• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 18:18
CEST 00:18
KST 07:18
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12TL.net Map Contest #22 - Voting & Ladder Map Selection7Code S Season 2 (2026) - RO8 Preview8[ASL21] Finals Preview: Two Legacies21
Community News
[TLMC] Summer 2026 Ladder Map Rotation05.0.16 patch for SC2 goes live (8 worker start)5ZeroSpace at Steam NextFest - Last free demo23Weekly Cups (June 8-14): Clem and Solar double, PTR tested0RSL: S6 Finals played at BlizzCon 202611
StarCraft 2
General
SC2 Planner - The StarCraft II Build Planner 5.0.16 patch for SC2 goes live (8 worker start) [TLMC] Summer 2026 Ladder Map Rotation StarCraft II 5.0.16 PTR Patch Notes may 26th HomeStory Cup In Early July
Tourneys
Douyu Cup 2026: $20,000 Legends Event (June 26-28) GSL CK #4 20-21th June Sparkling Tuna Cup - Weekly Open Tournament Master Swan Open (Global Bronze-Master 2) Crank Gathers Season 4: BW vs SC2 Team League
Strategy
[G] Having the right mentality to improve
Custom Maps
Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 531 Experimental Artillery Mutation # 530 One For All Mutation # 529 Opportunities Unleashed
Brood War
General
Fact based Zerg Upgrade Tier List BGH Auto Balance -> http://bghmmr.eu/ STARCRAFT MOVIE - Last Night at the Command center BW General Discussion Battle cruiser feet vs Carrier fleet
Tourneys
[Megathread] Daily Proleagues CSLAN 4 is Coming! Small VOD Thread 2.0 The Casual Games of the Week Thread
Strategy
Why doesn't anyone use restoration? Simple Questions, Simple Answers Relatively freeroll strategies Creating a full chart of Zerg builds
Other Games
General Games
Stormgate/Frost Giant Megathread ZeroSpace at Steam NextFest - Last free demo Beyond All Reason Nintendo Switch Thread Path of Exile
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread [H]Internet/Gaming Cafe Tips and Tricks The Games Industry And ATVI UK Politics Mega-thread
Fan Clubs
The HerO Fan Club! The herO Fan Club!
Media & Entertainment
Movie Discussion! [Req][Books] Good Fantasy/SciFi books [TV/BOOK] *SPOILERS* Game of Thrones Discussion
Sports
2024 - 2026 Football Thread McBoner: A hockey love story TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion Cricket [SPORT]
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Facing Challenges in Mobile App Development
TL Community
The Automated Ban List
Blogs
How To Predict Tilt in Espor…
TrAiDoS
An Exploration of th…
waywardstrategy
I'm an arrogant trash talke…
FlaShFTW
Gauntlet SC2: A Retrospectiv…
Ctone23
Why RTS gamers make better f…
gosubay
Customize Sidebar...

Website Feedback

Closed Threads



Active: 8864 users

The Big Programming Thread - Page 90

Forum Index > General Forum
Post a Reply
Prev 1 88 89 90 91 92 1032 Next
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_
Profile Joined June 2010
548 Posts
October 23 2011 01:44 GMT
#1781
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.
morty
Profile Joined July 2010
Germany38 Posts
Last Edited: 2011-10-23 09:30:37
October 23 2011 09:22 GMT
#1782
lol programming is not starcraft :D just use something that fits your hands well...
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 atleast while programming

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
Profile Joined August 2010
172 Posts
October 23 2011 09:47 GMT
#1783
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
Profile Joined December 2010
1515 Posts
October 23 2011 15:02 GMT
#1784
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.
Kambing
Profile Joined May 2010
United States1176 Posts
October 23 2011 15:16 GMT
#1785
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
Profile Joined December 2010
1515 Posts
Last Edited: 2011-10-23 15:30:33
October 23 2011 15:28 GMT
#1786
On October 24 2011 00:16 Kambing wrote:
Show nested quote +
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.

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
Profile Joined April 2010
Germany2229 Posts
Last Edited: 2011-10-23 15:34:01
October 23 2011 15:31 GMT
#1787
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
Profile Joined May 2010
Sweden1808 Posts
October 23 2011 15:43 GMT
#1788
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
England will fight to the last American
Kambing
Profile Joined May 2010
United States1176 Posts
October 23 2011 15:57 GMT
#1789
Yeah, if you aren't sure what paths are wrt a command prompt, then you should either do my first suggestion, install a non-express version of Visual Studio (which will contain the prompts), or do what Kaiser said and simply use the Visual Studio IDE to compile and run code.
sekritzzz
Profile Joined December 2010
1515 Posts
Last Edited: 2011-10-23 16:48:33
October 23 2011 16:12 GMT
#1790

i will try your other recommendation right away

edit: i just found the import files and the debugger works there. Thank you!
EvanED
Profile Joined October 2009
United States111 Posts
October 23 2011 18:03 GMT
#1791
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
Profile Joined August 2010
Sweden237 Posts
October 23 2011 18:17 GMT
#1792
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..
So poor, cant' even pay attention.
Kambing
Profile Joined May 2010
United States1176 Posts
October 23 2011 18:41 GMT
#1793
On October 24 2011 03:03 EvanED wrote:
Show nested quote +
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.)


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
Profile Joined August 2009
Hungary1023 Posts
Last Edited: 2011-10-23 21:42:33
October 23 2011 21:40 GMT
#1794
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.
http://www.fimfiction.net/user/Treasure_Chest
EvanED
Profile Joined October 2009
United States111 Posts
October 23 2011 21:41 GMT
#1795
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
Profile Blog Joined September 2009
Sweden4042 Posts
October 24 2011 23:51 GMT
#1796
Ok so I need a little help here... I'm supposed to make an interactive "dictionary" in Python with a list of tuples. I've done it with lists only but can't figure it out how to do it with tuples as well If anyone could give me just a hint it would be awesome. Here is what I've got so far:

+ Show Spoiler +


def main_dic():
word = []
description = []
while True:
print "Menu for dictionary \n 1: Insert \n 2: Look up \n 3: Exit \n"
val = raw_input("Chose option:")
if val == "1":
x = raw_input("Insert word:")
if x in word:
print "It's already in the dictionary."
else:
y = raw_input("Describe the word.")
word.append(x)
description.append(y)
elif val == "2":
z = raw_input("Search word:")
if z in word:
print "The description of", z, "is", description[word.index(z)]
else:
print "Couldn't find the word."
elif val == "3":
break

LunaSaint
Profile Blog Joined April 2011
United Kingdom620 Posts
Last Edited: 2011-10-25 16:12:16
October 25 2011 16:01 GMT
#1797
Necosarius:

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
0|1|2


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.


Apple |Banana
A red or green fruit found on trees.|A yellow, curved fruit found on trees in...


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
Profile Blog Joined August 2010
United States450 Posts
October 25 2011 16:37 GMT
#1798
@LunaSaint: Create a rect object containing the location of the tile from the sheet. This is a pretty good reference for basic PyGame usage. This also has some good reference code involving sprite sheets.

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'
print 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?
"When I became a man I put away childish things, including the fear of childishness and the desire to be very grown up." ~C.S. Lewis
IreScath
Profile Joined May 2009
Canada521 Posts
Last Edited: 2011-10-25 17:23:41
October 25 2011 17:22 GMT
#1799
So i've been working on trying to automate a lot of my repeatitive work lately at my job. I've gotten a lot automated, but I've hit a snag for teh last bit...

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?
IreScath
fabiano
Profile Blog Joined August 2009
Brazil4644 Posts
October 25 2011 18:08 GMT
#1800
so you need to break a 1x25 table into five 1x5 tables in which each one theres some label (such as "set2 of run 4")?

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.
"When the geyser died, a probe came out" - SirJolt
Prev 1 88 89 90 91 92 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 11h 43m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft788
ZombieGrub287
UpATreeSC 222
ProTech155
Railgan 106
SpeCial 97
BRAT_OK 82
StarCraft: Brood War
Shuttle 260
Leta 53
Dota 2
capcasts236
canceldota105
LuMiX1
Counter-Strike
summit1g7008
Super Smash Bros
PPMD35
Heroes of the Storm
Liquid`Hasu354
Other Games
Grubby4548
FrodaN994
shahzam642
C9.Mang0301
Trikslyr42
Organizations
Other Games
BasetradeTV183
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• Hupsaiya 103
• RyuSc2 26
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• TFBlade1002
Other Games
• Scarra1102
• imaqtpie949
• Shiphtur370
Upcoming Events
Sparkling Tuna Cup
11h 43m
The PondCast
1d 11h
Douyu Cup 2020
2 days
Oliveira vs Trap
Jieshi vs XY
soO vs FanTaSy
TY vs Coffee
OSC
2 days
Douyu Cup 2020
3 days
Neeb vs Impact
MacSed vs Cyan
Scarlett vs Kelazhur
INnoVation vs Dear
Douyu Cup 2020
4 days
Maestros of the Game
4 days
herO vs Classic
Maru vs Serral
BSL22 NKC (BSL vs China)
4 days
Douyu Cup 2020
5 days
BSL22 NKC (BSL vs China)
5 days
[ Show More ]
Online Event
5 days
RSL Revival
6 days
RSL Revival
6 days
WardiTV Weekly
6 days
Liquipedia Results
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Disclosure: This page contains affiliate marketing links that support TLnet.

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.