Posts

Showing posts from July, 2011

objective c - properties - non public weak setter appears to work, but getter only returns the same value as first call -

using properties want publicly visible getter , privately visible setter object weak reference. thought had worked using class extension. until called getter, both, before , after setting object nil. getter worked if called before or after object set nil. here have: bar.h #import <foundation/foundation.h> @interface bar : nsobject @property (nonatomic, readonly, weak) nsobject *object; // note readonly - (id) initwithobject:(nsobject *)object; @end bar.m #import "bar.h" @interface bar () // class extension @property (nonatomic, readwrite, weak) nsobject *object; // note readwrite @end @implementation bar - (id) initwithobject:(nsobject *)object { self = [super init]; if (self) { self.object = object; } return self; } @end main.c #import "bar.h" int main(int argc, char *argv[]) { @autoreleasepool { // call getter once, before setting object nil. // appears work. nsobjec

c# - How To View Database Diagram? -

i working on project requires me write several poco classes using entity framework code first . there lot of entity relationships , inheritance going on , hard keep track of looking @ code. now, know, entity framework code first yields .mdf file database, , thinking verification, database diagram server me better. is possible me view database diagram in scenario, , how may so?? you point sql server express database - default mvc 4 project uses localdb if you're more comfortable in management studio can create own database , change connection string that. also memory believe can attach mdf file in management studio may have trouble while application running. thinking of else there.

Perl - Transforming an anonymous array -

i can manipulate single array element , add reference array value in hash. easy. example, achieves desired result: # split line array @array = split; # convert second element hex dec $array[1] = hex($array[1]); # add array hash $hash{$name}{ ++$count{$name} } = \@array; my question: possible same thing using anonymous array? can close doing following: $hash{$name}{ ++$count{$name} } = [ split ]; however, doesn't manipulate second index (convert hex dec) of anonymous array. if can done, how? what asking this my $array = [ split ]; $array->[1] = hex($array->[1]); $hash{$name}{ ++$count{$name} } = $array; but may not mean. also, rather using sequential numbered hash keys better off using hash of arrays, this my $array = [ split ]; $array->[1] = hex($array->[1]); push @{ $hash{$name} }, $array; you need way access array want modify, modify after pushing onto hash, this: push @{ $hash{$name} }, [split]; $hash{$name}[-1][1] = hex($hash{$

java - How I remove inputted numbers from a Text Area? -

/* * integersumsview.java * program allows individual add list of numbers, , choose whether * add numbers, or or odd numbers */ public class integersumsview extends frameview { // int position = 0; int[] aryinteger = new int[10]; public integersumsview(singleframeapplication app) { super(app); initcomponents(); // status bar initialization - message timeout, idle icon , busy animation, etc resourcemap resourcemap = getresourcemap(); int messagetimeout = resourcemap.getinteger("statusbar.messagetimeout"); messagetimer = new timer(messagetimeout, new actionlistener() { public void actionperformed(actionevent e) { statusmessagelabel.settext(""); } }); messagetimer.setrepeats(false); int busyanimationrate = resourcemap.getinteger("statusbar.busyanimationrate"); (int = 0; < busyicons.length; i++) { busyicons[i] = resourcemap.geticon("statusbar.busyicons["

javascript - YouTube user feed parsing from JSON -

i trying make script json feed of specific user latest 2 uploads on youtube. tried use script <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script> <script type="text/javascript"> // set variables needed query var url = "https://gdata.youtube.com/feeds/api/users/"; var username = "myusername"; var jsonformat = "/uploads?v=2&alt=jsonc&max-results=2"; // construct json feed of youtube user's channel var ajaxurl = url + username + jsonformat; // last videos of youtube account, parse html code $.getjson(ajaxurl, function(data){ var htmlstring = ""; $.each(data.items, function(i,item){ // here's piece html htmlstring += '<iframe class="videos" type="text/html" width="640" height="390" src="http://www.youtube.com/embed/'; htmlstring +=

How to correctly handle autorun start & stop on linux with python -

i have 2 scripts: "autorun.py" , "main.py". added "autorun.py" service autorun in linux system. works perfectly! now question is: when want launch "main.py" autorun script, , "main.py" run forever, "autorun.py" never terminates well! when do sudo service autorun-test start the command never finishes! how can run "main.py" , exit, , finish up, how can stop "main.py" when "autorun.py" launched parameter "stop" ? (this how other services work think) edit: solution: if sys.argv[1] == "start": print "starting..." daemon.daemoncontext(working_directory="/home/pi/python"): execfile("main.py") else: pid = int(open("/home/pi/python/main.pid").read()) try: os.kill(pid, 9) print "stopped!" except: print "no process pid "+str(pid) first, if you're t

php - CGI Index yields 403 (Forbidden) -

i'm running nginx php-cgi on ubuntu computer. things seem working okay except major detail visiting / yields "403 forbidden" nginx. visiting /index.php works fine. if add index.html , go / works too. server { root /home/ajcrites/projects/php/devays/public/; server_name sub.localhost; location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } } it seem fastcgi_index index.php; cover this, not case. there need add / serve /index.php ? you need add index.php index directive have index index.html index.php; see http://nginx.org/en/docs/http/ngx_http_index_module.html

android - Error: Default Activity Not Found -

i upgraded intellij idea 12.0.4 12.10. now modules in android project give error: error: default activity not found i reverted 12.0.4 , works. any ideas ?? think might related plugins not being installed cause other thing have been local config deleted configuration folder confirm , didn't change anything. if see error occur after upgrading versions of intellij idea or android studio, or after generating new apk, may need refresh ide's cache. file -> invalidate caches / restart...

graphics - time complexity of line segment or edge intersection finding algorithms -

i briefly reviewed literature on line intersection , line arrangement problems in computational geometry. of them based on plane sweep algorithm. angle of computational complexity, seeems me asymptotic algorithmic bounds function of number of line segments , term "k" "k" number of intersections among edges. example, 1 of best known algorithms has time complexity of o(nlogn + "k") output sensitive. problem difficulty in understanding fact why cannot rid of term "k" while providing time complexity. because if @ other algorithms e.g sorting problems, complexity not function of how many swaps or comparisons done. function of number of inputs. insights helpful. if you'd express worst-case complexity strictly in terms of number of line segments in input, have assume k largest possible number of intersections (namely n 2 ). algorithm o(n log n + k) time complexity (such balaban's) called o(n 2 + n log n) or o(n * (n + log n)) if p

Post traverse recursion in VBA to calculate a consolidated status -

Image
my apologies i'm new vba. i'm looking post-traverse example resolve below problem. i'd recursively traverse tree in column calculate consolidated status. in example table below "real proj 1" has status (=amber). "real proj 2 , 3 have both status g (green). because 1 of sub projects of program b contains amber, it's calculated status should amber (see column c). or consolidated status of "simplification" on row 2 amber children ("real proj a", program b , c) contain @ least 1 status of amber. the values in column contain indentations, i.e. "program a" on row 3 has indentation level = 1, "real proj 2" on row 6 has indentation level = 3. on how implement in vba recursion appreciated. thanks, chris here solution. hope helps else too. best, chris sub teststatus() call populatestatus(2) end sub sub populatestatus(rowindex integer) dim level integer dim children() integer dim child integer

sql - I need make a subquery -

Image
i have 2 tables: invitations , events. i need name of event, total of guest per event , total of presents when true per event in same query! something join both tables (left join) selecting events.name, count(invitations.guest), count(invitations.presents when = true) , group events... looking tables data... i think work don't want... select e.name, count(in.guest) guests, (select count(presents) watermelon.invitations presents = true) presents watermelon.events e left join watermelon.invitations in on e.id = in.event group in.event; then get: http://dl.dropbox.com/u/360112/duda/resultado.jpg some suggestion? please need it, , i'm tired of trying , getting wrong results... in advance! sounds want using count , group by , case : select e.id, e.name, count(i.id) totalguests, count(case when i.presents = 'true' 1 end) totalpresents events e left join invitations on e.id = i.event group e.id, e.name i'm not po

