Daily Archives

Articles indexed Friday April 9 2010

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

  • two's complement, why the name "two"

    - by lenatis
    i know unsigned,two's complement, ones' complement and sign magnitude, and the difference between these, but what i'm curious about is: why it's called two's(or ones') complement, so is there a more generalize N's complement? in which way did these genius deduce such a natural way to represent negative numbers?

    Read the article

  • jquery strange flickering on mouseover/out

    - by Jonah
    The HTML: <div id="timerList"> ... <li rel="project" class="open"> <a class="" style="" href=""><ins>&nbsp;</ins>Project C</a> </li> ... </div> The javascript/jquery: $('#timerList li[rel="project"]').mouseover(function(){ $('a:first',this).after('<span class="addNew"><a href="#">Add Timer</a></span>'); }).mouseout(function(){ $('.addNew',this).remove(); }); When I hover my mouse over an li element, a span.addNew element is created within THE PROBLEM: When I put my mouse ofer the span.addNew, it flickers on and off. Perhaps the mouseout event is firing, but I don't understand why it would or how to prevent it. Thanks!

    Read the article

  • Bash Shell; read command; using Cygwin on Windows 7

    - by user312397
    Okay so I am having this problem. I write up a script to be run in cygwin on Windows. I've tried a bunch of basic example scripts in case it was my scripts problem. So I tried this: #!/bin/bash echo -e "Enter your name and press [ENTER]: \c" read var_name echo "Your name is: $var_name" Then I will run it and I enter a name for var_name. I get this: $ ./project1.sh Enter your name and press [ENTER]: Jake ': not a valid identifierad: `var_name Your name is: So as far as I understand it I am having a problem with read. I am trying to work on a project for my class, but I can't seem to figure out why it won't read it. I followed the book with no triumph then resorted to these examples on the web that do not seem to work for me either. Does anyone have any idea if it is my setup or if I am missing something, thanks.

    Read the article

  • Is it possible to reset NSURLConnection after providing credentials?

    - by John
    I am calling a REST service that requires basic auth and I respond to the didReceiveAuthenticationChallenge delegate OK NSURLCredential *credential = [[NSURLCredential alloc] initWithUser:self.user password:self.password persistence:NSURLCredentialPersistenceForSession]; [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge]; [credential release]; The Credentials are valid for the Session but I would like for my App to be able to switch between servers and therefore need to "reset" the Session so it asks again for a challenge. I can of course try the option of not storing the credentials for the Session and supply them for each call but this does not seem like a good idea. Any ideas would be appreciated!

    Read the article

  • Working out global tab order algorithmically?

    - by Mrgreen
    We have a proprietry system where we can configure fields on indiviual forms. However these fields have a global tab order (we cannot specify for a specific form). We have a bunch of forms (35 in total) which share a lot of different fields. Each form has a specific tab/edit order that needs to be configured. Example: Form 1 has fields A,B,C,D in that order. Form 2 has fields E,F,G,A in that order. Form 3 has fields E,B,H,I in that order. The global tab orders would be E,F,G,A,B,C,D,H,I Notice how A needs to come before B yet after G. Is there any easy way to work this out using the tab order lists for each form? I need to merge this tab order information into a single global tab order list. I have over 200 fields in total and it is near impossible to do by hand.

    Read the article

  • Is there a library or other way to do 128-bit math operations?

    - by samoz
    I am writing a cryptography application and need to work with 128 bit numbers. In addition to standard add, subtract, multiply, divide, and comparisons, I also need a power and modulo function as well. Does anyone know of a library or other implementation that can do this? If not 128-bit, is there a 64-bit option available?

    Read the article

  • Count string value?

    - by Adam
    Hey, Im a newbie in cocoa and I have a string and I am trying to count how long it is. I have been searching through Apples docs but I can't find anything. NSString *word = @"word"; How would I figure out how many characters is in a string? Thanks

    Read the article

  • MS SQL Server 15MM rows, simple COUNT query. 15+ seconds?

    - by john
    We took over a website from another company after a client decided to switch. We have a table that grows by about 25k records a day, and is currently at 15MM records. The table looks something like: id (PK, int, not null) member_id (int, not null) another_id (int, not null) date (datetime, not null) SELECT COUNT(id) FROM tbl can take up to 15 seconds. A simple inner join on 'another_id' takes over 30 seconds. I can't imagine why this is taking so long. Any advice? SQL Server 2005 Express

    Read the article

  • Compiling scipy on Windows 32-bit: linker error with libf77blas.a

    - by Sridhar Ratnakumar
    Has anyone tried compiling SciPy 0.7.1 on Windows using numpy-1.3.0 that was built with the pre-built ATLAS libraries (atlas3.6.0_WinNT_P4SSE2.zip) linked in the installation document. I get the following linker error, and have no ideas as to how to fix this issue. $ python setup.py config --compiler=mingw32 build --compiler=mingw32 install --root=i [...] creating build\temp.win32-2.6\Release creating build\temp.win32-2.6\Release\scipy creating build\temp.win32-2.6\Release\scipy\integrate compile options: '-DNO_ATLAS_INFO=2 -I"C:\Documents and Settings\apy\Application Data\Python\Python26\site-packages\numpy\core\inc lude" -IC:\Python26\include -IC:\Python26\PC -c' gcc -mno-cygwin -O2 -Wall -Wstrict-prototypes -DNO_ATLAS_INFO=2 -I"C:\Documents and Settings\apy\Application Data\Python\Python26\ site-packages\numpy\core\include" -IC:\Python26\include -IC:\Python26\PC -c scipy\integrate\_odepackmo dule.c -o build\temp.win32-2.6\Release\scipy\integrate\_odepackmodule.o C:\MinGW\bin\g77.exe -g -Wall -mno-cygwin -g -Wall -mno-cygwin -shared build\temp.win32-2.6\Release\scipy\integrate\_odepackmodule .o -LC:\atlas3.6.0_WinNT_P4SSE2 -LC:\MinGW\lib -LC:\MinGW\lib\gcc\mingw32\3.4.5 -LC:\Python26\libs -LC:\Act ivePython32Python26\PCbuild -Lbuild\temp.win32-2.6 -lodepack -llinpack_lite -lmach -latlas -lcblas -lf77blas -llapack -lpython26 - lg2c -o build\lib.win32-2.6\scipy\integrate\_odepack.pyd C:\atlas3.6.0_WinNT_P4SSE2/libf77blas.a(ATL_F77wrap_daxpy.o):ATL_F77wrap_axpy.c:(.text+0x3c): undefined reference to `ATL _daxpy' C:\atlas3.6.0_WinNT_P4SSE2/libf77blas.a(ATL_F77wrap_dscal.o):ATL_F77wrap_scal.c:(.text+0x26): undefined reference to `ATL _dscal' C:\atlas3.6.0_WinNT_P4SSE2/libf77blas.a(ATL_F77wrap_dcopy.o):ATL_F77wrap_copy.c:(.text+0x3d): undefined reference to `ATL _dcopy' C:\atlas3.6.0_WinNT_P4SSE2/libf77blas.a(ATL_F77wrap_idamax.o):ATL_F77wrap_amax.c:(.text+0x1e): undefined reference to `AT L_idamax' C:\atlas3.6.0_WinNT_P4SSE2/libf77blas.a(ATL_F77wrap_ddot.o):ATL_F77wrap_dot.c:(.text+0x36): undefined reference to `ATL_d dot' collect2: ld returned 1 exit status error: Command "C:\MinGW\bin\g77.exe -g -Wall -mno-cygwin -g -Wall -mno-cygwin -shared build\temp.win32-2.6\Release\scipy\integrat e\_odepackmodule.o -LC:\atlas3.6.0_WinNT_P4SSE2 -LC:\MinGW\lib -LC:\MinGW\lib\gcc\mingw32\3.4.5 -LC:\Python 26\libs -LC:\Python26\PCbuild -Lbuild\temp.win32-2.6 -lodepack -llinpack_lite -lmach -latlas -lcblas -lf77blas -llap ack -lpython26 -lg2c -o build\lib.win32-2.6\scipy\integrate\_odepack.pyd" failed with exit status 1 Does anyone know what could have gone wrong here? Looking for ATL_daxpy, for example, in libf77blas.a resulted in: $ strings libf77blas.a | grep -i daxpy _daxpy_ _atl_f77wrap_daxpy_ ATL_F77wrap_daxpy.o/ daxpy.o/ 1081731936 1003 513 100755 420 ` daxpy.f _daxpy_ _atl_f77wrap_daxpy_ _atl_f77wrap_daxpy_ _ATL_daxpy There is _ATL_daxpy, but no ATL_daxpy.

    Read the article

  • You guys are harsh.

    - by Ratman21
    Tough crowd around here it seems.   Let’s get down to the issues. First: spelling…I do not understand how there can be miss-spelled words, as I use spell check (MS Word) and cut and paste my post in to the blog. As to being defensive or complaining. Hmm as I said this is a vent for my frustrations as well letting others know they are not a lone, in Job less land. Warning, warning, warning, complaint coming. I have been out of work for 18 months now. I have gone in person to sites, emailed and phoned places for work (I am thinking of getting a sign with my resume and walking up and down the main drag until, I get a job). So forgive me if I seem a little frustrated in my post. Now one thing some one pointed out really bugs me. The person called me a Holy Roller and made a comment that this is keeping me from a job.  What! I am born again Christian and not a Holy Roller. What I have put on my web sites about my faith is staying!   Oh my web site is http://beingscottnewman.webs.com/ and my resume is on the home page (and has been since I started the site).

    Read the article

  • Windows XP SP3 - Upgrade - No longer part of workgroup

    - by dbasnett
    When I woke up this morning I decided to have a really lousy day. For a long time I have been telling auto updater to remind me later about installing SP3. But not this morning... It looked good, until I tried to access my NAS. Can't connect, can't see it, nothing. The other computers can see it, so it is my PC. Oh, and they can no longer see me. It turns out the only thing I can see is the printer. So if you know what wonderful thing Microsoft decided to change during the upgrade (oxymoron in my opinion), I would be grateful. Short of turning on all of the services I have tried so many things, and rebooted so often, that I am just sick of it.

    Read the article

  • Stopping network activity indicator.

    - by iSharreth
    I used the below code to load a webpage. Everything works fine, but I want to stop the network activity indicator after completing loading the webpage. How can we know that the webpage is loaded completely. Anyone please help. UIApplication* app = [UIApplication sharedApplication]; app.networkActivityIndicatorVisible = YES; // to stop it, set this to NO NSURL *url = [NSURL URLWithString:@"http://www.google.com"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; [webView loadRequest:request];

    Read the article

  • C# Lack of Static Inheritance - What Should I Do?

    - by yellowblood
    Alright, so as you probably know, static inheritance is impossible in C#. I understand that, however I'm stuck with the development of my program. I will try to make it as simple as possible. Lets say our code needs to manage objects that are presenting aircrafts in some airport. The requirements are as follows: There are members and methods that are shared for all aircrafts There are many types of aircrafts, each type may have its own extra methods and members. There can be many instances for each aircraft type. Every aircraft type must have a friendly name for this type, and more details about this type. For example a class named F16 will have a static member FriendlyName with the value of "Lockheed Martin F-16 Fighting Falcon". Other programmers should be able to add more aircrafts, although they must be enforced to create the same static details about the types of the aircrafts. In some GUI, there should be a way to let the user see the list of available types (with the details such as FriendlyName) and add or remove instances of the aircrafts, saved, lets say, to some XML file. So, basically, if I could enforce inherited classes to implement static members and methods, I would enforce the aircraft types to have static members such as FriendlyName. Sadly I cannot do that. So, what would be the best design for this scenario?

    Read the article

  • Navigating through a sea of hype

    - by wouldLikeACrystalBall
    This is a vague, open question, so if you have no interest in these, please leave now. A few years ago it seemed everyone thought the death of desktop software was imminent. Web applications were the future. Everyone would move to cloud-based software-as-a-service systems, and developing applications for specific end-user platforms like Windows would soon become something of a ghetto. Joel's "How Microsoft Lost the API War" was but one of many such pieces sounding the death knell for this way of software development. Flash-forward to 2010, and the hype is all around mobile devices, particularly the iPhone. Software-as-a-Service vendors--even small ones such as YCombinator startups--go out of their way to build custom applications for the iPhone and other smart phone devices; applications that can be quite sophisticated, that run only on specific hardware and software architectures and are thus inherently incompatible. Now some of you are probably thinking, "Well, only the decline of desktop software was predicted; mobile devices aren't desktops." But the term was used by those predicting its demise to mean laptops also, and really any platform capable of running a browser. What was promised was a world where HTML and related standards would supplant native applications and their inherent difficulties. We would all code to the browser, not the OS. But here we are in 2010 with the AppStore bulging and development for the iPad just revving up. A few days ago, I saw someone on Hacker News claim that the future of computing was entirely in small, portable devices. Apparently the future is underpowered, requires dexterous thumbs and induces near-sightedness. How do those who so vehemently asserted one thing now assert the opposite with equal vehemence, without making even the slightest admission of error? And further, how are we as developers supposed to sift through all of this? I bought into the whole web-standards utopianism that was in vogue back in '06-'07 and now feel like it was a mistake. Is there some formula one can apply rather than a mere appeal to experience?

    Read the article

  • JQuery dialog momentairly displayed on page load

    - by Kevin Won
    I created a page that has a JQuery based dialog using the standard JQuery UI function. I do this with out of the box functionality of JQuery... nothing special at all. Here is my HTML for the dialog: <div id = "myDialog"> <!-- ... more html in here for the dialog --> </div> Then the JQuery called in javascript that transforms the <div> to a dialog: // pruned .js as an example of kicking up a JQuery dialog $('#myDialog').dialog({ autoOpen: false, title: 'Title here', modal: true } }); Again, plain-vanilla JQuery. So you start this wizard by clicking on a link on the parent page, and it then spawns a JQuery dialog which has a significant chunk of HTML that includes images, etc. As I continued developing this page, I started to notice that when I loaded the page in the browser that the <div> tags I was putting in that JQuery transforms into dialogs would very briefly be displayed. Then the page would act as expected. In other words, the dialog would not be hidden, it would be displayed briefly in-line in the page. Quite ugly and unprofessional looking! But after a split second, the page would render correctly and look just as I expected/wanted. Over time, as the page size grew, the time the page would remain incorrectly rendered grew. My guess is that the rendering engine of the browser is rendering the page as it is loading, then at the end it is kicking off the JQuery that will transform the <div> into a dialog. This JQuery function will then transform the simple <div> to a JQuery dialog and hide it (since I have the autoOpen property set to false). Some browsers <cough>IE</cough> display it longer than others. My large-ish dialog now causes the page to incorrectly render for about 1 second... YUCK! I came up with a resolution to this problem which works OK, but I'm wondering if someone knows of a better way.

    Read the article

  • WYSIWYG browser editor that generates *good* HTML?

    - by dauerbaustelle
    I'm searching for a "suck less" WYSIWYG browser HTML editor that generates good HTML code. (no <font>, <foo style="...">, <p></p><span></span><p><span>&nbsp;</span><span><span>blah</span></<span></p> and so on -- <b> and <i> etc is ok). Should be easy-to-use as it is going to be used by people that do not know what HTML is. Any suggestions? (I found a lot of editors but they all create that <font> and nested <span> crap that breaks site design and bloats a site with one table up to 100kB.)

    Read the article

  • What output and recording ports does the Java Sound API find on your computer?

    - by Dave Carpeneto
    Hi all - I'm working with the Java Sound API, and it turns out if I want to adjust recording volumes I need to model the hardware that the OS exposes to Java. Turns out there's a lot of variety in what's presented. Because of this I'm humbly asking that anyone able to help me run the following on their computer and post back the results so that I can get an idea of what's out there. A thanks in advance to anyone that can assist :-) import javax.sound.sampled.*; public class SoundAudit { public static void main(String[] args) { try { System.out.println("OS: "+System.getProperty("os.name")+" "+ System.getProperty("os.version")+"/"+ System.getProperty("os.arch")+"\nJava: "+ System.getProperty("java.version")+" ("+ System.getProperty("java.vendor")+")\n"); for (Mixer.Info thisMixerInfo : AudioSystem.getMixerInfo()) { System.out.println("Mixer: "+thisMixerInfo.getDescription()+ " ["+thisMixerInfo.getName()+"]"); Mixer thisMixer = AudioSystem.getMixer(thisMixerInfo); for (Line.Info thisLineInfo:thisMixer.getSourceLineInfo()) { if (thisLineInfo.getLineClass().getName().equals( "javax.sound.sampled.Port")) { Line thisLine = thisMixer.getLine(thisLineInfo); thisLine.open(); System.out.println(" Source Port: " +thisLineInfo.toString()); for (Control thisControl : thisLine.getControls()) { System.out.println(AnalyzeControl(thisControl));} thisLine.close();}} for (Line.Info thisLineInfo:thisMixer.getTargetLineInfo()) { if (thisLineInfo.getLineClass().getName().equals( "javax.sound.sampled.Port")) { Line thisLine = thisMixer.getLine(thisLineInfo); thisLine.open(); System.out.println(" Target Port: " +thisLineInfo.toString()); for (Control thisControl : thisLine.getControls()) { System.out.println(AnalyzeControl(thisControl));} thisLine.close();}}} } catch (Exception e) {e.printStackTrace();}} public static String AnalyzeControl(Control thisControl) { String type = thisControl.getType().toString(); if (thisControl instanceof BooleanControl) { return " Control: "+type+" (boolean)"; } if (thisControl instanceof CompoundControl) { System.out.println(" Control: "+type+ " (compound - values below)"); String toReturn = ""; for (Control children: ((CompoundControl)thisControl).getMemberControls()) { toReturn+=" "+AnalyzeControl(children)+"\n";} return toReturn.substring(0, toReturn.length()-1);} if (thisControl instanceof EnumControl) { return " Control:"+type+" (enum: "+thisControl.toString()+")";} if (thisControl instanceof FloatControl) { return " Control: "+type+" (float: from "+ ((FloatControl) thisControl).getMinimum()+" to "+ ((FloatControl) thisControl).getMaximum()+")";} return " Control: unknown type";} } All the application does is print out a line about the OS, a line about the JVM, and a few lines about the hardware found that may pertain to recording hardware. For example on my PC at work I get the following: OS: Windows XP 5.1/x86 Java: 1.6.0_07 (Sun Microsystems Inc.) Mixer: Direct Audio Device: DirectSound Playback [Primary Sound Driver] Mixer: Direct Audio Device: DirectSound Playback [SoundMAX HD Audio] Mixer: Direct Audio Device: DirectSound Capture [Primary Sound Capture Driver] Mixer: Direct Audio Device: DirectSound Capture [SoundMAX HD Audio] Mixer: Software mixer and synthesizer [Java Sound Audio Engine] Mixer: Port Mixer [Port SoundMAX HD Audio] Source Port: MICROPHONE source port Control: Microphone (compound - values below) Control: Select (boolean) Control: Microphone Boost (boolean) Control: Front panel microphone (boolean) Control: Volume (float: from 0.0 to 1.0) Source Port: LINE_IN source port Control: Line In (compound - values below) Control: Select (boolean) Control: Volume (float: from 0.0 to 1.0) Control: Balance (float: from -1.0 to 1.0)

    Read the article

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