• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 11:53
CEST 17:53
KST 00:53
  • 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
Serral wins HomeStory Cup 298Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
[IPSL] Spring 2026 Grand Finals - This Weekend!0Weekly Cups (July 6 - 12): Protoss strike back3BSL Season 22 Full Overview & Conclusion7BSL Season 22 Full Overview & Conclusion7Weekly Cups (June 29-July 5): Solar Doubles0
StarCraft 2
General
Weekly Cups (July 6 - 12): Protoss strike back Is the larve respawn broken? Serral wins HomeStory Cup 29 Serral wins Maestros of the Game 2 Reynor: GSL Loss Wasn't About Preparation Format
Tourneys
GSL CK #5 Race War WardiTV Summer Cup 2026 RSL Revival: Season 6 - Qualifiers and Main Event HomeStory Cup 29 Vespene Cup #1 — $300+ USD, July 10
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together Mutation # 532 Nuclear Family
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ screpdb: new Starcraft reporting tool Pros Debate: Zerg Unfairly Nerfed? (ASL S22 map) ASL 22 Proposed Map Pool ASL22 General Discussion
Tourneys
[Megathread] Daily Proleagues [IPSL] Spring 2026 Grand Finals - This Weekend! [ASL22] Wildcard Qualifier IPSL Spring 2026 Top 4!
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies
Other Games
General Games
General RTS Discussion Thread Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile Summer Games Done Quick 2026!
Dota 2
Looking for a Dota Mentor 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
TL Mafia
NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread TL Mafia Power Rank Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread UK Politics Mega-thread YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books Movie Discussion! Anime Discussion Thread Series you have seen recently...
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Tennis[sport] Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Simple Questions Simple Answers FPS when play League Of Legend on laptop How to clean a TTe Thermaltake keyboard?
TL Community
The Automated Ban List
Blogs
The Experiences We Want and …
TrAiDoS
An Exploration of th…
waywardstrategy
Gauntlet SC2: A Retrospectiv…
Ctone23
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Evil Gacha Games and the…
ffswowsucks
Customize Sidebar...

Website Feedback

Closed Threads



Active: 8324 users

The Big Programming Thread - Page 331

Forum Index > General Forum
Post a Reply
Prev 1 329 330 331 332 333 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.
tec27
Profile Blog Joined June 2004
United States3702 Posts
July 26 2013 04:43 GMT
#6601
On July 26 2013 00:43 supereddie wrote:
For those PHP people that just posted: please use parameterized queries. It pains me to see those select statements...

Yeah, I get very tired of mentioning this every time. I don't even use PHP and I know that the mysql_ shit is deprecated and horrible to use, yet every single person in here basically uses it. If you're reading a book or a tutorial that recommends you use it, or recommends you do anything other than parameterized queries, throw it out and find a new resource.
Can you jam with the console cowboys in cyberspace?
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2013-07-26 13:50:10
July 26 2013 13:48 GMT
#6602
Is it a good idea to use a Java GUI builder? I've done a simple google check, and it seems Eclipse and some other CASE tools offer this, but how good is the generated code from them? I've only dealt once with Java GUI, and I wrote everything by hand which doesn't bring good memories, so I'm curious if it's better to use a builder this time.
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
July 26 2013 19:23 GMT
#6603
Is there a codecademy-style website for C? I just want it to learn the syntax, as I find doing codecademy stuff much more fun than just reading the syntax.
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
fabiano
Profile Blog Joined August 2009
Brazil4644 Posts
Last Edited: 2013-07-26 22:58:21
July 26 2013 19:37 GMT
#6604
On July 26 2013 22:48 darkness wrote:
Is it a good idea to use a Java GUI builder? I've done a simple google check, and it seems Eclipse and some other CASE tools offer this, but how good is the generated code from them? I've only dealt once with Java GUI, and I wrote everything by hand which doesn't bring good memories, so I'm curious if it's better to use a builder this time.


Depends on the project.

If you are a student and are doing things with the purpose of learning + the GUI is not complex, use Notepad++ and javac.

If you are working on a professional project or a project with a relatively complex GUI, then use a GUI builder. Netbeans is alright, I never used any other though, so can't comment which GUI builder is better.

Also, may come handy if you end up hating the default Layout Managers: MiG Layout.

edit: awful grammar mistake
"When the geyser died, a probe came out" - SirJolt
Millitron
Profile Blog Joined August 2010
United States2611 Posts
July 26 2013 21:19 GMT
#6605
Speaking of GUI builders, does anyone else love Visual Studio 2010's GUI builder?
Who called in the fleet?
sob3k
Profile Blog Joined August 2009
United States7572 Posts
July 28 2013 04:07 GMT
#6606
Hey, I'm still working on learning some basic HTML and CSS. I've gotten proficient enough to whip up some site frames from scratch but I have a few issues I'd like to ask about.

