Posts

Showing posts from April, 2010

count - SQL Student Database -

i having hard time trying display number of classes in column student taking. i have following query not sure if count counting , how display count each student: create view busy_student select first_name, last_name, student.student_id student inner join enrollment on enrollment.student_id= student.student_id group student.student_id, student.first_name, student.last_name having count(*) > 2 create view call busy_student stores concatenated name (first name , last name), student id , count of classes enrolled in, students enrolled in more 2 classes. name columns, full_name, student_id , enroll_num respectively. your select statement should this: select first_name + ' ' + last_name [full_name], student.student_id, count(*) [enrol_num] student inner join enrollment on enrollment.student_id= student.student_id group student.student_id, student.first_name, student.last_name having count(*) > 2

android - Listview not showing text from my Database -

i have listview setup shows 3 rows numbers 1-3 , it's not showing entries database.i've tried find answer listview subject vague , can't find clear answer on how show text db entries. here codes xml layout,listview class , cursor entry in database. layout: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/nfbackground" android:orientation="vertical" > <imageview android:id="@id/titlebar" android:layout_width="wrap_content" android:layout_height="66dp" android:src="@drawable/nftitlebar" /> <listview android:id="@android:id/list" android:layout_width="match_parent" a

php - jQ Grid problems with edit form does not send request to the SQL database -

i new user of jq grid , implement edit form. grid linked sql database. data of sql database correctly displayed in grid. when select row , click on edit button, edit form appearing data of selected row. when i'm modifying information , click submit, modification displayed on grid ** sql database not updated**. if refresh page, grid display information of sql database , can see modifications have not been made in database (the data displayed same displayed ). can me out ? here grid code : <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>my first grid</title> <link rel="stylesheet" type="text/css" media="screen" href="jq

input - Radio buttons in PHP not working properly -

i have code: <?php if (isset($_post['ans'])) { $answer = $_post['ans']; if ($answer == "ans1") { echo 'correct'; } else { echo 'incorrect'; } } ?> <form action="example.php" method="post"> answer 1 <input type="radio" name="ans" value="ans1" /><br /> answer 2 <input type="radio" name="ans" value="ans2" /><br /> answer 3 <input type="radio" name="ans" value="ans3" /><br /> answer 4 <input type="radio" name="ans" value="ans4" /><br /> <input type="submit" value="submit" /> </form> when select wrong button, tells me incorrect , when select right 1 tells me correct. problem if no button selected nothing happens. not echo incorrect or correct. if a

SyntaxError: invalid label using jQuery.ajax() -

Image
i'm trying make ajax call server using following jquery call: $.ajax({ type: "get", datatype: "jsonp", url: "http://iceworld.sls-atl.com/api/&cmd=time", success: function (data) { console.log("success"); console.log(data); }, error: function (error) { console.log("error"); console.log(error); }, }); i data expect browser, firebug keeps saying "syntaxerror: invalid label" shown below: so, puzzles me reason why error callback called instead of success. i'm wondering did wrong here. jsonp data must returned in format: callback( jsonobject ) . why getting invalid label error. expecting function, not json object. need modify server code wrap return value name of callback function. name automatically added request jquery when request jsonp. if watch request, should see this: http://iceworld.sls-atl.com/api/&cmd=time?callback=jqu

mysql - Sort array values after search php -

hi reasons when i did search form(post method) got array below: array( [0] =>array ( [0] => 2008 [1] => name1 [2] => surname1 ) [1] =>array ( [0] => 2009 [1] => name2 [2] => surname2 ) [2] =>array ( [0] => 2010 [1] => name3 [2] => surname3 ) ) how can sort array without executing other query , using $_get parameter or getting array this: array( [0] =>array ( [0] => 2010 [1] => name3 [2] => surname3 ) [1] =>array ( [0] => 2009 [1] => name2 [2] => surname2 ) [2] =>array ( [0] => 2008 [1] => name1 [2] => surname1 ) ) with array_reverse() function. manual: http://php.net/manual/en/function.array-reverse.php

jnlp - Java web start is not downloading respective JRE automatically -

