Posts

Showing posts from April, 2015

Python Requests: Hook or no Hook? -

i ' .get ' request , process response like: resp = requests.get('url') resp = resp.text .. # stuff resp after reading package's docs, saw there hook functionality permit me do: def process_r(resp, **kwargs): .. stuff resp resp = requests.get('url', hooks = {'response': process_r}) my questions: when should use hooks? or, why should use hooks? i wish initiate object (a parser) after request's response returned using requests resp.text procedure. what pythonic, correct approach here scenario? thank you hooks not million miles 'magic'. have effect of making code potentially things surprise other people (thereby violating "explicit better implicit"). hooks should therefore used drive behaviours make things more predictable, not less. example, requests uses them internally handle 401 responses various kinds of authentication. you should therefore guided restrictions on hooks. relevant part of docu

java - Partial matching of Regular expression -

i have string incrementally built. while string being built, matched whole regular expression , when match found, task performed. my requirement is: if in middle of string building process found there no way exact match found, string should reset , build process should re-initiated. for example if regular expression "mada12gaskar" , when char "3" added existing string "mada1" string should cleared , build process should start on again "mada13" never match "mada12gaskar" . possible through java regex api? i think found possible solution problem. look @ matcher#hitend() method: returns true if end of input hit search engine in last match operation performed matcher. when method returns true, possible more input have changed result of last search. now, match regexp against not-yet-fully-constructed string using matcher (obtainable via pattern instance) , @ results: if matched, have winner if

wmi - Using ManagementScope in ASP.NET -

i'm trying connect , modify dns server using asp.net mvc application. when executing following code, error: private void logon() { _namespace = "\\\\" + _servername + "\\root\\microsoftdns"; var con = new connectionoptions { username = _username, password = _password, impersonation = impersonationlevel.impersonate }; _managementscope = new managementscope(_namespace) { options = con }; _managementscope.connect(); } and error is: access denied. (exception hresult: 0x80070005 (e_accessdenied)) description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.unauthorizedaccess

cocoa - How to get output of shell command while its running in objective c -

i know similar questions have been asked before, none of them have answered mine. how can verbose output of shell command running, , interact command in nstextview? for example, lets i'm running command "emacs" inside of objective c app. shell command interactive app, , piping output think output of command when done running. want output of "emacs" while running , interact 1 if ran command in terminal. possible? if show me how it? thanks in advance

java - Is there any functions in String which can to help delete all spaces in string? -

is there functions in string can delete spaces in string? wouldn't use method this. private string deletespace(string string) { string newstring = ""; for(int = 0;i < string.length();i++) if(string.charat(i) != ' ') newstring += string.valueof(string.charat(i)); return newstring; } thank help. // occurrences literal arguments string = string.replace(" ",""); or // occurrences regular expression arguments string = string.replaceall("\\s+", "");

apk - Sencha-Touch to Android - TouchWiz issue -

i new android , have build first apk file. app is sencha-touch-web-app packaged andoird sencha cmd. samsung user interface touchwiz stops when install app on device adb. makes device unusable. touchwiz works when uninstall app. i don't see how javascript code responsible error. agree me ? below json file configures sencha cmd packaging operation : { "applicationname":"thename", "applicationid":"com.mevena.myappid", "bundleseedid":"kpxfepz6ef", "versionstring":"1.0-alpha", "versioncode":"1", "icon": { "36":"resources/icons/icon36.png", "48":"resources/icons/icon48.png", "57":"resources/icons/icon72.png" }, "inputpath":"./", "outputpath":"../build", "configuration":"debug", &q

java - How to set OnTouchListener for the entire screen? -

please have @ following code. posting important sections of code. activity_game.xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/fullview" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".game" > <textview android:id="@+id/numberofquestionsleft" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true"

html - CSS bug on pull menu jQuery script -

i know question bit specific, cannot solve problem. here's demo: http://jsfiddle.net/nwmst/ (you'll see css has comments, can ignore stuff...) the problem: notice tht menu default, has rounded corners (border-radius). when click pull menu out, 2 top corners stop having border-radius. however, if click again, close it, top corners remain same, no border radius... i've done many different tries snippets found here @ stackoverflow, non solution looking for. i'm sorry asking this, understand jquery manipulate it, can barely program own scripts. the pull tutorial used: http://www.hongkiat.com/blog/responsive-web-nav/ here's markup, styles , scripting (however, can see live in demo see problem is): html markup: <nav id="menu" class="clearfix"> <ul class="clearfix"> <li><a class="current first-item" href="#">home</a></li> <li><a href="#">

