Posts

Showing posts from March, 2012

javascript - How to display variables in AJAX? -

i have form users enter 6 numbers, collect , stored variables when form submitted. i'm using ajax display loading screen. wondering how display numbers entered on loading screen using ajax beforesend function? $(function() { $(".submit").click(function() { var num1 = $("#num1").val(); var num2 = $("#num2").val(); var num3 = $("#num3").val(); var num4 = $("#num4").val(); var num5 = $("#num5").val(); var num6 = $("#num6").val(); var datastring = 'num1=' + num1 + '&num2=' + num2 + '&num3=' + num3 + '&num4=' + num4 + '&num5=' + num5 + '&num6=' + num6; if (num1 == '' || num2 == '') { $('.error').fadeout(200).show(); } else {

c# - Static abstract objects with virtual methods -

i'm working on personal project , i've run issue. i have object couple of objects have same properties, methods, etc. things differ names, values of properties, , implementation of methods. need common default implementation of methods. right away, interface out of question. so created base class properties , "default" methods. base class needs abstract. methods virtual can overridden. the reason need them static objects properties of other objects. so, example, objects referenced above (for sake of simplicity) objx, objy, objz. derived base, objw. objcontainer unrelated object, has property of type objw, instance of either objx, objy, objz. objx, objy, , objz never change. properties readonly. multiple objects of instance objcontainer have objx, objy, or objz. public class objcontainer1 { objw processor = new objy; } public class objcontainer2 { objw processor = new objy; } how go doing this? wanted keep them static don't have multi

Polymer build does not output images folder? -

Image
i following build app app toolbox tutorial. in step 4 (deploy), after calling polymer build command, build/bundled , build/unbundled folder created, there no images folder in them. causes tab icon not show when deployed build. here screenshots:- in localhost development, tab icon shows up: i deployed build firebase ( https://polymer-app-toolbox.firebaseapp.com/ ), there no app-icon because images folder not in build output: am missing something? else seeing same problem?

git - How can I see what physical hunks are not in one branch from another? -

there branch topic1 branched master . let's original owner of topic1 didn't proper merge of branch master , , instead did cherry pick operation missed few commits. months pass, , realize topic1 still there. @ point, it's been long have no reliable way determine if cumulative patch topic1 represents present on master . what want able git diff topic1..master hide hunks on master not exist in topic1 . want see portion of diff showing changes in topic1 not present in master . possible? , if so, how can it? i'm using git 2.8+ you can start using --cherry-pick option of git log list of commits topic1 not cherry-picked master . from documenation of git-log : --cherry-pick omit commit introduces same change commit on “other side” when set of commits limited symmetric difference. what's interesting here --cherry-pick option uses commit's diff – not commit's sha-1 hash – in order determine whether commit introduces same

python - Regex - Splitting Strings at full-stops unless it's part of an honorific -

i have list containing possible titles: ['mr.', 'mrs.', 'ms.', 'dr.', 'prof.', 'rev.', 'capt.', 'lt.-col.', 'col.', 'lt.-cmdr.', 'the hon.', 'cmdr.', 'flt. lt.', 'brgdr.', 'wng. cmdr.', 'group capt.' ,'rt.', 'maj.-gen.', 'rear admrl.', 'esq.', 'mx', 'adv', 'jr.'] i need python 2.7 code can replace full-stops \. newline \n unless it's 1 of above titles. splitting list of strings fine well. sample input: modi waiting in line thank dr. manmohan singh preparing road map introduction of gst in india. bill set pass. sample output: modi waiting in line thank dr. manmohan singh preparing road map introduction of gst in india. bill set pass. this should trick, here use list comprehension conditional statement concatenate words \n if contain full-stop, , not in list of key words

twitter bootstrap 3 - Angular 2 rc4 Importing component content into modal -

i working angular 2 rc4 , using fuel-ui http://fuelinteractive.github.io/fuel-ui/#/ load modal. what trying achieve following: we have login component want inject fuel-ui modal problem actual modal html code (actual dom) getting loaded after. fuel-ui gives tag html modal gets loaded into. i have researched , tried dynamiccomponentloader although found out deprecated. what need know best way inject login component content rendered dom (tag modal-body class bootstrap html). i have searched perhaps had same issue , stumbled upon better link explains how this. thank you, in advance, help. nancy

MongoDb exclude null in aggregation $project -

i have data collection in mongodb shape: [{ "_id": "1", "sq1" : 5, "sq1comment" : "in general aaaaaa.", "sq2" : 8, "s2comment" : null, "sq3" : 5, "sq3comment" : "a person bbbbb." }, { "_id": "2", "sq1" : 4, "sq1comment" : "in general cc.", "sq2" : 8, "s2comment" : "a story ff", "sq3" : 5, "sq3comment" : null } ] i extract 'comment' fields, reflect not null in result. i can extract fields (sq1comment; sq2comment, sq3comment) one-by-one query db.collection.find({ "sq1comment": { $not: { $type: 10 } }) for output is: [{ "_id": "1", "sq1comment" : "in general aaaaaa.", "sq3comment" : "a person bbbbb." }] or if aggregation $project 'comment' fi

c - How to measure the execution time in micro seconds? -

this question has answer here: execution time of c program 12 answers i have written following code measure time of sorting data. getting weird results, negative time in cases , not getting consistent result same data set(i understand won't same). please let me know wrong or how can measure time properly. #include<stdio.h> #include<sys/time.h> void bubble(int a[],int n) { int i,j,flag,temp; for(i=0;i<n-1;i++) { flag=0; for(j=0;j<n-i-1;j++) { if(a[j]>a[j+1]) { flag=1; a[j]=a[j]+a[j+1]; a[j+1]=a[j]-a[j+1]; a[j]=a[j]-a[j+1]; } } if(flag==0) break; } } int main() { int n,a[100000],i; printf("enter size of array:"); scanf("%d",&n); for(i=0

jquery - Bootstrap Toggle not working on onclick LI element -

i'm using bootstraptoggle http://www.bootstraptoggle.com/ convert checkboxes toggles. have included cdn script , css. https://jsfiddle.net/j04x6sjm/4/ on <li>one</li> have called toggle function <input type="checkbox" data-toggle="toggle" /> reason not showing in filldle. works locally though. want achieve able check/uncheck checkboxes on clicking <li> or checkbox itself. i'm able achieve normal checkboxes script in fiddle. how can apply toggled checkboxes too? toggled class checkboxes should checked/unchecked on corresponding <li> click. many thanks. you not importing css s. i've imported them , it's working. can manually toggle switch using .bootstraptoggle('toggle') method(from official page). $('.list-group-item1-text').click(function() { var $cb = $(this).parent().find(":checkbox"); $cb.bootstraptoggle('toggle'); //if (!$cb.prop("

javascript - Creating an 'index' of current files in a given folder? -

i want create webpage looks this: <h1>index of results</h1> <div class="results"> <ul> <li><a href='result1.html'>--result 1--</a></li> <li><a href='result2.html'>--result 2--</a></li> <li><a href='... </a></li> </ul> </div> where results updated on page every time there new file added folder/directory. is possible monitor folder/ directory using javascript , update list without having hard-code links & tags etc? heres php solution: <?php print_r(scandir("/folder")); ?> you apply own html it: <?php $files=scandir("/folder"); foreach($files $file){ echo "<p>". $file."</p>"; } ?>

inno setup - Needing to raise and lower privileges as necessary in order to access network share, edit registry, then copy shortcuts on network share -

i need access network share during install process, , need edit registry keys. , finally, i'd add shortcuts program on network share. to edit registry keys, run installer elevated privileges. however, if that, won't able see network share created without admin privileges. there way kill installer , restart admin privileges, , fine copying necessary files, in order create shortcuts point network share, need downgrade privileges again, in middle of inno setup step copies file, step can't in middle of. any other options workaround? 1 found this , requires registry edit (fine) , restart (not fine). you can create shortcut using command , run [run] section runasoriginaluser flag. see how create shortcut via command-line in windows? or not kill unelevated installer. run copy files. , continue unelevated installer. also note can create shortcut pointing nonexisting file.

android - CursorWindowAllocationException thrown in SyncAdapter -

i following exception thrown in syncadapter class. think closing cursors correctly. can there other explanation why exception being thrown? or missing cursor.close() somewhere? fatal exception: android.database.cursorwindowallocationexception: cursor window not created binder. @ android.database.cursorwindow.<init>(cursorwindow.java:150) @ android.database.cursorwindow.<init>(cursorwindow.java:42) @ android.database.cursorwindow$1.createfromparcel(cursorwindow.java:698) @ android.database.cursorwindow$1.createfromparcel(cursorwindow.java:696) @ android.database.bulkcursordescriptor.readfromparcel(bulkcursordescriptor.java:75) @ android.database.bulkcursordescriptor$1.createfromparcel(bulkcursordescriptor.java:34) @ android.database.bulkcursordescriptor$1.createfromparcel(bulkcursordescriptor.java:30) @ android.content.contentproviderproxy.query(contentprovidernative.java:424) @ android.content.contentprov

python - How to take info from particular amount of elements with the same class name? -

i have lot of tables on same screen. , need take tex 1 of simple example: table:phone div id="phone_type" type-id="pass" class="panel panel-default sort_table"> <div class="panel-heading"> <h3 class="panel-title">phone</h3> </div> <ul class="list-group ui-sortable"> <li class="list-group-item ui-sortable-handle" id="pass"> <div class="row"> <div class="col-md-8 col-xs-8 increase_padding">home</div> <div class="col-md-2 col-xs-2 text-center"> <a data-remote="true" href="pass">edit</a> </div> <div class="col-md-2 col-xs-2 text-center"> <a data-remote="true" rel="nofollow" data-method="delete" href="pass">delete&

shell - bash script get substring from string -

i need part of string depending on value long string (for example output ps -ef). for example source string: long_string1="cmd ... -aaaa=a -bbbb=b -zzzz=z -dhome=/home/user/xxx -cccc=c ... etc." or long_string2="cmd ... -aaaa=a -dhome=/home/user/xxx -bbbb=b -zzzz=z -cccc=c ... etc." i want extract or following subtring after -dhome= : /home/user/xxx position of " -dhome= " not fixed, anywhere in long_string. i using following command: echo $long_string1|sed -e 's/.*-dhome=//g;s/ -cccc=c.*//g' it works fine $long_string1 doesn't work $long_string2. it work when " -cccc=c " netx " -dhome= " :-( how can path after " -dhome= " not depend on next values e.g. " -cccc=c " ??? is there more effective way or regexp same output ? thanks m.gi awk , cut can you. #!/bin/bash get_home() { awk -f "dhome=" '{print $2}' <<< "${long_string}"

java - How to check if three numbers are guessed? -

hi on community. i'm java newbie. no homework, i'm passionate programming , want learn more. stuck 1 exercise. basically have create simple lottery game. user has input 1 number 0 999, 3 digit number. if guess same, prize 10.000 $, if guess same (digits guessed not in order) prize 3,000 $ if guess not same (digits guessed == 1) prize 1,000 $. here's code far: don't know how deal condition 2 , 3. have hint or comment? import java.util.scanner; public class test { public static void main(string[] args) { scanner input = new scanner(system.in); system.out.println("please enter 3 digit number"); int guess = input.nextint(); //generate number: int lottery = (int)(math.random() * 1000); if ((guess > 999) || (guess < 100)) { system.out.println("the number not 3 digit number. system exit now."); system.exit(1); } else { // extrac

python - Rearrange position of words in string conditionally -

i've spent last few months developing program company using clean , geocode addresses on large scale (~5,000/day). functioning adequately well, however, there address formats see daily causing issues me. addresses format such park avenue 1 causing issues geocoding. thought process tackle issue follows: split address list find index of delimiter word in list. delimiter words words such avenue, street, road, etc . have list of these delimiters called patterns . check see if word following delimiter composed of digits length of 4 or less. if number has length of higher 4 zip code, not need. if it's less 4 house number. if word meets criteria explained in previous step, need move first position in list. finally, put list string. here initial attempt @ putting thoughts code: patterns ['my list of delimiters'] address = 'park avenue 1' # example address address = address.split(' ') pattern in patterns: location = address.index(pattern

caching - How to avoid require avalanches with node.js? -

i want cache data in node server: rpc data provider this: var cnt = 0; function rpcdataprovider(areaid) { return q.delay(100).then(() => { cnt += 1 console.log("i rpcdataprovider , not fast. requested " + cnt + " times."); const base = areaid * 10; var arr = []; (var = 0; < 10; ++) { arr.push(base + i); } return arr; }) } http server // cache data var provincelist; var citylist; var countylist; function getprovincelist() { if (provincelist && provincelist.length > 0) return q.resolve(provincelist); return rpcdataprovider(1).then((rv) => { provincelist = rv; return rv; }); } function getcitylist() { if (citylist && citylist.length > 0) return q.resolve(citylist); return getprovincelist().then((provincelist) => { return q.all(provincelist.map((item) => rpcdataprovider(item))).then(rvs => {

javascript - How to get the value of mysql.user password -

when log in using mysql.user can't log on if user has password. if logged on using user password page can't logged on other php. the user inputted on log in use on connection database. <?php session_start(); ?> <!doctype html> <html> <head> <title>log in</title> <meta charset="utf-8" /> <link rel="stylesheet" type="text/css" href="css/reset.css"> <link rel="stylesheet" type="text/css" href="css/structure.css"> <?php include('connection.php'); ?> </head> <body> <form class="box login" method="post"> <fieldset class="boxbody"> <label>username</label> <input type="text" tabindex="1" placeholder="username" required name="username" id="username"> <label><label class=&quo

eclipse - fetch all links under/in a specific class-selenium webdriver (java) -

Image
is there way fetch links under specific class? the thing is, ii writing test requires me click on random item/product if create list of links through by.tagname("a") , it'll fetch links on page. more exact, consider this website , want randomly choose pret , summer sale , accessories , bt lawn'16 , sale , lookbook or after clicking on summer sale , want randomly click on 1 of products under it. idea how it? here snippet of program : actually using incorrect xpath locating pret , summer sale , accessories , bt lawn'16 , sale , lookbook , links try below :- list<webelement> alllinks = driver.findelements(by.cssselector("a.level0")); random random = new random(); webelement randomlink = alllinks.get(random.nextint(alllinks.size())); randomlink.click();

xcode - 'Discard all changes' has deleted pod files -

i did commit on friday, discard changes on monday, pod related files in trash. realise did wrong, i'm quite inexperienced git etc, need restore files. has come across before , know do? description this should revert home directory state state prior changes refer in original post. example run git reflog find head@{id} (ex. head@{1} , head@{2} etc.) prior changes you've made run git reset --hard head@{id} ( id number refering particular head described in point 2. reference git reflog useful link recovering lost commits git reflog , reset

c# - ASP.NET MVC InvalidOperationException was unhandled by user code while following book example -

namespace sportsstore.domain.entities { public class product { [hiddeninput(displayvalue = false)] public int productid { get; set; } //[required(errormessage = "please enter product name")] public string name { get; set; } [datatype(datatype.multilinetext)] //[required(errormessage ="please enter description")] public string description { get; set; } //[required] //[range(0.01, double.maxvalue, errormessage = "please enter positive price")] public decimal price { get; set; } //[required(errormessage = "please specify category")] public string category { get; set; } } } this entity definition, , below action controller. public viewresult list(string category, int page = 1) { productslistviewmodel model = new productslistviewmodel { products = repository.products.where(p => category == null

Convolution Neural Network configuration -

how can choose cnn architecture? example, have n classes , images of size m*m, how can determine layer sizes , count should use? there universal formula? in case have 16k classes , images of size 64*64. can me it? there no techniques determine layer sizes , count should use. it's more of trial , error. there no universal formula. choose layer size , train network. change , train again, till satisfied accuracy.

PHP file upload always returns MIME type "inode/x-empty" -

so have function uploads terms & conditions folder. fetch extension , mime type of file , check if valid. of recently, files upload return $_files[$key]['size'] 0 while files on local disk have file size. when check mime type using following script, returns inode/x-empty . $finfo = finfo_open(fileinfo_mime_type); $filetype = finfo_file($finfo, $file['tmp_name']); // returns 'inode/x-empty' $expl = explode('.', $file['name']); $fileext = end($expl); i can't seem figure out why happening didn't couple of months back. i've never seen happen before either. below example of $_files output: array ( [name] => audite_marlow_logo.jpg [type] => image/jpeg [tmp_name] => /tmp/phpchbiln [error] => 0 [size] => 0 ) the server's php.ini more capable of handling files upload. post_max_size set insane 128m . all files upload return error integer value of 0 . i lost why happening.

Apache archiva returns http error 503 -

i using apache archiva v. 2.2.0 under windows server 2012 r2, java version 1.8.0_60 inside virtualbox. used work quite long time before windows autoupdate. after windows autoupdate getting error message when going archiva url: http error: 503 . problem accessing /. reason: service unavailable, powered jetty://. the apache archiva service running. no error logs generated. restarting or reinstalling of service has no impact. after rolling of windows update restore normal operation of archiva, mysteriously, once, i.e. stopping , restarting of archiva cause same http error 503. the log file not indicate problem or error cuase. thank tips. i faced similar issue. restarted archiva using ./path/to/archiva/apache-archiva-2.2.0/bin/archiva console for you, since using windows .\bin\archiva.bat console

java - Split a set to sub sets using Lists.partition or Iterable.partition -

i wondering efficient way split set sub sets? iterable<list<long>> partitions = iterables.partition(numbers, 10); or list<list<long>> partitions = lists.partition(numbers, 10); what difference in time complexity? thanks let's @ inner implementation method partition() iterables 529 public static <t> iterable<list<t>> partition(final iterable<t> iterable, final int size) { 530 checknotnull(iterable); 531 checkargument(size > 0); 532 return new fluentiterable<list<t>>() { 533 @override 534 public iterator<list<t>> iterator() { 535 return iterators.partition(iterable.iterator(), size); 536 } 537 }; 538 } method partition() lists 681 public static <t> list<list<t>> partition(list<t> list, int size) { 682 checknotnull(list); 683 checkargument(size > 0); 684 return (list instanceof randomaccess) 685 ? new

jsp - Adding HTML element values to ArrayList Using JSTL? -

problem: i trying figure out way iterate on series of <li> elements defined on jsp page using jstl. once done value of each li added arraylist in jstl. is possible? code jstl: jstl code used add html elements arraylist <%@page import="java.util.arraylist" %> <% // java inserting names invite arraylist arraylist<string> list = new arraylist<string>(); list.add(*input search here!*); request.setattribute("invited", list); %> html example of list elements added arraylist above - <ul> <li> 1 </li> <li> 2 </li> <li> 3 </li> </ul> for example, list.get(0) contain 'one'.

python - How to find polygon vertices from edge detection images? -

Image
1. problem given images of house roof, trying find contours of roofs. have labelled data available (as polygon vertices) interpolate , create truth image shown below i use canny, hough-lines, lbp features train ml model results decent. model output shown in middle, , overlay on test image shown on right. 2. need. the final output should set of polygons , need find points on these polygons should drawn (see highlighted points in image below). output can set of n line segments. each line segment 2 points [(x1,y1),(x2,y2)] 3. thoughts/ideas; a. erosion,dilation,opening,closing,skeletonize operations while these operations make lines in above image neater, don’t me find polygon vertices looking for. i'd fit (a number of) lines white pixels in image (something hough lines). the intersections of these lines give me vertices polygons looking for. i wondering if there more standard/better way of accomplishing above. i think houghlinesp in goal. find

gwt - EditorExit event handler called recursively -

the below portion of code caused recursive call on oneditorexit method. if remove setdata call, no recursion occur. can workaround? mygrid.addeditorexithandler(new editorexithandler() { public void oneditorexit(editorexitevent event) { gwt.log("hello"); mygrid.setdata(new listgridrecord()); } }); now check console output - console screenshot it won't work because each time call setdata() editor fire editorexit event in infinite loop (not recursively). way, calling setdata() in way doing replace records in listgrid 1 new empty record. seems disconcerting user experience. it looks want create , start editing new record when tab out of last one. in order in listgrid , use: grid.setlistendeditaction(rowendeditaction.next); that's need in order working.

wordpress - WooCommerce [product_categories] shortcode - Missing displayed sub-categories -

i using woocommerce plugin in wordpress, , have added 20 sub-categories in 1 parent category. when want display sub-categories in page using shortcode: [product_categories number="20" parent="0"] it retrieves 12 of them no pagination , doesn't display sub-categories. why happening? how can increase limit? in [product categories] woocommerce shortcode, argument number used display number of products in categories / subcategories , not number of categories. and argument parent="0" display top level categories , not subcategories. this shortcode made display product categories loop reference: [product categories] woocommerce shortcode

http - Share cookie between subdomain and domain -

i have 2 questions. understand if specify domain .mydomain.com (with leading dot) in cookie subdomains can share cookie. can subdomain.mydomain.com access cookie created in mydomain.com (without www subdomain)? can mydomain.com (without www subdomain) access cookie if created in subdomain.mydomain.com ? the 2 domains mydomain.com , subdomain.mydomain.com can share cookies if domain explicitly named in set-cookie header. otherwise, scope of cookie restricted request host. (this referred "host-only cookie". see what host cookie? ) for instance, if sent following header subdomain.mydomain.com : set-cookie: name=value then cookie won't sent requests mydomain.com . if use following, usable on both domains: set-cookie: name=value; domain=mydomain.com in rfc 2109 , domain without leading dot meant not used on subdomains, , leading dot ( .mydomain.com ) allow used across subdomains. however, modern browsers respect newer specification rfc 626

clojure - How to use AND operation in Riemann -

i have riemann code trigger email when both condition met . wrote below code. (let [email (mailer {....email configuration})] (streams (where (service "log") (smap (fn [events] (let [count-of-failures (count (filter #(= "failed" (:status %)) events) , (filter #(= "uk" (:country %)) events))] ;calculate count matched value (event { :status "failure" :metric count-of-failures :total-fail (>= count-of-failures 2)}))) (where (and (= (:status event) "failure") (:total-fail event)) (email "xxx@xx.com") )prn)))) i getting below error once started execute clojure.lang.arityexception: wrong number of args (3) passed to: can please suggest me right way use , operation here. thanks in advance you give 3 args count - therefore error.

mongoose im - mod_shared_roster_ldap configuration not working. How to make it work? -

i setting openldap along mongooseim. don't have detailed knowledge ldap. able set authentication ldap, not able set mod_shared_roster_ldap . want users in each others roster. my example config this: {ldap_servers, ["test.example.com"]}. {ldap_port, 389}. {ldap_rootdn, "cn=admin,dc=test,dc=example,dc=com"}. {ldap_password, "example"}. {ldap_base, "ou=users,dc=test,dc=example,dc=com"}. {ldap_uids, [{"uid", "%u"}]}. {mod_shared_roster_ldap, [{ldap_base,"ou=users,dc=test,dc=example,dc=com"}, {ldap_groupattr,"cn"}, {ldap_gfilter,"(&(objectclass=groupofurls)(cn=%g))"}, {ldap_groupdesc, "description"}, {ldap_memberattr, "member"}, {ldap_memberattr_format,"cn=%u,ou=users,dc=xmpp,dc=graphed,dc=io"}, {ldap_ufilter,"(&(objectclass=inetorgperson)(cn=%u))"}, {ldap_userdesc, "cn"}, {ldap_auth_check, "off"}, {ldap_

javascript - Table sorting issue on hidden row -

example fiddle table sorting issue on hidden row. have created fiddle. please this. function sorttable(f, n) { var rows = $('.videolisttble tbody tr').get(); rows.sort(function (a, b) { var = getval(a); var b = getval(b); if (a < b) { return -1 * f; } if (a > b) { return 1 * f; } return 0; }); function getval(elm) { var v = $(elm).children('td').eq(n).text().touppercase(); if ($.isnumeric(v)) { v = parseint(v, 10); } return v; } $.each(rows, function (index, row) { $('.videolisttble').children('tbody').append(row); }); } var f_sl = 1; var f_nm = 1; $(".matchhead").click(function () { f_sl *= -1; var n = $(this).prevall().length; sorttable(f_sl, n); }); $(".timehead").click(function () { f_nm *= -1;

cmd - While splitting txt file through batch script Exclamations are ommitting -

Image
iam new batch script , here tried split text file chunks each 1 million rows. chunk files generated expected, inside output file content iam missing exclamations ( ! ) , skipping immediate column after exclamation. please me data in original file chunks! @echo off setlocal disabledelayedexpansion set limit=1000000 set feed_name=test.txt set file=%tgt_dir%\%feed_name% set linecounter=1 set filenamecounter=1 set name= set extension= %%a in (%file%) ( set "name=%%~na" set "extension=%%~xa" ) setlocal enabledelayedexpansion /f "tokens=*" %%a in (%file%) ( set splitfile=!name!%date:~12,2%%date:~4,2%%date:~7,2%!filenamecounter!!extension! if !linecounter! gtr !limit! ( set /a filenamecounter=!filenamecounter! + 1 set linecounter=1 echo created !splitfile!. ) echo %%a>> %tgt_dir%\!splitfile! set /a linecounter=!linecounter! + 1 ) endlocal it tab delimiter file. screenshot you need

php - Extract first number(s) from variable -

i have variables start number or numbers , need script determine number ends, example variable can following: 1234 -hello1.jpg 1 hello1.gif 1234 hello1.gif 123456 hello1.gif what trying explode function not work, , regex poor, need left first number , ignore other number in string. need left number(s) in bold. thanks in advance... $arr = str_split($str); for($i = 0; $i < count($arr); ++$i){ if(!is_numeric($arr[$i])){ echo "number ends @ index: " . $i; break; } } you put numbers array using $arr[$i] if wish. lot more readable using regex. you add logic allow 1 decimal point question seems want integers. http://sandbox.onlinephpfunctions.com/code/fd21437e8c1502b56572a624cf6e4683cf483a8d - example of working code

sql - Alphabetic ranking a list with set of 'WITH TIES - ORDER BY (multiple fields) -

a regular usage of "with ties" & result of query : demand: best of 10 movies oscar wins select top 10 ties f.filmname title, f.filmoscarwins [oscar wins] dbo.tblfilm f filmoscarwins not null order [oscar wins] desc; resullt of first query when add "title" @ field of order make list alphabetical order, doesn't work properly! no 13 movies in list no alphabetic order demand: best of 10 movies in alphabetical order: select top 10 ties f.filmname title, f.filmoscarwins [oscar wins] dbo.tblfilm f filmoscarwins not null order [oscar wins] desc, title; result of second query so should make alphabetical order while ranking set of 'with ties - order by'? your query gets top 10 ranked oscar winning movies. top 10 , order by in query. n

Javafx : test with a layout manager? -

i'm learning javafx , made few try vbox layout manager. code seems ok wanna check if understood how works. here code : public class testshape2 extends application { public static void main(string[] args) { launch(args); } @override public void start(stage primarystage) throws exception { group root = new group(); label toplabel = new label("top..."); label toplabel2 = new label("top 2..."); rectangle rect = new rectangle(); rect.setfill(color.aqua); label bottomlabel = new label("bottom..."); vbox vbox = new vbox(); rect.widthproperty().bind(vbox.widthproperty()); rect.heightproperty().bind(vbox.heightproperty()); vbox.getchildren().addall(toplabel, toplabel2, rect, bottomlabel); /* * code 1 */ root.getchildren().add(vbox); scene scene = new scene(root, 300, 300, color.blanchedalmond); /* * code 2 */ // scene

abap - E:The key specification is incomplete. Generic specification is only completed -

when clicking on check (ctrl + f2) error: e:the key specification incomplete. generic specification completed unfortunately there not see indicator line wrong. thx sap :/ therefore here relevant code: select /bic/customer /bic/pcustomer table i_pcustomer objvers = c_a. select /bic/material /bic/sdcsnum /bic/pmaterial table i_pmaterial_s objvers = c_a. sort i_pmaterial_s /bic/material. i_pmaterial = i_pmaterial_s. delete i_pmaterial_s /bic/sdcsnum initial. *write log in infopackage - check double entries material sort i_pmaterial_s /bic/sdcsnum. loop @ i_pmaterial_s i_pmaterial_s_line. if sy-tabix = 1. clear flg_dup. else. if i_pmaterial_dcs_line-/bic/sdcsnum = i_pmaterial_s_line-/bic/sdcsnum. "clear p_t_errorlog. l_cnt = l_cnt + 1. p_t_errorlog_line-msgid = 'vrs'. p_t_errorlog_line-msgty = 'i'. p_t_errorlog_line-msgno = 0. p_t_errorlog_line-msgv1 = &

javascript - AngularJS: Iterate over array by clicking button -

sorry dump, question, new angularjs , javascript . iterate on collection clicking button. <body ng-init="customers = [ {'name':'john', 'city':'doe'}, {'name':'anna', 'city':'smith'}, {'name':'peter', 'city':'jones'} ]"> <div class="container" ng-app="myapp" ng-controller="myctrl" > <div class="span12"> <h1>{{name}}</h1> <br/> <p>{{city}}</p> <button type="button" name="button" value="next" ng-click="makeiterator($scope.customers)"></button> </div> </div> so after clicking next button see next iteration of customers displayed. how make it? you can store index , increment when clicking on button <body ng-app="myapp"> <div class="container" ng

cookies - Can't return to default language with Google Translate in javascript -

Image
i have code uses google-translate , jquery.cookie translate page other language: $(document).ready(function () { var googtrans = $.cookie('googtrans'); if (googtrans === '/es/en') { //paint specific flag var src = $('.lang-change img').attr('src').replace('flag_en.png', 'flag_es.gif'); $('.lang-change img').attr('src', src); $('#lang-change-en').attr('id', 'lang-change-es'); } $(".lang-change").on("click",function(){ if (googtrans == '/es/en') { //if language english return spanish $.removecookie('googtrans',{path:'', domain: 'domain.es'}); $.removecookie('googtrans',{path:'', domain: '.domain.es'}); location.reload(); }else{ //convert english $.cookie('googtrans','/es/en',{path:''});

javascript - Flowtype - string incompatible with string enum -

i have value comes select input , of type string, want pass function ( updatelanguage ) receives argument string enum type alias ( language ). the problem i'm facing flow allows me call updatelanguage if explicitly compare string value enum strings , want use array function array.includes. this code simplification of problem: // @flow type selectoption = { value: string }; const selectedoption: selectoption = {value: 'en'}; type language = 'en' | 'pt' | 'es'; const availablelanguages: language[] = ['en', 'pt']; function updatelanguage(lang: language) { // nothing } // ok if(selectedoption.value === 'en' || selectedoption.value === 'pt') { updatelanguage(selectedoption.value); } // flowtype errors if(availablelanguages.includes(selectedoption.value)) { updatelanguage(selectedoption.value); } running flow v0.30.0 gives following output: example.js:21 21: if(availablelanguages.includes(sel

Server Tomcat version 7.0 not working in Eclipse Indigo -

i getting things displayed in console below i new eclipse don't know how solve please me 8 aug, 2016 2:51:39 pm org.apache.tomcat.util.digester.setpropertiesrule begin warning: [setpropertiesrule]{server/service/engine/host/context} setting property 'source' 'org.eclipse.jst.jee.server:testmail' did not find matching property. 8 aug, 2016 2:51:39 pm org.apache.tomcat.util.digester.setpropertiesrule begin warning: [setpropertiesrule]{server/service/engine/host/context} setting property 'source' 'org.eclipse.jst.jee.server:talentakeaways' did not find matching property. 8 aug, 2016 2:51:39 pm org.apache.catalina.startup.versionloggerlistener log info: server version: apache tomcat/7.0.70 8 aug, 2016 2:51:39 pm org.apache.catalina.startup.versionloggerlistener log info: server built: jun 15 2016 16:27:45 utc 8 aug, 2016 2:51:39 pm org.apache.catalina.startup.versionloggerlistener log info: server number: 7.0.70.0 8 aug, 2