Search Results

Search found 735 results on 30 pages for 'brandon lee'.

Page 2/30 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • What's slowing for loops/assignment vs. C?

    - by Lee
    I have a collection of PHP scripts that are extremely CPU intensive, juggling millions of calculations across hundreds of simultaneous users. I'm trying to find a way to speed up the internals of PHP variable assignment, and looping sequences vs C. Although PHP is obviously loosely typed, is there any way/extension to specifically assign type (assign, not cast, which seems even more expensive) in a C-style fashion? Here's what I mean. This is some dummy code in C: #include <stdio.h> int main() { unsigned long add=0; for(unsigned long x=0;x<100000000;x++) { add = x*59328409238; } printf("x is %ld\n",add); } Pretty self-explanatory -- it loops 100 million times, multiples each iteration by an arbitrary number of some 59 billion, assigns it to a variable and prints it out. On my Macbook, compiling it and running it produced: lees-macbook-pro:Desktop lee$ time ./test2 x is 5932840864471590762 real 0m0.266s user 0m0.253s sys 0m0.002s Pretty darn fast! A similar script in PHP 5.3 CLI... <?php for($i=0;$i<100000000;$i++){ $a=$i*59328409238; } echo $a."\n"; ?> ... produced: lees-macbook-pro:Desktop lee$ time /Applications/XAMPP/xamppfiles/bin/php test3.php 5.93284086447E+18 real 0m22.837s user 0m22.110s sys 0m0.078s Over 22 seconds vs 0.2! I realize PHP is doing a heck of a lot more behind the scenes than this simple C program - but is there any way to make the PHP internals to behave more 'natively' on primitive types and loops?

    Read the article

  • assign subset of parent table to objects in R

    - by Brandon
    Hello, I would like to iterate through a table and break it into relvant parts based on the number of visits. I have tried several things but cannot seem to get it to work. I have included the code. for(i in 1:6){ paste("testing.visit",i,"\n",sep="") <- subset(testing,visit_no==2) } But I get the following error. Error in paste("testing.visit", i, "\n", sep = "") <- subset(testing, : target of assignment expands to non-language object Thank you, Brandon

    Read the article

  • Get Date Strings for draw_calendar() Function

    - by Brandon
    I'm using the David Walsh PHP calendar script and need to format my date arguments like this: draw_calendar(7,2009); I want to get today's Month and Year as well as the next month and the month after that (so current month, plus one, plus one). How can I call the function three times in succession to generate these three calendars only knowing today's Month and Year? -Brandon

    Read the article

  • Dots and spaces in variable names from external sources are converted to underscores

    - by Brandon
    Trying a bit of AJAX, and I find that much of my data is littered with underscores! Documentation confirms that this is working as intended. Any way to pass my form information to PHP intact? I'm using CodeIgniter, so my pass looks like /controller/function/variable, receiving controller: controller{ function($v=0){#what once was hello world is now hello_world...} } I can't very well do an undo, data might contain an underscore. Thanks, Brandon

    Read the article

  • [PHP] Dots and spaces in variable names from external sources are converted to underscores

    - by Brandon
    Trying a bit of AJAX, and I find that much of my data is littered with underscores! Documentation confirms that this is working as intended. Any way to pass my form information to PHP in tact? I'm using code igniter, so my pass looks like /controller/function/variable, receiving controller: controller{ function($v=0){#what once was hello world is now hello_world...} } I can't very well do an undo, data might contain an underscore. Thanks, Brandon

    Read the article

  • Why would cat6 connectors not work with cat5e patch cable?

    - by Lee Tickett
    I had a naff batch of cat5 connectors (the latching mechanism didn't work) so decided to order in some cat6 connectors in preparation for the inevitable upgrade. My existing reel of for making patch cables is cat5e utp stranded. I made up a few cables and tested them- none of them worked. I recrimped and still nothing. When i check them with a multi-meter not all pins are connected. This reel has always worked with the previous cat5 connectors so I tested the cat6 connectors on a reel of solid cat5e cable and they work fine. Any ideas what I might be doing wrong? Or what might be at fault? (cable/connectors) and how I can diagnose? Thanks Lee

    Read the article

  • Named pipe blocking with user nobody

    - by dnagirl
    I have 2 short scripts. The first, an awk script, processes a large file and prints to a named pipe 'myfifo.dat'. The second, a Perl script, runs a LOAD DATA LOCAL INFILE 'myfifo.dat'... command. Both of these scripts work when run locally like so: lee.awk big.file & lee.pl However, when I call these scripts from a PHP webpage, the named pipe blocks: $awk="/path/to/lee.awk {$_FILES['uploadfile']['tmp_name']} &"; $sql="/path/to/lee.pl"; if(!exec($awk,$return,$err)) throw new ZException(print_r($err,true)); //blocks here if(!exec($sql,$return,$err)) throw new ZException(print_r($err,true)); If I modify the awk and Perl scripts so that they write and read to a normal file, everything works fine from PHP. The permissions on the fifo and the normal file are 666 (for testing purposes). These operations run much more quickly through a named pipe, so I'd prefer to use one. Any ideas how to unblock it? ps. In case you're wondering why I'm going to all this aggravation, see this SO question.

    Read the article

  • Win7 Pro x64 task manager hangs when restarting explorer.exe after waking from sleep

    - by Brandon Dybala
    I have a desktop running Windows 7 x64 Pro, set for Hybrid Sleep on a wired network. Wakeup is only enabled from the keyboard (wake on mouse and Wake-On-LAN are both disabled). Sometimes when it wakes up, there is no network connectivity. The notification area icons for both network and volume don't respond to clicks. If I open the Network and Sharing Center, clicking the red X doesn't do anything. Restarting does fix the problem, but I'm looking for a solution that does not require restarting (if at all possible). Drivers are all up to date. I've tried opening Task Manager and restarting the explorer.exe process, but Task Manager freezes for a few minutes, the "New Task" dialog closes, and explorer.exe has not restarted. CPU and memory usage are both normal. One thread suggested making sure the BIOS was set for S3 sleep mode only (not S1 or S1 & S3), but I haven't checked this yet. Going back to sleep and waking back up does not help. So far only a reboot has fixed the issue. System specs: Windows 7 x64 Pro Asus P8Z68-V PRO/GEN3 128 GB Crucial m4 SSD (Firmware version 0309) Intel Core i7 2600 3.4 GHz 16 GB RAM Any ideas? Brandon

    Read the article

  • How to insert a word into a string in Perl

    - by Nano HE
    #!C:\Perl\bin\perl.exe use strict; use warnings; use Data::Dumper; my $fh = \*DATA; while(my $line = <$fh>) { $line =~ s/ ^/male /x ; print $line ; } __DATA__ 1 0104 Mike Lee 2:01:48 output male 1 0104 Mike Lee 2:01:48 Then I tried to insert male after the racenumber(0104), I replaced the code with style. $line =~ s/ ^\d+\s+\d+\s+ /male /x ; # but failed Acturally I want the output. thank you. 1 0104 male Mike Lee 2:01:48

    Read the article

  • How do I insert a word into a string in Perl?

    - by Nano HE
    #!C:\Perl\bin\perl.exe use strict; use warnings; use Data::Dumper; my $fh = \*DATA; while(my $line = <$fh>) { $line =~ s/ ^/male /x ; print $line ; } __DATA__ 1 0104 Mike Lee 2:01:48 output male 1 0104 Mike Lee 2:01:48 Then I tried to insert male after the racenumber(0104), I replaced the code with style. $line =~ s/ ^\d+\s+\d+\s+ /male /x ; # but failed Acturally I want the output. thank you. 1 0104 male Mike Lee 2:01:48

    Read the article

  • Mysql : get data from 2 tables (need help)

    - by quangtruong1985
    Assume that I have 2 tables : members and orders (Mysql) Members : id | name 1 | Lee 2 | brad Orders : id | member_id | status (1: paid, 2: unpaid) | total 1 | 1 | 1 | 1000000 2 | 1 | 1 | 1500000 3 | 1 | 2 | 1300000 4 | 2 | 1 | 3000000 5 | 2 | 2 | 3500000 6 | 2 | 2 | 3300000 I have a sql query : SELECT m.name, COUNT(o.id) as number_of_order, SUM(o.total) as total2 FROM orders o LEFT JOIN members m ON o.member_id=m.id GROUP BY o.member_id which give me this: name | number_of_order | total2 Lee | 3 | 3800000 brad | 3 | 9800000 All that I want is something like this : name | number_of_order | total2 | Paid Unpaid | Paid Unpaid ------------------------------------------------ Lee | 3 | 3800000 | 2 1 | 2500000 1300000 ------------------------------------------------ brad | 3 | 9800000 | 1 2 | 3000000 6800000 ------------------------------------------------ How to make a query that can give me that result? Thanks for your time!

    Read the article

  • Facebook Javascript SDK: First time logging in

    - by Brandon
    I'm currently integrating Facebook with my website using the Javascript SDK. I've got the login portion working well. The only thing I'm trying to figure out is if there is a way to tell if it was the first time the user logged into my website using their Facebook credientials. I tried subscribing to auth.login, but that didn't seem to have any information about that. Is there a flag anywhere that lets me know this? Or another way to go about looking this up? I realize I could do some server side code, but I'd prefer to stay away from that if possible. Thanks in advance, Brandon

    Read the article

  • [PHP] access array element by value

    - by Brandon
    array( [0] name => 'joe' size => 'large' [1] name => 'bill' size => 'small' ) I think i'm being thick, but to get the attributes of an array element if I know the value of one of the keys, I'm first looping through the elements to find the right one. foreach($array as $item){ if ($item['name'] == 'joe'){ #operations on $item } } I'm aware that this is probably very poor, but I am fairly new and am looking for a way to access this element directly by value. Or do I need the key? Thanks, Brandon

    Read the article

  • McAfee Virus Scan and Oracle RAC

    - by Lee Gathercole
    Hi, We're experiencing a strange problem with Oracle RAC and McAfee anti-virus. As part of the installation of the Oracle RAC we disable anti virus as directed. We have had our RAC running fine, but when we came to re-enable the AV and reboot we got the BSOD. Abnormal Program Termination (BugCheck, STOP: 0x00000035 (0x8E984678, 0x00000000, 0x00000000, 0x00000000 NO_MORE_IRP_STACK_LOCATIONS Following the standard process of raising this problem with Microsoft they identify the problem and also a fix. Microsoft talk about too many file filter drivers being present and pushing the DFS upper limit beyond the default size. Upping this value, as per msdn, has no impact. We're able to recover from this BSOD by disabling AV. We don't have the problem if we run the AV service manually whilst the system is up. However, if we make the service automatic we fail to boot. Tech Details 2 Node Oracle 10g Cluster 2 * Windows 2003 SP2, 16GB RAM, Quad Core 3ghz Processor SAN attached storage McAfee VirusScan Enterprise 8.5.0i, Scan Engine (5300.2777), DAT Version (5536.0000) Thanks Lee

    Read the article

  • Unable to specify abstract classes in TPH hierarchy in Entity Framework 4

    - by Lee Atkinson
    Hi I have a TPH heirachy along the lines of: A-B-C-D A-B-C-E A-F-G-H A-F-G-I I have A as Abstract, and all the other classes are concrete with a single discriminator column. This works fine, but I want C and G to be abstract also. If I do that, and remove their discriminators from the mapping, I get error 3034 'Two entities with different keys are mapped to the same row'. I cannot see how this statement can be correct, so I assume it's a bug in some way. Is it possible to do the above? Lee

    Read the article

  • Unit Test to Run .sql script to SQL Create Database

    - by Lee Englestone
    Can anyone point me in the direction of how I could get a NUnit test to run a .sql file to Create / Setup a database. I know about the the TestFixtureSetUp and TestFixtureTearDown attributes / methods in NUnit. So I KNOW how to call methods before and after all or each unit tests. I'm just unsure of how to load and execute the contents of a .sql file agains a SQL Server 2005 database programatically. Any examples? This is part of our TDD / CI. We are wanting to create the database before and tear down the database after executing unit tests. Cheers, -- Lee

    Read the article

  • VB.net 'cross-referencing' tables.

    - by Lee
    Hello, I have a DataGridView that is being filled with data from a table. Inside this table is a column called 'group' that has the ID of an individual group in another table. What I would like to do, is when the DataGridView is filled, instead of showing the ID contained in 'group', I'd like it to display the name of the group. Is there some type of VB.net 'magic' that can do this, or do I need to cross-reference the data myself? Here is a breakdown of what the 2 tables look like: table1 id group (this holds the value of column id in table 2) weight last_update table2 id description (this is what I would like to be displayed in the DGV.) take care, lee BTW - I am using Visual Studios Express.

    Read the article

  • Continuous Integration with Oracle Products

    - by Lee Gathercole
    Hi, I'm currently working on a Datawarehouse project using an Oracle Database, Oracle Data Integrator, Oracle Warehouse Builder and some Jython thrown in for good measure. All of which is held within TFS. My background is .net and prior to this project was seeing a lot of promise in CI. I'm not suggesting that the testing element of CI is feasible in this instance, but I would like to implement a stable deployment strategy. What I'm trying to understand is whether or not I can build some NANT scripts that will allow me to deploy ODI\OWB\Oracle DB code to any given environment at any point. Has anyone tried this before? Are there more appropriate tools out there that lends themselves better to this sort of toolset? Am I just a crazy horse to be evening contemplating this? Any view would be greatly appreciated. Thanks Lee

    Read the article

  • Where Are the Release Versions of ASP.Net AJAX 4.0 Templating Files?

    - by Lee Richardson
    I'm trying to get the production version of ASP.Net AJAX 4.0 Templating working and can't find the JavaScript files. With the beta version I needed to reference MicrosoftAjaxTemplates.js, MicrosoftAjaxAdoNet.js, and MicrosoftAjaxDataContext.js. I can get everything to work with the beta CDN versions (e.g. http://ajax.microsoft.com/ajax/beta/0911/MicrosoftAjaxTemplates.js). But for the life of me I can't find 1. The release CDN versions of these files or 2. Where to download the whole Release ASP.Net AJAX 4.0 JavaScript package. The files certainly are not listed on the ASP.Net AJAX 4.0 CDN at http://www.asp.net/ajaxlibrary/CDNAjax4.ashx. Maybe the files have been renamed? Theoretically this should be a rediculously easy question and I'm a little embarrased to even ask it on StackOverflow, but I've had no luck finding an answer on my own. Any help would be much appreciated. Thanks, - Lee

    Read the article

  • How do I improve the efficiency of the queries executed by this generic Linq-to-SQL data access clas

    - by Lee D
    Hi all, I have a class which provides generic access to LINQ to SQL entities, for example: class LinqProvider<T> //where T is a L2S entity class { DataContext context; public virtual IEnumerable<T> GetAll() { return context.GetTable<T>(); } public virtual T Single(Func<T, bool> condition) { return context.GetTable<T>().SingleOrDefault(condition); } } From the front end, both of these methods appear to work as you would expect. However, when I run a trace in SQL profiler, the Single method is executing what amounts to a SELECT * FROM [Table], and then returning the single entity that meets the given condition. Obviously this is inefficient, and is being caused by GetTable() returning all rows. My question is, how do I get the query executed by the Single() method to take the form SELECT * FROM [Table] WHERE [condition], rather than selecting all rows then filtering out all but one? Is it possible in this context? Any help appreciated, Lee

    Read the article

  • Is Windows 7 Home Premium edition sufficient for software development?

    - by Lee Englestone
    Is the Windows 7 Home Premium sufficient for software development? Development would be in Visual Studio 2010. I'm on a budget so would rather purchase 'Home Premium' rather than 'Professional' or 'Ultimate'. The Microsoft site says there is next to nothing functionality wise between them that developers would miss. Can anyone confirm or deny? BTW. Does it come with a version of IIS? I realize that this is not a technical question. But it is important to me and I'm sure other developers wonder the same thing. Cheers, -- Lee

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >