Search Results

Search found 2013 results on 81 pages for 'matt lewis'.

Page 63/81 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • Java: Generating distribution of values in an ArrayList

    - by Matt
    Hi all, I have a sorted ArrayList of values. I would like to get the distribution of the values. For example: Say I have 500 values, ranging from 1-100. I want to break them up into groups, say 10 groups: values 1-10, 11-20, 21-30, etc... I want the counts of each of the 500 values that fall into each category. For example, 5 of the 500 are valued at 1-10, 20 between 11-20, etc... However, I do not know the ranges of values in my ArrayList, it could be ranging from 1-30 or 1-200, but I want to break it up into, for example, 10 groups. Does anyone know how to do this?

    Read the article

  • Is there a way to give a subquery an alias in Oracle 11g SQL?

    - by Matt Pascoe
    Is there a way to give a subquery in Oracle 11g an alias like: select * from (select client_ref_id, request from some_table where message_type = 1) abc, (select client_ref_id, response from some_table where message_type = 2) defg where abc.client_ref_id = def.client_ref_id; Otherwise is there a way to join the two subqueries based on the client_ref_id. I realize there is a self join, but on the database I am running on a self join can take up to 5 min to complete (there is some extra logic in the actual query I am running but I have determined the self join is what is causing the issue). The individual subqueries only take a few seconds to complete by them selves. The self join query looks something like: select st.request, st1.request from some_table st, some_table st1 where st.client_ref_id = st1.client_ref_id;

    Read the article

  • ruby inject recursion?

    - by Matt Humphrey
    the goal is to start with ['a','b','c'] and end up with {'a'={'b'={'c'={}}}} so, getting my bearings, i did this: ruby-1.8.7-p174 ['a','b','c'].inject({}){|h,v| h.update(v = {})} = {"a"={}, "b"={}, "c"={}} and then figured, if i actually pass on the result hash, it will recurse and nest, but: ruby-1.8.7-p174 ['a','b','c'].inject({}){|h,v| h.update(v = {}); h[v]} = {} why is this? any idea how to achieve the desired result in an elegant one-liner?

    Read the article

  • Javascript recursive data structure definition

    - by Matt Bierner
    I need to define a data structure recursively in Javascript. Here is a simple example of a circular linked list: // List a very simplified example of what the actual (non list) code does. function List(f, r) { return function(){ return [f, r]; }; } var head = List('a', List('b', List('c', head))); When this is executed, head in List 'c' is resolved to undefined, not List 'a' as I need. List is an example function that returns a function (It is not an Javascript list that I can append to). I tried to wrap the definition of head is a self executing named function, but that blew the stack when head was resolved. What is the Javascript style solution that I am overlooking?

    Read the article

  • Trying to dynamically expand different divs with one function

    - by Matt Nathanson
    I'm trying to be able to dynamically expand / collapse multiple divs with the same code.... it's controlled with the click of a span (toggle) and then i'm trying to get the next id(the div that would slide up and down) $('span').toggle( function() { $('#albumholder').slideToggle(600); $(this).html('-');}, function() { $('#albumholder').slideToggle(600); $(this).html('+');} ); This code works to expand 1 div... but assume i have a divs #downloadholder#linksholderetc... How can i achieve the same effect with the same code? Thanks!

    Read the article

  • _NSAutoreleaseNoPool Breaking but No Helpful Stack Trace

    - by Matt Long
    I am getting the message: * _NSAutoreleaseNoPool(): Object 0x3f43660 of class UICFFont autoreleased with no pool in place - just leaking I have placed a break point using the symbol _NSAutoreleaseNoPool and the program does break, however, the stack trace does not show me any of my code only some UIView and Core Animation layer code. Is there a better way to get to the bottom of the issue? There is apparently a thread that does not have an auto release pool, but I can't figure out where. Thanks.

    Read the article

  • PHP IIS problems downloading file says it is corrupt

    - by Matt
    Hi, I am running PHP on IIS 6 with mssql. I have uploaded a file to my webserver through a php script. Upon checking the file on the server the file is ok and not corrupt. However, when i then have a link on my website to try and download the file, it says the file is corrupt. I know the file isnt corrupt as i can view it perfectly if i look at the file on the server. Is seems like this is a common problem as a similar problem was posted here: http://www.bigresource.com/Tracker/Track-php-1pAakBhT/ Any help would be much appreciated. Thanks, M My download code is as follows: $filesize = $rows->filesize; $filepath = $rows->filepath; header("Content-Disposition: attachment; filename=$filename"); header("Content-length: $filesize"); header("Content-type: application/pdf"); header("Cache-control: must-revalidate"); header("Content-Description: PHP Generated Data"); readfile($filepath);

    Read the article

  • Alter stored procedure if condition is met

    - by Matt
    I am looking to alter a stored procedure if a condition exists. I want to leave the stored procedure as is if the condition is not met, so drop/create is not really an option. Trying to put the contents of ALTER PROC inside an IF block is throwing up errors for me. Any thoughts?

    Read the article

  • How to fetch, display Amazon Marketplace listings by item?

    - by Matt G.
    Hi all, My question pretty much says it all: I'm looking for a way to display Amazon Marketplace listings based on an item lookup. Example: If I do a call to ItemLookup with an ASIN of 0590353403 (Harry Potter and the Sorcerer's Stone), I'm looking for a result set of perhaps the top ten new or used Marketplace listings, preferably with seller information attached. I apologize if this is clearly documented somewhere, but I have been looking all through the Amazon API docs and on Google to no avail. StackOverflow doesn't seem to have any Related Questions that match what I'm asking, either. Thanks in advance!

    Read the article

  • .NET make a copy of an embedded file resource to the local drive

    - by Matt H.
    Hi, i'm new to the realm to working with Files in .NET I'm creating a WPF application in VB.NET with the 3.5 Framework. (If you provide an example in C#, that's perfectly fine.) In my project I have a Template for an MS Access database. My desired behavior is that when the users clicks File--New, they can create a new copy of this template, give it a filename, and save it to their local directory. The database already has the tables and some starting data needed to interface with my application (a user-friendly data editor) I'm thinking the approach is to include this "template.accdb" file as a resource in the project, and write it to a file somehow at runtime? Any guidance will be very, very appreciated. Thanks!

    Read the article

  • Class<T> and static method Class.forName() drive me crazy.

    - by matt
    Hi, this code doesn't compile. I'm wondering what I am doing wrong: private static Importable getRightInstance(String s) throws Exception { Class<Importable> c = Class.forName(s); Importable i = c.newInstance(); return i; } where Importable is an interface and the string s is the name of an implementing class. The compiler says: ./Importer.java:33: incompatible types found : java.lang.Class<capture#964 of ?> required: java.lang.Class<Importable> Class<Importable> c = Class.forName(format(s)); thanks for any help! All the solutions Class<? extends Importable> c = Class.forName(s).asSubclass(Importable.class); and Class<? extends Importable> c = (Class<? extends Importable>) Class.forName(s); and Class<?> c = Class.forName(format(s)); Importable i = (Importable)c.newInstance(); give this error: Exception in thread "main" java.lang.IncompatibleClassChangeError: class C1 has interface Importable as super class where C1 is effectively a class implementing Importable, one of those i want to cast to Importable.

    Read the article

  • Get String Value from NSDictionary

    - by Matt S.
    I have the following code: NSMutableDictionary *jsonObj = [parser objectWithString:json_string error:nil]; NSString *test = [[[jsonObj objectForKey:@"questions"] valueForKey:@"owner"] valueForKey:key]; but what I get back is: ( 1a19f089a2bc4ee42bff1c102c6e89b8 ) The actual value is fine, but I get those parenthesis, which show up in my string. How can I get rid of them?

    Read the article

  • Best programming based games

    - by Matt Sheppard
    Back when I was at school, I remember tinkering with a Mac game where you programmed little robots in a sort of pseudo-assembler language which could then battle each other. They could move themselves around the arena, look for opponents in different directions, and fire some sort of weapon. Pretty basic stuff, but I remember it quite fondly, even if I can't remember the name. Are there any good modern day equivalents?

    Read the article

  • Maven - Eclipse does not see dependencies

    - by Matt
    I have a project in eclipse, that is unable to see maven dependencies. What is odd is when I build from the command line the build completes fine. They are both pointed at the same repository. I would think that it is something with maven or project configuration but I have been through every piece with no success. I would appreciate any help on this one. ps using m2eclipse

    Read the article

  • Getting a permission error when trying to connect to sql database

    - by Matt
    I have a sql server on a dedicated machine, running SQL 2008. I have the IP of the box, a database setup on it. I've built a small script that just does a connection test, and when I run it, I get the following error. Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. I've been told by the admin that SQL remote access has been granted for my IP address. Anybody know what's wrong?

    Read the article

  • Java - Incrementing through IP addresses in String format

    - by Matt
    I'm new to java and i'm trying to find a way of incrementing through an user input IP address range. For example from 192.168.0.1 to 192.168.0.255. However the way my application works at the moment is the take the from and to ip addresses as a String. Is there a way I can increment through all the ip addresses the user input from and to? Hope this makes sense and please dont flame me, I have looked for an answer!

    Read the article

  • Execute 'stty raw' command in same terminal?

    - by Matt
    I'm trying to put the console into "raw" mode in Java. I understand this will only work on UNIX. I'm using the command stty raw If I type the command into the terminal directly, it does what it's supposed to do. In Java, I try to set the mode like this: Runtime.getRuntime().exec("stty raw"); But the terminal does not go into raw mode. I have a feeling this is because Java is just executing the command in a virtual terminal in the background or something, rather than the active terminal. Is there a way to do this?

    Read the article

  • Architecture for multiple web apps and databases.

    - by Matt
    We used to have only one web app, but now we are breaking it down into multiple ones. Each one will be packaged as separate product (web app) Some have things in common some do not. It was originally coded with php and using Postgresql 8.4 and CodeIgniter as the framework. I am looking for some good suggestions on how I should set up multiple web apps. They all have their own somewhat unique data. Some data in the databases can be common to some apps but not all. All the apps will be on one server and will have some kind of API to manipulate data. I want it to be structured such that one User account can access any product they purchase. (kinda like google accounts) I do not know if its a good idea to have multiple database, or just to have one big one. eventually we will be using S3 for some videos and other images. Your thoughts and suggestions are much appreciated.

    Read the article

  • How do you convert date taken from a bash script to milliseconds in java program?

    - by Matt Pascoe
    I am writing a piece of code in java that needs to take a time sent from a bash script and parse the time to milliseconds. When I check the millisecond conversion on the date everything is correct except for the month I have sent which is January instead of March. Here is the variable I create in the bash script, which later in the script I pass to the java program: TIME=`date +%m%d%Y_%H:%M:%S` Here is the java code which parses the time to milliseconds: String dt = "${scriptstart}"; java.text.SimpleDateFormat scriptStart = new java.text.SimpleDateFormat("MMDDyyyy_HH:mm:ss"); long start = scriptStart.parse(dt).getTime(); The goal of this statement is to find the elapsed time between the start of the script and the current system time. To troubleshoot this I printed out the two: System Time = 1269898069496 (converted = Mon Mar 29 2010 16:27:49 GMT-0500 (Central Daylight Time)) Script Start = 03292010_16:27:45 Script Start in Milli = 1264804065000 (Converted = Fri Jan 29 2010 16:27:45 GMT-0600 (Central Standard Time))

    Read the article

  • Exporting and reformatting data out of MS Excel

    - by Matt H
    I have a huge Excel spreadsheet containing telephone calling rates to a number of different countries. The format of the columns is: Country, RateLocality, Prefixes, Rate, Wholesale e.g. Afganistan, Default, 93;930;931;9321;9322;9323;9324;9325;9326;9327;9328;9329;9331;9332;9333;9334;9335;9336;9337;9338;9339;9341;9342;9343;9344;9345;9346;9347;9348;9349;9351;9352;9353;9354;9355;9356;9357;9358;9359;9361;9362;9363;9364;9365;9366;9367;9368;9369;9371;9372;9373;9374;9376;938;939; $ 1.023, $0.455 These rates change every so often and I need to get them into another system that can import them using CSV. The eventual format is: LD PREPEND CODE ie. 00 or 011,CountryCode,Area Code,Comment,Connect Cost,Included Seconds,Per Minute Cost,Pricelist,Increment So to convert that above line I'd have 00,"Afganistan",93,"Default",1.023,60,1.023,10 00,"Afganistan",931,"Default",1.023,60,1.023,10 ... 00,"Afganistan",939,"Default",1.023,60,1.023,10 Where 00, 60 and 10 are hard coded and merged with the other data from excel. How can I export this data into the required format given that I need to reformat it as it goes. Should I export to XML and use XSLT or some other process to massage the data into CSV? If that is the case, how do I do it simply and quickly.

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >