Daily Archives

Articles indexed Wednesday May 19 2010

Page 24/122 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • How to make sketching kind module in java?

    - by Nitz
    Hey Guys I am trying to make one software on which user can make any sketch and make any drawing kind of thing. i am trying to get reference from this two great software. 1. Notelab 2. Jarnal But both having great and many facility in it. But In my software i want only sketching-drawing, so how to do that? I tried to use Canvas but i don't get how to use it?

    Read the article

  • POSTing a form using Python and Curl

    - by morpheous
    I am relatively new (as in a few days) to Python - I am looking for an example that would show me how to post a form to a website (say www.example.com). I already know how to use Curl. Infact, I have written C+++ code that does exactly the same thing (i.e. POST a form using Curl), but I would like some starting point (a few lines from which I can build on), which will show me how to do this using Python.

    Read the article

  • Google chrome, native client support and development

    - by hbt
    Hey guys, I would like to write a small C++ app and run it on chrome using the native client API. I have a few questions though: 1) I compiled the examples on Ubuntu and ran the code on firefox but can't run it on chrome (using version 5.0.342.7 beta) Do I need to install something? An extension/plugin? 2) I can't find a single online application I could run? Links anyone, I want to see the power of this thing without having to compile the code locally. Thanks for your help, -hbt PS: I don't know what's the policy with asking multiple questions. If it's a problem, let me know and I will create multiple threads.

    Read the article

  • mysql select help

    - by user344766
    Hi I have a table that looks like this id : productid : featureid and would have the following data: (1, 1, 16) (2, 1, 21) (3, 1, 25) (4, 2, 16) (5, 2, 21) (6, 2, 27) where featureid is a foreign key to another table. I need to select products that have both featureids of 16 and 25, in which case productid 1 but not productid 2 Can someone show me an example of how to format this query.

    Read the article

  • Classifying captured data in unknown format?

    - by monch1962
    I've got a large set of captured data (potentially hundreds of thousands of records), and I need to be able to break it down so I can both classify it and also produce "typical" data myself. Let me explain further... If I have the following strings of data: 132T339G1P112S 164T897F5A498S 144T989B9B223T 155T928X9Z554T ... you might start to infer the following: possibly all strings are 14 characters long the 4th, 8th, 10th and 14th characters may always be alphas, while the rest are numeric the first character may always be a '1' the 4th character may always be the letter 'T' the 14th character may be limited to only being 'S' or 'T' and so on... As you get more and more samples of real data, some of these "rules" might disappear; if you see a 15 character long string, then you have evidence that the 1st "rule" is incorrect. However, given a sufficiently large sample of strings that are exactly 14 characters long, you can start to assume that "all strings are 14 characters long" and assign a numeric figure to your degree of confidence (with an appropriate set of assumptions around the fact that you're seeing a suitably random set of all possible captured data). As you can probably tell, a human can do a lot of this classification by eye, but I'm not aware of libraries or algorithms that would allow a computer to do it. Given a set of captured data (significantly more complex than the above...), are there libraries that I can apply in my code to do this sort of classification for me, that will identify "rules" with a given degree of confidence? As a next step, I need to be able to take those rules, and use them to create my own data that conforms to these rules. I assume this is a significantly easier step than the classification, but I've never had to perform a task like this before so I'm really not sure how complex it is. At a guess, Python or Java (or possibly Perl or R) are possibly the "common" languages most likely to have these sorts of libraries, and maybe some of the bioinformatic libraries do this sort of thing. I really don't care which language I have to use; I need to solve the problem in whatever way I can. Any sort of pointer to information would be very useful. As you can probably tell, I'm struggling to describe this problem clearly, and there may be a set of appropriate keywords I can plug into Google that will point me towards the solution. Thanks in advance

    Read the article

  • Image rescale and write rescaled image file in blackberry

    - by Karthick
    I am using the following code to resize and save the file in to the blackberry device. After image scale I try to write image file into device. But it gives the same data. (Height and width of the image are same).I have to make rescaled image file.Can anyone help me ??? class ResizeImage extends MainScreen implements FieldChangeListener { private String path="file:///SDCard/BlackBerry/pictures/test.jpg"; private ButtonField btn; ResizeImage() { btn=new ButtonField("Write File"); btn.setChangeListener(this); add(btn); } public void fieldChanged(Field field, int context) { if (field == btn) { try { InputStream inputStream = null; //Get File Connection FileConnection fileConnection = (FileConnection) Connector.open(path); if (fileConnection.exists()) { inputStream = fileConnection.openInputStream(); //byte data[]=inputStream.toString().getBytes(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int j = 0; while((j=inputStream.read()) != -1) { baos.write(j); } byte data[] = baos.toByteArray(); inputStream.close(); fileConnection.close(); WriteFile("file:///SDCard/BlackBerry/pictures/org_Image.jpg",data); EncodedImage eImage = EncodedImage.createEncodedImage(data,0,data.length); int scaleFactorX = Fixed32.div(Fixed32.toFP(eImage.getWidth()), Fixed32.toFP(80)); int scaleFactorY = Fixed32.div(Fixed32.toFP(eImage.getHeight()), Fixed32.toFP(80)); eImage=eImage.scaleImage32(scaleFactorX, scaleFactorY); WriteFile("file:///SDCard/BlackBerry/pictures/resize.jpg",eImage.getData()); BitmapField bit=new BitmapField(eImage.getBitmap()); add(bit); } } catch(Exception e) { System.out.println("Exception is ==> "+e.getMessage()); } } } void WriteFile(String fileName,byte[] data) { FileConnection fconn = null; try { fconn = (FileConnection) Connector.open(fileName,Connector.READ_WRITE); } catch (IOException e) { System.out.print("Error opening file"); } if (fconn.exists()) try { fconn.delete(); } catch (IOException e) { System.out.print("Error deleting file"); } try { fconn.create(); } catch (IOException e) { System.out.print("Error creating file"); } OutputStream out = null; try { out = fconn.openOutputStream(); } catch (IOException e) { System.out.print("Error opening output stream"); } try { out.write(data); } catch (IOException e) { System.out.print("Error writing to output stream"); } try { fconn.close(); } catch (IOException e) { System.out.print("Error closing file"); } } }

    Read the article

  • How do I specify an action on a resource in a namespace in rails 3?

    - by harald
    I have a resource :products in a namespace :shop, like this: namespace :shop do resources :products root :to => 'products#index' end When running rake routes it outputs the following: edit_shop_product GET /shop/products/:id/edit(.:format) {:action=>"edit", :controller=>"shop/products"} But when I use the edit_shop_product_path in a partial view, like this: <%= button_to "Edit", edit_shop_product_path(product) %> I get an ActionController Exception: No route matches "/shop/products/1/edit" What am I missing?

    Read the article

  • Massive Crawling requests from Google Apps Engine useragent

    - by SilentPlayer
    Hi friends, I'm badly affected with 'Google AppEngine-Google' UserAgent.. receiving 5/6 requests per second on http server. This bot is crawling my site just like GoogleBot does. Following is the sample of url in my access logs. 72.14.192.3 - - [19/May/2010:01:27:06 +0000] "GET /some-url/etc-123.htm HTTP/1.1" 200 4707 "-" "AppEngine-Google; (+http://code.google.com/appengine; appid: harpy000)" I have checked the ip address it is registered with Google Inc. Can anyone tell me where i can report Abuse to Google Inc. Or any information about this issue. Thank you!

    Read the article

  • Trouble editing Word document with PHP

    - by bhoomi-nature
    I want to open a word document and edit it I am opening the word document from the server and at that time it's opening with garbage values (perhaps it's not being properly converted to UTF-8). When I delete those garbage values and insert something from a textarea to that file it is going to insert and from then on it opens properly. I would like the document to open with the English words in the document instead of garbage value - it's only the first opening that's broken at present. <? $filename = 'test.doc'; if(isset($_REQUEST['Submit'])){ $somecontent = stripslashes($_POST['somecontent']); // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'w')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened fi<form action="" method="get"></form>le. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename) <a href=".$_SERVER['PHP_SELF']."> - Continue - "; fclose($handle); } else { echo "The file $filename is not writable"; } } else { // get contents of a file into a string $handle = fopen($filename, 'r'); $somecontent = fread($handle, filesize($filename)); ?> <h1>Edit file <? echo $filename ;?></h1> <form name="form1" method="post" action=""> <p> <textarea name="somecontent" cols="80" rows="10"><? echo $somecontent ;?></textarea> </p> <p> <input type="submit" name="Submit" value="Submit"> </p> </form> <? fclose($handle); } ?>

    Read the article

  • What weird encoding is movistar Venezuela sms on blackberry using?

    - by cjp
    Send an sms using the normal GSM TextMessage API on the BlackBerry, get back garbage. It's not unicode, phone is set to 7-bit send. Byte size is only off by one. Is there some default crypto thing, or some weird encoding they use? This code works most everywhere else in the world; this definitely seems like a movistar problem. The string that comes back is random 7-bit ascii except for a few high order bytes. Needless to say the source input text is totally 7 bit chars, which should work in sms, ISO-8859 and look the same in UTF charsets. Anybody seen this or got sms working in code on movistar VZ blackberries?

    Read the article

  • How to make a random number generator in matlab that is based on percentages?

    - by Ben Fossen
    I am currently using the built in random number generator. for example nAsp = randi([512, 768],[1,1]); 512 is the lower bound and 768 is the upper bound, the random number generator chooses a number from between these two values. What I want is to have two ranges for nAsp but I want one of them to get called 25% of the time and the other 75% of the time. Then gets plugged into he equation. Does anyone have any ideas how to do this or if there is a built in function in matlab already? for example nAsp = randi([512, 768],[1,1]); gets called 25% of the time nAsp = randi([690, 720],[1,1]); gets called 75% of the time

    Read the article

  • Visual Studio add-in to quickly test a code snippet

    - by Matti Virkkunen
    One thing I really love about languages such as Python is that if you have a piece of code you'd like to try out, you can just open the interactive shell and do it in seconds. Is there a Visual Studio add-in that does the same for C#? Basically what I'm looking for is something that opens up a window or tab with a text editor (preferably with code completion, because VS does it so nicely) and a button that runs the code and displays the output. Extra points for convenience features such as displaying complex output in a user-friendly way (think Firebug's console.log), automatically referencing all the assemblies the current project references, etc. I tried googling for a while, but either I fail at coming up with good keywords, or no-one has made an add-in like this. If there really is none, I'm considering making one myself.

    Read the article

  • NServiceBus Testing Framework and NAnt Issue?

    - by user344775
    Hi Guys, This is my first post here, and I'm new to NService Bus world. After play around for a couple days, and found that it's really powerful framework to creat service and easy to use. :) Now, I came across a small question. I created a project which uses NServiceBus, it got normal message handlers and Saga handlers. And also I created a couple tests around these with NServiceBus.Testing framework. It all works fine when I run the tests via ReSharper Test Runner works and NUnit console, they all works fine, but when I include them into NAnt build script, it throw the following exception: System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. at System.Reflection.Module.GetTypesInternal(StackCrawlMark& stackMark) at System.Reflection.Assembly.GetTypes() at NServiceBus.Configure.<c_DisplayClass1.b__0(Assembly a) at System.Array.ForEach[T](T[] array, Action`1 action) at NServiceBus.Configure.With(Assembly[] assemblies) at NServiceBus.Configure.With(String probeDirectory) at NServiceBus.Configure.With() at NServiceBus.Testing.Test.Initialize() Any ideas? Thanks a lot.

    Read the article

  • selecting rows with unidentical values appearing in two different columns in R

    - by bazon
    Hi, I need to create a new data frame that excludes dams that appear in "dam1" and "dam2" columns on the same fosdate (fostering date). I tried df <- df[df$dam1!=dam2,] but could not work. dam1 and dam2 are dam or mother id's. my df: fosdate dam1 dam2 8/09/2009 2Z523 2Z523 30/10/2009 1W509 5C080 30/10/2009 1W509 5C640 30/10/2009 1W509 1W509 1/10/2009 1W311 63927 The new data frame that I need to get is: dfnew: fosdate dam1 dam2 30/10/2009 1W509 5C080 30/10/2009 1W509 5C640 1/10/2009 1W311 63927 Thanks, Bazon

    Read the article

  • jquery looping include php

    - by mapet
    Jquery Code: $(function() { $("#submit").click(function(){ var pilaMan = 2; for (i=0; i < pilaMan; i++) { $('#dialog_link').dialog({ modal: false, autoOpen: false, width: 800, height: 300, buttons: { "Ok": function() { $(this).dialog("close"); }, "Cancel": function() { $(this).dialog("close"); } } }); $('#dialog' + i).click(function(){ $('#dialog_link' ).dialog('open'); var lineCode = $('#lineCode').currentElem.prev().val(); alert(lineCode); return false; }); } }); My Problem with my jquery Code i cant get the exact value of $amew.. and also when i alert the lineCode it will return undefined :( php code: $amew = "loso, nimo"; $count = 0; $array = explode(" ", $amew) foreach ($array as $value) { echo '<td width="68" class="rep" id="dialog'.$count.'">'; echo '<input type="text" id="lineCode'" value="'.$value.'">'; echo '</td'; } my problem with my php code is so redundant my jquery codes i solving this for 10 hours and still i cant get it need help guys:(

    Read the article

  • How to do cleanup reliably in python?

    - by Cheery
    I have some ctypes bindings, and for each body.New I should call body.Free. The library I'm binding doesn't have allocation routines insulated out from the rest of the code (they can be called about anywhere there), and to use couple of useful features I need to make cyclic references. I think It'd solve if I'd find a reliable way to hook destructor to an object. (weakrefs would help if they'd give me the callback just before the data is dropped. So obviously this code megafails when I put in velocity_func: class Body(object): def __init__(self, mass, inertia): self._body = body.New(mass, inertia) def __del__(self): print '__del__ %r' % self if body: body.Free(self._body) ... def set_velocity_func(self, func): self._body.contents.velocity_func = ctypes_wrapping(func) I also tried to solve it through weakrefs, with those the things seem getting just worse, just only largely more unpredictable. Even if I don't put in the velocity_func, there will appear cycles at least then when I do this: class Toy(object): def __init__(self, body): self.body.owner = self ... def collision(a, b, contacts): whatever(a.body.owner) So how to make sure Structures will get garbage collected, even if they are allocated/freed by the shared library? There's repository if you are interested about more details: http://bitbucket.org/cheery/ctypes-chipmunk/

    Read the article

  • date picker in asp.net mvc

    - by Renu123
    i have basic date picker but i wank to add image as icon for date picker i have done it with the helper but now how can provide selecting year facility to the user if he want to select year 1986 then how much time he want to click so i want to add selecting year facility with icon date picker. if any one konws please tell me thanks in advance.

    Read the article

  • Show the progress of commiting

    - by Vepr
    I need to show a process of commiting my files to the svn. I use vs2008 C#.I take a progress bar, but when I am starting commiting, I don't know how to show my progress(also I want to look what file is uploading now in a label for example)

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >