Search Results

Search found 1436 results on 58 pages for 'martin g miller'.

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

  • Using Unix Process Controll Methods in Ruby

    - by John F. Miller
    Ryan Tomayko touched off quite a fire storm with this post about using Unix process control commands. We should be doing more of this. A lot more of this. I'm talking about fork(2), execve(2), pipe(2), socketpair(2), select(2), kill(2), sigaction(2), and so on and so forth. These are our friends. They want so badly just to help us. I have a bit of code (a delayed_job clone for DataMapper that I think would fit right in with this, but I'm not clear on how to take advantage of the listed commands. Any Ideas on how to improve this code? def start say "*** Starting job worker #{@name}" t = Thread.new do loop do delay = Update.work_off(self) break if $exit sleep delay break if $exit end clear_locks end trap('TERM') { terminate_with t } trap('INT') { terminate_with t } trap('USR1') do say "Wakeup Signal Caught" t.run end end

    Read the article

  • What is a good motivating example for dataflow concurrency?

    - by Alex Miller
    I understand the basics of dataflow programming and have encountered it a bit in Clojure APIs, talks from Jonas Boner, GPars in Groovy, etc. I know it's prevalent in languages like Io (although I have not studied Io). What I am missing is a compelling reason to care about dataflow as a paradigm when building a concurrent program. Why would I use a dataflow model instead of a mutable state+threads+locks model (common in Java, C++, etc) or an actor model (common in Erlang or Scala) or something else? In particular, while I know of library support in the languages above (and Scala and Ruby), I don't know of a single program or library that is a poster child user of this model. Who is using it? Why do they find it better than the other models I mentioned?

    Read the article

  • Why does ANTLR not parse the entire input?

    - by Martin Wiboe
    Hello, I am quite new to ANTLR, so this is likely a simple question. I have defined a simple grammar which is supposed to include arithmetic expressions with numbers and identifiers (strings that start with a letter and continue with one or more letters or numbers.) The grammar looks as follows: grammar while; @lexer::header { package ConFreeG; } @header { package ConFreeG; import ConFreeG.IR.*; } @parser::members { } arith: term | '(' arith ( '-' | '+' | '*' ) arith ')' ; term returns [AExpr a]: NUM { int n = Integer.parseInt($NUM.text); a = new Num(n); } | IDENT { a = new Var($IDENT.text); } ; fragment LOWER : ('a'..'z'); fragment UPPER : ('A'..'Z'); fragment NONNULL : ('1'..'9'); fragment NUMBER : ('0' | NONNULL); IDENT : ( LOWER | UPPER ) ( LOWER | UPPER | NUMBER )*; NUM : '0' | NONNULL NUMBER*; fragment NEWLINE:'\r'? '\n'; WHITESPACE : ( ' ' | '\t' | NEWLINE )+ { $channel=HIDDEN; }; I am using ANTLR v3 with the ANTLR IDE Eclipse plugin. When I parse the expression (8 + a45) using the interpreter, only part of the parse tree is generated: http://imgur.com/iBaEC.png Why does the second term (a45) not get parsed? The same happens if both terms are numbers. Thank you, Martin Wiboe

    Read the article

  • Alternatives to CAT.NET for website security analysis

    - by Gavin Miller
    I'm looking for an alternative tool to CAT.NET for performing static security scans on .NET code. Currently the CAT.NET tooling/development is at a somewhat fragile stage and doesn't offer the reliability that I'm looking for. Are there any alternative static code analyzers that you use for detecting security issues?

    Read the article

  • Oracle syntax - should we have to choose between the old and the new?

    - by Martin Milan
    Hi, I work on a code base in the region of about 1'000'000 lines of source, in a team of around eight developers. Our code is basically an application using an Oracle database, but the code has evolved over time (we have plenty of source code from the mid nineties in there!). A dispute has arisen amongst the team over the syntax that we are using for querying the Oracle database. At the moment, the overwhelming majority of our queries use the "old" Oracle Syntax for joins, meaning we have code that looks like this... Example of Inner Join select customers.*, orders.date, orders.value from customers, orders where customers.custid = orders.custid Example of Outer Join select customers.custid, contacts.ContactName, contacts.ContactTelNo from customers, contacts where customers.custid = contacts.custid(+) As new developers have joined the team, we have noticed that some of them seem to prefer using SQL-92 queries, like this: Example of Inner Join select customers.*, orders.date, orders.value from customers inner join orders on (customers.custid = orders.custid) Example of Outer Join select customers.custid, contacts.ContactName, contacts.ContactTelNo from customers left join contacts on (customers.custid = contacts.custid) Group A say that everyone should be using the the "old" syntax - we have lots of code in this format, and we ought to value consistency. We don't have time to go all the way through the code now rewriting database queries, and it wouldn't pay us if we had. They also point out that "this is the way we've always done it, and we're comfortable with it..." Group B however say that they agree that we don't have the time to go back and change existing queries, we really ought to be adopting the "new" syntax on code that we write from here on in. They say that developers only really look at a single query at a time, and that so long as developers know both syntax there is nothing to be gained from rigidly sticking to the old syntax, which might be deprecated at some point in the future. Without declaring with which group my loyalties lie, I am interested in hearing the opinions of impartial observers - so let the games commence! Martin. Ps. I've made this a community wiki so as not to be seen as just blatantly chasing after question points...

    Read the article

  • Converting kernel image from ELF to PE

    - by Frank Miller
    I am using Msys to build a home brew kernel that I wrote under Linux. Linux used ELF for its binary format and Msys uses PE. I have the source setup to allow it to be booted by Grub using the Multiboot spec. At the end of the build, I get some undefined symbols: init.o:init.S:(.text+0x14): undefined reference to `edata' main.o:main.c:(.text+0x121): undefined reference to `_alloca' main.o:main.c:(.text+0x126): undefined reference to `__main' ../../lib\libkern.a(mem.o):mem.c:(.text+0x242): undefined reference to `_end' ../../lib\libkern.a(mem.o):mem.c:(.text+0x323): undefined reference to `_end' These appear to be ELF oriented symbols. If anyone can advise me on how these should be dealt with in the PE world, e.g. if there are equivalents, it would help me out a lot!

    Read the article

  • Running an executable on network share with CustomAction with wix?

    - by martin
    Hello, i have created a msi-package which compresses some xml-files to a zip-file during installation. I have created a CustomAction for this purposes: <CustomAction Id="CompressMy" BinaryKey="zipEXE" ExeCommand="a -tzip &quot;[TEMPLATE_DIR]my.zip&quot; &quot;[TempSourceFolder]data.xml&quot;" Return="check" HideTarget="no" Impersonate="no" Execute="deferred" /> The installation works fine, if i try to install to a local drive, but recently a customer wanted to install [TEMPLATE_DIR] to a network drive on Windows Vista. The CustomAction fails, because of the elevated install-user hasn't mapped the network drive, even if the installer-calling user has mapped the drive. This happens also, if I try to install to an unc-path. I use 7zip for compressing. I have added it to my msi-package. I have tried to set Impersonate="yes", but then the Installations fails, if my TEMPLATE_DIR is f.e. the ProgramData-dir. Do you have any idea what i can do? I thinked about checking if TEMPLATE_DIR is a network path, but I didn't know how i can check this. Or do you have any other Ideas how I can provide a local and a network installation while using this custom action. Would be great if there are any advices, greetings, Martin

    Read the article

  • activemessaging with stomp and activemq.prefetchSize=1

    - by Clint Miller
    I have a situation where I have a single activemq broker with 2 queues, Q1 and Q2. I have two ruby-based consumers using activemessaging. Let's call them C1 and C2. Both consumers subscribe to each queue. I'm setting activemq.prefetchSize=1 when subscribing to each queue. I'm also setting ack=client. Consider the following sequence of events: 1) A message that triggers a long-running job is published to queue Q1. Call this M1. 2) M1 is dispatched to consumer C1, kicking off a long operation. 3) Two messages that trigger short jobs are published to queue Q2. Call these M2 and M3. 4) M2 is dispatched to C2 which quickly runs the short job. 5) M3 is dispatched to C1, even though C1 is still running M1. It's able to dispatch to C1 because prefetchSize=1 is set on the queue subscription, not on the connection. So the fact that a Q1 message has already been dispatched doesn't stop one Q2 message from being dispatched. Since activemessaging consumers are single-threaded, the net result is that M3 sits and waits on C1 for a long time until C1 finishes processing M1. So, M3 is not processed for a long time, despite the fact that consumer C2 is sitting idle (since it quickly finishes with message M2). Essentially, whenever a long Q1 job is run and then a whole bunch of short Q2 jobs are created, exactly one of the short Q2 jobs gets stuck on a consumer waiting for the long Q1 job to finish. Is there a way to set prefetchSize at the connection level rather than at the subscription level? I really don't want any messages dispatched to C1 while it is processing M1. The other alternative is that I could create a consumer dedicated to processing Q1 and then have other consumers dedicated to processing Q2. But, I'd rather not do that since Q1 messages are infrequent--Q1's dedicated consumers would sit idle most of the day tying up memory.

    Read the article

  • using php and java script in a form

    - by Gal Miller
    I am a little bit lost. What I want to achieve is: my own custom button change onMouseOver etc' keep it's size post the information to a php server side code What I'm missing is: The post - I couldn't figure out how to combine js & php The Button size - my code sets a size for the original button but after the rollover it changes The code: <html> <head> </head> <body> <script> function form_on_click(frm) { document.buttonMore.src='bottom_more_click.JPG'; frm.submit(); } </script> <div style="position: absolute; left: 120px; top: 90px; background-image: url(myBackgroundPicture.jpg); background-repeat:no-repeat; width: 800px; height: 280px; padding: 15px;"> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="whatever" size= "55" height="100" lang="en" dir="ltr" style="margin-top: 188px; margin-left: 95px; height: 20px; background-color: transparent; border:none; color: #FFFFFF; font-family: Verdana; font-weight: none; font-size: 18px;"> <a onmouseover="document.buttonMore.src='bottom_more_hover.JPG'" onmouseout="document.buttonMore.src='bottom_more_reg.JPG'" onmousedown= "form_on_click(this.form) this.form.submit()" onmouseup="document.buttonMore.src='bottom_more_hover.JPG'"> <img src="bottom_more_reg.jpg" name="buttonMore" height="30" width="173" border="0" alt="MORE!" style="margin-bottom:-10px; margin-left: 15px; height: 30px; width: 100px;"> </a> </form> </div> </body>

    Read the article

  • Android ViewFlipper is out of control

    - by Doug Miller
    I have an app that uses a ViewFlipper to display some text and images. I have the flipper's flipinterval set to 10 seconds, but also want to allow the user to click a button that will advance the flipper. The code blow works great on 2.2, the view is changed every 10 seconds and if I click flip_button the view is changed and the auto flip steps back in 10 seconds later. The 1.5 and 1.6 versions will remember the manual advance and it will happen every time in the rotation. What am I missing? private void initFlipButton(){ final ImageView flip_button = (ImageView) findViewById(R.id.flip_button); info_button.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { flipper.stopFlipping(); flipper.showNext(); flipper.startFlipping(); } }); } private void initFlipper(){ flipper = (ViewFlipper) findViewById(R.id.flip_dog); flipper.setFlipInterval(10000); flipper.setInAnimation(inFromRightAnimation()); flipper.setOutAnimation(outToLeftAnimation()); flipper.startFlipping(); }

    Read the article

  • reading non-english html pages with c#

    - by Gal Miller
    I am trying to find a string in Hebrew in a website. The reading code is attached. Afterward I try to read the file using streamReader but I can't match strings in other languages. what am I suppose to do? // used on each read operation byte[] buf = new byte[8192]; // prepare the web page we will be asking for HttpWebRequest request = (HttpWebRequest) WebRequest.Create("http://www.webPage.co.il"); // execute the request HttpWebResponse response = (HttpWebResponse) request.GetResponse(); // we will read data via the response stream Stream resStream = response.GetResponseStream(); string tempString = null; int count = 0; FileStream fileDump = new FileStream(@"c:\dump.txt", FileMode.Create); do { count = resStream.Read(buf, 0, buf.Length); fileDump.Write(buf, 0, buf.Length); } while (count > 0); // any more data to read? fileDump.Close();

    Read the article

  • Do you use Scimore SQL database ?

    - by Darian Miller
    There's a database engine that looks amazing for a free tool and that is Scimore. Have you had much experience with it? If so, how does it rate..particularly against Firebird? How resilient/self reliant is it? (Meaning how much downtime/maintenance is expected?) The scale out capabilities also look very interesting. I just downloaded it and have been playing around and so far it looks good. I had been looking for an easy to deploy single-user type embedded database (which Scimore has an option) and was toying with MS SQL Compact Edition and SQLite and remembered this database from a trial a few years ago. (Windows platform) I was about ready to settle in on SQLite but started thinking about other projects which are multi-user and wanted to stick with a single solution...which is why I started looking at Firebird as well.

    Read the article

  • How to access elements in a complex list?

    - by Martin
    Hi, it's me and the lists again. I have a nice list, which looks like this: tmp = NULL t = NULL tmp$resultitem$count = "1057230" tmp$resultitem$status = "Ok" tmp$resultitem$menu = "PubMed" tmp$resultitem$dbname = "pubmed" t$resultitem$count = "305215" t$resultitem$status = "Ok" t$resultitem$menu = "PMC" t$resultitem$dbname = "pmc" tmp = c(tmp, t) t = NULL t$resultitem$count = "1" t$resultitem$status = "Ok" t$resultitem$menu = "Journals" t$resultitem$dbname = "journals" tmp = c(tmp, t) Which produces: str(tmp) List of 3 $ resultitem:List of 4 ..$ count : chr "1057230" ..$ status: chr "Ok" ..$ menu : chr "PubMed" ..$ dbname: chr "pubmed" $ resultitem:List of 4 ..$ count : chr "305215" ..$ status: chr "Ok" ..$ menu : chr "PMC" ..$ dbname: chr "pmc" $ resultitem:List of 4 ..$ count : chr "1" ..$ status: chr "Ok" ..$ menu : chr "Journals" ..$ dbname: chr "journals" Now I want to search through the elements of each "resultitem". I want to know the "dbname" for every database, that has less then 10 "count" (example). In this case it is very easy, as this list only has 3 elements, but the real list is a little bit longer. This could be simply done with a for loop. But is there a way to do this with some other function of R (like rapply)? My problem with those apply functions is, that they only look at one element. If I do a grep to get all "dbname" elements, I can not get the count of each element. rapply(tmp, function(x) paste("Content: ", x))[grep("dbname", names(rapply(tmp, c)))] Does someone has a better idea than a for loop? Thanx, Martin

    Read the article

  • Regex for recursive "wiki-style" lists

    - by Syd Miller
    I'm trying to create a Regular Expression to match "wiki style" lists as in (using preg_replace_callback() ): * List Item 1 * List Item 2 *# List Item 2.1 *# List Item 2.2 * List Item 3 Asterisks denote Unordered Lists while Number-Signs denote Ordered Lists. I'm trying to get this so it can match infinite depth and so that * and # can be mixed. I tried the following expression (and variations of it): /\s([*#]{1,}) ([\S ]+)\s/si But it doesn't seem to want to work. What am I doing wrong? Or is there a better way of accomplishing this?

    Read the article

  • start-stop-daemon quoted arguments misinterpreted

    - by Martin Westin
    Hi, I have been trying to make an init script using start-stop-daemon. I am stuck on the arguments to the daemon. I want to keep these in a variable at the top of the script but I can't get the quotations to filter down correctly. I'll use ls here so we don't have to look at binaries and arguments that most people wont know or care about. The end result I am looking for is for start-stop... to run ls -la "/folder with space/" DAEMON=/usr/bin/ls DAEMON_OPTS='-la "/folder with space/"' start-stop-daemon --start --make-pidfile --pidfile $PID --exec $DAEMON -- $DAEMON_OPTS Double escaping the options and trying innumerable variations of quotations do not help... Then they end up at the daemon they are always messed up. Enclosing $DAEMON_OPTS in quotes changes things... then they are seen as one since quote... never the right number though :) Echoing the command-line (start-stop...) prints exactly the right stuff to screen. But the daemon (the real one, not ls) complains about the wrong number of arguments. How do I specify a variable so that quotes inside it are brought along to the daemon correctly? Thanks, Martin

    Read the article

  • Suggestions for VS+Resharper keyboard shortcuts on a Mac

    - by John Miller
    I just upgraded to a Macbook Pro as my development machine but still primarily develop .Net applications with Visual Studio and Resharper (via VMWare Fusion). By far, the biggest obstacle I'm running into is getting used to the keyboard layout change (ex. not being able to do ALT-Insert). Do any of you Windows-on-Mac veterans have any suggestions on how to ease the pain of transitioning (without moving to an external keyboard)? Are you changing mappings via VMWare's keyboard preferences? Or are you using something like AutoHotkey? Any other windows development tips for a Mac newb?

    Read the article

  • The conceptual process of populating related tables in a database (MySql) from a CSV file

    - by user322772
    I'm new to relational databases and all the material I've read covered primary and foreign keys, normal forms, and joins but left out to populate the database once it's created. How do you import a CSV file so the fields match their related table? Say you were tying to build a beer database and had a CSV file with each line as a record. Header: brewer, beer_name, country, city, state, beer_category, beer_type, alcohol_content Record 1: Anheuser-Busch, Budweiser, United States, St. Louis, Mo, Pale lager, Regular, 5.0% Record 2: Anheuser-Busch, Bud Light, United States, St. Louis, Mo, Pale lager Light, 4.2% Record 3: Miller Brewing Company, Miller Lite, United States, Milwaukee, WI, Pale lager, Light, 4.2% You can create a "Brewer" table and a "Beer" table. When importing how does you connect the primary keys between the tables?

    Read the article

  • Creating a RESTful API - HELP!

    - by Martin Cox
    Hi Chaps Over the last few weeks I've been learning about iOS development, which has naturally led me into the world of APIs. Now, searching around on the Internet, I've come to the conclusion that using the REST architecture is very much recommended - due to it's supposed simplicity and ease of implementation. However, I'm really struggling with the implementation side of REST. I understand the concept; using HTTP methods as verbs to describe the action of a request and responding with suitable response codes, and so on. It's just, I don't understand how to code it. I don't get how I map a URI to an object. I understand that a GET request for domain.com/api/user/address?user_id=999 would return the address of user 999 - but I don't understand where or how that mapping from /user/address to some method that queries a database has taken place. Is this all coded in one php script? Would I just have a method that grabs the URI like so: $array = explode("/", ltrim(rtrim($_SERVER['REQUEST_URI'], "/"), "/")) And then cycle through that array, first I would have a request for a "user", so the PHP script would direct my request to the user object and then invoke the address method. Is that what actually happens? I've probably not explained my thought process very well there. The main thing I'm not getting is how that URI /user/address?id=999 somehow is broken down and executed - does it actually resolve to code? class user(id) { address() { //get user address } } I doubt I'm making sense now, so I'll call it a day trying to explain further. I hope someone out there can understand what I'm trying to say! Thanks Chaps, look forward to your responses. Martin p.s - I'm not a developer yet, I'm learning :)

    Read the article

  • Problem declaring and calling internal metthods

    - by Martin
    How do I declare and use small helper functions inside my normal methods ? In on of my objective-c methods I need a function to find an item within a string -(void) Onlookjson:(id) sender{ NSString * res = getKeyValue(res, @"Birth"); } I came up with a normal C type declaration for helper function getKeyvalue like this NSString * getKeyvalue(NSString * s, NSString key){ NSString *trm = [[s substringFromIndex:2] substringToIndex:[s length]-3]; NSArray *list = [trm componentsSeparatedByString:@";"]; .... NSString res; res = [list objectAtIndex:1]; ... return res; } Input data string: { Birth = ".."; Death = "..."; ... } Anyway I get an exception "unrecognized selector sent to instance" for any of the two first lines in the helper function How do I declare helper functions that are just to be used internally and how to call them safely ? regards Martin

    Read the article

  • The PROMOTE TRANSACTION request failed because there is no local transaction active.

    - by Mark J Miller
    Under what circumstances would I see the above message? I have a single call to SQL Server which is wrapped in a call to TransactionScope. In our development and QA environments MSDTC is turned off and the call succeeds fine. However, in our production environment with MSDTC turned on we are failing with this call. Is there something that would cause this when I am sure we are not looking at a distributed transaction call at all?

    Read the article

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