Daily Archives

Articles indexed Friday May 21 2010

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

  • How can match end-of-line multiple times in a regex without interpolation?

    - by harschware
    Hi, if I have a input with new lines in it like: [INFO] xyz [INFO] How can I pull out the xyz part? I tried a pattern like /^\[INFO\]$(.*?)$\[INFO\]/ms, but perl gives me: Use of uninitialized value $\ in regexp compilation at scripts\t.pl line 6. I've been trying things to get interpolation to stop like using qr// but alas, no love. EDIT: The key is that the end-of-line anchor is a dollar sign but at times it may be necessary to intersperse the end-of-line anchor through the pattern. If the pattern is interpolating then you might get problems such as uninitialized $\. For instance an acceptable solution here is /^\[INFO\]\s*^(.*?)\s*^\[INFO\]/ms but that does not solve the crux of the first problem. I've changed the anchors to be ^ so there is no interpolation going on, and with this input I'm free to do that. But what about when I really do want to reference EOL with $ in my pattern? How do I get the regex to compile?

    Read the article

  • How much languages is "recommended" for a dynamic website?

    - by user345690
    When constructing a website, say a Q&A site or a just a forum site for a community, is just knowing HTML,CSS,PHP, MySQL, and javascript enough to make the site dynamic? I am saying this because when I talked with my teacher, he said that major sites use many languages combined. And he said that a site shouldn't be designed only in PHP. So is it possible to create a good website, not e-commerce, with only html,css, and php?

    Read the article

  • sqlite with Perl for Windows; suitable for relocation

    - by Paul Nathan
    I need to set up sqllite for Perl on a Windows box. However - Perl is probably being run over the network from a central server, and I do not know what modules will be available on initial running of my script. I can guarantee Perl 5.8+ (activestate) or Perl 5.10+ (strawberry). Therefore, I need to package sqlite & the associated Perl module(s) in the project directory itself. Having Goggled around, I don't see any immediate zipfile to do this.

    Read the article

  • how to send an array of bytes over a TCP connection (java programming)

    - by Mark Roberts
    Can somebody demonstrate how to send an array of bytes over a TCP connection from a sender program to a receiver program in Java. (I'm new to Java programming, and can't seem to find an example of how to do this that shows both ends of the connection (sender and receiver.) If you know of an existing example, maybe you could post the link. (No need to reinvent the wheel.) P.S. This is NOT homework! :-)

    Read the article

  • Shell how configure command to always work with some params?

    - by Gabriel L. Oliveira
    Hi. I want to know how to configure your environment to execute some command with specific params everytime you use it. So, if I have a command named: spec I want to know where I configure my bash to always use: spec -c --format nested instead of just 'spec' I tried to put this like an alias on my .bashrc file, like: alias spec='spec -c --format pretty' but didn't work. Any tip?

    Read the article

  • A controller method that calls a different method on the same controller

    - by justSteve
    I have a controller method: public ActionResult Details(int id) { Order order = OrderFacade.Instance.Load(id); return View(order); } that is used for 95% of possible invocations. For the other 5% i need to manipulate the value of id before passing to the facade. I'd like to create a separate method within this same controller that executes that manipulation and then calls this (Details) method. What would the signature of that method look like? What is the syntax to call the main Details method? public ??? ManipulatorMethod(int id) { [stuff that manipulates id] [syntax to call Details(manipulatedID)] } mny thx

    Read the article

  • Beginner video capture and processing/Camera selection

    - by mattbauch
    I'll soon be undertaking a research project in real-time event recognition but have no experience with the programming aspect of video capture (I'm an upperclassman undergraduate in computer engineering). I want to start off on the right foot so advice from anyone with experience would be great. The ultimate goal is to track events such as a person standing up/sitting down, entering/leaving a room, possibly even shrugging/slumping in posture, etc. from a security camera-like vantage point. First of all, which cameras/companies would you recommend? I'm looking to spend ~$100, more if necessary but not much. Great resolution isn't a must, but is desirable if affordable. What about IP network cameras vs. a USB type webcam? Webcams are less expensive, but IP cameras seem like they'd be much less work to deal with in software. What features should I look for in the camera? Once I've selected a camera, what does converting its output to a series of RGB bitmaps entail? I've never dealt with video encoding/decoding so a starting point or a tutorial that will guide me up to this point would be great if anyone has suggestions. Finally, what is the best (least complicated/most efficient) way to display video from the camera plus my own superimposed images (boxes around events in progress, for instance) in a GUI application? I can work on any operating system in any language. I have some experience with win32 GUIs and Java GUIs. The focus of the project is on the algorithm and so I'm trying to get the video capture/display portion of the app done cleanly and quickly. Thanks for any responses!!

    Read the article

  • Singletons in Cocoa Plugins

    - by David Beck
    How would I get a hold of a singleton in the main application from a SIMBL plugin? When I try to call something like [ProcessControl sharedInstance], I get an error that ProcessControl is undefined (even though it is declared in a header file).

    Read the article

  • Geben for emacs on Ubuntu 10.04

    - by jhedstrom
    I've had geben running perfectly on previous versions of Ubuntu. After the upgrade, and installing the latest version of geben (0.26), it only half works. Specifically, when in context mode, local variables are always marked as undefined. Has anybody successfully gotten geben up and running under Ubuntu 10.04, or is this a bug in geben (I've reported it as one, but thought I'd check here just in case there is a workaround). geben 0.26 xdebug 2.0.5 emacs 23.1.1 5.3.2-1ubuntu4.1 Thanks!

    Read the article

  • Windows 7 - 64 Computer shuts off unexpectedly

    - by C. Ross
    I have a home built Windows 7 x64 computer with a Core 2 Quad CPU. It has recently taken to suddenly shutting down/turning off at unusual intervals. It seems to be most common when playing media. I have tried running SpeedFan, and the CPU temp seems to hover around 49C. The computer has been running fine for over 1 years. Could heat be my problem, and how should I address it?

    Read the article

  • dealloc properties with assign and readwrite objective-c

    - by okami
    I have this structure: @interface MyList : NSObject { NSString* operation; NSString* link; } @property (readwrite) NSString* operation; @property (readwrite, assign) NSString* link; @end @implementation MyList @synthesize operation,link; @end I know that if I had retain instead of readwrite I should release the operation and link properties. BUT should I release the operation and link with the code above?

    Read the article

  • Need to get pixel averages of a vector sitting on a bitmap...

    - by user346511
    I'm currently involved in a hardware project where I am mapping triangular shaped LED to traditional bitmap images. I'd like to overlay a triangle vector onto an image and get the average pixel data within the bounds of that vector. However, I'm unfamiliar with the math needed to calculate this. Does anyone have an algorithm or a link that could send me in the right direction? I'm not even clear what this type of math is called. I've created a basic image of what I'm trying to capture here: http://imgur.com/Isjip.gif

    Read the article

  • What's the life-time of a thread-local value in Python?

    - by Carlos Valiente
    import threading mydata = threading.local() def run(): # When will the garbage collector be able to destroy the object created # here? After the thread exits from ``run()``? After ``join()`` is called? # Or will it survive the thread in which it was created, and live until # ``mydata`` is garbage-collected? mydata.foo = object() t = threading.Thread(target=run) t.start() t.join()

    Read the article

  • Retrieving virtual disk file name from disk number

    - by Josip Medved
    When I list virtual disks within diskpart: DISKPART> list vdisk VDisk ### Disk ### State Type File --------- -------- -------------------- --------- ---- VDisk 0 Disk 2 Attached not open Fixed C:\Disk.vhd Interesting part for me here is file name. I tried to find equivalent of function that would give me file name (under File column) if I know disk number. Any idea which function that might be?

    Read the article

  • How can I match end-of-line multiple times in a regex without interpolation?

    - by harschware
    Hi, if I have a input with new lines in it like: [INFO] xyz [INFO] How can I pull out the xyz part? I tried a pattern like /^\[INFO\]$(.*?)$\[INFO\]/ms, but perl gives me: Use of uninitialized value $\ in regexp compilation at scripts\t.pl line 6. I've been trying things to get interpolation to stop like using qr// but alas, no love. EDIT: The key is that the end-of-line anchor is a dollar sign but at times it may be necessary to intersperse the end-of-line anchor through the pattern. If the pattern is interpolating then you might get problems such as uninitialized $\. For instance an acceptable solution here is /^\[INFO\]\s*^(.*?)\s*^\[INFO\]/ms but that does not solve the crux of the first problem. I've changed the anchors to be ^ so there is no interpolation going on, and with this input I'm free to do that. But what about when I really do want to reference EOL with $ in my pattern? How do I get the regex to compile?

    Read the article

  • Should I commit or rollback a transaction that creates a temp table, reads, then deletes it?

    - by Triynko
    To select information related to a list of hundreds of IDs... rather than make a huge select statement, I create temp table, insert the ids into it, join it with a table to select the rows matching the IDs, then delete the temp table. So this is essentially a read operation, with no permanent changes made to any persistent database tables. I do this in a transaction, to ensure the temp table is deleted when I'm finished. My question is... what happens when I commit such a transaction vs. let it roll it back? Performance-wise... does the DB engine have to do more work to roll back the transaction vs committing it? Is there even a difference since the only modifications are done to a temp table? Related question here, but doesn't answer my specific case involving temp tables: http://stackoverflow.com/questions/309834/should-i-commit-or-rollback-a-read-transaction

    Read the article

  • Using ExtJS in ASP.NET

    - by Mike
    I don’t have advanced knowledge in JavaScript, and I am trying to learn how to use ExtJS framework in ASP.NET (C# or VB.NET) environment. I’ve got couple of samples, but was unable get the project working. Can anyone point in the right direction such as website or book so I can go a read up about the ExtJS in more details and how I can include this into my website?

    Read the article

  • JNLP File Association: How do I open the file which was double-clicked on?

    - by Sam Barnum
    I've got the following JNLP: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0.10//EN" "http://java.sun.com/dtd/JNLP-6.0.10.dtd"> <jnlp spec="6.0.10" version="1.63" codebase="http://foo.example.com/msi" href="Foo.jnlp"> <information> <title>Foo</title> <vendor> Foo Systems, Inc.</vendor> <homepage href="http://Foo.com"/> <description>Foo Viewer/Editor Application</description> <icon href="splash.gif" width="425" height="102" kind="splash"/> <icon href="Foo.gif" width="64" height="64"/> <offline-allowed/> <shortcut> <desktop/> <menu submenu="Foo Systems, Inc."/> </shortcut> <association mime-type="application-x/wlog" extensions="wlog"/> <association mime-type="application-x/mplot" extensions="mplot"/> </information> <security> <all-permissions/> </security> <resources> <j2se version="1.6+" initial-heap-size="32m" max-heap-size="255m"/> <jar href="jars_deployment/TimingFramework-1.0.jar"/> <jar href="jars_deployment/iText-2.1.5.jar"/> <jar href="jars_deployment/jai_codec.jar"/> <jar href="Foo.jar"/> <jar href="jars_deployment/TimingFramework-1.0.jar"/> <jar href="jars_deployment/iText-2.1.5.jar"/> <jar href="jars_deployment/jai_codec.jar"/> <jar href="jars_deployment/jsch-20090402.jar"/> <property name="apple.laf.useScreenMenuBar" value="true"/> <property name="apple.awt.graphics.UseQuartz" value="false"/> <property name="com.apple.mrj.application.apple.menu.about.name" value="Foo"/> <property name="java.util.logging.config.file" value="/Users/Shared/logging.properties"/> </resources> <application-desc main-class="com.prosc.msi.editor.ui.test.Sandbox"/> </jnlp> Most everything is working. When I double-click a .wlog file, it opens up my application. However, it doesn't open the correct file. I read somewhere that JNLP was supposed to pass parameters to the main method indicating which file caused the app to be launched, but this is not happening (on OS X 10.6). I get an empty array to my application's main method. Probably unrelated, my splash screen doesn't work :( Any pointers on getting this working?

    Read the article

  • jquery group validator plugin overriding the first items

    - by christian
    SO Question: jQuery Validate - require at least one field in a group to be filled I uses the sample rule from the above link and it works, but the problem was it overrides the fields that going to be validated it jumps directly to the group validation, when validates a form the messages in my error container only contains error for the group fields.

    Read the article

  • How can I send multiple images in a server push Perl CGI program?

    - by Jujjuru
    I am a beginner in Perl CGI etc. I was experimenting with server-push concept with a piece of Perl code. It is supposed to send a jpeg image to the client every three seconds. Unfortunately nothing seems to work. Can somebody help identify the problem? Here is the code: use strict; # turn off io buffering $|=1; print "Content-type: multipart/x-mixed-replace;"; print "boundary=magicalboundarystring\n\n"; print "--magicalboundarystring\n"; #list the jpg images my(@file_list) = glob "*.jpg"; my($file) = ""; foreach $file(@file_list ) { open FILE,">", $file or die "Cannot open file $file: $!"; print "Content-type: image/jpeg\n\n"; while ( <FILE> ) { print "$_"; } close FILE; print "\n--magicalboundarystring\n"; sleep 3; next; } EDIT: added turn off i/o buffering, added "use strict" and "@file_list", "$file" are made local

    Read the article

  • Unit Testing & Fake Repository implementation with cascading CRUD operations

    - by Erik Ashepa
    Hi, i'm having trouble writing integration tests which use a fake repository, For example : Suppose I have a classroom entity, which aggregates students... var classroom = new Classroom(); classroom.Students.Add(new Student("Adam")); _fakeRepository.Save(classroom); _fakeRepostiory.GetAll<Student>().Where((student) => student.Name == "Adam")); // This query will return null... When using my real implementation for repository (NHibernate based), the above code works (because the save operation would cascade to the student added at the previous line), Do you know of any fake repository implementation which support this behaviour? Ideas on how to implement one myself? Or do you have any other suggestions which could help me avoid this issue? Thanks in advance, Erik.

    Read the article

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