• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 17:47
CEST 23:47
KST 06:47
  • 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 - The Finalists12[ASL21] Ro16 Preview Pt1: Fresh Flow9[ASL21] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy21
Community News
2026 GSL Season 1 Qualifiers11Maestros of the Game 2 announced32026 GSL Tour plans announced10Weekly Cups (April 6-12): herO doubles, "Villains" prevail1MaNa leaves Team Liquid20
StarCraft 2
General
Weekly Cups (April 6-12): herO doubles, "Villains" prevail MaNa leaves Team Liquid Oliveira Would Have Returned If EWC Continued Team Liquid Map Contest #22 - The Finalists 2026 GSL Tour plans announced
Tourneys
2026 GSL Season 1 Qualifiers Sparkling Tuna Cup - Weekly Open Tournament Master Swan Open (Global Bronze-Master 2) SEL Doubles (SC Evo Bimonthly) $5,000 WardiTV TLMC tournament - Presented by Monster Energy
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 521 Memorable Boss The PondCast: SC2 News & Results Mutation # 520 Moving Fees Mutation # 519 Inner Power
Brood War
General
BW General Discussion Pros React To: Tulbo in Ro.16 Group A ASL21 General Discussion [BSL22] RO32 Group Stage mca64Launcher - New Version with StarCraft: Remast
Tourneys
[BSL22] RO32 Group D - Sunday 21:00 CEST [BSL22] RO32 Group C - Saturday 21:00 CEST Korean KCM Race Survival 2026 Season 2 [ASL21] Ro16 Group B
Strategy
What's the deal with APM & what's its true value Any training maps people recommend? Fighting Spirit mining rates Muta micro map competition
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Battle Aces/David Kim RTS Megathread Stormgate/Frost Giant Megathread Starcraft Tabletop Miniature Game
Dota 2
The Story of Wings Gaming Official 'what is Dota anymore' discussion
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
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion Cricket [SPORT]
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Reappraising The Situation T…
TrAiDoS
lurker extra damage testi…
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2230 users

The Big Programming Thread - Page 311

Forum Index > General Forum
Post a Reply
Prev 1 309 310 311 312 313 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.
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
June 08 2013 23:20 GMT
#6201
Well FiWiFaKi I can't devote 20 hours a week but you can just IM me on Skype and ask questions whenever you like. Skype name same as TL account name.
Azerbaijan
Profile Blog Joined January 2010
United States660 Posts
June 10 2013 07:48 GMT
#6202
C question.

I have 4 structure arrays of the same type and I want to throw these 4 arrays into another array so I can loop through them in a function all at once.
This is what I have:

typedef struct
{
members;
}myType;

myType type_array1[5];
myType type_array2[5];
myType type_array3[5];
myType type_array4[5];


I know I need a 2d array and I know I can declare it like this:
myType all_arrays[4][5];


I was hoping I could do this:
all_arrays[0] = type_array1;
all_arrays[1] = type_array2;
ect


But that obviously doesn't work.
So do I need a function that will place the individual array elements into the 2d array one array at a time? Would that function take one array as an argument and would I just call it for each array? Or could this function accept all four arrays as individual arguments? If that is the case would it be easier to just make the function I originally needed take all four arrays as arguments in the same way?

I don't really know what I'm doing :/
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
June 10 2013 08:08 GMT
#6203

int i;
for ( i = 0; i < 5; i++ )
{
all_arrays[0][i] = type_array1[i];
all_arrays[1][i] = type_array2[i];
all_arrays[2][i] = type_array3[i];
all_arrays[3][i] = type_array4[i];
}


Something like that? There may be some silly C memory tricks to get it working like you have there but I would prefer not.
There is no one like you in the universe.
Nobu
Profile Joined June 2010
Spain550 Posts
Last Edited: 2013-06-10 09:53:08
June 10 2013 09:52 GMT
#6204
On June 10 2013 16:48 Azerbaijan wrote:
C question.

I have 4 structure arrays of the same type and I want to throw these 4 arrays into another array so I can loop through them in a function all at once.
This is what I have:
+ Show Spoiler +

typedef struct
{
members;
}myType;

myType type_array1[5];
myType type_array2[5];
myType type_array3[5];
myType type_array4[5];


I know I need a 2d array and I know I can declare it like this:
myType all_arrays[4][5];


I was hoping I could do this:
all_arrays[0] = type_array1;
all_arrays[1] = type_array2;
ect


But that obviously doesn't work.
So do I need a function that will place the individual array elements into the 2d array one array at a time? Would that function take one array as an argument and would I just call it for each array? Or could this function accept all four arrays as individual arguments? If that is the case would it be easier to just make the function I originally needed take all four arrays as arguments in the same way?

