Posts

Showing posts from 2013

jquery - If input field is empty, disable submit button -

i'm trying disable submit button if user hasn't provided text. at first sight looks works fine, if user types text, deletes it, submit button becomes enabled. here code: $(document).ready(function(){ $('.sendbutton').attr('disabled',true); $('#message').keyup(function(){ if($(this).val.length !=0){ $('.sendbutton').attr('disabled', false); } }) }); you disabling on document.ready , happens once when dom ready need disable in keyup event when textbox gets empty. change $(this).val.length $(this).val().length $(document).ready(function(){ $('.sendbutton').attr('disabled',true); $('#message').keyup(function(){ if($(this).val().length !=0) $('.sendbutton').attr('disabled', false); else $('.sendbutton').attr('disabled',true); }) }); or can use conditional oper...

c# - If Best Fit Straight Line the best method for prediction -

i need make prediction next point, based on given set of point samples on 2-d coordinate system. i using best-fit straight line method such prediction. please let me know if there method better best-fit straight line? my code below: public class lineequation { public double m; //slope public double c; //constant in y=mx+c } public class point { public double x; public double y; } public class bestfitline { public point[] points = new point[7]; public void inputpoints(point[] points) { (int = 0; < points.length; i++) { points[i] = new point(); } points[0].x = 12; points[0].y = 13; points[1].x = 22; points[1].y = 23; points[2].x = 32; points[2].y = 33; points[3].x = 42; points[0].y = 23; points[4].x = 52; points[4].y = 33; points[5].x = 62; points[5].y = 63; points[6].x = 72; points[...

asp.net - I am using UrlRewritingNet.UrlRewrite dll, how to redirect to Error page when bad request get fired? -

Image
currently using urlrewritingnet.urlrewrite dll url rewriting in asp.net #3.5. without using special character works fine ex. url1. after giving special characters in url throws bad request error ex. url2 url1: http://www.example.com/search/0253 url2: http://www.example.com/search/0253:0253 to handle error, want redirect other error page, how can this? on iis 7+ can define error pages statuses, 400 bad request : <httperrors> <error statuscode="400" path="/bad-request.aspx" prefixlanguagefilepath="" responsemode="executeurl"/> </httperrors> or trough iis console go error pages , add custom error page status code 400 :

debugging - XCode 4.6 crash report stacktrace only -

a customer send me crash log, contains stack trace. stack trace generated custom developed exception handler. exception message: nsinvalidargumentexception exception reason: *** setobjectforkey: object cannot nil (key: pop_year) stacktrace: ( 0 corefoundation 0x3a9dc3ff <redacted> + 186 1 libobjc.a.dylib 0x39a35963 objc_exception_throw + 30 2 corefoundation 0x3a93e5ef <redacted> + 142 3 simplystats 0x0004640b simplystats + 103435 4 simplystats 0x000458e1 simplystats + 100577 5 simplystats 0x00034b83 simplystats + 31619 6 libdispatch.dylib 0x337c4793 <redacted> + 10 7 libdispatch.dylib 0x337c7b3b <redacted> + 142 8 libdispatch.dylib 0x337c567d <redacted> + 44 9 libdispatch.dylib 0x337c8613 <redacted> + 210 10 libdispatc...

javascript - Show/Display the checked checkbox value using PHP or JS -

i thought if possible done php or javascript: let's have 2 checkboxes: <li><input type="checkbox" checked="checked" name="tuesday" value="111"/> tueday</li> <li><input type="checkbox" name="wednesday" value="112"/> wednesday</li> i want see value of checked="checked" 111 after page loaded. how can achieve this? if possible in php , javascript, have both methods. thank you! window.addeventlistener('load', function(){ var ch = document.getelementsbyname('tuesday')[0]; if(ch.checked) // use ch.value }); or if want display checked values: window.addeventlistener('load', function(){ var checkedvalues= []; var chs = document.getelementsbytagname('input'); for(var = 0; < chs.length; i++) if(chs[i].type.tolowercase() === 'checkbox' && chs[i].checked) ...

html - Show background image on hover -

i'm trying show background image text inside when im hoovering navigation link, reason image wont show up. here of title css .navigation h1 { position: absolute; right: 22px; top: -7px; display: none; padding: 4px 20px 4px 7px; color: #fff; white-space: nowrap; background: transparent url('http://i.imgur.com/dbncnpk.png') 100% 50% no-repeat; } html <div class="navigation"> <ul> <li> <h1>one</h1> <a href="#hem" class="active">one</a> </li> <li> <h1>two</h1> <a href="#two">two</a></li> <li> <h1>three</h1> <a href="#three">three</a></li> </ul> </div> and fiddle jsfiddle http://jsfiddle.net/vbsdp/1/ check out fiddle. you didn...

c# - How to detect that an XPATH expression is correct? -

is there way (regex or similar, c# preferred) detect if xpath expression correct before using it? i have been googling time , nothing seems appear. thanks in advance! carlos. try , if there thrown xpathexception, mean xpath syntactically wrong. xmldocument doc = new xmldocument(); xpathnavigator nav = doc.createnavigator(); try { var res = nav.compile(xpath); // ... } catch (xpathexception e) { // handle exception }

iphone - UICollectionView delegate's tap method not getting called -

i have collection view, datasource delegate works well, uicollectionviewdelegate : -(void)collectionview:(uicollectionview *)collectionview didselectitematindexpath:(nsindexpath *)indexpath { nslog(@"didselect"); } not called, although set delegate (as did data source , worked) have mention cell loaded nib , connected subclass of uicollectionviewcell , anyway cells not respond touch. enabled user interaction in uiimageview in cell. also : -(bool)collectionview:(uicollectionview *)collectionview shouldselectitematindexpath:(nsindexpath *)indexpath { nslog(@"this caled"); return yes; } is not getting called! as mentioned did set: [self.collectionview setdelegate:self]; and of course <uicollectionviewdelegate> also don't have touchbegan override .. update : weird! gets called if long press! how can fix this, set delayscontenttouches no plus don`t have gesture recognizers implemented. help please. thanks. it...

php - How do I evaluate from a textarea? -

here's tried: <form method="post" action="new.php"> <font color="#c0c0c0"><small>it doesn't highlight still works. , feel free resize it!</small></font><br /> <textarea name="high" class="prettyprint">insert code here</textarea><br /> <button class="btn btn-large btn-success" type="submit">debug</button> </form> </center> <h1>debug info:</h1> <pre><?php if(isset($_post['high'])){ $high = (get_magic_quotes_gpc()) ? stripslashes($_post['high']) : $_post['high']; eval($high); }?></pre> i need evaluate code textarea executes php code (i put echo 'hi' in textarea , gives error:) parse error: syntax error, unexpected '<' in /home/a3827523/public_html/new.php(44) : eval()'d code on line 1 i don...

iphone - Having trouble with AutoSizing between 3.5" and 4" size screens -

Image
i having bit of trouble autosizing of uiscrollview within nib file. resizes fine in inspector view when comes on device 1 on 3.5" version takes height of 4" version. as can see images below resizes correctly in interface builder view on device view frame long 3.5" device. i can change frame of view in code using absolute values i'd rather try , working automatically resizing. it problem uiwindow. go uiwindow properties , check have enabled full screen @ launch

formal languages - Context-sensitive grammar -

i'm looking context-sensitive grammar describes following language: l = { ww | w ∈ {a,b}*, |w| ≥ 1} <br> i've got problems fact no rules such x -> ε allowed , therefore can't place nonterminal indicating "middle" of word. there trick problem? if happen know answer, please help. sure, easy. in context-sensitive grammar, can have strings on lhs; that's context. let's end string this: abababwababab alright, don't want rule like w := -empty- excellent. how these rules? awa := aa awb := ab bwa := ba bwb := bb of course, implies should avoid introducing w unless you're sure you're going have non-empty string.

c++ - how can I get smaller scale in RAND function -

this question has answer here: c++ random float number generation 14 answers i use code create random number between 0 , 1. randnumber = (double)((double)rand() / (double)rand_max); this line of code regularly give me numbers 0.650434, 0.302340 , 0.906789 big numbers me. problem need smaller range number these numbers: 0.000200, 0.000100, 0.000400, 0.000600 , on. how can modify line of code result? do know kind of probability distribution function you're looking for? if still want uniform can divide [0,1) result large number , apply shift it's centered around value want. if want that's distributed can use inverse transform method . again you'll need center , modify standard deviation. there similar transformations other distributions well

components - There is a TCustomStyleServices in Delphi 7? -

in order override tpanel's paint procedure make background color clwhite in delphi 7, following @rruz answer , can't find tcustomstyleservices class. there alternative want? i'm using xpman resource (idk if changes anything). since delphi7 not support vcl-styles, setting parentbackground false , color clwhite should fit requirements.

opencart SMTP newsletter error -

i'm getting error when try send newsletter clients in opencart. problem when send 1 client send successfully. however, when try send of clients, error: ehlo not accepted server. can me this? opencart provide many newsletter extension paid or free. refer links: newsletter --commerical newsletter1 --commerical free newsletter --free once included, should working fine.

java - Eclipse organize folders without using packages -

when designing stand-alone application customary of me use packages differentiate between types of classes should where. helped in finding classes , organizing enums views , listeners, etc. however, have been developing library, doesn't make sense use packaging structure because don't want make these enums , views public. should protected such user of library not have unnecessary access , visibility these useless components. but, in order seem have have them in same package, of course cause complete congestion of classes in 1 place without organization. is there way or plugin perhaps let me organize these classes? of great help. had seen couple questions responses such 'it can't done', assume plug-in out there , i'm sure plenty of people have come across this. maybe there easy solution...

Geolocation not working on webview android -

i 'm trying create application find location of user , show location on map. have read other articles issue , suggested solutions nothing worked me. web app runs in browsers (mobile , pc) when trying run application stacks in javascript of html file. think problem of permissions in javascript. code of project. java code import android.os.bundle; import android.app.activity; import android.view.menu; import android.webkit.webchromeclient; import android.webkit.webview; import android.webkit.geolocationpermissions; public class mainactivity extends activity { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); webview webview = (webview) findviewbyid(r.id.webview); webview.getsettings().setjavascriptenabled(true); webview.getsettings().setjavascriptcanopenwindowsautomatically(true); webview.getsettings().setgeolocationenabled(true); web...

iphone - How to set the character limit limit in three UITextfield -

this question has answer here: set maximum character length of uitextfield 37 answers i have 3 textfield. 1.textfield1 = 15 charecter 2.textfield2 = 50 charecter 3.textfield3 = 50 charecter code snippet if (textfield1 .text.length <15 && textfield2 .text.length <50 && textfield3 .text.length <50) { return yes; }else{ return no; } how set limit of 3 uitextfield. thanks in advance try this, - (bool)textfield:(uitextfield *)textfield shouldchangecharactersinrange:(nsrange)range replacementstring:(nsstring *)string{ nsuinteger length = [textfield.text length] + [string length] - range.length; if([textfield isequal:textfield1]) { if(length<15) return yes; else return no; nslog(@"1"); } else if([textf...

Start thread in OnClick in an adapter Android -

in application have adapter button. in onclicklistener of button must start thread modify ui, receive error. code is: public view getview(final int position, view convertview, viewgroup parent) { final viewholder holder; if (convertview == null) { holder = new viewholder(); convertview = inflater.inflate(r.layout.detailnews_layout, parent, false); holder.commentbutton = (imageview) convertview .findviewbyid(r.id.imagebuttoncomment); convertview.settag(holder); } else { holder = (viewholder) convertview.gettag(); } final view commentview=convertview; holder.commentbutton.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { if (menuposition == false) { holder.commentslayout.animate().translationy(-950) .setduration(2000); runnable commentsrun = new commentthread(position, commentview, holder); ...

c# - Pivot json data from array of models -

i host web api service, returns snapshot of model "mymodel" last 12 months. json array receive on client simple array of 12 "mymydel" objects. if mymodel has properties "foo" , "bar", there efficient way in javascript pivot array result in collection of arrays of properties, example: i'd transform history{ mymodel[] mymodel[0] foo: 1 bar: 2 key: 1 mymodel[1] foo: 3 bar: 4 key: 1 } into history{ "1"{ //key foo[] foo[0]: 1 foo[1]: 3 bar[] bar[0]: 2 bar[1]: 4 } } i open implementing on server side if more efficient. api service .net 4.5 web api. so again. question is, there super efficient way achieve these results in javascript? if not, there 1 in c#? can provide simple example code me going? help appreciated. thanks! edit: working code even though voted down on this, figure i'd provide working...

Accessing Remote Mysql via c# from local pc -

i working on winform application on c#. have access remote mysql database. have paid server , added ip address in remote access ip address list. but still not able access remote database. want know whats way then, connection string in c#. idea helpful. thanks in advance. here list of connection string settings mysql if don't work, check firewall settings, try via mysql command prompt.

sql - Query selecting common part of selected records -

i have problem constructing simple query, complicated using count function comes mind. here table: id | | b ----------- 1 | 1 | 1 2 | 1 | 2 3 | 1 | 3 4 | 1 | 4 5 | 2 | 1 6 | 2 | 2 7 | 2 | 5 8 | 2 | 6 9 | 3 | 1 10 | 3 | 3 11 | 3 | 7 i need values b, exist in every selected a. example table = 1 , 2 output b = 1 , 2 my plan take b, in selected using function in. , using function count count every b , if equal number of selected right. my second based on loop. use vba, first query find b a=1, b found in previous step find that, a=2 , on. complicated. what's opinion that. thank reply. examples: a in {1,2} => output: b = {1,2}, because b = 1 = 1 id = 1 , b = 1 = 2 id = 5 (similar way b = 2) b = 3 = 1 id = 3, not b id in {1, 2, 3} => output: b = {1}, in {1, 3} => output: b = {1, 3}, in {2, 3} => output: b = {1} select b.b (select b tablex = val1) join (select b tablex = val2) b on a.b=b.b untested.

actionscript 3 - Flash Embedded FLV Memory Leak -

i making game have several small character movieclips appear on screen randomly. there can several characters of same type, , when removed stage store them in memory pool reuse them. these characters have several different keyframes call make them specific things, fly, land, etc. improve performance flvs made different actions , these have been embedded in timeline. i having problem amount of memory assigned video increasing game played, though not making more instances of characters. have been researching garbage collecting video stuff find when using flvplayback component , haven't found helpful. does have ideas? thanks! how memory increasing? if it's starting @ ie. 80 mb , slowy increasing ie. 140, , either staying there or decreasing 120 , again going up, there's no need worry. unfortunately that's how flash gc works. if you're not leaking memory show memory increase (and sudden bob down, gc collects trash, , again up). however, have real ...

path of drawable folder in android studio -

what path of drawable folder in android studi0 ? in android studio , directory structure is myapp | .idea | assets | gen | res | | | drawable src | | | com.example.mobile | | | | | activity | | utils | androidmanifest.xml | externallibraries thanks. this path of drawables app\src\main\res\

connections - Connestions ActivityStreamService getActivityStream throws NullPointerException. -

i try access activity stream. i'm authenticated map<string, string> header = new hashmap<string, string>(); header.put("content-type", "application/json"); activitystreamservice svc = new activitystreamservice("giconnections"); this.list = svc.getactivitystream("@me", "@all", "@all", header); but list empty. debug deep in sdk found place: com.ibm.sbt.util.datanavigator$json._extractchildren the jsonfactory asked if prop array. prop null , jsonfactory throws nullpointerexception } else if(factory.isarray(prop)) { the requested property "attachments" , activity stream entry has no attachments. :-( added entry attachment , throws same error image of attachment. what wrong? cannot believe sdk throws errors on simple situations. thx andreas can try on latest openntf build. fix issue has been delivered. link download latest build : http://ibmsbt.openntf.org/

javascript - Changing the color of a clicked table row using jQuery -

i need help, how can i, using jquery, change background color of selected row in table (for example, let's use the css class "highlighted" and if same row clicked on again, change default color (white) select css class "nonhighlighted" <!doctype html> <html> <head> <style type="text/css"> .highlighted { background: red; } .nonhighlighted { background: white; } </style> </head> <body> <table id="data" border="1" cellspacing="1" width="500" id="table1"> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> ...

c# - How can I remove bookmarks from an OpenXML docx file? -

i thought following work: var bod = worddoc.maindocumentpart.document.body; foreach (var bookmark in bod.descendants<bookmarkstart>()) { bookmark.remove(); } foreach (var bookmark in bod.descendants<bookmarkend>()) { bookmark.remove(); } but corrupts file. try this, worked on document. var bs = worddoc.maindocumentpart.document .descendants<bookmarkstart>() .tolist(); foreach (var s in bs) s.remove(); var = worddoc.maindocumentpart.document .descendants<bookmarkend>() .tolist(); foreach (var e in be) e.remove();

publishing - Can you get Target Environment web.config transforms when packaging an Azure Web Role? -

i'm quite used publishing websites iis , azure using publish profiles feature of visual studio 2012. big feature me ability specify configuration transform file per environment, such can apply both "release" config transform , "production" config transform produce single result release build tailored production environment. now i'm trying build azure worker role, supports idea of multiple discrete configurations role , apply "release" or "debug" build configuration transforms depending on packaging settings. is possible apply target environment config transform web.config in similar fashion how publishing works? to clarify, want apply multiple config transforms web.config of web application hosted in web role based on build configuration , target environment. have @ answer here: azure web role configuration settings across environments the best solution i've found keep web.config transforms (debug/release). the...

python - Editing a duplicate list edits the original -

so i've started simple sort of roguelike game project in python, have problems editing duplicate list editing original. code follows: charx = 1 chary = 1 level = [["#","#","#","#","#","#","#"],["#",".",".",".",".",".","#"],["#",".","#",".",".",".","#"],["#","#","#","#","#","#","#"]] while true: move = raw_input("u,d,l or r: ") if move=="u": if level[chary-1][charx]!="#": chary-=1 elif move=="d": if level[chary+1][charx]!="#": chary+=1 elif move=="r": if level[chary][charx+1]!="#": charx+=1 elif move=="l": if level[chary][charx-1]!=...

android - Syncing UI Thread and workhorse thread -

hi have 1 thread uses surfaceview draw screen thread updating positions of objects on screen. how make these run @ same speed? there trade off: you want update screen sufficiently motion appears smooth. you want give cpu possible workhorse thread the easy solution this: the work horse thread sets flag indicating when there has been change worthy of redraw. the ui thread has flow bit this do { renderscreen(); while (!screenneedsredrawing) { thread.sleep(10); } }

XCode 5 Core Data Model Crashes -

i using xcode5-dp3 , osx mavericks on macbook pro, know xcode 5 still beta version, core data model bugging me time. everytime try open core data model file, xcode 5 shows 1 second , crashes. same project , file works fine xcode 4 . i searched lot , didn't find answer, apple doesn't mention in release notes either. found here having same issue xcode 4 , don't think it's because y core data model file, , tried open raw text file got nothing. there anyway resolve issue? it have been fixed in xcode5-dp4.

android - Openfire offline message in wrong order -

i using smack library in android project create instant messenger. using messagelistener receive messages , chatmanager send messages, offline messages in wrong order. on server have openfire installed. for instance online user sends 3 seperate messages "a", "b" , "c" offline user. when offline user comes online message not received in right order. displayed "c", "b" , "a". why so? , how can issue resolved? thank in advance help. this seems openfire bug or misconfiguration. xmpp messages should delivered in order: an xmpp server must ensure in-order processing of stanzas , other xml elements receives on given input stream connected client or remote server. in-order processing applies (a) xml elements used negotiate , manage xml streams, , (b) uses of xml stanzas, [...] -- rfc6120 section 10.1 offline messages not explicitly mentioned, server feature , not documented in protocol. there no ...

vb.net - What would be a better way to make a calendar than using labels? -

i've created own winforms month-view calendar in vb.net. to i've used table layout panel, 42 separate cells. in each of cells label called lblday1 , lblday2 , etc. when load page, labels written correct numbers month. dim daysinmonthcnt integer =31 'assume 31 days dim firstday integer = weekday("1/" & now.month & "/" & now.year) 'get weekday 1st of month daycount integer = firstday daysinmonthcnt dim lbl label lbl = ctype(pnlmonthbody.controls("lblday" & daycount), label) lbl.text = daycount 'write label next daycount unfortunately, turns out incredibly slow load. can please suggest faster method. just writing values small number of labels fast process. problems experiencing have vb.net "problems" while refreshing contents of gui controls; best way fix looking multithreading, suggested fraserofsmeg. as far think pretty simplistic gui low number of controls , not demanding ...

javascript - RaphaelJs: Circle doesn't show proper value -

Image
i have problem raphael library. i'm trying load image inside circle in 4 steps: 1 step = 25% of circle 2 step = 50% of circle 3 step = 75% of circle 4 step = 100% of circle if start step 2(50%) works fine, if start 25% image doesn't show proper. looks image out of circle. here live example, hope explain mean. http://jsfiddle.net/h4cjf/1/ var amount = 25; var archtype = raphael("canvas", 350, 350); archtype.customattributes.arc = function (xloc, yloc, value, total, r) { var alpha = 360 / total * value, = (90 - alpha) * math.pi / 180, x = xloc + r * math.cos(a), y = yloc - r * math.sin(a), path; if (total == value) { path = [ ["m", xloc, yloc - r], ["a", r, r, 0, 1, 1, xloc - 0.01, yloc - r] ]; } else { path = [ ["m", xloc, yloc - r], ["a", r, r, 0, +(alpha > 180), 1, x, y] ]; } ...

php - Can't get a session id -

i must have funky new server setup. (cent os) these 2 simple lines of code give me blank session id. shouldn't session id automatically generated , assigned? session_start(); echo "your session_id=".session_id()."<br/>"; thanks.

sql - Inserting into a temporary table from an Execute command -

i need insert data select statement temporary table using execute command. if object_id('tempdb..#x') not null drop table #x create table #x(aaa nvarchar(max)) declare @query2 nvarchar(max) set @query2 = 'select [aaa] imp_temp' insert #x select [aaa] imp_temp -- works select *from #x insert #x exec @query2 -- not works, why? select *from #x you need parenthesis around @query2 variable. exec command execute stored procedure, while exec() function executing dynamic sql taken parameter. insert #x exec (@query2) select *from #x reading material

django - Ndb models: assure uniqueness in datastore using custom key_name -

i'm trying mimic django's unique_together feature, can't seem straight class myclass(ndb.model): name = 'name' surname = 'surname' phone = 'phone' def get_unique_key(self): return self.name + "|" + self.surname + "|" + self.phone "yeah, pretty easy" not according accepted answer in this post , assigning id param in obj constructor enough. don't want handle in view. ideally, i'd this: object = myclass() object = object.custom_populating_method(form.cleaned_data) object.id = object.get_unique_key() object.put() or better, place in _pre_put_hook , id set last thing before saving (and maybe checking enforcing uniqueness of data across datastore). apparently, wrong. way achieve hacking view: unique_id = "|" + form.cleaned_data['bla'] + "|" + form.cleaned_data ... object = myclass(id=unique_id) which awful , wrong (since every change model'...

digital signature - C# Cades P7M with Smartcard -

i read post how can sign file bouncycastle dll in c# , know if possible found support certificates stored in smartcard. what i'm trying create p7m cades seems impossibile found dopcumentation, .net classes or free library. you can try c# ported version of european commission initiative: dss .net it supports cades. try using mscapisignaturetoken , guide in cookbook cookbook

java - Android Studio: Unable to resolve Symbol 'requestLocationUpdates' -

working basic gps code , running issue new android studio - mean preview software far has been reliable enough used full time. here code giving me issue: import android.app.activity; import android.app.alertdialog; import android.content.context; import android.content.dialoginterface; import android.content.intent; import android.location.location; import android.location.locationlistener; import android.location.locationmanager; import android.os.bundle; import android.widget.textview; public class whereami extends activity implements locationlistener{ textview lat, lon, alt, status; context mycontext = this; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.whereami); lat = (textview)findviewbyid(r.id.lattxt); lon = (textview)findviewbyid(r.id.lontxt); alt = (textview)findviewbyid(r.id.alttxt); status = (textview)findviewbyid(r.id.gpsstatus); } /* use locationmanager class obta...

shell - Using ImageMagick in Command Line in Android -

i have rooted android device , want run imagemagick library commands on android command line - example, when run command in windows command line "adb shell convert /sdcard/rose.jpg /sdcard/rose.png" should convert file png. possible? looked @ https://github.com/puelocesar/android-lib-magick these lie can used libraries app , not directly? there way of doing or other way of doing command line image manipulation in android can invoke windows?

Can I use Codeigniter for login and PHP for other functionality? -

my client has website built on php (without framework). website prone attacks 75% of work done. keeping scalability in mind want migrate codeigniter client wants mvp released in 30 days. can use partial codeigniter , continue existing php code. thank you. you have not given lot of detail, here goes..... firstly things might worth letting community know are: some coding examples exist in current project the type of application / web site being built what mean scalability (10s or 100s or millions of users)? making assumptions here thoughts..... time if want task correctly first time no 30 days, if large application may take long test it, let alone (re)write it. codeigniter have used codeigniter before? suspect not if you're asking on here how easy or difficult might be. take @ least 1 project framework , start use correctly. should make dummy application framework before starting production work in it, first batch of code inside framework have issues. ...

javascript - Reliably return element's scrollHeight without using `scrollHeight` property -

using either plain javascript or jquery, need full height of scrolling element. dom property scrollheight is apparently not 100% reliable . i envisioning temporarily giving item css height of auto , checking out size, returning css prior value (which has problems--how css height:100% instead of height:1012px jquery .css('height') return). figured out due way jquery applies css styling directly element, applying style '' returns normal style-sheet-declared value, theoretically this: $el.css('height', 'auto'); scrollheight = $el.height(); $el.css('height', ''); but isn't working. height:auto isn't overriding element's original style of 100% , making element take full desired height. so i'm thinking more along these lines: use position of first child element's top , position of last child element's bottom height. (i can adjust padding , margin if necessary, proof of concept.) function scrollheigh...

javascript - Timeout for mouseover and mouseout of drop down menu? -

i want make menu drop down http://www.huffingtonpost.com site. tried custom timeout mouseover , mouseout site can't. jquery: var navtimers = []; $('.mcats > ul > li').each(function(){ $(this).hover(function(){ var $this = $( ); var id = jquery.data( ); navtimers[id] = settimeout( function() { $this.addclass('hover'); navtimers[id] = ""; }, 250 ); }, function(){ var $this = $( ); var id = jquery.data( ); if ( navtimers[id] != "" ) { cleartimeout( navtimers[id] ); } else { navtimers[id] = settimeout( function() { if(!$this.is(':hover')) { $this.removeclass('hover'); navtimers[id] = ""; } }, 600 ); } }); }); here demo http://jsfiddle.net/rebeen/fskbl/ ...

Using PHP to append JSON file with new MySQL data -

i'm working on reading information in database json file. code have reads file fine i'm looking way append new data not present in file already. every time run code adds of information stored in database each time. $con = mysql_connect('localhost', '', '') or die('error connecting server'); mysql_select_db('twitter', $con); $file = 'file.json'; $query = mysql_query('select * sample_data'); //define columns $table = array(); $table['cols'] = array( array('label' => 'username', 'type' => 'string'), array('label' => 'retweet_count', 'type' => 'number'), array('label' => 'origin', 'type' => 'string'), array('label' => 'destination', 'type' => 'string'), array('label' => 'text', 'type' => 'string'), ...

ios - Stream Audio/Video from an iphone app using HTTP Live Streaming -

i trying existing stream music/video on iphone using http live streaming. read apple docs on http live streaming ( http://developer.apple.com/library/mac/#documentation/networkinginternet/conceptual/streamingmediaguide/introduction/introduction.html ), , how works. what doesn't how 1 use iphone server? have add tools ios app(mediastreamsegmenter, variantplaylistcreator) , run nstask or there kind of native support stream media files. if want stream iphone app can't iphone acting server. need separate server can send data iphone app. can use camera or microphone in app live content , can send asynchronously data server, using mediastreamsegmenter , variantplaylistcreator convert data ts segments , append them @ end of m3u8 file , meanwhile iphone app can act client , watch live content streaming first app. from experience way achieve that. hope helps.

javascript - JQuery Ajax Submit Error Messages Stack -

i have form has required fields. display errors when click continue not enter required fields. if click continue again without entering required fields, previous error message stays, , new 1 created underneath it. should not happen. now clearified structure , how want work, should work you. remove previous error messages everytime form submitted. function submit_ajax_form() { $('.error_span').remove(); // submits form ajax especting json response $('#usermgmtform').ajaxsubmit({ success: function(response, statustext, xhr) { if (response['status'] == 'ok') { window.location.replace(response['location']); } else { jquery.each(response['errors'], function(field, errors) { jquery.each(errors, function(i, error) { $fieldid = $('#id_'+field); $fieldid.closest('.control-group').addclass('error'); ...

tfs2010 - Sharing a custom field across multiple team projects in TFS 2010 -

i have tfs 2010 installation several team projects. there way use same field name across multiple team projects? at current, when try add field "requested by" user store work item in 1 team project, error: tfs237094 : field name 'requested used field 'someotherteamproject.requestedby' cannot used field 'thisteamproject.requestedby'. update based on discussion, appears due trying add field same name different reference name. when creating fields in tfs "name" , "refname" have unique. re-using field "name" different "refname" not allowed. the common practice custom fields use refname company.fieldname opposed team project name. by default new field add available team projects in collection use.

c - How is a string literal equal to char*, and how should I take a string as a parameter -

i have seen in several pieces of code string declared char*. how work, surely pointer single char, not array of chars makes string. if wished take string input method called this: themethod("this string literal"); what datatype should parameter be? surely pointer single char, not array of chars it's pointer first character of array of char . 1 can access each element of array using pointer first element performing pointer arithmetic , "array" indexing. what datatype should parameter be? const char * , if don't wish modify characters within function (this general case), , char * if do.

html - Cut off part of element's content -

Image
is possible cut off part of div#outer in shape of div#inner? want achieve this: if background image show through hole, can use same image background of #inner div , set background-attachment fixed something <div id="outer"> <div id="inner">div#inner</div> div#outer <div> and body{background:url('someimage') 0 0 no-repeat;} #inner{ background:url('someimage') 0 0 no-repeat fixed; } demo @ http://codepen.io/gpetrioli/pen/gsbbd ( contains javascript move div around, click , drag )

How to read portions of text from a .txt file in Java? -

i wondering, there way read parts of string in .txt file? example, if "1,5,10,20" in .txt file, can tell java save "1" int, save "5" different int, , on? hope made clear enough! thanks guys! p.s know how read whole line of text in .txt file in java using bufferedreader, not how read parts of it. you can use scanner class, provides scanner#nextint() method read next token int. now, since integers comma( , ) separated, need set comma( , ) delimiter in scanner , uses whitespace character default delimiter. need use scanner#usedelimiter(string) method that. you can use following code: scanner scanner = new scanner(new file("demo.txt")); scanner.usedelimiter(","); while (scanner.hasnextint()) { system.out.println(scanner.nextint()); }

reading xml form URL with from jsp -

how can read xml file url example: http://eampl.ecom/text.xml and show exact whole xml body in jsp page? i have tried jdom in jsp <%@ page import="org.jdom2.document" %> <%@ page import="org.jdom2.element" %> <%@ page import="org.jdom2.input.*" %> <% stringbuilder responsebuilder = new stringbuilder(); try { // create urlconnection object url url url = new url( "http://eampl.ecom/text.xml" ); urlconnection conn = url.openconnection(); httpurlconnection httpconn; httpconn = (httpurlconnection)conn; bufferedreader rd = new bufferedreader(new inputstreamreader(httpconn.getinputstream())); string line; while ((line = rd.readline()) != null) { responsebuilder.append(line + '\n'); } ...

RequireJS module attempts to load shim'ed module -

i'm having issue attempting create requirejs shim javascript code written team in organization. script loaded via noraml html script such: <script src="mycustommodule.js" type="text/javascript"></script> my main.js contains following: requirejs.config({ paths: { 'text': 'durandal/amd/text' }, shim: { 'mycustommodule': { exports: 'my.custom.module' } } }); and have tried accessing custom module in variety of ways, current code: define(['mycustommodule'], function (require, mycustommodule) { ... } but each time page/app loads error requirejs indicating failed load app/mycustommodule.js (and can see 404 error in console attempted request file server). doing wrong? you need include mycustommodule in paths : requirejs.config({ paths: { 'text': 'durandal/amd/text' 'mycustommodule': 'path/to/mycustommodule' }, ...

asp.net mvc 4 - DefaultModelBinder Returning Subclass MVC4 -

i've been trying read defaultmodelbinder couple of days i'm still confused. using mvc 4 & ef 5 tableperhiearchy structure. my problem have base class of resource: public class resource : pocobasemodel { private int _resourceid; private string _title; private string _description; //public accessors } that has sub classes (dvd, ebook, book, etc) public class dvd : resource { private string _actors; //more fields , public accessors } my controller code uses custom modelbinder [httppost] public actionresult create([modelbinder(typeof(resourcemodelbinder))] resource resource) { //controller code } public class resourcemodelbinder : defaultmodelbinder { public override object bindmodel(controllercontext controllercontext, modelbindingcontext bindingcontext) { var type = controllercontext.httpcontext.request.form["discriminatorvalue"]; bindingcontext.modelname = type; bindingcontext.modelmetada...

nspredicate - Core Data: Fetching all entity objects having to-many-relationship object with certain value -

Image
i have following relationship in core data: what's correct nspredicate courses having @ least 1 student on age of 25? [nspredicate predicatewithformat:@"any students.age > %d", 25] should work (as predicate fetch request "course" entity).