Posts

Showing posts from June, 2013

Insert array of json data into json file using javascript & JSP -

i have 1 function in code gives me x & y coordinates. have formatted data , saved data array in json format. now, want save variable data json file. can me out this? variable arraydata contains string of json data want save new json file. or can use jsp save data json file? problem here is, data in javascript variable. game.input.ondown.add(function() { x = math.floor(game.input.activepointer.worldx / 15); y = math.floor(game.input.activepointer.worldy / 15); arraydata.push("{'x':'" + x+"','y':'"+y+"'}"); document.getelementbyid('test').innerhtml = ' data: {"x":' + x+',"y":'+y+'}'; console.log(" data: " + arraydata); }); you don't have put object between quotes: string. change: arraydata.push("{'x':'" + x+"','y':'"+y+"'}"); to: arraydata.push({&#

java - UTF-8 characters not stored properly to SQLite DB at runtime -

i wrote following code convert ascii data utf-8. when store data sqlite db. not store properly. code utf-8 string in java data = data.replaceall(":", ""); byte[] btarrbytes = hex.decodehex(data.tochararray()); string utf8data = new string(btarrbytes, "utf-8"); insert query sqlite in java stringbuilder sbquery = null; stringbuilder sbvalues = null; sbvalues.append(string.format("(" + "\"%s\", " + "\"%s\", " + "\"%s\", " + "\"%s\", " + "\"%d\", " + "\"%s\", " + "\"%s\"" + ")", sid, seid, sddatetime, sdevdatetime, objrdata.getrversionindex(), objrdata.g

javascript - Creation of a button of condivision with facebook -

hi im working on web site created use of frame. the site have map user can trace route , calculate distance , time of route. now have button share on facebook route user create in code of sharing put url of page html url static when people click on page shared instead see map route see homepage. i tryed add url of page parameters of map (pointer of location , calculate of time , distance) give me original url.

Android How to enable writing In Arabic In EditText -

i have search box edit text. how can write arabic text return results. note : in english language edit text working fine , return results . i got language text working in edittext creating own keyboard. here great tutorial creating own keyboard. in tricky part know ascii codes of language (arabic) characters. , once have them, use them in keyboard.xml. after have use own keyboard in layout. <android.inputmethodservice.keyboardview android:id="@+id/keyboard_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@+id/ads_include" android:background="@color/colorkeyboardbackground" android:focusable="true" android:focusableintouchmode="true" android:keybackground="@drawable/key_backgrounds" android:keytextcolor="@color/colorprimarydark" android:shadowradius="0.0" android:visibility

jquery - Styling a tooltip appearing in span -

i have span title attribute showing tooltip. showing default tooltip. want tooltip shown tooltip black background color , white text color. how can that? my span html looks this <span class="bootstrap-switch-handle-on bootstrap-switch-success" title="my span tooltip" style="width: 42px;">on</span> thanks , regards you need use title text in css create new tooltip element. don't have add new el. use pseudo-selector such: span:hover:after{ content: attr(data-title); display:block; //more width, height, background etc. here } then use data-title instead of title avoid double-tooltip. here fiddle: https://jsfiddle.net/nyybsu1o/2/

java - Google Calendar API android create event -

i`m trying create event file (.pdf) in android app google calendar api: create events public static void addattachment(calendar calendarservice, drive driveservice, string calendarid, string eventid, string fileid) throws ioexception { file file = driveservice, android .files().get(fileid).execute(); event event = calendarservice.events().get(calendarid, eventid).execute(); list<eventattachment> attachments = event.getattachments(); if (attachments == null) { attachments = new arraylist<eventattachment>(); } attachments.add(new eventattachment() .setfileurl(file.getalternatelink()) .setmimetype(file.getmimetype()) .settitle(file.gettitle())); event changes = new event() .setattachments(attachments); calendarservice.events().patch(calendarid, eventid, changes) .setsupportsattachments(true) .execute(); } i copy totaly doesnt work,android studio put in red getalternatelink() , gettitle()doesnt reconize, line

linux - why inotifywait command shows multiple pids? -

i created 1 bash script named "quicktest.sh". task of script set inotifywait on data folder users home directory. code of quicktest.sh down below: function inotify_data() { user="$1" if [ -d /home/$user/data ]; while read -r path action file; echo "the file '$file' created" chmod 0777 -r /home/$user/data done < <(exec inotifywait -m -r /home/$user/data -e moved_to -e create -e modify) fi } cd /home/ ls >/tmp/.grp i=1 n=`wc -l </tmp/.grp` while [ "$i" -le "$n" ] user=`awk "nr==$i" /tmp/.grp` echo "setting watch on $user data folder." inotify_data "$user" & i=$((i+1)) done i have 2 users in machine, after running script, run "ps -ef | grep -i quicktest.sh" , shows 2 process of file.

ios - Implement search similar to native contacts search? -

on native contacts app, when try search contacts, type string , if contact first name / last name / company etc.. begin string, contact shown. to make matters more complex, can type mi ric , search find michael richardson. ric mi me michael richardson. i have made copy of contact record local core data store, , first instinct use nsfetchedresultscontroller , nice predicate. but how go predicate? if person record has 3 words, should query each word beginswith? can done 1 predicate? here use word base predicate: + (nspredicate *)wordbasedpredicateforstring:(nsstring *)searchstring withproperty:(nsstring *)property { // searchstring = [searchstring stringforsearch]; nsarray *searchstrings = [searchstring componentsseparatedbycharactersinset:[nscharacterset whitespacecharacterset]]; nsmutablearray<nspredicate *> *subpredicates = [nsmutablearray array]; (nsstring *string in searchstrings) if (![string isequaltostring:@""]) {

Automatically create a database connection with Python script? -

i never learned python (i know program bit in vba), , have been using qgis few weeks. i'm analysing tracking data , on user interface i'm allowing people select periods or days want see. database created on postgresql server, , know how connect qgis. in ui, when people click button, export qgs file configurations (maps, coordinates, colours, ...) want, layer i'm seeing in sql database people might have not created previously. is possible have (python) script create database connection? simple?

spring - .16 - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzScheduler' -

.16:17:41.823 [main] warn o.s.w.c.s.xmlwebapplicationcontext - exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.beancreationexception: error creating bean name 'quartzscheduler' defined in url [file:/c:/users/sivashankar/new%20folder/cimacs/smartcbsservice/target/classes/config/services.xml]: invocation of init method failed; nested exception org.quartz.schedulerexception: registration of jobs , triggers failed: found interface org.quartz.trigger, class expected .16:17:41.823 [main] warn o.s.w.c.s.xmlwebapplicationcontext - exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.beancreationexception: error creating bean name 'quartzscheduler' defined in url [file:/c:/users/sivashankar/new%20folder/cimacs/smartcbsservice/target/classes/config/services.xml]: invocation of init method failed; nested exception org.quartz.schedulerexception:

javascript - Submit form having file using java script submit button -

java-script : have form feed value controller via ajax call . form serialized in ajax call , controller return 'true' on success problem form have file , file can't serialized . working out how can receive file in controller using ajax call . function save() { if(save_method == 'on_submitted') { url = "<?php echo site_url('mycontroller/insertform')?>"; $.ajax({ url : url, type: "post", data:$('#form_name').serialize(), datatype: "json", success: function(data) { if(data.status) //if success close modal , reload ajax table { $('#modal_name').modal('hide'); alert('added successfully'); reload_table(); } else

sapui5 - Keep sap.m.MultiComboBox permanently open even after selecting an option -

is possible keep sap.m.multicombobox open disabling drop down toggle upon selecting checkbox option or other way of achieving same. have looked using selectlist? believe emulates trying achieve https://sapui5.hana.ondemand.com/explored.html#/sample/sap.m.sample.selectlist/preview

iphone - OpenTok appcelerator module using OpenTok CocoaPods -

i trying create appcelerator module opentok using latest opentok module using cocoapods. module gets compiled successful , module created. when try use sample app gives below error: [error] : ** build failed ** [error] : following build commands failed: [error] : ld build/products/debug-iphonesimulator/sampleapp.app/sampleapp normal x86_64 [error] : (1 failure) when open xcode sample project shows below error: ld: framework not found opentok clang: error: linker command failed exit code 1 (use -v see invocation) i have verified opentok framework exists in specific folder. have set below parameters in module.xcconfig file framework_search_paths= ld_runpath_search_paths= other_ldflags= here module , sample code https://ufile.io/bbcbb if can point out missing, great help. i don't believe can use cocoapods normal appcelerator ios module can done in titanium using appcelerator hyperloop. take @ documentation , let me know if have questions. thanks! http://do

listview - List selector state selected not working [ANDROID] -

in app, using list view show list of items have 1 text , 1 image, have added list selector attribute list view list item clicked background color changed different one.the problem when list item selected listview's row (that text view , image view) background not changed state pressed working fine.how work? appreciated listview <listview android:id="@+id/list" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:choicemode="singlechoice" android:divider="@null" android:dividerheight="0dp" android:listselector="@drawable/nav_lists_selector" /> list selector <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitfadeduration="@android:integer/config_mediumanimtime"> <item android:drawable="@drawable/list_presse

Missing libraries when running cmake, where to get for windows? -

i trying make bitshares core work computer, wen running cmake prompted following errors: -- not find curses (missing: curses_library curses_include_path) -- not find readline (missing: readline_include_dir readline_library) -- not find zlib (missing: zlib_library zlib_include_dir) -- not find bzip2 (missing: bzip2_libraries bzip2_include_dir) -- not find perl (missing: perl_executable) -- not find doxygen (missing: doxygen_executable) -- configuring done -- generating done -- build files have been written to: c:/users/carl/documents/bitshares/bitshares-core the libraries available download in ubuntu via sudo command, can these libraries windows? also says generating done there no makefile generated.

python - Scrapy, login with captcha failed -

i'm using following spider crawling tinyz.us website requires authentication. from scrapy.spiders import basespider scrapy.http import formrequest import urllib2 class start(basespider): name = 'test' start_urls = ["http://tinyz.us"] def parse(self, response): user_agent = 'mozilla/4.0 (compatible; msie 5.5; windows nt)' headers = {'user-agent': user_agent} imgrequest = urllib2.request("http://tinyz.us/securimage/securimage_show.php", headers=headers) imgdata = urllib2.urlopen(imgrequest).read() open('captcha.png', 'wb') f: f.write(imgdata) captcha = raw_input("-----> enter captcha in manually :") return formrequest.from_response( response=response, formdata={"login_user": "myusername", "login_password": "mypass",

c# XElement linq, return bool -

i need return bool type field contains 1 or 0 <auto>1</auto> code public bool getbooksauto() { return (bool)xd.elements("root").elements("books").elements("auto") .select(x => x) .any(); } can written in 1 return line or should test strings 1 , 0. thank you! if want check whether of auto elements has value 1 : xd.elements("root").elements("books").elements("auto") .select(a => (int)a == 1) // here true if value 1 , false if 0 .any() you can put condition directly any operator: xd.elements("root").elements("books").elements("auto").any(a => (int)a == 1)

python - How to save a specific variable in TensorFlow? -

i make network test save model. code: import tensorflow tf import numpy np import time dimensions=100 batch_size=128 def add_layer(inputs, in_size, out_size, activation_function=none): weights = tf.variable(tf.random_normal([in_size, out_size])) biases = tf.variable(tf.zeros([1, out_size]) + 0.1) wx_plus_b = tf.matmul(inputs, weights) + biases if activation_function none: outputs = wx_plus_b else: outputs = activation_function(wx_plus_b) return outputs def f(batch_size,val,dims): = np.zeros(batch_size,dtype=np.int32)+val b = np.zeros((batch_size, dims)) b[np.arange(batch_size), a] = 1 return b xs = tf.placeholder(tf.float32, [none, dimensions]) ys = tf.placeholder(tf.float32, [none, 43]) l1 = add_layer(xs, dimensions, 64, activation_function=none) l2 = add_layer(l1, 64, 64, activation_function=tf.nn.sigmoid) prediction = add_layer(l2, 64, 43, activation_function=none) loss = tf.reduce_mean(tf.square(ys - prediction)) train_step = tf.train.adamopt

vbscript - unable to login to openssh through scrpting via qtp -

i have installed openssh7.3.1.2 in windows system , trying login through cmd giving "ssh ip" successful. unable login when scripts executed through qtp. error is-'ssh' not recognized internal or external command, operable program or batch file." please let me know if settings has changed in qtp in order login openssh.

javascript - Convering json data to Java script array -

i have code above gets data database , place in in json form make readable in java script. results of echo "fiat":["anglia","bronco","capri","cobra","consul","corsair","cortina"], "land rover":["defender","discovery","discovery 3","discovery 4"] data converted in such way can reference in form var brand=array (); brand["fiat"]=["anglia","bronco","capri","cobra","consul","corsair","cortina"]; brand["land rover"]=["defender","discovery","discovery 3","discovery 4"]; in java script. 1 know how can this. $query = mysqli_query($conn,"select * car_models "); // loop db result while(($result = mysqli_fetch_array($query))) { // check if id in data array if(!array_key_exists($result['brand'], $data)){

Liferay 7 ignores AssetEntryQuery parameters -

assetentryquery ignoring parameters set, executing wildcard query , retrieving asset entries. snippet of i'm doing right now: long[] classtypeids = new long[] { 30837 }; assetentryquery assetquery = new assetentryquery(); assetquery.setclasstypeids(classtypeids); list<assetentry> entries = assetentrylocalserviceutil.getentries(assetquery); foreach (assetentry entry : entries) { system.out.printf("entry classtypeid %d expected %d", entry.getclasstypeid(), 30837); } when execute code, returns list of entries liferay without classtypeid being filtered. output: [...] entry classtypeid 0 expected 30837 entry classtypeid 0 expected 30837 entry classtypeid 28920 expected 30837 entry classtypeid 30331 expected 30837 entry classtypeid 30837 expected 30837 entry classtypeid 30837 expected 30837 entry classtypeid 30837 expected 30837 entry classtypeid 30921 expected 30837 [...] am missing liferay ignoring assetentryquery params or bug within liferay itse

Excel VBA Timestamp not updating -

i have worksheet building track our incoming trailers , put information on dashboard. have vba setup when user changes cell in column here closed, copy line next sheet keep history of trailers. my problem vba timestamp on completed page not updating when line copied over. know vba works can change trailer number on completed sheet , trigger vba , timestamp appear. need timestamp appear when line copied dashboard sheet. am missing need turn on trigger timestamp? thanks edit- sorry didn't add in code. here have timestamp on completed sheet private sub worksheet_change(byval target range) if intersect(target, range("c2:c10000")) nothing exit sub if target.count > 1 exit sub if target = "" exit sub application .screenupdating = false .enableevents = false cells(target.row, 10) .value = .numberformat = "mm/dd/yyyy hh:mm:ss" end .enableevents = true .screenupdating = true end end sub code dashboar

active directory - How to authenticate user by Down-Level Logon Name? -

i using passport-windowsauth middleware authentication. search user query: (&(objectclass=user)(|(samaccountname={0})(userprincipalname={0}))) , means user can found samaccountname or userprincipalname , how search user down-level logon name (domain\username)? or question how should use netbios name in search query? believe, shouldn't skip that.

html - Javascript - on clearing cache before loading page, dynamically modified elements are not being created -

i have page carousel of magazines , on click of each magazine , page scrolls section below show magazine details . elements there created dynamically based on magazine clicked. same thing if there hash in url , check hash , if there one, scroll section magazine details , , create magazine details based on slug name of magazine in hash of url . magazine details section: <section class="row expanded magazine-detail"> <div class="small-12 medium-6 large-7 columns magazine-hero"> <div class="hero-overlay-wrapper"> <img id="cover-image" src="/imagecache/cover/{{ $issues->first()->first()->image }}" alt="" /> <div class="magazine-preview-nav"> <div class="right-arrow" id="forward"> <img src="{{ asset('/img/right-arrow-black.svg') }}" />

webdriver - Required capabilities when running BrowserStack Automate with a mobile device -

description browserstack documentation lists capabilities can set automate product not describe ones must present in order test on, example 'google nexus 5'. their code generator suggests this: { "browsername" : "android", "platform" : "android", "device" : "google nexus 5" } but know experience set of capabilities works: {"os":"android", "device": "google nexus 5"} because of i'm asking myself: question {"device": "google nexus 5"} work? , if not, minimum , correct set of capabilities when using browserstack automate specific mobile device? it recommended use code generator browserstack. ensures have correct environment test.

javascript settimeout function in aurelia -

i want hide element after time ( 2 seconds ). in javascript in can use settimeout function that. there way use on aurelia? or there better way this? you can hide element using if custom attribute included in aurelia. bind property on viewmodel. this.showitem = true; window.settimeout(() => this.showitem = false, 2000); <h1 if.bind="showitem">i hide in 2 seconds</h1>

c# - IS this the right way to automate the user defined service import in Built in DI in asp.net-core -

i have created extension method adding services defined under particular namespace scoped in di. works well. public static class servicecollectionextensions { public static void addscopedimplementations(this iservicecollection services) { foreach (type type in assembly.getentryassembly().gettypes() .where(t => t.namespace == "serverapi.services") .where(t => !t.gettypeinfo().isdefined(typeof(compilergeneratedattribute),true)) .where(t => t.gettypeinfo().isclass)) { services.addscoped(type.gettypeinfo().getinterface("i" + type.name), type); } } } my question is: right way in built di in asp.net-core? like said, works. but, locks "serverapi.services" namespace. have give every single class interface of same name starts "i", in cases should not necessary. you're giving every dependency scoped lifetime, registrations should tr

angular4 - angular 4 and ng-template -

i'm getting warning: the <template> element deprecated. use <ng-template> instead (" [attr.tabindex]="-1" [ngclass]="{'k-item': true}"> [warning ->]<template *ngif="template" [templatecontext]="{ when using angular 4, being taken care of release version? thanks you need take care of that. need modify code , change occurences of <template> to <ng-template> <template> caused conflicts other usages of <template> tag, therefore angular team changed use <ng-template> angular purposes. it's breaking change, therefore didn't introduce change in angular2 in angular4 according semantic versioning rules.

ios - Swift: How to send data from loginView to other views? -

i have loginview , can switch other views slide-out-menu swrevealcontroller. the storyboard looks this: http://imgur.com/a/qx3tj i token alamofire in loginviewcontroller , want send mainpageview prepareforsegue override func prepare(for segue: uistoryboardsegue, sender: any?) { if (segue.identifier == "loginsegue") { personresource.gettoken(username: usernametf.text!, password: passwordtf.text!){ token in let mainpagevc = segue.destination as! mainpageviewcontroller mainpagevc.token = token } } } when click on login error: unrecognized selector sent instance what proper way this? can change login code this: func login(){ personresource.gettoken(username: usernametf.text!, password: passwordtf.text!){ token in if let t = token as? string{ performsegue(with:"loginsegue", sender:token) }

OpenXML SDK(C#): Copy all comments from one Excel workbook to another -

i have 1 workbook has data comments - , have copy of same workbook without comments. i want put comments in second workbook. tried appending comments 1 file , it's not working. here have tried far... spreadsheetdocument docwithcomments = spreadsheetdocument.open(@"...\comments.xlsx", true); spreadsheetdocument docwithoutcomments = spreadsheetdocument.open(@"...\nocomments.xlsx", true); workbookpart wbpwithcomments = docwithcomments.workbookpart; workbookpart wbpwithoutcomments = docwithoutcomments.workbookpart; (int = 0; < wbpwithcomments.worksheetparts.count(); i++) { if (wbpwithoutcomments.worksheetparts.elementat(i).worksheetcommentspart == null) { wbpwithoutcomments.worksheetparts.elementat(i).addnewpart<worksheetcommentspart>(); wbpwithoutcomments.worksheetparts.elementat(i).worksheetcommentspart.comments = new comments(); wbpwithoutcomments.worksheetparts.elementat(i).worksheetcommentspart.comments.commen

pthreads - luajit occasional threading approach -

i idea of occasional threading model described in 2006 post russ cox here http://lua-users.org/lists/lua-l/2006-11/msg00368.html . wondering if might have/write version luajit? if not how can compile it, post refers linit.c , luat, not sure are?

setvalue - Angular 2: How to set value on multiple select in template? -

i want set value(set 0) of select button click event. event me clear count. i have tried use [(ngmodel)] fix it, it'll sync value... don't want sync select value. need independent each select. this first question. if has mistake, please let me know! thank you! [template] <div class="container"> <div id="gallery row clearfix"> <h2>volvo</h2> <div *ngfor="let item of carinfo" class="gallery-item"> <span *ngfor="let favs of item.favorite" class="glyphicon glyphicon-thumbs-up" style="color:blue"></span> <h3 class="carmodel" #model>{{item.model}}</h3> <img src={{item.src}}/> <h3 class="carprice" #price>{{item.price}}</h3> <p>count:</p> <select class="form-control" #t (change)="addtocart(model.innertext,t.value)"> <op

java - App stopped after first launch, but no errors -

hello, lot time re according issue. i trying run app in android studio , builds fine 0 errors, app icon showing on device(i tried on different devices , emulators btw) when launches, crashes after few seconds, saying "my app" has stopped . tried view logcat errors , didnt understand problem. here logcat error file, , tell me if need other information problem please. 03-28 19:20:23.382 13915-13921/? e/jdwp: failed sending reply debugger: broken pipe 03-28 19:20:23.532 13915-13929/? e/dalvikvm: not find class 'android.app.appopsmanager', referenced method com.google.android.gms.internal.zzadf.zzg 03-28 19:20:23.762 13915-13915/? e/dalvikvm: not find class 'android.graphics.drawable.rippledrawable', referenced method android.support.v7.widget.appcompatimagehelper.hasoverlappingrendering 03-28 19:20:23.782 13915-13915/? e/onesignal: onesignal appid format invalid. example: 'b2f7f966-d8cc-11e4-bed1-df8

java - How to change background if I choose RadioButton and click Button -

i use javafx, new in javafx. app. if choose radiobutton have change background in other vbox. code. hbox box2,box1; vbox vbox1, vbox2; titledpane tp1,tp2; stackpane stackpane,stackpane2 ; radiobutton button1 ,button2,button3; button dugme1, dugme2; label labela1,labela2; checkbox cek1,cek2,cek3,cek4; @override public void start(stage primarystage) { hbox root = new hbox(); // stackpane stackpane = new stackpane(); stackpane2 = new stackpane(); vbox1 = new vbox(); vbox1.setpadding(new insets(10, 10, 10, 10)); vbox1.setspacing(10); vbox2 = new vbox(); vbox2.setpadding(new insets(10, 10, 10, 10)); vbox2.setspacing(10); labela2 = new label("operativni sistemi"); vbox2.getchildren().add(labela2); cek1 = new checkbox("windows"); vbox2.getchildren().add(cek1); cek2 = new checkbox("linux"); vbox2.getchildren().add(cek2); cek3 = new checkbox("ios"); vbox2.getc

playframework - Communication between Play! project and Java project -

good morning all. i have 2 projects, 1 java project, , other made play!. both projects in eclipse ide. need consume method in play! project java project. how can that? thanks helping. i've never used play framework myself, put jar-file use method in "lib" folder in play project , tell ide add lib java classpath. i'm guessing you're using ide develop app (would great if mention in case). that should enough access method java project , compile code. i'm not sure if need configure play project access lib @ runtime. for more specific need provide more info want , tools you're using.

reactjs - Calling (helper) function in redux -

i'm using react-native-router-flux react-redux , think should ask question here, correct me if i'm wrong. i have activitymodal container call show whenever there api call or similar thing want show modal. i'm calling this: actions.refresh({key: 'activitymodal', visible: true}); show , actions.refresh({key: 'activitymodal', visible: false}); hide. this works i'd rather make more elegant solution. added 2 actions (for show , hide) , added there lines of code , works i'm not sure if that's correct way (and without using reducers, action - i'm new redux). i'm thinking way this: adding helper functions i'll have actions.refresh calls , importing them need access activitymodal visibility. please tell me or suggest me correct way this? thanks! edit: succeeded i'd confirm if it's practice. here did: containers/logincontainer.js ... this.props.showactivitymodal(); // calling on button press ... actions/activit

google api - Gmail API - Is there a way to list messages in sorted order w.r.t. receive time? -

is there way list gmail mails using google mail apis in sorted order of receive time? although api returns mails in reverse chronological order. small data set 10 mails, finding discrepancy. response of mail list api: { "messages": [ { "id": "15afb61b8d220a19", "threadid": "15afb61b8d220a19" }, { "id": "15afb618f941d73f", "threadid": "15afb618f941d73f" }, { "id": "15afb6174711c7af", "threadid": "15afb6174711c7af" }, ... ... { "id": "159bc283f63d5eb7", "threadid": "159bc283f63d5eb7" }, { "id": "159bc283dc97cd87", "threadid": "159bc283dc97cd87" }, { "id": "159bc283d95f097c", "threadid": "159bc283d95f097c" } ], "resultsizeestimate": 9 } first message in

SSIS Logging of OnVariableValueChanged with variable value -

i trying log changes in variable values in ssis generated biml. managed create event handler writes everytime variable changes value. when log use parameter value set "system.variablevalue". pass parameter (togheter variablename , packagename) storedproc , write in log table. problem (but not always) seems parameter not has value. see new line in db log table means evnt correctly raised , handled seems parameter empty. strangest thing values logged correctly not always, not same variables, not same packages, rather, in quite random fashion. could problem fact several variables change value @ same time (some contention on db) ? doubt it, because row gets written on db. tried write, value, 'new value = ' + ? is, appending parameter value fixed string. fixed part gets written correctly but.. no value. name of variable changed value written correctly. any idea due to? as workaround tried use ready-made logging facility of ssis in case in message column of syss

c++ - using result of constexpr function as a template parameter (clang vs gcc) -

please take @ code below, sorry bit lengthy, did best reproduce problem minimum example (there live copy of it). there have metafunction returns size of string literal, , constexpr function wraps it. when call functions in template parameter gcc (5.4, 6.2) happy it, clang (3.8, 3.9) barfs "non-type template argument not constant expression" in test body on strsize(s) . if replace str_size<s> both compilers happy. questions are: whether problem clang, or code? what way make compile on both clang , gcc constexpr function? template<size_t n> using string_literal_t = char[n]; template<class t> struct strsize; ///< metafunction size of string literal alikes /// specialize strsize string literals template<size_t n> struct strsize <string_literal_t<n>>{ static constexpr size_t value = n-1; }; /// template variable, convenience template <class t> constexpr size_t str_size = strsize<t>::value; /// same constexpr func

jquery - Calculating Military Time to Get Hours and Minutes Worked in Javascript -

i've got few day's worth of "clock in" , "clock out" entries in military (24 hour) time plain numbers. clock in | clock out -------------------- 1020 | 1555 1116 | 1857 1049 | 1204 i've manually figured out person has worked 14 hours , 31 minutes . have html page contains lot of these entries in class, use following code them in javascript: $('.clockin').each(function() {clockinsum += +$(this).text()||0;}); $('.clockout').each(function() {clockoutsum += +$(this).text()||0;}); i'm not sure go here, or if right way start. there way javascript/jquery calculate hours , minutes worked bunch of these entries? you need tell timedifference. in javascript work in milliseconds, find milliseconds difference between each start , end time, compound them , use time calculate time spent: var list = [ ["1020", "1555"], [1116, 1857], [1049, "1204"], ]; /** * difference

c++ - How to check if a template function was specialized? -

is there way establish in compile time if template function specialized? for example, assume following function: template<size_t n> void foo(); i want test if foo<42> specialized. note declaration above doesn't contain default implementation. i tried sfinae couldn't find condition on function compiler cannot deduce declaration. any thoughts? thanks is there way establish in compile time if template function specialized? with function... don't think so. but if create functor, can add static const member ( is_specialized , in following example) can give information #include <iostream> template <std::size_t n> struct foo { static constexpr bool is_specialized { false }; void operator() () const { std::cout << "- generic (" << n << ") foo struct" << std::endl; } }; template <> struct foo<42u> { static constexpr bool is_specialized { true };