Here is what a basic frame looks like:

[image loading]

Question 1

I want the light blue body to always extend to the bottom of the page, but then also extend more as needed if the text goes farther. How is this done?

Question 2

I want the navbar buttons to all be an equal set width instead of just the length of the button name. I've looked this up and tried setting the list item width and it doesn't have any effect, so I'm confused. Right now I'm equalizing their widths by tacking on invisible characters to the end of the names...lol
In Hungry Hungry Hippos there are no such constraints—one can constantly attempt to collect marbles with one’s hippo, limited only by one’s hippo-levering capabilities.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
July 28 2013 04:18 GMT
#6607
On July 28 2013 13:07 sob3k wrote:
Question 1

I want the light blue body to always extend to the bottom of the page, but then also extend more as needed if the text goes farther. How is this done?


If I recall correctly...


html, body {
height: 100%;
}


And then you want to have a <div></div> around your light blue body content with a height: 100%; as well.


On July 28 2013 13:07 sob3k wrote:
Question 2

I want the navbar buttons to all be an equal set width instead of just the length of the button name. I've looked this up and tried setting the list item width and it doesn't have any effect, so I'm confused. Right now I'm equalizing their widths by tacking on invisible characters to the end of the names...lol



Your list elements should have a
display: block;
style applied to them, then you set the widths all to the same size.



What's your knowledge of HTML/CSS? This is quite a bother if you're not using a lot of CSS styles, divs, and good boilerplate. Google 'CSS boilerplates' to take a look.
There is no one like you in the universe.
sob3k
Profile Blog Joined August 2009
United States7572 Posts
July 28 2013 04:46 GMT
#6608
Thanks a ton. I'm obviously still learning but I'm confident in my ability to build basic sites from the ground up now that aren't a total mess. I'm actually more interested in learning everything from the ground up, so while I have and will continue to check out boilerplates and forms for ideas, I like to do it myself to make sure I understand whats going on. From my current learning experience everything seems quite doable so far, although many teaching resources are far from intuitive.
In Hungry Hungry Hippos there are no such constraints—one can constantly attempt to collect marbles with one’s hippo, limited only by one’s hippo-levering capabilities.
HardlyNever
Profile Blog Joined July 2011
United States1258 Posts
Last Edited: 2013-07-28 04:55:11
July 28 2013 04:52 GMT
#6609
Make the buttons a class, then name them that class. So for the CSS:



.button{
width:100px; (or whatever)
height; 100px;
}



Then name those buttons that class in the html.

Also, while learning (and setting up the layout) it is fine to do in-line css, it is standard and good practice to have all those css rules put onto an external stylesheet (or multiple stylesheets) and referenced.

Edit: Also Comic Sans
Out there, the Kid learned to fend for himself. Learned to build. Learned to break.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
July 28 2013 05:02 GMT
#6610
On July 28 2013 13:46 sob3k wrote:
Thanks a ton. I'm obviously still learning but I'm confident in my ability to build basic sites from the ground up now that aren't a total mess. I'm actually more interested in learning everything from the ground up, so while I have and will continue to check out boilerplates and forms for ideas, I like to do it myself to make sure I understand whats going on. From my current learning experience everything seems quite doable so far, although many teaching resources are far from intuitive.


Yeah, the main problem is really like, we're not sure where you stand in terms of how your code is laid out, so it's difficult to describe the concepts to you if we're not sure exactly how to explain a solution. However, good luck with learning HTML from scratch.
There is no one like you in the universe.
sob3k
Profile Blog Joined August 2009
United States7572 Posts
Last Edited: 2013-07-28 05:13:14
July 28 2013 05:09 GMT
#6611
yes this is all external

I still can't get the buttons to work though, they wont change in width no matter what I do. Currently they are styled links <a> inside <li> tags. The" Navitem" class has some fancy shmancy shit so they depress on mouseover and look buttony.

[image loading]

I've tried setting the widths from <a>, <li>, or even the <ul>, and I can't make it change at all.

