Posts

Showing posts from September, 2013

amazon web services - How to set EC2 tags on AWS Opsworks -

i've been using various community cookbooks set stack. i'm aware aws opsworks sets tags (stack name, layar name), need set tags myself. there doesn't appear way set them through opsworks api, i'll assume need use cookbook/recipe set them somehow. is there existing method/cookbook so, or need go , learn chef? the lwrp listed on : https://github.com/opscode-cookbooks/aws - works. add in recipe tags required specific instances. lwrp : aws_resource_tag

sql - Invalid Identifier with Joins -

i don't tend ask questions regarding errors 1 happening me on every report doing. there fundamentally wrong approach , need solution , explanation if possible. need convert multiple reports , on getting error in 1 way or another. here code. i getting invalid identifier on: inner join unit_instance_occurrences uio on uio.offering_organisation = ou.organisation_code what don't understand ou identifier has been defined. here full code: select pu.calocc_code, ou.fes_full_name, pu.uio_id, uio.fes_uins_instance_code ||' '||uio.long_description crse_desc, ebs_tutorgroupslist_sel(pu.id,pu.uio_id) grp, pu.person_code, p.forename, p.surname, upper(p.surname) ||', '||p.forename||' ('||pu.person_code||')' student, pu.progress_code, pu.progress_status, pu.progress_date, marks.absent, marks.late, marks.not_expected, marks.present, marks.notified_absence, marks.blanks, sum( marks.absent+ marks.late+ marks.no

knockout.js - Knockout js Binding to drop down list -

i learning knockout js yesterday only. seeming new me. somehow managed it. let saving country list, state list database using knock out js. have done first task saving country list. problem started in second page saving state list. here binding countries drop down list in state.aspx page, after dont understand how proceed. let me give code: <div id="state_container"> <table border="0" cellpadding="0" cellspacing="0" class="form" data-bind="with:statemodel" width="300px"> <tr> <td> <span>statename&nbsp; </span> &nbsp;<input type="text" name="statename" data-bind="value:statename" /> </td> </tr> <tr> <td> <span>short name</span> <input type="text&q

c++ - init a thread which is a member variable inside of an constructor -

i trying write resourcecach should have thread loads , unloads objects of different types. started idea of having thread member variable , list wich std::string s represent path files load / unload. there method called work() should executed thread. enaugh talk. the question is: how init thread inside of constructor? .h class resourcecach { public: resourcecach(); ~resourcecach(); void init(); bool stopthread(); void load(std::string path); void unload(std::string path); private: thread m_worker; // ptr? reference? right? vector<std::string> m_toload; vector<std::string> m_tounload; void work(); }; and cpp should (this not work) resourcecach::resourcecach() { init(); } resourcecach::~resourcecach() { } void resourcecach::init() { m_worker(resourcecach::work, "resourcecach-thread"); } void resourcecach::work(){ } bool resourcecach::stopthread(){ if (m_worker.joinable()) { m_worker.jo

android - How to stop an activity from starting while checking if a user is logged in? -

i trying achieve following when user starts app: 1- if user not logged in show login screen. 2- if user created account , there valid token show start screen. to end have implemented custom authenticator based on tutorial found here http://www.udinic.com/ . the code works, issue shows current activity ui briefly switches add account ui provided accountauthenticator. how can fixed this? this code: @override public void onstart(){ super.onstart(); gettokenforaccountcreateifneeded(accountgeneral.account_type, accountgeneral.authtoken_type_full_access); } @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); maccountmanager = accountmanager.get(this); } /** * auth token account. * if not exist - add , return auth token. * if 1 exist - return auth token. * if more 1 exists - show picker , return select account's auth token. * @param accounttype * @param authto

c# - How to put a MessageBox to display my Fibonacci sequence vertically -

here's finished code, need little advice , how insert desired messagebox. needs display finished sequence vertically, thanks. using system; using system.collections.generic; using system.linq; using system.text; using system.windows.forms; class program { public static double fibonacci(double n) { double = 0; double b = 1; (double = 0; < n; i++) { double sum = a; = b; b = sum + b; } return a; } static void main() { (double = 0; < 12; i++) { console.writeline(fibonacci(i)); } } } if want show messagebox, try: static void main() { list<double> nums = new list<double>(); (double = 0; < 12; i++) { nums.add(fibonacci(i)); } messagebox.show(string.join(system.environment.newline, nums)); } a console application can display messagebox if you've included right libraries, , looks include system.windows.forms , should set. although honestly

Highcharts: Not plotting correctly with Y-Axis label formatter -

when use y-axis label formatter, points don't plot correctly. point "6.8" plotting above 6.8 line. also, y-axis ticks not equal intervals (7.8, 7.5, 7.3, 7.0, 6.8, 6.5). removing label formatter clears issue. know work-around can keep label formatter? with label formatter: http://jsfiddle.net/3tkdt/1/ without label formatter: http://jsfiddle.net/3tkdt/2/ label formatter: yaxis: { labels: { formatter: function () { return highcharts.numberformat(this.value, 1); } } } using numberformat function on y-axis labels wasn't idea. rounding tick marks , representing intervals incorrectly. removed label formatter.

mysql - Select query issue with join -

Image
hello please me one, stent table bal table with stent_size 20 both table, current_status = co_qc_comeplete , status = added, 5 records, instead in select query got 50 recrods.. confused.. i want 5 records of stent table join of bal table , want 5 records bal table. can me create select query one.. thanks in advance.. edit : select * stent sd left join bal bd on sd.stent_size = bd.stent_size sd.current_status = "co_qc_complete" , sd.stent_size = "20" , bd.status = "added" select * stent sd left join bal bd on sd.stent_size = bd.stent_size sd.current_status = "co_qc_complete" , sd.stent_size = "20" , bd.status = "added" returns 50 records because takes of bal (10 records shown) , joins stent (5 records shown) stent_size = stent_size. (each bal record paired 5 stent records) there nothing unique data save ids, can trouble when joining these tables. thinking little more, , th

Android MVC Framework -

i know if know android framework conventional applications. example, framework rails can see mvc pattern. see answer here overview of android's limitations, give idea of why mvc pattern on android has not yet emerged: http://www.quora.com/is-there-any-standard-mvc-framework-in-android-application-development-if-not-is-it-worth-developing-one after having posted answer have gone ahead , built fully-featured app using single-activity architecture. allowed past major ux limitations mentioned while being able have arbitrary complexity in controller hierarchies (parents children sub-children etc.). overall worked out great, have build out specialized components (ie: custom stack mechanism) store/restore state in way plays nicely android's own activity/fragment lifecycle patterns. there limitations around fragment animations had pull our hair out @ times, required more custom component workarounds. ie: animations show both outgoing , incoming fragment on-screen @ same

php - Lost in WSDL web service -

hi im doing billing system page. need echo image, iso/iec 18004:2000, (pdf?) wich generated using format: ?re=xaxx010101000&rr=xaxx010101000&tt=1234567890.123456&id=ad662d33-6934-459c-a128- bdf0393f0f44 they have give me url: www.url.com/webservice/webservice/server32_salespartner.php?wsdl url.com hide real wsdl any, way, have read here: http://www.tutorialspoint.com/wsdl/wsdl_example.htm http://www.tutorialspoint.com/wsdl/wsdl_introduction.htm and other stuff.. can't figure out how "send" info, know info not sent, here lost do have build url after server32_salespartner.php? ?, how? like this: www.url.com/webservice/webservice/server32_salespartner.php?re=xaxx010101000&rr=xaxx010101000&tt=1234567890.123456&id=ad662d33-6934-459c-a128- bdf0393f0f44 how image then? i'm lost here. i ask here cause web service provider bad, lazy , have been waiting answer 3 days, , need move on faster on this. sorry im newbie @ wsdl

ruby - Rails link to a new post in a category without going to the category page -

i have post model , category model. , when in show page of model can create new post belongs category with: <%= link_to 'new post', new_page_path(:category_id => @category)%>. however see list of categories this: <% @categories.each |category| %> <h3><%= link_to category.title, category %></h3> <% end %> and want clicking on category go directly new post form in category. instead of having go category_show page first. to direct category link new post form instead of category show page, can change link follows: <% @categories.each |category| %> <h3><%= link_to category.title, new_page_path(:category_id => category) %></h3> <% end %> with change, when click on category go directly new post form in category.

emacs - Org-mode: timestamp + effort -> time range -

i liked question , answer @ emacs - org-mode: creation time range effort estimate - stack overflow . regarding taking scheduled item , effort estimate , producing time range. i wanted different result, can't see how modify (i imagine modifying org-deadline easy). instead of scheduled item, wanted act on timestamp. in other words, (cutting, pasting , removing scheduled: linked question), * todo sample todo <2014-04-18 fr 10:00> :properties: :effort: 1h :end: would become * todo sample todo <2014-04-18 fr 10:00-11:00> :properties: :effort: 1h :end: i considered org-time-stamp , org-add-planning-info , no success. assistance appreciated.

html - How to replicate background-attachment fixed on iOS -

this question has answer here: fixed background image ios7 4 answers i'm trying fixed-background-image divs working on ios school project. i've been using background-attachment: fixed; but leading weird sizing , no scrolling effects in mobile safari. here site i'm working with; method i'm using quote div image backgrounds works on desktops fails on ios. somehow, http://www.everyonedeservesgreatdesign.com got working. i'm having difficulty following code because they're using squarespace template of kind, looks they're putting images position:fixed div somehow being clipped position:relative parent div. under impression wasn't possible clip position:fixed divs other viewport, i'm curious what's going on here. any ideas on how implement method fixed image div backgrounds in site? it has been asked in past,

visual studio 2010 - SSRS error on preview : "The size necessary to buffer the XML content exceeded the buffer quota" hides original error -

i understand there wrong report (e.g. columns missmatcch) , need correct see wcf error message hides actual problem , hiding irritates me more original problem: columns missmatch. i guess need adjust wcf 'buffer size' , original problem message. config file? text search of "system.servicemodel" in c:\program files (x86)\microsoft visual studio 10.0 doesn't bring idea... p.s. since preview of report not think ssrs configuration problem. problem localised somewhere in devstudio process or int devstudio's internal web server process ... p.p.s please me improve question. see responders doesn't understand kind of need. i have encountered multiple "flavors" of bug in ssrs preview. seems renderer preview mode quite fragile. there simple way solve this. ignore error , attempt upload rdl file reporting server. uploader happily tell wrong file - tell field has problem , problem is. if there multiple errors, told each , every fiel

sql - Extracting numeric value in teradata -

i have column varchar data type.some sample values abc 56 def 34 ghi jkl mno 78 i wanted numeric values only, like 56 34 78 thanks in advance. if you're on td14 can use regular expression: regexp_substr(col, '[0-9]+') before might have otranslate udf, there's old trick remove character list of wanted ones: otranslate(col,otranslate(col, '0123456789',''),'')

javascript - Facebook conversion tracking in Magento -

im trying implement new facebook conversion code in magento installation. according facebook need copy tracking code , paste between < head> , < /head> in webpage want track conversions. in magento be app\design\frontend\xxxx\yyyy\template\checkout\success.phtml however, cant find in file. the code looks this, have tip of how implement it?: <!-- facebook conversion code track facebook --> <script type="text/javascript"> var fb_param = {}; fb_param.pixel_id = 'xxxxxxxxxxxx'; fb_param.value = '0.00'; fb_param.currency = 'usd'; (function(){ var fpw = document.createelement('script'); fpw.async = true; fpw.src = '//connect.facebook.net/en_us/fp.js'; var ref = document.getelementsbytagname('script')[0]; ref.parentnode.insertbefore(fpw, ref); })(); </script> <noscript><img height="1" width="1" alt="" style="display:none" src="https://w

node.js - Can't use connect-redis in Express.js -

i'm studying express.js , learned how handle sessions using cookie-session module. i'm trying use express-session have problems. previously, using cookie-session instead of express-session, , memorystore worked perfectly. however, couldn't use connect-redis cookie-session, reason installed express-session, it, can't use sort of store, nor memorystore neither redis. the redis db on redistogo , uri looks this: (masked security although practice) redis://redistogo:e34d3***********************f4bb@albacore.redistogo.com:10072/ however, when run "node app", prints error. my package.json: { "name": "application-name", "version": "0.0.1", "author": "me <me@gmail.com>", "license": "mit", "private": true, "scripts": { "start": "node app" }, "dependencies": { "express": "4.

ruby - Remove element from array by type -

i have following array: ["--",1,2,3,4] how can remove elements array element type, ie. remove non-integer values array? i'd :- ary = ["--",1,2,3,4] ary = ary.grep(integer) ary # => [1, 2, 3, 4] note :- if don't want mutate original array use new_ary instead of ary . like new_ary = ary.grep(integer)

java - Cannot make a static reference to a non-static method -

this question has answer here: java error: cannot make static reference non-static method 7 answers i have in java code, when try compile code error. happens when try value of text in textview var. cannot understand error because works fine in other method. why happens , how can fix it? public class mainactivity extends activity { public edittext edittext; textview textview; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toast.maketext(mainactivity.this, "oncreate", toast.length_long).show(); //setupmessagebutton(); edittext = (edittext) findviewbyid(r.id.edittext1); textview = (textview)findviewbyid(r.id.tvisconnected); } public voi

matrix - Create an new DenseMatrix from an submatrix in Breeze using Scala -

i've densematrix (original) . slice remove last column ( subset ). after want access data in subset. however, subset.data still points data in old densematrix ( original ). idea i'm missing here , how fix ? original: breeze.linalg.densematrix[int] = 1 200 3 0 10 201 4 0 111 200 0 100 150 195 0 160 200 190 0 150 scala> val numcols = original.cols numcols: int = 4 scala> val subset = original(::, 0 numcols - 2) subset: breeze.linalg.densematrix[int] = 1 200 3 10 201 4 111 200 0 150 195 0 200 190 0 scala> subset.data res0: array[int] = array(1, 10, 111, 150, 200, 200, 201, 200, 195, 190, 3, 4, 0, 0, 0, 0, 0, 100, 160, 150) scala> subset.data.size res1: int = 20 never mind figured out 1 way of doing it. by using following scala> subset.todensematrix.data res10: array[int] = array(1, 10, 111, 150, 200, 200, 201, 200, 195, 190, 3, 4, 0, 0, 0) scala> subset.todensematrix.data.size res1

python - Pymongo query issue -

i have query works in mongo client doesn't return when using pymongo. i have tried: posts = collection.find({"species": argv[0]}), "evidence" : {"$in":["[true,true,true,null]","[true,null,true,null]"]}}) and posts = collection.find({"species": argv[0]}), "evidence" : {"$in": [["true","true","true","null"],["true","null","true","null"]]}}) i have narrowed problem $in statement looking different arrays, because if run works: posts = collection.find({"species": argv[0]})}) looks you've mixed parenthesis , braces: posts = collection.find({"species": argv[0], "evidence" : {"$in": [["true","true","true","null"] ["true","nu

algorithm - Generating random data for a scatter plot -

Image
i'm testing out different javascript graphing frameworks. i'm trying out line graphs , scatter plots generated data. while it's going quite okay. i've run trouble while trying generate data scatter plot. so quite easy in php, or in other language: for ($i=0; $i < $x; $i++) { $data[] = array( 'x' => mt_rand(0, 10000), 'y' => mt_rand(0, 10000) ); } the result distributed pretty equally around whole chart. here trying think of way come better random data, more scatter plot, rather equally distributed dots on page. , can't come anything. i end more random scatter plot web: so more intense in part of plot , pretty nothing in corners. wouldn't make impossible dot make corners. any algorithmic ideas? for image showed, have line around want scatter data, it's pretty easy. example, imagine line in y = x * 0.75 . given that, select x value in range 0..xmax (whatever maximum x value is), , g

java - Android video upload to server changes rotation 90° without any reason -

i have application records video , uploads server. however, when try play video back, find rotation changes without me doing such thing. have idea why happens ? knowing when play video local storage, rotation preserved recorded. so, whatever happens, happens during upload.

android - ListView optimization with local images -

i have listview uses custom adapter, custom adapter uses data jsonobject array (yes, not jsonarray ), list seems quite sluggish, have used holder pattern , cleaned object instancing getview() method, alternatives have? right it's loaded specific list ever be, 48 elements have following inflated view: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="10dp" > <linearlayout android:layout_width="0dp" android:layout_height="wrap_content" android:orientation="vertical" android:padding="10dp" android:layout_weight="1" > <textview android:id="@+id/name" android:layout_width="match_parent" android:layout_height="wrap_content" android:grav

java - if (specialmarkId != null) {.....} got ignored -

i using auto generated jpacontroller of netbeans 8 using java 1.8. public void create(physical physical) { if (physical.gettalentcollection() == null) { physical.settalentcollection(new arraylist<talent>()); } entitymanager em = null; try { em = getentitymanager(); em.gettransaction().begin(); specialmark specialmarkid = physical.getspecialmarkid(); system.out.println(specialmarkid+ "...nullvalue"); if (specialmarkid != null) { system.out.println(specialmarkid+ "...ain't right"); specialmarkid = em.getreference(specialmarkid.getclass(), specialmarkid.getid()); physical.setspecialmarkid(specialmarkid); } ..... } during physical object creation, specialmark (part of physical object) optional. it can have value or null. specialmark in table physical allows have null values. when spe

php - POST data without user input -

so, have html in cannot use php (it's brew/rapache): <html> <body> <% filename = paste(tempfile(tmpdir = '/home/collin/desktop/final_project/plot'), '.png', sep = '') png(filename) data = read.csv("/home/collin/desktop/final_project/uploads/admin/grade2.csv") plot(data) dev.off() %> <form action="view.php" method="post"> <input type="hidden" name="filename" value="<%=filename%>" /> </form> <meta http-equiv="refresh" content="0; url=http://localhost/final_project/view.php"> </body> </html> anyway. put simply, i'm trying post <%=filename%> (you can treat string) $_post['filename'] can use value in view.php. i've attempted form above no avail. doing wrong?

mysql - Dynamically alter drop down by the results of selecting another dynamic drop down php -

i trying populate second drop down results of first drop down box . want them dynamic mysql tables. have far, second drop down wont populate. based on results of selecting project_id , want see tasks under selected project. appreciated!!!! yes aware of mysql_query , vulnerabilities. intend on going after works correctly , fixing security issues. there 3 tables involved projects , employee , , tasks . projects: project_id, project_name tasks: task_id, project_id employee: staff_id, lname, fname code follows: <?php require_once('mainheader.php'); require_once('db_credentials.php'); ?> <!-- latest compiled , minified css --> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> <!-- optional theme --> <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css"> <!-- latest compiled , minified javascr

high procesion position in 3D when using processing -

processing offer 3d features when using p3d or opengl argument in size function,in 2d scenes.we can postion mousex , mousey,but in 3d,how can mouse? there no direct way get, say, mousez since mousex , mousey tell mouse on window, 2d nature. however, there called 3d picking looking for. simple process: the ability match mouse click on window showing 3d scene primitive (let's assume triangle) fortunate enough projected exact same pixel mouse hit called 3d picking. you can read detailed explanations , implementation tutorials on here: http://ogldev.atspace.co.uk/www/tutorial29/tutorial29.html , http://schabby.de/picking-opengl-ray-tracing/ (done opengl). there is, incidentally, picking library processing 2+ can here: https://github.com/nclavaud/picking library comes 2 examples see how implemented. to better search results on this, use 3d picking search term , you'll lot of results on google.

OpenGL + GLUT over SSH seg faulting -

i trying run opengl+glut program on ssh x forwarding. program provides following errors, seg faults. xlib: extension "nv-glx" missing on display "localhost:10.0". it seems being caused because "server" computer has nvidia card telling client computer use these nvidia specific rendering functions, when client doesn't have nvidia card. googled of course, , saw many other people have had similar problems; however, solution saw suggested ( https://superuser.com/questions/196838/opengl-program-not-work-with-x-forwarding ) try $ export libgl_always_indirect=1 or use nonzero value which did not work. don't care hardware acceleration/maintaing great performance on ssh connection. window rendering. first things first, x11 server computer produces display output. client program running on remote computer making use of display services of server. you right insofar, message because client (running on remote computer) executed on machi

angularjs - JavaScript recursion find method -

i've following json: "params": [ { "name": "a", "value": "tes", "isattr": false, "children": [ { "name": "b", "value": "b", "isattr": false, "uid": "0.529892839025706", "parent_uid": "0.8096382778603584", "children": [], "expanded": true, "level": 2 } ], "uid": "0.8096382778603584", "expanded": true, "level": 1 }, { "name": "c", "value": "c", "isa

c - How to read from a file using asp.net -

i have uploaded file server , want read data file , insert data oracle. using list taking data file , data reading list. no problem code. reads , data's inserted oracle table locally.. after hosting data's not inserted table..after inserting data become stuck.

Rails: Destroy session with a session_id -

i'm writing gem needs destroy arbitrary session session_id. currently i'm using following codes case rails.application.config.session_store when actiondispatch::session::cachestore rails.cache.delete("_session_id:#{session_id}") when actiondispatch::session::activerecordstore activerecord::sessionstore.session_class.find(session_id).destroy when actiondispatch::session::cookiestore # cannot remove client-storage session end but i've found destroy_session(env, session_id, options) method every sessionstorage class. how can call method in script? (not in request or controller) if you're storing session in db, can try in console: rake db:sessions:clear you can destroy whole session following controller: reset_session

jquery autocomplete with ajax and multiple categories not working -

i trying makeout jquery autocomplete http://jqueryui.com/autocomplete/#remote-jsonp remote json, categories http://jqueryui.com/autocomplete/#categories . the remote json not working in jquery example. loading spinner indefinitely. wrong ? how combine remote json category ? have tried unsucessful. example not working. the jquery ui example the remote jsonp datasource autocomplete example not working, because geonames.org webservice has changed since example has been written. perform request http://ws.geonames.org/searchjson , json containing following message: please add username each call in order geonames able identify calling application , count credits usage. when example written, anonymous call accepted no more case. autocomplete : remote source + categories just combine 2 jquery ui examples: // 1. extends jquery ui autocomplete widget manage categories $.widget("custom.catautocomplete", $.ui.autocomplete, { _rendermenu: fu

calling python script from php with import module in it -

i have module ( z:\development\pipeline\tom\maya\modules\getticket ) imported in python script (which queries database , sends list on web interface) being called in php script. the python code: #!/usr/bin/env python # encoding: utf-8 import getticket serversetup import json def main(): var = [] var.append("from python :):)") print var json.dumps(main()) php code : putenv('pythonpath=z:/development/pipeline/tom/maya/modules'); this import getticket line giving error (see below). without import works fine. question how import python module in python script such when python script run within php script works alright. error in apache_error.log: traceback (most recent call last): file "tacticactivity.py", line 13, in <module> import getticket serversetup importerror: no module named getticket

javascript - Accessing Nested JSON with AngularJS -

i'm trying pull data behance.net , i'm running 2 issues when try information. the first issue trying pull description of project. can information calling ng-bind="project.description" formatting (paragraph returns) not present, i'm trying pull formatted description. here html: <div class="col-sm-6"> <h3 ng-bind="project.name"></h3> <p ng-bind="project.modules.text"></p> <h4><i class="fa fa-tags success"></i> tags</h4> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="pull-left label label-info" style="margin-right:5px; margin-bottom:10px;" ng-repeat="tag in project.tags" ng-bind="tag"></div> </div> </div> here json data behance showing: angular.callbacks._0({ "proje

ios - Text in Cocos3d -

i developing iphone application uses cocos3d draw shapes , images. want draw text. can please guide me on how draw text using cocos3d? thanks in advance! if want embed text in 3d scene (like add sign on wall within 3d scene), can use cc3bitmaplabelnode . cc3demomashup app includes example of how this, in addbitmaplabel method of cc3demomashupscene . example more need, because uses specialized subclass of cc3bitmaplabelnode wraps text around cylinder. give idea of how use cc3bitmaplabelnode . if want add text 2d overlay part of user interface (like button, menu, or message user), use standard cocos2d components that. can add these 2d components customized cc3layer . see cc3demomashuplayer example of how this.

mysql - How to inner join table? -

i have table patient_detail has id , name , check_in_id , check_out_id . check_out has check_out_id , illness_id , check_out_date. check_in has check_in_id , illness_id , check_in_date . illness has illness_id , illness_name . problem don know how join illness_name check_out table. use pantiendatabase select name,check_in,illness_name,check_out_id check_in ci inner join patient_detail p on ci.check_in_id = p.check_in_id inner join illness on i.illnessid =ci.illness_id inner join check_out co on co.check_out_id = p.check_out_id you can join same table twice , use aliases selected columns: select name, check_in, ii.illness_name illness_name_in, io.illness_name illness_name_out, check_out_id check_in ci inner join patient_detail p on ci.check_in_id = p.check_in_id inner join illness ii on ii.illnessid = ci.illness_id inner join check_out co on co.check_out_id = p.check_out_id inner join illness io on io.illnessid = co.illness_id

javascript - Trigger a PHP function on drop down change -

i trying create web site table of results have drop down box @ end of each row let select quantity of row. in case user have thousands of results based on search criteria possibly large , variable amount of results on page @ 1 time. i want use onchange or similar method update each change in background (update query table) without reloading page. no other information on page change , unnecessary delay user reload page, pulls tables mean. i have been searching net several days now, , figured out how information extracted on drop down changed , changed in javascript. i haven't found how trigger update sql command without reloading page. can please tell me how variables extracted sql update without reloading page? here have far. appreciated. function quantityfunction(select) { var selectedoption = select.options[select.selectedindex]; alert (\"the selected option \" + selectedoption.value); }//alert testing </script> <?php ec

css outer div max-width scale inner image -

is possible fit image outer div width limited max-width? here fiddle example: http://jsfiddle.net/7uzg7/ <div style="width:100%;"> <div style="max-width:30%; background-color:red; float:right; padding:10px;"><img src="http://www.acasa.org.br/ensaio/grande/506.jpg"></div> lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum </div> sure :) make css so .container { width:100%; } .image-container { width:100%; max-width:30%; } .image-container img { width:100%; height:auto; } and html so <div class="container"> <div class="image-container"> <img src="/img/source"> </div> <p>your text</p> </div> as side note, try not inline style items - makes less reusable code. let me know if there else answer.

android - Low performance maybe related with images -

i don't know happened, developed simple memory game uses imageviews, @ point ok in performance terms, after exported , signed, game looks laggy in xperia sola, takes long press buttons when open game, after 3-4 buttons pressed go normal performance, issues aren't noticeable on better devices (xperia sp or lg optimus g testing examples). but, fact have not changed nothing on code either before or after last testings (when game ok), made changes on images, used picture editor remove imperfections on images , more polished, of course game size increased (from 826kb 1.85mb after edit) , nothing else. i'd show code long. maybe can me identify issue?

javascript - Recreate handles with jquery rotatable -

hi using minified plugin godswearhats call plugin $('#em_1').rotatable(); here html code <div class="draggable paragraph ui-draggable ui-resizable active resizableborder "id="em_1"> asdasd123123 <div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se active-resizable" style="z-index: 90;"></div> <div class="ui-resizable-handle ui-resizable-n active-resizable" style="z-index: 90;"></div> <div class="ui-resizable-handle ui-resizable-w active-resizable" style="z-index: 90;"></div> <div class="ui-resizable-handle ui-resizable-s active-resizable" style="z-index: 90;"></div> <div class="ui-resizable-handle ui-resizable-e active-resizable" style="z-index: 90;"></div> <div class="ui-resizable-handle ui-resizable-nw active-resiz

Non-repeating random number generator in C -

i want write program print out 10 random numbers every time run it, random numbers printing out should 1-10, should never repeat. update:sorry not stating exact problem, while loop suppose re assign random numbers if hasent been used causing program not print @ all. if comment out entire while loop , leave printf @ bottom prints out 10 random numbers between 1-10, prints out repeats. could tell me how can fix code or give me tips? #include <stdio.h> #include <time.h> int main() { int array[10]; int x, p; int count; int i=0; srand(time(null)); for(count=0;count<10;count++){ array[count]=rand()%10+1; } while(i<10){ int r=rand()%10+1; (x = 0; x < i; x++) { if(array[x]==r){ break; } if(x==i){ array[i++]=r; } } } for(p=0;p<10;p++){ printf("%d ", array[p]); } return 0; } if(x==i) can never true inside for (x = 0; x < i; x++) loop, therefore while loop never terminate. if statement has moved after for-loop: while(i&l

html - Make canvas element orbit around/follow mouse -

http://jsfiddle.net/cby7p/1/ i want cyan dot spin around in canvas chasing mouse, mouse has gravity. think of mouse planet , object comet. tried code, makes cyan dot spin crazy , not follow mouse much. <div class="section"> <div id="intro"> <div id="mouse" style="border-radius: 50%; position: absolute;height: 20px;width: 20px;background-color: blue;"></div> <canvas id="canvas" style="background:black;"> </canvas> <script> var canvas = document.getelementbyid("canvas"); canvas.width = $(window).width(); canvas.height = $(window).height(); </script> <script> var canvas = document.queryselector("#canvas") var ctx = canvas.getcontext("2d"); var mousex; var mousey; var kule = { cx : 100, cy : 100, vy : 2, vx : 2, r : 5, e : 1, color : "cyan"

mysql - Getting formatted and sorted data from SQL -

i data sql graph. instead of getting data , sorting in php solve using sql. the dates should grouped day , platform should counted , sorted ios , android. bonus: if can sort platform values, rather given values, better. here data presented in sql: date |platform --------------------+---------- 2014-04-22 11:15:55 |ios 2014-04-22 12:15:55 |android 2014-04-22 13:15:55 |ios 2014-04-23 11:15:55 |ios 2014-04-23 12:15:55 |android 2014-04-23 13:15:55 |android desired output: date |ios |android ------------+-------+----- 2014-04-22 |2 |1 2014-04-23 |1 |2 select `date`, sum(`ios`) `ios`, sum(`android`) `android` (select date(`date`) `date`, case when `platform`='ios' 1 else 0 end `ios`, case when `platform`='android' 1 else 0 end `android` demo) t group `date`

c++ - CIN validation using cin.fail -

i developing small program asks 4 integers 1 after other using std::cin . using function request integers, , passing in maximum value allowed argument. check if the value integer use std::cin.fail . code calls functions shown below. cout << "specify source number (1 - 1024)\n"; source = validate(1024); cout << "specify destination number (1 - 1024)\n"; // except data, value equal value returned validate function destination = validate(1024); // maximum possible value passed in argument in each of cases. cout << "specify type number (1 - 10)\n"; // user prompted enter desired values. type = validate(10); cout << "source port number (1 - 1024)\n"; port = validate(1024); and validate function code shown below. int validate(int max) { int value; // initialise variable hold value. (;;) {

ember.js - Prevent ember from updating templates when save() fails -

i'm building ember app on top of api , wonder, why ember updates template if saving fails because of invalid record (e.g. when api returns 422): data.set('name', 'some_invalid_stuff'); data.save().then(function() { // close modal _this.closeform(); // disable editing mode _this.set('isediting', false); }, function (response) { _this.set('errors', response.errors); data.rollback(); }); when comment out data.rollback(); , template gets updated invalid record, because api doesn't accept values. problem data.rollback(); strange flickering: first, record gets updated on template few milliseconds later, rollback fires , updates template old data. especially if list sorted alphabetically, "double-updating" annoying. is there way prevent template updating when save() fails? in fact, templates gets updated instantly after data.set('name', 'some_invalid_stuff'); . i'm using latest stable em

vb.net - How do I read each text file from directories -

basically in program there form , form b. in form a, user adds information , when clicks on button, folder unique id created , text file created in folder. whenever user wants save more information, each time so, folder gets created , text file gets saved inside it. in form b, i've added listview , set style details. want every time form loaded, program read each text file directories saved in e.g. c:/ , add read items. listview has these columns: username, description , me populate items relevant column, i'd like: listview1.items.add(new listviewitem({"username", "description"})) how can make reads each text file folders created , populates listview columns want? i managed solve problem adding loops. public sub readfile() each dir string in directory.getdirectories(getfolderpath(specialfolder.applicationdata) + "\folder\sub-folder\") dim file1 string() = directory.getfiles(dir, "file1") dim file2

internet explorer - PowerShell script to launch 4 IE windows using different AD account credentials -

why won't simple powershell script launch 4 ie windows using different ad account credentials embedded script? $users = ('testaccount1','testaccount2','testaccount3','testaccount4') $password = 'password' foreach ($user in $users) { $username = ('domainname\' + $user) write-host $username $cred = new-object system.management.automation.pscredential -argumentlist @($username,(convertto-securestring -string $password -asplaintext -force)) start-process -filepath "c:\program files\internet explorer\iexplore.exe" -loaduserprofile -credential $cred -argumentlist "http://websiteaddress.com" } when run it, error, ie file path correct: domainname\testaccount1 start-process : command cannot run due error: directory name invalid. @ c:\users\username\downloads\launch ie multiple users testing.ps1:12 char:2 + start-process -filepath "c:\program files\internet explorer\iexplore.exe" -