Search Results

Search found 293 results on 12 pages for 'jamie'.

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

  • What would be the PHP equivalent of this Perl regex?

    - by Jamie
    What would be the PHP equivalent of this Perl regex? if (/^([a-z0-9-]+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/ and $1 ne "global" and $1 ne "") { print " <tr>\n"; print " <td>$1</td>\n"; print " <td>$2</td>\n"; print " <td>$3</td>\n"; print " <td>$4</td>\n"; print " <td>$5</td>\n"; print " <td>$6</td>\n"; print " <td>$7</td>\n"; print " <td>$8</td>\n"; print " </tr>\n"; }

    Read the article

  • The equivalent of this Perl regex in PHP

    - by Jamie
    Hi all, What would be the equivalent in php of this regex in php: I.e. which function would do the same job. if (/^([a-z0-9-]+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/ and $1 ne "global" and $1 ne "") { print " <tr>\n"; print " <td>$1</td>\n"; print " <td>$2</td>\n"; print " <td>$3</td>\n"; print " <td>$4</td>\n"; print " <td>$5</td>\n"; print " <td>$6</td>\n"; print " <td>$7</td>\n"; print " <td>$8</td>\n"; print " </tr>\n"; } Thanks very much! :-)

    Read the article

  • CVS branch name from tag name

    - by Jamie
    I have a number of modules in CVS with different tags. How would I go about getting the name of the branch these tagged files exist on? I've tried checking out a file from the module using cvs co -r TAG and then doing cvs log but it appears to give me a list of all of the branches that the file exists on, rather than just a single branch name. Also this needs to be an automated process, so I can't use web based tools like viewvc to gather this info.

    Read the article

  • Boost binding a function taking a reference

    - by Jamie Cook
    Hi all, I am having problems compiling the following snippet int temp; vector<int> origins; vector<string> originTokens = OTUtils::tokenize(buffer, ","); // buffer is a char[] array // original loop BOOST_FOREACH(string s, originTokens) { from_string(temp, s); origins.push_back(temp); } // I'd like to use this to replace the above loop std::transform(originTokens.begin(), originTokens.end(), origins.begin(), boost::bind<int>(&FromString<int>, boost::ref(temp), _1)); where the function in question is // the third parameter should be one of std::hex, std::dec or std::oct template <class T> bool FromString(T& t, const std::string& s, std::ios_base& (*f)(std::ios_base&) = std::dec) { std::istringstream iss(s); return !(iss >> f >> t).fail(); } the error I get is 1>Compiling with Intel(R) C++ 11.0.074 [IA-32]... (Intel C++ Environment) 1>C:\projects\svn\bdk\Source\deps\boost_1_42_0\boost/bind/bind.hpp(303): internal error: assertion failed: copy_default_arg_expr: rout NULL, no error (shared/edgcpfe/il.c, line 13919) 1> 1> return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]); 1> ^ 1> 1>icl: error #10298: problem during post processing of parallel object compilation Google is being unusually unhelpful so I hope that some one here can provide some insights.

    Read the article

  • Int[] Reverse - What does this actually do?

    - by Jamie Dixon
    I was just having a play around with some code in LINQPad and noticed that on an int array there is a Reverse method. Usually when I want to reverse an int array I'd do so with Array.Reverse(myIntArray); Which, given the array {1,2,3,4} would then return 4 as the value of myIntArray[0]. When I used the Reverse() method directly on my int array: myIntArray.Reverse(); I notice that myIntArray[0] still comes out as 1. What is the Reverse method actually doing here?

    Read the article

  • jQuery image fader slow in IE6 & 7

    - by Jamie
    Hi guys, I'm using the following jQuery script to rotate through a series of images pulled into an unordered list using PHP: function theRotator() { $('#rotator li').css({opacity: 0.0}); $('#rotator li:first').css({opacity: 1.0}); setInterval('rotate()',5000); }; function rotate() { var current = ($('#rotator li.show') ? $('#rotator li.show') : $('#rotator li:first')); var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('#rotator li:first') :current.next()) : $('#rotator li:first')); next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 2000); current.animate({opacity: 0.0}, 2000).removeClass('show'); }; $(document).ready(function() { theRotator(); }); It works brilliantly in FF, Safari, Chrome and even IE8 but IE6 & 7 are really slow. Can anyone make any suggestions on making it more efficient or just work better in IE6 & 7? The script is from here btw. Thanks.

    Read the article

  • Regular Expression to find the job id in a string

    - by Jamie
    Hi all, Please could someone help me, i will be forever appreciative. I'm trying to create a regular expression which will extract 797 from "Your job 797 ("job_name") has been submitted" or "Your Job 9212 ("another_job_name") has been submitted" etc. Any ideas? Thanks guys!

    Read the article

  • Problem with running JavaME

    - by Jamie
    Hi guys, I'm getting angry - I cant run the emulator (under vista x64). I still get the following error: Starting emulator in execution mode * Error * Failed to connect to device 2! Reason: Emulator 2 terminated while waiting for it to register! BUILD FAILED (total time: 26 seconds) I was trying to change the port to 1999, localhost to ip address and such stuff. Do you have any ideas what to do? Thank you in advance! Cheers

    Read the article

  • How do I convert an AMD module from a singleton to an instance?

    - by Jamie Ide
    I'm trying to convert a working Durandal view model module from a singleton to an instance. The original working version followed this pattern: define(['knockout'], function(ko) { var vm = { activate: activate, companyId: null; company: ko.observable({}) }; return vm; function activate(companyId) { vm.companyId = companyId; //get company data then vm.company(data); } } The new version exports a function so that I get a new instance on every request... define(['knockout'], function(ko) { var vm = function() { activate = activate; companyId = null; company = ko.observable({}); }; return vm; function activate(companyId) { vm.companyId = companyId; //get company data then vm.company(data); } } The error I'm getting is "object function () [...function signature...] has no method company on the line vm.company(data);. What am I doing wrong? Why can I set the property but can't access the knockout observable? How should I refactor the original code so that I get a new instance on every request? My efforts to simplify the code for this question hid the actual problem. My real code was using Q promises and calling two methods with Q.All. Since Q is in the global namespace, it couldn't resolve my viewmodel after converting to a function. Passing the view model to the methods called by Q resolved the problem.

    Read the article

  • How to send Event signal through Processes - C

    - by Jamie Keeling
    Hello all! I have an application consisting of two windows, one communicates to the other and sends it a struct constaining two integers (In this case two rolls of a dice). I will be using events for the following circumstances: Process a sends data to process b, process b displays data Process a closes, in turn closing process b Process b closes a, in turn closing process a I have noticed that if the second process is constantly waiting for the first process to send data then the program will be just sat waiting, which is where the idea of implementing threads on each process occurred and I have started to implement this already. The problem i'm having is that I don't exactly have a lot of experience with threads and events so I'm not sure of the best way to actually implement what I want to do. I'm trying to work out how the other process will know of the event being fired so it can do the tasks it needs to do, I don't understand how one process that is separate from another can tell what the states the events are in especially as it needs to act as soon as the event has changed state. Thanks for any help Edit: I can only use the Create/Set/Open methods for events, sorry for not mentioning it earlier.

    Read the article

  • How can I create an fscanf format string to accept white space and comma (,) tokenization

    - by Jamie
    I've got some analysis code (myprog) that sucks in data using the following: if(5 == fscanf(in, "%s%lf%f%f%f", tag, & sec, & tgt, & s1, & s2)) which works just fine. But in the situation where I've got data files that are separated by commas, I'm currently doing something like: sed 's/,/ /g' data | myprog Can I modify the format string in the fscanf() function to accept both delimitation formats?

    Read the article

  • Application design question, best approach?

    - by Jamie Keeling
    Hello, I am in the process of designing an application that will allow you to find pictures (screen shots) made from certain programs. I will provide the locations of a few of the program in the application itself to get the user started. I was wondering how I should go about adding new locations as the time goes on, my first thought was simply hard coding it into the application but this will mean the user has to reinstall it to make the changes take affect. My second idea was to use an XML file to contain all the locations as well as other data, such as the name of the application. This also means the user can add their own locations if they wish as well as sharing them over the internet. The second option seemed the best approach but then I had to think how would it be managed on the users computer. Ideally I'd like just a single .exe without the reliance on any external files such as the XML but this would bring me back to point one. Would it be best to simply use the ClickOnce deployment to create an entry in the start menu and create a folder containing the .exe and the file names? Thanks for the feedback, I don't want to start implementing the application until the design is nailed.

    Read the article

  • What are the most difficult aspects of project management in Software Engineering?

    - by Jamie Chapman
    I have been asked to provide a brief summary of the what the most difficult aspects of being a project manager of a software engineering project. However, I have no experience of this as I'm still at University and have no "hands on" experience of project management. I was hoping that someone on SO would be able to provide some insight based on their experience. What are the most difficult aspects of project management in Software Engineering?

    Read the article

  • map operator [] operands

    - by Jamie Cook
    Hi all I have the following in a member function int tt = 6; vector<set<int>>& temp = m_egressCandidatesByDestAndOtMode[tt]; set<int>& egressCandidateStops = temp.at(dest); and the following declaration of a member variable map<int, vector<set<int>>> m_egressCandidatesByDestAndOtMode; However I get an error when compiling (Intel Compiler 11.0) 1>C:\projects\svn\bdk\Source\ZenithAssignment\src\Iteration\PtBranchAndBoundIterationOriginRunner.cpp(85): error: no operator "[]" matches these operands 1> operand types are: const std::map<int, std::vector<std::set<int, std::less<int>, std::allocator<int>>, std::allocator<std::set<int, std::less<int>, std::allocator<int>>>>, std::less<int>, std::allocator<std::pair<const int, std::vector<std::set<int, std::less<int>, std::allocator<int>>, std::allocator<std::set<int, std::less<int>, std::allocator<int>>>>>>> [ const int ] 1> vector<set<int>>& temp = m_egressCandidatesByDestAndOtMode[tt]; 1> ^ I know it's got to be something silly but I can't see what I've done wrong.

    Read the article

  • PHP weirdness extending IMagick class

    - by Jamie Carl
    This is a really weird one. I have some code that is happily working on version 2.1.1RC1 of the php5-imagick module. It's basically just a class I wrote that extends the Imagick class and manages images stored in a database. Since upgrading to version 3.0.0RC1 (thankfully only on my dev box) things have gone to hell. It seems that object members are writeable but are NOT readable. Take the following sample code: class db_image extends IMagick { private $data; function __construct( $id = null ){ parent::__construct(); $this->data = 'some plain text'; echo $this->data; } This will output absolutely NOTHING. My debugger indicates that the contents of $this-data are the correct string value, but I am unable to read the value back out of the member variable. Seriously. WTF? Does anyone know what is causing this or has seen it before? I don't even know how to replicate this behaviour in my own classes.

    Read the article

  • Using CreateWindow() to make additional Window on a thread - C

    - by Jamie Keeling
    Hello, I have a windows form that has a simple menu and performs a simple operation, I want to be able to create another windows form with all the functionality of a menu bar, message pump etc.. as a separate thread so I can then share the results of the operation to the second window. I.E. 1) Form A opens Form B opens as a separate thread 2)Form A performs operation 3)Form A passes results via memory to Form B 4)Form B display results I'm confused as to how to go about it, the main app runs fine but i'm not sure how to add a second window if the first one already exists. I think that using CreateWindow will allow me to make another window but again i'm not sure how to access the message pump so I can respond to certain events like WM_CREATE on the second window. I hope it makes sense. Thanks!

    Read the article

  • Closing thread using ExitThread - C

    - by Jamie Keeling
    I have a simple program that creates a thread, loops twenty times and then makes a call to close itself and perform the necessary cleanup. When I debug the program it reaches the ExitThread(); method and pauses, ignoring the printf(); I have set up after it to signal to me it's closed. Is this normal or am I forgetting to do something? I'm new to threading using C. Main() void main() { Time t; int i = 0; StartTimer(); for(i = 0; i < 20; i++) { t = GetTime(); printf("%d.%.3d\n", t.seconds, t.milliseconds); Sleep(100); } StopTimer(); } Thread Creation void StartTimer() { DWORD threadId; seconds = 0; milliseconds = 0; // Create child thread hThread = CreateThread( NULL, // lpThreadAttributes (default) 0, // dwStackSize (default) ThreadFunc, // lpStartAddress NULL, // lpParameter 0, // dwCreationFlags &threadId // lpThreadId (returned by function) ); // Check child thread was created successfully if(hThread == NULL) { printf("Error creating thread\n"); } } Thread Close void StopTimer() { DWORD exitCode; if(GetExitCodeThread(hThread,&exitCode) != 0) { ExitThread(exitCode); printf("Thread closed"); if(CloseHandle(hThread)) { printf("Handle closed"); } } }

    Read the article

  • Developing on both Windows & Linux machines simultaneously

    - by Jamie
    Sorry for the bad title (couldn't think of a better way to describe it) I have a windows machine which I do development on. However, I have a new project which needs to interact with a linux system (executing linux commands etc.). So, obviously I can't do development on my windows machine..and I don't wish to code on the dev machine, svn commit and then svn update it on the linux machine. Is there a way where any changes I make on my dev machine will be quickly mirrored to the linux machine? SVN is not a very quick alternative and of course some changes will be very minor. Any ideas? A network share I guess....but that's not very pretty (bit slow too). As fellow developers I would like to know if you've been in a similar situation and how you've resolved it. On a furthernote, I can't just install Ubuntu as my development machine and mirror the commands, applications etc. from the linux machine because it's a cluster 'master' machine and so therefore it has quite a special configuration. Thanks guys! EDIT: I've also thought about having web services on the linux machine and then just calling them from code thus seperating platform development dependency. What do you think about that too? thanks

    Read the article

  • Clearing ColorConvertedBitmap in C#

    - by Jamie
    Hi guys, the problem is: I want to use the same ColorConvertedBitmap object for two purposes, firstly I set everyting: ColorConvertedBitmap conv = new ColorConvertedBitmap(); conv.BeginInit(); conv.SourceColorContext = new ColorContext(PixelFormats.Bgra32); conv.Source = myImage; conv.DestinationFormat = PixelFormats.Pbgra32; conv.DestinationColorContext = new ColorContext(PixelFormats.Pbgra32); conv.EndInit(); and then I would like to use the same object for another transformation. How to reset the values of ColorConvertedBitmap? Thank you for the reply! Cheers

    Read the article

  • jQuery validate - how do I ignore letter case?

    - by Jamie
    Probably a goofy question, but I can't seem to find anything in google land. I simply need one of my methods to ignore the case of the entered field. I am doing a city name match, but need both "Atlanta" and "atlanta" to be valid. How should I edit this to get the validation love that I need? jQuery.validator.addMethod("atlanta", function(value) { return value == "Atlanta"; //Need 'atlanta' to work too }, '**Recipient must reside in Chicago City Limits**'); Pre thanks to any and all :)

    Read the article

  • How to check if a DateTime range is within another 3 month DateTime range .NET 3.5 C#

    - by Jamie
    Hi I have a Start Date and End Date per record in a db. I need to check to see where the time period falls in a 2 year period broken into two lots of quarters then display what quarters each record falls into. Quarter 1 includes June 09, Jul 09, Aug 09 Quarter 2 includes Sept 09, Oct 09, Nov 09 Quarter 3 includes Dec 09, Jan 10, Feb 10 Quarter 4 includes Mar 10, Apr 10, May 10 Quaretr 5 includes Jun 10, Jul 10... e.g. 01/10/09 - 01/06/10 would fall into quarters 2, 3, 4 & 5 I am very new to .NET so any examples would be much appreciated.

    Read the article

  • Application built using VS2010 does not work in VS-Express2008 - C

    - by Jamie Keeling
    Hello, I have wrote an application that consists of two projects in a solution, each project contains only 1 .c source file. I was using Visual Studio 2010 Ultimate but due to the University only supporting 2008 I decided to create a blank solution and copy the source files into the new one. After creating a new solution in VS2008 express, creating two projects and re-creating and adding the source files to the projects I ran the application. For some reason only one part of the application does not work, I use CreateProcess() to execute "Project1.exe" from Project 2. This works fine under vs2010 but for some reason it's not working under VS2008 express, GetLastError() is showing an Error 2: File Not Found. This is an image showing the same code in both IDE's: I'm not using anything special and I've made sure that both solutions/projects are using .Net 3.5. I can't work out why it would work for one IDE and not the other. Any suggestions? Thanks!

    Read the article

  • Using events in threads between processes - C

    - by Jamie Keeling
    Hello all! I have an application consisting of two windows, one communicates to the other and sends it a struct constaining two integers (In this case two rolls of a dice). I will be using events for the following circumstances: Process a sends data to process b, process b displays data Process a closes, in turn closing process b Process b closes a, in turn closing process a I have noticed that if the second process is constantly waiting for the first process to send data then the program will be just sat waiting, which is where the idea of implementing threads on each process occurred and I have started to implement this already. The problem i'm having is that I don't exactly have a lot of experience with threads and events so I'm not sure of the best way to actually implement what I want to do. Following is a small snippet of what I have so far in the producer application; Create thread: case IDM_FILE_ROLLDICE: { hDiceRoll = CreateThread( NULL, // lpThreadAttributes (default) 0, // dwStackSize (default) ThreadFunc(hMainWindow), // lpStartAddress NULL, // lpParameter 0, // dwCreationFlags &hDiceID // lpThreadId (returned by function) ); } break; The data being sent to the other process: DWORD WINAPI ThreadFunc(LPVOID passedHandle) { HANDLE hMainHandle = *((HANDLE*)passedHandle); WCHAR buffer[256]; LPCTSTR pBuf; LPVOID lpMsgBuf; LPVOID lpDisplayBuf; struct diceData storage; HANDLE hMapFile; DWORD dw; //Roll dice and store results in variable storage = RollDice(); hMapFile = CreateFileMapping( (HANDLE)0xFFFFFFFF, // use paging file NULL, // default security PAGE_READWRITE, // read/write access 0, // maximum object size (high-order DWORD) BUF_SIZE, // maximum object size (low-order DWORD) szName); // name of mapping object if (hMapFile == NULL) { dw = GetLastError(); MessageBox(hMainHandle,L"Could not create file mapping object",L"Error",MB_OK); return 1; } pBuf = (LPTSTR) MapViewOfFile(hMapFile, // handle to map object FILE_MAP_ALL_ACCESS, // read/write permission 0, 0, BUF_SIZE); if (pBuf == NULL) { MessageBox(hMainHandle,L"Could not map view of file",L"Error",MB_OK); CloseHandle(hMapFile); return 1; } CopyMemory((PVOID)pBuf, &storage, (_tcslen(szMsg) * sizeof(TCHAR))); //_getch(); MessageBox(hMainHandle,L"Completed!",L"Success",MB_OK); UnmapViewOfFile(pBuf); return 0; } I'm trying to find out how I would integrate an event with the threaded code to signify to the other process that something has happened, I've seen an MSDN article on using events but it's just confused me if anything, I'm coming up on empty whilst searching on the internet too. Thanks for any help Edit: I can only use the Create/Set/Open methods for events, sorry for not mentioning it earlier.

    Read the article

  • Implementing events to communicate between two processes - C

    - by Jamie Keeling
    Hello all! I have an application consisting of two windows, one communicates to the other and sends it a struct constaining two integers (In this case two rolls of a dice). I will be using events for the following circumstances: Process a sends data to process b, process b displays data Process a closes, in turn closing process b Process b closes a, in turn closing process a I have noticed that if the second process is constantly waiting for the first process to send data then the program will be just sat waiting, which is where the idea of implementing threads on each process occurred and I have started to implement this already. The problem i'm having is that I don't exactly have a lot of experience with threads and events so I'm not sure of the best way to actually implement what I want to do. Following is a small snippet of what I have so far in the producer application; Create thread: case IDM_FILE_ROLLDICE: { hDiceRoll = CreateThread( NULL, // lpThreadAttributes (default) 0, // dwStackSize (default) ThreadFunc(hMainWindow), // lpStartAddress NULL, // lpParameter 0, // dwCreationFlags &hDiceID // lpThreadId (returned by function) ); } break; The data being sent to the other process: DWORD WINAPI ThreadFunc(LPVOID passedHandle) { HANDLE hMainHandle = *((HANDLE*)passedHandle); WCHAR buffer[256]; LPCTSTR pBuf; LPVOID lpMsgBuf; LPVOID lpDisplayBuf; struct diceData storage; HANDLE hMapFile; DWORD dw; //Roll dice and store results in variable storage = RollDice(); hMapFile = CreateFileMapping( (HANDLE)0xFFFFFFFF, // use paging file NULL, // default security PAGE_READWRITE, // read/write access 0, // maximum object size (high-order DWORD) BUF_SIZE, // maximum object size (low-order DWORD) szName); // name of mapping object if (hMapFile == NULL) { dw = GetLastError(); MessageBox(hMainHandle,L"Could not create file mapping object",L"Error",MB_OK); return 1; } pBuf = (LPTSTR) MapViewOfFile(hMapFile, // handle to map object FILE_MAP_ALL_ACCESS, // read/write permission 0, 0, BUF_SIZE); if (pBuf == NULL) { MessageBox(hMainHandle,L"Could not map view of file",L"Error",MB_OK); CloseHandle(hMapFile); return 1; } CopyMemory((PVOID)pBuf, &storage, (_tcslen(szMsg) * sizeof(TCHAR))); //_getch(); MessageBox(hMainHandle,L"Completed!",L"Success",MB_OK); UnmapViewOfFile(pBuf); return 0; } I'm trying to find out how I would integrate an event with the threaded code to signify to the other process that something has happened, I've seen an MSDN article on using events but it's just confused me if anything, I'm coming up on empty whilst searching on the internet too. Thanks for any help Edit: I can only use the Create/Set/Open methods for events, sorry for not mentioning it earlier.

    Read the article

  • Parsing XML with jQuery

    - by Jamie
    I've used this: $(document).ready(function () { $.ajax({ type: "GET", url: "http://domain.com/languages.php", dataType: "xml", success: xmlParser }); }); function xmlParser(xml) { $('#load').fadeOut(); $(xml).find("result").each(function () { $(".main").append('' + $(this).find("language").text() + ''); $(".lang").fadeIn(1000); }); } I used a local XML file on my computer, it works fine, but when I change the URL to an website, it just keeps loading all the time... How do I get this to work?

    Read the article

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