• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:29
CEST 15:29
KST 22:29
  • 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
[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18Serral wins EWC 202549
Community News
Maestros of The Game—$20k event w/ live finals in Paris23Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195Weekly Cups (Jul 28-Aug 3): herO doubles up6
StarCraft 2
General
What mix of new and old maps do you want in the next 1v1 ladder pool? (SC2) : 2v2 & SC: Evo Complete: Weekend Double Feature Geoff 'iNcontroL' Robinson has passed away The GOAT ranking of GOAT rankings RSL Revival patreon money discussion thread
Tourneys
RSL: Revival, a new crowdfunded tournament series Maestros of The Game—$20k event w/ live finals in Paris Sparkling Tuna Cup - Weekly Open Tournament Monday Nights Weeklies Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
External Content
Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below Mutation # 484 Magnetic Pull
Brood War
General
Flash On His 2010 "God" Form, Mind Games, vs JD BGH Auto Balance -> http://bghmmr.eu/ Joined effort New season has just come in ladder BW General Discussion
Tourneys
[ASL20] Ro24 Group B [ASL20] Ro24 Group C BWCL Season 63 Announcement [CSLPRO] It's CSLAN Season! - Last Chance
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Dawn of War IV Path of Exile Stormgate/Frost Giant Megathread
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread The year 2050 Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
High temperatures on bridge(s) Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment"
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
Evil Gacha Games and the…
ffswowsucks
Breaking the Meta: Non-Stand…
TrAiDoS
INDEPENDIENTE LA CTM
XenOsky
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2202 users

The Big Programming Thread - Page 342

Forum Index > General Forum
Post a Reply
Prev 1 340 341 342 343 344 1031 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
Hyrule19077 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 1031 Next
Please log in or register to reply.
Live Events Refresh
SC Evo League
12:00
S2 Championship: Ro16 Day 2
SteadfastSC86
EnkiAlexander 35
IntoTheiNu 13
IndyStarCraft 0
Liquipedia
WardiTV Summer Champion…
11:00
Playoffs Day 1
NightMare vs Zoun
Clem vs MaxPax
WardiTV943
Liquipedia
Sparkling Tuna Cup
10:00
Weekly #103
Solar vs ShoWTimELIVE!
ByuN vs TBD
CranKy Ducklings351
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Rex 143
ProTech93
BRAT_OK 87
SteadfastSC 86
IndyStarCraft 0
StarCraft: Brood War
Britney 45442
Larva 901
Killer 381
Hyun 325
Mini 286
Last 279
Hyuk 266
ggaemo 235
Pusan 234
Rush 233
[ Show more ]
firebathero 211
PianO 160
Mind 132
soO 41
Free 22
Sacsri 15
Noble 14
HiyA 11
Dota 2
Gorgc10645
qojqva1528
XcaliburYe319
Pyrionflax220
Fuzer 144
League of Legends
Dendi787
Counter-Strike
summit1g9354
olofmeister1869
Super Smash Bros
Mew2King58
Heroes of the Storm
Khaldor219
Other Games
singsing2024
B2W.Neo1177
byalli210
RotterdaM177
KnowMe58
rGuardiaN19
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Reevou 9
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2849
• WagamamaTV458
League of Legends
• Nemesis4704
• Jankos2632
Upcoming Events
Chat StarLeague
2h 31m
Razz vs Julia
StRyKeR vs ZZZero
Semih vs TBD
Replay Cast
10h 31m
Afreeca Starleague
20h 31m
Queen vs HyuN
EffOrt vs Calm
Wardi Open
21h 31m
RotterdaM Event
1d 1h
Replay Cast
1d 10h
Afreeca Starleague
1d 20h
Rush vs TBD
Jaedong vs Mong
WardiTV Summer Champion…
1d 21h
PiGosaur Monday
2 days
Afreeca Starleague
2 days
herO vs TBD
Royal vs Barracks
[ Show More ]
Replay Cast
3 days
The PondCast
3 days
WardiTV Summer Champion…
3 days
Replay Cast
4 days
LiuLi Cup
4 days
Cosmonarchy
5 days
OyAji vs Sziky
Sziky vs WolFix
WolFix vs OyAji
BSL Team Wars
5 days
Team Hawk vs Team Dewalt
BSL Team Wars
5 days
Team Hawk vs Team Bonyth
SC Evo League
5 days
[BSL 2025] Weekly
6 days
SC Evo League
6 days
Liquipedia Results

Completed

Jiahua Invitational
uThermal 2v2 Main Event
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 1
Acropolis #4 - TS1
CSLAN 3
SEL Season 2 Championship
WardiTV Summer 2025
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSL Season 18: Qualifier 2
CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
Maestros of the Game
EC S1
Sisters' Call Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
MESA Nomadic Masters Fall
Thunderpick World Champ.
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Disclosure: This page contains affiliate marketing links that support TLnet.

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.