opengl - using your visual studio 2012 c++ .exe on computers that don't have the .dll(s) -

so i'm making game using c++ glut , glew, installed 4 different .dll files system folder 32bit , 64bit both, so i'm wondering, since moved .exe computer , couldn't run, can create installer somehow include them? normal apps install system folders too? or automatically detect .dlls in same folder app or have change in c++?

javascript - Add Class to <body> tag after user has scrolled on a web page -

i have webpage , when user has scrolled @ point, want div tag change class "the top" "the topscrolled". i think have use .scrolltop() not quite sure how use it. here html code <div class="thetop"> <?php /** begin header **/ if ($gantry->countmodules('header')) : ?> <div id="rt-header"> <div class="rt-container"> <?php echo $gantry->displaymodules('header','standard','standard'); ?> <div class="clear"></div> </div> </div> <?php /** end header **/ endif; ?> </div> i include class named 'scrolled' in body tag after user has scrolled apply separate css styling. yes, can use scrolltop function. you can use on body : $('body').scrolltop(); it return number of pixels scrolled. let's want add class a

How to add New slide in between existing slides in the Jquery Cycle Plugin? -

while using jquery cycle plugin, able insert slides dynamically in between existing slides , not @ end. this code using function onbefore(curr, next, opts) { //adding new slide opts.addslide(item); //item has dynamic slide data going added existing slides. } thanks in advance! you can add slide in position yo uwant, have wait cycle on slide before 1 need. works quite because add slide when need show , in position want. function onbefore(curr, next, opts) { // on first pass, addslide undefined (plugin hasn't yet created fn); // when we're finshed adding slides we'll null out again if (!opts.addslide) return; //add type of logic here make sure in position //where want add slide if ($(curr).index() === 8 && $(next).index() === 9) { //adding new slide opts.addslide(item); } }

Is hadoop jar command class name case sensitive? -

i started learning hadoop 1.1.2 recently. when begin running wordcount case, 2 kind of codes both fine. command a: hadoop jar /usr/local/hadoop/hadoop-examples-1.1.2.jar wordcount input output command b: hadoop jar /usr/local/hadoop/hadoop-examples-1.1.2.jar wordcount input output the difference main class name wordcount . so question weather main class name wordcount case insensitive or not default? update : @amar said wordcount won't work fine , have checked right. mislead document here . official document need update. but still don't know why must wordcount . try running without wordcount , like: hadoop jar /usr/local/hadoop/hadoop-examples-1.1.2.jar input output you receive follows: unknown program 'input' chosen. valid program names are: aggregatewordcount: aggregate based map/reduce program counts words in input files. aggregatewordhist: aggregate based map/reduce program computes histogram of words in input files. dbco

java me - How to handle null as a key value in Hashtable in blackberry? -

as, know hash table doesn't allow null. how handle if want put key pair values? there other alternative in blackberry ?? you can extend hashtable this class nullkeyhashtable extends hashtable { private static object null = new object(); private object nulltonull(object key) { return key == null ? null : key; } public object put(object key, object value) { return super.put(nulltonull(key), value); } public object get(object key) { return super.get(nulltonull(key)); } ... }

asp.net - Google Language Dropdown Widget - On Ajax Page -

i have google language drop-down widget on asp.net page. page contains cascading drop-downs. is, on selection of value first drop-down, fill other. the problem facing is, if select language first google language drop-down , change value first drop-down, values in second drop-down not persisting changed language. sure happening because of async postback. but, if enableajax property false, working. using telerik radajaxmanager implement ajax. please find code attached here <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>test page - asp.net</title> </head> <form id="form1" runat="server"> <asp:scriptmanager runat="server" id="scrpt1"> </asp:scriptmanager> <telerik:radajaxmanager id="radajaxmanager1" runat="server" enableajax="true"> <ajaxsettings>

.net - Regex to find first extension in OpenFileDialog filter string -

i want find first extension in list of exentions in openfiledialog file filter string. consider below example - image files(*.bmp;*.jpg;*.gif)|*.bmp;*.jpg;*.gif text files (*.txt)|*.txt for first case - if user tries save file without extension default want append .bmp extension filename. for second case - if user tries save file without extension default want append .txt extension filename. rather use regex split string, use split function suggested sysdragon - there no earthly reason why wouldn't this. once have second part of original string regex bmp *.bmp;*.jpg;*.gif 1 , match. ^\|\*\.(\w{1,4}); simply put, says following: ^ start @ beginning of string \| find pipe character (the \ delimits because equivalent of or in regex) \* find single * character (again, delimited because * means 'zero or more repetitions' in regex) \. find single period (delimited because means 'any character' normally) (\w{1,4}) find @ l

javascript - How to play .mp3 files in chrome with computer local file -

i have made mp3 player. plays src determined files. need should play .mp3 file in computer local drive. c://fakepath... stop effort. can solve problem. can solve such problem next video player. thanks local files can't referenced web . if have file on computer , access file://something, should able access relative urls.

SSL serverHello message length tampered -

in ssl client, receiving serverhello message tampered message length below. "16 03 00 00 35 02 00 08 00... " here, "00 08 00" message length coming 2048 bytes. in next record, sends "servercertificate & serverhellodone" messages. so, in client side, waits read 2048 bytes. messages "serverhello, servercertificate, serverhellodone" not having 2048 bytes combinedly. so, still client waits read pending message (socket blocking socket). so, waits in recv , never comes out. i know how applications should handle situation. there way in ssl protocol, can identify this. if not possible, how applications should handle situation come out ? thank ! regards satish.

c# - Default value of dynamic type? -

what default value of variable declared dynamic e.g. private dynamic banana; ? can rely on default() function when type determined @ runtime? the reason need find default value declare dynamic member of class want set once (but not readonly ), use many times. how check if dynamic variable has been set other default value without knowing runtime type be? google came nothing on :s thanks in advance. it null . dynamic blah; console.write(blah); // crash console.write(blah.gettype()); // nullref ..is meant?

mfc - Use a C++/CLI DLL using afxwinforms.h as Reference of another C++/CLI DLL also using afxwinforms.h -

in visual c++ 2010 added reference c++/cli dll ( controlwrapper.dll ) c++/cli dll ( clilibrary.dll ). both including afxwinforms.h in stdafx.h. when try compile these errors: error c2011: 'microsoft::visualc::mfc::cwin32window' : 'class' type redefinition error c2011: 'microsoft::visualc::mfc::cwinformseventshelper' : 'class' type redefinition if turn of option reference assembly output , add #using "clilibrary.dll" using .cpp file following warnings: 1>controlwrapper.dll : warning c4944: 'cwin32window' : cannot import symbol 'c:\dev\trunk\clilibrary.dll': 'microsoft::visualc::mfc::cwin32window' exists in current scope 1> c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxwinforms.h(83) : see declaration of 'microsoft::visualc::mfc::cwin32window' 1> diagnostic occurred while importing type 'microsoft.visualc.mfc.cwin32window' assembly 'clilib

php - IOS Game - Life Regeneration -

i have ios / cocos2d game php/mysql server user given 5 lives @ start. users can connect on device play via facebook account. each time play game, 1 life used up. lives regenerate once every 10 minutes, regardless of whether app active, resigned or terminated. i understand can use nstimer or ccdelaytime "regenerate" lives while app active, how can persist while app minimized or closed? should implement on server side? should implement on server side? i think should handle on server side 2 main reasons: you app can played more 1 device. number of remaining lives should same whatever device playing needs kept in unique place. also keeping number of lives on server side prevent users trying hack app changing locally number of remaining lives.

JavaFX Secondary Screen "Always on Top" of All Applications -

i've read using jdialog wrap jfxpanel in order use jdialog's alwaysontop method. works, i'm having small issue hack. since i'm using technique make secondary windows main application (popups etc), need set them on top of main window. if use wrapper hack this, top panel "always on top" of everything (including other applications). is there way put secondary screen only on top of application ? don't fact application can dragged in between main window , secondary window of application. i suggest not using jdialog , jfxpanel , using javafx stages . make secondary screen stage , invoke secondarystage.initowner(primarystage) before show secondary stage. from stage documentation: a stage can optionally have owner window. when window stage's owner, said parent of stage . . . stage on top of parent window. i believe setting owner of secondary stage, correctly fulfills requirement of "secondary screen on top of applicati

How to read the pdf file using jpedal in javafx -

i need read pdf file using jpedal in javafx.i have tried jpedal lgpl src provided pdfdecoder class getpageasimage() gives pdf pages images.if not able perform search operation on pdf file.is there other method reads pdf file except reading images.if has idea regarding can plz give me reply. thanks in advance. did have @ examples: http://www.idrsolutions.com/how-to-extract-text-from-pdf-files/ ? i can suggest pdfbox ( http://pdfbox.apache.org/ ) works great text extraction pdf files. have fun

google play - Android Application convert required permissions to features -

i have uploaded new android application google play store , found simple application unsupported 909 devices. required permissions android.permission.access_fine_location android.permission.access_network_state android.permission.call_phone android.permission.internet now want make call_phone , access_fine_location optional. means want check pragmatically if device can't make call or can't provide fine location information. by doing think can support more devices. features include apis for: camera functions location data (gps) bluetooth functions telephony functions sms/mms functions network/data connections for feature requirements declared in <uses-feature> elements, google play assumes required application & filter based on those. if application attempts use of features without declaring in application's manifest, security exception thrown application.

ruby on rails - bad uri google places from heroku server -

i have google places api key , able query google places api localhost. i on rails 3.1, , when pushed site heroku bad request. referring http google places api , not javascript 1 - although suspect problem same either way (see message google below) here how account configured in google console: key browser apps (with referers) api key: xxxxxx referers: referer allowed activated on: mar 5, 2013 9:41 pm activated by: xx@stanford.edu – there no problem when on local host. however when push app , make query google places get: bad uri(is not uri?): https://maps.googleapis.com/maps/api/place/textsearch/json?query=blamp&key=xxxxx&sensor=false&types=restaurant|food|bar|cafe edit: i've pinpointed error because of usage of bars '|' separate google types @ end. works both when copy/paste query browser header, , when in development on localhost. ideas: 1) why happening. 2) how fix it? here how access api ruby code: query = uri.escape(para

iphone - Gyro CMAttitude pitch, roll and yaw angle problems -

i have problem getting pitch, roll , yaw angles cmattitude class. first, did normal gyro using 'cmmotionmanager' class , atributes x,y,z , worked fine. then, tried use cmattitude "absolute angles", doesn't work because seems not updating data. angles 0 (but isn't errors or warnings) i have searched lot in stackoverflow, , used solutions find, have same problem. here's code: - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. motionmanager = [[cmmotionmanager alloc] init]; cmdevicemotion *devicemotion = motionmanager.devicemotion; cmattitude *attitude = devicemotion.attitude; referenceattitude = attitude; [motionmanager startgyroupdates]; timer = [nstimer scheduledtimerwithtimeinterval:1/30.0 target:self selector:@selector(dogyroupdate) userinfo:nil

