Posts

Showing posts from August, 2011

When and where may I load data, from a remote API, in my Ember.js application? -

i'm learning ember.js, , writing application want perform following tasks ... load data local storage check 3rd party api new additional data append additional , save entire thing local storage display table of data my application single route. i'm using ember.route 's model hook load data local storage. spot check 3rd party api new data, though? should in model hook? i'd able display sort of loading icon during query 3rd party api , i'm not sure if model hook allow me this? right now, route contains following code ... app.historyroute = ember.route.extend({ model: function (params) { // initialize model var model = { summoner: params, history: [] }; if (typeof(localstorage.history) == 'undefined') return model; // fetch data local storage var history = json.parse(localstorage.history); // check existing data if (!history.hasownkey(params.region) || !history[par

Javascript object to PHP -

i posting javascript objects php backend not able retrieve data. i posted java-script object: {"name":"mastermold"} i trying access name this: $name= $_post["name"]; the error is: {"error":{"type":"errorexception","message":"undefined index: name","file":"c:\program files (x86)\ampps\www\app\controllers\journalscontroller.php","line":34}} savemongojournal=function(thejournal,dothis) { journalroute="http://localhost/public/journals" $http.post(journalroute,thejournal).success(dothis); }; $scope.clicky= function(){ savemongojournal( {name: "mastermold"},alertreply); }; $_post['name']; you may try (check this answer ) $data = json_decode(file_get_contents("php://input")); echo $data->name;

node.js - mongoose, how to create a schema has object in it? -

here's photoschema. has dbentry object. should create dbentry schema , ref in photoschema. or whatever have enough? new mongodb, try figure out correct way create schema. var photoschema = new mongoose.schema({ userid: objectid, type: string, createdon: {type: date, default: date.now}, isdeleted: {type: boolean, default: false}, isdownloaded: {type: boolean, default: false}, dbfile: string, dbentry: { revision: number, rev: string, thumb_exists: boolean, bytes: number, modified: date, client_mtime: date, path: { type: string, unique: true} } }); it depends on how plan access data. if want dbentry object each time query photoschema document, have way go. if however, you're going use dbentry independent of photoschema document, shoul

javascript - preventDefault() won't work with form.submit() -

i'm trying login form either close lightbox, or change text of errorbox depending on whether or not login attempt success. i'm not sure, think has onclick="formhash(this.form, this.form.password);" which js function hashes password, continues form submit. ends with form.submit(); here's code: html: <form action="includes/process_login.php" method="post" name="login_form"> email: <input class="searchform" type="text" name="email" size="20"/><br /> password: <input class="searchform" type="password" name="password" id="password" size="20"/><br /> <input type="button" class="searchform" value="submit" size="40" style="height:45px; width:90px" onclick=&quo

yii - how to get one of the input textfield value through ajaxbutton -

how user's input value , submit ajax controller? right now, in controller says id undefined index in $_post['id'] this input textfield within form, kind of form inside form. <?php echo $form->textfield($model,'email',array('id'=>'email')); ?> <?php echo $form->error($model,'email'); ?> <?php echo chtml::ajaxbutton ( 'request code', chtml::normalizeurl(array('site/requestresetcode', 'render'=>true), array ( 'type' => 'post', //'data'=> array('id'=> 'js:$("#resetpasswordform_email").val()'), 'data'=> array('id'=> 'js:$("#email").val()'), 'success'=>'function(data){ if(data.status == "sent")

python - django __unicode__: \n and manytomany? -

class nickname(models.model): name = models.charfield() def __unicode__(self): return unicode(self.name) class bob(models.model): bob_nickname = models.manytomanyfield(nickname) def __unicode__(self): return unicode(self.bob_nickname) number1. how __unicode__ class bob display actual fk name, rather <django.db.models.fields.related.manyrelatedfieldsmanager object @ 0xdsfjk> ? edit : doing self.bob_nickname.all() seems work fine. aint pretty, displays info: [<nickname: ron>,<nickname: randy>] number2. also, how can def __unicode__ not escape \n ? i'd create multiline unicode string thank you! why don't use values_list related nick_names list? class bob(models.model): bob_nickname = models.manytomanyfield(nickname) def __unicode__(self): return u'\n'.join(self.bob_nickname.values_list('name', flat=true))

Writing data to a txt file file using java classes -

i trying understand why code not writing output textfile expect work. program takes filename command line argument, , prints text file screen. bit more complicated since uses classes , objects demonstrate how objects work. can decipher why not writing file? here's code:- public class mamoonp3test { public static void main(string[] args) throws exception { //create array of 10 guitar (mamoonp3) objects final int number_of_instances = 10; mamoonp3[] objectnames = new mamoonp3[number_of_instances]; try { string filename = new string(args[0]); for(int i=0; i<number_of_instances; i++) { objectnames[i] = new mamoonp3(filename); system.out.println("this guitar number: " + i); objectnames[i].tuneguitar(); objectnames[i].playguitar(); objectnames[i].displayacronym(); objectnames[i].stopguitar();

java - Remove In Range in an ArrayList -

i have following requirements write java method. write method called removeinrange accepts 4 parameters: list of integers, element value, starting index, , ending index. method's behavior remove occurrences of given element appear in list between starting index (inclusive) , ending index (exclusive). other values , occurrences of given value appear outside given index range not affected. for example, list (0, 0, 2, 0, 4, 0, 6, 0, 8, 0, 10, 0, 12, 0, 14, 0, 16), call of removeinrange(list, 0, 5, 13) should produce list (0, 0, 2, 0, 4, 6, 8, 10, 12, 0, 14, 0, 16). notice zeros located @ indices between 5 inclusive , 13 exclusive in original list (before modifications made) have been removed. have written method follows: public static void removeinrange(list<integer> list,int value,int beg,int end) { beg=new integer(beg); //integer b=beg; int count=0; list.sublist(5, 13); /* for( integer b:list.sublist(beg, end)) { if(list.get(b)==value)

issue with FaceBook.Helper in asp.net MVC -

on asp.net 2013 express mvc4 razor i installed facebook.helper nuget. now when app attempts run following error: compiler error message: cs0246: type or namespace name 'simplemembershipprovider' not found (are missing using directive or assembly reference?) source error: line 216: } line 217: line 218: private static simplemembershipprovider getmembershipprovider() { line 219: var provider = membership.provider simplemembershipprovider; line 220: i wondering if has come across issue , can tell me. i added webmatrix.data , webmatrix.webdata references , marked them (copy local: true) after add webmatrix.data , webmatrix.webdata references ,you must go app_code/facebook.cshtml , write above : @using webmatrix.webdata; @using webmatrix.data;

opengl - Cannot get open GL to run on Dev ++ -

i trying run opengl on dev c++. , cannot code run. i've tried on site: http://www.prinmath.com/csci5229/misc/devc_opengl_for_windows.pdf my operating system windows 7-64 bit. use different ide if school insists use dev c++. here code trying run: #include <gl/gl.h> #include <gl/glu.h> #include <gl/glut.h> void init() { glclearcolor (1.0, 1.0, 1.0, 0.0); glmatrixmode (gl_projection); gluortho2d (0.0, 200.0, 0.0, 200.0); } void linesegment() { glclear (gl_color_buffer_bit); // clear display window. color buffer glcolor3f (0.0, 0.0, 0.0); int p1 [ ] = {40,80}; int p2 [ ] = {160, 80}; int p3 [ ] = {100, 40}; int p4 [ ] = {100, 160}; int p5 [ ] = {0, 80}; int p6 [ ] = {200, 200}; int p7 [ ] = {100, 0}; int p8 [ ] = {100,200 }; int p9 [ ] = {30, 30}; int p10 [ ] = {0, 0}; glbegin(gl_line_loop); glvertex2iv(p1); glvertex2iv(p2); glvertex2iv(p3); glvertex2iv(p4); glflush ( ); } int main(int argc, char *arg

sqlite - android insists i don't have a column in my database table -

i can't figure out strange error while try insert value database error 01-01 15:48:56.065 10056-10056/com.autophone e/sqlitelog﹕ (1) table maintable has no column named status_date 01-01 15:48:56.100 10056-10056/com.autophone e/sqlitedatabase﹕ error inserting status_date=1 בינו 2000 15:48:56 problem=non model=n9005 phone_number=123 in_date=1 בינו 2000 15:48:56 status=received name=ian android.database.sqlite.sqliteexception: table maintable has no column named status_date (code 1): , while compiling: insert maintable(status_date,problem,model,phone_number,in_date,status,name) values (?,?,?,?,?,?,?) the main point says don't have "status_date" in main table how possible? public static final string key_rowid = "_id"; public static final int col_rowid = 0; private static final string key_name = "name";//1 private static final string key_model = "model";//2 private static final string key_phone_number = &q

linux - How to keep stderr output and also redirect it to file -

i tried ffmpeg -i rtsp://172.19.1.34/live.sdp -acodec copy -vcodec copy b.mp4 2>>log.txt 2>&1 to keep stderr output , redirect file. but failed. however, can keep stderr output by ffmpeg -i rtsp://172.19.1.34/live.sdp -acodec copy -vcodec copy b.mp4 2>log.txt you can redirect stderr stdout 2>&1 , , use tee command. cmd 2>&1 | tee -a log

python - Errors running celery with Django -

this project structure: fj_project |-- fj | |-- celerybeat.pid | |-- celerybeat-schedule | |-- celeryconfig.pyc | |-- fe | | |-- admin.py | | |-- forms.py | | |-- __init__.py | | |-- models.py | | |-- tasks.py | | |-- tests.py | | |-- views.py | |-- feja | | |-- celeryconfig.pyc | | |-- __init__.py | | |-- settings | | | |-- base.py | | | |-- celeryconfig.py | | | |-- __init__.py | | | |-- local.py | | | |-- production.py | | | |-- tasks.py | | | `-- test.py | | |-- urls.py | | |-- wsgi.py | |-- fj.sqlite3 | |-- __init__.py | |-- manage.py | |-- site-media | `-- templates | |-- 400.html |-- makefile `-- requirements |-- local.txt -- production.txt i start celery settings directory. , starts doesn't add tasks mentioned in fe directory. celeryconfig file: from __future__ import absolute_import celery import celery datetime import timedelta app = cel

mysql - How to implement sql "where not in" in tuple relational calculus? -

i want convert sql query has not in clause tuple relational calculus.existential , universal quantifier implements exists , not exists clause want know how implement not in? my tables serves(bar,beer),frequents(drinker,bar),likes(drinker,beer) .the following query selects drinkers frequent bars serve beer like. select distinct f2.drinker frequents f2 f2.drinker not in (select f1.drinker frequents f1 (f1.bar,f1.drinker) not in (select f.bar,f.drinker frequents f,serves s,likes l l.beer=s.beer , f.bar=s.bar , f.drinker=l.drinker)) it's enough if can explain me how implement not in in trc no need convert entire query.i using http://www-rohan.sdsu.edu/~eckberg/relationalcalculusemulator.html check relational calculus , convert sql query. note: if use implications in query. it not support implication.for example implication can implemented follows.(p==>q) can written (not p or q) form both logically equivalent. your query equal inner

css - Font looks great on Localhost and Horrible when live -

Image
here font on localhost: here same font on chrome (windows 7) when site live: i've tried appliying: -webkit-font-smoothing:antialiased #header's font this fix i've tried using text-shadow:0 0 0 transparent this is there can fix this? edit: here example of difference between local machine: and how bad looks on chrome (windows) below!

eclipse - How can I make NetBean's autocomplete function more responsive like Xcode? -

i've been xcode user quite while, , liked autocomplete functionality. now i'm working on java project, decided pick netbeans . have found autocompletion not responsive xcode : if have int myvariable = 10; and later type "my", xcode suggest myvariable . netbeans doesn't suggest when start typing line. if object stream has 2 methods writebytes , writedata : and begin typing stream.writeb both xcode , netbeans suggest writebytes . but if later decide wanted writedata instead, press backspace key delete b , add d . @ point, writed , xcode suggest writedata , but netbeans stop suggesting moment used backspace key . the same occurs eclipse. is there way make netbeans' (or eclipse's) autocompletion responsive xcode ? press ctrl + space suggestions displayed. after pressing d , press ctrl + space

How do you borrow a mutable pointer in rust? -

i have function returns result<&'a ~foo, barerr>, can access using: match x.borrow() { ok(ref foo) => println!("found {}", foo.value), err(nope) => println!("bleh") } however, find myself in more complex situation in wish borrow mutable reference instead, such might able call function on it: match x.borrow() { ok(ref foo) => { foo.inc(); trace!("found {}", foo.value); }, err(nope) => trace!("bleh") } i've tried few variations on need stick 'mut' in, such mut ref foo, ref mut foo, -> mut result<...>, -> result, can't seem figure out syntax required. i keep getting: error: cannot borrow immutable dereference of `~`-pointer `***foo` mutable what should be? complete code example: macro_rules! trace( ($($arg:tt)*) => ( { let x = ::std::io::stdout().write_line(format_args!(::std::fmt::format, $($arg)*)); println!("{}", x); } ); ) #[deriving(show)]

javascript - How to sort elements in a list with numbers? -

this question has answer here: what easiest way order <ul>/<ol> in jquery? 3 answers i trying sort list: <div id="mainmenu"> <span>thing 5</span> <span>thing 4</span> <span>thing 7</span> <span>thing 1</span> <span>thing 5</span> <span>thing 6</span> <span>thing 3</span> </div> i have tried: $('#mainmenu').sort(function(){ $(this).children().sort(); }); i want sorted in order: <span>thing 1</span> <span>thing 2</span> <span>thing 3</span> <span>thing 4</span> <span>thing 5</span> <span>thing 6</span> <span>thing 7</span> try this, $span = $('#mainmenu span').sort(function(a, b) { if ($(a).text() &

Comment using HTML and Javascript -

i have task create comment box in html , javascript how delete comment using button delete? or should use linked list in task? code: <html> <body> <div id='container'> <textarea id='txt'></textarea><br/> <button type='button' onclick="add()">enter</button> <div id='contents'></div> </div> <script> function add(){ var txt= document.getelementbyid('txt').value; var content= document.getelementbyid('contents'); var tes= '<hr/><span>'+txt+"</span><button type='button'>delete</button>"; content.innerhtml+=tes; } </script> </body> </html> to answer question quick, if wanna stick pure javascript, can remove element

android - Dynamically Add and Remove Views from Layout -

i'm working on 1 demo project in had create 1 xml file containing views imageview , edittext . i'm loading xml file on framelayout @ runtime. @ 1 point want remove views , again want display them, used removeview() method on button click not work me,,please tell me right way it.. public class demo extends fragment implements onclicklistener, ontouchlistener{ //declaration of framelayout framelayout f; //declaration of imageview imageview imageview; view view, framelayoutview; file file; edittext etcardname, edittextusername,edittextusesrmobnumber,edittextusesremailid,edittextusesraddress; textview dialogtesting; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view = inflater.inflate(r.layout.activity_modify_card ,container, false); framelayoutview = inflater.inflate(r.layout.frame_layout_data ,container, false); captureimageinitiali

github - Ember Data 1.0 with none standard json -

i'm looking use json github's issues api ember data. the problem return json not formatted way ember data wants be. github returns data such. [ {id: 0, title: 'test'}, {id: 1, title: "ect.."} ] where ember data's restadapter expects like: { issues: [ {id: 0, title: 'test'}, {id: 1, title: "ect.."} ] } i assume based on research need override find , findall methods ds.restadapter myapp.issue = ds.model.extend({ ... }); myapp.issueadapter = ds.restadapter.extend({ host: 'https://api.github.com/repos/emberjs/ember.js', find: function(store, type, id) { ... }, findall: function(store, type since) { ... }, } the problem in example if found there few out of data methods , not explain how can pass array out key of "issues" to honest i'm complete noob , of js on head feel i'm close figuring out. let me know if i'm on right track.

html - Need text editor/composer like Wordpress -

i want visual text composer wordpress or this( stackoverflow ). want embed on html page maps or facebook box. searched on google did not found fruitful help, gives me html editor. may missed basic keyword. the words should looking visual editor, wysiwyg, tinymce . u want use ?? cms or in html pages ?? check link more info you find editors link there website in above article

c++ - Input leter with number into if statement -

how can make if user enters, p(any number) still enters if statement below. if ( input =='p') { ..... } do have change in if statement? basically if enter value p number following such p4 or p2, go if statement. let's you've defined "input" c string, this: char input[8]; fgets (input, 8, stdin); in case, can check "begins p" this: if ( input[0] =='p') { ..... } the same syntax work if instead defined "input" std::string: string input; cin >> input; if ( input[0] =='p') { ..... }

A strange thing About ImageView in Android -

recently,i complete own imageview. can draged or zoomed,but when install apk phone,this imageview shake when want zoom.(i not @ english,sorry).thanks help the following subclass of imageview: public class myimageview extends imageview { private mode mode = mode.none; private pointf startpoint = new pointf(); private float distance = 0; private float scale; public myimageview(context context) { super(context); this.setpadding(10, 10, 10, 10); this.setscaletype(scaletype.fit_xy); this.setimageresource(r.drawable.emoji_18); } @override public boolean ontouchevent(motionevent event) { if (!isenabled()) return false; switch (event.getaction() & motionevent.action_mask) { case motionevent.action_down: mode = mode.drag; startpoint.set(event.getrawx(), event.getrawy()); break; case motionevent.action_move: if (mode == mode.drag) { drag(event); } if (mode == mode.zoon_r

jquery - Image and CSS links broken after URL redirection -

this directory structure of webapi asp .net project: root controllers view -js -css -images -a.html my a.html contains links css, images - <img src="images\a.png" /> or <link herf="css/a.css"/> i use url redirection paths "localhost/client" open a.html. links broken. ideal way solve this? first of why broken. mean css/a.css points localhost/client/css/a.css not found? not want hardcode links path relative new path mean links broken when open html browser? can use kind of variable in css , image paths make configurable? try adding ~. ex. <img src="~/images/a.png" /> <link herf="~/css/a.css"/>

makefile - debug the environment used by make and port gcc from source -

i know how build gcc source, still have figure out exact environmental variables used gcc when configure , building gcc itself, i'm trying build compiler source using version of gcc different abi. any idea on how kind of information beside "try grep variable starts $ inside makefile s , configuration files" ? you can see list of environment variables affecting gcc . to create completly independent gcc new toolset, have @ lfs , explain how build gcc existing os future os. there page building gcc , talks boot_cflags='-o' , cflags_for_target , stage1_tflags , build_config . there additional variables cross-compiling , ada compiler.

I want to display a logo in PictureBox control irrespective of ImageURL in DevExpress Report control?, how could i do this? -

there 1 print i'm generating in devexpress report control , wanted show company logo in print. please me show image logo in xrpicturebox control without database binding , without providing imageurli.e. irrespective of path... yes can set image via image property. goto xrpicturebox properties , on image property click on ... symbol browse , set image. hope helps

sqlite - ORMLite (Android) Please, help me drafting a request -

really need in drafting request ormlite (android) http://ormlite.com/ . there sql queries (namedquery): 1) select m.contact.stringid, count(m.contact.stringid) messageentityimpl m m.status = messagestatus.new group m.contact.stringid" 2) select m.chat_id, c.stringid, c.fullname, m.message, max(posted) postdate messageentity m inner join (select chat_id, max(posted) max_posted messageentity group chat_id) max_posted_date on m.chat_id = max_posted_date.chat_id , posted = max_posted_date.max_posted inner join contactentity c on c.id = m.contact_id group m.chat_id, c.stringid, c.fullname, m.message order postdate desc you better off issuing raw query results (as genericrawresults<t> ) , traversing through container required results. here's example - string sql = "select m.contact.stringid messageentityimpl m m.status = messagestatus.new group m.contact.stringid"; arraylist<string> id = new arraylist<>(); try { genericrawresul

sdk - Embedded apps having GPIO, SPI Android -

i working on android application having gpi0 classes or function used. new using embedded app. i have existing code unable find these import import android.gpio.gpio; import android.gpio.gpioexception; and functions hardware interface on i.mx53 i not understand can import these classes. getting importing errors , there no native library in libs folder also. is there supported libray using these in android sdk or have installed other sdk or supported library. please provide me tutorial or on this.

linux - How to create a filesystem with /etc/fstab entry on RHEL -

for command can create filesystem , append /etc/fstab automatically? just aix command crfs -v jfs2 -d lv01 -m /backup -a yes . option -a means mount on next boot automatically, , don't need modify /etc/filesystems (as /etc/fstab on linux). there aren't such commands, can scripted.

sql - Subtract grouped figures in Oracle select Statement -

i have interest table interest indicator either credit or debit. requirement difference between credit , debit interest grouping branch. separated queries are: select sol_id, sum(amount_in_lcy)debit_interest interest_details int_id = 'd' group sol_id; my other query is: select sol_id, sum(amount_in_lcy)credit_interest interest_details int_id = 'c' group sol_id; i totally stuck on adding or subtracting 2 queries 1 resultset grouped sol_id. ideas?? there way subtract figures first , group them? select sol_id, (sum(case when int_id = 'c' amount_in_lcy else 0 end)- sum(case when int_id = 'd' amount_in_lcy else 0 end)) difference interest_details group sol_id;

java - Date from datepicker flips day and month -

when select date datepicker day , month flipping positions.i want mm/dd/yyyy. instead getting dd/mm/yyyy. i tried few methods described on site fix didn't help. such hour_of_day, instead of hour. however, doesn't seem work. any advice, suggestions? thanks in advance :) import android.app.activity; import android.app.datepickerdialog; import android.app.dialog; import android.app.progressdialog; import android.content.context; import android.content.intent; import android.net.connectivitymanager; import android.net.networkinfo; import android.os.asynctask; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.datepicker; import android.widget.edittext; import android.widget.textview; import android.widget.toast; import sync.databasehandler; import sync.userfunctions; import org.json.jsonexception; import org.json.jsonobject; import java.io.ioexception; import java.net.httpurlconnection; import java.net.malformedurle

Convert java date to 18 dgit LDAP date -

we have requirment need insert accountexpires date in active directory. , ad take input date large integer (18 digit ldap date). have date in format yyyy-mm-dd (for ex : 2014-04-29 ) , want convert java date ldap date 18 digit format i.e ( 130432824000000000 ). please let me know work around convert below format , populate ad curre nt date format. this solution using joda time, according definition found here : the timestamp number of 100-nanoseconds intervals (1 nanosecond = 1 billionth of second) since jan 1, 1601 utc. sample code: public final class foo { private static final datetime ldap_start_date = new datetime(1601, 1, 1, 0, 0, datetimezone.utc); public static void main(final string... args) { final datetime = datetime.now(); final interval interval = new interval(ldap_start_date, now); system.out.println(interval.todurationmillis() * 10000); } } replace now in code date , should set.

java - XACML Policy Evaluation Error -

i followed link run pdp using saml envelope on xacml. created webservice ( pdp , pdpclient - in other words xacml request generator ). here every thing run fine i.e. generate request , result perfect given (test policies given followed link ) policies. now test pdp policies !! ( in point of view ) pdp isn't evaluate policies correctly. example here policy <?xml version="1.0" encoding="utf-8" standalone="yes"?> <policy xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os" policyid="serverdatadeletion" version="2.0" rulecombiningalgid="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:deny-overrides"> <description>server data deletion student</description> <target> <subjects> <subject> <subjectmatch matchid="urn:oasis:names:tc:xacml:1.0:function:string-equal"> <attributev

Xcode 5 Interface Builder-designed light text appearing regular weight on iOS 6 -

Image
i've built view in interface builder on xcode 5: on ios 7 devices, runs (displays seen on ib). selected uilabel's font helvetica neue thin. however, when try on ios 6.1, font renders improperly: i'm aware of ios 7 sdk's text view's selectable = no bug doesn't set text properly, views uilabels, not uitextviews. how can make uilabels display on ios 6 too? helvetica neue thin not available in ios6 ios 6 fonts you should use light or ultra light.

php - strotime not working on different table -

i have code part of table; echo '<td>' . $row['datum_overboeking'] = date("m-d-y", strtotime($row["datum_overboeking"])) . '</td>'; i want add same piece of strtotime code piece of code part of table on page; td>' . mysql_result($result, $i, 'datum_overboeking') . '</td>'; so be; echo '<td>' . mysql_result($result, $i, 'datum_overboeking') = date("m-d-y", strtotime($row["datum_overboeking"])) . '</td>'; but doesnt work, gives error: fatal error: can't use function return value in write context in /home/davel/www/folder1/pagina_1/view-paginated.php on line 97 mark baker correct, trying set value mysql result - error. if wish display results of 'datum_overboeking' please try following: echo '<td>'.date('m-d-y', strtotime(mysql_result($result, $i, 'datum_overboekin

javascript - how to refresh table jquery mobile without data-role="table" -

i working on table in html how can refresh table. im not using data-role="table" reason here working jsfiddle code <table id="tblmailmod" class="table ui-responsive"> <tbody> <tr style="cursor: pointer;" onclick="setimg(this);"> <td> <img class="imgok" id="envelope1" src="http://m.jalf.com/testjalf/img/select_ok.png" alt="" /> </td> <td> <a data-prefetch="true" onclick=""> <div class=" ">de:</div><div class=" ">suject:</div><div class=" ">date:</div></a> </td> <td> <a data-prefetch="true" onclick=""><span class="larrow"> <img class="imga

axapta - How to hide grid in form when there is no data to show? -

i have 2 linked tables linked id. one of them contains list of albums , second 1 list of songs. i have them in data sources proper link types etc. i have form 2 grids. 1 shows albums , second 1 show list of songs on album. work correctly if there songs on album. if there no song on album on second grid values. there should nothing shown. there wrong information based on previous clicked album song. how can ensure if there no songs on album second grid empty or not shown @ all? without problems: http://postimg.org/image/e2pvzmbfb with data should not there: http://postimg.org/image/75xjyh9xt/ tables: album, songs (one song can on 1 album , linked album albumid. on song table there relation album.albumid==song.albumid) there 2 data sources. 1 link albums (ds_albums). second link songs (ds_songs) joinsource ds_albums, link type delayed. there 2 grids linked data sources. that's unusual behavior in axapta. 1.- check relation in songs table albums table.

c# - What is the fastest way to get the last elements of a list by ID with Datetime? -

i have huge list<myobject> . myobject had property named timestamp ( datetime? ) , code ( string ). need lasts objects timestamp each code. for example following input : code| | b | timestamp a1 | abc | def | fri 7 mar 2014 b2 | abc | ghi | thu 6 mar 2014 a1 | def | ghi | mon 10 mar 2014 b2 | def | ghi | fri 7 mar 2014 c3 | ghi | jkl | fri 7 mar 2014 i need : code| | b | timestamp a1 | def | ghi | mon 10 mar 2014 b2 | def | ghi | fri 7 mar 2014 c3 | ghi | jkl | fri 7 mar 2014 in order did following function : private list<myobject> getlastsobjects(list<myobject> input) { var output = input.where(x => x.timestamp == x.where(y => y.code == y.code) .max(tmp => tmp.timestamp)) .tolist(); return output; } it works have bad performance huge input... do know how can optimized function ? fastest way last elements timestamp each c

Where can I find sony xperia M 's android source code for its camera app? -

is there way can browse sony xperia m's android source code? of camera application? the limited source code sony have made available can found at https://github.com/sonyxperiadev in common other android producers (including google itself), not make source code proprietary applications, including camera app, available.

Git Merge Conflict in xCode -

i'm using (for first time) git source control of ios project. 2 persons working on project. ok until day modified same file (different methods , lines). when want commit modification xcode tell me pull first, because co-worker committed work. when pulled lost local modifications. to face problem, steps make ? thanks you'd better off using feature branch workflow. http://git-scm.com/book/en/git-branching-branching-workflows this allow , colleague work on same files little fuss. share branches @ own risk!

css - First child selector doesn't work if header is present -

i have simple html header , sections. <header>header</header> <section>section 1</section> <section>section 2</section> <section>section 3</section> i style first section section:first-child { background-color:green; } it seems :first:child selector doesn't work when header present ( jsfiddle ). when remove header works again! why? that's because <section> not first child of parent. element:first-child represents first child of parent, matching element. , in case, first element of parent <header> element. you use :first-of-type pseudo-class instead. section:first-of-type { background-color:green; } from mdn : the :first-of-type css pseudo-class represents first sibling of type in list of children of parent element.

codeigniter - Why protect tables and fields on top of every model? -

i have seen codeigniter application coder protected table , fields @ tp of every model. why this? , maybe why protect primary key separate other fields? class students_model extends my_model{ protected $table = 'students'; protected $primary_key = 'id'; protected $columns = array( 'student_code' => array('code', 'trim|required'), 'student_name' => array('name', 'trim|required'), 'country' => array('country', 'trim|required'), ); } this question understanding best practices in mvc (not codeigniter). there few different things going on here. 1) "protected" prolly done out of habit. protected php class keyword, , has nothing ci or models. can read here: http://jp2.php.net/protected ; if after reading don't understand why

c# - How to add duplicate keys into the Dictionary -

i have lines text files want add dictionary.i using dictionary first time.while adding starting lines ok got error: an item same key has been added here in code there duplicate keys can not change.here code in c# dictionary<string, string> previouslines = new dictionary<string, string> { }; previouslines.add(dialedno, line); here dialedno key , line textfile line. here code retrieving given line based on key. string tansferorginext = previouslines[dialedno]; so concern how allow add duplicate keys in dictionary if possible , if not how can similar functionality. please me . how allow add duplicate keys in dictionary it not possible. keys should unique. dictionary<tkey, tvalue> implemented: every key in a dictionary<tkey, tvalue> must unique according dictionary's equality comparer. possible solutions - can keep collection of strings value (i.e. use dictionary<string, list<string>> ), or (better) c

Rails 4 form - no implicit conversion of Model into String -

after adding helper method , edit form, i'm getting error typeerror in posts#create showing /users/jim/project/test/app/views/posts/_form.html.erb line #2 raised: no implicit conversion of question string extracted source (around line #2): 1 2 <%= show_random(@question)[:title] %> 3 app/helpers/questions_helper.rb:4:in `show_random' app/views/posts/_form.html.erb:2:in `_app_views_posts__form_html_erb___4147312638633006209_2202637820' app/views/posts/new.html.erb:3:in `_app_views_posts_new_html_erb___3518261482060642021_2203102520' app/controllers/posts_controller.rb:33:in `create' request parameters: {"utf8"=>"✓", "authenticity_token"=>"mk1wibkc8mqxskptvbgjwabnaaz7khm7rdvc8zyrmnc=", "post"=>{"question_id"=>"1", "content"=>""}, "commit"=>"create post"} but error won't appear if validations of post model me