hadoop - Any python library for parallel and distributed tasks? -

i looking python library can distribute tasks across few servers. task similar can parallelized subprocess library in single machine. i know can setup hadoop system such purposes. hadoop heavy weight. in case, use shared network disk data i/o, , don't need fancy failure recover. in mapreduce's terminology, need mappers, no aggregators or reducers. any such library in python? thanks! try using celery . celery asynchronous task queue/job queue based on distributed message passing. focused on real-time operation, supports scheduling well. the execution units, called tasks, executed concurrently on single or more worker servers using multiprocessing, eventlet, or gevent. tasks can execute asynchronously (in background) or synchronously (wait until ready).

jquery - Wait for hover animation to finish before executing other -

hopefully isn't repeated question, can't seem find answer. here problem: i have hover animation done in jquery, if user hover link, want first animation callback , animate again. here example of i've got far : http://sebastien-crapoulet.fr/test/ if have link 'a propos', full animation, want if go 'a propos' 'portfolio', propos callback finish, execute other hover animation. i have fiddled around .stop() , .filter(':not(:animated)'), unsuccessfully. here i've got far : $('nav ul li a').hover(function(){ link = $(this) color = $(this).data("color") position = link.position(); background = $('.menubackground') if (color=="blue"){ background.css({ 'background-color':'#99b3c4', 'width':(position.left)+(link.width())+20+'px', 'top':position.top+&

android - round rect border for layouts -

Image
in application i'm going use lot of layout "borders" simple rounded rectangle. test how created .png file transparent background: i set image layout background. problem need different proportions other layouts , waste of time create such images in photoshop layouts. the questions: how can same android api (maybe xml shape) allow rectangle stretched dimension , still remain sharp? you can use drawable have bkg.xml in drawable folder <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="#ffffff"/> <stroke android:width="3dp" android:color="#0fecff"/> <padding android:bottom="5dp" android:left="5dp" android:right="5dp" android:top="5dp"/> <corn

string - How to read and store values from a text file into a dictionary. [python] -

i'm trying figure out how open file , store it's contents dictionary using part no. key , other information value. want this: {part no.: "description,price", 453: "sperving_bearing,9900", 1342: "panametric_fan,23400",9480: "converter_exchange,93859"} i able store text file list, i'm not sure how assign more 1 value key. i'm trying without importing modules. i've been using basic str methods, list methods , dict methods. for txt file so 453 sperving_bearing 9900 1342 panametric_fan 23400 9480 converter_exchange 93859 you can do >>> newdict = {} >>> open('testfile.txt', 'r') f: line in f: splitline = line.split() newdict[int(splitline[0])] = ",".join(splitline[1:]) >>> newdict {9480: 'converter_exchange,93859', 453: 'sperving_bearing,9900', 1342: 'panametric_fan,23400'} you c

asp.net - APS.NET Registration problems when inserting to 2 tables in SQL Server database -

i pretty new asp.net , sql server please provide support detail possible, appreciate it. here situation: i doing registration system website using aps.net , sql server 2012 express. so when user registering, first of all, need fill out account information (name, address, phone, email, password...) , secondly, need fill company information - working @ (company name, company industry, website, description...). in database have 2 table: user , company problem when filled out require fields in registration form , click submit button, how check if data has been inserted 2 tables successfully, because if reason after data inserted user table failed company table gonna problem, don't know if there way check or reverse process in sql server if inserting query failed. i don't know make sense of you, please ask me if don't understand question. thank you! without code hard answer. in .net can use try{} catch{} blocks handle errors , act upon them. a bet

multithreading - Java: How should I implement waiting so that Images render? -

i'm not sure i've asked question correctly...and i'm not sure if i've relevantly phrased question or not..so, apologize in advance...but i'm quite stuck on issue , appreciate help.. further, i'm frankly not expert so...please gentle, i'm not trying idiot. so, point of program, frankly, simple game, based off of game show on tv has lifelines.. specific 1 "phone friend" one... have quote on quote 'button' (really jpanel has mouselistener ). once button pressed, add, , paint jlabel or jpanel onto jframe , whatever works draw animated gif (of countdown) , lock other component s until 30 seconds have occurred. reference, not using layoutmanager @ moment... the way i've been attempting this, is: imageicon countdownimg = new imageicon("countdown.gif"); jlabel countdownlbl = new jlabel(countdownimg); this.getcontentpane().add(countdownlbl); countdownlbl.setlocation(200, 200); countdownlbl.setsize(new dimension(countdown

javascript - Move selection nipple to selected div ID on link click -

Image
i working on website features many links on same page: http://www.alexanderlozada.com to let user know item viewing, i'd implement small triangle points @ selected item. example: how go doing without making each link separate page? sample of link working with- (i have keep current href , rel) <a class="grey show_hide" href="#" rel="#projects" > projects </a> in cases done using pseudo elements :before and/or :after ( read full article ) css: /* creates triangle */ .selected:after { content:""; display:block; /* reduce damage in ff3.0 */ position:absolute; bottom:-2px; left:50%; width:0; margin-left:-10px; border-width:0px 15px 15px; border-style:solid; border-color:white transparent; } div.links { display: inline-block; position:relative; // must have position triangle propery width: 25%; height: 45px; // adjust height fit menu float: left;

wpf - C# GMap.Net calculate surface of polygon -

i searching way calculate surface under polygon. the thing want accomplish user uses program, can create polygon mark out property. want know surface area can tell user how big property is. unit m² or km² or hectare. the points of polygon have latitude , longitude. i using c# wpf , gmap.net. map in windowsformhost can use winforms thing gmap.net because provoides overlays etc. i hope can me or show me post explained didn't found. using 2d vector space approximation (local tangent space) in section, can detail how come these formulas. let's note points points of polygon (where points[0] == points[points.count - 1] close polygon). the idea behind next methods split polygon triangles (the area sum of triangle areas). but, support polygon types simple decomposition (not star-shaped polygon), triangle contributions negative (we have "negative" area). triangles decomposition use : {(o, points[i], points[i + 1]} o origin of affine space. t

text - Javascript color split string -

i'm using following code process strings when gets down innerhtml part want color tittxt0 variable string data blue. know how if dom element don't know how color tittxt0 variable data , leave limit chars0 alone. time. var tittxt0 = txt0[i].split("++++")[0]; var txt00 = txt0[i].split("++++")[1]; var limitchars0 = txt00.substring(0,100); var limitchars1 = txt00.substring(100, txt00.length); var codecou0=limitchars1.split("[code]"); if(codecou0.length>1){paras0[i].innerhtml ="[code]" } if(limitchars0.length ==80){ paras0[i].innerhtml += tittxt0+"<br>"+limitchars0+ " ..."; tittxt0.style.color="blue"; }else{ paras0[i].innerhtml += tittxt0+"<br>"+limitchars0; tittxt0.style.color="blue"; } i fixed issue makeing on varaiable inside paragraph , inserting other variable inside strong element here complete function whoever needs it. callrecb0:function

It is ok to delete using GET if im using Spring MVC with Spring security? -

it ok delete using if im using spring mvc spring security? can secure /entity/delete/{id} path group of users. what mean "is ok"? work, yes. clearer use actual delete verb. can use spring's hiddenhttpmethodfilter achieve this, while securing url spring security using this: <sec:intercept-url pattern="/entity/**" method="delete" access="hasrole('role_admin')" />

awk - Data partitioning by columns -

i have big matrix of 50 rows , 1.5m columns. these 1.5m columns, first 2 headers. i trying divide data columns small pieces. example each small set 50 lines , 100 columns. each small data must have first 2 columns mentioned above headers. i tried awk '{print $1"\t"$2"\t"}' test | cut -f 3-10 awk '{print $1"\t"$2"\t"}' test | cut -f 11-20 ... or cut -f 1-2 | cut -f 3-10 test cut -f 1-2 | cut -f 11-20 test ... but none of above working. is there efficient way of doing this? one way awk . don't know if ( awk ) can handle such big number of columns, give try. uses modulus operator cut line each specific number of columns. awk '{ ## print header of first line. printf "%s%s%s%s", $1, fs, $2, fs ## count number of columns printed, 0 100. count = 0 ## traverse every columns first 2 keys. ( = 3; <= nf; i++ ) { ## print header again

Drupal 7: Users or content nodes. Where do I put data? -

here few things want data: add data without creating user related it. (as node, maybe) create users related data, whenever needed. enable users edit data related them without affecting else. make data searchable , filterable. so what's best approach? create many users , add field them data, or create nodes? and yes beginner in drupal. your question vague, here general advice. only create users if users. don't use user entity store general data, unless data fields pertain user. for example, if need store mailing address of user, add field user object.

javascript - Looping through all of the items in the window object -

last night, got bored , thought of little idea little script. thinking how many built-in functions php has compared javascript , realized don't know how many functions javascript has. thought of writing script through window object including every object inside object , forth. wrote script , worked (tried on smaller object). however, problem javascript wont let me loop though whole windows object. i have tried: for (var key in window) { console.log(key); } i tried: var = object.create(window); (var key in a) { console.log(key); } both snippets of code give me: top window location external chrome intl v8intl document script1374438467163 $pick $try iframe elements overtext iframeshim mask clientcide dbug value debugcookie stylewriter stickywin tabswapper collapsible collapsable drag cookie accordion asset spinner multipleopenaccordion mootools typeof instanceof type hash native $a $arguments $chk $clear $defined $each $empty $extend $h $merge $lambda $mixin

Programmatically pay a Dwolla account with API? -

i working on application need send funds via api, if possible, programmatically. possible dwolla? im not developer i'll explain best can. think similar what's possible paypal's adaptive payments api. basically, owner of dwolla account, need send money dwolla account using application. receiver's dwolla account#, payment amount, source, , pin stored/generated application manually entering information isn't necessary. our rest api's transactions / send method you're looking for. allows send money on behalf of dwolla user programmatically. the send endpoint takes parameters mentioned. request can simple as: post https://www.dwolla.com/oauth/rest/transactions/send content-type: application/json { "oauth_token": "hyq7sishz90i6seuptmhx8pppykfup94t5bsyw1xi9qvab7yqn", "pin": "1278", "destinationid": "812-713-9234", "amount": "309.21" } note e

Fastest way to send several HTTP Post request for iOS? -

i need send around 20 http post requests in ios application. right using nsurlconnection , sending 20 requests 1 one, of course takes long time. each connection starts after previous, taken around 7 seconds complete requests. possible send these 20 requests simultaneously , receive json result faster? you can use nsoperation , nsoperationqueue prepare of requests , push them onto queue @ same time. can set concurrent execution limit determine how many run @ same time. don't run 20 @ same time though may flood network , prevent of connections completing properly. try running 5 concurrently , see how goes.

python - Canonicalisation of usernames -

what best way canonical representation of username idempotent? i want avoid having same issue spotify: http://labs.spotify.com/2013/06/18/creative-usernames/ i'm looking library in python. prefer not spotify ended doing (running canonicalisation twice test if idempotent), , importing twisted project tad overkill, there stand-alone library this? would using email addresses instead preferred when comes usernames? how major sites/companies deal this? first should read wikipedia's article on unicode equivalence . explains caveats , normalization methods there represent unicode string in canonical form. then can use python's built-in module unicodedata normalization of unicode string preferred normalization form. a code example: >>> import unicodedata >>> unicodedata.normalize('nfkc', u'ffñⅨffi⁵kaÅéᴮᴵᴳᴮᴵᴿᴰ') 'ffñixffi5kaÅébigbird' >>> unicodedata.normalize('nfkc', u'ffñⅨffi⁵kaÅéᴮᴵᴳᴮᴵᴿᴰ').lower

php - Is there any way to SQL inject in my code? -

this question has answer here: sql injection gets around mysql_real_escape_string() 4 answers how can prevent sql injection in php? 28 answers i'm not familiar sql injection , wanna know if there invulnerability in script, if there please point out , give me tip fix it. <?php include("config.php"); ?> <?php $desc = $_post['desc']; $desc = mysql_real_escape_string($desc); $author = $_post['author']; $date = date("d/m/y"); mysql_query("insert `changelog`(`author`, `date`, `description`) values ('{$author}','{$date}','$desc')") or die(mysql_error()); include("success.php"); ?> yes there is. solely relying on mysql_real_escape_string has been deprecated. furthermore should b

css - How to set a maximum container-width in Susy that only the padding/margin keeps growing on larger viewports? -

in largest desktop view/breakpoint tried accomplish same behaviour on susy demo page ( http://susy.oddbird.net/demos/magic/ ) - when container maximum width reached padding or margin on each side growing while container stays @ maximum-width. but still bit confused few points preferable unit , what's best function accomplish described padding/margin behaviour. my general susy settings @ moment following: $total-columns: 24; $column-width: 3%; $gutter-width: 1%; $grid-padding: 0; the specific scss part looks that. i've included container , flanked margin via squish: .sectionwrap{ @include container; @include squish(3,3); @include breakpoint($medium) { @include squish(2,2); } @include breakpoint($small) { @include squish(1,1); } } but problem container , squished areas both grow , grow , grow proportionally. 1 flaw used units percentages? more reasonable use em or rem instead? means when summed , maximum width reached (nu

c - I am looking for how to do the two (BFS, DFS) searches for my 8 puzzle. I'm so close to done -

i've linked code here..i don't feel understand search algorithms. haven't tried attempt them, know don't have thing else. feel though simple me understand. when read on breadth-first search, understand have search rows before move down level on tree (and same depth first moving down), how coded? i'm stumped. basically, 8-puzzle using glut/opengl, computer search you, , supposed output moves said user. blank start in middle. save order in array, , need output moves. thing stumped on search itself. #include <stdio.h> // standard c libraries #include <stdlib.h> #include <math.h> #include <time.h> #include <string.h> #include <gl/glut.h> // glut library #include "cs_graphics_setup.h" // header cs4250/5250/6250 courses // constants #define window_xs 25 // window size #define window_ys 256 #define window_name "sliding box game"

python - Why does my function return None? -

this may easy question answer, can't simple program work , it's driving me crazy. have piece of code: def dat_function(): my_var = raw_input("type \"a\" or \"b\": ") if my_var != "a" , my_var != "b": print "you didn't type \"a\" or \"b\". try again." print " " dat_function() else: print my_var, "-from dat_function" return my_var def main(): print dat_function(), "-from main()" main() now, if input "a" or "b",everything fine. output is: type "a" or "b": a -from dat_function -from main() but, if type else , "a" or "b", this: type "a" or "b": purple didn't type "a" or "b". try again. type "a" or "b": a -from dat_function none -from main() i don't know why dat_fun

ruby on rails - Mongoid: find all children documents of multiple parent documents -

i have following 2 models in rails 3.2.13 app: class organization include mongoid::document include mongoid::search field :name field :description has_many :locations search_in :name, :description, :locations => [:name, :description, :keywords] end class location include mongoid::document field :name field :description field :keywords, type: array belongs_to :organization def self.find_by_keyword(keyword) locs = [] orgs = organization.full_text_search(keyword) orgs.each { |org| locs.push(org.locations) } locs.flatten end end in locations_controller.rb , have search method: def search @results = kaminari.paginate_array(location.find_by_keyword(params[:keyword])).page(params[:page]).per(30) end using mongoid_search gem, can keyword (the search term) in fields both organization , location models, , organizations match: orgs = organization.full_text_search(keyword) but want return locations belong organizations search r

mongodb - Node.js : which keys in req.body are present in schema -

when post request, want entries keys present in model's schema. example, if 'user' model's schema consists of 'name' , 'email' keys, iterate on req.body, want values 'name' , 'email' fields. how do that? if understand question correctly, wanting have unspecified set of keys query mongo with, , return data keys. if in fact case, using mongoose lodash/underscore: var keys = _.keys(req.body); user.find(req.body).select(keys.join(' ')).lean().exec(function(err, user { if (err) throw err; res.send(user); }): that's assuming things req.body object , how keys match schema.

How was the prebuilt objects in java created? -

i trying figure out how created of methods in java, because w/o these objects wouldn't able much. if there website link me, appreciated. & sorry if off topic. http://grepcode.com/snapshot/repository.grepcode.com/java/root/jdk/openjdk/7-b147/ here can see source code standard library. example, string class: http://grepcode.com/file_/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/lang/string.java/?v=source i think entire source standard lib comes jdk, in folder somewhere, don't remember. of course standard library not makes java, because have jvm. since you're talking objects, guess that's want.

jackson - Evaluate JSon with null value using Freemarker -

when dealing json values null freemarker give error in ?eval. with mapper.setserializationinclusion(inclusion.non_null) can avoid miss information on generated json. there's way achieve evaluation null values? <#assign test = "{\"foo\":\"bar\"}"> <#assign m = test?eval> ${m.foo} <#-- prints: bar --> fail in eval <#assign test = "{\"foo\":null}"> <#assign m = test?eval> <#-- fail in eval --> ${m.foo} unfortunately (or... infuriatingly), ftl doesn't know concept of null (although might change 2.4). if manage create map json foo key exists associated value null (like create such map in java), ${m.foo} still fail. surely can write ${m.foo!'null'} , print null if there's no foo key @ all. maybe it's better if provide default value null -s during json evaluation : <#function parsejson json> <#local null = 'null'> <#-- null

Can't read php on server -

i trying read php file on server, in android. sorry shot english because foreigner.. <html> <head> <title>aaa</title> <meta http-equiv="content-type" content="text" charset="utf-8"> </head> <body> <?php $link_id = mysql_connect('localhost','root',''); mysql_select_db('aaaa',$link_id); $res = mysql_query("insert ppt_member value ('$id','$password','$name','$email','$address','$sex','$age')",$link_id); ?> this php code. when run application, 07-22 01:41:32.505: w/response(1195): <html> 07-22 01:41:32.505: w/response(1195): <head> 07-22 01:41:32.505: w/response(1195): <title>aaa</title> 07-22 01:41:32.505: w/response(1195): <meta http-equiv="content-type" content="text" charset="utf-8&quo

jquery - SlideDown working, SlideUp refusing -

i have problem hiding attribute field based on selection attribute field. since there lack of doing easier, thought of adding jquery code in footer block. i try explain current situation possible. i have selection field being generated this: <select id="edit-attributes-4" class="form-select ajax-processed" name="attributes[4]"> <option selected="selected" value="12"> verzenden, €15.44 </option><option value="13"> ophalen, €8.03 </option></select> and this: <select id="edit-attributes-5" class="form-select ajax-processed" name="attributes[5]"> <option selected="selected" value="14"> 1 fles, €15.44 </option><option value="15"> 1 doos, €92.64 </option></select> i want field edit-attribute-4 hidden on page load, added in css code wich in same footer block: #edit-attributes-

windows - Display end-user message in case of an error in custom action in MSI with Wix -

say, have following wix markup instructs msi installer call custom action included dll: <customaction id="ca_setproperties_finalize" property="ca_oninstallfinalize" value="[installed],[reinstall],[upgradingproductcode],[remove]" /> <customaction id='ca_oninstallfinalize' binarykey='cadll' dllentry='msioninstallfinalize' execute='deferred' impersonate='no' /> <installexecutesequence> <custom action='ca_setproperties_finalize' before='installfinalize'></custom> <custom action='ca_oninstallfinalize' after='ca_setproperties_finalize'></custom> </installexecutesequence> <binary id='cadll' sourcefile='sources\ca-installer.dll' /> and dll has following c++ code custom action: #pragma comment(linker, "/export:msioninstallfinalize=_ms

Python/vtk - set each point size individually in a vtkPolyData object? -

i using following code populate point cloud: how display point cloud in vtk in different colors? the points long, lat , depth of quakes in new zealand right now. i want change point size, scale fourth value - mag - magnitude data each quake in swarm. i'm not familiar vtk wrapper, , wondered if point out @ point can address actor, , change each point size: code: import vtk import csv import numpy class points_maker(object): def __init__(self, fname): self.fname = fname self.points = [] self.points_mag = [] self.get_data() def get_data(self): reader = csv.reader(open(self.fname, "rb")) row in reader: if "fid" in row[0]: pass else: longitude = (float(row[3]) - 174) * 10 #de-localises value latitude = (float(row[4]) + 41) * 10 #de-localises value depth = float(row[5]) magnitude = float(row[

sublimetext2 - Can any one suggest some sublime plugin for converting huge list into comma separated? -

i working on salesforce platform , update through data loader need provide input in csv format . know can find , replace stuff. wondering in case sublime plugin there ? you got list2csv sublime plugin. here link, https://github.com/avinash8526/list2csv-sublime-plugin . can download through package control.

javascript - Append html table -

i need help. want append table same existing 1 condition example i've 2 rows when click na + button on first row beside na time new append table should appear in between 1st , third row. please <script src="jquery-1.7.1.js"></script> <script language="javascript"> function clearnode(node){ var child = node.childnodes[0]; while(child != null) { node.removechild(child); child = node.childnodes[0]; } } function addrow(table){ var targetview = table; // create element var newtr = document.createelement("tr"); var newtd_c1 = document.createelement("td"); newtd_c1.setattribute("width","147"); newtd_c1.setattribute("align","center"); newtd_c1.appendchild( input_data = document.createelement("input"),