Posts

Showing posts from April, 2011

javascript - To hide the div on ajax call if I get result -

here, getting result through ajax. want hide div if result ajax. below div want hide if result through ajax. here code, $("button").click(function(){ var dateselect=$("#dateselect").val(); var userselect = $("#employee").val(); $.ajax({ type: 'get', url: "<?php base_url() ?>manage_attendance/listing", data:'dateselect='+dateselect+'&userselect='+userselect, datatype: "json", success: function(data) { $('.clkin_time').html(data.result); if(data.clkout_result != "0000-00-00 00:00:00") { $('.clkout_time').html(data.clkout_result); //document.getelementbyid('selecttime').style.display = "hidden"; } else { $('.clkout

c# - How to set title of rendered anchor tags for <asp:BulletedList DisplayMode="HyperLink"/> -

i have bulleted list in asp.net displaymode set hyperlink. when control rendered, links display fine additionally want set title each anchor tag. how do this? aspx file: <asp:bulletedlist id="bl1" runat="server" displaymode="hyperlink" datatextfield="anchortext" datavaluefield="url" /> code behind file: in code behind file data binding bl1 list. list<urldata> listofurls . where urldata class has 3 public properties class urldata { public string url {get; set;} public string anchortext {get; set;} public string titletext {get; set;} //public urldata initialise properties } you have 2 options:- option 1: loop through items inside bulletedlist , add title attribute this:- protected void page_prerender(object sender, eventargs e) { foreach (listitem item in bl1.items) { item.attributes["title"] = gettooltip(item.value); } } obviously have call data

android - Fatal signal 11 (SIGSEGV), code 1, fault addr 0xa46847dc in tid 11765 (lfontpro.source) -

i developing android application in eclipse. why above error occur? not understand how solve above error.running application stop , close automatically. purpose of application make .ttf file generate style of font. using libttfjni.so file in code.also using multiple images. please 1 have idea error. thank you.

powershell - How to change logon enable/disable remotely -

when change mode of logons on terminal servers disable . forget reenable before close session. can not reconnect change if. you can use wmi win32_terminalservicesetting check , change status of tslogons get-wmiobject win32_terminalservicesetting -n "root/cimv2/terminalservices" -computername $_ -authentication packetprivacy i write 2 function enable , disable on many computers simultanusly function logondisable { param ( [parameter(mandatory=$true,position=0)] [alias("cn")] [string[]]$computername ) try { $computername | select-object -unique | %{ $ts_connector = get-wmiobject win32_terminalservicesetting -n "root/cimv2/terminalservices" -computername $_ -authentication packetprivacy $ts_connector.logons=1 $ts_connector.put() $ts_connector.get() if ($ts_connector.logons -eq 1) { "ok"

how to convert xml file into csv file in javascript -

<?xml version="1.0" encoding="utf-8"?> <current> <city id="1259229" name="pune"> <coord lon="73.86" lat="18.52" /> <country>in</country> <sun rise="2016-01-07t01:38:29" set="2016-01-07t12:42:53" /> </city> <temperature value="27.49" min="27.49" max="27.49" unit="metric" /> <humidity value="43" unit="%" /> <pressure value="955.13" unit="hpa" /> <wind> <speed value="2.65" name="light breeze" /> <gusts /> <direction value="113.502" code="ese" name="east-southeast" /> </wind> <clouds value="36" name="scattered clouds" /> <visibility /> <precipitation mode="no" /> <wea

c# - Return bool from a Background thread in WPF -

public bool function() { bool doesexist = false; backgroundworker worker = new backgroundworker(); worker.dowork += (o, ea) => { // work done here }; worker.runworkercompleted += (o, ea) => { //somw logic here return doesexist; }; } i want doesexist value return value function getting intellisense error system.componentmodel. runworkercompletedeventhandler returns void, return keyword must not followed object expression why getting error, how return bool value? public bool function() { bool doesexist = false; backgroundworker worker = new backgroundworker(); worker.dowork += (o, ea) => { // work ea.result = true; // set true if goes well! }; worker.runworkercompleted += (o, ea) => { // since boolean value calculated here &

csom - Event Handler later than OnPublished -

are there project server event handler events later "onpublished"-event when creating new project? the time when on published event occurs seems to early. loading project fieldvalues not work. null. publishedproject project = projcollection.first().includecustomfields; projectcontext.load(project); projectcontext.load(project.includecustomfields); customfieldcollection fields = project.customfields; projectcontext.load(fields); projectcontext.executequery(); dictionary<string, object> fieldvalues = project.fieldvalues; when executing same code existing project works fine. instead timeout x seconds prefer later server event values have been set. edit: seems there wrong other code before executing this. custom fields , fieldvalues loading correctly now. but loading projectsiteurl afterwards still @ point. projectsiteurl stays null. projectcontext.load(project, p => p.projectsiteurl); projectcontext.executequery(); i used psi not csom , &

postgresql - Database column encryption postgres -

how encrypt column in postgres database using pgcrypto addon ? i using postgres 9.3 , need encrypt 1 of column , postgres support aes encryption or mean can achieve ? yes, postgres pgcrypto module support aes . details examples can found here . sample usage: -- add extension create extension pgcrypto; -- sample ddl create table test_encrypt( value text ); insert test_encrypt values ('testvalue'); -- encrypt value encrypted_data ( select crypt('passwordtoencrypt0',gen_salt('md5')) hashed_value ) update test_encrypt set value = (select hashed_value encrypted_data); validate password: select (value = crypt('passwordtoencrypt0', value)) match test_encrypt; returns: match ------- t (1 row)

visual c++ - syntax error : missing ';' before ')' -

i have nested loop , getting error, far know dont need ';' in section of code while ( infile >> location >> elevation >> precipamount ) { (count, count <= 12, count ++) i getting error after last close parentheses. your for loop has syntax errors, note semi colons instead of commars: for (count; count <= 12; count ++)

Relational algebra , tried everything, just don't know how to do this -

the following relational tables/schemes given: in bold primary key, in italics foreign key: -city( name ,country,population) -venue( vid ,capacity, name ) -concert( kid , id , did ,duration) -performer( id , kid ,age,name) -ticket( tid , kid ,price,type) now assignment find concerts there more vip tickets other tickets. vip of attribute type, in tickets. have thought problem while. main idea group kid,type,count(*) in (tickets) , somehow add tickets of type != vip , select less vip tickets, don;t know how formally.. something work: select concert.name concert inner join ticket on concert.kid = ticket.kid (select count(concert.kid) concert inner join ticket on concert.kid = ticket.kid type = 'vip') > (select count(concert.kid) concert inner join ticket on concert.kid = ticket.kid type != 'vip')

What's the difference between ESC/P and ESC/P R? Will python-escpos work with an ESC/P R printer? -

i want control epson printer python. printer new (from last 2 years) , specifications language esc/p r. compatible esc/p? wikipedia article says esc/p r newer variant of printer language , compatible esc/p, couldn't find other sources this. and if you're familiar python-escpos in particular, has python-escpos been known work esc/p r? the python-escpos driver speaks esc/pos (hence name), different both esc/p , esc/p r. in particular, python-escpos has no concept of pages, not going useful tool describe output on esc/p printer, if of basic formatting codes same.

What would be the opposite of "git fetch"? -

if git fetch repo a b , master branch in b doesn't change - changes remotes/origin/master , , git status reminds me of it. but want opposite - update b a , pushing a:master b:remotes/origin/master . reason this update happens on ssh, , a machine has public-key auth b machine - not vice versa. how can this? git fetch a , run b , store current branches of a in refs/remotes/a . can pretty refspecs , it's possible same git push , run a , targeting b . a refspec has 2 parts, separated semicolon. in first part select want push. here want current branches, refs/heads/* . second part you'll store them on remote; here want store them under remotes/a/* , refs/remotes/a/* . put together, push local branches corresponding remote branches command: git push --force b refs/heads/*:refs/remotes/a/*

encryption - Ceasar cipher: python -

the decrypting section doesn't work because randomly put wrong letters doesn't make enter code here the word encrypted in first place. example if encrypted 'hello' 7 encryption 'olssv' when decrypted become 'cebbe' i think problem on line 22 ' cipher2 += alphabet[(alphabet.index(a)-key)%len(cipher)] ' i'm not 100% sure. here code. alphabet = 'abcdefghijklmnopqrstuvwxyz' la = len(alphabet) message = input("insert message: ") key = int(input("insert key: ")) cipher = '' in message: if in alphabet: cipher += alphabet[(alphabet.index(a)+key)%la] else: print ("error") print(cipher) cipher2 = '' question = input("do wish decrypt? y/n: ") if question.lower() == 'y': in cipher: if in alphabet: print((cipher.index(a)-key)) cipher2 += alphabet[(alphabet.index(a)-key)%len(cipher)] else: print(cipher

angularjs - Input field is not recognizing pasted data -

i have problem that, when try copy paste data, not recognized angular. if delete last number , write again, recognized. ideas can cause ? <input limit-to="20" name="iban" class="form-control" ng-model="paymentdata.iban" placeholder="at1234567890123456789" iban="de" required, xt-validation-tooltip placement="top" msg-iban="bitte geben sie eine gültige iban ein." msg-required="bitte geben sie ihre iban ein."/> </div> what mean when not recognized angular? see have orphaned div. input sandwiched within div wired controller? play fiddle here , see works expected copied , pasted numbers. markup <div ng-controller="myctrl"> <input limit-to="20" name="iban" class="form-control" ng-model="paymentdata.iban" placeholder="at

python - How to use elasticsearch.helpers.streaming_bulk -

can advice how use function elasticsearch.helpers.streaming_bulk instead elasticsearch.helpers.bulk indexing data elasticsearch. if change streaming_bulk instead of bulk, nothing gets indexed, guess needs used in different form. code below creates index, type , index data csv file in chunks of 500 elemens elasticsearch. working wandering possible increse prerformance. that's why want try out streaming_bulk function. currently need 10 minutes index 1 million rows csv document of 200mb. use 2 machines, centos 6.6 8 cpu-s, x86_64, cpu mhz: 2499.902, mem: 15.574g total. not sure can go faster. es = elasticsearch.elasticsearch([{'host': 'uxmachine-test', 'port': 9200}]) index_name = 'new_index' type_name = 'new_type' mapping = json.loads(open(config["index_mapping"]).read()) #read mapping json file es.indices.create(index_name) es.indices.put_mapping(index=index_name, doc_type=type_name, body=mapping) open(file_to_index, &

ios - Undefined symbols for architecture arm64 error after accidentally delete target -

i accidentally delete target. created again couldn't run application again. when set appdelegate error. ld /users/cihanozdiker/library/developer/xcode/deriveddata/moka-foueugicfassxcdbtgwkndrougpu/build/intermediates/moka.build/debug-iphoneos/moka.build/objects-normal/arm64/moka normal arm64 cd /users/cihanozdiker/documents/mokaaftermerchantfinished export iphoneos_deployment_target=9.1 export path="/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/usr/bin:/applications/xcode.app/contents/developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/sdks/iphoneos9.2.sdk -l/users/cihanozdiker/library/developer/xcode/deriveddata/moka-foueugicfassxcdbtgwkndrougpu/build/products/debug-iphoneos -l../include -l../include/barcode -l../include/commo

Disable affinity in Azure's Load Balancer for Cloud Services (Web/Worker roles) -

Image
i'm seeing definite non-round-robin load-balancing pattern in azure's load balancer cloud role. of requests going 1st instance of two-instance of web-api worker role setup. how can ensure azure's lb distributes requests equally? note first screenshot cloudmonix's dashboard contains cpu utilization 1st instance (60-65% sustained average) , 2nd screenshot contains cpu utilization 2nd instance (2-5% sustained average) consistent across many different times i've looked this. both of instances same, listen many http requests , process them. there way of configuring loadbalancerdistribution cloud service in .csdef file. flaw documentation updates :-( please @ article: https://azure.microsoft.com/en-us/blog/azure-load-balancer-new-distribution-mode/ the value of loadbalancerdistribution can sourceip 2-tuple affinity, sourceipprotocol 3-tuple affinity or none (for no affinity. i.e. 5-tuple) i'll in getting schema article updated reflect this

Xcode unit test compile-time error in Swift -

swift's advanced type-checking has ushered entire coding practice of maximizing compile-time type-checking. a lot has been said traditional unit-testing vs. type-safety in code. find myself on type-safety side of equation, i.e., i've been trying make code raise many compile-time errors possible when used incorrectly. however i'm wondering if there's way unit-test type-safety itself. of course, type-safety errors exhibited compile-time errors. therefore, boils down unit-testing compile-time errors. there answer achieving make in c++: unit test compile-time error ideally, able following: struct username: stringish{ ... } struct sqlquery: stringish{ ... } ... xctassertuncompilable{ func foo(a: username, b: sqlquery) { ... if (a == b) { ... } // error: cannot compare type username type sqlquery } xctassertuncompilable{ let user1 = username("joe") let selectallusers = sqlquery("select * users") user1 ==

OrientDB ETL: Looking for efficient work-around for lack of edge: skipDuplicates option -

i tried transformation { "edge" : { "class":"my_edge","skipduplicates":true } }...then noticed documentation had in of version 2.2. (4 releases now!?) i'm bit stuck on viable work-around. have single flat file i'm trying break out 5 different objects. (things have deal when data end users). i'd hoped skipduplicates option on vertex by-pass remaining transforms, no such luck. is there block or command work-around can use. don't think sql lookup work, since other edges batch not have been committed yet. by way, i've noticed when tried hack edge index, ended in kind of infinite loop... thanks assistance. update example -i'm using 2.1.8 here's basics of configuration { "transformers" : [ { "merge": { "joinfieldname":"document_id", "lookup":"article.document_id" } }, { "vertex": { "cla

xml - xmlns is not allowing the xslt to update a value -

so our data has xmlns= in child/parent stopping child's value being updated xslt sample data (please note intentionally removed xmlns="http://example.com/abc-artifact" second record, after <letter illustrate causing error) : <documents> <document xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <personaldata> <name>jack</name> </personaldata> <documentxml> <letter xmlns="http://example.com/abc-artifact" xsi:schemalocation="http://example.com/abc-artifact.xsd" xsi:type="lettertype"> <headerrecord> <dateofbirth>1971-11-07</dateofbirth> </headerrecord> </letter> </documentxml> </document> <document xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <personaldata>

r - Relative system path to miktex and pandoc - Shiny Application packaged as Windows desktop app -

i have packaged shiny application windows desktop app following following tutorial: http://www.r-bloggers.com/deploying-desktop-apps-with-r/ in shiny application provide user generate pdf report using pandoc , miktex. in order work in desktop application, have added following code in runshinyapp.r script. sys.setenv(path=paste("c:/users/woba/documents/dist/pandoc",sep=";", "c:/users/woba/documents/dist/miktex/miktex/bin/")) although works correctly, path relative application can distributed other users without them having change path. i've tried following - didn't work: sys.setenv(path=paste("./pandoc",sep=";", "./miktex/miktex/bin/")) folder structure following: dist/ + googlechromeportable + miktex + pandoc + r-portable + runshinyapp.r + run.bat anybody maybe nows how make path relative? (on windows) me lot! i managed provide relative path following code in runshinyapp.r script:

Azure Resource Manager - Multiple VM NAT Rules -

Image
i trying create arm template provision multiple webservers directly accessible ports. instance want vm have either port 9001 or 9002 open based on index of vm is. i struggling frontendport parameter accept function. here documentation have used. here relevant portion of template looks like: "inboundnatrules": [ { "copy": { "name": "natcopy", "count": "[parameters('numberofvms')]" }, "name": "[concat('directhttps-', copyindex())]", "properties": { "frontendipconfiguration": { "id": "[concat(variables('lbid'),'/frontendipconfigurations/loadbalancerfrontend')]" }, "frontendport": "[add(9001, copyindex())]", "backendport": 9001, "enablefloatingip": false, "idletimeoutinminutes": 4,

SQL Server - Table name as variable in query -

first, know has been addressed before - i've done research , you'll see below, have tried multiple versions work. i trying set query in variable can set , query uses variable. here's code: -- set category want check declare @validationcategory varchar = 'dept' declare @validationtable varchar = (select validationtable masterfiles..categories category = @validationcategory , tabletovalidate = 'xref') declare @validationfield varchar = (select validationfield masterfiles..categories category = @validationcategory , tabletovalidate = 'xref') exec(' select distinct category masterfiles.dbo.xref category = ''' + @validationcategory + ''' , (new_value not in (select ''' + @validationfield + ''' ' + @validationtable + ') , old_value not ''%new%'' or (new_value null or new_value = '''')) )' ) when run getting

vb.net - How can i describe buttons in matrix? -

i have 16*16 matrix , i'm trying define them matrix series in vb.net. make visual shows matrix led shows. dim n integer = 16 dim l integer = 16 dim x(n - 1, l - 1) integer dim i, j, k integer = 0 n - 1 j = 0 l - 1 k = 1 256 if j= k mod16 buton(k) = x(i, j) end if next next next*** i try apply algorithm. doesn't work. how can accomplish this? interests.. ok wrote while ago - i've adapted needs , runs ok on pc. need create array x this dim x(15,15) button to fill array buttons, use method.. private sub initializearray() dim btnslist new list(of button) dim btnnum integer dim btnname string dim splitbuttonname() string 'add buttons list each btncontrol object in controls dim btn button 'get button number , add list if >0 , <=256 if typeof btncontrol button btn = ctype

java - How to truncate the double value? -

this question has answer here: are there functions truncating double in java? 11 answers i want truncate double. e.g. double d=3.123456789087654; if want truncate 10th digit after decimal result should be result: 3.1234567890 i don't need round off value result i tried own function as static double truncatedouble(double number, int numdigits) { double result = number; string arg = "" + number; int idx = arg.indexof('.'); if (idx!=-1) { if (arg.length() > idx+numdigits) { arg = arg.substring(0,idx+numdigits+1); result = double.parsedouble(arg); } } return result ; } but didn't appropriate result want.. can please me clear problem. does java supports such function supports truncation not round off?? in general, can't, @ least not using

android - Show .txt file line by line in App Inventor 2 -

Image
i read txt file , show line line in app inventor 2 , don't know components/blocks use. something these choose .txt reading > show first line > press button > show second line this blocks try use , still no idea sorry, if didn't help ploy, can below: firstly, need create global empty list. next, global lineindex variable indicate number of lines shown. lastly, have configure maxindex number refer maximum lines in file. then, @ screen1.initialize call file1.readfrom function. can specify own file name. yet, please make sure saved in .csv format. contain of file such below: in example, i'm using 2 different buttons. 1 button read file , button reset global lineindex countdown. first image, can see in when read_button.click part, have set global lineindex countdown increase automatically 1 after read_button clicked. then, safety reason, have add check "if , else" statement. result_label show contain in file if lineindex c

c++ - Restart Poco HTTP Server -

i have implemented http server using poco-libraries. runs rest service , works fine. the http server runs daemon on linux system. now want implement functionality rest service restarts http server daemon itself. i use popen call shell command restart daemon. daemon restarts , can see via netstat -plten , ps -aux server gets new pid , listening on port 80. but not handle incoming http requests . if type shell command directly terminal, daemon restarts, gets new pid , handles incoming http requests. what wrong? edit i have tried calling shell command system(command); , std::thread(std::system,command).detach(); result same. i found solution. when creating poco::net::httpserver , create poco::net::serversocket go along it. need close socket before restarting daemon.

json - HTTP 415 unsupported media type error when calling Web API 2 endpoint -

Image
i have existing web api 2 service , need modify 1 of methods take custom object parameter, method has 1 parameter simple string coming url. after adding custom object parameter getting 415 unsupported media type error when calling service .net windows app. interestingly, can call method using javascript , jquery ajax method. the web api 2 service method looks this: <httppost> <httpget> <route("{view}")> public function getresultswithview(view string, ppaging paging) httpresponsemessage dim resp new httpresponsemessage dim lstrfetchxml string = string.empty dim lstrresults string = string.empty try '... work here generate xml string response '// write xml results response resp.content = new stringcontent(lstrresults) resp.content.headers.contenttype.mediatype = "text/xml" resp.headers.add("status-message", "query executed successfully") resp.statuscode = httpstatu

c# - Add Item to ListBox from TextBox -

i have listbox : <listbox x:name="playlistlist" alternationcount="2" selectionchanged="didchangeselection"> <listbox.groupstyle> <groupstyle /> </listbox.groupstyle> <listbox.itemtemplate> <datatemplate> <textblock text="{binding name}"/> </datatemplate> </listbox.itemtemplate> </listbox> and want add option add new item listbox . , want adding textbox listbox when user press button , user press enter , add text in textbox listbox . i try add text box listbox can add 1 type of listbox.itemtemplate , how can handle it? updated add textbox inside listbox: to add new item listbox, in button click code-behind do: textbox textboxitem = new textbox(); // set textboxitem properties here playlistlist.items.add(textboxitem);

angularjs - How can I create a login page using Ionic 2 framework that then leads to a tabbed view? -

currenty, in app.html file, have: <ion-tabs> <ion-tab [root]="tab1root" tabtitle="tab1" tabicon="time"></ion-tab> <ion-tab [root]="tab2root" tabtitle="tab2" tabicon="paper"></ion-tab> <ion-tab [root]="tab3root" tabtitle="tab3" tabicon="more"></ion-tab> </ion-tabs> and in app.js file, after doing proper imports of these pages, have: this.tab1root = page1; this.tab2root = page2; this.tab3root = page3; i want application open login page, , there progress tabbed view. i'm not sure how logically set in context of app.html , app.js i'm interested in answers involving ionic 2 (and angular 2.0), not older versions. in app, define this: export class yourapp { rootpage: type = loginpage; constructor(app: ionicapp, platform: platform) { platform.ready().then(() => { }); } } in login

ios - How to load data for UITableView from an API with pagination? -

i have api , when send request alamofire returns me, example, 500 records! cannot take of , use it. instead of did pagination on api, /page/1 , /page/2 , etc. but how can load data in uitableview? want show loading indicator when scroll uitableview, while data, , data partly, append main array. how can achieve this? or there solution it? can advice me? i searched lot it, of solutions in objective-c. found one: ios - how make tableview use paginated api output? but did not understand answer completely. variables there, not know means you need create uiactivityindicatorview , use scrollviewdidscroll(scrollview: uiscrollview) control data array private let serialqueue = dispatch_queue_create("mainvcloadingqueue", dispatch_queue_serial) override func scrollviewdidscroll(scrollview: uiscrollview) { delegate?.maincollectionviewdidscroll(scrollview) } func maincollectionviewdidscroll(scrollview: uiscrollview) { dispatch_sync(serialqueue, {

javascript - How does the simplied commonJS wrapper work in require.js under the hood? -

consider example website define(function (require) { var foo = require('foo'); //define module exporting function return function () { foo.dosomething(); }; }); my question is, 'foo' loaded asynchronously, how javscript below not execute before has loaded? this explained in http://requirejs.org/docs/api.html#cjsmodule , http://requirejs.org/docs/whyamd.html#sugar . require.js @ point (before running function) @ string representation of function, find require calls determine dependencies , load them. to make easier, , make easy simple wrapping around commonjs modules, form of define supported, referred "simplified commonjs wrapping": define(function (require) { var dependency1 = require('dependency1'), dependency2 = require('dependency2'); return function () {}; }); the amd loader parse out require('') calls using function.prototype.tostring() , internally c

variables - K&R C Chapter exercise int to float? -

section 1.3 of kernighan , ritchie uses following temperature conversion program introduce statements: #include <stdio.h> /* print fahrenheit-celsius table */ int main(){ int fahr; (fahr = 0; fahr <= 300; fahr = fahr + 20) printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32)); } what doesn't explain how program can make use of int variable produce float values without error. makes valid? don't variables in equation have of same type? i'm hesitant move forward without understanding this. the conversion implicit, enabling warnings should give message explaining int being converted double. here (5.0/9.0)*(fahr-32)) , double being multiplied int, , int converted double using usual arithmetic conversions. the types in arithmetic don't have match. c has whole chapter dedicated conversions: 6.3 conversions, 6.3.1 arithmetic operands.

javascript - Get an email from a string -

this question has answer here: extract email addresses text file using javascript 6 answers how validate email address in javascript? 65 answers a newbie here this problem let string var string = "this string contains many different words domain@gmail.com want email"; what want regex or different gets domain@gmail.com i've tried many things none has worked this last 1 i've tried var myregexp = /@(.*)/; var match = myregexp.exec(string); if(match) console.log(match[1]); this returns null or undefined can me out edit i want search before , after @ , stops on blank space thanks emails = str.match(/(\s[^\s@]*@\s+)/gi)

alter a table column and set identity from max existing in that column in sql server 2008 -

i have column maxcode name, in mytable filled before,now want alter column , set type identity start max number existing in column maxcode use below code reset seed value identity column declare @newseed numeric(10) select @newseed = max(maxcode) mytable dbcc checkident (mytable, reseed, @newseed)

Ignite running in Docker (is: General Java-Docker issue) -

i trying run ignite in docker container (mac os x, docker 1.9.1) committed in git: # start java image. java:7 # ignite version env ignite_version 1.5.0-b1 workdir /opt/ignite add http://www.us.apache.org/dist/ignite/1.5.0-b1/apache-ignite-fabric-1.5.0-b1-bin.zip /opt/ignite/ignite.zip # ignite home env ignite_home /opt/ignite/apache-ignite-fabric-1.5.0-b1-bin run unzip ignite.zip run rm ignite.zip # copy sh files , set permission add ./run.sh $ignite_home/ run chmod +x $ignite_home/run.sh cmd $ignite_home/run.sh after building locally apache/ignite , running image following command, container 'hangs' docker run --expose=4700-4800 -it -p 47500-47600:47500-47600 -p 47100-47200:47100-47200 --net=host -e "config_uri=https://raw.githubusercontent.com/apache/ignite/master/examples/config/example-default.xml" apacheignite/ignite-docker when connecting container ( docker exec -ti apache/ignite /bin/bash ) , running command in verbose mode via bash, hangs

c++ - why after the first push head is still null? -

i trying create singly-linked list. after first push, head still null . why head not updated after first push? using namespace std; typedef struct node { int data; // store information node *next; // reference next node }; void push(node*,int); void print(node*); int main() { node* head = null; //empty linked list push(head, 2); if (head == null) { cout << "vrvrvr"; } push(head, 3); push(head, 5); push(head, 2); //print(head); getchar(); return 0; } void push(node* x, int y){ node *temp = new node(); if (x == null) { // check linked list empty temp->next = x; temp->data = y; x = temp; } else { node *temp1 = new node(); temp1 = x; while (temp1->next != null) { // go last node temp1 = temp1->next; } temp1->next = temp; temp->data = y; temp->next = null; dele

c# - Creating Table in Azure Storage Emulator produces HTTP 500 Error -

i've been attempting create table through machine's azure storage emulator. can recreate problem simple program uses windowsazure.storage nuget version 6.2.0 : using microsoft.windowsazure.storage; namespace storageemulatortest { internal class program { private static void main(string[] args) { var cloudstorageaccount = cloudstorageaccount.parse("usedevelopmentstorage=true"); var cloudtableclient = cloudstorageaccount.createcloudtableclient(); cloudtableclient.gettablereference("johnnytest").createifnotexists(); } } } after 25 seconds, throw exception of type microsoft.windowsazure.storage.storageexception , message: the remote server returned error: (500) internal server error. i have attempted: ensuring windowsazure.storage nuget package latest version (6.2.0). re-installing azure sdk vs2015 2.8.1 (and ensuring it's latest version) stopping, clearing, initing azure

java - Letters in JTextPane are colored after delay -

i have simple text editor colours java key words blue. code: class mainpanel extends jpanel { private int width = 800; private int height = 500; private jframe frame; private jtextpane codepane = new jtextpane(); private styleddocument doc = codepane.getstyleddocument(); mainpanel(jframe frame) { this.frame = frame; setpreferredsize(new dimension(width, height)); setlayout(new borderlayout()); jscrollpane scroll = new jscrollpane(codepane); add(scroll, borderlayout.center); codepane.addkeylistener(new mainpanel.keyhandler()); codepane.setfont(new font("monospaced", font.plain, 15)); //loading key words.. //... } private class keyhandler extends keyadapter { @override public void keytyped(keyevent ev) { string code = codepane.gettext(); simpleattributeset set = new simpleattributeset(); styleconstants.setforegroun

bash/python script to retrieve nodes with given tag property -

the document.xml file looks following: <?xml version="1.0" encoding="utf-8"?> <document version="4"> <tool version="21.4"/> <notes> <note id="minor" message="dont forget"> <place file="path/to/filea" line="81"/> </note> <note id="major" message="quite well"> <place file="path/to/fileb" line="11"/> <place file="path/to/filec" line="67"/> </note> <!-- ... --> <note id="medium" message="keep going"> <place file="path/to/filef" line="789"/> <place file="path/to/filea" line="91"/> <!-- ... --> <place file="path/to/filek" line="6"/>

Best way to sort an array of data in PHP -

so have following data array: array (size=10) 0 => int 5 1 => string '5b1' (length=7) 2 => int 4 3 => string '4b1' (length=7) 4 => int 3 5 => string '3b1' (length=7) 6 => int 2 7 => string '2b1' (length=7) 8 => int 1 9 => string '1b1' (length=7) what want sort this: array (size=10) 0 => string 5b1 1 => int '5' (length=7) 2 => string 4b1 3 => int '4' (length=7) 4 => string 3b1 5 => int '3' (length=7) 6 => string 2b1 7 => int '2' (length=7) 8 => string 1b1 9 => int '1' (length=7) the hierarchy of numbers never change although there additional level seen here: 7 -> 6b2 -> 6b1 -> 6 -> 5b2 -> 5b1 -> 5 4b2 -> 4b1 -> 4 -> 3b2 -> 3b1 -> 3 -> 2b2 -> 2b1 -> 2 -> 1b2 -> 1b1 -> 1 -> b2 -> b1 i wondering best way sort in php? on 1 hand thinking of

actionscript - How to remove MovieClip by selecting a row and pressing a delete button? -

i have datagrid, rows added. whenever row added, movie clip added stage. added button remove row in datagrid if row , button clicked, , of works well. however, when try remove movie clip relating row in datagrid, not work. my code is: function removeloaditem(event:mouseevent) { datagrid.removeitemat(datagrid.selectedindex); removechild(movieclip(datagrid.selectedindex); } removechild(movieclip(datagrid.selectedindex); you need understand line of code trying do. datagrid.selectedindex this variable number. so, trying cast number movieclip. movieclip(1) that not work. need reference actual movieclip object. wherever creating movieclip object, need store reference object. can have plain object store of references. var objectlist:object = {}; and then, wherever creating movieclip, add line: objectlist["reference_" + datagrid.selectedindex] = "movieclip variable"; replace "movieclip variable" reference movieclip object. aft

Building Documentation for Nested projects with CMake -

i'm working on project contains other projects libraries using git submodules. these sub-projects under active development well, root cmake file run sub-project cmake files well. example project structure: current_project/ src/ include/ docs/ libs/ sub_module_1/ src/ include/ docs/ sub_module_2/ src/ include/ docs/ sub_module_3/ src/ include/ docs/ src/ the actual building portion works fine. in of sub projects, custom target docs used generate documentation. since there multiple docs targets defined each subproject, cmake complains. don't have control on sub-projects, , therefore cannot edit cmake files those. there way to, without editing sub-projects (as changes overwritten when git update), either have cmake combine commands each sub-project , run of them, or have generate prefix (probably project name) docs targ

google cloud dataflow - Are template tables supported in BigQuery for bulk import? -

there several options loading data bigquery : e.g. bulk import gcs , streaming , others. in many cases, 1 needs shard data being loaded, e.g. date, or arbitrary key, in order produce smaller tables faster query, or around per-table import quotas. recently, new feature introduced, template tables , makes such sharding easy streaming: specify suffix of table name want stream to, on per-record basis. is bigquery feature available other import modes, importantly import gcs? useful importing large amounts of data bigquery in sharded way, common use case e.g. when using cloud dataflow batch jobs. no, template tables not available bulk import @ time; rationale since bulk import can create tables side-effect, wouldn't necessary. for streaming imports, semantics bit trickier. since streaming insert requests don't specify schema, if destination table doesn't exist, bigquery doesn't know desired schema of table should be. template tables allow streaming syste

openerp - How can I send a list of all Open invoices for a partner in an email template? -

how can send list of open invoices partner in email template? there way list invoices partner in email template?, need sent single message every customer have, how can that?, sent message per invoice... time... you can go below way : 1. create email template : create new email template using email.template model , set invoice method call using object.your_global_method_name() using res.partner model hear object global entity object res.partner single tone obejct. 2. added new method on res.partner model: create new method compute open invoices , helpful method in scheduled action call. 3. create scheduled action : which helpful make automated action remaining open invoice checking.you can set interval unit per need , make add method call created in res.partner model. 4. call method on scheduled action : ever method created in res.partner method called on scheduled action call. 5. not forgot set outgoing email configuration , add email setting on each pa

regex - Problems with basic python syntax for regular expressions -

i'm studying bio-informatics exam there things professor did don't understand. i've tried looking can please explain in non-programmer language? have tried looking things understand i'm bit clueless.my questions this; import re line = "cats smarter dogs" matchobj = re.match(r'(.*) (.*?)*',line,re.m|re.i) if matchobj: print("matchobj.group():",matchobj.group()) print("matchobj.group():",matchobj.group(1)) print("matchobj.group():",matchobj.group(2)) my questions: what (.*) do, i'm guessing you're trying match 'cats' why don't type cats? understand . means 'any character' don't understand * does what combination (. ?) ' do? what re.m|re.i do? thanks mutch! i'm starting become bit desperate. mind doesn't work in right way understand kind of things think. i'll give first one, these are easy regex ever see out there in wild :) . character * un

bash - Programmatically feed parameters to sed -

say have bash script, first parses parameters/files. result, script generates following string: args="-e 's/\\\$foo\\b/bar/gi' -e 's/\\\$baz\\b/qux/gi'" now want feed resulting string ( -e 's/\$foo\b/bar/gi' -e 's/\$baz\b/qux/gi' ) sed in order perform search , replace on instance following file: hello $foo, hello $baz if 1 uses sed -e 's/\$foo\b/bar/gi' -e 's/\$baz\b/qux/gi' , returns: hello bar, hello qux if 1 calls: sed $args it gives error: sed: -e expression #1, char 1: unknown command: `'' how can programmatically feed sequence of parameters sed ? avoid crazy escaping , declare args variable shell array: args=(-e 's/\$foo\b/bar/gi' -e 's/\$baz\b/qux/gi') and use in sed as: s='hello $foo, hello $baz' echo "$s" | sed "${args[@]}" hello bar, hello qux

jquery - Only first item display when applying CSS on navigation -

i have tried following code navigation in retrieving category names , subcategories mysql database table. problem when don't apply css it. shows subcategories under relevent category. when applied css code shows first relevant subcategory name on hover category name. here code , css. stuck , can't understand doing wrong. suggestions please. $(function() { if ($.browser.msie && $.browser.version.substr(0,1)<7) { $('li').has('ul').mouseover(function(){ $(this).children('ul').show(); }).mouseout(function(){ $(this).children('ul').hide(); }) } }); body { width: 960px; margin: 40px auto; } /* main menu */ #menu { width: 100%; margin: 0; padding: 10px 0 0 0; list-style: none; background: #111; background: -moz-linear-gradient(#444, #111); background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #111),color-stop(1, #444)); background: -webk

jsf - p:chart is not visible -

i want display 2 charts in primefaces. i using bootstrap 1.0.10, primefaces 5.3 , tomcat 7. the strange thing is, chart rendered, user isn't able see it. stats.xhtml <ui:define name="content"> <div> <p:panel id="panel" header="statistik" style="margin: 20px;"> <p:chart type="pie" model="#{statistikbean.chartmodel1}" style="width:400px; height:300px" /> <p:chart type="metergauge" model="#{statistikbean.chartmodel2}" style="width:400px; height:250px" /> </p:panel> </div> </ui:define> statistikbean.java .... private piechartmodel chartmodel1; private metergaugechartmodel chartmodel2; @postconstruct public void init() { domodels(); } private void domodels() { this.chartmodel1 = new piechartmodel(