Posts

Showing posts from January, 2015

ms access - borland sdac inserted record is not shown when I try to fetch record from within the same connection -

i using borland 6 , sdac5.0 interaction ms access database. however, when insert record database , try fetch data table within same connection, newly inserted data not shown. i have noticed there bug in ms access jet4.0 regarding issue. ( https://support.microsoft.com/kb/239114 ) unfortunately system windows 7 , have checked jet.dll , have confirmed that's latest version , microsoft has confirmed issue solved. just wondering there method force database update data hard disk? can sacrifice performance in order ensure integrity of data. similar related question here , under circumstances may take approximately 5 seconds newly-inserted row visible in access database. presumably because access databases shared-file databases , access database engine may make effort "batch" commits rather hit database file instant receives insert/update query. to make update "immediately" available users (other connections) can force change database file closing co

vb.net - Find specific string then special character after string and integers -

ok spin on question asked before, although dont think clear enough in explanation. example strings follows. 06:15:34get/a/users/23/list_messagehttp 06:15:35put/a/users/231223/badge?http 06:15:36post/a/users/4454?set_action i trying search example "post/a/users/" or "get/a/users/" find next special character after number/integers. last example can see there ?, im trying locate enable me put vbtab before it. i can instance find 4th / in line , put vbtab before not find string find next special character after it. any gratefully received, many vbvirg

jpa 2.0 - Can JPA join to a codes table when part of join clause requires a hard coded value? -

i resulting entity contain columns table1, plus description codes1. if in sql write follows: select table1.*, codes1.description table1 inner joing codes1 codes1.code = table1.status_code , codes1.group = 'status' i have done native query, using straight jpa if possible. codes table: group code description status status code status b status code b other other code if imagine 2 objects: table1 , code1. class table1 contains of course code1. in "straight jpa" or jpql select object query be: select t table1 t t.code1.group = 'status' the join automaticaly done mapping (@onetoone, @manytoone...).

java - The executable generated by install4j doesnt start -

i'm evaluating install4j since want generate executable our windows-users. run our app directly in eclipse, or using bash scripts. have 1 big jar whole framework our applications, , dependency jars. on deployment set class path 1 shellscript , start individual applications using other shellscripts. this procedure work on both linux, mac , windows. now tried installing demo version of install4j, , have been struggling create installer. the result right build installer runs, , installs generated exe , our other files in directory structure under it. however starting generated executable doesnt work well. demo dialog shown, , after while application exits without error messages. my guess of course crashes, because classpath incorrect or similar. the problem is, have been playing around options in install4j couple of hours without change in behaviour, , i'm in dark right now. adding whole lib directory, "scan directory", adding jars individually etc etc.

meteor - How to check a variable value within a template -

problem : want show different templates based on user selection. question : there way check radio button selected using markup(spacebars) , not using click event on radio button value. following example of want do. <template name="category"> <label class="radio-inline"> <input name="studentgroup" id="studentyes" value="true" type="radio"> yes </label> <label class="radio-inline"> <input name="studentgroup" id="studentno" value="false" type="radio"> no </label> </template> within conditional block want check radio button selected can show correct template. {{#if value}} {{> studenttemplate}} {{else}} {{> regulartemplate}} {{/if}} the way use click event value. there might community packages automate you, though.

sorting - Search in view results and sort column -

Image
i have panel being used datasource repeat control. in panel, 'search in view results' computed ft search expression , column name , sort order set. if following property (click on column header sort) not set on view column being used sort, 500 error on page. when set it, page loads , results sorted expected. i stumbled across post in forum bob cross mentioned having check parameter in view column. http://www-10.lotus.com/ldd/xpagesforum.nsf/xptopicthread.xsp?documentid=9fe4e37d27400c1585257d3800734372 anyone can explain correlation between two? i'm stumped. thanks works designed. return sorted domino requires index on column. property "click on column header sort" tells domino build index row. sort indexes not build on fly, when set ftsearch sorted column doesn't have index, error "column not indexed" translates error 500. can try manually: open view itself. click on header sort property set , @ url. modify url use column wi

angularjs - ng-repeat filtering based on array -

i have standard ng-repeat <tr ng-repeat="tran in filteredtransactions(history)"> $scope.history doing call factory json result back $scope.history = historyfactory.gethistory; i have created scope object compare items array , filter $scope.history build ng-repeat $scope.filteredtransactions = function () { if ($scope.filterby.length > 1) { return $scope.history.filter(function (tran) { return $scope.filterby.indexof(tran.slot) !== -1; }); } else { return $scope.history; } } i have list of 'buttons' users able click engage item in filter. instance if click 'item 1' added array , ng-repeat filtered accordingly. i have ng-click function pushing/popping items out of array correctly. ng-repeat isn't updating. there better way work? rather try , return list of filtered items use filter , put filter function there. <tr ng-repeat="tran in history | filter: fi

mysql - How to group the different values of same field -

i have written select distinct r.id_destination , lo.location1 , lo.location2 , lo.destination , lo.zip , ld.id_field , da.identification entity , da.data pl_records r join pl_records_detail rd on r.id_order = rd.id_order left join pl_attribue @ on rd.product_attribute_id = at.id_product_attribute left join pl_profile pr on at.id_attribute = pr.id_attribute join pl_location lo on r.id_address_delivery = lo.id_address join pl_situation si on r.current_state = si.id_order_state left join pl_location_detail on r.id_cart = ld.id_cart left join pl_data da on ld.id_field = da.id_field r.id_record = 6 it returns output gets repeated because of fields " entity" , "data&qu

ios - Build permissions using Testflight -

Image
i have created ipa using xcode 6.1 , uploaded testflight, whenever tried test, shows following screen, should change build permission? right after have uploaded binary testflight should show page permissions e.g. list of devices can test app provisioning profile have used sign app. list should check of devices, , click "update , notify" or "just update" button. in case, think have missed step, , can go testflight, navigate app, select proper build, click permissions on left, select devices want permit test app, click "update , notify" or "just update" button. can test app (if device on list, of course)! luck!

rest - Should I encode HTTP request headers? -

i know urls need encoded before sent server. need encode http request headers well? i'm sending base64 string in header contains = %3d .. correct? the field value restrictions similar, not same. instance, can't use bare "%", or "<" , ">" in uri, can use them in header field value.

Auto populating Google Calendar based on Google Sheets document -

i've read lot of posts related problem... problem i'm not computer programmer , it's reading foreign language me. i've tried muddle way through no avail. i've been working this post , links page. i have google sheets document list of id numbers , start date , end date treatments. i'd able run script auto populate google calendar id numbers event title , treatment time frame. don't need start , end time, i'm looking dates. i create google calendar same spreadsheet. have 6 columns associated each id number - projected date , actual date 3 different types of testing. able run script populates google calendar type of testing event title. again, not concerned times @ all, dates. i'm using track experiment i'm running , it's lot of information see on spreadsheet. nice easier see testing need in calendar format don't make more mistakes in missing testing days or when stop treatments. i've been trying 3 weeks figure out o

c++ - Creating an array with a variable -

i have following code: #include <iostream> using namespace std; int main() { unsigned int endx = 5; unsigned int endy = 5; unsigned int endz = 5; int matrix[endx+1][endy+1][endz+1] = {}; return 0; } i error c2057: expected constant expression ok, how can create matrix shown in code without vectors or dynamic allocated array? as error says, need constant expressions define array/matrix sizes; in example, make integers const , compile. const unsigned int endx = 5; const unsigned int endy = 5; const unsigned int endz = 5; if don't want dynamically allocated arrays or vectors, you'll have know exact array size beforehand.

How can I get the indexes of elements in a Haskell list -

is there function in haskell returns indexs of elements elemindex in list. example list [1,2,3,4,2,3] , looking 2 returns [1,4] . you can use hoogle type of questions. basically, type of function you're looking -- in our case have list [a] , a search , want return of [int] indices -- , search it (in case, first result, elemindices , seems work)

homebrew - Brew - Install specific version of brew package -

how can install specific version of brew package? like brew uninstall rbenv (v. 2.1.2) first place check described in this answer , if previous version isn't there, try using this script install specific version (from another answer in same thread).

c# - Map same table to two different lists -

is possible have 1 table maps 2 different lists? for example 1 list might hold active orders , other list might hold submitted orders. in database orders in 1 table different state. i assuming can use clause on bag collections? have issues when persisting data? i don't think should handle on mapping level. either query filtered data in service, or add methods entity, getactiveorders() , getsubmittedorders() filter (mapped) list of orders. btw, think clause on collection mappings work.

numpy - What means this sparse matrix in scipy? -

i have nlp task , i'm using scikit-learn. reading tutorials found have vectorize text , how use vectorization models feed classification algorithm. assume have text , vectorize follows: from sklearn.feature_extraction.text import countvectorizer corpus =['''computer science scientific , practical approach computation , applications.''' #this opinion '''it systematic study of feasibility, structure, expression, , mechanization of methodical procedures underlie acquisition, representation, processing, storage, communication of, , access information, whether such information encoded bits in computer memory or transcribed in genes , protein structures in biological cell.''' #anotherone '''a computer scientist specializes in theory of computation , design of computational systems'''] vectorizer = countvectorizer(analyzer='word') x = vectorizer.fit_transform(corpus) print x the problem d

java - Method for copying bytes from Channels to Paths and vice versa? -

i found there 2 methods copying bytes between path s , input/outputstream s files#copy(inputstream in, path target, copyoption... options) files#copy(path source, outputstream out) are there methods using readable/writablebytechannel s? say, copy(readablebytechannel in, path target, copyoption... options) copy(path source, writablebytechannel out) ? i know there handy methods changing streams , channels. channels#newchannel(inputstream) channels#newchannel(outputstream) thanks.

javascript - How to convert audio into an arrayBuffer using synchronous ajax request? -

var context = new webkitaudiocontext(); var url = [ "/foo.mp3"]; function init(callback) { var req = new xmlhttprequest(); var audiobuffers = []; for(var = 0; < url.length; i++) { req.open("get", url[i], true); req.responsetype = "arraybuffer"; req.onload = function() { context.decodeaudiodata(req.response, function(buffer) { //blah blah push buffer array }); req.send(); } if(callback) callback(audiobuffers); } this works fine, don't me wrong. thing is, want load synchronously instead of asynchronously. req.open("get", url[i], true) the last argument declare synchronous or not. reason, when make false, unable change responsetype arraybuffer. this breaks method since not arraybuffer , cannot read response. , surprisingly natural behavior. context.decodeaudiodata(req.response, function(buffer){}); i did reasearch on this, found methods convert strings array buffer. for c

javascript - webapp read text file ajax, httprequest, or -

i'm using jquery mobile create web app... know best way read text file? @ moment, have functions working fine... don't know differences between them, , 1 better use? or fastest... function 1 function readfileajax() { $.get('txt/info.txt', function(txt) { var lines = txt.split(/\n/); var randlinenum = math.floor(math.random() * lines.length); var text = lines[randlinenum]; var parts = text.split(/#/); var fulltext = parts[0] + " " + parts[1] + " " + parts[2]; $("#msg").append("<p>" + fulltext + "</p>"); }); } function 2 function readfilehttprequest() { var filepath = "txt/info.txt"; xmlhttp = new xmlhttprequest(); //xmlhttp.overridemimetype('text/plain'); xmlhttp.open("get",filepath,false); xmlhttp.send(null); var filecontent = xmlhttp.responsetext; var lines = filecontent.split(/\n/)

SAS skip last row with unknown number of rows in proc import -

situation, able import "xls" file if manually delete last row of file before importing it. not know number of observations in file beforehand, therefore cannot use endrow = xx statement skip last row. proc import out = testing datafile = "c:\data\file1.xls" dbms = xls replace; namerow = 4; startrow = 6; run; thanks can save .xls .csv file first? can use data step instead, , eliminate last row based on last observation check or if check specific data. here have set names yourself, not have 'getnames' option.

GWT: Calling a javascript function from Java -

hi trying call function in .js file java. in java code have @override public native void test() /*-{ //javascript $wnd.h8(); }-*/; just alert inside method works can't call 1 of functions. i've tryed $wnd, $doc , nothing. say have functions.js in it: function h8(){ alert("hi"); } in index have: <!doctype html> <html> <head> <title>gwt test</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link href="styles.css" rel="stylesheet" type="text/css"> <script src="js/functions.js"></script> </head> <body> <div align="center" id="embed-html"></div> <script type="text/javascript" src="html/html.nocache.js"></script> <

javascript - How can I make animation duration more accurate based on setInterval (js) -

i'm writing animation looks number rising in limited time. use setinternal , clearinterval implement it.(i don't want use jquery) interval time 1 millisecond. , limit time 1000 milli seconds. slower expected. went 10000 milliseconds.what doing wrong? here's code. <html> <head> <title>a numeric test</title> </head> <body> <div id="numberscroll"></div> <script type="text/javascript"> var limittime = 100; //milliseconds var goalnum = 123456; //the final num var increament = false; //whether animation increasing of not. var textsize = 30; //size of text var temnum = increament ? (goalnum * 0.8) : (goalnum * 1.2); //start number temnum = eval(temnum.tofixed(2)); var increamentnum = (goalnum - temnum) / limittime; var numberscroll = document.getelementbyid("numberscroll"); if(numberscroll === null) { console.log("no

libgdx Table can't get ChangeListener for a click to fire? -

i have table added stage, , can't click listener fire it: table table = new table(); table.setx(0); table.sety(0); table.setwidth(300); table.setheight(300); table.addlistener(new changelistener() { @override public void changed(changeevent event, actor actor) { system.out.println("click"); } }); stage.addactor(table); i've set background 9 patch on table, , it's rendering fine. clicking has no effect. if add label or button table, set same changelistener widgets, listener fires fine. is there special handling table needs work? thanks --------- update ------------------- the way work using eventlistener block interaction on table instance: table.addlistener(new eventlistener() { @override public boolean handle(event event) { return true; } }); all events fire expected here. i tried setting table touchable, still changelistener not fire: table.settouchable(touchable.enabled); table.setlistener(....);

mongodb - How-to import meteor.js db to remote mongo -

i have app developed using meteor.js; since locally ok, move dedicated server; i've installed mongodb 2.6 on server following official doc; i've made dump of local app's db using: mongodump -h 127.0.0.1 --port 3001 -d meteor and uploaded dump folder /var/www/mywebsite on server; mongodb configured use auth: true; trying mongorestore -h 127.0.0.1 --port 27017 -d mydbname dump/meteor nothing inserted (using mongo shell root, databases can see local , admin) my root mongodb user created on admin db: (i've tried also): mongorestore -h 127.0.0.1 --port 27017 --username root --password xxxxxx -d mydbname dump/meteor { "_id" : "admin.root", "user" : "root", "db" : "admin", "roles" : [ { "role" : "useradminanydatabase", "db" : "admin" } ] } i have mongo user new database , restore it; aft

Mysql trigger or coding in PHP? -

i have table hardware_description : +------------------+--------------+------+-----+---------+----------------+ | field | type | null | key | default | | +------------------+--------------+------+-----+---------+----------------+ | computer_id | int(11) | no | pri | null | auto_increment | | emp_id | int(11) | no | mul | null | | | pc_type | varchar(20) | yes | | null | | | operating_system | varchar(20) | yes | | null | | | product_key | varchar(30) | yes | | null | | | assign_date | date | yes | | null | | | dvd_rom | varchar(20) | yes | | null | | | cpu | varchar(30) | yes | | null | | | ip_address | varchar(30) | yes | | null | | | mac_address | varchar(30) | yes | | nul

apache - How to test .htaccess offline? -

i have .htaccess need tested. can not put on server may cause website crash. read answer did not it. used htaccess tester website although htaccess works on website, not work on server; therefore, need test offline. i suggest make subdomain , test in that. in way not have issues current website , no need have separate server.

proxy - proxying relative urls with nginx -

my question similar nginx relative url absolute rewrite rule? - added twist. i have nginx acting proxy server, proxies multiple apps, similar (simplified) config: server { listen 80; server_name example.com; location /app1 { proxy_pass http://app1.com; } location /app2 { proxy_pass http://app2.com; } } this works fine, in other question, these applications ( app1 , app2 ) use relative urls such /css/foo.css , or /js/bar.js . it's big problem ask applications change /app1/css/foo.css . is possible nginx intelligently figure out application should handle request? ftr, users accessing these applications this: http://example.com/app1/fooaction or http://example.com/app2/baraction . if matters, applications java/tomcat based apps. tia! based on updated comments; if upstream backend sends referer header , this: location ~* ^/(css|js)/.+\.(css|js)$ { #checking if referer app1 if ($http_referer

asp.net - Avoid Postback on command field -

i have commandfiled inside gridview. <asp:commandfield showeditbutton="true" showdeletebutton="true" editimageurl="~/icons/1414412214_edit.png" edittext="edit" deleteimageurl="~/icons/1414412198_delete.png" updatetext="done" > <itemstyle height="10%" width="10%" /> </asp:commandfield> how can stop post on edit link button , still able show update , cancel link on clicking it. know can using update panel , tried did not work? use update panel avoid full page postback.. or try jquery grid plugin in application. using jqgrid in asp.net

java - I want to make the button visible on one page by closing another page by clicking the cross button -

i have button on page , when click button page open pop , button hided when close popup page want button become visible again . how can that? you take 2 functions: function dissablebtns() { window.document.frm.name1.disabled=true; window.document.frm.name2.disabled=true; } function enablebtns() { window.document.frm.name1.disabled=false; window.document.frm.name2.disabled=false; } this functions call when want disable or enable:

javascript - jQuery.change() not compatible with addEventListener? -

i having problem when using plain javascript mixed jquery(two different libraries using). text input field, plain javascript library rely on change event binding added using addeventlistener method. other jquery plugin(datetimepicker) used change field , jquery.change() method triggered after value updated. the problem is, listener not triggered jquery event. here simple code illustrate issue. <!doctype html> <html> <body> <input id="abc">abc abc.</input> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script> document.getelementbyid('abc').addeventlistener("change", function(){ alert('change event triggered'); }); $('#abc').change(); </script> </body> </html> given simple html page this, event listener not triggered jquery.change() method, alert box not displayed. if change input field manually, event works fine. fol

java - making a Binary Search Tree from a Sorted Doubly Linked List -

hey guys studying programming interview questions , got stuck in one. i trying recursively don't know start. this algorithm have far: maketree(head, tail){ nodemid = list/2 root = nodemid root.left = maketree(head, nodemid) root.right = maketree(nodemid, tail) do have right idea? input highly appreciated. thanks! the major problem see , forgive me if wrong not changing location of list each node. each time recursively call maketree(head, tail){ nodemid = list/2; as far can see inside loop not change part of list goes recursive call. ie have array of ints myints has (0,1,2,3,4,5,6,7,8,9) every time recursion called infinitely fill binary tree number @ list/2 need change value of nodemid each call, use head/tail variables sending. you not want keep resetting root node either. should using "this" operator set value of current node looking at. start being start of portion of array looking @ , end being end of portion. recursive

objective c - Hiding the master view controller with UISplitViewController in iOS8 -

Image
i have ios7 application, based on xcode master-detail template, porting ios8. 1 area has changed lot uisplitviewcontroller . when in portrait mode, if user taps on detail view controller, master view controller dismissed: i able programmatically hide master view controller if user taps on row. in ios 7, master view controller displayed pop-over, , hidden follows: [self.masterpopovercontroller dismisspopoveranimated:yes]; with ios 8, master no longer popover, above technique not work. i've tried dismiss master view controller: self.dismissviewcontrolleranimated(true, completion: nil) or tell split view controller display details view controller: self.splitviewcontroller?.showdetailviewcontroller(bookviewcontroller!, sender: self) but nothing has worked far. ideas? extend uisplitviewcontroller follows: extension uisplitviewcontroller { func togglemasterview() { let barbuttonitem = self.displaymodebuttonitem() uiapplication.shar

jms - Proxy Service: AdminProxy Admin Exception in wso2 esb 4.8.1 -

Image
i have defined simple proxy service in wso2 esb(4.8.1) listening on queue via jms. service after reading message send queue. problem: when define inline endpoint works fine, if refer registry endpoint wso2 esb gives me error , not allow me modify service. proxy service: <?xml version="1.0" encoding="utf-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="failovertest" transports="jms" statistics="disable" trace="disable" startonload="true"> <target> <insequence> <property name="out_only" value="true" scope="default" type="string"/> <log level="full"/> <property name="clientapinonblocking" action="remove" scope="axis2"/> <send> <endpoint key="gov:/repository/endpoint

html - Bootstrap Grid, unable to separate them into desired columns space -

i new programming , having difficulty in adjusting bootstrap grids fit framework; trying 3 columns side bar on left, , followed 9 column main side bar on right - appeared 12 columns each after input code. <div class="content row"> <?php include "_/components/php/snippet-carousel.php"; ?> <section class="col-md-3 col-md-pull-9 sidebar"> <?php include "_/components/php/aside-social.php"; ?> </section><!-- sidebar --> <section class="col-md-9 col-md-push-3 cont-grid"> <?php include "_/components/php/weekend-intro.php"; ?> <?php include "_/components/php/popular-categories.php"; ?> </section><!-- main --> </div><!-- content --> <?php include "_/components/php/footer.php"; ?> </section><!-- container -

I would like to remove trailing zeros from excel. But when i try to use substitute function i get function not defined error -

if use trim replace function mycell.value = trim(replace(mycell.value, chr(160), chr(32))) removes leading zeros. sub trimtext() dim mycell range on error resume next selection.cells.specialcells(xlcelltypeconstants, 23).select each mycell in selection.cells mycell.value = trim(substitute(g7, char(160), " ")) next on error goto 0 end sub sub trimtext() dim mycell range on error resume next selection.cells.specialcells(xlcelltypeconstants, 23).select each mycell in selection.cells 'range("k:k").select selection.numberformat = "@" mycell.value = trim(replace(mycell.value, chr(160), chr(32))) next on error goto 0 end sub

c# - Delete multiple asp.net repeater Items with checkbox selection only -

here not show error page loading error? c# code protected void imgs_click(object sender, imageclickeventargs e) { foreach (repeateritem ri in repeater.items) { checkbox item_check = (checkbox)ri.findcontrol("item_check"); label txt_id = (label)ri.findcontrol("txt_id"); if (item_check.checked) { con = new sqlconnection(strcon); sqlcommand cmd = new sqlcommand("ram", con); cmd.commandtype = commandtype.storedprocedure; con.open(); cmd.parameters.addwithvalue("@action", "delete"); cmd.parameters.addwithvalue("@eid", txt_id); repeat(); } } } asp.code you forgot write cmd.executenonquery(); stop using addwithvalue always use usi

javascript - Using jquery to run code when django document is ready -

i building django admin site , using javascript , jquery (2.0.3) add functionality forms. i importing scripts page this: <html> <head> <script type="text/javascript" src="/static/admin/js/jquery.js"></script> <script type="text/javascript" src="/static/admin/js/jquery.init.js"></script> <script type="text/javascript" src="/static/project/js/project.js"></script> </head> <!-- ... --> </html> at first placed following code @ end of project.js : function trycustomiseform() { // ... } $(document).ready(trycustomiseform); unfortunately results in uncaught typeerror: undefined not function exception on last line. i tried alternative syntaxes of ready() without more luck. lastly explored change_form.html template , found inline javascript: <script type="text/javascript"> (function($) {

styling - How to chage background color of frozen columns in jqgrid -

i have used json script generated sp bind jqgrid dynamically, @ first pass colnames , colmodel empty. after grid loads find id of tables freezes columns list_frozen when use code $("#list").jqgrid("setlabel", "location", false, "cvteste"); i unable set color frozen columns. please guide how go getting color frozen column background.

SharePoint 2013 API - get only newly modified list items -

i'm using rest service retrieve list items: _api/lists/getbytitle('list title')/items?$oderby=duedate is possible use query parameter filter items newer/older specific date, using standard modified date field? i found answer myself: using $filter parameter odata expression /items?$filter=modified gt datetime'2014-11-27t12:00:00.000z'

javascript - jQuery how to load a div from a other page using load -

i have little project need show items on 1 page other have little categorie can click on. pick attr("href"); , set page load. works. how add <div> online load <div class="holder"></div> , not whole div? function: function setupcasesfilter() { j(".casemenu a").click(function(e) { e.preventdefault(); j("ul.casesholder").load(j(this).attr("href")); }); } where can add class inside attr("href")); ? if want load specific div element url use way: j("ul.casesholder").load(j(this).attr("href") + " .holder"); what seems me have .holder div on href page loading, can pass div's class name want load space ex. page.html .holder .

windows - Creating .exe program using PHP language? -

my client asking me convert php program .exe format. tried convince him php server side programming language not accepting it. there way create .exe program using php? if want execute exe file can below command. string exec ( string $command [, array &$output [, int &$return_var ]] ) for more details can visit link: http://php.net/manual/en/function.exec.php but, if requirement create exe file of php application seems not valid request, can following things achive work around: 1) create small vb application web component , set url in web component application's http url. 2) create setup file of vb application. 3) when install exe file, @ end php application http request open.

java - Animation listerener not called after fragment change -

have main activitiy containing fragment. fragment can changed selecting menu item. when on first fragment, clicking menu button. side bar shown. after selecting menu item, fragment changes. when click menu item on fragment, animation listeren not called instantly. first have scroll in direction before calles script. menu item in main activity, should mind if there different fragment, right? slidein = animationutils.loadanimation(getapplicationcontext(), r.anim.slide_in); slidein.setanimationlistener(new animationlistener() { @override public void onanimationstart(animation animation) { isanimating = true; } @override public void onanimationend(animation animation) { animation = new translateanimation(0.0f, 0.0f, 0.0f, 0.0f); animation.setduration((long) 0.1f); menuview.startanimation(animation); viewgroup.marginlayoutparams p = (viewgroup.marginlayoutparams) menuview.getlayoutpa

python - O(1) lookup of single tuple element in a dict? -

i have structure in mind similar dict tuples keys, except can entries 1 of tuple elements. e.g. (something similar this. not real python code, idea) >>> d[(100, "apple")] = 5.0 # putting entry dict >>> d[(100, "pear")] = 10.0 # putting entry dict >>> d[(200, "pear")] = 10.0 # putting entry dict >>> d[100] # o(1) lookup [("apple", 5.0), ("pear", 10.0)] >>> d["pear"] # o(1) lookup [(100, 10.0), (200, 10.0)] you can't defaultdict() . best way in python, or best data structure use? i'd lookup o(1), dict. in case, neither tuple element unique, nor values. i considering: nested dicts two dicts? some database-like structure consider like: class mydict(object): def __init__(self): self._data = {} def __setitem__(self, key, val): self._data[key] = val if key[0] not in self._data: self._data[key[0]] = {}

oauth - What is the best SSO solution for a native mobile app which can support multiple IDPs? -

in our current situation, our web-based application(sp) has integrated sso using spring security saml extension. our product saas , have different clients may have different idps (identity providers) configured @ end. we're trying provide sso support our mobile application. after search, i've come across 3 possible solutions implement: 1) using web view : when saml enabled client, mobile app embed web view renders idp login page upon opening mobile app. url on sp side hit trigger saml redirect idp. webview carry out sp-initiated login flow. however, webview not use cookie space, user has login app, every time app killed or session expires. webview not browser, i've read may not handle edge-cases during http redirects. 2) using native sso app : idps provide native sso app mobile app can log idp. mobile app can interact idp's native application via sdks provided respective idp. since our mobile app should able support sso many idps, if follow approach may have

Powershell string to var -

i've been struggling issue while , searched hours can't find how solve it problem: want string, , use variable name. example: eval('sometext') = 'someinfo' which out come like: $sometext (which contains 'someinfo') maybe little bit hard explain hope guys understand it, it's simple don't know how in powershell scripting. you can use set-variable set variable variable name, shown below. ps> set-variable -name ($env:computername) -value "sometext" ps> get-variable -name ($env:computername) name value ---- ----- jr-pc sometext you can refer variable (in case): $($env:computername)

MAVEN: Multi-module project, How to add different environments for build -

there complex multi module project working on move ant. things want achieve are: ease of development, , packaging developer. example: parent project son a parent project son grandson grandson b daugter (depends on son) grandson c grandson d what want when developer working on daughter project downloads parent project , son dependency should resolved svn repository. know can done defining dependecy in pom.xml conflict second requirement. 2) download daughters , sons of parent project , compile them build consistently can checked automated build manager jenkins. , in addition release revisions on flag maven repository if build successful. please note revision needs head of each module. 3) in both procedure want create tar file or own style directories contain different jars in different directory per need. (i can achieve adding ant copy command; bet

jquery - Change current list element on link click using JavaScript -

Image
i'm trying change current tab on link click. have this: so when click on next or previous link want change active tab. guess can done in javascript, since i'm complete beginner, can preform easiest tasks. this html used building part of page: <div class="grey-box-wrap"> <div class="top"> <a href="javascript:;" class="prev"><i></i>previous week</a> <span class="center">february 04 - february 10, 2013 (week 6)</span> <a href="javascript:;" class="next">next week<i></i></a> </div> <div class="bottom"> <ul class="days"> <li> <a href="javascript:;"> <b>feb 04</b> <!-- <i>7.5</i> --> <span>monday</span>

node.js - How to get meteor-sharejs documents text -

i using meteor-sharejs i add package meteor add mizzao:sharejs-ace now in view, add document {{> sharejsace docid="javascriptdoc" id="editor"}} i know meteor-sharejs creates ops collection , docs. my questions how grab current raw text of of "javascriptdoc" document on server send somewhere else. listen changes , grab content. you want check sharejs api this. mizzao:sharejs using sharejs 0.6.3; here server api . want use getsnapshot function. the package makes sharejs available in sharejs.model , try sharejs.model.getsnapshot(...) on server. note: wrote package.

linux - Changing memory page size -

i reading there,that number of virtual memory pages equal number of physical memory frames , size of frames , of pages equal,like 32bit system page size 4096. well thinking there there way change page size or frame size? i using linux os. have searched lot , found is,we can change page size or in fact can increase page size shifting huge pages.is there other way change (increase or decrease) or set page size of our choice? (not coding anything,a general question) in practice (nearly) impossible "change" memory page size, since page size known & determined mmu hardware, operating system taking account. however, notice some linux systems (and hardware!) have hugetlbpage , linux mmap(2) might accept map_hugetlb (but code should handle case of processors or kernels without huge page support, e.g. calling mmap again without map_hugetlb when first mmap map_hugetlb has failed). from read, on some linux systems, can use hugetlbpage various sizes.

regex - Regexbuddy get matches without to much linefeeds -

Image
i'm using regexbuddy matches text input 1 . works fine except issue newlines 2 added output of matches (because every single match listed in new line, see detailed output 3 ). there option or workaround avoid this? edit: regex quite simple: \w* text input output detailed output

javascript - Split array by tag and delete all similar element -

i have html page text , need output inner html tag b alphabetical order in lower case. i'm begginer, don't strict. my code here (text example): http://jsfiddle.net/pamjaranka/ebeptlzj/1/ now want to: 1) save upper case inner html tag abbr; 2) delete similar element array (as mabs). i trying find way split array tag, i've done is: for(var i=0; i<allbold.length; i++){ labels[i] = allbold[i].innerhtml; } var searchterm = ['abbr']; var abbr = []; var keywordindex; $.each(labels, function(i) { $.each(searchterm, function(j) { var rsearchterm = new regexp('\\b' + searchterm[j] + '\\b','i'); if (labels[i].match(rsearchterm)) { keywordindex = i; for(var j=0; j<labels.length; j++){ abbr[i] = labels[i]; } } }); }); vanilla js solution (no library required, see jsfiddle ): var allbold = document.queryselectorall("b"), words = document.queryselector("#words")

r - Reshape multiple values at once -

i have long data set make wide , i'm curious if there way in 1 step using reshape2 or tidyr packages in r. the data frame df looks this: id type transactions amount 20 income 20 100 20 expense 25 95 30 income 50 300 30 expense 45 250 i'd this: id income_transactions expense_transactions income_amount expense_amount 20 20 25 100 95 30 50 45 300 250 i know can part of way there reshape2 via example: dcast(df, id ~ type, value.var="transactions") but there way reshape entire df in 1 shot addressing both "transactions" , "amount" variables @ once? , ideally new more appropriate column names? in "reshape2", can use recast (though in experience, isn't known function). library(reshape2) recast(mydf, id ~ variable + ty

c# - Inner helper with different conditions in foreach loop, how to manage that? -

inner helper different conditions in foreach loop, how manage that? i want have different foreach loop, rest of helper should same different version 1 - foreach (var item in model.where(_ => _.version > 0)) 2 - foreach (var item in model.where(_ => _.version = 0)) 3 - foreach (var item in model) any suggestions? @helper writegrid() { foreach (var item in model.where(_ => _.version > 0)) { <div> @item.from </div> } } you can change @helper bit take func<t,bool> can decide items show: @helper writegrid(func<mymodel, bool> p) { foreach (var item in model.where(p)) { <div>@item.from</div> } } @writegrid(x => x.version > 0) <hr/> @writegrid(x => x.version == 0) <hr/> @writegrid(x => true) <hr/>

ios - Updating height of UITableViewCell -

i'm building table shows entry user. 1 of cells shows set of "tags" downloaded server. building set of uilabels , manually adding them view contained in cell. while works, cell not dynamically resize after adding tags. tags overlap cell beneath , can't figure out how manually update height of cell. in cellforrowatindexpath: journaltagscell *cell = [tableview dequeuereusablecellwithidentifier:@"journaltagscell" forindexpath:indexpath]; //check if have tags show if(self.journalobject.journalentrytags != nil){ cell.placeholderlabel.hidden = yes; cell.tagsview = [self updatetagsview:cell.tagsview]; } return cell; the following method creating each tag, laying them out , adding them view: - (void)updatetagsview:(uiview*)viewtoupdate{ nsarray *items = self.journalobject.journalentrytags; //clean view first nsarray *viewstoremove = [viewtoupdate subviews]; (uiview *v in viewstoremove) { [v removefromsuperview]; }

Facing Error While getting backend Document in xpages (SSJS) On Lotus Notes Client -

i facing issue in workflow application developed on xpages using ssjs. have status field text field containing status 0 20. when document send initiator , status value set 0. concerned initiator try re-submit request system generates error while accessing values using datasource. unable backend document value. same code works in browser. can please guide me issue code accessing backend value client. following error: unexpected run time error [typeerror] exception occurred calling method notesdocument.getitemvalue(string) null var mtitle = leavedoc.getdocument().getitemvaluestring("type"); if (mtitle == "cancel") { return "leave application cancellation form" } else { return "leave application form" } please have @ , guide me. thanks

Does i need to apply Sessions in ASP.NET for log in/log out if im using SimpleMembership in MVC? -

i new web development so, need implement sessions while using simplemembership having problem button after logs out. goes previous page instead of login. added code below in global.ascx. works perfect now!! response.cache.setcacheability(httpcacheability.nocache); response.cache.setexpires(datetime.utcnow.addhours(-1)); response.cache.setnostore(); so query is, can run application without sessions in there authentication of users i.e. there user accounts , login , logout functionality there. you can login , logout using default simplemembership functions: for login: bool success = websecurity.login(form["username"], form["password"], false); for logout: websecurity.logout(); for details refer msdn link here

php - Update XML node attribute -

i'm trying following without success. can me out why attribute imageid not changed? $dom = new domdocument; $dom->loadxml($appcom_file_name); $frames = $dom->getelementsbytagname('frame'); foreach ($frames $frame) { if ($frame->getattribute('imageid') == '') { $frame->setattribute('imageid', $id); } } $dom->savexml(); xml source: <template> <appcom> <page> <defaultvalues> <frame id="frame_01_0" deltarotation="0" deltascale="100" deltax="0" deltay="0" imageid="" /> <frame id="frame_02_0" deltarotation="0" deltascale="100" deltax="0" deltay="0" imageid="" /> <frame id="frame_03_0" deltarotation="0" deltascale="100" deltax="0" deltay="0&quo

javascript - Extending a service provider (provider) -

i'm trying extend service provider; more $routeprovider ngroute module my extended provider looks this: angular .module('myapp') .provider('customroute', customroute) function customroute($routeprovider) { var extendedprovider = angular.extend({}, $routeprovider, { // customization here }); // these print identical objects console.log(extendedprovider); console.log($routeprovider); this.$get = function() { return extendedprovider; } } the config of routes looks this: angular .module('myapp') .config(routes); function routes(customrouteprovider, $routeprovider) { /* print object looks same ones printed in provider definition */ console.log($routeprovider); /* object not $routeprovider more :( */ console.log(customrouteprovider); customrouteprovider .when('/', { templateurl: 'path/to/some/template.html',

exist-db : Issues with ant task xdb:adduser or xdb:users : no such handler -

i'm using ant scripts initializing exist-db. but, have script below (dummy version) working in local platform , not on procution one. i'm not 1 handle configuration of database, don't know in conf fix this. here script (which trying add new user) : <project basedir="." default="default" name="antproject"> <property file="load.properties"/> <path id="classpath.core"> <fileset dir="${path}/lib/core"> <include name="*.jar"/> </fileset> <pathelement path="${path}\exist.jar"/> <pathelement path="${path}\exist-optional.jar"/> </path> <typedef resource="org/exist/ant/antlib.xml" uri="http://exist-db.org/ant"> <classpath refid="classpath.core"/> </typedef> <target name="default"> <echo mess

c# - How to access to the DBContext used in an EntityManager? -

i insert/update large amount of entities (~5000) during process , taking huge amount of time (it timeout on 5 minutes transaction). i read default dbcontext.autodetectchangesenabled set on , cause kind of behavior ( http://www.exsertus.be/2014/10/ef-bulk-performance/ ). to understanding, devforce "kind of" encapsulate dbcontext within each entitymanager. devforce use it's own implementation unless define mine did. know how can access able "play" property autodetectchangesenabled. or there other solution insert/update/delete large amount of entities devforce ? regards since you've defined own dbcontext can alter property setting in dbcontext constructor configuration.autodetectchangesenabled = false; however, i'm not sure how change help. if application n-tier , you're trying save ~5000 entities across wire slow, , you'll run communication timeouts. if need bulk operations devforce isn't optimal approach.