Search Results

Search found 4650 results on 186 pages for 'juvil john soriano'.

Page 128/186 | < Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >

  • parsing position files in ruby

    - by john
    I have a sample position file like below. 789754654 COLORA SOMETHING1 19370119FYY076 2342423234SS323423 742784897 COLORB SOMETHING2 20060722FYY076 2342342342SDFSD3423 I am interested in positions 54-61 (4th column). I want to change the date to be a different format. So final outcome will be: 789754654 COLORA SOMETHING1 01191937FYY076 2342423234SS323423 742784897 COLORB SOMETHING2 07222006FYY076 2342342342SDFSD3423 The columns are seperated by spaces not tabs. And the final file should have exact number of spaces as the original file....only thing changing should be the date format. How can I do this? I wrote a script but it will lose the original spaces and positioning will be messed up. file.each_line do |line| dob = line.split(" ") puts dob[3] #got the date. change its format 5.times { puts "**" } end Can anyone suggest a better strategy so that positioning in the original file remains the same?

    Read the article

  • How to update MySQL table with a cumulative count of events with the same date

    - by John
    I have a table which I pull data from. This data has a date and a stock symbol. There can be multiple rows of data with the same date and different stock symbols. I need to update the table so that there is a running total for all rows with the same date. When a new date occurs the cumulative count re-sets to 1 and then resumes. A typical query: mysql> SELECT Sym 'sym' , fdate as 'FilledDate', TsTradeNum 'numT' -> FROM trades_entered_b2 -> WHERE fDate >= '2009-08-03' AND fDate <= '2009-08-07' -> LIMIT 10; +------+------------+------+ | sym | FilledDate | numT | +------+------------+------+ | WAT | 2009-08-03 | 0 | | ALGN | 2009-08-04 | 0 | | POT | 2009-08-05 | 0 | | PTR | 2009-08-06 | 0 | | SCHW | 2009-08-06 | 0 | | FDO | 2009-08-07 | 0 | | NBL | 2009-08-07 | 0 | | RRC | 2009-08-07 | 0 | | WAT | 2009-08-08 | 0 | | COCO | 2009-08-08 | 0 | +------+------------+------+ What I want: +------+------------+------+ | sym | FilledDate | numT | +------+------------+------+ | WAT | 2009-08-03 | 1 | | ALGN | 2009-08-04 | 1 | | POT | 2009-08-05 | 1 | | PTR | 2009-08-06 | 1 | | SCHW | 2009-08-06 | 2 | | FDO | 2009-08-07 | 3 | | NBL | 2009-08-07 | 4 | | RRC | 2009-08-07 | 5 | | WAT | 2009-08-08 | 1 | | COCO | 2009-08-08 | 2 | +------+------------+------+ What I need to do is update the TsTradeNum column with the correct values. I have tried to create a function and various queries all failed. Any ideas? Thanks in advance

    Read the article

  • PHP PDO Username Availability Checker

    - by John Bernal
    I'm building a registration page that uses JQuery's validator plugin to validate the form. For the username, i used the remote method. So here's my jquery+html code: fiddle And here's Available.php: <?php $usr = $_POST["username"]; $link = new PDO('mysql:***;dbname=***;charset=UTF-8','***','***'); $usr_check = $link->prepare("SELECT * FROM Conference WHERE Username = :usr"); $link->bindParam(':usr', $usr); $usr_check->execute(); if($usr_check->rowCount()>0) echo "false"; else echo "true"; ?> So I have a test account in my database with the username: user. When I tried to submit my form with the same username, it didn't display the error saying "username taken" which means the php isn't correct. Any ideas where I went wrong? Thanks

    Read the article

  • How big can a SQL Server row be before it's a problem?

    - by John Leidegren
    Occasionally I run into this limitation using SQL Server 2000 that a row size can not exceed 8K bytes. SQL Server 2000 isn't really state of the art, but it's still in production code and because some tables are denormalized that's a problem. However, this seems to be a non issue with SQL Server 2005. At least, it won't complain that row sizes are bigger than 8K, but what happens instead and why was this a problem in SQL Server 2000? Do I need to care about my rows growing? Should I try and avoid large rows? Are varchar(max) and varbinary(max) a solution or expensive, in terms of size in database and/or CPU time? Why do I care at all about specifying the length of a particular column, when it seems like it's just a matter of time before someones going to hit that upper limit?

    Read the article

  • Duplicate array but maintain pointer links

    - by St. John Johnson
    Suppose I have an array of nodes (objects). I need to create a duplicate of this array that I can modify without affecting the source array. But changing the nodes will affect the source nodes. Basically maintaining pointers to the objects instead of duplicating their values. // node(x, y) $array[0] = new node(15, 10); $array[1] = new node(30, -10); $array[2] = new node(-2, 49); // Some sort of copy system $array2 = $array; // Just to show modification to the array doesn't affect the source array array_pop($array2); if (count($array) == count($array2)) echo "Fail"; // Changing the node value should affect the source array $array2[0]->x = 30; if ($array2[0]->x == $array[0]->x) echo "Goal"; What would be the best way to do this?

    Read the article

  • Trying to understand crash log output

    - by John Smith
    I'm trying to understand debug output from a crash log. I have the following line from the crashlog: 22 FG 0x00022b94 0x1000 + 138132 I understand how to use atos on 0x00022b94 to get the source code location. What I would like to know is why the crash log helpfully splits that number into 0x1000 + 138132? I have googled and the googles failed me.

    Read the article

  • Quickly Compiling Changes for Couple of Files

    - by john doe
    I am using .NET Framework and C# and working on a large project. The application compile takes forever. Currently, I don't have time to see what is going wrong. But is there anyway that if I change 2-3 files I can compile the application quickly. It is a web application. The solution has 6-7 other projects.

    Read the article

  • Optimal way to initialize varying objects

    - by John Smith
    I have to initialize a lot of different types of objects based on an integer parameter. They all have the same overall initialization methods. At the moment I have the following code #def APPLE 1 #def PEAR 2 switch (t) { case APPLE: newobj = [[FApple alloc] init]; break; case PEAR: newobj = [[FPear] alloc] init]; break; default: retobj = nil; } I believe there must be a better way to do this. When I add FOrange I have to go and add another line here. What would be a better way?

    Read the article

  • Should we use Nexus or Artifactory for a Maven Repo?

    - by John Stauffer
    We are using Maven for a large build process ( 100 modules). We have been storing our external dependencies in source control, and using that to update a local repo. However, we are ready to graduate to a local repo that can cache central so that we don't have to proactively download all 3rd parties (but we can still have a local repo to pull from). In addition we want to publish our internal build artifacts from a nightly build so that developers don't have to build the world. We are considering Nexus and Artifactory. What are the reasons for preferring one over the other? Are there others we should be considering?

    Read the article

  • Is content from AJAX call added to Django context variable

    - by John
    Hi, I am using the JQuery load function to load part of my page. Can I access the variables from that page in the page that loads it. e.g. Page A uses JQuery load function to load B Page B loads and sets a variable in context called pageB_var which holds a django object Page A can then access this variable by doing {{pageB_var}} since it was added to the context If not what is the best way of doing this? Thanks

    Read the article

  • get premitive , complex, ArrayEnumerable types

    - by john
    i have a separate class for each of my database entities and when i create an object of my class to reference the properties of a class it returns a circular reference which contains properties of other entities too that are related via FK ... to remove the circular reference i want to first make a copy of the object through "context proxy object" copy and then get the primitive, complex, arrayEnumerable types of that object and strip off these types from the object and then the object get returned by web service....

    Read the article

  • [Win32/MFC] Making group-boxes contain things

    - by John
    As I understand it, a group-box is just another control. Controls inside it are not owned by it, so unlike in Winforms, if you move a group-box the contained controls stay put. What would be the nicest way to address this? Just create your own data-structure mapping controls to 'container' group-boxes so that when the container is moved the children are automatically moved?

    Read the article

  • MFC: 'Gluing' two windows/dialogs together

    - by John
    I'm trying to set something up so my main dialog has one or more child dialogs, and these are glued/docked to the outside of the main dialog - when the main dialog is minimised, the children are too, when main dialog moves, children move with it. I'd tried setting child dialogs as having main dialog CWnd as parent, with CHILD style. But then they get clipped by the parent's boundary. If I set them as POPUP, they can be outside but then don't move with the parent. I'm looking at putting an OnMove handler on the parent dialog, but is there something built-in? And, should child dialogs still be children of the main dialog... I assume they should? This is VS2005 (I think VS2008 has some related functionality so I mention this).

    Read the article

  • Does a Distributed Version Control System really have no centralised repository?

    - by John
    It might seem a silly question, but how do you get a working drectory set up without a server to check out from? And how does a business keep a safe backed up copy of the repo? I assume then there must be a central repo... but then how exactly is it 'distributed'? I always thought of a server-client (SVN) Vs peer-2-peer (GIT) distinction, but I don't believe that can be correct unless tools like GIT are dependent on torrent-style technology?

    Read the article

  • Converting OpenGL coordinates to lower UIView (and UIImagePickerController)

    - by John Qualis
    I am new to OpenGL on the iPhone. I am developing an iPhone app similar to a barcode reader but with an extra OpenGL layer. The bottommost layer is UIImagePickerController, then I use UIView on top and draw a rectangle at certain coordinates on the iPhone screen. So far everything is OK. Then I am trying to draw an OpenGL 3-D model in that rectangle. I am able to load a 3-D model in the iPhone based on this code here - http://iphonedevelopment.blogspot.com/2008/12/start-of-wavefront-obj-file-loader.html I am not able to transform the coordinates of the rectangle into OpenGL coordinates. Appreciate any help. Do I need to use a matrix to translate the currentPosition of the 3-D model so it is drawn within myRect? The code is given below. -(void)setupView:(GLView*)view { const GLfloat zNear = 0.01, zFar = 1000.0, fieldOfView = 45.0; GLfloat size; glEnable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); size = zNear * tanf(DEGREES_TO_RADIANS(fieldOfView) / 2.0); CGRect rect = view.bounds; glFrustumf(-size, size, -size / (rect.size.width / rect.size.height), size / (rect.size.width / rect.size.height), zNear, zFar); glViewport(0, 0, rect.size.width, rect.size.height); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); NSString *path = [[NSBundle mainBundle] pathForResource:@"plane" ofType:@"obj"]; OpenGLWaveFrontObject *theObject = [[OpenGLWaveFrontObject alloc] initWithPath:path]; Vertex3D position; position.z = -8.0; position.y = 3.0; position.x = 2.0; theObject.currentPosition = position; self.plane = theObject; [theObject release]; } - (void)drawView:(GLView*)view; { static GLfloat rotation = 0.0; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glColor4f(0.0, 0.5, 1.0, 1.0); // the coordinates of the rectangle are // myRect.x, myRect.y, myRect.width, myRect.height // Do I need to use a matrix to translate the currentPosition of the // 3-D model so it is drawn within myRect? //glOrthof(-160.0f, 160.0f, -240.0f, 240.0f, -1.0f, 1.0f); [plane drawSelf]; }

    Read the article

  • tortoisesvn - Error REPORT request failed on ../../../!svn/vcc/default

    - by John
    Users attempting to check out files from a particular Subversion 1.4.x repository with Apache 2.2 on Windows 2003 have suddenly begun getting an error message in their log windows upon checkout with TortoiseSVN 1.4: Error REPORT request failed on '/[path_to_repo]/!svn/vcc/default' Error REPORT of '/[path_to_repo]/!svn/vcc/default': 200 OK (http://[server_name]) This started following an hd crash on the server and subsequent restore of about 10 subversion repositories. Only one repository is having this problem after an attempted working directory reconciliation. The repo owner reconcile their working directory with the repository by modifying/deleting the hidden .svn directories (though this was not advised). I can't find anything on the Internets that represents my situation. The restored server is exactly as the original and no other repositories on this server are throwing errors. Any ideas on 1) what this error is and 2) how to fix it?

    Read the article

  • MySQL - Limit a left join to the first date-time that occurs?

    - by John M
    Simplified table structure (the tables can't be merged at this time): TableA: dts_received (datetime) dts_completed (datetime) task_a (varchar) TableB: dts_started (datetime) task_b (varchar) What I would like to do is determine how long a task took to complete. The join parameter would be something like ON task_a = task_b AND dts_completed < dts_started The issue is that there may be multiple date-times that occur after the dts_completed. How do I create a join that only returns the first tableB-datetime that occurs after the tableA-datetime?

    Read the article

  • Accessing facebook sdk result Object using .NET 3.5 API?

    - by John K
    Consider the following in .NET 3.5 (using the Bin\Net35\Facebook*.dll assemblies): using Facebook; var app = new FacebookApp(); var result = app.Get("me"); // want to access result properties with no dynamic ... in the absence of the C# 4.0 dynamic keyword this provides only generic object members. How best should I access the facebook properties of this result object? Are there helper or utility methods or stronger types in the facebook C# SDK, or should I use standard .NET reflection techniques?

    Read the article

  • Does a servlet-based stack have significant overheads?

    - by John
    I don't know if it's simply because page-loads take a little time, or the way servlets have an abstraction framework above the 'bare metal' of HTTP, or just because of the "Enterprise" in Jave-EE, but in my head I have the notion that a servlet-based app is inherently adding overhead compared to a Java app which simply deals with sockets directly. Forget web-pages, imagine instead a Java server app where you send it a question over an HTTP request and it looks up an answer from memory and returns the answer in the response. You can easily write a Java socket-based app which does this, you can also do a servlet approach and get away from the "bare metal" of sockets. Is there any measurable performance impact to be expected implementing the same approach using Servlets rather than a custom socket-based HTTP listening app? And yes, I am hazy on the exact data sent in HTTP requests and I know it's a vague question. It's really about whether servlet implementations have lots of layers of indirection or anything else that would add up to a significant overhead per call, where by significant I mean maybe an additional 0.1s or more.

    Read the article

< Previous Page | 124 125 126 127 128 129 130 131 132 133 134 135  | Next Page >