Search Results

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

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

  • PHP attempting to make JavaScript friendly timestamp, failing, returns 1.34899651119E+12

    - by chris
    Well, not sure whats going on. I have been trying to follow by examples I have found here on stack, on google, even an answer someone gave me a week+ ago, which unfortunately I wasn't able to test until today. Anyway I am attempting to generate a javascript friendly timestamp via php so I can get my times synced up. The best logic I could find overall was something dealing with microtime. However that doesn't seem to work as expected, not even in the slightest. Right now I am using microtime(true)*1000; and am getting 1.34899651119E+12 for the result. Did I some how manage to mess up that one tiny line of code, Im not sure.

    Read the article

  • Change IP settings using C++

    - by Chris
    How do I change the IP settings of a Windows CE 6 box Programatically via C++? Functions for Windows might also work. I found that I can change the hostname via sethostname but couldn't find how to change IP address settings such as: IP Address DHCP Subnet Gateway DNS1 / DNS2 WINS1 / WINS2 Any advice / pointers would be great. Thanks. P.s. How would you get the box to update to those settings - is a refresh or the programming equivalent of ipconfig /renew required?

    Read the article

  • Changing a Select dropdown with a jquery ui slider

    - by Chris J. Lee
    Trying to set a select dropdown with a slider. You move the jquery ui slider and then it will change the selection of the other two dropdowns. is there a current method in jquery that would set these options? Current dropdown: <select id="alert-options-frequency-opts"> <option value=""></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select>

    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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • 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

  • Wpf Window resizes when computer is locked.

    - by Chris
    I have a Window set to the height and width of my monitors: var r = System.Drawing.Rectangle.Union( System.Windows.Forms.Screen.AllScreens[0].Bounds, System.Windows.Forms.Screen.AllScreens[1].Bounds ); Height = r.Height; Width = r.Width; This is all fine until I Lock my computer (WIN+L), when I come back the window has resized itself to be on one monitor only. What I want to do is prevent the decrease in size, as I'm drawing on a canvas on the second monitor, and when the resize occurs, this is all lost.. Any thoughts on how I can prevent this? Cheers!

    Read the article

  • Creating a Month Dropdown in C# ASP.NET MVC

    - by Chris M
    This method seems stupid and a bit heavy; is there a more optimal way of creating the same thing (its for an MVC View Dropdown) private List<KeyValuePair<int, string>> getMonthListDD { get { var dDur = new List<KeyValuePair<int, string>>(); dDur.Add(new KeyValuePair<int, string>(1, "January")); dDur.Add(new KeyValuePair<int, string>(2, "Febuary")); dDur.Add(new KeyValuePair<int, string>(3, "March")); dDur.Add(new KeyValuePair<int, string>(4, "April")); dDur.Add(new KeyValuePair<int, string>(5, "May")); dDur.Add(new KeyValuePair<int, string>(6, "June")); dDur.Add(new KeyValuePair<int, string>(7, "July")); dDur.Add(new KeyValuePair<int, string>(8, "August")); dDur.Add(new KeyValuePair<int, string>(9, "September")); dDur.Add(new KeyValuePair<int, string>(10, "October")); dDur.Add(new KeyValuePair<int, string>(11, "November")); dDur.Add(new KeyValuePair<int, string>(12, "December")); return dDur; } }

    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

  • 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

  • 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

  • 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

  • Is it possible to modify the value of a record's primary key in Oracle when child records exist?

    - by Chris Farmer
    I have some Oracle tables that represent a parent-child relationship. They look something like this: create table Parent ( parent_id varchar2(20) not null primary key ); create table Child ( child_id number not null primary key, parent_id varchar2(20) not null, constraint fk_parent_id foreign key (parent_id) references Parent (parent_id) ); This is a live database and its schema was designed long ago under the assumption that the parent_id field would be static and unchanging for a given record. Now the rules have changed and we really would like to change the value of parent_id for some records. For example, I have these records: Parent: parent_id --------- ABC123 Child: child_id parent_id -------- --------- 1 ABC123 2 ABC123 And I want to modify ABC123 in these records in both tables to something else. It's my understanding that one cannot write an Oracle update statement that will update both parent and child tables simultaneously, and given the FK constraint, I'm not sure how best to update my database. I am currently disabling the fk_parent_id constraint, updating each table independently, and then enabling the constraint. Is there a better, single-step way to update this content?

    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

  • jQuery multiple if else Statements

    - by Chris MMgr
    I have a set of images that I am trying to activate (change opacity) based on the position of a user's window. The below code works, but only through a long series of if else statements. Is there a way to shorten the below code? //Function to activate and deactivate the buttons on the side menu function navIndicator() { var winNow = $(window).scrollTop(); var posRoi = $('#roi').offset(); var posRoiNow = posRoi.top; //Activate the propper button corresponding to what section the user is viewing if (winNow == posRoiNow * 0) { $('#homeBut a img.active').stop().animate({ opacity: 1 } { queue: false, duration: 300, easing: "easeOutExpo" }); $('#homeBut').addClass("viewing") } else { $('#homeBut a img.active').stop().animate({ opacity: 0 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#homeBut').removeClass("viewing") } if (winNow == posRoiNow) { $('#roiBut a img.active').stop().animate({ opacity: 1 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#roiBut').addClass("viewing") } else { $('#roiBut a img.active').stop().animate({ opacity: 0 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#roiBut').removeClass("viewing") } if (winNow == posRoiNow * 2) { $('#dmsBut a img.active').stop().animate({ opacity: 1 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#dmsBut').addClass("viewing") } else { $('#dmsBut a img.active').stop().animate({ opacity: 0 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#dmsBut').removeClass("viewing") } if (winNow == posRoiNow * 3) { $('#techBut a img.active').stop().animate({ opacity: 1 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#techBut').addClass("viewing") } else { $('#techBut a img.active').stop().animate({ opacity: 0 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#techBut').removeClass("viewing") } if (winNow == posRoiNow * 4) { $('#impBut a img.active').stop().animate({ opacity: 1 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#impBut').addClass("viewing") } else { $('#impBut a img.active').stop().animate({ opacity: 0 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#impBut').removeClass("viewing") } if (winNow == posRoiNow * 5) { $('#virBut a img.active').stop().animate({ opacity: 1 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#virBut').addClass("viewing") } else { $('#virBut a img.active').stop().animate({ opacity: 0 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#virBut').removeClass("viewing") } if (winNow == posRoiNow * 6) { $('#biBut a img.active').stop().animate({ opacity: 1 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#biBut').addClass("viewing") } else { $('#biBut a img.active').stop().animate({ opacity: 0 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#biBut').removeClass("viewing") } if (winNow == posRoiNow * 7) { $('#contBut a img.active').stop().animate({ opacity: 1 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#contBut').addClass("viewing") } else { $('#contBut a img.active').stop().animate({ opacity: 0 }, { queue: false, duration: 300, easing: "easeOutExpo" }); $('#contBut').removeClass("viewing") } };

    Read the article

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