I don't really know what I'm doing :/


Not really experienced in C and it's been a while but, can't you do something like this?


myType* all_arrays[4];
all_arrays[0]=type_array1; all_arrays[1]=type_array2; all_arrays[2]=type_array3;
all_arrays[3]=type_array4;


Or you want to avoid pointers?
"There's farmers and there's gamers, farmers get up early, gamers sleep in." Artosis
nepeta
Profile Blog Joined May 2008
1872 Posts
June 10 2013 12:00 GMT
#6205
On June 09 2013 06:03 nepeta wrote:
Show nested quote +
On June 05 2013 22:27 nepeta wrote:
Thanks Yoshi- &Encdalf &Blisse

Will have a look at your magic this evening.


Sorry for the wait, only got around to it just now, and I'm sorry to inform everyone that I couldn't get it to work Thanks for all the input, really appreciated, it's probably just me.

Also got troubles with borders again, at least 'again' didn't pop up until I put more content on a page than one screen could hold. I officially suck at webdesign ^^

Going to rewrite once more. I cannot be that stupid that I can't get a bloody basic web page to work ^^


In case anyone is curious: I did it! It's a bloody awful hack with backgrounds and ungodly positioning with paddings and margins, but it is functional and I have decided to be content with that. Criticism always welcome of course

http://nepeta.host56.com/index2.php


Many thanks everyone!
Broodwar AI :) http://sscaitournament.com http://www.starcraftai.com/wiki/Main_Page
Azerbaijan
Profile Blog Joined January 2010
United States660 Posts
Last Edited: 2013-06-10 17:28:09
June 10 2013 16:43 GMT
#6206
On June 10 2013 17:08 Blisse wrote:

int i;
for ( i = 0; i < 5; i++ )
{
all_arrays[0][i] = type_array1[i];
all_arrays[1][i] = type_array2[i];
all_arrays[2][i] = type_array3[i];
all_arrays[3][i] = type_array4[i];
}


Something like that? There may be some silly C memory tricks to get it working like you have there but I would prefer not.


That makes a ton of sense but the type_arrays are not all the same size in the actual code so I don't think it would work.

On June 10 2013 18:52 Nobu wrote:
Not really experienced in C and it's been a while but, can't you do something like this?


myType* all_arrays[4];
all_arrays[0]=type_array1; all_arrays[1]=type_array2; all_arrays[2]=type_array3;
all_arrays[3]=type_array4;


Or you want to avoid pointers?

I'm still figuring pointers out. I will try this and if it works ill try to figure out why
EDIT: Didn't work :/
teumas
Profile Joined July 2010
Sweden280 Posts
June 10 2013 19:50 GMT
#6207
On June 11 2013 01:43 Azerbaijan wrote:
Show nested quote +
On June 10 2013 18:52 Nobu wrote:
Not really experienced in C and it's been a while but, can't you do something like this?


myType* all_arrays[4];
all_arrays[0]=type_array1; all_arrays[1]=type_array2; all_arrays[2]=type_array3;
all_arrays[3]=type_array4;


Or you want to avoid pointers?

I'm still figuring pointers out. I will try this and if it works ill try to figure out why
EDIT: Didn't work :/


The code by Nobu should work, afterwards you can access the structs like this: all_arrays[0][2].
Just keep in mind that since you now only have a pointer to each of the starting elements of the separate arrays, you have to remember how many elements each contains.
Azerbaijan
Profile Blog Joined January 2010
United States660 Posts
June 10 2013 20:08 GMT
#6208
Yeah it does work now. I had a syntax error ><. C is hard
Thanks everyone
WindWolf
Profile Blog Joined July 2012
Sweden11767 Posts
June 11 2013 16:28 GMT
#6209
I have a question about UUID's (Universally Unique Identifiers).

Is there any advantages of randomizing out values instead of start from 0 and count upwards (Which is what I planned in my C++ project before I discovered that Boost had an UUID library)?
EZ4ENCE
phar
Profile Joined August 2011
United States1080 Posts
June 12 2013 04:58 GMT
#6210
That depends entirely on the context. If you have no centralized way of enforcing uniqueness of the ids for whatever you're using, then properly random uuids can be useful. If you do have a centralized way of enforcing uniqueness, then counting upwards is totally fine (you'd typically call this a sequence in the context of a database).

