Posts

Showing posts from February, 2014

java - Which one is faster?(from CTCI book) -

i came across 2 code snippets in ctci book, code snippet 1: int min = integer.max_value; int max = integer.min_value; for(int x : array) { if (x < min) min = x; if (x > max) max = x; } code snippet 2: int min = integer.max_value; int max = integer.min_value; for(int x : array) { if (x < min) min = x; } for(int x : array) { if (x > max) max = x; } the book didnt gave clear cut answer on 1 faster , more efficient assembly level , compiler optimization perspective. believe both of have o(n) running time. first 1 has 1 loop expense of 2 conditional operations while second one, loops twice 1 conditional operation. to technically precise second run time o(2n) , first 1 o(n) since omit constants, both described o(n). let huge size of n, constant matter? 1 result in more optimized assembly code compiler perspective? edit: constants no matter large size of n, comparing 2 code snippets, 1 has constant of 2, , other 1 not, effect running time,

python - Multiprocessing for calculating eigen value -

i'm generating 100 random int matrices of size 1000x1000 . i'm using multiprocessing module calculate eigen values of 100 matrices. the code given below: import timeit import numpy np import multiprocessing mp def caleigen(): s, u = np.linalg.eigh(a) def multiprocess(processes): pool = mp.pool(processes=processes) #start timing here don't want include time taken initialize processes start = timeit.default_timer() results = [pool.apply_async(caleigen, args=())] stop = timeit.default_timer() print (processes":", stop - start) results = [p.get() p in results] results.sort() # sort results if __name__ == "__main__": global a=[] in range(0,100): a.append(np.random.randint(1,100,size=(1000,1000))) #print execution time without multiprocessing start = timeit.default_timer() caleigen() stop = timeit.default_timer() print stop - start #with 1 process multiprocess(1) #with 2 processes multiprocess(2) #with 3 processes

Bubble getting cut off in Chart.js -

Image
i'm having issue last bubble in chart cuts off. need way of extending chart entire circle displayed. i've tried adding value end, adjusting padding. nothing seems work. unfortunately, chart js documention on bubble charts severely lacking well. var randomscalingfactor = function() { return (math.random() > 0.5 ? 1.0 : -1.0) * math.round(math.random() * 100); }; var randomcolorfactor = function() { return math.round(math.random() * 255); }; var randomcolor = function() { return 'rgba(' + randomcolorfactor() + ',' + randomcolorfactor() + ',' + randomcolorfactor() + ',.7)'; }; var bubblechartdata = { animation: { duration: 10000 }, datasets: [{ label: "my first dataset", backgroundcolor: randomcolor(), data: [ { x: 10, y: 0, r: math.abs(randomscalingfactor()) / 5, }, { x: 20, y: 0, r: math.abs(randomscalingfactor()) / 5, }, { x:

c# - Json.Net Serialize Complex Object to Xml Attribute And Value -

let's have json object looks this: { "phones": [ { "phone": { "value": 123, "@type": "foo" } } ] } i want call jsonconvert.deserializexmlnode() resulting xml this: <phones> <phone type="foo">123</phone> </phones> currently value being deserialized xml element child of phone , want xml value of phone . there way using json.net, special operator tells deserialize such, without having create custom serializer? apppreciated. i figured out. using "phone": { "@type": "foo", "#text": 123 } gives me expected result. #text tells not create child element value.

java - Move a JDialog from outside the screen to a position in screen -

i'm trying create notifications system. i'm trying make jdialog thats moves outside screen specific position. i'm using timing framework , can move dialog position another, when try specify position outside screen dialog not that. this code: dialog.setlocation(new point(-dialog.getwidth(), 10)); should put dialog on right side outside screen not. i did try use notifications libraries as: jcommunique jtelegraph twinkle jcarrierpigeon but of libraries work needs.

android - How to add ListView to snackbar? -

Image
while playing youtube app noticed view appear when clicked button: is snackbar (white view @ bottom of screen) , if how customise normal snackbar it? these bottom sheets, modal bottom sheets. see documentation here: https://material.google.com/components/bottom-sheets.html?authuser=0#bottom-sheets-modal-bottom-sheets you'll need add linearlayout acts bottomsheet parent view of coordinatorlayout

What is safe method to perform `Object.assign` when using AngularJS? -

basically perform object.assign copy of data, without angularjs attached in past, attaches now, or may attach in future versions. sure can delete such property $$hashkey after assignment approach totally fragile, on other hand manually construct object fields want on other hand tiresome (and fragile if change definition of source object). is there solid in between? there no other properties $$hashkey , 1 of kind. all of angular object helpers are aware of property , remove @ end of operation . angular.extend direct angular counterpart of object.assign , should used instead.

bash - Is it possible to use perl/ajax to read a file line by line while the file is written by another program? -

it similar question being asked here how read file line line using ajax request while file written other program using java? have file populated command line outputs generated remote machine. every time gets written in file, want use perl (or javascript quite dubious it) capture , display being written in opened webpage. ideally each line should shown in html written in file way how generated in terminal. my difficulty not sure how should polling - detecting being written in file - , how can capture line @ real time. that being said, possibility have thought of change script on remote machine , dump terminal output div of website. avoid writing, reading , realtime polling not sure if possible? ignoring ajax second, perl program use file::tail . with ajax, you'd have reimplement file::tail. following basic version: #!/usr/bin/perl use strict; use warnings; use cgi qw( ); use fcntl qw( seek_set ); use text::csv_xs qw( decode_json encode_json )

r - Error in { : task 1 failed - "could not find function "knn"" -

i trying run parallel knn program on r error: error in { : task 1 failed - "could not find function "knn"" this program: library(class) library(dosnow) library(foreach) train <- read.csv('train.csv') test <- read.csv('test.csv') trainy <- read.csv('trainy.csv') cl <- as.vector(as.matrix(trainy)) system.time(summary(knn(train, test, cl, k=25, prob = true))) clus <- makecluster(4) registerdosnow(clus) countrows=nrow(test) system.time(foreach( icount(countrows) ) %dopar% { summary(knn(train, test, cl, k=25, prob = true)) }) stopcluster(clus) you need call library(class) on each of nodes. foreach makes easy via .packages argument. system.time(foreach( icount(countrows), .packages="class" ) %dopar% { summary(knn(train, test, cl, k=25, prob = true)) }) you might need export train , test , , cl . system.time( foreach( icount(countrows), .packages="class", .export=c

android - Different themes are required by activity and fragment for dialog box -

i trying create dialog box fragment(mainscreenfragment.java). there many fragments called mainactivity since using tab view here using holo theme mainactivity when try create alert box, error shows in fragment saying " java.lang.illegalstateexception: need use theme.appcompat theme (or descendant) activity." please tell me do! manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.coderahul.player"> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.read_external_storage" /> <uses-permission android:name="android.permission.write_external_storage" /> <application android:allowbackup="true" android:icon=&q

R coding: Function to write Approximate Bayesian Computation with Population Monte Carlo method -

i trying write function can calculate approximate bayesian computation using population monte carlo method. however, ran troubles r code following error. head(abc_pmc(2,5000,1,observeddata,observedsummary)) error in while (prior == 0) { : missing value true/false needed in addition: warning message: in log(importance.sample[2]) : nans produced the code doesn't have problem when run 1 iteration, t=1. issue lies second iteration , think assignment of importance.sammpling step. can't figure out error tried run code manually , works. any , appreciated. thanks! initialise variables: set.seed(12345) n=5000 weight = rep(1,n) theta = matrix(na, nrow = n, ncol = 2) (i in 1:n) { fit = c(runif(1,-2,2), runif(1,0,4)) theta[i,] = fit } #calculate importance density current t use in next iteration old.prop.weight = weight / sum(weight) old.theta = theta kernel.mean = cbind(old.theta[,1],old.theta[,2]) kernel.cov = cov(old.theta) main loop: (i

cmd - Windows command line to parse information from a text file -

i have text file contains, amongst other information, lines start 'password: ' . looking run command line command (if possible) parse through .txt file extract of terms follow 'password: ' , place them new textfile listing solely passwords. number of spaces between word 'password:' , actual password varies in entries. i have far used: findstr /l "password: " input_file.txt > output_file.txt this works extracts term 'password: ' too. research have carried out, don't believe command line has built-in function remove strings .txt files thinking run above command followed similar to:- findstr /l "password: " input_file.txt > output_file.txt & delstr "password: " output_file.txt > final_file.txt & del output_file.txt obviously have invented 'delstr' said, need there remove string 'password: ' each line. any suggestions? thanks in fact, there (very limited) built-in fun

xcode - Can't reference type in separate project -

i have class in project called infrastructure. public class myclass { public init() { } } the file class defined in in project's list of compiled sources , target compiles successfully. i've imported project name project's source file , referenced class. let s = myclass() i've added infrastructure project target link binary libraries list. xcode has no problem recognising myclass - adds code completion it. however compiler says, use of unresolved identifier 'myclass' what strange if remove initialiser myclass compiler see class says, 'myclass' cannot constructed because has no accessible initializers what wrong solution? i have tried cleaning projects , deleting of output files. the problem seems in project doing targeting. i'm able reference myclass different new project. i created new projects, proved possible, deleted projects, deleted generated files , compiled. i changed couple of opti

java - Convert string to lower case except all metacharacters -

i want convert a string (basically regex itself) lowercase want exclude metacharacters getting converted. e.g. : if string x = "[\\s\\s]*test message indicator: (.*)[\\s\\s]*"; x = x.tolowercase(); it convert capital s in \\s s change meaning of regex. i want avoid that. final regex should [\\s\\s]*test message indicator: (.*)[\\s\\s]* . is there way can easily? you can use placeholder (that know not in input string) swap in , out uppercase predefined character classes of regular expression. example, replace unicode values 00a0 , 00a1 , 00a2 \s , \d , , \w respectively (or whichever char values anticipate never see), lower case string, , back-replace special chars: string x = "[\\s\\s]*test message indicator: (.*)[\\s\\s]*"; x = x.replaceall("\\\\s", "\u00a0").replaceall("\\\\d","\u00a1").replaceall("\\\\w","\u00a2");; x = x.tolowercase(); x = x.replaceall("\u00a0"

haskell - What does [safe] marker mean in ghci? -

prelude data.void> :info void data void -- defined in `data.void' instance [safe] eq void -- defined in `data.void' instance [safe] ord void -- defined in `data.void' instance [safe] read void -- defined in `data.void' instance [safe] show void -- defined in `data.void' what [safe] mean? it means datatype defined in module defined using safe extension. can find details of extension in user guide . in fact, can test defining module using safe extension: {-#language safe#-} data test = test deriving (eq, show) and trying out in ghci : λ> :i test data test = test instance [safe] eq test instance [safe] show test but note in current ghc (7.10.2), safe extension cannot relied of trust guarantee because of this ghc bug .

c# - How to display item in .aspx page using if -

here want display list menu element based on if condition. here want to check if session["user_id"] empty or not . if empty display <li><a href="register.aspx">register</a></li> <li><a href="login.aspx">login</a></li> else display <li><a href="login.aspx">login</a></li> index.aspx <div class="navbar"> <ul> <li><a href="index.aspx">home</a></li> <li><a href="about.aspx">about us</a></li> <li><a href="feedback.aspx">feedback</a></li> <li><a href="rti.aspx">rti</a></li> <li><a href="faq.aspx">faq</a></li> <li><a href="contactus.aspx">contact us<

multithreading - Shared future setting different values with get -

i wanted know if shared_futures . have 2 threads receive reference promise. incase of thread returns output setting value in promise process output , return listening assignment promise remaining thread. can this. void ta(std::promise<string>& p ) { .... std::string r = "hello thread a"; p.set_value(std::move(r)); } void tb(std::promise<string>& p ) { ... std::string r = "hello thread a"; p.set_value(std::move(r)); } int main() { std::promise<std::string> inputpromise; std::shared_future<std::string> inputfuture(inputpromise.get_future()); //start thread std::thread t(std::bind(&ta,std::ref(inputpromise)); //start thread b std::thread t(std::bind(&ta,std::ref(inputpromise)); std::future<std::string> f(p.get_future()); std::string response = f.get(); ------> unblock when 1 thread sets value promise , can go listening more assignments on promise ? if(response=="b") response = f.get();

angular - How to create object as service member? -

i try access main template (app.tpl) properties of member object (appdriver) provided service (appdriverservice). problem... : during instantiation of appdriverservice, return of appdriver constructor undefined :/ here files, if me. appdriver.ts export class appdriver { public path: string; public content: string; constructor (){ this.path = ''; this.content = ''; } } appdriverservice.ts import {appdriver} 'app/appdriver.ts'; export class appdriverservice { public appdriver : appdriver; constructor(){ appdriver = new appdriver(); console.log(this.appdriver); // here problem // this.appdriver = undefined ?????? } public getappdriver(): appdriver { return this.appdriver; } } app.ts import {component, view, bootstrap, form_directives} 'angular2/angular2'; import {appdriverservice} 'app/services/appdriver-service.ts'; import {appdriver}

python 3.x - Dynamically created tablewidget -

i have function dynamically creates stackedwidget , adds new pages based on query. each page gets dynamically created tablewidget loaded before code loops again. stackedwidget controlled list filled @ same time each page created. point, works great having problem extracting data tablewidgets. @ end of loops there signal ui.tablewidget.cellchanged[int,int].connect(savelineitem) that used testing. function savelineitem print row & column whichever tablewidget clicked on, last line, print text, print last tablewidget created. signal recognizes current tablewidget. how can pass on savelineitem function? def savelineitem(row, col): print('row = ' + str(row)) print('column = ' + str(col)) ui = uidef.ui print(ui.tablewidget.item(row, col).text()) def loadinventory(ui): conn = sqlite3.connect('dblocal.sqlite') cur = conn.cursor() sql = "select inventory.inventory inventory desc

sql - select a "fake" column that is a range of specific numbers -

i need select table's a information along range of specific numbers, is, every a.id want show every number in range, using postgresql 8.4 . let's suppose range numbers 123, 175 , 192, result want: range a.id 123    1     175    1     192    1     123    2     175    2     192    2     123    3     175    3     192    3     i know can achieve using select range, a.id inner join generate_series(1, 100, 1) range on true but thing is, don't want use generate_series because range random numbers, there way it? maybe this: select range, a.id range in (123, 175, 192) group range, a.id; given comment: for every a.id want show every number of range this creates called cartesian product . here's 1 generic option using cross join union all : select a.id, r.rng cross join ( select 123 rng union select 234 union select 556 union select 653 union select 634) r sql fiddle demo

java - JPA entity mapping - linking the same entity -

i faced problem mapping same entity. entity represents tree node , assumes parent , child defined same entity: id-class @mappedsuperclass public class parentid { @id @generatedvalue(strategy = generationtype.auto) @column(name = "id") private long id; public void setid(long id) { this.id = id; } public long getid() { return id; } } entity-class @entity @table(name = "navigation_tree_node") public class navigationtreenode extends parentid { @column(name = "node_name") private string nodename; @column(name = "node_type") @enumerated(enumtype.ordinal) private nodetype nodetype; @manytoone(fetch = fetchtype.eager) @joincolumn(name = "entity_id") private navigationtreenode parent; @onetomany(mappedby = "parent") private list<navigationtreenode> children; public string getnodename() { return nodename; }

android - How to fake sms on Lollipop? -

here part of code, don't understand why doesn't work. have right permissions set in manifest too. enum box { inbox, sent } void addmessage(string address, string message, time sent, box b, boolean read) { uri u = null; switch (b) { case inbox: u = uri.parse("content://sms/inbox"); break; case sent: u = uri.parse("content://sms/sent"); break; } if (u != null) { cursor mcursor = this.getcontentresolver().query(u, null, null, null, null); contentproviderclient p = this.getcontentresolver() .acquirecontentproviderclient(u); contentvalues v = new contentvalues(); v.put("body", message); v.put("read", read); v.put("seen", true); v.put("address", address); v.put("date", sent.tomillis(false)); v.put("date_sent", sent.t

python - Wrong posts sequence at home page [Django app] -

at home-page i've got exhibited posts on blog, they're sorted incorrectly, oldest post newest(it has reversed). use querysets sort posts order published date in views.py def home(request): posts = post.objects.filter(published_date__lte=timezone.now()).order_by('published_date') return render(request, "home.html", {'posts': posts}) and that's home.html source code: {% extends "c:\myapp\blog\templates\base.html" %} {% block content %} {% post in posts %} <div class="post"> <div class="date"> {{ post.published_date }} </div> <h1><a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a></h1> <p>{{ post.text|linebreaksbr }}</p> </div> {% endfor %} {% endblock content %} could me in reverse these posts? in advance. you want add - string argument in order_by cause

python - How to convert Panda's columns into an index and a header when index column has duplicates -

i’d convert dataframe, df, similar one: pidm | course | grade 1 | mat1 | b 1 | phy2 | c 2 | mat1 | 2 | mat2 | b 2 | phe2 | to following format: pidm | mat1 | phy2 | mat2 | phy 2 1 | b | c | nan | nan 2 | | nan | b | i assuming like: df2 = df.pivot(index='pidm', columns=‘course’, values = ‘grade) but receive error stating have duplicate indices. thank help. you can use pivot_table aggregate function join : df2 = df.pivot_table(index='pidm', columns='course', values = 'grade', aggfunc=', '.join) print (df2) course mat1 mat2 phe2 phy2 pidm 1 b none none c 2 b none

Cant make JSON/PHP echo message appear using jQuery -

i'm trying make php echo messages show whenever users inputs either nothing @ or no numbers. ive been able make error messages show when doesnt input numbers onto text field. however cant make error message i've created in php show whenever clicks send button without inputing @ in text field. my php code: $resurs = array(); $fyll = $_get['inputfield']; $dg = 2; $nummer1 = $nummer1 * $dg; $fel = "fill in number"; $nummer2 = $nummer1 * $fill; $no = "field empty"; if (is_numeric($fyll)){ $resurs = array( "nummer1" => $nummer1. "<br>", "nummer2" => $nummer2. "<br>" ); echo json_encode($resurs); } else { $resurs = array ( "fel" => $fel. "<br>" ); echo json_encode ($resurs); } if (empty($fyll)){ $resurs = array ( "no" => $no. "<br>" ); echo json_encode ($resurs

android - I want to design login n sign up(register) page like shown in image pz give mi source code -

Image
please give me code design edit text box, button round corners, etc. shown in image. you can use xml drawable , use background first go drawable directory , create new drawable resource file , name myroundbutton copy code it <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <stroke android:color="#ff66cc" android:width="2dp"/> <corners android:radius="10dp"/> </shape> then add button background android:background="@drawable/myroundbutton" now can change corner radius changing android:radius="somevalue" and border color by android:color="#somecolor"

Python - Cut all words between two Strings -

could me cut strings between join , on keyword in addition first line using python 3? input data assigned variable input_txt= date_dim date_dim_all inner join main_fact_response on (date_dim_all.response_date = main_fact_response.response_date) left join dim_fore_main on (dim_fore_main.id = fact_fore_respond.id) left join fact_fore_resi on (fact_fore_resi.fore_re = fact_fore_respond.fore_re inner join fact_fore_respond fact_fore_respond_merit on ( fact_fore_respond_merit.fore_respond = fact_fore_r espond.fore_respond output data date_dim date_dim_all, main_fact_response, dim_fore_main, fact_fore_resi, fact_fore_respond fact_fore_respond_merit input_data = '''date_dim date_dim_all inner join main_fact_response on (date_dim_all.response_date = main_fact_response.response_date) left join dim_fore_main on (dim_fore_main.id = fact_fore_respond.id) left join fact_fore_resi on (fact_fore_resi.fore_re = fact_fore_res

c# - Strong-type new object after LINQ select statement -

this not critical concept me wondering if strong-type new object after linq select statement, rather make anonymous type, in c# . here sample, defunct of course speaks concept: public class displayaddress { public int addressid; public string shortaddress; } list<displayaddress> shortaddresses = (from la in longaddresses join ca in customeraddresses on la.addressid equals ca.addressid ca.customerid == selectedcustomer select new { new displayaddress() {addressid = la.addressid, shortaddress = la.line1 + " " + la.city + " " + la.state}}).tolist<displayaddress>(); absolutely, can use expression in select , including 1 creates new object of type defined. need removing outer new : select new displayaddress { addressid = la.addressid , shortaddress = la.line1 + " " + la.city + " " + la.state }).tolist(); note anonymous types typed well. in other words, if do select new { addressid = la.a

nameerror - Python: ' ' is not defined -

here code: # program makes robot calculate average amount of light in simulated room myro import * init("simulator") random import* def pressc(): """ wait "c" entered keyboard in python shell """ entry = " " while(entry != "c"): entry = raw_input("press c continue. ") print("thank you. ") print def randomposition(): """ gets robot drive random position """ result = randint(1, 2) if(result == 1): forward(random(), random()) if(result == 2): backward(random(), random()) def scan(): """ allows robot rotate , print numbers each light sensors obtains """ leftlightseries = [0,0,0,0,0,0] centerlightseries = [0,0,0,0,0,0] rightlightseries = [0,0,0,0,0,0] index in range(1,6): leftlight = getlight("left") leftlightseries[index] = lef

python - Slider with max value greater than 2147483647 in wxPython Phoenix? -

basically, wx.slider widget wxpython phoenix cannot go further 2147483647 . indeed, slider = wx.slider( parent = parent, value = 10, minvalue = 0, maxvalue = 2147483647 ) print slider.getmax() outputs : 2147483647 whereas, slider = wx.slider( parent = parent, value = 10, minvalue = 0, maxvalue = 2147483648 ) print slider.getmax() outputs : (program.py:5403): gtk-critical **: ia__gtk_range_set_range: assertion 'min < max' failed 0 i need use bigger values widget. workaround? have considered dividing values appropriate divisor. edit: there times when have pragmatic. cannot possibly display or use slider length of 2 billion. whether automatically generated or not, simpler make slider utilise values between 0% , 100%, can manipulate tooltip display value if essential accuracy of given position whe

Update Event with Google Calendar API Javascript -

how can update calendar events of google calendar api (v3) in javascript? can not find example. list, delete , add working fine me still not update function working. i tried example //this event data got, changed values, want changed in calendar api var changedeventdata; //changing data of calendar event $.ajax({ url: "https://www.googleapis.com/calendar/v3/calendars/" + calendarid + "/events/" + eventid, method: "put", data: changedeventdata }); from question: how update event in google calendar using javascript? but server responses 403 exception thanks in advance as discussed in events: update , updating of calendar events can done sending http request following format: put https://www.googleapis.com/calendar/v3/calendars/calendarid/events/eventid please note requires authorization added scope of access. for encountered 403 exception , other possible errors, suggested actions given in handle api errors .

github - Git for Windows - error 403 access denied when pushing -

the error: $ git push origin master remote: permission currentuser/repo.git denied olduser. fatal: unable access 'https://github.com/currentuser/repo.git/': requested url returned error: 403 $ git remote -v origin https://github.com/currentuser/repo.git (fetch) origin https://github.com/currentuser/repo.git (push) upstream https://github.com/upstreamuser/repo.git (fetch) upstream https://github.com/upsetreamuser/repo.git (push) $ git config user.name currentuser i'm on git windows (please don't shoot me it's not choice). olduser coming from??? can't find anywhere. i've done complete uninstall of git machine no avail. also i've read lot instructions , people recommended resetting keychain - isn't osx, can't find windows. thank you!

java - Is there a simple example of the new ANDROID M MIDI -

i trying read midi data in new android mushroom midi. attempting use new midi method. https://developer.android.com/reference/android/media/midi/package-summary.html android midi has example. contains spinners, context, wrappers , way complex first understanding from. has many java programs , 800 lines of code. want open device 0 , midi output port 2. is there simple example out there using classes m.opendevice , public void ondeviceopened(mididevice device)? searching first example runs in main , produces textview output. this seems simple midi sends 3 bits of data, key down, key number, , impact. after weeks of trying, can't seem work. here oneidi example of code below. contains 30 lines of code. want. // midi parameters out of midi transmitter public void midi_info() { midimanager m = (midimanager) getsystemservice(midi_service); //get system device information final midideviceinfo[] deviceinfo = m.getdevices(); //you

c# - How to modify List<> between two classes in unity? -

Image
in unity i'm making program allows click on cube , select spheres represent vertices shown below: once theses spheres selected added list selectedspheres of type gameobject . i've created 2 class files - cube.cs , vertex.cs . vertex inherits cube inherits monobehaviour . in cube have member list stores selected spheres. i have defined function addtoselected() adds input selectedspheres list. print statement inside function prints off true every single time. print statement in update() function prints argument out of range error shown below while addtoselected() has shown has worked 8 times: the addtoselected() function called onmousedown() function inside vertex class. code both classes shown below: cube.cs public class cube : monobehaviour { bool isselected = false; gameobject[] spheres; list<gameobject> selectedspheres = new list<gameobject>(); public void addtoselected(gameobject obj) { selectedspheres.add(

What are the best JVM settings for Eclipse? -

Image
what best jvm settings have found running eclipse? it time of year again: "eclipse.ini take 3" settings strike back! eclipse helios 3.6 , 3.6.x settings alt text http://www.eclipse.org/home/promotions/friends-helios/helios.png after settings eclipse ganymede 3.4.x , eclipse galileo 3.5.x , here in-depth @ "optimized" eclipse.ini settings file eclipse helios 3.6.x: based on runtime options , and using sun-oracle jvm 1.6u21 b7 , released july, 27th ( some sun proprietary options may involved ). ( by "optimized", mean able run full-fledge eclipse on our crappy workstation @ work, old p4 2002 2go ram , xpsp3. have tested same settings on windows7 ) eclipse.ini warning : non-windows platform, use sun proprietary option -xx:maxpermsize instead of eclipse proprietary option --launcher.xxmaxpermsize . is: unless using latest jdk6u21 build 7 . see oracle section below. -data ../../workspace -showlocation -showsplash org.e