• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 15:39
CET 21:39
KST 05:39
  • 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
ByuL: The Forgotten Master of ZvT29Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
Team Liquid Map Contest - Preparation Notice2Weekly Cups (Feb 23-Mar 1): herO doubles, 2v2 bonanza1Weekly Cups (Feb 16-22): MaxPax doubles0Weekly Cups (Feb 9-15): herO doubles up2ACS replaced by "ASL Season Open" - Starts 21/0258
StarCraft 2
General
Team Liquid Map Contest - Preparation Notice How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? ByuL: The Forgotten Master of ZvT Nexon's StarCraft game could be FPS, led by UMS maker Weekly Cups (Feb 23-Mar 1): herO doubles, 2v2 bonanza
Tourneys
PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) RSL Season 4 announced for March-April Sparkling Tuna Cup - Weekly Open Tournament SEL Doubles (SC Evo Bimonthly) WardiTV Team League Season 10
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026] Map Editor closed ?
External Content
The PondCast: SC2 News & Results Mutation # 515 Together Forever Mutation # 514 Ulnar New Year Mutation # 513 Attrition Warfare
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion It's March 3rd CasterMuse Youtube Recent recommended BW games
Tourneys
[Megathread] Daily Proleagues BWCL Season 64 Announcement The Casual Games of the Week Thread [LIVE] [S:21] ASL Season Open Day 1
Strategy
Soma's 9 hatch build from ASL Game 2 Fighting Spirit mining rates Simple Questions, Simple Answers Zealot bombing is no longer popular?
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Battle Aces/David Kim RTS Megathread Diablo 2 thread Path of Exile
Dota 2
The Story of Wings Gaming 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 Vanilla Mini Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread UK Politics Mega-thread NASA and the Private Sector
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Just Watchers: Why Some Only…
TrAiDoS
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2160 users

The Big Programming Thread - Page 675

Forum Index > General Forum
Post a Reply
Prev 1 673 674 675 676 677 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.
Furikawari
Profile Joined February 2014
France2522 Posts
November 05 2015 13:06 GMT
#13481
SwearengenCD

Dunno why but it made my day :D
Manit0u
Profile Blog Joined August 2004
Poland17682 Posts
Last Edited: 2015-11-06 10:04:30
November 06 2015 07:29 GMT
#13482
I've run into curious problem. PHP webpage. Works on Linux, doesn't work on Windows (localhost). Neither Apache, nor PHP error logs show anything (Apache complains about some ssl certificates on www.example.com, which is only present in the test and help files so that's not it). Browser only shows "Connection reset".

The funny thing is. It works fine under Windows when run on built-in PHP server, which leads me to believe that it's a problem with Apache.

Curious indeed and I can't track it down. Have any of you run into anything like that before?
Time is precious. Waste it wisely.
tofucake
Profile Blog Joined October 2009
Hyrule19193 Posts
November 06 2015 12:11 GMT
#13483
What doesn't work about it?
Liquipediaasante sana squash banana
Khalum
Profile Joined September 2010
Austria831 Posts
November 06 2015 12:32 GMT
#13484
Have you tried turning it off and on again?
Manit0u
Profile Blog Joined August 2004
Poland17682 Posts
November 06 2015 13:00 GMT
#13485
On November 06 2015 21:11 tofucake wrote:
What doesn't work about it?


I don't really know. The project simply won't run on localhost on Windows. No errors are generated, the browser displays "Connection reset" error and that's it. It works flawlessly on built-in PHP web server but not via XAMPP...
Time is precious. Waste it wisely.
tofucake
Profile Blog Joined October 2009
Hyrule19193 Posts
November 06 2015 14:38 GMT
#13486
try changing the port apache is running on?
Liquipediaasante sana squash banana
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
November 06 2015 20:43 GMT
#13487
I am confused on how you should structure your scripts together. We have a bunch of python scripts that edit pdfs together. I was thinking of combining them into one python file to reduce clutter, but it's making that file too large. How do you manage the clutter?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Cynry
Profile Blog Joined August 2010
810 Posts
Last Edited: 2015-11-06 21:15:55
November 06 2015 21:06 GMT
#13488
On November 06 2015 16:29 Manit0u wrote:
I've run into curious problem. PHP webpage. Works on Linux, doesn't work on Windows (localhost). Neither Apache, nor PHP error logs show anything (Apache complains about some ssl certificates on www.example.com, which is only present in the test and help files so that's not it). Browser only shows "Connection reset".

The funny thing is. It works fine under Windows when run on built-in PHP server, which leads me to believe that it's a problem with Apache.

Curious indeed and I can't track it down. Have any of you run into anything like that before?


Read some stuff about unicode issues with windows recently, but it was an old topic and may not apply to your problem. Still worth a try, what's your UTF of choice ?

Edit : Yeah, just checked, probably totally unrelated, the guy posting this issue had his code displayed on page, but not executed...
Manit0u
Profile Blog Joined August 2004
Poland17682 Posts
Last Edited: 2015-11-06 21:08:40
November 06 2015 21:07 GMT
#13489
On November 07 2015 05:43 WarSame wrote:
I am confused on how you should structure your scripts together. We have a bunch of python scripts that edit pdfs together. I was thinking of combining them into one python file to reduce clutter, but it's making that file too large. How do you manage the clutter?


Depends on how your methods are structured. You could group them by function (generators, exporters, parsers etc.) and go this way. Then you can create few files, each having a group of methods (generatorService, exportService, parsingService and so on). This should reduce clutter and provide easy way to find what you need later on.

On November 07 2015 06:06 Cynry wrote:
Show nested quote +
On November 06 2015 16:29 Manit0u wrote:
I've run into curious problem. PHP webpage. Works on Linux, doesn't work on Windows (localhost). Neither Apache, nor PHP error logs show anything (Apache complains about some ssl certificates on www.example.com, which is only present in the test and help files so that's not it). Browser only shows "Connection reset".

The funny thing is. It works fine under Windows when run on built-in PHP server, which leads me to believe that it's a problem with Apache.

Curious indeed and I can't track it down. Have any of you run into anything like that before?


Read some stuff about unicode issues with windows recently, but it was an old topic and may not apply to your problem. Still worth a try, what's your UTF of choice ?


UTF-8. Will try switching up the ports and some other stuff tomorrow.
Time is precious. Waste it wisely.
Cynry
Profile Blog Joined August 2010
810 Posts
Last Edited: 2015-11-06 21:40:32
November 06 2015 21:22 GMT
#13490
Which version of PHP/Apache are you using ? Nothing better to do while I wait for hero to get crushed, so might as well try to help...

Add the following to the end of httpd.conf to increase the Apache stack size to 8MB.

<IfModule mpm_winnt_module>
ThreadStackSize 8388608
</IfModule>


Found that in a bunch of different topics
Manit0u
Profile Blog Joined August 2004
Poland17682 Posts
Last Edited: 2015-11-07 11:50:55
November 07 2015 01:36 GMT
#13491
On November 07 2015 06:22 Cynry wrote:
Which version of PHP/Apache are you using ? Nothing better to do while I wait for hero to get crushed, so might as well try to help...

Show nested quote +
Add the following to the end of httpd.conf to increase the Apache stack size to 8MB.

<IfModule mpm_winnt_module>
ThreadStackSize 8388608
</IfModule>


Found that in a bunch of different topics


PHP 5.6.14, Apache 2.4.17. And before you ask, my PHP memory limit is set to 2GB

Edit: Increasing the stack size worked. Thanks a ton!
Time is precious. Waste it wisely.
Manit0u
Profile Blog Joined August 2004
Poland17682 Posts
November 08 2015 15:19 GMT
#13492
Heh, for the first time in my life I became an Open Source contributor.

https://github.com/Sylius/Sylius/pull/3541

Never before has committing 3 lines of code been so profound for me
Time is precious. Waste it wisely.
AKnopf
Profile Blog Joined March 2011
Germany259 Posts
November 08 2015 15:34 GMT
#13493
Congratz man. Way to go!

*Proudly pins batch to shoulder*

(And just in case any cynical internet person thinks I was ironic: I was not)
The world - its a funny place
Artesimo
Profile Joined February 2015
Germany567 Posts
November 08 2015 19:30 GMT
#13494
Have some problems with java. I want to fill an vector with a certain number of objects:

private Vector <Register> register;

for(int i = 0; i < registerAnzahl;i++)
{
this.register.add(new Register());
}

Seems fine to me, but I get the following error: "Exception in thread "main" java.lang.NullPointerException". Class "Register" doesn't have any custom constructors so I assume I can't just create a new object and assign it to an vector like this in java?
bioboyAT
Profile Joined July 2004
Austria1763 Posts
November 08 2015 19:38 GMT
#13495
Could it be that there is no empty default constructer?
Milchmann | DeadVessel: Milchmann pwns. I fail.
Artesimo
Profile Joined February 2015
Germany567 Posts
Last Edited: 2015-11-08 19:46:43
November 08 2015 19:42 GMT
#13496
On November 09 2015 04:38 bioboyAT wrote:
Could it be that there is no empty default constructer?


Still same error. Do I always have to define my own constructor in java, even though it is just the default one?

EDIT:

private Vector <Register> register = new Vector<Register>();

fixed it.
Acrofales
Profile Joined August 2010
Spain18226 Posts
November 08 2015 21:09 GMT
#13497
On November 09 2015 04:42 Artesimo wrote:
Show nested quote +
On November 09 2015 04:38 bioboyAT wrote:
Could it be that there is no empty default constructer?


Still same error. Do I always have to define my own constructor in java, even though it is just the default one?

EDIT:

private Vector <Register> register = new Vector<Register>();

fixed it.

I was about to say...

Calling the constructor will never ever ever give a nullpointer exception (well, it might give a nullpointer exception INSIDE the constructor, but that is a different story). Also, the parameterless constructor always exists (in Java). If you don't define it, it is inherited from Object.

Artesimo
Profile Joined February 2015
Germany567 Posts
Last Edited: 2015-11-08 21:57:55
November 08 2015 21:47 GMT
#13498
On November 09 2015 06:09 Acrofales wrote:
I was about to say...

Calling the constructor will never ever ever give a nullpointer exception (well, it might give a nullpointer exception INSIDE the constructor, but that is a different story). Also, the parameterless constructor always exists (in Java). If you don't define it, it is inherited from Object.


To me it was clear that the constructor had nothing to do with it, I was asking in general as I already assumed what you said but wasn't sure(and was thinking about the mistake above to hard to just simply test it lol).

Now I struggle with reading in a file.


public void readFile()
{
String fileName = "test.txt";
String line = null;
try {
FileReader fileReader = new FileReader(fileName);
BufferedReader bufferedReader = new BufferedReader(fileReader);

while((line = bufferedReader.readLine()) != null)
{
System.out.println(line);
}
bufferedReader.close();
}
catch(FileNotFoundException ex) {
System.out.println(
"Unable to open file '" +
fileName + "'");
}
catch(IOException ex) {
System.out.println(
"Error reading file '"
+ fileName + "'");
// Or we could just do this:
// ex.printStackTrace();

}


Even though my file is in the same directory as my .java programm, it I get "Unable to open file". File name is correct, when entering a wrong one the correct exception gets thrown.

EDIT: might already have a solution. seems like I need to get the absolut path for NetBeans.

Yup, NetBeans is a bitch
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
Last Edited: 2015-11-09 05:25:46
November 09 2015 04:36 GMT
#13499
Hey folks, I would like some help with a Python problem I'm working on for fun. I'm flat out stuck. The challenge is here. My thinking has been to DFS down to the bottom ASAP. Whenever a chain hits the bottom allowed number, I back up the chain by one element and try the next chain. So if the chain is -2 -> -2 -> -2 and that hits bottom, the next chain is -2 -> -2 -> -1 then -2 -> -2 -> 1, etc. I seem to be on the right path, but I'm having trouble working out the bugs.

The code is located here.

I've been testing it with small numbers. With 5 as the input, it gets stuck in a loop of 4 -> 2 -> 4 -> 2. I'm not 100 sure how to resolve this. I was thinking a memoization table could be useful? If it sees that the current value and the current sum of the chain is in the table then it automatically returns a failure, because that chain has already been done. Does this seem like a good idea?

There is a lot of stuff here that I am very unsure of, and y'all have been very helpful when I have general questions like this. If there is a smarter way to do it, please let me know. If memoization tables don't work I would love an explanation why - I'm doing this to learn.

EDIT: Okay, turns out that was WAYYYYY easier than anticipated, and resolved my problem. All I did was add a dict. Every time you check a total/sum pair, check if it's in the table. If it is already, then you've already checked those values and they must not work, so return a failure. The code is here.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Manit0u
Profile Blog Joined August 2004
Poland17682 Posts
Last Edited: 2015-11-09 09:33:54
November 09 2015 09:32 GMT
#13500
Pretty cool. First one was easy enough:


$num = 929;
$steps = [];

while ($num > 1) {
switch ($num % 3) {
case 1:
$num = $num - 1;
$steps[] = -1;
break;
case 2:
$num = $num + 1;
$steps[] = 1;
break;
default:
$num = $num / 3;
$steps[] = 0;
break;
}
}

$steps[] = 1;

print_r($steps);
Time is precious. Waste it wisely.
Prev 1 673 674 675 676 677 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 4h 22m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 542
elazer 238
IndyStarCraft 117
UpATreeSC 113
JuggernautJason41
CosmosSc2 8
StarCraft: Brood War
Britney 18420
Sea 17026
Shuttle 713
NaDa 6
Counter-Strike
fl0m3845
pashabiceps3794
Fnx 1482
Heroes of the Storm
Liquid`Hasu400
Other Games
tarik_tv19943
Grubby3926
FrodaN1079
Beastyqt694
ceh9631
B2W.Neo572
shahzam277
C9.Mang0166
KnowMe124
Trikslyr61
Dewaltoss57
Hui .56
Mew2King27
Organizations
Other Games
BasetradeTV204
Counter-Strike
PGL68
StarCraft 2
angryscii 32
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 21 non-featured ]
StarCraft 2
• Hupsaiya 8
• Reevou 4
• Kozan
• IndyKCrew
• sooper7s
• Migwel
• AfreecaTV YouTube
• intothetv
• LaughNgamezSOOP
StarCraft: Brood War
• 80smullet 19
• Michael_bg 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• lizZardDota2110
• Noizen34
League of Legends
• Nemesis3463
• TFBlade1272
Other Games
• imaqtpie965
• WagamamaTV388
• Shiphtur217
Upcoming Events
PiGosaur Cup
4h 22m
Replay Cast
12h 22m
Replay Cast
1d 3h
The PondCast
1d 13h
KCM Race Survival
1d 13h
WardiTV Winter Champion…
1d 15h
Replay Cast
2 days
Ultimate Battle
2 days
Light vs ZerO
WardiTV Winter Champion…
2 days
Classic vs Nicoract
herO vs YoungYakov
ByuN vs Gerald
Clem vs Krystianer
Replay Cast
3 days
[ Show More ]
CranKy Ducklings
3 days
WardiTV Winter Champion…
3 days
MaxPax vs Spirit
Bunny vs Rogue
Cure vs SHIN
Solar vs Zoun
Replay Cast
4 days
Sparkling Tuna Cup
4 days
WardiTV Winter Champion…
4 days
Replay Cast
5 days
Replay Cast
5 days
Monday Night Weeklies
5 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-03-02
PiG Sty Festival 7.0
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Jeongseon Sooper Cup
Spring Cup 2026
WardiTV Winter 2026
Nations Cup 2026
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025

Upcoming

ASL Season 21: Qualifier #1
ASL Season 21: Qualifier #2
ASL Season 21
Acropolis #4 - TS6
Acropolis #4
IPSL Spring 2026
CSLAN 4
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
NationLESS Cup
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
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.