Posts

Showing posts from September, 2015

c++ - Linked List error when inserting for the last time -

so have part of code here this loop 5 times (max = 5) insert word link list. for ( int = 0 ; < max ; i++ ) { string alphabet = g->returnalphabets(); l[i]->addwords(alphabet[i]); } and have insert word part here string line; fstream myfile ("words.txt"); while (!myfile.eof()) { getline(myfile,line); if ( alphabet == line[0] ) { listnode *newnode = new listnode; if ( head == null ) { newnode->item = alphabet; newnode->next = null; head = newnode; } else { newnode->item = line; prev = cur; prev->next = newnode; } cur = newnode; } } myfile.close(); my problem gives me error on last loop. meaning on max = 4, insert node. rest of loop fine. when decrease max 4 meaning loop 4 times, program error-free when program loops 5 times gives error. anyone can poin...

Using Angularjs $http in browser console -

i've testing angularjs services in browser console during development quick verification. way inject service console describe in this question or var $inj = angular.injector(['myapp']); var serv = $inj.get('myservice'); serv.dosomething(); that working angularjs 1.0.7. however, after upgrading 1.1.5, doesn't work anymore services uses $http service, no xhr sent. i've tested injecting $http directly, doesn't work. angularjs changelog seems have no record on issue. may know what's problem here? update: it seems angularjs 1.0.7 uncompressed version doesn't work well. tested working version angularjs 1.0.7 minified. it works uncompressed also. $http = angular.element(document.body).injector().get('$http'); then $http.get(...) // or post or whatever

java - Cannot connect to a local sesame local store -

i want create sparql endpoint locally tomcat on computer , sesame2.7.3 apis, there problem encountered. after have created native datastore on computer, want connect datastore , execute sparql queries on it, , code in java, following error message tomcat. exception javax.servlet.servletexception: error instantiating servlet class com.jelly.web.rdfservlet org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:103) org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:293) org.apache.coyote.http11.http11processor.process(http11processor.java:861) org.apache.coyote.http11.http11protocol$http11connectionhandler.process(http11protocol.java:606) org.apache.tomcat.util.net.jioendpoint$worker.run(jioendpoint.java:489) java.lang.thread.run(thread.java:680) root cause java.lang.noclassdeffounderror: org/openrdf/repository/repositoryexception java.lang.class.getdeclaredconstructors0(native method) java.lang.class.pri...

You don't have permission to access /marcon/assets/images/pic.jpg in apache php -

i getting error don't have permission access /marcon/assets/images/pic.jpg in apache php on local fedora 17, php,mysql , apache(not xampp installation). error occuring new files copying directory.the older files /marcon/assets/images/header.jpg accessible fine. checked permissions , 777 (now) still doesn't work. wierd error. subdirectory , other images work fine. newer files don't work this happens when embed image when access directly. works other files in directory. not newer ones edit: ironically problem doesn't occur if check files github , clone project again. works hunky dory. it selinux issue: try $ ls -z file1 you should similar to: drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 scripts if no try: chcon -r -t httpd_sys_content_t /marcon/assets/images

c++ - Issues with OpenGL referencing when compiling in Ubuntu terminal -

i working on compiling directory of c++ files , headers. thought installed opengl, glut , glew keep getting referencing errors when running it. here doing , errors compiler sending me: user@linux-machine:~/documents/hw$ make g++ -g framework.o poly_line.o shader_program.o circle.o controller.o main.o scene.o view.o -lglew -lglut -lglu -o hw framework.cpp:84: error: undefined reference 'glgeterror' check_gl.h:30: error: undefined reference 'glgeterror' check_gl.h:43: error: undefined reference 'glgeterror' poly_line.cpp:23: error: undefined reference 'glgenbuffers' poly_line.cpp:28: error: undefined reference 'glbindbuffer' poly_line.cpp:29: error: undefined reference 'glbufferdata' poly_line.cpp:54: error: undefined reference 'glenable' poly_line.cpp:55: error: undefined reference 'glenable' poly_line.cpp:56: error: undefined reference 'glblendfunc' poly_line.cpp:57: error: undefined reference 'glhint...

multithreading - Python 2.7.5 - Run multiple threads simultaneously without slowing down -

i'm creating simple multiplayer game in python. have split processes using default thread module in python. noticed program still slows down speed of other threads. tried using multiprocessing module not of objects can pickled. is there alternative using multiprocessing module running simultaneous processes? here options: mpi4py: http://code.google.com/p/mpi4py/ celery: http://www.celeryproject.org/ pprocess: http://www.boddie.org.uk/python/pprocess.html parallel python(pp): http://www.parallelpython.com/

java - activate/deactivate sonar maven plugin by profile? -

i use sonar plugin executes if activated in maven profile. sonar runs on every compile. the problem build fail other team members not have sonar application installed locally. pom.xml checked in team members same copy including sonar configuration, don't want them modify purpose of disabling sonar (they might inadvertently check modified copy in). please advise how configure maven (.m2/settings.xml) and/or pom.xml sonar feature can enabled/disabled local profile. here sonar configuration in each project's pom.xml: <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>sonar-maven-plugin</artifactid> <version>1.0</version> <executions> <execution> <id>make-sonar</id> <phase>compile</phase> <goals> <goal>sonar</goal> </goals> </execution> </executions> ...

jsf - How to get rid of ViewState Error -

i used omnifaces handle redirect problem after session expired @ primefaces , works well. problem when try relogin after session timeout occurs , directs me login page, come across following error. after clicking f5, or reloading page error disapperas , directs me homepage. problem come across error after session expires , when click ajax button.afterwards, directs me login page. after write username / password , click login button come across viewstate error blank page gives me following message. i glad if can me. best regards alper kopuz error : 339983964997632919:6839730696265126459

c++ - Finding min and max of a point vector -

i want find min , max value point vector. vector consists of x , y element type. want min , max of x , minmax of y. vector defined as: std::vector<cv::point> location; findnozeroinmat(angles,location); //i tried use gives error minmaxloc(location.cols(0), &minval_x, &maxval_x); minmaxloc(location.cols(1), &minval_y, &maxval_y); i tried location.x didn't work. how can min , max value of x , y seperately? you can use std::minmax_element custom less-than comparison functions/functors: #include <algorithm> bool less_by_x(const cv::point& lhs, const cv::point& rhs) { return lhs.x < rhs.x; } then auto mmx = std::minmax_element(location.begin(), location.end(), less_by_x); and y . mmx.first have iterator minimum element, , mmx.second maximum one. if don't have c++11 support auto need explicit: typedef std::vector<cv::point>::const_iterator pointit; std::pair<pointit, pointit> mmx = std::min...

c# - SqlDataReader null exception -

i have sqldatareader fills multiple textboxes, issue when null exception dont know how handle. sqlcommand command = new sqlcommand("select * zajezd akce='" + akce + "' , rocnik='" + klientclass.rocnik() + "'", spojeni); spojeni.open(); sqldatareader read= command .executereader(); if (read.read()) { s_ub_cen.text = read.getdecimal(59).tostring(); object nulldate = (s_ub_dat.text = read.isdbnull(61) ? string.empty : read.getdatetime(61).toshortdatestring()); } exception: system.data.sqltypes.sqlnullvalueexception: data null. i have 20 textboxes, there easy solution? leave textboxes empty when value null, working fine shortdatstring. i need figure out how handle when value db null: s_ub_cen.text = precti2.getdecimal(59).tostring(); thank much. you need check isdbnull : if(!precti2.isdbnull(59)) { ...

Screen Resolution for different Android Devices -

this question has answer here: application skeleton support multiple screen 2 answers how solve screen resolution problem? i want application run on android device, , layout should not change, i read android blog of supporting multiple screens,but not enough idea. i have created different layout folder layout-small,layout-normal,layout-large,layout-xlarge , created different xml files folder. but when run on tablet takes default normal size xml file,i don't know why? please me solve it, in advance , waiting response <supports-screens android:smallscreens="true" android:normalscreens="true" android:largescreens="true" android:xlargescreens="true" android:anydensity="true" /> add manifest file of app.

Check function parameters for existence and type in JavaScript -

supposed have function defined such as: var x = function (options, callback) { /* ... */ } options needs have properties foo , bar , foo shall of type number , , bar of type string . so, basically, check using following code: var x = function (options, callback) { if (!options) { throw new error('options missing.'); } if (!options.foo) { throw new error('foo missing.'); } if (!options.bar) { throw new error('bar missing.'); } if (!callback) { throw new error('callback missing.'); } // ... } but checks existence, not yet correct types. of course can add further checks, becomes lengthy, , not readable. once start talking optional parameters, gets mess, parameter-shifting , on … what best way deal (supposed want check it)? update to clarify question: know there typeof operator, , know how deal optional parameters. have these checks manually, , - sure - not best can come with. the goal of question was: there ready-made f...

sql - Joining Two query -

select a.enquiry_id,a.ckeck_in,a.check_out,a.hotel_name,a.meal_plan,a.room_type,a.occupancy_type,a.room_qt,a.adults accomodation a.enquiry_id = 74 select q.enquiry_id,q.start,q1.stay_at quick_plan q,quick_plan q1 q.enquiry_id = 74 , q1.enquiry_id = 74 , q.stay_at = q1.start result of 1st query is 74 2013-08-03 2013-08-04 ads cp deluxe double 1 2 and result of 2nd query is 74 ahmedabad agra nw want combine these 2 query result 74 2013-08-03 2013-08-04 ads cp deluxe double 1 2 ahmedabad agra in case easiest way use ctes won't need modification. ;with firstcte ( select a.enquiry_id, a.ckeck_in, a.check_out, a.hotel_name, a.meal_plan, a.room_type, a.occupancy_type, a.room_qt, a.adults accomodation a.enquiry_id = 74 ), secondcte ( select q.enquiry_id, q.start, ...

events - Extjs 4.2 Parameter in listeners function -

i've got problem controller ext.define('app.controller.mycontroller', { init: function() { this.control({ '#myinputfield': { change: this.textfieldchange(parameter) } }) }, textfieldchange: function(parameter) { //do } }); its problem when give parameter here change: this.textfieldchange(parameter) then fire after site load , don't know why. without parameter waiting change event should can any1 me please ? it because: change: this.textfieldchange here giving reference function property change: this.textfieldchange(parameter) here giving result of function property (which if don't use return, undefined ). you can use eopts variable in function definition, custom parameter sending, see in example: ext.define('app.controller.mycontroller', { init: function() { this.control({ '#myinputfield': { ...

css - Custom fonts not rendering in IE8 or IE7 -

my custom fonts not render in ie7 or ie8. getting crazy trying figure out went wrong. here css code @font-face { font-family: 'neutratextdemi'; src: url('customfonts/neutratext-demi.eot'); src: url('customfonts/neutratext-demi.eot?#iefix') format('embedded-opentype'), url('customfonts/neutratext-demi.woff') format('woff'), url('customfonts/neutratext-demi.ttf') format('truetype'), url('customfonts/neutratext-demi.svg#neutratextdemi') format('svg'); } you notice difference if open file in let's chrome , ie8. went through other stack overflow issues , solutions. can't seem solve @ all. in internet explorer 8 , earlier, url must point embedded opentype (eot) file (.eot or .ote format). no other font formats supported. i used arialblack.ttf for below sample: /* generated font squirrel ( http://www.fontsquirrel.com ) on august 26, 2013 */ @...

ruby - Different javascript loading process between Production and Development environments -

i've got issue must come side turning me crazy :-p when i'm in development environment, i've put these lines in application.html.erb have i18n.js working : <%= javascript_include_tag "i18n" %> <%= javascript_include_tag "translations" %> the problem on production environment, doesn't work (it doesn't found i18n.js , 404, know that's normal, due assets pipeline), i've put these lines in application.js : //= require i18n //= require i18n/translations but if leave these that, i've got error in development environment : uninitialized constant simplesideias it works rest of scripts, i18n.js got problem load. what way make them both works ? :p

if statement - if(a,b,c,d) how does this work? -

this question has answer here: what comma operator , do? 8 answers int main(void) { int a=0, b=20; char x=1, y=10; if(a,b,x,y) printf("bye"); return 0; } how "if" condition in above code work work? value of "y" considered "if"? yes, value of comma operator right operand. because none of other operands have side effects, boils down if (y) .

matlab - output in different windows -

Image
can show 3-4 outputs(graphical output, same images) in different windows using matlab.some thing following fig. for more clarification- example- for i=1:10 vid = videoinput('winvideo', 2); set(vid,'framespertrigger',2); start(vid); imagedata=getdata(vid,1); i=rgb2gray(imagedata); figure,imshow(i); end in case 10 frames shown in 10 different figure. not want do. want show frames in same window, if frame changes every time. i not talking figure or subfigure. , output can changed every time in same window. regards, you can call created figure using simple code figure(h) . this, no new figure window created. h = figure; %create figure ... figure(h); %call figure h , draw in it. using code h = figure; i=1:10 vid = videoinput('winvideo', 2); set(vid,'framespertrigger',2); start(vid); imagedata=getdata(vid,1); i=rgb2gray(imagedata); figure(h); imshow(i); end

asp.net - Error : The underlying connection was closed: The connection was closed unexpectedly. -

i tried suggestions in other posts , didn't work. i'm getting error when tried send request , getting response getresponse(). my codes this, protected string createsalerequest(double amount, int installment) { string request = ""; try { xmlnode node = null; xmldocument _msgtemplate = new xmldocument(); _msgtemplate.loadxml("<?xml version=\"1.0\" encoding=\"utf-8\" ?><epaymentmsg versioninfo=\"2.0\" tt=\"request\" rm=\"direct\" ct=\"money\">" + "<operation actiontype=\"sale\"><opdata><merchantinfo merchantid=\"\" merchantpassword=\"\" />" + "<actioninfo><trnxcommon trnxid=\"\" protocol=\"156\"><amountinfo amount=\"0\" currency=\"792\" /></trnxcommon><paymenttypeinfo>" + "<installmentinfo ...

php - MySQL - nested where condition -

i trying delete multiple records data table. problem if need remove 3 records of deposit need not 'deposit' keyword 'balance' keyword. table report: -------------------------------------------------------------------------------------- | report_id action_id action_name balance received given item_name total| -------------------------------------------------------------------------------------- | 1 1 balance 0 10 0 gold 10 | | 2 2 deposit 10 10 0 gold 20 | | 3 3 deposit 20 10 0 gold 30 | | 4 4 balance 0 5 0 silver 5 | | 5 5 deposit 5 5 0 silver 10 | | 6 6 deposit 10 5 0 silver 15 | | 7 1 withdraw 30 ...

android - Login impossible on webView -

i've little problem... i'm doing small web browser in app, , problem can't login on websites evernote or bitbucket. when i'm submiting form, i'm redirected on form's page, refreshed form instead of submiting it. i've enabled javascript on webview. has had problem ? ! use default cache mode: mwebview.getsettings().setcachemode(websettings.load_default);

php - Notification generation issue in Android GCM -

Image
i'm having following 2 problems: first problem: i have register 2 customers using same device, have same registration id. when send offer server side both of these customers, notification being displayed should depend on logged in customer. for example (see image): in application have customer login form. in form, if user gnanavel logs in, app has receive offers alone, , not other's offers. similarly, if user jeya logs in, app has receive offers alone, , not other's offers. currently app receiving both offers. edit: i have created login status field in database.if customer logs in device means received notification offers alone.i didn't other's offers.its working well. i have checked condition while click offer button: $getregid = mysqli_query($con,"select * pim_customers customer_id='$customer_id' , gcm_regid='$regid' , loginstatus='y'"); i wrote these condition means first problem solved.but raised...

php - Get values from Json code -

this json code [ {"prospectid":"87f3278e-c9ee-4775-abc6-4813969d45a5", "firstname":"erter", "lastname":"nurtertel", "emailaddress":"null", "company":"null", "phone":"null", "mobile":"456456456", "total":"690"}, {"prospectid":"00969dcd-5c03-450e-832c-063e976285d5", "firstname":"rter", "lastname":"erte", "emailaddress":"null", "company":"null", "phone":"56456456", "mobile":"null", "total":"690"} ] in code need prospectid.how prospectid in array php code? first of need change json string. put " " around null. use following code fetch value of 'prospectid' $json = '[{"prospectid":"87f3278e-c9ee-4775-abc6-4813969d45...

sql - MSSQL - union all with different decimal precision -

when execute sql select 1.4 union select 2.0400 union select 1.24 i following result: 1.4000 2.0400 1.2400 but when execute following sql select sum(1.4) union select sum(2.0400) union select sum(1.24) i following result: 1.4 2.0 1.2 why there difference in precision (scale) applied records? shouldn't use precision no data loss, 1st sql? thx. i know quite old question, none of existing answers seem address "why?" aspect question. first, data type literal expressions? wasn't sure (and didn't up) ran following: select 1.4 union select 'frob' which returns error: msg 8114, level 16, state 5, line 1 error converting data type varchar numeric. okay, 1.4 , other literals numeric - a.k.a decimal . next, return type of sum function, if passed decimal(p,s) 1 : decimal(38, s) okay, data types of 3 sum expressions in query decimal(38,1) , decimal(38,4) , decimal(38,2) . given 3 data types available pi...

c++ - Can't Clean Box2D from my Eclipse Android Project -

i new eclipse/android. have cocos2d-x project , have added box2d based on responses http://www.cocos2d-x.org/boards/6/topics/20827 . when project/clean/(clean projects) get clean: box2d_static [armeabi] rm -rf (target_objs) /bin/sh: -c: line 0: syntax error near unexpected token `(' i haven't been able find rm -rf (target_objs) line in shell scripts, have no idea error coming from. my hunch may mixing copy of box2d source in project copy in cocos2d-x home folder. here full build output, followed android.mk project. 11:19:03 ** clean-only build of configuration default project racerx ** bash /users/paul/projects/racerx/proj.android/build_native.sh ndk_debug=1 v=1 clean ndk_root = /users/paul/tools/android-ndk-r8e cocos2dx_root = /users/paul/tools/cocos2d-x-2.1.4 app_root = /users/paul/projects/racerx/proj.android/.. app_android_root = /users/paul/projects/racerx/proj.android using prebuilt externals make: ...

Cannot connect google APIs project to any google+ page -

hi have project created in google apis console , cannot connect google+ page, it show error "an error occurred while processing request. please try again." in 'connected service' page in google+ after press approve button. have tried several google+ pages didn't work. can tell me reason , how fix it? connecting google+ page google apis console project two-step process. can see full instructions @ bottom of page @ https://developers.google.com/+/features/analytics . however, basic process first tell console project google+ page connected, , go page , request connection project. to see demo, can see google+ platform insights episode of google+ developers live, connect google+ page enable additional analytics. demo begins around 2:15 @ http://www.youtube.com/watch?v=bpj9mvngel0 .

wpf - How to active UserControl outside the wrapper? -

i met focus related problem in usercontrol : suppose have usercontrol this: <usercontrol x:class="_20130826.usercontrol1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <stackpanel> <listbox> <listboxitem> <textblock text="text1" /> </listboxitem> <listboxitem> <textblock text="text2" /> </listboxitem> <listboxitem> <textblock text="text3" /> </listboxitem> <listboxitem> <textblock text="text4" /> </listboxitem> </listbox> </stackpanel> </usercontrol> and mainwindow.xaml this: <window x:class="_20130826.mainwi...

Image Processing Softwares -

i need process text inside image. image of meter reading data. tried newocr , few other free online image processing software, didnt read data correctly. which best image processing softwares(both freeware , shareware) can read meter data accurately? ps: need exact reading image processed. so, cannot afford handle inappropriate data. the images processed can found on this link. tesseract perhaps? http://code.google.com/p/tesseract-ocr/ im not sure able avoid inappropriate data, ocr make mistake , slip through.

windows - How to install a software and then run java class from batch file -

i have batch file runs java class file. want install software before running class file? when runs batch file again should not ask installing software again. file.bat @echo off cd acr122u_msi_winx64_1120_p setup.exe java -cp zpay-client-1.5-jar-with-dependencies.jar;.\resources com.abc.posgui.licensevalidator but asks install software everytime , not execute java class. appreciated. if java doesn't work have tried launch batch without "setup.exe"? @echo off cd acr122u_msi_winx64_1120_p rem setup.exe java -cp zpay-client-1.5-jar-with-dependencies.jar;.\resources com.abc.posgui.licensevalidator otherwise, sure installation has stopped?

Validation and Callbacks in redis data -

i using rails. stored part of data in mysql database , in redis. question : can apply callbacks , validation on redis data in rails? no - best can encaspulate write operations in lua server-side scripts, can validation work (and trigger lua callbacks). complete do-it-yourself approach.

How can I configure TortoiseSVN to not show .class, .log and folder list when creating an svn patch -

Image
i creating svn patch using tortoisesvn. gives me list of modified files choose create patch. in case long list of .class files , folder list, as .log files. is possible configure svn not show list of .class files , folder list while creating svn patch? i create patch file check modifications... screen. since you've mentioned *.class , *.log in svn:ignore list, should tell tortoisesvn not display them: you sort modified files list extension, , not select files extensions. from create patch screen, deselect show unversioned files : this assumes files unversioned in first place, because marking them ignored after versioning them pointless. hope helps.

c# - Unable to cast object of type 'System.Int16' to type 'System.String' -

i encounter following exception in linq query . unable cast object of type 'system.int16' type 'system.string'. var query = t in dt.asenumerable() select new { sys_db= t.field<int16>("process_id").tostring() + "|" + t.field<string>("db_code").tostring(), process_name = t.field<string>("process_name").tostring() }; why problem appear , how fix ? this t.field<string>("db_code").tostring() perhaps should this: t.field<short>("db_code").tostring() or equivalent t.field<int16>("db_code").tostring()

c# - MODI not working on another computer -

i use modi ocr. my application works fine in machine, it's not working on machine. application throws "class not registered" error. install sharepoint 2007 on machine , application works fine, don't want install sharepoint 2007 on computers. does have ideas? thank you.

android - Loading images in a Listview properly -

i'm using universal image loader library load images in listview, loads images notice if scroll first time can see wrong images being loaded first before correct image. how can stop effect. here entire class below. public mylistadapter(context context, list<venuedetails> m_venue_details) { super(context, r.layout.venue_list_row, m_venue_details); this.context = context; this.venue_details = new arraylist<venuedetails>(); this.venue_details = m_venue_details; df = new decimalformat("#.##"); } @suppresswarnings("deprecation") @suppresslint("newapi") @override public view getview(int position, view v, viewgroup parent) { final viewholder holder; final venuedetails vd = venue_details.get(position); if (inflater == null) { inflater = (layoutinflater) context .getsystemservice(context.layout_inflater_service); } if (v == null) { v = inflater.inflate(r.layout....

c# - Paging, sorting and filtering in SQL Server 2005 -

can please explain me custom paging, filtering , sorting . though have searched on internet these things ways difficult understand. body have better approach paging, filtering , sorting in single query. how able things in single query have created grid using forloop. , how can paging , filtering custom.i have checked loginc hav not understood . row number being used in many of examples of paging online. can please explain this. sorry poor english. please me asap. thank you. i find grids easiest way display large amounts of data. try googling examples of asp:gridview . basic functionalities grid automatically adds (when enable paging) are: previous page, next page , similar buttons move between pages max page/item count current page an important not on paging: client side paging: load all data @ once, display 10/15/20/... items @ once server side paging: load page viewing (so every time go different page there database call needed) generally, client side pa...

Hide/remove the GridViewGroupRow in Telerik RadGridView WPF -

how hide/remove gridviewgrouprow (rowheader expand/collapse) in telerik radgridview wpf. i tried set height=1 or visibility=collapsed hides data (not rowheader). <telerik:radgridview.grouprowstyle> <style targettype="telerik:gridviewgrouprow"> <setter property="showheaderaggregates" value="false"></setter> <setter property="visibility" value="collapsed"></setter> <setter property="height" value="1"></setter> </style> </telerik:radgridview.grouprowstyle> can me resolve issue. in advance. note : i can able hide expand/collapse button & other aggregation contents. i can able hide indent cell columns of gridview. but unable hide gridviewgrouprow. i found solution. setting height 0 in telerik's indentpresenter style solves problem. and ca...

android - How to show an image on a device without any quality loss -

i have 320 x 320 image on server , when download , show on device. blurred. i tried show in imageview below params. <imageview android:layout_width="fill_parent" android:layout_height="320dp"/> i tried getting dp equivalent of 320 px on device(240 dpi) , reduced the layout_height="213dp" but still image unclear. image on server clear. specify image view width , height wrap content. if not work try 2. try use draw9 patch tool generate equivalent image image have stored on server. downloaded image clear.

javascript - Php: How to get textbox value from mysql database without submitting the form -

i want check values either 1 of 2 textboxes text boxes matches value other without submitting form. keypress event handling this, sending value jour_info.php page get_sid.php page. have 2 files jour_info.php get_sid.php the code in first file <form method="post" name="journ_form" > p-issn/isbn<br/><input name="printissn" id="printissn_input" type="text" value=""> <input type="text" name="pissnsid" id="pissnsid" style="width: 30px;" autocomplete="off" value=""> <span style="color: red;" id="feedback"></span> </form> <script type="text/javascript"> $(document).ready(function(){ $('#feedback').load('get_sid.php').show(); $('#printissn_input').keyup(function(){ $...

arrays - PHP Iterator Custom Sort Order (Laravel 4) -

i have "post" object, accessed via ioc container. various errors tell me object's type ends " collection ", implements several interfaces, including iteratoraggregate , arrayaccess. i want display user-defined group of posts according specific order, e.g.: $desired=array("69","63","70");//these represent post id's just sorting array in manner seems complex, want sort collection. have been researching various combinations of usort(), uksort(), eloquent's sortby(), array_multisort()... obvious solutions result in orders 3,2,1 or 1,2,3, not 2,1,3. the closest have gotten goal fetch ones want, //blogcontroller private function myposts($desired){ $posts=$this->post->wherein('id',$desired)->get(); ... "convert" collection object array, $posts=$posts->toarray(); and treat array custom function: source function sortarraybyarray($array,$orderarray) { $ordered = array(...

jquery - Slide in menu creating horizontal scroll bar -

i've got issue slide-in menu. can view example here: http://jsfiddle.net/flobar/z62t2/ the problem when menu hidden, creates horizontal scroll bar. how prevent that? html: <div id="slidein"> <ul> <li>home</li> <li>about</li> <li>contact</li> </ul> </div> css: #slidein { background:red; width: 200px; float: right; margin-right: -180px; } js: var menu = 0; $('#slidein').click(function() { if (menu == 0) { menu = 1; $(this).animate( {marginright: '0px'},200 ); } else { menu = 0; $(this).animate( {marginright: '-180px'},200 ); } }); the way have it, need include overflow:hidden; on wrapper. see fiddle: http://jsfiddle.net/z62t2/5/ body { overflow-x:hidden; width:100%; }

Can I put C# and Java code in the same file to make porting my code easier? -

i porting code c# java. i'm finding it's easy miss code or make other mistakes. i'm thinking if can have both versions of code exist in same file, cut down on these mistakes. edit 1 file, 2 parts of file. if java had pre-processor c#'s (i know projects available allow this), write this: #if c_sharp namespace mymath { class naivefib { public int run(int n) { if (n == 0) return 1; if (n == 1) return 1; return run(n - 1) + run(n - 2); } } } #elif java package mymath; public class naivefib { public int run(int n) { if (n == 0) return 1; if (n == 1) return 1; return run(n - 1) + run(n - 2); } } #endif i still have problem ide recognizing file contains compilable code given java files named *.java , c# files named *.cs. looks can have visual studio think *.java files c# files if check right settings. wouldn't have make changes java ide (eclipse). i...

android - Remove item in ArrayAdapter<String> in ListView -

this question has answer here: unsupportedoperationexception arrayadapter.remove [duplicate] 2 answers unable modify arrayadapter in listview: unsupportedoperationexception 1 answer i delete clicked item in listview. the solution use arraylist instead of string[]; here code: public class mydialogfragment extends dialogfragment { @override public dialog oncreatedialog(bundle savedinstancestate) { alertdialog.builder builder = new alertdialog.builder(getactivity()); builder.settitle("critères supplémentaires"); builder.setnegativebutton("cancel", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int whichbutton) { oncancel(dialog); } ...

javascript - Define transparent material in JSON Model format 3.1 -

i ask, how define transparent material in json model format 3.1. have tried following json without success: { "metadata": { "formatversion" : 3 }, "materials": [{ "dbgcolor" : 15658734, "dbgindex" : 0, "dbgname" : "dummy", "illumination" : 2, "opticaldensity" : 0.5, "transparency" : 0.5, "colorambient" : [ 0.9, 0.1, 0.1 ], "colordiffuse" : [ 0.1, 0.7, 0.1 ] }], "vertices": [0,0,0, 100,0,0, 100,100,0, 0,100,0 ], "normals": [], "colors": [1,0,0, 0,1,0 ], "uvs": [], "faces": [67, 0,1,2,3,0, 1] } i have tried play different values illumination, optical density , transparency, no luck. thanks jan you need set transparent: true , transparency: 0.5 . latter maps opacity . "materials...

java class method stubs with /* compiled code */ -

i received third party authentication library use in clients application. didn't receive documentation , trying dig through source , see how works. i'm new java when click go to -> declaration on methods in intellij sends me .class file , see bunch of stubbed methods /* compiled code */ in methods. i'm sure common in java don't know search learn going on. clarification great. this typically means don't have source code, , intellij displays /* compiled code */ placeholder source code don't have. to see what's going on, best receive source code of third party library. you should of course documentation, reading source code , guessing how use library isn't best way learn. the second best option install decompiler plugin intellij, intellijad, automatically decompile java class file (note license third party library may disallow that). never 100% solution, in cases it's better nothing.

css - How to standardise font-sizes across different font-family -

Image
i using oswald ( http://www.google.com/fonts/specimen/oswald ) , bebas neue ( http://dharmatype.com/dharma-type/bebas-neue.html ) on website. i loading both via font-face (oswald via google web fonts, it's same process). however, fonts appear dramatically different heights when using same font-size definition (e.g. font-size:14px renders 2 different sizes). i need them render same size page work. two questions: i) causing difference, , ii) can done fix it? preferably ie8 compliance. thanks answer 1: glyphs in font positioned on canvas. need whitespace around positioned each other. amount of white differs. 1 of reasons ratio between x-height size of ascenders (bdfhklt) , descenders (gjqpy). if font has relative small x-height (large (as/de)cenders), there more white around glyph font has relative big x-height. there more variables influence amount of white. capital/lowercase ratio , font weight. answer 2: nothing broken. can use css , set font-size relativ...

java - Converting date in milliseconds to date format using JSTL -

we can convert date in milliseconds normal date format using jstl follows; <jsp:usebean id="mydate" class="java.util.date"/> <c:set target="${mydate}" property="time" value="1365532200000"/> <p>date: ${mydate}</p> output : tue apr 09 18:30:00 gmt 2013 and can format "mydate" timezone="ist" follows; <fmt:formatdate value="${mydate}" pattern="dd-mmm-yyyy hh:mm:ss z" timezone="ist"/> consider, if have milliseconds (1377614766426) value of date in gmt 5:30 time zone(tue aug 27 20:16:06 ist 2013), how can convert millisecond value date format based on system time zone? your date in milliseconds in utc. if change amount of milliseconds, still in utc, wrong. calculations date, use calendar. if calendar doesn't suffice, use joda time.

css - Jquery Mobile - set textbox background -

Image
i'm trying set background color jquery mobile textbox field, background not covering whole textbox. can see in image below on left , right ends of control there parts not inheriting background color. the problem the problem jquery mobile adding dynamically div wrappers , textbox rendered <div class="ui-input-text ui-shadow-inset ui-corner-all ui-btn-shadow ui-body-c"> <input type="text" name="name" class="inputreq ui-input-text ui-body-c" id="name" value=""> </div> if set background color div wrapper cover whole textbox, how can pure css ? there way set style of element's parent? here working jsfiddle example above. there brave jqm warrior me? use .ui-shadow-inset, ui-corner-all, ui-btn-shadow, ui-body-c { background-color: #d5eeff !important; } if override other component, remove award css. update $(".inputreq").parent().css("background-colo...

android - getSharedPreferences using R.something? -

with these lines: string app_name = "@string/app_name"; sharedpreferences sharedpreferences = getsharedpreferences(app_name, 0); i illegalargumentexception : file @string/app_name.xml contains path separator if this: sharedpreferences sharedpreferences = getsharedpreferences("myappname", 0); it works fine how use without hard-coding app name? can't use r.string.app_name because int. you can this string app_name = getresources().getstring(r.string.app_name); sharedpreferences sharedpreferences = getsharedpreferences(app_name, 0);

apply display none property of css on a paragraph -

i working on css , want display none p tag width refrence of div class ""abc unable cannot put , class in p tag auto generating use of refrence must in correct way. please. here html: <div class="abc">any text</div> <p>any text here</p> here css tried far: .abc p{ display:none} but know not correct search on google no luck. try adjacent sibling selector + . select element preceded former element: .abc + p{ display:none} jsfiddle example