Posts

Showing posts from April, 2013

osx - Docker hangs while pulling -

i trying run docker run docker/whalesay cowsay boo tutorial. here output get: unable find image 'docker/whalesay:latest' locally latest: pulling docker/whalesay e190868d63f8: exists 909cd34c6fd7: exists 0b9bfabab7c1: exists a3ed95caeb02: pulling fs layer 00bf65475aba: exists c57b6bcc83e3: exists 8978f6879e2f: waiting 8eed3712d2cf: download complete it has been 10 minutes nothing shows up. supposed take long? i tried control+c , re-run command, , restarting docker quickstart terminal. it's still not solving problem. reinstalling docker scratch solved problem me

Actionscript Workers don't work on Mac OSX (Flash Player 11.7) -

mac osx version 10.8.4 adobe air sdk 3.7 flash player 11.7 debug version mac osx i've tried adobe air sdk 3.8 beta, result same. my code simple. main: package sandbox { import flash.display.sprite; import flash.system.worker; import flash.system.workerdomain; import flash.utils.bytearray; public class testworkermain extends sprite { [embed(source="../../workerswfs/sandbox/testworker.swf", mimetype="application/octet-stream")] private static var worker_byteclass:class; private var worker:worker; public function testworkermain() { var bytes:bytearray = new worker_byteclass(); worker = workerdomain.current.createworker(bytes); worker.start(); super(); } } } worker: package sandbox { import flash.display.sprite; import flash.events.timerevent; import flash.utils.timer; public class testworker extends sprite ...

How to check/cast class to generic type with where in Swift -