Decrypting Java AES Encryption in Objective-C -

this question might've asked several times, have yet discover answer solved problem. scenario: have encrypted file server, using java. goal decrypt file in iphone (objective-c). i tried decrypt using fbencryptoraes no avail. here's decryption in objective-c: nsdata *returndata = [fbencryptoraes decryptdata:stream key:key iv:nil]; the stream encrypted nsdata obtained server, key aes. i have written equivalent java code, , decrypt data correctly using , therefore verify key i'm using identical byte-per-byte. here's said java code: secretkeyspec key = new secretkeyspec(key, "aes"); cipher cipher = cipher.getinstance("aes"); cipher.init(cipher.decrypt_mode, key); cipherin = new cipherinputstream(new fileinputstream(<decrypted-file>, cipher); any suggestion? thanks.

How to support multiple projects in multiple languages (Java and Scala) in Gradle? -

i trying convert our antiquated ant build gradle. project contains java 50 sub-projects , 10 scala sub-projects. java projects contain java , scala projects scala. each project getting built java scala slowing down our build considerably. i want place common logic in root build.gradle file possible looks this: subprojects { apply plugin: 'java' apply plugin: 'scala' sourcecompatibility=1.7 targetcompatibility=1.7 sourcesets { main { scala { srcdir 'src' } java { srcdir 'src' } } test { scala { srcdir 'test' } java { srcdir 'test' } } } repositories { mavencentral() } dependencies { scalatools "org.scala-lang:scala-compiler:2.9.3" compile "org.scala-lang:scala-lib

Optimizing php/mysql translation lookup with huge database and hash indexes -

i'm using utf8 mysql database. checks if translation in database , if not, translation , stores in database. select * `translations` `input_text`=? , `input_lang`=? , `output_lang`=?; (the other field "output_text".) basic database, first compare, letter letter, input text "input_text" "text" field. long characters matching keep comparing them. if stop matching, go onto next row. i don't know how databases work @ low level assume basic database, search @ least 1 character every row in database before decides input text isn't in database. ideally input text converted hash code (e.g. using sha1) , each "input_text" hash. if database sorted rapidly find of rows match hash , check actual text. if there no matching hashes return no results though each row wasn't manually checked. is there type of mysql storage engine can or there additional php can optimize things? should "input_text" set kind of "index&quo

run php site on iis express -

i've been trying run simple hello world php site iis express, following question https://stackoverflow.com/a/7086364/744610 but keep getting error 500 iis, , in cmd can see 404 error regarding fav icon. detailed informaion 500 error detailed error information: module fastcgimodule notification executerequesthandler handler php-fastcgi error code 0x80070002 requested url http://localhost:32701/index.php physical path c:\myphpsite\index.php logon method anonymous logon user anonymous request tracing directory c:\users\user\documents\iisexpress\tracelogfiles\phptest i double checked @ physical path indeed correct. the cmd: request started: "get" http://localhost:32701/index.php request ended: http://localhost:32701/index.php http status 500.0 request started: "get" http://localhost:32701/favicon.ico request ended: http://localhost:32701/favicon.ico http status 404.0 request started: "get" http://lo

Date Intervals and MySQL -

hello! is possible exclude date intervals in mysql. let's say: have picked 2 dates start_date = "2013-04-02" and end_date = "2013-04-12" the table reservation holds 2 columns each item (items may not unique id's since many reservations possible single item): reserved_from , reserved_until (both type = date). assume first item reserved_from = "2013-04-05" and reserved_until = "2013-04-07 is possible select items not reserved between start date , end date ? multiple reservations , special cases ( reserved_from < "start_date" , etc. ) thank you! try: not between start_date , end_date it select items dates not present in between both.

java - How to filter salesforce case object using SQOP API based on parameters like ""Parent Case Product Discription" -

i trying list of cases opened , assigned engineering team , specific few products. i using soap api , trying first filter cases based on criteria s "parent case product description=some product", type=engineering escalation etc. , retrieving owner name, account name, case product version etc. "parent case product description" , type additional fields based on can filter cases salesforce gui. however not able filter cases based on above mentioned fields these not fields of case object. checked here http://www.salesforce.com/us/developer/docs/api/content/sforce_api_objects_case.htm i can access field(which not part of case object), e.g. account name field not there in case object retrieve using "case.account.name" in soql query. problem is, not find way access parameters "parent case product description=some product" , type=engineering escalation. i achieve below, select ... case "parent case product description" "some pr

building an object in javascript using properties from another object -

what trying create object has x number of properties in along y number of properties object retrieve calling method. possible do? ie here pseudo code. want mydata include properties object getmoredata() maybe not possible have no idea how if :( var mydata = { name: "joe soap", dob: "01-01-2001", otherdata: { hascat: true, hasdog : false } var otherdata = getmoredata(); for(var prop in otherdata) { create additional property in mydata prop; } } function getmoredata() { var moredata = { middlename: "tom", location: "uk" } return otherdata; } you can't declare variables or use other statements for in middle of object literal. need define basic object first, , add properties afterwards: var mydata = { name: "joe soap", dob: "01-01-2001", otherdata: { hascat: true, hasdog : false } };

javascript - How to target alternate odd/even text lines -

Image
say i've p element or div element having text 10-15 lines, client has weird call on this, needs odd/even lines having different text color. line 1 - black, line 2 should grey, line 3 should again black , on... so decided using span's , changed color variable resolution killing things here, aware of :first-line selector (which won't useful in case), selectors :odd & :even ruled out here not using tables, there way can achieve using css or need use jquery? tl; dr : want target odd/even lines in paragraph or div i need css solution, if not, jquery , javascript welcome demo 1 a rather ugly little solution, compounded fact it's 3:30 am. still, works on plain text blocks , allows each line individually styled. fiddle: http://jsfiddle.net/fptq2/2/ chrome 26, ff 20, safari 5.1.7, ie 8/9/10 (7 made functional) essentially it: splits source individual words once wraps each word in span (ugly effective- any style can applied span) uses

Visual studio 2010 professional errer -

i have intalled silverlight5_tools , can't more solution explorer , errer an exception occurred during construction of contents of frame. information can saved running application / log on command line, stores results in "c: \ users \ studio \ appdata \ roaming \ microsoft \ visualstudio \ 10.0 \ activitylog.xml." détails de l'exception : system.outofmemoryexception: not enough storage available complete operation. (exception de hresult : 0x8007000e (e_outofmemory)) à system.runtime.interopservices.marshal.throwexceptionforhrinternal(int32 errorcode, intptr errorinfo) à microsoft.visualstudio.platform.windowmanagement.windowframe.constructcontent()

python 2.7 - numpy 2D matrix- How to improve performance in this case? -

i came know numpy slow individual element accesses big matrix. following part of code takes 7-8 minutes run. size of matrix 3000*3000 import numpy np ................ ................ arraylength=len(coordinates) adjmatrix=np.zeros((len(angles),len(angles))) x in range(0, arraylength): y in range(x+1, arraylength-x): distance=distance(coordinates[x],coordinates[y) if(distance<=radius) adjmatrix[x][y]=distance adjmatrix[y][x]=distance i trying construct adjacency matrix graph consists of 3000 nodes. can me in doing numpy way? or alternatives? edit: here distance() function def distance(p1,p2): distance=np.sqrt(np.square(p1[0]-p2[0])+np.square(p1[1]-p2[1])) return distance by way passing coordinates tuples.. in p[0]=x-coordinate , p[1]= y- coordinate. can post distance() function? if it's common function, scipy.spatial.distance.cdist can calculate distance matrix quickly: htt

r - split a character vector every n words -

how can split single character vector of words list of vectors each vector in list contains number of words? for example: # reproducible data examp <- "before asking technical question e-mail, or in newsgroup, or on website chat board, following: try find answer searching archives of forum plan post to. try find answer searching web. try find answer reading manual. try find answer reading faq. try find answer inspection or experimentation. try find answer asking skilled friend. if you're programmer, try find answer reading source code. when ask question, display fact have done these things first; establish you're not being lazy sponge , wasting people's time. better yet, display have learned doing these things. answering questions people have demonstrated can learn answers. use tactics doing google search on text of whatever error message (searching google groups web pages). might take straight fix documentation or mailing list thread answering question. if