• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 04:18
CET 10:18
KST 18: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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3ComeBackTV's documentary on Byun's Career !11Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2
StarCraft 2
General
ComeBackTV's documentary on Byun's Career ! Team TLMC #5: Winners Announced! What's the best tug of war? The Grack before Christmas Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies
Tourneys
OSC Season 13 World Championship $5,000+ WardiTV 2025 Championship $100 Prize Pool - Winter Warp Gate Masters Showdow Sparkling Tuna Cup - Weekly Open Tournament Winter Warp Gate Amateur Showdown #1
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement
Brood War
General
BW General Discussion How soO Began His ProGaming Dreams Klaucher discontinued / in-game color settings BGH Auto Balance -> http://bghmmr.eu/ Recommended FPV games (post-KeSPA)
Tourneys
[Megathread] Daily Proleagues [BSL21] LB SemiFinals - Saturday 21:00 CET [BSL21] WB & LB Finals - Sunday 21:00 CET Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread Mechabellum Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile
Dota 2
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 Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread 12 Days of Starcraft The Games Industry And ATVI Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced Where to ask questions and add stream?
Blogs
National Diversity: A Challe…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1618 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 42m
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Larva 753
Jaedong 596
Mong 418
Stork 400
hero 160
sorry 140
Shuttle 116
Sharp 112
Sacsri 75
Pusan 60
[ Show more ]
NotJumperer 39
ToSsGirL 36
Rush 33
NaDa 23
JulyZerg 12
Terrorterran 11
eros_byul 0
Dota 2
XcaliburYe36
League of Legends
JimRising 597
C9.Mang0468
Counter-Strike
summit1g9642
minikerr64
Other Games
Happy308
mouzStarbuck293
XaKoH 156
trigger12
Organizations
Other Games
gamesdonequick881
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1534
• Jankos679
Upcoming Events
Sparkling Tuna Cup
42m
Krystianer vs Classic
TriGGeR vs SKillous
Percival vs Ryung
ByuN vs Nicoract
OSC
8h 42m
BSL 21
10h 42m
Cross vs Dewalt
Replay Cast
23h 42m
Wardi Open
1d 2h
OSC
2 days
Solar vs MaxPax
ByuN vs Krystianer
Spirit vs TBD
OSC
5 days
Korean StarCraft League
5 days
OSC
6 days
OSC
6 days
Liquipedia Results

Completed

Escore Tournament S1: W1
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL Season 21
CSL Season 19: Qualifier 2
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025

Upcoming

CSL 2025 WINTER (S19)
Escore Tournament S1: W2
Escore Tournament S1: W3
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
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 © 2025 TLnet. All Rights Reserved.