Posts

Showing posts from September, 2010

php - SQL Update Query - Attempt to put 0 in a field -

i'm using following update row in sql server database: "update bmraconfig set [pn operator] = '".$pnop."', [pn value] = '".$pnvalue."', [mel operator] = '".$melop."', [mel value] = '".$melvalue."', [ndz operator] = '".$ndzop."', [ndz value] = '".$ndzvalue."', [fuel type] = '".htmlentities($fueltype, ent_quotes)."' [pn operator] = '".$default["pnop"]."' "; however when 1 of variables equal 0 , example $melvalue == 0, field isn't updated. if value 51 example change, not when it's 0 .

Git commits linked to wrong user on Github, correct in git log output -

i have been using git months now. working on own, working on repository of .html , .txt files little (terrible) python. coding skills average @ best, , have been using linux & unix command line 2 years @ basic level. while visiting parents in uk, installed git on mac mini continue working on repository. set second repo different purpose , used git config in repo set local values user.email user.name etc. set second github account using different email address , pushed once. since then, every time push 1st git repository on own computer, commits listed being second user set on mac, though never pushed there own computers. output of git log on local repo has author ought "author: pocketapocketa ", github has "christopher-rozruch". (in fact, looking on commit history, "christopher-rozruch" commits pre-date use of mac mini , setting of christopher-rozruch identity in form week or so.) i have searched problem found issues involving changed config

php - Mailgun : Fatal error: Uncaught exception 'Guzzle\Common\Exception\InvalidArgumentException' with message 'Unable to open -

i have used following code , have placed these files in same directory of script running send mail. exception continues thrown when try give online link. i trying piece of php code in local host can figure out error below # include autoloader (see "libraries" install instructions) require 'mail/vendor/autoload.php'; use mailgun\mailgun; # instantiate client. $mgclient = new mailgun('key-secret'); $domain = "mydomain"; $result = $mgclient->sendmessage($domain, array( 'from' => 'email', 'to' => 'email', 'bcc' => 'email', 'subject' => "sending attachment 2", 'text' => "sending attachment", 'html' => "sending attachment", 'attachment-1'=> 'test.xml' ), array("attachment" => array(

javascript - Find nested order of ul's and add specific classes -

i trying figure out way loop through container <nav id="container"> <ul> <li>text</li> <li> <ul> <li>text</li> <li> <ul> <!-- , on --> </ul> </li> </ul> <li> </ul> </nav> and check how deep ul nested in if first 1 add class="level-1" it, if second .level-2 etc. bear in mind, each <ul> can contain more 1 nested ul (multi level navigation). demo simply iterate through ul s , create classname based on how many parent ul s each has, using parentsuntil() in case #container within ul . $(function(){ $('#container ul').each(function(){ var classname = 'level-' + ($(this).parentsuntil('#container', 'ul').length + 1); $(this).addclass(classname); }); }); a shorter way write (courtesy of arun p johny) is

javascript - Regular expression for remove last n characters -

i have requirement remove last n characters string or remove 'page' particular string. eg: var string = 'facebookpage'; expected output string = 'facebook' i remove 'page' string. done using substring. var str = "facebookpage"; str = str.substring(0, str.length - 4); could me find better way it. regex this: //str - string; //n - count of symbols, return function(str, n){ var re = new regexp(".{" + n + "}","i"); return str.match(re); }; edit: for remove last n characters: var re = new regexp(".{" + n + "}$","i"); return str.replace(re, ""); update: use regex task, not way; example, avg runtime 100000 iterations: str length solution = 63.34 ms regex solution = 172.2 ms

Is there a way to edit the source of a network request in Firebug? -

can source of post tab of specific post request in firebug's net panel edited? firebug version 2.x not allow edit network requests. there longstanding enhancement request this . though firebug 3 designed integrate firefox built-in devtools. , allow edit network requests , resend them. inherit feature them. to need select request within network panel, click edit , resend , edit parameters , click on send .

recursion - Find node in javascript tree by some params -

