• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:26
CET 01:26
KST 09: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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband Information Request Regarding Chinese Ladder SC: Evo Complete - Ranked Ladder OPEN ALPHA
Tourneys
$5,000+ WardiTV 2025 Championship Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3 Tenacious Turtle Tussle [Alpha Pro Series] Nice vs Cure
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BW General Discussion [ASL20] Ask the mapmakers — Drop your questions Which season is the best in ASL? FlaSh's Valkyrie Copium BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET [BSL21] RO16 Group C - Saturday 21:00 CET Small VOD Thread 2.0
Strategy
Game Theory for Starcraft How to stay on top of macro? Current Meta PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread The Perfect Game Path of Exile Nintendo Switch Thread Should offensive tower rushing be viable in RTS games?
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 TL Mafia Community Thread
Community
General
Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread US Politics Mega-thread The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1315 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
Hyrule19167 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 34m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft465
elazer 197
JuggernautJason82
CosmosSc2 53
StarCraft: Brood War
Artosis 542
ZZZero.O 96
NaDa 52
Dota 2
capcasts224
League of Legends
C9.Mang0253
Counter-Strike
minikerr43
Super Smash Bros
PPMD63
Other Games
summit1g6860
tarik_tv5228
Grubby4905
FrodaN1906
shahzam694
ceh9601
Day[9].tv441
Mew2King74
ViBE62
SpeCial45
Organizations
Other Games
gamesdonequick734
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• davetesta35
• Freeedom1
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Doublelift3356
Other Games
• imaqtpie1384
• Scarra702
• Day9tv441
Upcoming Events
PiGosaur Monday
34m
PiGStarcraft465
Wardi Open
11h 34m
StarCraft2.fi
16h 34m
Replay Cast
23h 34m
The PondCast
1d 9h
OSC
1d 15h
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
1d 23h
Korean StarCraft League
3 days
CranKy Ducklings
3 days
SC Evo League
3 days
[ Show More ]
BSL 21
3 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
3 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
4 days
OSC
4 days
BSL 21
4 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
5 days
Wardi Open
5 days
StarCraft2.fi
5 days
Replay Cast
5 days
StarCraft2.fi
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
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
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
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.