- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
25 Posted Topics
Re: [CODE] public int random(int min, int max) { int random = (int) (Math.random() * (max + 1)); return random < min ? random(min, max) : random; }[/CODE] | |
I've had this problem come and go and have tried everything to resolve it. Program icons don't load and instead are blank. "My Computer" doesn't load anything, it appears to be loading, but nothing ever appears. Context menus (on files and folders) do not load and usually crash the current … | |
How exactly would I go about doing the following in C#? public class Test { public static void main(String[] args) { Test(new TestInterface() { @Override public void SomeMethod() { //create instance of the interface within parameters of a method. } }); } public static void Test(TestInterface _interface) { } } … | |
Re: I have alot of experience with client -> server (and vice versa) operations. You need to learn how binary works, you also need to learn bitwise operations, for example, writing a 4-byte signed integer (d word) to a buffer: [CODE] private byte[] buffer = new byte[4]; private int bufferOffset; public … | |
I enjoy making time capsule-type programs that shows something when the date countdown reaches 0, the only problem is that you can change your computers clock to prematurely make the countdown reach 0. The only way I can think of fixing it is by connecting to a time server and … | |
Using the basic principle in this code: [CODE] try { GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); GraphicsDevice[] gs = ge.getScreenDevices(); BufferedImage[] screenshots = new BufferedImage[gs.length]; ImageWriter writer = null; Iterator<ImageWriter> iter = ImageIO.getImageWritersByFormatName("jpeg"); if (iter.hasNext()) writer = iter.next(); ImageWriteParam iwp = writer.getDefaultWriteParam(); iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); iwp.setCompressionQuality(0.1F); DisplayMode mode; Rectangle bounds; for (int i … | |
Re: [CODE] try { BufferedReader reader = new BufferedReader(new FileReader("file.txt")); String line = ""; while ((line = reader.readLine()) != null) { //This will read each line of the file sequentially. } reader.close(); } catch (Exception ex) { }[/CODE] | |
My entire project is fucked if I can't do this; Basically, I need to be able to add an element to a JList (doesn't need to be a JList, just needs to be a list component) then have a tag added to the element too, so when I get the … | |
Heres my situation: I have a server that people connect to. The server runs off the source files on a virtual private server. The files are always being updated when I edit them because they sync with dropbox and the vps. Is it bad to do this, and would it … ![]() | |
What's the C# equivalent to "System.setOut(new Logger(System.out));" in java? Basically with that line of code each line thats printed in the console prints the current date + time, etc.. Thanks. | |
My program requires users to be able to right click a tab and then close it, but I can't do this when the right clicked tab doesn't select. Any help would be nice, thanks. | |
[url]http://img839.imageshack.us/img839/3619/bytes.png[/url] Is this abnormal... Having that many bytes sent/received in that short period of time? Also, can someone explain to me exactly how the activity thing works? | |
How exactly do you distinguish file and folder deletion events using the file system watcher control? I've searched google trying to find an answer, but the only suggestion I've seen is to use separate filesystemwatcher objects for each task, just changing the "include sub directories" flag each time. That's stupid, … | |
Basically, I'm working on a GIF animation creator, all is going well, I just don't know how to move items. For example: I select image 1 and move it to image 0's position, and when I drop it over image 0 it will move image 1 to image 0's position. | |
I'm not sure about what I did, but........ [url]http://i33.tinypic.com/2vjr87b.png[/url] How do I get rid of those green arrows? | |
[CODE] using (var sr = new StreamReader(Misc.tempFile)) { using (var sw = new StreamWriter(Misc.path + "test.dat")) { while ((line = sr.ReadLine()) != null) { for (int i = 0; i < detailViewer.SelectedIndices.Count; i++) lineToDelete[i] = Encryption.encrypt(detailViewer.SelectedItems[i].SubItems[0].Text) + "," + Encryption.encrypt(detailViewer.SelectedItems[i].SubItems[1].Text) + "," + Encryption.encrypt(detailViewer.SelectedItems[i].SubItems[2].Text); if (line != lineToDelete[detailViewer.SelectedIndices.Count - 1] … | |
Hello, I'm having problems removing an array of lines from a text file. Heres my code: Ugh, I apologize. I can't get the conventions to correctly show on this post, I'm really sorry. [code] using (var sr = new StreamReader(Misc.tempFile)) { using (var sw = new StreamWriter(Misc.path + "test.dat")) { … | |
I'm making an application which searches all the lines of my text files in a directory, and writes the specific search match to my output box. The only problem is I need to split a string like this: [CODE]character-item = 0 996 1500000[/CODE] How it works: You search for the … | |
I've searched everywhere, I can't find any tutorials or anything on how to make a custom C# taskbar. I have no clue on how to make one, can someone please help me? Thanks for your time! | |
Do you guys think this code will function properly? [CODE] public void LoadUser(string UserName, string Password) { try { using (StreamReader sr = new StreamReader("./Users/" + UserName + ".txt")) { string Line; bool passCorrect = false; bool userCorrect = false; while ((Line = sr.ReadLine()) != null) { if (Line.Equals("UserName = … | |
I'm attempting to make a program that connects to a ip or something. So like people can connect to it also and chat and stuff. I have no clue on how to even start this, so can someone please point me in the right direction? :) Thanks for your time! … | |
Hello, I have made two textboxes and a button, you type into the second textbox and it's content gets displayed on the first texbox when you click the button, and also creates a new line so I can type as much as I want without it clearing. I want to … | |
Well, I have a main form (Form1) and a second form (Form2) which is a preference box. Anyways, I made a combobox and a button on the second form, and a button on the first form which opens up the new one. Everything works well until you try to use … | |
Do you guys know a better way to write this? [CODE] bool a = Directory.Exists("C:\\Program Files\\Java\\jdk1.6.0_1"); bool b = Directory.Exists("C:\\Program Files\\Java\\jdk1.6.0_2"); bool c = Directory.Exists("C:\\Program Files\\Java\\jdk1.6.0_3"); bool d = Directory.Exists("C:\\Program Files\\Java\\jdk1.6.0_4"); bool ee = Directory.Exists("C:\\Program Files\\Java\\jdk1.6.0_5"); bool f = Directory.Exists("C:\\Program Files\\Java\\jdk1.6.0_6"); bool g = Directory.Exists("C:\\Program Files\\Java\\jdk1.6.0_7"); bool h = Directory.Exists("C:\\Program … |
The End.