i came with simple playground illustrating problem: import uikit protocol myprotocol { var foo: bool { set } } class mygenericclass<t: uiview t: myprotocol>: uiview {} func checkifismygenericclass(view: uiview) -> bool { return view mygenericclass // generic parameter 't' not inferred } i need identify instances of mygenericclass . my actual code isn't simple, please don't ask me change mygenericclass declaration. mygenericclass has associatedtype requirements. not sure try import uikit protocol myprotocol { var foo: bool { set } } class mygenericclass<t: uiview t: myprotocol>: uiview {} func checkifismygenericclass<t: uiview t: myprotocol>(view: t) -> bool { return view mygenericclass<t> // generic parameter 't' not inferred } updated import uikit protocol myprotocol { var foo: bool { set } } class view: uiview, myprotocol { var foo: bool = true } class mygenericclass<t:...

c# - Dynamically creating charts -

i trying dynamically create chart each drive in computer, inside form. each chart should pie chart contains amount of free space (colored green) , used space(colored red) in gbs. but when run following code thing see blank rectangles titles of "c:\", "d:\" , on. here code : public static void drawcharts() { chart[] charts = new chart[driveinfo.getdrives().length]; driveinfo[] drives = driveinfo.getdrives(); (int = 0; < drives.length; i++) { charts[i] = new chart(); charts[i].palette = chartcolorpalette.brightpastel; charts[i].titles.add(drives[i].name); charts[i].series.add("storage"); charts[i].series[0].charttype = seriescharttype.pie; charts[i].location = new system.drawing.point(20 + * 231, 30); charts[i].size = new system.drawing.size(230, 300); datapoint d = new datapoint(); d.xvalue = 1; ...

html - Nested 100% heights -

i'm working on mobile site has structure looks this: body ---->mobile container div (height 100%) -------->full page div (height 100%) ------------>vertically centered div (height 200px) my problem full page div level comes out 0px. here's relevant css: html, body { height: 100%; margin: 0; } .mobile { min-height: 100%; } .full-page { height: 100%; position: relative; } .center { height: 200px; top: 50%; margin-top: -100px; position: absolute; } the mobile container filling window height, full page (100% of height of mobile container) being rendered @ 0px height, ruins vertical centering. why happening? jsfiddle the red div mobile container the yellow div full page div (it's not visible because it's 0px tall) the green div vertically centered div this happening because of following rule: .mobile { min-height: 100%; } here's why. css specs tell following percentage height: ...

git - GitHub inquiry concerning branch updating -

we use github @ work. created branch , made changes resolve issue. clear once started testing changes did not work. instead of backing out changes, deleted branch (local , remote) , created new branch same name. new changes worked , merged branch our main branch. when testing done against main branched merged changes, changes in deleted branch reintroduced, along new changes. looked like, because used same name on new branch old branch, when git did branch merge, used branches, deleted or not. sure, had used different name new branch, not have happened. has ever happened else?

excel - Searching a list to make different series, then plotting their corresponding values -

let me start out saying new both site , vba (i took crash course in high school, basic coding jargon). have been looking several days find code work need, haven't found anything. basically have bunch of sand samples have been sieved. every sample gets own sheet. here, have master summary sheet collects data need plot these other sheets , puts table. finds type of sample , date of test. there 6 different types of sample (so far). also, need summary table plotted date on x-axis, , percent on y-axis. need each sample type have own series. have gotten have 6 series divided correctly (though sure code awfully inefficient) can't figure out how value column next sample type plotted. in other words, stuck @ value of "0" because sorting string right now. i've put code , text version of excel sheet below. appreciate can give me! 'sheet date type sieve #40 'truck 47533 4/15/2016 truck 55% 'truck 47272 4/4/2016 truck...

ubuntu - APT: install specific version of a package -

i need install specific package version, not work apt: root@myhost:~# apt-get install my-lib-java=2016.03.30-79 reading package lists... done building dependency tree reading state information... done following packages installed: my-lib-java 0 upgraded, 0 newly installed, 0 remove , 93 not upgraded. older version installed: root@myhost:~# dpkg -l | grep my-lib-java ii my-lib-java 2016.02.25-3-g5aa415e-75 amd64 no description given but explicitly specified version exist: root@myhost:~# apt-cache madison my-lib-java my-lib-java | 2016.04.19-86 | https://my.re.po/dl/ubuntu/ trusty/ packages my-lib-java | 2016.03.30-79 | https://my.re.po/dl/ubuntu/ trusty/ packages my-lib-java | 2016.02.25-73 | https://my.re.po/dl/ubuntu/ trusty/ packages how may install 2016.03.30-79? ok, problem apt my-lib-java depended on my-lib solution is apt-get install my-lib-java=2016.03.30-79 my-lib=2016.03.30-79 then goes through.

SilverStripe: make a piece of HTML optional in page -

i not sure how , cant find example on silverstripe site. i want make checkbox in cms field list. when checked page display code block have. when not checked not. in page.ss have like: <% if $showprintbutton %> $showprintbutton <% end_if %> here relevant code private static $db = [ 'showprintbutton' => 'boolean(1)' ]; private static $defaults = [ 'showprintbutton' => true ]; public function getcmsfields() { ... $fields->addfieldtotab('root.main', checkboxfield::create('showprintbutton', 'allow printing page')); ... }

sql - Setting up primary keys in my tables? -

i have few tables generated different systems no unique identifier available on raw data. several files same system can joined based on the: interaction_time, customer_id, employee_id other files not include timestamp , there interaction_date . problem same customer can speak same employee on same day several times. using interaction_date, customer_id, employee_id not unique. using python (pandas), find unique values of interaction_date, customer_id, employee_id . filter these rows separate dataframe , joins. data rows 1 customer interacted 1 employee 1 time on date. concat/append rows had multiple interactions post-joined data. any recommendations on how set sql server? assume must common. building tables right , not sure primary key should be... composite key of date/customer_id/employee_id? how deal duplicates (these rows cannot joined other files because there no clear way tie data together)? edit- wanted add tying granular data have. used tie survey (which might ...

android - PersistInt slowing down button response in custom preference -

i've created custom preference embeds 2 buttons (here have subclassed button fastbutton). problem executing persistint store preference drastically slows down response of button. i had notion of executing persistint when preference's lifecycle ended, not find appropriate method override (i.e. there nothing onpause() preference class). i unsuccessful @ trying use asynctask move persistint off of ui thread. any suggestions how should go mitigating effect of persistint on ui response? public final class stepperpreference extends preference { public int mcurrentvalue = 1; public int maxvalue = integer.max_value; public int minvalue = integer.min_value; private textview mtext; private fastbutton plusbutton; private fastbutton minusbutton; public stepperpreference(context context) { super(context); } public stepperpreference(context context, attributeset attrs) { super(context, attrs); parsecustomattributes(attrs); } public stepperpreference(context cont...

ms media foundation - Are custom sources supported with the IMFCaptureEngine? -

i've got custom source seams work simple topology. when queryinterface gets called stack looks this: mysource.dll!mysource::queryinterface(const _guid & riid, void * * ppv) line 83 c++ mfcore.dll!cmediaeventptr::getunknown(struct imfmediaevent *,struct _guid const &,void * *) unknown mfcore.dll!cmpsourcemanager::onnewstream() unknown mfcore.dll!cmpsourcemanager::onsourceevent() unknown mfcore.dll!cmpsourcemanager::onsourceeventasynccallback::invoke(struct imfasyncresult *) unknown using same custom source without topology, letting imfcaptureengine deal that. when queryinterface gets called stack looks this: mysource.dll!mysource::queryinterface(const _guid & riid, void * * ppv) line 42 c++ mfcore.dll!cmediaeventptr::getunknown(struct imfmediaevent *,struct _guid const &,void * *) unknown mfcore.dll!cseqsourcewrap::handleupdatedstream(struct imfmediaevent *) unknown mfcore.dll!cseqsourcewrap::onsourceevent() unknown mfcore.dll!cseqsourcewrap::onsou...

tsql - How to do bitwise OR between two arbitrary long VARBINARY(MAX) values in Sql Server? -

motivation: i have trigger when of text fields of table updated or inserted into. the code must not hard code table knowledge. i.e. should work on arbitrary tables. where did far ddl trigger on create_table adds for insert,update dml trigger new table a _columnmask table mapping 1-based integers respective varbinary(max) masks compatible columns_updated format. having _columnmask table , aaaculture table, able write following query: ;with aux ( select (max(column_id) + 7) / 8 mask_len sys.columns object_id = object_id('aaaculture') ) select c.name, column_id, case when pad.zero null cm.mask else cm.mask + pad.zero end mask sys.columns c join aux on 1 = 1 join sys.types t on t.user_type_id = c.user_type_id join _columnmask cm on cm.n = c.column_id left join _columnmask pad on pad.n = aux.mask_len - (c.column_id + 7) / 8 object_id = object_id('aaaculture') , (t.name '%char' or t.name '%text') order c.column_id yieldi...

javascript - Reutilize maps markers for weighted heatMaps -

i'm using functions markers via ajax, , draw in map_canvas div. works perfectly, , i'm trying reuse "gmarkers" variable create heatmap...with no luck. how can create heatmap data? i prefer use same data i'm loading function weighting heatmap variable: llamados. how can start? var gmarkers = []; function initialize() { var myoptions = { zoom: 10, center: mapcenter, maptypeid: google.maps.maptypeid.roadmap }; map = new google.maps.map(document.getelementbyid('map_canvas'), myoptions); current_zoom = map.getzoom(); var mycontrol = document.getelementbyid('descripcion'); map.controls[google.maps.controlposition.right_bottom].push(mycontrol); } google.maps.event.adddomlistener(window, 'load', initialize); var infowindow = new google.maps.infowindow(); var bounds = new google.maps.latlngbounds(); var marker, i; var mylatlng; function createmarker (obj, i) { mylatlng = new google.map...

html - How to set the size of a background image according to the size of the containing div? -

i want have image fill div not overflow , 50% off screen in bootply. have displaying way want in bootply hoping there more dynamic way less code. bootply i figured out. needed background-position: top right; background-size: contain; instead of of other code had content div, , cropped image in photoshop wouldn't need change horizontal position.

.htaccess - Apache HTTPS -> HTTP -> HTTPS 301 redirect -

i experiencing issue if rewriterule meets in .htaccess , 301 redirect https http https for instance, if i've 301 redirect rule follows rewriterule ^/products/?$ /en/products/ [r=301,l] then is +------------------------------------+ | https://example.com/products/ | +----------------+-------------------+ | v +----------------+-------------------+ | http://example.com/en/products/ | +----------------+-------------------+ | v +----------------+-------------------+ | https://example.com/en/products/ | +------------------------------------+ any idea, might cause this? you have rewrite https somewhere, right? remove l flag. [r=301,l] -> [r=301]. l means last , doens't @ rules listed beneath that. should if https rewrite after one. another option can direct straight there: rewriterule ^/products/?$ https://{http_host}/en/products/ [r=301,l]

mongodb - How to query nested objects? -

i have problem when querying mongodb nested objects notation: db.messages.find( { headers : { from: "reservations@marriott.com" } } ).count() 0 db.messages.find( { 'headers.from': "reservations@marriott.com" } ).count() 5 i can't see doing wrong. expecting nested object notation return same result dot notation query. wrong? db.messages.find( { headers : { from: "reservations@marriott.com" } } ) this queries documents headers equals { from: ... } , i.e. contains no other fields. db.messages.find( { 'headers.from': "reservations@marriott.com" } ) this looks @ headers.from field, not affected other fields contained in, or missing from, headers . dot-notation docs

How to correctly write this function?(matlab) -

Image
input: syms x b c; piem=((c+a*x+b*x^(1/2))/(x-1)-1); solve(piem,x) pretty(solve(piem,x)) f2=arcsin(sqrt(x(x^2-1))); df2=diff(arcsin(sqrt(x(x^2-1)))); x=1:0.1:13; y=eval(f2); dy=eval(df2); plot(x,y,x,dy) this function supposed like i don't understand why part isn't working f2=arcsin(sqrt(x(x^2-1))); df2=diff(arcsin(sqrt(x(x^2-1)))); x=1:0.1:13; y=eval(f2); dy=eval(df2); plot(x,y,x,dy) as understand error there wrong part arcsin(sqrt(x(x^2-1))) how can write 1 in different way? matlab not perform implicit multiplication when encounters parenthesis. instead need explicitly perform multplication using * . also, want asin not arcsin . asin(sqrt(x * (x^2-1)))

javascript - Getting radio button value from $.(ajax) and passing it in a SQL Query -

Image
i have 2 sets of radio buttons: 1 car brands , other 1 car models. selecting "audi" car brands fetch of car models brand name "audi" in database through $(ajax). function fetchmodels() { $.ajax({ type: "post", url: "script/rent/models.php", data: {datefrom: selecteddatefrom, dateto: selecteddateto, destination: selecteddestination, brand: selectedbrand}, success: function(data) { $("#model-wrapper").html(data); } } );} // fetchmodels end /* whenever selected car brand changed, change value of selectedbrand , run function fetchmodels(). */ $('input[type=radio][name=brand]').on('change', function() { switch($(this).val()) { case 'audi': selectedbrand = "audi"; break; case 'toyota': selectedbrand = "toyota"; break; case ...

clone - ShallowCopy with MemoryStream class c# -

i have generic methos deep copy. worried if may cause issues? 100% safe? if not, when can fail , should watch out for? /// <summary> /// makes copy object. /// doesn't copy reference memory, data. /// </summary> /// <typeparam name="t">type of return object.</typeparam> /// <param name="item">object copied.</param> /// <returns>returns copied object.</returns> public static t clone<t>(this object item) { if (item != null) { binaryformatter formatter = new binaryformatter(); memorystream stream = new memorystream(); formatter.serialize(stream, item); stream.seek(0, seekorigin.begin); t result = (t)formatter.deserialize(stream); stream.close(); return result; } else return default(t); } example: customer customercopy = customer.clone<customer>();

Exclude specific folders with Gulp -

if have following structure, how can exclude folders format "xx_yy" except "en_us" within gulp.src ? images/ |_ en_us/ |_ en_gb/ (this should ignored) |_ de_de/ (this should ignored) |_ etc etc... something should work you: var images = [ 'images/**/*', '!images/en_gb/**/*', '!images/de-de/**/*' ]; gulp.src(images)...

osx - virtualenvwrapper seemingly ignoring VIRTUALENVWRAPPER_PYTHON -

i python / virtualenv n00b, , tried follow instructions installing virtualenv / virtualenvwrapper.sh. i installed both virtualenv , virtualenvwrapper.sh via: pip install virtualenv pip install virtualenvwrapper i have python3.5 , python2.7 installed on system (mac os x el capitan 10.11.4) when search python, python3, virtualenv , virtualenvwrapper.sh via bash following: which python ==> /usr/local/bin/python python3 ==> /usr/local/bin/python3 virtualenv ==> /usr/local/bin/virtualenv virtualenvwrapper.sh ==> /usr/local/bin/virtualenvwrapper.sh i add following lines .bash_profile: export path=/usr/local/bin:$path export virtualenvwrapper_python=/usr/local/bin/python3.5 export workon_home=$home/.virtualenvs export project_home=$home/devel source /usr/local/bin/virtualenvwrapper.sh my .bashrc file empty, , .profile sources .bash_profile. when try use virtualenvwrapper.sh commands (e.g., 'mkvirtualenv' , 'lsvirtualenv'), work, default pyth...

bash - mkdir: omit leading pathname when creating multiple directories? -

this question has answer here: bash mkdir , subfolders [duplicate] 3 answers i'm sure question has been asked elsewhere can't seem phrase in way returns useful google result. i creating dozen directories have same root path , don't want have cd able make these directories. current command looks like, awful , repetitive: $ mkdir frontend/app/components/home frontend/app/components/profile \ frontend/app/components/post frontend/app/components/comment an ideal syntax along lines of: $ mkdir frontend/app/components/{home, profile, post, comment} is there haven't found? don't want have run for loop make few directories. your wish granted :-). mkdir doesn't know , doesn't have to, shells bash or zsh understand syntax {...,...,...} . just remove spaces "along lines of" , works: mkdir frontend/app/compon...

sql - Where clause affecting two different select statements -

i need count payers , mortals separately have zip code of 44444. zip codes stored in same tables ids on 2 separate tables in many-to-many relationships. have written this: select count(mortal_zip) "mortals in 44444" ,count(payer_zip) "payers in 44444" (select am.zip_code mortal_zip address join mortal_address on mortal_address.address_id = am.address_id join mortal on mortal.mortal_id = mortal_address.mortal_id trim(am.zip_code) = '44444' ) m, (select ap.zip_code payer_zip address ap join payer_address on payer_address.address_id = ap.address_id join payer on payer.payer_id = payer_address.payer_id trim(ap.zip_code) = '44444' ) p; i know this: there no payers zip code of 44444 there 3 mortals zip code of 44444. reason getting there 0 mortals zip code of 44444. if ask mortals in 44444, needed. if a...

Chrome Custom Tabs CookieManager -

i have app uses cookies give authcode inturn token oauth flow. looked on android developer site , says cookiemanager used webview instances. mean chrome custom tabs can not use cookiemanager? thank in advance. james thats right, chrome custom tabs uses chrome's cookie store, , it's not possible read or write cookies client application.

python - Debugging django-allauth Social Network Login Failure -

when using django-allauth oauth login via social provider, fails error page "social network login failure". there no log output containing more information. there feature request log output ( https://github.com/pennersr/django-allauth/issues/1120 ) has been open on year. in mean time, how more information debug error? more information passed context used render error template not used in default template. you can log output overriding template , including in template following: {{ auth_error }} or alternatively: code: {{ auth_error.code }}, error: {{ auth_error.exception }} to override template, add folder django template dirs. in django 1.8+, looks following: templates = [ { ... dirs: [os.path.join(base_dir, 'templates')] } ] then, in folder, make directory socialaccount , put in file called authentication_error.html

Is it possible to run Android Device Emulator (via Android Studio 2) on VMWare? -

Image
i have been running android studio 1.5.1 doing development on wmware copy of windows 2012 r2 , works fine. i've been able run device emulator no problems , start various versions of android running in avd. android studio 2.x change installed android studio 2.0 (see image below exact version). now when attempt run emulator nothing happens. well, see message in status bar of studio when attempt start device, message disappears , nothing happens after that. there warning need turn off hyper-v (see image below), don't believe possible since vm. no longer possible? is not possible run emulator on vm more? more recent versions of android emulator require hardware virtualization support (intel haxm). unfortunately, virtual machines not provide haxm instructions guest (a vm within vm), unable use emulator within virtual machine.

python - Subtraction/Addition from seperate rows/columns -

i have dataframe this: day diff 137 0 185 48 249 64 139 -110 in column diff whenever negative value encountered want subtract 365 value in day previous row , add value day value in current row of negative number. example, in scenario when -110 encountered want 365-249 (249 day in previous row) , add 139. 365-249 = 116 , 116 + 139 = 255. therefore -110 replaced 255 . my desired output is: day diff 137 0 185 48 249 64 139 255 you can way: in [32]: df.loc[df.diff < 0, 'diff'] = 365 + df.day - df.shift().loc[df.diff < 0, 'day'] in [33]: df out[33]: day diff 0 137 0.0 1 185 48.0 2 249 64.0 3 139 255.0

acumatica - Tax calculation is wrong when updating UnitPrice while creating the Invoice from Shipment, TaxAttribute.Calculate uses the old extprice -

in our add-on, modifying unitprice when creating invoice shipment based on our own calculation regex expression. seems fine fields, except taxes take soorder taxes. we created pxgraphextension , used following: public void invoiceorder(datetime invoicedate, pxresult<soordershipment, soorder, currencyinfo, soaddress, socontact, soordertype> order, pxresultset<soshipline, soline> details, customer customer, documentlist<arinvoice, soinvoice> list, action<datetime, pxresult<soordershipment, soorder, currencyinfo, soaddress, socontact, soordertype>, pxresultset<soshipline, soline>, customer, documentlist<arinvoice, soinvoice>> method) { using (var scope = new pxtransactionscope()) { method(invoicedate, order, details, customer, list); lookupbalesfromorderandshipment(); scope.complete(); } } in lookupbalesfromorderandshipment(); modify unitprice ba...

404 error redirect in Spring MVC with java config -

i have simple spring mvc application want hande 404 not found exceptions in advice controller class configuration: public class appinitializer extends abstractannotationconfigdispatcherservletinitializer { @override protected class<?>[] getservletconfigclasses() { return new class<?>[]{webconfig.class}; } @override protected class<?>[] getrootconfigclasses() { return new class<?>[]{rootconfig.class, securityconfig.class}; } @override protected string[] getservletmappings() { return new string[]{"/"}; } @override public void onstartup(servletcontext servletcontext) throws servletexception { super.onstartup(servletcontext); servletcontext.addlistener(new sessionlistener()); filterregistration.dynamic encodingfilter = servletcontext.addfilter("encodingfilter", new characterencodingfilter()); encodingfilter.setinitparameter(...

javascript - MVC pass model between Parent and Child Window -

thanks in advance. please excuse me grammer. tried best explain issue in quest of solving below question started develop poc first. c# mvc no submit pass object between views i having issue using tempdata object , pass model between parent popup , child popup. problem doing tempdata["studentviewmodel"] 2 times. first time insert , first time read second time read though make sure insert second time before read not working. i try best explain clearly. i have asp.net page called class.cshtml. have grid of class. user select classname column , opens students.cshtml new popup window has grid studentname , address columns. user select studentname , opens popup window called studentdetails.cshtml. we have classcontroller.cs used popups , have c# methods. classcontroller.js has javscript code. public actionresult getstudentsdetails() { // create students each class. //inside student each class create student details. // first insert tempdata["student...

knockout.js - knockout observable array push adding only first object -

i have observable array. assume (object) data has id, name, description self.selectedobjects = ko.observablearray(); self.selectedobjects.push(data); self.selectedobjects.push(data); line number 1 , 2 work fine. @ line number 3 debug point vanishes , never comes back. this simple example works well, may problem somewhere else var viewmodel = new function() { var self = this; var data = {"id" : "id1", "name" : "name1"}; self.selectedobjects = ko.observablearray(); self.selectedobjects.push(data); self.selectedobjects.push(data); } ko.applybindings(viewmodel); jsfiddle demo

How do I take words from one text file out of another? Python -

tran = open("rep-small.txt") stop = open("stopsql.txt") ctran = open("cleantran.txt.","w") badlist = [] line in stop: badlist.append(line) def cleantxt(): line in tran: word in badlist: line = line.replace(word,"") ctran.write(line) it writing ctran.txt isn't taking out words stop. stop file formatted way: a and the it with each word on different line. you can skip loop: (btw calling function cleantxt()?) tran = open("rep-small.txt") ctran = open("cleantran.txt.","w") def cleantxt(): line in tran.readlines(): word in badlist: line = line.replace(word,"") ctran.write(line) ctran.close() open("stopsql.txt") stop: # with-statement calls close() function after finished executing badlist = stop.readlines() # add lines list cleantxt()

group by - Mysql find matching rows for common field in two tables and combine fields into one row -

i have 3 tables: table 'a' has number of events each unique id. table 'b' has categories match id of table though there several matches each id. table 'c' defines category names match id in table 'b'. how can output shows unique events have multiple categories listed opposed each event repeated per category? table table b table c id | event | date | id | catid catid | cat 1 swim 1-2-16 1 11 11 slow 2 swim 1-2-16 1 12 12 med 3 run 1-3-16 1 13 13 fast 4 bike 1-5-16 2 11 5 run 1-30-16 3 12 3 13 4 12 5 11 i have mysql statement: select a.*, b.*, c.* a, b, c a.id = b.id , b.catid = c.catid , date(date) between "1...

javascript - Background Image not appearing in canvas -

i'm trying follow along tutorial build small game in javascript using libraries i'm trying type out myself instead of copy/paste etc in order learn more effectively, whilst changing aspects. i'm trying add background image canvas when run see blank white screen. i'm not sure if i'm being stupid , missing simple syntax or if it's more complicated. here html , js file. have png image in assets folder called 'background'. html <!doctype html> <html> <head> <title>1812 shooter game</title> <link href="normalize.css" type="text/css" rel="stylesheet" /> <!-- game file --> <script language="javascript" type="text/javascript" src="game.js" /> <!-- cdn createjs library --> <script language="javascript" type="text/javascript" src="https://code.createjs.com/createj...

ios - How to do a replace segue on an iPhone? -

i want change between 2 view controllers using button, on iphone. don't want use uitabbarcontroller because takes space, want same kind of segue. how do that? need write custom segue ? a push segue want operation can reversed allowing button (or stepper) dictate navigation. to initiate; [self performseguewithidentifier:@"destinationviewcontroller" sender:self]; to return either use button appear in navigation bar or programmatically hidden button. [self.navigationcontroller popviewcontrolleranimated:yes]; to hide button: self.navigationitem.hidesbackbutton = yes; called in -(void)viewwillappear part of lifecycle.

asp.net - How to update GridView on UI before method ends -

i running small app in sharepoint produces data needed in our company. in short pulls data azure database data-table, , converts data-table excel. can take minute or 2 , sometimes, because in new zealand , using remote server in usa, timeouts , 1 of worksheets won't load. so when builds excel iterates through list of suppliers, , list of financial weeks getting data each , creating separate worksheet in excel per data-table. ideally, add new row grid view user sees, as report being built , stating whether financial week , supplier added, or not, excel report creating in back-end. allow user more aware of progress, , allow them know if there has been problem rather guessing. it's lot of code try show relevant parts. method pulls , creates excel public void excelthreadcall() { datatable updatedatatable = new datatable(); gridview.datasource = updatedatatable; //payments download chosen financial week using (xlworkbook workbook ...

mongodb - Mongo DB - Sort and Skip within a group -

i using mongodb , want sort , skip records within group. below sample data: { "_id" : objectid("51cd7274267d959cb9f95cea"), "creation_time" : 100, "delivered" : true, "id" : 1, "user_id" : 10 } now want _id of documents per user ( user_id ) no. of documents user greater 4. want _id of documents after skipping 4 documents. if user has 6 documents, want _id of last 2 documents (sorted creation_time) can archive 2 old documents db. i using following query: db.newsdb.aggregate([ { $match: { delivered: true } }, { $group: { _id: { user_id: "$user_id", creation_time: "$creation_time" } } } ]) now problem want perform $sort , $skip operation on documents each user , not on documents of users. want like: { $group: { _id: { user_id: "$user_id", creation_time: ...

css - Bootstrap option text truncating long text on osx chrome -

Image
i'm using bootstrap 3 , when system tries display long text in select box, option text gets truncated (but element displayed right width). happens in google chrome os x. the code ( http://jsfiddle.net/arthurvasconcelos/h21n6lwx/ ): <div class="content"> <div class="row"> <div class="col-md-3"> <form class="form-horizontal"> <select class="form-control"> <option value=""></option> <option value="0">65a073e6-066b-11e6-b512-3e1d05defe78_21e23745-838b-44bc-b639-eb02bd04f41f_really_big_name_for_a_option</option> <option value="1">82e027b3-a9f1-4274-8056-a3fe67a1f83d_option_test_long_name</option> <option value="2">shortter</option> <option value="3">short test</option> <option value="4"...