Search Results

Search found 3425 results on 137 pages for 'polynomial math'.

Page 93/137 | < Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >

  • multipart file-upload post request from java

    - by Martin
    I'm trying to make a program that uploads a image to a webserver that accepts multipart file-uploads. More specificly i want to make a http POST request to http://iqs.me that sends a file in the variable "pic". I've made a lot of tries but i don't know if i've even been close. The hardest part seems to be to get a HttpURLConnection to make a request of the type POST. The response i get looks like it makes a GET. (And i want to do this without any third party libs) UPDATE: non-working code goes here (no errors but doesn't seem to do a POST): HttpURLConnection conn = null; BufferedReader br = null; DataOutputStream dos = null; DataInputStream inStream = null; InputStream is = null; OutputStream os = null; boolean ret = false; String StrMessage = ""; String exsistingFileName = "myScreenShot.png"; String lineEnd = "\r\n"; String twoHyphens = "--"; String boundary = "*****"; int bytesRead, bytesAvailable, bufferSize; byte[] buffer; int maxBufferSize = 1*1024*1024; String responseFromServer = ""; String urlString = "http://iqs.local.com/index.php"; try{ FileInputStream fileInputStream = new FileInputStream( new File(exsistingFileName) ); URL url = new URL(urlString); conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn.setDoOutput(true); conn.setRequestMethod("POST"); conn.setUseCaches(false); conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary); dos = new DataOutputStream( conn.getOutputStream() ); dos.writeBytes(twoHyphens + boundary + lineEnd); dos.writeBytes("Content-Disposition: form-data; name=\"pic\";" + " filename=\"" + exsistingFileName +"\"" + lineEnd); dos.writeBytes(lineEnd); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); buffer = new byte[bufferSize]; bytesRead = fileInputStream.read(buffer, 0, bufferSize); while (bytesRead > 0){ dos.write(buffer, 0, bufferSize); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); bytesRead = fileInputStream.read(buffer, 0, bufferSize); } dos.writeBytes(lineEnd); dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd); fileInputStream.close(); dos.flush(); dos.close(); }catch (MalformedURLException ex){ System.out.println("Error:"+ex); }catch (IOException ioe){ System.out.println("Error:"+ioe); } try{ inStream = new DataInputStream ( conn.getInputStream() ); String str; while (( str = inStream.readLine()) != null){ System.out.println(str); } inStream.close(); }catch (IOException ioex){ System.out.println("Error: "+ioex); }

    Read the article

  • Form loop db insertion + javascript altering

    - by MrStatic
    I basically need to check if there is an easier way to do this before I rewrite all the code. I have a fairly large form that I have each input named with []'s on the end so I can loop through via php for easy insertion. <input type="hidden" name="currentdate[]" value="<?php echo date('mdY'); ?>"> <td><input style="width: 50px" type="text" name="jackname[]" /></td> <td><input style="width: 20px" type="text" name="jackkey[]" /></td> <td><input style="width: 50px" type="text" name="jackbeg[]" /></td> <td><input style="width: 50px" type="text" name="jackend[]" /></td> <td><input style="width: 50px" type="text" name="jackbegveh" /></td> <td><input style="width: 50px" type="text" name="jackbegmon[]" /></td> <td><input style="width: 50px" type="text" name="jackendveh" /></td> <td><input style="width: 50px" type="text" name="jackendmon[]" /></td> <td><input style="width: 50px" type="text" name="jacktx" disabled /></td> There are quite a few more fields but you get the idea. I then use foreach ($_POST['jackname'] as $row=>$name) { $jackname = $name; $date = $_POST['currentdate'][$row]; $jackkey = $_POST['jackkey'][$row]; $jackbeg = $_POST['jackbeg'][$row]; $jackend = $_POST['jackend'][$row]; $jackbegveh = $_POST['jackbegveh'][$row]; $jackbegmon = $_POST['jackbegmon'][$row]; $jackendveh = $_POST['jackendveh'][$row]; $jackendmon = $_POST['jackendmon'][$row]; $jacktx = $_POST['jacktx'][$row]; if ($jacktx == '') { $jacktx = '0'; } if (empty($jackkey)) { echo 'Skipped empty! <br />'; } else { mysql_query("INSERT INTO `ticket_counts_jackson` VALUES('', '" . $date . "', '" . $jackname . "', '" . $jackkey . "', '" . $jackbeg . "', '" . $jackend . "', '" . $jackbegveh . "', '" . $jackbegmon . "', '" . $jackendveh . "', '" . $jackendmon . "', '" . $jacktx . "')", $mysql_link) or die(mysql_error()); echo 'Added the info the db! <br />'; } } I use the above to loop through the form and add it to the database. Now for my main question. I also want to add in some javascript to do a little math. Basically ($jackendveh - $jackbegveh) - ($jackendmon - $jackbegmon) and have that displayed in jacktx. Currently the only way I know of adding in the math calculations is to rename each input to a unique name and then rewrite my insert from 1 insert to 8 inserts.

    Read the article

  • Javascript phsyics in a 2d space

    - by eroo
    So, I am working on teaching myself Canvas (HTML5) and have most of a simple game engine coded up. It is a 2d representation of a space scene (planets, stars, celestial bodies, etc). My default "Sprite" class has a frame listener like such: "baseClass" contains a function that allows inheritance and applies "a" to "this.a". So, "var aTest = new Sprite({foo: 'bar'});" would make "aTest.foo = 'bar'". This is how I expose my objects to each other. { Sprite = baseClass.extend({ init: function(a){ baseClass.init(this, a); this.fields = new Array(); // list of fields of gravity one is in. Not sure if this is a good idea. this.addFL(function(tick){ // this will change to be independent of framerate soon. // and this is where I need help // gobjs is an array of all the Sprite objects in the "world". for(i = 0; i < gobjs.length; i++){ // Make sure its got setup correctly, make sure it -wants- gravity, and make sure it's not -this- sprite. if(typeof(gobjs[i].a) != undefined && !gobjs[i].a.ignoreGravity && gobjs[i].id != this.id){ // Check if it's within a certain range (obviously, gravity doesn't work this way... But I plan on having a large "space" area, // And I can't very well have all objects accounted for at all times, can I? if(this.distanceTo(gobjs[i]) < this.s.size*10 && gobjs[i].fields.indexOf(this.id) == -1){ gobjs[i].fields.push(this.id); } } } for(i = 0; i < this.fields.length; i++){ distance = this.distanceTo(gobjs[this.fields[i]]); angletosun = this.angleTo(gobjs[this.fields[i]])*(180/Math.PI); // .angleTo works very well, returning the angle in radians, which I convert to degrees here. // I have no idea what should happen here, although through trial and error (and attempting to read Maths papers on gravity (eeeeek!)), this sort of mimics gravity. // angle is its orientation, currently I assign a constant velocity to one of my objects, and leave the other static (it ignores gravity, but still emits it). this.a.angle = angletosun+(75+(distance*-1)/5); //todo: omg learn math if(this.distanceTo(gobjs[this.fields[i]]) > gobjs[this.fields[i]].a.size*10) this.fields.splice(i); // out of range, stop effecting. } }); } }); } Thanks in advance. The real trick is that one line: { this.a.angle = angletosun+(75+(distance*-1)/5); } This is more a physics question than Javascript, but I've searched and searched and read way to many wiki articles on orbital mathematics. It gets over my head very quickly. Edit: There is a weirdness with the SO formatting; forgives me, I is noobie.

    Read the article

  • how to speed up the code??

    - by kaushik
    i have very huge code about 600 lines plus. cant post the whole thing here. but a particular code snippet is taking so much time,leading to problems. here i post that part of code please tell me what to do speed up the processing.. please suggest the part which may be the reason and measure to improve them if this small part of code is understandable. using_data={} def join_cost(a , b): global using_data #print a #print b save_a=[] save_b=[] print 1 #for i in range(len(m)): #if str(m[i][0])==str(a): save_a=database_index[a] #for i in range(len(m)): # if str(m[i][0])==str(b): #print 'save_a',save_a #print 'save_b',save_b print 2 save_b=database_index[b] using_data[save_a[0]]=save_a s=str(save_a[1]).replace('phone','text') s=str(s)+'.pm' p=os.path.join("c:/begpython/wavnk/",s) x=open(p , 'r') print 3 for i in range(6): x.readline() k2='a' j=0 o=[] while k2 is not '': k2=x.readline() k2=k2.rstrip('\n') oj=k2.split(' ') o=o+[oj] #print o[j] j=j+1 #print j #print o[2][0] temp=long(1232332) end_time=save_a[4] #print end_time k=(j-1) for i in range(k): diff=float(o[i][0])-float(end_time) if diff<0: diff=diff*(-1) if temp>diff: temp=diff pm_row=i #print pm_row #print temp #print o[pm_row] #pm_row=3 q=[] print 4 l=str(p).replace('.pm','.mcep') z=open(l ,'r') for i in range(pm_row): z.readline() k3=z.readline() k3=k3.rstrip('\n') q=k3.split(' ') #print q print 5 s=str(save_b[1]).replace('phone','text') s=str(s)+'.pm' p=os.path.join("c:/begpython/wavnk/",s) x=open(p , 'r') for i in range(6): x.readline() k2='a' j=0 o=[] while k2 is not '': k2=x.readline() k2=k2.rstrip('\n') oj=k2.split(' ') o=o+[oj] #print o[j] j=j+1 #print j #print o[2][0] temp=long(1232332) strt_time=save_b[3] #print strt_time k=(j-1) for i in range(k): diff=float(o[i][0])-float(strt_time) if diff<0: diff=diff*(-1) if temp>diff: temp=diff pm_row=i #print pm_row #print temp #print o[pm_row] #pm_row=3 w=[] l=str(p).replace('.pm','.mcep') z=open(l ,'r') for i in range(pm_row): z.readline() k3=z.readline() k3=k3.rstrip('\n') w=k3.split(' ') #print w cost=0 for i in range(12): #print q[i] #print w[i] h=float(q[i])-float(w[i]) cost=cost+math.pow(h,2) j_cost=math.sqrt(cost) #print cost return j_cost def target_cost(a , b): a=(b+1)*3 b=(a+1)*2 t_cost=(a+b)*5/2 return t_cost r1='shht:ra_77' r2='grx_18' g=[] nodes=[] nodes=nodes+[[r1]] for i in range(len(y_in_db_format)): g=y_in_db_format[i] #print g #print g[0] g.remove(str(g[0])) nodes=nodes+[g] nodes=nodes+[[r2]] print nodes print "lenght of nodes",len(nodes) lists=[] #lists=lists+[r1] for i in range(len(nodes)): for j in range(len(nodes[i])): lists=lists+[nodes[i][j]] #lists=lists+[r2] print lists distance={} for i in range(len(lists)): if i==0: distance[str(lists[i])]=0 else: distance[str(lists[i])]=long(123231223) #print distance group_dist=[] infinity=long(123232323) for i in range(len(nodes)): distances=[] for j in range(len(nodes[i])): #distances=[] if i==0: distances=distances+[[nodes[i][j], 0]] else: distances=distances+[[nodes[i][j],infinity]] group_dist=group_dist+[distances] #print distances print "group_distances",group_dist #print "check",group_dist[0][0][1] #costs={} #for i in range(len(lists)): #if i==0: # costs[str(lists[i])]=1 #else: # costs[str(lists[i])]=get_selfcost(lists[i]) path=[] for i in range(len(nodes)): mini=[] if i!=(len(nodes)-1): #temp=long(123234324) #Now calculate the cost between the current node and each of its neighbour for k in range(len(nodes[(i+1)])): for j in range(len(nodes[i])): current=nodes[i][j] #print "current_node",current j_distance=join_cost( current , nodes[i+1][k]) #t_distance=target_cost( current , nodes[i+1][k]) t_distance=34 #print distance #print "distance between current and neighbours",distance total_distance=(.5*(float(group_dist[i][j][1])+float(j_distance))+.5*(float(t_distance))) #print "total distance between the intial_nodes and current neighbour",total_distance if int(group_dist[i+1][k][1]) > int(total_distance): group_dist[i+1][k][1]=total_distance #print "updated distance",group_dist[i+1][k][1] a=current #print "the neighbour",nodes[i+1][k],"updated the value",a mini=mini+[[str(nodes[i+1][k]),a]] print mini

    Read the article

  • How to determine edges in an images optimally?

    - by SorinA.
    I recently was put in front of the problem of cropping and resizing images. I needed to crop the 'main content' of an image for example if i had an image similar to this: the result should be an image with the msn content without the white margins(left& right). I search on the X axis for the first and last color change and on the Y axis the same thing. The problem is that traversing the image line by line takes a while..for an image that is 2000x1600px it takes up to 2 seconds to return the CropRect = x1,y1,x2,y2 data. I tried to make for each coordinate a traversal and stop on the first value found but it didn't work in all test cases..sometimes the returned data wasn't the expected one and the duration of the operations was similar.. Any idea how to cut down the traversal time and discovery of the rectangle round the 'main content'? public static CropRect EdgeDetection(Bitmap Image, float Threshold) { CropRect cropRectangle = new CropRect(); int lowestX = 0; int lowestY = 0; int largestX = 0; int largestY = 0; lowestX = Image.Width; lowestY = Image.Height; //find the lowest X bound; for (int y = 0; y < Image.Height - 1; ++y) { for (int x = 0; x < Image.Width - 1; ++x) { Color currentColor = Image.GetPixel(x, y); Color tempXcolor = Image.GetPixel(x + 1, y); Color tempYColor = Image.GetPixel(x, y + 1); if ((Math.Sqrt(((currentColor.R - tempXcolor.R) * (currentColor.R - tempXcolor.R)) + ((currentColor.G - tempXcolor.G) * (currentColor.G - tempXcolor.G)) + ((currentColor.B - tempXcolor.B) * (currentColor.B - tempXcolor.B))) > Threshold)) { if (lowestX > x) lowestX = x; if (largestX < x) largestX = x; } if ((Math.Sqrt(((currentColor.R - tempYColor.R) * (currentColor.R - tempYColor.R)) + ((currentColor.G - tempYColor.G) * (currentColor.G - tempYColor.G)) + ((currentColor.B - tempYColor.B) * (currentColor.B - tempYColor.B))) > Threshold)) { if (lowestY > y) lowestY = y; if (largestY < y) largestY = y; } } } if (lowestX < Image.Width / 4) cropRectangle.X = lowestX - 3 > 0 ? lowestX - 3 : 0; else cropRectangle.X = 0; if (lowestY < Image.Height / 4) cropRectangle.Y = lowestY - 3 > 0 ? lowestY - 3 : 0; else cropRectangle.Y = 0; cropRectangle.Width = largestX - lowestX + 8 > Image.Width ? Image.Width : largestX - lowestX + 8; cropRectangle.Height = largestY + 8 > Image.Height ? Image.Height - lowestY : largestY - lowestY + 8; return cropRectangle; } }

    Read the article

  • Slow Javascript touch events on Android

    - by oneself
    I'm trying to write a simple html based drawing application (standalone simplified code attached bellow). I've tested this on the following devices: iPad 1 and 2: Works great ASUS T101 running Windows: Works great Samsung Galaxy Tab: Extremely slow and patchy -- unusable. Lenovo IdeaPad K1: Extremely slow and patchy -- unusable. Asus Transformer Prime: Noticeable lag compare with the iPad -- close to usable. The Asus tablet is running ICS, the other android tablets are running 3.1 and 3.2. I tested using the stock Android browser. I also tried the Android Chrome Beta, but that was even worse. My questions is why are the Android tablets so slow? Am I doing something wrong or is it an inherit problem with Android OS or browser, or is there anything I can do about it in my code? multi.html: <html> <body> <style media="screen"> canvas { border: 1px solid #CCC; } </style> <canvas style="" id="draw" height="450" width="922"></canvas> <script class="jsbin" src="jquery.js"></script> <script src="multi.js"></script> </body> </html> multi.js: var CanvasDrawr = function(options) { // grab canvas element var canvas = document.getElementById(options.id), ctxt = canvas.getContext("2d"); canvas.style.width = '100%' canvas.width = canvas.offsetWidth; canvas.style.width = ''; // set props from options, but the defaults are for the cool kids ctxt.lineWidth = options.size || Math.ceil(Math.random() * 35); ctxt.lineCap = options.lineCap || "round"; ctxt.pX = undefined; ctxt.pY = undefined; var lines = [,,]; var offset = $(canvas).offset(); var eventCount = 0; var self = { // Bind click events init: function() { // Set pX and pY from first click canvas.addEventListener('touchstart', self.preDraw, false); canvas.addEventListener('touchmove', self.draw, false); }, preDraw: function(event) { $.each(event.touches, function(i, touch) { var id = touch.identifier; lines[id] = { x : this.pageX - offset.left, y : this.pageY - offset.top, color : 'black' }; }); event.preventDefault(); }, draw: function(event) { var e = event, hmm = {}; eventCount += 1; $.each(event.touches, function(i, touch) { var id = touch.identifier, moveX = this.pageX - offset.left - lines[id].x, moveY = this.pageY - offset.top - lines[id].y; var ret = self.move(id, moveX, moveY); lines[id].x = ret.x; lines[id].y = ret.y; }); event.preventDefault(); }, move: function(i, changeX, changeY) { ctxt.strokeStyle = lines[i].color; ctxt.beginPath(); ctxt.moveTo(lines[i].x, lines[i].y); ctxt.lineTo(lines[i].x + changeX, lines[i].y + changeY); ctxt.stroke(); ctxt.closePath(); return { x: lines[i].x + changeX, y: lines[i].y + changeY }; }, }; return self.init(); }; $(function(){ var drawr = new CanvasDrawr({ id: "draw", size: 5 }); });

    Read the article

  • How to upload Image on Android?

    - by Mattiah85
    I havve to upload image from my SD card to PHP server. I have read a lot of articles and topics but I have some problems... First I have use that code: HttpURLConnection connection = null; DataOutputStream outputStream = null; //DataInputStream inputStream = null; String urlServer = hostName+"Upload"; String lineEnd = "\r\n"; String twoHyphens = "--"; String boundary = "*****"; String serverResponseMessage; //int serverResponseCode; int bytesRead, bytesAvailable, bufferSize; byte[] buffer; int maxBufferSize = 1*1024*1024; try { showLog("uploading file: " + file); FileInputStream fileInputStream = new FileInputStream(new File(pictureFileDir+"/"+file) ); URL url = new URL(urlServer); connection = (HttpURLConnection) url.openConnection(); // Allow Inputs &amp; Outputs. connection.setDoInput(true); connection.setDoOutput(true); connection.setUseCaches(false); // Set HTTP method to POST. connection.setRequestMethod("POST"); connection.setRequestProperty("Connection", "Keep-Alive"); connection.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary); outputStream = new DataOutputStream( connection.getOutputStream() ); outputStream.writeBytes(twoHyphens + boundary + lineEnd); outputStream.writeBytes("Content-Disposition: form-data; name=\"uploaded_file\";filename=\"" + file +"\"" + lineEnd); outputStream.writeBytes(lineEnd); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); buffer = new byte[bufferSize]; // Read file bytesRead = fileInputStream.read(buffer, 0, bufferSize); while (bytesRead > 0) { outputStream.write(buffer, 0, bufferSize); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); bytesRead = fileInputStream.read(buffer, 0, bufferSize); } outputStream.writeBytes(lineEnd); outputStream.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd); // Responses from the server (code and message) //serverResponseCode = connection.getResponseCode(); serverResponseMessage = connection.getResponseMessage(); showLog("server response: " + serverResponseMessage); fileInputStream.close(); outputStream.flush(); outputStream.close(); } catch (Exception ex) { ex.printStackTrace(); } but server response 200/OK and no file was on destination server... After i have read about Multipart: try { HttpParams params = new BasicHttpParams(); params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); DefaultHttpClient mHttpClient = new DefaultHttpClient(params); File image = new File(pictureFileDir + "/" + filename); HttpPost httppost = new HttpPost(hostName+"Upload"); MultipartEntity multipartEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); multipartEntity.addPart("Image", new FileBody(image)); httppost.setEntity(multipartEntity); mHttpClient.execute(httppost, new PhotoUploadResponseHandler()); } catch (Exception e) { e.printStackTrace(); } but then a i have such LOG in LogCat and nothing else... 06-04 06:50:52.277: D/dalvikvm(1584): DexOpt: couldn't find static field Lorg/apache/http/message/BasicHeaderValueParser;.INSTANCE 06-04 06:50:52.277: W/dalvikvm(1584): VFY: unable to resolve static field 6688 (INSTANCE) in Lorg/apache/http/message/BasicHeaderValueParser; 06-04 06:50:52.277: D/dalvikvm(1584): VFY: replacing opcode 0x62 at 0x001b ServerSide Script: $target_path = "uploads"; $target_path = $target_path . basename( $_FILES['Image']); if(move_uploaded_file($_FILES['tmp_name'], $file_path)) { echo "success"; } else{ echo "fail"; } why? What is the simplest way to upload image?

    Read the article

  • How to determine edges in an image optimally?

    - by SorinA.
    I recently was put in front of the problem of cropping and resizing images. I needed to crop the 'main content' of an image for example if i had an image similar to this: the result should be an image with the msn content without the white margins(left& right). I search on the X axis for the first and last color change and on the Y axis the same thing. The problem is that traversing the image line by line takes a while..for an image that is 2000x1600px it takes up to 2 seconds to return the CropRect = x1,y1,x2,y2 data. I tried to make for each coordinate a traversal and stop on the first value found but it didn't work in all test cases..sometimes the returned data wasn't the expected one and the duration of the operations was similar.. Any idea how to cut down the traversal time and discovery of the rectangle round the 'main content'? public static CropRect EdgeDetection(Bitmap Image, float Threshold) { CropRect cropRectangle = new CropRect(); int lowestX = 0; int lowestY = 0; int largestX = 0; int largestY = 0; lowestX = Image.Width; lowestY = Image.Height; //find the lowest X bound; for (int y = 0; y < Image.Height - 1; ++y) { for (int x = 0; x < Image.Width - 1; ++x) { Color currentColor = Image.GetPixel(x, y); Color tempXcolor = Image.GetPixel(x + 1, y); Color tempYColor = Image.GetPixel(x, y + 1); if ((Math.Sqrt(((currentColor.R - tempXcolor.R) * (currentColor.R - tempXcolor.R)) + ((currentColor.G - tempXcolor.G) * (currentColor.G - tempXcolor.G)) + ((currentColor.B - tempXcolor.B) * (currentColor.B - tempXcolor.B))) > Threshold)) { if (lowestX > x) lowestX = x; if (largestX < x) largestX = x; } if ((Math.Sqrt(((currentColor.R - tempYColor.R) * (currentColor.R - tempYColor.R)) + ((currentColor.G - tempYColor.G) * (currentColor.G - tempYColor.G)) + ((currentColor.B - tempYColor.B) * (currentColor.B - tempYColor.B))) > Threshold)) { if (lowestY > y) lowestY = y; if (largestY < y) largestY = y; } } } if (lowestX < Image.Width / 4) cropRectangle.X = lowestX - 3 > 0 ? lowestX - 3 : 0; else cropRectangle.X = 0; if (lowestY < Image.Height / 4) cropRectangle.Y = lowestY - 3 > 0 ? lowestY - 3 : 0; else cropRectangle.Y = 0; cropRectangle.Width = largestX - lowestX + 8 > Image.Width ? Image.Width : largestX - lowestX + 8; cropRectangle.Height = largestY + 8 > Image.Height ? Image.Height - lowestY : largestY - lowestY + 8; return cropRectangle; } }

    Read the article

  • Need a hand understanding this Java code please :-)

    - by Brian
    Hi all, Just wondering if anyone would be able to take a look at this code for implementing the quicksort algorithm and answer me a few questions, please :-) public class Run { /*************************************************************************** * Quicksort code from Sedgewick 7.1, 7.2. **************************************************************************/ public static void quicksort(double[] a) { //shuffle(a); // to guard against worst-case quicksort(a, 0, a.length - 1, 0); } static void quicksort(final double[] a, final int left, final int right, final int tdepth) { if (right <= left) return; final int i = partition(a, left, right); if ((tdepth < 4) && ((i - left) > 1000)) { final Thread t = new Thread() { public void run() { quicksort(a, left, i - 1, tdepth + 1); } }; t.start(); quicksort(a, i + 1, right, tdepth + 1); try { t.join(); } catch (InterruptedException e) { throw new RuntimeException("Cancelled", e); } } else { quicksort(a, left, i - 1, tdepth); quicksort(a, i + 1, right, tdepth); } } // partition a[left] to a[right], assumes left < right private static int partition(double[] a, int left, int right) { int i = left - 1; int j = right; while (true) { while (less(a[++i], a[right])) // find item on left to swap ; // a[right] acts as sentinel while (less(a[right], a[--j])) // find item on right to swap if (j == left) break; // don't go out-of-bounds if (i >= j) break; // check if pointers cross exch(a, i, j); // swap two elements into place } exch(a, i, right); // swap with partition element return i; } // is x < y ? private static boolean less(double x, double y) { return (x < y); } // exchange a[i] and a[j] private static void exch(double[] a, int i, int j) { double swap = a[i]; a[i] = a[j]; a[j] = swap; } // shuffle the array a[] private static void shuffle(double[] a) { int N = a.length; for (int i = 0; i < N; i++) { int r = i + (int) (Math.random() * (N - i)); // between i and N-1 exch(a, i, r); } } // test client public static void main(String[] args) { int N = 5000000; // Integer.parseInt(args[0]); // generate N random real numbers between 0 and 1 long start = System.currentTimeMillis(); double[] a = new double[N]; for (int i = 0; i < N; i++) a[i] = Math.random(); long stop = System.currentTimeMillis(); double elapsed = (stop - start) / 1000.0; System.out.println("Generating input: " + elapsed + " seconds"); // sort them start = System.currentTimeMillis(); quicksort(a); stop = System.currentTimeMillis(); elapsed = (stop - start) / 1000.0; System.out.println("Quicksort: " + elapsed + " seconds"); } } My questions are: What is the purpose of the variable tdepth? Is this considered a "proper" implementation of a parallel quicksort? I ask becuase it doesn't use implements Runnable or extends Thread... If it doesn't already, is it possible to modify this code to use multiple threads? By passing in the number of threads you want to use as a parameter, for example...? Many thanks, Brian

    Read the article

  • Fastest way to pad a number in Java to a certain number of digits

    - by Martin
    Am trying to create a well-optimised bit of code to create number of X-digits in length (where X is read from a runtime properties file), based on a DB-generated sequence number (Y), which is then used a folder-name when saving a file. I've come up with three ideas so far, the fastest of which is the last one, but I'd appreciate any advice people may have on this... 1) Instantiate a StringBuilder with initial capacity X. Append Y. While length < X, insert a zero at pos zero. 2) Instantiate a StringBuilder with initial capacity X. While length < X, append a zero. Create a DecimalFormat based on StringBuilder value, and then format the number when it's needed. 3) Create a new int of Math.pow( 10, X ) and add Y. Use String.valueOf() on the new number and then substring(1) it. The second one can obviously be split into outside-loop and inside-loop sections. So, any tips? Using a for-loop of 10,000 iterations, I'm getting similar timings from the first two, and the third method is approximately ten-times faster. Does this seem correct? Full test-method code below... // Setup test variables int numDigits = 9; int testNumber = 724; int numIterations = 10000; String folderHolder = null; DecimalFormat outputFormat = new DecimalFormat( "#,##0" ); // StringBuilder test long before = System.nanoTime(); for ( int i = 0; i < numIterations; i++ ) { StringBuilder sb = new StringBuilder( numDigits ); sb.append( testNumber ); while ( sb.length() < numDigits ) { sb.insert( 0, 0 ); } folderHolder = sb.toString(); } long after = System.nanoTime(); System.out.println( "01: " + outputFormat.format( after - before ) + " nanoseconds" ); System.out.println( "Sanity check: Folder = \"" + folderHolder + "\"" ); // DecimalFormat test before = System.nanoTime(); StringBuilder sb = new StringBuilder( numDigits ); while ( sb.length() < numDigits ) { sb.append( 0 ); } DecimalFormat formatter = new DecimalFormat( sb.toString() ); for ( int i = 0; i < numIterations; i++ ) { folderHolder = formatter.format( testNumber ); } after = System.nanoTime(); System.out.println( "02: " + outputFormat.format( after - before ) + " nanoseconds" ); System.out.println( "Sanity check: Folder = \"" + folderHolder + "\"" ); // Substring test before = System.nanoTime(); int baseNum = (int)Math.pow( 10, numDigits ); for ( int i = 0; i < numIterations; i++ ) { int newNum = baseNum + testNumber; folderHolder = String.valueOf( newNum ).substring( 1 ); } after = System.nanoTime(); System.out.println( "03: " + outputFormat.format( after - before ) + " nanoseconds" ); System.out.println( "Sanity check: Folder = \"" + folderHolder + "\"" );

    Read the article

  • Flash Mouse.hide() cmd+tab(alt+tab) bring the mouse back

    - by DickieBoy
    Having a bit of trouble with Mouse.show() and losing focus of the swf This isn't my demo: but its showing the same bug http://www.foundation-flash.com/tutorials/as3customcursors/ What i do to recreate it is: mouse over the swf, hit cmd+tab to highlight another window, result is that the mouse is not brought back and is still invisible, (to get it back go to the window bar at the top of the screen and click something). I have an area in which movement is detected and an image Things I have tried package { import flash.display.Sprite; import flash.display.MovieClip; import com.greensock.*; import flash.events.*; import flash.utils.Timer; import flash.events.TimerEvent; import flash.utils.*; import flash.ui.Mouse; public class mousey_movey extends MovieClip { public var middle_of_the_flash; //pixels per second public var speeds = [0,1,3,5,10]; public var speed; public var percentage_the_mouse_is_across_the_screen; public var mouse_over_scrollable_area:Boolean; public var image_move_interval; public function mousey_movey() { middle_of_the_flash = stage.stageWidth/2; hot_area_for_movement.addEventListener(MouseEvent.MOUSE_OVER, mouseEnter); hot_area_for_movement.addEventListener(MouseEvent.MOUSE_OUT, mouseLeave); hot_area_for_movement.addEventListener(MouseEvent.MOUSE_MOVE, mouseMove); stage.addEventListener(Event.MOUSE_LEAVE, show_mouse); stage.addEventListener(MouseEvent.MOUSE_OUT, show_mouse); stage.addEventListener(Event.DEACTIVATE,show_mouse); hot_area_for_movement.alpha=0; hot_area_for_movement.x=0; hot_area_for_movement.y=34; } public function show_mouse(e) { trace(e.type) trace('show_mouse') Mouse.show(); } public function onActivate(e) { trace('activate'); Mouse.show(); } public function onDeactivate(e) { trace('deactivate'); } public function get_speed(percantage_from_middle):int { if(percantage_from_middle > 80) { return speeds[4] } else { if(percantage_from_middle > 60) { return speeds[3] } else { if(percantage_from_middle > 40) { return speeds[2] } else { if(percantage_from_middle > 20) { return speeds[1] } else { return 0; } } } } } public function mouseLeave(e:Event):void{ Mouse.show(); clearInterval(image_move_interval); } public function mouseEnter(e:Event):void{ Mouse.hide(); image_move_interval = setInterval(moveImage,1); } public function mouseMove(e:Event):void { percentage_the_mouse_is_across_the_screen = Math.round(((middle_of_the_flash-stage.mouseX)/middle_of_the_flash)*100); speed = get_speed(Math.abs(percentage_the_mouse_is_across_the_screen)); airplane_icon.x = stage.mouseX; airplane_icon.y = stage.mouseY; } public function stageMouseMove(e:Event):void{ Mouse.show(); } public function moveImage():void { if(percentage_the_mouse_is_across_the_screen > 0) { moving_image.x+=speed; airplane_icon.scaleX = -1; } else { moving_image.x-=speed; airplane_icon.scaleX = 1; } } } } Nothing too fancy, im just scrolling an image left of right at a speed which is generated by how far you are from the middle of the stage, and making an airplane moveclip follow the mouse. The events: stage.addEventListener(Event.MOUSE_LEAVE, show_mouse); stage.addEventListener(MouseEvent.MOUSE_OUT, show_mouse); stage.addEventListener(Event.DEACTIVATE,show_mouse); All fire and work correctly when in the browser, seem a little buggy when running a test through flash, was expecting this as ive experienced it before. The deactivate call even runs when testing and cmd+tabbing but shows no mouse. Any help on the matter is appreciated Thanks, Dickie

    Read the article

  • Photo inside the image view should not go cross on dragging

    - by TGMCians
    I want photo inside the imageview should not go outside on dragging. In my code when i start to drag bitmap inside the imageview its goes out from imageview but i want when it cross the imageview its should come at starting point of imageview. How to achieve this. please help me for this. @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.save(); scaleCount=scaleCount+scale; angleCount = addAngle(angleCount, Math.toDegrees(angle)); Log.v("Positions", "X: "+x+" " + "Y: "+y); Log.d("ScaleCount", String.valueOf(scaleCount)); Log.d("Angle", String.valueOf(angleCount)); if (!isInitialized) { int w = getWidth(); int h = getHeight(); position.set(w / 2, h / 2); isInitialized = true; } Paint paint = new Paint(); Log.v("Height and Width", "Height: "+ getHeight() + "Width: "+ getWidth()); transform.reset(); transform.postTranslate(-width / 2.0f, -height / 2.0f); transform.postRotate((float) Math.toDegrees(angle)); transform.postScale(scale, scale); transform.postTranslate(position.getX(), position.getY()); canvas.drawBitmap(bitmap, transform, paint); canvas.restore(); BitmapWidth=BitmapWidth+bitmap.getScaledWidth(canvas); BitmapHeight=BitmapHeight+bitmap.getScaledHeight(canvas); try { /*paint.setColor(0xFF007F00); canvas.drawCircle(vca.getX(), vca.getY(), 30, paint); paint.setColor(0xFF7F0000); canvas.drawCircle(vcb.getX(), vcb.getY(), 30, paint);*/ /*paint.setColor(0xFFFF0000); canvas.drawLine(vpa.getX(), vpa.getY(), vpb.getX(), vpb.getY(), paint); paint.setColor(0xFF00FF00); canvas.drawLine(vca.getX(), vca.getY(), vcb.getX(), vcb.getY(), paint);*/ } catch(NullPointerException e) { // Just being lazy here... } } @Override public boolean onTouch(View v, MotionEvent event) { vca = null; vcb = null; vpa = null; vpb = null; x=event.getX(); y=event.getY(); try { touchManager.update(event); if (touchManager.getPressCount() == 1) { vca = touchManager.getPoint(0); vpa = touchManager.getPreviousPoint(0); position.add(touchManager.moveDelta(0)); } else { if (touchManager.getPressCount() == 2) { vca = touchManager.getPoint(0); vpa = touchManager.getPreviousPoint(0); vcb = touchManager.getPoint(1); vpb = touchManager.getPreviousPoint(1); VMVector2D current = touchManager.getVector(0, 1); VMVector2D previous = touchManager.getPreviousVector(0, 1); float currentDistance = current.getLength(); float previousDistance = previous.getLength(); if (currentDistance-previousDistance != 0) { scale *= currentDistance / previousDistance; } angle -= VMVector2D.getSignedAngleBetween(current, previous); /*angleCount=angleCount+angle;*/ } } invalidate(); } catch(Exception exception) { // Log.d("VM", exception.getMessage()); } return true; }

    Read the article

  • Running game, leaving game and continuing animation

    - by Madrusec
    I have been trying to learn some Actionscript recently and have been trying to run an interactive story that at one point turns into an extremel simple shooter game. After the player either wins or looses, then he/she is taken to the rest of the animated story. So I have everything up to the point where the games runs (successfully) but for some reason I am unable to have flash run the rest of the frames, most of which have no code at all. This is the code for scene 1: stop (); import flash.display.MovieClip; import flash.events.MouseEvent; import flash.utils.Timer; import flash.events.TimerEvent; var stoneInGame:uint; var stoneMaker: Timer; var container_mc: MovieClip; var cursor:MovieClip; var score:int; var anxiety:int; var anxiety_mc :MovieClip = new mcAnxiety(); //stage.addChild( anxiety_mc ); function initializeGame():void { stoneInGame = 10; stoneMaker = new Timer(1000, stoneInGame); container_mc = new MovieClip(); addChild(container_mc); container_mc.addChild(anxiety_mc); anxiety_mc.x = 497; anxiety_mc.y = 360; stoneMaker.addEventListener(TimerEvent.TIMER, createStones); stoneMaker.start(); cursor = new Cursor(); addChild(cursor); cursor.enabled = false; Mouse.hide(); stage.addEventListener(MouseEvent.MOUSE_MOVE, dragCursor); score = 0; anxiety = anxiety_mc.totalFrames; anxiety_mc.gotoAndStop(anxiety); } function dragCursor(event:MouseEvent):void { cursor.x = this.mouseX; cursor.y = this.mouseY; } function createStones(event:TimerEvent):void { var stone:MovieClip; stone = new Stone(); stone.x = Math.random() * stage.stageWidth; stone.y = Math.random() * stage.stageHeight; container_mc.addChild(stone); } function increaseScore():void { score ++; if(score >= stoneInGame) { dragCursor.stop(); createStones.stop(); stoneMaker.stop(); trace("you wind!"); } } function decreaseAnxiety():void { anxiety--; if(anxiety <= 0) { stoneMaker.stop(); trace("you lose!"); } else { anxiety_mc.gotoAndStop(anxiety); } increaseScore(); } initializeGame(); So what I tried to do was adding gotoAndPlay() inside both the decreaseAnxiety and increaseScore functions after the trace statements and referenced a frame where I have more keyframes that continue a story. However, Flash just goes back to the beginning of the timeline and I even the functions that change and control the cursor seem to be running. This leads me to believe that I need to make sure that I tell flash o stup running certain functions before jumping to another frame. However, it seems to me that I would still have the same issue and not be able to continue in the timeline. Is there something I am missing? How can I jump out of all this code once the game finishes and simply continue playing the rest of the frames? Any pointers would be greatly appreciated. Thank you

    Read the article

  • Get Image Source URLs from a Different Page Using JS

    - by SDD
    Everyone: I'm trying to grab the source URLs of images from one page and use them in some JavaScript in another page. I know how to pull in images using JQuery .load(). However, rather than load all the images and display them on the page, I want to just grab the source URLs so I can use them in a JS array. Page 1 is just a page with images: <html> <head> </head> <body> <img id="image0" src="image0.jpg" /> <img id="image1" src="image1.jpg" /> <img id="image2" src="image2.jpg" /> <img id="image3" src="image3.jpg" /> </body> </html> Page 2 contains my JS. (Please note that the end goal is to load images into an array, randomize them, and using cookies, show a new image on page load every 10 seconds. All this is working. However, rather than hard code the image paths into my javascript as shown below, I'd prefer to take the paths from Page 1 based on their IDs. This way, the images won't always need to be titled "image1.jpg," etc.) <script type = "text/javascript"> var days = 730; var rotator = new Object(); var currentTime = new Date(); var currentMilli = currentTime.getTime(); var images = [], index = 0; images[0] = "image0.jpg"; images[1] = "image1.jpg"; images[2] = "image2.jpg"; images[3] = "image3.jpg"; rotator.getCookie = function(Name) { var re = new RegExp(Name+"=[^;]+", "i"); if (document.cookie.match(re)) return document.cookie.match(re)[0].split("=")[1]; return''; } rotator.setCookie = function(name, value, days) { var expireDate = new Date(); var expstring = expireDate.setDate(expireDate.getDate()+parseInt(days)); document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/"; } rotator.randomize = function() { index = Math.floor(Math.random() * images.length); randomImageSrc = images[index]; } rotator.check = function() { if (rotator.getCookie("randomImage") == "") { rotator.randomize(); document.write("<img src=" + randomImageSrc + ">"); rotator.setCookie("randomImage", randomImageSrc, days); rotator.setCookie("timeClock", currentMilli, days); } else { var writtenTime = parseInt(rotator.getCookie("timeClock"),10); if ( currentMilli > writtenTime + 10000 ) { rotator.randomize(); var writtenImage = rotator.getCookie("randomImage") while ( randomImageSrc == writtenImage ) { rotator.randomize(); } document.write("<img src=" + randomImageSrc + ">"); rotator.setCookie("randomImage", randomImageSrc, days); rotator.setCookie("timeClock", currentMilli, days); } else { var writtenImage = rotator.getCookie("randomImage") document.write("<img src=" + writtenImage + ">"); } } } rotator.check() </script> Can anyone point me in the right direction? My hunch is to use JQuery .get(), but I've been unsuccessful so far. Please let me know if I can clarify!

    Read the article

  • Calculate the number of ways to roll a certain number

    - by helloworld
    I'm a high school Computer Science student, and today I was given a problem to: Program Description: There is a belief among dice players that in throwing three dice a ten is easier to get than a nine. Can you write a program that proves or disproves this belief? Have the computer compute all the possible ways three dice can be thrown: 1 + 1 + 1, 1 + 1 + 2, 1 + 1 + 3, etc. Add up each of these possibilities and see how many give nine as the result and how many give ten. If more give ten, then the belief is proven. I quickly worked out a brute force solution, as such int sum,tens,nines; tens=nines=0; for(int i=1;i<=6;i++){ for(int j=1;j<=6;j++){ for(int k=1;k<=6;k++){ sum=i+j+k; //Ternary operators are fun! tens+=((sum==10)?1:0); nines+=((sum==9)?1:0); } } } System.out.println("There are "+tens+" ways to roll a 10"); System.out.println("There are "+nines+" ways to roll a 9"); Which works just fine, and a brute force solution is what the teacher wanted us to do. However, it doesn't scale, and I am trying to find a way to make an algorithm that can calculate the number of ways to roll n dice to get a specific number. Therefore, I started generating the number of ways to get each sum with n dice. With 1 die, there is obviously 1 solution for each. I then calculated, through brute force, the combinations with 2 and 3 dice. These are for two: There are 1 ways to roll a 2 There are 2 ways to roll a 3 There are 3 ways to roll a 4 There are 4 ways to roll a 5 There are 5 ways to roll a 6 There are 6 ways to roll a 7 There are 5 ways to roll a 8 There are 4 ways to roll a 9 There are 3 ways to roll a 10 There are 2 ways to roll a 11 There are 1 ways to roll a 12 Which looks straightforward enough; it can be calculated with a simple linear absolute value function. But then things start getting trickier. With 3: There are 1 ways to roll a 3 There are 3 ways to roll a 4 There are 6 ways to roll a 5 There are 10 ways to roll a 6 There are 15 ways to roll a 7 There are 21 ways to roll a 8 There are 25 ways to roll a 9 There are 27 ways to roll a 10 There are 27 ways to roll a 11 There are 25 ways to roll a 12 There are 21 ways to roll a 13 There are 15 ways to roll a 14 There are 10 ways to roll a 15 There are 6 ways to roll a 16 There are 3 ways to roll a 17 There are 1 ways to roll a 18 So I look at that, and I think: Cool, Triangular numbers! However, then I notice those pesky 25s and 27s. So it's obviously not triangular numbers, but still some polynomial expansion, since it's symmetric. So I take to Google, and I come across this page that goes into some detail about how to do this with math. It is fairly easy(albeit long) to find this using repeated derivatives or expansion, but it would be much harder to program that for me. I didn't quite understand the second and third answers, since I have never encountered that notation or those concepts in my math studies before. Could someone please explain how I could write a program to do this, or explain the solutions given on that page, for my own understanding of combinatorics? EDIT: I'm looking for a mathematical way to solve this, that gives an exact theoretical number, not by simulating dice

    Read the article

  • Help for creating a random String

    - by Max
    I need to create a random string which should be between the length of 6 to 10 but it sometimes generates only about the length of 3 to 5. Here's my code. Can anyone would be able to find out the problem? :( int lengthOfName = (int)(Math.random() * 4) + 6; String name = ""; /* randomly choosing a name*/ for (int j = 0; j <= lengthOfName; j++) { int freq = (int)(Math.random() * 100) + 1; if(freq <= 6){ name += "a"; }if(freq == 7 && freq == 8){ name += "b"; }if(freq >= 9 && freq <= 11){ name += "c"; }if(freq >= 12 && freq <= 15){ name += "d"; }if(freq >= 16 && freq <= 25){ name += "e"; }if(freq == 26 && freq == 27){ name += "f"; }if(freq == 28 && freq == 29){ name += "g"; }if(freq >= 30 && freq <= 33){ name += "h"; }if(freq >= 34 && freq <= 48){ name += "i"; }if(freq == 49 && freq == 50){ name += "j"; }if(freq >= 51 && freq <= 55){ name += "k"; }if(freq >= 56 && freq <= 60){ name += "l"; }if(freq == 61 && freq == 62){ name += "m"; }if(freq >= 63 && freq <= 70){ name += "n"; }if(freq >= 71 && freq <= 75){ name += "o"; }if(freq == 76 && freq == 77){ name += "p"; }if(freq == 78){ name += "q"; }if(freq >= 79 && freq <= 84){ name += "r"; }if(freq == 85 && freq == 86){ name += "s"; }if(freq == 87 && freq == 88){ name += "t"; }if(freq >= 89 && freq <= 93){ name += "u"; }if(freq == 94){ name += "v"; }if(freq == 95 && freq == 96){ name += "w"; }if(freq == 97){ name += "x"; }if(freq == 98 && freq == 99){ name += "y"; }if(freq == 100){ name += "z"; } }

    Read the article

  • Generating strongly biased radom numbers for tests

    - by nobody
    I want to run tests with randomized inputs and need to generate 'sensible' random numbers, that is, numbers that match good enough to pass the tested function's preconditions, but hopefully wreak havoc deeper inside its code. math.random() (I'm using Lua) produces uniformly distributed random numbers. Scaling these up will give far more big numbers than small numbers, and there will be very few integers. I would like to skew the random numbers (or generate new ones using the old function as a randomness source) in a way that strongly favors 'simple' numbers, but will still cover the whole range, I.e. extending up to positive/negative infinity (or ±1e309 for double). This means: numbers up to, say, ten should be most common, integers should be more common than fractions, numbers ending in 0.5 should be the most common fractions, followed by 0.25 and 0.75; then 0.125, and so on. A different description: Fix a base probability x such that probabilities will sum to one and define the probability of a number n as xk where k is the generation in which n is constructed as a surreal number1. That assigns x to 0, x2 to -1 and +1, x3 to -2, -1/2, +1/2 and +2, and so on. This gives a nice description of something close to what I want (it skews a bit too much), but is near-unusable for computing random numbers. The resulting distribution is nowhere continuous (it's fractal!), I'm not sure how to determine the base probability x (I think for infinite precision it would be zero), and computing numbers based on this by iteration is awfully slow (spending near-infinite time to construct large numbers). Does anyone know of a simple approximation that, given a uniformly distributed randomness source, produces random numbers very roughly distributed as described above? I would like to run thousands of randomized tests, quantity/speed is more important than quality. Still, better numbers mean less inputs get rejected. Lua has a JIT, so performance can't be reasonably predicted. Jumps based on randomness will break every prediction, and many calls to math.random() will be slow, too. This means a closed formula will be better than an iterative or recursive one. 1 Wikipedia has an article on surreal numbers, with a nice picture. A surreal number is a pair of two surreal numbers, i.e. x := {n|m}, and its value is the number in the middle of the pair, i.e. (for finite numbers) {n|m} = (n+m)/2 (as rational). If one side of the pair is empty, that's interpreted as increment (or decrement, if right is empty) by one. If both sides are empty, that's zero. Initially, there are no numbers, so the only number one can build is 0 := { | }. In generation two one can build numbers {0| } =: 1 and { |0} =: -1, in three we get {1| } =: 2, {|1} =: -2, {0|1} =: 1/2 and {-1|0} =: -1/2 (plus some more complex representations of known numbers, e.g. {-1|1} ? 0). Note that e.g. 1/3 is never generated by finite numbers because it is an infinite fraction – the same goes for floats, 1/3 is never represented exactly.

    Read the article

  • HMTL5 Anti Aliasing Browser Disable

    - by Tappa Tappa
    I am forced to consider writing a library to handle the fundamental basics of drawing lines, thick lines, circles, squares etc. of an HTML5 canvas because I can't disable a feature embedded in the browser rendering of the core canvas algorithms. Am I forced to build the HTML5 Canvas rendering process from the ground up? If I am, who's in with me to do this? Who wants to change the world? Imagine a simple drawing application written in HTML5... you draw a shape... a closed shape like a rudimentary circle, free hand, more like an onion than a circle (well, that's what mine would look like!)... then imagine selecting a paint bucket icon and clicking inside that shape you drew and expecting it to be filled with a color of your choice. Imagine your surprise as you selected "Paint Bucket" and clicked in the middle of your shape and it filled your shape with color... BUT, not quite... HANG ON... this isn't right!!! On the inside of the edge of the shape you drew is a blur between the background color and your fill color and the edge color... the fill seems to be flawed. You wanted a straight forward "Paint Bucket" / "Fill"... you wanted to draw a shape and then fill it with a color... no fuss.... fill the whole damned inside of your shape with the color you choose. Your web browser has decided that when you draw the lines to define your shape they will be anti-aliased. If you draw a black line for your shape... well, the browser will draw grey pixels along the edges, in places... to make it look like a "better" line. Yeah, a "better" line that **s up the paint / flood fill process. How much does is cost to pay off the browser developers to expose a property to disable their anti-aliasing rendering? Disabling would save milliseconds for their rendering engine, surely! Bah, I really don't want to have to build my own canvas rendering engine using Bresenham line rendering algorithm... WHAT CAN BE DONE... HOW CAN THIS BE CHANGED!!!??? Do I need to start a petition aimed at the WC3???? Will you include your name if you are interested??? UPDATED function DrawLine(objContext, FromX, FromY, ToX, ToY) { var dx = Math.abs(ToX - FromX); var dy = Math.abs(ToY - FromY); var sx = (FromX < ToX) ? 1 : -1; var sy = (FromY < ToY) ? 1 : -1; var err = dx - dy; var CurX, CurY; CurX = FromX; CurY = FromY; while (true) { objContext.fillRect(CurX, CurY, objContext.lineWidth, objContext.lineWidth); if ((CurX == ToX) && (CurY == ToY)) break; var e2 = 2 * err; if (e2 > -dy) { err -= dy; CurX += sx; } if (e2 < dx) { err += dx; CurY += sy; } } }

    Read the article

  • How does java.util.Collections.contains() perform faster than a linear search?

    - by The111
    I've been fooling around with a bunch of different ways of searching collections, collections of collections, etc. Doing lots of stupid little tests to verify my understanding. Here is one which boggles me (source code further below). In short, I am generating N random integers and adding them to a list. The list is NOT sorted. I then use Collections.contains() to look for a value in the list. I intentionally look for a value that I know won't be there, because I want to ensure that the entire list space is probed. I time this search. I then do another linear search manually, iterating through each element of the list and checking if it matches my target. I also time this search. On average, the second search takes 33% longer than the first one. By my logic, the first search must also be linear, because the list is unsorted. The only possibility I could think of (which I immediately discard) is that Java is making a sorted copy of my list just for the search, but (1) I did not authorize that usage of memory space and (2) I would think that would result in MUCH more significant time savings with such a large N. So if both searches are linear, they should both take the same amount of time. Somehow the Collections class has optimized this search, but I can't figure out how. So... what am I missing? import java.util.*; public class ListSearch { public static void main(String[] args) { int N = 10000000; // number of ints to add to the list int high = 100; // upper limit for random int generation List<Integer> ints; int target = -1; // target will not be found, forces search of entire list space long start; long end; ints = new ArrayList<Integer>(); start = System.currentTimeMillis(); System.out.print("Generating new list... "); for (int i = 0; i < N; i++) { ints.add(((int) (Math.random() * high)) + 1); } end = System.currentTimeMillis(); System.out.println("took " + (end-start) + "ms."); start = System.currentTimeMillis(); System.out.print("Searching list for target (method 1)... "); if (ints.contains(target)) { // nothing } end = System.currentTimeMillis(); System.out.println(" Took " + (end-start) + "ms."); System.out.println(); ints = new ArrayList<Integer>(); start = System.currentTimeMillis(); System.out.print("Generating new list... "); for (int i = 0; i < N; i++) { ints.add(((int) (Math.random() * high)) + 1); } end = System.currentTimeMillis(); System.out.println("took " + (end-start) + "ms."); start = System.currentTimeMillis(); System.out.print("Searching list for target (method 2)... "); for (Integer i : ints) { // nothing } end = System.currentTimeMillis(); System.out.println(" Took " + (end-start) + "ms."); } }

    Read the article

  • XMLNodes being appended to an XMLNode are "undefined"? Actionscript 2.0 is being unkind

    - by DigitalMercenary
    If anyone can offer an explanation for this one, I'd LOVE to see it! I was required to append a legacy application to display 20 random questions from an XML data source, as opposed to the total of 70 questions that are part of the original XML. No big deal, right? WRONG! I got it to work just fine in the end, but it's a total HACK! For some reason, some of the nodes that I am appending to a dynamically generated XML document are being returned as "undefined". I kept getting between 16 and 20 questions to render until I modified my iteration from a 'for' loop to a 'do while' loop with the appropriate number of XMLNodes as the condition of the 'do while' loop. Can anyone offer an explanation? Below is the code, with some notes for the reader : function editXML(xml:XML):XML { var node:XMLNode = xml.firstChild; var newNode:XMLNode = new XMLNode(); var nodeArray:Array = new Array(); var usedNodes:Array = new Array(); var totalNodes:Number = node.lastChild.childNodes.length - 1; var nextNode:Number; var returnNode:XMLNode = new XMLNode(); var tempNode:XMLNode; var buildNode:XMLNode; var addNode:Boolean = true; var tempXML:XML = new XML(); var pagesNode:XMLNode = tempXML.createElement("pages"); tempXML.appendChild(pagesNode); tempXML.appendChild(node.childNodes[0]); tempXML.appendChild(node.childNodes[1]); tempXML.appendChild(node.childNodes[2]); var questionsNode:XMLNode = tempXML.createElement("pages"); tempXML.firstChild.appendChild(questionsNode); do { nextNode = Math.floor(Math.random()*totalNodes); **//random number to represent random node** //trace(nextNode + " nextNode"); **//check usedNodes Array to look for node.childNodes[nextNode]. If it already exists, skip and reloop.** trace(node.childNodes[1].childNodes[nextNode] + " : pre building Node " + totalNodes); if(usedNodes.length == 0) { buildNode = new XMLNode(); buildNode.nodeName = node.childNodes[1].childNodes[nextNode].nodeName; buildNode.nodeValue = node.childNodes[1].childNodes[nextNode].nodeValue; tempXML.firstChild.lastChild.appendChild(node.childNodes[1].childNodes[nextNode]) usedNodes.push(node.childNodes[1].childNodes[nextNode]); nodeArray.push(node.childNodes[1].childNodes[nextNode]); trace("adding first node : " + nodeArray.length); addNode = false; } else { for(var j:Number = 0; j < usedNodes.length; j++) { if(usedNodes[j] == node.childNodes[1].childNodes[nextNode]) { addNode = false; trace("skipping node : " + nodeArray.length); } } } **//if node not in usedNodes, add node to XML** if(addNode) { trace(node.childNodes[1].childNodes[nextNode] + " : building Node"); **//This trace statement produced a valid node** tempXML.firstChild.lastChild.appendChild(node.childNodes[1].childNodes[nextNode]); **//Before modifying the code from adding nodes to the xml from an Array called 'nodeArray' in a for loop to adding nodes directly to the xml in a do while loop with the length of the xml node used to retrieve data for the questions as the condition, I was not always getting 20 questions. Some of the nodes were being rendered as 'undefined' and not appended to the xml, even though they were traced and proven valid before the attemp to append them to the xml was made** usedNodes.push(node.childNodes[1].childNodes[nextNode]); } addNode = true; } while(tempXML.firstChild.lastChild.childNodes.length <= 19); trace(tempXML.firstChild.lastChild.childNodes.length + " final nodes Length"); courseXML = tempXML; //removes the old question list of 70 and replaces it with the new question list of 20. Question list is the last node. return tempXML; } If I had my choice, I would have rebuilt the whole application in Flex with AS3. I didn't have that choice. If anyone can explain this mystery, PLEASE DO! Thank you in advance!

    Read the article

  • XNA: Camera's Rotation and Translation matrices seem to interfere with each other

    - by Danjen
    I've been following the guide here for how to create a custom 2D camera in XNA. It works great, I've implemented it before, but for some reason, the matrix math is throwing me off. public sealed class Camera2D { public Vector2 Origin { get; set; } public Vector2 Position { get; set; } public float Scale { get; set; } public float Rotation { get; set; } } It might be easier to just show you a picture of my problem: http://i.imgur.com/H1l6LEx.png What I want to do is allow the camera to pivot around any given point. Right now, I have the rotations mapped to my shoulder buttons on a gamepad, and if I press them, it should rotate around the point the camera is currently looking at. Then, I use the left stick to move the camera around. The problem is that after it's been rotated, pressing "up" results in it being used relative to the rotation, creating the image above. I understand that matrices have to be applied in a certain order, and that I have to offset the thing to be rotated around the world origin and move it back, but it just won't work! public Matrix GetTransformationMatrix() { Matrix mRotate = Matrix.Identity * Matrix.CreateTranslation(-Origin.X, -Origin.Y, 0.00f) * // Move origin to world center Matrix.CreateRotationZ(MathHelper.ToRadians(Rotation)) * // Apply rotation Matrix.CreateTranslation(+Origin.X, +Origin.Y, 0.00f); // Undo the move operation Matrix mTranslate = Matrix.Identity * Matrix.CreateTranslation(-Position.X, Position.Y, 0.00f); // Apply the actual translation return mRotate * mTranslate; } So to recap, it seems I can have it rotate around an arbitrary point and lose the ability to have "up" move the camera straight up, or I can rotate it around the world origin and have the camera move properly, but not both.

    Read the article

  • Parallelism in .NET – Part 9, Configuration in PLINQ and TPL

    - by Reed
    Parallel LINQ and the Task Parallel Library contain many options for configuration.  Although the default configuration options are often ideal, there are times when customizing the behavior is desirable.  Both frameworks provide full configuration support. When working with Data Parallelism, there is one primary configuration option we often need to control – the number of threads we want the system to use when parallelizing our routine.  By default, PLINQ and the TPL both use the ThreadPool to schedule tasks.  Given the major improvements in the ThreadPool in CLR 4, this default behavior is often ideal.  However, there are times that the default behavior is not appropriate.  For example, if you are working on multiple threads simultaneously, and want to schedule parallel operations from within both threads, you might want to consider restricting each parallel operation to using a subset of the processing cores of the system.  Not doing this might over-parallelize your routine, which leads to inefficiencies from having too many context switches. In the Task Parallel Library, configuration is handled via the ParallelOptions class.  All of the methods of the Parallel class have an overload which accepts a ParallelOptions argument. We configure the Parallel class by setting the ParallelOptions.MaxDegreeOfParallelism property.  For example, let’s revisit one of the simple data parallel examples from Part 2: Parallel.For(0, pixelData.GetUpperBound(0), row => { for (int col=0; col < pixelData.GetUpperBound(1); ++col) { pixelData[row, col] = AdjustContrast(pixelData[row, col], minPixel, maxPixel); } }); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Here, we’re looping through an image, and calling a method on each pixel in the image.  If this was being done on a separate thread, and we knew another thread within our system was going to be doing a similar operation, we likely would want to restrict this to using half of the cores on the system.  This could be accomplished easily by doing: var options = new ParallelOptions(); options.MaxDegreeOfParallelism = Math.Max(Environment.ProcessorCount / 2, 1); Parallel.For(0, pixelData.GetUpperBound(0), options, row => { for (int col=0; col < pixelData.GetUpperBound(1); ++col) { pixelData[row, col] = AdjustContrast(pixelData[row, col], minPixel, maxPixel); } }); Now, we’re restricting this routine to using no more than half the cores in our system.  Note that I included a check to prevent a single core system from supplying zero; without this check, we’d potentially cause an exception.  I also did not hard code a specific value for the MaxDegreeOfParallelism property.  One of our goals when parallelizing a routine is allowing it to scale on better hardware.  Specifying a hard-coded value would contradict that goal. Parallel LINQ also supports configuration, and in fact, has quite a few more options for configuring the system.  The main configuration option we most often need is the same as our TPL option: we need to supply the maximum number of processing threads.  In PLINQ, this is done via a new extension method on ParallelQuery<T>: ParallelEnumerable.WithDegreeOfParallelism. Let’s revisit our declarative data parallelism sample from Part 6: double min = collection.AsParallel().Min(item => item.PerformComputation()); Here, we’re performing a computation on each element in the collection, and saving the minimum value of this operation.  If we wanted to restrict this to a limited number of threads, we would add our new extension method: int maxThreads = Math.Max(Environment.ProcessorCount / 2, 1); double min = collection .AsParallel() .WithDegreeOfParallelism(maxThreads) .Min(item => item.PerformComputation()); This automatically restricts the PLINQ query to half of the threads on the system. PLINQ provides some additional configuration options.  By default, PLINQ will occasionally revert to processing a query in parallel.  This occurs because many queries, if parallelized, typically actually cause an overall slowdown compared to a serial processing equivalent.  By analyzing the “shape” of the query, PLINQ often decides to run a query serially instead of in parallel.  This can occur for (taken from MSDN): Queries that contain a Select, indexed Where, indexed SelectMany, or ElementAt clause after an ordering or filtering operator that has removed or rearranged original indices. Queries that contain a Take, TakeWhile, Skip, SkipWhile operator and where indices in the source sequence are not in the original order. Queries that contain Zip or SequenceEquals, unless one of the data sources has an originally ordered index and the other data source is indexable (i.e. an array or IList(T)). Queries that contain Concat, unless it is applied to indexable data sources. Queries that contain Reverse, unless applied to an indexable data source. If the specific query follows these rules, PLINQ will run the query on a single thread.  However, none of these rules look at the specific work being done in the delegates, only at the “shape” of the query.  There are cases where running in parallel may still be beneficial, even if the shape is one where it typically parallelizes poorly.  In these cases, you can override the default behavior by using the WithExecutionMode extension method.  This would be done like so: var reversed = collection .AsParallel() .WithExecutionMode(ParallelExecutionMode.ForceParallelism) .Select(i => i.PerformComputation()) .Reverse(); Here, the default behavior would be to not parallelize the query unless collection implemented IList<T>.  We can force this to run in parallel by adding the WithExecutionMode extension method in the method chain. Finally, PLINQ has the ability to configure how results are returned.  When a query is filtering or selecting an input collection, the results will need to be streamed back into a single IEnumerable<T> result.  For example, the method above returns a new, reversed collection.  In this case, the processing of the collection will be done in parallel, but the results need to be streamed back to the caller serially, so they can be enumerated on a single thread. This streaming introduces overhead.  IEnumerable<T> isn’t designed with thread safety in mind, so the system needs to handle merging the parallel processes back into a single stream, which introduces synchronization issues.  There are two extremes of how this could be accomplished, but both extremes have disadvantages. The system could watch each thread, and whenever a thread produces a result, take that result and send it back to the caller.  This would mean that the calling thread would have access to the data as soon as data is available, which is the benefit of this approach.  However, it also means that every item is introducing synchronization overhead, since each item needs to be merged individually. On the other extreme, the system could wait until all of the results from all of the threads were ready, then push all of the results back to the calling thread in one shot.  The advantage here is that the least amount of synchronization is added to the system, which means the query will, on a whole, run the fastest.  However, the calling thread will have to wait for all elements to be processed, so this could introduce a long delay between when a parallel query begins and when results are returned. The default behavior in PLINQ is actually between these two extremes.  By default, PLINQ maintains an internal buffer, and chooses an optimal buffer size to maintain.  Query results are accumulated into the buffer, then returned in the IEnumerable<T> result in chunks.  This provides reasonably fast access to the results, as well as good overall throughput, in most scenarios. However, if we know the nature of our algorithm, we may decide we would prefer one of the other extremes.  This can be done by using the WithMergeOptions extension method.  For example, if we know that our PerformComputation() routine is very slow, but also variable in runtime, we may want to retrieve results as they are available, with no bufferring.  This can be done by changing our above routine to: var reversed = collection .AsParallel() .WithExecutionMode(ParallelExecutionMode.ForceParallelism) .WithMergeOptions(ParallelMergeOptions.NotBuffered) .Select(i => i.PerformComputation()) .Reverse(); On the other hand, if are already on a background thread, and we want to allow the system to maximize its speed, we might want to allow the system to fully buffer the results: var reversed = collection .AsParallel() .WithExecutionMode(ParallelExecutionMode.ForceParallelism) .WithMergeOptions(ParallelMergeOptions.FullyBuffered) .Select(i => i.PerformComputation()) .Reverse(); Notice, also, that you can specify multiple configuration options in a parallel query.  By chaining these extension methods together, we generate a query that will always run in parallel, and will always complete before making the results available in our IEnumerable<T>.

    Read the article

  • Oracle Announces Oracle Big Data Appliance X3-2 and Enhanced Oracle Big Data Connectors

    - by jgelhaus
    Enables Customers to Easily Harness the Business Value of Big Data at Lower Cost Engineered System Simplifies Big Data for the Enterprise Oracle Big Data Appliance X3-2 hardware features the latest 8-core Intel® Xeon E5-2600 series of processors, and compared with previous generation, the 18 compute and storage servers with 648 TB raw storage now offer: 33 percent more processing power with 288 CPU cores; 33 percent more memory per node with 1.1 TB of main memory; and up to a 30 percent reduction in power and cooling Oracle Big Data Appliance X3-2 further simplifies implementation and management of big data by integrating all the hardware and software required to acquire, organize and analyze big data. It includes: Support for CDH4.1 including software upgrades developed collaboratively with Cloudera to simplify NameNode High Availability in Hadoop, eliminating the single point of failure in a Hadoop cluster; Oracle NoSQL Database Community Edition 2.0, the latest version that brings better Hadoop integration, elastic scaling and new APIs, including JSON and C support; The Oracle Enterprise Manager plug-in for Big Data Appliance that complements Cloudera Manager to enable users to more easily manage a Hadoop cluster; Updated distributions of Oracle Linux and Oracle Java Development Kit; An updated distribution of open source R, optimized to work with high performance multi-threaded math libraries Read More   Data sheet: Oracle Big Data Appliance X3-2 Oracle Big Data Appliance: Datacenter Network Integration Big Data and Natural Language: Extracting Insight From Text Thomson Reuters Discusses Oracle's Big Data Platform Connectors Integrate Hadoop with Oracle Big Data Ecosystem Oracle Big Data Connectors is a suite of software built by Oracle to integrate Apache Hadoop with Oracle Database, Oracle Data Integrator, and Oracle R Distribution. Enhancements to Oracle Big Data Connectors extend these data integration capabilities. With updates to every connector, this release includes: Oracle SQL Connector for Hadoop Distributed File System, for high performance SQL queries on Hadoop data from Oracle Database, enhanced with increased automation and querying of Hive tables and now supported within the Oracle Data Integrator Application Adapter for Hadoop; Transparent access to the Hive Query language from R and introduction of new analytic techniques executing natively in Hadoop, enabling R developers to be more productive by increasing access to Hadoop in the R environment. Read More Data sheet: Oracle Big Data Connectors High Performance Connectors for Load and Access of Data from Hadoop to Oracle Database

    Read the article

  • CodePlex Daily Summary for Saturday, June 05, 2010

    CodePlex Daily Summary for Saturday, June 05, 2010New Projects555 Calculator: A simple calculator to help choosing resistor and capacitor values to get the frequency you're looking for on a 555 timer.BleQua .NET: PL: Program sieciowy BleQua .NET jest multi-komunikatorem. EN: Network program BleQua .NET is multicomunicator.ChatDiplomaWork: ChatSample is the sample project.CSUFVGDC Summer Jam: Repository for VGDC summer game jam.Database Export Wizard: ExportWizard is a Step Wizard for Database Export using ASP.net and SQL Server. It allows easy export in any of the standard formats: CSV, TXT, HTM...Dozer Enterprise Library for .NET: a light .net framework for enterprise applications developmentEmployee Management System: This is an Employee Management System. the goal here is to offer a software that caters to small to mid sized businesses for free. This program a...Fanray: My project on Codeplex.Infragistics Analytics Framework: This project includes wrappers for the Infragistics controls that integrate with the recently launched Microsoft Silverlight Analytics Framework. ...KIME Simio Extensions: This is the official project of KIME Solutions. Here you find any current developments of KIME that are publicly available. KIME develops extension...MindTouch Community Extensions: MindTouch Community Extentions is a Native C# extention library for MindTouch Core that will have Dekiscript functions for full coverage of the API...NginxTray: NginxTray allows you manage easily Nginx Web Server by a Tray icon.NStore: NStore is a virtual store example done with ASP.NET MVC 2.0 tecnologyProjet Campus Numerique + Appli Mobile: Projet de création d'un campus numérique pour l'ISEN et d'un application mobile d'accès.SharePoint 2010 Feature Upgrade Kit: A set of tools for managing upgradable Features in SharePoint 2010. (Upgrading Features is a means of deploying code/artifact updates to existing S...SiteMap Utility for DNN Blog Module: This is a mini-project which allows you to easily add or generate an XML site map to your DotNetNuke® website for the search engines to use to inde...Space Explorer: A small app to help users examine folders to see which files and subfolders are taking up space. Still in development, no releases available curren...SQL Compact Toolbox: SQL Compact Toolbox is a Visual Studio 2010 add-in, that adds scripting, import, export, migrate, rename, run script and other upcoming SQL Server ...Twilverlight: Twliverlight is TweetDeck mixed with Silverlight. Much as I like using TweetDeck, it hogs my memory out, so this is an attempt to write a memory-ef...Visual Studio 2010 FxCop Extension: Visual Studio 2010 FxCop Extension allows to integrate stand-alone FxCop into Visual Studio 2010. You'll be able to analysis your source code with ...VisualStudio 2010 JavaScript Outlining: Visual Studio 2010 editor extension for JavaScript code blocks and custom regions outlining Wiki Shelf: Wiki Shelf is a Wikipedia browser app. The goal is to bring the library experience of browsing books, studying, and researching to the Wikipedia u...X-Arena - Magic: Projeto de PDS2 no Curso de Tecnologia em Desenvolvimento de Software no CEFETRN. O desenvolvimento do jogo Quiz Arena possui como pr...New Releases555 Calculator: 555Calc release v1.0: The initial 1 point uh-oh release of 555Calc.BleQua .NET: BleQua .NET 1.0.0.0: First releaseChatterbot JBot: JBot 1.0.1.155: Change presentation technology from Window Forms to Widndown Presentation Fundation.Community Forums NNTP bridge: Community Forums NNTP Bridge V26: Release of the Community Forums NNTP Bridge to access the social and anwsers MS forums with a single, open source NNTP bridge. This release has ad...Community Forums NNTP bridge: Community Forums NNTP Bridge V27: Release of the Community Forums NNTP Bridge to access the social and anwsers MS forums with a single, open source NNTP bridge. This release has ad...Community Forums NNTP bridge: Community Forums NNTP Bridge V28: Release of the Community Forums NNTP Bridge to access the social and anwsers MS forums with a single, open source NNTP bridge. This release has ad...CSS 360 Planetary Calendar: Final Release: =============================================================================== Final Release Version: 2.0 Tools Used: - Collaboration, Releas...Database Export Wizard: Version 3: As described in CodeProject article: Database Export Wizard for ASP.net and SQL Server. http://www.codeproject.com/KB/aspnet/DatabaseExportWizard.aspxEdu Math: Edu Math 2.0.10.122: Change version .NET Framework.Employee Management System: V1 (beta): This version is still in beta testing. Any issues, comments or suggestions are greatly appreciated. The export to excel function in this release o...ESB.NET: ESBDeploy_7.0.27.0 (x64 and x86) [ESB.NET 7.0 RC1]: Release Details Changes Since Last Release (since 6.3.47.1) - Targets .NET Framework 4, Visual Studio.NET 2010, Workflow 4 - Flowchart workflow ada...Free Silverlight & WPF Chart Control - Visifire: Visifire SL and WPF Charts v3.1.1 beta 2 Released: Hi, This release contains the following enhancements: *ShowIndicator() and HideIndicator() function has been implemented in Chart. So now user wi...Free Silverlight & WPF Chart Control - Visifire: Visifire SL and WPF Charts v3.5.4 beta 2 Released: Hi, This release contains the following enhancements: *ShowIndicator() and HideIndicator() function has been implemented in Chart. So now user wi...FsCheck: A random testing framework: FsCheck 0.7: What to download? If you use F# April 2010 CTP with Visual Studio 2008 or Visual Studio 2010, either Source or Binaries will do. To open source in...Git Source Control Provider: V 0.5: For VS 2010 users, it is recommanded to install it within Visual Studio by selecting Tools | Extension Manager. Run Visual Studio. Go to Tools ...GPdotNET - Genetic Programming Tool: GPdotNETv0.95: 1. Localization support 2. Export functionality for GP Model with training and testing data. 3. Export GPModel with Testing and Training data. 4....JoshDOS: JoshDOS 1.1: 1.1 adds a toutorial of how to create new commands and of course, you need the COMSOS user kit or dev kit. Ver 1.1 also includes a demo called Gue...KIME Simio Extensions: KIME.SimioDebugStep: This simple Simio step allows you to debug any number of expressions from within the simulation run. The debug information is displayed using a mes...NginxTray: NginxTray 0.3 Beta 2: NginxTray 0.3 Beta 2NginxTray: NginxTray 0.5 Beta 3: NginxTray 0.5 Beta 3NginxTray: NginxTray 0.6 RC1: NginxTray 0.6 RC1Open Source PLM Activities: Prodeos_OC beta 1.0: The “Innovator – MS Office Connector” is a product developed by Prodeos (www.prodeos.com). It is a light connector made to facilitate the use of Mi...Paint.NET PSD Plugin: 1.5.1: Changes in this release: Bitmap-mode images can now be loaded. Thanks to dhnc for filing the bug. Plugin no longer crashes on files with user m...SharePoint 2010 Feature Upgrade Kit: 1.0.0.0: This release contains:- - Custom application page to manage the upgrade of Site and Web-scoped Features. To come in the next release: - Companio...SiteMap Utility for DNN Blog Module: Blog SiteMap Utility v01.00.01: This is the first public release of the SiteMap Utility for the core DotNetNuke® Blog Module. Please see the documentation on this site on how to...SqlDiffFramework-A Visual Differencing Engine for Dissimilar Data Sources: SqlDiffFramework 1.0.2.0: Maintenance Release Defect Fixes: Issue # 3: 3 Issue # 4: 4 Enhancements: About Box now displays regional and language settings in effect. SDF...SuperSocket: First release of SuperSocket: !First release of SuperSocketThe Fastcopy Helper: FastcopyHelper: Fastcopy Helper 2.0 This is a final one. You can use it on the way. In order to use it , you should have the .NET3.5 ! 此软件必须下载 .NET3.5平台,方可使用!TV Show Renamer: TV Show Renamer Beta 3: I found the bug the prevented it from closing correctly so I fixed it and had to release it right away. If anyone else finds any problems. contact me.UrzaGatherer: UrzaGatherer v2.0: UrzaGatherer is the first stable version. This release include UrzaBackgroundPictures.VisualStudio 2010 JavaScript Outlining: VisualStudion 2010 Javascript Outlining 1.0: Features Outlines JavaScript codeblock regions for the code placed between { }. Both places on a new line. Outlines custom regions defined by: //...Wouter's SharePoint Demo Land: Navigation Service with Proxy: A SharePoint 2010 Service Application that uses service proxies to relay commands to the actual service. The demo proxy makes use of in-memory comm...盘古分词-开源中文分词组件: V2.0.0.0: 进一步优化性能,分词速度达到将近 500K ,1.2.0.1 版本只有 320K 修改 PanGu.Lucene.Analyzer, 支持 Lucene.net 2.9 版本。 增加对字典中以数字开头的专业非中文词汇的识别 增加英文分词开关,权重由英文小写权重和英文词根权重两个参数来决定...Most Popular ProjectsCommunity Forums NNTP bridgeOutSyncASP.NET MVC Time PlannerNeatUploadMoonyDesk (windows desktop widgets)AgUnit - Silverlight unit testing with ReSharperViperWorks IgnitionASP.NET MVC ExtensionsAviva Solutions C# Coding GuidelinesMute4Most Active ProjectsCommunity Forums NNTP bridgeRawrpatterns & practices – Enterprise LibraryIonics Isapi Rewrite FilterGMap.NET - Great Maps for Windows Forms & PresentationN2 CMSStyleCopFarseer Physics Enginesmark C# LibraryMirror Testing System

    Read the article

  • Geek it Up

    - by BuckWoody
    I’ve run into a couple of kinds of folks in IT. Some really like technology a lot – a whole lot –and others treat it more as a job. For those of you in the second camp, you can go back to your drab, meaningless jobs – this post is for the first group. I’m a geek. Not a little bit of a geek, a really big one. I love technology, I get excited about science and electronics in general, and I read math books when I don’t have to. Yes, I have a Star Trek item or two around the house. My daughter is fluent in both Monty Python AND Serenity. I totally admit it. So if you’re like me (OK, maybe a little less geeky than that), then go for it. Put those toys in your cubicle, wear your fan shirt, but most of all, geek up your tools. No, this isn’t an April Fool’s post – I really mean it. I’ve noticed that when I get the larger monitor, better mouse, cooler keyboard, I LIKE coming to work. It’s a way to reward yourself – I’ve even found that it makes work easier if I have the kind of things I enjoy around to work with. So buy that old “clicky” IBM keyboard, get three monitors, and buy a nice headset so that you can set all of your sounds to Monty Python WAV’s. And get to work. Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!

    Read the article

< Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >