Search Results

Search found 5192 results on 208 pages for 'random forests'.

Page 86/208 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • List to CSV in Python

    - by Steve
    Hi, I am creating a CSV from a list of values. CSV File gets created but the csv is formed as a single column. Actually it should be multiple rows with multiple columns, instead it forms as a multiple rows with a single column. I am using the following code from random import choice import csv fileObject = csv.writer(open('Insurance.csv','w'),dialect='excel',delimiter=' ') for i in range(0,175): current_list = list(choice(master_list)) fileObject.writerows(current_list) current_list = [] Thanks

    Read the article

  • Find items is SSRS by Id

    - by chief7
    How do you find items in SSRS by ID? I tried to use the id returned by another find result, a new guid to string and small random string all of which return the same error: The ID field has a value that is not valid. --- Microsoft.ReportingServices.Diagnostics.Utilities.InvalidElementException: The ID field has a value that is not valid. Here is the code: var request = new FindItemsRequest { Conditions = new[] { new SearchCondition { Name = "ID", Value = "test"} }, Folder = "/" }; return _ssrsService .FindItems(request) .Items I'm using SSRS 2005.

    Read the article

  • Perl vs Python but with more style than normally

    - by user350571
    I'm learning perl and everytime I search for perl stuff in the internet I get some random page with people saying that perl should die because code written in it looks like a lesson in steganography. Then they say that python is clean and stuff like that. Now, I know that those comparisons are always stupid and made by fellows that feel that languages are a extension of their boring personality so, let me ask instead: can you give me the implementation of a widely known algorithm to deal with a data structure like red-black trees in both languages so I can compare?

    Read the article

  • Reservoir sampling

    - by Codenotguru
    to retrieve k random numbers from an array of undetermined size we use a technique called reservoir sampling. Can anybody briefly highlight how it happens with a sample code??

    Read the article

  • "'" is displayed as u0027 in facebook app - how to fix that?

    - by Imageree
    I have a facebook app that is displaying random quotes - it is written in php. One quote in the database looks like this: "There's only one rule in photography - never develop colour film in chicken noodle soup. - Freeman Patterson" When it is seen on facebook it looks like this: "Thereu0027s only one rule in photography - never develop colour film in chicken noodle soup. - Freeman Patterson" How do I fix it?

    Read the article

  • Deleting items from a ListView using a custom BaseAdapter

    - by HXCaine
    I am using a customised BaseAdapter to display items on a ListView. The items are just strings held in an ArrayList. The list items have a delete button on them (big red X), and I'd like to remove the item from the ArrayList, and notify the ListView to update itself. However, every implementation I've tried gets mysterious position numbers given to it, so for example clicking item 2's delete button will delete item 5's. It seems to be almost entirely random. One thing to note is that elements may be repeated, but must be kept in the same order. For example, I can have "Irish" twice, as elements 3 and 7. My code is below: private static class ViewHolder { TextView lang; int position; } public View getView(final int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.language_link_row, null); holder = new ViewHolder(); holder.lang = (TextView)convertView.findViewById(R.id.language_link_text); holder.position = position; final ImageView deleteButton = (ImageView) convertView.findViewById(R.id.language_link_cross_delete); deleteButton.setOnClickListener(this); convertView.setTag(holder); deleteButton.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.lang.setText(mLanguages.get(position)); return convertView; } I later attempt to retrieve the deleted element's position by grabbing the tag, but it's always the wrong position in the list. There is no noticeable pattern to the position given here, it always seems random. // The delete button's listener public void onClick(View v) { ViewHolder deleteHolder = (ViewHolder) v.getTag(); int pos = deleteHolder.position; ... ... ... } I would be quite happy to just delete the item from the ArrayList and have the ListView update itself, but the position I'm getting is incorrect so I can't do that. Please note that I did, at first, have the deleteButton clickListener inside the getView method, and used 'position' to delete the value, but I had the same problem. Any suggestions appreciated, this is really irritating me.

    Read the article

  • Where are the TweetDeck settings-files located in (ubuntu-) linux?

    - by Philipp Andre
    Hi Everybody, i'm running Windows as well as Ubuntu and like to sync both tweetdeck installations via dropbox. Therefore i need to locate two files: td_26_[username].db preferences_[username].xml I found them on windows under the folder c:\Users[account]\AppData\Roaming\TweetDeckFast.[random string]\Local Store\ But i can't find them on my ubuntu installation. Does anyone know where these files are located? Best Regards Philipp

    Read the article

  • Per Application Packet Analyzer

    - by Anindya Chatterjee
    Is there any tool which can analyze network traffic per application? Wireshark does not have per application filtering, fiddler also does not give proper logging for any application. So can anyone please help me out to find an app which can analyze network traffic originating from a random application and log the traffic for that particular application only?

    Read the article

  • Simulating a 6-faced die in Ada-2005

    - by Arkapravo
    Dear Friends ! I have very definitively come across the 'simulating a 6-faced die' (which produces a random integer between 1 and 6, all outcomes are equally probable) in Java, Python, Ruby and Bash. However, I am yet to see a similar program in Ada. Has anyone come across one ? Kind regards Arkapravo

    Read the article

  • Perl vs Python: implementation of algorithms to deal with advanced data structures

    - by user350571
    I'm learning perl and everytime I search for perl stuff in the internet I get some random page with people saying that perl should die because code written in it looks like a lesson in steganography. Then they say that python is clean and stuff like that. Now, I know that those comparisons are always stupid and made by fellows that feel that languages are a extension of their boring personality so, let me ask instead: can you give me the implementation of a widely known algorithm to deal with a data structure like red-black trees in both languages so I can compare?

    Read the article

  • iPhone: value of selectedIndex for tab should be consistent, but isn't

    - by Janine
    This should be so simple... but something screwy is happening. My setup looks like this: MainViewController Tab Bar Controller 4 tabs, each of which loads WebViewController My AppDelegate contains an ivar, tabBarController, which is connected to the tab bar controller (this was all set up in Interface Builder). The leftmost tab is marked "selected" in IB. Within the viewWillAppear method in WebViewController, I need to know which tab was just selected so I can load the correct URL. I do this by switching on appDelegate.tabBarController.selectedIndex. When the app first runs and the leftmost tab is selected, selectedIndex is a large garbage value. After that, I get values from 0 to 3, which is as it should be, but they are in random order. Not only that, but each tab I touch reports a different value each time. This app is extremely simple right now and I can't imagine what I could have done to make things go this wrong. Has anyone seen (and hopefully solved) this behavior? Update: we have a request for code. There's not much to see. The tab bar controller gets loaded in applicationDidFinishLaunching: [self.mainViewController view]; //force nib to load [self.window addSubview:self.mainViewController.tabBarController.view] There is currently no code whatsoever in MainViewController.m other than the synthesize and release for tabBarController. From WebVewController.m: - (void)viewWillAppear:(BOOL)_animation { [super viewWillAppear:_animation]; NSURL *url; switch([S_UIDelegate mainViewController].tabBarController.selectedIndex) { case 0: url = [NSURL URLWithString:@"http://www.cnn.com"]; break; case 1: url = [NSURL URLWithString:@"http://www.facebook.com"]; break; case 2: url = [NSURL URLWithString:@"http://www.twitter.com"]; break; case 3: url = [NSURL URLWithString:@"http://www.google.com"]; break; default: url = [NSURL URLWithString:@"http://www.msnbc.com"]; } NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView loadRequest:request]; } This is where I'm seeing the random values.

    Read the article

  • Dynamically inserted input elements not showing up in ActionResult's FormCollection parameter

    - by roosteronacid
    I am adding input elements to a view, dynamically, using JavaScript. But I am unable to find those inputs in my ActionResult's FormCollection parameter...: public ActionResult Del(FormCollection fc) I am able to find static input elements in the View. And using FireBug in Mozilla FireFox, I can see that the inputs are inside of the form element, in the DOM, and are not floating around somewhere random. How can I access these inputs?

    Read the article

  • AES code throwing NoSuchPaddingException: Padding NoPaddin unknown

    - by Tom Brito
    The following code is a try to encrypt data using AES with asymmetric key: import java.io.OutputStream; import java.math.BigInteger; import java.security.Key; import java.security.KeyFactory; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import java.security.spec.RSAPrivateKeySpec; import java.security.spec.RSAPublicKeySpec; import javax.crypto.Cipher; public class AsyncronousKeyTest { private final Cipher cipher; private final KeyFactory keyFactory; private final RSAPrivateKey privKey; private AsyncronousKeyTest() throws Exception { cipher = Cipher.getInstance("AES/CBC/NoPaddin", "BC"); keyFactory = KeyFactory.getInstance("AES", "BC"); // create the keys // TODO should this numbers be random? RSAPrivateKeySpec privKeySpec = new RSAPrivateKeySpec(new BigInteger( "d46f473a2d746537de2056ae3092c451", 16), new BigInteger("57791d5430d593164082036ad8b29fb1", 16)); privKey = (RSAPrivateKey) keyFactory.generatePrivate(privKeySpec); } public void generateAuthorizationAct(OutputStream outputStream) throws Exception { // TODO Ticket #14 - GenerateAuthorization action KeyFactory keyFactory = KeyFactory.getInstance("AES", "BC"); // TODO should this numbers be random? RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(new BigInteger("d46f473a2d746537de2056ae3092c451", 16), new BigInteger("11", 16)); RSAPublicKey pubKey = (RSAPublicKey) keyFactory.generatePublic(pubKeySpec); byte[] data = new byte[] {0x01}; byte[] encrypted = encryptAO(pubKey, data); outputStream.write(encrypted); } /** Encrypt the AuthorizationObject. */ public byte[] encryptAO(Key pubKey, byte[] data) throws Exception { cipher.init(Cipher.ENCRYPT_MODE, pubKey); byte[] cipherText = cipher.doFinal(data); return cipherText; } public byte[] decrypt(byte[] cipherText) throws Exception { cipher.init(Cipher.DECRYPT_MODE, privKey); byte[] decyptedData = cipher.doFinal(cipherText); return decyptedData; } public static void main(String[] args) throws Exception { System.out.println("start"); AsyncronousKeyTest auth = new AsyncronousKeyTest(); auth.generateAuthorizationAct(System.out); System.out.println("done"); } } but at line cipher = Cipher.getInstance(AesEncrypter.getTransformation(), "BC"); it throws NoSuchPaddingException: Padding NoPaddin unknown. What is this? And how to solve?

    Read the article

  • Could it be that the stack size of a Web Service is smaller than that of a Window Application?

    - by mouthpiec
    Hi, I have a program that includes a recursive function. This function when executed in a Windows Application works just fine, and when used in a Webservice, it works fine when the webservice is initiated by the VS (it assigns a random port), but this function return a stackoverflow error when the webservice is published. (note that the machine used is the same, hence it is published on my pc). Could it be that the stack size of a Web Service is smaller than that of a Window Application?

    Read the article

  • Any specifications/docs around optimization of Google Apps Script, to avoid timeouts and "hangs"

    - by BruceM
    From my experience so far, it seems that if you write a script that makes lots of expensive calls close together, the functionality just "hangs", or you get inconsistent responses, and have to refresh the browser because sheets stop updating etc. Are there any docs or specs that clarify this, as releasing an app fr real-world use is not possible if users can expect it to work most of the time, and produce random results every now and then...

    Read the article

  • Loading external pngs into an AS2 swf that is loaded into an AS3 swf wrapper

    - by James Fassett
    I have a Wrapper SWF that loads a series of AS2 movies. Each AS2 movie loads a series of .png files. AS3_wrapper.swf |-> AS2_1.swf |-> image_1.png |-> image_2.png |-> AS2_2.swf |-> image_1.png |-> image_2.png Inside of the AS2 I listen for the load of the pngs using onLoadInit and update my UI. This works fine for the first AS2 swf. But when I load the second AS2 swf the onLoadInit isn't triggered for the pngs. My guess is that the images are in a cache or something like that. I put a random string on the end of the request to try and avoid the cache but that doesn't seem to work. The code in the as2 looks roughly like this: var flagLoader:MovieClipLoader = new MovieClipLoader(); var listener:Object = new Object(); listener.onLoadInit = Delegate.create(this, handleImageLoad); flagLoader.addListener(listener); var row:MovieClip = frame1["row" + (numLoaded + 1)]; flagLoader.loadClip(predictionData[numLoaded].flag + "?r="+Math.random(), row.flag); I'm making sure to load only one image at a time (I've read anecdotal evidence loading more than one thing at a time can confuse the MovieClipLoader). For the first as2 file everything works great. When I load the second as2 file the handleImageLoad never gets called. Update: Even more perplexing is if I reload the first AS2 movie (after the second AS2 movie fails to load the images) the first AS2 movie loads the images again fine. Update 2: After trying to change from using a MovieClipLoader to polling (as was helpfully suggested) I have found some more evidence that is relevant. When I load the first AS2 files and trace from the top level clip it prints out _root. The second AS2 file when loaded traces the same _root. This lead me to check if they were clashing on names and they are. Both have a child called frame. The first one, when I trace it comes out as _root.frame as expected. The second AS2 file traces _level0.instance3.instance118.instance111.frame. I'm guessing this is related to the problem. Flash is keeping the _root of the two files the same but it is changing the locations of their children (for subsequently loaded files that have children with the same names). So either the onLoad is going to the wrong clip or the events about it loading are.

    Read the article

  • Looking for an algorithm that will show how to fit the most boxes in a container.

    - by Abe Miessler
    I've been interested in writing an application that will show how to fit boxes (of random dimensions) in a container so there is as little space as possible left. A real life example would be something that would tell you how to use the most space in a UPS truck. Does anyone know of a good place to start for something like this? Is there an existing algorithm that does something similar to what I'm talking about?

    Read the article

  • Fluid Design bugs in ie7

    - by Qwibble
    Hey guys, I've created a dummy layout for my latest design, but when I resize the window in ie7 to check that the min-width works, it kicks the content area to below the sidebar, whereas in all other browsers (including ie6) it behaves exactly as it should do. Demo Link Can anyone see what the problem is that's causing this random couple extra pixels that kick it off?

    Read the article

  • JQuery UI Autocomplete - disallow free text entry?

    - by JK
    Is it possible to disallow free text entry in the JQuery UI autocomplete widget? eg I only want the user to be allowed to select from the list of items that are presented in the autocomplete list, and dont want them to be able to write some random text. I didn't see anything in the demos/docs describing how to do this. http://jqueryui.com/demos/autocomplete/ I'm using autocomplete like this $('#selector').autocomplete({ source: url, minlength: 2, select: function (event, ui) { // etc }

    Read the article

  • Number of threads and thread numbers in Grand Central Dispatch

    - by raphgott
    I am using C and Grand Central Dispatch to parallelize some heavy computations. How can I get the number of threads used by GCD? Also is it possible to know on which thread a piece of code is currently running on? Basically I'd like to use sprng (parallel random numbers) with multiple streams and for that I need to know what stream id to use (and therefore what thread is being used).

    Read the article

  • How to make an image randomizer from gallery directory?

    - by zebraman
    Hello, I would like to make a image randomizer/slider that randomly displays an image from a designated gallery and has controls to view the next/previous image. I have seen this done where images must be coded into arrays, but I would like to be able to just drop images into a /img/gallery directory and have the randomizer/slider pull random images from that directory. Could anyone offer some guidance on how to do this, possibly using jQuery, or refer me to a tutorial that does something like this?

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >