Posts

Showing posts from August, 2013

Cast varchar to an integer in Teradata -

here have: select * trans transid in ( select cast(trim(firstname) int) customer trim(firstname) between '0' , '9999999999999999' , custid not in (select custid address) ) have numerical values in firstname column have trace trans table, in values in firstname column transid's. getting error: select failed. 2620: format or data contains bad character your fails because it's true '0foo', too. what's teradata release? in td14 use regular expression: where regexp_instr(trim(firstname), '^[0-9]+$') > 0 before need udf, eisinteger or eisbigint of ebay udfs

html - Change navbar text color Bootstrap -

i have piece of html represents relevant part of navbar: <nav class="navbar navbar-inverse" role="navigation"> <div class="container"> <ul class="nav navbar-nav navbar-right"> <li><a href="#"><span class="glyphicon glyphicon-user"></span> about</a></li> <li><a href="#"><span class="glyphicon glyphicon-earphone"></span> contact</a></li> <li><a href="#"><span class="glyphicon glyphicon-briefcase"></span> portfolio</a></li> <li><a href="#"><span class="glyphicon glyphicon-list-alt"></span> r&eacute;sum&eacute;</a></li> </ul> </div> </nav> and have piece of css hoping use change text color of navbar: .nav.n

php - Check if File exists before running a query -

i newbie forgive ignorance; i have upload pdf form check if form exists, if doesnt, upload , therefore run mysql insert query. tried this: if (file_exists($pdfsubdirectory.$filename)) if (isset($_post['submit'])) { $quer->execute(); } but error; > fatal error: call member function execute() on non-object any ideas? my main code is; <?php require "config.php"; $cat = $_get['cat1']; $catid = $_get['cat']; $subcat = $_get['subcat']; $subcatid = $_get['subcatid']; $subcat2 = $_get['subcat2']; //form vars $form_class = $_post['class']; // create modify delete flag $form_cerfa = $_post['cerfa']; // cerfa yes or no flag $form_id = $_post['id']; $form_name = $_post['name']; $predir = "./docs"; $dir = $predir."/" .$cat. "/" .$subcat."/" .$subcat2 . "/"; $dir= strtolower($dir); $dir= st

c# - UnassignedReferenceException on an assigned variable (unity 3D) -

Image
i'm new unity (using 4.5) , i'm trying learn unity 3d. have small "game" want swing axe kill spiders. have created animation named "axeswing" , small script trigger animation when click left button. probleme have error saying variable "attackanimationclip" has nothing assigned it. can see on screen shot assigned , when left click animation trigger , come idleaxe animation. here script: [requirecomponent(typeof(animation))] public class attackanimation : monobehaviour { public animationclip attackanimationclip; // update called once per frame void update () { if (input.getmousebutton(0)) animation.play(attackanimationclip.name); else if (isattackfinished) animation.crossfade(animation.clip.name); } private bool isattackfinished { { return animation[attackanimationclip.name].time > animation[attackanimationclip.name].length; } } } since have animation

objective c - iOS App Store Rejection: Can't Reproduce Error "Library Not Loaded" -

after waiting 6 days, apple got me , rejected ios spritekit game (for ipad). rejection crashing on startup. in 4 of crash logs, there 1 error: exception type: exc_breakpoint (sigtrap) exception codes: 0x0000000000000001, 0x0000000120055098 triggered thread: 0 dyld error message: library not loaded: /developer/library/frameworks/xctest.framework/xctest referenced from: /var/mobile/applications/8f4649c6-39f7-4eb7-8ff9-450fdf92e543/mygame.app/mygame reason: image not found dyld version: 324.1 i have tried reproduce crash creating .ipa file using ad hoc provisioning profile of exact same archive submitted app store. however, when run (tested on 2 ipads), runs fine. checked ~/library/logs/crashreporter, , there no .crash files app's name. quite confused @ point. how can reproduce error? any , suggestions appreciated! edit: i have tried answer futureelite7 , completed of steps, app rejected again apple, same error. the next time, removed xctest.framework

php - ics file not reflected in outlook calendar -

i trying send meeting invite php code, sending meeting invite through ics file. ics file coming in attachment in gmail not being reflected in ms outlook. this following file format have: begin:vcalendar prodid:-//microsoft corporation//outlook 10.0 mimedir//en version:2.0 method:request x-ms-olk-forceinspectoropen:true begin:vevent attendee;cn=mail@veershubhranshu.com;rsvp=true:mailto:mail@veershubhranshu.com attendee;cn=srivastav.veer@gmail.com;rsvp=true:mailto:srivastav.veer@gmail.com attendee;cn=veer@veershubhranshu.com;rsvp=true:mailto:veer@veershubhranshu.com class:public created:20140626t005704z description:when: thursday\, june 26\, 2014 10:00 am-10:30 (utc-08:00) p acific time (us & canada).\nwhere: nowhere\n\nnote: gmt offset above d oes not reflect daylight saving time adjustments.\n\n*~*~*~*~*~*~*~*~*~*\n \nsdcsdascsdcs\n dtend:20140626t173000z dtstamp:20140626t005704z dtstart:20140626t170000z last-modified:20140626t005704z location:nowhere organizer;

Does Racket support multithreading? -

i want write multithreading program in racket utilizes multiple processes shared memory space pthread in c. racket provides "thread", uses 1 process execute multiple threads. provides "subprocess" executing new programs via command line runs on multiple processes, programs cannot share same memory space. don't that. racket provide parallelism via futures , places , not provide (unrestricted) shared memory spaces. if want send data 1 thread another, use place channel. as greg hendershott points out, can send shared vector via place channel, provides shared space use. (but that's not same thing sharing memory references, familiar with, say, java-style threading might expect. , latter "don't that" refers to.) if want use pthread-like threading, guile provide them , won't using racket more. ;-)

asp.net mvc - jQuery <select> value of <form> always null -

i've done many times , it's cinch, there's wrong here , can't see problem. when selection made dropdown list, .value null. know better that. can't see problem. see problem in code? in _layout.cshtml i'm calling controller action returns partial view: @{html.renderaction("languagelistpartial", "account");} the partial view: @html.dropdownlistfor( x => x.selectedlanguage, model.languages, new { @class = "form-control } ) the dropdown renders fine: html: <form method="post" action="/account/listpartial"> <select name="selectedlanguage" id="selectedlanguage"> <option value="en-us">english</option> <option value="fr-ca">francais</option> <option value="pt-br">portugues</option> <option value="es-mx">espanol</option> </select>

swing - Java GUI using Netbeans -

i have problem writing things using .settext in textfield if writing command in code of frame in order set text in textfield in frame know textfields in netbeans preloaded gui have private method . suggestions overcome problem the code calling other frame write in it, private void jcombobox2actionperformed(java.awt.event.actionevent evt){ tx_customize l= new tx_customize(); env_region = jcombobox2.getselectedindex(); l.lf(); system.out.println(env_region); } where other frame public void lf(){ envi = s.env_region; system.out.println(envi); switch (envi) { case 1: penetration.settext("21.5"); lnf.settext("10"); system.out.println("error1"); break;` case 0: penetration.settext("16.5"); lnf.se

python - Using .mean() in numpy -

i given code , i'm familiar numpy, 1 line has me stuck looking answer. plt.contourf(lat,lev,t.mean(0).mean(-1),extend='both') t 4 dimensional variable dependent on time, lat, lon, lev. my question is, t.mean(0).mean(-1) do? thanks! the value passed mean specifies axis along take mean. therefore, t.mean(0) takes mean along 0th axis , returns 3d array. .mean(-1) performs mean along last axis of newly created 3d array, returning 2d array. which conveniently ideal contourf.

c++ - const char * pointing to same memory location -

i trying break string integer , characters using below codes. in first section on immediate printing got right output later wrong. int lottery::calcinvodds(string ruleconstraint){ const char * sorted; const char * unique; string temp; size_t pos; temp = ruleconstraint; pos = temp.find_first_of(" "); sorted = temp.substr(0,pos).c_str(); cout << temp << endl; cout << "s = " << sorted << endl; temp = temp.substr(pos+1); unique = temp.substr(0,pos).c_str(); cout << "u = " << unique << endl; cout << "sorted = " << sorted[0] << " " << "unique = " << unique[0] << endl<<endl; return 0; } output this: t f s = t u = f sorted = f unique = f f t s = f u = t sorted = t unique = t but after replacing const char * array char sorted[2] , temp.substr(0,pos).c_str(); *temp.substr(0,pos).c_str() , correct output displayed. reason of

python - Is the file read or remembered? -

if copying file , comparing back: import shutil, filecmp # dummy file names, they're not important infile = "d:\\some\\path\\file.ext" copyfile = "d:\\some\\other\\path\\file_copy.ext" # copy file shutil.copyfile(infile,copyfile) # compare 2 files if not filecmp.cmp(infile,copyfile,shallow=false): print "file not copied correctly" why? seems kind of pointless doesn't it? after i've copied file has identical, doesn't it? wrong! hard drives have acceptable error rate that's small still present. way sure re-read file it's been in memory how can sure system (windows 7) has actually read file media , not returned page standby memory ? let's assume i've got write 16 tb of data removable hard disc drives , have sure none of files on disc corrupt - or @ least no more corrupt live files. in 16 tb of disc space there few files not identical; using windiff check files byte-for-byte file comparison utility slow, @ l

ruby on rails - Atomic inc of multiple mongoid hash values -

i have mongoid model hash field looks this: class dimensionstat include ::mongoid::document include ::mongoid::timestamps field :data, type: hash attr_accessible :data end i pretend on runtime fill data like data: { 'a' => 1, 'b' => 2, ... } i need perform increments on multiple keys atomically such as: 'a' => -1, 'b' => 5 somewhere found that: instance.collection.find(_id: my_id).update("$inc" => {'data.a' => -1, 'data.b' => 5}) will trick doesn't, doing wrong? update: i'm using mongoid 3.1.6 the .inc method works non-existing keys, document not automatically refreshed database. try: dimension_stat.inc('data.a' => -1, 'data.b' => 5) puts dimension_stat.data['a'] # not changed dimension_stat.reload puts dimension_stat.data['a'] # changed you see counters have changed.

Amazon SES nodemailer connection failing -

i'm using nodejs nodemailer connect amazon ses email service. appears simple, keep getting error: "the request signature calculated not match signature provided. check aws secret access key , signing method. consult service documentation details." i've searched online , people because have space @ end of secrect key or forward slash maybe causing problem. last 1 no longer issue kept creating smtp credentials until there wasn't one. i've created around 10 smtp credentials now, copied , pasted accesskey , secretkey in each time , i'm still getting error. i've tried using http://email-smtp.us-west-2.amazonaws.com , still got same error. here code: var nodemailer = require("nodemailer"); var transport = nodemailer.createtransport("ses", { awsaccesskeyid: 'akia************', awssecretkey: 'aqlwf*****************************', seviceurl: 'http://email-smtp.us-east-1.amazonaws.com' });

java - invalid plugin.yml bukkit plugin error -

hey did issue on multiple sites before posted , did correct, still error when try load plugin, says error not invalid plugin.yml, , gives bunch of code lines , stuff (i'm assuming code in bukkit files , whatnot, , yes plugin.yml saved in src folder not package, , when export export .jar, anyway here's plugin.yml file name: prothome main: com.yahoo.m1kesanders.prothome.prothome version: 1.0.0 description: simple /home plugin commands: sethome: description: sets players home home: description: teleports player home and did use 4 spaces , no tab keys used 2 spaces after commands: , 2 after each command and here's code plugin in eclipse in case need check name , not package com.yahoo.m1kesanders.prothome; import java.io.file; import java.io.filenotfoundexception; import java.io.ioexception; import org.bukkit.bukkit; import org.bukkit.location; import org.bukkit.world; import org.bukkit.plugin.java.javaplugin; import org.bukkit.command.command; imp

transpose - Changing a row into a column in mysql -

i have query in mysql returns following: amount1 amount2 amount3 0.1 0.3 0.6 i need data in following format: amount1 0.1 amount2 0.3 amount3 0.6 the query return single row 3 columns. how can change format? thanks your option select each column per query , union them all. example : select 'amount1' amount_type, `amount1` amount_value your_query_results union select 'amount2', `amount2` your_query_results union select 'amount3', `amount3` your_query_results

php - Error message showing when converting Excel file to Text file -

i found script converting .doc, .docx , .xls/.xlsx file text format. it's converting .doc , .docx file text format. when i'm trying convert excel file it's showing me following error message. do know why it's showing me error message , how fix ? thank you. error message : warning: missing argument 1 docxconversion::xlsx_to_text(), called in d:\software installed\xampp\htdocs\contact-management\class-free.php on line 105 , defined in d:\software installed\xampp\htdocs\contact-management\class-free.php on line 48 notice: undefined variable: input_file in d:\software installed\xampp\htdocs\contact-management\class-free.php on line 52 warning: ziparchive::open(): empty string source in d:\software installed\xampp\htdocs\contact-management\class-free.php on line 52 php class (class-free.php) : <?php class docxconversion{ private $filename; public function __construct($filepath) { $this->filename = $filepath; } private fun

java - The Android program does not execute getView function inside BaseAdapter Class -

this simple program uses custom layout using baseadapter. logcat shows other functions have been executed, except getview function. on running app, receive blank screen. here code in mainactivity.java public class mainactivity extends activity { public final string tag = "task:"; //objects arraylist created class. public class codelearnchapter { string chaptername; string chapterdescription; } //defined custome adapter. myadapter mmyadapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main_simple_list); log.i(tag, "listview set contentview"); //initialized custom adapter. mmyadapter = new myadapter(); log.i(tag,"new adapter mmyadapter created"); listview codelearnlessons = (listview) findviewbyid(r.id.listid); log.i(tag,"listview inflated&q

javascript - Building different types of Highcharts Programmatically. -

what able render graphs dynamically giving defined set of parameters url. example http://example.html?team=team1%chartype=pie . this code simple 'column' http://jsfiddle.net/4mbwg/ code simple 'pie' http://jsfiddle.net/yfdkt/ code block (so not letting me post without code) programmatically need able accept 'type' parameter example (pie, chart, line) , able plot graph. simply changing "type" not sufficient. looking @ 2 types of graphs assuming plotoptions needs build dynamically...what need accomplish this? if html try, // http://stackoverflow.com/a/3855394/1817690 var qs = (function(a) { if (a == "") return {}; var b = {}; (var = 0; < a.length; ++i) { var p=a[i].split('='); if (p.length != 2) continue; b[p[0]] = decodeuricomponent(p[1].replace(/\+/g, " ")); } return b; })(window.location.search.substr(1).split('&')); if(qs['type'

printing - How To Deal With Card Printers Through C# -

**hi guys i have general question in company have card printer named (edi secure dcp 360i) . want me make program deal printer , print cards through it i never made such program deals devices . suggestion on how ?? or there reference can use me in issue any appreciated . thanks** the card printer printer. create program whatever needed, create cards image or report. should able print card printer.

ruby on rails - bootstrap-sass not working when running rspec -

i don't think i'm understanding how rails asset pipeline works. i'm building rails engine has dependency on bootstrap-sass in gemspec: #--------# # assets # #--------# ## https://github.com/twbs/bootstrap-sass s.add_development_dependency 'bootstrap-sass', '~> 3.1.1.1' ## https://github.com/rails/coffee-rails s.add_development_dependency 'coffee-rails', '~> 4.0.1' ## https://github.com/compass/compass-rails s.add_development_dependency 'compass-rails', '~> 1.1.7' ## https://github.com/rails/sass-rails s.add_development_dependency 'sass-rails', '~> 4.0.3' ## https://github.com/rails/coffee-rails s.add_development_dependency 'uglifier', '>= 1.3.0' in application.css, file i've got. /* *= require bootstrap *= require_tree . */ when run rails s , bootstrap loaded inside application.css, when run specs, get: actionview::template::error: couldn't find

android - Getting null pointer exception on interface -

i wanna pass arraylist on class class extends listfragments.but whenever call getting null pointer exception. async class public class searchjobasync extends asynctask<string, string, string> { private string response; context c; searchmodel data; arraylist<searchmodel> values; getarraylist list; public interface getarraylist { public void getlist(arraylist<searchmodel> data); } public searchjobasync(context c, arraylist<searchmodel> values, getarraylist list) { this.c = c; this.values = values; this.list = list; } public searchjobasync(context c) { this.c = c; } @override protected void onpreexecute() { super.onpreexecute (); commonfunctions.showprogress (c, "please wait...", true); } @override protected void onpostexecute(string s) { values = new arraylist<searchmodel> (); super.onpostexecute (

ios - hitTest to dismiss keyboard causing weird behaviour -

i've googled on how dismiss keyboard when touching blank area in uitableview in ios, , there're several ways solve this. using delegate, uitapgesturerecognizer, - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event , - (uiview *)hittest:(cgpoint)point withevent:(uievent *)event . i decide take hittest subclassing corresponding uiview class , override method this: - (uiview *)hittest:(cgpoint)point withevent:(uievent *)event { uiview *result = [super hittest:point withevent:event]; [self endediting:yes]; return result; } this works, dismiss virtual keyboard when touch / scroll / swipe / pinch ... somewhere else, problem shows up. the keyboard active or shown when touch 1 uitextfield object, touch same uitextfield object, here problem, keyboard try dismiss not completely, in middle of somewhere begin show up, doing kind of weird animation. of case in our apps, keyboard should stay still when touch same uitextfield object. there nice , simp

c# - Make Installer for Both 64 and 32 bit -

i use wix create msi installer dll. i make 1 installer allows install program on 64 bit platform on 32 bit. the registry entries have define, different 32 , 64 bit. this entry have create key in case 64 bit platform: h_key_localmachine\software\wow6432node\sparx systems\eaaddins\adminaddins this entry have create key in case 32 bit platform: h_key_localmachine\software\sparx systems\eaaddins\adminaddins this how registry entries defined in code: <component id="adminaddinsregentries" guid="8777a7ab-b147-4850-9f25-65011306e9c6" > <registrykey root="hklm" key="software\wow6432node\sparx systems\eaaddins\adminaddins" action="createandremoveonuninstall"> <registryvalue type="string" value="adminaddins.myclass" /> </registrykey> </component> how can add condition avoid 2 different installers? you need make 32 bit install package. that's all

javascript - dropdown list with preset closed height breaking dynamic height variable -

why ello! im trying list of boxes, variable height, able hide / show content .animate() on 1 function. im trying height of content boxes .height() works... need set boxes height start @ 0px page loads , boxes closed begin with. the problem arises me being bad variables. can thing work, set boxes start @ 0px(globally)... variable set on click find content size finds size of 0px set initial state... boxes can close have no height reopen to. if comment out first line in jsfiddle , below , can see sort of working: //$(".classname").find("p").not(".trigger").css({height: '0px'}); btw: know way made selectors $(this).parent().bla().bla().bla(); not efficient way of selecting these items sites actual code more complex , wanted keep similar. thx! here 1 way it: /** set object. **/ var allelementheightsoriginally = { heights: {} }; var triggerelementheight = $(

Java List<String> to Short -

i have list of string: private final list<string> categorylist = arrays.aslist("27", "28, 96", "10", "15", "7", "98"); from above list, "28, 96" considered 1 item (not typo). converting each of them short have no problems except 1 item: for ( int m = 1; m < categorylist.size(); m++) { short layervalue = short.parseshort(categorylist.get(m)); } i'm getting error converting "28, 96": java.lang.numberformatexception: input string: "28, 96" @ java.lang.numberformatexception.forinputstring(numberformatexception.java:65) @ java.lang.integer.parseint(integer.java:492) @ java.lang.short.parseshort(short.java:117) @ java.lang.short.parseshort(short.java:143) but if add directly: //pmtpselectlist[0].layerratelist = new short[] {layervalue}; pmtpselectlist[0].layerratelist = new short[] {28, 96}; it works properly. so, i'm confused why , if there'

android - YouTube animantions -

i play video in app , have animations youtube app has -- swiping view fullscreen mode view resize small window in corner. i think can if video played in same layout/ have others options? mean can play video in different activity or fragment in fullscreen mode , swipe close , show small window in previous activity (with animation)

javascript - Expand right floated div to push left div -

so, have <div style="width:250px;border: 1px solid;overflow:auto" id="container"> <div style="float:left;">vasileostrovsky rayon</div> <div id="rightaligneddiv"> div expanding </div> </div> how can make #rightaligneddiv expand on left one. in other words when #rightaligneddiv wide enough, want push left 1 smaller, , left div can move new line :). here fiddle demonstrate predicament http://jsfiddle.net/ec9zx/1/ this has solved somehow using css. js solution complicate logic much. , wouldn't elegant one. window.alterwidth = function() { var testwidth=parseint(document.getelementbyid("testid").style.width); var testwidth1=parseint(document.getelementbyid("rightdiv").style.width); document.getelementbyid("testid").style.width = (testwidth-33)+'px'; document.getelementbyid("rightdiv").style.width = (testwidth1+33)+&#

Android WebView Client Causes ANR -

i implementing client end library oauth api. in authentication process, webview client fire , load authentication page's url.however, webview client start correctly, started causing anrs. here's code library: public string inflateview(activity activity,string redirecturl, string scope){ final string rurl=redirecturl; layoutinflater inflater = activity.getlayoutinflater(); page=inflater.inflate(r.layout.web_overlay, null); final string scopes=scope; activity.setcontentview(page); gwebview = (webview) page.findviewbyid(r.id.webview); gwebview.loadurl("https://api.23andme.com/authorize/?redirect_uri=" + redirecturl + "&response_type=code&client_id=" + this.clientid + "&scope=" + scope ); log.d(tag, "http://192.241.244.189/auth/authorize?response_type=code&client_id=iv9amqp9&scope=read:sequence read:patient"); gwebview.setwebviewclient(new webviewclient(

php - how to prevent user multiple login with single account -

i need completed login script , i'm confused how prevent user multiple login single account? in website have membership subscription 1 free , 1 paid want create more secure login system , want embed function paid user can't login multiple pc or browser once user logged single account. example of system 1)if user login google chrome , trying login firfox system should automtically destroy chrome session? here login script $email=$_post['email']; $password=$_post['password']; $email = stripslashes($email); $password= stripslashes($password); $email = mysql_real_escape_string($email); $password = mysql_real_escape_string($password); //selecting user db $querymysql=mysql_query("select * students semail='$email' , spassword='$password'") or die ("query problem"); $row=mysql_fetch_array($querymysql); $name=$row['sname']; $act=$row['activation']; $e=$row['semail']; $p=$row['spasswor

asp.net web api - how to pass large amount of data when exporting to excel using angularjs and web api -

i using angularjs + web api website. need export table excel. tried use different js methods, worked on chrome need work on >ie8. so, decided use server: send table's $scope.data server using post. how looks: function excel_service($http) { var _$http = $http; self = this; self.exporttoexcel = function (excel_data) { var promise = _$http({ method: "post", url: 'api/exporttoexcel', data: { "exceldata": excel_data } }).success(function (data, status, headers, config) { }).error(function (data, status, headers, config) { }); return promise; }; }; when debug, see part of data appears in request, then, there error... think it's because trying pass 700 rows using method. is there way send large data via post, or perhaps approach wrong, , it's better if saved data in server's session when retrieved, , export excel there. thanks.

mysql - How to manage timezone for different users of different countries for a php web application? -

i developing web application. application has different users different countries. i have used manage thier registrations using utc timestamp. works fine me. but problem occures when checking expiry date of account. for example - suppose registration valid 15 days , user india registration date 11 june 2014 per asia/kolkata timezone, in database table have stored registration date in unix timestamp format (server set utc timezone), on 16th day want expire account , when executing query compairing todays date (date in timestamp, date converted timestamp using strtotime() function of php), found there difference in 1 day. how handle these type of situation? not registration problem other conditions there. if want send email of registration expiry using cron job, how works? you need few steps. database table of countries along timezone on registration or form submit ip address check details based on ip , country , timezone save country , timezone along record in

php - codeigniter $this->dbutil->csv_from_result ignore last delimiter -

i using following function export csv. $this->dbutil->csv_from_result() unfortunately @ end of line prints delimiter, when use csv import data again takes field out key. example here: "id", "time", "name", "1", "1400000000", "john", "2", "1400000000", "matt", wondering if can this. you can use rtrim($string, ","); // strip comma end of string example : $string = "abc" ; echo rtrim( $string , "c") ; echo ab

javascript - AngularJS SVG Path directive -

bit of short question, wondering why happening: in example posted below, there 2 svg elements, each containing directive assigned element. first directive doesn't use template, , setup use assign actions paths. the second directive trying in order clean code bit, won't drawn. i googled bit around, , read there difference between svg & dom nodes? since both ng-repeat's working, i'm bit puzzled on going on. link plunkr: http://plnkr.co/edit/cok6o58souyaghg5jtu5?p=preview angular.module('app', []).controller("appctrl", function($scope) { $scope.items = [1,2,3,4]; }).directive('svgpathnoreplace', function() { return { restrict: 'a', scope: true, link: function(scope, element, attrs) { } } }).directive('svgpathreplace', function() { return { restrict: 'a', replace: true, template: '<path id="1" d="m 85.750001,0 c 38.393651,0 0,39.02444 0,87.15625

android - Master/Detail Flow (Two Pane) Layout List Subitems -

i'm using this tutorial build android project. uses master-detail flow (two pane) layout tablets. provides list fragment items list. uses android.r.layout.simple_list_item_activated_1 layout show list of item on left, , uses webview on right show dummy content. now want add description list items (i beleive called item/subitem listview) liko so: http://i.stack.imgur.com/kb4ew.jpg the problem is, can't achieve kind of list subitems using public static map<string, dummyitem> item_map = new hashmap<string, dummyitem>(); array kind of structure: additem(new dummyitem("1", "title", "file:///url.html")); the question is: how can add needed functionality project modifying basic master/flow layout webview dummycontent representing?

javascript - CodeMirror using jQuery .keyup on editor textarea -

i want getvalue of codemirror editor on keyup did not work. here's the fiddle var mixedmode = { name: "htmlmixed", scripttypes: [{matches: /\/x-handlebars-template|\/x-mustache/i, mode: null}, {matches: /(text|application)\/(x-)?vb(a|script)/i, mode: "vbscript"}] }; var editor = codemirror.fromtextarea(document.getelementbyid("html"), {mode: mixedmode,linenumbers: true }); $(document).ready(function(){ $("#html").keyup(function(){ html = editor.getvalue(); alert(html); }); }); codemirror hides textarea element, listening events of editor instance can use on method: $(document).ready(function () { editor.on('change', function () { html = editor.getvalue(); alert(html); }); }); you can find list of supported events in codemirror's manual. http://codemirror.net/doc/manual.html

r - download csv from sftp server and use it as data frame -

i download csv file sftp server , use data frame. i'm doing following: library(rcurl) url<-c("sftp://data.ftp.net/data.csv") x <-geturl(url, userpwd="<username>:<passwd>") writelines(x, con="data.csv")) dataframe <- read.csv("data.csv") the problem when using geturl takes long read file, e.g. ,about 12+ mins read 38~mb file, when take seconds download files in other ftp clients such filezilla. drastic difference when considering case of downloading multiple files. is there more efficient/faster way this?

android - Ternary operator in select statement -

i trying execute query has ternary operator inside select statement: select id, memory_id, case when word_to =? word_from else word_to end translations word_to =? or word_from =? how can build such query using querybuilder object? tried: public list<translation> findmeanings(long wordid) { try { dao<translation, long> translations = getdao(translation.class); querybuilder<translation, long> querybuilder = translations.querybuilder(); string id = long.tostring(wordid); querybuilder.selectraw(dbcolumns.id, dbcolumns.memory_id, "case when word_to="+id+" word_from else word_to end"); querybuilder.where().eq(dbcolumns.word_to, id).or().eq(dbcolumns.word_from, id); return querybuilder.query(); } catch (sqlexception e) { logger.error("db", e.getmessage(), e); } return new arraylist<translation>();