What are you using it for?
Who after all is today speaking about the destruction of the Armenians?
Craton
Profile Blog Joined December 2009
United States17281 Posts
June 12 2013 05:04 GMT
#6211
Don't mistake database sequences for ordering. In Oracle, and probably in SQL Server, sequences only guarantee uniqueness and nothing else.
twitch.tv/cratonz
pyro19
Profile Joined August 2010
6575 Posts
June 12 2013 05:15 GMT
#6212
What are the Required languages that I should know for Database management and creation if working on .net platform.
I'm currently learning C# , SQL and ADO.net...Is there anything more I could be learning?
Thy Shall Die Alone...or emm..something like that.
Craton
Profile Blog Joined December 2009
United States17281 Posts
Last Edited: 2013-06-12 05:21:23
June 12 2013 05:18 GMT
#6213
Database management and .NET are more or less separate things. ADO.NET basically provides the facilities for connecting to and interacting with databases, but there really isn't much/any database management involved.

Database creation and management is usually done by DBAs, which in a sufficiently large organization would never even see code that's accessing it. Certainly the DBAs at my work have never seen any of the code we've written.

If you just want .NET things that touch databases then you can add ASP.NET and VB.NET.
twitch.tv/cratonz
pyro19
Profile Joined August 2010
6575 Posts
June 12 2013 05:34 GMT
#6214
On June 12 2013 14:18 Craton wrote:
Database management and .NET are more or less separate things. ADO.NET basically provides the facilities for connecting to and interacting with databases, but there really isn't much/any database management involved.

Database creation and management is usually done by DBAs, which in a sufficiently large organization would never even see code that's accessing it. Certainly the DBAs at my work have never seen any of the code we've written.

If you just want .NET things that touch databases then you can add ASP.NET and VB.NET.


Thanks for the answer.
And yeah I do know they are kinda separate stuff..I'm actually learning to build a website and Building databases and connecting them. Stuff I already know right now
HTML
ASP
VBScript
C
Javascript
Java (not too much tho)

Guess I'm trying to learn a bit about every aspect of web development and stuff while being a master at None
I'm so confused with my Life @_@
Thy Shall Die Alone...or emm..something like that.
phar
Profile Joined August 2011
United States1080 Posts
June 12 2013 05:41 GMT
#6215
On June 12 2013 14:04 Craton wrote:
Don't mistake database sequences for ordering. In Oracle, and probably in SQL Server, sequences only guarantee uniqueness and nothing else.

Yea I don't think anyone is concerned with ordering here. We can't be sure because don't know what the guy's actual use case is, but he didn't mention ordering.
Who after all is today speaking about the destruction of the Armenians?
WindWolf
Profile Blog Joined July 2012
Sweden11767 Posts
Last Edited: 2013-06-12 05:51:11
June 12 2013 05:50 GMT
#6216
On June 12 2013 13:58 phar wrote:
That depends entirely on the context. If you have no centralized way of enforcing uniqueness of the ids for whatever you're using, then properly random uuids can be useful. If you do have a centralized way of enforcing uniqueness, then counting upwards is totally fine (you'd typically call this a sequence in the context of a database).

What are you using it for?

As a summer project, I'm writing a tower defense game in C++. And since I planned to use features from Boost anyway and saw that it had an UUID library, so I thought why not use it since I'm planning on adding effects that requires some kind of UUID.


But since the main purpose of the project is to learn how to make a tower defense game (programmer art all the way), it is not the end of the world if the UUID's isn't 100% unique all the time. I'm currently using boost::uuids:: random_generator()() as my mean of generating UUID's. Should that be sufficient for my game?
EZ4ENCE
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2013-06-12 05:56:25
June 12 2013 05:55 GMT
#6217
Yes. Assuming boost's random generator doesn't use a really bad default seed, you should be totally fine. And from a 5 sec google search looking at the boost docs, it appears as though the seed on the default constructor is just fine:

(From http://www.boost.org/doc/libs/1_46_1/libs/uuid/uuid.html#Random Generator)
Design notes

The document, http://www.itu.int/ITU-T/studygroups/com17/oid/X.667-E.pdf, was used to design and implement the boost::uuids::uuid struct.

The boost::uuids::basic_random_generator class' default constructor seeds the random number generator with a SHA-1 hash of a number of different values including std::time(0), std::clock(), uninitialized data, value return from new unsigned int, etc..


Using libraries is often a good choice
Who after all is today speaking about the destruction of the Armenians?
Tobberoth
Profile Joined August 2010
Sweden6375 Posts
June 12 2013 06:59 GMT
#6218
On June 12 2013 14:15 pyro19 wrote:
What are the Required languages that I should know for Database management and creation if working on .net platform.
I'm currently learning C# , SQL and ADO.net...Is there anything more I could be learning?

Don't really understand what you mean here. I mean, for just database management, SQL will be more than enough assuming you'll be working with an SQL database. ADO.NET is just the part of ASP.NET handling databases, it's not really something you study by itself, more like learning how to use databases with ASP.NET, in which case LINQ to SQL, Entity Framework etc might be more interesting than "ADO.NET" so to speak. And if you know Linq to SQL or such ways to work with the database, there's really nothing in C# outside of that which concerns databases. ADO.NET is just the backbone of the ways you interact with databases from the .NET framework.

I guess what I'm saying is that it's really all up to learning SQL, then learning how to best work with databases from the language at hand. Since you seem to work a lot with C#/ASP.NET, I would definitely recommend Linq to SQL (Entity Framework is "better", but it's more complex so unless you're doing bigger projects, I would think staying with Linq to SQL is nicer, they are similar enough to learn the other later).
WindWolf
Profile Blog Joined July 2012
Sweden11767 Posts
June 12 2013 15:19 GMT
#6219
On June 12 2013 14:55 phar wrote:
Using libraries is often a good choice

Indeed, that why I'll be using lots of Boost-code on the back-end side of things
EZ4ENCE
Wobulator
Profile Joined January 2012
United States15 Posts
June 12 2013 15:24 GMT
#6220
Dear all;
I’ve been creating a chess AI. I’ve already created earlier versions, so I’m familiar with the programming required, but I have some specific questions about coding. The GUI is written in c#, which calls c++ DLLs to do the real thinking. Both are written by me in visual studio 2010 Express.
1) My board representations make heavy use of bitwise operators. Are these optimized and fast in a managed language? (Specifically Visual c++)
2) How does one debug a DLL? I saw something about attaching a debugger to the DLL. I’m not quite sure how this would work, and the internet says this can’t be done in Express edition anyways.

Because I'm not a computer scientist/engineer and just program for fun, I've always used the easiest programming tools, so I sometimes end up learning things backwards.
Thanks for the help.
The plural of anecdote is not data
Prev 1 309 310 311 312 313 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 2h 13m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech137
CosmosSc2 36
StarCraft: Brood War
Britney 15551
Calm 2626
ggaemo 224
firebathero 126
Dewaltoss 118
SilentControl 11
Dota 2
ODPixel157
capcasts93
League of Legends
Reynor108
Counter-Strike
byalli380
Super Smash Bros
PPMD61
Heroes of the Storm
Liquid`Hasu373
Other Games
summit1g11671
tarik_tv4661
FrodaN715
shahzam403
C9.Mang0222
ArmadaUGS119
ZombieGrub57
QueenE43
Trikslyr37
ViBE4
Organizations
Other Games
BasetradeTV570
Counter-Strike
PGL97
StarCraft 2
angryscii 85
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 22 non-featured ]
StarCraft 2
• davetesta40
• musti20045 29
• RyuSc2 13
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• Kozan
• IndyKCrew
StarCraft: Brood War
• HerbMon 31
• Azhi_Dahaki25
• RayReign 16
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21224
• WagamamaTV503
League of Legends
• Doublelift3427
Other Games
• imaqtpie1458
• Scarra782
• Shiphtur150
Upcoming Events
Replay Cast
2h 13m
Escore
12h 13m
WardiTV Map Contest Tou…
13h 13m
OSC
17h 13m
Big Brain Bouts
18h 13m
MaNa vs goblin
Scarlett vs Spirit
Serral vs herO
Korean StarCraft League
1d 5h
CranKy Ducklings
1d 12h
WardiTV Map Contest Tou…
1d 13h
IPSL
1d 18h
WolFix vs nOmaD
dxtr13 vs Razz
BSL
1d 21h
UltrA vs KwarK
Gosudark vs cavapoo
dxtr13 vs HBO
Doodle vs Razz
[ Show More ]
CranKy Ducklings
2 days
Sparkling Tuna Cup
2 days
WardiTV Map Contest Tou…
2 days
Ladder Legends
2 days
BSL
2 days
StRyKeR vs rasowy
Artosis vs Aether
JDConan vs OyAji
Hawk vs izu
IPSL
2 days
JDConan vs TBD
Aegong vs rasowy
Replay Cast
3 days
Wardi Open
3 days
Afreeca Starleague
3 days
Bisu vs Ample
Jaedong vs Flash
Monday Night Weeklies
3 days
RSL Revival
4 days
Afreeca Starleague
4 days
Barracks vs Leta
Royal vs Light
WardiTV Map Contest Tou…
4 days
RSL Revival
5 days
Replay Cast
6 days
The PondCast
6 days
WardiTV Map Contest Tou…
6 days
Liquipedia Results

Completed

Proleague 2026-04-15
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
StarCraft2 Community Team League 2026 Spring
WardiTV TLMC #16
Nations Cup 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
PGL Cluj-Napoca 2026
IEM Kraków 2026

Upcoming

Escore Tournament S2: W3
Escore Tournament S2: W4
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
2026 GSL S2
RSL Revival: Season 5
2026 GSL S1
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
BLAST Rivals Spring 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.