Posts

Showing posts from January, 2011

android - What happens when two apps define same BroadcastReceiver class in their manifest? -

i have android library project broadcastreceiver class , scheduler class defines methods setting repeating pendingintent broadcastreceiver //delay alarmmanager setrepeating method in seconds //id requestcode pendingintent public static void schedulebroadcast(context context,int delay,int id){ intent intent = new intent(context, superreceiver.class); intent.putextra(key_delay, (long)(delay * 1000)); intent.putextra("app_name", context.getpackagename()); long timegap = (long)(delay * 1000); pendingintent alarmintent = pendingintent.getbroadcast(context, id, intent, pendingintent.flag_cancel_current); alarmmanager alarmmanager = (alarmmanager) context.getsystemservice(context.alarm_service); alarmmanager.setrepeating(alarmmanager.rtc_wakeup, system.currenttimemillis() + timegap, timegap, alarmintent); } the receiver @override public void onreceive(context context, intent intent) { log.e("chirag-library"...

java - Error with Notification.Builder in notify -

hello new android, , 'm trying create notifications notification.builder , failed . when launching notification error nm.notify(idnotificacionuno,notif); // error in notif i have downloaded api 's 16 17 18 19 23, , code : public class mainactivity extends appcompatactivity { notificationmanager nm; private static final int idnotificacionuno = 1; notification notif; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); button btnlanzar = (button) findviewbyid(r.id.boton_notificacion); btnlanzar.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent = new intent(getapplicationcontext(),segundaventana.class); pendingintent intencionpendiente = pendingintent.getactivity(getapplicationcontext(),0,i,0); notification.builder notif = new notification.builder(getapplicationcontext()); notif.setsmallicon(r.drawable.tree); notif...

arrays - PHP: Pass variable to function -

looks simple (and maybe) need pass received variable in function function. here's code: pd: using laravel eloquent's scopes class myparentmodel extends model { public function scopemyscope($query, $var_i_want_to_pass=[]) { return $query->with('model'])->wherehas('model', function($q, $var_i_want_to_pass=[]) { $q->where('colum1',$var_i_want_to_pass[0])->where('colum2',$var_i_want_to_pass[1])->where('colum3',$var_i_want_to_pass[2]); })->take(10); } } and want this: $result = myparentmodel::myscope([3,1,6])->get(); i resolve using use : class myparentmodel extends model { public function scopemyscope($query, $var_i_want_to_pass) { return $query->with('model'])->wherehas('model', function($q) use ($var_i_want_to_pass) { $q->where('colum1',$var_i_want_to_pass[0])->where('colum2',$var_i_want...

ios - Xcode 7 crash: [NSLocalizableString length] 30000 -

Image
the app hangs on ios7,8,9, makes 30000 calls [nslocalizablestring length] cpu on max. see https://forums.developer.apple.com/thread/16001 also (lldb) bt * thread #1: tid = 0x2cb4df, 0x0349065c foundation`-[nslocalizablestring length] + 6, queue = 'com.apple.main-thread', stop reason = exc_bad_access (code=2, address=0xbf728ffc) * frame #0: 0x0349065c foundation`-[nslocalizablestring length] + 6 frame #1: 0x03490680 foundation`-[nslocalizablestring length] + 42 frame #2: 0x03490680 foundation`-[nslocalizablestring length] + 42 frame #3: 0x03490680 foundation`-[nslocalizablestring length] + 42 frame #4: 0x03490680 foundation`-[nslocalizablestring length] + 42 frame #5: 0x03490680 foundation`-[nslocalizablestring length] + 42 frame #6: 0x03490680 foundation`-[nslocalizablestring length] + 42 frame #7: 0x03490680 foundation`-[nslocalizablestring length] + 42 frame #8: 0x03490680 foundation`-[nslocalizablestring length] + 42 ...

html - PHP - access different pages -

i want make php page following scenarios: if click "my account", link me login page if i'm not logged site. if click "my account" , i'm logged site, take me user account. you can php sessions purpose.have @ below example login session

Putting function definition after call in R knitr -

quick, , stupid, question: in r markdown/knitr document, possible put function definition @ end of doc (e.g. in appendix) after function called? is possible put function definition @ end of document, after function called? technically, no. function needs defined before called. however, question relates knitr should rephrased: is possible show function definition @ end of document, after function called? yes, , there several ways achieve this. note options 2 , 3 can found in print highlighted source code of function . option 1: reuse chunks define function before used. ```{r definition, echo = false} myfun <- function(x) { return(sprintf("you passed me %s", x)) } ``` use function: ```{r} myfun(123) ``` show chunk defined: ```{r definition, eval = false} ``` an empty chunk same label non-empty chunk "inherits" latter's code. described in how reuse chunks . code inside chunk definition hidden @ first ( echo = false )....

javascript - Flot Categories Plugin Ordering Incorrect -

Image
thanks in advance time. i have following code flot chart <script src="js/plugins/flot/jquery.flot.js"></script> <script src="js/plugins/flot/jquery.flot.tooltip.min.js"></script> <script src="js/plugins/flot/jquery.flot.spline.js"></script> <script src="js/plugins/flot/jquery.flot.resize.js"></script> <script src="js/plugins/flot/jquery.flot.categories.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(function() { var data = [{ "label": "commission", "color": "#1ab394", "data": [["oct", ],["nov", ],["dec", ],["jan", ],["feb", ],["mar", ],["apr", ],["may", 14],["jun", 0],["jul", 5],["aug", 12],["sep", 7]] }, { ...

java - How to handle newline character in HIVE on HBase? -

i inserting data hbase java program. need convert byte arrays insert hbase doing so. when there newline character in input string, storing hexadecimal values in hbase (eg: tried insert string "prasad\r\nchowdary" in hbase prasad\x0d\x0achowdary ). my problem when data in hbase, when try query table hive, jdbc resultset been repeating 2 time single row. so how avoid converting \r\n hexadecimal when inserting hbase. if want put new line or other set of characters in string modify them such java treats them string. convert "prasad\r\nchowdary" "prasad\r\nchowdary" that use escape character "\" before new line convert bytes. should like. string name = "prasad\\r\\nchowdary"; put.add(bytes.tobytes("family"),bytes.tobytes("qualifier"),bytes.tobytes("name"));

java - Detecting rectangles using OpenCV -

so i'm new opencv , past 2-3 days i've searched lot how use opencv in java , android studio perform perspective correction , detect biggest rectangle in bitmaps , based on searches have done work result bitmap not correct.i'm sure i've done lot of things wrong great if me. thanks in advance help. public void onpicturetaken(byte[] data, camera camera) { bitmap myimage = bitmapfactory.decodebytearray(data, 0, data.length); mat matimage = new mat(myimage.getheight(),myimage.getwidth(), cvtype.cv_8uc3); bitmap mybitmap32 = myimage.copy(bitmap.config.argb_8888, true); utils.bitmaptomat(mybitmap32, matimage); correctperspective(matimage); } public static void correctperspective(mat imgsource) { // convert image black , white (8 bit) imgproc.canny(imgsource.clone(), imgsource, 50, 50); // apply gaussian blur smoothen lines of dots imgproc.gaussianblur(imgsource, imgsource, new org.opencv.core.size(5, 5), 5); // find cont...

Where to find project Id to Google Analytics Big Query -

my customer company has given me access google analytics premium account , can log in see information. have prepared number of queries on big query , need download result company's database (most via .net library). when try test funtions via apis explorer , asks projectid . can find project id? when log in big query account of company, see no projects created there. how can have prepared queries want without project? bigquery api needs enabled company's account. may try doing if have access or ask them so. they can add email address member project.

kubernetes : Service shared between multiple namespaces -

i'm searching answer didn't find anywhere. possible share service between multiple namespaces ? for instance, if have 2 namespaces (let's 'qa' , 'dev'), possible use same database server ? database server preferably managed kubernetes too. i've read issue : https://github.com/openshift/origin/issues/1244 it's not directly related kubernetes. regards, smana services accessible namespaces long address them using both name , namespace. for example, if have service named db in namespace dev , can access using dns name db . while won't work qa , can access both qa , dev if instead use dns name db.dev ( <service>.<namespace> ), in order clarify namespace should searched service.

angularjs - Angular UI-router switch between multi views to single view -

i have app has 3 views ( ui-view using angular ui-router): header , sidebar , content . my index.html looks this: (i omitted actual classes clearness) <body> <div ui-view="header" class="..."></div> <div class="page-container"> <div ui-view="sidebar" class="..."></div> <div class="page-content"> <div ui-view="content"></div> </div> </div> </div> </body> this pattern works pages have header , sidebar . have pages don't want display header , sidebar , example login page should fit on page. kind of pages need like: ui-view should this: <body> <div ui-view="content"></div> </body> so won't nested , under other views <div> 's , affected classes. i have solutions in mind, none of them gave me enoug...

javascript - Give href value to a div -

i'm using bootstrap accordion , has code: <div class="panel-heading" data-toggle="collapse" data-parent="#accordion" href="#collapseone"> i want create accordion dynamically, can't set .href value div in javascript. var accordionhead = document.createelement("div"); accordionhead.classname = "panel-heading"; accordionhead.dataset.parent = "#accordion"; accordionhead.dataset.toggle = "collapse"; accordionhead.href = "#id_"+player.pos; every other option valued, not .href , accordion not working. there other option give .href value div? var accordionhead = document.createelement("div"); accordionhead.classname = "panel-heading"; accordionhead.dataset.parent = "#accordion"; accordionhead.dataset.toggle = "collapse"; accordionhead.setattribute("href","#id_"+player.pos);`

Native dev with Android Studio - Getting the experimental Gradle 2.5 -

i've been searching web download link 2.5 version of gradle supports ndk in android applications, can't find any. is there option in android studio download automatically possible ndk ? or there download link somewhere installation instructions ? thank ! gradle distributions: https://services.gradle.org/distributions experimental plugin user guide: http://tools.android.com/tech-docs/new-build-system/gradle-experimental

seo pagination help to avoid duplication -

suppose have article submission site have more 1000 article , daily updated , added new i have 3 parameter connected article category tag author and structure of pagination like category wise articles =>site.com/category/{category_name} tag wise articles =>site.com/tag/{tag_name} particular author posted articles =>site.com/{author_name}/{article} all page show article pagination. how can apply pagination above links need suggestion for 1. url structure like. ?page=number or /page/number 2. how can avoid duplication because there full chance. 3. suggestion regarding html tag seo 4. or can improve structure 5. , 1 best url displaying content /article/slug or any?? just open page , - view page source find line link rel="canonical" href="http://yourwebsite/ if have fine. this article can : https://support.google.com/webmasters/answer/139066?hl=en but if have duplicate content other sites ...

javascript - Jquery selector for html select drop down -

currently working jquery selector have query on how find html select drop down using jquery selector input text finding in way possible combine html select drop down .find("input[type='text']" want know how find html select drop down. tried select[name=bar] in code have more 4 html drop down , don't want give this. any suggestion please me here jquery code function bind_change_events(){ $('.cloned_field').on('input',function(e){ if($(this).val().trim().length > 0) { //$(this).removeclass("cloned_field"); $(this).addclass("required_field"); var parent_div = $(this).closest("div.cloned-row1,div.cloned-row2,div.cloned-row3,div.cloned-row4,div.cloned-row5").find("input"); parent_div.each(function () { $(this).addclass("required_field"); }); } check_for_validation_removal($(thi...

rest - RESTful Java based webservice to handle huge data. -

i have existing system - cobol + db2(mainframe). i trying create new system - java + db2(mainframe). at moment, trying use java execute stored procs (on db2 mainframe). stored procs pull data , trying return result of restful web service. dataset running 2 million or so. system fine if can handle 10 million. i know multiple ways of creating java based restful web service, have not handled amount of data earlier i.e. 10 million. can please suggest best tool / framework (in java realm) handle amount of data. i have gone through following links how handle huge data in java how handle huge data rest service i polling group see if there other options available? thanks.

c# - how to add html content to document -

i trying convert html pdf.i have html code. ex: var example_html = @"<p>this <em>is</em> <span class="" headline"" style=""text-decoration: underline;"">some</span> <strong>sample <em>text</em> </strong> <span style=""color: red;"">!!!</span> </p>"; i have added below code generate html content pdf throwing error saying "the documnet has no pages" response.clear(); response.contenttype = "application/pdf"; using (document doc = new document()) { pdfwriter writer = pdfwriter.getinstance(doc, response.outputstream); doc.open(); //doc.add(new paragraph(example_html)); using (textr...

asp.net - Visual Studio 2013 can't find present dlls -

Image
scenario i undo pending changes, , latest version tfs. attempt build solution , errors 2 assemblies, these are: a different member of team same me , builds fine , assemblies found 0 issues. our web.config same since both check out of tfs. what have done i asked path 2 troublesome dlls sit on machine, , checked same path on machine, exist! have dlls in same folder , same version hers! c:\program files (x86)\microsoft asp.net\asp.net web pages\v1.0\assemblies\ i compared our projname.csproj.user file check , see if had different in hers after read this topic . same mine! i proceeded remove dlls, adding them manually path above, , errors gone, told web.config has changed , needs checked in, , know has changed: <reference include="system.web.helpers, version=1.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil"> <hintpath>c:\program files (x86)\microsoft asp.net\asp.net web pages\v1.0\assemblies\system....

centos6 - Logrotate errors -

after last update of centos 6 logrotate not working correctly. can point me source of problem? i've got mails this: /etc/cron.daily/logrotate: logrotate_script: line 1: daily: command not found logrotate_script: line 2: rotate: command not found logrotate_script: line 3: delaycompress: command not found` are possibly putting lines inside of script block in logrotate.conf script or scripts? for example, inside "postrotate", "prerotate", "firstaction", "lastaction" block before "endscript" directive? that cause script treat logrotate directives commands in script; since not commands, you'd messages mentioned.

wpf - How to restore a window while it is minimized in system tray? -

i have wpf form has 1 main window. when click button in main window show child window. tried restore child window couldn't. how restore while minimized in system tray? something should work if (this.mainwindow.windowstate == windowstate.minimized) { this.mainwindow.windowstate = windowstate.normal; } //bring window front of windows this.mainwindow.activate(); this.mainwindow should reference window want maximize or bring normal state. regards,

javascript - AngularJS resize container -

i have issue application. trying build metro style web app , far have used bit of sass make bootstrap horizontal: @import "variables"; @import "mixins"; // --- // metro. // --- @include screen-md { .metro { height: 100%; .container-fluid { width: 10000px; padding: 0 100px; position: absolute; top: 130px; bottom: 0; left: 0; .row-title { position: absolute; height: 100px; } > .row, .invisible-container > .row { position: relative; float: left; height: 780px; padding: 0 15px 30px 15px; margin-right: 50px; @include make-tiles($tile-width); &:last-child { margin-right: 0; } } } } .flex-column { d...

sql - select UNION except one column -

i have question: i want join 2 sql querys 1 query using union avoid duplicates, need know if data comes fisrt select query or second select query. sample data: table b table ----------------------------------------------------------------------------- 01 john 01 john 02 juan 02 peter 03 martin 03 martin i have this: select a.code,a.name conditions unión select b.code,b.name b diferent conditions result table 01 john 02 juan 02 peter 03 martin this works fine, if want know if data comes first query or second think this: select a.code,a.name, 'a' conditions unión select b.code,b.name, 'b' b diferent conditions result table 01 john 'a' ...

java - Getting unrecognized property exception though the property has been mentioned -

i getting below exception when try read string message coming in. com.fasterxml.jackson.databind.exc.unrecognizedpropertyexception: unrecognized field "eventid" (class org.json.jsonobject), not marked ignorable (0 known properties: ]) @ [source: {"messagetype": "eventsubscription","messagedata": {"eventid": ["proximitysensorinrange", "proximitysensoroutofrange", "barcodebarcodescanned", "rfidrfidscanned", "externalrfidexternalrfidscanned", "buttonsbuttonpressed", "testclientevent", "applicationinteractiondetected", "productadditionmethodbarcode", "productadditionmethodrfid", "productadditionmethodsearchandadd", "kohlsofferkohlscashused", "kohlsoffergiftcardused", "kohlsofferpromocodesused", "searchinputkeyedin", "searchinputvoice", "kubeusagetime", "producta...

regex - How to validate mobile number in Regular Expression -

i trying validate mobile using regular expression so have tried https://regex101.com/#javascript my expresion ((\d[^0-5]|[6-9])\d{9})|^(\d)\1*$ i need validate moblie number below 1.it should not start 0-5 e.g 0600432102 2.not same or in sequence e.g 1111111111 or 0123456789 or 9876543210 3.lenght 10 digit where made error. help me.... thanks .... this covers criteria , tests few numbers. not specify reason number being invalid - leave you. var numarr = ["1111111111", "0123456789", "9876543210", "8682375827", "83255"]; (var = 0; < numarr.length; i++) { console.log(numarr[i] + " " + validate(numarr[i])); } function validate(num) { if ((num.match(/^[6-9]\d{9}$/) && (!num.match(/^([0-9])\1{9}$/))) && (!isincr(num) && (!isdecr(num)))) { return ( "valid") ; } else { return ( "not valid") ; }...

Ejabberd Packet parsing using erlang -

ejabberd server receives packet this: {xmlel,<<"message">>,[{<<"from">>,<<"user1@localhost/resource">>},{<<"to">>,<<"user2@localhost">>},{<<"xml:lang">>,<<"en">>},{<<"id">>,<<"947yw-9">>}],[{xmlcdata,<<">">>},{xmlel,<<"body">>,[],[{xmlcdata,<<"helllo wassup!">>}]}]} i want fetch data packet. needed data : type, if body has parameter, {<<"xml:lang">>,<<"en">>} doing following operations: {_xmlel, type, details , _body} = packet this provides me type : <<"message">> or <<"iq">> or <<"presence">> . to check if details has {<<"xml:lang">>,<<"en">>} this: ...

python - How to convert numpy ndarray to C float *[] -

i have code in c , use in python , used swig wrap c-code, , got python module imported in python code. now have following code: import flame import numpy np data = np.random.rand(3,2).astype(np.float32, copy=false) n = 3 m = 2 print data flameobject = flame.flame_new() flame.flame_setdatamatrix( flameobject, data, n, m, 0 ) and gives error: typeerror: in method 'flame_setdatamatrix', argument 2 of type 'float *[]' i understand should pass float array pointer method, how can convert numpy multi-dimensional array correct type? there scipy documentation on this: how pass numpy arrays c code via swig (and vice versa). have here . basically, there swig interface file numpy.i use in following way. in swig interface file include: %{ #define swig_file_with_init %} %include "numpy.i" %init %{ import_array(); %} and add in interface file, before mentioning c functions: %apply ( float* in_array2, int dim1, int dim2 ) { (float* your...

jquery - How to export all rows from Datatables using Ajax? -

i using new feature in datatables: "html5 export buttons". loading data ajax. https://datatables.net/extensions/buttons/examples/html5/simple.html the problem export page displayed. i exporting this: buttons: [ { extend: 'pdfhtml5', text: 'pdf', exportoptions: { "columns": ':visible', } }, ] how can export rows? according datatables documentation there no way export rows when using server side: special note on server-side processing: when using datatables in server-side processing mode ( serverside ) selector-modifier has little effect on rows selected since processing (ordering, search etc) performed @ server. therefore, rows exist on client-side shown in table @ 1 time, , selector can select rows on current page. i worked around adding 'all' parameter length menu , training end users display records before doing pdf (or xls) export: var table = $(...

javascript - Request.QueryString is undefined -

i using following code logedinuser login.aspx , send chat.aspx send frmforajaxcalls return data db , fill on div in running time telling me in browser console request.querystring undefined here login.aspx code protected void button3_click(object sender, eventargs e) { response.redirect("chat.aspx?lgn2="+textboxusername.text); } and chat.aspx javascript code <script type="text/javascript" > var xmlhttp; function getdata() { xmlhttp = null; if (window.xmlhttprequest) { xmlhttp = new xmlhttprequest(); } else if (window.activexobject) { xmlhttp = new activexobject(); } string logedinuser = request.cookies["logedinuser"].value; var logedinuser = request.querystring["lgn2"]; xmlhttp.onreadystatechange = function () { if (xmlhttp.readystate == 4 || xmlhttp.status == 200) { document.g...

java - Closing JDBC-Connections only in finally-block? -

why database connections closed @ 2 positions, once directly after use, , secondly additionally in finally-block using check null in order prevent them closed twice. doesn't suffice use block? finally-block executed in every case. here official example of apache-tomcat jndi datasource how-to . point out there connection must closed under every circumstance. wonder why not sufficient use finally-block close-commands within end of main try {}-block seem redundent. connection conn = null; statement stmt = null; // or preparedstatement if needed resultset rs = null; try { conn = ... connection connection pool ... stmt = conn.createstatement("select ..."); rs = stmt.executequery(); ... iterate through result set ... rs.close (); rs = null; stmt.close (); stmt = null; conn.close (); // return connection pool conn = null; // make sure don't close twice } catch ...

php - High load average zf2 + doctrine on simple page -

i use zendframework2 , doctrine launching project. cpu shows high usage on httpd requests. enabled opcache filecaching, , memcache doctrine. any idea why might have load average being near 5.0? put die('test1') inside of onbootstrap of zendframework2 1 time, , time put die('test') before. die('test2') zend\mvc\application::init(require 'config/application.config.php')->run(); my apache bench shows when framework loaded without connection database or goes controller it's 5x slower. why zf2 acting , might possible solution normalize it's behavior? [question update] i profiled xdebug , webgrind , found out processes on bootstrap take high percentage ( application\module->onbootstrap) on bootstrap have line of codes //... $eventmanager->attach(mvcevent::event_route, function($e) use ($blacklistfornormaluser, $auth) { $match = $e->getroutematch(); // no route match, 404 ...

java - What is the difference between the object serialization and Filewriter? -

i going through head first java,and have reached serialization topic,it states if if data used java,program generated use serialization or else if data used other programs write plain text file. but have read serialization of object jvm independent. when serialize object,the data gets saved when use filewriter , filereader print gets stored in file,different serialization right? also when bufferedreader used,how use in cse filewriter. serialization 1 (of various) concepts describes how achieve persistence java objects. term refers protocol used turn object stream of bits , bytes. what do stream of bits , bytes depends ... on well; want it. a filewriter on other hand; unrelated "concept" - part of io framework java offers resolve tasks "reading or writing from/to file system". in other words: can use serialization turn java objects bits , bytes. can use filewriter; or 1 of many specific subclasses bits , bytes ... memory file lives on disc. ...

Jsoup parse android span class -

i have code: <span class="definizione">formula di saluto o di augurio usata nella mattina e, in alcune regioni, fino al calar della sera</span><br></p><span class="aiuto">ricerca: b06a8c00 - buongiorno<span> i have try whit not work: elements image = doc.select("span[class=definizione]"); imagen= image.text(); i not sure problem is, code works me: final string html = "<span class=\"definizione\">formula di saluto o di augurio " + "usata nella mattina e, in alcune regioni, fino al calar " + "della sera" + "</span>" + "<br></p>" + "<span class=\"aiuto\">ricerca: b06a8c00 - buongiorno<span>"; final document doc = jsoup.parse(html); final elements image = doc.select("span.definizione"); system.out.println( image.tex...

node.js - BinaryJS Server Response -

given example bellow: binaryserver = binaryserver({port: 9001}); binaryserver.on('connection', function(client) { console.log("new connection"); client.on('stream', function(stream, meta) { console.log('new stream'); strean.on('data', function('data'){ //(code store audio in buffers)}); stream.on('end', function() { //end of stream //(routine calls addon , convert speech text) //****immediate response client****** }); }); }); now, objective send response (to client) when generated. trying binaryjs cant understand how. server side: binaryserver = binaryserver({port: 9001}); binaryserver.on('connection', function(client) { console.log("new connection"); client.on('stream', function(stream, meta) { console.log('new stream'); strean.on('data', function('data'){ //(code store audio in buffers)}); ...

ios - Bluetooth BLE Device disconnects as soon as connected? -

i've been writing app using swift connects bluetooth ble device. reason, app doesn't connect device. in case connect gets disconnected straight away. happens maybe 1 in 10 times connects, interferes reliability of app. i'm using corebluetooth connect ble device. attempting connection again gets reconnect, , other apps communicate device works correctly every time, i'm confident not problem peripheral. i'd know if there out there has had similar issue or if there particular reason why may happening? edit: here's code willselectrow of table. peripheral connect. func tableview(tableview: uitableview, willselectrowatindexpath indexpath: nsindexpath) -> nsindexpath? { centralmanager.stopscan() connectingperipheral.append(discovereddevicearrayinfo[indexpath.row]) connectperipheralnow(connectingperipheral[0]) return indexpath } this connect, @ point select row sets cbperipheral details of device connect to. conne...

excel - Copy active cell row and insert copied row directly underneath -

i trying copy active cell row , want insert copied row directly beneath row. so: row 1 < user clicks relevant cell trigger macro (active row) row 2 < copied cell gets inserted directly beneath active row i want happen if there row below active row i.e. this, when user clicks copy active row: row 1 < active row row 2 < other content would turn this: row 1 < active row row 2 < copied cell gets inserted directly beneath active row row 3 < other content here code have tried put no luck: 'add tender type row dim nextrow range set nextrow = range("b" & sheets("home").activecell.rows.count + 1) if not intersect(target, range("af" & activecell.row)) nothing , range("af" & activecell.row).value = "+" sheet1.range("b" & activecell.row & ":af" & activecell.row).copy sheet1.activate nextrow.pastespecial paste:=1, operation:=xlnone, skipblanks:=false, tran...

javascript - Minimum and maximum date -

i wondering minimum , maximum date allowed javascript date object. found minimum date 200000 b.c., couldn't reference it. does know answer? hope doesn't depend on browser. an answer in "epoch time" (= milliseconds 1970-01-01 00:00:00 utc+00) best. from the spec, §15.9.1.1 : a date object contains number indicating particular instant in time within millisecond. such number called time value. time value may nan, indicating date object not represent specific instant of time. time measured in ecmascript in milliseconds since 01 january, 1970 utc. in time values leap seconds ignored. assumed there 86,400,000 milliseconds per day. ecmascript number values can represent integers –9,007,199,254,740,992 9,007,199,254,740,992; range suffices measure times millisecond precision instant within approximately 285,616 years, either forward or backward, 01 january, 1970 utc. the actual range of times supported ecmascript date objects smaller: –100,0...

java - How to read HDFS sequence file in spark -

i trying read file hdfs ( s3 in case) spark rdd. file in sequenceinputfileformat . not able decode contents of file string. have following code: package com.spark.example.examplespark; import java.util.list; import scala.tuple2; import org.apache.spark.sparkconf; import org.apache.spark.api.java.javasparkcontext; import org.apache.spark.api.java.javardd; import org.apache.spark.api.java.javapairrdd; import org.apache.spark.api.java.function.function; import org.apache.spark.sql.row; import org.apache.spark.sql.sqlcontext; import org.apache.spark.sql.dataframe; import org.apache.spark.sql.hive.hivecontext; public class raweventdump { public static void main( string[] args ) { sparkconf conf = new sparkconf().setappname("atlas_raw_events").setmaster("local[2]"); javasparkcontext jsc = new javasparkcontext(conf); javapairrdd<string, byte> file = jsc.sequencefile("s3n://key_id:secret_key@<file>", string...

python - Radionbutton output reset and border that's not showing up -

i coding python script can display buttons select label. this program containing 4 radiobutton , 1 label. so far problem of program program can not repeated. need have border surround label. i using python 2.7 , cannot post image because don't have enough reputation = label(the_window, text = 'null', fg = 'black',font = ('times', 36), width = 8) button.grid(row=2,column=1) button.grid(row=3,column=1) button.grid(row=2,column=2) button.grid(row=3,column=2) this setup https://repl.it/bjch you can add border label specifying relief : direction_status = label(the_window, text = 'null', fg = 'black', font = ('times', 36), width = 8, relief=groove) rather using 4 booleanvars value attributes radio buttons, use single intvar. indicate tkinter radio buttons belong in same group, , ensure 1 can selected @ time. from tkinter import * # create window the_window = tk() # give window title...

javascript - Google Map API V3 - ReferenceError: Google is not defined - script error in Windows 2008 R2 new machine -

i have html page works in local machine, , have same page in old server, , works too. now, try migrate new server , have script errors. whenever try load google maps html code never display , following error: referenceerror: google not defined here code: <!doctype html> <html> <head> <meta http-equiv="x-ua-compatible" content="ie=edge" /> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <style> .etiqueta { font-size: 9pt; font-family: 'microsoft sans serif'; } .valor { width: 95%; } </style> <script type="text/javascript"> var gmap; var mypano = null; var puntolatlon; var prmdir; var geocoder; var geomarker; var prmlngx = null; var prmlaty = null; var prmyaw = null; var prm...