Posts

Showing posts from September, 2013

azure - Diagnosing MobileServiceInvalidOperationException -

Image
i'm calling azure mobile service windows phone 8 emulator. receive mobileserviceinvalidoperationexception no innerexception property. in fiddler, see response contains 400 - bad request. no further details. how diagnose these problems? there server-side logging tools on azure mobile services aid me? i found answer myself. i'll share in case azure mobile services beginner looking this. on azure management portal, go mobile service. there "logs" tab records server-side errors. that's needed:

c# - No overload for 'ConnectWithFacebook_Click' matches delegate 'System.Windows.RoutedEventHandler' -

first of all, i'd establish i'm extreme n00b @ c#, i'm trying learn of intermediate example. i found tutorial create facebook application using fb c# sdk @ http://blog.prabir.me/post/facebook-csharp-sdk-writing-your-first-facebook-application-v6.aspx . in tutorial, has used winforms, wanted courageous , made same program wpf. i face problem see has happened many users, couldn't figure out how can fix code. receive error shown below: no overload 'connectwithfacebook_click' matches delegate 'system.windows.routedeventhandler' i don't syntax errors, when start program, error appears (i think that's call runtime error?). double click error, points wpf code. here's wpf code: <button x:name="connectwithfacebook" content="connect facebook" horizontalalignment="left" padding="10, 5" margin="520,10,0,0" verticalalignment="top" background="#ff3782dc" foreg

sql - How do you let users share one database file in android development? -

i developing android application users can upload own recipes. so, need create 1 database file , let users share file. possible? googled uploading database file on server , letting application manipulate file did not find answer. appreciated. you need setup sql database on web server , apps make http request query database, better yet, make php script accesses db (much easier) , displays relevant results, use jsoup in android , parse php script information need.

node.js - Express Socket.io example server not working -

i'm trying learn socket.io , example express isnt working. heres code: app.js: var express = require('express') , routes = require('./routes') , user = require('./routes/user') , server = require('http').createserver(app) , path = require('path') , io = require('socket.io').listen(app); var app = express(); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.favicon()); app.use(express.logger('dev')); app.use(express.bodyparser()); app.use(express.methodoverride()); app.use(app.router); app.use(require('less-middleware')({ src: __dirname + '/public' })); app.use(express.static(path.join(__dirname, 'public'))); server.listen(3000); app.get('/', function (req, res) { res.sendfile(__dirname + '/index.jade'); }); io.sockets.on('connection', function (socket) { socket.emit('news', { he

javascript - Find out where Node is freezing? -

i'm setting passport authenticate via ldap (using passport-ldap ) , whenever user fails log in, loads failuredirect link. however, if log in (or think) program hangs. there aren't errors received; browser seems it's loading ("waiting server..."). there way see passport freezing without going through entire trace of functions called , putting console.log statement in each function? in routes: app.post('/users/session', passport.authenticate('ldap', { failureredirect: '/login_fail', successredirect: '/admin' }), users.session) in passport.js file: var ldapstrategy = require('passport-ldap').strategy [...] passport.use(new ldapstrategy({ server:{ url: 'ldap://[my_url]:3268', }, base: '[hidden]', search: { filter: "(&(objectclass=user)(samaccountname={{username}}))", } }, function(user, done) { console.log("success") return don

MySQL how to select on multiple tables using Not Exist -

i have 3 tables. 1 table of deletion candidates. table created criteria, did not include couple of factors consideration (limitations of system). other 2 tables created considering "left out" factors. so, need run select query on these 3 tables come deletion list. what started is: select inactive.id inactive, renamed, returned not exists (inactive.id = remamed.id , inactive.id = returned.id) but giving me error. can point out error here? thank you it's not entirely clear trying here. i assume want list of rows inactive table not exist in either renamed table or inactive table. right? if can use query this: select inactive.id inactive not exists (select null renamed renamed.id = inactive.id) , not exists (select null returned returned.id = inactive.id)

why does maven goes and downloads same jars all the time from the remote repo -

when start: mvn validate -dmaven.repo.local=c:\my\.m2\repository dependency:resolve i got list of jar downloading. downloading: http://nexus-bla-bla.com:8081/nexus/content/groups/release/junit/junit/4.8.2/junit-4.8.2.pom then next time repeat step , maven again downloading same pom/jar so, spend 2 minutes time though there nothing download actually. why happens? should download deps local repo when it's necessary only?

source code for text summarization by java -

