Posts

Showing posts from April, 2011

jquery - How to pass a URL parameter in an ajax() call -

i have single page (products) responds url parameters , displays information accordingly. here examples: http://www.mysupersite.com/products http://www.mysupersite.com/products/buy http://www.mysupersite.com/products/buy/computers these user-friendly urls. url parameters "buy" , "computers". i need pass parameters from current page in ajax() server knows types of information send e.g. $.ajax({ type: "post", url: "/cfc/getsomeproducts", datatype: "html", data: { //psuedo code below... productcategory: "buy", producttype: "computers" } }) to clarify, if on /products/buy , need send productcategory: 'buy' . if on /products/buy/computers , productcategory: 'buy', producttype: 'computers' . how achieve this? var url = document.location.pathname; var values = url.split("/"); $.ajax({ type: "post",

python - How to use multiple wxPython project files in one program? -

i trying make pretty big app many different parts , windows. decided lot cleaner if had windows have own file , import them main file. tried when try run class, gives error of needing 3 arguments. not understand how should go doing appreciated! main file: import wx import login login.apples(self,parent,id) class oranges(wx.frame): def __init__(self,parent, id): wx.frame.__init__(self,parent,id,"mail",size=(700,700)) self.frame=wx.panel(self) if __name__=="__main__": app=wx.app(false) window=oranges(parent=none, id=-1) window.show() app.mainloop() i nameerror: name "self" not defined. import wx class apples(wx.frame): def __init__(self,parent,id): wx.frame.__init__(self,parent,id,"login mail",size=(400,400)) self.frame=wx.frame(self) if __name__=="__main__": app=wx.app(false) window=apples(parent=none, id=-1) window.show() app.mainloop() import

jquery - Form tag closing automatically -

i have issue form tag automatically closed. i'm trying figure out causing problem. whatever inside of form tag added after. i'm using netsuite thats why items in tables , little harder debug. here link site. t this (partly) generated on browser > <div class="col-xs-8"> > <div class="oos-button"></div> > <form method="get" id="add-to-cart-form" role="form" action="/app/site/backend/additemtocart.nl"></form> <!-- modal --> etc... but modal code should go inside form , that's how have coded it. <form method="get" id="add-to-cart-form" role="form" action="/app/site/backend/additemtocart.nl"> <!-- modal --> <div id="<%=getcurrentattribute('item','itemid')%>" class="modal fade bs-example-modal-lg" tabindex="-1" role

java - How to call a stored procedure with less parameters? -

string foo = "{call mystored(?,?,?,?)}"; callablestatement = dbconnection.preparecall(foo); callablestatement.setint(1, 10); callablestatement.executeupdate(); i have stored procedure 20 parameters. possible set few of parameters? stored procedure returns value. i've tried call mystored(?) , set callablestatement.setint("colname", 10); missmatch in numbers of parameters... should return value count parameter, it's 21? you have bind parameters declare in statement. (for each ? have provide value set* or registeroutparameter) if these parameters have default value (that possible in pl/sql) don't have declare them in statement. in db: function get_empname(emp_id number, emp_name varchar2 default 'something') return varchar2 in java: string statement1= "{? = call get_empname(?)}"; // valid statement string statement2= "{? = call get_empname(?, ?)}"; // valid statement if have stored function (it return

java - How can I bypass parent's attributeset to child in android -

i creating compond view imageview + textview imagetextview follow in xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="match_parent" > <button android:id="@+id/btnview" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <textview android:id="@+id/txtview" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </linearlayout> in usage, want use imagetextview follow: <com.mypkg.myclass.imagetextview android:layout_width="wrap_content" android:layout_height="50dp" android:text="text textview" //used textview android:background="@drawable/background.png" //used image view /> in imagetextviewconstru

javascript - why can't I access value NODE_ENV in my server.js file when I have set it gruntfile.js with grunt-env -

i trying set options using env in gruntfile.js can use node_env based if statements in server.js file. i have installed grunt-env using "npm grunt-env --save-dev" , included , env section in gruntfile.js: grunt.initconfig({ pkg: grunt.file.readjson('package.json'), env: { dev: { node_env : 'development' }, prod: { node_env : 'production' } }, .... i registered tasks dev , production @ end of file grunt.registertask('dev', ['csslint', 'jshint', 'nodeunit', 'sass', 'concurrent', 'nodemon']); grunt.registertask('prod', ['cssmin', 'uglify', 'nodemon']); when run "grunt dev" or "grunt prod" server starts without error , starts correct tasks, still not able access node_env form inside server.js file. tried adding following: console.log(process.env.node_env);

java - Cannot find symbol when creating an object in IO class using inheritance -

i'm trying create tourist object on io class , parameters specified correctly in respective class. however, wouldn't compile says cannot find symbol. because i'm using tourist sub-classes? compiler says cannot find symbol variable "nam" etc.. helping. this method in io class.. private void addmembercard() { system.out.println("enter member name"); string name = reader.nextline(); system.out.println("select 1. tourist, 2. business"); system.out.println("enter choice"); int choice = reader.nextint(); membercard m; if (choice == 1){m = new tourist (nam, rat, cred, cit);} else if (choice == 2){m = new business(nam, rat);} preston.addmembercard(m); } and constructor in tourist class public tourist (string nam, int rat, int cred, string cit) { super(nam, rat, cred); city = cit; }

ios - How do you create and index Apple Watch interface pages -

i'm creating watch app has multiple pages using same interface controller. know how custom manager object can index each controller. i've tried adding ibinspectable index set in storyboard, controllers report pageindex 0 after init & awake calls. i know create subclasses return own index, seems messy. you have no control on index, matter of adding them array in order want. this how present pages: [self presentcontrollerwithnames:controllers contexts:contexts]; both controller , contexts arrays. pages presented order have in array. if present multiple controllers of same type, create loop , add them controller array. same contexts. controllers[0] use contexts[0] , on.

javascript - Choosing between uploading a file or entering a custom URL - HTML Forms -

i creating web form in users have option set custom profile picture. i'm trying create drop-down box gives option choose between uploading image or linking image url. the option not selected should disabled, can't seem work. here code: html: <form> choose profile picture:<br> <select> <option onselect="upload()">upload image <option onselect="link()">load url </select><br> <input type="file" id="filebrowse" accept="image/*"><br> <input type="url" id="enterurl" placeholder="enter in url." disabled> js: function upload() { document.getelementbyid("enterurl").disabled = true; document.getelementbyid("filebrowse").disabled = false; } function link() { document.getelementbyid("filebrowse").disabled = true; document.getelementbyid("enterurl").disabled = false

c# - Access control in content control from main window -

i had found methods access main window usercontrol: window parentwindow = window.getwindow(this); dependencyobject parentwindow = visualtreehelper.getparent(child); application.current.mainwindow parentwindow; i have questions: which of above methods best? how can access control in usercontrol main window , usercontrol usercontrol in same main window? thanks, skip bad english :) current.mainwindow ideal in every case because if usercontrol embedded inside usercontrol , can still use current.mainwindow traversing tree. methods fine , depends on usage , you're trying accomplish. to access control (lets textblock ) inside usercontrol . textblock tb = findvisualchildren<textblock>(usercontrol) public static ienumerable<t> findvisualchildren<t>(dependencyobject depobj) t : dependencyobject { if (depobj != null) { (int = 0; < visualtreehelper.getchildrencount(depobj); i++) { dependencyobject chil

android - is my do loop code for java correct? -

is correct? im modifying source code github : usb charge commander when battery goes down 20 percent charge when batter goes 80 wont , countdown timer every 5 mins set 20000 testing boolean startcountdown=true; do{ new countdowntimer(20000, 1000) { intent intent = _context.registerreceiver(null, new intentfilter(intent.action_battery_changed)); int level = intent.getintextra(batterymanager.extra_level, 0); int scale = intent.getintextra(batterymanager.extra_scale, 100); int percent = (level*100)/scale; public void ontick(long millisuntilfinished) {} public void onfinish() { if(percent <= 20){ _iischarging = 1; } else if (percent >=80){ _iischarging = 0; } else{ _iischarging = 1; } } }.start(); }whi

python - print the unique values in every column in a pandas dataframe -

i have dataframe (df) , want print unique values each column in dataframe. i need substitute variable (i) [column name] print statement column_list = df.columns.values.tolist() column_name in column_list: print(df."[column_name]".unique() update when use this: "unexpected eof parsing" no details. column_list = sorted_data.columns.values.tolist() column_name in column_list: print(sorted_data[column_name].unique() what difference between syntax ys-l (above) , below: for column_name in sorted_data: print(column_name) s = sorted_data[column_name].unique() in s: print(str(i)) it can written more concisely this: for col in df: print df[col].unique() generally, can access column of dataframe through indexing using [] operator (e.g. df['col'] ), or through attribute (e.g. df.col ). attribute accessing makes code bit more concise when target column name known beforehand, has several caveats

mysql - Inserting multiple columns in the table error with query -

this query: alter table `mytable` add `telephone` varchar( 50 ) not null, `date_of_annual_health_care_plan` date not null, `first_language` varchar ( 50 ) not null, `interp_req` int not null, `religion` varchar ( 50 ) not null, `religious_considerations` varchar ( 350 ) not null, `diagnosis_and_associated_health_conditions` varchar ( 500 ) not null, `communcation` varchar ( 350 ) not null, `challenging_behaviours` varchar ( 350 ) not null, `medicare_number` varchar ( 50 ) not null, `pension_number` varchar ( 50 ) not null, `private_health_insurance` varchar ( 50 ) not null, `person_responsible` int not null, `person_res_name` varchar ( 50 ) not null, `person_res_address` varchar ( 50 ) not null, `person_res_telephone_h` varchar ( 50 ) not null, `person_res_telephone_w` varchar ( 50 ) not null, `person_res_telephone_m` varchar ( 50 ) not null, `person_res_email` varchar ( 50 ) not null, `decision_making_function` varchar ( 250 ) not null, `relative` varchar ( 50 ) not null, `gu

php - How can I present subcategories within a parent category in prestashop? -

Image
so can in image, can hover on nav button 'eliquids' , 4 categories show in drop down. all products contained within 4 categories, however, if click on word 'eliquids' it's self, takes empty page being products stored within respective category. on left can see categories being displayed in side navbar. how can make 4 sub-categories (chef's blends, steamgunk etc) show within category 'eliquids' ? is possible via office can't seem find self. otherwise, case of editing source code ? version: prestashop 1.6.0.9 theme: prestashop default bootstrap theme you need configure "theme configurator" module. there "display subcategories" @ bottom @ "configure" page.

javascript - Node Acl dynamic links -

i'm trying use npm module acl implement acl system. homepage can found here: https://github.com/optimalbits/node_acl . the documentation shows lot of simple examples giving role access. in particular, there piece of code here: acl.allow([ { roles:['guest','member'], allows:[ {resources:'blogs', permissions:'get'}, {resources:['forums','news'], permissions:['get','put','delete']} ] }, { roles:['gold','silver'], allows:[ {resources:'cash', permissions:['sell','exchange']}, {resources:['account','deposit'], permissions:['put','delete']} ] } ]) unfortunately, docs don't show examples of more complicated url '/blogs/:id/today'. possible set acls these kinds of dynamic urls? and, need specify users can own info

c++ - noexcept depending on method of member -

related this question , want specify private section after public interface. template<class t, void (t::*f)()> class b { public: void g(int y) noexcept(noexcept(x.*f())) {} private: t& x; }; but error clang x undeclared identifyer. mm_test.cpp:14:34: error: use of undeclared identifier 'x' void g(int y) noexcept(noexcept(x.*f())) ^ it compiles fine if declaration of member x occurs before declaration of g. not supposed able use member variable in noexcept operator earlier in class definition declaration? if not, how achieve equivalent noexcept specifier without moving declaration of x ahead?

sql - Right way to subtract in a stored procedure -

i have following query in stored procedure declare @i int declare @tenpercent int declare @rowscount int set @tenpercent =10 set @i = 1 select @i, dbo.tblvegetationtype.vegtypecode, dbo.tblvegetationtype.vegtypename dbo.tblvegetationtype inner join dbo.tblvegtypevegformationlink on dbo.tblvegetationtype.vegtypeid = dbo.tblvegtypevegformationlink.vegtypeid inner join tblcmavegtypelink on dbo.tblvegetationtype.vegtypeid = dbo.tblcmavegtypelink.vegtypeid dbo.tblvegetationtype.percentagecleared >= (@percentcleared - @tenpercent) , dbo.tblvegtypevegformationlink.vegetationformationid = @vegetationformationid , dbo.tblcmavegtypelink.cmaid = @cmaid i have following condition dbo.tblvegetationtype.percentagecleared >= (@percentcleared - @tenpercent) what trying here: if percentcleared 60% want query pick list 50 %. so add set @tenpercent = 10 , subtract condition. is right way do? another way of writing query can be: sel

Amazon S3 - List all the zip files recursively within S3 bucket using Java API -

i've s3 bucket on amazon , trying list of zip files located within folders under bucket recursively. for e.g, zip files located shown below : bucket1/${user1}/${date1}/abc.zip bucket1/${user2}/${date2}/xyz.zip bucket1/${user3}/${date3}/mno.zip bucketname=bucket1 prefix=bucket1/ below code : final amazons3 amazons3 = amazons3utils.getamazons3client(); final listobjectsrequest listobjectsrequest = new listobjectsrequest().withbucketname("bucket1") .withprefix("bucket1/"); objectlisting current = amazons3.listobjects(listobjectsrequest); final list<s3objectsummary> keylist = current.getobjectsummaries(); while (current.istruncated()) { keylist.addall(current.getobjectsummaries()); current = amazons3.listnextbatchofobjects(current); } keylist.addall(current.getobjectsummaries()); for(s3objectsummary summary : keylist) { system.out.println(summary.getkey()); }

Passing OpenCV contours from a JNI C++ function to Java in Android -

what best way pass opencv vector< std::vector<point > > contours jni c++ function java in android? current approach use arrays of doubles inefficient. there way use pointers maybe? here's efficient way access contours wrapper javacpp presets opencv : import org.bytedeco.javacpp.indexer.*; import static org.bytedeco.javacpp.opencv_core.*; import static org.bytedeco.javacpp.opencv_imgproc.*; import static org.bytedeco.javacpp.opencv_highgui.*; public class contours { public static void main(string[] args) { mat grayscaleimage = imread("lena.png", cv_load_image_grayscale); mat binarizedimage = new mat(); matvector contours = new matvector(); threshold(grayscaleimage, binarizedimage, 128, 255, thresh_binary); findcontours(binarizedimage, contours, retr_list, chain_approx_none); int contourssize = (int)contours.size(); system.out.println("size = " + contourssize); (int co

c++ - Comparing two objects of the same class -

i trying overload == operator in c++. #include <string> using namespace std; namespace date_independent { class clock { public: int clockpair[2] = {0,0}; operator string() const { string hourstring; string minstring; if(clockpair[0]<10) { hourstring = "0"+to_string(clockpair[0]); } else { hourstring = to_string(clockpair[0]); } if(clockpair[1]<10) { minstring = "0"+to_string(clockpair[1]); } else { minstring = to_string(clockpair[1]); } return hourstring+":"+minstring; }; bool operator ==(const clock&clockone, const clock&clocktwo) const

what is the correct routing table of openstack controller? -

i can't seem figure out should routing table of openstack controller 2 interfaces same network, tried several configurations, 1 working disable 1 interface, that's not want do destination gateway genmask flags metric ref use iface 0.0.0.0 10.0.4.2 0.0.0.0 ug 0 0 0 eth2 10.0.0.0 0.0.0.0 255.255.255.0 u 0 0 0 eth0 10.0.4.0 0.0.0.0 255.255.255.0 u 0 0 0 eth2 ignore 10.0.4.2 used internet connectivity. following entry needed openstack work. routing openstack management network. assume controller ip 10.0.0.11 . 10.0.0.0 0.0.0.0 255.255.255.0 u 0 0 0 eth0

jquery - Custom ordering Shield UI the bars in a bar type chart -

i using shieldui charting component , looking way render bars 1 on other, preferably different width in order avoid visibility issues. rendered side side , cannot find way re-position them. this has been implemented in newest release of control. demonstrated in following example: https://demos.shieldui.com/web/bar-chart/overlapped-bar you need set divideseries property false.

java - how can I create a long String from a Clob? -

// load database details variables. string url = "jdbc:oracle:thin:@localhost:1521:orcl"; string user = "scott"; string password = "tiger"; // create properties object holds database details properties props = new properties(); props.put("user", user ); props.put("password", password); props.put("setbigstringtryclob", "true"); try { drivermanager.registerdriver(new oracledriver()); connection conn = drivermanager.getconnection( url , props ); // create preparedstatement object preparedstatement pstmt = null; // create resultset hold records retrieved. resultset rset = null; // create sql query statement retrieve records having clob data // database. string sqlcall = query; pstmt= conn.preparestatement(sqlcall); // execute preparestatement rset = pstmt

c# 4.0 - OWIN bearer authentication failing in web api 2 -

Image
i trying implement web api 2 based claim based authentication oauth tokens. have created [assembly: owinstartup(typeof(pmw.api.startup))] public class startup { //private iunitofwork _unitofwork; //private iuserservice _userservice; //private icommonservice _commonservice; public void configuration(iappbuilder app) { httpconfiguration config = new httpconfiguration(); webapiconfig.register(config); app.usecors(microsoft.owin.cors.corsoptions.allowall); app.usewebapi(config); iunitycontainer container = getunitycontainer(); config.dependencyresolver = new unitydependancyresolver(container); //_unitofwork = container.resolve<iunitofwork>(); //_userservice = container.resolve<iuserservice>(); //_commonservice = container.resolve<icommonservice>(); mapautomapper(); configureoauth(app)

php - Yii Scope not being passed into CListView -

i'm trying pass model scope clistview here scope in comment model public function scopes() { return array( 'lastestcomment'=>array( 'alias' => 't', 'select'=>array('t.*,t2.*'), 'join'=>'join `comments_posts` t2', 'condition'=>'t.id=t2.commentid', 'order'=>'t.createdate asc', 'limit'=>'5' ) ); } in view have this $dataprovider=new cactivedataprovider(comment::model()->lastestcomment()); $this->widget('zii.widgets.clistview', array( 'dataprovider'=>$dataprovider, 'itemview'=>'_view', //view file location )); in view, call $data can values in comments model , not comm

java - How to update Activity from thread started in another activity? -

i have main activity , after click on button start thread (but thread hidden in library , have callback in main activity. want start activity (call a) want put results thread. below simplified code: public class main extends activity { xmanager.resultscallback xresultscallback = new xmanager.resultscallback() { // method called every 10 sec. @override public void onresult(arraylist<string> texts) { } }; xmanager xmanager = new xmanager(xresultscallback); view.onclicklistener onclick = new view.onclicklistener() { @override public void onclick(view arg0) { xmanager.start(); intent = new intent(main.this, a.class); startactivity(i); } }; } i want update content of activity each time when onresult() method called. how that? use localbroadcastmanager, in main activity create function : private void sendresult() { log.d("sender", "

Open PDF file from folder inside project in Windows Store App C# -

i working on windows store app. have folder named pdf in solution in have 1 pdf file named "sample.pdf". want open pdf file using code inside application. have seen many links not find useful help? you need let system open file in default viewer using launchfileasync. storagefile file = await windows.applicationmodel.package.current.installedlocation.getfileasync(@"pdf\file.pdf"); windows.system.launcher.launchfileasync(file);

Turkish Character issue in PHP and MySQL -

i'm trying count occurences of letters in turkish alphabet in mysql database. when try count letter "a" this, correct result : while($nt=mysql_fetch_array($rt)) { $mystring = $nt["word"]; for($i = 0; $i < strlen($mystring) ; $i++) { if($mystring[$i] == 'a') { $a++; } } } when replace "a", "ç" zero. added code : $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("database unavailable"); mysql_set_charset('utf8', $bd); how can fix code turkish characters? thanks. in utf-8 ç encoded 2 bytes ( c3 a7 ), therefore byte-by-byte comparison won't work. consider substr_count : $s = "abçdeç"; print substr_count($s, 'ç'); // 2 or use unicode-aware function this: function utf8_char_count($s) { $count = []; preg_match_all('~.~u', $s, $m); foreach($m[0] $c) $count[$c] = isset

Weblogic server not coming to RUNNING state -

when start weblogic server using startweblogic.cmd, exits after printing below messages on command prompt without error messages. how deduce what's wrong , rectify. <dec 2, 2014 1:05:29 pm ist> <info> <weblogicserver> <bea-000377> <starting webl ogic server java hotspot(tm) client vm version 10.0-b19 sun microsyste ms inc.> <dec 2, 2014 1:05:29 pm ist> <info> <management> <bea-141107> <version: weblogic server 10.3 fri jul 25 16:30:05 edt 2008 1137967 > <dec 2, 2014 1:05:31 pm ist> <warning> <management> <bea-141230> <could not loca te descriptor file system resource : wseejmsmodule.> <dec 2, 2014 1:05:31 pm ist> <warning> <management> <bea-141230> <could not loca te descriptor file system resource : cgdatasource.> <dec 2, 2014 1:05:31 pm ist> <warning> <management> <bea-141230> <could not loca te descriptor file system resource

cocoa - How does StoreKit determine which region's App Store it must query for In-App purchases? -

i'm selling os x app on mac app store due intended purpose useful in germany only. consequently, isn't localized available solely in german language: doesn't employ base localization , info.plist's cfbundledevelopmentregion key set german. on mac app store it's correctly displayed being available in german language only. i have added in-app purchase functionality app. works fine there major issue regarding localization: whenever user trying make in-app purchase, storekit displays misleading message text insisting user logged in wrong store , needs switch german store because in-app purchase item available in german store. naturally, scares away potential german customers of course are logged in german store , message displayed nevertheless makes no sense them. furthermore, selling price of purchase displayed using wrong currency ($ instead of €) because storekit somehow doesn't honor user's app store region affiliation. 1 this feels bug in storeki

node.js - jasmin-node not working in Windows -

i'm trying run jasmine-node windows cmd no success. package.json @ top level of project, following { "devdependencies": { "jasmine-node": "" } } i run @ top level of project. npm install and this node_modules/jasmine-node/bin/jasmine-node spec/greetspec.js this result 'node_modules' not recognized internal or external command, operable program or batch file. what went wrong installing jasmin-node? proper way in windows? it seems reading same book right now. all need put node command before path node_modules/jasmine-node/bin/jasmine-node spec/greetspec.js , use backslashes \ this: node node_modules\jasmine-node\bin\jasmine-node spec\greetspec.js

ios - automatic height for -[tableView:heightForHeaderInSection:] -

tl, dr: wish set all properties of section header, including height, in storyboard. there way can that? there's never around in cocoatouch api. the uitableviewdelegate contains method called -[tableview:heightforheaderinsection:] , must return appropriate height header in section. the best practices know of advise separate presentation , logic. yet, uitableviewdelegate seems mix these 2 concepts: handles interaction ( didselect... ) , aspects of presentation ( heightforheader... ). furthermore, define section headers in storyboards, therefore making both storyboard , (typically) view controller highly interdependent section headers. is there way find out height in generic way, or make method "automatic"? used section header , return height, it's performance issue when there many section headers. you should draw arbitrary header in tableview:heightforheader method , return height of arbitrary header dynamic header size. worked me. hope works

ios - UIButton UIControl target action 2 actions for single button -

i have button has selected , non-selected state. my target action code button this: nsarray *targets = [mybutton actionsfortarget:self forcontrolevent:uicontroleventtouchupinside]; if ([targets count] == 0) { [mybutton addtarget:self action:@selector(save:) forcontrolevents:uicontroleventtouchupinside]; when button pressed, goes selected state in method. if button selected, different action should called. there unintended consequence doing way or there way add actions uicontrolstate instead? if (mybutton.selected == no){ [mybutton addtarget:self action:@selector(save:) forcontrolevents:uicontroleventtouchupinside]; } else{ [mybutton addtarget:self action:@selector(delete:) forcontrolevent:uicontroleventtouchupinside]; } -(ibaction)mybutton:(id)sender { uibutton *btn = (uibutton*)sender; btn.selected = !btn.selected; if(btn.selected) { //do whatever want when button selected [self delete]; } else { //do whatever want when button isdeselec

javascript - Meteor: Accounts.sendVerificationEmail customising behavior -

can please provide correct method send email verification upon user creation? important part... a) user have immediate access upon signing up. if user has not yet clicked clicked on verification link within 48 hours, deny them logging in until have clicked on link. my code far sends email verification user has continuos access application or without clicking on verification link (so code of course incomplete). client.js template.join.events({ 'submit #join-form': function(e,t){ e.preventdefault(); var firstname= t.find('#join-firstname').value, lastname= t.find('#join-lastname').value, email = t.find('#join-email').value, password = t.find('#join-password').value, username = firstname.substring(0) + '.' + lastname.substring(0), profile = { fullname: firstname + ' ' + lastname }; accounts.createuser({ email: email, username: username, password: password, usertype: // 'reader&

android - OpenMobileAPI, GetData command returns shown values without PIN -

i'm using seek-for-android connect secureelement on sim card . i'm able data e.g. card number, cvc, .., using get data command, example card number follow 1111 **** **** 1111 with actual * chars . now want full number run verify pin and get data command, data shown correctly 1111 1111 1111 1111 , problem : every time try get data command, return clear (shown) card number 1111 1111 1111 1111 when don't send verify pin command, fyi i'm closing channel after every command that's not it. note : when send incorrect pin starts returning me hidden card number any suggestions? thank !!

java - Timer Event Impl / Lib -

this question has answer here: java timer task schedule 1 answer i have create timer, firing event on elapsed timespan. easy write runnable busy wait loop. easy include sleep statement busy waiting prevent massive busy waiting. need solution precise still performance friendly. have suggestions how implement it? guess pretty easy using hack causing interruptedexceptions dont rly know. there library offering functionality in generic way? pretty limited java. although, if there arguments use other language impls try jna. the scheduledexecutorservice jdk offers functionality

How to execute sql user defined function using c#? -

how execute sql user defined function using c# same of executing stored procedure you can use other sql. here's example: using (var con = new sqlconnection(properties.settings.default.connectionstring)) using (var cmd = new sqlcommand("select dbo.isinteger(@value);", con)) { con.open(); cmd.parameters.add("@value", sqldbtype.varchar).value = "10"; bool isint = (bool)cmd.executescalar(); } dbo.isinteger scalar-valued function returns bit (true/false). for sake of completeness , if it's not related, here it: create function [dbo].[isinteger](@value varchar(18)) returns bit begin return isnull( (select case when charindex('.', @value) > 0 case when convert(int, parsename(@value, 1)) <> 0 0 else 1 end else 1 end isnumeric(@value + 'e0') = 1),

c++ - How to get full path by just giving filename? -

please not getting how implement function returns full path of file using c/c++? unix/linux: #include <limits.h> #include <stdlib.h> char *full_path = realpath("foo.dat", null); ... free(full_path); or: char full_path[path_max]; realpath("foo.dat", full_path); windows: #include <windows.h> tchar full_path[max_path]; getfullpathname(_t("foo.dat"), max_path, full_path, null);

javascript - How to add context menu, autoComplete, onChange Event in ADF CodeEditor? -

i using jdeveloper 12.1.2. not using adf bc, adf dc, adf am. trying create code editor xml using adf-faces should have functionality like autocomplete closing tag as codeeditor edited should marked changed. right click options code editor(specific functionality of code). i unable fetch caret position adding autocomplete of closing tag. valuechangelistener getting triggered once user tabs out codeeditor or clicks outside codeeditor. want call valuechangelistener editing begins can mark editor dirty. tried adding context menu. getting error : showpopupbehavior not valid child of af:codeeditor. also, want add javascript code in codeeditor getting error : af:clientlistener not valid child of af:codeeditor. thanks in advance. af:codeeditor has limitiations. can not customize on top of comes out of box.

virtualization - Running qemu on ARM with KVM acceleration -

i'm trying emulate arm vm on arm host, cubieboard2 embedded board, means of qemu . i've compiled qemu source code , enabled kvm . problem launching qemu-system-arm follows: $ /usr/local/bin/qemu-system-arm -m accel=kvm -cpu host -kernel vmlinuz-3.2.0-4-vexpress -initrd initrd.img-3.2.0-4-vexpress -sd debian_wheezy-_armhf_standard.qcow2 -append "console=ttyama0 root=/dev/mmcblk0p2" -nographic i have error: qemu-system-arm: -m accel=kvm: unsupported machine type use -machine list supported machines! what wrong in command i've typed. how enable kvm ? -m takes machine name (eg "vexpress-a15" or "virt"), not set of suboption=value settings. want -machine suboption=value,... that. ("-m name" shortcut "-machine type=name".) you need specify machine name, either via -machine type=name or -m name, otherwise qemu complain didn't specify one.

Popping messages from Ruby Queue in a proper way -

here code send messages queue : def initialize @messages = queue.new end def send_messages_from_queue while msg = @messages.pop(true) #pushing data through websocket end rescue threaderror #raised if queue empty end it works has 1 drawback: if there no channel subscribers message not being sent still taken out of queue , therefore goes lost. how take last message queue not delete there until sent? i expose inner queue: @messages.class.module_eval { attr_reader :que } or @messages.define_singleton_method(:first_message) @que.first end but not right way , has it's own drawback: when take message out of queue in 1 thread using pop , won't available other thread few milliseconds later, when use custom first_message method, message available other thread until call pop .

iphone - Customization of UITableViewCell not doing anything -

i'm having issue can't figure out. have uitableview custom uitableviewcell . i've set should , that's fine. have uiimageview in uitableviewcell . i'm trying customize objects inside uitableview uiimageview without using storyboard. added uiimageview using storyboard , connected iboutlet custom uitableviewcell class file. i'm starting of simple customization like: override func awakefromnib() { super.awakefromnib() profilepictureimageview.frame = cgrect(x: 5, y: 5, width: 70, height: 70) println("pic dimensions: x:\(profilepictureimageview.frame.origin.x) y:\(profilepictureimageview.frame.origin.y) w:\(profilepictureimageview.frame.size.width) h:\(profilepictureimageview.frame.size.height)") } the weird thing println statement showing i've changed dimensions of uiimageview expected, problem having not being reflected in ui. weird thing is other sort of customization in awakefromnib() such rounding uiimageview ,

Asterisk segfault error 4 in libsqlite3.so.0.8.6 -

i use asterisk 11.3.0 , every 3-4 days im geting in dmesg : asterisk[24467]: segfault @ 18 ip 00007f7e5c49ba3f sp 00007f7e035fb500 error 4 in libsqlite3.so.0.8.6[7f7e5c46b000+8c000] after asterisk crashes , need restart it. i used gdb find solution in core file , shows me : *#0 __ao2_callback (c=0x0, arg=0x7fbfaf050290, flags=obj_pointer) @ astobj2.c:1190 #1 __ao2_find (c=0x0, arg=0x7fbfaf050290, flags=obj_pointer) @ astobj2.c:1221 #2 0x00000000004d7f2b in find_interface (format1=<value optimized out>, format2=0x7fbf70935c28) @ format.c:107 #3 format_cmp_helper (format1=<value optimized out>, format2=0x7fbf70935c28) @ format.c:314 #4 0x00000000004da242 in cmp_cb (obj=<value optimized out>, arg=<value optimized out>, flags=<value optimized out>) @ format_cap.c:56 #5 0x0000000000447652 in internal_ao2_callback (c=0x7fbf7124bf58, flags=obj_pointer, cb_fn=<value optimized out>, arg=0x7fbf7124944c, data=0x0, type=default, tag=0x0, file=0

Implementing google analytics for android app -

how implement google analytics android app? (i need basic code searched lot of websites didn't understand please me) thanks in advance.. https://developers.google.com/analytics/devguides/collection/android/v3/ link guide you. http://dl.google.com/googleanalyticsservices/googleanalyticsservicesandroid_3.02.zip download jar analytics link. put in in libs. https://www.google.com/analytics/web/ , use create account analytics @ location. , create new app in it. use analytics app id below. and use below code in each of activity. public void trackevent(string category, string action, string label, long value) { // todo auto-generated method stub easytracker easytracker = easytracker.getinstance(this); easytracker.send(mapbuilder.createevent(category, action, label, value).build()); } public void onstart() { super.onstart(); easytracker.getinstance(this).activitystart(thi

laravel - html::link to dynamic route -

Image
i trying output list of users on blade.php page. clicking on user's id should take individual profile page. here view browse.blade.php file <?php $cars = db::table('cars')->get(); foreach ($cars $car) { echo "<table >" ; echo "<tr>"; html::linkroute('browse/'.$car->car_id, 'car id: '.$car->car_id); echo "<td>make: $car->make <br/ ></td>" ; echo "</tr>"; echo "</table>"; } ?> my controller public function browse() { return view::make('car/browse'); } public function showprofile($car_id) { return view::make('car/profile')->with('car_id', $car_id); } my route route::any('browse/{car_id}', 'browsecontroller@showprofile'); i want view page output bunch of cars in database. clicking on car car_id = should tak me http://localhost:8000/browse/i each respect

ios - ContainerView nextViewController is not child stacked to container view as subview -

i have 3 view contorller first view controller have container view of height 300.0f @ center. it has 1 embedded view controller table view controller. on cell selection should navigate detailsviewcontroller. all process ok. but detailsviewcontroller not behaving embedded view controller of containerview , not of same size container view. takes whole screen size. as triggered embedded view controller should follow frame without overlapping other controls in first view controller. you need embed not view controller table view, embed navigationcontroller(you can hide navigation panel on side), end set yours table view controller root it, , use pushviewcontroller go detail page.

swing - Move JOptionPane's showConfirmDialog along with Java Application -

i want have warning showconfirmdialog window in front of application if gui moves different position, works fine if don't move application , press 'close alt+x' button, if move application second screen warning showconfirmdialog window stays @ old position, how move warning window along gui, please give me directions, thanks. close alt+x button //close window button jbutton btnclosewindow = new jbutton("close alt+x"); btnclosewindow.setmnemonic('x'); btnclosewindow.addactionlistener(new actionlistener() { public void actionperformed(actionevent e) { jframe frame = new jframe(); int result = joptionpane.showconfirmdialog(frame, "are sure want close application?", "please confirm",joptionpane.yes_no_option); //find position of gui , set value //dialog.setlocation(10, 20); if (result == joptionpane.yes_option) system.exit(0);

libgdx - Changing color and alpha of actor doesn't work in Scene2D -

changing color , alpha of actor doesn't work in scene2d; scaleto, moveby work though. can issue? @override public void render(float alpha){ stage.act(delta); table.settransform(true); //works table.addaction(actions.scaleto(2.3f, 2.5f, 2f))); //does not work table.addaction(actions.alpha(0.2f, 2f)); //does not work either table.addaction(actions.color(new color(1f,1f,1f, 0.2f), 2f)); stage.draw(); } method render() called every time screen going rendered. code starts actions beginning every frame , nothing changes. you should move these lines render() method other place (for example show() method of screen object): table.settransform(true); //works table.addaction(actions.scaleto(2.3f, 2.5f, 2f))); //does not work table.addaction(actions.alpha(0.2f, 2f)); //does not work either table.addaction(actions.color(new color(1f,1f,1f, 0.2f), 2f));