Search Results

Search found 1862 results on 75 pages for 'matt argyle'.

Page 58/75 | < Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >

  • In C# how can I serialize a List<int> to a byte[] in order to store it in a DB field?

    - by Matt
    In C# how can I serialize a List to a byte[] in order to store it in a DB field? I know how to serialize to a file on the disk, but how do I just serialize to a variable? Here is how I serialized to the disk: List<int> l = IenumerableofInts.ToList(); Stream s = File.OpenWrite("file.bin"); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(s, lR); s.Close(); I'm sure it's much the same but I just can't wrap my head around it.

    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

  • 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

  • Get local network interface addresses using only proc?

    - by Matt Joiner
    How can I obtain the (IPv4) addresses for all network interfaces using only proc? After some extensive investigation I've discovered the following: ifconfig makes use of SIOCGIFADDR, which requires open sockets and advance knowledge of all the interface names. It also isn't documented in any manual pages on Linux. proc contains /proc/net/dev, but this is a list of interface statistics. proc contains /proc/net/if_inet6, which is exactly what I need but for IPv6. Generally interfaces are easy to find in proc, but actual addresses are very rarely used except where explicitly part of some connection. There's a system call called getifaddrs, which is very much a "magical" function you'd expect to see in Windows. It's also implemented on BSD. However it's not very text-oriented, which makes it difficult to use from non-C languages.

    Read the article

  • Safe to cast pointer to a forward-declared class to its true base class in C++?

    - by Matt DiMeo
    In one header file I have: #include "BaseClass.h" // a forward declaration of DerivedClass, which extends class BaseClass. class DerivedClass ; class Foo { DerivedClass *derived ; void someMethod() { // this is the cast I'm worried about. ((BaseClass*)derived)->baseClassMethod() ; } }; Now, DerivedClass is (in its own header file) derived from BaseClass, but the compiler doesn't know that at the time it's reading the definition above for class Foo. However, Foo refers to DerivedClass pointers and DerivedClass refers to Foo pointers, so they can't both know each other's declaration. First question is whether it's safe (according to C++ spec, not in any given compiler) to cast a derived class pointer to its base class pointer type in the absence of a full definition of the derived class. Second question is whether there's a better approach. I'm aware I could move someMethod()'s body out of the class definition, but in this case it's important that it be inlined (part of an actual, measured hotspot - I'm not guessing).

    Read the article

  • Play local video with an HTML/Javascript based Adobe Air application

    - by Matt Wood
    I'm trying to add some video playback (that will be used for a tutorial) to my Adobe Air application. I'm not a Flex or Flash developer and my application is HTML/Javascript based, so I'm having trouble with some of the video solutions I've been able to find. Here is one of the examples I've found that is flex based: Playing local files with Air I've looked for a free flash video player that I could just embed. But the only one I've found I was unable to coerce to play files from my Air application directory. I was exited at the prospect of using the HTML5 video tag which I thought Air supported, but that also seems to not work. Can anyone recommend a free flash video player that I can embed? Or a solution that doesn't have to be built completely from flex?

    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

  • How do I get a title or some text to appear in a Silverlight mediaplayer when switching to FullScree

    - by Matt
    I am working on an ASP.NET website with VB.NET code-behind. I have a Silverlight mediaplayer object on one of the pages and the user may view that video in FullScreen mode. When changing to full-screen mode they are losing the title and chapter of the video series they are viewing. I have tried accessing properties and searched the web for examples on how I could put a title or some text over the player when in FullScreen mode to give the user an indication of where they are currently at while viewing each video. I am using OnClientMediaEnded to move through the videos after each video has ended so they are able to watch the whole series once in FullScreen mode. I am using a call to javascript in with this method to do that and want to know if there is any way to get a title or text up there and then change once the video switches to the next in the series? The controls on the player also go away when going into FullScreen mode so any help with that would be greatly appreciated as well. Thanks

    Read the article

  • How do you tell if a string contains another string in Unix shell scripting?

    - by Matt
    Hi all, I want to write a Unix shell script that will do various logic if there is a string inside of another string. For example, if I am in a certain folder, branch off. Could someone please tell me how to accomplish this? If possible I would like to make this not shell specific (i.e. not bash only) but if there's no other way I can make do with that. #!/bin/sh CURRENT_DIR=`pwd` if [ CURRENT_DIR contains "String1" ] then echo "String1 present" elif [ CURRENT_DIR contains "String1" ] then echo "String2 present" else echo "Else" fi

    Read the article

  • xml schema ........

    - by matt
    ive made an xml schema all the code basically and was wonder is there a way that the code genarates something like this http://www.novell.com/documentation/extend52/Docs/help/Director/books/PGImages/novell_portlet_xml_schema.gif and if i can then how do you do it?

    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

  • Is there a way to give a subquery an alias in Oracle 10g 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

  • How would I implement separate databases for reading and writing operations?

    - by Matt
    I am interested in implementing an architecture that has two databases one for read operations and the other for writes. I have never implemented something like this and have always built single database, highly normalised systems so I am not quite sure where to begin. I have a few parts to this question. 1. What would be a good resource to find out more about this achitecture? 2. Is it just a question of replicating between two identical schemas, or would your schemas differ depending on the operations, would normalisation vary too? 3. How do you insure that data written to one database is immediately available for reading from the second? Any further help, tips, resources would be appreciated. Thanks.

    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

  • 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

  • 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

  • How can I get my div id to reload via ajax and jquery

    - by Matt Nathanson
    I'm creating a CMS using jQuery and AJAX. When I click, my "Add Campaign" buttom, it creates a unique client ID in the DB and on a hard reload, the new client shows up in its container. I am trying to use ajax to reload the container on the fly and I'm not having the exact luck i am hoping for. I can get it to reload, but it's like it's pulling in descriptions of each of the clients as well! function AddNewClient() { dataToLoad = 'clientID=' + clientID + '&addClient=yes'; $.ajax({ type: 'post', url: '/clients/controller.php', datatype: 'html', data: dataToLoad, target: ('#clientssidebar'), async: false, success: function(html){ $('#clientssidebar').html(html); }, error: function() { alert('An error occured!'); } }); };

    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

  • 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

< Previous Page | 54 55 56 57 58 59 60 61 62 63 64 65  | Next Page >