Posts

Showing posts from July, 2010

html - div occupying all the space of a parent -

i have grid (i'm using semantic-ui), left column has fixed width (e.g. 768px ) , right column. want content in right column occupy height (e.g. 768px ) available. stacks , top. see demo: https://jsfiddle.net/evdymapm/1/ in right column have 3 elements: <div class="ui horizontal divider"> test </div> <div> <div id="about" class="nano"> <div class="nano-content"> <p> 12:34:56: &nbsp;&nbsp;&nbsp; &lt;test&gt; test test <p> 12:34:56: &nbsp;&nbsp;&nbsp; &lt;test&gt; test test <p> 12:34:56: &nbsp;&nbsp;&nbsp; &lt;test&gt; test test <p> 12:34:56: &nbsp;&nbsp;&nbsp; &lt;test&gt; test test </div> ...

jquery - Would a chrome extension that copy pastes Linkedin page data against Linkedin's terms of service? -

it's pretty trivial write extension let copy fields in linkedin's page , paste crm tool. to full name via jquery example fullname = $('#name').children('h1').eq(0).children('span').eq(0).children('span').eq(0).text() however, against linkedin's terms of service? have read , says scraping forbidden, scraping? it's merely automating copy pastes data on single page have access to. edit: further clarify. extension let automatically copy text seeing on open linkedin profile page have acces to, crm program use. automate exact equivalent of: opening linkedin page, selecting text name , email, copy, opening crm program, selecting respective fields, paste. yes, linkedin not allow scraping of public profiles.

python - wxpython PyEmbeddedImage Unicode error? -

i try follow tutorial embed image in python (wxpython). getting following error: typeerror: string or unicode type required in line: bmp = wx.image(plane.geticon(), wx.bitmap_type_bmp) what's wrong code?: plane = pyembeddedimage( "ivborw0kggoaaaansuheugaaacaaaaagcayaaabzenr0aaaabhncsvqicagifahkiaaabgvj" "refuwixtknlq1guyx7+/3wwbxwm5f4rflh1mnzr1uymbw1tmcm3runhrxswuxtioggeiqekp" "j/pwvejfviiuffbsn664n3oj5vgc2wvpyje93/5okrm4kpvxdz///d739zzf7/n9h+ajjyng" "ty2+j6kpier0sc6vri66ikvqxmu+pb4pel9q9flrtpf+i7ite4na/lllzeboiwa4/2gpfrq2" "99rl0kb+2g0lvcohwg+d0/j3n8imxp6ngdwbmfeohjot1z/uy9qgtm3hdeu13cr5wzx55drz" "2co68gpzzefzivcbjoxgnpavi75ubq8lao6re7aaop4j1taepjibwa/uglze1fy1ypewdanj" "nwn7x5nfh5sd0ozrvhuzypggaphe76wv7nozmwoux5s1gtnduqolo3iwrpnktq6qnimezmyv" "jqxgiyerpxo8hqp57yauybugol9dthildhns1xdnfcm...

Philips Hue Android SDK Checking for Sunset/ -

i working on app uses philips hue sdk. want perform action if after sunset. looks there sensor on bridge can return true or false if user under daylight. i'm finding documentation little lacking in area, or @ least i'm not finding it. i've found http://www.developers.meethue.com/documentation/supported-sensors gives no information how use it. other thing i've found http://www.developers.meethue.com/documentation/java-sdk-getting-started#usingsensors says how find new sensors. don't want sensors, want access daylight sensor , check daylight , if not something. thanks can provide. you can accomplish setting json values appropriately on bridge. here how using debug/clip.html tool on bridge. use 1 of hue api's perform these operations also, using debug tool easy. first, put (update) daylight sensor config own long , lat. these values omaha, ne. offsets can set plus or minus 120 minutes make state change earlier or later computed sunrise/sunset t...

c# - Mono SVN Post-Commit Hook not exiting when run under Apache -

we have ubuntu 14.04 lts svn server replacing our original windows 2003 server. both running svn via apache. part of deal our existing .net commit hooks ported on - these handle things such updating our project tracker , firing build jobs. part have succeeded - things run natively under mono. have installed mono-complete on server. when run under normal user on server, , sudo -u www-data , hook runs , exits cleanly , correctly. have tried invoking mono env - give empty environment, process still completes expected. the problem comes when hook fires. mono invoked , program proceeds normal. however, not exit. have put extensive logging in program , returns main(), should returning exit code on completion. not happen; instead, hangs infinitely. performing strace on process returns futex(0x982440, futex_wait_private, 0, null sounds process waiting something. behaviour occurs in both .net 3.5 , .net 4.0. the obvious problem here control not return svn until hook exits, clie...

java - Android socket app takes too much time to load -

i able connect server using socket. problem activity takes time load. changing textview every line in network class using handler , runnable. seems everythhing done , output... have made network thread thinking run in background , app load instantly. suggestions can do? main activity package com.abhishek.ally2; import android.os.bundle; import android.os.handler; import android.os.strictmode; import android.annotation.suppresslint; import android.app.activity; import android.view.menu; import android.widget.textview; public class mainactivity extends activity { textview textview; string header; @suppresslint("newapi") @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); if (android.os.build.version.sdk_int > 9) { strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.s...

mysql - Recurring Tasks with PHP -

i need solution recurring tasks on date. i have reminder table on database. have these structure; id, contract_id, remindtask, remind_startdate, remind_enddate, remind_repeat, remind_repeatunit, remind_responsible [note: remind_repeat , remind_repeatunit columns using on date("d.m.y", strtotime(date + 1 day ))] i want make agenda @ http://bootsnipp.com/snippets/featured/agenda except time column. want use first reminder of representation checkbox on other date("d.m.y", strtotime($calendar_date +$repeat $repeatunit)) display in form. i write code , approached want. $conn_reminder_min_startdate = mysql_query("select * reminder order remind_startdate asc"); $get_reminder_min_startdate = mysql_fetch_array($conn_reminder_min_startdate); $remind_min_startdate = $get_reminder_min_startdate['remind_startdate']; $conn_reminder_max_enddate = mysql_query("select * reminder order remind_enddate desc"); $get_reminder_max_enddate = ...

database - Liquibase support for Postgres and Oracle -

this question related liquibase. our application code base has support oracle , postgres. 1 product on oracle , other on postgres. there changesets common both products. there tool can execute liquibase changesets database agnostic , tweak them based on target database? if more information needed or if unclear elaborate. thank you. yes, possible, can tedious. 1 of key tools use dbms attribute on changesets - marks particular changeset being applicable dbms. useful things have use platform-specific sql, such in stored procedures , functions. key technique using properties (liquibase calls them changelog parameters) things vary data type used on column depending on dbms. search ' liquibase changelog parameters ' documentation on this. as run problems, feel free post new questions here on stackoverflow - there large community of users , developers can help. if questions focused single issue @ time , include: this did (full command, changelog, etc.) this e...

javascript - Firebase return a collection as an array -

i trying build app using firebase end , need seems simple problem. want return list of nested data (i know shouldn't nesting data!) array. try , solve have following give me collection of status each record in database: var ref = new firebase("https://firebase_url"); ref.orderbychild("status").on("child_added", function (snapshot) { var articleid = snapshot.key(); var articledata = snapshot.val(); console.log(articledata.status.status); this gives me collection of status how combine these console.log list array? you can declare array outside scope of firebase event, , on event push it: var ref = new firebase("https://firebase_url"); var statuscollection = []; //array outside 'child_added' scope ref.orderbychild("status").on("child_added", function (snapshot) { var articleid = snapshot.key(); var articledata = snapshot.val(); statuscollection.push(articledata.status.sta...

javascript - provide HTTP status to the success callback of $resource -

Image
i need status code of factory promises, how can it? myapp.factory('cartservice', ['$resource', function($resource){ return $resource('/api/v1/carts ', {}, { show: { method: 'get', isarray:false, headers:{'authorization':'token token=' + localstorage.token} }, create: { method: 'post', headers:{'authorization':'token token=' + localstorage.token} } }) }]); this call cartservice.show().$promise.then(function(data){ $rootscope.cart = data; // status ???? }).catch(function(response){ growl.warning("problems!!", {title: 'error'}); }) the response has status 204 as said in this answer, you have add interceptor $ressource call. in interceptor, can add $http response promise response. code this: var resource = $resource(url, {}, { get: { method: 'get' interceptor: { response: function(resp...

java - Android good architecture -

i interested in exploring architectural patterns android applications. i made several experiments viper , clean architecture approaches material/ideas investigate dear fellows. here important points should reflected: it should handle routing/navigation in typical single activity/multiple fragments app it should separate components/layers run on background threads , on main thread , communicate between layers (observer pattern, eventbus or whatever) it uses limited amount of third party libraries , if please indicate pros , cons (like dagger dependency injection example) it helps mantaining orthogonality on long run while adapting/extending app. change in 1 module should affect minimum amount of components without having cascading effects because components thigh coupled. it great have real examples/prototypes on github or wherever keep real , practical without being on academic side ;-) thanks in advance cool ideas/patterns you can use mvp + repository patter...

R, ggvis graphing from two data frames that both need to be grouped by -

Image
i'm creating stacked bar graph multiple horizontal lines running through it. done in shiny app. user picks option , depending on is, there either 2 or 3 horizontal lines. here minimal reproducible example: df1 <- data.frame(a=as.factor(rep(1:10,2)), b=sample(1:5,20, replace=t), c=c(rep("apple",10), rep("banana",10)) ) df1 <- df1[order(df1$a, df1$c),] df2 <- data.frame(a=as.factor(rep(1:10,2)), i=c(rep(3,10),rep(4,10)), j=c(rep("red",10), rep("green",10)) ) > df1 b c 1 1 5 apple 11 1 2 banana 2 2 3 apple 12 2 3 banana 3 3 1 apple 13 3 2 banana 4 4 3 apple 14 4 1 banana 5 5 4 apple 15 5 3 banana 6 6 4 apple 16 6 2 banana 7 7 3 apple 17 7 4 banana 8 8 5 apple 18 8 1 banana 9 9 5 apple 19 9 2 banana 10 10 1 apple 20 10 3 banana > df2 j 1 1 3 red 2 2 3 red 3 3 3 red 4 4 3 red 5 5 ...

javascript - AngularJS - Conditionally set a controller for the route -

i'm using native angularjs router , wondering if there way assign controller route conditionally. example, let's have 3 user types: guest user system admin when come home page, want able assign different controller based on user type. have 3 registered controllers: guesthomectrl , userhomectrl , systemadminhomectrl . i imagined this: $routeprovider .when( '/' , { controller: gethomectrl(), controlleras: 'homectrl' }) i know can pass in string of registered controller, main issue being able find out type of user logged in. have userservice typically keeps track of that, doesn't seem can access set routes. or mistaken? any direction out lot. check this article of dan wahlin. he explains how achieve near question.

oracle - referencing a variable from another procedure in plsql -

i have written package : create or replace package body new_hire_pkg procedure load_emp( errbuf out varchar2, retcode out varchar2 ) cursor cur_person_info select * table_abc; cursor cur_person_adr select * table_adr; l_person_id number; l_emp_num number; lv_add_type varchar2(100); lv_address_line1 varchar2(100); begin person_info_rec in cur_address_info loop hr_employee_api.create_employee ( p_validate => false, --input parameter p_hire_date =>person_info_rec.date_start, -- output p_employee_number => lc_employee_number, p_person_id => ln_person_id ); end loop ; end; procedure load_add( errbuf out varchar2, retcode out varchar2 ) ln_person_id number; begin address_info_rec in cur_address_info loop begin hr_perso...

mysql - Python - Import CSV file and save it into Database SQLAlchemy -

i have prblem importing csv-file database... im using sqlalchemy in python , wanted open csv-file show in qtablewidget maybe change values , after write db (new table). def setintable(self): colcnt = len(self.title) rowcnt = len(self.data) self.tabel_model = qtgui.qtablewidget(rowcnt, colcnt) vheader = qtgui.qheaderview(qtcore.qt.orientation.vertical) self.tabel_model.setverticalheader(vheader) hheader = qtgui.qheaderview(qtcore.qt.orientation.horizontal) self.tabel_model.sethorizontalheader(hheader) self.tabel_model.sethorizontalheaderlabels(self.title) in range(rowcnt): j in range(len(self.data[0])): item = qtgui.qtablewidgetitem(str(self.data[i][j])) self.tabel_model.setitem(i, j, item) self.tabel_model.horizontalheader().sectiondoubleclicked.connect(self.changehorizontalheader) self.setcentralwidget(self.tabel_model) get csv-data def getdata(filepath): open(filepath, 'r') csvfile: ...

android - EditText not working in RecyclerView Adapter. Random Data is displayed on device -

im making app takes movie name input user, after input new screen displayed showing list items of movie, list of movie shown " http://www.omdbapi.com/ " imdb. on clicking list item(movie name) details of movie shown in screen, working fine before getting input, hard code movie name before want user give inout think there's problem in edit text i'm unable input user. mainactivity class public class mainactivity extends appcompatactivity { private static string log_tag = mainactivity.class.getsimplename(); private edittext edittext; private button button; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); edittext = (edittext) findviewbyid(r.id.edittext); button = (button) findviewbyid(r.id.button1); button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { validateinput(); } })...

html - Table created using PHP has attribute display:none -

i'm struggling strange error. create html table mysql query using php so: echo "<div id=\"table_div\">"; echo "<table id=\"ad_table\">"; echo "<tr id=\"table_header\"><td>media id</td><td> company</td><td>title/claim</td><td>start - end</td><td>website/email</td><td></td></\td></tr>"; while($row = mysql_fetch_assoc($result)) { echo "<tr id= " . $row['id']. "><td><b>" .$row['titel'] . "</b> <br>" . $row['offer'] . "</td><td><button class=\"del_btn\" rel=" . $id . ">delete</button> </td></\td></tr>"; } echo "</table>"; echo "</div>"; but table not visible. can inspect html , table , expected rows present table class h...

ios - Use parent coordinates in SKShader -

i'm playing around skshader ios. void main() { vec4 val = texture2d(u_texture, v_tex_coord); float len = 0.5 + 0.5 * sin(10.0 * u_time + 0.05 * (gl_fragcoord.x + gl_fragcoord.y)); vec4 c = vec4(vec3(len), 1); gl_fragcolor = c * val; } i want assign shader sprites connected, , want effect smooth between sprites. hence don't think can use v_tex_coord in shader. use gl_fragcoord instead. the problem sprites children of sknode can moved. , gl_fragcoord in screen coordinates movement affect animation. q: there way avoid sprite shaders affected movement of parent node without passing uniform data, containing position , zrotation of sprite, shader? yes, rather changing uniform (which recompile shader), pass size skattribute , update attribute in skscenedelegate update method. for example: let attributebasedshader = skshader(filenamed: "usingattributes.fsh") attributebasedshader.attributes = [ skattribute(name: "a_sprite_position...

When is it ok to use AJAX to access Firebase data? -

my question simple sounds. when ok use ajax rather create new firebase() object when retrieving data? i (ajax) or create new firebase object, better? function get_user_data(user_id) { var gotuserdata = $.deferred(); var username, userlastcheckin; $.ajax({ datatype: "json", url: datalocation + '/users/' + user_id + '.json', type: "get", success: function(data) { if(data != null) { userdata = data; // console.log(userdata); username = data['username']; userlastcheckin = data['checkin']; } }, }).always(function () { userinfo = [username, userlastcheckin]; gotuserdata.resolve(); }); return $.deferred(function (def) { $.when(gotuserdata).done(function () { def.resolve(); }); }); } i want know if secure? i know firebase d...

javascript - Why does this simple regex work everywhere except html5 input pattern attribute? -

this question has answer here: new regexp('^\+\d{2}\.\d{10}$') doesn't work 3 answers this html input colours red indicate pattern has not matched when value in input "1". var inp = document .createelement ('input'); inp .pattern = '^\d+\.?\d*$'; document .getelementbyid ("foo") .appendchild (inp); the regex /^\d+\.?\d*$/ matches "1" when test elsewhere. looks should too. why form element fail match? (firefox.) string representations, son. your usage of pattern attribute correct in using string literals. mdn : the regular expression language same javascript's. pattern not surrounded forward slashes. however, in string literals have escape \ before slash gets own li'l interpretation in string literal sense. if escape it, seen actual slash , then whole pattern recognised re...

c# - Move 2 dimensional array lines one level lower -

i've got 2 dimensional array looks sth that: 1 2 3 4 5 6 7 8 9 i'd copy every line 1 level lower, generating new first 1 method, this: x x x 1 2 3 4 5 6 the last line before copying deleted. there better way copying new array , copying original one? you can move values without create temporary array: for (int j = arr.getlength(1) - 1; j > 0 ; j--) // replaces values (int = 0; < arr.getlength(0); i++) // of each row arr[i, j] = arr[i, j - 1]; // previous row values then, copy new values: for (int = 0; < arr.getlength(0); i++) arr[i, 0] = /* new row values */

Google Bar Chart custom tooltip does not work -

Image
this code: chart = new google.charts.bar(document.getelementbyid('chart')); var datatable = new google.visualization.datatable(); datatable.addcolumn('string', ''); datatable.addcolumn('number', 'value'); datatable.addcolumn({type: 'string', role: 'tooltip', p: {'html': true}}); var rows = [ ['u.s.', 2, "tool"], ['france', 10, "tip"] ]; datatable.addrows(rows); chart.draw(datatable); does not result in custom tooltip. strangely works other chart types. do know why please? [edit] apparently not possible. there other way put "%" symbol in tooltip, in screenshot? the tooltip should show formatted value default. using object notation values, can provide formatted value ( f: ) along required value ( v: )... you can use datatable.setformattedvalue(...) after table loaded... example... google.charts.load('current', { callback:...

php - How to remove all items of array except specific one? -

i have variable containing these nested arrays: echo $var; /* output: array( [0] => array ( [id] => 1 [box] => 0 ) [2] => array ( [id] => 2 [box] => 0 ) [3] => array ( [id] => 3 [box] => 1 ) ) */ now want remove items of array above except $numb = 2; (the value of id) . mean want output: echo newvar; /* output: array( [2] => array ( [id] => 2 [box] => 0 ) ) */ how can that? actually can part of using if statement , array_shift() function: foreach($var $key => $val) { if($val["id"] != 2) { array_shift($var); } } but output of code above isn't want need. you can use different loop. foreach ($var $item) { if ($item['id'] == 2) { $newvar = $item; break; ...

qt - Initialize QProcess to a process already running -

i know if it's possible create qprocess , initialize process running? my application starts other application. if application abnormally closed, when restarted, attach other application. you should use ipc system e.g. qt d-bus on linux. communicate other process on ipc system instead of stdin , stdout. when frontend application crashes, restarted application can reconnect backend process.

webserver - Does concatenation improves I/O performance? -

http/2 nice improvement, don't have network overhead related creating multiple connections download multiple files, , recommended stop concatenating js , css files improve caching, i'm not sure if perspective of i/o, having read multiple files hard drive impact performance. i don't know if web servers apache or nginx have ram caching of frequent files , avoids i/o overhead , can stop concatenating , stop worrying this. no, having read multiple files hard disk won't worsen performance, specially if using current crop of ssd hard-drives. have amazing performance , them network bandwidth, ssl , else bottlenecks. also, operating systems automatically cache in ram accessed files, feature doesn't need built web server, because built operating system. , works if using magnetic drives. there 1 thing though. (at shimmercat.com) have noticed compression suffers having multiple small files instead of concatenated one. in sense, have been nice if http/2 had i...

php - SilverStripe data not showing in the template -

i tried can not output existing data in database server. page.ss (layout directory) <div class="content-container unit size3of4 lastunit"> <article> <div> <% loop $latestmydata %> $data1 <% end_loop %> </div> <div class="content">$content</div> </article> $form $commentsform </div> mydata.php (mysite/code directory) class mydata extends dataobject { private static $db = array( 'data1' => 'varchar(30)' ); } class mydata_controller extends controller { public function latestmydata($count = 1) { return mydata::get() ->limit($count); } } i tried build database /dev/build , flush cache ?flush=all still no output. know wrong? the latestmydata function should in page_controller instead of mydata_controller controller page template call. ...

php - Unknown column '(value)' in 'field list' -

ok, maybe fool, can't find out whats wrong here. :) i error unknown column '(the value user has selected dropdown)' in 'field list' yes, know question has been asked many times before, , have tried fix problem old answers, can't figure out. i'm trying make posting form forum , error because of "select topic type" dropdown menu. <?php //create_topic.php include 'connect.php'; include 'header.php'; echo '<h2>create topic</h2>'; if($_session['signed_in'] == false) { //the user not signed in echo 'sorry, have <a href="/forum/signin.php">signed in</a> create topic.'; } else { //the user signed in if($_server['request_method'] != 'post') { //the form hasn't been posted yet, display //retrieve categories database use in dropdown $sql = "select cat_id, ...

three.js r75 pointLight shadows in wrong places -

i have jsfiddle containing fixed sun , moons , moving planet earth orbits sun. here code 2 lights (ambient , point) , example objects. var light2 = new three.ambientlight(0x444444);//... lighting sun , other meshbasicmaterial meshes. scene.add(light2); //... pointlight // http://threejs.org/docs/#reference/lights/pointlight var light3 = new three.pointlight( 0xffffff, 10, 150000,1); light3.castshadow = true; light3.shadow.camera.near = 1; light3.shadow.camera.far = 5000; light3.shadow.camera.fov = 90; // light3.shadowcameravisible = true; light3.shadow.bias = 0.001; scene.add( light3 ); // spheres var spheregeom = new three.spheregeometry( 40, 32, 16 ); var sunmaterial = new three.meshbasicmaterial( { color: 0xffff00 } ); this.sun01 = new three.mesh( spheregeom.clone(), sunmaterial ); sun01.position.set(-500, 0, 220); ...

c++ - Looks like COM object is created, but JScript fails to get a reference -

i'm using following code create com component have developed , registered. var mycom = new activexobject("mirabilis.componentservices.1"); mycom.setfirstnumber(5); mycom.setsecondnumber(3); the first line runs fine, while if alter progid (that is, string passed activexobject ) message automation server can't create object . suggests @ least basics of registration mechanism working properly. i integrated logging calls dll. when run script proof log file both call queryinterface : stdapi dllgetclassobject( const clsid &clsid, const iid &iid, void **ppv) { ... caddfactory *paddfact = new caddfactory; ... hresult hr = paddfact->queryinterface(iid, ppv); if (hr == s_ok) writetologfile("class queryinterface returned s_ok"); else writetologfile("class queryinterface failed"); return hr; ... } and one: hresult __stdcall caddfactory::cr...

php - Dynamic Virtual Host gives 500 error with Laravel -

i'm trying make dynamic developing environment virtual host. have: <virtualhost *:80> usecanonicalname off virtualdocumentroot "c:\xampp\htdocs\%1\public" # available aliases use serveralias *.dev </virtualhost> and works default route of laravel: route::get('/', function () { return view('home.index'); }); but other route give me 500 error of many internal redirects. use laravel 5.2 without changes @ except routes.php , default changes. when assign domain virtualhost works fine: <virtualhost *:80> servername example.dev virtualdocumentroot none documentroot "c:\xampp\htdocs\example\public" </virtualhost> how can fix problem can use dynamic domain names don't have add domains manually. thank in advance, stefan fransen edit when use this: http://example.dev/index.php/test the page loading correctly not want. how remove index.php url? i've checked , al modules loaded ...

php - Targeting with Javascript -

i developing website using popular fullpage.js framework . see basic site: http://212.111.40.154/fullpage problem the slider default not automatically scroll through slides, following working code enable automatic scrolling on slides applies scrolling sliders on page. there 2 slides in demo link above, need top slider scroll automatically second slider not scroll automatically. code how can code modified apply 1 instance of slider. // automatic slider setinterval(function () { $.fn.fullpage.moveslideright(); }, 3000); i'm sure others can benefit response, fullpage author add answer faq. damn easy 1 :( solution: // automatic slider setinterval(function () { $('#section0 .fp-controlarrow.fp-next').click(); }, 3000);

assembly - How to restrict Vtune Analysis to a specific function -

i have program basic structure below : <c language headers> main() { malloc() allocations , file reads these buffers call assembly language routine needs optimized maximum write output of files , free() exit() } the assembly language program computes checksum of data in buffer, , intention optimize absolute maximum. not make system calls, or library function calls. i have installed intel vtune amplifier xe suite vs 2015. how specify vtune focus strictly on assembly language routine part, , skip analysis on "c" language preparatory parts. seem getting data cumulated, instruction count, or cpi, etc. possible data loops , branches within assembly language subroutine. if so, please advise how that. thanks you can instrument code via vtune provided api analyze specific regions in workload. use task api tracking thread-specific activities or frame api analyzing global stages in workload. configuring analysis type, select option "ana...

javascript - Passing callback twice in single function in NodeJS -

i have created function fetch values firebase. variables in stored result of firebase query accessible inside firebase operation. require variables outside function created callback function overcome problem. my code looks this: have 2 firebase databases. 1 store registered users (ref1) , 1 store paid users(paidref). need check 1 has login registered user or paid user. var paidref=new firebase("https://app.firebaseio.com/paidusers"); var ref1=new firebase("https://app.firebaseio.com/tempuser"); function checkpaidusers(res,callback){ ref1.orderbychild('userid').equalto(jsondata.userid).once('child_added', function(snap) { registereduser=true; paidref.on('child_added',function(snapshot) { if(snapshot.child('userid').val()==jsondata.userid ) { paidflag=true; return callback(registereduser,paidflag,res); } else { paidflag=false; return callback(registereduser,paidflag,res); } }...

Swift Convert A String-As-An-Array, To An Array Of Strings -

i have string: "["word1","word2"]" and want simple way convert actual [string] . all other questions dig on there converting int strings arrays. i tried doing array(arrayliteral: "["word1","word2"]") but get ["[\"word1\",\"word2\"]"] manually cleaning edges , removing slashes seems i'm doing wrong. i'm curious if there's simple way convert array of strings string array of strings. i.e. convert "["word1","word2"]" ["word1","word2"] solution (thanks @eric d) let data = stringarraystring.datausingencoding(nsutf8stringencoding) var stringsarray:[string]! { stringsarray = try nsjsonserialization.jsonobjectwithdata(data!, options: []) as? [string] } catch { print() } print("array \(stringsarray)") encode "string array" data, decode da...

matplotlib - Convert str( location ) to tuple of (Longitude,Latitude) in Python 3? -

i'm doing webscraping list of locations. want try , convert these respective longitude , latitude coordinates. found geopy looks right stuff. with or without geopy , how can convert list respective coordinates (lon: (from -180,180) , lat: (from -90,90)) within python 3.5 ? preferably precise coordinates if not possible, general area coordinates work well. i found resource trying mimic https://pypi.python.org/pypi/geopy #convert longitude/latitude geopy.geocoders import nominatim geolocator = nominatim() locations = ['kahekili beach/old airport beach, leeward shore maui', 'outside honokohau harbor south / naia / ripoff reef, north kona coast', 'ulua beach, leeward shore maui', 'kaiwi pt./arch cave/wash rock/sand channel/kamanu/devils doorway, north kona coast', 'honolua bay mlcd, leeward shore maui', 'golden arches', 'lone tree arch / freeze face cave, north kona coast', 'old airport', 'turtle heav...

html - Make grails pagination -

my controller returns results in array this: render (template: 'show' , model: [changes: changes]) show default action , changes array created query( createcriteria ). how can make pagination in index.gsp page displaying results in html div? my problem: controller: def list() { [terminhistorie: changes, terminhistoriecount: changes.size()] } gsp: <g:paginate controller="terminhistorie" action="list" total="${terminhistoriecount}"/> error: tag [paginate] missing required attribute [total] @ c:/users/matejb/documents/netbeansprojects/gutmann/grails-app/views/terminhistorie/index.gsp:309 the way pagination works first need create view using paginate tag, on show action need slice changes. meaning view send offset , max parameter , createcriteria query database data. take @ page , here see how can pass max , offset createcriteria method. to see example, see page or create new application 1 simple do...

authentication - WSO2: How to logout a user that has obtained a 'rememberMeCookie' -

i using wso2 identity server 4.1.0 perform basic authentication. possible call authenticationadmin webservice, contains 'loginwithremembermeoption'. user obtain 'remembermecookie', can log in, if session (jsession) has expired. i have learned loginwithremembermeoption has timeout: 7 days, , time cannot modified: wso2 authentication, adding/modifing timeout rememberme cookie the authenticationadmin service provides 'logout' operation. unfortunately, operation invalidate session. if user has rememebermecookie, still able login: wso2 authenticationadmin logout the question is, how logout user has obtained rememebermecookie? preferably using authenticationadmin? as understand there no direct way logout user remember me cookie. i went through code. once login remember me option, uuid generated. refer org.wso2.carbon.core.services.authentication.authenticationadmin.loginwithremembermeoption(string, string, string) method in authenticationadmin ...

c++ - How to get rid of libcurl linking error? -

i using libcurl version 7.19 in cpp application. trying use example given kukuruku.co . when try build application getting following errror, lib/libcurl.a(libcurl_la-http_negotiate.o): in function `cleanup': http_negotiate.c:(.text+0x1b): undefined reference `gss_delete_sec_context' http_negotiate.c:(.text+0x30): undefined reference `gss_release_buffer' http_negotiate.c:(.text+0x45): undefined reference `gss_release_name' lib/libcurl.a(libcurl_la-http_negotiate.o): in function `curl_output_negotiate': http_negotiate.c:(.text+0x123): undefined reference `gss_release_buffer' http_negotiate.c:(.text+0x1c0): undefined reference `gss_release_buffer' lib/libcurl.a(libcurl_la-http_negotiate.o): in function `curl_input_negotiate': http_negotiate.c:(.text+0x324): undefined reference `gss_c_nt_hostbased_service' http_negotiate.c:(.text+0x33a): undefined reference `gss_import_name' http_negotiate.c:(.text+0x48e): unde...

winrt xaml - Navigate to another page from flyout -

is possible navigate page when flyout popup in settings charm shown in windows 8. want able navigate page when button clicked in flyout popup if page want display.... public sealed partial class pagetonavigateto: layoutawarepage { //code stuff page } your flyout code this... private void navigationclick(object sender, routedeventargs e) { frame rootframe = window.current.content frame; rootframe.navigate(typeof(pagetonavigateto)); }

sql - Using Oledb connection string for Localhost c# -

when use oledb c# connection noticed lot connection using file. how connect localhost using oledb? created database , tables using microsoft sql server management connect sql express , using window authentication when using function don't know how should convert connect localhost //want connstring connect localhost instead of file public static string connstring = @"provider=microsoft.jet.oledb.4.0;data source=" + path + "\\database\\errdb.mdb"; public static oledbconnection connection; public myfunction() { string sqlstring = "select name,contact,accesslevel,crudential_id errors crudential_id =@id"; connection = new oledbconnection(connstring); oledbcommand command = new oledbcommand(sqlstring, connection); //open connection connection.open(); command.parameters.add("@id", oledbtype.varchar); command.parameters["@id"].value = "test"; //read database oledbdatareader reader = ...