Posts

Showing posts from April, 2012

c# - Am I building the wrong entities in MVC? -

goal. have "gift" entity describes has offer (babysitting, dog walking, etc) rating. , want "giftcategory" entity gives general category descriptive information (pets, sports, automotive, etc) search apon , gift have categories. "gift" entity can have multiple "giftcategory" entities associated it. want ability search category , pull out "gift" entities have been created categories associated them. here have far doesn't seem work entity first approach. maybe need table connects 2 entities because way 2 tables connected doesn't seem correct? gift entity: public class gift { public int id { get; set; } public string name { get; set; } public icollection<giftcategory> categories { get; set; } // incorrect??? public int rating { get; set; } } category entity: public class giftcategory { public int id { get; set; } public string name { get; set; } public string description { get; set; } }...

html - Fixed sidebar but responsive layout -

this preview of website i'm working on: http://jsfiddle.net/x4yc8/ it has fixed (full height) sidebar scrolling main content section. when width of window reduced (see screenshot below) main content overlaps sidebar. how ensure doesn't happen? http://imgur.com/sgy5ken ideally main content appear below sidebar when screen width e.g. when viewed on mobile-sized screen thanks in advance! my code is: css /* css document */ @import url(http://fonts.googleapis.com/css?family=open+sans); html, body { height:100%; margin: 0px; padding: 0px; color: #fff; background-color: #06c; } #sidebar { width: 250px; height: 100%; left: 0; float:left; background-color: #006; padding-top: 25px; position: fixed; clear: right; } section#settings { width:auto; float:left; margin-left:250px; padding-top: 60px; padding-right: 25px; padding-bottom: 25px; padding-left: 25px; position: absolute; } #...

python - Sharing variables between urlpatterns in Django -

here urls.py from django.conf.urls import patterns, url, include geartables import views geartables.views import datatable urlpatterns = patterns('', url(r'^$', views.index, name='index'), url(r'^data/$', datatable.as_view(), name='datatable'), url(r'^(?p<product_type>[\w\-]+)/$', views.table, name='table'), ) when user goes "localhost/table/", page generated template. within template {% url %} tag calls datatable class (to create json data). so question how can datatable class in views.py call variable? like so: class datatable(basedatatableview): model = <product_type> ... edit: views.py: ... def table(request, product_type): ptype = producttype.objects.get(url_name=product_type) datatable = 'datatable' context = {'mselectmenus': ptype.mselects, 'columns': ptype.columnlist,...

objective c - I can't figure out the meaning of this statement: -

+(appdelegate*)instance{return [uiapplication sharedapplication].delegate; it's in middle of appdelegate using template. if has time, please explain line or usefulness of it. thank patrick it utility method: when in need of instance of application's delegate casted correct class call: [appdelegate instance] instead of: appdelegate* instance = (appdelegate*)[uiapplication sharedapplication].delegate;

javascript - Transform a lodash/underscore collection in a jQuery object (chaining) -

i seamlessly wrap lodash collection in jquery object. right i'm saving lodash output in variable , feeding jquery: //simplified code var els = [document.getelementbyid('a'), document.getelementbyid('b')]; els = _(els) .map(dostuff) .map(domorestuff); var $els = $(els); but chain instead: //pseudo code _(els) .map(dostuff) .map(domorestuff) .jqueryfy() //this magic method, missing .show() //jquery method, right away i thought possible tap , doesn't change collection. _(els) .map(dostuff) .map(domorestuff) .tap(function(array) { return $(array); }) //doesn't return jquery object .show() this should using mixin jquery constructor take array of dom elements: _.mixin({jqueryfy: jquery}, {chain:false}); notice jquery support basic collection manipulation functions , could've written example as $("#a, #b").map(dostuff).map(domorestuff).show();

unique - Uniquely identify instruction in LLVM -

is there way uniquely identify given instruction in llvm. example, if have function , inside function have "add" instruction, there way same "add" instruction every time execute it? thank what mean "execute" it? if execute in interpreter (via lli ), yes, each llvm instruction unique value* . if compile down machine code , execute it, can use debug info correlate between llvm instruction , machine code generated it. it's trickier, doable. complications multiple machine code instrs generated same llvm instruction, etc.

java - Setting a .bat file to run at windows shutdown doesn't work -

i need run java application @ windows shutdown. have windows 7 , have tried in 2 ways: i have created .bat file containing following: javaw -xmx200m -jar c:\path\to\jar\dl.jar dl.jar application need run @ shutdown , added in local group policies->windows settings->scripts(stratup/shutdown)->shutdown->script name batch file, doesn't work. also have added in shutdown scripts local group policies @ script name: c:\windows\system32\cmd.exe , @ script parameters path batch file, doesn't work in way either if run .bat file command promt works. have idea how make work?

tfs2010 - Does TFS 'keep local version' change the file's history? -

if have files checked out , run update later, i'll come across conflict gives me few options resolve. if pick 'keep local version' option, changes replace server's version without updating history? is there reason why want option alter source code secretly? nothing changes until check in file , have history , annotations. typically unless have reason not want merge conflicted non-binary files , use common sense when choosing whether take updated binary file or not. if non-binary merge pretty time keep local if knew didn't want latest changes since check file out make in copy.

javascript - Can't get height of div to adjust -

i'm in pickle. i'm working on layout , , need main div adjust window size, mainly middle div make scrollbar upon resizing. it's acting table cell currently, why it's forcing become taller instead of using scrollbar. it's in containing div in efforts keep doing though. <div id="all"> <div id="voltron"> <div id="mainsidebar">ok</div> <div id="content"> <div id="ticker">please</div> <div class="wrap"> <div id="postsgohere"> <p>lorem ipsum dolor sit amet, ...</p> </div> <div id="rightsidebar">well then.</div> </div> </div> </div> </div> i resorted jquery, , though found code thing, it's not working. <script src="//ajax.google...

Identifying an unknown data encoding? -

i'm trying understand undocumented api have discovered, , can't past format of data being returned. here example of when perform get on url i'm looking at: a+uzl4258wxdnwztlepjnxtdl3tu4hrittw2auwqhuk5c6batsbu/xsqevittcpi7wrw/oxwiblot8+cdtuwbag3mzk3clohkpvi7pwpf7jqcsbjngh+5iv5gb8by2k31kp62sfwz+i8r/3ta6ngrnjb6edob7d0c6f34rtfrrrzsejtiwyxaj5jed3yjy+c at first thought base64 encoded, gives me gibberish: echo -n "<above snippet>" | base64 -d ?/???ݝl?c?5vy??????,?8?s?@m t?{r-?*h? ???ֈhoϜv??7?97p?!(??????? &?4h~???i7?jz???g輯???Ʈr[??n?ts?w??f??i?m?f?ix=?%? when strip url down domain, website cyrillic text. maybe data converted cyrillic somehow? does data format familiar you? i'll continue keep trying , report if make progress. this base64, because of / , + characters. when decode string using base64 , hexdump: 00000000 03 eb 99 2f 8d b9 f3 05 dd 9d 6c ed 94 43 c9 35 |.../......l..c.5| 00000010 7b 5d 97 74 ee e2 14 48 ...

paint - java double buffer doesn't erase -

i doing project double buffering. when paint, paints on top of old layers, need erase them. repaint() didn't work, i'm guessing equally simple answer. any ideas? added code, , disappears, erases background color. public void paint(graphics g) { super.paint(buffer); for(projectile p: projectiles) drawrectimage(buffer, p.image, p.getrectangle()); } suggestions: if swing gui, don't override paint method, instead override paintcomponent method. won't current problem, prevent future problems including problems painting of borders , child components. if swing (again don't say), make sure painting component extends jpanel, not jcomponent, since jpanel opaque , fills background rectangle in super method. if it's not swing, should consider changing awt swing. if you're still stuck, yep, you'll want create , post minimal example program . please check out link.

r - Add dummy variables to data.frame using for-loop -

i want add 100 dummies t1, t2, ..., t100 data frame df . df$'t1' <- ifelse(df$x==1, 1, 0) df$'t2' <- ifelse(df$x==2, 1, 0) ... df$'t100' <- ifelse(df$x==100, 1, 0) using for-loop, tried code this: for (i in 1:100) df$paste("t","i",sep="") <- ifelse(df$x == i, 1, 0) can please correct r code? for (i in 1:100){ df[[paste("t",i,sep="")]] <- ifelse(df$x == i, 1, 0) }

node.js - Changing localhost server files are served from using Node (Webstorm /maybe IntelliJ) -

i'm not sure i'm missing here, can me out. i'm working on project we're using node , in run/edit configurations i've down following: node interpreter: path node.exe file checked out subversion working directory: "app.js" file is, path command line type node app.js , starts server javascript file: app.js name of file creates server now main nav bar when run / run server box @ bottom pops , tells me express server listening on port 3000. cool. i can navigate localhost:3000/mypage.html , can page fine. added json file same directory on hard drive mypage.html in, , can navigate localhost:3000/largetestdata.json . so server , running , serving file should. problem in webstorm project, want make ajax request largetestdata file. using jquery like: var data = $.get('localhost:3000/largetestdata.json'); data.done(function(data){ console.log('here data'); cnosole.log(data); }) when error (in chro...

reporting services - ReportViewer is slow on large reports despite ServerReport processing -

i have observed performance problems when rendering 1000-page serverreport using microsoft.reportviewer.webforms versions 10 , 11 in visual studio 2013, running against sql server 2012 report server. this not query performance problem, since underlying stored procedure returns data in few seconds. running report through report manager returns html or pdf report in 30 seconds. when report returned through report viewer additional delay of several minutes encountered. neither pagecountmode.estimate nor local processing of report have helped. it appears rendering issue. unexpected, because rendering should happening on server. client machines less powerful server, , in fact want server render report. some of rendering in fact being done on client, despite fact serverreport. examination of executionlog2 view in reportserver database shows rpl format returned in, e.g., 30 seconds. however, though serverreport, client spends several minutes apparently performing ad...

javascript - Loop in a json codeigniter object with jquery -

i searched in many questions doesn't worked me, want loop through json object returned controller, let me show code: model public function traer_pasajero($id){ $this->db->select('*'); $this->db->from('pasajeros'); $this->db->where('id', $id); $query = $this->db->get(); return $query->result(); } controller public function traer_pasajero(){ $pasajero = $this->pasajeros_model->traer_pasajero($this->input->post('id')); $this->output->set_content_type('application/json'); $this->output->set_output(json_encode($pasajero)); return $pasajero; } js function modificarpasajero (id) { $.ajax({ type: "post", url: "http://localhost/xxx/xxx/traer_pasajero", data: {id: id}, datatype: "text", cache:false, success: function(data){ $.each( data, function( key, value ) { al...

ios - Why isn't my segue being performed? -

i have segue should take place when 1 of number of things happen, it's called programatically, so: - (void)unwindaway { nslog(@"let's segue"); [self performseguewithidentifier:@"mysegue" sender:self]; nslog(@"we should have performed segue"); } - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { nslog(@"let's segue"); } but output in console is: 2014-05-29 22:20:30.173 app[7848:60b] let's segue 2014-05-29 22:20:30.178 app[7848:60b] should have performed segue so can see, it's not calling prepareforsegue. the segue name correct - if give invalid segue name errors you'd expect. any ideas? for unwind segues, prepareforsegue:sender: called on view controller source of segue, in other words 1 you're exiting from.

understanding random number code in assembly 8086 -

i found here on forum code generate random number between 0 , 9 in assembly 8086. here code: randstart: mov ah, 2ch int 21h mov ax, dx xor dx, dx mov cx, 10 div cx mov si, dx mov variable, si please, need guys explain me line: xor dx, dx i don't understand why need use xor here. hope guys can , teach me :) xor dx,dx equals mov dx,0 . logic gate that: 1+1=0 0+0=0 1+0=1 0+1=1 basically when xor number output 0. preferred on mov command because takes less memory. hope understand little better now.

ajax - Get value with JQuery value from Table -

i have view passes @model ienumerable<webapplication2.entities.movie> dumps out list of movie's in table me. i trying value of item.id . the following code gives me text input in item-field , not sure how manipulate location value of input above it. var name1 = $field.find(":input:first").val(); here entire jquery overview <script> $(document.documentelement) .on("click", "span.item-display", function (event) { $(event.currenttarget) .hide() .next("span.item-field") .show() .find(":input:first") .focus() .select(); }) .on("focusout", "span.item-field", function (event) { console.log("this log"); var $field = $(event.currenttarget), $display = $field.prev("span.item-display"); $displ...

apache - Downloaded PHP5.4.25 with Homebrew....empty php.ini file yet it still works? -

macbook pro: 10.9.3 php: 5.4.25 apache 2.2 i have downloaded php using homebrew along mongodb. working fine can not seem find php.ini file apache using. used phpinfo() method , telling me loaded file in etc/php.ini. strange thing php.ini file empty. line in file extension directive mongodb driver. have been searching while using usual methods such php -i , phpinfo(). have no idea how configure php. must loading default configurations somewhere can not find where. have clue might be?

java - Concurrency - postpone method execution -

this question has answer here: is there concurrent list in java's jdk? [closed] 4 answers how modify class: public class event<t extends eventargs> { private final list<listener<t>> listeners; public event() { listeners = new arraylist<>(); } public void invoke(t args) { (listener<t> l : listeners) l.onevent(args); } public void addeventlistener(listener<t> l) { listeners.add(l); } public void removeeventlistener(listener<t> l) { listeners.remove(l); } } so addeventlistener() , removeeventlistener() postponed execute after invoke() ends (so won't concurrentmodificationexception )? depending on how long expect invoke() run have 2 choices. if execution less short interval (i.e. 10ms) lock on class. otherwise n...

Is it better to use CSS :hover or jQuery hover? -

which better website speed, css :hover or jquery hover? or same? css css native (built browsers), html parser , javascript engine css styles exposed scripting languages via cssom - css object model defines apis media queries, selectors , css itself implementation not happen through scripting language (unless layout engine written in one) jquery jquery javascript library, , therefore external browsers needs downloaded , run through browser's implementation of javascript jquery need access dom , cssom, implemented in javascript, browser has run so, theoretically , while can use jquery , css both use onevent methods, css faster, native browsers, , not have added step download , "translate" library. more information performance: pure css vs jquery how browsers work - behind scenes of modern web browsers

arrays - Stuck in Vector in Java -

i created string vector , want store selected type of coffee in vector, example if choose number 3,4,5 , 1, store them in vector1 variables ("latte", "american", "capuccino" , "moka") , print stored names, problem prints, number 6 "black", always. import java.io.*; class exercise{ public static void main (string[] args) throws java.io.ioexception { datainputstream receivedata= new datainputstream(system.in); string keyboard; int seleccafe,n=0,contvector=0; string []vector1=new string[200]; do{ system.out.println("\n1. moka"); system.out.println("2. expreso"); system.out.println("3. latte"); system.out.println("4. american"); sy...

Out of memory error or program unresponsive during multithreading JAVA -

i new multi threading. literally. , pretty new java overall. however, making simulation , thread seem working except have program become unresponsive , once said out of memory error. assume because creating many threads? @ point have on 2000 threads running @ same time. can adjust code (i.e reduce number of customers or increase time between ticks) release pressure on system wondering if there doing ease burden within each thread itself. i'm pretty sure isn't deadlock since code runs fine if above run longer same amount of customers come through. show relevant parts of code , if more required happy put up. please don't understand well, simple , helpful explanations appreciated, since if comment complex wont' know how implement it. this main class creates thread. checkoutfloor checkoutfloor = new checkoutfloor(); checkoutfloor.addcheckoutoperators(checkoutoperators); int tick = 0; int customers = 0; while (tick < simulationtime) { ...

openstack swift - curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' url:8080/auth/v1.0 results in "HTTP/1.1 400 Bad Request" -

i have tried setup saio - swift in 1 per instructions in " http://docs.openstack.org/developer/swift/development_saio.html " but when execute "curl -v -h 'x-storage-user: test:tester' -h 'x-storage-pass: testing' url:8080/auth/v1.0", results in "http/1.1 400 bad request". i new cloud computing , hence in matter appreciated. i encountered similar problem. code "worked on system", when tried run code against swift store hosted cleversafe, got same 400 error. i solved problem using x-auth-user , x-auth-key header names rather x-storage-user , x-storage-pass. unfortunately, swift documentation net clear distinction, if any, between these 2 options.

node.js - Error during WebSocket handshake: Status line contains embedded null (using livereload, node-inspector, and karma) -

whenever use in terminal requires websocket chrome or safari (livereload, node-inspector, karma), following console error "error during websocket handshake: status line contains embedded null" not sure if right place ask question, appreciated.

html - equally dividing columns doesnt work without commenting out returns, is there a better way? -

i tried around bit because didnt understand causes blank spaces between equally divided columns, http://jsfiddle.net/esvne/ helped me took while until noticed comments, <div id="wrapper"> <div id="c1" style="background:red"></div><!-- --><div id="c2" style="background:blue"></div><!-- --><div id="c3" style="background:yellow"></div> </div> and me 1 line solution, ugly! http://jsfiddle.net/qfm8u/ is there better way this? (that is, dividing div equal parts without padding/margin hacks or one-line/comment stuff) it's inline-block that's creating white-space between divs: attribute's name suggests, works bit inline , means take spaces , line-breaks "consideration", speak. (hope made sense.) try using display: block; , float: left; this: div div { height: 50px; background-color: green; width: 32.666%...

java - Queried date value moves by 2 days -

i'm trying learn spring data , using jparepository try , query date objects database. however, every time query date, result 2 days ahead of expected value. time component seems correct; it's date wrong. thing is, looks happens if compile code on machine. doing in person's yields correct results. there things need @ this? appreciated. db value: 2014-05-29 19:47:00.576 testrepo() below returns 2014-05-27 19:47:00.576 instead. public void testrepo() { system.out.println(repo.findbyname("testdate").getvalue()); } ========== @autowired private entitymanager em; public dateobject findbyname(string name) { stringbuffer sql = new stringbuffer(); sql.append("select * "); sql.append("from static_dates "); sql.append("where name = '" + name + "'"); query q = em.createnativequery(sql.tostring(), dateobject.class); list<dateobject> resultlist = q.getresultli...

android - Some data missing when being inserted into MySQL -

like many, new android , java programming. working on project employer scan labels , compare serials match , upload database. have mysql database set @ home , inserting data expected of 'contlabel' scans missing in table though in edittext boxes. please excuse cobbled code, still learning quite bit , doing test. can please explain why of data missing though there data in required fields please? thank in advance. this jsonparser: public class jsonparser { static inputstream = null; static jsonobject jobj = null; static string json = ""; // constructor public jsonparser() { } // function json url // making http post or mehtod public jsonobject makehttprequest(string url, string method, list<namevaluepair> params) { // making http request try { // check request method if(method == "post"){ // request method post // defaulthttpclient defaulthttpclient httpclient = new defaulth...

regex - Redux Framework - How To Validate Phone Number -

i'm using redux framework build theme options panel wordpress theme. i'd allow users enter phone number validated text field can incorporate around site. i've checked docs , , looks can write own custom validation. i tried adding html5 attribute type="tel" input field without success. googling turns no results. i did find this post on using regex phone # validation. has used redux framework , incorporated phone # validation? it hard do. you'd need make own custom validation class. take of redux validation classes: https://github.com/reduxframework/redux-framework/blob/master/reduxcore/inc/validation/numeric/validation_numeric.php change class name. include in code before run redux, , add validation. when it's working, submit pull request , we'll put in redux core. :)

clojure - MongoDB Connection Pattern using Monger -

i new clojure. are there idioms/patterns around connecting mongodb through monger? do have connect , disconnect using (monger.core/connect) & (monger.core/disconnect conn) respectively. each time ? is there way can reuse connection connection pool? monger uses mongoclient, connection pooling. after connect , can keep working pool until you're done, , disconnect . see monger documentation supported connection options (e.g. maximum number of connections in pool, default 10).

java - Why does Avahi "ant test-browse" fail with "libavahi4j.so: undefined symbol: avahi_malloc"? -

i able build avahi per instructions , next step in quick start of running "ant test-browse" results in symbol lookup error, , i'm confused how proceed troubleshooting problem. did find following post showed similar problem, wasn't able make progress (it seems thread never publicly resolved anyway). here error output see: myuser@ubuntu:~/downloads/avahi4j-0.1$ ant test-browse buildfile: /home/myuser/downloads/avahi4j-0.1/build.xml init: compile: [javac] /home/myuser/downloads/avahi4j-0.1/build.xml:109: warning: 'includeantruntime' not set, defaulting build.sysclasspath=last; set false repeatable builds jar: jnilib: [exec] make: entering directory `/home/myuser/downloads/avahi4j-0.1/src' [exec] make: nothing done `all'. [exec] make: leaving directory `/home/myuser/downloads/avahi4j-0.1/src' test-browse: [java] avahi4j v0.1-0 [java] /usr/lib/jvm/java-7-oracle/jre/bin/java: symbol lookup error: /home/myuser/down...

python - extracting a range of elements from a csv / 2d array -

i want extract elements range of elements specific column csv file. i've simplified problem this: data = [['a',1,'a',100],['b',2,'b',200],['c',3,'c',300],['d',4,'d',400]] print(data[0:2][:],'\nrows 0&1') print(data[:][0:2],'\ncols 1&1') i thought meant 'show me columns row 0 , 1' 'show me rows column 0 , 1' but output showing me rows 0 , 1, never columns, [['a', 1, 'a', 100], ['b', 2, 'b', 200]] rows 0&1 [['a', 1, 'a', 100], ['b', 2, 'b', 200]] cols 1&1 when want see this: ['a', 1, 'a', 100,'b', 2, 'b', 200] # ... i.e. rows 0 , 1 ['a','b','c','d',1,2,3,4] is there nice way this? your problem here data[:] a copy of data : >>> data [['a', 1, 'a', 100], ['b', 2, 'b', ...

html - CSS3 navigation bar top menu -

i want create navigation menu http://oi61.tinypic.com/345g7wz.jpg but found problems. li background-color doesn't connected , display differently in ie this code http://codepen.io/anon/pen/hdzif html: <body> <header> <div class="logo"></div> <nav> <ul> <li><a href="index.html" class="active">home</a></li> <li><a href="about-us.html">about us</a></li> <li><a href="cupcakes.html">cupcakes</a></li> <li class="empty"></li> <li><a href="how-to-order.html">how order</a></li> <li><a href="contact-us.html">contact us</a></li> <li><a href="faq.html">faq</a></li...

c# - A calls B where B calls A, huge stack trace -

i have class has 2 methods this: int counter = 0; private void () { debug.log (system.environment.stacktrace); counter++; b (); } private void b () { counter++; if (counter < 100) (); } this compiles , works fine , stops after 100 iterations expected. however, i'm bit worried end of it, stack trace gets rather enormous. i tried searching kind of pattern, couldn't find anything. doing in general no-no, or fine, long terminates properly? edit: clarification on use of this: main loop of program should keep going forever; it's not meant kind of recursive function. have 1 big loop, split multiple smaller methods various reasons , call each other in fashion. functionally it's same having code in giant while loop, i'm worried stack trace. this recursive pattern, , not per se bad design. long stack generated recursive calls (depend on number of calls, , number of arguments per calls) not exceed maximum stack size (by de...

javascript - Source map created points to system paths instead of relative path -

i using uglifyjs2 minify javascript source files 1 large minified file. here relevant bit of code use: var options = options || {}; options.outsourcemap = 'minfile.js.map'; try { // "scripts" array of absolute paths javascript files var minified = uglifyjs.minify(scripts, options); // minified.map contains minfile } catch (err) { // handle errs here } the minfile contains absolute paths source files: { "version": 3, "file": "nodebb.min.js.map", "sources": [ "/path/to/folder/jquery/js/jquery.js", "/path/to/folder/another/lib.js", ... ], ... } the problem is, source files i'm passing in not accessible publically, compiled minfile , minfile accessible. therefore, source map seems pointless, chrome (in case) tries load http://mydomain.com/path/to/folder/jquery/js/jquery.js instead of reading file on local fs. what doing wrong? ...

php - How to handle "Domain of sender address ee@e.com does not exist" error exception -

i want make message "domain of sender address ee@e.com not exist" shows client instead of debug error. how can make it? in default, following debug error message show. swift_transportexception expected response code 250 got code "553", message "553 5.1.8 <ee@e.com>... domain of sender address ee@e.com not exist " i want make error message shows client tell them email address not exists, please try others. how handle error message? the receipent e-mail server run series of tests determine legitimacy of sender e-mail server , sender e-mail addresses server trying send. the usual tests include reverse dns match, spf record match, clean dnsbl, , of course domain must exist. the receipent e-mail server can -- , -- refuse e-mails if 1 or more of tests fail.

text parsing - Applescript: Break a set of lines into blocks based on a condition -

i have automator service uploading images , returning urls text editor. works well, there's want improve: when workflow starts, automator images in folder , upload them ftp server. returns result below: ("http://url/0530/pic01/pic-01.jpg", "http://url/0530/pic01/pic-02.jpg", "http://url/0530/pic01/pic-03.jpg", "http://url/0530/pic01/pic-04.jpg", "http://url/0530/pic02/pic-01.jpg", "http://url/0530/pic02/pic-02.jpg", "http://url/0530/pic02/pic-03.jpg", "http://url/0530/pic02/pic-04.jpg", "http://url/0530/pic03/pic-01.jpg", "http://url/0530/pic03/pic-02.jpg", "http://url/0530/pic03/pic-03.jpg", "http://url/0530/pic03/pic-04.jpg") and workflow gets these strings , puts them in new text document. finally, here result in text editor: http://url/0530/pic01/pic-01.jpg http://url/0530/pic01/pic-02.jpg http://url/0530/pic01/pic-03.jpg http://url/0530/pic01/pi...

Storing variables from parsed text file using javascript -

the text file contains information want use website logging in purposes text file contains following..line line user:password user2:user2password i have tried using blob read text file variables not getting stored know going wrong or if able read file using method function readfile(){ var filename = txtname.value; file = login.txt; var blob = file.read(); var readtext = blob.text; var lines = data.split("\n && : " ); //adding file content label placed lblfilecontent.settext(readtext); ti.api.info(readtext); // dispose of file handle & blob. file = null; blob = null; } i've used in past read txt-file: javascript (jquery): function readfile() { $.post('path/to/php/read_file.php', { dir: 'path/to/file', file: 'file_name.txt', },function(file_contents) { if (file_contents != '') { //your code here } }); } ...

Get all value in JSONObject android -

i have jsonobject { "status": "fails", "validation": { "a": [ "fd", "message 1" ], "aa": [ "2", "message 2" ], "aaa": [ "2", "message 3" ], "afda": [ "2", "message 4" ], "ada": [ "2", "message 2" ], "aca": [ "2", "message 5" ] }, "debug": "", "data": null } because jsonobject in project dynamic. so, possible values in jsonobject regardless keys? for example: desire result array of string: ["message 1","message 2","message 3","message 4","message 5"] try example use full android_json_parser and this android-json-parsing-tutorial

php - Count Number of Revisions for a Wordpress Post -

i display number of revisions specific wordpress post. example, if post id "78" updated 8 times, echo number "8" in php. you may try this: $args = array( 'post_parent' => 78, // id 'post_type' => 'revision', 'post_status' => 'inherit' ); $query = get_children($args); echo count($query); // i.e. 7

c# - configuring deployment of web service -

i have defined rules in xml file. when running service getting nodes of xml file, when deploying web service, folder containing xml file not copied server!! i.e when publish folder not there, service throwing error stating xml file not found what changes should make ensure xml file getting copied along parent folder during deployment? what ide using ?? if visual studio can before publish set property 'copy out directory' 'always copy' , set property 'build action' 'content' in xml file propeties. copied when publish service.

iOS: UDID is upper case -

i know ios device udid , case-sensitive. have query, client sent me upper case in udid characters. have never seen upper case letters in udid's. don't find document says udid can have upper case letters consists. need create right build them. advise, should ask client now? can't them, udid incorrect. can ask them make sure case-sensitive , send me back? also, can udid have upper , lower case combination in letters? thank you! you can convert lowercase safely. udids the output of sha1 function , , represented typical string of hexadecimal characters. don't need worry "a" meaning different "a", it's different formatting same values. change capitalization format desire (lowercase, in case), , not worry it, unless have other reason believe client sent wrong thing (wrong length, , characters other 0-9, a-f/a-f both warrant raised eyebrow).

php - Order a list by the second and third text in a field -

i have table text column, prono , values contain 4 (4) combination numbers - in-between them. example data: id prono 01 012-40-45-7894 02 045-12-13-8048 03 012-40-44-9704 i wanted fetch whole row , sort list database based on second , third number . there way this? currently, , temporarily, sort them whole. mysqli_query($connection,"select * table order prono"); and output (based example data above): id prono 03 012-40-44-9704 01 012-40-45-7894 02 045-12-13-8048 but what need output (it arrange based on second , third pattern of numbers): id prono 02 045-12-13-8048 03 012-40-44-9704 01 012-40-45-7894 is doable? , how? try use substring select * table order substr(prono,5,2), substr(prono,8,2) substring gives substring of prono position 5 length 2 , other stubstring 8 length 2 (what substring need order. more information tu substr can find on mysql.com

java - How to resize JPanel when JFrame is maximized? -

Image
i new java swing, try create swing app format text. when click maximum button, text panel's length not resize, , middle panel takes large space. and seems setresizable(false) not work code public class mainframe extends jframe { private static final long serialversionuid = 7553142908344084288l; private jtextarea fromtextarea; private jtextarea totextarea; public mainframe() { super("jformatter"); panel mainpanel = new panel(); mainpanel.setlayout(new boxlayout(mainpanel, boxlayout.x_axis)); setcontentpane(mainpanel); fromtextarea = createtextarea(); lines.setborder(borderfactory.creatematteborder(0, 1, 0, 1, color.light_gray)); lines.seteditable(false); font f = new font(font.sans_serif, font.plain, 16); lines.setfont(f); jscrollpane fromtextareascrollpanel = new jscrollpane(fromtextarea); fromtextareascrollpanel.setborder(borderfactory.createemptyborde...

ios - Store a value for the app's running time -

i need store boolean value persist app's running time. when user quit app (from background well) variable should reset default. how can this? i tried constants. keep constants in separate .h file. in declared this. const bool hasshowntutorial = no; and in view controller, if (hasshowntutorial == no) { [self showapptutorial]; hasshowntutorial = yes; } i error @ hasshowntutorial = yes; saying read-only variable not assignable. i tried going using nsuserdefaults . thing value stored once set it. there way clear when app quits? i'd appreciate input , suggestions. thank you. store in nsuserdefaults under specific key. [[nsuserdefaults standarddefaults] setbool:<mybool> forkey:@"mykey"]; then retrieve later. bool b = [[nsuserdefaults standarddefaults] boolforkey:@"mykey"]; if want clear data. nsstring *domain = [[nsbundle mainbundle] bundleidentifier]; [[nsuserdefaults standarduserdefaults] removepersistentdom...

c# - OrderBy list for only Date but not Time -

i have ilist<customclass> my customclass: createddate(datetime), name(string), number(int) i use orderby(p => p.createddate) my question: how custom or find way order createddate date, not include time when order? given createddate of type datetime can following. orderby(p => p.createddate.date)

How to pair date rows in mysql -

how pair rows imperfecty in mysql? imperfect, meaning rows not paired in , out. sometimes, there 2 in 1 out or no out @ or 2 or more out 1 in or no in @ all. table this: | id | action | date | +----+--------+---------------------+ | 1 | in | 19.1.2012 15:41:52 | | 1 | out | 19.1.2012 15:55:52 | | 2 | in | 19.2.2012 15:55:52 | | 2 | out | 19.2.2012 17:55:53 | | 1 | in | 19.3.2012 15:55:54 | | 1 | in | 19.3.2012 17:55:55 | | 1 | out | 19.3.2012 19:55:56 | | 3 | in | 19.4.2012 15:55:57 | | 3 | out | 19.4.2012 17:55:58 | | 3 | out | 19.4.2012 19:55:59 | +----+--------+---------------------+ the desired result this: +----+--------+---------------------+ | id | action | date | +----+--------+---------------------+ | 1 | in | 19.1.2012 15:41:52 | | 1 | out | 19.1.2012 15:55:52 | | 2 | in | 19.2.2012 15:55:52 | | 2 | out | 19.2.2012 17:55:53 | | 1 | in | 19.3.2012 17:55:5...