• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 08:53
CET 14:53
KST 22: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
RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation13Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
Zerg is losing its identity in StarCraft 2 [TLMC] Fall/Winter 2025 Ladder Map Rotation Mech is the composition that needs teleportation t RotterdaM "Serral is the GOAT, and it's not close" RSL Season 3 - RO16 Groups C & D Preview
Tourneys
RSL Revival: Season 3 Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle BGH Auto Balance -> http://bghmmr.eu/ What happened to TvZ on Retro? SnOw's ASL S20 Finals Review BW General Discussion
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET
Strategy
PvZ map balance Current Meta Simple Questions, Simple Answers How to stay on top of macro?
Other Games
General Games
Clair Obscur - Expedition 33 Should offensive tower rushing be viable in RTS games? Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread Artificial Intelligence Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2236 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
Poland17433 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
Hyrule19153 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
Poland17433 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
Hyrule19153 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
Poland17433 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
Poland17433 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
Poland17433 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
Germany563 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
Germany563 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
Spain18119 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
Germany563 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
Poland17433 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
WardiTV Korean Royale
12:00
Group Stage 1 - Group A
WardiTV640
LiquipediaDiscussion
Kung Fu Cup
12:00
2025 Monthly #3: Day 5
Cure vs herOLIVE!
Reynor vs TBD
RotterdaM617
TKL 352
IndyStarCraft 269
SteadfastSC113
IntoTheiNu 35
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 617
TKL 352
Tasteless 324
Reynor 276
IndyStarCraft 269
Rex 147
SteadfastSC 113
Railgan 25
MindelVK 21
StarCraft: Brood War
Britney 36790
Rain 8932
Sea 4139
firebathero 4096
BeSt 1748
Horang2 1687
GuemChi 939
Soma 605
EffOrt 552
Stork 500
[ Show more ]
Mini 456
actioN 283
Rush 225
Killer 174
Last 146
Hyun 144
scan(afreeca) 136
hero 133
Bonyth 99
Mind 90
Barracks 61
Sharp 51
zelot 50
yabsab 49
Sea.KH 45
sorry 42
Snow 39
sas.Sziky 24
Shinee 18
Hm[arnc] 15
NaDa 8
Bale 6
Dota 2
singsing3070
qojqva1678
Dendi1083
Gorgc737
XcaliburYe301
Counter-Strike
byalli539
x6flipin531
Heroes of the Storm
Khaldor238
Liquid`Hasu193
Other Games
FrodaN4939
B2W.Neo1844
Pyrionflax359
Fuzer 256
KnowMe216
DeMusliM40
Organizations
Dota 2
PGL Dota 2 - Main Stream14873
PGL Dota 2 - Secondary Stream1808
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Adnapsc2 8
• Dystopia_ 6
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV606
• Ler66
Upcoming Events
BSL 21
6h 7m
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
6h 7m
Dewalt vs WolFix
eOnzErG vs Bonyth
Replay Cast
9h 7m
Wardi Open
22h 7m
Monday Night Weeklies
1d 3h
Replay Cast
1d 9h
WardiTV Korean Royale
1d 22h
BSL: GosuLeague
2 days
The PondCast
2 days
Replay Cast
3 days
[ Show More ]
RSL Revival
3 days
BSL: GosuLeague
4 days
RSL Revival
4 days
WardiTV Korean Royale
4 days
RSL Revival
5 days
WardiTV Korean Royale
5 days
IPSL
6 days
Julia vs Artosis
JDConan vs DragOn
RSL Revival
6 days
Liquipedia Results

Completed

Proleague 2025-11-14
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
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.