Posts

Showing posts from July, 2010

osx - Signing Applescript Application So It Doesn't Ask For Password -

i have applescript application wrote modifies network settings connect me vpn provider. problem: asks me password every time want run it. hopeful solution: runs without asking password. (************************ run *************************) on run #{vpnconfiguration} set rand_vpn random_vpn() set vpnconfiguration pick_vpn(rand_vpn) # returns list 1 item set vpnconfiguration item 1 of vpnconfiguration # selects item list connect_vpn(vpnconfiguration) end run (******************** random vpn **********************) on random_vpn() set rand_vpn item of {"us-cali", "us-west", "us-east", "us-midwest", ¬ "us-texas", "us-flordia", "us-seattle", "us-siliconvallay", "us-newyorkcity"} return rand_vpn end random_vpn (********************* pick vpn ***********************) on pick_vpn(rand_vpn) set vpnconfiguration choose list {¬ "us-cali...

c++ - VS2015 Additional Include Directories not finding included header? -

Image
the question title says all. here project settings addition include directories. here current program #include <curses.h> int main() { initscr(); /* start curses mode */ printw("hello world !!!"); /* print hello world */ refresh(); /* print on real screen */ getch(); /* wait user input */ endwin(); /* end curses mode */ return 0; } here errors. and curses.h file in include folder anyone might have clue went wrong? try use #include "curses.h" , instead of #include <curses.h>

angularjs - Semantic ui search module -

i using semantic ui search module, content remote json file, can make work no matter typed whether found or not, show list json file. script $('.ui.search') .search({ apisettings: { url: 'http://localhost/api/materialmaster.json' }, fields: { results : 'data', title : 'matcode' }, mincharacters : 2 }) ; json file format is {"data":[{"matcode":"0a66244s1"},{"matcode":"200gd0s100150cm"}]} see if can help. had same problem , solved using instructions. https://stackoverflow.com/a/32937262/5381965

html - What will be the basic JavaScript code for a button? -

Image
i need button shows me date below when use hover mouse on , hides when hover mouse out. in picture below: you can read more event handling in javascript https://developer.mozilla.org/en/docs/web/api/eventtarget/addeventlistener , fiddle little. have declare 2 listeners on button, 'mouseenter' , 'mouseleave' event types (1st argument of addeventlistener), , use algorithms of choice executed in listener functions (2nd argument of addeventlistener).

dynamic - How to create a new entity with fields in CRM programatically -

i want create new entity named "record" fields approvalstatus, pendingwith. how can create programatically part of solution can deploy higher environments i able find links creating new entity items , want create new entity i have create few entities record,management etc , need create views, forms these best approach this? using crm 2016 you can use metadata web service manipulate crm metadata , create entities, attributes. looking functions createentityrequest . however if looking move components between environments better served using solutions explicitly purpose

mongodb - mongorestore error: "Failed: error connecting to db server: no reachable servers" -

i'm working through book "getting mean," mean stack tutorial. i'm creating sample app , deploying heroku. i'm stuck @ point i'm trying push data local mongo database mlab heroku addon. i able create mlab database no problem. created mongodump in temp folder. retrieved mlab uri with: heroku config:get mongolab_uri so far good. next step push data temp folder mlab database command (populated real values mongolab uri, of course): mongorestore -h <db server:port> -d <db name>7 -u <username> -p <password> <path temp folder> but when run that, get: failed: error connecting db server: no reachable servers i searched through documentation on mlab , heroku , forum getting mean book itself, , wasn't able find helpful. thanks in advance! i had same problem (also while following 'getting mean' , solved taking database name out of host name: when mongodb_uri, after @ host name database name slashed afte...

logic - Converting Normal Form to CNF -

in cs logic class have convert normal form boolean expressions cnf, kind of stuck on one. ¬(¬p => (p => q)) which is: ¬(¬p => (¬p or q)) implication elimination ¬(¬¬p or (¬p or q)) implication elimination ¬(p or (¬p or q)) double negation ¬p , ¬(¬p or q)) demorgan's ¬p , (¬¬p , ¬q)) demorgan's ¬p , (p , ¬q)) double negation the next step distribute or on and, there aren't or distribute. once reach ¬(p or (¬p or q)) double negation you have ¬((p or ¬p) or (p or q)) distribution ¬(true or (p or q)) excluded middle ¬(true) null element of or false obviousness :p

Does AMD processors use hyperthreading internally? -

yesterday had argument friend stated amd processors using hyperthreading it's 8 core processors. knowledge there 8 cores on 1 chip , share memory l3 cache. so, what's this? can more knowledge explain that's about? ht allows 2 process' contexts share functional blocks of 1 core in same time (to utilize these blocks effective possible) that's why number of physical processors in os = ht cores number * 2. amd processors doesn't have equivalent, have more small cores. current architecture known "symmetric multithreading" (smt) cpu consists of number of processing blocks , each block has 2 cores (which share l2 cache , logic)

css - Can you put a link in an accordion or not? -

i've installed simple css accordion, , works fine. i've heavily adapted one: http://codepen.io/pollardld/pen/lthaf (actually, 1 similar although don't have source address). question: there's text @ top (closed position) click , opens. want that, want put text @ left (the site name , link) link , not open accordion. possible, though (without using absolute-positioned link overlayed z-index, fallback if no experienced coder here knows cleaner, cheaper solution. thanks reference code (not necessary question required stack because linked codepen: <h3>accordion</h3> <div class="accordion"> <!-- span target fix closing accordion --> <span class="target-fix" id="accordion"></span> <!-- first accoridon option --> <div> <!-- span target fix accordion --> <span class="target-fix" id="accordion1"></span> <!-- link open accordion, hidden when open...

cq5 - Hide Workflow from SiteAdmin -

we have requirement in our project want hide workflows in siteadmin. using aem 6.1. please let know if has solution. highly appreciated. thanks, tushar using user permissions this can controlled user permissions. permissions can updated in useradmin console remove read permission workflow models want not shown user. permissions can managed via groups please note there 2 workflow models schedule activation/deactivation, read access required these in case want user able use "activate/deactivate later" ootb functionality in siteadmin/damadmin console. these 2 anyways not shown in workflow list while initiating workflow siteadmin/damadmin console, should take care while removing read permissions. this solution verified. using model changes model can updated make system workflow refer adobe forum link . verify 1 day care see if there side effect.

python - parse xml file and output to text file -

trying parse xml file (config.xml) elementtree , output text file. looked @ other similar ques here none helped me. using python 2.7.9 import xml.etree.elementtree et tree = et.parse('config.xml') notags = et.tostring(tree,encoding='us-ascii',method='text') print(notags) output traceback (most recent call last): file "./python_element", line 9, in <module> notags = et.tostring(tree,encoding='us-ascii',method='text') file "/usr/lib64/python2.7/xml/etree/elementtree.py", line 1126, in tostring elementtree(element).write(file, encoding, method=method file "/usr/lib64/python2.7/xml/etree/elementtree.py", line 814, in write _serialize_text(write, self._root, encoding) file "/usr/lib64/python2.7/xml/etree/elementtree.py", line 1005, in _serialize_text part in elem.itertext(): attributeerror: > 'elementtree' object has no attribute 'itertext' instead of tree (...

html - Cakephp HtmlHelper for images not picking-up images from webroot -

i have cakephp (2.7.0) installed on wamp. images located under app/webroot/img. in view have following: <?php echo $this->html->image( 'img2.gif', array('alt' => 'img2')); ?> when img element renders "src" set /app/img/img2.gif instead of /app/webroot/img/img2.gif. missing?

c# 4.0 - Jquery script changes are not working in IE 11 browser after deploying using IIS -

i have made changes in 1 of script file in project developed in c#.net(it developed in .net 4.0) .when tested in localhost working fine.after deploying modified file using iis changes not reflecting in ie 11 able see reflected changes in ie 9 , google chrome.please me this.

how to Gujarati Number Sum datagridview row in c# -

Image
i can not sum of datagridview row. can sum english numbers complete gujarati number can't sum. there can several ways achieve this. 1 of them might add hidden column corresponding english number value, sum , convert result in gujarati number.

database - Include table name in column from select wildcard sql -

is possible include table name in returned column if use wildcard select columns tables? to explain further. suppose want join 2 tables , both tables have column name “name” , many other columns. want use wildcard select columns , not explicitly specifying each column name in select. select * tablea a, tableb b a.id = b.id instead of seeing 2 column same name "name", write sql return 1 column name "a.name" (or tablea.name) , 1 "b.name"(or tableb.name) without explicitly putting column name in select? i prefer solution mssql other database reference too. thanks! you joining 2 tables on id field, see 1 column labeled "id", not two, because asking see records id same in table , table b: share same id.

Grouping together a list in python -

i trying group self.l list groups of 5 , reverse both individual groups want output follows step1.(group list 2 section of five) [[1,3,5,67,8],[90,100,45,67,865]] step2.(reverse numbers within 2 groups) [[8,67,5,3,1],[865,67,45,100,90]] the code have class flip(): def __init__(self,answer): self.answer = answer self.matrix = none self.l = [1,3,5,67,8,90,100,45,67,865,] def flip(self): if self.answer == 'h': def grouping(self): in range(0, len(self.l), 5): self.matrix.append(self.l[i:i+5]) print(self.matrix) if __name__ =='__main__': ans = input("type h horizontal flip") work = flip(ans) work.flip() when run code output is none to create nested lists 5 elements in each one, can use list comprehension : lst = [1,3,5,67,8,90,100,45,67,865] new_list = [lst[i:i+5] in range(0, len(lst), 5)] then...

python - What are equality operators and how many are there? -

are these operators in python or there more? ==, !=, >=, <= operators in python docs the equality operators ones = sign before them, yes ones :) but if ever unsure of regarding syntax or usage best bet python docs, it's available offline quick press on f1 in idle being on internet.

JavaScript Boolean Values -

am setting boolean values right? because it's not working me. basically, on website, want 1 alert message popping (starting earliest pop later one) until fields have been checked. example: 1) validate pizza size (user selected pizza size) 2) validate toppings (user did not select pizza size) 3) validate text area (user did not select pizza size) result: pop #2 comes stating "select jalapeno!" , not pop #3 (if makes sense) here javascript: http://pastebin.com/6c2cxu5x it's javascript... pizzasizeelement.value = "" to compare, should be: pizzasizeelement.value == "" or if want ensure comparing of same type (string) then: pizzasizeelement.value === ""

calculated columns - Cross table in Spotfire -

Image
*update based on ksp's answer (thank that, looking for.) can me following problem. given data table: key rec period dow category value key1 rec1 period1 dow1 kpia x1 key1 rec2 period1 dow1 kpib z1 key1 rec3 period2 dow1 kpia y1 key2 rec4 period1 dow1 kpia x1 key2 rec5 period1 dow1 kpib z1 key2 rec6 period2 dow1 kpia y1 key1 rec7 period1 dow2 kpia x2 key1 rec8 period1 dow2 kpib z2 key1 rec9 period2 dow2 kpia y2 key2 rec10 period1 dow2 kpia x2 key2 rec11 period1 dow2 kpib z2 key2 rec12 period2 dow2 kpia y2 key1 rec13 period1 dow1 delta d1 key1 rec14 period1 dow2 delta d2 key2 rec15 period1 dow1 delta d3 key2 rec16 period1 dow2 delta d4 in spotfire, possible create following cross table: avg(kpia) avg(kpib) delta per...

mongoose - Mongodb error "failed to use text index to satisfy $text query" -

i'm trying use fulltext search. setting index in way myrootschema.index({ "_type": 1, "$**": "text" }); where _type discriminatorkey , myrootschema father schema of 4 inherited schemas. i error { "name": "mongoerror", "message": "error processing query: ns=mydb.casenotestree: text : query=title, language=english, casesensitive=0, diacriticsensitive=0, tag=null\nsort: {}\nproj: {}\n planner returned error: failed use text index satisfy $text query (if text index compound, equality predicates given prefix fields?)", "waitedms": 0, "ok": 0, "errmsg": "error processing query: ns=mydb.casenotestree: text : query=title, language=english, casesensitive=0, diacriticsensitive=0, tag=null\nsort: {}\nproj: {}\n planner returned error: failed use text index satisfy $text query (if text index compound, equality predicates given prefix fields?)", "code": 2 } tryi...

java - Create folder with UI Google Drive Android -

i want able choose and/or create new folder in google drive using ui user , save folder id later use. right i'm using: intentsender intentsender = drive.driveapi .newopenfileactivitybuilder() .build(mgoogleapiclient); try { log.d(tag, "startar ui"); startintentsenderforresult( intentsender, 5, null, 0, 0, 0); } catch (intentsender.sendintentexception e) { log.i(tag, "failed launch file chooser."); } } it works it's not ideal purpose. other newactivitybuilder find createfile have same problems. is there workarounds making work? use extra_response_drive_id driveid result.( https://developers.google.com/android/reference/com/google/android/gms/drive/openfileactivitybuilder.html#extra_response_drive_id ) @override protected void onactivityresult(int requestcode, int resultcode, intent data) { switch (requestcode) { case 5: if (resultcode == result...

c - Comparing numbers of bits per position in two lists of integers -

i have run problem can circumvent arranging algorithm differently, it's quite interesting , maybe 1 of has idea. the situation follows: have 2 lists of unsigned long integers, both lists have same size, , if helpful can assume size power of two. size of these lists in range of several hundred. want compute integer has set bit in every position in first list has more set bits second list. speed everything. simplified example: list1 list2 1010 0101 1111 0000 1100 0011 1010 0101 result: 1010 because of 4>0, 2<=2, 3>1, 1<=3 edit: alternative arrangement of data result in bit vectors contain bits of position in several different vectors. in case use bit counting algorithm , compare, amount less 30 operations per 64 bits in both lists. have matrix of bits , can use bit vectors columns or rows. additional structure: john willemse's comment made me realise calculate third list, these 3 lists complement each other bitwise. though don't see...

sql - error getting in procedure -

i trying build dynamic query page compression, @ time of execution showing error. alter procedure usp_findtablenameinalldatabase @dbname varchar(256) declare @tablename varchar(256) declare @varsql varchar(512) declare @gettablename cursor set @gettablename = cursor select tablename table_list open @gettablename fetch next @gettablename @tablename while @@fetch_status = 0 begin set @varsql = 'use ' + @dbname + ' alter table '+@tablename+' rebuild partition = (data_compression = page )' exec (@varsql) fetch next @gettablename @tablename end close @gettablename deallocate @gettablename go exec usp_findtablenameinalldatabase '[adventureworks2014]' go which giving error: msg 16943, level 16, state 4, procedure usp_findtablenameinalldatabase, line 50 could not complete cursor operation because table schema changed after cursor declared. how solve this??? declare @pagesize int, @pagenumber int, @firstrow int...

c# - Issue with Partial View name -

Image
hi stuck in code don't no whats wrong have done. getting in error block. this function call function getdocumenttlist(fid, cid) { var furl = "/claimedit/alldocumentlist"; if (fid && cid) { $.ajax({ type: 'get', url: furl, datatype: "html", async: false, data: { "folderid": fid, "claimid": cid, "page": 1 }, contenttype: "application/json; charset=utf-8", success: function (result) { $('#partialdivdocumentlist').html(result); $('#partialdivdocumentlist').css('display', 'block'); //....now update navigation list start. $.ajax({ type: 'get', url: '/claimedit/navigationlist', datatype: "text", async: false...

java - Inflate different menu depending on boolean condition -

Image
i have favourites feature users can add favourite recipes , remove them afterwards. have menu item on actionbar can perform these 2 actions. have 2 different menus this. when fragment recipe page displayed, check performed see if recipe has or has not been favourited user. if has been favourited, "delete" icon should appear, if has not, "add favourites" icon should appear. however, when test loading favourited recipe page, "add favourites" button displayed this: but when switch tab , switch back, correct delete icon displayed. why not displaying correct menu on first attempt? ingredientsfragment.java boolean exists; @override public void oncreateoptionsmenu(menu menu, menuinflater inflater) { menu.clear(); super.oncreateoptionsmenu(menu, inflater); session = new sessionmanager(getactivity()); new checkfavourite().execute(); getexistence(); if (session.isloggedin()) { if (exists){ inflater....

Setting the version number for .NET Core projects -

what options setting project version .net core / asp.net core projects? found far: set version property in project.json . source: dnx overview , working dnx projects . seems set assemblyversion , assemblyfileversion , assemblyinformationalversion unless overridden attribute (see next point). setting assemblyversion , assemblyfileversion , assemblyinformationalversion attributes seems work , override version property specified in project.json . for example, including 'version':'4.1.1-*' in project.json , setting [assembly:assemblyfileversion("4.3.5.0")] in .cs file result in assemblyversion=4.1.1.0 , assemblyinformationalversion=4.1.1.0 , assemblyfileversion=4.3.5.0 is setting version number via attributes, e.g. assemblyfileversion , still supported? have missed - there other ways? context the scenario i'm looking @ sharing single version number between multiple related projects. of projects using .net core (project.json), oth...

Error in Insert into statement in vb.net queries -

i tried match query earlier posts not able resolve problem. i have table user_master importing permission_id , zone_id other tables key. date in short format. cmd.commandtext = "insert user_master(uname, password, creation_date, creation_time, permission_id, zone_id)" & "values('" & txtuname.text & "','" & txtupass.password & "','" & date_gl & "','" & time_gl & "','" & _user_perm & "','" & _zone_id & "')" cmd.executenonquery() the primary key autonumber, creation_date/time executed in other query , permission_id , zone_id numbers. other fields texts. tried several permutations , combinations altering query (removing quotes etc.) field count same. please let me know parameter executing wrong? same case for, cmd.commandtext = "update user_master set uname = " & ""...

c# - Changing the stored value in a textbox -

my winform capable of storing values entered textbox, when appropriate node selected on treeview, these values return text box entered into. however, i'm having issue in trying amend program user can on write value have stored. this how set @ moment: private void tagtextbox_textchanged(object sender, eventargs e) { _screentag = tagtextbox.text; if (_selectednode > -1) { node n = _nodelist[_nodelist.count - 1]; n.tag = _screentag; } } the above method first stores value entered tagtextbox. next pass dictionary contains list of nodes (custom class , not confused treeview node, sorry): foreach (keyvaluepair<string, entry> pair in n.nodedictionary) { if (pair.key == "tag ") { tagtextbox.text = (string)pair.value.value; } } the above method gets called when node (not class node, tree node (sorry if thats confusing) ) on treeview selected. brings stored value , re-enters proper textbox. n...

emoji - How to add the emojicon library in chatting android application? -

i 'm using library rockerhiue emojicon tell me programming step step. there enough examples on github or check out . it's written in chinese. prepared

c# - Visual Studio - UWP Designer doesn't "render" -

Image
= the wpf designer works expected, happening uwp projects. have tried setting target platform 10240, no difference. i'm running latest insider preview build 14279. any ideas on why happening , how fix it? i can't quite see code, can assume, you're missing styles <button /> you're trying render, that's why looks it's "invisible" (in screenshots seems designer running ok, no exceptions thrown or of likes.

give relative path in javascript file in asp.net folder -

Image
i trying use relative path in javascript json file placed in asp.net folder structure. file using d3.json() . have used below code d3.json("../resources/flare.json", function (error, root) { ...some code; }); here directory structure: unfortunately, not working. i getting error :cross origin requests supported protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

java - check for annotation type @transient -

i want skip fields annotadet @transient in query builder. something if(!fcol.annotationtype().equals(@transient){ } somebody have idea? reflections reflections = new reflections(packagename); reflections.getfieldsannotatedwith(javax.persistence.transient.class))

matrix - nested loop don't go inside each element c# -

here part of wrote: double[,] visualmatrix = new double[3, m_descriptor.visualword.length]; (int i=0; i<3; i++) { (int j=0; j<m_descriptor.length; j++) { visualmatrix[i, j] = (m_descriptor.visualword[j].tf) * (m_descriptor.visualword[j].idf); system.diagnostics.debug.writeline(visualmatrix[i, j]); } console.writeline(); } what want visual matrix in case, fill visualmatrix[0,0] till visualmatrix[2,29] since m_descriptor.length 29. done fills first element of each i: visualmatrix[0,0],visualmatrix[1,0],visualmatrix[2,0]. as consider, have missed .visualword in statement. change j<m_descriptor.length j<m_descriptor.visualword.length double[,] visualmatrix = new double[3, m_descriptor.visualword.length]; (int i=0; i<3; i++) { (int j=0; j<m_descriptor.visualword.length; j++) { visualmatrix[i, j] = (m_descriptor.visualword[j].tf) * (m_descriptor.visualword[j].idf); ...

javascript - Null in not an object (evaluation itemText.style) -

in to-do list, trying strike through item checked off, receiving error - "null in not object (evaluating 'itemtext.style')" can explain how should alter make strike-through work? i'm trying avoid putting css in html file, if possible. function removeitem() { var boxid = this.id.replace("boxid_", ""); var itemtext = document.getelementbyid("item_", + boxid); itemtext.style.setproperty("text-decoration", "line-through"); //error here } function addnewitem(list, itemtext) { totalitems++; var listitem = document.createelement("li"); var checkbox = document.createelement("input"); checkbox.type = "checkbox"; checkbox.id = "cb_" + totalitems; var span = document.createelement("span"); span.id = "item_" + totalitems; span.innertext = itemtext; checkbox.onclick = removeitem; listitem.appendchild(chec...

How to maintain checkbox selected after navigation through different pages in jsgrid through jquery? -

unable maintain data or (checkbox selection) after page navigation? or can example:i on page 1 of jsgrid , have checked 2 rows using check box available on row , navigate second page , again come first 1 selection lost. add field on data item track checkbox state. in itemtemplate restore value on each rendering. { name: "fieldname", align: "center", itemtemplate: function(value, item) { return $("<input>").attr("type", "checkbox") .attr("checked", value || item.checked) .on("change", function() { item.checked = $(this).is(":checked"); }); } } here working fiddle http://jsfiddle.net/tabalinas/xo1npabw/ as alternative can store checkbox state in separate array in demo "batch delete" on demo page .

python - How to run Flask with Gunicorn in multithreaded mode -

i have web application written in flask. suggested everyone, can't use flask in production. thought of gunicorn flask . in flask application loading machine learning models. these of size 8gb collectively. concurrency of web application can go upto 1000 requests . , ram of machine 15gb. best way run application? you can start app multiple workers or async workers gunicorn. flask server.py from flask import flask app = flask(__name__) @app.route("/") def hello(): return "hello world!" if __name__ == "__main__": app.run() gunicorn gevent async worker gunicorn server:app -k gevent --worker-connections 1000 gunicorn 1 worker 12 threads: gunicorn server:app -w 1 --threads 12 gunicorn 4 workers (multiprocessing): gunicorn server:app -w 4 more information on flask concurrency in post: how many concurrent requests single flask process receive? .

Force maven update -

i imported working project on other computer started download dependencies. apparently in meantime internet connection crashed. get: build errors comics; org.apache.maven.lifecycle.lifecycleexecutionexception: failed execute goal on project comicstest: not resolve dependencies project comicstest:comicstest:war:0.0.1-snapshot: following artifacts not resolved: org.springframework:spring-context:jar:3.0.5.release, org.hibernate:hibernate-entitymanager:jar:3.6.0.final, org.hibernate:hibernate-core:jar:3.6.0.final, org.hibernate:hibernate-commons-annotations:jar:3.2.0.final, org.aspectj:aspectjweaver:jar:1.6.8, commons-lang:commons-lang:jar:2.5, mysql:mysql-connector-java:jar:5.1.13: failure transfer org.springframework:spring-context:jar:3.0.5.release http://repo1.maven.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or updates forced. original error: not transfer artifact org.springfra...

Using the returned value of sum aggregation - elasticsearch -

i made query sum "practicevalue" doubles. { "size" : 0, "query" : { "bool" : { "must_not" : [ { "missing" : { "field" : "practiceobj.practicevalue" } } ], "must" : [ { "match" : { "entityobj.description" : "first" } } ] } }, "aggs" : { "total" : { "sum" : { "script" : "(doc['practiceobj.practicevalue'].value)" } } } } my query returned following: { "took": 32, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total...

javascript - How to find selected path on svg image in xamarin forms -

i'm using c# library in i'm unable select path of svg image. i'm developing hybrid mobile application, using xamarin.forms platform have display svg image , have highlight selected parts. so, have added svg nuget package. svg image working fine but, unable find selected parts. can please me? var svgpaths = new list<string> { "sampleapp.images.sample1.svg", }; var grid = new grid { rowdefinitions = new rowdefinitioncollection(), columndefinitions = new columndefinitioncollection() }; var svgpath = svgpaths[0]; var svgimage = new svgimage { svgpath = svgpath, svgassembly = typeof(app).gettypeinfo().assembly, heightrequest = 400, widthrequest = 400, horizontaloptions = layoutoptions.center, verticaloptions = layoutoptions.center, backgroundcolor = color.white }; grid.children.add(svgimage);

javascript - Client side scripting. e.g. validating a form and need it to only accept a "/" or numbers for expiry date. -

anyway i've tried pretty hard i'm still struggling. essentially need validate form assignment. i need make sure email format valid, assume includes ".", "@", numbers , letters. i need make sure 1 part of form accepts alpha numeric characters i need make sure @ least 1 box has been ticked and said in title, make sure expiry date box accepts "/" or numbers. any or tips hugely appreciated because i'm absolutely stuffed right now. thanks. validating email <input pattern="/^[a-za-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-za-z0-9-]+(?:\.[a-za-z0-9-]+)*$/" required /> i need make sure 1 part of form accepts alpha numeric characters <!doctype html> <html> <head> <title>validate</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <style> .widefat-main{ } ...

ios - Issue with JSQMessages Displaying Test Messages -

Image
when add multiple test messages, 2 of them displaying on screen. other messages there because can copy them, colors not showing. when scroll around, new 2 texts appear, still two. below show examples. first screenshot shows when screen first loads. second shows when move around. third shows other messages exist not visible. ideas on how fix this? also, how make names appear? there guide doing in swift? here code used: var messages = [jsqmessage]() var incomingbubbleimageview = jsqmessagesbubbleimagefactory.incomingmessagebubbleimageviewwithcolor(uicolor.jsq_messagebubblelightgraycolor()) var outgoingbubbleimageview = jsqmessagesbubbleimagefactory.outgoingmessagebubbleimageviewwithcolor(uicolor.jsq_messagebubblegreencolor()) override func viewdidload() { super.viewdidload() self.sender = uidevice.currentdevice().identifierforvendor?.uuidstring messages += [jsqmessage(text: "hello", sender: self.sender)] messages += [jsqmessage(text: ...

javascript - Can Sikuli observe changes in mouse pointer? (responsive vs non-responsive mouse) -

i controlling windows gui sikuli (sikuli 1.1.0 , windows 7). annoying thing wizard sometimes needs ages load next stage of wizard , @ instances sikuli script crashes because not wait it. during these lag times spinning windows circle mouse. worse, happens "next" button appears (the 1 waiting sikuli) mouse not ready yet click , still in spinning circle mode 20-30s. not want specify 30s wait times @ every stage in wizard because unnecessarily , massively slow down script execution; because of time not need it. there similar issue reported here: how sikuli wait until mouse pointer changes "busy" "not busy?" i wondering whether there update issue? can sikuli recognize if mouse still in spinning-circle non-responsive mode , wait until mouse normal? i don't believe sikuli supports functionality, can work around this, in way. use exact matches, you'll have loop until field trying type has changed blank field text in it(or whatever e...

c# - Get the list of Roles in ASP.NET MVC -

i have following methods list of roles stored in aspnetroles [allowanonymous] public async task<actionresult> register() { //get list of roles viewbag.roleid = new selectlist(await rolemanager.roles.tolistasync(), "name", "name"); return view(); } then in view follows <div class="form-group"> <label class="col-md-2 control-label"> select user role </label> <div class="col-md-10"> @foreach (var item in (selectlist)viewbag.roleid) { <input type="checkbox" name="selectedroles" value="@item.value" class="checkbox-inline" /> @html.label(item.value, new { @class = "control-label" }) } </div> </div> but once load page i'm getting object reference not set instance of object...

Unknown memory leak form delphi xe8 -

i created simple application button on form tform1 used create form tform2. form2 contains toolbar 2 buttons @ each corner , label tabcontrol below it. keep getting memory leak below. im sure created , destroyed forms correctly. screenshot of error program project1; uses system.startupcopy, fmx.forms, unit1 in 'unit1.pas' {form1}, unit2 in 'unit2.pas' {form2}; {$r *.res} begin reportmemoryleaksonshutdown := true; application.initialize; application.createform(tform1, form1); application.run; end. here form1 creates form2 unit unit1; interface uses system.sysutils, system.types, system.uitypes, system.classes, system.variants, fmx.types, fmx.controls, fmx.forms, fmx.graphics, fmx.dialogs, fmx.controls.presentation, fmx.stdctrls, unit2; type tform1 = class(tform) button1: tbutton; procedure button1click(sender: tobject); private { private declarations } public { public declarations } end; var form1: tform...

php - Write file after extract data -

i need piece of code. i'm working on customers list of club, can extract email address , print them on screen, can't write them txt. here's code: <?php if ( $_post ){ function extract_emails($str) { $regexp = '/([a-z0-9_\.\-])+\@(([a-z0-9\-])+\.)+([a-z0-9]{2,4})+/i'; preg_match_all($regexp, $str, $m); return isset($m[0]) ? $m[0] : array(); } $xurl = $_post['testo'];// there input field $doc = new domdocument(); @$doc->loadhtmlfile($xurl); $xpath = new domxpath($doc); $wpage = $xpath->query('//body[@*]'); print_r(extract_emails($wpage->item(0)->nodevalue)); $scrivi=fopen("emails.txt","a"); fwrite($scrivi,need here."\n"); fclose($scrivi); } ?> everytime , try output found in file "array". [solved] @jdo, i've solved way: $mail = (extract_emails($wpage->item(0)->nodevalue)); $result = var_export($mail, true); echo $result ; $scrivi=fopen("emails.txt...

css - Custom Drop down Z-Index Issue -

i have bootstrap drop down on modal dialog. after clicking on drop down button drop down menu appears under form. there way fix issue, without using "position:fixed",because using fixed attribute facing other issues. <div id="dialog" title="basic dialog" ng-show='showdialog'> <div class="container"> <h2>dropdown</h2> <div class="dropdown"> <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">dropdown example <span class="caret"></span></button> <ul class="dropdown-menu"> <li><a href="#">aaaaaa</a></li> <li><a href="#">bbbbbb</a></li> <li><a href="#">cccccc</a></li> <li><a href...

javascript - Send JSON date to a PHP backend, timezone is lost -

i missing dates here. assume have basic input page, this markup <input type="date" ng-model="item.date"> <button ng-click="test(item)">test</button> angular module angular.module('test', []).controller('ctrl', function($scope, $http){ $scope.test = function(item) { $http.post('___', item); } }); then on server side there's trivial code. date_default_timezone_set ( 'europe/rome' ); var_dump( new \datetime($input['date']) ); being $input['date'] post-ed json date value, holds iso format following: 2016-03-22t23:00:00.000z now, having timezone set, expect above mentioned iso date handled correct timezone, see instead this object(datetime)#1 (3) { ["date"]=> string(26) "2016-03-22 23:00:00.000000" ["timezone_type"]=> int(2) ["timezone"]=> string(1) "z" } which should resolved instead 2...

perl - rename the file according PDF title -

Image
i trying write file rename perl script, reducing manual efforts. manually open pdf file, copy title , rename file name according title. i writing below code rename pdf according file title. e.g. spe-180024-ms title , pdf should renamed that according logic should rename file, output not proper #!/usr/bin/perl use strict; #use warnings; use cwd; use file::basename; #use file::copy; use file::find; use pdf::api2; use cam::pdf; $path1 = getcwd; open( f6, ">ref.txt" ); opendir( dir, $path1 ) or die $!; @dots = grep /(.*?)\-(ms)$/, readdir(dir); closedir(dir); @file; @files; $check; $err_1; $err_2; $err_3; foreach $file (@dots) { #print f6 $file."\n"; opendir dir1, $file or die "can't open $file: $!"; @files = sort grep { -f "$file/$_" } readdir dir1; $data1 = join( ",", <@files> ); closedir dir1; #print f6 @files."\n"; $a = @files; if ($data1 =~ m#(((\w+)\-(\d+)\-ms)\...

Configure PyCharm interpreter with docker-compose inside Vagrant -

i have basic vagrant box, docker , docker-compose running in it. docker-compose.yaml has web service this: web: restart: build: . ports: - "5000:5000" expose: - "5000" links: - postgres:postgres volumes: - .:/usr/src/app/ env_file: .env command: python manage.py runserver #below postgres service defined vagrantfile: vagrant.configure(2) |config| config.vm.box = "phusion/ubuntu-14.04-amd64" config.vm.network "private_network", ip: "192.168.33.69" config.vm.synced_folder ".", "/vagrant_data" # provisioning the web service uses dockerfile content: from python:3.5.1-onbuild i installed pycharm 5.1 professional edition beta 2 (build 145.256.43, march 11, 2016). want configure interpreter of pycharm same runs web service. when try so, in "configure remote python interpreter" dialog window, select docker compose, add new docker server. when trying add...