Posts

Showing posts from April, 2015

c# - The name 'txtStudentDOB' does not exist in the current context -

i have web form user control , want add calender textbox in edit form, error txtstudentdob in void calendar1_selectionchanged1(object sender, eventargs e) . problem cannot access calender edit form context. using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; using system.globalization; namespace learningsystem.controls { public partial class usrstudent : system.web.ui.usercontrol { protected void page_load(object sender, eventargs e) { if (!ispostback) { calendar1.visible = false; } } protected void imagebutton1_click(object sender, imageclickeventargs e) { if (calendar1.visible == false) { calendar1.visible = true; } else { calendar1.visible = true; } } void calendar1_selectionchanged1(object sender, eventargs e) { txtstudentdob.text = cale...

http - How to send a cURL POST without request data in PHP? -

my goal send post request server , proper response. note: angled brackets represent placeholders. in terminal, using following code provide me desired response. curl -u <user>:<pass> -h 'content-type: application/xml' -x post https://<rest of url> my current php looks this: $ch = curl_init(); curl_setopt($ch, curlopt_url, $uri); //$uri same use in terminal curl_setopt($ch, curlopt_userpwd, sprintf('%s:%s', $user, $pass)); //same terminal user & pass curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_ssl_verifypeer, false); $headers = array( 'content-type: application/xml', //expect xml response ); curl_setopt($ch, curlopt_httpheader, $headers); $curl_result = curl_exec($ch); using php, 400 bad request error. the verbose information: > post <same url> http/1.1 authorization: basic ywrtaw5ac3bhcms0nteuy29tonnwyxjrc29tzxroaw5n host: <correct host...

python - Unable to get lock on /var/lib/dpkg/lock when trying to execute $: salt \* pkg.install vim -

i using salt stack development of scm. have connected master minion , following command works successfully. $: salt \* test.ping now, trying execute following command. $: salt \* pkg.install vim to install vim on minion using master, when execute command on master, getting following error [info ] user sudo_user1 executing command pkg.install jid 20140910191537152620 [debug ] command details {'tgt_type': 'glob', 'jid': '20140910191537152620', 'tgt': '*', 'ret': '', 'user': 'sudo_user1', 'arg': ['vim'], 'fun': 'pkg.install'} [info ] starting new job pid 5762 [info ] executing command "dpkg-query --showformat='${status} ${package} ${version} ${architecture}\n' -w" in directory '/home/cybage' [info ] executing command ['apt-get', '-q', '-y', '-o', 'dpkg::options::=--force-confold', '...

html5 - Is there any internet browser supporting input="datetime" by a datetime picker? -

is there internet browser provide datetime(not date) picker html field: <input class="form-control text-box single-line valid" data-val="true" data-val-date="the field date of birth must date." data-val-required="pole date of birth jest wymagane." id="birthdate" name="birthdate" type="datetime" value="2014-08-07 00:00:00"> i have tried: ie 11 opera 24 chrome 37 current safari torch netscape navigator

perl - How can I concatenate multiple XML files? -

how can concatenate multiple xml files different directories single xml file using perl? i've had make quite lot of assumptions this, here's answer: #!/usr/bin/perl -w use strict; use xml::libxml; $output_doc = xml::libxml->load_xml( string => <<eof); <?xml version="1.0" ?> <issu-meta xmlns="ver2"> <metadescription> <num-objects xml:id='total'/> </metadescription> <compatibility> <baseline> 6.2.1.2.43 </baseline> </compatibility> </issu-meta> eof $object_count = 0; foreach (@argv) { $input_doc = xml::libxml->load_xml( location => $_ ); foreach ($input_doc->findnodes('/*[local-name()="issu-meta"]/*[local-name()="basictype"]')) { # find each object $object = $output_doc->importnode($_, 1); # import object information output document $output_doc->documentelement->appendchild($object); ...

ios - selective library linking Xcode 6 / LLVM 6 -

i selectively link library depending on configuration in project build settings. i.e. debug: -l libcws_ps release: -l libcws in library search paths, point directory contains these 2 .a libraries. i'll point out worked on xcode 5, on xcode 6 it's not linking , i'm getting undefined symbol errors. if link using usual method - 'link binary libraries', works - don't have configuration based linking. any ideas how fix this, or @ least clues how debug it? libtool /users/dave/library/developer/xcode/deriveddata/filmflexmovies-ddwyjuvbhaqgqralpjczhprnltla/build/products/release-iphoneos/libiosirdetolibrary.a normal armv7 cd /users/dave/developer/git/filmflex/ios/submodules/iosmodelcontroller/submodules/iosirdetolibrary export iphoneos_deployment_target=7.0 export path="/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/usr/bin:/applications/xcode.app/contents/developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /applica...

ruby - Compare two very large sorted arrays efficiently -

i need find efficient way of find out different between 2 large sorted arrays. in other words, need find out what added/deleted 1 of them based on comparisons other . sorting optional, if think can achieve no ordering, fine me. these 2 arrays each 1 million elements long, comparing them in memory @ once not feasible. the background simple. trying new rows remote legacy sql (openedge) table not have way of telling new. know might sound strange, reality working with. no triggers on data, no timestamps, nothing. resolved in stackoverflow thread i not looking ways add functionality remote table . i have copy of table in postgresql local database comparisons. doing comparison on network , using jruby jdbc driver inspect remote data. tried load both tables ruby arrays , standard array - array , eats why memory (the tables each million rows long). any other options me consider? algorithms not aware of? if both arrays sorted, can go through both arrays @ same time , compar...

php - fwrite to STDERR resulting in error in executable script -

i have strange issue. in executable php script error happens, , have no idea why warning: fwrite() expects parameter 1 resource, string given i have following examples: -rwxr-xr-x 1 root root 87 sep 10 16:55 test* -rw-r--r-- 1 root root 33 sep 10 17:10 test.php where file ./test is: #!/usr/bin/php -q <?php fwrite(stderr, "test\n"); and file test.php (exact same, missing shebang): <?php fwrite(stderr, "test\n"); i made tests on machine , it's behavior strange: # ./test <br /> <b>warning</b>: fwrite() expects parameter 1 resource, string given # php -q test.php test # php -r 'fwrite(stderr, "test\n");' test has idea why fwrite stderr not work (only) in executable php files? php 5.4.28 (cli) (built: may 19 2014 15:39:12) the error gone when use shebang #!/usr/local/bin/php . makes sense, since php compiled source. but still don't understand why happens on other path. t...

Splot with pattern-filled closed curves and colorbar in Gnuplot -

i've got 2 datafiles need plot, first datafile "surface.dat" nx3 matrix contains x y z data. am splotting pm3d , set viewmap 2d projection map of current surface z data defines range of colorbar. the second data file "closed_curve.dat" lies on x-y plane no z components. easy plot surface , curve in same graph using set view map set cbrange... set xrange... set yrange... splot "surface.dat" u 2:1:3 title "" w pm3d ,"closed_curve.dat" u 1:2:(0) title "" since closed curve however, want fill 1 of gnuplot patterns can't find works. a closed curve in form of rectangle example can created object without need of data file , filled in that's not problem e.g set object 1 rectangle 0,0 0.4,0.8 front fc lt 1 fs pattern 2 lw 2 thanks in advance.... i think best option using external tool create polygon object based on data file: set macros polystr = system('awk -v "ors= " ...

TinyMCE 4 Table resize cells by dragging -

i looking tinymce plugin table resize cell dragging , came to: http://sourceforge.net/p/tinymce/plugins/163/?page=2 here there working example http://tinymcesupport.com/premium-plugins/resize-table-cells unfortunately old version (i'm using 4) , following migration guide didn't came working version. i'm not java programmer , don't know if migration quite simple small changes or more development necessary. thanks tinymce supports resizing columns its 4.3 release . enable table plugin shown: tinymce.init({ inline: true, selector: 'table', plugins: 'table' }); table { border-collapse: collapse; } th, td { border: solid 1px #ccc; text-align: center; padding: 10px; } <script src="//cdn.tinymce.com/4/tinymce.min.js"></script> make sure <code>table</code> plugin activated, drag columns resize them: <table style="width: 100%;"> <thead> ...

java - Want to count characters from cmd argument array -

i'm quite new java. have studied code long time , can't find way declare args array in simple string can count _length(); i getting args array doing following in cmd: java sentence day die . output way want atm, but, how efficiently count args array characters? way of declaring every single args[0], args[1] , etc doesn't feel right. right code: public class sentence { public static void main(string[] args) { string s = args[0]; string t = args[1]; string = args[2]; string r = args[3]; string l = args[4]; int sum = s.length()+t.length()+a.length()+r.length()+l.length(); system.out.print("you wrote: "); (int j=0; j < args.length; j++){ system.out.print(" "+args[j]); } if (args.length > 0) { system.out.println("\nnumber of words:\t"+args.length); system.out.println("number of characters:\t"+sum); ...

SSIS: merging data from two csv's -

i importing data csv file(csv1) having columns userid, date , focus. there multiple records of same userid having diferrent focus value , different dates. need pick focus of user id having latest date , join file (csv2) having userid( more 1 same userid)fisrtname lastname , focus. the result should in csv 2 same userid must have focus set of latest focus in csv1 file. can how achieve result. thanks in advance. you can that, takes 2 steps: step 1: import csv2 (look-up table) temporary table. step 2: using ssis, "data flow transformations" toolbox select "lookup" item. write query select data temporary table. define matching columns. also, there "merge join" type of transformation, seems me need "lookup". if not familiar ssis transformations, google "ssis lookup transformation".

lapply - Using apply functions instead of for and branching statements in R -

i using r , stop using branching , statements take advantage of apply functions. being said, have list, x: x <- c(5,12,19,26,2,9,16,23) i corresponding list follows: for in x if (i<=7) 1 else if (i<=14) 2 else if (i<=21) 3 else if (i<=28) 4 else 5 the final new list be: 1,2,3,4,1,2,3,4 how can 1 of apply statements? every time try , write 1 end scratching head hour , post question here. thank you. simply use cut : x <- c(5, 12, 21, 35) as.integer(cut(x, c(-inf, 7, 14, 21, 28, inf))) #[1] 1 2 3 5

scala - Is there any way to use SBT's resolver only for subset of artifacts? -

is there way define custom resolver used subset of artifacts, more fetch artifacts predefined groupid ? for example, project defines custom fooresolver should used artifacts groupid org.foo other artifacts should resolved using default resolver. to add unmanaged dependencies sbt project, simplest solution put jars in lib folder in project. libraries in lib folder in classpath default. if want use folder instead of lib , can redefine it: unmanagedbase := // provide java.io.file here. if want more complex: sbt retrieves unmanaged libraries unmanagedjars task, can redefine task (but sign you're trying complicated reasonably use unmanaged dependencies...).

Minimum iOS Deployment Target for Xcode 6 -

wikipedia said minimum ios deployment target xcode 6's ios 7. checked, xcode 6 gm listed on page now, minimum ios deployment target has been changed ios 5.1.1. i need support ios 6.0, , confirm official xcode document. searched , not find particular information. can share link official document mentions this? thanks. xcode 6 supports deployment target 4.3. of course doesn't support simulators old. need test on real devices. you have no problem supporting ios 6 xcode 6 need real devices ios 6 test app properly. i don't have link document need set project's deployment target ios 6.0 , have proof.

objective c - Update CoreData entity obj -

i have complex coredata entity: my_entity i receive object of type my_entity webservice. in cases, need edit local coredata obj (my_entity) received obj. so: i have obj_1 in coredata i receive obj_2 webservice. i need update obj_1 obj_2. have set field or can assign obj_1 objectid obj_2 , save context (same context)? since 2 separate instances, need move want o2 o1. can use routine such move attribute attribute assuming both objects of same entity class: // use entity description entity attributes , use keys value // scan attributes nsdictionary *attributes = [[sourceentity entity] attributesbyname]; (nsstring *attribute in attributes) { id value = [sourceentity objectforkey:attribute]; if (value == nil) { continue; } nsattributetype attributetype = [[attributes objectforkey:attribute] attributetype]; switch (attributetype) { case nsstringattributetype: // value = [value stringvalue]; break; cas...

Is my CDN or W3 Total Cache blocking the Facebook crawler? -

every new page i've added since yesterday (6) hasn't been able pull data facebook crawler. debugger gives me response code 200 , error must fixed 'og:type' property required, not present. errors should fixed inferred property 'og:url' property should explicitly provided, if value can inferred other tags. both of these on page. crawler tells me it's seeing this: <!doctype html public "-//w3c//dtd html 4.0 transitional//en" "http://www.w3.org/tr/rec-html40/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="robots" content="noindex,nofollow"> <script> loooong token(?) information </script> </head> <body> <iframe style="display:none;visibility:hidden;" src="//content.incapsula.com/jstest.html" id="gaiframe"></iframe> </body> </html...

html - Multiple effects on single DIV element hover -

i trying multiple effects on single image hover allow best outcome least code possible. note: not want jquery @ all! css (even 3). so have image change on hover , @ same time cause div below said image change background image (which text, couldn't find way change text tried image) , having hover image on img tag have link place want. so far managed image changed , links working on hover image this: css .container { width: 1500px; height: 400px; } .image a:hover .container { background-image: url('logo-tp-text.png'); } html <div class="image"> <a href="http://www.google.com"> <img src="logo-tp.png" onmouseover="this.src='logo-fb.png';" onmouseout="this.src='logo-tp.png';"> </a> </div> <div class="container"></div> now, more experienced people me can see, have image on img tag self onmouseovered , out try , avoid...

neo4j - Orderby desc multiple properties in Neo4jClient -

suppose have 4 photos , want return list sorted first on rating desc, second on ratingscount desc. below cypher query gives me correct result: match (n:`photo`) n.ratingscount > 0 return n.rating, n.ratingscount order n.rating desc, n.ratingscount desc limit 20 id 1-rating 9-ratingscount 1 id 3-rating 7-ratingscount 2 id 2-rating 7-ratingscount 1 id 4-rating 2-ratingscount 1 unfortunately cannot translate neo4jclient. below query gives me photolist ordered rating ascending , ratingscount descending: var query = await graphclient.cypher .match("(photo:photo)") .where((photoentity photo) => photo.ratingscount > 0); .returndistinct((photo) => new { photo = photo.as<photoentity>() }) .orderbydescending("photo.rating", "photo.ratingscount") .limit(20) .resultsasync; id 4-rating 2-ratingscount 1 id 3-rating 7-rat...

c# - localization with resource file not working when setting culture at runtime -

i'm setting page culture @ runtime in code-behind this: system.threading.thread.currentthread.currentculture = new cultureinfo("fr-fr"); system.threading.thread.currentthread.currentuiculture = new cultureinfo("fr-fr"); page.culture = "fr-fr"; the resource files in globalresource folder , i've got 2 files: somefile.resx , somefile.fr.resx in markup page, have literal looks this: <asp:literal runat="server" id="test" text="<%$ resources:somefile, somekey%>" /> if code sets culture commented out literal take value that's in somefile.resx if run code sets culture value that's in somefile.resx file instead of value that's in somefile.fr.resx file. tried culture info set "fr" see if makes difference doesn't. what need change? thanks. the microsoft article locating localized resources provides example of how this. you've written, looks not creating new...

ios - UIScrollView cannot call addSubview for another UIViewController -

i have 3 controller first controller load list data (success) --> searchviewcontroller second controller load detail content ozdetailtestviewcontroller in third controller --> ozdetailsearchviewcontroller third controller --> ozdetailtestviewcontroller my problem is, when call function in ozdetailsearchviewcontroller (createviewatindex) uiscrollviewcontroller cannot load, log print when nslog in ozdetailtestviewcontroller. think _scrolldetailnews cannot alloc, don't know how alloc that. this code: ozdetailsearchviewcontroller.h @interface ozdetailsearchviewcontroller : uiviewcontroller<uiwebviewdelegate, uiscrollviewdelegate> @property (strong, nonatomic) iboutlet uiscrollview *scrolldetailnews; @property (strong, nonatomic) iboutlet uiview *viewforscroll; @property (strong, nonatomic) iboutlet uilabel *lbllinekanal; @property (strong, nonatomic) iboutlet uiimageview *imgheader; @property (strong, nonatomic) iboutlet nsarray *arrallnews; @property...

python 2.7 - NLTK RegEx Chunker - Wildcard match any POS tag? -

i'm using nltk's regexpparser phrases pos-tagged words. example: grammar = """ found:{<nnp>+<cd>+<,>+<cd>} ... """ pos_tagged_words = [('february', 'nnp'), ('14', 'cd'), (',', ','), ('1993', 'cd')] result = nltk.regexpparser(grammar).parse(pos_tagged_words) is there way match wildcard tag? if worked, i'd looking this: found:{<nnp>?<.>*<vbz>} where <.> wildcard. edit: found pretty bad way doesnt include characters. still appreciate dedicated wildcard char. found:{<nnp>?<[a-z]+|[:punct:]+>*<vbz>} try this: {<nnp>?<.*>*<vbz>}

Why i get HelloWorld.java uses or overrides a deprecated API, when compiling java using cmd? -

when compiling java file helloworld.java using command prompt, why following errors: note: helloworld.java uses or overrides deprecated api. note: recompile -xlint:deprecation details. this hint, using function condiered "deprecated", i.e. may vanish in later versions of java (see http://docs.oracle.com/javase/6/docs/api/java/lang/deprecated.html official definition). the concept of deprecating apis works this: in version, lets say, 1.0 api gets added. in later version (e.g. version 3.0) better apis introduced, , old api marked deprecated in order warn people using old api - in version people warning, old api not yet removed backward compatibility. later version lets 5.0 deprecated api may removed. check out java documentation (see links below) getting more information this. there written, new methods use instead. java se 6 api: http://docs.oracle.com/javase/6/docs/api/ java se 7 api: http://docs.oracle.com/javase/7/docs/api/ java se 8 api: http://d...

Bigquery: Check for duplications during stream -

we have data generated our devices installed on clients' side. duplicated data exist , design, means wouldn't able eliminate duplicated ones in data generating phase. looking possibility avoid duplication while streaming bigquery (rather clean data doing table copy , delete later). that's say, every ready-to-be-streamed record, check whether it's in bigquery first, if not continue stream in, if exist, won't stream in. but here's concern: (quote [here]: https://developers.google.com/bigquery/streaming-data-into-bigquery ) data availability the first time streaming insert occurs, streamed data inaccessible warm-up period of 2 minutes. after warm-up period, streamed data added during , after warm-up period queryable. after several hours of inactivity, warm-up period occur again during next insert. data can take 90 minutes become available copy , export operations. our data go different bigquery tables (the table name dynamically generated ...

ios - Autolayout stretched selected image for UIButton -

Image
creating button in interface builder image it's selected state no image it's default state causes said image come out distorted when in selected state. turning off autolayout fixes issue. both buttons same size. button ibaction toggles selected state. grey box around view there i'd know touch activate button since button has no image it's default state. project zip 2 questions 1. why auto layout f'ing how button content displayed? 2. how work in auto layout? so instead of setting image property of uibutton , set backgroundimage property. i think reason auto layout calculates intrinsic size of button without taking account image property, since added on foreground.

listview - Android ListViewAnimations NoClassDefFoundError -

i attempting add listviewanimations list view , instructions seem pretty straight forward. pretty plugin , play right? so take of original code of: usersadapter adapter = new usersadapter(dingggactivity.this, dingggactivity.friendtemplist); listview.setadapter(adapter); this works great. updates , displays needed. when modify code work listviewanimations error: 09-10 17:19:52.083 2125-2125/com.dingggapp.dinggg e/androidruntime﹕ fatal exception: main process: com.dingggapp.dinggg, pid: 2125 java.lang.noclassdeffounderror: com.nineoldandroids.animation.animator[] @ com.nhaarman.listviewanimations.appearance.animationadapter.animateviewifnecessary(animationadapter.java:174) @ com.nhaarman.listviewanimations.appearance.animationadapter.getview(animationadapter.java:145) isn't error of classes not imported correctly. thought did correctly. here new adapter code after adding listviewanimations. usersadapter adapter = ...

spring security ldap additional attributes -

i add few additional ldap attributes (actually one) userdetail object. seems way override usercontextmapper classes involves extending person class , essence class within it. seems little work add additional attributes. before pursuing route wanted make sure there isnt easier way accomplish this. basically have attribute called "collections" in ldap have available on principal object within application. thanks you don't have extend internal classes if don't want to. thing userdetailscontextmapper requires object return mapuserfromcontext implements userdetails . so should able read attributes want (including "collections") ldap context object (the dircontextoperations ) , use these create instance.

gruntjs - Yeoman/Grunt clean:dist task property undefined -

i'm new grunt , having trouble clean:dist task grunt-contrib-clean. code task. clean: { dist: { files: [{ dot: true, src: [ '.tmp', '<%= yeoman.dist %>/*', '!<%= yeoman.dist %>/.git*', '!<%= yeoman.dist %>/procfile', '!<%= yeoman.dist %>/package.json', '!<%= yeoman.dist %>/web.js', '!<%= yeoman.dist %>/node_modules' ] }] }, server: '.tmp' }, when run grunt build following warning "an error occurred while processing template (cannot read property 'dist' of undefined). use --force continue." i'm thinking must syntax error or wrong plugin, don't know enough keep figure out. for reason, changing <%= yeoman.dist %> <%= config.dist %> solves problem me. not sure w...

testing - "Don't keep activities" option in Android Studio? -

i'm trying test low memory conditions in android app, , i've read here should activate "don't keep activities" option in developer options test onsaveinstancestate code. unfortunately, can't find option in studio. (is available in eclipse?) is possible set option in studio? this option in device itself. under developer options menu - near bottom under apps heading. if have not already, need enable developer options menu clicking bunch of times on build number in phone under settings.

multiprocessing - Python: Using Multiprocess to switch functions -

i'm trying learn multiprocessing in python. what want happen have x increase time, when hit 'enter' decrease time , can keep hitting enter switch increasing decreasing. all i've managed make far this import time multiprocessing import pool def f(x): return (x+1) def f1(x): return (x-1) if __name__ == '__main__': pool = pool(processes=2) x=0 while x<100: x = pool.apply_async(f, [10]) time.sleep(0.05) i'm having trouble looking though documentation because don't give explicit examples. please have no idea threw example give ideas. #!/usr/bin/python3 import time multiprocessing import pool, manager threading import thread num_processes = 4 def consumer(q): out = [] while true: val = q.get() if val none: #poison pill break #doing work here time.sleep(0.01) out.append(val) return out def producer(queue): flip = tr...

pandas - Inconsistent behavior of `dataframe.groupby(allcolumns).agg(len)` -

for demonstration purposes, first, define couple of simple dataframes, df0 , df1 : >>> import pandas pd >>> import collections co >>> data = [['a', 1], ... ['b', 2], ... ['a', 3], ... ['b', 1], ... ['a', 2], ... ['a', 3], ... ['b', 1]] >>> colnames = tuple('xy') >>> df0 = pd.dataframe(co.ordereddict([(colnames[i], ... [row[i] row in data]) ... in range(len(colnames))])) >>> df0 x y 0 1 1 b 2 2 3 3 b 1 4 2 5 3 6 b 1 >>> >>> df1 = df0.ix[:, [0]] >>> df1 x 0 1 b 2 3 b 4 5 6 b now, here's result of grouping on all columns of df0 , aggregating len aggregator function: >>> df0.groupby(['x', 'y']).agg(len) x y 1 1 2 1 3 2 b 1 2 2 ...

C++ Pointer to 2D Dynamic Array? -

i bit of c++ newbie , working on project , little stuck. need create dynamic 2d ragged array have pointer point it. here have: int ** x = new int*[3]; int *** y = ???; now, after do: x[n] = new int[length]; x[++n] = new int[length2]; //etc etc i can access values in array through statement like: int num = x[i][j]; what want able same array values through y like: int num2 = *y[i][j]; so, in case, num2 , num should have same value, how go allocating memory y , assigning it? thanks! here example of creating 2d array in c++. #include <iostream> int main() { // dimensions int n = 3; int m = 3; // dynamic allocation int** ary = new int*[n]; for(int = 0; < n; ++i) ary[i] = new int[m]; // fill for(int = 0; < n; ++i) for(int j = 0; j < m; ++j) ary[i][j] = i; // print for(int = 0; < n; ++i) for(int j = 0; j < m; ++j) std::cout << ary[i][j] << "\n"; // free for(int = ...

php - how can I monitor a folder for new files or folders -

using php, trying create monitoring or watch script let me know new file or folder has been created. not sure if possible in php or have use other program monitor folder. yes possible. can create cronjob or infinite loop sleep period, map folder, listen changes.

c# - How to set a property of the parent element, when firing a trigger on ListBoxItem in WPF -

i have resourcedictionary has style responsible creating style of vertical side menu. below xaml resourcedictionary of hypothetical example created demonstrate problem: <resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:control="clr-namespace:firstfloor.modernui.presentation"> <style targettype="control:controle"> <setter property="template"> <setter.value> <controltemplate targettype="control:controle"> <grid> <border background="{templatebinding backcolor}"> <listbox x:name="linklist" itemssource="{binding links,relativesource={relativesource templatedparent}}" background="transparent"> <lis...

asp.net - MVC action results in 404 with "No type was found that matches the controller" invoking default action on controller works -

i inherited asp.net mvc code , tasked adding new features. complete beginner using asp.net mvc , come background of using web forms. i added new controller (apicontroller) , added following actions it: // get: /api/index public string index() { return "api methods"; } // get: /api/detectionactivity public jsonresult detectionactivity() { var detections = d in db.detections orderby dbfunctions.truncatetime(d.creationtime) group d dbfunctions.truncatetime(d.creationtime) g select new { date = g.key, count = g.count() }; viewbag.detectioncounts = detections.tolist(); return json(detections, jsonrequestbehavior.allowget); } my routeconfig.cs has following registered routes. public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maprout...

struct - Mutating in Structure Swift Same function Name -

still trying out swift, , came across problem (not sure if classifies one) so have protocol, , structure inherits it. protocol exampleprotocol { var simpledescription: string { } func adjust() } struct simplestructure : exampleprotocol{ var simpledescription = "a simple structure" mutating func adjust() { simpledescription += " (adjusted)" } func adjust() { //i created second method conform protocol } } var b = simplestructure() b.adjust() //this generates compiler error mentioning ambiguity (correct) question how call mutating adjust() not adjust protocol. i.e. know if declare b protocol , initialized struct call adjust protocol, how call first adjust ? or not possible? or using wrongly ? cheers, your code doesn't compile, error in redefining adjust method adding mutating attribute - doesn't create overloaded version of adjust . in opinion correct code: protocol exampleprotocol { var simpledescript...

sql - how to get the even and odd column separately with separate column by query -

i have input: id 1 2 3 4 5 6 7 8 9 10 i want , odd columns separately columns in specified output this id col 1 2 3 4 5 6 7 8 9 10 here id , col separate columns id contains odd number , col contains number specified input select min(id) id, max(id) col yourtable group floor((id+1)/2) for ids 1 , 2 , (id+1)/2 2/2 = 1 , 3/2 = 1.5 , respectively, , floor returns 1 both of them. similarly, 3 , 4 , 2 , , on. groups input rows pairs based on formula. uses min , max within each group lower , higher ids of pairs.

jquery accordion on table rows -

i've implement quickfix accordion following table <table> <tbody> <tr class="category"><td>category - 1</td></tr> <tr><td>sub cateogry 1.1</td></tr> <tr><td>sub cateogry 1.2</td></tr> <tr class="category"><td>category - 2</td></tr> <tr><td>sub cateogry 2.1</td></tr> </tbody> </table> jquery is $(document).ready(function () { $('table').accordion({header: 'tr.category', collapsible: true }); }); fiddle - http://jsfiddle.net/8xyjy/500/ error: seems hide first row after category header row. there accordion option make work correctly? i've seen examples of using multiple tbody thing there tons of legacy code generates tables (with different bg color header rows) , don't want change structure of table. can point fix? thanks.

PHP XML Parsing Erases Attribute Value -

i have following code below: <?php $xml = '<divisions xmlns="urn:description7a.services.chrome.com"> <responsestatus responsecode="successful" description="successful"/> <division id="1">acura</division> <division id="44">aston martin</division> <division id="4">audi</division> <division id="45">bentley</division> <division id="5">bmw</division> <division id="6">buick</division> <division id="7">cadillac</division> <division id="8">chevrolet</division> <division id="9">chrysler</division> <division id="11">dodge</division> <division id="46">ferrari</division> <division id=...

magento - How to send email with a custom email template -

i creating template abandoned orders. when try use template created, send blank email, more template appears in: system/transactional email template the temaplate copy of order_update.html name test_order_update.html in en_us/template/email/sales/ config.xml - working <global> <template> <email> <custom_template module="mymodule"> <label>abandoned transactions</label> <file>sales/test_order_update.html</file> <type>html</type> </custom_template> </email> </template> </global> shooting - not load template <?php $storeid = mage::app()->getstore()->getid(); $emailtemplate = mage::getmodel('core/email_template'); $emailtemplate->loaddefault('test_order_update'); $emailtemplate->settemplatesubject('my subject here'); $ema...

ember.js - cannot delete record which hasMany relationship to same record type (ember data 1.0.0-beta.9) -

i upgraded ember data 1.0.0-beta.2 ember data 1.0.0-beta.9. there piece of code delete record works fine in beta 2, doesn't work in beta.9 my model looks this: as.question = ds.model.extend({ questionname: ds.attr('string'), childquestions: ds.hasmany('question', { async: true }) }); and delete method looks this: deletequestion: function (question) { var self = this; question.deleterecord(); question.save().then(function () { console.log('success'); //unload child records store because server removes child questions }, function (failureresponse) { console.log(failureresponse); console.log('failure'); //perform rollback })['finally'](function () { console.log('in finally'); }); } in ember data beta 9, never goes through success function if question has child questions, goes second function catches failure. delete works if question...

angularjs - Angular-UI: Force Typeahead results -

i have text field uses angularui's typeahead feature . looks this: <input typeahead="eye eye in autocomplete[column] | filter:$viewvalue"> i'd force user select option list generated. if type not on list appears, on blur (clicking outside of text field), i'd value of text field reset it's original value. is functionality part of typeahead directive, or need extend it? searched 10 minutes on google , stackoverflow, couldn't find relevant documentation. can please point me in right direction accomplish this? there attribute in plugin force existing values only: typeahead-editable="false" . default value true . only $modelvalue being set empty when there wrong value selected, , necessary otherwise not able write anything. $viewvalue stays last text entered. might able bind blur event of own field reset $viewvalue ? here jsfiddle selected value displayed: http://jsfiddle.net/zjpwe/61/ you use attribute typeahead-on-...

go map key by reference, comparison by dereference -

i need use large maps large strings keys. there way in go's default map specify comparison test key treated address? if not, there libraries implement this? note want prevent long strings being passed copy whenever map lookup made. for particular case of strings, go want default: strings represented pointer/length pairs you're not copying string data around when copy strings. in general, can't specify custom comparison (or hash) function. other types , custom structs are treated according rules listed in spec : pointers compared address, example, fixed-size arrays compared value, , slice types aren't comparable in general struct types include them aren't usable map key types.

PHP only printing last element of returned array -

i'm trying populate array file names ending in "mp4" recursive function looking through list of sub-directories. when print elements in array foreach loop before return statement, array displays of elements correctly. however, when create variable return of method , try iterate through again, receive last entry in array. could caused recursion in loop? my code follows: <?php function listfolderfiles($dir){ $array = array(); $ffs = scandir($dir); foreach($ffs $ff){ if($ff != '.' && $ff != '..'){ // adds array. if(substr($ff, -3) == "mp4"){ $array[] = $ff; } // steps next subdirectory. if(is_dir($dir.'/'.$ff)){ listfolderfiles($dir.'/'.$ff); } } } // @ point if insert foreach loop, // of elements display return $array; } // new '$array' variable in...

installer - New custom action in MSP -

i'm trying add custom action msp, didn't exist in original msi. knows how it? thanks, ievgen. a .msp patch file delta between original msi file , new msi file. build new msi file custom action in , you'll end patch includes it.

TeeChart php for HTML5 Builder. How to customize the x-axis -

Image
i'm using embarcadero's html5 builder (php) , teechart draw graphs. great tool parts teechart documentation html5 builder php extremely thin, nonexisting need guess lot. now, need way format x-axis in teechart line graph has 2 series of data. both series shares same y , x-axis.the x-axis in case should text, not numbers. now, default x-axis numbered 1,2,3... isn't workable in situations. to format teechart's y-axis easy; following code it: $this->chart1->axes->left->automatic = false; $this->chart1->axes->left->minimum = 16; $this->chart1->axes->left->maximum = 28; one think same logic apply bottom axis, i.e. $this->chart1->axes->bottom->minimum = etc... but not so. you'll runtime error trying manouver. someone out there knows how teechart php html5 builder draw x-axis want appear? i've taken source code this demo (index page here ) , i've added @ end of page, before render ca...

javascript - Error: TypeError: Object has no method 'set' -

i using cloud code function ios app. calling cloud function code... var moment = require("moment"); parse.cloud.define("registeractivity", function(request, response) { var user = request.user; user.set("lastactive", new date()); user.save().then(function (user) { response.success(); }, function (error) { console.log(error); response.error(error); }); }); and ios call this... [pfcloud callfunction:@"registeractivity" withparameters:@{}]; why error? error: typeerror: object has no method 'set' you can't pass parse objects through cloud functions , expect them remain parse objects. better solution pass object id, create pointer user object, , set id it. update , save: var moment = require("moment"); parse.cloud.define("registeractivity", function(request, response) { var user = new parse.user() user.id = request.userid; user.set("...

jquery - External Javascript files extremely slow in IE 8,9,10,11 -

my site calls js files google & microsoft's libraries. example: <script src="https://ajax.microsoft.com/ajax/4.0/4/microsoftajax.js" type="text/javascript"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript"></script> my site loads fine on chrome & firefox, when open in ie (8,9,10,11), takes ages load. looking @ http watch, waterfall shows every external js file taking 20+ seconds load. total site load time upwards of 60 seconds. if open js files directly in ie, loads instantaneously: https://ajax.microsoft.com/ajax/4.0/4/microsoftajax.js https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js it's slow loading when called through website. website on cdn , loads correctly when spoofing directly our origin server. external js files slow down when page loaded through cdn. additionally, on companies/networks/vpns, cdn site loads...