• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 23:02
CEST 05:02
KST 12:02
  • 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
Team TLMC #5 - Finalists & Open Tournaments1[ASL20] Ro16 Preview Pt2: Turbulence10Classic Games #3: Rogue vs Serral at BlizzCon9[ASL20] Ro16 Preview Pt1: Ascent10Maestros of the Game: Week 1/Play-in Preview12
Community News
StarCraft II 5.0.15 PTR Patch Notes133BSL 2025 Warsaw LAN + Legends Showmatch2Weekly Cups (Sept 8-14): herO & MaxPax split cups4WardiTV TL Team Map Contest #5 Tournaments1SC4ALL $6,000 Open LAN in Philadelphia8
StarCraft 2
General
#1: Maru - Greatest Players of All Time StarCraft II 5.0.15 PTR Patch Notes Team TLMC #5 - Finalists & Open Tournaments Team Liquid Map Contest #21 - Presented by Monster Energy Weekly Cups (Sept 1-7): MaxPax rebounds & Clem saga continues
Tourneys
KSL Week 80 Stellar Fest StarCraft Evolution League (SC Evo Biweekly) RSL: Revival, a new crowdfunded tournament series SC2's Safe House 2 - October 18 & 19
Strategy
Custom Maps
External Content
Mutation # 491 Night Drive Mutation # 490 Masters of Midnight Mutation # 489 Bannable Offense Mutation # 488 What Goes Around
Brood War
General
ASL20 General Discussion BW General Discussion Diplomacy, Cosmonarchy Edition Soulkey on ASL S20 ASL TICKET LIVE help! :D
Tourneys
[ASL20] Ro16 Group D BSL 2025 Warsaw LAN + Legends Showmatch [ASL20] Ro16 Group C Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers Muta micro map competition Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
Stormgate/Frost Giant Megathread Borderlands 3 Path of Exile Nintendo Switch Thread General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine The Big Programming Thread UK Politics Mega-thread Russo-Ukrainian War Thread
Fan Clubs
The Happy Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023
World Cup 2022
Tech Support
Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s)
TL Community
BarCraft in Tokyo Japan for ASL Season5 Final The Automated Ban List
Blogs
Too Many LANs? Tournament Ov…
TrAiDoS
i'm really bored guys
Peanutsc
I <=> 9
KrillinFromwales
A very expensive lesson on ma…
Garnet
hello world
radishsoup
Lemme tell you a thing o…
JoinTheRain
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1134 users

The Big Programming Thread - Page 675

Forum Index > General Forum
Post a Reply
Prev 1 673 674 675 676 677 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.
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
Poland17347 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
Hyrule19087 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
Poland17347 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
Hyrule19087 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
Poland17347 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
Poland17347 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
Poland17347 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
Germany549 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
Germany549 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
Spain18055 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
Germany549 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
Poland17347 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 1031 Next
Please log in or register to reply.
Live Events Refresh
Korean StarCraft League
03:00
Week 80
davetesta37
HKG_Chickenman7
CranKy Ducklings5
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft423
NeuroSwarm 189
RuFF_SC2 165
Nathanias 72
Nina 39
PiLiPiLi 21
StarCraft: Brood War
ggaemo 82
Noble 39
Icarus 10
Bale 4
Dota 2
LuMiX1
League of Legends
JimRising 440
Trikslyr65
Cuddl3bear4
Counter-Strike
Coldzera 647
Other Games
summit1g8930
C9.Mang0325
ViBE196
Maynarde191
XaKoH 130
Organizations
Other Games
gamesdonequick971
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH138
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 53
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Stunt342
Other Games
• Scarra1378
Upcoming Events
BSL Open LAN 2025 - War…
4h 58m
RSL Revival
6h 58m
Reynor vs Cure
TBD vs Zoun
OSC
17h 58m
BSL Open LAN 2025 - War…
1d 4h
RSL Revival
1d 6h
Classic vs TBD
WardiTV Invitational
1d 7h
Online Event
1d 12h
Wardi Open
2 days
Monday Night Weeklies
2 days
Sparkling Tuna Cup
3 days
[ Show More ]
LiuLi Cup
4 days
The PondCast
5 days
CranKy Ducklings
6 days
Liquipedia Results

Completed

Proleague 2025-09-10
Chzzk MurlocKing SC1 vs SC2 Cup #2
HCC Europe

Ongoing

BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
LASL Season 20
2025 Chongqing Offline CUP
BSL World Championship of Poland 2025
RSL Revival: Season 2
Maestros of the Game
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1

Upcoming

IPSL Winter 2025-26
BSL Season 21
SC4ALL: Brood War
BSL 21 Team A
Stellar Fest
SC4ALL: StarCraft II
EC S1
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
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 © 2025 TLnet. All Rights Reserved.