Posts

Showing posts from August, 2014

html - Dropdown Menu goes underneath image -

today encountered weird experience in site livegreen when hover on menu services, dropdown goes underneath image section below that. tried every possible way positioning , z-index ing , kind, , googled lot, not bad html , css still, testing me. this theme purchased, cant post code. can check website itself. please me. remove z-index property on .main class. .main { z-index: 1; /* causing problems */ }

Java ArrayList StringBuilder appending -

i have 1 problem when appending list values string. getting 1 or more 1 value list. need append these string 1 string , use separator , each string. @ end comma getting added. how can remove @ end of string dynamically. here code: cntlist = parsexml(metadata.xml); if (cntlist.size() != 0) { // entrycountrymap.put(id, country); system.out.println("size ---->" + cntlist.size()); stringbuilder sb = new stringbuilder(); if (cntlist.size() >= 2) { (string s : cntlist) { sb.append(s); sb.append(","); } } system.out.println("stringbuilder ----->" + sb.tostring()); } and output this: stringbuilder ----->all countries,us - united states, please me resolving this. - raji with java 8 it's 1 liner string.join(",", cntlist); if need filter elements of list and/or mutate strings before joining single string, can still in concise manner without loops. cnt...

android - Couchbase Cannot Write Document to Database -

i newbie on android , trying store image database using couchbase mobile. when try run code logcat outputs error " cannot write database.the current winning revision not deleted, conflict" . don't know doing wrong. appreciated. here code. document document = database.getdocument("test1"); map<string, object> doccontent = new hashmap<>(); doccontent.put("message", "hello couchbase lite"); doccontent.put("creationdate", currenttimestring); doccontent.put("testing message 1","testing sync of message"); try { document.putproperties(doccontent); unsavedrevision newrev = document.createrevision(); url url = new url("res/mipmap-mdpi-v4/sym_def_app_icon.png"); newrev.setattachment("photo.png", "image/png", url); newrev.save(); log.d (tag, "document wr...

Determine where an existing Excel macro is used -

is there way determine in excel 2010 workbook macro used? inherited workbook coworker , there macros no comments can't determine used. i'd delete them if trial or debug related code left behind. make backup of original file, delete unwanted macros in new file, see if still works....

css - Text too large in Gmail app (Android) in Mailchimp newsletter -

i've ran inbox inspection , newsletter looks great on devices except gmail. gmail decides render email on desktop , in doing lot of text overlaps each on , large. i've read gmail ignores media queries unfortunate , i've read must inline css work. ruin every other view except gmail. is there solution or should hope people click "view email in browser" first off, never rely on people clicking view web version of email. , always inline styles. except media queries cannot inlined. yeah have inline gmail it's worth it. now, don't know figures email client market share make email work in gmail. but have pointed out, either appear big or small depending on device being used. there no middle ground away with, close want on screen size?

How to implement REST web-services? -

i trying learn java web-service using rest architecture. far have created class don't know how consume service. here's code: import javax.ws.rs.get; import javax.ws.rs.produces; import javax.ws.rs.path; @path("/sericecreation") public class sericecreation { @get @produces("text/plain") public string display(){ return "hello"; } } now, want call display method. can me understand how can achieved? in simplified point of view, rest services bound http calls, in example @get annotation tells method accessed making http get call. you can point browser url generated service , should see "hello" response. url http://<server>:<port>/<appcontext>/<rest-servlet-mapping>/sericecreation where: <server> server name. typically localhost <port> default server port number. if usin jboss 8080 <appcontext> typically name of applicaction (war file) <rest-...

java - Why the below program, without a sleep go to deadlock state but with sleep it executes all the three threads and terminates normally? -

public class threadtest { public static void main(string[] args) throws interruptedexception { exampletest obj = new exampletest(); thread t1 = new thread(new runn(obj)); thread t2 = new thread(new runn(obj)); thread t3 = new thread(new runn(obj)); t1.start(); t2.start(); t3.start(); //thread.sleep(1); obj.exit(); } } class exampletest { public synchronized void enter() { try { system.out.println("printed " +thread.currentthread().getname() +" inside wait"); this.wait(); system.out.println("printed " +thread.currentthread().getname() +" exit wait"); } catch (interruptedexception e) { e.printstacktrace(); } system.out.println("printed " +thread.currentthread().getname() +" @ time: "+system.currenttimemillis()); } public synchronized void exit() { this.notifyall(); } } class runn implements runnable { exampletest obj; public ...

angularjs - Angular JS 2.0 compiling typescript into javascript -

i trialling angularjs 2.0 poor mans reddit. have following script called app.ts ///<reference path="typings/angular2/angular2.d.ts" /> import { component, view, bootstrap, } "angular2/angular2"; @component({ selector: 'hello world' }) @view( { template: `<div>helloworld</div>` }) class helloworld { } bootstrap(helloworld) however, after saving this, i'd compile javascript (js file) using tsc app.ts think should work, compiler spits out number of errors command line. i have installed tsc via npm install -g 'typescript@^1.5.0-beta' , ran npm install. errors along lines of: c:\angular2-reddit\typings\angular2\angular2.d.ts(7,22): error ts1005: ')' expec ted. c:\angular2-reddit\typings\angular2\angular2.d.ts(14,6): error ts1008: unexpecte d token; 'module, class, interface, enum, import or statement' expected. can shed light on doing wrong here? thanks... you need provid...

cassandra - Connection error from DataStax Java driver under high read/write load -

i using cassandra 2.1.5 , have 4 node cluster. during load testing, see following exceptions in cassandra server logs "connection reset peer". see exception intermittently on 4 nodes in cluster. not see exception getting logged in server logs. looks under high load datastax java driver closing connection? is known issue? i saw 1 bug related hints similar ( http://mail-archives.apache.org/mod_mbox/cassandra-commits/201504.mbox/%3cjira.12787468.1427922296000.117682.1428071333503@atlassian.jira%3e ). has seen similar issues? ---stack trace seen in cassandra server logs on nodes under high load info [sharedpool-worker-21] 2015-07-08 04:07:39,206 message.java:532 - unexpected exception during request; channel = [id: 0xfdb55a7e, /10.62.129.90:59757 :> /10.62.128.123:9042] java.io.ioexception: error while read(...): connection reset peer @ io.netty.channel.epoll.native.readaddress(native method) ~[netty-all-4.0.23.final.jar:4.0.23.final] ...

javascript - DataTables' Autofill extension with input elements not working -

context i using datatables plugin autofill extension. allows copy cell pulling cross (bottom-right of it) or down column. works fine in project. problem however, when try copy input inside of cell, clears selected inputs. reading docs, seems older version of plugin enables copying of inputs inside cells, adding small script . current doc , looking @ write option, behaviour looking should possible default: this callback corollary of fnread, providing method customise how autofill writes calculated fill value given cell. default autofill set value in input or select element in cell if found, otherwise set value html. the thing is, when input has initial value, copying works. when adding/editing value, copies previous one. tried add read , write function options, never called (see fiddle). code here's jsfidle reproducing issue: drag down row.1 col.1 row.2 col.1 -> works edit value of row.1 col.1 , repeat step 1 -> goes previous value ent...

IndexedDB Users › IndexedDB current usage -

i wondering if there way or report showing indexeddb number of usage on desktop , mobile browser. how many api calls made. trying figure if used or not. additionally, if knows reason not being used. in advance. i wondering if there way or report showing indexeddb number of usage on desktop , mobile browser. how many api calls made. no, there no such official report or market survey published can give exact or approximate market share information. just trying figure if used or not. at point of time, per available information, future ahead. w3c have few specifications web or browser storage websql , indexeddb , web storage . websql: predecessor of indexeddb, , deprecated. since starting afresh, must not consider using same. indexeddb: replacement of websql , future ahead storing information in browser embedded database . web storage: storage option applicable small data in form of key-value pair . not large amount of structured data, in these scena...

How to instantiate Multiple Redis Connections for Publish Subscribe (node.js + node_redis) -

scenario using node_redis build simple redis pubish subscribe (chat) example: https://github.com/nelsonic/hapi-socketio-redis-chat-example ( with hapi.js , socket.io ) we have created node module redis_connection.js in our project ( see: http://git.io/vqaos ) instantiate redis connection because don't want repeating code connects (to rediscloud) multiple times: var redis = require('redis'); var url = require('url'); var redisurl = url.parse(process.env.rediscloud_url); var redisclient = redis.createclient(redisurl.port, redisurl.hostname, {no_ready_check: true}); redisclient.auth(redisurl.auth.split(":")[1]); module.exports = redisclient; which use this: var redisclient = require('./redis_connection.js'); // confirm able connect rediscloud: redisclient.set('redis', 'working', redisclient.print); redisclient.get('redis', function (err, reply) { console.log('rediscloud ' ...

xml - error: No resource identifier found for attribute 'paddingbottom' in package 'android' -

there problem in relative layout "paddingbottom" please tell me how resolve it <textview android:id="@+id/textview1" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/hello_world"> <imageview android:id="@+id/imageview_image" android:layout_below="@+id/textview1" android:layout_height="wrap_content" android:layout_margintop="64dp" android:layout_torightof="@+id/textview1" android:layout_width="wrap_content"> <button android:id="@+id/button_insert" android:layout_below="@+id/imageview_image" android:layout_height="wrap_content" android:layout_margintop="45dp" android:layout_torightof="@+id/textview1" android:layout_width="wrap_content" android:text="insert in db"> </button><button android:id="@+id/button_retrieve" andr...

How to get the number of days of difference between two dates in awk -

i need read date format file in awk . each line in file has 2 date data 1 in first element , other 1 in second element.the format day/month/year . there way of comparison between 2 dates in awk. instance, need 2 days answer if have 03/05/2015 , 05/05/2015 . sorry not providing sample input/output question. input same akshay described. have file in each line starts 2 dates 03/05/2015 05/05/2015 corresponding start , end of process (the second 1 happens after first one). hard coding using awk read information 2 dates. not optimal solution needed obtain results yesterday. simply, extract day, month , year of each date , compute how many days far apart. simple check see if corresponding year leap year or not. awk'{ d1= int(substr($1,1,2)); d2= int(substr($2,1,2)); m1= int(substr($1,4,2)); m2= int(substr($2,4,2)); y1 = int(substr($1,7,4)); y2 = int(substr($2,7,4)); leap1 = ((y1-2008)%4)?1:0; leap2 = ((y2-2008)%4)?1:0; cnt1 = 0; ii = 1; whi...

ios - How to pass NSManagedObject to userInfo of UILocalNotification -

i'm trying pass nsmanagedobject userinfo of uilocalnotification, like: nsmanagedobject *obj = ...; uilocalnotification* localnotification = [[[uilocalnotification alloc] init] autorelease]; localnotification.userinfo = [nsdictionary dictionarywithobjectsandkeys:obj, @"keyname", nil]; but crashed below error property list invalid format: 200 (property lists cannot contain objects of type 'cftype') *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'unable serialize userinfo: (null)' to understanding, root cause nsmanagedobject not serializable, how fix issue? workaround here? i have tried nsmanagedobjectid, , got same error here. try matt gallagher has great blog post this: http://cocoawithlove.com/2008/08/safely-fetching-nsmanagedobject-by-uri.html and try : error when setting userinfo in uilocalnotification

php - ASP.NET authentication for custom API -

i know pretty discussed topic i'm struggling in finding solution case. i have done working api service in asp.net (c# 4.5.1) . clients uses php pages call page.aspx on server , sending via post string. string contains id , cypher message . every user have different key (aes 256) and, since have id db correct key decypher message , request contains. check ip, every client have list of approved ips (when not using debug mode testing) i method have let users purchases. implemented (thank paypal) , works, feel security weak . so wanted add already known , already wrapped authentication system, without re-writing of working , debugged code. since used lot of big internet services thought oauth 2.0 (and i know nothing it), looks talks creating login uses services facebook, google, twitter , go on.. not case. have my own database my user list , need know 100% security calling api service. i tried creating new web api 2 project (mvc.. damn) cannot understand if ca...

Android - Retrieving image blob form SQLite DB without using bitmaps or decodeStream -

android - getting image jpeg url , storing in binary form in sqlite db. while retrieving same blob db, getting bytearray nad converting bitmap, using decodestream ; causes outofmemory , have used insamplesize scale image. but requirement not scale image, there other way get image db without using bitmaps , decodestream . also there way in android retrieve image db in native format(jpeg)? i understand that, process cannot done without bitmaps. still resolved issue without scaling image. added following in manifest, android:largeheap="true" under application tag. i understand may cause serious performance issue app. temporary solution. have started clean code , try use heap more efficiently. thanks all!! :)

linux - Android studio doesn't launch in Elementary OS (Freya) -

alright, yesterday writing code in android studio, , when saw autocomplete function wasn't working properly, did "invalidate , restart" function, closed android studio. , now, when try start android studio, nothing happens, can spam shortcut crazy, nothing pops up, nothing. working on project need fixed asap, google offers no clues. i'd appreciate clues or fixes. ended reinstalling os after running more issues removing , reinstalling studio couple of times.

MYSQL index with text fileds -

i try build index article (own_a) table because can't use exist index. the select contain 6 fileds article table, 3 integer, 1 varchar (30) , 2 text. if delete 2 text filed query, use index succesfully. how build index 2 large text filed? error: "specified key long; max key length 1000 bytes". select own_a.id article_id, own_a.article_number, own_d.id dealer_id, own_d.name dealer, own_a.tecdoc_article_id, own_a.description, own_a.extra_description, 'art' type, al.genart_id, 1 own own_db.article own_a join own_db.dealer own_d on own_a.dealer_id = own_d.id join `common_db`.`arti...

asp.net mvc - MVC/C# Put a comma after every number in string -

i have string of 4 numbers: 1234 i want convert in elegant way possible in mvc to 1,2,3,4 i've tried this: codetosend.tostring("#,#"); but outputs "1,234" (which expected really). i suspected following put comma after every digit, no avail. codetosend.tostring("#,#,#,#"); i have tried string.format , again facing same issue. var formattedstring = string.format("{0:0,0}", 1234); whats efficient way of doing therefore? note: string of numbers 4 digits long - , numbers only. don't want use insert wouldn't elegant imo , aware question has been asked before in similar ways different in crucial ways (such formatting thousands, not every digit or not elegantly!). how using string.join ? int = 1234; string.join(",", i.tostring().tochararray()); // 1,2,3,4 if 1234 string , use; string s = "1234"; string.join(",", s.tochararray()); // 1,2,3,4 or ...

android - AppCompatSpinner is not a view that can be bounds by this SimpleCursorAdapter -

i'm totally new android development, , i'm trying populate spinner data database column. successful in populating cursor object data, i'm doing wrong. i read similar problems in other topics here, nothing solved issue. protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_set_grade); assetdatabasehelper dbhelper = new assetdatabasehelper(getbasecontext(), "mydb"); try { dbhelper.importifnotexist(); } catch (ioexception e) { e.printstacktrace(); } db = dbhelper.getreadabledatabase(); cursor cursor = db.rawquery("select name _id items",null); simplecursoradapter adapter = new simplecursoradapter( this, r.layout.activity_set_grade, cursor, fromcols, toviews, 0); spinner = (spinner) findviewbyid(r.id.items_spinner); adapter.setdropdownviewres...

datastax - Can I restart Cassandra without restarting Spark worker? -

is there way restart cassandra without restarting spark worker in datastax enterprise (dse)? according user phact in comment: currently not possible [...]

c# - ListBox SelectionChanged Not Firing -

i have listbox <listbox grid.columnspan="4" grid.column="1" grid.row="7" grid.rowspan="2" style="{dynamicresource productlistboxstyle}" itemtemplate="{dynamicresource productitemtemplate}" itemssource="{binding relatedproducts}" itemspanel="{dynamicresource productlistitemspaneltemplate}" selecteditem="{binding selectedproduct,mode=twoway}" padding="-12,0,0,0" ishittestvisible="true" itemcontainerstyle="{dynamicresource productlistitemcontainerstyle}" x:name=mylistbox > <i:interaction.triggers> <i:eventtrigger eventname="selectionchanged"> <i:invokecommandaction command="{binding selectionchangedcommand}" /> </i:ev...

Odoo 8 : what different res_model between model? -

<record model="ir.actions.act_window" id="open_gtd_all_tasks_pci"> <field name="name">tasks (gtd)</field> <field name="res_model">project.task</field> <field name="search_view_id" ref="project_gtd.view_task_gtd_search"/> <field name="context">{'set_visible': true, 'gtd': true, 'search_default_timebox_id': 1, 'search_default_open': 1, 'search_default_open_project': 1, 'hide_stage': 0}</field> <field name="view_type">form</field> <field name="view_mode">kanban,tree,form,calendar,gantt,graph</field> </record> <record id="planningtask_calendar_view_inherit" model="ir.ui.view"> <field name="name">ic.team.planning.task.calendar.inherit</field> <field name="model">ic.team.planning...

node.js - Deep populate self referencing schema in mongoose -

i have self referencing employee schema in mongoose. var mongoose = require('mongoose'); var schema = mongoose.schema; var employee = new schema({ name: string, description: { type: string, default: 'no description' }, manager: { type: schema.types.objectid, ref: 'employee', default: null }, reportee: [{ type: schema.types.objectid, ref: 'employee' }] }); an employee can manager & can have several reportee. if manager null employee treated top level employee. i need created hierarchy based on model. struggling generate desired output. so far have tried use popluate() & mongoose-deep-populate module unable desired output. wonder becuase have self referencing model. or may not using these 2 options properly. this have tried deep-populate module. seems populating reportee model not repotree of reportee model. i n short populating 1 level of records. employee.deeppopulate(employees, ...

ruby on rails - Advanced usage of add_index -

in ruby on rails project have migration creates case insensitive index string column. class addcecodetousers < activerecord::migration def change add_column :users, :ce_code, :string execute <<-sql create unique index index_users_on_lower_ce_code_index on users using btree (lower(ce_code)); sql end end this works expected want know there way same using rails built_in add_index method? for mysql try: add_index "users", "lower(ce_code)", name: "index_users_on_lower_ce_code" for pg try: install gem "schema_plus_pg_indexes" t.index expression: "lower(ce_code)", name: "index_users_on_lower_ce_code"

Compare Array in an array(as its value) in PHP -

i got 2 ass-array below first: array (size=4) 0 => array (size=1) 'ma_ncc' => string '1' (length=1) 1 => array (size=1) 'ma_ncc' => string '2' (length=1) 2 => array (size=1) 'ma_ncc' => string '3' (length=1) 3 => array (size=1) 'ma_ncc' => string '4' (length=1) second: array (size=3) 0 => array (size=1) 'ma_ncc' => string '999' (length=3) 1 => array (size=1) 'ma_ncc' => string '1' (length=1) 2 => array (size=1) 'ma_ncc' => string '1' (length=1) how can compare array (arrays value) thank much!!! use array_diff() function. example: <?php $array1 = array("a" => "green", "red", "blue", "red"); $array2 = array("b" => ...

c# - Quartz.net How to set MisfireInstruction on trigger -

in quartz 1.0.x possible set misfireinstruction on trigger setting it: trigger.misfireinstruction = misfireinstruction.crontrigger.donothing; we upgraded quartz version 2.3.2 , it's not possible set anymore because trigger.misfireinstruction has no setter anymore. how possible set misfireinstruction on trigger now? i tried recreate trigger triggerbuilder this: trigger = trigger.gettriggerbuilder()... but couldn't find misfireinstruction-method on triggerbuilder too. thanks help this behaviour has changed version 2, guess. misfireinstruction read-only property , set using builder can see in codebase . now can set the misfireinstruction using triggerbuilder : itrigger mytrigger = triggerbuilder .create() .withidentity("trigger1", "mygroup") .withcronschedule("0 0 12 1/5 * ? *", x => x.withmisfirehandlinginstructiondonothing()) .build(); you can use few options: you can use these options: w...

arrays - Swift: check if jsonObjectWithData is json or not -

i have swift application communicates http server, the answers server may json, or not. need check print answer dictionary or array , in order avoid fatal error: unexpectedly found nil while unwrapping optional value @ nsjsonserialization.jsonobjectwithdata(dataval, options: nsjsonreadingoptions.mutablecontainers, error: nil) as! nsdictionary this jsonobjectwithdata : var dataval: nsdata = nsurlconnection.sendsynchronousrequest(request, returningresponse: &response, error:nil)! elimresponse = response?.description elim = nsjsonserialization.jsonobjectwithdata(dataval, options: nsjsonreadingoptions.mutablecontainers, error: nil) as! nsdictionary what try like: if dataval json{ elim = nsjsonserialization.jsonobjectwithdata(dataval, options: nsjsonreadingoptions.mutablecontainers, error: nil) as! nsdictionary println(elimjson) }else{ elim = nsjsonserialization.jsonobjectwithdata(dataval, options: nsjsonreadingoptions.mutablecontainers, error: n...

Different Session timeout for ASP.NET Identity 2.0 and normal sessions -

i'm using asp.net mvc 5 identity 2.0. i've set identity session timeout in startup.cs below: app.usecookieauthentication(new cookieauthenticationoptions { authenticationtype = defaultauthenticationtypes.applicationcookie, loginpath = new pathstring("/login"), expiretimespan = timespan.fromminutes(double.parse(configurationmanager.appsettings["app:sessiontimeout"])) }); i think timeout set asp.net auth cookie. so, i've changed session timeout other sessions in global.asax below: protected void session_start() { session.timeout = int.parse(configurationmanager.appsettings["app:sessiontimeout"]); } i'm using following code login logic (note session variable @ end): var usermanager = new usermanager(); var identityuser = await usermanager.findbyidasync(userid); var identity = await usermanager.createidentityasync(identityuser, defaultauthenticationtypes.applicationcookie); var authenticationmanager = httpcontext.cu...

Apache server type in response header -

Image
i don't want server type shown in response headers. i've tried add httpd.conf, saw in many answers: serversignature off servertokens prod but still see "server: apache" in response: can remove "apache" response? update also tried this: loadmodule headers_module modules/mod_headers.so header unset server header unset x-powered-by but got same response. you cannot remove header server: apache unless modify source code , recompile apache. , if do, still may not difficult find out server software running. make search "webserver fingerprinting", find http header response ordering, answers malformed requests , other ways discover server running. spend time securing application instead of trying achieve obfuscation. from apache doc : setting servertokens less minimal not recommended because makes more difficult debug interoperational problems. note disabling server: header nothing @ make server more secu...

c# - How do I do the equivalent of TaskCompletionSource<nothing>? -

i want have eventwaithandle -like task await on on 1 end, , set completed on other end. taskcompletionsource want, requires me pass value. use dummy value, before thought i'd see if there's more correct solution. the point able use task.waitany . the common scenario i've seen in source code create empty struct equivalent nothing. or use bool dummy: internal struct void { } and then: var tcs = new taskcompletionsource<void>(); i've seen common pattern in bcl source code well: // special internal struct use signify not interested in // task<voidtaskresult>'s result. internal struct voidtaskresult { }

wso2 - Query with Siddhi CEP using two times windows and 2 streams (continued) -

i keep trying make complex correlations siddhi, on occasion have 2 input streams, web client consult , notices sent clients visits, want generate alert if first stream each client repeated more once long second stream not has occurred under 2 windows , depends of status of events. define stream consults (idclient string,dniclient string,codproduct string,codsubproduct string,chanel string,time string ) define stream comercialactions(idclient string, idaccioncomercial string,codproduct string,codsubproduct string,chanel string,time string,status string) consults[codproduct=='fondos']#window.time(50 seconds) select idclient,codproduct, codsubproduct, chanel, time, count(idclient) visitcount group idclient insert consultsavg current-events consultsavg[visitcount==1] select idclient, '' idaccioncomercial,codproduct, codsubproduct ,chanel, time, 'temp' status insert comercialactions all-events comercialactions[status=='temp' or status == 'lanzad...

Firefox Add-on : Where to specify new version number -

i creating firefox add-on using addon-sdk-1.17. submitted version 0.1 review, passed. i've made changes add-on. under submissions, when clicked on "upload new version" , uploaded xpi, got message saying "version 0.1 exists". have specify version number in project somewhere? as noitidart mentioned, firefox add-on sdk, version of add-on contained in package.json file. the property/key version define version add-on. add-on line: "version": "0.1", will need changed like: "version": "0.2", or "version": "0.1.1", or other version number. version number format: version numbers must comply rules in " extension versioning, update , compatibility " says should comply " toolkit version format ". page says version string made of version parts separated . . version part sequence of 4 portions, optional,: <number-a><string-b><number-c><stri...

Can I make Orion Context Broker ignore additional fields in JSON payload in POST request -

we want transfer data spark core context broker using regular post request (v1/updatecontext). generate following json payload: { "contextelements“: [ { "type":"producer“, "ispattern":"false“, "id":"1337“, "attributes“: [ { "name":"currentpower“, "type":"float“, "value":“0" }, { "name":"timestamp“, "type":"int“, "value":"2015-07-07t20:32:36.958z“ } ] } ], "updateaction":“update" } however, firmware automatically adds additional fields (in addition "contextelements" , "updateaction...

Hide "Send" button in Outlook 2013 -

i have outlook plugin open popup window after user click on "send" button. in window user choose email sender. use "itemsend" event , if change "sendonbehalf" property inside event outlook overite changes should before "itemsend" found 1 event before "itemsend" it's "beforechecknames" can't use because popup window open many times. last idea maybe can hide standard button "send" , put button send email can make changes , after email.send(). found question asked before replace outlook 2010 send-button? there no answer. maybe have ideas? thank help no, send button cannot hidden. why not add combobox ribbon , let user specify sender before sending? can set sendonbehalf user selects value combobox.

jquery - Changing the menu character into a x -

i have created responsive menu following tutorial on internet <a class="menu_button" href="#"><span class="icon">≡</span> </a> <div id='menu'> <nav> <ul> <li><a href="link">link1</a></li> <li><a href="link">link2</a></li> <li><a href="link">link3</a></li> <li><a href="link">link4</a></li> <li><a href="link">link5</a></li> <li><a id="selected" href="link">link6</a></li> </ul> </nav> </div> the menù it's shown when user press link , uses script jquery(document).ready(function() { $('.menu_button').click(function(...

redirect - S3 static site hosting with my domain: why aws manual doesn't work for me? -

i've seen lot of manuals question , aws' official docs doesn't work me , cann't understand why. i created 2 buckets mydomain.com , www.mydomain.com. i added bucket policy mydomain.com: { "version": "2012-10-17", "statement": [ { "sid": "addperm", "effect": "allow", "principal": " ", "action": "s3:getobject", "resource": "arn:aws:s3:::mydomain.com/ " } ] } i enabled "enable website hosting" mydomain.com , put index.html there. i've got endpoint mydomain.com.s3-website-us-east-1.amazonaws.com in opening index.html. i enabled "redirect requests host name" www.mydomain.com mydomain.com.s3-website-us-east-1.amazonaws.com. according aws' official should redirect mydomain.com. doesn't work me, , way of redirect does. a...

objective c - TodayViewController class in iOS Today widget not being read? -

my todayviewcontroller class implemented follows: #import "todayviewcontroller.h" #import <notificationcenter/notificationcenter.h> @interface todayviewcontroller () <ncwidgetproviding> @end @implementation todayviewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view nib. nslog(@"yeehaw"); } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } - (void)widgetperformupdatewithcompletionhandler:(void (^)(ncupdateresult))completionhandler { // perform setup necessary in order update view. // if error encountered, use ncupdateresultfailed // if there's no update required, use ncupdateresultnodata // if there's update, use ncupdateresultnewdata nslog(@"gitalong"); completionhandler(ncupdateresultnewdata); } - (uiedgeinsets)widgetmargininsetsforproposedmargininsets:(uiedgeinsets)defaultmarg...

xml - clickable and unclickable button android Studio -

Image
i making small application , want do: every time click on "+" button, want increment counter have done. every time click "-" button, want decrement counter again, have done. however, when value of counter reaches 0, want button "-" no longer clickable , greyed out, how able this? what can in oncreate method button fewer=(button)findviewbyid(r.id.fewer); and can use .setclickable(false);

javascript - IE 11 SVG animation smoothness -

i've got big problem svg smoothness on ie 11 (works on chrome). it should work real-time timeline. svg element dynamically increasing it's height, events shown in it's time , goes down time. problem moving elements 1px visible , looks bad. on chrome resolved problem adding transform: rotate(360deg) (now i've got scale() ) enabled antialiasing these elements, , it's working smoothly there. animation on ie isn't smooth unfortunately. tried positioning elements both x / y , translate() . position calculated precisely each time requesting animation frame. it's more visible on raster images included (or think so). tried using shape-rendering , text-rendering (for text) , image-rendering these images. there simple jsfiddle: http://jsfiddle.net/9ke74mqo/ has other idea? thanks if interested i've resolved it. problem in ie there isn't possibility turn on antialiasing svg element property. when packed in <g transform="rot...

vb.net - How does the for each loop works with lisbox.items(0)? -

cmd = new oledb.oledbcommand("insert [orderdetail] ([orderid],[cinemaid], [seatid], [moviename],[movietime],[price]) values (@orderid,@cinemaid, @seatid,@moviename,@movietime,@price)", con) cmd.parameters.add("@orderid", dbase.oledbtype.numeric, 15).value = label11.text cmd.parameters.add("@cinemaid", dbase.oledbtype.varchar, 255).value = movie.cinid cmd.parameters.add("@seatid", dbase.oledbtype.varchar, 255).value = listbox1.items(0) cmd.parameters.add("@moviename", dbase.oledbtype.varchar, 255).value = movie.movien cmd.parameters.add("@movietime", dbase.oledbtype.varchar, 255).value = movie.moviet dim sql string dim data dbase.oledbdatareader dim cmdd dbase.oledbcommand sql = "select * seattype id = """ & sid & """" cmdd = new dbase.oledbcommand(sql, con) con.open() data = cmdd.executereader data.read() sprice = d...

shell - Script to resize image only if bigger than original image -

i want command line or script in linux (ubuntu) resize folder of images if image bigger original image size. thanks if want resize jpeg files in current folder larger, down 1600x1600, can use mogrify part of imagemagick suite: mogrify -resize '1600x1600>' *.jpg

dictionary - What is a better way to remove key from dict in Python 3.4? -

this question has answer here: difference between del, remove , pop on lists 8 answers i've found 2 ways of doing it: del dict[key] vs dict.pop(key) which 1 better , why, or maybe there's more? del faster pop(). have @ discussion best way remove item python dictionary?

angularjs - Angular equivalent of Radio Button Change Event -

in jquery like: $( ".radio-buttons" ).change(function() { .. }); how same in angular js there 2 ways monitor radio button changes , first use ng-change along radio button , </label><input type="radio" ng-model="radiovalue" ng-change="invokechangefunction()" />yes</label> in controller , $scope.invokechangefunction = function() { console.log($scope.value); } second method using $watch ng-model , $scope.$watch('radiovalue', function(value) { console.log(value); });

php - Connection between phpstorm and xdebug -

Image
i configured phpstorm-xdebug , able debug code breakpoints. these days updated php (through brew) , xdebug , have php 5.5.26 xdebug 2.3.3. when try debug tests (and code) phpstorm tells me: "connection xdebug not established". i checked configuration of xdebug in php.ini , it's follow [xdebug] zend_extension="/usr/local/opt/php55-xdebug/xdebug.so" xdebug.remote_enable=1 xdebug.profiler_enable=1 xdebug.remote_port=9000 xdebug.remote_host=127.0.0.1 xdebug.idekey=phpstorm and web server debug validation says i tried different versions of phpstorm, uninstalling e reinstalling php55/php55-xdebug no success. do have idea on how solve problem? after installing new php, if start php-fpm without configuring properly, defaults listen on port 9000. here 'stock' php-fpm.conf distro need edit: /usr/local/etc/php/5.5/php-fpm.conf ... ; '[::]:port' - listen on tcp socket addresses ; (ipv6 , i...

sidekiq - Heroku Free plan workers -

with new june 2015 heroku free plan, how sidekiq worker behave when scheduled job set run while it's sleeping? https://devcenter.heroku.com/articles/dyno-sleeping

c++ - error C2440: 'initializing' : cannot convert from 'const jchar *' to 'LPCWSTR' in Visual Studio 2008 -

my java code using native method (win api) opening file native method implemented in c++. dont have idea win api. when try compile c++ project, getting above mentioned error. the code responsible error follows: std::wstring getunicodestring(jnienv *env, jstring str) { jboolean iscopy; jsize len = env->getstringlength(str); lptstr unicodestring = (lptstr) malloc (2 * len + 2); memset (unicodestring, 0, 2 * len + 2); lpcwstr tempstr = env->getstringchars(str, &iscopy); // <--- line memcpy(unicodestring, tempstr, 2 * len ); std::wstring result = unicodestring; env->releasestringchars(str, tempstr); delete unicodestring; return result; } i getting error in highlighted line. thought must conversion error did typecasting. after typecasting, error in particular line got resolved got many errors based on dependency. i think there no problem code because code got compiled several times previously. think might unicode settings ...

excel - Creating worksheets based on unique values -

i have data set sorted date wise , want copy data based on month, i.e, data of each month copied new worksheet , name of sheet name of month present. data set: http://bit.ly/1cohv5j i tried running following code: sub x() dim rng range activesheet .autofiltermode = false sheets.add().name = "temp" .range("h2", .range("h2").end(xldown)).advancedfilter action:=xlfiltercopy, copytorange:=sheets("temp").range("a1"), unique:=true each rng in sheets("temp").usedrange.offset(1).resize(sheets("temp").usedrange.rows.count - 1) .range("a1").currentregion.autofilter field:=8, criteria1:=rng sheets.add(after:=sheets(sheets.count)).name = rng.text .autofilter.range.copy sheets(rng).range("a1") next rng .autofiltermode = false application.displayalerts = false sheets("temp").delete application.displayalerts = true end end sub ...

SVN log for specific path ignoring history (similar to git log -- file) -

does subversion provide method view log of path, regardless of whether has file/folder @ path in current revision? subversion uses 2 different specifiers revisions @xxxx (peg revision) , -rxxxx (operative revision) specify location @ revision , state of item @ revision (might have been moved in meanwhile). basically, i'm looking svn equivalent of git log -- path/to/file command. print out commits touching path, ignoring (i.e. not following) moves. doing svn log -r$rev:$((rev-1) path/to/file@$rev in loop seems overkill (and i'm not sure work intended) ok, can't see problem here (for svn 1.8.*) sample full repo-log (unrelated changed path/in/question added) >svn log -v -q file:///z:/repo ------------------------------------------------------------------------ r6 | badger | 2015-07-08 15:03:09 +0500 (Ср, 08 июл 2015) changed paths: /trunk/miracle ------------------------------------------------------------------------ r5 | badger | 2015-07-08 15...

javascript - Failed to get user's current position using google map API -

i trying display map current location using google map api using java script unable fetch user's current location.i explaining code below. window.onload = function () { if (navigator.geolocation) { navigator.geolocation.getcurrentposition(success); } else { alert("geo location not supported on current browser!"); } function success(position) { var lat = position.coords.latitude; var long = position.coords.longitude; var city = position.coords.locality; var mylatlng = new google.maps.latlng(lat, long); var myoptions = { center: mylatlng, zoom: 12, maptypeid: google.maps.maptypeid.roadmap }; var map = new google.maps.map(document.getelementbyid("map"), myoptions); var marker = new google.maps.marker({ position: mylatlng, title: ...

objective c - iOS app Sqlite Prepare statement error when inserting long html string -

i facing issue when inserting long html string in sqlite database in ios app. i getting long html content dynamically pulled mail server. example html content below. [i need store entire html string. because i'll have string again , load in uiwebview] <div style="padding-bottom: 20px;"><div style="background-color:#eee"> <div><b>from:</b> martin test &lt;martintest@gmail.com&gt;</div> <div><b>to:</b> steve test &lt;stevetest@yahoo.com&gt;, martin test &lt;martintest@gmail.com&gt;</div> <div><b>subject:</b> testing</div> <div><b>date:</b> july 8, 2015 @ 11:05:05 gmt+5:30</div> ...

sparql - Copy a Sesame repository into a new one -

i'd copy data existing sesame repository new one. need migration use owl-inferencing on triplestore not possible using owlim in in memory repository (the type of existing repository). what efficient way copy triples repository new one? update 1: i'm curious understand why using sparql insert cannot valid approach. tried code under sparql update section of new repository: prefix : <http://dbpedia.org/resource/> insert{?s ?p ?o} { service <http://my.ip.ad.here:8080/openrdf-workbench/repositories/rep_name> { ?s ?p ?o } } i following error: org.openrdf.query.updateexecutionexception: org.openrdf.sail.sailexception: org.openrdf.query.queryevaluationexception: is there error in query or can data not inserted way? i've inserted data dbpedia using queries of similar structure. manually (workbench) open repository want copy from . select 'export'. choose suitable export format ('trig' or 'binaryrdf' choices th...

c++ - Specializing a function from a variadic template class -

consider illegal code: template <int... is> struct object { void foo() const; }; template <int... js> void object<0, js...>::foo() {/*do whatever*/} we want specialize foo() when first template parameter 0, , let's want specialize foo() if second parameter 3, , third int 1. solution found (not sure if best approach) following: #include <iostream> template <int...> struct foo; template <int... is> struct object { int id; // member illustrate case when 'this' needed in foo(). friend struct foo<is...>; void foo() const {foo<is...>::execute(this);} // pass 'this' in case needed. }; template <int... is> struct foo<0, is...> { static void execute (const object<0, is...>* object) {std::cout << "first int = 0, id = " << object->id << ".\n";} }; template <int n, int... is> struct foo<n, 3, is...> { static void ex...