Daily Archives

Articles indexed Friday May 7 2010

Page 20/110 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Using Multiple File Handles for Single File

    - by Ryan Rosario
    I have an O(n^2) operation that requires me to read line i from a file, and then compare line i to every line in the file. This repeats for all i. I wrote the following code to do this with 2 file handles, but it does not yield the result I am looking for. I imagine this is a simple error on my part. IN1 = open("myfile.dat","r") IN2 = open("myfile.dat","r") for line1 in IN1: for line2 in IN2: print line1.strip(), line2.strip() IN1.close() IN2.close() The result: Hello Hello Hello World Hello This Hello is Hello an Hello Example Hello of Hello Using Hello Two Hello File Hello Pointers Hello to Hello Read Hello One Hello File The output should contain 15^2 lines.

    Read the article

  • How to measure a canvas that has auto height and width

    - by Wymmeroo
    Hi Folks, I'm a beginner in silverlight so i hope i can get an answer that brings me some more light in the measure process of silverlight. I found an interessting flap out control from silverlight slide control and now I try to use it in my project. So that the slide out is working proper, I have to place the user control on a canvas. The user control then uses for itself the height of its content. I just wanna change that behavior so that the height is set to the available space from the parent canvas. You see the uxBorder where the height is set. How can I measure the actual height and set it to the border? I tried it with Height={Binding ElementName=notificationCanvas, Path=ActualHeight} but this dependency property has no callback, so the actualHeight is never set. What I want to achieve is a usercontrol like the tweetboard per example on Jesse Liberty's blog Sorry for my English writing, I hope you understand my question. <Canvas x:Name="notificationCanvas" Background="Red"> <SlideEffectEx:SimpleSlideControl GripWidth="20" GripTitle="Task" GripHeight="100"> <Border x:Name="uxBorder" BorderThickness="2" CornerRadius="5" BorderBrush="DarkGray" Background="DarkGray" Padding="5" Width="300" Height="700" > <StackPanel> <TextBlock Text="Tasks"></TextBlock> <Button x:Name="btn1" Margin="5" Content="{Binding ElementName=MainBorder, Path=Height}"></Button> <Button x:Name="btn2" Margin="5" Content="Second Button"></Button> <Button x:Name="btn3" Margin="5" Content="Third Button"></Button> <Button x:Name="btn1_Copy" Margin="5" Content="First Button"/> <Button x:Name="btn1_Copy1" Margin="5" Content="First Button"/> <Button x:Name="btn1_Copy2" Margin="5" Content="First Button"/> <Button x:Name="btn1_Copy3" Margin="5" Content="First Button"/> <Button x:Name="btn1_Copy4" Margin="5" Content="First Button"/> <Button x:Name="btn1_Copy5" Margin="5" Content="First Button"/> <Button x:Name="btn1_Copy6" Margin="5" Content="First Button"/> </StackPanel> </Border> </SlideEffectEx:SimpleSlideControl>

    Read the article

  • Orientation in UITabBarController + UIViewController

    - by Muhammad Hanifa S
    Anyone please answer for my requirement Im using my application in this order, first page = UIViewController, secondpage = UITabBarController with 4 tabs, I need landscape on the orientation on the second tabpage(UIViewController) ? not working.. Note : When using UITabBarController its working perfect but when I add the UIViewController for my first page, the orientation not working...? anyone who knows the solution plz answer

    Read the article

  • can wsdl generated from java web service using apache cxf be similarly implemented as a .net web ser

    - by user335092
    Hi, i have a web service implemented in java using apache cxf and spring. But the requirement is the same i need that service to be implemented in .net and use that service with my java project web service client..... the package structure of the interface and its implementation should be simulated in .net..... i am novoice to .net and donno how it can be done... any help is appreciated..........

    Read the article

  • Server unable to find public folder in rails 3 production environment

    - by James
    Hi, I'm using the latest rails 3 beta. The app works fine in development mode, but when I start the server in production mode via rails server -e production, it seems that the public folder can't be found. I get error messages like: ActionController::RoutingError (No route matches "/javascripts/jquery.js"): And similar messages for everything that should be in the public folder. I've tried this with both mongrel and webrick. I'd appreciate any help.

    Read the article

  • create a new option and inject into select box using mootools 1.2

    - by Avinash
    Hi i have one AJAX function which return the list of countries. It works fine. My problem is that want to load that countries in on select box which is already in HTML and is empty means no option value in it. I want to know that how can i create a new option element and inject into the select box using moo tools 1.2 I have used below code but its not working in IE. var NewOption = new Option("Select Sub Category",'0'); NewOption.inject($('nSub_nIndustryID')) Thanks Avinash

    Read the article

  • Problem with Ubuntu 10.04 and ATI

    - by Maximilinao
    I'm having a problem installing the drivers from the video card. Just finished installing the driver, reboot my OS, and my monitor is starting off in energy saving mode and does not boot Ubuntu. What I can do? Sorry for my English. I used the Google translator.

    Read the article

  • Where do I connect the HDD LED wires on my RAID adapter?

    - by Giffyguy
    I'm using a Promise FastTrak TX8660 with RAID 5. The manual (and Google) just doesn't seem to explain how exactly to connect a standard two-pin HDD LED wire to the eight available pins on the card. The Manual just says - To connect your LED, follow the following diagram: The card itself resembles the diagram: But it doesn't make any sense to me. All I have is a two-pin connecter for HDD LED on the front of my computer case. I don't need anything fancy like the fault LED or seperate indicators for each drive. I just want to be able to see when my RAID 5 array is working, that's all. I don't know what the "R" and "G" stand for, but my HDD LED wires are red and white. I tried connecting the red wire to the "R" pin and the white wire to the "G" pin, but that just makes the LED on the front of my case light up indefinitely, even when the computer is idle. Which pins am I suppose to connect the HDD LED header to for basic activity indication?

    Read the article

  • use theme for X11

    - by amir-beygi
    HI all sorry for my bad english My program (GTK) runs in linux(ubuntu) without any problem and it's themes are fine but when i change my system to run just X and then my program , it runs but without any theme ,how can i configure my system to use theme in X for my program REGARDS

    Read the article

  • Allow access to my server.

    - by Zachary Brown
    I have a server, did some of the programming myself. It ison my home network, but I need to be able to access it from anywhere over the internet. I have done the port forwarding like I am supposed to, but I still cant get to it from an outside computer. It just displays Internet Explorer cannot display the webpage. I don't know what else to do. I am on a Linksys WRT54G v8 router running ddWRT v24 micro firmware.

    Read the article

  • Magic Mouse problems dragging and dropping files in finder (Mac OSX 10.6.3)

    - by Brendan Green
    I have an issue dragging files around in the finder with my Magic Mouse. For example, I was trying to select and drag multiple files from the desktop onto an external hard drive. However, whenever I do so, the files either end up deselected (and the move doesn't happen). If I try to drag a single file, finder ends up doing whatever it does to enable the file to be renamed. Reverting back to the touchpad works fine. Is there a problem with drag-and-drop with this mouse, or is there a setting that I am missing (I've scoured the settings, and nothing is jumping out at me). Any help would be appreciated. Thanks

    Read the article

  • Is there a way to prevent a ToolWindow from being closed?

    - by brunoqc
    Is there a way to hide the "X" closing icon of a ToolWindow or is there a way to use IVsWindowFrameNotify3's OnShow method to discard (ignore) the event? It seems that the OnClose method is called only when VS exit. When the ToolWindow is called, the OnShow method is called with the __FRAMESHOW.FRAMESHOW_WinHidden state. thanks

    Read the article

  • get premitive , complex, ArrayEnumerable types

    - by john
    i have a separate class for each of my database entities and when i create an object of my class to reference the properties of a class it returns a circular reference which contains properties of other entities too that are related via FK ... to remove the circular reference i want to first make a copy of the object through "context proxy object" copy and then get the primitive, complex, arrayEnumerable types of that object and strip off these types from the object and then the object get returned by web service....

    Read the article

  • Unable to import nltk in NetBeans

    - by afs
    Hello all, I am trying to import NLTK in my python code and I get this error: Traceback (most recent call last): File "/home/afs/NetBeansProjects/NER/getNE_followers.py", line 7, in import nltk ImportError: No module named nltk I am using NetBeans: 6.7.1, Python 2.6 NLTK. My NLTK module is installed in /usr/local/lib/python2.6/dist-packages/nltk/ and I have added this in Python paths in Netbeans. What am I missing here? Thanks in advance.

    Read the article

  • Using callback functions for error handling in C

    - by Earlz
    Hi, I have been thinking about the difficulty incurred with C error handling.. like who actually does if(printf("hello world")==-1){exit(1);} But you break common standards by not doing such verbose, and usually useless coding. Well what if you had a wrapper around the libc? like so you could do something like.. //main... error_catchall(my_errors); printf("hello world"); //this will automatically call my_errors on an error of printf ignore=1; //this makes it so the function will return like normal and we can check error values ourself if(fopen.... //we want to know if the file opened or not and handle it ourself. } int my_errors(){ if(ignore==0){ _exit(1); //exit if we aren't handling this error by flagging ignore } return 0; //this is called when there is an error anywhere in the libc } ... I am considering making such a wrapper as I am synthesizing my own BSD licensed libc(so I already have to touch the untouchable..), but I would like to know what people think about it.. would this actually work in real life and be more useful than returning -1?

    Read the article

  • resampling a series of points

    - by clamp
    hello, i have an array of points in 3d (imagine the trajectory of a ball) with X samples. now, i want to resample these points so that i have a new array with positions with y samples. y can be bigger or smaller than x but not smaller than 1. there will always be at least 1 sample. how would an algorithm look like to resample the original array into a new one? thanks!

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >