Posts

Showing posts from March, 2011

.net - Highlight text of PDF--same functionality as Adobe? -

i have acro com object on wcf . document loads correctly , of functionality through adobe can found within com. need "comment" toolbar (specifically "highlight text" tool) active. can open toolbar, every option greyed out. may duplicate, haven't been able find answer question despite searching find. i not need save highlighted text when close pdf. pdf loading code is: private sub lomcdataentry_load(sender object, e eventargs) handles mybase.load dim screen screen screen = screen.allscreens(0) frmpdf.bounds = (from scr in screen.allscreens not scr.primary)(1).workingarea frmpdf.startposition = formstartposition.manual frmpdf.axacropdf1.loadfile("g:\gis\alycia\development\lomcdev\2015084\regular lomc section\region i\nh\15-01-0961a-330104.pdf") frmpdf.show() end sub you need use javascript: collab.showannottoolswhennocollab = true take @ question: enabling annotation in adobe axacropdflib it's c# may

Want to Compare values of 2 maps having billions of data in java -

i getting values database storing in maps. want compare values of 2 maps , load database problem is, maps having 100ks of data. right code written in such way comparing every entry eg if both maps having 200k of entries looping 200k * 200k times , taking days & days. need compare string , long values separately. so there efficient way compare can avoid unnecessary looping? here code written , old code: below getallmaps method retrieving data database , storing in maps: protected hashtable recordslist = new hashtable(); protected hashtable recordslistic = new hashtable(); public void getallmaps() throws exception { int count = 0; int = 0; int j = 0; int k = 0; long nicphyport, nicid; string ipv4val, ipv6val; try { trace.debug("ruuning pvc sql map"); nicpvcstmt.setfetchsize(5000); resultset rs = nicpvcstmt.executequery(); int rcnt = 0; while (rs.next()) { rcnt++; hash

write Scala iterative recursion like Python generator -

i can write recursion return iterator in python using generator. like permutation function string: def permute(string): if len(string)==1: yield string else: in range(len(string)): p in permute(string[:i]+string[i+1:]): yield string[i]+p how translate scala version. can scala's iterator work here, or need resort continuation (never used, heard of )? you can use stream similar effect: def permute[t](list: list[t]): stream[list[t]] = if (list.size == 1) stream(list) else { <- stream.range(0, list.size) l <- list splitat match { case (left, el :: right) => permute(left ::: right) map (el :: _) } } yield l it works ok permutations of long sequences. example, printing last 10 elements 10 permutations of 100 elements starting 10000-th permutation: scala> permute(1 100 tolist) slice (10000, 10010) foreach { lst => println(lst.takeright(10)) } list(91, 92, 94, 100, 99, 95

javascript - jQuery toggle button text and Icon -

i trying toggle both icon , button text on button , each function works independently, not work when run consecutively. seems function toggle button text removing icon altogether. <button type="button" id="toggle-list-details"> <i class="fa fa-list fa-lg"></i> list view </button> $("#toggle-list-details").click(function() { $(this).text(function(i, text){ return text === " list view" ? " details view" : " list view"; }); $(this).find('i').toggleclass('fa-list fa-th-list'); )}; when $(this).text(function(i, text){ this reffers <button type="button" id="toggle-list-details"> , replaces inner content plain text. to avoid this, can smth this: <button type="button" id="toggle-list-details"> <i class="fa fa-list fa-lg"><

version control - git push error between two local respositories -

i have (main)folder 'prj' directories , have git init there creating repo , added , committed files git add * i have created directory 'prj2' have git init , did git pull copied on 'prj2' now when make changes files in prj2 repo , commit, git push prj(main) gives error: remote: error: refusing update checked out branch: refs/heads/master[k remote: error: default, updating current branch in non-bare repository[k remote: error: denied, because make index , work tree inconsistent[k remote: error: pushed, , require 'git r............. is correct way set main project(prj) , second(prj2) can push main? and if pushing not possible because main project repo non bare git init..etc, how should 1 push main repo? or different set better? the easier way clone main project , configure remote . fact it's local not issue in other words, instead of init ing 2 repos, init --bare 1 , clone it. or if both need have working copy

osx - Game Center Air Native Extension. Connection error -

making game center ane os x. when app unsigned, (and enabled workaround, described here https://devforums.apple.com/message/736545 ), works fine. when sign app distribution, , disable workaround, raise errors, when try authorize local player could not services gamed. please file radar including gamekit logs, , gamed crash logs. error error domain=nscocoaerrordomain code=4099 "couldn’t communicate helper application." (the connection service named com.apple.gamed.osx invalidated.) userinfo=0x325c90 {nsdebugdescription=the connection service named com.apple.gamed.osx invalidated.} error domain=gkerrordomain code=3 "the requested operation not completed due error communicating server." userinfo=0x21ce90 {nslocalizeddescription=the requested operation not completed due error communicating server.} has encountered similar problem? here script, use sign app: app=myapp.app cert=3rd party mac developer application: ... rm "$app"/contents/frameworks/

java - XMPP register new user -

i having lots of trouble xmpp, new , examples have found have account connect , things. my problem concerns new users. not have account needs able register himself , log in. have understood, first need create connection before can create users. without account can not create one. some links have been reading: http://alvinalexander.com/java/jwarehouse/eclipse/platform-ui-home/eclipsecon/tutorial/example2/org.jivesoftware.smack/src/org/jivesoftware/smack/accountmanager.java.shtml https://code.google.com/p/lxmppd/issues/detail?id=328 https://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp/ http://www.igniterealtime.org/builds/smack/dailybuilds/documentation/connections.html https://gist.github.com/mindjiver/1605194 so basically, need create connection without user login. create user , login user. so found this: how register new user on xmpp using (a)smack library but seems accountmanager class outdated or because canno

c# - Trouble using TemplateGroupDirectory -

i want put several template files on directory named "templates", relative executable of application, , use them. 1 template file, instance, named "globals.st". that way, created templategroupdirectory , loaded template: var group = new templategroupdirectory("templates"); var tmpl = group.getinstanceof("globals"); on trying instance of template i've got message saying occurs nullreferenceexception. what missing? might syntax thing heres example: string fullpath = path.getfullpath("templates/"); templategroupdirectory tgd = new templategroupdirectory(fullpath ,'<','>'); template t = tgd.getinstanceof("helloworld"); t.add("world", "shitty world"); i have folder named templates, file helloworld.st contains helloworld(world) ::= << hello, <world> >> my best guess cannot find .st file need, remember put copy on newer or coby, on .st file

angularjs - Triggering function when image is loaded -

i creating ionic application. in application, have image want resize (itself , map area associated) when loading of image finished. problem don't know directive use call (it doesn't seems ng-init ). example of want : <div class="ng-scope" ng-controller="screenshotctrl"> <img id="main_img" class="rwdimgmap" ng-src="img/home.jpg" usemap="#map_main_img" width="360" height="569" ng-directive_i_dont_know_of="thefunctioniwanttocall"> <map name="map_main_img"> <area shape="rect" coords="358,567,360,569" alt="image map" style="outline:none;" title="image map" /> <area href="#/homemenu" shape="poly" coords="359,246,282,91,16,220,182,557,356,474" style="outline:none;" target="_self&q

C# Linq double groupby need min/max for hourly values once per day -

i have been playing around awhile , can't quite result looking for. i have object this: public class point { public string tag {get;set;} public datetime time {get;set;} public int value {get;set;} } each tag have 24 values per day (one per hour). data (tag / time / value): x / 5-15-2015 - 0100 / 10 x / 5-15-2015 - 0200 / 20 x / 5-15-2015 - 0300 / 30 y / 5-15-2015 - 0100 / 20 y / 5-15-2015 - 0200 / 30 x / 5-16-2015 - 0100 / 10 for example... i sort tag , date, min/max/avg 24 hrs in each day. goal create following object. public class newpoint { public string tag {get;set;} public datetime date {get;set;} public int lowvalue {get;set;} public int highvalue {get;set;} public int avgvalue {get;set;} } where resulting objests (tag / date / lowvalue / highvalue / avgvalue): x / 5-15-2015 / 10 / 30 / 20 y / 5-15-2015 / 20 / 30 / 25 x / 5-16-2015 / 10 / 10 / 10 i having issues with: group list new {list.tag, list.time.tost

multithreading - Use of setjmp and longjmp in single-threaded MPI applications -

i have read other questions posted other users regarding setjmp , longjmp in multithreaded applications. people use of these 2 may not safe multithreading. so safe use setjmp , longjmp in single-threaded mpi applications have main thread? i asking because know mpi runtime creates other implementation-dependent threads running along side main() thread not sure whether affect use of setjmp , longjmp in mpi application or not.

angularjs - Sending an image via a post request from an Ionic app to a rails endpoint -

i working on ionic mobile application take photos, attach location , send them inside post request rails endpoint. after looking @ link , link , countless others, have been unable find solid information on implementing particular feature. i can upload photos through browser using html input form, added database , displayed on app via request. however @ moment when taking photo on phone , attempting send via post request directly app, location information being received, image not being correctly encoded. here json data has been received, returning "image_url":"/images/main/missing.png" . { "id":6,"city":"greater london", "country":"united kingdom","created_at":"2015-05-14t21:22:22.825z", "updated_at":"2015-05-14t21:22:22.825z","image_file_name":null, "image_content_type":null,"image_file_size":null, "i

graphviz - Dot language with concentrate=true confusing the graph -

Image
i draw simple graph shown below , found different behavior of color display. digraph g { concentrate=true edge [dir=none] -> b [color=red] b -> c c -> b b -> } graph show edge between , b red >> 1 correct. but when change digraph g { concentrate=true edge [dir=none] -> b b -> c c -> b b -> [color=red] } this time color of edge , b black not red color want. figure out wrong here? analysis because code in question draws 2 edges 1 on top of other, color of last edge drawn wins. layout engine dot works either bottom top or right left. means last edge drawn first 1 listed. general solution dot draws digraphs. undirected graph can simulated using dir=none there should 1 edge: digraph g { concentrate=true edge [dir=none] -> b [color=red] b -> c } alternative keep in mind dir=none not intended display property. if goal 2 dir

android - Firebase, gps location and speed -

i want build traffic report app gets gps location , speed user driving , calculates , sends traffic conditions of closest streets. can use firebase store data , sync result every device? should have server app calculates conditions or not?

php - Writing text on an image in javascript -

i need add text uploaded image , upload new image text onto server. i'd use image on server, means have variable $image_location linking directly image set. i found code on stackoverflow enables putting text on image upload through upload form. my question how change instead of uploading image, use image on server. <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> <script> var maxsize=600, // max width or height of image font='italic small-caps bold 40px/50px arial', // font style fontcolor='white', // font color textx=50, // text x position texty=50, // text y position h=function(e){ var fr=new filereader(); fr.onload=function(e){ var img=new image(); img.onload=function(){ var r=maxsize/math.max(this.width,this.height), w=math.round(this.width*r), h=math.round(this.height*r), c=document.createelement("canvas"),cc=c.getcontext("2d"); c.widt

Possible initialized jagged array error C# -

i using jagged array of gameobjects tiled map generation, , keep getting error: indexoutofrangeexception: array index out of range. (wrapper stelemref) object:stelemref (object,intptr,object) map.generatemap () (at assets/scripts/map.cs:148) map.start () (at assets/scripts/map.cs:74) i stumped why getting error. below full function have written initialization of jagged array. far know initializing array correctly. void generatemap(){ mapwidth = random.range (5, 25); mapheight = random.range (5, 25); //initialise jagged array genmaparray = new gameobject [mapheight][]; (int = 0; < mapheight; i++) genmaparray [i] = new gameobject [mapwidth]; //generate mountains int mountx = random.range(1, mapwidth - 1); // random within int mounty = random.range(1, mapheight - 1); // map border (int y = 0; y < mapheight+1; y++) { (int x = 0; x < mapwidth+1; x++) { if((y == 0 && x <= mapwidth) |

iOS-Charts null data point do not show on chart -

like health app on ios 8 null/empty data points not displayed while x axis labels still there. using ios-charts chart library project possible achieve same? you shouldn't pass nil, not accept nil , xcode warn it. should do, not pass @ all. you not have pass y value every x index. have make sure y values ordered according x indices.

configuration - Block all IP addresses unless specified -

i want block ip-addresses trying connect omnibus server can't seem find setting in gitlab.rb config file. i've found nginx config file there notice changes overwritten, seems bit risky if reconfiguration triggered , forget add ip-blocking afterwards. how block/redirect ip-addresses own? it seems way setup entries in iptables, blocking connections given ip addresses.

storyboard - Xcode right pane (utilities pane) not applicable? -

Image
i programming using swift in xcode, halfway through when wanted edit button using utilities pane, realised became "not applicable". attributes inspector, connections inspector, etc became "not applicable", quick inspector still shows. i have selected button in storyboard. can this? attached screenshots.. storyboard cant opened @ start. open file (like appdelegate) not storyboard. than close xcode. open xcode again. works in xcode 7.2

javascript - onchange() not firing in firefox -

here's jsfiddle : http://jsfiddle.net/xpkff/330/ if open dialog, enter username , password, press button , prompted firefox's "remember password", onchange not work first time choose option dropdown if click on dropdown causes prompt dismiss. knows way around it? edit : jsfiddle seems down, here's jsbin if can reproduce problem http://jsbin.com/wecasehanu/1/ html <div id="dialog"> <form autocomplete="off"> <input id="username" type="text"/> <input id="password" type="password"/> <button type="submit" style="height:30px;width:30px;"/> </form> </div> <a href="#" id="open">open dialog</a> <select id="ih8ff"> <option>1</option> <option>2</option> </select> javascript $(

android - My list view does not get scrolled -

pfb layout my listview not scrolled have 3 list below 1 relative layout structure when click on relative layout list gets visible . working fine when click on relative layout , after data populated . list not seem scroll. <scrollview android:layout_width="match_parent" android:layout_height="580dp" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginleft="20dp" android:layout_marginright="20dp" android:layout_margintop="20dp" android:background="@drawable/bg_box" android:orientation="vertical" android:padding="20dp" > <relativelayout android:id="@+id/landrel" android:layout_width="match_parent" android:lay

node.js - How secure is to use req.param secure? -

i building rest api app , wondering if req.param secure user can alter url when getting results simple request. for example : app.get('/instruction/:url', function (req, res) { var url = req.params.url; ...stuff here... }); i retrieving data url inserted in api wondering how make sure url introduced secure , not going have injection server. :url url entered example: the url parameter used "https.request", example rest api url http://localhost/instruction/https://restcountries.eu/rest/v1/all any suggestion ? enough simple parse string ?

android - which is better to execute Database query on MainActivity or SubActivity -

i following tutorial making notepad , tutorial using 2 activity main activity , edit activity, edit activity using fill data database , query executed in main activity data must sent onactivityresult edit activity main activity . the main question want know why must pass data main activity instead of execute insert or update query on edit activity, best way?, can explain why? there have 2 activities, 1 (main) meant ust display notes, other (edit) let user create note. when user confirms creation of new note in editactivity, finish , in mainactivity's "onactivityresult" notes loaded , displayed in list. if want separate creation visualization of (i highly suggest this), want approach.

Cleaning URL using .htaccess -

from this: crunchpaper.com/jlpt/form/try_question.php to this: crunchpaper.com/jlpt/try_question/ i try this: rewriteengine on rewritecond %{request_filename} !-d rewriterule ^try_question$ /try_question.php/$1 [nc,qsa] but it's not working. i want clean url above. please me. thanks this rule should work : rewriterule ^jlpt/form/try_question\.php$ jlpt/try_question/ [l]

Find business reviews using yelp API -

i using yelp api searching business reviews. http://api.yelp.com/business_review_search?term=fire-it-up-naperville&location=naperville, il 60563&ywsid=xxxxxxxxxxxx we 20 reviews @ time. want next page reviews. there no input parameter getting next page reviews. there way next page reviews via ylp api. help appreciated. it seems business_review_search endpoint isn't part of yelp api 2.0. available endpoints described here . for request, maybe should try add offset parameter offset=20 next 20 reviews.

mysql - PHP File upload fails after some time -

i facing problem uploading files, getting errors after time. uploading files , inserting details database image name date etc. what happens till no of uploaded file 27 works when try upload more 27 file start showing errors like warning: move_uploaded_file(../../images/2015/05/imvsa/kexk.jpg): failed open stream: no such file or directory warning: move_uploaded_file(): unable move 'd:\wamp\tmp\php3635.tmp' '../../images/2015/05/imvsa/kexk.jpg' my php.ini max_execution_time = 1440 max_input_time = 1440 post_max_size = 1024m upload_max_filesize = 1024m max_file_uploads = 10000 session.save_path = "d:/wamp/tmp" session.gc_maxlifetime = 7200 memory_limit = 512m if truncate database table starts working uptill row 27 , again starts fail. my script if($_files['image']['size']<5242880&&getimagesize($_files['image'])!=false) { if(!is_

Problems creating TRIGGER in MySQL -

Image
i first time using trigger concept in mysql workbench below query, first created people table using below query, create table people (age int, name varchar(150)); then used below query trigger delimiter create trigger agecheck before insert on raptor1_5.people each row if new.age < 0 set new.age = 0; end if; delimiter ; but agecheck trigger not creating people table. not show error message when run query. here table images, updated : based on answer try this. use `raptor1_5`; delimiter $$ drop trigger if exists raptor1_5.agecheck$$ use `raptor1_5`$$ create trigger agecheck before insert on people each row begin if new.age < 0 set new.age = 0; end if; end$$ delimiter ;

html - How to change favicon right align inside the browser address bar -

i'm facing problem , don't know how change image-icon address displayed right align? <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/> updated one, there no change <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" style="text-align: right;"/> you cannot style attribute not available in link tag. can't change browser , feel unless change , feel , move icon right.

c# - FieldBuilder - Ho do you set the default value? -

i'm using typebuilder create types @ runtime, can't seem figure out how set default value of field. for example, wanted create following layout @ runtime, using typebuilder, how set default value of 'm_number' (to 64)? public class dynamictype1 { private int m_number = 64; public int number { { return m_number; } set { m_number = value; } } } here code use create property, ... how set field have value of 'defaultvalue' void addproperty(string name, type type, object defaultvalue) { // add private field of type fieldbuilder fieldbuilder = m_typebuilder.definefield("m_" + name.tolower(), type, fieldattributes.private); // define property gets , sets private field. last argument of defineproperty null, because // property has no parameters. (if don't specify null, must specify array of type objects. parameterless property, // use built-in array no elements

ios - ionic app resume and pause -

i want app when comes form it's background state active state. understand according cordova documentation can code below , working. // device apis available // function ondeviceready() { document.addeventlistener("resume", onresume, false); } // handle resume event // function onresume() { } my app build ionic , downside of using code above work outside app module, can't trigger functions inside app module. found few code example on how should work inside app module, non of them working. see examples below. $ionicplatform.on('resume', function(){ // rock on }); / ionic.platform.ready(function() { ionic.on('resume', function(){ //rock on }, element); }); / $ionicplatform.ready(function () { document.addeventlistener("deviceready", function () { document.addeventlistener("resume", function () { $timeout(function () { //rock on

javascript - JQuery Offset Script -

i creating navigation menu website. when user scrolls past point 497px needs change colour. have wrote script: $(document).ready(function(){ function checkoffset() { var offset = $(document).scrolltop(); console.log(offset); if(offset > 497){ $("#fixedbar").animate({backgroundcolor: '#1b1b1b'}, 1000); $("#fixedbar nav a").animate({color: '#fff'}, 1000); }else{ $("#fixedbar").animate({backgroundcolor: '#fff'}, 1000); $("nav a").animate({color: '#1b1b1b'}, 1000); } } $(window).scroll(function() { checkoffset(); }); }); if refresh page , past point indeed changes, if scroll past point doesn't change. how can fix this? your script works. but since animating on every scroll. there chance of having consecutive animation cycles. possible solutions (any 1 of these points), to use either

jquery - Is there a smart and universal solution for using datatables.js with relational SQL table -

couple of days i'm trying build server side processing table grid datatables.js , relational sql table. what means ? i have master table (with few joins), example select m.id, m.date, u.name, t.name, case m.type when 1 'some value 1' when 2 'some value 2' end master m left join users u on m.user_id = u.id left join test t on m.test_id = t.id .... everything ok, main problem appears on searching etc... first of all, can decide how store data json datatables, accessing field names or table prefix + field names $(".dt").datatable({ "bserverside": true, "sajaxsource": "/items/show", "sajaxdataprop": "data", columns: [ { data: "m.id" }, { data: "m.date" }, { data: "m.type" }, etc .... }); that's ok, when try search values type field must write whole procedure processing "ssearch", "ssearc

Using jQuery shake effect on document ready -

i'm trying have element on page shake when page loads. shake briefly(about 2 seconds) when username , password incorrect on sites. here have tried. <div id="login_wrapper"> <div id="login_header"><div id="header_title">enter login details below</div> </div> <div id="login_input_wrapper"> <div id="username_wrapper"> <div id="username_label"><h3>username</h3></div><div id="username_input"><input type="text" class="text_field" id="login_username" name="login_username" placeholder="username123"></div> </div> <div id="username_wrapper"> <div id="username_label"><h3>password</h3></div><div id="username_input"><input type="

eclipse plugin - Close an open IFile in editor if it is deleted in Project Explorer -

i have requirement close open ifile in editor if deleted in project explorer. as understand iresourcechangelistener can used listens changes in project workspace how can perticular file has been deleted. as event.getresource() returns iproject being changed seems . how can locate file has been deleted , close file in editor if open? a resource change event contains information changes related resources. file change file, parent folders , project. getresource method of iresourcechangeevent returns top resource has been changed. the iresourcedelta returned getdelta contains full set of resources resource change event covers: iresourcedelta delta = event.getdelta(); you can search delta particular file with: iresourcedelta filedelta = delta.findmember(file.getfullpath()); you can use accept method call 'visitor' on each resource.

Data synchronization between two or Android devices and website -

i building app allows users insert data , synchronize website. user can insert data on website well. there 2 entity tables ( t1 , t2 ) , 1 n-m relation table ( tr ). data structure (it's illustrative): t1 (_id, name, modified) t2 (_id, name, modified) tr (t1_id, t2_id) the problem facing data synchronization of ids. e.g. device a1 , a2 offline , record inserted on both, id = 1. after online sync starts , there conflict ids. thought introducing column gid - global id. structure be: t1 (_id, name, modified, gid) t2 (_id, name, modified, gid) tr (t1_id, t2_id, t1_gid, t2_gid) global id assigned website. but not sure whether approach or not (never done before , cannot tell if there future problem). you have use additional ids, suppose network_id, generate network_ids on server , use local ids on devices (e.g. uuid). when sending create entity request server generate real id , return you, can update local database network_id. important use network_id main fiel

javascript - AngularJS displaying image using base64 string -

i have image stored in database , want use angular display it. html page looks this: <img ng-if="controller.model.logo && !controller.result" ng-src="{{ controller.model.logo }}" /> and model looks this: { "id":1, "name":"test", "logo":"data:image/gif;base64,r0lgodlhgaqhafcaai6sls3o1npt1picplq9xfv47t/j5zwwm73dy…i+amvciiqn6qqaivtzzkziomicbb0lmumqg79lxkqajjl3xuje4hwbrib9cv9cgpcsnzecaga7", "theme":"black", "centers":null } but image not displaying. doing wrong? try this <img ng-if="controller.model.logo && !controller.result" ng-src="{{controller.model.logo}}" /> using string interpolation ng-src attribute

database - MySQL Relationships & Joins -

in mysql database there relationships between tables , primary key of 1 table stored foreign key in second table, there still need perform join? if there is, point on declaring relationship? i'd take stab in dark , it's indexing or related tables can find related records faster? i've tried googleing this, can't seem find much. i'm sure there loads out there on this, don't know keywords search for. here example of table 1 , table 2: ------------------- table 1 ---------------------- create table if not exists `db_hint`.`user` ( `id` int unsigned not null auto_increment, `fb_id` int not null, `last_logged_in` datetime null, `permissions` int unsigned not null, primary key (`id`), index `permissions_id_idx` (`permissions` asc), constraint `permissions_id` foreign key (`permissions`) references `db_hint`.`permissions` (`id`) on delete no action on update no action) engine = innodb; ----------------- table 2 ---------------------- create table if not exist

graph - Are orient-DB java hooks capable of providing notifications when a record gets modifed from any client -

i have started using orientdb , 1 of useful features project hook. let me try explain setup: orientdb "graph" database server running on machine-1, many clients connected on machine-2 running orientdb java based client application there many web applications connecting orientdb server graph database manipulation on machine-2 java client, have registered hooks listen change of class records expecting whenever record (of specified class mentioned hook) modified hook imitate trigger on java client running on machine-2 in reality, getting triggers when class gets modified java client running on machine-2 (i.e. same client) this code graph = new orientgraph(connectionstring, "root", "hello"); odatabasedocumenttx docdbref = graph.getrawgraph(); docdbref.begin(); try { docdbref.registerhook(new odocumenthookabstract() { ------- ------- }); docdbref.commit(); }catch (exception e) { docdbref.rollback(); } is there way, can write client can not

html - Changing button value of a jQuery mobile with a setTimeout function -

i facing challenging problem due little knowledge in jquery mobile. have researched many solutions , implemented them not seem work i have button called click me when user clicks on button, button becomes disabled , text clickme changes please wait... after 2 seconds button become activated (no longer disabled ) , text changes please wait... click me . i have gotten work extent. finding difficult grab right html code line in order change click me please wait... . i trying use example in jsfiddle file http://jsfiddle.net/nogoodatcoding/ncsbz/1/ integrate within settimeout code. any or guidance appreciated. code below: html content jquery mobile <div class="ui-btn ui-input-btn ui-corner-all ui-shadow"> clickme <input class="submit button-primary btn large send" id="wp-submit" name="up_submit" tabindex="250" type="button" value="clickme"> </div> jquery mobile co

java - Navigation Drawer is not opening on clicking menu icon -

navigation drawer not opening on clicking navigation icon(i.e 3 horizontal line on top left screen). on lollipop working, problem kitkat , jelly bean not working? styles.xml <resources> <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <!-- customize theme here. --> <item name="windowactionbar">false</item> <item name="android:windowactionbaroverlay">true</item> <item name="drawerarrowstyle">@style/drawerarrowstyle</item> </style> <style name="drawerarrowstyle" parent="widget.appcompat.drawerarrowtoggle"> <item name="spinbars">true</item> <item name="color">@android:color/white</item> </style> androidmanifes.xml <application android:name="com.volley_network_thread.appcontroller" android:icon="@mipmap/ic_launcher"

windows - IIS account environment -

iis 7.0+ uses concept of so-called virtual accounts identify application pools ( iis apppool\apppoolname ). accounts have profiles , can local environment variables set them? how? the bottom of blog post says virtual accounts cant managed, don't appear in user searches within windows sounds possible: http://weblogs.asp.net/owscott/managed-service-accounts-msa-and-virtual-accounts *iis , virtual accounts iis , virtual accounts, user called “iis apppool{apppoolname}”. example, “iis apppool\defaultapppool”. note virtual accounts can’t found windows select users or groups tool, if type in name specifically, can managed there.* alternatelively, create local user account on server , set app pool run account. with regards editing environment variables user, post says can in registry. https://serverfault.com/questions/397966/windows-how-to-set-environment-variable-for-another-user

c++ - template type dependecy and inheritance -

i have template method defined as template<class t> const std::list<t>& getlist() { return getlist(std::shared_ptr<parent>(new t())); } const std::list<std::shared_ptr<parent>>& getlist(const std::shared_ptr<parent>&a) { // } given t type of classes take parent parent class, e.g class child1:public parent {}; compilation error : can not convert const std::list<std::shared_ptr<parent>>& const std::list<t>& is there way fix without changing type of t shared_ptr ? the definitions have match. typedef std::shared_ptr<parent> parentptr; std::list<parentptr> getparentlist(const parentptr& a) { // } template<class child> std::list<parentptr> getparentlistt() { parentptr parent_ptr(new child); return getlist(parent_ptr); } ... std::list<parentptr> my_list = getparentlistt<child1>(); also make sure child1 defined (and not merely de

google chrome - navigator.serviceWorker.controller is always null -

i have problem after registering serviceworker navigator.serviceworker.controller null. never force refresh , refresh page. test google chrome 42.0.2311.152 m (32-bit). var currentserviceworker = null; navigator.serviceworker.register(service_worker_url).then(function(serviceworkerregistration { if (navigator.serviceworker.controller) { currentserviceworker = navigator.serviceworker.controller; } else { currentserviceworker = serviceworkerregistration.active; } }); according this: the controller read-only property of serviceworkercontainer interface returns serviceworker object if state activated (the same object returned serviceworkerregistration.active). property returns null if request force refresh (shift + refresh) or if there no active worker. ( source: https://developer.mozilla.org/en-us/docs/web/api/serviceworkercontainer/controller ) navigator.serviceworker.controller should return same object serviceworkerregistration.active . .active active w

c# - Entity framework connecting to database with app.config -

i'm developing program using entity framework wpf , using sql credentials on database. when deploying program produces program.exe.config file contains connection string. user can open , see credentials data (sql username & password). searched figure out way hide them or encrypt nothing useful in case. found entity using base variable connection app.config when tried after many ways pass connection string directly right way faced problem provider in connection string. [solved] let connection app.config fake data username , password . created setting store connection string . , @ instantiating of db entity changing connection property stored in settings . guess connection safe .

asp.net - SSRS timeout issue -

i have ssrs reports displayed on asp.net site runs fine. problem occurs when user has opened report , kept screen time 15-20 minuets , when activity on report screen postback or so, following error occurs the report execution r3fwifezzfm2qoe3anvp0n55 has expired or cannot found. (rsexecutionnotfound) note: session site still active. the error persists after setting report timeout setting in site setting of report server. please tell me possible solution error asap. you can set timeout in connectionstring below: <add name="connectionstring" connectionstring="data source=your datasource;initial catalog=yourdbname;integrated security=false;user id=sa;password=yourpassword;min pool size=0;max pool size=5000;connect timeout=0" providername="system.data.sqlclient"/>

php - Checkbox issue where clicking on Checkbox 3 marks Checkbox 1 and etc -

i have never encountered problem before. when click checkbox 1 checks checkbox 1, if click on checkbox 2 or 3 , still check first box. <tr> <td><input type="checkbox" id="checkbox65" class="css-checkbox med" /> <label for="checkbox65" class="css-label med elegant" name="avatar" value="image1"/></label></td> <td><input type="checkbox" id="checkbox65" class="css-checkbox med" /> <label for="checkbox65" class="css-label med elegant" name="avatar" value="image2"/></label></td> <td><input type="checkbox" id="checkbox65" class="css-checkbox med"/> <label for="checkbox65" class="css-label med elegant" name="avatar" value="image3"></label></td> </tr> i using checkbox

jquery - Getting index of clicked row that's dynamically created -

i've created table 3 rows can expanded use of add button. want know index of every row click. have piece of code works fine on 3 automatically generated rows, not on rows add using add button. here's fiddle shows issue: http://jsfiddle.net/4wa5kfpz/ , actual code has lot more stuff in basic/stripped version. as can see, rows added between first 2 , last not respond when clicked. i've tried (see below, based on this question ) add click event table rows, didn't work. $("table tr").on('click', '#mytable tr', function(e){ alert('clicked row '+ ($(this).index()+1) ); }); any ideas? use .on event: $("#mytable").on('click', 'tr', function(){ alert('clicked row '+ ($(this).index()+1) ); }); http://jsfiddle.net/4wa5kfpz/1/

sql - MySQL Products to ClientsPriceList Database Design Issue -

Image
product table. pricelist table. i have product table , pricelist table linking purpose of getting price of each product based on client(column name). i'm wondering if design alright? more efficient? column each client's pricelist or table each client's pricelist?

c++ - How to use smart pointer in this situation -

i want use smart pointer in following situation: some_struct* ptr = new some_struct; ptr->some_member = new byte[100]; callsomeapi(ptr); now api can either return error or pass in both cases want delete object , 1 way can write delete statement during error exit , during normal exit. but how can use smart pointer these pointers ? smart pointers mean unique_ptr, shared_ptr , etc. whichever can work ! thanks! i assume cannot modify smoe_struct add destructor it. leaves 2 options: custom deleter, , encapsulation. first, create custom deleter use std::unique_ptr : struct some_struct_deleter { void operator() (some_struct *p) const { delete[] p->some_member; delete p; } }; std::unique_ptr<some_struct, some_struct_deleter> ptr{new some_struct}; ptr->some_member = new byte[100]; callsomeapi(ptr.get()); if find that, unlike situation described in question, shared ownership suit better exclusive one, can use deleter shared_ptr