also that aint Comic Sans bro. Patrick Hand SC (obviously it wouldn't be on everything in a real finished product)
In Hungry Hungry Hippos there are no such constraints—one can constantly attempt to collect marbles with one’s hippo, limited only by one’s hippo-levering capabilities.
HardlyNever
Profile Blog Joined July 2011
United States1258 Posts
July 28 2013 05:19 GMT
#6612
I wouldn't make the buttons with a list, but that is me. I'd just make each one a separate div, nested in the navbar div. But if you're set on it, you should be able to control the size. I would make the <li> the class, not the anchors. Did you set the li to block level?
Out there, the Kid learned to fend for himself. Learned to build. Learned to break.
sob3k
Profile Blog Joined August 2009
United States7572 Posts
July 28 2013 05:32 GMT
#6613
On July 28 2013 14:19 HardlyNever wrote:
I wouldn't make the buttons with a list, but that is me. I'd just make each one a separate div, nested in the navbar div. But if you're set on it, you should be able to control the size. I would make the <li> the class, not the anchors. Did you set the li to block level?


alright, if I set use the li as the button and block them it equalizes the width. Of course it broke all my hover styling and shit but whatever, in the future I'll do that. This was just a practice page.
In Hungry Hungry Hippos there are no such constraints—one can constantly attempt to collect marbles with one’s hippo, limited only by one’s hippo-levering capabilities.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
July 28 2013 05:41 GMT
#6614
On July 28 2013 14:32 sob3k wrote:
Show nested quote +
On July 28 2013 14:19 HardlyNever wrote:
I wouldn't make the buttons with a list, but that is me. I'd just make each one a separate div, nested in the navbar div. But if you're set on it, you should be able to control the size. I would make the <li> the class, not the anchors. Did you set the li to block level?


alright, if I set use the li as the button and block them it equalizes the width. Of course it broke all my hover styling and shit but whatever, in the future I'll do that. This was just a practice page.


Yeah that's basically how changes in CSS work. Change one thing break everything. :'D
There is no one like you in the universe.
teamamerica
Profile Blog Joined July 2010
United States958 Posts
Last Edited: 2013-07-28 07:37:41
July 28 2013 07:21 GMT
#6615
Hey guys, was wondering if my code to solve fibonacci sequences with useMap set to true would qualify as dynamic programming.

Code is at https://gist.github.com/anonymous/d23efa6ad0c662c9d261

It was taking more then 10 sec for fib(100) to return so I was trying to speed it up a bit. If anyone has any other tips, I'd also appreciate it.

Also, is there any solution to how fast I get a long overflow?

edit:
Some other questions I had are
-would the runtime of calling fib with useMap set to false be O(n!)
-would the runtime with useMap set to true be O(n)

-storing the results in a map takes up more memory then not storing it. is there ever a case where the memory costs of memoring the results are offset by saved stack space of less method calls? Sorry if this is a super dumb question! I'd appreciate any tips about how to think about it.
RIP GOMTV. RIP PROLEAGUE.
tec27
Profile Blog Joined June 2004
United States3702 Posts
July 28 2013 07:29 GMT
#6616
Yes, that's basic memoization, so it qualifies.

I assume you're asking about a stack overflow, not a long overflow, and if so, the solution is to not use recursion. Java has no tail-call optimization so there's not really any other way to avoid stack overflows with any sort of long recursion. With your algorithm as written, you could also avoid it by finding smaller fibonacci values first before attempting to find a large one, but its better to avoid the recursion.
Can you jam with the console cowboys in cyberspace?
teamamerica
Profile Blog Joined July 2010
United States958 Posts
July 28 2013 07:39 GMT
#6617
On July 28 2013 16:29 tec27 wrote:
Yes, that's basic memoization, so it qualifies.

I assume you're asking about a stack overflow, not a long overflow, and if so, the solution is to not use recursion. Java has no tail-call optimization so there's not really any other way to avoid stack overflows with any sort of long recursion. With your algorithm as written, you could also avoid it by finding smaller fibonacci values first before attempting to find a large one, but its better to avoid the recursion.


I had actually meant long overflow as in the result overflowing at something like fib(100). Because I looked up the first 1000 and they have huge results, but my attempt to calculate anything too large quickly overflowed.
RIP GOMTV. RIP PROLEAGUE.
Pawsom
Profile Blog Joined February 2009
United States928 Posts
Last Edited: 2013-07-28 07:42:50
July 28 2013 07:41 GMT
#6618
On July 28 2013 16:21 teamamerica wrote:
Hey guys, was wondering if my code to solve fibonacci sequences with useMap set to true would qualify as dynamic programming.

Code is at https://gist.github.com/anonymous/d23efa6ad0c662c9d261

It was taking more then 10 sec for fib(100) to return so I was trying to speed it up a bit. If anyone has any other tips, I'd also appreciate it.

I don't really know Java but I think your code is fine. Dynamic programming involves storing previous results in memory so you don't have to calculate them everytime. This is what you're doing with your dictionary lookup.


On July 28 2013 16:21 teamamerica wrote:
Also, is there any solution to how fast I get a long overflow?


Big number libraries, possibly long long(platform dependent), or even using an unsigned integer will increase your range.





tec27
Profile Blog Joined June 2004
United States3702 Posts
July 28 2013 07:51 GMT
#6619
On July 28 2013 16:39 teamamerica wrote:
Show nested quote +
On July 28 2013 16:29 tec27 wrote:
Yes, that's basic memoization, so it qualifies.

I assume you're asking about a stack overflow, not a long overflow, and if so, the solution is to not use recursion. Java has no tail-call optimization so there's not really any other way to avoid stack overflows with any sort of long recursion. With your algorithm as written, you could also avoid it by finding smaller fibonacci values first before attempting to find a large one, but its better to avoid the recursion.


I had actually meant long overflow as in the result overflowing at something like fib(100). Because I looked up the first 1000 and they have huge results, but my attempt to calculate anything too large quickly overflowed.

Ah, then as Pawsom said, use something like BigInteger
Can you jam with the console cowboys in cyberspace?
Yoshi-
Profile Joined October 2008
Germany10227 Posts
Last Edited: 2013-07-28 08:05:53
July 28 2013 08:05 GMT
#6620
On July 28 2013 13:07 sob3k wrote:
Hey, I'm still working on learning some basic HTML and CSS. I've gotten proficient enough to whip up some site frames from scratch but I have a few issues I'd like to ask about.

Here is what a basic frame looks like:

[image loading]

Question 1

I want the light blue body to always extend to the bottom of the page, but then also extend more as needed if the text goes farther. How is this done?

Question 2

I want the navbar buttons to all be an equal set width instead of just the length of the button name. I've looked this up and tried setting the list item width and it doesn't have any effect, so I'm confused. Right now I'm equalizing their widths by tacking on invisible characters to the end of the names...lol


If the first Question is still an Issue, this is often done like this: http://alistapart.com/article/fauxcolumns
Prev 1 329 330 331 332 333 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 18h 7m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Serral 2039
Ryung 238
SHIN 102
RushiSC 25
StarCraft: Brood War
Calm 6460
Bisu 2062
Sea 1759
Shuttle 1523
Jaedong 1091
Mini 803
Soulkey 656
Soma 407
EffOrt 358
firebathero 348
[ Show more ]
Hyuk 320
Light 272
Snow 230
ggaemo 164
Rush 82
ZerO 68
Sea.KH 54
Free 51
sorry 47
JYJ 41
Pusan 32
soO 31
Movie 31
Killer 28
hero 27
PianO 26
ToSsGirL 26
scan(afreeca) 23
Aegong 21
Rock 20
sSak 20
yabsab 19
Sexy 17
Terrorterran 16
Hm[arnc] 14
Bale 13
Barracks 12
IntoTheRainbow 11
Yoon 9
Shine 9
Dota 2
Gorgc9594
Dendi956
syndereN202
XcaliburYe118
League of Legends
KnowMe31
Counter-Strike
fl0m630
byalli421
kRYSTAL_64
Other Games
singsing2059
FrodaN1379
hiko921
B2W.Neo642
Lowko479
crisheroes276
ToD179
Livibee90
Trikslyr41
ZerO(Twitch)11
Organizations
Other Games
gamesdonequick2893
BasetradeTV296
StarCraft 2
TaKeTV82
StarCraft: Brood War
lovetv 8
Kim Chul Min (afreeca) 6
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• mYiSmile131
• poizon28 16
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis4383
• TFBlade1348
Other Games
• Shiphtur237
• imaqtpie223
Upcoming Events
The PondCast
18h 7m
Replay Cast
1d 17h
CrankTV Team League
1d 19h
Replay Cast
2 days
CrankTV Team League
2 days
Replay Cast
3 days
RSL Revival
3 days
Clem vs Lambo
Scarlett vs Cure
CranKy Ducklings
3 days
IPSL
4 days
Dragon vs Hawk
RSL Revival
4 days
Classic vs Trap
herO vs SHIN
[ Show More ]
Sparkling Tuna Cup
4 days
IPSL
5 days
Bonyth vs Ret
WardiTV Weekly
5 days
Monday Night Weeklies
6 days
Liquipedia Results

Completed

YSL S3
HSC XXIX
Eternal Conflict S2 E2

Ongoing

IPSL Spring 2026
Acropolis #4
CSL 2026 Summer (S21)
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
XSE Pro League 2026
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

Upcoming

Escore Tournament S3: W3
ASL S22 SEASON OPEN Day 1
Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
CSLAN 4
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E3
Logitech G Connect 2026
StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
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.