i try write mixin underscore, can find node params, example: _.finddeep(tree, {id: 5456, parent_id: 555}) tree: var tree = [ { id: 22, name: 'qqqq', depth: 0, parent_id: 11, children: [ { id: 222, name: 'ttttt', depth: 1, parent_id: 444, children: [], positions: [] }, { id: 5456, name: 'yyyy', depth: 1, parent_id: 555, children: [ { id: 6767, name: 'dfgfdg', depth: 3, parent_id: 6564, children: [], positions: [] }, { id: 4345, name: 'dfgdgfg', depth: 3, parent_id: 45234, children: [], positions: [] }, ], positions: [] }, ], positions: [ { id: 14, name: 'rere', pri

eclipse - Add XML outline to Xtext DSL IDE -

i have dsl ide generated xtext 2.8.4. works ok. due different reason have implement few editors different kind of file. i've easy added xml editor syntax coloring. need outline view xml. if not mistake have implement public class xmloutlinetreeprovider implements ioutlinetreestructureprovider, ioutlinetreeprovider, ioutlinetreeprovider.cancelable {} also eclipse platform has xml outline implementation. can reuse implementaion in xtext project? i'm sure there ready use implementation task, find it. next question not find out how register implementaion in xtext core any advises appreciated thanks alex i'd guess it's more effort reuse existing outline implementation implement few methods on own. in fact, have provide label, icon path , list of children xml nodes. it in principle (code xtend): def _createchildren(ioutlinenode parentnode, element element) { element.children.foreach [ createnode(parentnode, it); ] } the label provide

excel - VBA script to pull values within specific HTML classes -

i created vba script pull prices websites getting value within html class. please see vba script pull data website more context. this works there cases there 1 price (no rrp & sale price) , therefore need somehow incorporate if statement class name, if doesn't exist another. for example have following spreadsheet: | | b | c | | | item | price | | | bfd/garden-structures/arbours/arbours-sunflower | | | | bfd/garden-structures/arbours/tatton-corner-arbour-seat | | | | bsd/garden-storage/wooden-storage/4-x-2-windsor-garden-storage-chest | | in example first 2 work code below: (looking int class variantprice & nowvalue ) 3rd example doesn't work classes variantprice & nowvalue not exist, have class price & singleprice . the code have used below: sub buydeckingdirect() dim ie new internetexplorer dim doc htmldocument dim result ihtmlelement dim result2 ihtmlelement dim item string dim lrow long 'ie.visible = tr

javascript - Uncaught SyntaxError: missing after argument list -

below parsed html of button. basically, it's inside datagrid. when click on button gives me console error: uncaught syntaxerror: missing ) after argument list <button onclick="myfunction(javed@gmail.com)">click</button> here scripting click event. function myfunction(e) { alert(e); } you need pass email string, otherwise, parsed javascript <button onclick="myfunction('javed@gmail.com')">click</button> note, not parameters need strings. passing number, function, object,or variable without quotes valid. if not include quotes, thats parser assume trying pass fail if parameter neither of those.

javascript - how to prevent default on keypress for certain event but then bring back the default again -

i have been working on requires me use space bar trigger event. thing i've been working on more complex i've simplified down basics example of needed do. the idea when space bar held down highlights div , when let go un-highlights. had problem when pressing down space, default make scrollbar jump down in stages. deal tried adding prevent default , ended using return false. this great...until realised when testing typing input field text boxes had taken away ability put space whilst typing. what think need either: to (undo) prevent default or return false somehow after i've finished using although couldn't figure out how because needed function available on whole page. stop spacebar making page scroll down when held still keep it's ability add spaces when typing text. really not sure how this. here code using example: html <div class="container"> <div class="moo">i moo</div> <input/> </di

android - How can I retrieve data attached to an Eddystone-URL? -

i'm trying experiment eddystone , nearby messages in android. registered eddystone-uid proximity beacon api , attached data. in app used samples nearby messages api retrieve , seems working fine. since want use eddystone-url , website casual use, offer possibility of downloading app, trying use eddystone-url, , attach data it, can have additional information in app. i did same steps eddystone-uid, app doesn't see message. beacon seems registered, , data attached it, app it's not receiving anything. am missing something? not supported? the attachments describe work eddystone-uid. whole purpose of eddystone-url based on web, means not using centralized servers(other web page). url points website. if want data 'attached' url, use web technologies that, e.g. have data in markup/as additional web page/etc. edit: believe want have best of both worlds: url beacon simple web page , uid app have additional data. that's why eddystone has multiple f

javascript - Firefox SDK: ActionButton not working - behave like I am not click on it - just nothing -

i taked simple code documentation : var { actionbutton } = require('sdk/ui/button/action'); var button = actionbutton({ id: 'translate-button', label: 'replace selected text translated', icon: './ico.png', onclick: function() { console.log('x'); } }); i clicking - , nothing happen - terminal clear. i under xubuntu 14.04.2 i386, building command jpm run -b /usr/bin/firefox . other functions of addon working fine. have no idea problem. looks bug in sdk - because if wrong need see error in console. full code of index.js const { getmostrecentbrowserwindow } = require('sdk/window/utils'); var uuid = require('sdk/util/uuid').uuid(); var uuidstr = uuid.number.substring(1, 37); var notifications = require("sdk/notifications"); var contextmenu = require("sdk/context-menu"); var request = require("sdk/request").request; var self = require('sdk/self'); var data

Python's `range` function with 3 parameters -

i understand following line give given result: for in range(5): print(i) 0 1 2 3 4 but don't understand how if adding 3 separate parameters result confusing. how returning these particular results? (4 6 , 8) ???? for in range(4, 10, 2): print(i) 4 6 8 starts @ 4, increments 2, end @ 8 because 10 < 10 false. 4 6 8

geojson - mapbox number of items returned by getJSON -

i placing multiple clustered locations on map. how can retrieve number of total of featured returned? here code: <script> $.getjson("datafile.json", function(data) { var geojson = l.geojson(data, { oneachfeature: function (feature, layer) { layer.seticon(l.mapbox.marker.icon({'marker-symbol': 'circle-stroked', 'marker-color': '59245f'})); var popup="pouptext"; layer.bindpopup(popup,{ closebutton: true, minwidth: 320 }); } }); markers.addlayer(geojson); var map = l.mapbox.map('map', 'mapbox.streets') .setview([42, -90], 4); baselayer.addto(map); markers.addto(map); }); </script> thanks. assuming datafile.json contains geojson featurecollection, number of features stored in data.features.length property.

javascript - Replacing browser scrollbar with buttons -

Image
i googled, , can't find solutions, have see implementation of somewhere before. so have large spread sheet - table, generated user. content extent past viewport both horizontally , vertically, scrolling needed. however, i'm trying find "prettier" way user scroll (horizontal , vertical scrollbars don't nice). thinking of arrows following (see attached). however, looked around , can't see example of doing this. so here questions: can tell me if there's technical reasons shouldn't replace browser scrollbar "scroll buttons"? can done javascript or there (preferably angularjs) plugins can imitate behaviour? i have no idea why being downvoted. also, not ux question. i think looking "scrolling without scrollbar". can google this. many results answer this. one of closest answers (and popular ones) came across 1 right here on stackoverflow. in case, involves scrolling using keyboard keys or mouse wheel.

javascript - Issue a unit test on a Gulp file using Karma & Jasmine -

i wrote unit test gulp file. test runs through karma using jasmine framework (safari/chrome). knowing karma runs test file, specified in json config file, in browser, should have way run node's modules in browser. after researching, found using browserify i'll able require modules in browser. when write command browserify ./test/gulptest.js -o ./test/test.js -d the new test.js seems big and run following command start test on new test.js karma start karma.conf.js i error: gulp input stream ✗ should compile ts js typeerror: cannot read property 'istty' of undefined @ object. (/users/snap/desktop/demo app/test/test.js:75226:20) @ object.252._process (/users/snap/desktop/demo app/test/test.js:75284:4) @ s (/users/snap/desktop/demo app/test/test.js:1:254) @ /users/snap/desktop/demo app/test/test.js:1:305 @ object.31../lib/pluginerror (/users/snap/desktop/demo app/test/test.js:3530:9) @ ob

java - Need two extract co-ordinates value of x & y axis from a image chart? -

i have images of different chart (ex. pie chart , bar chart etc.).can body tell me how co-ordinate value of each point draw @ chart ??? thanks in advance since images (aka, not charts created within java), real option analyze charts images, using along lines of imagej (i use pil in python, similar that) convert image matrix of rgb values, can use distinguish colors of each slice of graph, , use matrix coordinates starting point generating (x,y) coordinates.

cmd - Ping Test Batch File to Text Output of Results -

i wrote simple .bat file pings 6 ip addresses on start , pauses window can go through , make sure each responding. i wondering if possible create output .txt file simplifies results. instead of output of like: pinging www.google.com [74.125.226.17] 32 bytes of data: reply 74.125.226.17: bytes=32 time=9ms ttl=51 reply 74.125.226.17: bytes=32 time=9ms ttl=51 reply 74.125.226.17: bytes=32 time=9ms ttl=51 reply 74.125.226.17: bytes=32 time=9ms ttl=51 ping statistics 74.125.226.17: packets: sent = 4, received = 4, lost = 0 (0% loss), approximate round trip times in milli-seconds: minimum = 9ms, maximum = 9ms, average = 9ms in .txt file read "%servername% online , responsive" or "%servername% not responsive," when reporting packet loss. i'm not sure if possible simple batch file if not, can point me in right direction of language? set "servername=www.google.com" ping %servername% |find "ttl" >nul && echo %se

java - How to properly refresh a list while using it for iterating -

i have following problem. deleting firewall rules sonicwall. way rules sonic wall find matching ones, store them in list , use list in order issue command delete them. way rules delete using ssh , command id. problem having every time id deleted id's changed leading second command try , delete access rule not exist (or worse wrong one). order overcome this, after each delete process refresh list order renewed elements , new id's. problem facing update of list not correct (it happens within each loop) since list used iterator (leading wrong commands being issued). what best , safest way update list new elements? below part of code in question: multiresult = expect.expect(anyof(regexp("(.*)" + promptpattern))); accessrules = getaccessrules(multiresult, accessrule); if(accessrules == null){ trc.trc("no access rules found delete"); return false; } numberofrulestodelete = accessrules.size();

javascript - How can I get the tick values of a '.nice()'ed scale? -

i've created chart in d3 contains grid lines. i'm placing gridlines @ every tick on axis using axis' scale: y0scale.ticks() the problem i'm having value of .ticks() doesn't seem take account face scale has had .nice() called. result of chart missing gridlines @ extents of axes. i know combine y0scale.domain[0] , y0scale.domain[1] tick marks know about, doesn't work, in cases .nice() algorithm more adding tick value on min , max of scale. you need call .ticks() after having called .nice() on scale.

android - Unable to create a valid .obb file -

i on verge of creating obb file adding video around 80 mb. trying create obb file via win rar naming convention main.2.my.package.name.obb , indeed using mentioned store format zipping file. a screenshot - . when try run following code zipfilecontentprovider contentprovider = new zipfilecontentprovider(); string contentpath = "content://my.package.name.provider"; file root = environment.getexternalstoragedirectory(); string exp_path = file.separator + "android" + file.separator + "obb" + file.separator; string path = root.tostring() + exp_path + getpackagename() + file.separator + "main.2.dmcc.mea.golive.golive.obb"; string zipfilename = contentpath + path + "/" + "video/app_video.mp4"; log.e("the uri ", "" + zipfilename); uri = uri.parse(zipfilename); public class zipfilecontentprovider extends apezprovider { @override pu

r - dplyr standard evaluation: summarise_ with variable name for summed variable -

i went through lot of questions similar mine addressed 1 part of problem. using dplyr standard evaluation accommodate variable names. works fine filter_ , group_by_ in pipe. however, summarize cannot have variable name metric i'm summing. example make clear. library(dplyr) library(lazyeval) # create data <- data.frame( x = c(2010, 2010, 2011, 2011, 2011), y_zm = c(rep(10, 5)), y_r2 = c(rep(20, 5))) # define variable names tag <- "2011" metric <- "y" run1 <- "zm" run2 <- "r2" # working example pipe fixed variable name %>% filter_(~x == tag) %>% group_by_(tag) %>% summarise_(variable_name = interp(~sum(var, na.rm = t), var = as.name(paste0(metric,"_",run1)))) # non-working example of want %>% filter_(~x == tag) %>% group_by_(tag) %>% summarise_(as.name(paste0(metric,"_",run1)) = interp(~sum(var, na.rm = t),

Move a Graphic in Java,using keyboard arrows and mouseEvent -

Image
i'm beginner in learning this.doing test drawing triangle , want move it.it's not working want ask what's mistake.sorry it's long. import javax.swing.jframe; import javax.swing.jpanel; import java.awt.color; import java.awt.graphics; import java.awt.event.*; public class test extends jframe { private triangle triangle; private final int step = 10; private triangle keyboardpanel = new triangle(); public static void main(string[] args) { test t = new test(); } public test() { settitle("try try try"); setlocationrelativeto(null); // center frame setdefaultcloseoperation(jframe.exit_on_close); setbounds(100, 100, 500, 500); jpanel tripanel = new jpanel(); add(tripanel); triangle = new triangle(); tripanel.addkeylistener(null); tripanel.addmouselistener(null); tripanel.addmousemotionlistener(null); setvisible(true); } static class move extends jpanel implements keylistener,mouselistener,

linux - Start Mysql when Mysql cluster is installed -

i have problem starting mysql when have installd mysql cluster on singel server. i have read somewhere if install mysql cluster not have download mysql server or client (apt-get install mysql-server / client) becuse these end in conflict. mysql packets should in mysql-cluster-gpl-7.4.7-linux-glibc2.5-x86_64 file downloaded here . but how can start mysql without install mysql-server or client? if write mysql in promp, error message: error 2002 (hy000): can't connect local mysql server through socket '/var/run/mysqld/mysqld.sock' (2) and if search "mysql-cluster-gpl-7.4.7-linux-glibc2.5-x86_64" cant find matching files mysqld.sock i have tried start mysqld got alot off errors. 2015-08-19 14:52:00 0 [warning] timestamp implicit default value deprecated. please use --explicit_defaults_for_timestamp server option (see documentation more details). 2015-08-19 14:52:00 4208 [error] can't find messagefile '/usr/local/mysql-cluster-gpl-7.4.7-linux

c# - a regex pattern that never matches anything -

this question has answer here: a regex never matched anything 23 answers i'm maintaining c# software contains list of rules , each rule has regex pattern part of definition. regex pattern determines whether rule should applied particular data instance or not. i.e. given particular string, apply rule if regex pattern matches against string, never apply rule against strings regex pattern not match. i deactivate rules never apply against string. so need regex pattern not match, no matter string value passed it. any suggestions? a negative lookahead looks nothingness not follow current position: (?!)

windows phone 8 - GPS running in background when Here Drive+ is running -

i have problem running wp (8.0) app in background when here drive+ running in foreground. app location based app. i've setup little demo project reproduce , isolate , simplify problem. i have geolocator, checking , displaying current location in positionchanged event label, when in foreground. when running in background, displays toast every 5 seconds (to show me, positionchanged event still triggered). pretty forward stuff, works. public mainpage() { initializecomponent(); datacontext = this; app.locationwatcher.reportinterval = 5000; app.locationwatcher.desiredaccuracy = positionaccuracy.high; app.locationwatcher.positionchanged += locationwatcheronpositionchanged; app.locationwatcher.statuschanged += locationwatcheronstatuschanged; } private void locationwatcheronstatuschanged(geolocator sender, statuschangedeventargs args) { displaytoast("status:", args.status.tostring()); }

analysis - How to separate data in R based on conditions -

i separate data depending on conditions in r data analysis can't figure out how this. i have data grouped separate based on conditions of grouping. here example of trying do: original data: dataset: trial position data 1 1 70 1 2 73 1 3 80 1 4 75 2 1 41 2 2 80 2 3 45 2 4 70 3 1 50 3 2 53 3 3 50 3 4 53 4 1 80 4 2 90 4 3 85 4 4 53 desired data: dataset1: trial position data 1 1 70 1 2 73 1 3 80 1 4 75 4 1 80 4 2 90 4 3 85 4 4 53 dataset2: trial position data 2 1 41 2 2 80 2 3 45 2 4 70 3 1 50 3 2 53 3 3 50 3 4 53 i able separate data, such if data in position 1 of each separate trial above 50, entire trial information , data gets put data set , data in position 1 below 50 gets put separate data set. how do this? we can use split list output. create grouping variable ave checking if first value of 'data' greater 50 each 'trial' group. lst <- split(dataset, with(dataset, ave(data, trial, fun=function(x) x[1]<=50))) if need 2 da

How to select All JTextFields and get their text-Java -

lets have class lot of jtextfields following: public class multiplefields{ jtextfield a=new jtextfield(); jtextfield b=new jtextfield(); jtextfield c=new jtextfield(); //there many more jtextfields in actual code public void gettextfromfields(){ //implementation code goes here } } is there api,library or use text jtextfields(or else these jtextfields?) use list<jtextfield> or array. public class multiplefields { jtextfield textfields = new jtextfield[700]; public multiplefields() { (int = 0; < textfields.length; ++i) { textfields[i] = new jtextfield(); } } public string alltexts() { stringbuilder sb = new stringbuilder(); final string eol = system.getproperty("line.separator"); (int = 0; < textfields.length; ++i) { sb.append(i).append(": ").append(textfields[i].gettext().append(eol); } return sb.tostring(); }

Copy JSON column in Redshift -

i have import csv file in redshift s3. 1 of columns in table json format. while using copy command, following error - invalid timestamp format or value [yyyy-mm-dd hh24:mi:ss] the command used - copy api_log 's3://x/y' credentials 'aws_access_key_id=;aws_secret_access_key=' delimiter ',' maxerror 250 truncatecolumns; commit; sample data - c1 c2 c3 x y {a:b,c:d} if add quotes json , removequotes copy works. put test file in s3: echo x,y,'"{a:b,c:d}"' | aws s3 cp - s3://[bucket]/json/test_file.csv create table: create table if not exists api_log (c1 varchar, c2 varchar, json_colum varchar(65535)); load: copy api_log 's3://[bucket]/json/' credentials 'aws_access_key_id=;aws_secret_access_key=' delimiter ',' maxerror 250 truncatecolumns removequotes; or, if don't quotes, can use tabs or other character not in data. e.g.: echo -e "x\ty\t{a:b,c:

javascript - How can I create a drop down menu with JQuery -

i found fiddle has functionality want. however, i'm not sure how adjust code (css) drop down menu links. when click on = want menu drop down. original code works clicking on parent , showing child links. assume work instance not sure how. what want accomplish clicking = drops item 1 , item 2. otherwise hidden. html <!-- original code --> <ul id="nav"> <li>home</li> <li class="parent">about <ul class="sub-nav"> <li>johnny</li> <li>julie</li> <li>jamie</li> </ul> </li> <li>contact</li> </ul> <!-- code --> <div class="header-nav"> <nav class="nav-menu"> <ul> <li>item 1</li> <li>item 2</li> </ul> </nav> <a href="#" id="menu-icon"></a>

python - csv module doesn't work in Google App Engine -

we using google app engine python our application. wrote code exports data csv, using csv module. when try read csv: import csv users_csv_file = self.request.get("users_csv_file") csv_reader = csv.reader(users_csv_file) i exception: attributeerror: 'module' object has no attribute 'reader' what problem , why can't import csv? eventually found problem. had directory "csv" , when imported csv imported local directory, didn't have attribute reader . renamed directory "_csv" , solved problem.

python multiprocessing logging: QueueHandler with RotatingFileHandler "file being used by another process" error -

i'm converting program multiprocessing , need able log single rotating log main process subprocesses. i'm trying use 2nd example in python cookbook logging single file multiple processes , starts logger_thread running part of main process, picking log messages off queue subprocesses add to. example works is, , works if switch rotatingfilehandler. however if change start logger_thread before subprocesses (so can log main process well), log rotates, subsequent logging generates traceback windowserror: [error 32] process cannot access file because being used process . in other words change code 2nd example workers = [] in range(5): wp = process(target=worker_process, name='worker %d' % (i + 1), args=(q,)) workers.append(wp) wp.start() logging.config.dictconfig(d) lp = threading.thread(target=logger_thread, args=(q,)) lp.start() to this: logging.config.dictconfig(d) lp = threading.thread(target=logger_thread, args=(q,)) lp.start() workers = [] in

sql server 2008 - How to do a group by and count individual group in sql subquery -

i have following table: date_trans | customerid 2015-02-01 | 12 2015-02-01 | 14 2015-02-01 | 13 2015-02-01 | 12 2015-02-02 | 13 2015-02-02 | 12 2015-02-02 | 13 2015-02-02 | 14 2015-02-02 | 14 i able total transactions per day group by: select date_trans, count(*) "transactions" thetable group date_trans date_trans | transactions 2015-02-01 | 4 2015-02-02 | 5 but not able partial numbers same date customers: date_trans | transactions | "by 12" | "by 13" | "by 14" 2015-02-01 | 4 | 2 | 1 | 1 2015-02-02 | 5 | 1 | 2 | 2 i tried group in select not work. how can achieve in sql 2014? thank you with trans ( select date_trans, count(*) "transactions" thetable group date_trans) , cust ( select customerid, date_trans, count(*) "cust_txns" thetable group customerid, date_trans) select c.date_trans, t.transactions, case when c.customerid = 12 cust_t

ios - Change UINavigationbar title according to UICollectionView Cell -

im trying change title of uinavigationbar title according uicollectionview cell indexpath.row , have horizontal uicollectionview cells photo sliding-content (as photo app in ios). what trying achieve when move indexpath.row example 1 2 change title having 1 issue, i've placed following code in cellforitematindexpath or willdisplaycell : self.title = "\(indexpath.row+1) of 2" this code works fine has 1 issue, when start dragging next cell return i, title changed 2 still in 1 ! annoying ! i've tried place code in scrollviewdidenddecelerating has same issue, started dragging changed mind stay on cell 1 method says okey end dragging, title again changes 2 still in one. i need since if still don't have change title, if in next cell change title. it happening because method cellforitematindexpath called prepare second item, first cell still in memory , method cellforitematindexpath not called when return first. try this: -(void)scrollvie

web - Bottle server to accept question mark as input in Python -

i writing following code: bottle import route, run @route('/input/') def greet(name): return name run(host='localhost', port=8080, debug=true) however, when try access this: http://localhost:8080/input/?hi i following error: sorry, requested url ' http://localhost:8080/input/?hi ' caused error: not found: '/input/' i need parse whole string "?hi" input string in method "inpout" i have tried replicate issue, have not had success. version of bottle using? below altered version of code have print "hello (name)" variable. from bottle import route, run, request @route('/input/') def greet(): return "hello " + request.query.get("name") run(host='localhost', port=8080, debug=true) hitting http://localhost:8080/input/?name=shaklasah result in hello shaklasah

ios - RLMException: Can't persist property 'id' with incompatible type, but nonexistant -

i'm trying new instance of object: class myawesomerealmobject: baserealmobject { var field: string = "" var thing: string = "" var whatever: string = "" var something: string = "" var key: string = "" var cards = [otherrealmobject]()//wasnt either override static func primarykey() -> string? { return "key" } // override static func ignoredproperties() -> [anyobject] { // return ["id"] //this didnt work either // } } this parent class class baserealmobject: object { //nothing here, extending realm's object } and runtime exception. 2015-08-19 10:03:53.388 app[84571:2188559] *** terminating app due uncaught exception 'rlmexception', reason: 'can't persist property 'id' incompatible type. add ignoredpropertynames: method ignore.' *** first throw call stack: ( 0 corefoundation