Posts

Showing posts from August, 2013

swing - change layer depth in JLayeredPane java -

Image
i'm using jlayeredpane draw several layers, each layer has different depth question is: how can change layer depth @ run time? need change depth of previewmap 0 1, , depth of mapcontrolpanel 1 0

google app engine - How to query with a list object on repeated string property in ndb -

with google app engine, use ndb manange data. have entity use repeated string property save list of string values. how can query list object equal property value? what meant is, entity is class question(ndb.model): question = ndb.stringproperty(required=true) choices = ndb.stringproperty(repeated=true) and want query this: question = "the question" choices = ["choice1", "choice2", ..., "choice6"] question.query(question.question==question, question.choices==choices) when have repeated property, there no way perform query searching exact equality of list. for example, question entity with: question = "a question" choices = ["a", "b", "c"] will match all of following query question.query(question.choices=="a") question.query(question.choices=="b") question.query(question.choices=="c") solution 1: computed property if want write query en...

ios - Only black screen in my UIWebView -

i have 2 view controllers. in first 1 have button , when click need display web page in second view controller. when click button, see black screen. here tabulkaviewcontroller.m code: #import "tabulkaviewcontroller.h" #import "webviewcontroller.h" @interface tabulkaviewcontroller () @end @implementation tabulkaviewcontroller - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if (self) { // custom initialization } return self; } - (void)viewdidload { [super viewdidload]; // additional setup after loading view. _hbutton.layer.borderwidth = 1; _hbutton.layer.bordercolor = [[uicolor graycolor] cgcolor]; } - (ibaction)hbutton:(id)sender { nsurl *url = [nsurl urlwithstring:@"http://apple.com"]; webviewcontroller *webviewcontroller = [[webviewcontroller alloc] initwithurl:url andtitle:@"apple...

haskell - Finding list entry with the highest count -

i have entry data type data entry = entry { count :: integer, name :: string } then want write function, takes name , list of entry s arguments give me entry s highest count. have far is searchentry :: string -> [entry] -> maybe integer searchentry _ [] = nothing searchentry name1 (x:xs) = if name x == name1 (count x) else searchentry name xs that gives me first entry function finds, want entry highest count. how can implement that? my suggestion break problem 2 parts: find entries matching given name find entry highest count you set as entriesbyname :: string -> [entry] -> [entry] entriesbyname name entries = undefined -- use maybe since list might empty entrywithhighestcount :: [entry] -> maybe entry entrywithhighestcount entries = undefined entrybynamewithhighestcount :: string -> [entry] -> maybe entry entrybynamewithhighestcount name entires = entrywithhighestcount $ entriesbyname name entries al...

Retrieve data-descr attribute using jquery to use in Fancybox thumbnail -

<div class="shirt-thumb"> <a href="../wp-content/uploads/2014/05/icelandic-logo2.png" class="fancybox fancybox-thumb" rel="shirt1" title="shirt"> <img src="../wp-content/uploads/2014/05/icelandic-logo2.png" data-descr="shirt 1 back" /> </a> </div> above html. trying grab data-descr attribute , add fancybox thumbnail in jquery can apply css style ::after element. need descriptions appear below each thumbnail. i'm understanding, there isn't built in way this, apply title underneath fullsize image? this how variables thumbnail list items defined. 1 added thumbdescr, other 3 came fancybox: init: function (opts, obj) { var = this, list, thumbdescr = opts.description, thumbwidth = opts.width, thumbheight = opts.height, thumbsource = opts.source; below build of thumbnail list item. part loads fine: for (var n = 0;...

internet explorer - Jenkins crashing IE when trying to configure -

i'm trying configure system in jenkins, whenever try configure, ie stops working. other pages within jenkins work though. tried removing jenkins , reinstalling, still same problem here of details crash problem event name: appcrash application name: iexplore.exe application version: 10.0.9200.16866 application timestamp: 53211297 fault module name: mshtml.dll this known issue current versions of jenkins: jenkins-17825 known workarounds: use different browser enable compatibility mode in ie

javascript - Animate -> Slide to left not working jQuery -

i have div: "id1" , want slide "id2" i have button on <div id="id1"> has: <a href="#id2">next</a> and have script: $(function() { $('#next-button2').bind('click',function(event){ var $anchor = $(this); $('html, body').stop().animate({ scrollleft: $($anchor.attr('href')).offset().left }, 2000); event.preventdefault(); }); }); that took this site , not working, ideas why? your script looking bind animation function dom object id = next-button2 change html to: <a id="next-button2" href="#id2">next</a> so jquery can bind click function right dom object. also, you'll need make actual animation bind correct object, change: $('html, body') to: $('#id1') if want more in depth answer may want provide more html, js / jq, , css at.

javascript - A bar serie next to a stacked bar chart with flot charts -

Image
hi have stacked bar chart time series : but need yellow series next others : i not able keep 3 series stacked while having 1 not stacked , offset left. tried different things none of them works. adding when declaring data did trick: data: thedata, stack:false, bars: {show: true, align: "right" }

javascript jquery deferred not working with worker? -

i have following javascript code: var promises = []; // entries contains unknown amount of items. sake of // sample, has five. $.each(entries, function() { promises.push(doprocessing()); }); return $.when.apply($, promises).done(function() { alert('success'); }).fail(function() { alert('failed'); }); if doprocessing function is: function doprocessing() { var def = $.deferred(); settimeout(function () { console.log('request completed'); def.resolve(); },2000); return def.promise(); } // end of doprocessing i request completed log 5 times, followed 'success' alert. if change doprocessing method be: function doprocessing() { var def = $.deferred(); // worker has message myworker.onmessage = function(event) { console.log('worker finished'); def.resolve(); console.log(def); }; myworker.postmessage({action:'dosomething'}); return...

Kendo grid update - update click of any row shows 1st row details -

Image
i facing issue kendo grid inline editing, issue though update row, 1st row data displayed in grid, on this? before update after update. interestingly object return controller have correct data controller code [acceptverbs(httpverbs.post)] [validateantiforgerytoken] [actionsessionstate(system.web.sessionstate.sessionstatebehavior.required)] [outputcache(duration = 0, varybyparam = "none")] public actionresult _savebatcheditingintegrate([datasourcerequest] datasourcerequest request) { var upobj = sessionfacade.userprofile userprofile; try { integrationrate objinteg = new integrationrate(); tryupdatemodel(objinteg); if (objinteg.periodid != 0) { var integrationrate = (from p in _draftmanagecompany.integrationrates p.periodid == objinteg.periodid select p).first(); tryupdatemodel(integrationrate); if (integrationrate.ra...

html - Is it possible to include image in email as attachment using a cid and web server URL? -

i working on email signature sent outlook , outlook web client applied individuals in company using adolsign (a third party tool generates email signature based on ad information , html template). it needs contain logo. based on research, images linked directly web server below cause 2 problems. 1. blocked web clients security reasons , 2. unavailable when user has downloaded email , opens offline. <img src="http://www.myurl.com/myimage" width="142" height="30" > embedding image using svg or 64 bit encoded data tag doesn't work in outlook, not option. i believe using cid tag create , reference hidden attachment best option particular client, i'm struggling work using url. using network file path not great option won't resolve users sending emails web client. i'd use doesn't render when open in outlook: <img src="cid:http://www.myurl.com/myimage" width="142" height="30" > my hop...

angularjs - Writing units tests for a Angular Controller -

my controller looks angular.module('demo').controller('democtrl',['$scope','$modal', function($scope, $modal){ $scope.askforinput = function(action){ var modalinstance = $modal.open({ /* here open modal , display form input */ }); modalinstance.result.then(function(input){ /* process input here */ }); }; } the part confused how test code i.e test modal opened, form filled , data received in controller ? i using jasmine , stuck on first line itself. i wouldn't recommend testing $modal , instead democtrl , askforinput should do. when you're creating controller in test, can inject mock values $scope , $modal . because you're injecting mocks, have complete control on how behave. for instance, follows: // dependencies var $scope, $modal, controller; // test values var modalopeninput, modalinstance; beforeeach(module("demo")); beforeeach(inject(function($root...

iphone - IOS access a variable outside a block -

this question has answer here: how can access __block variable, after block has completed? [duplicate] 3 answers i have following: __block alassetsgroup* album = nil; alassetslibrary* library = [alassetslibrary new]; [library enumerategroupswithtypes: alassetsgroupalbum usingblock: ^ (alassetsgroup *group, bool *stop) { if (group) { nsstring* title = [group valueforproperty: alassetsgrouppropertyname]; if ([title isequaltostring: @"test1"]) { album = group; *stop = yes; nslog(@"sd%@", album.description); } } else { // afterwards self.images = [self showfirstphotoofgroup:album]; // (oreilly, programming ios 7, ch.17) nslog(@"a:%d",[_images count]); ...

php - Laravel returns Patchwork\\utf8\\Bootup error -

i have problem in laravel 4.1 project. executing on ubuntu 14.04. copied running instance of project ubuntu os. when refresh page on virtual host, blank page. , apache access logs return 500 error , error logs return following error: php fatal error: class 'patchwork\\utf8\\bootup' not found in /var/www/www.domain.com/bootstrap/autoload.php on line 46 what wrong in here? run composer update or composer install -- you're missing vendor packages.

Determining Mojarra Version on Glassfish Server -

i'm chasing jsf bug that's occurring in qa not locally. (both servers glassfish.) it's been suggested local version of mojarra may newer 1 being used on qa, explain behavior. how can figure out version of mojarra particular server running? access qa server limited, if know precisely tell our qa guy look, should able information need. this information printed in server.log if deploy jsf project. looks similar this: information: mojarra 2.2.6 ( 20140304-1537 https://svn.java.net/svn/mojarra~svn/tags/2.2.6@12949 ) context '/rest' initialized. per default these mojarra versions included in glassfish versions: glassfish 3.1.1: mojarra 2.1.3 (fcs b02) glassfish 3.1.2: mojarra 2.1.6 (snapshot 20111206) glassfish 3.1.2.2: mojarra 2.1.6 (snapshot 20111206) glassfish 4.0: mojarra 2.2.0 ( 20130502-2118 https://svn.java.net/svn/mojarra~svn/tags/2.2.0@11930 ) glassfish 4.1: mojarra 2.2.7 (20140610-1547 https://svn.java.net/svn/mojarra~svn/t...

regex - How can I match namespace prefixes with regular expression -

what want match namespace prefixes both tags , attributes using regular expression. for example: <foo:person bar:id="43"> text text <nomatch:free text <baz:name> text nomatch:free> text </baz:name> text nomatch:free="44" text <age bae:years="44" /> text </foo:person> what want extract following prefixes: foo, baz, bad, bae, bar i cannot find regular expression implementing this. please take account regular expression should not have hardcoded names foo, baz, bad, bae, bar... something this? [<]([^:]+) will put prefix (after angle bracket , before colon) group 1. i see misinterpreted question, after looking more closely. [<](((\w+):\w+)(\s+(\w+):\w+="\d+"\s*[\/])?)> which have result in groups $3 , possibly $5. think it. whoops, missed ? [<](((\w+):\w+)(\s+(\w+):\w+="\d+"\s*[\/]?)?)>

forms - Runtime Error 2147024809 (80070057): Could not find the specified object -

i ran issue project throwing me loop. project no longer recognizing 2 of 11 forms have been in existence virtually since program's inception. names of forms have not changed, nor has code calling forms changed. these 2 forms being called without issue , runtime error exists. 2 forms not coming anymore "vacation_days_form" , "vacation_holidays_form", code below explains. issue "holidays_form" userform, being called no data being outputted program. again, form working fine , not after no code pertaining form changed. 1 of main forms works code below "normal_iteration", embedded in module1 (not userform). below code: private sub userform_initialize() options .additem "no vacation or holidays" .additem "vacation" .additem "holiday" .additem "vacation & holidays" end end sub private sub vacation_options_select_click() vacation_options_form.hide ...

xml - Adding and Removing Xmlnode using Powershell -

i trying add , remove elements multiple xml files. ran 2 issue. removed empty elements automatically , second did not remove wanted to i have xml this <entity> <app> <item1>1</item1> <emptyitem/> <person> <itemtoremove>true</itemtoremove> <emptyitem/> <otheritem>1</otheritem> </person> <person> <itemtoremove>false</itemtoremove> <emptyitem/> <otheritem>3</otheritem> </person> <person> <itemtoremove>false</itemtoremove> <emptyitem/> <otheritem>3</otheritem> </person> </app> </entity> what want is <entity> <app> <item1>1</item1> <emptyitem/> <person> <emptyitem/> <otheritem>1</otheritem...

android - Parse XML data through DOM parser. -

i struggling many hours parse xml data. xml data: <?xml version="1.0" encoding="utf-8"?> <data> <status>200</status> <description>ok</description> <topcities> <city>ahmedabad</city> <city>bangalore</city> <city>chandigarh</city> <city>chennai</city> <city>cochin</city> <city>faridabad</city> <city>ghaziabad</city> <city>gurgaon</city> <city>hyderabad</city> <city>kolkata</city> <city>mumbai</city> <city>navi mumbai</city> <city>new delhi</city> <city>noida</city> <city>pune</city> <city>thane</city> </topcities> <othercities> <city>agra</city> <city>ahmednagar</city...

Taking vowels from string. Java -

i'm having trouble simple exercise. have take vowels string: astring. this return vowels string, whant is, if there 3 a, return one. example: string astring = "aaa eee iii"; the return should be: a e i this have reached. public static void getvowels(char achar, string astring){ system.out.print("your string has following vowels: "); (int = 0; < astring.length(); i++){ if ((astring.charat(i) == 'a') || (astring.charat(i) == 'e') || (astring.charat(i) == 'i') || (astring.charat(i) == 'o') || (astring.charat(i) == 'u')) { achar = astring.charat(i); system.out.print(achar + " "); } } } thx , sorry bad english. edit code follows: public static void getvowels(char achar, string astring) { system.out.print("your string has following vowels: "); string vowels=""; (int = 0; < astring.length(); i++) { ...

Glass Mirror API save attatchment image to server via PHP -

i using php quick start project example display timeline's attachment (image): <?php if ($timeline_item->getattachments() != null) { $attachments = $timeline_item->getattachments(); foreach ($attachments $attachment) { ?> <img src="<?php echo $base_url . '/attachment-proxy.php?timeline_item_id=' . $timeline_item->getid() . '&attachment_id=' . $attachment->getid() ?>" /> <?php } } ?> now need save image server can resize , use elsewhere. have tried few variations of file_put_contents, fopen, , curl seems attachment-proxy.php not returning image in format of these expect. how can save timeline attachment server? solution: based on prisoner's response took @ attachment-proxy.php file. returning image string. had unsuccessfully tried file_put_contents($img, file_get_contents("attachment-proxy.php....")); before. turns out don't need file_get_conte...

java - Stackoverflow while deleting an entity -

i using eclipse link , want delete entities clause. when doing stackoverflow error. here method use deleteting. wrong in ? entitymanager em = getentitymanager(); try { aclentry acle = new aclentry(); typedquery<aclentry> q = em.createquery("delete aclentry acle acle.acl=:acl ", aclentry.class); q.setparameter("acl", acl); } catch (exception ex) { log.throwing("dao", "removeallaclentries", ex); // em.gettransaction().rollback(); } { em.close(); } } here aclenrty entity: /* * change license header, choose license headers in project properties. * change template file, choose tools | templates * , open template in editor. */ package com.cisco.onepk_web.entity; import java.io.serializable; import java.util.objects; import javax.persistence.entity; import javax.persistence.generatedvalue; imp...

ios - Iphone Simulator photos Without changing orientation? -

i've followed several posts adding photos iphone simulator , work, however, there bad side effect of changing orientation , related tiff metadata. in conflict iphone itself. for example, regardless of orientation take photo (portrait/landscape), iphone display "right-side up". however, metadata remains unchanged, orientation information still correct (i.e. 0,1,2, or 3) however, once added iphone simulator, images "corrected" , orientation "0". this means these statements work on iphone (correctly returns 0-3) not on simulator (always returns 0): uiimage *image=info[uiimagepickercontrolleroriginalimage]; nslog(@"original orientation:%li",image.imageorientation); so, here question (finally): how can add photos simulator , maintain correct, , necessary, metadata can test without having use iphone?

python - Passing in login credentials when making REST calls using Restangular -

i writing application creates data via rest. example while using requests in python save patient pt = requests.post('http://localhost:8080/openmrs/ws/rest/v1/patient',data=json.dumps(patientpayload),headers=headers,auth=httpbasicauth('myusername','mypassword')) how can 1 simulate using restangular these examples found not working return restangular.all('user/session/authenticate').post({user_id: user_id, password: password}); or var login = restangular.one('auth').custompost( {grant_type:'password', username:'b@t.com', password:'666666', scope:'app'}, 'token', {}, { authorization:'basic ' + client, contenttype:'application/x-www-form-urlencoded' } );

SQL Matlab (ambiguous) -

first, want i'm complete newbie in sql, please bear me, myself , stupidity. i've been trying data through matlab using ​sqlquery='select patientid, visit_results.visitid, segmentid, init_time, end_time, num_steps, "distance_f", height, weight, birth visit, visit_results, patient visit_results.visitid=visit.visitid , visit_results.visitid=patient.patientid'; now, know sure 3 tables exist. both visit_results , visit have visitid primary key. i want data third table, patient , primary key patientid . am missing something? you joining visitid patientid, not right join (deduction based on column names).. try instead: sqlquery=' select patient.patientid, visit_results.visitid, segmentid, init_time, end_time, num_steps, "distance_f", height, weight, birth visit, visit_results, patient visit_results.visitid = visit.visitid , visit.patientid = patient.patientid...

android - Button Stays on Screen between Activities -

in android application i'm writing have button when pressed transitions new activity using intents. new activity has linearlayout, framelayout inside of it. when reach new activity button previous activity still on screen , still can tapped; however, causes application crash because onclick method isn't defined in new activity. any idea why button remains? ideally i'd remove button. edit, adding code: intent intent = new intent(mainactivity.this, cameraactivity.class); startactivity(intent); finish(); could please show code? easier see, anywho try using this: public void onclick(view v) { switch(v.getid()){ case r.id.bsubmit: if (a > 0 && b > 0 && c > 0 && d > 0){ bundle basket = new bundle(); basket.put***("key"); //depening on trying transfer 1 class other, different. intent = new intent(main.this, other.class); ...

gcc - toquelib behaves different with static and dynamic linking -

this puzzling me... have code looks this: #include <stdio.h> #include <pbs_ifl.h> int dosomestuff() { char *server_name; int c; server_name = pbs_default(); c = pbs_connect(server_name); printf("pbs_errno %d\n",pbs_errno); // stuff pbs_disconnect(c); } when compile with: gcc -static -o executablename sourcefile.c -ltorque it works allright, compiling '-static'. pbs_errno 0 , can stuff. but if remove '-static' flag starts giving me message when run it: munge: error: unable access "/var/run/munge/munge.socket.2": no such file or directory so... start munge service (munged) , stops complaining it, instead pbs_errno=15033 , can't cluster (do stuff). any ideas? i don't know if delete de question or answer it, seems solved... i'm posting solution here. i had 2 versions of lib installed, 1 via yum other via source. since compiled code had static libs, when linking -stati...

c# - Winforms chart is empty -

i made simple project default winforms chart no changes , button. public partial class form1 : form { public dictionary<int, double> l { get; set; } public form1() { initializecomponent(); l = new dictionary<int, double>(); chart1.datasource = l; chart1.series[0].xvaluemember = "key"; chart1.series[0].yvaluemembers = "value"; } private void generate(object sender, eventargs e) { l.clear(); random r = new random(); (int = 0; < numbernud.value; i++) { l.add(i, r.nextdouble() * 100); } } } but after click chart still empty. datasource have values, chart1.series[0].points.count == 0 did miss something? do call generate method somewhere? should first call can fill dictionary random values.

sql - Highcharts dont display statistics with MySQL Query -

highcharts dont display statistics mysql query it works: $this->db->query("select count( gt ) sayi , from_unixtime( tarih, '$periyot' ) gun sayigoruntu tarih >= date_sub( curdate( ) , interval 1 month ) , gt='$gt'".$sqlek." group gun order gun"); output: [[3582],[2062],[140],[4425],[294]] $this->db->last_query() result: select count( gt ) sayi , from_unixtime( tarih, '%y.%m.%d' ) gun sayigoruntu tarih >= date_sub( curdate( ) , interval 1 month ) , gt='0' group gun order gun this works without problems doesn't work (php): if($siteid !=''){ $sqlek="and sid='".$siteid."'"; } sql query: select count( gt ) sayi , from_unixtime( tarih, '$periyot' ) gun sayigoruntu tarih >= date_sub( ...

c# - How to make each button respond to that row only -

i have repeater creates table multiple row same field name: <asp:repeater runat="server" id="rptcontent"> <headertemplate> <table border="0" style="width: 95%;"> <tr> <td style="width: 25%;">name</td> <td style="width: 25%;">last 4 ssn #</td> <td style="width: 25%;">pdf generator</td> </tr> </headertemplate> <itemtemplate> <tr> <td><%# eval("name").tostring() %></td> <td><%# eval("ssn3").tostring() %></td> <td><asp:button id="btngeneratepdf" runat="server" text="generate pdf for" oncl...

ios - tableHeaderView UISearchBar not showing -

i have added uisearchbar programatically uitableview, showing fine untill decided add offset uitableview hide uisearchbar when view loaded. displaying again. this code looks like. - (void)viewdidload { [super viewdidload]; self.tableview.contentoffset = cgpointmake(0.0f, 44.0f); mysearchbar = [[uisearchbar alloc] initwithframe:cgrectmake(0.0f, 0.0f, 320.0f, 44.0f)]; mysearchbar.autocorrectiontype = uitextautocorrectiontypeno; mysearchbar.autocapitalizationtype = uitextautocapitalizationtypenone; mysearchbar.keyboardtype = uikeyboardtypealphabet; mysearchbar.delegate = self; self.tableview.tableheaderview = mysearchbar; // create search display controller uisearchdisplaycontroller *searchcontroller = [[uisearchdisplaycontroller alloc] initwithsearchbar:mysearchbar contentscontroller:self]; searchcontroller.searchresultsdatasource = self; searchcontroller.searchresultsdelegate = self; i not sure go here appreciated. t...

Return a a json object from an ajax call to a django view -

am trying return json object render grid in template. how it. views.py def ajax_up(request): history_data=upload_history.objects.all() history=serializers.serialize("json",history_data) return httpresponse( history, mimetype='application/json' ) html $(".reply").click(function(){ $.ajax({ url: "/ajax_up/", type: 'get', //this default though, don't need mention datatype: "json", success: function(data) { alert("awasome"+ data) }, failure: function(data) { alert('got error'); } }); so declare object hold data as var data = {{history|safe}}; where history returned ajax call in view above when alert(data), [object object],[object object]..... can 1 please? sounds it's working, alert displays string. since data not string, it'll show [object object ]. either serialize data json.stringify or use console.log instead ...

java - glRotatef works on multiple objects -

basicly want open door , thought of using glrotatef. problem is affecting every object drawn after it. know how stop ? door.class public static void draw(texture door) { door.bind(); if(door_test.state == "out" && d != 90){ glrotatef(i, 0, 1, 0); i+=5; } glbegin(gl_quads); glcolor3f(1f, 1f, 1f);gltexcoord2f(0,0);glvertex3f(-2,3, -15); glcolor3f(1f, 1f, 1f);gltexcoord2f(0,1);glvertex3f(-2,-3, -15); glcolor3f(1f, 1f, 1f);gltexcoord2f(1,1);glvertex3f(2,-3, -15); glcolor3f(1f, 1f, 1f);gltexcoord2f(1,0);glvertex3f(2,3, -15); glend(); } when rotate, rotates entire scene. rotate single object, rotate entire scene, draw object, rotate screen back. glrotatef(i, 0, 1, 0); // draw object. glrotatef(-i, 0, 1, 0); as reto koradi pointed out, if continually might have floating point rounding errors accumulate on time. holyblackcat's answer offers better solution.

excel vba - how can i pause a macro wile IE generated file is open -

my macro generating report in excel 2003 format internet application. want read file , generate metrics data. while excel file generated ie application, macro executes beyond can read ie generated excel file. want pause macro until ie generated excel file complete. i have tried application.wait command stops generating file until wait over. can me? it helpful if posted code, see trying. in mean time, here code wrote years ago, should work want do. 'this block holds program until output file ready outfile = filepath & "\" & yfttablefile = 0 set fo = createobject("scripting.filesystemobject") until fo.fileexists(outfile) 'loop until output file created, infinity if there problem application.wait (now + timevalue("0:00:02")) 'holds program 2 seconds doevents = + 1 if (i = 30) msgbox ("no output file created within 60 seconds") exit sub end if loop application.wait (now ...

jquery - Updating CSS property dynamically -

http://jsfiddle.net/u6gwx/1/ $("div.ttt").css('display','block'); i have filter empties forst column float:left, when column empty want update second column css style float:left, want align left if left column empty. in fillde kind of have high level of code, how using jquery, trying do: if(!$('.ab div.ttt').css('display') == 'block'){ - select if not of elements have display:block change style of .cd (second column) not work, need reset once items in left column..i filter out items in left , right depending on input. try this: var ttt = $(".ab div.ttt"), cd = $(".col.cd"); $("div#test").click(function () { if (ttt.is(':visible')) { ttt.hide(); cd.css('float', 'left'); } else { ttt.show(); cd.css('float', 'right'); } }); jsfiddle demo.

java - libgdx, table in scrollpane -

i'm trying make shop game. in shop, there should 2 scroll pannel : 1 iventory's stuff, other 1 dealer sells. (it 'd make way) http://i.stack.imgur.com/5glur.jpg so @ first, tried put list in scrollpane, can't put both image of weapons , text in those. tried put table in scrollpane : long have stuff in inventory, add cells item's texture, 1 name of weapon, ...) there's no way found select table ... so i'm bit confused : if use list, can't put texture , make fancy, tables, can't select items ... have guys got ideas of how should ? thanks ! edit : here code, no since it's pretty ugly ! table test3 = new table(skin2); for(weaponelement weapon : gamescreen.dataloader.getweaponarray()){ image img = new image(new texture(weapon.geticonpath())); test3.add(img).width(32); test3.add().width(10); test3.add(weapon.getname()).align(align.left).row(); } panelshop = new scrollpan...

javascript - Input field not appending to td -

i trying create table input field dynamically code ends creating empty table. var calcdiv = document.getelementbyid("calc_div"); var calctab = document.createelement('table'); var tbody = document.createelement('tbody'); var calcform = document.createelement('form'); calcform.id = "calculator_form"; //calc display var tr = document.createelement('tr'); var td = document.createelement('td'); td.colspan = "4"; var comp = document.createelement('input'); comp.type = "text"; comp.value = 0; comp.disabled = true; comp.id = "compdisplay"; td.appendchild(comp); //this doesn't seem work tr.appendchild(td); tbody.appendchild(tr); calcform.appendchild(comp); calctab.appendchild(tbody); calctab.style.width = "500px"; calctab.style.height = "500px"; calcdiv.appendchild(calctab); you missing line , incorrectly appendi...

javascript - How to display pop up div for dynamically created database elements -

i have grid of 40 thumbnails of staff images , i'd display additional text (mainly biography) when user hovers on each element. i've tried using jquery powertip ( http://stevenbenner.github.io/jquery-powertip/ ) job, don't know how dynamically create each tooltip connect each thumbnail. my javascript skills quite poor, i'm hoping can show me how display pop div unique each person on hover next each item? <div class="people-list-container"> <ul class="people-list"> <a href="/person/details/8045"> <li> <img src="8045.jpg" class="img-polaroid" /> bob smith <br /> australia </li> </a> <a href="/person/details/8046"> <li> <img src="8046.jpg" class="img-polaroid" /> jill jane <br /...

Adding Views to Scrollview in Famo.us -

this issue concerns adding views scrollview (rather surfaces). when adding view single surface seems work intended. each view stacks neatly on top of 1 another. however when adding view multiple surfaces not stack nicely. in case each view seems set exact height of scrollview viewport. if each view 100px tall, , scrollview viewport 500px tall, there 400px of whitespace between each view when scrolling. if view taller scrollview vp, views overlap. so question is: how add view multiple surfaces scrollview , have them stack nicely? example function build scrollview... function _createscrollview() { var scrollview = new scrollview(); var surfaces = []; scrollview.sequencefrom(surfaces); (var = 0, temp; < 10; i++) { temp = new testview(); temp.pipe(scrollview); surfaces.push(temp); } this.add(scrollview); } example of view... define(function(require, exports, module) { var view = require('famous/core/view...

sql server - How to convert multiple join associated with aggregate function Linq to sql C#? -

i want write following query using linq sql ? tried , i'm beginner in linq , got lost in , please or tips articles can figure out ?? select (s.fname + '' + s.lname ) doctor_name , appointment_id , [date/time] , price , type , patient_id staff s , (select appointment_id,[date/time] , price , apptype.type , patient_id , [doctor-id] appointmenttype apptype , ( select * appointments app app.appointment_id = ( select max(appointment_id) lastapp appointments app1 app1.patient_id = app.patient_id , app.patient_id=10 ) ) rr apptype.id = rr.type ) dd dd.[doctor-id] = s.id any tips please , way :) using (dataclasses1datacontext db = new dataclasses1datacontext()) { var x = apptype in db.appointmenttypes rr in ( ...

Ruby on Rails: Create a new record that belongs to another model -

i have users , have posts . i want create new post user #1. want using syntax similar option #2, chained original user selection. possible? option 1 (i know how this): user = user.find(1) post = post.create(content: "foobar content", user: user) option 2 (is possible?): user.find(1).new_post(content: "foobar content") use build method: user = user.find(1).posts.build(content: "post content") in case of has_one relationship, invoke build_association method: user = user.find(1).build_profile(content: "profile content") in either event, new child object initialized , associated parent user , however , you'll need save user instance in order preserve association: user.save alternatively , same associations can created via create , create_association methods: user.find(1).posts.create(content: "post content") user.find(1).create_profile(content: "profile content") neither call requ...

XML to XSLT can open data from xml -

i have 2 files xml file: <cadeiahoteis> <hoteis id="1"> <codigo>458</codigo> <morada>porto</morada> <num_quartos>3</num_quartos> <piscina>não</piscina> <restaurante> <dados>sim</dados> <num_mesas>10</num_mesas> <num_pessoas>3</num_pessoas> <hora_abertura>11:30</hora_abertura> <hora_fechar>23:00</hora_fechar> </restaurante> <num_funcionarios>8</num_funcionarios> </hoteis> <hoteis id="2"> <codigo>381</codigo> <morada>lisboa</morada> <num_quartos>25</num_quartos> <piscina>sim</piscina> <restaurante> <dado...

Beginner R: Using Incident Data, Create a Series of New Dataframes with Sums of Categorical Variables -

i have set of incident data following rough format: incident # date year state criminal offense location 155k incidents. want create new series of dataframes group ungrouped data (ie, opposite of first step in link: http://ww2.coastal.edu/kingw/statistics/r-tutorials/descriptive.html ). want dataframes each year/each state totals of each categorical count each of last 2 columns above, "offense" , "location" (but there ever 1 row each year-state combination) 2 separate dataframes: year state sum of criminal offense 1 sum of criminal offense 2 sum of crim 3 and year state sum of location 1 sum of location 2 sum of location 3 the goal comparisons of incident counts state on time, or time-series predictions total incidents of crime type in state. ungrouped data? there resource or brief rules analyses/predictive approaches work best/most practically grouped versus ungrouped data? here approach using table count ...

Prolog not unique elements in predicate call -

in prolog script, have defined: mother(x,y) :- parent_of(x,y), female(x). i want know if there mothers more 2 children, run: mother(x,y), mother(x,z) with result: x = pam, y = m, m = bob which has left me quite baffled.... figured if add not(y = z) this fix it, unsure why... if execute query like mother(x,y). the result bring mothers have 2 children well. so if database like female(maria). female(irini). parent_of(maria,nick). parent_of(maria,dario). parent_of(irini,dewey). and executed mother(x,y). query, result bring back 1 ?- mother(x,y). x = maria, y = nick ; x = maria, y = dario ; x = irini, y = dewey. so result have mother (maria) has 2 children. if only want mother 2 children, should modify mother query as: mother(x,y) :- parent_of(x,y), parent_of(x,m), y \= m, female(x). the result of query be: 3 ?- mother(x,y). x = maria, y = nick ; x = maria, y = dario ; false. ( false means prolog did't find...