Posts

Showing posts from January, 2014

debian - Automate Bluetooth Pairing/Trusting in Bluez5 -

i've been working on making rpi 2 function car bluetooth receiver , well, except have no idea how automate pairing of bluetooth devices in bluez5. in past would've used bluetooth agent , simple script, seems have gone out window move 4 -> 5. nature of setup means have no kb/mouse on rpi once in car, needs automated setup can scan rpi, , if hard-coded pin correct, trusting of device needs automatically done, no cli input. i've searched on web seems using bluetoothctl works them, in particular setup i'd able have friends pair own phones, having trust devices rpi out of car isn't ideal. i'm not sure why using simple script not possible bluez5. think can it. below 1 example how. download bluez5 source , edit test/simple-agent . comment out lines of code shown below: def requestauthorization(self, device): print("requestauthorization (%s)" % (device)) #auth = ask("authorize? (yes/no): ") #if (auth == ...

javascript - jquery Datatables eu-date not working as expected -

Image
i trying sort eu date (dd/mm/yyyy) using data tables it's not working expected , not ordering date should be, http://jsfiddle.net/cyubv/55/ js $.extend($.fn.datatableext.osort, { "date-eu-pre": function (date) { date = date.replace(" ", ""); if (!date || date == "-") { return -1; } var year; var eu_date = date.split(/[\.\-\/]/); /*year (optional)*/ if (eu_date[2]) { year = eu_date[2]; } else { year = 0; } /*month*/ var month = eu_date[1]; if (month.length == 1) { month = 0 + month; } /*day*/ var day = eu_date[0]; if (day.length == 1) { day = 0 + day; } return (year + month + day) * 1; }, "date-eu-asc": function (a, b) { if (a == '-') return 1; else if (b == '-') retu...

java - Check if Object (document) exists in MongoDB (using Jongo) -

i'm trying find out if object (document) exists in collection. here's i've tried i'm stuck. @dbtable(name = "websites") private mongocollection websitestable; private boolean isintable(string url) { findone p = websitestable.findone("{url: #}", url); return false; } how check, if given url in collection? appreciated. try this: return websitestable.findone("{url: #}", url) .as(map.class) .iterator() .hasnext();

javascript - Angular scope and select dropdowns -

i have date filter in angular project have built , updates date on scope results. have couple of selects beside used pick month , year. the date stored in scope variable. when update calendar, works fine , updates dropdowns , when when change dropdown works fine , update calendars. my issue when change dropdown , change calendar date scope variable updates select stays on value had changed , not update. i have checked using boomerang , scope variable updating fine, not updating select dropdown. i have tried resetting array of objects dropdown , still hasn't worked. here im working with: <select ng-model="selectedstartmonth" ng-options="startmonth startmonth startmonth in startmonths" ng-change="changedatedropdown('startmonth', selectedstartmonth);" ng-selected="selectedstartmonth" ></select> <script> scope.$watchgroup(['start', 'end'], function(newvalue, oldvalue...

CORS on PHP and Google App Engine -

i've been working on app engine past day , stuck on 1 thing. cors ive included following top of php files header('access-control-allow-origin: *'); header('header set access-control-allow-credentials: true'); header('header add access-control-allow-headers "origin, x-requested-with, content-type"'); header('header add access-control-allow-methods "put, get, post, delete, options"'); in app.yaml file have following application: app version: 1 runtime: php55 api_version: 1 module: default handlers: - url: / script: index.php - url: /ip script: /ip/index.php - url: /user script: /user/index.php - url: /user/auth script: /user/auth/index.php - url: /user/check script: /user/check/index.php - url: /user/dash script: /user/dash/index.php - url: /user/forget script: /user/forget/index.php - url: /user/generate script: /user/generate/index.php - url: /user/link script: /user/link/index.php - url:...

mysql - Php Time Format -

i have here mysql query average of column(the column data type 'time'). column values example are: 00:00:55, 00:00:59, 00:01:03 select avg(time_to_sec(column_name)) table_name)as average_result in php formatted result way: <?php foreach($display_average $da){ echo date("h:i:s", ($da["average_result"])); } ?> outputs: 08:00:59 instead of 00:00:59, why starts 08? or did miss something? thanks! both php's date/time functions , mysql's date/time data types handle wall clock timestamps , not durations ; i.e. 00:00:55 means fifty-five seconds past midnight . not want; couldn't handle durations longer 23 hours, 59 minutes, 59 seconds, because data types , functions you're using handling clock time, cannot exceed these values. your specific issue stems timezone settings. larger issue need store simple integer values expressing elapsed seconds or minutes; not timestamps. format human readable string in php can use d...

Regex in SQL Server to check whitespaces -

i checking invalid names(names special characters) in sql server following code select first_name sc.name first_name '%[^a-za-z]%'; how add check leading , trailing whitespaces? there no native regex in sql server, there pattern matching . easy way select columns end or start white space be: select mycolumn mytable (mycolumn '% ') or (mycolumn ' %') or (mycolumn '%[^a-z]%') a quite "heavy" search, one-time query it'll work. of course, if looking leading , trailing white spaces, , requirement has both, use: (mycolumn ' %[^a-z]% ') or combination of above suit needs.

ios - Receiving message from blocked user xmpp -

i blocked user in xmpp @ still receiving message form user i'm using code block user [xmppprivacy retrievelistwithname:@"block_list"]; [xmppprivacy setactivelistname:@"block_list"]; nsstring *strjid= @"551924b3cfc4a3a80800000e"; strjid=[strjid stringbyappendingformat:@"@62.10.47.43"]; nsxmlelement *privacyelement = [xmppprivacy privacyitemwithtype:@"jid" value:strjid action:@"deny" order:1]; [xmppprivacy blockiqs:privacyelement]; [xmppprivacy blockmessages:privacyelement]; [xmppprivacy blockpresencein:privacyelement]; [xmppprivacy blockpresenceout:privacyelement]; nslog(@"-------> privacy element: %@", privacyelement); nsarray *arrayprivacy = [[nsarray alloc] initwithobjects:privacyelement, nil]; [xmppprivacy setlistwithname:@"block_list" items:arrayprivacy]; i privacy list form openfire <item type="jid" value="551924b3cfc4a3a80800000e@62.10.47.43" action="deny...

powershell - How do I delete Version History files in SharePoint Online? -

i trying delete version history files in sharepoint online through powershell. research has provided plenty of examples on how in sharepoint 2010 , 2013 not sharepoint online. files reside in document libraries. script below seemed promising task have been unable modify work sharepoint online. changes necessary make work sharepoint online? [void][system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint") # site $site = new-object microsoft.sharepoint.spsite("http://xxx.sharepoint.com") # loop through webs foreach ($web in $site.allwebs) { write-host $web.url # loop through lists in web foreach ($list in $web.lists) { # examine if basetype of list not document library if (($list.basetype -eq "documentlibrary") -and ($list.enableversioning)) { # delete version history foreach ($item in $list.items) { # work file object we're in document library $file = $ite...

php - How can I make an array of times with half hour intervals? -

i needed list of times in array... 12am 12:30am 1:00pm ... how can php? thank-you reopening question alex. this solution should resonate functional programmers. function halfhourtimes() { $formatter = function ($time) { if ($time % 3600 == 0) { return date('ga', $time); } else { return date('g:ia', $time); } }; $halfhoursteps = range(0, 47*1800, 1800); return array_map($formatter, $halfhoursteps); }

javascript - Handle event fired when selected drop down option is selected again -

i have select element this: <select name="select1" id="select1"> <option value="1">1</option> <option value="2">2</option> </select> i have written onchange event: $(document).on('change', '[id*=select1]', function () { alert('in change select1'); }); now suppose have option 1 selected , again go , select same option (option1), change event not fired. i want handle event fired in case. can tell me fired when try select option selected? try: $(document).on('mouseup', '[id*=select1]', function () { alert('in change select1'); }); demo

javascript - Running into "Maximum call stack" errors on a recursive function -

i'm making height map editor. grid of numbers can change location +/- 1. editor makes sure there can difference of 1 between of touching 8 tiles. i'm doing recursive function. looking @ it's 8 neighbors , adjusting them needed. if adjusted, call function on 8 neighbors. i uncaught rangeerror: maximum call stack size exceeded errors after messing around awhile , can't see coming from. i'm doing checks make sure don't try access non-exsiting grid locations... the function this: var movedown = function (x, y) { var updated = false; if (x-1 >= 0 && math.abs(grid[x][y] - grid[x-1][y]) > 1) { grid[x-1][y] -= 1; updated = true; } if (x-1 < size && math.abs(grid[x][y] - grid[x+1][y]) > 1) { grid[x+1][y] -= 1; updated = true; } if (y-1 >= 0 && math.abs(grid[x][y] - grid[x][y-1]) > 1) { grid[x][y-1] -= 1; updated = true; } if (y+1 < siz...

java - elaticsearch update doc with index api or update api.which is more efficient? -

i using elastic search first time.but can not finalize api use update.it can done update api , index api.but in performance 1 better? update api , index api 2 different things. in index api , can over-write existing whole documents update api , can change or edit parts of documents. under hood , both marking original document deleted , creating new document.

How to reset focus to the ultragrid cell after resizing the form size in C# -

i have ultragrid , resizing form size dynamically according no. of rows when user applied filter on it. want reset focus on ultragrid cell after form resize. have tried in ultragrid1_afterrowfilterchanged event. ultragridcell acell = this.ultragrid1.activerow.cells["companyname"]; this.ultragrid1.activecell = acell; this.ultragrid1.focus(); this.ultragrid1.performaction(ultragridaction.entereditmode, false, false); but didn't work. i want alternate solution it. when rows filtered out grid active row not changing. in if active row filtered out assume code not anything. select first not filtered out row may use code in afterrowflterchanged event: var notfilteredoutrow = this.ultragrid1.rows.firstordefault(r => !r.isfilteredout); if (notfilteredoutrow != null) { this.ultragrid1.activecell = notfilteredoutrow.cells[0]; this.ultragrid1.focus(); this.ultragrid1.performaction(ultragridaction.entereditmode, false, false); }

unity3d - Dynamic text for humanoid avatar -

i new game development, used iclone character avatar , added basic animations, text speech, facial animation. i bring avatars, animations unity3d via 3dxchange, text speech audio file can't imported unity 3d. my questions possibly can use iclone audio file in unity 3d, entered text manually in iclone avatar speak, audio file saved in iclone? my goal create humanoid avatar able speaks & read text entered user facial expression , body gesture. is possible achive facial expression , lib sync adjustments in unity 3d?? its possible facial expression , lib sync adjustments in iclone , blender or other tools? needs direction, or tutorials how proceed read text entered user facial expression , body gesture. thanks check unity store tts plugins try crazytalkanimatior may meets requirement. http://www.reallusion.com/crazytalk/animator/animator_trial.aspx

ip camera - Foscam Integration in Wowza using RTSP or HTTP -

we using foscam f18918w model , wowza 4.1.0 foscam url -> http://180.151.85.194:1024/ username -> admin password -> admin now url working fine in vlc http://180.151.85.194:1024/videostream.cgi?user=admin&pwd=admin&resolution=32 and streaming in wowza add stream file in application. create myfoscam stream in live application. , when hit url using swagger ui http://localhost:8087/v2/servers/ defaultserver /vhosts/ defaultvhost /applications/live/streamfiles/myfoscam then response <?xml version="1.0" encoding="utf-8" ?> <streamfile resturi="http://localhost:8087/v2/servers/_defaultserver_/vhosts/_defaultvhost_/applications/live/streamfiles/myfoscam"> <version>1431524179000</version> <uri>http://180.151.85.194:1024/videostream.cgi?user=admin&amp;pwd=admin</uri> </streamfile> and when test player message comes myfoscam.stream published. black screen open, no videos ...

How can I treat double quoted data and single quoted data same in Python 2.x? -

i have hardcoded metadata file data wrapped around in single quotes 'australia', 'usa'. metadata compared against new data can wrapped in either double quotes "usa" (problem in comparing), or singles quotes (where have no problem) . also, cannot compare 'usa' against "usa" .since new files large ~ 700 mb , don't want performance intensive replacement of data using replace function . how can compare metadata new data ? if want use @jay's algorithm, without imports, may like: def make_str(s): return s.strip("'").strip('"') = 'usa' b = '"usa"' c = "un" d = "'un'" if make_str(a) == make_str(b): print(make_str(a)) if make_str(c) == make_str(d): print(make_str(c))

c# - What access specifier must be used for UserControl members when used with the WinForms Designer? -

i created larger usercontrol , added forms designer form. the application compiles , runs fine, until edit in designer. then in initializecomponent the this.myusercontrol = new myusercontrol(); line vanishes. user control gets declared , initialized. problem is, instance creation missing , when comes initialization nullreferenceexception. i have add didn't touch designer few weeks. during time changed lot of public fields of usercontrol internal or private. worked fine until tried edit form contains usercontrol. when found missing instantiation took backup , changed every membervariable of usercontrol public , problem missing instantiation fixed again. are there known problems/restrictions according access specifiers used in windows forms usercontrols when used in designer?

Writing to the Windows Event Log using Delphi -

how can delphi app write windows event log? what difference between teventlogger , reportevent? how use reportevent function? if writing windows service , need write local machine's windows event log can call tservice. logmessage mentioned here . //tmytestservice = class(tservice) procedure tmytestservice.servicestart(sender: tservice; var started: boolean); begin logmessage('this error.'); logmessage('this error.', eventlog_error_type); logmessage('this information.', eventlog_information_type); logmessage('this warning.', eventlog_warning_type); end; for other type of applications can use svcmgr. teventlogger undocumented helper class tservice write the local machine's windows event log mentioned here , here , here . uses svcmgr; procedure tform1.eventloggerexamplebuttonclick(sender: tobject); begin teventlogger.create('my test app name') begin try logmessage('this error.');...

listview - Android list adapter - only giving one value -

i have listview adapter takes data array , should put them listview. however, listview show 1 item array - , show in rows of listview. heres code, wrong? arrayadapter<string> adapter = new arrayadapter<string>(getapplicationcontext(), android.r.layout.simple_list_item_2, android.r.id.text1, mainactivity.values) { @override public view getview(int position, view convertview, viewgroup parent) { view view = super.getview(position, convertview, parent); textview text1 = (textview) view.findviewbyid(android.r.id.text1); textview text2 = (textview) view.findviewbyid(android.r.id.text2); int = 0; int p = 0; text1.settext(mainactivity.values[i]); text2.settext(mainactivity.numvalues[i]); i++; return view; } }; listview.setadapter(adapter); adapter.notify...

java - jackson - MessageBodyWriter Not Found when returning a JSON POJO from a GET Api -

Image
i trying return simple json response using jackson. @get @produces(mediatype.application_json) public fmsresponseinfo test(){ system.out.println("entered function"); fmsresponseinfo fmsresponseinfo = new fmsresponseinfo(); list<searchdetailsdto> searchdetailsdtolist = new arraylist<>(); (int = 0; < 5; i++) { searchdetailsdto searchdetailsdto = new searchdetailsdto(); searchdetailsdto.setbarcode("barcode" + i); searchdetailsdto.setdocno("docno" + i); searchdetailsdto.setdoctype("doctype" + i); searchdetailsdtolist.add(searchdetailsdto); } fmsresponseinfo.setstatus("200"); fmsresponseinfo.setmessage("success"); fmsresponseinfo.setdata(searchdetailsdtolist); system.out.println("exiting function"); return fmsresponseinfo; } this code. when function ...

How to print a word thats in a string thats in a list? in Python -

i'm new python , appreciate help. part of larger function trying call word string in list. here's example came with: words = ['i sam', 'sam am', 'green eggs , ham'] for x in words: y in x: print(y) this prints every character: i m s m s m m... etc. but want every word(the spaces not matter): i sam sam am....etc. try this: x in words: y in x.split(' '): print y

javascript - How to delay angular bootstrap until after a service call -

i'm beginner on angular. i've got need make multiple webservice calls , bootstrap model. i've tried placing following code inside function executed after webservices have run. var myapp = angular.module('myapp', []) myapp.controller('ctrl', ['$scope', function ($scope) { $scope.obj = model }]); angular.element(document).ready(function () { angular.bootstrap(document, ['myapp']); }); but receive following exception. [$injector:modulerr] failed instantiate module myapp due to: [$injector:nomod] module 'myapp' not available! either misspelled module name or forgot load it. if registering module ensure specify dependencies second argument. my code still works, want rid of exception , more importantly learn how angular code should structured when bootstrapping delayed. i don't know if help, i'm including in case. <div ng-app ng-controll...

Storyboard orientation Xcode 6.3 -

i need design app in landscape mode. selected viewcontroller , went attribute inspector , selected orientation landscape controller view in storyboard doesn't become in landscape mode. please suggest doing wrong. using xcode 6.3 thanks since size of view controller freeform doesn't rotate. if can change size of view controller, can see rotating. check screenshot

"No MBean found for MobileFirst project 'HelloWorld'" -

i using eclipse-jee-luna-sr2-win32 , mobilefirst platform foundation 6.3.0.0-mfpf-studiop2-if201504301455. have created adapter , tried running it. getting error: no mbean found mobilefirst project 'helloworld'. possibly mobilefirst runtime web application mobilefirst project 'helloworld' not running. if running, use jconsole inspect available mbeans. if not running, full error details available in mobilefirst development server eclipse console view. possible solutions/workarounds: delete mobilefirstserverconfig quit eclipse navigate eclipse workspace delete mobilefirstserverconfig folder open eclipse delete workspace , start again delete workspace restart eclipse re-import project try eclipse kepler sr2 32bit/64bit or eclipse luna sr2 64bit

javascript - Unable get the value of textarea inside jquery ui dialog -

i tried put textarea inside dialog box , want value of textarea if "ok" click can't value. might problem? $(document).on('click', '#open', function () { var txt = $('#txt').val(); $('#break-diag').dialog({ modal: true, title: 'dialog', show: { effect: "scale", duration: 200 }, resizable: false, buttons: [{ text: "ok", click: function () { console.log(txt); } }] }); }); #break-diag{ display:none; } <link href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <button id=...

sql server - SQL outputs string made of HTML tags? -

hopefully easy one. have stored procedure checks database various tables see if item in stock. i'm trying reuse same procedure , extract part of check stock level somewhere else on-site output procedure goes string. i tried outputting string textbox see how useful , ended unformatted html code below string result: <div class="product-column-right-location">&nbsp;</div> <div class="product-column-right-stock"> <strong>stock</strong></div> <div class="product-column-right-committed"> <strong>committed</strong></div> <div class="product-column-right-on-order"> <strong>on order</strong></div> <div class="product-column-right-available"><strong>available</strong> </div><div class="product-column-right-location"> <a href="/contact-us.aspx" alt="global pc tower junction contact informati...

git - exclude files from pushing and pulling -

i have remote repository mirrored development site , downloaded local machine work with. when push changes update site hooks. update thing need: repository holds whole project working "configuraion.php" development site (working online resource testing); developer can pull roject , change 2 path variables in configuration.php run it; after file should not commited repository , should not overwritten when pulling changes. but errors pulling repository. have tried: downloaded project git update-index --assume-unchanged configuration.php changed file , @ moment seems ok but when try pull changes (made others) repository following: error: local changes following files overwritten merge: configuration.php please, commit changes or stash them before can merge. aborting tried add ".git/info/exclude" no visible effect. what doing wrong? could case file configuration.php still being tracked other people? if so, remote repository contain...

ios - Does the Swift toolchain eliminate code that is never called? -

if create xcode project ios single view application template , choose swift language, compiler exclude release build (binary) functions never called? i'm wondering because want include third-party library has lot of superfluous classes & functions, , want keep app small & fast. while agree comments, unlikely impact performance in significant way if included... xcode 6 uses apple llvm compiler version 6.1, depending on how closely related llvm developer group's version optimization feature available http://llvm.org/docs/passes.html options such -dce: dead code elimination, -adce: aggressive dead code elimination. one way know sure included checking assembly output using -emit-assembly option in swift compiler , review output, or opening binary in disassembler such hopper ( http://www.hopperapp.com/download.html )

r - Using lme4 glmer function for unbalanced treatment comparison results in variable length error -

i using lme4 package run generalized linear mixed model proportion data using binary response. have unequal sample sizes treatments , getting following error, understand due fact have unequal sample sizes: error in model.frame.default(data = pol3, drop.unused.levels = true, formula = x2 ~ : variable lengths differ (found 'trtmt') here code leads error: #excluding na data set pol3<-na.exclude(pol) #indicating binary response x2<-cbind(pol3$chsd, pol3$totsd-pol3$chsd) #running model mmchs4<-glmer(x2~trtmt+(1|bsd)+(1|hgt), family=binomial, data=pol3) i have read lme4 can deal unbalanced samples can't work. impossible sure without reproducible example, need make sure trtmt variable contained within pol3 (i.e., there isn't trtmt variable lying around in global workspace). i implement model in way: glmer(chsd/totsd~trtmt+(1|bsd)+(1|hgt), weights=totsd, family=binomial, na.action=na.exclude, data=pol) ...

JavaScript Calculate what exact date it would be after exactly X Years -

now finding challenging exact date after 'x' years date (birth date), 'yyyy/mm/dd' a trivial version be function addyearstodate(date, years) { return +date.slice(0, 4)+years + date.slice(4); } here, +date.slice(0,4) makes number out of first 4 characters of date, add number of years, concatenate remainder of input date. > addyearstodate('1953/04/18', 62) < "2015/04/18" you need special-case feb. 29. this assumes want input , output in string form yyyy/mm/dd. more sophisticated date manipulation, consider using library moment allow things like moment('1953/04/18').add(62, 'years')

Set background of Python OpenCV warpPerspective -

Image
when using warpperspective scale image smaller, there black area around it. may like: or how make black borders white? pts1 = np.float32([[minx,miny],[maxx,miny],[minx,maxy],[maxx,maxy]]) pts2 = np.float32([[minx + 20, miny + 20, [maxx - 20, miny - 20], [minx - 20, maxy + 20], [maxx + 20, maxy + 20]]) m = cv2.getperspectivetransform(pts1,pts2) dst = cv2.warpperspective(dst, m, (width, height)) how remove black borders after warpperspective ? if @ documentation warpperspective function online opencv documentation ( http://docs.opencv.org/modules/imgproc/doc/geometric_transformations.html ) says there parameter can give function specify constant border color: cv2.warpperspective(src, m, dsize[, dst[, flags[, bordermode[, bordervalue]]]]) where src – input image. dst – output image has size dsize , same type src . m – 3\times 3 transformation matrix. dsize – size of output image. flags – combinatio...

java - Moving objects in Jframe -

i've got kind of jbutton want move, example in code: package javaapplication19; import java.awt.*; import java.awt.container; import java.awt.event.*; import javax.swing.*; import javax.swing.jframe; public class javaapplication19 extends jframe{ public static jbutton button=new jbutton("button");//button move public static int x; public static int y; public javaapplication19(){ final container c = getcontentpane(); c.setlayout(null); button.setbounds(100,100,100,100); c.add(button); //mouselistenerstart button.addmouselistener(new mouseadapter() { public void mousepressed(mouseevent e) { if(!e.ismetadown()){ x = e.getx(); y = e.gety(); } } }); button.addmousemotionlistener(new mousemotionadapter() { public void mousedragged(mouseevent e) { if(!e.ismetadown()){ point p = getlocation(); button.setlocation(p.x + e.getx() - x, p.y + e.gety() - y); } ...

casting - Convert byte to sbyte without changing bits in C# -

i want convert byte sbyte, without changing bits. byte b = 0x84; sbyte sb = unchecked((sbyte)b); console.writeline("0x" + convert.tostring(b, 16)); console.writeline("0x" + convert.tostring(sb, 16)); the result of be: 0x84 0xff84 i understand result means , why happens. however, cannot seem find out can avoid behaviour. how can copy actual binary value of byte , inside sbyte? the bit's not changing between b , sb @ all. behavior coming convert.tostring() . there isn't overload of convert.tostring() takes sbyte , base. closest match convert.tostring method (int16, int32) . sb being sign extended 16 bits.

android - ARC Welder cuts off the action bar -

Image
i finished work on first android app, new daily quotes . excited hear "port" chromebooks , google chrome through arc welder , chrome web store, i've run snag. when run app in arc welder, top portion of action bar cut off, making title text impossible read , menu button difficult @ best. degree of cutoff varies depending on form factor selected, phone being worst , tablet/maximized producing same results. below screenshots of mean. source code available here if helps any. phone ui arc welder phone ui - landscape arc welder phone ui - portrait found answer! turns out, using arc welder (at least currently) returns api 19 (kitkat), , because using jgilfelt's systembartint library, setting nonexistent status bar tint directly on top of action bar. i able fix issue not checking ensure in fact on api 19, manufacturer build doesn't contain chromium in contents. if(build.version.sdk_int == 19 && !build.manufacturer.tolowercase()....

linux - Is it possible to build 5000 IP address on a single application? -

i asked build simulator pretend 5000 udp clients, each unique ip address. can simulator pc application?if can, can build on windows, or linux. or has build hardware only? thanks you can in software. there 2 different approaches: use ip aliasing. ip aliasing, can create multiple virtual network interfaces map single physical interface. each interface has own ip address. create separate socket each address , send traffic on it. see post more details. use raw sockets "forge" udp packets desired ip address. has disadvantage server cannot reply client, since there no network interface corresponding forged address. see this instructions on how craft udp packets using raw sockets.

html - How to catch the value in a td element with jquery and change another td elements background color based on the caught td's value? -

i've spent time today looking @ examples iterate through table , rows jquery, after lot of trial error able it. running issue trying value td element, can change color of td element. have repeater bound datatable. markup looks this.. <div> <table id="table"> <tr> <th>global group </th> <th>option id </th> </tr> <tr> <asp:repeater id="repeater1" runat="server" onitemdatabound="repeater1_itemdatabound"> <itemtemplate> <tr align="left"> <td id="header"> <asp:label id="lbloptionname" runat="server" text='<%#eval("globalgroup_name") %>'></asp:label> </td> <td class="level"><%#eval("globalgroup_level...

arrays - Formatting ruby hash to json -

i current working on formatting data ruby json; current code looks def line_chart_data @sources = ['facebook','twitter','instagram','linkedin'] @sourcecount = [5,12,16,6] @weeks = ['one','two','three','four','five','six'] h = [] @weeks.each |i,v| h.push({'v' => 'week ' + i}) @sourcecount.each |s| h.push({'v' => s}) end end c = {c: h} #how data should formatted on export @sources2 = { cols: [ {label: 'week', type: 'string'}, #each source needs looped though , formatted {label: 'facebook', type: 'number'}, {label: 'twitter', type: 'number'}, {label: 'instagram', type: 'number'}, {label: 'linkedin', type: 'number'} ], rows: c } respond_to |forma...

ios8 - Displaying search bar in navigation bar in iOS 8 -

Image
uisearchdisplaycontroller had boolean property called displayssearchbarinnavigationbar . what's equivalent in ios 8 have search bar move there? guidance appreciated. here's code, i'm not entirely sure why isn't working. when click search bar, disappears instead of moving , navigation bar up. import uikit class viewcontroller: uiviewcontroller, uisearchresultsupdating, uisearchcontrollerdelegate, uisearchbardelegate, uitableviewdelegate, uitableviewdatasource { let searchcontroller = uisearchcontroller(searchresultscontroller: nil) var tableview = uitableview() override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. self.searchcontroller.searchresultsupdater = self self.searchcontroller.delegate = self self.searchcontroller.searchbar.delegate = self self.searchcontroller.hidesnavigationbarduringpresentation = true self.searchcontroller.dimsbackgroundduringpresentation = true ...

java - Placing an Object into and Object Array, which is inside another Object Array -

so i'm new coding/java , i'm working on project. assignment create 3 different classes (which have here) , make them cooperate. i've made fishtankmanagerapp class retrieve new fish object , i'm trying figure out how put in fishtank object. my fishtank class only there create array object can hold 5 fish (i think i've done correctly). in fishtankmanagerapp class, i've created array of 10 of these fishtank objects. my question cant figure out life of me how place fish objects specfic fishtank object after they've been created (i've made note @ end of code i've ran problem). essentially know i'm trying put object i've created inside of , array contains array fish objects can stored... think.... any appreciated! thank you! import java.util.scanner; public class fish { private static scanner stdin = new scanner(system.in); private string userinput; private int userinput2; public boolean mean; public stri...

Error in huge R package when criterion "stars" -

i trying association network using expression data have, data huge: 300 samples , ~30,000 genes. apply gaussian graphical model data using huge r package. here code using dim(data) #[1] 317 32291 huge.out <- huge.npn(data) huge.stars <- huge.select(huge.out, criterion="stars") however in last step got error: error in cor(x) : ling....in progress:10% missing values present in input variable 'x'. consider using use = 'pairwise.complete.obs' any appreciated. you posted exact question on rhelp today. both , rhelp deprecate cross-posting if choose switch venues @ least courteous inform readership. you responded suggestion here on there missing data in data-object named 'data' claiming there no missing data. code return: lapply(data , function(x) sum(is.na(x))) that first level check, there error caused later step encountered missing value in matrix of correlation coefficients in matrix 'huge.out". happen if the...

linux - How can I set the current_timezone in DB2 V8.1 database server? -

is there way can set current_timezone in db2 database ? querying db2 "select current timestamp , current timezone sysibm.sysdummy1" 1 2 -------------------------- -------- 2015-05-13-22.02.23.714464 0. right current_timezone value 0 , set gmt want manually set pst (-80000). can please guide me steps ? the db2 database manager obtains time information operating system, you'd need set time zone via tz environment variable instance owner, restart instance.

java - Hash map keys are not random -

it seems java's implementation of hashmap always places keys same bins (at least saw integer keys). i.e. hashing deterministic , in runs produces same value. have heard languages randomize insertions in bucket key stored unpredictable security reasons. why java keys same? this not true java 7, added unique hash seed each hashmap instance. there's more information on collections framework enhancements in java se 7 page. this mechanism removed in java 8 performance, , replaced alternative converts comparable keys (such string) balanced tree elide dos security problem. there's more information on collections framework enhancements in java se 8 page.

How to assign identical unique IDs to matching observations between two dataframes in r? -

have practical question when have 2 (or more) data frames , want assign unique ids each matching observation within each , across both datasets e.g.: #1. create dataframe df1: a1 <- c(1, 1, 1, 1, 2, 2, 2, 2, 1, 1) b1 <- c(1, 5, 3, 2, 3, 4, 5, 1, 5, 2) c1 <- c("white", "red", "black", "white", "red", "white", "black", "silver", "red", "green") df1 <- data.frame(a1, b1, c1) df1 a1 b1 c1 1 1 1 white 2 1 5 red 3 1 3 black 4 1 2 white 5 2 3 red 6 2 4 white 7 2 5 black 8 2 1 silver 9 1 5 red 10 1 2 green #2. create dataframe df2: a2 <- c(2, 2, 1, 1, 2, 2, 2, 2, 2, 2) b2 <- c(3, 1, 3, 2, 1, 3, 4, 5, 3, 5) c2 <- c("black", "blue", "black", "white", "silver", "green", "green", "red", "blue", "white...

ruby - Using for-loop to add numbers together -

if randomly put in 2 numbers (first number smaller), how use for-loop add numbers between , itself? ex: first number: 3 second number: 5 the computer should give answer of '12'. how do using for-loop? simple loop across range defined: puts "enter first number: " first = gets.to_i puts "enter second number: " second = gets.to_i total = 0 in (first..second) total += end puts total note if don't enter valid number, converted 0. assumes second number larger first.

node.js - Sending a buffer to the client to download -

i have buffer download on node.js server dropbox. i'd send buffer (or convert file , send it) client, , have begin downloading on client side. missing here? var client = dboxapp.client(req.session.dbox_access_token); client.get(req.body.id, function(status, data, metadata) { // do here? }) here's angular (uses promise). when console.log(response object includes buffer). function(id, cloud){ return $http.post('/download/'+cloud, {id: id}).then(function(response){ console.log(response) }, function(response) { return $q.reject(response.data); }) } it looks dbox module you're using has stream() option better suited file downloads. should make call metadata file's mime type. example: var middleware = function(req, res, next) { var client = dboxapp.client(req.session.dbox_access_token); var file = req.body.id; client.metadata(file, function(status, reply) { res.setheader('content-disposition', ...

c++ - How to generate LLVM bitcode for a file using a compilation database? -

i want generate llvm bitcode large number of c source files have compilation database . there way invoke clang such reads compilation database , uses appropriate flags? background for toy programs, command generate llvm bitcode simple: clang -emit-llvm -c foo.c -o foo.bc however, source files in large projects require lots of additional compilation flags, including -i s , -d s , whatnot. i want write script iterates on large number of source files , calls clang -emit-llvm ... on each generate llvm bitcode. difficulty each clang -emit-llvm ... command has have flags specific source file. have compilation database these source files, captures flags needed each individual source file. is there way make clang -emit-llvm ... aware of compilation database? one solution i've thought of parse compilation database myself , find appropriate entry each source file, , modify command entry (a) include -emit-llvm , (b) change -o foo.o -o foo.bc , , run command. might work,...

javascript - How do I change the first bar color in a canvasjs stacked bar chart? -

i'm working on project want sideways stacked bar chart. needs written in javascript, , best library i've found need canvasjs. in chart i'm creating, colors used in stacked bar not distinguishing different bars, colors have meaning. because of this, if specify color each part of stacked bar independently other bars. here page specific kind of chart want on page, example provide has 5 bars, each colors blue, red, purple, green, light blue. 5 bars, colors go in same order. able mix order independently, have bar goes red > green > yellow, 1 goes green > yellow > red, etc. if know how this, or if know of graphing library in, appreciate help. thanks! it looks matter of adding color attribute each datapoint individually: { x: new date(2012, 01, 1), y: 71, color: "red" } ...which can done each datapoint way like.

javascript - Morris.js View Full date with time -

i have problem because make dynamic response of back-end. code generated is: new morris.line({ // id of element in draw chart. element: 'myfirstchart', // chart data records -- each entry in array corresponds point on // chart. data: [ { year: '2015-05-13 14:47:56', value: 18 } { year: '2015-05-13 00:07:22', value: 21 } { year: '2015-05-12 00:07:22', value: 23 } { year: '2015-05-11 17:14:49', value: 22 } { year: '2015-05-11 00:07:31', value: 22 } { year: '2015-05-10 17:59:56', value: 26 } { year: '2015-05-10 06:02:49', value: 27 } { year: '2015-05-10 04:46:30', value: 888 } ], xkey: 'year', ...