i heard java web start download latest jre automatically. not doing that. here issue. #### java web start error: #### java.lang.unsupportedclassversionerror: jvmcfre003 bad major version; class=com/ibm/nzna/projects/qit/qit, offset=6 i know getting because have compiled code on jdk 7 , machine have jdk 6. please advice if need mentioned specific line in jnlp file <?xml version="1.0" encoding="utf-8"?> <!-- not edit! last regenerated 2012-11-11 05:50 pst replicatorsender --> <!doctype jnlp public "-//sun microsystems, inc//dtd jnlp descriptor 6.0//en" "http://java.sun.com/dtd/jnlp-6.0.dtd"> <!-- doctype points sun, not oracle compatibility. --> <jnlp spec="6.0+" codebase="sample" href="qit_fester.jnlp" version="6.5.2"> <information> <title>quest input tool fester 6.5.2</title> <vendor>ashish tyagi</vendor> <description&g

Android : How to wait until Timer and Timertask finish their work on UI Thread -

i have fragment. in fragment, have timer run timertask periodically. override onpause when switch fragment, timertask , timer stop work. @override public void onpause() { super.onpause(); timertask.cancel(); timer.cancel(); timer.purge(); } and here code switching fragment : orderfragment fragment2 = new orderfragment(); fragment2.setarguments(arguments); getsupportfragmentmanager().begintransaction().replace(r.id.item_detail_container, fragment2).commit(); but when switch different fragment, receive null point exception because timertask cannot access ui thread anymore (because have used runonuithread ) so, question : how sure timer , timertask stop work, before can change fragment. thanks :) it seems onhiddenchanged(boolean hidden) need. fragment onpause() documentation: this tied activity.onpause of containing activity's lifecycle. so o

date - Dynamics CRM 2011: javascript, 'null' is null not an object. error -

i using javascript on dynamics crm 2011. trying create new field comparing 2 date fields. however, think wrong null value. cas error message shows up: 'null' null not object. the following script. please have look, , let me know think. function m1status() { var m1date = xrm.page.getattribute("new_m1date").getvalue() var today = xrm.page.getattribute("new_todayis").getvalue() if (m1date == null) { xrm.page.getattribute("new_m1status").setvalue('not booked');} else if (m1date.gettime() >= today.gettime()) { xrm.page.getattribute("new_m1status").setvalue('booked');} else { xrm.page.getattribute("new_m1status").setvalue('completed');} //set submit mode xrm.page.getattribute("new_m1status").setsubmitmode("always"); } also default value null. cas nothing shown up. thanks much. there typos in code, can rewr

javascript - AJAX catch difference between «failed» and «canceled» sending request to another domain -

i'm making ajax request server on domain don't actially need response, know got request. when ok, in chrome developer tools (header status) says «canceled» , console writes «xmlhttprequest cannot load» server gets requests. when server down header status not number «failed». trying catch critical difference on js xhr status 0 in both cases. i'm making ajax request server on domain you can't make ajax request different domain, due same-origin policy . want @ jsonp, writes out <script> tag remote url. what jsonp about? detecting success/error jsonp calls tricky, doesn't work typical ajax calls @ all. ideally want remote server call callback function on page, above link describes. if don't control other domain, can attempt detect errors using timeout. here post discussing jquery timeout argument this, though implement own timeout raw javascript well.

class - Haskell type enforcement on typeclass parameters -

i trying follow along machine learning book , knowing bit future content trying make code generalisable. here code. have other instances of dataset, have now. data superviseddataset x y = superviseddataset [([x], y)] deriving (show) class dataset augment :: x -> -> --augment each input vector, making x head. instance dataset (superviseddataset x y) augment v (superviseddataset ds) =· let xsys = unzip ds in superviseddataset $ zip (map (v:) $ fst xsys) (snd xsys) i trying enforce type of first parameter of superviseddataset first parameter of augment requested type checker in ghc. perceptron.hs:16:7: couldn't match type `x1' `x' `x1' rigid type variable bound type signatu

android - AndroidWebDriver class missing in Selenium-Java library -

i tried example provided in the, android app testing through selenium, have included selenium-java library , android-webdriver apk installed in emulator, when try sample code provide in forum got error in anroidwebdriver import, in selenium library androiddriver class available, adroidwebdriver jar. plz assit. note: selenium library latest one. import android.test.activityinstrumentationtestcase2; import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.android.androidwebdriver; import simple.app.simpleappactivity; public class simplegoogletest extends activityinstrumentationtestcase2<simpleappactivity> { private webdriver driver; private webdriver googledriver; public simplegoogletest() { super("simple.app", simpleappactivity.class); } @override protected void setup() throws exception { driver = new androidwebdriver(getactivity()); } ....

Mysql conditional insert(With the combined primary key) -

i have table following structure id -- auto increment name -- unique group -- integer primary key(name,group) i not want add element same name , group values. (i.e ("test",1) , ("test",1) should not inserted.... , ("test",1),("test",2) can inserted). i want insert value if not exist .. checked link . using above link possible operation , problem checks name key not combined group (i.e insertion of values("test",1) , ("test",2) not happening) how can this. i think problem name column unique ,please remove unique constraint on name column , try insert ignore yourtable(name,group)values("test",2)

Find the sum of a Javascript array and divide by its length -

i'm embarrassed ask this. i'm beginner programmer, , javascript confusing me. managed put of instructor, there simple things can't right. i tried search stack overflow thread answer question, of them i've seen contain code haven't learned yet, they're gibberish me. what i'm trying add values of array , divide sum array's length, ergo, find average. description of assignment find average of number of students' grades. my 2 problems i can't figure out how sum of numeric values in array and, for reason, array.length returns 1 more actual length of array, if add -1. (ex. if enter 6 values, array.length return 7.) i know problem can't figure out need enter. assignment due tomorrow, anyone's time , effort appreciated. here script: <script type="text/javascript"> var allgrades = new array(); var g = 0; var l = 0; var s = 0; var t = 0; { allgrades[g] = window.prompt("plea

java - Android application Error passing data -

i keep getting error shows: (04-04 23:26:29.557: e/dalvikvm(716): unable open stack trace file '/data/anr/traces.txt': permission denied). please help. i'm trying pass data android app. public class data extends activity implements onclicklistener{ button start, startfor; edittext sendet; textview gotanswer; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.get); initialize(); } private void initialize(){ start = (button) findviewbyid(r.id.bsa); startfor = (button) findviewbyid(r.id.bsafr); sendet = (edittext) findviewbyid(r.id.etsend); gotanswer = (textview) findviewbyid(r.id.tvgot); start.setonclicklistener(this); startfor.setonclicklistener(this); } @override public void onclick(view arg0) { // todo auto-generated method stub switch(arg0.getid()){ case r.id.bsa: string bread = sendet.gette

javascript - Cannot construct regex -

i trying build regex expression validation. want check if string combination of atleast 1 alphabet , 1 integer. have tried ^(?=.*[\w][\d]).+ don't understand regex much. expression checks both aplhabet , number in string wants string have alphabet @ start. instead want check if both alphabet , number present in string irrespective of number , order of occurence. alphabet can both capital or small guess word checking case insensitive. string might contain special characters along word , digit in combination , order space should discarded. can help? you'll have use 2 lookaheads: /(?=.*[a-z])(?=.*[0-9])/i

arrays - Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: -1 -

i'm getting error: exception in thread "main" java.lang.arrayindexoutofboundsexception: -1 @ snakebox.neighbor(snakebox.java:150) @ snakebox.findsnake(snakebox.java:86) @ pg6a.main(pg6a.java:28) the class being used is: /** class can used manipulate 2d boxes of "snakes" pg6. */ import java.util.*; import java.io.*; public class snakebox { // instance variables private char[][] box; private int rows, columns; private int snakecount; private int startrow, startcol; private int endrow, endcol; private boolean finish; private int x, y; private string todisplay; /** create , initialize snakebox reading file. @param filename external name of plain text file */ public snakebox(string filename) throws ioexception{ scanner filescan = new scanner(new filereader(filename)); rows = filescan.nextint(); columns = filescan.nextint(); snakecount = filescan.nextint(); filescan.nextline(

Why does gcc require gmp? -

as has ever built gcc source knows, gmp dependency gcc. why this? in other words, gcc use for? see this answer similar (but not same) question. gmp needed inside compiler (at compilation time) notably constant folding. language standards (notably recent versions of fortran) requires e.g. 1234567891234567*1234567891 computed in arbitrary precision. even c happier bigints constant folding: way correct result expression (perhaps obtained after macro expansion, if don't put explicitly in source code) (123456789087651234*65125412651209128612+187451)%10000000141 or (140000000000041*150000000000061+134500000000139)%250000000000111 . i forgot c or c++ standard says such constant expressions. computing them correctly not wrong. fortran requires them computed correctly, , need bigints. second example contains primes fitting in 64 bits, need bignums compute result correctly... also, gcc when cross-compiling needs more precision the host integer. consider cross-compil

Using SQL Server to augment a slow-performing database platform -

i have application written work mssql , company has moved on develop applications using slower database platform (i leave unnamed now). data migrated sql new slower platform , left task of changing app point new platform, @ same time finding way 2 keep fast enough usable. tests have shown new platform slower in measure of seconds while sql performs in milliseconds. have decided going impossible use new slower database platform support app because of does. want data stay in sql. this leads me think sync data slower platform on sql in order serve app, app needs write new slower database! some more constraints: the app , database deployed in same local network. the app allows multiple users edit data, , prevents users editing same record if being viewed else. the app relies on @ least 15 tables, largest of has 60 columns. would syncing data slower database sql , reprogramming app write both databases @ same time efficient way to this?

c# - Loading a DataView into a DataGrid causes ShowDialog to hang? -

i have straightforward code: var xldata = excel8oledbhelper.importexcelfile(filename); var viewmodel = new myviewmodel(xldata); _window = new mywindow(viewmodel); _window.showdialog(); the excel8oledbhelper.importexcelfile() method works, can view datatable's content when debugging. problem _window not show , thread behaves if did (i.e. it's waiting unshown window closed). if change code this: var viewmodel = new myviewmodel(new datatable()); _window = new mywindow(viewmodel); _window.showdialog(); then window appears, of course empty grid. the xaml grid: <datagrid x:name="mygrid" margin="4" isreadonly="true" selectionunit="cell" itemssource="{binding path=gridsource}" /> and viewmodel's constructor: public dataview gridsource { get; private set; } public myviewmodel(datatable datasource) { gridsource = datasource.defaultview; } this first time using wpf data grid maybe i'm

regex - How do I count inside of a javascript regular expression? -

how stick counter in javascript regular expression substitution? the question answered here perl/pcres. i've tried obvious string.replace(/from/g, "to "+(++count)) , no (the ++count evaluated once @ start of string.replace, seems). you can pass along function called per match replace: // callback takes match first parameter , groups // additional, left empty because i'm not using them in function. string.replace(/from/g, function() { return "to " + (++count); }); i've found extremely handy tool in replacing complex string portions (like user comments embedded codes) on client side ease burden bit on server.

ruby - Extend send method of Object class -

i want change send method in ruby. code follow class def send(symbol, *args) #customize code here #finally call orinial __send__ function __send__(symbol, args) end end however, when call send function such obj.send('a_var=', 10), got error: argumenterror: wrong number of arguments (1 0) the error @ line call __ send__ function. how can fix error. if want pass *args through __send__ call individual arguments instead of array, need deconstruct there well: __send__(symbol, *args)

Create a JSP Bean instance based upon an ArrayList and set Values -

i'm starting out jsp , need read several .txt files, create html table based upon data read, give user ability edit data , effect edit original .txt file changes. so how i'm going i'm reading .txt file(s) , creating arraylist (for each file) storing each line .txt file. now want able create bean instance(?) each .txt file , set values based upon what's inside arraylist. bean.setname(arraylist(0)); however i'm not sure how go initializing beans there's 1 each .txt file. i appreciate can given, let me know if should post more details or of code i've written far. edit: shall post in code attempting with. out.println("<tr>"); arraylist starray = new arraylist(); bufferedreader br = new bufferedreader((new inputstreamreader(ins2))); string data; while((data= br.readline()) != null) { starray.add(data); } <jsp:usebean id="some" class

sql - Select from audit table -

i have following table column1 column2 newvalue oldvalue in columns newvalue oldvalue values (foreign keys) other table. need display other column referenced table(i.e. based on primary keys). in select instead of newvalue key displayed column coresponds keys. new here, if want clarify question more, it. in advance. edit: in first table columns entityid(from audited table), columnname, oldvalue, newvalue second table addressid, city, street, zipcode. in first table in colmns newvalue, oldvalue pks second table. need display example oldstreet, new street. what need join tables together. there different types of join, case need use inner join , reason column newvalue , column oldvalue foreign keys. can join 2 tables following sample: select column1, column2, b.newcolumn1, -- table b c.newcolumn2, -- table c tablea inner join tableb b on a.newvalue = b.newvalue -- join on fk = pk inner join tablec c on a.oldvalue = c.oldvalue you can go

download - The application can be downloaded from AppStore for iPhone 5 only -

i want users can download app appstore iphone 5. i tried set valid architecture armv7s, got message "the key uirequireddevicecapabilities contains value 'armv7s' incompatible minimumosversion value of '6.0'" if add armv7 "required device capabilities" working good, other iphones too... not need. thanks i think not possible because doesn't use architecture 4 or 4s , there's nothing unique gyroscop/compass 4/4s don't have. used separation. iphone5 requirement have? idea write ist in description , hope user read it.

node.js - Nodejs express request headers - get the referrer, etc. -

i post form payment gateway https verify payment etc. need verify post infact domain. im trying verify referrer list of domains in req.headers dont see referrer|referer options: { 'x-real-ip': '123.34.45.176', 'x-forwarded-for': '123.34.45.176', host: 'my.foo.com', 'x-nginx-proxy': 'true', connection: 'close', 'user-agent': 'mozilla/4.0 (compatible; msie 5.01; windows nt 5.0)', accept: '*/*', 'content-length': '441', 'content-type': 'application/x-www-form-urlencoded' } why headers empty of fields such referer, origin etc ? this inside post: app.post('/payment/notify/', function(req, res){ req.headers }) not requests have referer header. if last page browser on secure server (https) not transmit referer you. also, if user types address address bar don't referer well.

c++ - How to prevent ASIO based server from terminating -

i have been reading boost asio tutorials. far, understanding entire send , receive loop can iterated once. please have @ following simple code: client.cpp: #include <boost/asio.hpp> #include <boost/array.hpp> #include <iostream> #include <string> boost::asio::io_service io_service; boost::asio::ip::tcp::resolver resolver(io_service); boost::asio::ip::tcp::socket sock(io_service); boost::array<char, 4096> buffer; void read_handler(const boost::system::error_code &ec, std::size_t bytes_transferred) { if (!ec) { std::cout << std::string(buffer.data(), bytes_transferred) << std::endl; sock.async_read_some(boost::asio::buffer(buffer), read_handler); } } void connect_handler(const boost::system::error_code &ec) { if (!ec) { sock.async_read_some(boost::asio::buffer(buffer), read_handler); } } void resolve_handler(const boost::system::error_code &ec, boost::asio::ip::tcp::resolver::iterator it) {

convert sql query to hibernate query to retun list of specific object -

i 'd convert query below hql return me list<article> because createsqlquery impossible , must convert result manually : here sql query : query query = getsessionfactory().getcurrentsession().createsqlquery( "select * article articleid in (select articleid article_depot depotid = "+depotid+")" ); thank in advance assuming have onetomany relation between article_depot , article (one depot contains multiple articles) if have been correctly mapped query : query query = getsessionfactory().getcurrentsession().createquery("select d.article article_depot d d.depotid = :depotid"); query.setparameter("depotid", depotid); list<article> resultlist = query.getresultlist();

android - State_pressed change color of a view -

i have selector xml file applied relativelayout background element: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <shape> <solid android:color="#449def" /> <stroke android:width="1dp" android:color="#2f6699" /> <corners android:radius="3dp" /> <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" /> </shape> </item> <item android:state_pressed="false"> <shape> <gradient android:startcolor="#f3ae1b&quo

django - Using login() loses the session data -

when sessions created , destroyed? in application have def app_login(request): request.session.set_expiry(0) if 'current_day' not in request.session: request.session['current_day'] = utilities.default_day() then further down use : login(request, user) if login in user, works fine , 'current_day' retained in session. if log out user , log in another, 'current_day' lost , not available after calling login(). i assume that logout(request) does not clear session, , when second user tries login data 'current_'day' still available in session calling login(user) presumably creates new session. is assumption correct , how best correct this? login source : def login(request, user): """ persist user id , backend in request. way user doesn't have reauthenticate on every request. note data set during anonymous session retained when user logs in. """

Error generating android project javadoc using Doclava -

i'm trying generate documentation of android project using javadoc & doclava. downloaded doclava jar , i'm trying generate doc through project-> generate javadoc. if understood mechanism, have 2 ways tell javadoc use doclava doclet: 1) select "use custom doclet" these options: doclet name: com.google.doclava.doclava doclet path: /full/path/of/my/doclava/dir/doclava-1.0.6.jar 2) select "use standard doclet" , then, in "javadoc options" put: -doclet com.google.doclava.doclava -docletpath ${/full/path/of/my/doclava/dir/doclava-1.0.6.jar} i have encountered these issues: if use first method can generate doc seems android classes not recognized. errors when doclava parses "import android.util.sparsearray" if use second method error: "javadoc: error - cannot find doclet class com.google.doclava.doclava 1 error" as matter of fact: if don't use doclava documentation correctly generated links android

javascript - Can't get cookies to set in IE9 -

i'm using following code: <script> var time = new date(); time.setfullyear(time.getfullyear() + 1, time.getmonth(), time.getday()); expires = ";expires=" + time.togmtstring(); document.write(expires); document.cookie = "aardvark=cats; expires= " + time +"; path=/"; document.write('\ndone: ' + document.cookie); </script> i've put html file , ran locally, , tried running on jsfiddle, , tried uploading site , accessing in browser. in internet explorer 9, no cookie created on computer. ideas why not? when looking @ code, might snippet gets executed after dom loaded. loading dom implicitly closes document, whereas document.write needs document opened. if isn't 1 of 3 things can happen: best case: nothing happens, nothing written worse: new page created worst, , sadly common: existing document overwritten check question on why document.write : not used why document.write con

c# - text entered in uppercase during login still gives successful login -

i have login page windows application in c#.even if enter username , password in uppercase i.e caps on still login successful. this should not case, enteries in database in lower case. public partial class frmlogin : form { sqlconnection con = new sqlconnection("data source=th07l019;initial catalog=procurement;integrated security=true"); datatable dt = new datatable(); sqlcommand cmd = new sqlcommand(); sqldataadapter adp = new sqldataadapter(); public frmlogin() { initializecomponent(); } private void form1_load(object sender, eventargs e) { cmd.connection = con; } private void button1_click(object sender, eventargs e) { con.open(); cmd.commandtext = "select * login username='" + txtusername.text + "' , password='" + txtpassword.text + "'"; adp.selectcommand = cmd; adp.fill(dt); if (dt.rows.count > 0) {

Xamarin: Libraries support -

i want use c++ library (static/dynamic) on xamarin.android , xamarin.ios project. should c++ library static or dynamic in order used on both xamarin.android , xamarin.ios projects, i'm thinking of using c# dllimport/swig tool use c++ library c#. (i heard ios forbids usage of dynamic libraries in apps.) can best approach me? thanks! you correct, ios not allow use dynamic libraries, @ least ios must build c++ library static library. i believe both static , dynamic library work fine on android, there doesn't matter choose.

c# - How to change XAML file as a template WPF -

i have c# wpf application 2 templates(group of .xaml files) how can exclude project 1 group of xaml files , include other group without editing project file manually thanks! in visual studio, right click files want exclude project , click exclude project . can add them in doing right-click on folder or project , selecting add --> existing item, , select them in open fire dialog.

ruby - Equivalent of should be_true in minitest -

i know equivalent of: event.should be_live in minitest? method testing is: event.live? at moment using: conf.live?.must_equal true but looks me quite contrived. newer versions of minitest allow testing predicates in assert_operator . expectation in spec dsl must_be . code can like: event.must_be :live?

kendo ui - Based on selection is it possible to change value axis -

i have requirement i.e based on tree view check box selection value axis need update.i using 4 check boxes 4 value axis.when ever check first item corresponding value axis should changed .3 other axis should in invisible state. here tried of code , updated . code: <div id="treeview"></div> <div id="example" class="k-content"> <div class="chart-wrapper"> <div id="chart"></div> </div> </div> var valueaxes = [ { name: "km",visible:false, title: { text: "km" ,visible:false} }, { name: "miles per gallon", title: { text: "miles per gallon" } }, { name: "miles",

operating system - How to continuously show os command output in erlang? -

i need continuously show stdout/stderr os command in erlang. in ruby can implement following code: s1, s2 , s3, t = open3.popen3('for %a in (1 2 3 4 5 6 7 8 9) (echo message & sleep 2 ) 2>&1 ') s2.each |l| puts l end it show 'message\n message\n' in 'real time' - not wait end of process. i've tried os:cmd(..) , 1> p5 = erlang:open_port({spawn, "ruby rtest.rb"}, [stderr_to_stdout, in, exit_s tatus, binary,stream, {line, 255}]). #port<0.505> 2> receive {p5, data} -> io:format("data ~p~n",[data]) end. data {data,{eol,<<>>}} ok but both of them wait end of process. are optional continuously stdout reading in erlang? edit: in other words popen (c/c++; proc_open(php) , etc) function in erlang edit2 code, works on linux (tested on centos6.2). vinod : -module(test). -export([run/0]). run() -> p5 = erlang:open_port({spawn, "sh test.sh"}, [stderr_to_stdout

jquery - Making Android code cross platform -

my android app uses dynamic ui. is, of ui screens made of simple types (gallery, list view, form view) , created entirely java code instead of using xml templates. because there hardly static in ui. java code uses sqlite extensively. there no media stuff (images, videos) , plain database front end app. doesn't use of device capabilities (camera, sms etc). there 3 major areas - sqlite files, pure java code not have android dependency, android ui java code (listview etc - pretty thin code). need make of these work in ios. what choices make code cross platform (atleast port ios)? jquery mobile? phonegap? other? thanks! have tried google project j2objc ?

Does c++ standard support non-const data member being as array bounds? -

see following code: class x { int a; public: void foo() { char arr[a]; // not constant variable, g++ doesn't report error, why? } }; i thought constant expression can used in array bounds, until today met strange code above. both g++ , clang++ can compile successfully. can't find description in c++ standard supporting it. extented content of compiler? , can find description it? no, c++ standard doesn't support vla

javascript - How to replace all occurring same character like ' with ;$39 -

i using following code, in want replace ' ;$39 not working fine . it's replace first ' . var searchusername = document.getelementbyid("ctl00_contentmain_usersearchcoll").value.replace("/\'/g", ";$39;"); for example: ram's's .output: ram;$39s;$39s thanks in advance. you don't need put regexp inside double quotes. remove them. value.replace(/'/g, ';$39;') also note need not "escape" single quote. (thanks @paul s. pointing)

Get value of a hidden field tag Ruby on Rails -

i lost, not know i'm doing wrong! have 4 radio buttons , hidden field (value = "1"). when click on second radiobutton, value of hidden field changes 2 , on. works fine js function. different divs showed when different radiobutton selected. now, when i'm trying value of hidden field in controller returns nil. here's code: view: (radiobuttons, hiddenfield , 1 div) <div> <%= form_tag patients_path %> <%= radio_button_tag 'searchrbn', 'patient', true, :onchange => "checkradiobutton()" %> <%= label_tag :bypatient_patient, "patient" %> <%= radio_button_tag 'searchrbn', 'staff', false, :onchange => "checkradiobutton()" %> <%= label_tag :bystaff_staff, "staff" %> <%= radio_button_tag 'searchrbn', 'ocmw', false, :onchange => "checkradiobutton()" %> <%= label_

scrollbar - How to get rounded edge scroll bar in IE10? -

am using following css change scroll bar color <style> body { scrollbar-face-color: #eeeeee; scrollbar-highlight-color: #ffffff; scrollbar-3dlight-color: #cccccc; scrollbar-darkshadow-color: #ffffff; scrollbar-shadow-color: #aaaaaa; scrollbar-arrow-color: #000000; scrollbar-track-color: #eeeeee; } </style> color changed. way rounded edge scroll bar in ie10? there isn’t way style scrollbars in ie, except colour. can see full list of css properties styling scrollbars @ http://msdn.microsoft.com/en-us/library/windows/apps/hh466154.aspx

java - unknown database in jdbc -

i using jdbc , new it. keep getting runtime exception: connecting psysical database... com.mysql.jdbc.exceptions.jdbc4.mysqlsyntaxerrorexception: unknown database 'kholofelodb' @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:57) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45) @ java.lang.reflect.constructor.newinstance(constructor.java:525) @ com.mysql.jdbc.util.handlenewinstance(util.java:411) @ com.mysql.jdbc.util.getinstance(util.java:386) @ com.mysql.jdbc.sqlerror.createsqlexception(sqlerror.java:1052) @ com.mysql.jdbc.mysqlio.checkerrorpacket(mysqlio.java:3609) @ com.mysql.jdbc.mysqlio.checkerrorpacket(mysqlio.java:3541) @ com.mysql.jdbc.mysqlio.checkerrorpacket(mysqlio.java:943) @ com.mysql.jdbc.mysqlio.secureauth411(mysqlio.java:4113) @ com.mysql.jdbc.mysqlio.dohandshake(mysqlio.java:1308) @