Posts

Showing posts from May, 2011

python - why are the right answers coming out wrong -

from random import randint correct = 0 in range(10): n1 = randint(1, 10) n2 = randint(1, 10) prod = n1 * n2 ans = input("what's %d times %d? " % (n1, n2)) if ans == prod: print ("that's right -- done.\n") correct = correct + 1 else: print ("no, i'm afraid answer %d.\n" % prod) print ("\ni asked 10 questions. got %d of them right." % correct) print ("well done!") what's 1 times 5? 5 no, i'm afraid answer 5. what's 9 times 3? 27 no, i'm afraid answer 27. what's 4 times 1? 4 no, i'm afraid answer 4. you have convert input string number: for in range(10): n1 = randint(1, 10) n2 = randint(1, 10) prod = n1 * n2 ans = int(input("what's %d times %d? " % (n1, n2))) if ans == prod: print("that's right -- done.\n") correct += 1 else: print("no, i'm afrai

Java enum getter -

i appreciate here. executing following code, buyer2 id override buyers1 id. means id=2. not sure wrong following code. think enum , method retains last value. buyer bone = new buyer("buyer1", 1); buyer btwo = new buyer("buyer2", 2); rest of code: public enum fruits { banana("banana", "b"), apple("apple","a"), orange("orange","o"); private string type, id; private fruits(string type, string id){ this.type = type; this.id = id; } public string gettype() { return type; } public string getid() { return id; } public void setid(string id){ this.id = id; } } public class player { private string name; private fruits banana, apple, orange; private int id; public buyer(string name, int id) { this.name = name; this.id = id; banana = fruits.orange; apple = fruit

java - Add time to 9-hours days -

i'm working on basic project manages tasks. working days 8:00 17:00. task has start time , estimated duration. estimated duration in minutes . want calculate end time. i've figured out how add days start time far precise. divide estimated duration 540 (= 9 hours) know how many days there approximately are. want able calculate end date precisly. i can't can't add minutes calendar because calendar uses 24-hours days instead of 9-hours days. example if start time 2015-04-26 16:00:00.0 , add 180 minutes (3 hours) end time 2015-04-27 10:00:00.0. how done? have far: public timespan calculateestimatedduration() { simpledateformat format = new simpledateformat("yyyy-mm-dd hh:mm:ss.s"); //divide 540 because there 9 hours in work day long workingdays = math.round((this.getestimatedduration()/540)); //convert calendar add estimated working days start date date startdate = this.getplannedstarttime(); calendar c

javascript - php mail with .js validation -> can't see any mistakes -

i got piece of code free template , followed instructions came it, seems fine mail doesn't go trough. html: <!--start contact form --> <form name="enq" method="post" action="email/" onsubmit="return validation();"> <fieldset> <input type="text" name="name" id="name" value="" class="input-block-level" placeholder="name.." /> <input type="text" name="email" id="email" value="" class="input-block-level" placeholder="email.." /> <textarea rows="11" name="message" id="message" class="input-block-level" placeholder="message.."></textarea> <div class="actions"> <input type="submit" value="send!" name=&quo

c# - Where in an ASP.NET WebForms project can "System.Web.UI.Control" namespace found? -

does know in asp webforms project can "system.web.ui.control" namespace found? <asp:hyperlink> or <asp:hiddenfild> are? @ web.config? the system.web.ui namespace within system.web.dll assembly. there multiple namespaces containing controls: system.web.ui has control , usercontrol , , literalcontrol ( not same thing <asp:literal /> ) , other primitives. system.web.ui.htmlcontrols has "html controls" representations of normal html elements runat="server" applied, such <a runat="server" href="~/foo" /> . system.web.ui.webcontrols contains "web controls" library, more complex controls (for better or worse) force web-developer relinquish control (no pun intended) how page rendered. these controls referenced using aspx syntax in <asp: /> element namespace. these controls <asp:hyperlink , <asp:login .

java - How to get JPA 2.0 with JBoss 5.1? -

i reading pro jpa 2 book , trying examples in it. using eclipse kepler , jboss 5.1.0. in eclipse created dynamic web project jpa project facet. jpa implementation type selected disable library configuration means using jboss's hibernate jpa implementation library. i got error on line of code: typedquery<employee> query = em.createquery("select e employee e", employee.class); these error messages: typedquery cannot resolved type the method createquery(string) in type entitymanager not applicable arguments (string, class) i believe typedquery introduced in jpa 2.0 means jboss 5.1 have not support jpa 2.0. correct? need can use jpa 2.0 jboss 5.1?

python - Hashing a time-string: Why not receive same results? -

why following code not generate @ least few identical md5 strings: import hashlib import time hasher = hashlib.md5() def calchash(): localtime = time.localtime() timestring = time.strftime("%y-%m-%d-%h-%m-%s", localtime) print(timestring) hasher.update(timestring.encode('utf-8')) print("calculated: " + hasher.hexdigest()) in range(1,10): calchash() i feeding not time stamp, generated string hasher. i'd expect identical md5 hashes if feed same string twice hasher. 2015-04-26-09-50-24 calculated: 52cae4a4231c812e5b79102a55721282 2015-04-26-09-50-24 calculated: 0329298a8a18246fc1fc2f9878252dcf 2015-04-26-09-50-24 calculated: 3db4562ca628a76c863f1308b8c41b04 2015-04-26-09-50-24 calculated: 51c482a637405897cd5d91f2145e424f 2015-04-26-09-50-24 calculated: 297eb85857fc85533a785fb13c200bdc 2015-04-26-09-50-24 calculated: 4288a660c70ee9ed40a8e7611176af91 2015-04-26-09-50-24 calculated:

c# - 2D Monogame: Rectangle collision detection, side specific -

i have 2 rectangles, 1 player, 1 map. player needs not able walk through map. both player , map have rectangle position , texture width , height, both have vector position. rectangle.intersect() outputs boolean value, cannot figure out how might find out side collided with. found function here outputs vector representing how rectangles overlapped. public static vector2 getintersectiondepth(this rectangle recta, rectangle rectb) { // calculate half sizes. float halfwidtha = recta.width / 2.0f; float halfheighta = recta.height / 2.0f; float halfwidthb = rectb.width / 2.0f; float halfheightb = rectb.height / 2.0f; // calculate centers. vector2 centera = new vector2(recta.left + halfwidtha, recta.top + halfheighta); vector2 centerb = new vector2(rectb.left + halfwidthb, rectb.top + halfheightb); // calculate current , minimum-non-intersecting distances between centers. float distan

java - SWTBot eclipse - How to terminate (stop project) a running project -

i'm trying stop running project using swtbot plug-in (for automation testing). i've tried terminate project following command: bot.toolbarbuttonwithtooltip("terminate").click(); but doesn't work! also, thought problem element focus issue, fixed with: // go console window (focus) keyboardfactory.getawtkeyboard().pressshortcut(keystrokes.alt,keystrokes.shift,keystroke.getinstance(0, 'q')); bot.sleep(100); keyboardfactory.getawtkeyboard().pressshortcut(keystroke.getinstance(0, 'c')); bot.sleep(3000); // todo: try terminate project bot.toolbarbuttonwithtooltip("terminate").click(); but still doesn't work!! i tried use bot.button() instead of toolbarbuttonwithtooltip(), , doesn't work... thanks try pass index instead of string acces toolbar button, or terminate run menu: bot.menu("run").menu("terminate").click();

vb.net - Carry objreader file being read over from form to form -

okay i'm making multiple-choice quiz game assignment , have form list of categories , actual questions. because i'm quite new @ coding , don't have whole lot of time totally restructure code in way wouldn't understand, instead of adding buttons 1 buttons "handles" made sub each click event. example of 1 of these subs: public sub btnmusic_click(byval sender system.object, byval e system.eventargs) handles btnmusic.click questions.show() me.close() dim objreader new system.io.streamreader("music.txt") end sub my text read following structure: structure quizq dim q string dim string dim b string dim c string dim d string dim correct string end structure i try read lines according structure with: dim integer = 0 5 myq(i).q = objreader.readline myq(i).a = objreader.readline myq(i).b = objreader.readline myq(i).c = objreader.readli

android - AsyncTask in Fragment not working and shows FATAL EXCEPTION: AsyncTask #1 -

the following code when run crashes app. calling in mainactivity . when run tells me: fatal exception: asynctask #1 , directs me toward progressdialog , http response line import android.app.fragment; import android.app.progressdialog; import android.os.asynctask; import android.os.bundle; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.arrayadapter; import android.widget.edittext; import android.widget.listview; import com.montel.senarivesselapp.model.showdatalist; import com.montel.senarivesselapp.model.vessel; import org.apache.http.httpresponse; import org.apache.http.httpstatus; import org.apache.http.statusline; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpresponseexception; import org.apache.http.client.methods.httpget; import org.apache.http.impl.client.defaulthttpclient; import org.json.jsonarray; import org.json.jsonexception;

Android LoaderManager Callbacks -

hi i'm using onloadfinished callback set variables public class mainactivity ... double foo; ... public void onloadfinished(loader<cursor> loader, cursor cursor) { if (cursor.movetofirst()){ int index = cursor.getcolumnindex(database_table.field); double value = cursor.getdouble(index); if (lat > 0) **foo = value;** } } but, when try use variable seems unset. what doing wrong? should synchronize method main thread? p.d cursor have data. the mainactivity class has implement loadercallbacks interface like public class mainactivity implements loadermanager.loadercallbacks<cursor> then should provide instance parameter initloader method

Fabric(twitter api) setup issue. Using swift -

hi using twitter api first time , have little experience apis in general. installed fabric app , following documentation integrate twitter using swift. when build app , install twitter option on fabric, asks me run code. when 'signal sigabrt' error on line fabric.with([twitter()]) in appdelegate.swift file. before had added import twitterkit line appdelegate . i tried add these lines following api documentation: twitter.sharedinstance().startwithconsumerkey("your_key", consumersecret: "your_secret") fabric.with([twitter.sharedinstance()]) and error comes in twitter.sharedinstance() line. adding these lines in func application method. from language use, evident newbie programming , need smiley thanks in advance. to fix problem, did following: open xcode target go "build phases" tab click "copy bundle resources" section click add button add twitterkitresurce.bundle

html - How to let the Navigation Bar (and maybe other stuff) end on the right -

so i've got problem navigation bar. i've set width 100%. see end, because it's got rounded corners... so this: | (=======) | not it's now: | (==========| #nav { height: 60px; font-size: 30px; line-height: 60px; vertical-align: middle; text-align: center; background-color: #0080ff; width: 100%; border: 10px solid #16044e; border-radius: 20px; z-index: 1; } #nav ul {} #nav li { display: inline; text-align: center; margin: 20px; } #nav { color: white; text-decoration: none; } <ul id="nav"> <li><a href="">home</a> </li> <li><a href="">courses</a> </li> <li><a href="">subjects</a> </li> <li><a href="">sign up</a> </li&

java - Google Chart's Column Annotations don't Fit -

http://s18.postimg.org/oex83yh61/screen_shot_2015_04_26_at_2_48_07_pm.png i trying create annotated stacked column chart google's chart api. however, cannot annotations display properly. when annotation big sit inside column, apparently supposed display on top (which has here, columns 1,2,3 , 7). however, instead of doing consistently many annotations represent '...' (which useless). all annotations 2-3 digit numbers, there no reason them not fit. known bug? there workaround formatting annotations? have tried adjusting font-size same behaviour occurs until font imperceptibly small (1 or 2pt). this used work in image charts api, trying move new api , can't past annotation issue. hugely appreciated. i figured out finally, interested trick use combochart. instead of directly annotating columns, add invisible line series same data (linewidth: 0), , annotate line. this jsfiddle andrew gallant illustrates... http://jfiddle.net/asgallant/qjqnx/ with lit

ios - Parameter type UnsafePointer<Void> in glDrawElements -

i trying context ( eaglcontext ) render in swift; days haven't been able function gldrawelements work. i have read couple of similar questions here on stackoverflow no avail. my gldrawelements follows: gldrawelements(glenum(gl_triangles), glsizei(indices.count), glenum(gl_unsigned_byte), &offset) i having problem last parameter - offset , expects unsafepointer<void> . i have tried following: let offset: cconstvoidpointer = copaquepointer(unsafepointer<int>(0)) the above no longer works, because cconstvoidpointer doesn't seem available anymore in swift 1.2. and: var offset = unsafepointer<int>(other: 0) the above gives warning should use bitpattern: instead. although don't believe bitpattern: should used here (because parameter expects word ), decided give try according suggestion provided such following: var offset = unsafepointer<int>(bitpattern: 0) gldrawelements(glenum(gl_triangles), glsizei(indices.count), gl

excel - Find match and copy data -

i have following (sheet1): state region south australia aberfoyle park new south wales abermain south australia adelaide and (sheet2): state region long lat victoria abermain -12.8167 51.4333 new south wales abermain -32.8167 151.4333 south australia aberfoyle park -35.07 138.5885 i require efficient way search through sheet1 , match region , state in sheet2 , when match found create 2 new columns (in sheet1 ) copies matched long , lat sheet2 , final output should (in sheet1 ): state region long lat south australia aberfoyle park -35.07 138.5885 new south wales abermain -32.8167 151.4333 note; sheet1 contains lot of more data shown here simple copy past not work :) thanks in advance. in sheet1!c2 gather correct data two-column-matching records in several ways. here 3 scenarios , examples. use two-column criteria on lookup based on index function . t

node.js - geoNear not found on Mongoose model? -

i'm confused why geonear not found on mongoose model: var location = { type : 'point', coordinates : coordinates }; shift.geonear(location, { maxdistance : 5, spherical : true }, function(err, results, stats) { response.json(results); console.log(stats); }); typeerror: object function model(doc, fields, skipid) { if (!(this instanceof model)) return new model(doc, fields, skipid); model.call(this, doc, fields, skipid); } has no method 'geonear'

How to add an icon/image to routes using Aurelia? -

i wanted add image/icon navigation links specified in aurelia's router configuration. i found answer on github . can add settings property in router configuration allows specify path image. in case using svg: import {inject} 'aurelia-framework'; import {router} 'aurelia-router'; @inject(router) export class app { constructor(router) { this.router = router; this.router.configure(config => { config.title = 'aurelia'; config.map([ {route: ['', 'dogs'], moduleid: './dogs', nav: true, title: 'dogs', settings: './img/dogs-nav.svg'}, {route: ['cats', 'cats'], moduleid: './cats', nav: true, title: 'cats', settings: './img/cats-nav.svg'}, }); } } <ul class="nav navbar-nav"> <li repeat.for="row of router.navigation" class="${row.isactive ? 'active' : ''}&

python - Tkinter Frame Not Recognizing Keypresses -

this question not duplicate of question: why doesn't .bind() method work frame widget in tkinter? as can see, set focus current frame in game_frame() method. i'm writing chip-8 emulator in python , using tkinter gui. emulator running, can't tkinter recognize keypresses. here code: def game_frame(self): self.screen = frame(self.emulator_frame, width=640, height=320) self.screen.focus_set() self.canvas = canvas(self.screen, width=640, height=320, bg="black") self._root.bind("<keypress-a>", self.hello) key in self.cpu.key_map.keys(): print(key) self.screen.bind(key, self.hello) self.screen.pack() self.canvas.pack() def hello(self, event): if event.keysym in self.cpu.key_map.keys(): self.cpu.keypad[self.cpu.key_map[event.keysym]] = 1 self.cpu.key_pressed = true self.cpu.pc += 2 sys.exit() def run_game(self, event): self.game_frame() self.cpu.load_rom("t

c# - Membership.GetUser -> Membership doesn't contain a definition for 'GetUser'. What have I missed? -

membershipuser newuser = membership.getuser(createuserwizard1.username); i red line under getuser , when hover on it, message appears: membership doesn't contain definition 'getuser' when click small dash below getuser get: generate method stub 'getuser' in 'membership what have missed? aspx: <asp:createuserwizard id="createuserwizard1" runat="server" oncreateduser="createuserwizard1_createduser" > <wizardsteps> <asp:createuserwizardstep id="createuserwizardstep1" runat="server"> </asp:createuserwizardstep> <asp:completewizardstep id="completewizardstep1" runat="server"> </asp:completewizardstep> </wizardsteps> </asp:createuserwizard> code behind: using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webc

r - Deleting specific columns based on conditions -

i have dataset in r column indicating errors on task: 0 = no error. 1 = error. how delete rows error column shows 1 (for error) , subsequent row (even if 0) ? example: id part block response time wrong 1 1 1 1 307 2015-04-26 0 2 2 1 1 291 2015-05-03 1 3 3 1 1 310 2015-05-10 0 how delete rows 2 , 3? cheers! you do: library(dplyr) df %>% filter(!(wrong == 1 | lag(wrong == 1, default = f)))

Tricky C char pointer issue -

so i'm trying write function take in 2 pointers chars , return new pointer concatenation. here's attempt: #include <stdio.h> #include <stdlib.h> char * append (char *, char *); int main(void) { char *start = "start"; char *add = "add"; char* newstring = append(start, add); printf("%s\n", newstring); return 0; } char * append(char *start, char *add) { char *newarray = malloc(sizeof(char) * 100); //get end of start word while (*start != '\0') { *newarray = *start; newarray++; start++; } while (*add != '\0') { *newarray = *add; newarray++; add++; } return newarray; } two questions: 1) of compiles nothing gets printed. think because append function returns pointer end of concatenated characters. should create temporary character pointer , set newarray @ start (so can return that)? otherwise, have somehow decrement pointer until start. there's no value

oop - Chain up to 'Gtk.Box.new' not supported -

i'm new vala , far think it's pretty cool i'm having trouble understanding inheritance. read here should use base() call parents constructor. alright, cool, seems understandable din't work me. kept getting error on title. here snippet show: public class mybox : gtk.box { public mybox(gtk.orientation orientation, int spacing) { // have this.set_orientation(orientation); this.set_spacing(spacing); // want this: base(orientation, spacing); //workaround this: object(orientation: orientation, spacing: spacing); } } please me understand why object(....) works not base(...) shouldn't same thing? this due implementation of c code. when vala generates constructor, generates 2 c functions _new function allocates memory , calls _construct , _construct function initialises object. when case base constructor using base() , needs matching _construct function call. not classes written in c hav

visual c++ - C# code not catching SEHExceptions -

i have c# application invokes managed c++ dll deliberately accesses invalid address; enabled seh exceptions in c++ project, added _se_translator_function c++ code , added signal handler when sigsegv occurs. using c++ code purely native test, works perfectly, when invoke c++ code .net app, app crashes a: unhandled exception: system.accessviolationexception: attempted read or write protected memory. indication other memory corrupt. @ k.killnative() in c:\users\ebascon\documents\visual studio 2013\projects\consoleapplication3\consoleapplication4\source.cpp:line 32 this c# console app: namespace consoleapplication3 { class program { static void main(string[] args) { try { var k = new nativekiller(); k.kill(); } catch (exception ex) { console.writeline("catching " + ex); } } } } and c++/cli code invoked: void mxxexceptiontranslator(u

java - How JUNIT read arquillian.xml in eclipse? -

i tried run arquillian test in eclipse instead of running mvn. under maven, ok, eclipse, give me exceptions: org.jboss.arquillian.container.spi.configurationexception: jbosshome 'null' must exist @ org.jboss.arquillian.container.spi.client.deployment.validate.configurationdirectoryexists(validate.java:139) @ org.jboss.as.arquillian.container.distributioncontainerconfiguration.validate(distributioncontainerconfiguration.java:103) @ org.jboss.as.arquillian.container.managed.managedcontainerconfiguration.validate(managedcontainerconfiguration.java:65) @ org.jboss.arquillian.container.impl.containerimpl.createdeployableconfiguration(containerimpl.java:115) @ org.jboss.arquillian.container.impl.containerimpl.setup(containerimpl.java:181) @ org.jboss.arquillian.container.impl.client.container.containerlifecyclecontroller$7.perform(containerlifecyclecontroller.java:149) @ org.jboss.arquillian.container.impl.client.container.contain

.net - Why is there time difference between client and server on localhost -

Image
application running on localhost. server 1 hour earlier client! client sends time : sat apr 25 2015 00:00:00 gmt-0400 (eastern daylight time) request sent: dateofarrival: "2015-04-25t04:00:00.000z" server receives time: {4/24/2015 11:00:00 pm} why there 1 hour difference between , how can handle it? guess somehow related daylight time vs standart time. when try code: string datestr = "2015-04-25t04:00:00.000z"; var mydate = datetime.parse(datestr); // gives me mydate = {4/25/2015 12:00:00 am} actually interested day part of time. in db, holding date type. because of time difference, days goes 1 day before. i tried various ways handle issue got lost in datetime conversion world! lost on localhost application, not imagine happen on live server. i think this q&a mentions similar issue, can't figure out if matters: my timezone: eastern time zone (utc-05:00) about web api odata json serializer, from post other this one

transition - d3.js. How to animate throughout all data set from start to end? -

i draw circle , want run transition first last point of data set. can't understand how it. code available here . how can it? best practice kind of animation? var data = [[{ x: 10, y: 10, r: 10, color: "red" }, { x: 70, y: 70, r: 15, color: "green" }, { x: 130, y: 130, r: 20, color: "blue" }]]; function setup() { this.attr("cx", function(d, i) { return d[i].x; }).attr("cy", function(d, i) { return d[i].y; }).attr("r", function(d, i) { return d[i].r; }).attr("fill", function(d, i) { return d[i].color; }); } var canvas = d3.select("body") .append("svg") .attr("width", 300) .attr("height", 300); canvas.append("rect") .attr("width", 300) .attr("height", 300) .attr("fill", "lightblue"); var circles

optimization - Error fitting a simulation model to data with optim in R -

good afternoon: have 30 years of population data on guanacos, , matrix simulation model; want estimate optimal values of 12 of model's parameters in r using optim, minimizing residual sums of squares (sum(obs-pred)^2). created function model. model working fine, if invoke function fixed parameter values exected results. when call optim sewt of initial parameters , function, following error message: "the argument a13 absent, no value omission"; also: message of lost warning: in if (ssq == 0) { : condition has length > 1 , first element used called from: top level (freely translated spanish). please find below r code in 3 sections: (1) first function "guafit" declaration, (2) standalone run of model invoking "guafit", , (3) call of "optim" starting parameter values. thank you, jorge rabinovich # section (1): # clean rm(list=ls()) ##################################################################### ####################### fu

java - Getting IndexOutofBoundsException -

why here getting indexoutofboundsexception 16 , eclipse pointing following code in line: if((temp[0][0] == '.' && temp[0][height - 1] == '.') || if pass following string: string layout = "..aa\n"+ "..aa\n"+ "...a\n"+ "...a\n"+ "...a\n"+ "...a\n"+ "...a\n"+ "aaaa\n"+ "aaaa\n"+ "...a\n"+ "...a\n"+ "...a\n"+ "...a\n"+ "...a\n"+ "...a\n"+ "...a\n"+ "...a\n"+ ""; into method, im getting error. smb please me this? im pretty sure im doing smth wrong in conditionals after loops. note: layout strings shapes must have @ least 1 filled block in each of 0th row , 0th column , last row , , last column . thanks! public static shape makeshape(string layout,char displaychar)

php - MySql - Sort persons by name and partner -

i'm dealing following problem in mysql/php web application: a table of persons looking having columns: id, firstname, surname, idofpartner, street, zipcode should ordered surname of person should followed partner of person result like person a partner of person (no matter surname starts with) person b partner of person b ... i'm doing simple order surname , putting them in php code. at moment query select * customers order surname, firstname the rest done in php code slow. can achieved in database? , better performance wise? ok, let's build up. the list of persons, without partners, is: select a.surname, a.firstname, a.surname sortsurname, a.firstname sortfirstname, a.id sortid, 0 role person now fetch partners of persons. in join b partner. select b.surname, b.firstname, a.surname sortsurname, a.firstname sortfirstname, a.id sortid, 1 role person join person b on b.id = a.idofpartner now combin

java - How do I ask for a parameter to be a mutable Map? -

i have function accepts map of parameters, adds them before using them: public string dorequest(string endpoint, map<string, string> parameters) { parameters.put("limit", "50"); ... } it's convenient create map using guava's immutablemap.of() : dorequest("/comments", immutablemap.of("filter", "true")); however, throws java.lang.unsupportedoperationexception @ runtime. two questions: 1) can declare dorequest in way example hashmap , treemap fine using immutablemap compile time error? 2) inside dorequest , how detect it's immutablemap , run params = maps.newhashmap(params) ? 1) can declare dorequest in way example hashmap , treemap fine using immutablemap compile time error? no. immutablemap implements map , can't compile time error. problem map.put , allows throw. it'd better have map without put , mutablemap interface... there's nothing in java software aro

excel - How do I repeat a Sub row by row in VBA? -

i have been able send emails excel through gmail, excel cells defining meta-data, body, , attachment of email. this sub runs on selected cells. i'd ideally sub run on first row (row 2 in case), , run on next rows, until has reached end. the end goal able automate sending of customized emails via excel. here's have far. sub cdo_mail_small_text_2() dim imsg object dim iconf object dim strbody string dim flds variant set imsg = createobject("cdo.message") set iconf = createobject("cdo.configuration") iconf.load -1 ' cdo source defaults set flds = iconf.fields flds .item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true .item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 .item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myemail" .item("http://schemas.microsoft.com/

cython - Cythonising Pandas: ctypes for content, index and columns -

i very new cython, yet experiencing extraordinary speedups copying .py .pyx (and cimport cython , numpy etc) , importing ipython3 pyximport . many tutorials start in approach next step being add cdef declarations every data type, can iterators in loops etc. unlike pandas cython tutorials or examples not apply functions speak, more manipulating data using slices, sums , division (etc). so question is: can increase speed @ code runs stating dataframe contains floats ( double ), columns int , rows int ? how define type of embedded list? i.e [[int,int],[int]] here example generates aic score partitioning of df, sorry verbose: cimport cython import numpy np cimport numpy np import pandas pd offcat = [ "breakingpeace", "damage", "deception", "kill", "miscellaneous", "royaloffences", "sexual", "theft",

python 2.7 - Adding a list of lists in a pandas dataframe column -

i have data frame a b c 0 1 2 1 6 5 i need add list of lists in 4th column of dataframe . becomes a b c d 0 1 2 [[4,-0.05],[0.03,[-0.02,0.02]],[0.01,-0.03]] 1 6 5 [[4,-0.35],[0.07,[-0.02,0.02]],[0.91,-0.03]] please note list of lists in column d. unable find way add type of column data pandas dataframe appreciate help. in advance you create new series as in [11]: df['d'] = pd.series([[[4,-0.05],[0.03,[-0.02,0.02]],[0.01,-0.03]], [[4,-0.35],[0.07,[-0.02,0.02]],[0.91,-0.03]]]) in [12]: df out[12]: b c d 0 0 1 2 [[4, -0.05], [0.03, [-0.02, 0.02]], [0.01, -0.... 1 1 6 5 [[4, -0.35], [0.07, [-0.02, 0.02]], [0.91, -0.... however, i'm not sure, why want store data in structure!

cdf - How to get cumulative distribution function correctly for my data in python? -

hello have list of values need cumulative distribution function have saved list in variable name yvalues [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0, 64.0, 65.0, 66.0, 67.0, 68.0, 69.0, 70.0, 71.0, 72.0, 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0, 81.0, 82.0, 83.0, 84.0, 85.0, 86.0, 87.0, 88.0, 89.0, 90.0, 91.0, 92.0, 93.0, 94.0, 95.0, 96.0, 97.0, 98.0, 99.0, 100.0, 101.0, 102.0, 103.0, 104.0, 105.0, 106.0, 107.0, 108.0, 109.0, 110.0, 111.0, 112.0, 113.0, 114.0, 115.0, 116.0, 117.0, 118.0, 119.0, 120.0, 121.0, 122.0, 123.0, 124.0, 125.0, 126.0, 127.0, 128.0, 129.0, 130.0, 131.0, 132.0, 133.0, 134.0, 135.0, 136.0, 137.0, 138.0, 139.0, 140.0, 141.0, 142.