Search Results

Search found 560 results on 23 pages for 'roger nelson'.

Page 15/23 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Code hot swapping in Erlang

    - by Roger Alsing
    I recently saw a video about Erlang on InfoQ, In that video one of the creators presented how to replace the behavior of a message loop. He was simply sending a message containing a lambda of the new version of the message loop code, which then was invoked instead of calling the old loop again. Is that code hot swapping in Erlang reffers to? Or is that some other more native feature?

    Read the article

  • Command line switches parsed out of executable's path

    - by Roger Pate
    Why do Windows programs parse command-line switches out of their executable's path? (The latter being what is commonly known as argv[0].) For example, xcopy: C:\Temp\foo>c:/windows/system32/xcopy.exe /f /r /i /d /y * ..\bar\ Invalid number of parameters C:\Temp\foo>c:\windows\system32\xcopy.exe /f /r /i /d /y * ..\bar\ C:\Temp\foo\blah -> C:\Temp\bar\blah 1 File(s) copied What behavior should I follow in my own programs? Are there many users that expect to type command-line switches without a space (e.g. program/? instead of program /?), and should I try to support this, or should I just report an error and exit immediately? What other caveats do I need to be aware of? (In addition to Anon.'s comment below that "debug/program" runs debug.exe from PATH even if "debug\program.exe" exists.)

    Read the article

  • Python: Convert a string to an integer

    - by Adam Nelson
    Does anybody have a quickie for converting an unsafe string to an int? The string typically comes back as: '234\r\n' or something like that. In this case I want 234. If '-1\r\n', I want -1. I never want the method to fail but I don't want to go so far as try, except, pass just to hide errors either (in case something extreme happens).

    Read the article

  • Synchronizing thread communication?

    - by Roger Alsing
    Just for the heck of it I'm trying to emulate how JRuby generators work using threads in C#. Also, I'm fully aware that C# haas built in support for yield return, I'm just toying around a bit. I guess it's some sort of poor mans coroutines by keeping multiple callstacks alive using threads. (even though none of the callstacks should execute at the same time) The idea is like this: The consumer thread requests a value The worker thread provides a value and yields back to the consumer thread Repeat untill worker thread is done So, what would be the correct way of doing the following? //example class Program { static void Main(string[] args) { ThreadedEnumerator<string> enumerator = new ThreadedEnumerator<string>(); enumerator.Init(() => { for (int i = 1; i < 100; i++) { enumerator.Yield(i.ToString()); } }); foreach (var item in enumerator) { Console.WriteLine(item); }; Console.ReadLine(); } } //naive threaded enumerator public class ThreadedEnumerator<T> : IEnumerator<T>, IEnumerable<T> { private Thread enumeratorThread; private T current; private bool hasMore = true; private bool isStarted = false; AutoResetEvent enumeratorEvent = new AutoResetEvent(false); AutoResetEvent consumerEvent = new AutoResetEvent(false); public void Yield(T item) { //wait for consumer to request a value consumerEvent.WaitOne(); //assign the value current = item; //signal that we have yielded the requested enumeratorEvent.Set(); } public void Init(Action userAction) { Action WrappedAction = () => { userAction(); consumerEvent.WaitOne(); enumeratorEvent.Set(); hasMore = false; }; ThreadStart ts = new ThreadStart(WrappedAction); enumeratorThread = new Thread(ts); enumeratorThread.IsBackground = true; isStarted = false; } public T Current { get { return current; } } public void Dispose() { enumeratorThread.Abort(); } object System.Collections.IEnumerator.Current { get { return Current; } } public bool MoveNext() { if (!isStarted) { isStarted = true; enumeratorThread.Start(); } //signal that we are ready to receive a value consumerEvent.Set(); //wait for the enumerator to yield enumeratorEvent.WaitOne(); return hasMore; } public void Reset() { throw new NotImplementedException(); } public IEnumerator<T> GetEnumerator() { return this; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return this; } } Ideas?

    Read the article

  • Including phonon environment setup in Qt Creator

    - by Roger B
    On Windows XP, I ran "configure", and Qt says that I'm configured to use phonon, but I'm not sure how to set up my environment correctly in Qt Creator. According to the Qt documentation, I need to call: Set DXSDK_DIR=C:\Program Files\Microsoft DirectX SDK (February 2007) %DXSDK_DIR%\utilities\bin\dx_setenv.cmd C:\program files\Microsoft Platform SDK\setenv.cmd How do I do this in the Qt Creator IDE? Thanks!

    Read the article

  • How to create a list of data clickable? asp.net

    - by Roger Filipe
    Hello, I am learning asp.net but I'm finding some problems. My doubt is how to make a list of titles of news contained in a database. And in this list, each of the titles when clicked is redirected to a page where you will be able to view the news in full (Title, Body, Author ..). What I got: - A database containing a table with the news, every news is associated with an identification code (ex: "ID"). - A page where you will make the listing. (Ex: site / listofnews.aspx) - I have a page that uses the method "querystring" to know what is the primarykey the news. (Ex: site/shownews.aspx?ID=12345, where "12345" is the primarykey of the news. Once it knows what is the primarykey of the news in the database, it loads each of the fields of the page (news.aspx) with the news, this part is working ok. - The data is retrieve using the Linq, so I receive a List of "News", the class "News" as ID, Title, Body, Author.. My doubt is how to make the listing clickable. In php I used this method (make a list of html links, in each link the href field is changed so that the tag "id" coincides with the news): //database used is oracle, $stmt is the query, you don´t need to understand how it works. oci_define_by_name($stmt, "ID", $id); oci_define_by_name($stmt, "TITLE", $title); if (!oci_execute($stmt, OCI_DEFAULT)) { $err = oci_error($stmt); trigger_error('Query failed: ' . $err['message'], E_USER_ERROR); } echo '<br />'; while (oci_fetch($stmt)) {<------While there is data from the database , create links $link = '<a href="site/shownews.php?ID='.$id.'" >'.$title.'</a>';<----the shownews.php?ID= $id, creates the link according with the ID echo $link<---Prints the link echo '<br />'; } How do i make the same with asp.net?

    Read the article

  • Naming multi-instance performance counters in .NET

    - by Roger Lipscombe
    Most multiple instance performance counters in Windows seem to automatically(?) have a #n on the end if there's more than one instance with the same name. For example: if, in Perfmon, you look under the Process category, you'll see: ... dwm explorer explorer#1 ... I have two explorer.exe processes, so the second counter has #1 appended to its name. When I attempt to do this in a .NET application: I can create the category, and register the instance (using the PerformanceCounterCategory.Create that takes a CounterCreationDataCollection). I can open the counter for write and write to it. When I open the counter a second time, it opens the same counter. This means that I have two applications fighting over the counters. The documentation for PerformanceCounter.InstanceName states that # is not allowed in the name. So: how do I have multiple-instance performance counters that are actually multiple instance? And where the second (and subsequent) instances get #n appended to the name? That is: I know that I can put the process ID (e.g.) on the instance name. This works, but has the unfortunate side effect that restarting the process results in a new PID, and Perfmon continues monitoring the old counter.

    Read the article

  • Can I add metadata to git commits? Or can I hide some tags in gitk

    - by Chris Nelson
    I want to associate custom metadata with a git commit. Specifically to record a review ID from a code review but it could be anything. Tags seem a natural way to do that but I expect to have a review for every commit and I don't want to clutter gitk with tons of tags. Is there some other mechanism to add custom metadata? Can I make certain tags invisible? If I could tell gitk not to display tags matching some pattern or RE, that would likely work but I don't see a way to do that.

    Read the article

  • Android ADB has moved and Eclipse is looking in the old place

    - by Peter Nelson
    I did an SDK update last night and it moved adb.exe. In its place it left a file called "adb_has_moved.txt" saying The adb tool has moved to platform-tools/ If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and install "Android SDK Platform-tools" Please also update your PATH environment variable to include the platform-tools/ directory, so you can execute adb from any location. So I did all that, including the PATH and now I can start adb.exe from any DOS prompt. But I still can't start it from Eclipse (Galileo 3.52). When I try it says Location of the Android SDK has not been set up in the preferences ... which is not true. The SDK IS set up in Preferences. The real problem is at the top of the Preferences window where it says "Could not find C:\SDK\android-sdk-windows\ tools \adb.exe!" ...No kidding - the update moved it to C:\SDK\android-sdk-windows\ platform-tools. Because it's specifying a specific (wrong) path Eclipse is bypassing the PATH variable. So how do I get Eclipse to look in the right place?

    Read the article

  • Ultra-Portable Laptop or Tablet PC for Development and Sketching

    - by Nelson LaQuet
    I am a software developer that primarily writes in PHP, [X]HTML, CSS, Javascript, C# and C++. I use Eclipse for web development, Visual Studio 2008 for C++ and C# work, TortoiseSVN, Subversion server for local repositories, SQL Server Express, Apache and MYSQL. I also use Office 2007 for word processing and spreadsheets and use Vista Ultimate 64 as my primary operating system. The only other things I do on my laptop are watch movies, surf the internet and listen to music. I currently have a Acer Aspire 5100 (1.4 GHz AMD Turion X2, 2 GB of RAM and a 15.4" screen). This thing does not cut it in performance or portability, and in addition, my DVD drive failed. And before anybody posts about vista: I have had XP Professional 32 on it for the last two years, and recently upgraded to Vista 64. It is actually faster (with areo disabled) then XP; so it is not the OS that is causing the laptop to be slow. I usually sketch a lot, for explaining things, developing user interfaces and software architecture. Because of my requirements, I was thinking about a Lenovo X61 Tablet PC. It outperforms my current laptop, is significantly more portable, and... is a tablet. My question is: do any other software developers use this (or other tablets) for programming? Does it help to be able to sketch on the computer itself? And is it capable of being a good development machine? Will it handle the above software listed? If not, what is the best ultra-portable laptop that is good for programming? Or are ultra-portable laptops even good for programming? I could manage with my 15.4" screen, but am spoiled by my two 19" at my home desktop and my job's workstation.

    Read the article

  • geting the median of 3 values using sheme car & cdr

    - by kristian Roger
    Hi still stuck with the ugly scheme the problem this time is to get the median of three values (easy) I did all these : (define (med x y z) (car(cdr(x y z))) and it was accepted but when testing it (med 3 4 5) I will get this error Error: attempt to call a non-procedure (2 3 4) and when entering letters inetead of number i got (md x y z) Error: undefined varia y (package user) using somthin else than x y z i got (md d l m) Error: undefined variable d (package user) so what is wronge ?!

    Read the article

  • IQueryable and lazy loading

    - by Nelson
    I'm having a hard time determining the best way to handle this... With Entity Framework (and L2S), LINQ queries return IQueryable. I have read various opinions on whether the DAL/BLL should return IQueryable, IEnumerable or IList. Assuming we go with IList, then the query is run immediately and that control is not passed on to the next layer. This makes it easier to unit test, etc. You lose the ability to refine the query at higher levels, but you could simply create another method that allows you to refine the query and still return IList. And there are many more pros/cons. So far so good. Now comes Entity Framework and lazy loading. I am using POCO objects with proxies in .NET 4/VS 2010. In the presentation layer I do: foreach (Order order in bll.GetOrders()) { foreach (OrderLine orderLine in order.OrderLines) { // Do something } } In this case, GetOrders() returns IList so it executes immediately before returning to the PL. But in the next foreach, you have lazy loading which executes multiple SQL queries as it gets all the OrderLines. So basically, the PL is running SQL queries "on demand" in the wrong layer. Is there any sensible way to avoid this? I could turn lazy loading off, but then what's the point of having this "feature" that everyone was complaining EF1 didn't have? And I'll admit it is very useful in many scenarios. So I see several options: Somehow remove all associations in the entities and add methods to return them. This goes against the default EF behavior/code generation and makes it harder to do some composite (multiple entity) LINQ queries. It seems like a step backwards. I vote no. If we have lazy loading anyway which makes it hard to unit test, then go all the way and return IQueryable. You'll have more control farther up the layers. I still don't think this is a good option because IQueryable ties you to L2S, L2E, or your own full implementation of IQueryable. Lazy loading may run queries "on demand", but doesn't tie you to any specific interface. I vote no. Turn off lazy loading. You'll have to handle your associations manually. This could be with eager loading's .Include(). I vote yes in some specific cases. Keep IList and lazy loading. I vote yes in many cases, only due to the troubles with the others. Any other options or suggestions? I haven't found an option that really convinces me.

    Read the article

  • Query Only Specified Number Of Items From Parent/Child Categories

    - by RogeR
    I'm having trouble figureing out how to query every item in a certain category and only list the newest 10 items by date. Here is my table layout: download_categories category_id (int) primary key title (var_char) parent_id (int) downloads id (int) primary key title (var_char) category_id (int) date (date) I need to query every file in a main category that lets say has 100 items and 5 child categories and only spit out the last 10 added. I have functions right now that just add up all the files so I can get a count by category, but I can't seem to modify the code to only display a certain amount of items based on the date.

    Read the article

  • How do I tell ReSharper that an attribute means that a method is used?

    - by Roger Lipscombe
    I'm playing with SpecFlow, and ReSharper thinks that my step definitions are unused (I guess because they're used via reflection): [Binding] public class StepDefinitions { // ... [When(@"I press add")] public void WhenIPressAdd() // R# thinks this is unused { _calculator.PressAdd(); } // ... } How can I tell ReSharper that methods with [Given], [When], [Then] attributes (etc.) are actually used? I don't want to use // ReSharper disable UnusedMember.Global comments.

    Read the article

  • Send an onclick to a dropdown list

    - by P Nelson
    Is it possible to show the list of items in a dropdown list when the user presses the up or down arrow keys, when focus is on that dropdown control? I think this would involve sending an onclick to the dropdown list using onkeydown for Keycode 38(arrow up) & 40(arrow down)? But I cannot figure out how to do this.

    Read the article

  • Debugging F# code and functional style

    - by Roger Alsing
    I'm new to funcctional programming and have some questions regarding coding style and debugging. I'm under the impression that one should avoid storing results from funcction calls in a temp variable and then return that variable e.g. let someFunc foo = let result = match foo with | x -> ... | y -> ... result And instead do it like this (I might be way off?): let someFunc foo = match foo with | x -> ... | y -> ... Which works fine from a functionallity perspective, but it makes it way harder to debug. I have no way to examine the result if the right hand side of - does some funky stuff. So how should I deal with this kind of scenarios?

    Read the article

  • Attribute lost with yield

    - by Nelson
    Here's an interesting one... There is some code that I'm trying to convert from IList to IEnumerable: [Something(123)] public IEnumerable<Foo> GetAllFoos() { SetupSomething(); DataReader dr = RunSomething(); while (dr.Read()) { yield return Factory.Create(dr); } } The problem is, SetupSomething() comes from the base class and uses: Attribute.GetCustomAttribute(new StackTrace().GetFrame(1).GetMethod(), typeof(Something)) Yield ends up creating MoveNext(), MoveNext() calls SetupSomething(), and MoveNext() does not have the [Something(123)] attribute. I can't change the base class, so it appears I am forced to stay with IList or implement IEnumerable manually (and add the attribute to MoveNext()). Is there any other way to make yield work in this scenario?

    Read the article

  • How are you using C++0x today? [closed]

    - by Roger Pate
    This is a question in two parts, the first is the most important and concerns now: Are you following the design and evolution of C++0x? What blogs, newsgroups, committee papers, and other resources do you follow? Even where you're not using any new features, how have they affected your current choices? What new features are you using now, either in production or otherwise? The second part is a follow-up, concerning the new standard once it is final: Do you expect to use it immediately? What are you doing to prepare for C++0x, other than as listed for the previous questions? Obviously, compiler support must be there, but there's still co-workers, ancillary tools, and other factors to consider. What will most affect your adoption? Edit: The original really was too argumentative; however, I'm still interested in the underlying question, so I've tried to clean it up and hopefully make it acceptable. This seems a much better avenue than duplicating—even though some answers responded to the argumentative tone, they still apply to the extent that they addressed the questions, and all answers are community property to be cleaned up as appropriate, too.

    Read the article

  • How to I pass parameters to Ruby/Python scripts from inside PHP?

    - by Roger
    Hi, everybody. I need to turn HTML into equivalent Markdown-structured text. From what I could discover, I have only two good choices: Python: Aaron Swartz's html2text.py Ruby: Singpolyma's html2markdown.rb As I am programming in PHP, I need to pass the HTML code, call the Ruby/Python Script and receive the output back. I started creating a simple test just to know if my server was configured to run both languages. PHP code: echo exec('./hi.rb'); Ruby code: #!/usr/bin/ruby puts "Hello World!" It worked fine and I am ready to go to the next step. Unfortunately, all I know is that the function is Ruby works like this: HTML2Markdown.new('<h1>HTMLcode</h1>').to_s I don't know how to make PHP pass the string (with the HTML code) to Ruby nor how to make the ruby script receive the variable and pass it back to PHP (after have parsed it into Markdown). Believe it or not: I know less of Python. A folk made a similar question here ("how to call ruby script from php?") but with no practical information to my case. Any help would be a joy - thanks. Rogério Madureira. atipico.com.br

    Read the article

  • Run a script inside a content page. ASP.NET

    - by Roger Filipe
    Hello, I have a masterpage and content page. And I'm trying to run a script that needs to be executed on the page loading. As I am using a master page do not have access to the field My doubt is how to run the script within the content page? And where the script has to be? the head of the master page or inside the content page?

    Read the article

  • HTML divs can go outside browser window??

    - by Nelson
    I was playing around with ASP.NET Web Parts which has a "drop down" div. It's all the way to the right of the page. When I click to bring it up, it goes off the window. Usually anything off the viewable area will trigger the bottom scrollbars. How is this possible? See screenshot: http://i42.tinypic.com/4sejww.png

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >