• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:26
CEST 21:26
KST 04:26
  • 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
[ASL21] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy18ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book20
Community News
$5,000 WardiTV TLMC tournament - Presented by Monster Energy1GSL CK: More events planned pending crowdfunding0Weekly Cups (May 30-Apr 5): herO, Clem, SHIN win0[BSL22] RO32 Group Stage4Weekly Cups (March 23-29): herO takes triple6
StarCraft 2
General
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Weekly Cups (May 30-Apr 5): herO, Clem, SHIN win Rongyi Cup S3 - Preview & Info Team Liquid Map Contest #22 - Presented by Monster Energy What mix of new & old maps do you want in the next ladder pool? (SC2)
Tourneys
RSL Season 4 announced for March-April $5,000 WardiTV TLMC tournament - Presented by Monster Energy Sea Duckling Open (Global, Bronze-Diamond) GSL CK: More events planned pending crowdfunding Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
The PondCast: SC2 News & Results Mutation # 520 Moving Fees Mutation # 519 Inner Power Mutation # 518 Radiation Zone
Brood War
General
so ive been playing broodwar for a week straight. ASL21 General Discussion Pros React To: JaeDong vs Queen [BSL22] RO32 Group Stage Gypsy to Korea
Tourneys
🌍 Weekly Foreign Showmatches [Megathread] Daily Proleagues [ASL21] Ro24 Group F Escore Tournament StarCraft Season 2
Strategy
Muta micro map competition Fighting Spirit mining rates What's the deal with APM & what's its true value Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread Starcraft Tabletop Miniature Game General RTS Discussion Thread Nintendo Switch Thread Darkest Dungeon
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
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
European Politico-economics QA Mega-thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread Russo-Ukrainian War Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion Cricket [SPORT] Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Loot Boxes—Emotions, And Why…
TrAiDoS
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
ASL S21 English Commentary…
namkraft
Electronics
mantequilla
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1360 users

The Big Programming Thread - Page 342

Forum Index > General Forum
Post a Reply
Prev 1 340 341 342 343 344 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.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2013-08-13 09:21:16
August 13 2013 09:20 GMT
#6821
Alright guys. Thanks for help. I'll keep your advice in mind.
HardlyNever
Profile Blog Joined July 2011
United States1258 Posts
August 13 2013 13:49 GMT
#6822
On August 13 2013 16:46 Encdalf wrote:
Show nested quote +
On August 13 2013 01:34 HardlyNever wrote:
Anyone with a lot of experience with recaptcha? I got it to work on one of the forms I made, but I can't get it to work (it always fails, no matter what) on another form someone else made but I need to add it to. I've isolated the problem to an event handler javascript piece that for some reason always causes a fail. I'm not super familiar with javascript, especially if someone else wrote it (and this is kinda big), and was wondering if anyone has a similar problem in the past. Somewhere in here is the part that is causing the recaptcha to always fail (I'm thinking it is one of the set global variables, but I'm not sure). I believe it is some premade piece of script that a lot of people use. Warning, it is pretty big:

[...]

I can't just remove the event helper, as this particular form needs it to do what it needs to do right. I may be able to come up with a simpler solution for getting the form to work if I can't figure it out. I don't 100% need recaptcha on this form, but it would be nice as we've had a few spam bots hit it.


I'm sorry, but without any further context, I doubt anyone will be able to help you. This is a problem caused by the combination of scripts on your page, and without a live example these things are pretty hard to track down.

Or to put it into a metaphor..
You get a combustion engine to a mechanic, and tell him "I think this eingine is broken.". "Why?" the mechanic asks. "Well, I checked everything and I believe it's the engine which is broken.". The mechanic checks the engine, but unfortunately the engine is brand new and working perfectly.
The real problem was somewhere else: The car was electric.


Not really...
I know 100% that the problem is within the script. If I take that out, the recaptcha works, and if I leave it in, it doesn't. I've added/removed other things, and they don't change the outcome. And more specifically, I believe it is one of the global variables in the script that is causing the problem.

I know that is a pretty big chunk of script, but since it seems to be a premade piece of open-source and recaptcha is a pretty common thing. I thought there was an outside chance someone had run into the same problem. I know it's a long shot, but it was worth a try.
Out there, the Kid learned to fend for himself. Learned to build. Learned to break.
UdderChaos
Profile Blog Joined February 2010
United Kingdom707 Posts
Last Edited: 2013-08-13 14:13:54
August 13 2013 14:13 GMT
#6823
I know there is a lot of guides and such in the OP but it's a bit overwhelming. Basically i have an interview in a weeks time for a programming job (entry level) and i need to brush up on my c++ to a fairly good standard. Any advice on some intermediate to advanced guides/websites? stuff like multi-threading and the factory method pattern would be useful i guess? It's for an electronic engineering company, for their software development side(entry level ofc).
Nunquam iens addo vos sursum
phar
Profile Joined August 2011
United States1080 Posts
August 13 2013 15:40 GMT
#6824
What format is their interview in? Some places ask a lot of language-specific bullshit, while others will ask almost no language questions, just algorithms, data structures, design, problem solving.

Can you ask your recruiter what to expect?
Who after all is today speaking about the destruction of the Armenians?
Shikada
Profile Joined May 2012
Serbia976 Posts
August 13 2013 16:19 GMT
#6825
On August 08 2013 18:04 n0ise wrote:
Starting with Ruby on Rails, coming from java/J2EE/Spring MVC

Any quick tips/pointers or a particular piece worth reading?

Much appreciated


Guess your question was missed due to the heavy discussion going on.

At a minimum, I would recommend:
http://www.amazon.com/Ruby-Programming-Language-David-Flanagan/dp/0596516177

This is your Ruby language reference book. For Rails, get the newest version of Agile Web Development with Rails. It gets you writing a demo app in no time, and the other half of the book explains Rails nicely (though keep in mind that Rails changes and improves often).

http://www.amazon.com/Ruby-Rails-Tutorial-Addison-Wesley-Professional/dp/0321832051/ref=pd_sim_b_8
Another fine Rails book, which also has DVD video tutorials, if you're into that.

Good luck and have fun
heroyi
Profile Blog Joined March 2009
United States1064 Posts
August 13 2013 17:36 GMT
#6826
Piggy-backing on the recent posts:

I was wondering if someone could explain linked list quickly to me. I have read some of it on Google but I am quite confused with some of their explanation. Also, why is it mergesort is better than quicksort on a linked list??
wat wat in my pants
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
August 13 2013 17:53 GMT
#6827
A linked list consists of multiple list elements each linked to a next one (and often also to the previous one) through a reference. Each list element also contains a reference to data object.

Linked lists are good at adding/removing/inserting/splitting elements or sequences of elements because you only need to change a couple of next/previous references. They are bad at indexed access because you need to traverse the list.

Mergesort is good on linked lists because the algorithm just goes very naturally with linked lists. Quicksort isn't really worse either as long as you do it properly (see http://stackoverflow.com/questions/14805936/optimal-quicksort-for-single-linked-list).
If you have a good reason to disagree with the above, please tell me. Thank you.
Freaky[x]
Profile Blog Joined August 2005
Canada995 Posts
August 13 2013 18:31 GMT
#6828
I've seen people talk a lot about algorithms and software programming, does anybody here work on hardware programming (fpga and such) using vhdl?

I've been working on a project relating to the 3gpp lte, simulating coding schemes in matlab. I wanted to try and implement what I built in hardware and would like to know if people had knowledge in this field (vhdl programming).
gedatsu
Profile Joined December 2011
1286 Posts
August 13 2013 18:52 GMT
#6829
On August 14 2013 02:36 heroyi wrote:
Piggy-backing on the recent posts:

I was wondering if someone could explain linked list quickly to me. I have read some of it on Google but I am quite confused with some of their explanation. Also, why is it mergesort is better than quicksort on a linked list??

An array-list will have its elements lined up in order in the physical memory. With a linked list, every element has a pointer to where the next element is in memory, and it may be in a completely different place. This means that you can immediately find the 100th element in an array - just look 100 steps from the start of the array. With a linked list, you have no idea where the 100th element is, you need to ask the 99th element where it is (and to find the 99th, you need to ask the 98th...). So for lookups and overwrites, array is typically better. But if you want to insert an element into the middle of an array, you need to move every following element one step, and that can take a lot of time. Linked lists can do that operation very quickly.

Mergesort involves a lot of comparing two neighboring elements and switching their positions, which is easy to do with a linked list. You can do that with quicksort too, but it's easy to write a quicksort that assumes random access to elements which linked lists don't provide.
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
August 13 2013 19:05 GMT
#6830
On August 13 2013 17:19 darkness wrote:
Where do you guys read/learn which algorithm is best for your problem? For example, I've read today that MergeSort is best for linked lists, while QuickSort is best for general use and that it is more memory efficient than MergeSort. Well, I guess that's logical when you know MergeSort uses additional array.

Is it also a good idea to just use already implemented algorithms in the language you use? I've read that std::sort, Java's Collections.sort(), Linked List, etc are much more optimised than you would possibly implement them.

It just has to do with the way things are laid out in memory. You might not want to, or be able to, move the nodes of a linked list around in memory. Merge sort allows you to sort the linked lists in-place by just swapping head/tail pointers around.

Other sorting algorithms are better suited for moving around stuff that is packed together in memory within an array.

That's about it. You take note of how things are stored in memory, how they will be used in that memory, and find the fastest algorithm you can apply given the restrictions.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
Last Edited: 2013-08-13 19:17:06
August 13 2013 19:07 GMT
#6831
On August 14 2013 02:36 heroyi wrote:
Piggy-backing on the recent posts:

I was wondering if someone could explain linked list quickly to me. I have read some of it on Google but I am quite confused with some of their explanation. Also, why is it mergesort is better than quicksort on a linked list??


A linked list basically consists of a series of this:

class LinkedListNode
{
// A pointer or reference to the next node
LinkedListNodePointer Next;

// The actual content of the node
SomeType Value;

// A doubly linked list also contains a pointer to the preceding node:
LinkedListNodePointer Prev;
}



Adding an element somewhere in the middle of the linked list is as easy as creating a node with the Next pointer on the following node and changing the previously preceding node so it points to the new one.


Node1.Next -> Node2
Node2.Next -> Node3

Add new node NodeX:
Node1.Next -> NodeX
NodeX.Next -> Node2
Node2.Next -> Node3


The advantages of linked lists are:
They can be (in theory) infinitely large without having to reallocate the whole array every time you exceed the storage space of the previous arry. This makes them good at dealing with situations where you have to store an unknown amount of data. If an array exceeds it's storage space, a new, bigger storage space has to be allocated and the old data has to be copied over to the new space, which is time consuming. For the linked list, each node is in it's own memory space and seperately managed.

Insertion/Deletion at the start or in the middle is extremely fast. If you remove an array element in a classical array, you have to move all following elements a step forward which in large arrays can take a lot of time, i.e. array[2] has to be moved to array[1], array[3] to array[2], array[4] to array[3], etc.
If you insert an element in the middle, all following elements have to be moved a step back.
In linked lists adding a node in the middle of the list doesn't affect any other nodes than the directly preceding one, so you don't have to move elements around no matter what you do in the list itself, you just have to set the pointers.
In the previously discussed big-O notation that means adding/removing is O(1) since you always just have to change two pointers (or 3 in a doubly linked list), in an array it is O(N) with N being the number of elements in the array since it can happen that you have to move every single element in the array if you insert/delete right at the start.

The disadvantages of linked lists are:
Getting a specific element in the list requires going through all elements in the list, so in terms of the big-O notation, a linked list has an access time of O(N) where N is the number of elements in the linked list. An array has an access time of O(1), i.e. you get the element in a constant time no matter how big the array grows. Finding a specific element in an array of a million entries is as fast as finding it in one with 10 entries. Finding a node in a linked list of a million entries can potentially require a million comparisions until you finally find it.

Since you also store a pointer in conjunction with the actual content of the node, a linked list requires more memory than an array. This is not a big deal if each node stores a relatively high amount of data but if the content of each element is very small, e.g. only a single integer, then using a linked list can use twice as much memory as an array.
heroyi
Profile Blog Joined March 2009
United States1064 Posts
Last Edited: 2013-08-14 03:33:53
August 14 2013 02:13 GMT
#6832
easy question:
how/what comprises of the windows gui system language wise (I understand that the kernel, while holds true for other OS like OS x and linux, is written in C) but what is written for the shell?
wat wat in my pants
tofucake
Profile Blog Joined October 2009
Hyrule19200 Posts
August 14 2013 03:23 GMT
#6833
C++ does not lack GUI capabilities.
Liquipediaasante sana squash banana
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2013-08-14 05:23:20
August 14 2013 03:29 GMT
#6834
C/C++ has many library extensions/toolkits you can include in your project file, like Qt, Gtk, that allow you to create GUIs. Your understanding here is incorrect. Qt is not Java (or any) language specific. Qt uses OS specific APIs to be portable. Programming languages simply build a wrapper on top of the toolkit, which are packaged out as a library for you to add to your project file in order to "write Qt code in Java". (and then some other programming voodoo happens)


On most Unix (X Window) systems, the GUI is written in Xlib.
Windows Shell I believe is currently DirectX, which is built on top of WinAPI.

Everything is C.
There is no one like you in the universe.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2013-08-14 03:40:06
August 14 2013 03:32 GMT
#6835
Nvm, dumb question. No one does this.
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
August 14 2013 03:58 GMT
#6836
On August 14 2013 12:32 obesechicken13 wrote:
Nvm, dumb question. No one does this.


http://www.ggobi.org/rgtk2/
http://www.omegahat.org/RwxWidgets/

apparently this is the best if you want to avoid wx or gtk

http://cran.r-project.org/web/packages/gWidgets/gWidgets.pdf
There is no one like you in the universe.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
August 14 2013 04:16 GMT
#6837
On August 14 2013 12:58 Blisse wrote:
Show nested quote +
On August 14 2013 12:32 obesechicken13 wrote:
Nvm, dumb question. No one does this.


http://www.ggobi.org/rgtk2/
http://www.omegahat.org/RwxWidgets/

apparently this is the best if you want to avoid wx or gtk

http://cran.r-project.org/web/packages/gWidgets/gWidgets.pdf

Oh thanks. I missed this on my first search for R gui dev packages.
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
adwodon
Profile Blog Joined September 2010
United Kingdom592 Posts
Last Edited: 2013-08-14 08:44:41
August 14 2013 08:03 GMT
#6838
Probably not the place to ask but it's always fun to see what people know.

I've made an audio peak meter 'control', it's actually just a progress bar at the minute, I may create a custom control in future but the tricky part was actually make the damn thing work which I've now done.

Anyway I just noticed that once I've stuck it into the main app from my little test app that Visual Styles are enabled and the shiney green bar does not look as appealing as the solid blue one before, it distracts and now it does definitely look like a progress bar.
I'm a little unfamiliar with Visual Styles but is it possible to override them for individual controls? Either disabling them or removing the aero theme plus changing the colour? Would be nice if I could change the colour with no aero, then I could have a table of colours going from green->red and have it change colour dynamically, would be pretty

This is all C/C++ by the way, no .NET or anything fancy.

EDIT - Solved

Ok so straight forward enough

SetWindowTheme( hCtl, L"", L"") disables visual styles for an individual control. Passing in NULL instead of an empty string does not work by the way and was why I was a bit stumped before.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
August 14 2013 08:43 GMT
#6839
That kind of depends on the technology (for example WPF, MFC, Win32 or whatever that ancient stuff is called) you are using for your user interface, but generally I'd assume you can change styles for individual controls, yes.
If you have a good reason to disagree with the above, please tell me. Thank you.
adwodon
Profile Blog Joined September 2010
United Kingdom592 Posts
Last Edited: 2013-08-14 09:02:03
August 14 2013 09:01 GMT
#6840
On August 14 2013 17:43 spinesheath wrote:
That kind of depends on the technology (for example WPF, MFC, Win32 or whatever that ancient stuff is called) you are using for your user interface, but generally I'd assume you can change styles for individual controls, yes.


Yea its all Win32, I've not dared touch anything else, MFC looks a bit horrible. WPF looks mental but I hear if you can do it you can get some pretty swanky jobs, looks like a bitch to debug though and in my current job I've got very little excuse to learn .NET outside of writing some sample apps for our SDK.

Figured it out in the end though
Prev 1 340 341 342 343 344 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 4h 34m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 496
elazer 150
UpATreeSC 128
ProTech124
BRAT_OK 66
MindelVK 23
JuggernautJason4
StarCraft: Brood War
Calm 2098
Shuttle 464
Larva 270
ggaemo 187
hero 173
Mini 157
Rush 152
Soulkey 121
Dewaltoss 119
sorry 41
[ Show more ]
Terrorterran 14
Sexy 12
910 11
Dota 2
Gorgc6599
420jenkins293
BananaSlamJamma98
Counter-Strike
pashabiceps2121
fl0m1687
Super Smash Bros
Mew2King73
Heroes of the Storm
Liquid`Hasu387
Other Games
summit1g7187
Grubby2519
FrodaN1336
Beastyqt736
B2W.Neo612
C9.Mang0202
ArmadaUGS118
Hui .105
ZombieGrub91
Sick73
Trikslyr51
kaitlyn14
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 22 non-featured ]
StarCraft 2
• HeavenSC 23
• Adnapsc2 18
• Reevou 9
• intothetv
• IndyKCrew
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• Kozan
StarCraft: Brood War
• blackmanpl 41
• Azhi_Dahaki19
• Michael_bg 5
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• lizZardDota258
League of Legends
• Nemesis3338
Other Games
• imaqtpie1029
• Scarra357
• WagamamaTV218
• Shiphtur207
Upcoming Events
Replay Cast
4h 34m
The PondCast
14h 34m
CranKy Ducklings
1d 4h
WardiTV Team League
1d 15h
Replay Cast
2 days
CranKy Ducklings
2 days
WardiTV Team League
2 days
uThermal 2v2 Circuit
2 days
BSL
2 days
Sparkling Tuna Cup
3 days
[ Show More ]
WardiTV Team League
3 days
OSC
3 days
BSL
3 days
Replay Cast
4 days
Replay Cast
4 days
Wardi Open
4 days
GSL
5 days
Replay Cast
6 days
Kung Fu Cup
6 days
Liquipedia Results

Completed

CSL Elite League 2026
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
StarCraft2 Community Team League 2026 Spring
Nations Cup 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
BLAST Bounty Winter 2026

Upcoming

Escore Tournament S2: W2
IPSL Spring 2026
Escore Tournament S2: W3
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
RSL Revival: Season 5
WardiTV TLMC #16
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 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...

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.