Posts

Showing posts from April, 2013

How to restrict string and date values in a Teradata table -

is there way impose restriction on teradata table fields, column education can contain: high school , bs , ms , phd , nothing else. if tries insert other string, referential integrity mechanism throw exception also, there way impose restriction date field, such newly inserted date must >= current_date ? thank experts it's same other rdbms (besides compress part, teradata save disk space): datecol date check(datecol >= current_date) maybe add not null constraint. education varchar(11) check (education in ('high school', 'bs', 'ms', 'phd')) in teradata should add compress ('high school', 'bs', 'ms', 'phd') to save disk space. of course insert 4 values in table, add primary key , foreign key referencing column...

php - getting secondary name using sub query -

i have 2 tables, 1st table holds categories list , 2nd table holds profile information along 1st table category id foreign key. follow table1 id category 1 first 2 second table2 id category name phone 1 2 john 9999999999 how retrieve table 2 records along category name (not id:2 shown in table 2) i tried this, select category, name, phone table2; i need see following line result second, john, 9999999999 get me out of step, in advance. what need join , means "combine" 2 tables linking rows 1 table rows table based on criterion. in case, criterion value of category in table2 must equal value of id in table1 , expressed follows: select table1.category, table2.name, table2.phone table2 join table1 on table2.category = table1.id if needed, can add where clause limit result specific rows, e.g. where table1.id = 9999999999 filter rows have category 9999999999.

php - apache cross domain configuration -

i trying setup application on server openspeedtest.com self-hosted app provided nginx configuration. how can make work on apache shared hosting server? fastcgi_read_timeout 360; client_max_body_size 2000m; location / { if ($http_origin) { add_header 'access-control-allow-origin' 'http://openspeedtest.com'; add_header 'access-control-allow-methods' 'get, post, options'; } if ($request_method = options ) { add_header access-control-allow-credentials "true"; add_header 'access-control-allow-headers' 'accept,authorization,cache-control,content-type,dnt,if-modified-since,keep-alive,origin,user-agent,x-mx-reqtoken,x-requested-with'; add_header access-control-allow-origin "http://openspeedtest.com"; add_header access-control-allow-methods "get, post, options"; return 204; } } add server! setting cors

php - regex detect any string with no extension at the end -

there string ending this: test/15-test how exclude strings have extension @ end. one: test/15-test.jpg and select one's no extension @ end. this pattern not working ^[a-za-z0-9\/-]+\/[0-9]+-*(?!(\.(\w)).)$ and string after number can contain utf-8 characters. example: test/14-تست you can use: /[\p{l}\p{n}\/-]+\/[0-9]+-[\p{l}\p{n}_]+$/u or /[\p{l}\p{n}\/-]+\/[0-9]+-[^.]+$/u

python - faster way to use the scikit-learn trained model -

i have trained prediction model using scikit-learn, , used pickle save hard drive. pickle file 58m, quite sizable. to use model, wrote this: def loadmodel(pkl_fn): open(pkl_fn, 'r') f: return pickle.load(f) if __name__ == "__main__": import sys feature_vals = read_features(sys.argv[1]) model = loadmodel("./model.pkl") # predict # model.predict(feature_vals) i wondering efficiency when running program many times in command line. pickle files supposed fast load, there way speed up? can compile whole thing binary executable? if worried loading time, can use joblib.dump , joblib.load , more efficient pickle in case of scikit-learn. for full (pretty straightforward) example see the docs or related answer ogrisel: save classifier disk in scikit-learn

javascript - Codemirror autocomplete and auto closing brackets doesnt trigger change event -

i have following problem. i've written server , client scripts node js work live collaboration code editing. 2 or more people can code in same instance of codemirror editor. until have enabled autocomplete feature , auto closing brackets working perfect, after did messed work. when use autocomplete list or when bracket or tag closed module not manually not recognized change. have inspected object codemirror instance returning , doesnt contain change have been done automatically. not strictly problem node js beacuse if want lets say, send changes server via ajax , save in file, wont happen beacuse not present in change object. had similiar problem , can help? client code: var appcm = codemirror.fromtextarea(document.getelementbyid('app-cm'), { mode: 'text/html', theme: "monokai", styleactiveline: true, linenumbers: true, matchbrackets: true, indentunit: 4, indentwithtabs: true, auto

vba - Is V() a utility function in Visual Basic? -

i'm trying reverse engineer calculator made visual basic. original author has function called on lot of variables looks like: v(offset) v(cpx) v(cang) i can't find anywhere in of functions wrote. don't think utility function in visual basic. know means? my best guess converting units of numbers called on format compatible other numbers. as mentioned gserg above, v not utility function.

eclipse - Cannot initiate the type GeoIPService in Java -

new soap. using eclipse mars jdk 1.8 under windows vista. i using http://www.webservicex.net/ws/wsdetails.aspx?catid=12&wsid=64 i following error: cannot initiate type geoipservice. idea why? import java.rmi.remoteexception; import javax.xml.rpc.serviceexception; import net.webservicex.www.geoip; import net.webservicex.www.geoipservice; import net.webservicex.www.geoipservicesoap; public class iplocationfinder { public static void main(string[] args) throws serviceexception, remoteexception { if (args.length != 1) { system.out.println("you need pass in 1 ip address"); } else { string ipaddress = args[0]; geoipservice geoipservice = new geoipservice(); //<== cannot initiate type geoipservice geoipservicesoap geoipservicesoap = geoipservice.getgeoipservicesoap(); geoip geoip = geoipservicesoap.getgeoip(ipaddress); system.out.println( geoip.getcountryname() ); } }}

How to check values from valuelist in coldfusion -

i have emp records records this: name, id, gender, itemvalue steve, 123, m, (3,4,5) bond, 456, m, (5,4) james, 345, f, (4,7) in table have references of itemvalues this: 3='test' 4='coder' 5='admin' now in record value, how check single value itemvalues ? example, check whether steve's itemvalue 5 or not in coldfusion? <cfif steve.itemvalue eq 5> <cfelse> if not 5 </cfif> you can use listfind() this: <cfloop query="getemployee"> <cfif findnocase("steve", getemployee.name) , listfind(getemployee.itemvalue, "5"> <cfelse> if not 5 </cfif> </cfloop>

AngularJS How to watch offset top position of elements? -

how watch offset top position (of each element) , if distance top screen border lower 100 px, need hide div. (each div can move on page). please write angular directive. i can't watch each element top offset. var app = angular.module('app', []); app.app.directive('blah', function() { return { restrict: 'a', link: function(scope, element) { element.show(); scope.$watch(function() { return element.offset().top > 120 }, function(outofborder) { if (outofborder) { element.hide() console.log(outofborder) } else { element.show() console.log(outofborder) } }); } } }); .all { height: 100px; width: 300px; border:1px solid; overflow: scroll; } .elements { height: 30px; width: 300px; border:1px solid red; float: left; clear: both; } <script src="https://ajax.googleapis.com/ajax/libs/angularjs/

php - BitCoin Gateway Proccessing Time -

i want write bitcoin gateway using blockchain api. with link address receiving bitcoin: https://blockchain.info/api/receive?method=create&address=169b4epdspnpxgxnsru9g56xxxxxxxxxxxx&callback=http%3a%2f%2fhost.com%2fbc%2frec.php%3fsecret%3d234r here 169b4epdspnpxgxnsru9g56xxxxxxxxxxxx bitcoin addres. give response: {"callback_url":"http:\/\/host.com\/bc\/rec.php?secret=234r","input_address":"199r12qvmuy7eusavtpzsgtx1rp15dd6e","destination":"169b4epdspnpxgxnsru9g56xxxxxxxxxxxx","fee_percent":0} and our customer should send bitcoins 199r12qvmuy7eusavtpzsgtx1rp15dd6e (the input address). but after sending bitcoin address, our main address ( 169b4epdspnpxgxnsru9g56xxxxxxxxxxxx ) won't receive bitcoins.

cordova - Ionic build failed with an exception -

i used proxy .i got error when tru run ionic build command.i put error message follow. d:\myapp\myone>ionic build android running command: "c:\program files\nodejs\node.exe" d:\myapp\myone\hooks\after_p repare\010_add_platform_class.js d:\myapp\myone add body class: platform-android running command: cmd "/s /c "d:\myapp\myone\platforms\android\cordova\build.bat" " android_home=c:\users\rajitha\appdata\local\android\android-sdk java_home=c:\program files\java\jdk1.7.0_79 running: d:\myapp\myone\platforms\android\gradlew cdvbuilddebug -b d:\myapp\myon e\platforms\android\build.gradle -dorg.gradle.daemon=true failure: build failed exception. * went wrong: problem occurred configuring root project 'android'. > not resolve dependencies configuration ':classpath'. > not resolve com.android.tools.build:gradle:0.9.0. required by: :android:unspecified > not 'https://repo1.maven.org/maven2/com/androi

sql - SSIS Package not showing under MSDB file -

i running sql server 2008 r2 , after trial , error created package server agent executes on schedule, on test server. when move on production server - using ssms logged in sa - create package right clicking database , going tasks did in test. when log integration services see folders including msdb folder, saved package isn't there. when go server agent , navigate package created it's there! fails when server agent runs it. i trying eliminate running of package thing causing error. first time has used integration service on production server maybe there's setup step missed? how packages show in ssms under msdb folder on test database?

email - SpamAssassin filter header -

i'm trying filter messages header return-path contains string '@example.eu'. i added /etc/mail/spamassasin/local.cf lines: my first attempt: header local_demonstration_all return-path =~ /example\.eu/i score local_demonstration_all 10.0 my second attempt: header local_demonstration_all =~ /return-path.*example.eu>/i score local_demonstration_all 10.0 another filters work, above doesn't. checked regex ok. what's wrong? thanks. the return-path header contains envelope sender , typically added email when delivered recipient's mailbox, i.e. not present visible header while email in transit. the envelope sender passed in smtp dialog using mail from command , can used in spamassassin rules, depending on how spamassassin being called actual details may vary. spamassassin has pseudo-header envelopefrom tries populate envelope sender using heuristics (or can tell spamassassin how should populated using envelope_sender_header

python - Function is not getting called -

i have below code have 2 functions print_menu() , pstockname() def print_menu(): print ("\t\t\t\t 1. stock series ") print ("\t\t\t\t 2. invoke stocks.") print ("\t\t\t\t 3. generate dc stock list . ") print ("\t\t\t\t 4. quit") def pstockname(): global stocklist, fstocklist pstocklist = [] fstocklist = [] stocklist = str(raw_input('enter pipe separated list of stocks : ')).upper().strip() items = stocklist.split("|") count = len(items) print 'total distint stock count : ', count items = list(set(stocklist.split("|"))) # pipelst = stocklist.split('|') # pipelst = [i.split('-mc')[0] in stocklist.split('|')] # pipelst = [i.replace('-mc','').replace('-mc','').replace('$','').replace('^','') in stocklist.split('|')] pipelst = [i.replace('-mc', '&#

javascript - with ajax js, passing an array to php -

i've created string array: 'id=$id&value=$value' 2 value id+checked, i'm trying pass array through php update db.. i'm newbie ajax don't know how correctly.. did inserting data form when works cool.. struggle badly issue. collect values table after click submit btn, please, out! js code: function ejecutarajax(datos) { ajax = objetoajax(); ajax.onreadystatechange = enviardatos; ajax.open("post", "trst.php"); ajax.setrequestheader("content-type", "application/x-www-form-urlencoded"); ajax.send(datos); } var datos = new array, querystring = '', id = new array(), status = new array(), checkstatus = document.getelementsbyname('check'); (i = 0; < checkstatus.length; i++) { id[i] = checkstatus[i].getattribute('data-id'); status[i] = checkstatus[i].checked; datos += "idstatus=" + id[i] + "&checkstatus=" + status[i] + &

php - How to set up task scheduling in Laravel 4? -

i've website made in laravel 4.2 , have monthly membership 30 credits. if user doesn't use of them, should expire @ valid_till date. i wish have piece of code run @ 12 every night , set credit 0 in everyone's account who's valid_till date equal yesterday or before that. if there task scheduling in laravel 5.1, runs function on particular time of day daily, perfect. know cron can set in laravel 4.2, using commands i'm unable understand how use in case? create file following in app/commands, replace comment in fire method update function. <?php use illuminate\console\command; use symfony\component\console\input\inputoption; use symfony\component\console\input\inputargument; class setcredittozero extends command { /** * console command name. * * @var string */ protected $name = 'set:zero'; /** * console command description. * * @var string */ protected $description = 'com

ios - UIButton Animation in Swift -

i'm trying make animation on button upon button press. case following. button have have picture of apple. when pressed change image1, image2, image3 (like .gif) , picture of pear. right i'm seeing change apple pear , skipping on animation i'm trying create. this code animation part: var image1:uiimage = uiimage(named: buttonanimationimage1)!; var image2:uiimage = uiimage(named: buttonanimationimage2)!; var image3:uiimage = uiimage(named: buttonanimationimage3)!; sender.imageview!.animationimages = [image1, image2, image3]; sender.imageview!.animationduration = 1.5; sender.imageview!.startanimating(); you can have behavior using animated images . var image1:uiimage = uiimage(named: buttonanimationimage1)!; var image2:uiimage = uiimage(named: buttonanimationimage2)!; var image3:uiimage = uiimage(named: buttonanimationimage3)!; var images = [image1, image2, image3] var animatedimage = uiimage.animatedimagewithimages(images, duration:

ios - Highlight words in UIAlertView? (with bold text) -

i want highlight words in uialertview message, either making bold, or, underline. let message = "this normal text.\nbold title:\n normal text" let alert = uialertview(title: "title", message: message, delegate: self, cancelbuttontitle: "cancel", otherbuttontitles: "ok") alert.show() how make "bold title" bold (or underline) in message? this not possible, uialertview api not support attributed strings, normal way accomplish this.

java - Android: app crashes at onTaskCompleted after app is closed -

i doing asynchronous tasks http fetch data. when close app in middle of asynchronous operation, nullpointerexception error. seems happening because asynchronous task being competed , ontaskcompleted called; app closed. does know how handle this? i'm running android studio, android version 4.4.2. galaxy s4. java.lang.nullpointerexception @ com.example.lu.seed_2.tabs.tab4$3.ontaskcompleted(tab4.java:174) @ com.example.lu.seed_2.articleasync.onpostexecute(articleasync.java:36) @ com.example.lu.seed_2.articleasync.onpostexecute(articleasync.java:11) @ android.os.asynctask.finish(asynctask.java:632) @ android.os.asynctask.access$600(asynctask.java:177) @ android.os.asynctask$internalhandler.handlemessage(asynctask.java:645) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:157) @ android.app.activitythread.main(activitythread.java:5356) @ java.lang.reflec

url - how can I use encoding URIbuilder() method in Java -

i'm using api in java. i need use korean text in uri, , request string variable. if set request = "안녕하세요"; , use code: final uri uri = new uribuilder().setscheme("https").sethost(server + "api.net").setpath("/api/" + "/" + **request**).setparameters(param).build(). ; if use this, can see following result: https://api.net/api/%ec%95%88%eb%85%95%ed%95%98%ec%84%b8%ec%9a%94?api_key i tried use code: final uri uri = new uribuilder().setscheme("https").sethost(server + "api.net").setpath("/api/" + "/" + **urlencoder.encode(request, "utf-8")**).setparameters(param).build(). ; but getting same result. how can solve problem? your uri has been encoded. url, can't use special characters, if want retrieve request string, must decode specific part of uri, this: string result = java.net.urldecoder.decode(uri.getpath(), "utf-8"); system.out.printl

Using an eval() server side in a Python/Django application -

eval evil, rm -rf /, etc etc... but lets silly reason want leverage power of eval basic computations , conditionals. i want idea of potential risks having eval block sitting around in server side code, , can in order mitigate them. for starters, eval run against user input... scarier know. these super users , who, in theory can trusted, disgruntled former employees , thing. the intended use of input provide formula used calculations against spreadsheet parsed. example, intended input like: ({{column a}} + {{column b}}) * {{column c}} a regex engine run on value replace curly bracket values appropriate column values, turn statement like: (5 + 6) * 11 however, left alone, recognize like: from subprocess import call; call(["rm", "-rf", "/"]) so, idea come clean method allow for: 1) string values valid 2) within brackets valid since won't eval'd 3) nothing else containing alphanumeric characters valid. what i've got far

html - Fixing footer issues in web page which is powered by bootstrap -

Image
i've requirement if size of browser less 992*1024 , scrolling added automatically. footer wrote working, i'm unable position media part. wrote footer shown in screen shot: i'm trying create footer similar this: here code. .imgcontainer { background: #e6e6e6; box-shadow: 0 4px 2px 1px #000; } #footer { height: 350px; background: #003663; min-width: 992px; } #footeritems { min-width: 992px; width: 100%; padding: 0px 6%; min-width: 992px; } #footeritems div { display: inline-block; color: #fff; padding-top: 2%; font-weight: bold; font-size: 16px; } .accountpos { padding-left: 3%; } #footeritems div ul { padding-left: 0; } #footeritems div ul li { list-style-type: none; font-weight: 400; font-size: 13px; font-style: italic; } #videoptions { height: 74px; width: 23px; background-color: #4c5053; } #footeritems div video { min-width: 35px; min-height: 30px; } .socialinks {

Android assets as a File -

i want add hierarchy of files android program , use of them files. possible add them assets folder , files , directories of assets folder files? (for example if have pictures directory in assets, create file path pictures folder of assets). it depends need for. cannot access assets via file if need so, can copy assets content local filesystem or storage , use it. alternatively can rethink how use assets.

json - Parsing a timestamp based PHP std class obkect -

i have php standard class object converted json_decode of rest call on api looks : array ( [1437688713] => stdclass object ( [handle] => keep logically awesome. [id] => 377748 [ping] => stdclass object ( [url] => https://api.me.com [id] => 377748 [name] => web [active] => 1 [events] => array ( [0] => data_new [1] => data_old ) so far had no issues in parsing of php objects. 1 failing because can not access nested object elements using key since 1437688713 not assigned key , accessing object failing if try this: $object->1437688713->handle is there way access these elements ? update: 1 more thing, never know value (1437688713) in advance. key. stdclass object have parse.

linux - /bin/sh: /user/bin/cc Permission denied -

Image
i trying instal git on buehost shared hosting server. i following blog install http://www.willjackson.org/blog/installing-git-bluehost-shared-hosting but when run make command following error.. please me out you have not permission compile applications on shared hosting. think should try vps. update: in tutorial author unzips git-master.zip ~/.local/scr/git-master . have git-master in ~ . maybe should try again step step? think this video can you.

ecmascript 6 - Is it possible to use ES6 For..Of on an Object instead of an Array? -

this question has answer here: using objects in of loops 11 answers on babel-node repl typeerror: undefined not function when trying iterate using for..of on object. don't why for..in work, for..of won't. arrays? const config = { base: 'iei', url: 'www.' } (let of config) { console.log(i); } no, for of iterables . not objects iterable. can create custom iterator object, though: object.values = function* (o) { (let k of object.keys(o)) yield o[k]; }; (let of object.values(config)) console.log(i); // 'iei', 'www.'

algorithm - Reordering a linked list efficiently -

i got question in interview follows: if have linked list this, 1->2->3->4->5->6 i have convert to, 1->6->2->5->3->4 and if is, this, 1->2->3->4->5->6->7 i have convert to 1->7->2->6->3->5->4 and, importantly, have modify original linked list , cannot make new linked list. thought of recursion this. but, couldn't solve it. moreover, constraint function can have head of linked list. this can done in linear time o(n) , during interviews (unfortunately) counts more robustness of solution. you can splitting original list 2 (as) equally sized (as possible) list, reversing second 1 , merging both of them element element (first element first list, second element second list etc). don't need additional space can use existing pointers. for example: 1->2->3->4->5->6 1->2->3 , 4->5->6 // after split, 3 points null, 4 head of second list 1->2->3 , 4<-5

html - How do I display an empty div tag with CSS? -

how force empty div tag show? have add &nbsp; in div show. there way force display using css? <div class="bar bg-success" title="2015-07-23,5.0000" height="50%"></div> .bar { background: green; width: 5px; float: left; position: relative; } i tried adding .bar:after { content: " "; } but didn't help. fiddle: http://jsfiddle.net/cf0gprln/ bootply: http://www.bootply.com/tnjkapio7l please ignore below answers saying set height in css. height has set dynamically. &nbsp; makes display. sorry realize made mistake height style. i'm not sure thinking. however, still doesn't work with: <div class="bar bg-success" title="2015-07-23,5.0000" style="height: 50%;"></div> i see works in jsfiddle, not bootply. it's problem bootstrap. since question changed, i'll re-enter different question. updated bootply inline style: http://www.bootpl

Error handler for MBassador message/event bus -

i'm using mbassador 1.2.1 message/event bus. works well. except getting error message in logs, repeated each of instantiated bus objects: warn: no error handler configured handle exceptions during publication. error handlers can added instance of abstractpubsubsupport or via busconfiguration. falling console logger. the main project page shows example line on busconfiguration object: .addpublicationerrorhandler( new ipublicationerrorhandler{...} ) …yet neither ide nor see such method on busconfiguration class. how should go installing error handler mbassador? add property when building configuration bus: ibusconfiguration config = new busconfiguration() .addfeature(feature.syncpubsub.default()) .addfeature(feature.asynchronoushandlerinvocation.default()) .addfeature(feature.asynchronousmessagedispatch.default()) .setproperty(properties.common.id, "command channel bus")

java - deploy same plug with different version -

i have osgi project couple plugins 1 of plugin called: com.lilum.sr.util and otheres plugin use plugin plugin: com.lilum.sr.servea require-bundle: org.eclipse.core.runtime, com.lilum.sr.util="1.2.3" com.lilum.sr.serveb require-bundle: org.eclipse.core.runtime, com.lilum.sr.util="1.2.5" as can see plugin com.lilum.sr.servea use com.lilum.sr.util version 1.2.3 and plugin com.lilum.sr.serveb use com.lilum.sr.util version 1.2.5 and when deploy them, both use com.lilum.sr.util highets version (1.2.5) want force com.lilum.sr.servea use com.lilum.sr.util (1.2.3) there way it? i try use range version ([1.2.3, 1.2.4)) error can't resolve com.lilum.sr.util_[1.2.3, 1.2.4) it's seems osgi deploy highets version in osgi, third segment of version identifies "service" or "patch" release. first , second identify when api has changed. because of this, osgi treating 2 bundles equivalent in api , op

c# - asp.net inserting data with " ' " causes exception -

i inserting data .mdf database through webpage. when insert words contain apostrophe " ' ", causes exception. tried escape \' inserts whole " \' ". don't want insert these directly database table through visual studio because need date.now time/date inserted (through c#). please show me how insert " ' " , other characters. in advance. you can escape double apostrophe '' , shouldn't use in sqlcommand text. add parameters using sqlcommand.parameters avoid sql injection possibility.

ios - Using blocks to download image, freezing UI -

in app downloading image using blocks freezing ui. have 1 network class contains method download image, -(void)downloadimagewithcompletionhandler:^(nsdata *adata, nserror *error)ablock; i calling above method in view controller download image. once image downloaded using nsdata show in image view. network class method uses nsurlconnection methods download image. [[nsurlconnection alloc] initwithrequest:theurlrequest delegate:self]; once data download complete calling completion handler block of view controller. but not sure why ui freezing? can me find doing wrong? thanks in advance! - (void) setthumbnailurlstring:(nsstring *)urlstring { nsstring *url= [nsstring stringwithformat:@"%@",urlstring]; //set request: nsmutableurlrequest *request = [[nsmutableurlrequest alloc]init]; [request seturl:[nsurl urlwithstring:url]]; nsoperationqueue *queue=[[nsoperationqueue alloc] init]; if ( queue == nil ){ queue = [[nsoperatio

count - Strange result in DB2. Divergences queries -

a strange thing, don't know cause, happenning when trying collect results db2 database. the query following: select count(*) myschema.table1 t1 not exists ( select * myschema.table2 t2 t2.primary_key_part_1 = t1.primary_key_part_2 , t2.primary_key_part_2 = t1.primary_key_part_2 ) it simple one. strange thing is, same query, if change count(*) * 8 results , using count(*) 2 . process repeated more times , strange result still continuing. at example, table2 parent table of table1 primary key of table1 primary_key_part_1 , primary_key_part_2 , , primary key of table2 primary_key_part_1, primary_key_part_2 , primary_key_part_3 . there's no foreign key between them (because legacy ones) , have huge amount of data. the db2 query select versionnumber sysibm.sysversions returns: 7020400 8020400 9010600 and client used squirrelsql 3.6 (without rows limit marked). so, explanatio

uinavigationcontroller - iOS Universal app seems slightly zoomed in on phone -

Image
i have ipad app i'm converting universal app show on phones. has both tab bar , navigation bar, , problem both way big on phone. swear heard paul hegarty (from itunes u class stanford on swift app development) mention switch or trick somewhere cause bars adapt iphone, can't find it. here screenshots of apps bars, vs photos app in iphone 6 simulator show i'm talking about. not huge difference, significant on small phone screen. my fonts way big, confusing since have them set system "headline" or "body" options size classes, may separate issue. any appreciated! app written in swift, using storyboards ios8, btw. edit: the more @ this, more i'm convinced it's not related bars, entire app - fonts , everything. whole app appears zoomed in 120%, subtle, looks bad , wastes space. i have seen in second app - apple datecell sample . appears 'zoomed in' when run on iphone 6 simulator. edit 2: effect more exaggerated on

What is the way to verify beforehand if a function works for any version of java jre? -

i'm relatively new using java , tried of codes in other computers (with different versions of jre or jdk) ...for example, i've been trying know if function .newline() works jre1.6 ...but can't find it writer = new bufferedwriter(new outputstreamwriter( new fileoutputstream(directorio523+"tabla1.txt"), "utf-8")); writer.write("something"); writer.newline(); so, there web wich identify or command linux put? check the class's javadoc . in case, class noted being present "since jdk1.1", , method doesn't have more specific date, since java 1.1 should support it.

database - Excel DB connection: insert, update & delete? -

i used data - from other sources - from sql server controls import database table excel workbook. looks perfect, , refreshing data works charm. however, whenever make changes table (editing, inserting or deleting rows), cannot seem find way push these changes database. makes me wonder whether possible. can tell me how this, or confirm not supported? when make 'live' table in excel linking external data source have described in question, excel manages using querytable object behind scenes. querytable objects have ability refreshed on demand, , refresh on periodic schedule defined user. quertytable objects not bi-directional. can used import data excel, not write changes data source. querytable objects can manipulated vba. custom vba code can written automatically write data source changes made user table. absolutely requires writing code... not simple option can select excel user interface table. can tell me how this, or confirm not supported?

web services - Swagger editing api-docs? -

i'm new developing rest web services , now, i'm trying add authenication via url: http://developers-blog.helloreverb.com/enabling-oauth-with-swagger/ unfortunately, i'm stuck on first step, when says edit resource listing, believe api-docs, right? so, how supposed edit if generated service , not stored file anywhere? my swagger version 1.2 the link provided refers swagger 1.2 latest version swagger 2.0 as starting point, may consider using editor.swagger.io , reviewing petstore example, contains authentication-related setting

sql - I want project_manager column which is not null -

query sql :: want project_manager column not null alias name. want query having null in project_manager. having trouble getting required query(project_manager having null). how can ? select t_gps_applications.application_id, t_gps_applications.application_name, (select u.first_name || ' ' || u.middle_name || ' ' || u.last_name tas.t_users u, t_gps_app_properties ap to_char(u.user_id) = ap.property_value , ap.property_name = 'project_manager' , ap.application_id = t_gps_applications.application_id) project_manager, decode(t_gps_applications.visible_flag, 'false', 'closed', decode((select count(1) t_gps_instances gi gi.application_id = t_gps_applications.application_id),

java - hibernate - could not execute statement; SQL [n/a] - saving nested object -

i'm trying save nested object using hibernate , receive could not execute statement; sql [n/a] exception code @entity @table(name = "listing") @inheritance(strategy = inheritancetype.joined) public class listing implements serializable { @id @column(name = "listing_id") private string listingid; @column(name = "property_type") private propertytype propertytype; @column(name = "category") private category category; @column(name = "price_currency") private string pricecurrency; @column(name = "price_value") private double pricevalue; @column(name = "map_point") private mappoint mappoint; @column(name = "commission_fee_info") private commissionfeeinfo commissionfeeinfo; } public class mappoint implements serializable { private final float latitude; private final float longitude; } public class commissionfeeinfo implements serializable { private string

html - Change DIV display value using Javascript/Jquery function -

update: fixed , working. help. hello i'm making javascript/jquery button when clicked, div appears (display: inline-block), , when clicked again div goes display: none. ideally want animate movement, want working first. my button... <button> menu test </button> my function (updated)... <script> $("button").click(function(){ $("#flexmenu").toggle("slow", function() { }); }); </script> the css flexmenu... #flexmenu { /* display: inline-block;*/ position: fixed; float: left; background: #1f1f1f; margin: 3.9em 0 0 0; padding: .25em; width: 15%; height: 6em; border: 2px solid #fff; z-index: 100; } i'm sure how grab display property of id , change it. i've done hover function before using css ease-out make divs grow in size when hovered , change class using $(this).toggleclass(nameofclass), have never tried changing element. other questions didn't fit changing display val

javascript - Add style to child element inside target -

currently have script adds display:block target element matching id. document.getelementbyid(id).style.display = 'block'; ...but want change add's style or class child div element. you can grab child element using javascript code: document.getelementbyid(id)[0].style.display = 'block'; it's accessing item inside of array.

Correct method on passing PHP variables that contains date and time to javascript -

i'm bit confuse on passing php variables contains date on onclick attribute of button, example.. (for reason, put button inside echo) <?php $date = date("f-d-y", "2015-07-24"); //to convert string 2015-07-24 date specific format echo "<button onclick = 'gotothisjsmethod(".$date.")'> pass </button>"; ?> on javascript part wherein gotothisjsmethod written. function gotothisjsmethod(daterec){ alert (daterec); } the syntax above results nothing , alert box didn't appear i tried changing above code, alter parameter passed on php, instead of using $date variable, used exact string of date parameter , change javascript this: function gotothisjsmethod(daterec){ var date = new date(daterec); alert(date.getmonth()+1 " " + date.getdate() + " " + date.getfullyear()); } yes there's result again, returns default date of 1/1/1970 . should regarding problem? the bigg

angularjs - Error: Graph container element not found -

why getting exception "uncaught error: graph container element not found" when using morris.js? solution: put javascript after morris.js div from post tiraeth: https://github.com/morrisjs/morris.js/issues/137

sql server - Select SQL with conditions to count different values -

i'm trying query on sql i'm stuck! i have 2 tables: table 1: question table 2: answer for each question can have 1 or more answers different users each user can comment 1 time. when user answers question, must choose 1 status answer: 1) agree, 2) disagree or 3) discuss so, "question" table has questions this: id question 1 q1 2 q2 3 q3 ..and "answer" table has answers users, plus fk "question" table , column status chosen user. id answer idquestion status 1 a1 1 1 2 a2 1 3 3 a3 2 2 4 a4 2 2 5 a5 3 1 what need: need select questions , need count questions has different aswer's status. example: question 1 has 2 answers , 2 answers has different status. need count or put number know question has answers diffent status. question 2 has 2 answers answers has same status. don't need count that.. or maybe put o

neo4j - How to use exists, findOne and other GraphRepository methods, taking id as argument? -

let assume following: 1). have 2 entities: @nodeentity public class { @graphid private long id; ... } @nodeentity public class b { @graphid private long id; ... } 2). have 2 appropriate repositories: public interface arepository extends graphrepository<a> { ... } public interface brepository extends graphrepository<b> { ... } 3). , have following nodes in database: a id=1 b id=2 case a: assume need check whether id=2 exists: arepository.exists(2) i expect return false , since id=2 isn't exists. returns true , since tries find among ids, not among nodes. case b: or maybe need find b id=1: brepository.findone(1); i expect returns null or throws appropriate exception, informing b id=1 isn't exists. throws unexpected me persistententityconversionexception . hence questions: how can use aforementioned operations expected behavior? may there workaround?

javascript - node.js callbacks http server read dir -

rookie problems, unable make script show file listings, think walk async, have nothing in errors help. regards, marcelo // ---- listfiles.js ----------------------------------------------------------- exports.walk = function(currentdirpath, extension, callback) { var fs = require('fs'); var regex = new regexp( extension + '$', 'g' ); fs.readdir( currentdirpath, function (err, files) { if (err) callback(err); files.filter(function(fname){ if(fname.match(regex)) { callback(null, fname); } }) }); console.log("fired callback."); } // walk('.', 'js', function(err, file){ console.log(file); }); runs ok // ---- listfilestest.js -------------------------------------------------------- var http = require('http'); var content = require('./listfiles'); var args = process.argv.slice(2); console.log(args); // command line arguments (dir &am

MySql self join predicate not understanding how it works -

i learning self joins , have simple table: +-----------+-------------+ | name | location | +-----------+-------------+ | robert | guadalajara | | manuel | guadalajara | | dalia | guadalajara | | alejandra | guadalajara | | luis | guadalajara | | monica | guadalajara | | claudia | guadalajara | | scartlet | guadalajara | | sergio | guadalajara | | rick | mexico city | | rene | mexico city | | ramon | culiacan | | junior | culiacan | | kasandra | culiacan | | emma | culiacan | | johnatha | dunedin | | miriam | largo | | julie | largo | +-----------+-------------+ what intended find people share same location 'robert'. using self joins saw following works reading solutions on here but, don't understand going on , not able explain if asked me how worked: select users1.name users users1, users users2 users1.location = users2.location , users2.name = 'robert'; correctl

How can we send user input taken from UI to commandline and run a command using objective c -

i want reset mac osx password , want gui. know in terminal have run following command. aug4-2:~ root# passwd changing password root new password: retype new password: for want provide user interface, user can reset user password. need use nstask , nspipe task. if 1 have code snippet please post here try using apple script. tell application "system events" activate display dialog "please enter old password:" default answer "" title "password reset" hidden answer set pswd0 text returned of result end tell tell application "system events" activate display dialog "please enter new password:" default answer "" title "password reset" hidden answer set pswd1 text returned of result end tell tell application "system events" activate display dialog "please re-enter new password:" default answer "" title "password reset&quo

java - Random javax.net.ssl.SSLExceptions using OkHttp client -

in android app using okhttp client trusts ssl certificates. problem is, facing random sslexceptions. example 8 out of 10 calls fail due sslexceptions , 2 succeed. any pointers on why might happening? please let me know if need more info. stack trace: javax.net.ssl.sslexception: connection closed peer @ com.android.org.conscrypt.nativecrypto.ssl_do_handshake(native method) @ com.android.org.conscrypt.opensslsocketimpl.starthandshake(opensslsocketimpl.java:405) @ com.squareup.okhttp.internal.http.socketconnector.connecttls(socketconnector.java:103) @ com.squareup.okhttp.connection.connect(connection.java:143) @ com.squareup.okhttp.connection.connectandsetowner(connection.java:185) @ com.squareup.okhttp.okhttpclient$1.connectandsetowner(okhttpclient.java:128) @ com.squareup.okhttp.internal.http.httpengine.nextconnection(httpengine.java:341) @ com.squareup.okhttp.internal.http.httpengine.connect(httpengine.java:330)

Adding a fragment in android on button click and adding data to it simultaneously -

i creating android app in have main activity has 2 fragments, fragup , fragdown. fragup has 2 edit text fields , button , fragdown has 2 text view fields. initially main activity shows fragup , asks user input fields, when user clicks button onclick method triggered , fragdown created below fragup , shows 2 fields entered user. summary- fragments- fragup , fragdown main activity- main activity main activity has 2 linear layouts 1.ly1 fragup 2.ly2 fragdown note- fragments added dynamically in main java file , not declared in main.xml file. this main activity code public class mainactivity extends appcompatactivity implements fragup.fraginterface { fragmenttransaction ft,ft1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_second); ft=getfragmentmanager().begintransaction(); fragup fu=new fragup(); ft.add(r.id.ly1,fu); //fragment fr

php - Get Records from database of all months -

i developing web application in symfony. want fetch records database according months. query is: $totalsearchesbyadminall = $em->createquerybuilder() ->select('count(searchhistory.id) totalsearchesbyadmin') ->from('drpadminbundle:log', 'searchhistory') ->where('searchhistory.last_updated :last_updated') ->setparameter('last_updated',??????.'%') ->andwhere('searchhistory.event = :event') ->setparameter('event','admin_search') ->getquery() ->getarrayresult(); last_updated datetime field , stores in database like: 2015-06-12 11:50:44 i want records jan=>5 feb=>10 .....and on.. please help you can group data month , year date_format mysql statement. in order use mysql function in dql doctrine statement suggest install mapado/mysql-doctrine-functions doctrine function. add composer.json , enable in config.yml follow: #ap

java ee - Content of a dockerfile to run glassfish server and deploy specific application from a git repository -

i trying deploy java ee application using glassfish 4.1 server , deploy docker container. as consequence, i'd writing correct docker download/start glassfish server , deploy application on it, using corresponding git repository. currently able build docker container starting glassfish server following dockerfile: from java:8-jdk env java_home /usr/lib/jvm/java-8-openjdk-amd64 env glassfish_home /usr/local/glassfish4 env path $path:$java_home/bin:$glassfish_home/bin run apt-get update && \ apt-get install -y curl unzip zip inotify-tools && \ rm -rf /var/lib/apt/lists/* run curl -l -o /tmp/glassfish-4.1.zip http://download.java.net/glassfish/4.1/release/glassfish-4.1.zip && \ unzip /tmp/glassfish-4.1.zip -d /usr/local && \ rm -f /tmp/glassfish-4.1.zip expose 8080 4848 8181 workdir /usr/local/glassfish4 # verbos