Search Results

Search found 3484 results on 140 pages for 'chris dubois'.

Page 115/140 | < Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >

  • Javascript E4X - Return the text of node and its children?

    - by Chris
    I'm trying to parse some of html where there is are repeating lines of code such as: <a>This is <span>some text</span> but its <span>not grabbing the span</span> content</a> So I am looping through the object and extracting this: object.a[i].text(); but its only returning "This is but its content" How do I grab the text within the children nodes as well, all as one string? Cheers

    Read the article

  • How to provide an API client with 1,000,000 database results?

    - by Chris Dutrow
    What is a good way to provide an API client with 1,000,000 database results? We are cureently using PostgreSQL. A few suggested methods: Paging using Cursors Paging using random numbers ( Add "GREATER THAN ORDER BY " to each query ) Save information to a file and let the client download it Iterate through results, then POST the data to the client server Return only keys to the client, then let the client request the objects from Cloud files like Amazon S3 (still may require paging just to get the file names ). What haven't I thought of that is stupidly simple and way better than any of these options?

    Read the article

  • javascript prototype problem

    - by Chris Tosswill
    So I have a rather basic javascript problem which I have been slamming my head into a wall over for awhile: <div class='alist'> <ul> <li class='group_1'> An Item </li> <li class='group_1'> An Item </li> <li class='group_2'> An Item </li> </ul> </div> <div class='alist'> <ul> <li class='group_1'> An Item </li> <li class='group_1'> An Item </li> <li class='group_2'> An Item </li> </ul> </div> <script> function toggle_item( num ){ $$( 'li.group_' + num ).invoke('toggle'); } </script> Basically, I need to create a sweeper that sets the div to display:none if all the li are display:none. I think it would start like: function sweep(){ $$('div.alist').each( function( s ) { ar = s.down().children }); } Any suggestions for good tutorials would be welcome as well

    Read the article

  • Video Reconstruction

    - by chris barber
    How does reconstruction using video compare to using standard reconstruction using still images? What similarities and differences are there. Finally what can and cannot be reconstructed using standard stereo methods?

    Read the article

  • XSL - How to tell if element is last in series

    - by Chris
    I have an XSL template that is called (below). What I would like to do is be able to tell if I am the last Unit being called. <xsl:template match="Unit[@DeviceType = 'Node']"> <!-- Am I the last Unit in this section of xml? --> <div class="unitchild"> Node: #<xsl:value-of select="@id"/> </div> </xsl:template> Example XML <Unit DeviceType="QueueMonitor" Master="1" Status="alive" id="7"> <arbitarytags /> <Unit DeviceType="Node" Master="0" Status="alive" id="8"/> <Unit DeviceType="Node" Master="0" Status="alive" id="88"/> </Unit>

    Read the article

  • Conditional compilation hackery in C# - is there a way to pull this off?

    - by Chris
    I have an internal API that I would like others to reference in their projects as a compiled DLL. When it's a standalone project that's referenced, I use conditional compilation (#if statements) to switch behavior of a key web service class depending on compilation symbols. The problem is, once an assembly is generated, it appears that it's locked into whatever the compilation symbols were when it was originally compiled - for instance, if this assembly is compiled with DEBUG and is referenced by another project, even if the other project is built as RELEASE, the assembly still acts as if it was in DEBUG as it doesn't need recompilation. That makes sense, just giving some background. Now I'm trying to work around that so I can switch the assembly's behavior by some other means, such as scanning the app/web config file for a switch. The problem is, some of the assembly's code I was switching between are attributes on methods, for example: #if PRODUCTION [SoapDocumentMethodAttribute("https://prodServer/Service_Test", RequestNamespace = "https://prodServer", ResponseNamespace = "https://prodServer")] #else [SoapDocumentMethodAttribute("https://devServer/Service_Test", RequestNamespace = "https://devServer", ResponseNamespace = "https://devServer")] #endif public string Service_Test() { // test service } Though there might be some syntactical sugar that allows me to flip between two attributes of the same type in another fashion, I don't know it. Any ideas? The alternative method would be to reference the entire project instead of the assembly, but I'd rather stick with just referencing the compiled DLL if I can. I'm also completely open to a whole new approach to solve the problem if that's what it takes.

    Read the article

  • LINQ Expression help with Func TEntity,TType

    - by Chris Conway
    I have a repository method that accepts an order by parameter in the form: public IEnumerable<TEntity> Get<TEntity>(Expression<Func<TEntity,string>> orderBy) Now that works fine when trying to sort by a property of type string, var entities = rep.Get(x => x.Name); but what if i want to sort by double or int or any other type. Doing something like var entities = rep.Get(x => x.Price); obviously throws a compile error saying I can't convert double to string. How can I make this more generic so I can sort by any property in my entity, or at least the properties where the type implements IComparable or something similar?

    Read the article

  • PHP Speed - Many Echos vs Building a String

    - by Chris
    Wondering if anyone knows if either of these methods would produce an output faster: Method 1 for ($i=1;$i<99999;$i++) { echo $i, '<br>'; } or Method 2 for ($i=1;$i<99999;$i++) { $string .= $i . '<br>'; } echo $string; Thanks for any input you have.

    Read the article

  • Problems deploying Sinatra app to staging environment

    - by chris
    I have a small Sinatra app with both a staging and production environment on a single server with running Nginx. To deploy I am using Capistrano and capistrano-ext to easily deploy to different locations. The problem that the staging environment always runs with the production configuration specified within the app.rb file. configure :staging do # staging settings set :foo, "bar" end configure :production do # prod settings set :foo, "rab" end I have come to the conclusion that the capistrano :environment variable within the deploy.rb file doesn't config Sinatra in any way. I have also tried setting the ENV["RACK_ENV"] to "staging" to no avail. config/deploy/staging.rb server "10.10.100.16", :app, :web, :db, :primary => true set :deploy_to, "/var/www/staging.my_app" set :environment, "staging" set :env, "staging" ENV["RACK_ENV"] = "staging" Any ideas?

    Read the article

  • check if lookup yields any valid rows for insertion before clearing table using ssis

    - by Chris
    SSIS ignoramus needing help! the situation: a temp table is populated from an excel file, which has been known to change formats at random times, that is owned by a different group. a lookup need to be performed on the temp table, tableA, to populate tableB with valid data. if the lookup results in 0 rows being returned, an email should be sent and the existing data in tableB should remain untouched. If the lookup results in a number of valid rows 0, tableB should have all rows deleted and the new records from the lookup on tableA inserted. question: what would be the best way to check if there are any valid rows and perform the appropriate action(s), depending on my results? Thanks!

    Read the article

  • Container<ImplementerOfIInterface> is not Container<IInterface>. Why not?

    - by Chris Simmons
    Why wouldn't DoesntWork() work below? The error is: Cannot implicitly convert type 'List' to 'IEnumerable'. An explicit conversion exists (are you missing a cast?). I know this is something about generic/templates I'm not getting, but List is IEnumerable and Implementer is an IInterface. I don't see why this needs to be casted (or if it really can be). public interface IInterface { // ... } public class Implementer : IInterface { // ... } IEnumerable<IInterface> DoesntWork() { List<Implementer> result = new List<Implementer>(); return result; }

    Read the article

  • How do I serve a large file using Pylons?

    - by Chris R
    I am writing a Pylons-based download gateway. The gateway's client will address files by ID: /file_gw/download/1 Internally, the file itself is accessed via HTTP from an internal file server: http://internal-srv/path/to/file_1.content The files may be quite large, so I want to stream the content. I store metadata about the file in a StoredFile model object: class StoredFile(Base): id = Column(Integer, primary_key=True) name = Column(String) size = Column(Integer) content_type = Column(String) url = Column(String) Given this, what's the best (ie: most architecturally-sound, performant, et al) way to write my file_gw controller?

    Read the article

  • Refactoring huge if ( ... instanceof ...)

    - by Chris
    I'm currently trying to refactor a part of a project that looks like this: Many classes B extends A; C extends A; D extends C; E extends B; F extends A; ... And somewhere in the code: if (x instanceof B){ B n = (B) x; ... }else if (x instanceof C){ C n = (C) x; ... }else if (x instanceof D){ D n = (D) x; ... }else if (x instanceof E){ E n = (E) x; ... }else if (x instanceof G){ G n = (G) x; ... }... Above if-construct currently sits in a function with a CC of 19. Now my question is: Can I split this if-construct up in mutliple functions and let Java's OO do the magic? Or are there any catches I have to look out for? My idea: private void oopMagic(C obj){ ... Do the stuff from the if(x instanceof C) here} private void oopMagic(D obj){ ... Do the stuff from the if(x instanceof D) here} private void oopMagic(E obj){ ... Do the stuff from the if(x instanceof E) here} .... and instead of the huge if: oopMagic(x);

    Read the article

  • ANDROID SAX Parser issue

    - by Chris Watson
    Since I am new to java programming, I need a bit of help with this. I stuck on this one issue and can't continue until I get this to work. I am trying to make a string from that includes a preference int. I saved the data and can display the int (just sample code): SharedPreferences prefs=PreferenceManager .getDefaultSharedPreferences(this); list.setText(prefs.getString("list", "22")); now, I have a xml parser that is pulling a url correctly as a static string: public static String feedUrl = String.format("http://www.freshpointmarketing.com/iphone/objects/XML/AND.php?ID=%d", 22); Works great... now my issue...... I need to have the preference "int" become the variable in the string, thus making it not static. static SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this); static int myVariable = prefs.getInt("list1", 22); public static String feedUrl = String.format("http://www.freshpointmarketing.com/iphone/objects/XML/AND.php?ID=%d", myVariable); If I take out all static references, I get an error on this: private void loadFeed(ParserType type){ try{ FeedParser parser = FeedParserFactory.getParser(type); long start = System.currentTimeMillis(); messages = parser.parse(); long duration = System.currentTimeMillis() - start; Log.i("AndroidNews", "Parser duration=" + duration); String xml = writeXml(); Log.i("AndroidNews", xml); List<String> titles = new ArrayList<String>(messages.size()); for (Message msg : messages){ titles.add(msg.getTitle()); } ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.row,titles); this.setListAdapter(adapter); } catch (Throwable t){ Log.e("AndroidNews",t.getMessage(),t); } } thanks

    Read the article

  • Setting PATH in Makefile run by eclipse

    - by Chris Jefferson
    I have a Makefile which runs fine from a bash shell, but fails to run from Eclipse. This is because the path I am setting in my .bash_profile is not getting used. What is the best way of making this happen? Is there somewhere else I could put the path, to make sure it is invoked in non-interactive shells (which is I assume how eclipse is running make)?

    Read the article

  • Password protect web pages on Windows CE 6

    - by Chris
    I am using the default web server for WinCE 6 and wish to password protect certain folders. The default VROOT /remoteadmin/ is password protected, and this works but my configuration doesn't work. I have tried mimicking these settings on my own folders but to little success. Here is how one looks: In the HKLM\Comm\HTTPD\VROOTS key I have created a subkey called /web/configuration (this folder actually exists on the box). The following values are in this key A = 1 DefaultPage = config.html Path = /hard disk/webroot/web/configuration/ UserList = ADMIN This is nigh on identical to the settings in /RemoteAdmin/ but /RemoteAdmin/ requests a password and /web/configuration doesn't (even after reboot).

    Read the article

  • Efficient retrieval of lists over WebServices

    - by Chris
    I have a WCF WebService that uses LINQ and EF to connect to an SQL database. I have an ASP.NET MVC front end that collects its data from the webservice. It currently has functions such as List<Customer> GetCustomers(); As the number of customers increases massively the amount of data being passed increases also reducing efficiency. What is the best way to "page data" across WebServices etc. My current idea is to implement a crude paging system such as List<Customer> GetCustomers(int start, int length); This, however, means I would have to replicate such code for all functions returning List types. It is unfortunate that I cannot use LINQ as it would be much nicer. Does anyone have any advice or ideas of patterns to implement that would be "as nice as possible" Thanks

    Read the article

  • Git on live Windows Server - Trying to pull from the repo but local files already modified

    - by Chris
    I have my Git repository hosted at github.com. I would like to push updates and such to github.com and then log into my Windows server and do a git pull to get my changes (that are verified to work on my local machine. Ideally I should have another server setup as my local machine settings are different from the live server. But I'm cheap.). It seems like whenever I try to do a git pull on the server, the files seem to get modified somehow since the last pull. And so I am unable to get the update as git says I need to commit my local (Windows server) changes. How can I use git like I want to? Or is there a better way?

    Read the article

  • NHibernate and MySql is inserting and Selecting, not updating

    - by Chris Brandsma
    Something strange is going on with NHibernate for me. I can select, and I can insert. But I can't do and update against MySql. Here is my domain class public class UserAccount { public virtual int Id { get; set; } public virtual string UserName { get; set; } public virtual string Password { get; set; } public virtual bool Enabled { get; set; } public virtual string FirstName { get; set; } public virtual string LastName { get; set; } public virtual string Phone { get; set; } public virtual DateTime? DeletedDate { get; set; } public virtual UserAccount DeletedBy { get; set; } } Fluent Mapping public class UserAccountMap : ClassMap<UserAccount> { public UserAccountMap() { Table("UserAccount"); Id(x => x.Id); Map(x => x.UserName); Map(x => x.Password); Map(x => x.FirstName); Map(x => x.LastName); Map(x => x.Phone); Map(x => x.DeletedDate); Map(x => x.Enabled); } } Here is how I'm creating my Session Factory var dbconfig = MySQLConfiguration .Standard .ShowSql() .ConnectionString(a => a.FromAppSetting("MySqlConnStr")); FluentConfiguration config = Fluently.Configure() .Database(dbconfig) .Mappings(m => { var mapping = m.FluentMappings.AddFromAssemblyOf<TransactionDetail>(); mapping.ExportTo(mappingdir); }); and this is my NHibernate code: using (var trans = Session.BeginTransaction()) { var user = GetById(userId); user.Enabled = false; user.DeletedDate = DateTime.Now; user.UserName = "deleted_" + user.UserName; user.Password = "--removed--"; Session.Update(user); trans.Commit(); } No exceptions are being thrown. No queries are being logged. Nothing.

    Read the article

  • UDP: Client started before Server

    - by Chris
    I have a bit of a glitch in my game just now, everything runs fine if the server is started before the client however when the client is started before the server they never connect. This is all UDP The problem happens when the client tries to call recvfrom() before the server has started, when this happens the client never finds the server and the server never finds the client. The resulted error is a wouldblock. If I stop the client using recvfrom and start the client before the server (the client is still sending data its just not receiving it) they both find each other no problem. Whats the solution for this? The way its seems just now is that the client cannot call recvfrom without a server being active or it all falls apart. Is there a check that can be done to see if data is sitting on a certain port(data the server would send)? Or is there a better way to do this? Some Code... Server Operation - UDPSocket is a class UDPSocket.Initialise(); UDPSocket.MakeNonBlocking(); UDPSocket.Bind(LOCALPORT); int n = UDPSocket.Receive(&thePacket); if (n > 0) UDPSocket.Send(&sendPacket); Client... UDP.Initialise(); UDP.MakeNonBlocking(); UDP.SetDestinationAddress(SERVERIP, SERVERPORT); serverStatus = UDP.Receive(&recvPacket); if (serverStatus > 0) { //Do some things UDP.Send(dPacket); //Try and reconnect with server } Thanks

    Read the article

  • Settings cell selected background view removes backgroundview

    - by Chris
    I'm trying to set up custom UITableViewCells. I can set the backgroundView no problem, but if I set selectedBackgroundView, the cell's background becomes white and only the selected background is seen: - (void) createCell: (UITableViewCell*)cell onRow: (NSUInteger)row { UIImageView* bgImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"cell_background_red.png"]]; cell.backgroundView = bgImage; cell.selectedBackgroundView = bgImage; cell.textLabel.hidden = YES; UILabel* titleLabel = [[UILabel alloc] initWithFrame: CGRectMake(20, CGRectGetHeight(cell.frame) / 2, 200, 50)]; titleLabel.text = [[self.ruleList objectAtIndex: row] objectForKey: TitleKey]; titleLabel.backgroundColor = [UIColor clearColor]; [cell.contentView addSubview: titleLabel]; }

    Read the article

  • Can I have sinatra not read the entire request body into memory?

    - by Chris Markle
    Say I have a sinatra route ala: put '/data' do request.body.read [...] end It appears that the entire request.body is read into memory. Is there a way to consume the body as it comes into the system, rather than having it all buffered in Rack/sinatra beforehand? I see I can do this to read the body in parts, but the entire body still seems to be read into memory beforehand. put '/data' do while request.body.read(1024) != nil [...] end [...] end

    Read the article

< Previous Page | 111 112 113 114 115 116 117 118 119 120 121 122  | Next Page >