Posts

Showing posts from April, 2012

select all the highest money making movies from each studio IN mysql TABLE -

i have table has studio, title, , worldwide column in mysql table. want select highest money making movies each studio. how can achieve this? please me. thank you edit i have following code doesn't work properly select studio, max(cast(worldwide int)* 1000000), title top_movies group studio; select studio_name, movie_name, total_money top_movies join ( select studio, max(total_money) tmoney top_movies group studio ) b on top_movies.studio = b.studio , top_movies.total_money = b.tmoney

php - How to push xml object to array? -

i want push each coa array.here xml file code. <?xml version="1.0" encoding="utf-8"?> <companies> <company> <name>best western</name> <groups> <group> <coa>410101 · net room revenue taxable</coa> <coa>415101 · gtd no show</coa> <coa>total 400000 · room revenue</coa> <coa>total · room revenue</coa> <coa>ii · other operating revenue</coa> <coa>425120 · meeting room</coa> <coa>480380 · interest income</coa> <coa>480383 · guest laundry</coa> <coa>480385 · vending</coa> <coa>480389 · miscellaneous</coa> <coa>482000 · sales tax discounts</coa> <coa>total 480000 · other

c++ - why i can pre-compile c'tor of father but not his attribute? cpp -

good morning. when tring pre-compile (i dont know real name of this..) father c'tor this: point_3d(int _x, int _y, int _z) :point_2d(_x, _y, _z), z(_z+100){}; its working. when trieng this: point_3d(int _x, int _y, int _z) :point_2d(_x, _y, _z), _x(4), z(_z+100){}; it doesnt. (the '_x' parameter belongs father.) , little question: why cant pre-compile '=' , must use '()'? thanks! assuming _x(4) refers member of point_2d class, can initialized owning class, not derived classes. the initalizer list can contain base classes , members of current class, not members of base classes. but wouldn't point_3d(int _x, int _y, int _z) :point_2d(4, _y, _z), z(_z+100){}; ___________________________________________^ do want?

java - Uber Refresh Authenticator crash -

my app receives accesstoken , refreshtoken , expirytimeinmillis after doing uber websetup. these storing in file via storedcredential . whenever have create session create credential follows reading values stored in storedcredential . private credential createcredential(){ credential.builder builder = new credential.builder(new credential.accessmethod() { @override public void intercept(httprequest request, string accesstoken) throws ioexception { /** * nothing */ } @override public string getaccesstokenfromrequest(httprequest request) { /** * nothing */ return null; } }); builder.settransport(new mockhttptransport()); builder.setjsonfactory(new mockjsonfactory()); builder.setclientauthentication(new basicauthentication("user","pass")); string query = ""; try { query = urlencod

javascript - What is the difference between clicking the refresh button in the browser and selecting the link and pressing enter? -

in web application,i have made pin popup supposed popup , disable rest of screen after timeout. when page refreshed(ctrl+r) or clicking on refresh button, pin popup appears, if link highlighted , enter key pressed, popup not come. how (click on link , press enter) different (ctrl+r) or clicking on refresh button? please in advance. generally: clicking on link (or tab , enter/space) starts new (get scratch (like open new browser , paste url in address)). while refresh/ctrl-r resends previous command - if post post. you can use ctrl-f5 new get. in addition: element on page (specifically link in case) may have event handler applied can stop default action. so, if yout link has event handler contains e.preventdefault(); or return false; (eg <a href='...' onclick='return false;'>link</a> ) appear nothing happening. pressing enter/space on focused link same clicking (runs .click() event handler).

serialization - Spring MVC - should my domain classes implement Serializable for over-the-wire transfer? -

i'm trying learn spring boot implementing simple rest api. my understanding if need transfer object on wire, object should implement serializable. in many examples on net though, including official ones, domain classes need transferred server client (or vice-versa) not implement serializable. for instance: https://spring.io/guides/gs/rest-service/ but in cases, do: for instance: https://github.com/szerhusenbc/jwt-spring-security-demo/blob/master/src/main/java/org/zerhusen/security/jwtauthenticationrequest.java is there general rule of thumb on when implement serializable? using java serialization api means need in java on other side of wire deserialize objects, have control code deserializes code serializes. this typically isn't relevant rest applications, consuming application response business of else's code, outside organization. when building rest application it's normal try avoid imposing limitations on consuming it, picking format more t

Python couchdb script consuming too much memory (getting KILLED) -

i'm processing couchdb view has on 10 million rows returned. there way iterate on rows "clean up" memory after i've processed row? for example, in django can use queryset.iterator() prevent queryset caching helps memory consumption. this i'm doing: couch = couchdb.server(url) couch.resource.credentials = (username, password) db = couch[database_name] result = db.view('xxx/xxx', none, stale='update_after', reduce='false') total = 0 row in result.rows: total += row['value'].num my actual code more complicated please don't suggest using reduce in couchdb.

api - overwrite csv file using jmeter beanshell -

Image
i'm testing api service using oauth tokens. have divide load per api service, therefore seperated services in different thread groups (also make requests in parallel). since extracted oauth tokens (you need acces token make request api) local thread groups, used small beanshell script write tokens csv file. later on, these tokens used when doing api calls. the problem i'm facing 'csv dataset config' element pre-loaded in memory (correct me if wrong), , because tokens arent received yet @ point api calls failing regex eof. happens few times after request succeed. implemented once controller api requests implement thinktime, helps waiting users authenticated , receive tokens. question 1: how can read token values in realtime csv file each api call (using custom code/beanshell)? question 2: how can make beanshell script (see below) rewrite whole csv file each time oauth2 sequence run (now keeps on appending it..) ? situation: issue fixed using 2 sepe

c++ - Var members in a class -

i'll try , explain more example. have square , want able initialise variable dimensions such (width,length) = (int, int) or (double, int) or (double, double) etc.. i know if wanted square have integer sides declare int width , int height how declare can take many forms ? eg: header.h class square { public: // constructor : initialise dimensions square(); // set dimensions template< typename t1, typename t2> setdim(t1 x, t2 y); private: // right ???? template <typename t> t width; template <typename t> t height; }; moreover, if create square how initialise variables 0. e.g: src.cpp square::square() { // correct ??? width = 0; height = 0; } it doable, need 2 different types width , height, if understand question correctly (and note rectangle, not square, technically speaking). #include <iostr

angularfire - Firebase force to use map rather than array -

in firebase quide read array: https://www.firebase.com/docs/web/guide/understanding-data.html#section-arrays-in-firebase especially : however, developers storing arrays in firebase database, when data read using val() or via rest api, if data looks array, firebase clients render array. in particular, if of keys integers, , more half of keys between 0 , maximum key in object have non-empty values, firebase clients render array. latter part important keep in mind. is there way force firebase use map , never convert data array? configuration? in example in firebase have got structure that: { "0": { "drivers" : { "12" : { "latitude" : 50.076574, "longitude" : 19.9209708, "timestamp" : 1456311442329 }, "13" : { "latitude" : 50.0166148, "longitude" : 20.9863258, "timestamp" : 1456395866163 } } } }, { "1" : {

javascript - How to stop a scheduled ontick event on Cesium -

i have 2 buttons on code add , delete primitives when clicked. on other hand, have event listener ontick method input active primitive , variable indicating index, , supposed used primitive particular index event. when did debugging saw although input argument updated parameter used event listener not updated. , got error object destroyed. do know how can update these arguments or stop scheduled events? ontick cesium event addeventlistener function returns hook unsubscribe. call return value, later, when want end subscription event. var unsubscribe = viewer.clock.ontick.addeventlistener(mycallback); // ... later ... // stop ontick callback. unsubscribe();

operating system - Python: os.chdir does not work in Python? -

i have below code snippet , function chdir doesn't seem work.. cwd_path = os.getcwd() print("cwd: " + cwd_path) changed = os.chdir(r"c:/cisco/python/my_learning/prank") print(changed) the below output: cwd c:\cisco\python\my_learning none as can read here os.chdir returns none in cases.

c++ - Stringstream trouble -

so,i'm trying conversion(integer string) , add string another.but seems stringstream not working..(it's working loop causes troubles) i'm done google & tried can't code work..anyone me :( ? #include <iostream> #include <string> #include <sstream> using namespace std; int main() { int n; cin>>n; string arr[n]; string a; int i=0; int s; int c; cin>>a; arr[i] = a; i++; cout<<"ok"<<endl; n--; while(n--) { cin>>a; s = 0; for(int j=0;j<i;j++) { if(arr[j] == a) { s = 1; break; } } i++; if(s == 0) { arr[i] = a; cout<<"ok"<<endl; } else { c++; stringstream ss; ss<<c; string m = ss.str(); a+=m; arr[i] = a; cout<<a<<endl; ss.str(""); ss.clear(); } } return 0; }

Access Form SQL -

i had question requires theoretical ideas/solutions rather exact execution plans. i`m trying design ms access form (i have experience access it's been while , not enough practice), can compare 2 tables (table 1 , table 2) , gather list of names against other. now know how , query results. problem arises when have multiple other tables want compare table 1 , of them have different columns. this ongoing testing process , new changes introduced monthly/annually, want automated form can use button (or less time consuming using queries everytime). primary key have been useful since don't exist, full names best option. another question related is, if excel tables stored in local server folders, there way retrieve files our database without manual imports? pass-through queries? i don't mean throw work @ other people because of laziness, want overview of approach can take. advice appreciated! thank you. i want automated form can use button... this mac

Ubuntu: large syslog and kern.log files -

logging ubuntu machine, warning running out of disk space. tracing back, find syslogs, kern.log(s) eating 1tb disk. -rw-r----- 1 syslog adm 240g feb 25 14:22 kern.log -rw-r----- 1 syslog adm 516g feb 21 07:59 kern.log.1 -rw-r----- 1 syslog adm 1.1k feb 15 07:39 kern.log.2.gz -rw-r----- 1 syslog adm 19k feb 7 07:56 kern.log.3.gz -rw-r----- 1 syslog adm 37k feb 1 07:45 kern.log.4.gz -rw-r----- 1 syslog adm 23g feb 25 14:52 syslog -rw-r----- 1 syslog adm 25g feb 25 08:11 syslog.1 -rw-r----- 1 syslog adm 1.6g feb 24 07:49 syslog.2.gz -rw-r----- 1 syslog adm 1.7g feb 23 08:18 syslog.3.gz -rw-r----- 1 syslog adm 3.4g feb 22 08:19 syslog.4.gz -rw-r----- 1 syslog adm 3.6g feb 21 07:59 syslog.5.gz -rw-r----- 1 syslog adm 6.9g feb 20 07:38 syslog.6.gz -rw-r----- 1 syslog adm 7.3g feb 19 07:36 syslog.7.gz from snippet above, can find kern.log , kern.log.1 eating 80% of 1tb disk. can space deleting files, think won't solve problem. does have idea on issue might be? saw can logg

iphone - Need guideline about IOS notification process with php api -

i'm php developer, , developed api fetching data database , converting json encode ios app. according ios developer ios app hitting api file notification once user open app , kill it. what need do? according requirement once ios app hit api , received data database ios app should not received data again till 20 minutes, in other words can app shouldn't hit again api file. what wanted know? i want know possible above mention task ( ios app shouldn't received notification or data server till 20 minutes once received it. ) in ios app. ios developer said me not possible inside app, can done server , php side. can guide me possible inside app ? appreciate. yes possible ios app. developer can use nstimer , set time limit 20 mins.

operators - Python: Concise way to toggle boolean "once" (i.e., in one direction) -

i find myself needing update boolean variable when happens first time (and then). using var = not var out of question since continue flip-flopping every time. (sorry silly example; i'm struggling find more sensible one…) inner_has_been_two = false outer in range(5): inner in range(3): if inner == 2: if not inner_has_been_two: inner_has_been_two = true print(inner_has_been_two) let's assume want "touch" variable little possible—otherwise overwrite again , again omitting innermost if -statement. basically i'm looking more terse, pythonic way emulate (the binary versions of ternary conditional operator, like) elvis operator ( ?: ) or null coalescing operator (e.g. ?? ; varies upon language). any ideas on how keep short(er) , clear? setting true each time fast: single machine cycle, easy parallel process. if want logically trying do: inner_has_been_true |= true this single-cycle instruction

How ffmpeg can return wavespic png image to console in png -

this command return wavespic in stdout. ffmpeg -i "/home/01.mp3" -filter_complex "aformat=channel_layouts=mono,compand,showwavespic=s=640x120" -frames:v 1 -f image2 - i want return stdout wavespic in png format. cant choose format in case -f image2 - . yes can -f output.png dont want save file disk. use ffmpeg -i "/home/01.mp3" -filter_complex "aformat=channel_layouts=mono,compand,showwavespic=s=640x120" -c:v png -frames:v 1 -f image2 - if need indexed colors, add -pix_fmt pal8

c# - Get Min and Max for items from database using Linq -

in database have : name value first player 300 first player 500 first player 250 secondplayer 200 second player 450 and need show each player max , min values: name maxvalue minvalue firstplayer 500 250 secondplayer 450 200 i did this: var res = (from item in _context.players select item).max(s=>s.value); but 1 player max value; query syntax: var result = (from item in _context.players group item name @group select new { name = @group.key, maxvalue = @group.max(i=>i.value), minvalue = @group.min(i=>i.value) }).tolist(); or in nice linq methods syntax: (this overload lets .select() "in" .groupby() var result = _context.players.groupby(item => item.name, (key, @group) => new { name = key, maxvalue = @group.max(i => i.value), minvalue = @group.min(i => i.value) }).tolist();

r - Ggplot - plot a dataframe with multiple points in 1 row in order to animate it with gganimate -

Image
i have dataframe each row contains information coordinates of 8 points @ point in time: time x1 y1 x2 y2 x3 y3 … x8 y8 a row may example: mydata <- data.frame(time=0.1,x1=-7.79,y1=7.32,x2=-3.86,y2=-1.62,x3=-1.35,y3=-4.61,x4=-6.24,y4=-9.89,x5=-6.40,y5=2.00,x6=4.02,y6=4.77,x7=-1.42,y7=9.89,x8=6.59,y8=-8.02) the problem have ggplot accepts 1 column name each axis. moreover, animate movements of points using gganimate, that's why want use ggplot. how can this? i managed animate data drawing plot using standard r plot() method each point in time , redrawing it, doesn't allow me save animation or work further. this builds on answer pavodive , adds how animation part done. i define larger data set such there animate: set.seed(1544) mydata <- data.frame(seq(0, 1, = 0.1), matrix(runif(11*8*2, -10, 10), nrow = 11)) names(mydata) <- c("time", paste0(c("x", "y"), rep(1:8, each = 2))) and use pavodive&#

ios - PDF: Unable to highlight selected word from UIWebView -

i doing book reading app. displaying every pdf in uiwebview . trying highlight selected word. failed. then, unable selected string pdf too. my code: webview.stringbyevaluatingjavascriptfromstring("window.getselection().tostring();") the above code working fine, when uiwebview content html . but, failed in pdf . kindly guide me, how highlight selected text colour?

exception - Try/Catch Add-DnsServerResourceRecordA in PowerShell -

i want catch exception occurs, when adding dns record add-dnsserverresourcerecorda in powershell switch -createptr , no reverse lookupzone exists. there no error. if provoke error simple menu pops , informs me situation. independent -erroraction switch $error variable not receive error. what's fault? thanks reply. ps c:\users\xyz>> add-dnsserverresourcerecorda -name "test-mwi4" -ipv4address 1.1.1.1 -createptr -zonename contoso.biz -erroraction continue add-dnsserverresourcerecorda : failed create ptr record. resource record test-mwi4 in zone mn-man.biz on server mndemucdc010 created successfully, corresponding ptr record not created. @ line:1 char:1 + add-dnsserverresourcerecorda -name "test-mwi4" -ipv4address 1.1.1.1 -createptr - ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : notspecified: (test-mwi4:root/microsoft/...resourcerecorda) [add-dnsserverresourcerecorda], cimexcep

Count similarities MySQL -

i have been trying figure out query , goes likes this: i have table ingredient containing information ingredients: table ingredient id int pk name varchar(50) i have table category, every ingredient can have 1 or more category connected it, example ice cream related categories dessert, cold dish , on. many many relation. table category id int pk name varchar(50) table category_ingredient category_id int ingredient_id int lets want make query how similar 2 ingredients measuring categories share. mean is, lets database contains 3 ingredients: 1,2,3. ingredient 1 connected categories {1,2,3}, ingredient 2 connected categories {3,4,5} , ingredient 3 connected categories {1,2,3,4}. doing query search ingredients similar ingredient 1, result in: ingredient 3 100% ingredient 2 33% any thought on how kind of query achieved? the "nice" way (in mind) query use conditional aggregation involving case when ... in expression, mysql not seem support this. i

Failing to install R package from archive -

i want install "fume" package on windows machine. tried giving following command in console: install.packages("https://cran.r- project.org/src/contrib/archive/fume/fume_1.0.tar.gz", repos = null, type ="source", install_opts = c('--no-lock')) but following result: * installing *source* package 'fume' ... ** package 'fume' unpacked , md5 sums checked ** r ** data ** preparing package lazy loading warning: package 'chron' built under r version 3.3.1 ** *** installing indices ** building package indices ** testing if installed package can loaded warning in library(pkg_name, lib.loc = lib, character.only = true, logical.return = true) : there no package called 'fume' error: loading failed execution halted error: loading failed * removing '\\company.local/users$/name/r/win-library/3.3/fume' warning in install.packages : running command '"f:/r/r-33~1.0/bin/x64/r" cmd install --no-lock -l

How authenticate and login functions work in django -

in code below, how authenticate function validate username , password. pick actual values match against ? from django.contrib.auth import authenticate, login def my_view(request): username = request.post['username'] password = request.post['password'] user = authenticate(username=username, password=password) if user not none: if user.is_active: login(request, user) it takes user name , password django user table. first want create user entry in django user table. refer following link authenticate user , know more django authentication system. django authentication system

amazon web services - Lambda S3 permission denied in s3-get-object blueprint -

i'm trying lambda read file off s3 bucket using s3-get-object blueprint in response file post events. even when bucket has full public access , full permissions: { "version": "2012-10-17", "id": "policy1468930000031", "statement": [ { "sid": "stmt1468929998580", "effect": "allow", "principal": "*", "action": "s3:*", "resource": "arn:aws:s3:::xlp-uploads/*" } ] } and lambda role has full s3 , lambda access, still access denied when running example code. this lambda code in blueprint: 'use strict'; console.log('loading function'); let aws = require('aws-sdk'); let s3 = new aws.s3({ apiversion: '2006-03-01' }); exports.handler = (event, context, callback) => { //console.log('received event:', json.stringify(event, null, 2))

css - Understanding positioning: adding position absolute to img container, doesn't allow me to margin auto. Why? -

i trying understand positioning , when parent element positioned relatively can position children element absolutely. @ least thought understood this. i proceeded give picture element below position:absolute, when did ran problem couldn't center image in mobile view (using media query). tried test centering normally, still couldn't make image center. used margin-left: auto , margin-right:auto under .img-circle , didn't work. so removed position:absolute on .picture class , boom worked. 1 way or another, had re-position title class. it looks understanding of positioning bit off, please me understand why above happened exactly? have done avoid such mess, because took me while it. thank you! codepen project /*.picture{ position:absolute; }*/ .img-circle{ margin-top:10em; width:20em; height:20em; border:.2em solid; border-radius:50%; display:block; }/*image shape*/ <div class="container container-fluid contthird1&qu

How to clean cache and cookies in Selenium using PhantomJS in Python? -

i using selenium phantomjs webdriver on python 2.7 , don't see references in documentation cleaning cache. there way clean cache , cookies? have seen functions in phantomjs can it, how use them in selenium ? try this: driver.get("about:blank") driver.delete_all_cookies() driver.execute_script('localstorage.clear();') i put driver.get("about:blank") in there in case current site has changed javascript environment in unexpected ways. you destroy driver , create new one, might less efficient (you'd have measure on setup know sure).

javascript - How can I repeat a mysql query every 5 minutes? -

i have sql query looks this: <?php include("settings.php"); $sql = conn->query("select * table limit 1"); $content = $sql->fetch_assoc(); $id = $content['id']; /* php operations here. */ ?> now, want able repeat sql query every lets 5 minutes, because tables content change. how can this? there way sql request in javascript or ajax script? if want refresh content, use ajax call in settimeout().

VBA excel, alot of flickering and a bit slow, help me optimize -

i have completed intended worksheet accomplish want do. however, code seems heavy , computer screen flickers epileptic seizure. hoping maybe there can done, need in acheiving this. the "system" consists of 2 files, userfile (the 1 flickers) , database file. when run either full update or "new item only" update, seems require extensive resources, didnt think necessary considering simple task , number of potential lookups. done sheet "sagsnr." in "stackoverflow_dummy.xlsm" file. i have written code beneath, complete, sanitized, files available here: https://spaces.hightail.com/space/vskxs . i hope guys can me optimise this. sub worksheet_updateallitemcostdata() dim material variant dim fndentry range dim wb1 workbook, wb2 workbook dim lr long, long, j long const spos string = "pos. " application.screenupdating = false application.displayalerts = false set wb1 = activeworkbook j = 0 lr = wb1.sheets("sagsnr.").ce

php - UTF-8 all the way through -

i'm setting new server, , want support utf-8 in web application. have tried in past on existing servers , seem end having fall iso-8859-1. where need set encoding/charsets? i'm aware need configure apache, mysql , php - there standard checklist can follow, or perhaps troubleshoot mismatches occur? this new linux server, running mysql 5, php 5 , apache 2. data storage : specify utf8mb4 character set on tables , text columns in database. makes mysql physically store , retrieve values encoded natively in utf-8. note mysql implicitly use utf8mb4 encoding if utf8mb4_* collation specified (without explicit character set). in older versions of mysql (< 5.5.3), you'll unfortunately forced use utf8 , supports subset of unicode characters. wish kidding. data access : in application code (e.g. php), in whatever db access method use, you'll need set connection charset utf8mb4 . way, mysql no conversion native utf-8 when hands data off applicati

asp.net - ADO.Net Connection Pooling with an MSSQL Account that is Disabled -

in our production environment have database every 30 minutes restored vendor's log shipping backup. when restore happens, our sql auth account disabled, database restored , account re-enabled. a problem occurs when connection pool fresh , attempt connect disabled account. bad connection pooled (i assume) , next 1 3 hours every connection throws sqlexception [sqlexception: login failed user 'xxxxx'. reason: account disabled.] even though, can connect database via ssms , application pool reset fixes issue. is there fix other disable pooling?

javascript - React Native + Redux basic authentication -

i'm looking way create basic authentication react-native app. couldn't find example react-native app. to login, app sends email/password + clientsecret server if ok, server returns accesstoken + refreshtoken the user logged in, other requests include bearer accesstoken. if accesstoken expires, app requests new 1 refreshtoken automatically. the user stays logged in time, states should saved in phone. what best approach this? thanks. when app communicates http api enforces form of authentication, app typically follows these steps: the app not authenticated, prompt user log in. the user enters credentials (username , password), , taps submit. we send these credentials api, , inspect response: on success (200 - ok): cache authentication token/ hash, because we're going use token/ hash in every subsequent request. if token/ hash not work during of subsequent api requests (401 - unauthorized), we'll need invalidate hash/ token , prompt user

javascript - Number on keyup add comma in INR standard -

i trying remove text after numbers typed , add decimal i have multiple input type="text" on keypress adding comma in inr (indian rupee) standard when type more 3 numbers entire value removed , '0' added. code not allowing decimal .00 number should. doing wrong? js fiddle html: <input name="txtmsexmarcardfee" type="number" id="txtmsexmarcardfee" class="stylednumber"> <input name="txtmsexmarcardfee1" type="number" id="txtmsexmarcardfee1" class="stylednumber"> <input name="txtmsexmarcardfee2" type="number" id="txtmsexmarcardfee2" class="stylednumber"> js: $('input.stylednumber').keyup(function(){ var x=$(this).val(); x=x.tostring(); var afterpoint = ''; if(x.indexof('.') > 0) afterpoint = x.substring(x.indexof('.'),x.length); x = math.floor(x); x=x.tostring

bitcoin - A transaction with a decent fee isn't gettingc confirmed -

i have sent transaction seems isnt being confirmed. i have added decent fee. https://blockchain.info/tx/f18eb6a4a148bae01a1a6da408f6d1a2f190881de0eb0578fcf2447c0b520715 someone has idea why happens? thank you looks has been confirmed @ point block 400468. for future reference, .0001 btc not decent fee anymore, it's minimum. blocks being filled max 1mb limit. size of previous block, 400467, 934.408 kb. every block going deeper alternates between ~750kb , ~950kb. space becoming more limited in each block, miners prefer include transactions more profitable.

javascript - go to next field automatically html5 form -

i using following html5 form. <form> <input type="text" name="orderno" /> <input name="picture" id="img" type="file" accept="image/*" capture="camera" /> <input class="btn-success" type="submit" name="submit" value="upload" /> </form> when open page in mobile phone, want when fill first input text, there should button called "next" in keyboard shows "go" button directly. please? javascript function document.getelementbyid('img').focus(); not opening camera automatically. i want facility launch camera on phone automatically when clicked "next" or "go" in keyboard. for security concerns, browsers not allow direct access file uploader or image capture trigger. user has click on corresponding field upload file or capture photograph. can define focus after each has been addressed.

ios - Adding UIWindow removes status bar -

i'm adding subvview on top of status bar. first i'm creating new window: let currentwindow = uiapplication.sharedapplication().keywindow currentwindow?.windowlevel = uiwindowlevelstatusbar next add subview: currentwindow?.addsubview(self.profileview!) the problem i'm having when remove subview, status bar not show more throughout application. supposed remove currentwindow well? when remove subview, you'll need set windowlevel default value status bar visible again. let currentwindow = uiapplication.sharedapplication().keywindow currentwindow!.windowlevel = uiwindowlevelnormal

ios - Chinese keyboard and Secure Text Entry -

Image
i updating 1 of apps localize 7 other languages besides english. chinese, traditional 1 of languages. am performing final tests before submission. scenario: user creates username, password , email 3 uitextfield spaces. username field, , email field show chinese keyboard allows user "draw" characters. everything works fine, exception of password entry field. merely uitextfield, created storyboard. use auto layout. have no issues other languages. the difference between text fields secure text entry selected, duh, password field. on device when testing, of languages display "globe" , can cycle through them... except chinese! my question: ios not allow chinese "drawing" keyboard when secure text entry selected? can't find entries on topic. thanks assistance. i've attached screen capture of password field attributes.

C# Image.Save AccessViolationException -

i have function, builds image pixel array , saves file. works without problems when called once. if call twice (after it's executed first time), function throws accessviolationexception . private void saveimage(byte[] bmpbytes) { debug.print("image saving started"); var arrayhandle = system.runtime.interopservices.gchandle.alloc(bmpbytes, system.runtime.interopservices.gchandletype.pinned); system.drawing.image bmp = new system.drawing.bitmap(960, 540, 960 * 3, pixelformat.format24bpprgb, arrayhandle.addrofpinnedobject()); bmp.save("img.bmp"); debug.print("image saving completed"); } so, bmp.save("img.bmp"); line throws exception. i've tried saving data in memorystream , same result: success on first call , accessviolationexception every other time. reason can be? this error states trying access protected memory. passed array of lesser size image required. it's similar buffer overflow. when gdi

java me - j2me sprite not working -

first, i'm sorry bad english. i'm newbie j2me i wrote below code after watched tutorial not working. don't know happen it. animationcanvas.java package example; import java.io.ioexception; import javax.microedition.lcdui.*; import javax.microedition.lcdui.game.gamecanvas; import javax.microedition.lcdui.game.layermanager; import javax.microedition.lcdui.game.sprite; public class animationcanvas extends gamecanvas implements runnable { private sprite ca; private int framewidth = 14; private int frameheight = 14; private boolean playing = true; private int a=1; public animationcanvas(){ super(true); try { ca = new sprite(image.createimage("ca.png"), framewidth, frameheight); } catch (ioexception ex) { ex.printstacktrace(); } } public void start() { thread runner = new thread(this); runner.start(); } public void run(){ while (playing

c# - UnicodeEncoding.GetBytes sometime doesn't get the right Bytes -

i want encode utf-8 text german latin encoding. unicodeencoding unicodeencoding = new unicodeencoding(); byte[] bytes = unicodeencoding.getbytes(text); the problem method encodes ä ä(0x00e4) or a(0x0061) , "(0x0308) .

ruby - NameError: uninitialized constant MongoClient -

i'm using ruby 2.2. have installed mongo gem, still error: my-mac:ruby-2.2.0 me$ gem list *** local gems *** bigdecimal (1.2.6) bson (4.0.3) bundler (1.10.6) bundler-unload (1.0.2) executable-hooks (1.3.2) gem-wrappers (1.2.7) io-console (0.4.3) json (1.8.1) log4r (1.1.10) mini_portile2 (2.0.0) minitest (5.4.3) mongo (2.2.3) nokogiri (1.6.7.2) power_assert (0.2.2) psych (2.0.8) rake (10.4.2) rdoc (4.2.0) rubygems-bundler (1.4.4) rvm (1.11.3.9) test-unit (3.0.8) my-mac:ruby-2.2.0 me$ irb 2.2.0 :001 > require 'mongo' => true 2.2.0 :002 > include mongo => object 2.2.0 :003 > mongo::version => "2.2.3" 2.2.0 :004 > c = mongoclient.new nameerror: uninitialized constant mongoclient (irb):4 /users/me/.rvm/rubies/ruby-2.2.0/bin/irb:11:in `<main>' 2.2.0 :005 > what's problem? the object want instantiate mongo::client.new docs here.