Search Results

Search found 3264 results on 131 pages for 'michael j hamilton sr'.

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

  • Populating PDF fields in .NET without a API, such as iTextSharp

    - by Kristjan Oddsson
    class mineTest { string pdfTemplate = @"c:\us.pdf"; public mineTest(Customer c, string output) { StreamReader sr = new StreamReader(pdfTemplate); StreamWriter sw = new StreamWriter(output); string content = sr.ReadToEnd(); content.Replace("(Customer name)/DA(/Verdana 10 Tf 0 g)/FT/Tx/Type/Annot/MK<<>>/V()/AP<</N 13 0 R>>>>", "(Customer name)/DA(/Verdana 10 Tf 0 g)/FT/Tx/Type/Annot/MK<<>>/V(John Johnson)/AP<</N 13 0 R>>>>"); sw.Write(content); sw.Close(); sr.Close(); } } Why does the above code fail at producing a valid PDF?

    Read the article

  • How GC collects resources in a static member in C#?

    - by carter-boater
    Dear all, I have a piece of code like this: Class Program { static StreamReader sr = null; static int var=0; static Program() { sr = new StreamReader("input.txt") } ~Program() { sr.Dispose(); } static void main(string args[]) { //do something with input here } } This may not be a good practice, but I just want to use this example to ask how the deconstructor and GC works. My question is: Will ~Program() get called at a non-determined time or it won't be called at all in this case. If the deconstructor won't get called, then how GC collect the unmanaged resources and managed resources. Thank you very much!

    Read the article

  • copy a versioned files in clearcase

    - by devtech
    Hi , I need a perl script using I can copy a versioned file (using extended path) to a directory . the simple copy command here does not working. here the versioned files K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\1 K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\2 K:\views\jah\hakgs\sr\th\test.java@@\main\branch\view\3 I want these files copy and stored outside the view to a directory.like the first versionned file must store in folder name 1,second file in folder 2,3rd file in 3. Is it possible to do with a perl script. Please give any suggestion.Many thanks in advance

    Read the article

  • What version control system is best designed to *prevent* concurrent editing?

    - by Fred Hamilton
    We've been using CVS (with TortoiseCVS interface) for years for both source control and wide-ranging document control (including binaries such as Word, Excel, Framemaker, test data, simulation results, etc.). Unlike typical version control systems, 99% of the time we want to prevent concurrent editing - when a user starts editing a file, the pre-edit version of the file becomes read only to everyone else. Many of the people who will be using this are not programmers or even that computer savvy, so we're also looking for a system that let's people simply add documents to the repository, check out and edit a document (unless someone else is currently editing it), and check it back in with a minimum of fuss. We've gotten this to work reasonably well with CVS + TortoiseCVS, but we're now considering Subversion and Mercurial (and open to others if they're a better fit) for their better version tracking, so I was wondering which one supported locking files most transparently. For example, we'd like exclusive locking enabled as the default, and we want to make it as difficult as possible for someone to accidentally start editing a file that someone else has checked out. For example when someone checks out a file for editing, it checks with the master database first even if they have not recently updated their sandbox. Maybe it even won't let a user check out a document if it's off the network and can't check in with the mothership.

    Read the article

  • How to retrieve a binary file from .NET assembly?

    - by Rahul Soni
    I have an excel file that I want to embed in my C# assembly. I have changed the build action of the XLSX file to "Embedded Resource". During runtime, I have to retrieve this XLSX file from the assembly. Assembly assembly = Assembly.GetExecutingAssembly(); StreamReader sr = new StreamReader(assembly.GetManifestResourceStream("AssemblyName.Output.xlsx"), true); StreamWriter sw = new StreamWriter(strPath); sw.Write(sr.ReadToEnd()); sr.Dispose(); sw.Dispose(); System.Diagnostics.Process.Start(strPath); As expected, this fails for the XLSX file since it is a binary data. This could works well with a text file. I tried binary read/write, but I am not able to get the code running. Thoughts?

    Read the article

  • Tables with no Primary Key

    - by Matt Hamilton
    I have several tables whose only unique data is a uniqueidentifier (a Guid) column. Because guids are non-sequential (and they're client-side generated so I can't use newsequentialid()), I have made a non-primary, non-clustered index on this ID field rather than giving the tables a clustered primary key. I'm wondering what the performance implications are for this approach. I've seen some people suggest that tables should have an auto-incrementing ("identity") int as a clustered primary key even if it doesn't have any meaning, as it means that the database engine itself can use that value to quickly look up a row instead of having to use a bookmark. My database is merge-replicated across a bunch of servers, so I've shied away from identity int columns as they're a bit hairy to get right in replication. What are your thoughts? Should tables have primary keys? Or is it ok to not have any clustered indexes if there are no sensible columns to index that way?

    Read the article

  • Parsing a XML File and Replacing Chosen Node With Values From Text File

    - by transmogrify
    I wrote a C# Winforms program to take a XML file and load values from a text file into each occurrence of that field which the user specifies on the UI. For whatever reason, the program inserts a carriage return on any nodes which don't contain a value. For example, it will do that to <example></example> whereas it will not misbehave on something like <country>USA</country> What is causing it to do this and how can I prevent it? Here is the code from the part which handles this functionality. XmlDocument LoadXmlDoc = new XmlDocument(); StreamReader sr = File.OpenText(DataLoadTxtBx.Text); string InputFromTxtFile; LoadXmlDoc.Load(XmlPath.Text); XmlNodeList NodeToCreateOrReplace = LoadXmlDoc.GetElementsByTagName(XmlTagNameTxtBx.Text); foreach (XmlNode SelectedNode in NodeToCreateOrReplace) { if ((InputFromTxtFile = sr.ReadLine()) != null) { SelectedNode.InnerText = InputFromTxtFile; } } sr.Close(); LoadXmlDoc.Save(XmlPath.Text);

    Read the article

  • Generating code for service proxies

    - by Hadi Eskandari
    I'm trying to generate some additional code base on the auto-generated webservice proxies in my VS2010 solution, I'm using a T4 template to do so. The problem is, automatically generated proxies are added in "Service Reference" folder but ProjectItems (files) are hidden by default and the following code does not find them in the project structure: var sr = GetProjectItem(project, "Service References"); if(sr != null) { foreach(ProjectItem item in sr.ProjectItems) { foreach(var file in item.ProjectItems) { //Services.Add(new ServiceInfo { Name = file.Name }); } } } The above code runs and although service reference is found, and there are ProjectItems under that node (named by the webservice reference name), under object under that node is of type System.__ComObject and I'm not sure how to progress. Any help is appreciated.

    Read the article

  • Getting mysql row that doesn't conflict with another row

    - by user939951
    I have two tables that link together through an id one is "submit_moderate" and one is "submit_post" The "submit_moderate" table looks like this id moderated_by post 1 James 60 2 Alice 32 3 Tim 18 4 Michael 60 Im using a simple query to get data from the "submit_post" table according to the "submit_moderate" table. $get_posts = mysql_query("SELECT * FROM submit_moderate WHERE moderated_by!='$user'"); $user is the person who is signed in. Now my problem is when I run this query, with the user 'Michael' it will retrieve this 1 James 60 2 Alice 32 3 Tim 18 Now technically this is correct however I don't want to retrieve the first row because 60 is associated with Michael as well as James. Basically I don't want to retrieve that value '60'. I know why this is happening however I can't figure out how to do this. I appreciate any hints or advice I can get.

    Read the article

  • Space bar and arrow keys on Radio buttons trigger TypeError: Error #1009

    - by Sr.Richie
    I've just discovered a bug in my app, it looks like a Flash player bug, i would like to know if anyone has found a workaround or something. I've some radio buttons groups in my app. If I press the arrow keys while holding the spacebar pressed, it ends up triggering TypeError: Error #1009: Cannot access a property or method of a null object reference. at fl.controls::LabelButton/drawIcon() at fl.controls::LabelButton/draw() at fl.controls::RadioButton/draw() at fl.core::UIComponent/callLaterDispatcher() If found this thread that describes my same situation. Do you think there's any workaround for this? Is it really a flash bug?

    Read the article

  • new user registration on ejabberd server using jaber.net

    - by SR Dusad
    Hi I m working on an online text chat program in C#.Net . For this i m using ejabberd server and for build a client m using jaber.net .But i m facing some problem during the new user registration . Can anyone give me a proper code for register new user or some advise or instruction to create new account. Any type of help will be appreciated. Thanks in advance

    Read the article

  • paket drop and splits in udp tunnel

    - by sr-dusad
    hi guys ! Currently I am working on video conferencing project.For this i m using pwnat for nat traversing. pwnat is based on udp tunneling.I m using the TCP connection for data transmission. My problem is that when i send a packet , it does not reach properly at its destination side . Sometime it drops the packet and many times it breaks ( split ) the packet into pieces. Please Help me .. How can i send and recieve a packet into single piece. So, i can draw image properly and play sound. Any kind of help will be appriciated . Thanks in advance

    Read the article

  • Android phone contact 2.1

    - by Sudeep SR
    Hi in my application i need to show all the phone contact including contact image, currently i read all the data in to array and show ,but in some lower end phones it create problem ,like out of memory is there any alternative way to display the all the phone contact NB: the default phone contact intent is not my requirment , i need to get all the phone numbers, and also if first name is empty i need to show the organization name

    Read the article

  • stun and p2p communication

    - by sr-dusad
    hi I m new in network programming.I want to traverse NAT using Stun .I use the stun client application defined in code project Stun Client .It returned me a mapped ip and port.But i don't know how to use this ip and port for p2p communication in c#.net. Pls Help me . Any help will be appriciated

    Read the article

  • how to get ipv6 public address on xp machine ?

    - by SR Dusad
    C:netsh netshinterface ipv6 netsh interface ipv6show addres Querying active state... Interface 6: Local Area Connection 3 Addr Type DAD State Valid Life Pref. Life Address Temporary Preferred 6d23h38m55s 23h36m8s 2001:db8:1dde:1:6d16:9d1:b1ec:2245 Public Preferred 29d23h59m30s 6d23h59m30s 2001:db8:1dde:1:201:2ff:fe29:23b6 Link Preferred infinite infinite fe80::201:2ff:fe29:23b6 The books says, after IPv6 is enabled on XP, auto configure will give it 3 addresses, a Link, a Public, and a Temporary one. But on my computer, I could only see Link, what was the problem? I used the XP machine. But when i try it on windows 2007 .it works fine and show me a public address. - How to get public ipv6 address from xp machine ? - on my xp machine ipv6 is enabled but when i use command tracert6 www.kame.net it shows No route to destination. Why Any type of help willl appreciated..

    Read the article

  • Cannot access implict object from within method in custom JSP tag file

    - by David Hamilton
    I'm attempting to create a custom jsp tag. Everything is working fine, except for the fact that I the request seems to be out-of-scope for my custom function. Here is the relevant bit from the .tag file: <%! private String process(String age, BigDecimal amount) { //Attempting to access request here results in an compile time error trying to: String url=request.getURL; } %> I'm very new to JSP so I'm sure I'm missing something obvious..but I can't seem to figure out what. Any help is appreciated.

    Read the article

  • Why is Func<T> ambiguous with Func<IEnumerable<T>>?

    - by Matt Hamilton
    This one's got me flummoxed, so I thought I'd ask here in the hope that a C# guru can explain it to me. Why does this code generate an error? class Program { static void Main(string[] args) { Foo(X); // the error is on this line } static String X() { return "Test"; } static void Foo(Func<IEnumerable<String>> x) { } static void Foo(Func<String> x) { } } The error in question: Error 1 The call is ambiguous between the following methods or properties: 'ConsoleApplication1.Program.Foo(System.Func<System.Collections.Generic.IEnumerable<string>>)' and 'ConsoleApplication1.Program.Foo(System.Func<string>)' C:\Users\mabster\AppData\Local\Temporary Projects\ConsoleApplication1\Program.cs 12 13 ConsoleApplication1 It doesn't matter what type I use - if you replace the "String" declarations with "int" in that code you'll get the same sort of error. It's like the compiler can't tell the difference between Func<T> and Func<IEnumerable<T>>. Can someone shed some light on this?

    Read the article

  • How to get IPv6 public address on Windows XP machine?

    - by SR Dusad
    C:\>netsh netsh>interface ipv6 netsh interface ipv6>show addres Querying active state... Interface 6: Local Area Connection 3 Addr Type DAD State Valid Life Pref. Life Address --------- ---------- ------------ ------------ ----------------------------- Temporary Preferred 6d23h38m55s 23h36m8s 2001:db8:1dde:1:6d16:9d1:b1ec:2245 Public Preferred 29d23h59m30s 6d23h59m30s 2001:db8:1dde:1:201:2ff:fe29:23b6 Link Preferred infinite infinite fe80::201:2ff:fe29:23b6 The books says, after IPv6 is enabled on Windows XP, auto configure will give it 3 addresses, a Link, a Public, and a Temporary one. But on my computer, I could only see Link, what was the problem? I used the Windows XP machine. But when I try it on Windows 2007 it works fine and show me a public address. How to get public IPv6 address from Windows XP machine? on my Windows XP machine IPv6 is enabled but when I use the command tracert6 www.kame.net it shows "No route to destination". Why?

    Read the article

  • Do you like languages that let you put the "then" before the "if"?

    - by Matt Hamilton
    I was reading through some C# code of mine today and found this line: if (ProgenyList.ItemContainerGenerator.Status != System.Windows.Controls.Primitives.GeneratorStatus.ContainersGenerated) return; Notice that you can tell without scrolling that it's an "if" statement that works with ItemContainerGenerator.Status, but you can't easily tell that if the "if" clause evaluates to "false" the method will return at that point. Realistically I should have moved the "return" statement to a line by itself, but it got me thinking about languages that allow the "then" part of the statement first. If C# permitted it, the line could look like this: return if (ProgenyList.ItemContainerGenerator.Status != System.Windows.Controls.Primitives.GeneratorStatus.ContainersGenerated); This might be a bit "argumentative", but I'm wondering what people think about this kind of construct. It might serve to make lines like the one above more readable, but it also might be disastrous. Imagine this code: return 3 if (x > y); Logically we can only return if x y, because there's no "else", but part of me looks at that and thinks, "are we still returning if x <= y? If so, what are we returning?" What do you think of the "then before the if" construct? Does it exist in your language of choice? Do you use it often? Would C# benefit from it?

    Read the article

  • Show Alertdialog and use vibrator

    - by user1007522
    I'm having a class that implements RecognitionListener like this: public class listener implements RecognitionListener I wanted to show a alertdialog and use the vibrator but this isn't possible because I need to provide a context what I don't have. My alertdialog code was like this: new AlertDialog.Builder(this) .setTitle("dd") .setMessage("aa") .setNeutralButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { } }) .show(); But the AlertDialog.Builder(this) wants a context, the same problem with my vibrator code: v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); The getSystemService method isn't available. My code that starts the class: sr = SpeechRecognizer.createSpeechRecognizer(this); sr.setRecognitionListener(new listener()); Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,"voice.recognition.test"); intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS,5); sr.startListening(intent); Whats the best way to solve this?

    Read the article

  • RAW key generation in IOS with AES

    - by sudheer
    I am novice to the cryptography in ios . I got a requirement to convert android encryption code into IOS . Below is the android code part. I need that in IOS . Can any one please help me out in this . I need this below android code in IOS. private static byte[] getRawKey(byte[] seed) throws Exception { KeyGenerator kgen = KeyGenerator.getInstance("AES"); SecureRandom sr = SecureRandom.getInstance("SHA1PRNG"); sr.setSeed(seed); kgen.init(256, sr); SecretKey skey = kgen.generateKey(); byte[] raw = skey.getEncoded(); return raw; }

    Read the article

  • Sort List by occurrence of a word by LINQ C#

    - by Thomas
    i have stored data in list like List<SearchResult> list = new List<SearchResult>(); SearchResult sr = new SearchResult(); sr.Description = "sample description"; list.Add(sr); suppose my data is stored in description field like "JCB Excavator - ECU P/N: 728/35700" "Geo Prism 1995 - ABS #16213899" "Geo Prism 1995 - ABS #16213899" "Geo Prism 1995 - ABS #16213899" "Wie man BBA reman erreicht" "this test JCB" "Ersatz Airbags, Gurtstrammer und Auto Körper Teile" now i want to query the list with my search term like geo jcb if you look then the word geo has stored many times in the description field. so i want to sort my list in such way that the word in search term found maximum that data will come first. please help me to do so. thanks

    Read the article

  • HOW TO GET WEB CAM IMAGES IN C#

    - by SR Dusad
    Hi I m working on online video conferencing project in c# and .Net4.0 I want a library or code which i can used for collecting web camera inges per second in diferent form. I try this by using the AVICAP32, in which we send Messages for diferent purpose like copy or edit frames.but in this we have to pass a reference of picturebox while creating handler as given below mCapHwnd = capCreateCaptureWindowA("0", 268435456 | 1073741824, 0, 0, 640, 480,picturebox1.Handle.ToInt32(), 0); usiing these commands i m able to capture images but the problem comes when i minimize the picturebox form . at that time doesn't create new image . I think this is happened because i minimize the form and when it copy the image from this clipboard it doesn't shhow anything. How can i solve this problem . Any type of help will be appreciated. Thanks srdusad

    Read the article

  • issue with regex in C#

    - by Dilip
    my file is > A B C D unuse data <begin> Addd as ss 1 My name is 2323 33 text > </end> 34344 no need and my code is StringBuilder mSb = new StringBuilder(); StreamReader sr = new StreamReader(@"E:\check.txt"); String line; while (sr.ReadLine() != null) { mSb.AppendLine(sr.ReadLine()); } string matc = new Regex(@"(<begin>)(\n?.*)*</end>)?").Match(mSb.ToString()).ToString(); here it reading all file , but i just want till if i am removing ? from end , my program is crashing .. Thanks

    Read the article

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