The Big Programming Thread - Page 90
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
JayDee_
548 Posts
| ||
morty
Germany38 Posts
if you got fat fingers get a keyboard with wide keys i use a cherry infinity but any keyboard will do ![]() normally my brain is way slower than my fingers ![]() if you really want to be special get a dvorak http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard but for programming the us layout is probably better ![]() Edit: If you want to speed up your Coding Process look into vim or emacs ![]() | ||
japro
172 Posts
On October 23 2011 18:22 morty wrote: lol programming is not starcraft :D lol, starcraft is not programming. I'd go for a mechanical keyboard for typing purposes way before gaming purposes... I lately got a cherry 80-3000 and am happy with it. | ||
sekritzzz
1515 Posts
Basically I downloaded microsoft visual C# express, I made my "practice" code but then when I look for the command prompt, I cant find it. Apparently its supposed to be in start->all programs-> Microsoft Visual studio, but its not there...... I've been google searching for the past 2 days and simply cant figure out how to get it. I even got the tool to be able to right click and go to VS cmd from there but it doesn't work on my notebook files, only on other folders. | ||
Kambing
United States1176 Posts
On October 24 2011 00:02 sekritzzz wrote: I've been trying to learn C# and tried to learn how to cope with microsoft visual and all the new information coming to me but I've been trying for 2 days to solve this problem with no success. Basically I downloaded microsoft visual C# express, I made my "practice" code but then when I look for the command prompt, I cant find it. Apparently its supposed to be in start->all programs-> Microsoft Visual studio, but its not there...... I've been google searching for the past 2 days and simply cant figure out how to get it. I even got the tool to be able to right click and go to VS cmd from there but it doesn't work on my notebook files, only on other folders. If I remember correctly, the command prompt batch files are not installed with C# express. Workarounds: + Install Visual C++ express or the Windows SDK which (should) contain the command prompt: http://msdn.microsoft.com/en-us/library/ms229859.aspx + Hack up a command prompt yourself. It's just a batch file that sets your environments variables to point to the toolkit. SInce you're using just C#, you just need to include the C# bin directory in your PATH. | ||
sekritzzz
1515 Posts
On October 24 2011 00:16 Kambing wrote: If I remember correctly, the command prompt batch files are not installed with C# express. Workarounds: + Install Visual C++ express or the Windows SDK which (should) contain the command prompt: http://msdn.microsoft.com/en-us/library/ms229859.aspx + Hack up a command prompt yourself. It's just a batch file that sets your environments variables to point to the toolkit. SInce you're using just C#, you just need to include the C# bin directory in your PATH. I'm rather new at this so some of what you just said is unknown territory for me =/. How do I exactly "include the C# directory in my path". Do you mean at the end of the code or? Im a bit lost. p.s. if anyone wants to recommend books for C#/C/C++ feel free to drop a few names. I'm heading to the library soon to buy a few soon. | ||
Zocat
Germany2229 Posts
On October 23 2011 04:56 OpAndroid wrote: So there is basically an array for the alphabet and an array for the input which is limited to 140 characters, and the degree to shift: alpha[26]="abcdefghijklmnopqrstuvwxyz" input[140]= whatever they input So lets say the user inputs: "hi, how are you?" and a shift of 3, then the program would take input[0], or h, find h in the alphabet array as alpha[7], apply the shift of 3 to find alpha[10], or k, and then put that value of k into an array for our output. I feel like this would work, but I'm completely unsure on how to carry this out. For instance, I don't know how to make the arrays work together in this manner, how can I have one element from one array be found in a completely different array? Is that even possible? Well, you already said that you need to find the position of an element in an array. So you need a function like "int getPositionInArray(char c)" which returns the position of character c in that array. You can also add a pointer to the array like fabiano did, or just use the array 'alpha' directly in your code, if you're not comfortable with pointers. How the function itself looks like: You just loop through the whole array and check if alpha[i] == c. If yes, return i. To find the shifted value you need to look at alpha[i+shift] (consider cases when you want to shift ie. 'z' by 3, so basically alpha[28]) Your example also has ' ' ? and , so you need to have a case when the character you search isnt in alpha. | ||
KaiserJohan
Sweden1808 Posts
On October 24 2011 00:02 sekritzzz wrote: I've been trying to learn C# and tried to learn how to cope with microsoft visual and all the new information coming to me but I've been trying for 2 days to solve this problem with no success. Basically I downloaded microsoft visual C# express, I made my "practice" code but then when I look for the command prompt, I cant find it. Apparently its supposed to be in start->all programs-> Microsoft Visual studio, but its not there...... I've been google searching for the past 2 days and simply cant figure out how to get it. I even got the tool to be able to right click and go to VS cmd from there but it doesn't work on my notebook files, only on other folders. What do you mean you look for the command prompt? Have you made a Console Application and wants to test your Console program you made? In that case just "Run"/"Debug" it in visual studio. Otherwise just locate your .exe in debug/release folders in your project directory and run them there. If you mean the actual Visual Studio Command Prompt, iirc its not much more than a glorified normal Command Prompt with the Visual Studio binaries in its PATH. If you would really need the other debugging tools from VS, you could just locate them inside the VS folder and run them from there afaik... I dont know I havnt really found a need for it tbh... :p | ||
Kambing
United States1176 Posts
| ||
sekritzzz
1515 Posts
i will try your other recommendation right away edit: i just found the import files and the debugger works there. Thank you! | ||
EvanED
United States111 Posts
On October 23 2011 10:44 JayDee_ wrote: Does anybody have any suggestions for a good programmer keyboard? Mechanical? What kinda switches? I was thinking of getting a Choc mini, Filco Tenkeyless, or Daskeyboard with either red or brown switches. Personally, my favorite keyboard is the MS Natural 4000. I like the split, and I really like the reverse tilt, (which unfortunately pretty much limits your choices to the 4000.) It may not have as good "finger feel" as mechanical keyboards, but it makes up for it and more in hand positioning. The main thing to watch out for is that it's enormous. (And don't spill water in them. I've gone through more than one of them by doing that -- even if it's just a little bit of water.) | ||
Rizell
Sweden237 Posts
There is ClassA, that class got FunctionA There is ClassB, that class got Function B Inside FunctionA a new object of type ClassB is created. I want to make sure that Inside FunctionA the classB object correctly calls functionB. Is it even possible for me to test that? Im using VB.Net and Rhino mocks.. | ||
Kambing
United States1176 Posts
On October 24 2011 03:03 EvanED wrote: Personally, my favorite keyboard is the MS Natural 4000. I like the split, and I really like the reverse tilt, (which unfortunately pretty much limits your choices to the 4000.) It may not have as good "finger feel" as mechanical keyboards, but it makes up for it and more in hand positioning. The main thing to watch out for is that it's enormous. (And don't spill water in them. I've gone through more than one of them by doing that -- even if it's just a little bit of water.) A lot of people around here swear by the kinesis advantage which is contoured like the MS natural keyboards but has mx browns inside: http://www.amazon.com/Kinesis-Advantage-USB-Keyboard-white/dp/B003T0IL3Q/ref=sr_1_3?s=electronics&ie=UTF8&qid=1319395212&sr=1-3 Pricey, but if you're looking to optimize towards programming (rather than gaming), I'd consider it. | ||
Frigo
Hungary1023 Posts
On October 24 2011 03:17 Rizell wrote: Ok, i work on a project with a rather large codebase that wasent developed using TDD. Now our team have just been starting trying to work after TDD. Im a beginner with TDD and its hard because our huge code base isent exactlly loosley coopled.. Here is my dilemma: There is ClassA, that class got FunctionA There is ClassB, that class got Function B Inside FunctionA a new object of type ClassB is created. I want to make sure that Inside FunctionA the classB object correctly calls functionB. Is it even possible for me to test that? Im using VB.Net and Rhino mocks.. Yes, it actually seems easy from the information you have provided. Refactor ClassA to separate construction of ClassB from its use with some technique (abstract factory, dependency injection, or some other way) as to loosen the coupling between ClassA and ClassB, then write a spy (mock) class that is passed to ClassA in place of ClassB, and that mimics or proxies FunctionB while checking the validity of the arguments passed to it. Also, read Clean Code by Robert C. Martin, it's extremely useful. I've heard good things about Test Driven - TDD and Acceptance TDD for Java Developers by Lasse Koskela as well, but haven't read it yet. It is next on my list though. | ||
EvanED
United States111 Posts
On October 24 2011 03:41 Kambing wrote:A lot of people around here swear by the kinesis advantage which is contoured like the MS natural keyboards but has mx browns inside: http://www.amazon.com/Kinesis-Advantage-USB-Keyboard-white/dp/B003T0IL3Q/ref=sr_1_3?s=electronics&ie=UTF8&qid=1319395212&sr=1-3 Pricey, but if you're looking to optimize towards programming (rather than gaming), I'd consider it. Kinesis has some promising stuff, but: 1. They're obscure enough it's likely that you couldn't find one to try, 2. They require relearning enough that even if you could find one to try, you'd have to borrow it for a couple weeks to see whether you liked it, and 3. They're way too expensive to "buy to try". I actually have a [url=http://www.kinesis-ergo.com/classic.htm]Kinesis classic[/ur] which looks very similar. (I actually pulled it out of the trash!) I tried using it for a short while and definitely did not go through the relearning enough to say that I gave it a fare shake, but I switched back because I wasn't impressed enough. Basically, long story short, don't rule out Kinesis, but they may or may not be for you. | ||
Necosarius
Sweden4042 Posts
![]() + Show Spoiler +
| ||
LunaSaint
United Kingdom620 Posts
Tuples can't be changed when they're made, so the method you currently use would not work with them. Also, you said that you were meant to make a list of tuples. A list of tuples would look like this: [(0,0), (0,1), (0,2)] This basically makes a table that has as many columns as there are tuples, and as many rows as there are values within the tuples. In other words, you're making a structure like this: 0|0|0 If that doesn't help, the spoiler details how it would look for a dictionary. + Show Spoiler [What a dictionary would look like as a…] + [("Apple", "A red or green fruit found on trees."), ("Banana", "A yellow, curved fruit found on trees in warmer climates."), ('Name', 'Description')] This way, you have a list of tuples containing a word and its definition.
You said you just wanted a hint, so I won't explain how you'd integrate it into a dictionary, but I hope that makes sense. -- Halp!: I'm going to be using Python with Pygame to make a basic Turn Based Strategy using a square grid system, but there's still a lot of image based functions of Pygame I don't grasp. I'm trying to work out how to import a segment of an image only - in this case, a tile from a tileset. | ||
ArcticVanguard
United States450 Posts
Could someone help me break down this (small) code please, so I may understand it better? + Show Spoiler + quine = 'quine = %r\r\nprint quine %% quine' I know what the flags do, but I'm having trouble understanding how they relate to print quine % quine. What does the % operator do when performed on two identical strings like that? | ||
IreScath
Canada521 Posts
I need to automate data copy/pasting from a CSV file to an excel file (CSV is just an excel file with no formula's, macros, etc, allowed.... its purly comma seperated and EOL seperated.) A raw csv file would look like the follwoing in a text editor (for those who dont know): name,job,date steve,sales,may 24 which would open up in excel as a 3 column and 2 row spreadsheet. now.. I generate tons of data in this format at work... all numbers. Two of the CSV files I end up with both have only 1 column (no headings) and 25 or 60 rows of data (1x25, 1x60)... with no empty rows. However when I paste this data into the master excel sheet I need to copy+paste every 4 or 5 data values (depending on if its the 25 or 60 row version) into the excel doc, as there are 2 or more lines in between each set of pasted numbers... so I cannot just copy paste teh whole thing. for example I have something like 23 43 23 43 23 34 65 67 which needs to pasted into 23 43 23 43 Set2 of run 4 23 34 65 67 so as of now I copy the forst 4 numbers, tab over, select the cell, paste, tab back, and repeat. Its super annoying and I havent been able to find something of any help.... Any ideas?.. Something that could be done with VB script in excel? | ||
fabiano
Brazil4644 Posts
if thats what you need you should code a CSV parser that identifies if the table has 25 or 60 lines and break it into five 1x5 (for the 25 lines) or fifteen 1x4 (for the 60 lines). Should be very easy to do with java, no idea about VB though. | ||
| ||