• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 12:35
CEST 18:35
KST 01:35
  • 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
Code S Season 1 - RO8 Preview4[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10
Community News
Maestros of The Game 2 announcement and schedule !7Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
Maestros of The Game 2 announcement and schedule ! GSL Code S Season 1 (2026) Sea Duckling Open (Global, Bronze-Diamond) RSL Revival: Season 5 - Qualifiers and Main Event Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
Why there arent any 256x256 pro maps? Do we have a pimpest plays list? BGH Auto Balance -> http://bghmmr.eu/ (Spoiler) Asl ro8 D winner interview BW General Discussion
Tourneys
Escore Tournament StarCraft Season 2 [ASL21] Ro8 Day 4 Small VOD Thread 2.0 [BSL22] RO16 Group Stage - 02 - 10 May
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread OutLive 25 (RTS Game) Dawn of War IV
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread The Letting Off Steam Thread Canadian Politics Mega-thread Russo-Ukrainian War Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
How EEG Data Can Predict Gam…
TrAiDoS
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1533 users

The Big Programming Thread - Page 151

Forum Index > General Forum
Post a Reply
Prev 1 149 150 151 152 153 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.
billy5000
Profile Blog Joined December 2010
United States865 Posts
Last Edited: 2012-07-26 08:01:02
July 26 2012 08:00 GMT
#3001
I've been trying to prepare for this coursera course, but I've been stuck on a particular algorithm for a few hours, off and on. I tried visualizing it in my head, re-reading it, looking at the trace table provided in the book, etc. After that, I sort of got it--but not enough to implement my own, though. Then I tried making a trace table of my own with a random made-up data structure. I did this a few times, and I finally got it! I wish someone had told me about this earlier.

Well, anyway, this is more of a note to self but I thought it could be helpful to a few others. And now back to creating trace tables..
Tiger got to hunt, bird got to fly; Man got to sit and wonder, 'Why, why, why?' Tiger got to sleep, bird got to land; Man got to tell himself he understand. Vonnegut
SiPa
Profile Joined July 2010
Germany129 Posts
Last Edited: 2012-07-27 10:41:28
July 26 2012 09:36 GMT
#3002
+ Show Spoiler +
Hey, quick question:
How do i import a xls (or xlsx) (Excel) File into an 2D Array using C?

Would be happy if some1 could PM me an answer or some hints on how to find the answer; google isnt helping.

most likely solved
tofucake
Profile Blog Joined October 2009
Hyrule19210 Posts
July 26 2012 09:41 GMT
#3003
You don't really (technically). You can save the file as a CSV or TDV and then parse it.
Liquipediaasante sana squash banana
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
Last Edited: 2012-07-26 10:49:50
July 26 2012 10:49 GMT
#3004
On July 26 2012 18:36 SiPa wrote:
Hey, quick question:
How do i import a xls (or xlsx) (Excel) File into an 2D Array using C?

Would be happy if some1 could PM me an answer or some hints on how to find the answer; google isnt helping.


If you are using windows, you can use the Windows/Excel API... but honestly, you don't really want to. The windows API is complex and XLS/XLSX is a very, very complex format since it supports lots of formatting, layout, formulas and such.

Make your users submit CSV files instead (you can select CSV in Excels "Save as") and parse those.

CSV files are simple in comparision, though there are some variants in the format - comma or semicolon to seperate values, single/double/no quotation marks around values, ....

If i remember correctly, Excel by default uses this format:

"ValueA1";"ValueB1";"ValueC1"
"ValueA2";"ValueB2";"ValueC2"
...



To parse it you can also use some free library instead of writing your own parser.
As an example, google found me http://sourceforge.net/projects/libcsv/ which should do the job.
Merany
Profile Blog Joined February 2011
France890 Posts
July 26 2012 11:40 GMT
#3005
Hi guys,

Quick background about myself before I ask my question:
I did a bit of programming (C/C++, Java) during my studies but got "trapped" in SQA and testing for 2 years because of an internship (not that I hate QA by any means). I finally managed to work my way up to development just recently in my company. The team has quite a lot of money and like "shiny stuff" so they exclusively work with latest Microsoft technologies i.e. C#, .NET 4.0, WPF, they also try to implement the MVVM pattern the best they can. And I got to say, it's a bit hard now.

To get back in shape ASAP I decided to work on my own and what more motivating way to do it than creating a Starcraft app? I will try to do something similar to SC2Gears.
I quickly realized that I would need something to parse replays. I've googled a bit and found libraries but I would like to avoid anything third party if I can. Do you think it would be interesting to code one for myself just for the sake of learning?
In case yes, what approach would I need to do it? Did not find anything useful on the internet except a replay is some sort of MPQ file? To begin with, I would just need the names of the players, the map, the winner, maybe the overall apm.

Any help welcomed!
Gesh
Profile Joined November 2010
Bulgaria69 Posts
July 26 2012 12:09 GMT
#3006
To begin with, I would just need the names of the players, the map, the winner, maybe the overall apm.

The first two thing you want to do are quite simple - open up a map with a hex editor and see what their offset is. And yes, replay is sort of mpq file, considering that the first 3 bytes of it are 'MPQ'. I think using hex editor you should be able the deduce the other information as well, but you will need more replays.
memcpy
Profile Blog Joined April 2010
United States459 Posts
July 26 2012 12:15 GMT
#3007
On July 26 2012 21:09 Gesh wrote:
Show nested quote +
To begin with, I would just need the names of the players, the map, the winner, maybe the overall apm.

The first two thing you want to do are quite simple - open up a map with a hex editor and see what their offset is. And yes, replay is sort of mpq file, considering that the first 3 bytes of it are 'MPQ'. I think using hex editor you should be able the deduce the other information as well, but you will need more replays.


There's also a wiki on one of those replay viewer library sites that has all the offsets written down. Don't have the link but I remember seeing it before and it shouldn't be too hard to find.
Gesh
Profile Joined November 2010
Bulgaria69 Posts
July 26 2012 12:20 GMT
#3008
On July 26 2012 21:15 memcpy wrote:
Show nested quote +
On July 26 2012 21:09 Gesh wrote:
To begin with, I would just need the names of the players, the map, the winner, maybe the overall apm.

The first two thing you want to do are quite simple - open up a map with a hex editor and see what their offset is. And yes, replay is sort of mpq file, considering that the first 3 bytes of it are 'MPQ'. I think using hex editor you should be able the deduce the other information as well, but you will need more replays.


There's also a wiki on one of those replay viewer library sites that has all the offsets written down. Don't have the link but I remember seeing it before and it shouldn't be too hard to find.

Well, yeah, the links are listed here http://en.wikipedia.org/wiki/MPQ although the first link is broken (points to the correct place, but the wiki vomits exceptions)
crappen
Profile Joined April 2010
Norway1546 Posts
July 26 2012 12:25 GMT
#3009
Just curioius, anyone a little experienced with the Playframework 2.0 ?
tec27
Profile Blog Joined June 2004
United States3702 Posts
July 26 2012 14:03 GMT
#3010
On July 26 2012 20:40 Merany wrote:
Hi guys,

Quick background about myself before I ask my question:
I did a bit of programming (C/C++, Java) during my studies but got "trapped" in SQA and testing for 2 years because of an internship (not that I hate QA by any means). I finally managed to work my way up to development just recently in my company. The team has quite a lot of money and like "shiny stuff" so they exclusively work with latest Microsoft technologies i.e. C#, .NET 4.0, WPF, they also try to implement the MVVM pattern the best they can. And I got to say, it's a bit hard now.

To get back in shape ASAP I decided to work on my own and what more motivating way to do it than creating a Starcraft app? I will try to do something similar to SC2Gears.
I quickly realized that I would need something to parse replays. I've googled a bit and found libraries but I would like to avoid anything third party if I can. Do you think it would be interesting to code one for myself just for the sake of learning?
In case yes, what approach would I need to do it? Did not find anything useful on the internet except a replay is some sort of MPQ file? To begin with, I would just need the names of the players, the map, the winner, maybe the overall apm.

Any help welcomed!

Having one of those libraries myself, I do not recommend you approach this, unless your intent is very simple. Like, the names of the players and the map name are fairly easy, the winner is easy most of the time, but the APM will be a pain. The problem is that to actually parse game actions, you have to put in a lot of work to support all of the different action types, and they change between patches, etc. You'll find that you spend less time doing actual interesting programming, and more time collecting data to study/test with. And thats assuming that you use a premade library to extract things from the MPQ.

Anyway, if you still decide you want to approach this, this is the best documentation of the format that you will get: https://github.com/GraylinKim/sc2reader/wiki/Replay-Format-Home

You can also join #sc2reader on irc.freenode.net
Can you jam with the console cowboys in cyberspace?
berated-
Profile Blog Joined February 2007
United States1134 Posts
July 27 2012 00:03 GMT
#3011
On July 26 2012 21:25 crappen wrote:
Just curioius, anyone a little experienced with the Playframework 2.0 ?


I've only played with it for an hour or so and I've watched videos because we were thinking about using it. I've done java web app dev for 4 yrs, though, so it seemed like a nice transition into a rapid development style while still staying in java.

Back to your question though, why do you ask?
Craton
Profile Blog Joined December 2009
United States17281 Posts
Last Edited: 2012-07-27 01:37:55
July 27 2012 00:43 GMT
#3012
+ Show Spoiler [Solved] +
I have an Oracle Express server set up on a machine on my local network. I can connect to it succesfully through SQL*PLUS and SQL Developer on the local machine (localhost as the hostname).

I want to access it from another machine on the same LAN using SQL Developer. The issue is resolving the hostname (or supplying some other form of "use this machine" identification).

Can someone point me in the right direction for this? I know it should be a minor change, but I can't figure out what needs doing.

The hostname I tried to use is the name of the PC holding Oracle (and also the hostname as it's defined on the listener, which is running on the port I'm trying). Had no luck with using the IP as the hostname or using the hosts file.

Status: Failure -Test failed: IO Error: The Network Adapter could not establish the connection


Nevermind. Solved by adding an exception to Windows Firewall running on that machine. (zzzz)
twitch.tv/cratonz
SiPa
Profile Joined July 2010
Germany129 Posts
Last Edited: 2012-07-27 11:17:13
July 27 2012 10:47 GMT
#3013
+ Show Spoiler +
Another question from me:
I found this neat little sourcecode, which i compiled into a .dll.
It's in C++.
Coworker of mine told me, i can probably still use it with C; what are the restrictions?
If you got some spare time, look over this code: (i copied the part i will want to use in my Program)
pastebin
The only thing i will do with this is reading doubles from the cells and putting them into an array or vector.
Website, where I got it from.

Solved i guess
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
July 27 2012 11:11 GMT
#3014
On July 27 2012 19:47 SiPa wrote:
Another question from me:
I found this neat little sourcecode, which i compiled into a .dll.
It's in C++.
Coworker of mine told me, i can probably still use it with C; what are the restrictions?
If you got some spare time, look over this code: (i copied the part i will want to use in my Program)
pastebin
The only thing i will do with this is reading doubles from the cells and putting them into an array or vector.
Website, where I got it from.


It's pure C++ code, you can theoretically use it in C calling the class methods by their C aliases but it won't be pretty.
C++ method names are internally converted to something containing the name of the method, the type of the returned value and the types of the parameters. For example
void foo(char *bar, int baz)
could be called using something along the lines of
__vfoo_cp_i(char *bar, int baz);

However, since the code is completely object oriented, if you really want to use excel files instead of CSV I would suggest you change your project from C to C++ and use those classes as they are instead, which would be about a million times easier.
SiPa
Profile Joined July 2010
Germany129 Posts
July 27 2012 11:16 GMT
#3015
On July 27 2012 20:11 Morfildur wrote:
Show nested quote +
On July 27 2012 19:47 SiPa wrote:
Another question from me:
I found this neat little sourcecode, which i compiled into a .dll.
It's in C++.
Coworker of mine told me, i can probably still use it with C; what are the restrictions?
If you got some spare time, look over this code: (i copied the part i will want to use in my Program)
pastebin
The only thing i will do with this is reading doubles from the cells and putting them into an array or vector.
Website, where I got it from.


It's pure C++ code, you can theoretically use it in C calling the class methods by their C aliases but it won't be pretty.
C++ method names are internally converted to something containing the name of the method, the type of the returned value and the types of the parameters. For example
void foo(char *bar, int baz)
could be called using something along the lines of
__vfoo_cp_i(char *bar, int baz);

However, since the code is completely object oriented, if you really want to use excel files instead of CSV I would suggest you change your project from C to C++ and use those classes as they are instead, which would be about a million times easier.


It was for the most part only a theoretical question.
I was kinda already leaning towards c++, since I havent really gotten into C yet.
There were a few reasons for C, but if i really have to use something like
__vfoo_cp_i(char *bar, int baz);
, then I will stick to c++.
thanks alot for the quick answer!
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
July 27 2012 16:59 GMT
#3016
On July 27 2012 20:16 SiPa wrote:
It was for the most part only a theoretical question.
I was kinda already leaning towards c++, since I havent really gotten into C yet.
There were a few reasons for C, but if i really have to use something like
Show nested quote +
__vfoo_cp_i(char *bar, int baz);
, then I will stick to c++.
thanks alot for the quick answer!

I don't know what's wrong with calling that function in C. Looks fine to me.
andeh
Profile Blog Joined August 2009
United States904 Posts
July 28 2012 22:29 GMT
#3017
Hey, I need some help with how to do something.

So I want to make a web app where you are given a bunch of cards (say magic cards or whatever) and you are able to pick a few, and then based on the cards you choose, it gives back a few cards that are the best counters. I want to use a gui.

I'm just not sure on how I should do it, should I use java with swing, flash?

+ Show Spoiler +
this question makes me sound rather clueless rofl :D
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
July 28 2012 22:31 GMT
#3018
On July 29 2012 07:29 andeh wrote:
Hey, I need some help with how to do something.

So I want to make a web app where you are given a bunch of cards (say magic cards or whatever) and you are able to pick a few, and then based on the cards you choose, it gives back a few cards that are the best counters. I want to use a gui.

I'm just not sure on how I should do it, should I use java with swing, flash?

+ Show Spoiler +
this question makes me sound rather clueless rofl :D


Which programming languages do you know?

The simplest solution would be some Javascript with a PHP backend but it really depends on your existing knowledge.
andeh
Profile Blog Joined August 2009
United States904 Posts
July 28 2012 22:57 GMT
#3019
On July 29 2012 07:31 Morfildur wrote:
Show nested quote +
On July 29 2012 07:29 andeh wrote:
Hey, I need some help with how to do something.

So I want to make a web app where you are given a bunch of cards (say magic cards or whatever) and you are able to pick a few, and then based on the cards you choose, it gives back a few cards that are the best counters. I want to use a gui.

I'm just not sure on how I should do it, should I use java with swing, flash?

+ Show Spoiler +
this question makes me sound rather clueless rofl :D


Which programming languages do you know?

The simplest solution would be some Javascript with a PHP backend but it really depends on your existing knowledge.


I have good knowledge of java, ok usage of c, ok knowledge of c/c++.
tec27
Profile Blog Joined June 2004
United States3702 Posts
July 28 2012 22:58 GMT
#3020
On July 29 2012 07:29 andeh wrote:
Hey, I need some help with how to do something.

So I want to make a web app where you are given a bunch of cards (say magic cards or whatever) and you are able to pick a few, and then based on the cards you choose, it gives back a few cards that are the best counters. I want to use a gui.

I'm just not sure on how I should do it, should I use java with swing, flash?

+ Show Spoiler +
this question makes me sound rather clueless rofl :D

If you want to make a webapp I'd say your choices are between doing most stuff on the client (Javascript) or on the server (any number of server languages [php, ruby, python, c#, ...]). Flash and Java aren't really great choices for web stuff at this point, and I don't think anyone really uses them for much any more.

Personally I'd use Javascript, and if it needed a lot of data, I'd setup some sort of simple API on a server. I'd probably use JS for the server as well (but I pick JS for just about every project I do at this point, so you shouldn't listen to me on the server part ). You may find something like BackboneJS useful in organizing your application, and it would make interfacing with an API rather easy.
Can you jam with the console cowboys in cyberspace?
Prev 1 149 150 151 152 153 1032 Next
Please log in or register to reply.
Live Events Refresh
Big Brain Bouts
16:00
#115
Fjant vs Bly
Serral vs Shameless
RotterdaM396
TKL 126
IndyStarCraft 91
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Serral 4346
RotterdaM 396
TKL 126
IndyStarCraft 91
BRAT_OK 40
StarCraft: Brood War
Britney 42545
Bisu 2129
EffOrt 654
Larva 644
ggaemo 451
Stork 388
firebathero 385
Soulkey 344
ZerO 300
Rush 263
[ Show more ]
Hyuk 227
actioN 227
BeSt 216
hero 150
Killer 121
Dewaltoss 78
Hyun 73
Barracks 54
Sharp 54
Pusan 53
sorry 31
HiyA 20
soO 19
Rock 16
ajuk12(nOOB) 12
Shine 12
GoRush 11
Terrorterran 6
Dota 2
Gorgc7195
qojqva1858
monkeys_forever343
Counter-Strike
fl0m1280
byalli216
Heroes of the Storm
MindelVK10
Other Games
singsing1835
FrodaN1654
Liquid`RaSZi988
hiko785
Beastyqt669
DeMusliM352
ceh9335
KnowMe204
ArmadaUGS137
QueenE87
Mew2King72
Trikslyr43
UpATreeSC27
B2W.Neo19
ZerO(Twitch)16
fpsfer 1
Organizations
Other Games
gamesdonequick2202
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 17
• FirePhoenix3
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota255
League of Legends
• Nemesis4146
• TFBlade1167
Other Games
• Shiphtur240
Upcoming Events
OSC
5h 25m
The PiG Daily
6h 25m
Maru vs Rogue
TBD vs Classic
herO vs Solar
ByuN vs Solar
Replay Cast
7h 25m
CranKy Ducklings
17h 25m
RSL Revival
17h 25m
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
18h 25m
Krystianer vs TriGGeR
Cure vs Rogue
SC Evo League
20h 25m
uThermal 2v2 Circuit
22h 25m
BSL
1d 2h
Artosis vs TerrOr
spx vs StRyKeR
Replay Cast
1d 7h
[ Show More ]
Sparkling Tuna Cup
1d 17h
RSL Revival
1d 17h
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
1d 18h
BSL
2 days
Dewalt vs DragOn
Aether vs Jimin
GSL
2 days
Afreeca Starleague
2 days
Soma vs Leta
Wardi Open
2 days
Monday Night Weeklies
2 days
OSC
3 days
CranKy Ducklings
3 days
Afreeca Starleague
3 days
Light vs Flash
Replay Cast
4 days
Replay Cast
5 days
The PondCast
5 days
Replay Cast
6 days
RSL Revival
6 days
Liquipedia Results

Completed

Proleague 2026-05-05
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2

Upcoming

KK 2v2 League Season 1
BSL 22 Non-Korean Championship
YSL S3
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
BLAST Bounty Summer 2026: Closed Qualifier
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
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...

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.