Posts

Showing posts from May, 2012

java - Hibernate: Updating OneToMany relationship -

i have parent list of child mapped. may know how update list of child when update parent example: a parent p1 have child b c. i decided delete b , add d so parent p1 have child c d in database. currently merely delete child belongs parent p1 , repopulate chid(a c d) again... believe there more simple way of doing so. i know task quite sensitive, please kind enough let me know need set ensure child inserted , deleted properly. new question: 1) there way lazy update/delete relationship? have list fetchtype.lazy, when updating data, might not wish load relationship or update it. 2) if list have item b c, removed item c , dto.save(). item c deleted? here mapping update child using parent - @entity @table(name = "company") @sequencegenerator(name="companyseq", sequencename="companyseq", allocationsize=1) public class company implements serializable { private static final long serialversionuid = 1l; /* * custome...

sql - ORA-00923: FROM keyword not found where expected -

i have code below, , receive error: ora-00923: keyword not found expected @ fourth select ( * ). know why? i have searched other posts , have not found solution. select plan_date week, plan_date+7 "week + 7", plan_date+14 "week + 14", plan_tower, plan_rice_type, plan_hours/100 plan_count, (select count(*) smart_rice_cooker rc rc.tower = p.plan_tower , rc.rice_type = p.plan_rice_type , rc.status <> 'cancelled' , rc.actual_fd_date between p.plan_start_date , p.plan_end_date ) delivered_fd_count, (select count(*) smart_rice_cooker rc rc.tower = p.plan_tower , rc.rice_type = p.plan_rice_type , rc.status <> 'cancelled' , rc.actual_fd_date null , rc.target_fd_date between p.plan_start_date , p.plan_end_date ) target_fd_count ***(select count(*) s...

PHP Serialize & Unserialize -

i have problem unserialize return nothing after getting $_post. post simple array form , see double quotes been added serialized string. tried stripslashes before serialzing , before unserializing, result same no output. have turned of magic_quotes_gpc in php.ini , again no luck. when hardcode values in unserialize adding "\" manually gave me desired string, tried addslashes , again left nothing. please me resolve this. <?php $tmp = $_post["strvid"]; $mynewarray = unserialize($trp); print_r($mynewarray); $myarray = array('key1'=>'value1', 'key2'=>'value2'); $serialized = serialize($myarray); ?> <form onsubmit="return validate(this)" action="test_serialize.php" method="post"> <input type="hidden" name="strvid1" value="this mega shit"/> <input type="hidden" name="strvid" value="<?php echo $serialized; ?>...

swing - Java: System.exit() parameters -

i having simple question, questionable. situation. in application, can open new windows clicking new button. when click "x" (close) button, first ask whether want save work. if no, use system.exit(0) exit. case is, closes open "new" windows. want close window user selected option "no save". how can this? please help! it text editor, notepad. uses "new" open new "windows"." alternatives (all mentioned in or linked answer the use of multiple jframes, good/bad practice? ): jtabbedpane jdesktoppane containing jinternalframe instances cardlayout (see linked answer..)

Does a Java "reference object" exist? -

sometimes pass immutable object method , change value inside of method or assign object parameter reference (example 1). or assign inside of anonymous inner class object final local variable (example 2). because of these cases not possible, use atomic(integer|long...) class or list (which bad, because list can contain multiple objects) purpose. alternatively, create class holds object , allows changing object: public class referenceexample { public static void main(string[] args) { final reference<string> string = new reference<>("a"); // example 1: method(string); // example 2: new thread() { @override public void run() { string.set("c"); }; }.start(); } public static void method(reference<string> string) { string.set("b"); } private static class reference<t> { private t value; p...

How to make the color theme inside #ifdef more readable in Eclipse? -

i love color themes (thanks!), 1 nagging issue code #ifdef'd out, impossible read (and annoyingly bright). if highlight lines, can read it, i'd really rather not see @ all. seems similar issue 1 tool-tips, hoping there setting somewhere turn off syntax highlighting inactive code. have looked , not found it, doesn't mean doesn't exist. optimist (in regard anyway). you can disable #ifdef highlighting entirely going to: window -> preferences -> c/c++ -> editor , unchecking box "highlight inactive code". also, can change #ifdef highlighting color going same screen , changing "inactive code highlight" color (under "appearance color options" heading) color works better you.

multilingual - How can I add translations to a Plone site front-page -

i'm using linguaplone in site thas written in english , spanish. site pages , folders can translated, except front page folder. think can translate page front page folder uses view, in case when user goes front page, folder view showed (not translation). i'm using plone 4.1.4 , linguaplone 4.1.2. maybe need try other tool, raptus.multilingualplone. normally, when setting linguaplone site let linguaplone create top-level per-language folders act navigation roots. root of site set redirect visitors 1 of these roots depending on language preferences , other factors, using language selector. take @ http://www.norden.org/ example of such site. notice when visit url automatically redirected 1 of supported languages, http://www.norden.org/en/ english. can switch between available languages on top left, , you'll see first element of url changes between language codes. top-level folders. the advantage here each of these folders can have it's own default view...

facebook fql - Querying for past events using FQL -

i'm trying access past events of given user. i'm using following fql query: select eid, name, pic_square, start_time, end_time, location event eid in (select eid event_member uid = me() , rsvp_status != 'declined') , start_time < 1338974650 order start_time desc limit 0,20 ( 1338974650 supposed current unix timestamp). works fine. however, facebook returns set of 4 events in case, whereas facebook.com displays lot more. why that? yes. facebook severely limits amount of past items returned api call. when visit 1 of pages, see on 75 events listed on past events page. when query page's events using either fql or graph api, 2 events. guess facebook has separate table stores past events isn't available via api. btw, can make code simpler replacing timestamp now() .

ios - How to avoid old xib cache on released iphone apps? -

i'm developing first iphone app. 1 day, renamed files including xib file , view controller. after that, app began use old xib file. deleted xib file, old xib still used. code init view controller was: myviewcontroller *vc = [[myviewcontroller alloc] init]; i modified code to: myviewcontroller *vc = [[myviewcontroller alloc] initwithnibname:@"myviewcontroller" bundle:nil]; then app used new xib instead of old xib. the question is, possible old xib files displayed not on developing apps on released apps reasons? can avoid old nix caching on released apps if use initwithnibname: instead of init ? i think need remove files in deriveddata. i've been through sort of thing. if you're using simulator, i'd reset simulator or delete files. paths: /users/yourname/library/developer/xcode/deriveddata /users/yourname/library/application support/iphone simulator you fussy, delete deriveddata directory when having trouble. xcode rebu...

web services - Extension Base on nusoap -

i create xml schema on nusoap following: <xsd:complextype name="wsmessage"> <xsd:sequence> <xsd:element minoccurs="0" maxoccurs="1" name="errormessage" type="s:string"/> <xsd:element minoccurs="0" maxoccurs="1" name="errorcode" type="s:string"/> </xsd:sequence> </xsd:complextype> <s:complextype name="resultset"> <s:complexcontent mixed="false"> <s:extension base="tns:wsmessage"> <s:sequence> <s:element minoccurs="0" maxoccurs="1" name="testdata" type="tns:arrayoftestdata"/> </s:sequence> </s:extension> </s:complexcontent> </s:complextype> i can't see documentation on how that. know already? thank you. add 2 complex type input, under...

java - TimeZone customized display name -

i need timezone display values follows : (utc + 05:30) chennai, kolkata, mumbai, new delhi but using following method getting bit different output. how should timezone display name above ? (if required, can use joda). public class timezoneutil { private static final string timezone_id_prefixes = "^(africa|america|asia|atlantic|australia|europe|indian|pacific)/.*"; private static list<timezone> timezones; public static list<timezone> gettimezones() { if (timezones == null) { timezones = new arraylist<timezone>(); final string[] timezoneids = timezone.getavailableids(); (final string id : timezoneids) { if (id.matches(timezone_id_prefixes)) { timezones.add(timezone.gettimezone(id)); } } collections.sort(timezones, new comparator<timezone>() { public int compare(final timezone t1, f...

version control - Number of commits on branch in git -

i'm writing small script , want know how many commits made on current branch since created. in example i'd have 2 commits made on child : git checkout master git checkout -b child ... git commit -a ... git commit -a so want is commit_number = ... echo $commit_number thank help. git can provide number of commits without further shell scripting. git rev-list master.. --count rev-list semi-hidden (not listed in git help ) command used work revisions. as master.. list commits base of master , current branch current branch, --count give count of them. if instead want have number of commits between 2 revisions use master... . elaborate: between in master recent common ancestor of master , current branch (head), , current branch again. if visualize commit history tree should able follow 2 branches common ancestor. master.. on other hand count 1 of 2 branches. so whether want use master.. or master... depends on whether want know how many commits ...

Git sync same branch in two repositories which are cloned from same master -

i trying implement git in company. decided implement model http://nvie.com/posts/a-successful-git-branching-model/ there 3 branches in main repo, ie master,develop , feature1. there 2 developer named alice , bob. both developers working on clone of main repo. both of them working in feature1 branch. alice has defined git remote, named bob, pointing bob’s repository, , vice versa. how can make bobs changes on feature branch alice , vice versa? the " a successful git branching model » nvie.com " comes set of tools called " git-flow " on top of default git installation. this utility provide some interesting commands deal features. bob or alice or else can create new feature , publish main repository: git flow feature start <name> git flow feature publish <name> then bob , alice have track , pull newly created feature: git flow feature track <name> git flow feature pull <remote> [<name>] and bob , alice can use...

eclipse - java.lang.NoSuchMethodError: org.codehaus.jackson.JsonFactory.configure -

i using following code , throws exception accesstokenresponse = new googleaccesstokenrequest.googleauthorizationcodegrant(new nethttptransport(), new jacksonfactory(), client_id,client_secret, authorizationcode, redirect_uri).execute(); exception: java.lang.nosuchmethoderror: org.codehaus.jackson.jsonfactory.configure(lorg/codehaus/jackson/jsongenerator$feature;z)lorg/codehaus/jackson/jsonfactory; the javatype class in jackson-core jar, , objectmapper class in jackson-mapper both of same version.

Clojure: is there a way to load leiningen plugins as libraries? -

question: is there way load lein plugin, codex or lein-beanstalk, clojure library ? context: i'm writing tools managing lein projects, , keep finding myself wanting have functionality of lein plugins libraries in code -- don't see way access lein-pluins namespaces clojure user land. edit: in particular, want use: https://github.com/weavejester/codox i want able equiv of "lein doc" inside of "lein repl." the problem can't load codox.codox.core namespace. thanks! of course can it. leiningen plugins plain maven artifacts. need specify plugin in :dependencies clause in project.clj , this: :dependencies [[org.clojure/clojure "1.3.0"] [lein-beanstalk "0.2.2"]] then run lein deps , leiningen download needed plugin lib directory.

iphone - AVURLAsset - loadValuesAsynchronouslyForKeys:requestedKeys -

i'm using code load values of key , play movie url. [asset loadvaluesasynchronouslyforkeys:requestedkeys completionhandler: ^{ dispatch_async( dispatch_get_main_queue(), ^{ [self preparetoplayasset:asset withkeys:requestedkeys]; }); }]; but method preparetoplayasset cannot run , don't know why. know reason?

Backup MySQL database in ASP.NET MVC3 -

how backup mysql database asp.net mvc3. project located in local network server. thanks you can use mysqlbackup.net perform task http://mysqlbackupnet.codeplex.com/ i'm 1 of author of project.

c++ - How can I access dynamically created objects which are created out of the scope of the current function? -

i want pass uninitialized object pointer method. within method i'll create instance of object using new operator (or malloc ) , assign address passed pointer. part of code: void test(testclass* t){ ... t = new testclass(); ... } int _tmain(int argc, _tchar* argv[]) { testclass* t = null; test(t); cout<<t->gettestvalue()<<endl; delete t; } my problem in _tmain function (after calling test ) want call gettestvalue method of object pointed t . here program crashes , terminates access violation unexpected exception. it seems object created dynamically (using operator new , malloc ) not usable outsie of scope of function test . can help? to change pointer in function, must passed reference: void test(testclass*& t) otherwise, change made inside function not visible on outside. your original pointer doesn't changed, remains null , , runs undefined behavior , crash. whenever pass parameter value, copy made...

Mastermind Game Java Swing, MouseListener -

i working on mastermind game java object oriented programming , have working except 1 part of code if(ug[0].geticon() == compguess[0].geticon() && ug[1].geticon() == compguess[1].geticon() && ug[2].geticon() == compguess[2].geticon() && ug[3].geticon() == compguess[3].geticon()) { joptionpane.showmessagedialog(f1, "you have guessed them coorect!", "mastermind: test mind", joptionpane.information_message); submit.setenabled(false); compguess[0].setenabled(false); compguess[1].setenabled(false); compguess[2].setenabled(false); compguess[3].setenabled(false); compguess[0].setvisible(true); compguess[1].setvisible(true); compguess[2].setvisible(true); compguess[3].setvisible(true); ug[0].setenabled(false); ug[1].setenabled(false); ug[2].setenabled(false); ug[3...

php - WORDPRESS: I have just created an extra column with phpMyadmin on my wp_user row, I now need each user to update that column when logged in -

wordpress: have created column phpmyadmin on wp_user row (foo), need each user update column when logged in. have called value each user by: <?php $wpdb->hide_errors(); auth_redirect_login(); nocache_headers(); $current_user = wp_get_current_user(); if ( 0 == $current_user->id ) { // not logged in. } else { echo '<input>' . $current_user->foo . '/>'; } ?> can please explain why did alter wordpress table ? it such bad practice. highly doubt column persist if wp has update somewhere in time. there table called wp_usermeta fits needs. you can access , update value with: update_usermeta($userid,'foo',"1"); $foo = get_usermeta($userid,'foo'); now , main issue, can overload wp_authenticate function or, use filter "authenticate...

objective c - connection : didReceiveData is not called -

i having problem in nsurlconnection. didrecievedata method not being called . dont know what's problem. went through previous problems nothing seems solve. please me out. code. -(void)getthejsondata { nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:_serveraddress cachepolicy:nsurlrequestuseprotocolcachepolicy timeoutinterval:10]; [request sethttpmethod: @"get"]; nsurlconnection *connection = [[nsurlconnection alloc] initwithrequest:request delegate:self startimmediately:yes]; nslog(@"this displayed"); } -(void)connection:(nsurlconnection*)connection didreceivedata:(nsdata *)data { nslog(@"this not displayed."); appappdelegate *jsondata = (appappdelegate*)[[uiapplication sharedapplication] delegate]; jsondata.userloginjsondata = [[nsdata alloc] initwithdata:data]; nserror *error; _result = [nsjsonse...

android - imageviews in TableLayout -

i have rather complex layout scrollview contains relativelayout. relativelayout contains tablelayout full of imageviews. there 40 images. of them jpegs , of them 200 pixels wide. if layout table in 3 columns, works fine. if try layout table in 2 columns, first column displays images fine, in second columns images "truncated" , right portion of image not visible. for kludge workaround came create "filler-image" rectangle 50 pixels wide , 100 pixels tall. stuck in 3rd column of first row of table, makes 3 row tables, , scrunches other 2 columns enough can both read. seems there should better way. here snippet of xml (here including filler image in first row. <tablelayout android:id="@+id/pls_table" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@id/pl_title" android:shrinkcolumns="*" android:stretchcolumns=...

cocos2d iphone - Box2D small pocket hole creation -

i have simple question game making using box2d , cocos2d. started using physics engine yesterday rather inexperienced usage , capabilities. game involves rolling ball around screen using accelerometer. want add holes ground if ball rolls into, require greater acceleration via accelerometer escape hole pocket. i've toyed friction, linear damping, modifying accelerometer's gravity vector, , tried adding attractive forces haven't had success , of doesn't simulate want happening. want create sensors , give them properties of small pocket ball can fall in to. tips , advice appreciated. thanks i suggest use level helper . awesome tool create physic based games. you can find here

java - Can an Error be handled in the same way as an Exception -

i want know whether error can handled or not in java in similar way exceptions. have seen errors can't handled such assertionerror , i've tried throwing error inside program , tried handling using catch, worked , next part of code did execute(this contradictory part program supposed exited whenever error encountered). few errors can handled , few others cannot be. i'm confused this, can clear doubt of mine , state difference between errors , exceptions? package package1; public class class1 { public static void main(string[] args) { class1 cl1=new class1(); int x=2; string s = null; //assert(x<0):"x not less zero"; try { cl1.workonexceptions(); } catch (error e) { e.printstacktrace(); } system.out.println("not terminated yet"); } public void workonexceptions() throws error { try { ...

java - How to change/resize EditText in table layout? -

i want resize edittext matches texts. when insert edittext in table layout in column 3 fills whole space of column 3 , looks big. want change size. how possible? below .xml coding: <tablerow> <textview android:layout_column="1" android:text="s" android:layout_width="150dp" /> <textview android:layout_column="2" android:text="c" android:layout_width="75dp" /> <textview android:layout_column="3" android:text="g"/> </tablerow> <view android:layout_height="2dip" android:background="#ff909090" /> <tablerow> <textview android:layout_column="1" android:id="@+id/s1" android:text="medium text"/> <textview android:layout_column="2" android:id="@+id/c1" android:text="tex...

java - Covert database table result into XML - How to generate an XML document -

i have query when run returns resultset following data in order , grouping shown: country region town --------------------------------------- england north newcastle england north manchester england north leeds england south london england south bristol england south birmingham england south portsmouth norway north trondheim norway north tromso norway south oslo norway south stavanger norway west bergen using java, convert returned result xml document shown below: <countries> <country> <countryname>england</countryname> <region name = "south"> <town>london</town> <town>bristol</town> <town>birmingham</town> <town>portsmouth</town> </region> <region name = "nort...

html - Firefox td width doesn't change with the first row's td -

i got table 4 columns , several rows. problem in firefox, if resize first td in first row 80px 120px , width of first tds in other rows won't change td in first row (which means width of other tds remains 80px unchanged). (everything ok in ie.) i remember if width set on td, entire column have width. seems firefox didn't follow rule. the css related table given below: .grid .body_table { table-layout:fixed; } this sounds similar https://bugzilla.mozilla.org/show_bug.cgi?id=735579 , should fixed in firefox 14, if so.

css - Dropdown has no content (bootstrap framework) -

Image
hi have following code dropdown using bootstrap-sass gem: <div class="nav-collapse collapse" style="height:0px;"> <nav> <ul class= "nav pull-right"> <% if signed_in? %> <li><%= link_to "profile", current_user %></li> <li><%= link_to "users", users_path %></li> <li id = "fat-menu" class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> account <b class="caret"></b> </a> <ul class="dropdown-menu"> <li><%= link_to "settings", edit_user_path(current_user) %></li> <li class="divider">...

vector - How to calculate azimut & elevation relative to a camera direction of view in 3D ...? -

i'm rusty bit here. i have vector (camdirectionx, camdirectiony, camdirectionz) represents camera direction of view. have (camx, camy, camz) camera position. then, have object placed @ (objectx, objecty, objectz) how can calculate, camera point of view, azimut & elevation of object ?? the first thing do, simplify problem, transform coordinate space camera @ (0, 0, 0) , pointing straight down 1 of axes (so direction (0, 0, 1)). translating camera @ (0, 0, 0) pretty trivial, won't go that. rotating camera direction (0, 0, 1) little trickier... one way of doing construct full orthonormal basis of camera, stick in rotation matrix , apply it. "orthonormal basis" of camera fancy way of saying 3 vectors point forward, up, , right camera. should @ 90 degrees each other (which ortho bit means), , should of length 1 (which normal bit means). you can these vectors bit of cross-product trickery: cross product of 2 vectors perpendicular (at 90 degrees) b...

ssl - where is new_ssl? -

from rabbitmq documents know there new_ssl application. have installed erlang through macport command. after using command "port content erlang|grep new_ssl" , can't find it. in www.erlang.org, new_ssl document, says new_ssl module not application. reading ssl.app , doesn't contain new_ssl module? is ghost? new vs old ssl 2 different implementations of ssl. old ssl used libopenssl directly new ssl build in erlang libcryto functions in c. of r15b release (dec 2011) of erlang/otp, old_ssl implementation entirerly dropped.

jsf - Commandbutton does not invoke action when disabled property is changed to false by JavaScript -

i have web application build in jsf + primefaces. in web form set disable property of command button of primefaces true. when form loaded after performing custom client side validations on form input fields, set disable property of command button false or true according user inputs on form. note: here if validation through button gets enable, @ same time if user edits input , validation fails again button gets disabled. <p:commandbutton id="savebutton" value="save" actionlistener="#{some method of bean}" update="component update" disabled="true" /> but button doesn't work properly, mean form not getting submitted. but if if disabled property of button not set true in beginning, during custom validation disabled/enabled javascript(as explained above) works fine. i can't understand how form submit-ion dependent on initial value of disabled property of command button though setting through javascript. here html...

android - Display Score In A Different Way in a Game -

i making game , display score in such fashion if score 0 , increased 10, score should increment through of numbers 0 10. after reaching new score should stop, @ least small pause. if, again, score increased 10, scoreboard should increment through every number 10 20 , stop again. i have tried using handlers unsuccessful in getting them pause or stop, in way. the example in video demonstrates trying accomplish. if @ scoreboard in top right, see score incrementing. here url in case above link not work: http://www.youtube.com/watch?v=ndz8yupmema&feature=fvwrel this code runnable increment score. final handler mhandler=new handler(); mrunnable=new runnable() { public void run() { string s = null; ++i; s= new integer(i).tostring(); tv.settext(s); mhandler.postdelayed(mrunnable,1000); } /*protected void onstop() { mhandler.re...

What does "implementation-agnostic" mean? -

i'm wondering "implementation-agnostic" means? didn't find explanation. mean in context: "an implementation-agnostic engineering approach". the opposite of "implementation-agnostic" "implementation-specific". examples should make difference clear: implementation-agnostic synonym: implementation- independent examples: sorting algorithm "quicksort" algorithms written in pseudo-code the examples above can implemented every language (assembler, basic, c#, c++, java, javascript, ...) implementation-specific synonym: implementation- dependent examples: device drivers machine language code intel processors the examples above run on hardware written for.

Game development on android emulator -

i have corei7 @1.73ghz 6gb ram, , emulator slow. how guys prefer develop games ? on emulator or real device? easy: on real device. there lots of reasons why need both. device way faster , reflects software encounter. emulator endlessly versatile , can turn on pedantic runtime options. go device when need quick turnaround, emulator deep debugging, device make sure aren't encountering quirk in emulator, , emulator make sure aren't encountering device-specific behavior.

objective c - UIButton not responding to 'touchUpInside' but will respond to 'touchDown' fine -

in program, have uibutton declared programmatically property of uiviewcontroller . have set send actions when user triggers touchupinside event, shown here: [restartbutton addtarget:self action:@selector(handlerestart) forcontrolevents:uicontroleventtouchupinside]; restartbutton name of uibutton . when enter uicontroleventtouchdown in forcontrolevents parameter, works fine. however, uicontroleventtouchupinside not work. know why is? you may want check restartbutton.bounds . may have set size of 0 causing uicontroleventtouchupinside never occur. best way of checking add borders layer. [restartbutton.layer setborderwidth:1.0f]; [restartbutton.layer setbordercolor:[uicolor redcolor].cgcolor]; don't forget #import <quartzcore/quartzcore.h> above work

Facebook Login Redirect PHP/Javascript Not Working -

i've looked through many posts on site, still unable facebook login , redirect working. when user logs in via facebook pressing button on webpage, want automatically redirect them webpage , pass email , password through via url. unfortunately, i've got work point when login, have manually reload page them redirect page refreshing webpage. wondering if post code on how this? i've tried moving things around lot. <?php //uses php sdk. download https://github.com/facebook/php-sdk require 'facebook.php'; define('your_app_id', 'xxxx'); $facebook = new facebook(array( 'appid' => 'xxxx', 'secret' => 'xxxx', )); ?> <div id="fb-root"></div> <div id="user-info"></div> <div class="fb-login-button" style="position:absolute;top:800px;">login facebook</div> <script> window.fbasyncinit = function() { ...

pdo - mysql join two tables select and records problems -

i want show below info onto webpage : date - personal expense (business expense) 06-june-2012 - usd555.00 (usd3022.00) 05-june-2012 - usd666.00 (usd0.00) 04-june-2012 - usd0.00 (usd444.40) 04-june-2012 - usd333.00 (usd2333.40) currently code : $sql = "select payment_date, sum(price) expense category=? spender_id=? group payment_date"; $q = $conn->prepare($sql); $result = $q->execute(array("personal", $user_id)); while($r = $q->fetch(pdo::fetch_assoc)){ $payment_date_db = $r['payment_date']; $payment_date_db2 = date("d-f-y", strtotime($payment_date_db)); $price_db = $r['sum(price)']; echo $payment_date_db2 . " - " . $money_currency . $price_db . "<br />"; } i don't know how select , display business expense record , show blanket sign (). idea? you should provide more details in regards table schema, think can infer query it's t...

c# - Internet and Server Connection and Communication -

i working on .net-based application, using c#. i've been searching web weeks , months without luck, , unable find example or solution or recommended approach. what want is: make application connects server (over internet) , downloads information database, example: antivirus connecting server , downloading virus signature files. how can implement stable , safe connection web-server? you can download file website using webclient class: http://msdn.microsoft.com/en-us/library/ez801hhe.aspx

javascript - Attaching a callback to html generated by JSF - Primefaces -

i've got primefaces command button need add callback in jquery on document.ready. i've been trying reference existing function , call in new function wrote: var existingfunction = jquery("[id~='submit']").live("click"); jquery("[id~='submit']").live("click", function(){ existingfunction(); alert('test'); updatecontrolpanel(buildcontrolpanelurl(geturlvars())); }); it seems simple enough me reason not work. when load page , click submit button doesn't reach alert. i've checked error console , found it's throwing following errors: ((f.event.special[s.origtype] || {}).handle || s.handler).apply not function there existing jquery functions on page did not write i'd make sure error not related way i'm approaching this. i'm using tomcat 6 older version of jquery (1.3 or 1.4 ). thanks , let me know if guys need more info. edit i've put example of i'm tryin...

android - GPS Coordinates not posting on web -

i want post gs coordinates android phone website. created server using wamp. did webhosting using site www.000webhost.com below php code , java code... getting location on phone coordinated not being posted on website.. php code <?php echo 'hello, world!'; $json = $_get['jsonpost'];//get post sent... $data = json_decode($json); //decode json formatted string... print_r($data); $id = $data->id; $devid = $data->devid; $latitude = $data->latitude; $longitude = $data->longitude; $service = $data->service; $con = mysql_connect("","",""); if (!$con) { die('could not connect: ' . mysql_error()); } mysql_select_db("a5234826_ul", $con); $devid = $_post['devid']; $latitude = $_post['latitude']; $longitude = $_post['longitude']; echo "devid" +$devid; echo "latitude" + $latitude; echo "longitude" + $longitude; $sql = "insert `a5234826_ul`.`lo...

JSON length Causing Facebook Post to Wall Functionality to Break in IE8 & IE9 -

i have been using facebook javascript sdk post content cms facebook fan page. works pulling current pages content using jquery , feeding fb.api function. works fine in firefox, safari, chrome, etc. problem ie in nothing happens, no error message, no javascript errors, nothing. here function using: function publish(){ //variables pulled page content so: var fb_message = $('#content').text(); fb.api('/me/feed', 'post', { access_token : fb_token, name : fb_name, message : fb_message, link : fb_link, picture : fb_photo, caption : fb_caption },function(response) { if (!response || response.error) { alert("couldnt post"); } else { alert('posted'); } }) } if remove message fb.api json, or limit length of string being sent 850 chars works fine in ie, have no idea why? s...

algorithm - Simplest way to do "natural" sort for numbers in strings? -

Image
i saw this , wondering best way implement natural sorting this? usually in list of 1,4,11,12 string sort (used in listing items) returns 1,11,12,4 . how implement natural ordering? the items can [ 'screen 4 episode 13', 'screen 11 episode 1', .... ] for above mentioned list , sample list provided in question, following method can used: convert number in elements bucket based system, i.e calculate maximum of digit in of string. example in above list, value 2. convert numbers in elements in such way length turns out of length same maximum. therefore,'screen 4 episode 13' converted 'screen 04 episode 13' , 'screen 11 episode 1' converted 'screen 11 episode 01'. now sort modified list string.

Are Objective-C UUIDs compatible with .NET -

is uuid (guid) created using cfuuidcreate in objective-c compatible guids created within microsoft .net framework. i.e. if build ios system generates ids using cfuuidcreate able use these in .net context? thanks. a uuid/guid 128-bit integer. such, inherently platform-agnostic. when represented strings, seems both cfuuidcreatestring() , system.guid.newguid().tostring() use same format. the difference cfuuidcreatestring() uses uppercase letters represent hex digits ( "6027ec11-8084-4678-a250-53d534aefd4a" ) while .net version uses lowercase letters ( "9245fe4a-d402-451c-b9ed-9c1a04247482" ) default.

objective c - Is there a MD5 library that doesn't require the whole input at the same time? -

i'm working on objective c cocoa application. tested cc_md5 in commoncrypto , , worked fine; however, when gave 5 gygabyte file it, whole computer froze , crashed. md5 algorithm processes input 512-byte chunks , doesn't require input @ once. there library in objective c or c asks next 512-byte chunk instead of taking input @ once? there great thread on calculating md5 of large files in obj-c here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/17659-calculating-md5-hash-large-file.html here solution came there: +(nsstring*)filemd5:(nsstring*)path { nsfilehandle *handle = [nsfilehandle filehandleforreadingatpath:path]; if( handle== nil ) return @"error getting file md5"; // file didnt exist cc_md5_ctx md5; cc_md5_init(&md5); bool done = no; while(!done) { nsautoreleasepool * pool = [nsautoreleasepool new]; nsdata* filedata = [handle readdataoflength: chunk_size ]; cc_md5_update(&m...