Daily Archives

Articles indexed Wednesday May 26 2010

Page 32/118 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • How write string " " on c#

    - by riad
    dear all, I need to write this same string to a txt file But C# find error on " " point.can anybody pls guide me: my code: writeText.WriteLine("<?xml version="1.0" encoding="utf-8"?>"); needed uoutput on txt file is: pls guide Thanks riad

    Read the article

  • Perl - What is Larry?

    - by user350571
    I was reading some Perl book and I find meant-to-be funny mentions to something named Larry. Some times it is mixed in a religious context (like "Larry multiplied the code and distributed among coders"). Since I'm not stupid, I tried to think a bit and I believe I finally got it... It's about Larry the cow from Gentoo right?. And the religious context is because cows are normally associated to religion. Anyway, why the references? There is something about camels and cows together that I'm not following?

    Read the article

  • MS WebBrowser + Embedded HTML Resource + res:// Protocol

    - by letthewookiewin
    Hi, I have an embedded HTML resource (helloworld.htm) inside my Visual Studio project. (Ie, I've added an HTML file to the project and set its properties to "Embedded Resource". Within the same application I have a WebBrowser control. I'd like to direct the WebBrowser control to display the HTML resource using the res:// protocol. But I can't figure out the exact format needed to address an embedded resource using this style of URL. Any ideas? Thanks!

    Read the article

  • How to get it working in O(n)?

    - by evermean
    I came across an interview task/question that really got me thinking ... so here it goes: You have an array A[N] of N numbers. You have to compose an array Output[N] such that Output[i] will be equal to multiplication of all the elements of A[N] except A[i]. For example Output[0] will be multiplication of A[1] to A[N-1] and Output[1] will be multiplication of A[0] and from A[2] to A[N-1]. Solve it without division operator and in O(n). I really tried to come up with a solution but I always end up with a complexity of O(n^2). Perhaps the is anyone smarter than me who can tell me an algorithm that works in O(n) or at least give me a hint...

    Read the article

  • Silverlight file upload - file is in use by another process (Excel, Word)

    - by walkor
    Hi, all. I have a problem with uploading of the file in Silverlight application. Here is a code sample. In case when this file is opened in other application (excel or word for example) it fails to open it, otherwise it's working fine. I'm using OpenFileDialog to choose the file and pass it to this function. private byte[] GetFileContent(FileInfo file) { var result = new byte[] {}; try { using (var fs = file.OpenRead()) { result = new byte[file.Length]; fs.Read(result, 0, (int)file.Length); } } catch (Exception e) { // File is in use } return result; } Is there any way i can access this file or should i just notify the user that the file is locked?

    Read the article

  • Thread processing in EMS connection

    - by aladine
    I am setting up a client and exchange project and both are connecting to a remote server. Exchange will connect to the server by EMS connection. While client will connect by FIX. For the aim of building of black box testing, both client and exchange engine will be given some predefined testcases to send and receive to the server. I design the client engine with multithread processing to manipulate many testcases. Actually it is able to run succesfully. For exchange engine, I wonder that multi thread is applicable in the context that the exchange engine just need to publish a message when it received msg from subscribed topic on server. Flow of messages transmission: Client--SERVER--Exchange FIX EMS Exchange--SERVER--Client EMS FIX Thanks if you can help me on this issue.

    Read the article

  • how to redirect terminal contents to a jtextpane?

    - by sonu thomas
    hi.. I was trying to run a java class file using java code.The aim was to direct the executing sequence of the terminal of fedora 10 into a frame with a textpane. My code is: import java.io.DataInputStream; import java.io.IOException; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.JTextPane; //import sun.reflect.ReflectionFactory.GetReflectionFactoryAction; public class file { /** * @param args */ /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException{ // TODO Auto-generated method stub JDialog jj = new JDialog(); jj.setTitle("helllo"); String sssub1,sssub2,sssub3; String ss="C:/Users/sonu/Desktop/ourIDE/src/src/nn.java"; JPanel n = new JPanel(); jj.setContentPane(n); JTextPane tpn2=new JTextPane(); jj.getContentPane().add(tpn2); jj.setVisible(true); Runtime runtime; Process process; if(ss.indexOf(" ")==-1) { try { runtime= Runtime.getRuntime(); sssub1="/home/ss/Desktop/src/"; sssub2="nn"; process=runtime.exec("sh jrun.sh "+sssub1+" "+sssub2); DataInputStream data=new DataInputStream(process.getInputStream()); DataInputStream data_data=new DataInputStream(process.getErrorStream()); String s="",t=""; int ch; while((ch=data.read())!=-1){ s=s+(char)ch; } data.close(); while((ch=data_data.read())!=-1){ t=t+(char)ch; } data_data.close(); if(t.equals("")) { s+="\nNormal Termination."; tpn2.setText(s); } else tpn2.setText(t); }catch(Exception e){ System.out.println("Error executing file==>"+e);} } } } The content of **jrun.sh** is cd $1 java $2 When the content of **nn.java** was this: import java.io.*; class nn { public static void main(String[] ar)throws IOException { int i=90; BufferedReader dt = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter"); //i=Integer.parseInt(dt.readLine()); line--notable System.out.println("i="+i); } } It worked smoothly But when I remove the comment on line--notable,it gave me Textpane with no content. The problem is : I cant read an input from nn.java Kindly give me a solution... If i am able to: get the terminal pop up with executing the nn.class,and i am able to enter the input,then it will do... Thanks in advance...

    Read the article

  • Setting CommandTarget to selected control in a TabControl

    - by Bart
    I have a WPF window with a few buttons and a tabcontrol having a tab for each 'document' the user is working on. The tabcontrol uses a DataTemplate to render the data in ItemSource of the tabcontrol. The question: If one of the buttons is clicked, the command should be executed on the control rendering the document in the active tab, but I've no idea what I should set CommandTarget to. I tried {Binding ElementName=nameOfControlInDataTemplate} but that obviously doesn't work. I tried to make my problem a bit more abstract with the following code (no ItemSource and Document objects, but the idea is still the same). <Button Command="ApplicationCommands.Save" CommandTarget="{Binding ElementName=nestedControl}">Save</Button> <TabControl x:Name="tabControl"> <TabControl.Items> <TabItem Header="Header1">Item 1</TabItem> <TabItem Header="Header2">Item 2</TabItem> <TabItem Header="Header3">Item 3</TabItem> </TabControl.Items> <TabControl.ContentTemplate> <DataTemplate> <CommandTest:NestedControl Name="nestedControl"/> </DataTemplate> </TabControl.ContentTemplate> </TabControl> I tested the code by replacing the complete tabcontrol with only one single NestedControl, and then the command button just works. To be complete, here is the code of NestedControl: <UserControl x:Class="CommandTest.NestedControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid> <Label x:Name="label" Content="Not saved"/> </Grid> </UserControl> And code behind: public partial class NestedControl : UserControl { public NestedControl() { CommandBindings.Add(new CommandBinding(ApplicationCommands.Save, CommandBinding_Executed)); InitializeComponent(); } private void CommandBinding_Executed(object sender, ExecutedRoutedEventArgs e) { label.Content = "Saved"; } }

    Read the article

  • Python 2.6 -> Python 3 (ProxyHandler)

    - by blah
    Hallo, I wrote a script that works with a proxy (py2.6x): proxy_support = urllib2.ProxyHandler({'http' : 'http://127.0.0.1:80'}) But in py3.11x there is no urllib2 just a urllib... and that doesnt support the ProxyHandler How can I use a proxy with urllib? Isnt Python 3 newer then Python 2? Why did they remove urllib2 in a newer version?

    Read the article

  • FeedValidator & Feedburner get 404 when accessing wordpress RSS feeds when permalinks are enabled.

    - by Wazbaur
    I'm helping a friend set up a self-hosted Wordpress blog + feedburner and I'm seeing a problem with the feeds that I'm finding somewhat mysterious. Using the default permalink structure (e.g., ?p=123) everything works as expected; I can follow the feed in Google reader, navigate to it manually, and set it up in feedburner. However, once I switch away from the default permalink structure, feedburner and feedvalidator both report that accessing the feed is returning HTTP-404 and Google reader no longer shows new posts (I'm assuming for the same reason), but I can navigate to the feed using a browser. When I do that it appears as though nothing is wrong; there is a feed there and it contains all the posts I expect it to have. I've re-started the feedburner & reader set-up from the beginning after changing the link structure, so I don't think they're doing anything silly like looking at the feed at its old address. I've seen people with similar problems in various other places but there doesn't seem to be a good answer anywhere.

    Read the article

  • Exchange 2010: Possible to close for incomming mails for specific acount and reply with "no longer a

    - by Mestika
    Hi, I was wondering if it is possible, in Exchange server 2010, to disable a mailbox account, lets call it mailuser and if anyone sends a E-mail for [email protected] then it will send a mail back with some sort of standard "This E-mail is no longer in use. Please write to [email protected] instead" mail. I know I can create an "out-of-office" reply from the users outlook, but it would be so much faster to do it within the exchange server. Sincerely Mestika

    Read the article

  • IT merger - self-sufficient site with domain controller VS thin clients outpost with access to termi

    - by imagodei
    SITUATION: A larger company acquires a smaller one. IT infrastructure has to be merged. There are no immediate plans to change the current size or role of the smaller company - the offices and production remain. It has a Win 2003 SBS domain server, Win 2000 file server, linux server for SVN and internal Wikipedia, 2 or 3 production machines, LTO backup solution. The servers are approx. 5 years old. Cisco network equippment (switches, wireless, ASA). Mail solution is a hosted Exchange. There are approx. 35 desktops and laptops in the company. IT infrastructure unification: There are 2 IT merging proposals. 1.) Replacing old servers, installing Win Server 2008 domain controller, and setting up either subdomain or domain trust to a larger company. File server and other servers remain local and synchronization should be set up to a centralized location in larger company. Similary with the backup - it remains local and if needed it should be replicated to a centralized location. Licensing is managed by smaller company. 2.) All servers are moved to a centralized location in larger company. As many desktop machines as possible are replaced by thin clients. The actual machines are virtualized and hosted by Terminal server at the same central location. Citrix solutions will be used. Only router and site-2-site VPN connection remain at the smaller company. Backup internet line to insure near 100% availability is needed. Licensing is mainly managed by larger company. Only specialized software for PCs that will not be virtualized is managed by smaller company. I'd like to ask you to discuss both solutions a bit. In your opinion, which is better from the operational point of view? Which is more reliable, cheaper in the long run? Easier to manage from the system administrator's point of view? Easier on the budget and easier to maintain from IT department's point of view? Does anybody have any experience with the second option and how does it perform in production environment? Pros and cons of both? Your input will be of great significance to me. Thank you very much!

    Read the article

  • MediaPortal crash when scanning my TV Channels

    - by Martin Ongtangco
    Hello, I tried installing MediaPortal (http://www.team-mediaportal.com) on my old system. I installed & tried both beta & stable releases: Here's the old system specs: Windows XP SP3; 512mb DDR; 80GB IDE; K-World PVR-TV7131 Analog TV-Tuner; Inno3d FX5500 128mb 64bit; When scanning through the TV-Server, it crashes. I don't know if the incompatibility comes from the hardware or the OS, but my TV Tuner's own Media center app works well. For now, that's what im using. Anyone here familiar with MediaPortal? Thanks!

    Read the article

  • Automatically allowing SSH into a machine behind a UPNP router?

    - by GJ
    Hi I have a MacBook connecting to the Internet from behind various routers from time to time (home, office, etc). All of the routers support UPNP. I need to allow a co-worker to SSH into the machine, without configuring each router each time to forward port 22 to the MacBook. Is there any way to get the MacBook to use UPNP (or some other method) to automatically configure any supporting router that it is behind to forward port 22 to itself? That would allow the co-worker to SSH into the MacBook but just knowing its external IP, which is easy.

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >