• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 16:29
CET 22:29
KST 06: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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
[BSL21] Non-Korean Championship - Starts Jan 100SC2 All-Star Invitational: Jan 17-1819Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises3Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3ComeBackTV's documentary on Byun's Career !11
StarCraft 2
General
Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises SC2 All-Star Invitational: Jan 17-18 Chinese SC2 server to reopen; live all-star event in Hangzhou Starcraft 2 Zerg Coach ComeBackTV's documentary on Byun's Career !
Tourneys
OSC Season 13 World Championship WardiTV Mondays $5,000+ WardiTV 2025 Championship $100 Prize Pool - Winter Warp Gate Masters Showdow Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play
Brood War
General
A cwal.gg Extension - Easily keep track of anyone I would like to say something about StarCraft StarCraft & BroodWar Campaign Speedrun Quest BGH Auto Balance -> http://bghmmr.eu/ (UMS) SWITCHEROO *New* /Destination Edit/
Tourneys
SLON Grand Finals – Season 2 [BSL21] Non-Korean Championship - Starts Jan 10 [Megathread] Daily Proleagues [BSL21] Grand Finals - Sunday 21:00 CET
Strategy
Simple Questions, Simple Answers Current Meta [G] How to get started on ladder as a new Z player Fighting Spirit mining rates
Other Games
General Games
Elden Ring Thread General RTS Discussion Thread Nintendo Switch Thread Awesome Games Done Quick 2026! 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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Canadian Politics Mega-thread The Games Industry And ATVI 12 Days of Starcraft
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced
Blogs
National Diversity: A Challe…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 924 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
Poland17557 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
Hyrule19186 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
Poland17557 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
Hyrule19186 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
Poland17557 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
Poland17557 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
Poland17557 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
Germany564 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
Germany564 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
Spain18161 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
Germany564 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
Poland17557 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
The PiG Daily
21:00
Best Games of SC
Reynor vs Clem
MaxPax vs TBD
SHIN vs TBD
Rogue vs TBD
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 655
PiGStarcraft234
ProTech106
UpATreeSC 83
SC2Nice 33
RushiSC 33
Railgan 30
StarCraft: Brood War
Mini 149
Shuttle 86
firebathero 76
Killer 31
Sexy 22
JYJ 18
yabsab 11
Dota 2
febbydoto18
League of Legends
C9.Mang0231
Counter-Strike
pashabiceps2762
Heroes of the Storm
Liquid`Hasu574
Other Games
Grubby5583
tarik_tv3411
FrodaN2395
Beastyqt1062
B2W.Neo359
fl0m345
mouzStarbuck324
ArmadaUGS145
Livibee108
KnowMe98
IndyStarCraft 85
QueenE66
PPMD32
ZombieGrub30
Organizations
StarCraft 2
angryscii 18
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• kabyraGe 233
• davetesta6
• Kozan
• LaughNgamezSOOP
• AfreecaTV YouTube
• sooper7s
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• Azhi_Dahaki8
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV660
Other Games
• imaqtpie3281
• Shiphtur347
• tFFMrPink 22
Upcoming Events
Korean StarCraft League
5h 31m
OSC
14h 31m
IPSL
19h 31m
Dewalt vs Bonyth
OSC
20h 31m
OSC
1d 14h
uThermal 2v2 Circuit
1d 16h
Replay Cast
2 days
RotterdaM Event
2 days
Patches Events
2 days
OSC
3 days
[ Show More ]
OSC
4 days
OSC
5 days
Liquipedia Results

Completed

C-Race Season 1
WardiTV 2025
META Madness #9

Ongoing

IPSL Winter 2025-26
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 2
Escore Tournament S1: W2
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025

Upcoming

CSL 2025 WINTER (S19)
Escore Tournament S1: W3
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Thunderfire SC2 All-star 2025
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
Underdog Cup #3
NA Kuram Kup
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 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...

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.