Search Results

Search found 1903 results on 77 pages for 'james wenday'.

Page 51/77 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • How to sort a list so that managers are always ahead of their subordinates (How do I do a topologica

    - by James Black
    I am working on a project using Groovy, and I would like to take an array of employees, so that no manager follows their subordinates in the array. The reason being that I need to add people to a database and I would prefer not to do it in two passes. So, I basically have: <employees> <employee> <employeeid>12</employeeid> <manager>3</manager> </employee> <employee> <employeeid>1</employeeid> <manager></manager> </employee> <employee> <employeeid>3</employeeid> <manager>1</manager> </employee> </employees> So, it should be sorted as such: employeeid = 1 employeeid = 3 employeeid = 12 The first person should have a null for managers. I am thinking about a binary tree representation, but I expect it will be very unbalanced, and I am not certain the best way to do this using Groovy properly. Is there a way to do this that isn't going to involve using nested loops?

    Read the article

  • Reading value of cookie using curl in php

    - by james
    Hello, Im using Firefox 3.5.9. When i visit a url , it sets a cookie on my computer.I can see this cookie in Firefox by going to Tools-Options-Privacy,then clicking on 'Remove Individual Cookies'. There is a folder called xyz,which contains a cookie named JSessionId and which has some Content value . If i use curl in my php code to navigate to that website,is there a way i can read the Content value of that cookie programmatically ? . Some sample code would be really appreciated. Thank You

    Read the article

  • How to have multiple instances of jQuery plugin on single page?

    - by James Skidmore
    I'm writing a simple jQuery plugin, but I'm having trouble being able to use multiple instances on a page. For instance, here is a sample plugin to illustrate my point: (function($) { $.fn.samplePlugin = function(options) { if (typeof foo != 'undefined') { alert('Already defined!'); } else { var foo = 'bar'; } }; })(jQuery); And then if I do this: $(document).ready(function(){ $('#myDiv').samplePlugin({}); // does nothing $('#myDiv2').samplePlugion({}); // alerts "Already defined!" }); This is obviously an over-simplified example to get across the point. So my question is, how do I have two separate instances of the plugin? I'd like to be able to use it across multiple instances on the same page. I'm guessing that part of the problem might be with defining the variables in a global scope. How can I define them unique to that instance of the plugin then? Thank you for your guidance!

    Read the article

  • Live streaming using Flash

    - by James
    Hi, I was working on an application that streams live video using Flash client and Wowza media server. As of now, I use an independent desktop based encoder(Flash Media Live Encoder) to publish my live stream. I wanted to know if it is possible to do the encoding part in the browser? My application would be a used by many to publish their streams so I cannot ask everyone to use FMLE to publish. I was wondering how do the other web based video chat applications do the encoding part over the web. Please help. Thanks

    Read the article

  • Retrieving data from MySQL in one SQL statement

    - by james.ingham
    Hi all, If I'm getting my data from Mysql like so: $result = $dbConnector->Query("SELECT * FROM branches, businesses WHERE branches.BusinessId = businesses.Id ORDER BY businesses.Name"); $resultNum = $dbConnector->GetNumRows($result); if($resultNum > 0) { for($i=0; $i < $resultNum; $i++) { $row = $dbConnector->FetchArray($result); // $row['businesses.Name']; // $row['branches.Name']; echo $row['Name']; } } Does anyone know how to print the field Name in businesses and how to print the name from branches? My only other alternative is to rename the fields or to call Mysql with two seperate queries. Thanks in advance

    Read the article

  • How to initialize F# list when size is unknown, using while..do loop

    - by James Black
    I have a function that will parse the results of a DataReader, and I don't know how many items are returned, so I want to use a while..do loop to iterate over the reader, and the outcome should be a list of a certain type. (fun(reader) -> [ while reader.Read() do new CityType(Id=(reader.GetInt32 0), Name=(reader.GetString 1), StateName=(reader.GetString 2)) ]) This is what I tried, but the warning I get is: This expression should have type 'unit', but has type 'CityType'. Use 'ignore' to discard the result of the expression, or 'let' to bind the result to a name. So what is the best way to iterate over a DataReader and create a list?

    Read the article

  • Scrum stories and behind the scenes features

    - by James P.
    As I understand things, the Scrum backlog is composed of a series of Stories that represent something for the end user and this is further decomposed into Features. If this is the case, where does all the behind the scenes features go that aren't really linked to a story but are still useful? For example, say I'm making an application that catalogs the contents of a hard drive. A story wouldn't require it but having an md5 hash on each file would be a nice feature.

    Read the article

  • Using NSThread to solve waiting for image from URL on the iPhone

    - by james.ingham
    So I have the following code in a method which I want to set a UIImageView image to that of one from an online source: [NSThread detachNewThreadSelector:@selector(loadImage) toTarget:self withObject:nil]; Then in the method called by the thread I have this: - (void) loadImage { NSURL *url = [NSURL URLWithString:logoPath]; // logoPath is an NSString with path details NSData *data = [NSData dataWithContentsOfURL:url]; logoImage.image = [UIImage imageWithData:data]; } This works great however I get many warnings within the Debugger Console along the lines of: 2010-05-10 14:30:14.052 ProjectTitle[2930:633f] * _NSAutoreleaseNoPool(): Object 0x169d30 of class NSHTTPURLResponse autoreleased with no pool in place - just leaking This occurs many times each time I call the new thread and then eventually, under no pattern, after calling a few of these threads I get the classic 'EXC_BAD_ACCESS' run-time error. I understand that this is happening because I'm not retaining the object but how can I solve this with the code in 'loadImage' shown above? Thanks

    Read the article

  • How Do I Add Value To All Previous Values In Array

    - by James
    Lets say I have the following array: my_array = [1, 5, 8, 11, -6] I need to iterate over this array and add the values prior to the current value together. An example will probably be easier to understand. I need to return an array that should look something like this: final_array = [1, 6, 14, 25, 19] I have tried doing something like this: my_array.collect {|value| value + previous_values } But obviously that doesn't work because I can't figure out how to get the previous values in the array. I am a programming noob so this might be easier than I am making it. I am pretty sure I need to use either collect or inject, but I can't seem to figure out how to do this. Any help would be appreciated.

    Read the article

  • VB.NET 2008, Windows 7 and saving files

    - by James Brauman
    Hello, We have to learn VB.NET for the semester, my experience lies mainly with C# - not that this should make a difference to this particular problem. I've used just about the most simple way to save a file using the .NET framework, but Windows 7 won't let me save the file anywhere (or anywhere that I have found yet). Here is the code I am using to save a text file. Dim dialog As FolderBrowserDialog = New FolderBrowserDialog() Dim saveLocation As String = dialog.SelectedPath ... Build up output string ... Try ' Try to write the file. My.Computer.FileSystem.WriteAllText(saveLocation, output, False) Catch PermissionEx As UnauthorizedAccessException ' We do not have permissions to save in this folder. MessageBox.Show("Do not have permissions to save file to the folder specified. Please try saving somewhere different.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) Catch Ex As Exception ' Catch any exceptions that occured when trying to write the file. MessageBox.Show("Writing the file was not successful.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try The problem is that this using this code throws an UnauthorizedAccessException no matter where I try to save the file. I've tried running the .exe file as administrator, and the IDE as administrator. Is this just Windows 7 being overprotective? And if so, what can I do to solve this problem? The requirements state that I be able to save a file! Thanks.

    Read the article

  • Implicit vs explicit getters/setters in AS3, which to use and why?

    - by James
    Since the advent of AS3 I have been working like this: private var loggy:String; public function getLoggy ():String { return loggy; } public function setLoggy ( loggy:String ):void { // checking to make sure loggy's new value is kosher etc... this.loggy = loggy; } and have avoided working like this: private var _loggy:String; public function get loggy ():String { return loggy; } public function set loggy ( loggy:String ):void { // checking to make sure loggy's new value is kosher etc... this.loggy = loggy; } I have avoided using AS3's implicit getters/setters partly so that I can just start typing "get.." and content assist will give me a list of all my getters, and likewise for my setters. I also dislike underscores in my code which turned me off the implicit route. Another reason is that I prefer the feel of this: whateverObject.setLoggy( "loggy's awesome new value!" ); to this: whateverObject.loggy = "loggy's awesome new value!"; I feel that the former better reflects what is actually happening in the code. I am calling functions, not setting values directly. After installing Flash Builder and the great new plugin SourceMate ( which helps to get some of the useful features that FDT is famous into FB ) I realized that when I use SourceMate's "generate getters and setters" feature it automatically sets my code up using the implicit route: private var _loggy:String; public function get loggy ():String { return loggy; } public function set loggy ( loggy:String ):void { // do whatever is needed to check to make sure loggy is an acceptable value this.loggy = loggy; } I figure that these SourceMate people must know what they are doing or they wouldn't be writing workflow enhancement plugins for coding in AS3, so now I am questioning my ways. So my question to you is: Can anyone give me a good reason why I should give up my explicit g/s ways, start using the implicit technique, and embrace those stinky little _underscores for my private vars? Or back me up in my reasons for doing things the way that I do?

    Read the article

  • What are the arguments against the inclusion of server side scripting in JavaScript code blocks?

    - by James Wiseman
    I've been arguing for some time against embedding server-side tags in JavaScript code, but was put on the spot today by a developer who seemed unconvinced The code in question was a legacy ASP application, although this is largely unimportant as it could equally apply to ASP.NET or PHP (for example). The example in question revolved around the use of a constant that they had defined in ServerSide code. 'VB Const MY_CONST: MY_CONST = 1 If sMyVbVar = MY_CONST Then 'Do Something End If //JavaScript if (sMyJsVar === "<%= MY_CONST%>"){ //DoSomething } My standard arguments against this are: Script injection: The server-side tag could include code that can break the JavaScript code Unit testing. Harder to isolate units of code for testing Code Separation : We should keep web page technologies apart as much as possible. The reason for doing this was so that the developer did not have to define the constant in two places. They reasoned that as it was a value that they controlled, that it wasn't subject to script injection. This reduced my justification for (1) to "We're trying to keep the standards simple, and defining exception cases would confuse people" The unit testing and code separation arguments did not hold water either, as the page itself was a horrible amalgam of HTML, JavaScript, ASP.NET, CSS, XML....you name it, it was there. No code that was every going to be included in this page could possibly be unit tested. So I found myself feeling like a bit of a pedant insisting that the code was changed, given the circumstances. Are there any further arguments that might support my reasoning, or am I, in fact being a bit pedantic in this insistence?

    Read the article

  • Are there any OSGi web service / SOAP clients out there?

    - by James Carr
    I'm looking for any webservice client that can be run inside an OSGi container and connect to a simple web service using SOAP, doesn't sound so hard does it? Oh, and it has to work under Java 1.5, so the JRE jax-ws wont be present. The problem is I've tried a few solutions now, and although each solution works in standard Java using it from within OSGi doesn't. the springsource JAX-WS bundles seem to have dependency issues the CXF bundles get me as far as calling the service, but then can seem to find the stub methods in the proxy Is there anyone out there who has successfully created an OSGi webservice client?

    Read the article

  • How do you unpack gems using jruby on rails 2.3?

    - by James Moore
    I'm trying to unpack all the system gems to end up with a standalone Rails directory including all the rails gems and all the system gems. I'm starting with a bare rails setup; just did a jruby -S rails and a 'generate jdbc'. I then add a config.gem 'jdbc-mysql' to environment.rb and do the jruby -S rake gems:unpack:dependencies. After unpacking, if I do a rake I get: no such file to load -- jdbc-mysql Is there something else you need to do to get the jdbc gem unpacked? I'm using jruby 1.4.0 (and moving to 1.5 is on my todo list) and rails 2.3.8.

    Read the article

  • Read a specific range of lines from a file using c

    - by James Joy
    I have the following content in a file: hhasfghgsafjgfhgfhjf gashghfdgdfhgfhjasgfgfhsgfjdg jfshafghgfgfhfsghfgffsjgfj . . . . . startread hajshjsfhajfhjkashfjf hasjgfhgHGASFHGSHF hsafghfsaghgf . . . . . stopread . . . . . . jsfjhfhjgfsjhfgjhsajhdsa jhasjhsdabjhsagshaasgjasdhjk jkdsdsahghjdashjsfahjfsd I need to read the lines from the next line of startread till the previous line of stopread using a c code and store it to a string variable(of course with a \n for every line breaks). How can i achieve this? I have used fgets(line,sizeof(line),file); but it starts reading from the beginning. I don't have the exact line number to start and stop reading since the file is written by another C code. But there are these identifiers startread and stopread to identify whereto start reading. Operating platform is linux. Thanks in advance.

    Read the article

  • Does the order of columns in a query matter?

    - by James Simpson
    When selecting columns from a MySQL table, is performance affected by the order that you select the columns as compared to their order in the table (not considering indexes that may cover the columns)? For example, you have a table with rows uid, name, bday, and you have the following query. SELECT uid, name, bday FROM table Does MySQL see the following query any differently and thus cause any sort of performance hit? SELECT uid, bday, name FROM table

    Read the article

  • Is there a way to automate MS Office applications without license?

    - by james-h-l
    I am currently writing an application that will perform automation in Excel. I have MS Office (2007) installed on my work computer and the application is working fine referencing the the Microsoft Excel 12.0 Object Lirary. The target machine has the Office installed but not registered. It is one of those preinstalled editions. Attempting to run the application on the target machine I get an error saying Office is not installed? I'm assuming then you have to have a registed Office to use the object libraries? Is there anyway around this as I do not have a Office license key lying around and its quite expensive?

    Read the article

  • How do you filter an NSMutable Array that contains core data?

    - by James
    I have an array that it is populated by core data as follows. NSMutableArray *mutableFetchResults = [CoreDataHelper getObjectsFromContext:@"Spot" :@"Name" :YES :managedObjectContext]; It looks like this in the console. (entity: Spot; id: 0x4b7e580 ; data: { CityToProvince = 0x4b7dbd0 ; Description = "Friend"; Email = "[email protected]"; Age = 21; Name = "Adam"; Phone = "+44175240"; }), How can i filter the array to remove anyone who is over a certain age? or use values in the array to make calculations? Please help i have been stuck for ages on this. Code would be gratefully appreciated.

    Read the article

  • How Do I Remove The First 4 Characters From A String If It Matches A Pattern In Ruby

    - by James
    I have the following string: "h3. My Title Goes Here" I basically want to remove the first 4 characters from the string so that I just get back: "My Title Goes Here". The thing is I am iterating over an array of strings and not all have the h3. part in front so I can't just ditch the first 4 characters blindly. I have checked the docs and the closest think I could find was chomp, but that only works for the end of a string. Right now I am doing this: "h3. My Title Goes Here".reverse.chomp(" .3h").reverse This gives me my desired output, but there has to be a better way right? I mean I don't want to reverse a string twice for no reason. I am new to programming so I might have missed something obvious, but I didn't see the opposite of chomp anywhere in the docs. Is there another method that will work? Thanks!

    Read the article

  • Android: Help with tabs view

    - by James
    So I'm trying to build a tabs view for an Android app, and for some reason I get a force close every time I try to run it on the emulator. When I run the examples, everything shows fine, so I went as far as to just about copy most of the layout from the examples(a mix of Tabs2.java and Tabs3.java), but for some reason it still wont run, any ideas? Here is my code(List1.class is a copy from the examples for testing purposes). It all compiles fine, just gets a force close the second it starts: package com.jvavrik.gcm; import android.app.TabActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TabHost; import android.widget.TextView; public class GCM extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final TabHost tabHost = getTabHost(); tabHost.addTab(tabHost.newTabSpec("tab1") .setIndicator("g", getResources().getDrawable(R.drawable.star_big_on)) .setContent(new Intent(this, List1.class))); tabHost.addTab(tabHost.newTabSpec("tab2") .setIndicator("C") .setContent(new Intent(this, List1.class)) ); tabHost.addTab(tabHost.newTabSpec("tab3") .setIndicator("S") .setContent(new Intent(this, List1.class)) ); tabHost.addTab(tabHost.newTabSpec("tab4") .setIndicator("A") .setContent(new Intent(this, List1.class)) ); } }

    Read the article

  • Is it possible to set ContentType for a WCF WebGet method?

    - by James Cadd
    I'm working with a WCF restful/http method that returns a stream of image data. I want to make sure that the content type is marked as "image/png". The method is defined as: [ServiceContract] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] public class TileImageService { [WebGet(UriTemplate = "{id}")] public Stream GetTileImage(string id) { Bitmap bmp = new Bitmap(173, 173); Graphics g = Graphics.FromImage(bmp); g.Clear(Color.Blue); g.DrawString(DateTime.Now.ToLongTimeString(), new Font("Chiller", 20), Brushes.White, new PointF(10, 10)); g.Flush(); MemoryStream ms = new MemoryStream(); bmp.Save(ms, ImageFormat.Png); ms.Seek(0, SeekOrigin.Begin); return ms; } } In Firefox it looks like the content type is marked as application/octet stream. Is there a way to change the content type?

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >