Search Results

Search found 11 results on 1 pages for 'arcadian'.

Page 1/1 | 1 

  • Non-object-oriented game tutorials

    - by Arcadian
    I've been tasked with writing an essay extolling the virtues of object oriented programming and creating an accompanying game to demonstrate them. My initial idea is to find a tutorial for a simple game written in a programming language which does not follow the OOP paradigm (or written in an OOP language but not in an OOP way) and recreate it in an OOP way using either C# or Java (haven't yet decided). This would then allow me to make concrete comparisons between the two. The game doesn't have to be anything complex; Tetris, Pong, etc. that sort of thing. The problem I've had so far is finding a suitable tutorial, any suggestions?

    Read the article

  • [change] Vlookup onto another workbook

    - by Arcadian
    Hello, here is my dilemma. I have two worksheets one that has the name of clients and one that i want to copy the names to depending on the city. For instance: associated to each column is last name, first name and city. i have hundreds of names associated to different cities and what i would like is from worksheet1.xls to copy all the New York clients to worksheet2.xls either when i open worksheet2 or via macro what ever is easier and because last name is in one cell and the first name is in the other i would have to copy both. I saw that its possible to link cells from one worksheet to another and then do a vlookup depending on the criteria. Is that the best easiest way or is there another? thanks in advance and cheers oleg

    Read the article

  • populating a list from another worksheet with 1 criteria

    - by Arcadian
    Hello, here is my dilemma. I have two worksheets one that has the name of clients and one that i want to copy the names to depending on the city. For instance: associated to each column is last name, first name and city. i have hundreds of names associated to different cities and what i would like is from worksheet1.xls to copy all the New York clients to worksheet2.xls either when i open worksheet2 or via macro what ever is easier and because last name is in one cell and the first name is in the other i would have to copy both. I saw that its possible to link cells from one worksheet to another and then do a vlookup depending on the criteria. Is that the best easiest way or is there another? thanks in advance and cheers oleg

    Read the article

  • Custom listbox sorting

    - by Arcadian
    I need to sort the data contained within a number of listboxes. The user will be able to select between two different types of sorting using radio boxes, one of which is checked by default on form load. I have created the IF statements needed in order to test whether the checked condition is true for that radio button. but i need some help to create the custom sort algorithms. Each list with contain similar looking data, the only difference in the prefix with which each line starts. For example each line in the first listbox starts with the prefix "G30" and the second listbox will be "G31" and so on. There are 10 listboxes in total (G30-G39 in terms of prefixes). The first search algorithm has to sort the lines by the number order of the first 13 chars. Example: This is how the data looks before sorting G35:45:58:11 JG07 G35:45:20:41 JG01 G35:58:20:21 JG03 G35:66:22:20 JG05 G35:45:85:21 JG02 G35:64:56:11 JG03 G35:76:35:11 JG02 G35:77:97:12 JG03 G35:54:29:11 JG01 G35:55:51:20 JG01 G35:76:24:20 JG06 G35:76:55:11 JG01 and this is how it should look after sorting G35:45:20:41 JG01 G35:45:58:11 JG07 G35:45:85:21 JG02 G35:54:29:11 JG01 G35:55:51:20 JG01 G35:58:20:21 JG03 G35:64:56:11 JG03 G35:66:22:20 JG05 G35:76:24:20 JG06 G35:76:35:11 JG02 G35:76:55:11 JG01 G35:77:97:12 JG03 as you can see, the prefixes are the same. so it is sorted, lowest first, by the next pair integers, then the next pair and the next but not by the value after "JG". the second sort algorithm will ignore the first 13 chars and sort by order of the value after "JG", highest first. any help? theres some rep in it for you :) thanks in advance

    Read the article

  • Read text file into listbox collections

    - by Arcadian
    Hi, i'm new to C#. I need my program to show different parts of the data contained in a txt file into different listboxs (which are on different tabs of a form) so that the user can see the particular block of data they are interested in. the data contained in the txt file looks like this: G30:39:03:31 JG06 G32:56:36:10 JG04 G31:54:69:52 JG04 G36:32:53:11 JG05 G33:50:05:11 JG06 G39:28:81:21 JG01 G39:22:74:11 JG06 G39:51:44:21 JG03 G39:51:52:22 JG01 G39:51:73:21 JG01 G35:76:24:20 JG06 G35:76:55:11 JG01 G36:31:96:11 JG02 G36:31:96:23 JG02 G36:31:96:41 JG03 though much more of it :) The separate listboxes will contain only the lines who's first integer pair matches that listbox's name. For example, all the lines that start "G32" will be added to the G32 listbox. I think the code would start something like: private void ReadToBox() { FileInfo file = new FileInfo("Jumpgate List.JG"); StreamReader objRead = file.OpenText(); while (!objRead.EndOfStream) but i'm not sure where to start in terms of getting it sorted yet. Any help? There's some rep in it for you :D

    Read the article

  • Create class instance in assembly from string name

    - by Arcadian
    I'm not sure if this is possible, and I'm quite new to using assemblies in C#.NET. What I would like to do is to create an instance of a class when supplied the string name of that class. Something like this: using MyAssembly; namespace MyNameSpace { Class MyClass { int MyValue1; int MyValue2; public MyClass(string myTypeName) { foreach(Type type in MyAssembly) { if((string)type == myTypeName) { //create a new instance of the type } } AssignInitialValues(//the type created above) } //Here I use an abstract type which the type above inherits from private void AssignInitialValues(AbstractType myClass) { this.value1 = myClass.value1; this.value2 = myClass.value2; } } } Obviously you cannot compare strings to types but it illustrates what I'm trying to do: create a type from a supplied string. Any thoughts? EDIT: After attempting: var myObject = (AbstractType) Activator.CreateInstance(null, myTypeName); AssignInitialValues(myObject); I get a number of errors: Inconsistent accessibility: parameter type 'MyAssembly.AbstractType' is less accessible than method 'MyNameSpace.MyClass.AssignInitialValues(MyAssembly.AstractType)' 'MyAssembly.AstractType' is inaccessible due to it's protection level The type or namespace name 'MyAssembly' could not be found (are you missing a using directive or an assembly reference?) The type or namespace name 'AbstractType' could not be found (are you missing a using directive or an assembly reference?) Not exactly sure why it can't find the assembly; I've added a reference to the assembly and I use a Using Directive for the namespace in the assembly. As for the protection level, it's calling classes (or rather the constructors of classes) which can only be public. Any clues on where the problem is? UPDATE: After looking through several articles on SO I came across this: http://stackoverflow.com/a/1632609/360627 Making the AbstractTypeclass public solved the issue of inconsistent accessibility. The new compiler error is this: Cannot convert type 'System.Runtime.Remoting.ObjectHandle' to 'MyAssembly.AbstractType' The line it references is this one: var myObject = (AbstractType) Activator.CreateInstance(null, myTypeName); Using .Unwrap() get's me past this error and I think it's the right way to do it (uncertain). However, when running the program I then get a TypeLoadException when this code is called. TypeLoadException: Could not load type ‘AbstractType’ from assembly ‘MyNameSpace'... Right away I can spot that the type its looking for is correct but the assembly it's looking in is wrong. Looking up the Activator.CreateInstance(String, String) method revealed that the null as the first argument means that the method will look in the executing assembly. This is contrary to the required behavior as in the original post. I've tried using MyAssembly as the first argument but this produces the error: 'MyAssembly' is a 'namespace' but is used like a 'variable' Any thoughts on how to fix this?

    Read the article

  • Debug formatting code

    - by Arcadian
    I'm trying to debug my code here: private void CheckFormatting() { StringReader objReaderf = new StringReader(txtInput.Text); List<String> formatTextList = new List<String>(); do { formatTextList.Add(objReaderf.ReadLine()); } while (objReaderf.Peek() != -1); objReaderf.Close(); for (int i = 0; i < formatTextList.Count; i++) { if (!Regex.IsMatch(formatTextList[i], "G[0-9]{2}:[0-9]{2}:[0-9]{2}:[0-9]{2} JG[0-9]{2")) { MessageBox.Show("Line " + formatTextList[i] + " is not formatted correctly.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } else { this.WriteToFile(); MessageBox.Show("Your entries have been saved.", "Saved", MessageBoxButtons.OK, MessageBoxIcon.Information); } } } what it is supposed to do is to check each line in the list. if one of them isn't formatted correctly, then break the loop and display a message box, if all the lines are formatted properly then it should call the WriteToFile method. However, when testing it using input that WAS correctly formatted it displayed the error message and broke the loop. Anyone figure out why? There's some rep points in it for you :) Thanks in advance

    Read the article

  • How to check user input for correct formatting

    - by Arcadian
    This is what i've come up with so far private void CheckFormatting() { StringReader objReaderf = new StringReader(txtInput.Text); List<String> formatTextList = new List<String>(); do { formatTextList.Add(objReaderf.ReadLine()); } while (objReaderf.Peek() != -1); objReaderf.Close(); for (int i = 0; i < formatTextList.Count; i++) { } } What it is designed to do is check that the user has entered their information in this format Gxx:xx:xx:xx JGxx where "x" can be any integer. As you can see the user inputs their data into a multi-line textbox. i then take that data and enter it into a list. the next part is where i'm stuck. i create a for loop to go through the list line by line, but i guess i will also need to go through each line character by character. How do i do this? or is there a faster way of doing it? thanks in advance

    Read the article

  • Showing a hidden form

    - by Arcadian
    Newb question: how do i show a from that have been hidden using this.Hide(); I have tried MainMenuForm.Show(); and this just says i need an object ref have tried: MainMenuForm frmMainMenu = new MainMenuForm(); frmMainMenu.Show(); which seems to show the appropriate form. but when you exit the app, it is still held in memory because it hasn't shown the form that was hidden, instead it has shown a new version of the form. in effect having 2 instances of the form (one hidden, one visible). whats the correct procedure here Thanks in advance

    Read the article

  • txt file read/overwrite/append. Is this feasible? (Visual C#)

    - by Arcadian
    Hi, I'm writing a program for some data entry I have to periodically do. I have begun testing a few things that the program will have to do but i'm not sure about this part. What i need this part to do is: read a .txt file of data take the first 12 characters from each line take the first 12 characters from each line of the data that has been entered in a multi-line text box compare the two lists line by line if one of the 12 character blocks from the multi-line text box match one of the blocks in the .txt file then overwrite that entire line (only 17 characters in total) if one of the 12 character blocks from the multi-line text box DO NOT match any of the blocks in the.txt file then append that entire line to the file thats all it has to do. i'll do an example: TXT FILE: G01:78:08:32 JG05 G08:80:93:10 JG02 G28:58:29:28 JG04 MULTI-LINE TEXT BOX: G01:78:08:32 JG06 G28:58:29:28 JG03 G32:10:18:14 JG01 G32:18:50:78 JG07 RESULTING TXT FILE: G01:78:08:32 JG06 G08:80:93:10 JG02 G28:58:29:28 JG03 G32:10:18:14 JG01 G32:18:50:78 JG07 as you can see lines 1 and 3 were overwriten, line 2 was left alone as it did not match any blocks in the text box, lines 4 and 5 were appended to the file. thats all i want it to do. How do i go about this? Thanks in advance

    Read the article

1