Posts

Showing posts from January, 2015

javascript - type=number formatting, jquery validate -

i have gotten requirement customer wants numbers seperated space thousands. ex: 1000000 becomes 1 000 000. my application built .net mvc5 , using jquery validate front end validation. i tried format inputs user types, validation wouldn't work. example interprated "8 000" "8". i tried change type=number inputs type=text, numeric validation jquery validate stopped working, html5 features of input=number min/max validation etc. does have idea on how solve this? can imagine solution hidden fields containing actual data, , other fields displaying formatted data, feel hacky, hard maintain , not reliable.

matlab - how to dlmwrite a file from array -

Image
how write cell below in text file(my_data.out)? http_only = cell2mat(http_only) dlmwrite('my_data.out',http_only) i error below:(i have tried solve still return me error) here full code: want generate text file each of data store 'http_only' check meet word in split_url. %data = importdata('data/url/training_url') data = importdata('data/url/testing_url') domain_url = regexp(data,'\w*://[^/]*','match','once') no_http_url = regexp(domain_url,'https?://(?:www\.)?(.*)','tokens','once'); no_http_url = vertcat(no_http_url{:}); split_url = regexp(no_http_url,'[:/.]*','split') [sizedata b] = size(split_url); = 1:100 a7_data = split_url{i}; data2=fopen(strcat('data\webpage_source\testing_data\',int2str(i),'.htm'),'r') chardata = fread(data2, '*char')'; %read text file , store data in chardata fclose(data2); img_only = regex

Unable to Undo Hijack with IBM Clear Case Eclipse Plugin 7.6.2 and Clear Case 8.0.0.6 -

i have problem, team->undo hijack function doesn't work ibm clear case eclipse plugin 7.6.2 , clear case 8.0.0.6. icon of file changes normal, file still hijacked. in clear case explorer, file still marked hijacked, it's possible undo hijack file clear case explorer. last clear case version 7.x, function worked perfectly. did know problem? thanks , greetings the first check need cleartool ls in parent folder of hijacked file. that confirm status (hijacked, after "undo hijacked") then, recommend closing many apps, , files within eclipse workspace, before attempting again "undo hijacked". possible eclipse keeps handle on resource (file) attempt "undo hijack".

subdomain - Auto login web app through url in Lotus Domino 6.5.4? -

in domino 6.5.4, possible assign newly registered account user new subdomain under our domain (eg. accountid.abc.net) , related database(eg. accountid.nsf); once user opens url(accountid.abc.net) through our email notification, automatically login server , database accountid.nsf opened? yes, possible. unfortunately redirection- documents need applied after http restart, might not best solution you. might find iwaredir- template useful without subdomain, depends on want achieve. but: stackoverflow not there "consulting" best solution quite "generic" topic, concrete questions concrete code issues. so might not best platform question.

java - Decript Jasypt encrypted information -

i encrypting object below entry using spring , hibernate. have salt , password possible decryption information plain text? <bean id="hibernatestringencryptor" class="org.jasypt.hibernate.encryptor.hibernatepbestringencryptor"> <property name="registeredname" value="hibernatestringencryptor" /> <property name="password" value="1234" /> <property name="saltgenerator"> <bean class="org.jasypt.salt.fixedstringsaltgenerator"> <property name="salt" value="1" /> </bean> </property> </bean> @entity @table(name = "bride") @typedef(name = "encryptedstring", typeclass = org.jasypt.hibernate.type.encryptedstringtype.class, parameters = { @parameter(name = "encryptorregisteredname", value = "hibernatestringencryptor") }) public class bridedetails { /

c# - SharePoint 2010 Web Part Error - Exception from HRESULT: 0x80131904 -

a client of ours encountered problem web part wrote while back. web part advanced search returns results based on information entered text box , criteria selected drop down. web part has been functional on other customer sites , error encountered 1 client not replicated, after extensive testing on our development environment. error appears when search column lookup field , works expected on other field type. have looked around web find resolution specific problem, majority of cases refer sql error of content database being out of space, don't believe case in instance. below full stack trace message receive. resolve problem appreciated! exception hresult: 0x80131904 @ microsoft.sharepoint.spglobal.handlecomexception(comexception comex) @ microsoft.sharepoint.library.sprequest.getlistitemdatawithcallback2(ilistitemsqlclient psqlclient, string bstrurl, string bstrlistname, string bstrviewname, string bstrviewxml, safearrayflags fsafearrayflags, isp2dsafearraywrite

javascript - tinymce 4 init button -

question tinymce 4-th version. when add button editor.addbutton('cut_tag', { type: 'button', text: '<cut>', name: 'cut_tag', id: 'cut_tag', icon: false, tooltip: 'Вставить cut', onclick: function(e){ editor.insertcontent('[cut]'); this.disabled(true); editor.cut_tag_button = this; // hack - store object in var object var later } }); and want execute code when initializing button, tried 'oninit', 'oncreate', 'setup', etc. no effect. please advice, thank you. you need move onclick event outside add button object. editor.addbutton(...); editor.on('click', function(e) { alert('insert logic here'); }); the syntax has changed little. tinymce migration guide might expla

html - CSS issues with different browsers -

below mentioned code works on google chrome whenever use ie7/8 output weird , entire page goes haywire. please me correct code, tell me resource or book should follow learn css. <html> <head> <style> .wrapper { width:1000px; height:auto; margin-left:auto; margin-right:auto; } .header { height:250px; width:1000px; background-color:red; } .menu_bar { height:40px; width:1000px; background-color:blue; margin-left:auto; margin-right:auto; } .menu_item { height:40px; width:300px; float:left; text-align:center; color:white; } .page { width:1000px; height:500px; background-color:yellow; margin-left:167px; } .page_left { width:150px; height:500px; background-color:green; float:left; } .page_right { background-color:black; height:500px; width:250px; float:right; } .footer { height:200px; width:1000px; background-color:orange; margin-left:167px; } </style> <head> <body&g

writing XSD from XML -

i writing xsd xml.i strucked @ point.can please me out. please mderators delete this <xsd:element name="aaa"> <xsd:complextype> , <xsd:element name="cvccodeswitch " type="xsd:integer" nillable="true"/> in above 1 how can make assumptions integer? the <xsd:element name="cvccodeswitch " type="xsd:integer" nillable="true"/> should fine (only integer allowed); you're confused because <cvccodeswitch /> is not nil; nil xml element looks like <cvccodeswitch xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nil="true" /> (you can omit xmlns:xsi if you've declared @ higher level) if have no control on xml (i.e. have write xsd according xml have) have declare type union of integer , empty string: <xsd:element name="cvccodeswitch"> <xsd:simpletype> <xsd:union> <xsd:si

java - When we use Referrence type and Object Type -

this question has answer here: what mean “program interface”? 29 answers i having doubt regarding arraylist , list. in case should use arrarylist like: arraylist obj = new arraylist(); and in case should use list interface. list obj = new arraylist(); after googling , study found nothing... please let me know difference between them. thanks in advance :-) if need call method specific implementation, use implementation. when write : list obj = new ... //arraylist() or linkedlist() the compiler knows obj list . hence, cannot use methods specific 1 implementation. for example, if need access last element of linkedlist , need declare : linkedlist = obj = new linkedlist(); now, obj linkedlist . hence, can use obj.last() .

php - Redirect site from https to http using htaccess or any other way -

i tried answers mentioned on search engine redirecting site https http these not working me. i tried: how redirect https http? , http://wp-mix.com/htaccess-redirect-http-to-https/ methods here let me explain little more here: before site (combustiondepot.com) separate site , having ssl installed there. working fine time. after deleted main combustiondepot.com site , make addon domain our main domain industrialstores.com. now site working fine except https. whatever changes making in htaccess or php these of no use. the examples above work if have .htaccess allowed in config. allow override if want using code assuming using php. <?php if ( $_server['https'] ) { $host = $_server['http_host']; $request_uri = $_server['request_uri']; $good_url = "http://" . $host . $request_uri; header( "http/1.1 301 moved permanently" ); header( "location: $good

c# - Validate Credentials and Redirect to given page -

i sending email external user link. this how url looks. "www.details.aspx?id=1234". when user clicks on url, want him go login page first, validate credentials , redirect given page. how can using windows authentication ? how give url ? thanks, if use windows authentication, don't need login page. you need put in web.config (inside system.web): <authentication mode="windows"/> if website in iis, need configure site uses windows authentication.

Using OR condition + function in join appears to confuse SQL Server's query optimizer -

i struggling debug performance on particular query. query this: select count(*) dbo.user d inner join dbo.distinct_first_name dfn on ( [dbo].jw(dfn.first_name, 'john') > 0.8 , (d.first_name = dfn.first_name or d.nick_name = dfn.first_name or d.middle_name = dfn.first_name) ) the query runs jaro winkler filter on distinct first name table (containing approx 15k rows) , inner joins against user table produce result set. defined, takes around 1 minute run approx 500k rows in user table. here's know: 1) jaro winkler filter instant (0.1s itself) 2) if change user clause include 1 of columns (i.e. remove ors) takes 0.4s 3) if change 3 queries, , run them back, takes approx 2s 4) if change jaro winkler filter 0.99 (so there's 1 result) makes no substantive difference in query execution time 5) if replace jaro winkler filter equality operation (dfn.first_name = 'john') total query time reduced 4s

beautifulsoup - Is there a shorter syntax than soup.select("#visitor_stats")[0]? -

i'm using beautifulsoup ( import bs4 ) read information web page. several lines in script like stats = soup.select("#visitor_stats")[0] is there shorter syntax this? select() lets select bunch of html tag elements based on css properties (like id , class ). in case looking html tag elements css id property set visitor_stats . , selecting first element returned list. the beautifulsoup method find() returns first occurrence of search criteria. list index [0] can gotten rid of using find() stats = soup.find(attrs={'id':'visitor_stats'}) but not sure if shorter :)

Run Go scripts in local vagrant machine -

i want run go scripts vagrant. when vagrant up, , run command 'go version' not see go installed , told the program 'go' not installed. can install typing: sudo apt-get install golang-go ` did install , it's running simple scripts fmt.println() then question is... i have repository lot of code in go. , need run in virtual machine vagrant. then best way run scripts worked on outside of vagrant vm because when vagrant up not see had install go. you don't want deploy via source , go run . run command connivence wrapper builds , executes binary in 1 step. there's lot can't do. compile code, , run binary. if deployment target different os/architecture, there's nothing wrong building executable in vm, make sure it's has go. can cross-compile code if don't have dependency on cgo, may easier.

c# - Read XML node from certain element forward? -

i know there bunch of ways of doing this, i'm looking easiest way of doing without having use streamreader or more manual force me loop through whole file , compare endless strings. possibility use streamreader find specific text, , use xml library retrieve node. here's xml. need do: 1) find first instance of tag npid text text find 2) extract node nodetoextract , store in data object. there several nodes called nodetoextract want first 1 after initial search of text text find <?xml version="1.0" encoding="iso-8859-1"?> <mdc> <ne> <neun>adb</neun> <nn>subnetwork=context</nn> <nw>r33</nw> <mi> <nut>20140101</nut> <hq>000</hq> <nw> <npid>text find</npid> <r>0</r> </nw> </mi> </ne> <ofid> <ofun>abc</ofun> <ofdn>blah</ofdn&g

artificial intelligence - Neural Network and Temporal Difference Learning -

i have read few papers , lectures on temporal difference learning (some pertain neural nets, such sutton tutorial on td-gammon) having difficult time understanding equations, leads me questions. -where prediction value v_t come from? , subsequently, how v_(t+1)? -what getting propagated when td used neural net? is, error gets propagated come when using td? the backward , forward views can confusing, when dealing simple game-playing program, things pretty simple in practice. i'm not looking @ reference you're using, let me provide general overview. suppose have function approximator neural network, , has 2 functions, train , predict training on particular output , predicting outcome of state. (or outcome of taking action in given state.) suppose have trace of play playing game, used predict method tell me move make @ each point , suppose lose @ end of game (v=0). suppose states s_1, s_2, s_3...s_n. the monte-carlo approach says train function approximat

php - alpha number 0-255 equivalent in 0-127 range -

i have rgba color in alpha value in 0-255 range. using function imagecolorallocatealpha in php accept alpha value in 0-127 range.how can convert alpha value in 0-255 0-127 for example alpha = 255 equivalent in 0-127 = 127 alpha = 0 equivelent in 0-127 = 0 use code imagecolorallocatealpha($image, $red, $green, $blue, $alpha/2); instead of imagecolorallocatealpha($image, $red, $green, $blue, $alpha); example alpha = 255 equivalent in 0-127 = 127 (255/2 = 127.5) alpha = 0 equivelent in 0-127 = 0 (0/2 = 0)

javascript - how to make layout work in grails when link has id (or not) -

the following code in land.gsp page. <table style="padding: 10 "> <thead> <tr style="color: blue"> <td>gname</td> <td>gowner</td> <td>device number</td> <td>edit </td> <td>delete </td> </tr> </thead> <tbody> <g:each in="${groups.list()}" status="i" var="groupsinstance"> <g:set var="myid" value="${groupsinstance.id}"></g:set> <tr class="${(i % 2) == 0 ? 'even' : 'odd'}"> <td>${fieldvalue(bean: groupsinstance, field: "gname")}</td> <td>

javascript - Dynamically Generated FileUpload and Image Preview -

Image
i dynamically generated table rows fileupload , default image using jquery. i want when image picked using fileupload on particular row default no-image pictured should replaced selected image. i tried using below jquery, seems work single fileupload , image. function readurl(input) { if (input.files && input.files[0]) { var reader = new filereader(); reader.onload = function (e) { $('#img-tag').attr('src', e.target.result); } reader.readasdataurl(input.files[0]); } } $("#file").change(function () { readurl(this); }); html: <table id="image" class="list"> <thead> <tr> <td class="left">image</td> <td class="right">sort order</td> &

Javascript - Delegate click event and detect the position of child element(compare with first-child) -

<div class="parent"> <div class="child"></div> <div class="child"></div> <div class="child"></div> <div class="child"></div> <div class="child"></div> </div> i find appropriate way using javascript when click on 1 of child element. figure out element's position( not coordinate ) such element third children of parent element. asking same detect child node number <script> $(document).ready(function () { $('.child').click(function () { alert("position is" + ($(this).index() + 1)) }); }); </script> <div class="parent" > <div class="child">1</div> <div class="child">2</div> <div class="child">3</div> <div

android - Probleme of Preferences in class extends Fragment -

sharedpreferences prefs1 = getsharedpreferences("monfichierdeprefs",mode_private); the same syntax works on class extend activity not in extends fragment added context syntax error has disappeared when press button "demande" application stops error come preferance sure may not find solution me please!!!!! public class pagegauchefragment extends fragment { private static string key_success = "success"; private static string key_error = "error"; final string para_nom = "parametre2"; final string para_nom1 = "parametre3"; context context; public string fname,lname,ftype; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.page_gauche, container, false); /** * action sur bouton demande * **/ button button = (button) view.findviewbyid(r.id.button1); button.setonclicklistener(new view.onclickli

c# - unable to save log into windows azure table storage? -

i have used following code save trace log table storage. i'm using windows azure skd version 2.2 system.diagnostics.trace.traceerror("start log"); also added listener in web.config <system.diagnostics> <trace> <listeners> <add type="microsoft.windowsazure.diagnostics.diagnosticmonitortracelistener, microsoft.windowsazure.diagnostics, version=2.2.0.0, culture=neutral, publickeytoken=31bf3856ad364e35" name="azurediagnostics"> <filter type="" /> </add> </listeners> </trace> </system.diagnostics> also added code in webrole.cs public override bool onstart() { startdiagnostics(); return base.onstart(); } private void startdiagnostics() { diagnosticmonitorconfiguration dmc = diagnosticmonitor.getdefaultinitialconfiguration(); timespan tsoneminute = time

c# - Improving Generic List Comparator -

i need generic class compare 2 list instances. have code below, quite messy , inefficient. how can make better , faster? callbyname extension uses reflection property. public class listobjectcomparator { #region proprietes public list<object> newlist {get; private set;} public list<object> removedlist { get; private set; } public list<object> communlist { get; private set; } #endregion #region methodes publics public bool run<t>(string icommuntextpropertyname, list<t> ioriginallist, list<t> inewlist) { return run(icommuntextpropertyname, ioriginallist, icommuntextpropertyname, inewlist); } public bool run<t>(string ioriginalpropertyname, list<t> ioriginallist,string inewpropertyname, list<t> inewlist) { if (ioriginalpropertyname.isnotnull() && inewpropertyname.isnotnull() && ioriginallist != null &&

iis 7 - IIS Security and Wordpress -

we self hosting wordpress on iis 7, 2008 server. to allow automatic updates wordpress code base, had set following permissions on wordpress root installation folder: iusr - modify my app pool - full control is secure configuration? thanks in advance, chris no, first - you should remove inheritance @ wwwroot , add system (full control) , administrators (full control) second - create administrator account application path website , use instead of basic pass through authentication (basic settings) third - change app pool use applicationpoolidentity , add permissions iis apppool\my app pool root of website , give read permission.

django - Fetch data from DB on every pageload -

i need make db query on every view within app, in order pass data templates. since views not classes, simple functions, can't have construct, can query. so, structurally speaking, best practice on put kind of logic? create template tag , queries there, seems not organized me. firstly, views can classes: django has offered class based views since version 1.3. however, best way pass data every template use context processor .

r - Check if one sample exists in the sample space (From PCA or other cluster analysis) -

i have 200 50 matrix, here 200 means 200 compounds (row) , 50 means 50 independent varialbes (column), , use 200 * 50 matrix cluster analysis (e.g. k-mean etc.), can plot show distributions these 2000 compounds. my question when have new compound, have same 50 independent variable 200 * 50 matrix, how can test if new compound located in cluster space? thanks. edit: plz note not need find element in data.frame. think first step cluster data (for example, using pca , plot(pca1, pca2)), test if new record located in plot or out. like picture , (2) belongs cluster , (1) not belong cluster space, this. here simple solution: step1: setup data set.seed(1) refdata <- data.frame(matrix(runif(200*50),nrow=200)) newrec01 <- refdata[11,] # record exists in data newrec02 <- runif(50) # record not exist in data step2: testing: true %in% sapply(1:nrow(refdata),function(i) all(newrec01 == refdata[i,])) true %in% sapply(1:nrow(refdata),function(i) all(newr

actionscript 3 - Why is StrobeMediaPlayer.swf 253k in the "for Flash Player X" folder but 433k when compiled or in player/bin folder? -

i have been trying compile strobemediaplayback source; i've managed compile project using ant flex 4.5.1 or flex 6 sdk , compiled using flash builder 4.5 (as recommended project). in cases, compiling smp project results in 433k strobemediaplayback.swf. also, strobemediaplayback.swf located in src/player/strobemediaplayback/bin/strobemediaplayback.swf ships 433k. question then, how on earth compile strobemediaplayback.swf 253k exists in for flash player 10.1 folder? appears there external osmf.swc file in folder 233k - typically gets bundled build... however, can drop 253k strobemediaplayback.swf new project without osmf.swc file , works fine. so, if turns out need compile strobemediaplayback without bundling osmf.swc, can point me in right direction on how this? relevant installation documentation impossible find: http://osmf.org/dev/osmf/specpdfs/building-osmf.pdf so, if turns out need compile strobemediaplayback without bundling osmf.swc, can point me i

javascript - How to use jquery Cookie? -

i have simple code: <html> <head> <script src="lib/jquery-1.11.0.min.js"></script> <script> $(document).ready(function () { $('.close_i').click(function(){ $('.adsbox').hide(); $('.open_i').show(); }); $('.open_i').click(function(){ $('.adsbox').show(); $('.open_i').hide(); }); }); </script> </head> <body> <div class="adsbox"> <img src="as1.jpg"> <img src="as2.jpg"> <img src="as3.jpg"> <img src="as4.jpg"> <img src="as5.jpg"> <img src="as6.jpg"> <a class="close

Trace Statements in PHP -

in c#/.net, can use trace.write or debug.write output application specific diagnostics. equivalent in php? echo outputting web page don't want. you write data error_log using error_log() via second argument can select type of logging want, such file logging, system logging or email.

java - instanceof vs equals on defined string that identifies the Class -

i can test class type in program i'm working both instanceof or getting field identifies class appartenency. choice between if(myobjec instanceof something){ } and if(myobjec.geclasstype().equals("something")){ } what best in terms of efficency? geclasstype() method present in object of program i'm working(not standard java method) , method returns string wih name of class. name passed field when object created edit field in second sample in code doesn't identify class category , used different routines, can use purpose since use specific object each category. have reported getclasstype make question more clear. you mean what's difference if verifying if object reference belongs specific class using instanceof vs comparing name of class. instanceof works object references class or subclass of class being compared. in case of interfaces, returns true if class (or super class) of object reference implements interface. getcla

c++ - What abstraction level should the servo transitions have? -

i think i'm using many methods because of poor abstraction design. that's why i'm asking question, different this one , similar ones, focus on number of methods per se. long story short, i'm doing hexapod. i'm saying because there unusual design considerations: cannot change going forward going backwards in no time; there's transition time. also, there's idle time, that's when there's no action. i'm refactoring code, achieve find i'm creating many methods should not in top-level abstraction, below: void loop() { // potentiometer string action = controller.action(); serial.println(action); // set spider forward start position if (action == "toforward") { spidey.toforward(); } // move spider forward else if (action == "forward") { spidey.forward(); } // standby position else if (action == "fromforward") { spidey.fromforward(); } // many more m

Can't Install Several Python Packages -

i have easy_install , pip installed on system. have tried installing number of different packages such twisted , scrapy , keep getting following error message: command python setup.py egg_info failed error code 1 in /tmp/pip_build_vagrant/cryptography i running os x 10.9 , have tried on local machine ubuntu virtual machine in vagrant. regardless of keep getting variation of above error. oddly enough, can install packages flask, django , few others. i have tried using virtualenv , no avail. here 1 example of error: command /users/meblumen/desktop/virtual_environments/scraper/bin/python -c "import setuptools, tokenize;__file__='/users/user1/desktop/virtual_environments/scraper/build/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bs/lkq_06gs33s1s_56zywwds2w0000gn/t/pip-wk9wd5-record/install-record.txt --single-version-extern

Case insensitivity in "if" statement (Python) -

this question has answer here: how test 1 variable against multiple values? 16 answers why `a == b or c or d` evaluate true? [duplicate] 1 answer i working on project @ 1 point ask user yes/no question. use code handle such questions: def yn(): global finalchoice choice=str(raw_input("y/n: ")) if choice == "y": finalchoice="true" elif choice == "y": finalchoice="true" elif choice == "n": finalchoice="false" elif choice == "n": finalchoice="false" else: yn() pass but seems quite inefficient, have check both "y" , "y" or "n" , "n" separately. i've tried: if choice == &quo

java.io.StreamCorruptedException: invalid stream header: 54657374 -

i trying read string send client using socket program, code follows: import java.io.ioexception; import java.io.objectinputstream; import java.io.objectoutputstream; import java.lang.classnotfoundexception; import java.net.serversocket; import java.net.socket; public class socketserverexample { //static serversocket variable private static serversocket server; //socket server port on listen private static int port = 5000; public static void main(string args[]) throws ioexception, classnotfoundexception{ //create socket server object server = new serversocket(port); //keep listens indefinitely until receives 'exit' call or program terminates while(true){ system.out.println("waiting client request"); //creating socket , waiting client connection socket socket = server.accept(); //read socket objectinputstream object objectinputstream ois = new objecti

xcode - updating my iOS app in appStore - Signiant Transfer Engine warning - app got rejected -

i've submitted , updated app several times. when i'm uploading app via xcode organizer (not application loader) receive following warning (3 times): "creating new signiant transfer engine because previous transfer had canceled. session @ risk of running out of available system resources." first didn't think it, today app got rejected app store reviewer because crashes on launch on ipad air use test on. ideas how can solved? found discussion here: application loader, new weird warning signiant transfer engine suggests change preferences in application loader. because have not uploaded app via application loader beginning cannot use application loader update (at least couldn't figure out how), doesn't me. else going wrong? ideas welcome! update: app validates without errors , warnings. when uploading it takes longer usual before warning mentioned above. have tested app on multiple devices. app not targeting ipads, it's made iphone/ipodtouch.

jquery - Wrap each group of elements with class starting with same characters -

here fiddle http://jsfiddle.net/7habq/12/ of have far. want wrap groups of 'ok' starting classes own <div class="wrapper"> i figured 1 possibility take first element of each group, run nextuntil() till finds element class not matching class, wrapall. it should in en this: <div class="foo">aaa</div> <div class="wrapper"> <div class="ok-4">bbb</div> <div class="ok-21887">ccc</div> <div class="ok-6">ddd</div> </div> <div class="bar">eee</div> <div class="baz">fff</div> <div class="wrapper"> <div class="ok-5a4">ggg</div> <div class="ok-12">hhh</div> </div> <div class="bim">iii</div> to wrap every individual div can use .wrap() : $('div[class^="ok"]').wrap("<div

android - How to enable programatically sqlite foreign key support? -

in documentation of sqlite syntax pragma foreign_keys = on; enables foreign key support. code in android ? you can override onopen in class extends sqliteopenhelper this: @override public void onopen(sqlitedatabase db) { super.onopen(db); if (!db.isreadonly()) { db.execsql("pragma foreign_keys=on;"); } }

java - Connecting to Azure SQL Server using Hibernate JDBC connection -

hibernate connection works local postgresql , automatically creates tables, when want use azure sql server (microsoft sql server) , change driver name etc., didn't error didn't work. (didn't create tables) jdbc.driverclassname=com.microsoft.sqlserver.jdbc.sqlserverdriver jdbc.databaseurl=jdbc:sqlserver://xxxx.database.windows.net:1433;database=xxxx jdbc.password=xxxx jdbc.user=xxx@xxxx jdbc.encrypt=true jdbc.hostnameincertificate=*.database.windows.net jdbc.logintimeout=30; jdbc.dialect=org.hibernate.dialect.sqlserverdialect <bean id="propertyconfigurer" class="org.springframework.beans.factory.config.propertyplaceholderconfigurer" p:location="/web-inf/jdbc.properties" > </bean> <bean id="datasource" class="org.apache.commons.dbcp.basicdatasource" destroy-method="close" p:driverclassname="${jdbc.driverclassname}" p:url="${jdbc.databaseurl}" p:usern

java - Error while connecting to Alfresco repository using opencmis and SSO -

i have alfresco server running on xx.xx.xx.101, connecting java workspace it, workspace , alfresco have been wired using sso . whenever click on link in jsp page, without authenticating redirecting alfresco share page . this code logging alfresco repository sessionfactory sessionfactory = sessionfactoryimpl.newinstance(); map<string, string> params = new hashmap<string, string>(); params.put(sessionparameter.user, username); params.put(sessionparameter.password, password); params.put(sessionparameter.atompub_url, "http://10.139.1.217:81/alfresco/service/cmis"); params.put(sessionparameter.binding_type, bindingtype.atompub.value()); params.put(sessionparameter.object_factory_class, dms_const.kbrrepositoryfactoryimpl); list<repository> repos = sessionfactory.getrepositories(params); return repos.get(0).createsession(); for username pass role_ticket , password pass ticket_value retriev

Ruby On Rails :- WHM VPS server -

i new in ruby on rails. upload , run ror project on web host manager- vpsserver. when try upload small size of video 7 mb upload. , on local host here can upload 200 mb video facing problem on whm vps server , when try upload 30 mb video file browser given me below error: the connection reset connection server reset while page loading. site temporarily unavailable or busy. try again in few moments. if unable load pages, check computer's network connection. if computer or network protected firewall or proxy, make sure firefox permitted access web. i change configuration of whm vps (php configuration editor). magic_quotes_gpc = off; register_globals = off; default_charset = utf-8; memory_limit = 500m; max_execution_time = 30000; upload_max_filesize = 999m; safe_mode = off; mysql.connect_timeout = 20; session.use_cookies = on; session.use_trans_sid = off; session.gc_maxlifetime = 12000000; allow_url_fopen = on; but did not solution. that sounds you're

json - jq - select objects with given key name -

i've got arbitrary structure many levels, etc. need select objects contain key named updatedate . how do jq? came 1 way produces errors on invalid data types when visits leaf have grep out: jq 'recurse(.[]) | has("updatedate")' | grep -fv error i don't understand how check types or leaves , suspect there simpler way achieve want? in 1.4 can just: jq '..|.updatedate?' if you're stuck 1.3 can use longer program so: jq 'recurse(if type == "array" or type = "object" .[] else empty end) | if type == "object" .updatedate else empty end'

android - All activities are closing on home button press -

thank taking time help. i have created android application thats starts splash screen , depending if user logged in, application opens either login or main activity. when user presses home button , click's application icon application resume @ last activity user @ (for example login screen). this works fine when apk installed onto device via android studio, if try install apk manually (the exact same apk), every time press home button , reopen application acts if killed , started application (the splash screen starts again). any idea why happening? thanks add following line manifest in launching activity means 1st activity android:launchmode="singletask" android:cleartaskonlaunch="true" on other activities add: android:finishontasklaunch="true"

java - Processing mapping always out of bounds -

i'm trying make graph in processing, keep getting "arrayindexoutofbounds" error. having hard time understanding concept of map() syntax, clear me? i'm not sure every number supposed stand within map(x,y,z,a,b); string[] name = { "1st:", "5th:", "10th:", "15th:", "20th:", "25th:", "30th:" }; int[] temperature = { 81, 82, 84, 85, 87, 88, 90 }; void setup(){ size(200,200); } void draw(){ int x=0; for(int i=0;i<10;i++){ if(mousex>x && mousex<=x+40){ fill(255,40,40); }else{ fill(50); } float h = map(temperature[i], 0, 100, 0, 200); rect(x+4,height-h,32,h); x+=40; } } your arrays have 7 elements, iterate 10 times. for(int i=0;i<10;i++){ ... float h = map(temperature[i], 0, 100, 0, 200); } either fill arrays additional 3 elements, or better: instead of number 10 should use i < tem

python - How to subset pandas dataframe by two-column list of any length -

i have tried different combinations of boolean arrays , .isin constructions, pandas fu not strong enough. if have following example dataframe: in[1]: import pandas pd exampledf = pd.dataframe({ 'factor1' : ['a', 'b', 'c', 'd', 'a', 'b', 'c', 'd'], 'factor2' : ['e', 'e', 'e', 'e', 'f', 'f', 'f', 'f'], 'numeric' : [1., 2., 3., 4., 5., 6., 7., 8.] }) i need pass list of factor1, factor2 pairs of length return subset of dataframe has combination of factors. for example: in[2]: def factorfilter(df, factorlist): # code goes here # returns dataframe factorfilter(exampledf, [['a', 'e'], ['c', 'f']]) out[2]: factor1 factor2 numeric 0 e 1 6 f

Unable to install Microsoft SQL Server 2012 Developer -

Image
i have problem installing sql server 2012 (no matter edition choose). installation runs well, near end shows error: the link points not-existing article on msdn page. after click ok button, installation reaches it's end , shows window: after able start, example sql management studio, cannot connect database. services of sql server stopped , not able start them manually (any try throws undefined error): i tried complete reinstalling of sql server, cleaning registry entries, different editions of software - none method helped. also, tried .iso images of installation media on other computers - worked , installed without errors. os windows 8.1 x64.

selenium - How to find a certain link under a tr that is underneath several identical trs -

another problem getting particular portion of html click link. need click link above classify item #, ifw #qa gm 04012014 1424-1, supplier 1 the part of td know "qa gm 04012014 1424". can table doing a: //*[@id='opentaskstable']/tbody what i'm left unknown number of td's same id. i'm not sure how find proper 1 point. code: <table id="opentaskstable" cellspacing="1" cellpadding="1"> <thead> <tbody> <tr class="evenrow tablecontroldatarow twtabletr"> <td> <a href="../teamworks/process.lsw?zworkflowstate=1&ztaskid=t453156" target="_blank">run task</a> </td> <td>classify item #, ifw #qa gm 04012014 0911-1, supplier one</td> <td>apr 24, 2014</td> </tr> <tr class="oddro

c++ - OpenCV fast mat element and neighbour access -

i use opencv (c++) mat matrix , want acces single mat elements fast possible. opencv tutorial, found code efficient acces: for( = 0; < nrows; ++i) { p = i.ptr<uchar>(i); ( j = 0; j < ncols; ++j) { p[j] = table[p[j]]; } } for problem, need access mat element , neighbours (i-1,j-1) calculation. how can adapt given code acces single mat element , surrounding elements? since speed matters, want avoid mat.at<>() . efficient way acces mat value , neighbour values? the pixel , neighbor pixels can formed cv::rect , can use: cv::mat mat = ...; cv::rect roi= ...; // define based on neighbors defination cv::mat sub_mat = mat(roi); in case neighbors definition not regular, i.e. cannot form rectangle area, use mask instead. check out here examples.

PHP while inside while -

let's i'm trying combine items 2 lists, , want result: a7 a8 b7 b8 this code: <?php $list1_array = array('a', 'b'); $list2_array = array('7', '8'); while(list( , $item1) = each($list1_array)) { while(list( , $item2) = each($list2_array)) { echo $item1.$item2."<br />"; } } ?> i result: a7 a8 i seems outside 'while' doesn't make second loop? doing wrong? while might better use more common (perhaps more readable) approach (e.g. using foreach loops as shown goleztrol ,) in answer original questions: the problem happening because internal "cursor" (or " pointer ") array not being reset ... never gets start of original array. instead, if try this: <?php $list1_array = array('a', 'b'); $list2_array = array('7', '8'); while(list(,$item1) = each($list1_array)) { while(list(,$item2) = each($li

jquery - How to style diffrent Collor Coulmn in Highcharts -

can please take @ this demo , let me know how can set diffrent color foe each of columns in chart? $(function () { $('#container').highcharts({ chart: { type: 'column' }, title: { text: 'world\'s largest cities per 2014' }, subtitle: { text: 'source: <a href="http://en.wikipedia.org/wiki/list_of_cities_proper_by_population">wikipedia</a>' }, xaxis: { type: 'category', labels: { align: 'center', style: { fontsize: '13px', fontfamily: 'verdana, sans-serif' } } }, yaxis: { min: 0, title: { text: 'population (millions)'

regex - Javascript regular expression,how to allows empty string for page value for printing -

i've regular expression check page value entered printing pages, 1-7 or 1-3,7 or 1-3,5-7. regex working cases, want allow blank page value, should not validate blank , print pages. i'm allowing user type special characters [&,-;_]. how allow blank or empty string regex. page value should start digit , end digit. var pagevalue = document.getelementbyid("pages" + counter); var regex = /^\d([&,-;_]\d+)*$/ //if page value wrong, return null , display error message here if(regex.test(pagevalue.value) == false) { alert("invalid page number: " + pagevalue.value); return; } i'm testing these page values. match found: 2-3 match found: 1,2 match found: 3-1 not match --- want match empty string match found: 1_2 not match abc match found: 1&2 match found: 1;2 not match -1-9 not match 1-9- match found: 1-5,13 match found: 1-5;13 match found: 1-5,13-23 not match 1-5,13-23; you can use: var regex = /^(\d([&,;_-]\d+)*)?

jquery - Ajax load - several containers -

i reading jquery load method. not know if there way load 2 different parts of response in 2 different containers, using single ajax call, like: $( "#b" ).load( "article.html #targetinb" ); $( "#a" ).load( "article.html #targetina" ); but using single ajax call. thanks in advance. i don't think it's built-in. however, can load entire contents hidden element temporarily, move there target elements. reduce number of ajax calls 1: $('#temp').load("article.html", function() { $('#a').append($('#temp #targetina')); $('#b').append($('#temp #targetinb')); }); here using optional callback ability of .load post-processing after result returned ajax call. #temp div gets entire contents ajax. each individual piece appended respective div. demonstration: http://jsfiddle.net/j4dkc/