my project requires text summarizer. there source code in java ? or if must build myself, there book on subjects? you have build text summarizer yourself. although there libraries, api's , software text summarizer can maybe check them out see if useful. here website found describes 30+ text summarizer libraries, api's , software: http://blog.mashape.com/post/58164039983/list-of-30-summarizer-apis-libraries-and-software hope helps. luck.

sql server - Concatenate a single column into a comma delimited list -

this question has answer here: concatenate many rows single text string? 38 answers i've seen multiple examples of people rolling single column comma delimited list, need bit more. here example of data , results need. declare @salesperson table (salespersonid int, salespersonname varchar(10)) declare @region table (regionid int, regionname varchar(15)) declare @salespersonregion table (salespersonid int, regionid int) insert @salesperson (salespersonid, salespersonname) values (1,'jeff') insert @salesperson (salespersonid, salespersonname) values (2,'pat') insert @salesperson (salespersonid, salespersonname) values (3,'joe') insert @region (regionid, regionname) values (1,'north') insert @region (regionid, regionname) values (2,'south') insert @region (regionid, regionname) values (3,'east') insert @regi

javascript - XPath query against DocumentFragment -

i need dom surgery on documentfragment , , i'm trying use xpath find nodes need modified. however, can't figure out how document.evaluate work on fragment. tried fragment.ownerdocument.evaluate( '//*', fragment.ownerdocument, null, xpathresult.any_type, null ) but did not work. use svg temp element if need run xpath against xml, since security restrictions prevent evaluating xpath expressions on element not attached dom: <!doctype html> <html lang="en"> <head> <title>xpath context</title> <meta charset="utf-8"> </head> <body> <svg id="model" version="1.1" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 100 100""> <?foo bar?> </svg> <script type="text/javascript;version=1.7"> function $xpath(axpath, acontext) { let nodes = []; acontext = document.getelementbyid("model

osx - Octave output buffer completely messed up on OS X. How to fix? -

Image
i have installed octave 3.6 version on macbook. uses emacs default editor, seems regular emacs keys (such c-x c-c exiting) doesn't work in octave emacs. also, output buffer gets messed when try use octave. also, prints prompt when i'm in emacs. (see picture below) it seems it's parsing input in editor on fly. have no idea how every happen. can tell me problem , how fix it? my guess end running emacs comes bundled mac os x (an old version of emacs works in text mode) , want change installing more recent version can run in gui. that's wild guess.

listener - In Android how do you get an activity to continually listen for a message from a server? -

i've tried searching around , can't find answer makes sense. basically when activity first starts should connect server , continually listen message. when gets it, it'll parse , if it's particular message, close connection , other stuff. should able close if user pushes button. i tried searching around , can't tell if should use servlets or services or (edit: or how use them). know needs on it's own thread. so should use? edit: i'm not sure how use servers/services/etc. make happen an intentservice you're gonna want. it's easiest implement , it's perfect network operations. automatically handles running service in own thread. once establish connection server, should stay open until respond message server.

Sharing Session between ServiceStack in an MVC app and separate Web services project -

i have mvc powerpack web app has minimal servicestack configuration talks separate servicestack web project acts api. in other words, of services, auth, , registration coming services project, not mvc project. in mvc project have controllers inheriting servicestackcontroller , using customusersession shown in socialbootstrapapi demo. i wondering best approach allow me share session information between 2 projects. able decorate controllers [authenticate] attribute , use servicestack authentication in mvc app well. i have looked @ various examples, mentioned socialbootstrapapi app - of examples show servicestack configured in 1 project. how can implemented separate projects can share session info between 2 , access customusersession while @ same time being able use [authenticate] tags lock down controllers? if 2 applications on same domain should able read same auth cookies. if on 2 separate domains have implement kind of single sign-on process / handshake. i not s

jQuery trigger mouseenter not working in Internet explorer 8 -

i tried trigger mouseenter event manually using $("element").trigger("mouseenter"). works fine in browser except ie8. <html><head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> <meta charset="utf-8"> </head> <body> <div id="box" style="border:5px solid red;width:100px;height:100px"> </div> <script> $(function(){ $("#box").mouseenter( function(event){ console.log("mouseenter triggered!!"); }); $("#box").trigger("mouseenter"); //$("#box").mouseenter(); }); </script> </body></html> ie8 not have lot of support newer versions of jquery. know jquery says isn't true. try using older library, before jquery 1.6. add browser detection function switch between 2 libraries. --e

python - Efficiency of infinite loop to service GPIO -

i'm using python on raspbian (a type of linux) on raspberry pi (an embedded processor board) monitor gpio inputs. see simplified version of code below. have infinite loop in python script waiting happen on gpio i/p. correct way it? i.e. mean cpu running @ full whack going round loop, leaving no cpu cycles other stuff? need running other things in parallel (e.g. browser). also happens if cpu busy doing else , gpio i/p changes? gpio event stored somewhere serviced, or lost? is there better way of doing this? (for answers, please note i'm new linux, , v. new python , real-time programming) #!/usr/bin/python import rpi.gpio gpio gpio.setmode(gpio.board) gpio.setup(16, gpio.in, pull_up_down=gpio.pud_up) def buttonhandler(channel): print "button pressed " + str(channel) # stuff here gpio.add_event_detect(16, gpio.falling, callback=buttonhandler, bouncetime=200) while true: pass yes, doing while true: pass burn 100% of cpu (or close pos

php - Match Timestamp With Current Date For An Event Calendar -

i having trouble displaying event on calendar correct date. this code far: $timestamp = mktime(0,0,0,$cmonth,1,$cyear); $maxday = date("t",$timestamp); $thismonth = getdate ($timestamp); $startday = $thismonth['wday']; $queryevent = "select * myweekevents date = '$timestamp' "; $resultevent = mysql_query($queryevent); $rowevent = mysql_fetch_assoc($resultevent); i not able display event's information correct date. format date on database y-m-d. why not matching timestamp? mktime(0,0,0,$cmonth,1,$cyear); returns raw timestamp value means of number. please format date this: $rawtime = mktime(0,0,0,$cmonth,1,$cyear); $timestamp = date( "y-m-d", $rawtime );

Haskell List Generator -

i've been working problems (such pentagonal numbers ) involve generating list based on previous elements in list. can't seem find built-in function of form want. essentially, i'm looking function of form: ([a] -> a) -> [a] -> [a] where ([a] -> a) takes list far , yields next element should in list , a or [a] initial list. tried using iterate achieve this, yields list of lists, each successive list having 1 more element (so 3000th element have (list !! 3000) !! 3000) instead of list !! 3000 . if recurrence depends on constant number of previous terms, can define series using standard corecursion, fibonacci sequence: -- fibs(0) = 1 -- fibs(1) = 1 -- fibs(n+2) = fibs(n) + fibs(n+1) fibs = 1 : 1 : zipwith (+) fibs (tail fibs) -- foos(0) = -1 -- foos(1) = 0 -- foos(2) = 1 -- foos(n+3) = foos(n) - 2*foos(n+1) + foos(n+2) foos = -1 : 0 : 1 : zipwith (+) foos (zipwith (+) (map (negate 2 *)

javascript - AngularJS Service for XHR -

i trying create service in angularjs fetch me json data website. wrapped service in factory method shown below app.factory('httpservice', function($http) { delete $http.defaults.headers.common['x-requested-with']; return { getdata : function() { var url = "http://www.reddit.com/.json?callback=json_callback"; return $http.jsonp(url).then( function(result) { return result; }); } } }); the problem i'm coming across receive error uncaught syntaxerror: unexpected token : . when use get() instead of json() 501 /cors error. the urls trying fetch data are: http://api.4chan.org/b/1.json http://www.reddit.com/.json following link jsfiddle rest of code. http://jsfiddle.net/fatgamer85/adpue/3/ does 1 has idea on how solve this? edit: have managed data , solved issue. sza following code i've used if anyone's interested var myapp = an

jquery looping array of arrays on $.ajax request -

i have ajax request polling server every 5 seconds returns json array of data available users shopping carts contents. the json correctly formed , being returned everytime without problem. json [ { "status": "success", "responsecode": "00", "data": [ { "partnumber": "part 1", "status": "true", "quantity": "4", "productid": "item-1", "name": "product 2", "online": "1" }, { "partnumber": "part 2", "status": "false", "quantity": "0", "productid": "item-2", "name": "product 2",

wordpress - jQuery accordion content renders before accordion -

the problem content jquery accordion renders before accordion. while occurs short time messy , execute perfectly. i've researched , have found few similar issues reported. i'm looking suggestions on possible causes type of problem. realize question vague @ moment i'm out of ideas possible causes. to see effect got page , click on image watch next page renders. see, fleetingly admittedly, list of contents before covered accordion. additional information: this symptom inconsistent. page renders not. the content created wordpress template. can't see why make difference. this refered fouc (flash of unstyled content), , solution knowledge --when dealing jquery fouc-- hide element with css when it's not yet styled, , show jquery when think flash has finished. sometimes don't see fouc, it's because browsers grabs js files cache , styles fast, there no network delay. similar situation

ipad - Hide iOS Keyboard, but allow user to move cursor around -

i'd allow user move cursor around uitextarea tapping can do, don't want keyboard show. is there method can override make possible? if don't want show keyboard , cursor return no , @ end of - (bool)textfieldshouldbeginediting:(uitextfield *)textfield { /// stuff; return no; } another option: uiview* dummyview = [[uiview alloc] initwithframe:cgrectmake(0, 0, 1, 1)]; mytextfield.inputview = dummyview; add uiview (dummyview) uitextfield 's inputview . this not return keyboard display blinking cursor.

Parsing simple JSON to android -

Image
having problem parsing json data android i have descriptively mentioned problem facing, ideas on how overcome this initially have used json url url:: http://54.218.73.244:8084/ jsonparser.java public class jsonparser { static inputstream = null; static jsonarray jobj = null; static string json = ""; // constructor public jsonparser() { } public jsonarray getjsonfromurl(string url) { // making http request try { // defaulthttpclient defaulthttpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(url); httpresponse httpresponse = httpclient.execute(httppost); httpentity httpentity = httpresponse.getentity(); = httpentity.getcontent(); } catch (unsupportedencodingexception e) { e.printstacktrace(); } catch (clientprotocolexception e) { e.printstacktrace(); } c

bash - Interchanging two programs inputs and outputs -

the title of question rather misleading, not find better title it. the rephrased title "i want program x's output program y's input , program y's output program x's input. program x start giving output, while program y start accepting input." program x stdout --> <program y>stdin stdin --> <program y>stdout any help? you can named pipe : mkfifo xy_pipe ./program_x < xy_pipe | ./program_y > xy_pipe a regular pipe used connect x's stdout y's stdin. to connect y's stdout x's stdin create second, named pipe using mkfifo . named pipe explicit way connect 2 processes way | does. whenever process writes named pipe blocks until process reads pipe. although xy_pipe appears file, no data written disk. example: $ cat program_x #!/bin/bash echo foo read line && echo "program_x: read '$line'" >&2 $ cat program_y #!/bin/bash read line && echo &qu

vbscript - How to redirect a person to a website after prompting? -

i want redirect person when clicks "yes" on x=msgbox("message description",4+16,"title") after he/she clicks "yes" redirected www.google.com, , if click "no" .vbs exit. this me alot you try this x = msgbox ("blah blah", vbyesno, "title") if x = vbyes location.href = "www.google.com" end if

javascript - Load .js file from wordpress plugin -

i'm trying load .js file wp plugin. the code load jquery, jquery-ui , .js file this, , located inside "main" plugin file: //load java , jquery function load_jquery() { // use method we're not in wp-admin if (!is_admin()) { // deregister original version of jquery wp_deregister_script('jquery'); wp_deregister_script('jquery-ui'); wp_deregister_script('lyox-script'); // discover correct protocol use $protocol='http:'; if($_server['https']=='on') { $protocol='https:'; } // register google cdn version wp_register_script('jquery', $protocol.'//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', false, '1.10.2'); wp_register_script('jquery-ui', $protocol.'//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', false, '1.10.3');

PHP __get magic method unexpected behaviour -

i have following classes. class book { protected $name; protected $cost; protected $description; public function __construct(){ $this->name = 'the x'; $this->cost = 19.95; $this->description = 'something x'; } public function __get($variable){ return $this->$variable; } } class readerabstract { protected $_book; public function __construct(){ if(null == $this->_book){ $this->_book = new book(); } } public function __get($variable){ $method = 'get'.ucwords($variable); if(method_exists($this, $method)){ return $this->$method(); } return $this->getbook()->__get($variable); } public function getbook(){ return $this->_book; } } class reader extends readerabstract { public function getcost(){ return round($this->cost, 2); //retu

java - Need help on NoClassDefFound error -

i'm working on service prepare spreadsheet report. i'm using jxl-2.4.2.jar achieve ( please note can't use latest version due compatibility constraints). when execute code locally on eclipse works fine. eclipse has java 1.5. when deploy code in test environment, giving noclassdeffound error jxl.* ( classes in jxl ). test environment has ibm's java 1.5. believe doesn't make difference if use ibm's version or sun's version of java in context. i believe error happen when jvm fails load class @ runtime or if class has static methods/properties. checked classes , none of them have static contents. so, else. fyi.. i'm using ant build project & check build.xml. showing correct version of java 1.5. please fix error? fyi.. project resides on aix 5.0 server. any in regard much appreciated . in advance. this error implies dependency missing @ runtime i.e. set of dependent jars not not correct. jxl-2.4.2.jar not getting shipped along dep

java - interpreting jstack output -

i have java process loading lot of data bunch of .csv files neo4j database using batchinserter . using: openjdk 7 ubuntu 12.04 neo4j 2.0 m3 after loading first 164 gb (according ls -lh ) folder size stopped increasing process kept running, no memory released, , cpu still @ 100% (all according htop ). the loading process single threaded, jvm using more 1 thread - guess parallelgc . i'm not sure how diagnose type of problem instructed try jstack , have included output below. anyone has idea went wrong or has suggestions on how can go diagnosing this? full thread dump openjdk 64-bit server vm (22.0-b10 mixed mode): "attach listener" daemon prio=10 tid=0x00007fc3a4001000 nid=0x5636 runnable [0x0000000000000000] java.lang.thread.state: runnable "service thread" daemon prio=10 tid=0x00007fcf58123000 nid=0x4545 runnable [0x0000000000000000] java.lang.thread.state: runnable "c2 compilerthread1" daemon prio=10 tid=0x00007fcf58120800

codeigniter - How to access the session variables from the add.php in grocery crud? -

i modified add.php in grocery crud , add iframe shows image crud. need add conditional statement iframe show specific tables only. set flag in controller this. , problem dont know how access session because $this->session->userdata('isuploadvisible'); will generate error severity: notice message: undefined property: grocery_crud::$session filename: views/add.php line number: 2 this add.php 1 can found in assets/grocery_crud/themes/datatables/views/add.php you use $this somewhere refers this grocery_crud class. try this: $ci =& get_instance(); $ci->session->userdata('isuploadvisible');

SQL Query - Finding Current log file usage for one database -

i want set monitoring software generate smnp trap if database log file goes beyond 95% usage. can @ first result in first column of sql query, i'm looking sql query return percentage figure in result - eg, 95 i've found several different ways of doing similar things, return table heading etc, whereas want figure. it'll running query every hour nothing intensive. i'm running sql version 8. thanks, mike you write query against os dmvs single value you're looking for. not sure if work sql server 2000, know works far sql server 2005. requires performance counters enabled on host server (i.e. os, not sql server). this query should trick: select cntr_value percentused sys.dm_os_performance_counters counter_name = 'percent log used' , instance_name = 'your_database_name'

getelementbyid - How to target all classes with javascript. No jQuery -

i writing responsive program keeps changing width of sertain elements, corresponding other elements have % based width. works fine. ran problem when wanted change images in side div big grand parent of images. js: var thebigone = document.getelementbyid('imgpresentation'); var demimages = document.getelementsbyclassname('presentatinthis'); fixtheresponsiveness = setinterval(fixthis,1000); function fixthis() { demimages.style.width = thebigone.offsetwidth+"px"; } fixtheresponsiveness(); html: <div id="imgpresentation" class="imgpresentation"> <div id="slidethemimgpresentation" class="slidethemimgpresentation"> <img class="presentatinthis" src="img/billeder/xyachtvisit/xyachtbesoeg1.jpg"/> <img class="presentatinthis" src="img/billeder/xyachtvisit/xyachtbesoeg2.jpg"/> <img class="presentatinthis" src=&

apache2 - SVN: 404 Error when trying to revert to previous revision -

some time ago set debian svn server , far works without problems. yesterday had trouble commiting changes , wanted revert revision revisions ago, didn't work. first time tried this, don't know if worked @ time. i managed solve commiting-issue still can't revert. can revert recent changes, when want go revisions 404 error. i'm using tortoise in client side , not find information issue. does know issue? thanks in advance! edit: additional information: svn-client: 1.8.1 svn-server: 1.6.17 the committing-trouble mentioned couldn't commit because got "out of date" error, if affected files new. solved making backup of parent directory , deleted it, updated , commited, re-added directory , committed again. the exact error when try revert revisions is: repository moved temporarily ' https://url.ofmyserver.com/errors/404.html '; please relocate after weeks of desperation , getting crazy managed solve problem!! th

c++ - Force a returned const value to move not copy -

i know ok: struct foo { foo& operator=( foo& ) = delete; // disallow assign foo( int ) { } // basic constructor foo( const foo& ) = delete; // disallow copy foo( foo&& ) { } // allow move }; foo getfoo( void ) { return foo( 3 ); } foo foo = getfoo( ); // uses move constructor whereas use copy constructor, , therefore invalid foo (and object with copy constructor, valid inefficient): const foo getconstfoo( void ) { return foo( 3 ); } const foo constfoo = getconstfoo( ); // error: copy constructor deleted! but ok: (and extend life of constfooref ) const foo& constfooref = getconstfoo( ); // uses move constructor now, second case call foo( const foo&& ) { } if it's available. know if there's way detect final object const inside constructor. if there is, can apply move semantics (since both involved objects const , parameter isn't being used elsewhere it's

c# - XML comments - refer to property in class -

how describe in xml comments property encoding intiliaze default. public class settings { public encoding encoding{get;set;} /// <summary> /// initialize new instance of <c>httprequestsettings</c> type. /// </summary> /// <remarks> /// <para> /// how refer property encoding in class , describe property encoding set default ???? /// </para> /// </remarks> public settings() { encoding = encoding.default; } } use: /// ... /// constructor sets <see cref="encoding"/> default value. /// ... does lead problems? believe member (property) should have higher "priority" type (class) not nested in current class.

How to replace tags with a javascript function from beginning to end? -

here problem, while using replace javascript function in order replace html tags bbcode tags, encountered issue: what wanted: [b]some text[/b], [b]other text[/b]. what i've got: [b]some text</b>, <b>other text[/b]. this way wrote this: mystring.replace(new regexp('<b>(.*)</b>','gi'),'[b]$1[/b]'); i know example replace way: mystring.replace('<b>','[b]').replace('</b>','[/b]'); but thing want use divs specific id... if replacing opening , ending tags separately, wouldn't able replace '</div>' properly. is there way have function run through string "linearly", beginning end, rather extremities towards center ? (my biggest problem not able formulate question properly, hence lack of results while searching web.) thank input may provide.

android - How to start activity Language and input -

i want open (start) activity named: "language , input", user can change device language. startactivity(new intent(locale....)); it's in locale or... settings? it? try this intent intent=new intent(android.provider.settings.action_input_method_settings); startactivity(intent);

sql - Rails has_and_belongs_to_many find unique objects in common -

i have 2 models, conversation , phones, both of has_and_belongs_to_many each other. phones can have lot of conversations, , conversations can have lot of phones (two or more). class conversation < activerecord::base has_and_belongs_to_many :phones end class phone < activerecord::base has_and_belongs_to_many :conversations end of course, there's conversations_phones join table well. if have 2 or more phone objects, how find list of conversations share? catch: conversations can't include other phones (ie number of phone ids equals number search with). i've been able pure rails, involves looping every conversation , counting on db. not good. i don't mind doing pure sql; using model ids should stop injection attacks. the closest i've come is: select conversations.* conversations inner join conversations_phones t0_r0 on conversations.id = t0_r0.conversation_id inner join conversations_phones t0_r1 on conversations.id = t0_r1.conversation_id

jquery - Div height dynamically -

i have html code: <div id="container"> <div id="feedbackbox"></div> </div> the #feedbackbox div doesn't appear in, initially. the css centralize div: #container { position: absolute; width: 380px; height: 360px; left: 50%; top:50%; padding: 30px; margin-left: -220px; margin-top: -210px; } but need change height of #feedbackbox via jquery. i tested , doesn't work: .expandinfo { height: 500px; margin-top: -221px; } $("#container").removeclass().addclass('expandinfo'); but doesn't work! css class doesn't apply, less has been re-done (the calculation) div remains centralized. the height not change, because of different selector priorities. ( http://www.w3.org/wiki/css/training/priority_level_of_selector ) you set height #container by id . height .expandinfo defined by class . in css id-selector has higher priority class-selector. try that: #conta

java - Drools: Why does this rule fire incorrectly? -

my drl is: rule "active orders" dialect "mvel" //no-loop when m: order( status == order.enabled, id : id ) system.out.println( "order id is: " + id ); modify ( m ) { status = order.disabled }; end i pass single order instance drools this: order order = new order(); order.setid(100); order.setstatus( order.enabled ); ksession.insert( order ); ksession.fireallrules(); i seeing rules fired infinitely message: order id is: 100 order id is: 100 order id is: 100 ..... i can understand infinite-loop, key thing setting order status disabled in modify block: status = order.disabled therefore, when rule fired again....the when condition i.e status == order.enabled , should not satisfied, , should not see system.out.println message more once. any idea, doing wrong? (pls note: problem not infinite loop, why rule evaluated incorrectly after object modification) the s

html - CSS Gradient Background Stripes instead of Smooth gradient -

Image
i trying achieve following css background effect in following page . however, instead of getting smooth gradient, image shown below. my css: body{ background:-webkit-radial-gradient(#205983, #0a2742); background:radial-gradient(#205983, #0a2742); overflow:hidden; } i want achieve same result. have no other css body. from chrome inspector (for body element) background: -webkit-radial-gradient(#205983, #0a2742); background: radial-gradient(#205983, #0a2742); overflow: hidden; i've checked both pages on same browser , don't use css reset code. how can achieve same results. thanks. the example page provided works fine here in google chrome (v. 28.0.1500.95 m). i've inspected site's source. css use is: #wrap { min-width: 600px; height: 100%; position: relative; background: -webkit-radial-gradient(#205983, #0a2742); background: radial-gradient(#205983, #0a2742); overflow: hidden; } did try using same css rules on site? m

java - Why does T extends Comparable <? super T> include T? Meaning includes Comparable<T>? -

class binarysearch<t extends comparable<? super t> > why t extends comparable <? super t> including t , meaning including comparable<t> , not super class hierarchy? confused on super keyword thought super include super class items. new java , in java book had following example: this regarding method in class trying limit upper , lower bound of hierarchy using java.awt.component class had extends container class customcomponent<t extends container> in class have following method void describecomponent<customcomponent<? super jpasswordfield> ref) and goes on note jpasswordfield, superclass of jtextfield, omitted in list of permissible objects. from lower bounded wildcards , section of generics section of the java tutorial : ... lower bounded wildcard restricts unknown type a specific type or super type of type. (bold mine, emphasis theirs) thus, set of classes match t extends comparable<t> subset of

python - Define node with a unique property in neo4django -

i've defined graph structure in project contains 2 type of nodes: user , post. have installed neo4django on django framework , define models.py below: from neo4django.db import models class user(models.nodemodel): #firstname of user registered in first time firstname = models.stringproperty(max_length=20) #lastname of user registered in first time lastname = models.stringproperty(max_length=20) #password of user selected user password = models.stringproperty(max_length=50) #email use verification email = models.emailproperty() #status of user can 1 online , 0 offline status = models.booleanproperty() #date of birth user selected register form #birthdate = models.dateproperty() #sex of user can male , female (0=male,1=female) gender = models.booleanproperty() i want use email address , password login email must unique in database. how can in models.py? you can pass unique=true property subclass. uniqu

Connecting to MySQL in AutoPlay Media Studio -

i wanna connect mysql database on host through ams 8 database remote open , added % in remote mysql allow ip access db can give me simple code??? you must first enable databse support in ams project. after you'll mysql lua's representive commands binded in action menu. chunk connecting db this mysqlconnection, err = mysql:connect("database", "user", "pswd", "localhost", "port");

Mysql sortation on multiple LIKE's -

there lot of topics on sortation (like: order results occurrence ) these 1 value. i have search field people use keywords; said queries generated like: 1 word: select * `meta` (`keywords` '%bike%') 2 words: select * `meta` ( `keywords` '%bike%' or `keywords` '%yellow%' ) etc... what sort result on found keywords. how unknown amount of keywords like's here general way sort number of keyword matches in mysql (using like ): select * `meta` order ((`keywords` '%bike%') + (`keywords` '%yellow%') + . . . ) desc; if want handle flexible number of keywords, should use appropriate relational data structure. storing keywords in single field (probably comma-separated) not best approach. should have separate table 1 row per keyword. edit: to add in number of keywords found, expression can put in select statement: select m.*, ((`keywords` '%bike%') +

python - creating tables from different models with sqlalchemy -

Image
i have different models e.g. model1.py, model2.py etc. how tables being created following pocoo link , required invoked terminal. but def init_db(): import model.model1 import model.model2 base.metadata.create_all(bind=engine) this not working, rather requires invoked terminal. >> database import init_db >> init_db() #works database.py from sqlalchemy import create_engine sqlalchemy.orm import scoped_session, sessionmaker sqlalchemy.ext.declarative import declarative_base engine = create_engine('sqlite:///xyz.sqlite', echo=true) db_session = scoped_session(sessionmaker(autocommit=false, autoflush=false, bind=engine)) base = declarative_base() base.query = db_session.query_property() def init_db(): import model.admin # model.admin import user doesnt either import model.role base.metadata.create_all(bind=engine) if __name__ == '__ma

postgresql - Combine SUM and CAST - not working? -

postgresql unicode 9.01 doesn't like: select table1.fielda, sum (cast (table2.fielda int)) header.specific *etc* what wrong sum-cast? error message: incorrect column expression: 'sum (cast (specifics_nfl_3pl_work_order_item.delivery_quantity int)) query: select specifics_nfl_3pl_work_order.work_order_number, specifics_nfl_3pl_work_order.goods_issue_date, specifics_nfl_3pl_work_order.order_status_id, sum (cast (specifics_nfl_3pl_work_order_item.delivery_quantity int)) units public.specifics_nfl_3pl_work_order specifics_nfl_3pl_work_order, public.specifics_nfl_3pl_work_order_item specifics_nfl_3pl_work_order_item, public.specifics_nfl_order_status specifics_nfl_order_status specifics_nfl_3pl_work_order.order_status_id in (3,17,14) , specifics_nfl_3pl_work_order_item.specifics_nfl_work_order_id= specifics_nfl_3pl_work_order.id , ((specifics_nfl_3pl_work_order.sold_to_id<>'0000000000') , (specifics_nfl_3pl_work_order.goods_issue_date>={d &#

mvvmcross - Error installing Simple.Odata via nuget on a PCL -

i have pcl targeting .net 4.5, silverlight 4+, windows phone 7.5+, .net windows store apps, mono android , monotouch i attempting install simple.odata via nuget , getting error below. have tried many different combinations, nothing seems able pull down library. main goal develop android , touch using mvvmcross , odata services. pm> install-package simple.odata.client installing 'simple.odata.client 0.16.0'. installed 'simple.odata.client 0.16.0'. adding 'simple.odata.client 0.16.0' emc.mobile.core. uninstalling 'simple.odata.client 0.16.0'. uninstalled 'simple.odata.client 0.16.0'. install failed. rolling back... install-package : not install package 'simple.odata.client 0.16.0'. trying install package project targets 'portable-win+net403+sl40+wp', package not contain assembly references or content files compatible framework. more information, contact package author. @ line:1 char:1 + install-package simple.odata.clie

javascript - Ember.js - Getting routes and models working together -

i'm learning ember.js i'm struggling figure out why routes aren't working properly. here relevant parts of app.js: // routes app.router.map(function() { this.resource('posts', { path: '/posts' }); this.resource('post', { path: '/post/:id' }); }); // handle route posts list app.postsroute = ember.route.extend({ model: function() { return app.post.findall(); } }); // handle route single post app.postroute = ember.route.extend({ model: function(params){ return app.post.findbyid(params.id); } }); // post model app.post = ember.object.extend(); app.post.reopenclass({ findall: function(){ var posts = []; $.getjson("/api/posts").then(function(response){ response.posts.foreach(function(post){ posts.pushobject(app.post.create(post)); }); }); return posts; }, findbyid: function(id){ $.get

javascript - JQuery toggle images CSS -

i using jquery change css of images. it works , changes image css size when clicked. issue when click on next image, previous image stays new css toggle. is there way when click on next image, previous image goes original css. i have included jsfiddle example here: http://jsfiddle.net/webdott/hsfpp/ here jquery code: $('img').click(function() { $(this).toggleclass('thumb fullview') }); you can see each image click stays large. thanks check fiddle. solved issue. please check fiddle http://jsfiddle.net/resey/1/ $('img').click(function() { $(this).toggleclass('fullview').siblings().removeclass('fullview'); });

ruby - After deploying rails app to Heroku, no dropdowns -

after deploying rails app heroku, there no dropdown menus! when running locally, source looks : <link href="/assets/application.css?body=1" media="screen" rel="stylesheet" /> <link href="/assets/jquery.ui.core.css?body=1" media="screen" rel="stylesheet" /> <link href="/assets/jquery.ui.theme.css?body=1" media="screen" rel="stylesheet" /> <link href="/assets/jquery.ui.accordion.css?body=1" media="screen" rel="stylesheet" /> <link href="/assets/jquery.ui.menu.css?body=1" media="screen" rel="stylesheet" /> <link href="/assets/jquery.ui.autocomplete.css?body=1" media="screen" rel="stylesheet" /> <link href="/assets/jquery.ui.button.css?body=1" media="screen" rel="stylesheet" /> <link href="/