• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 02:59
CEST 08:59
KST 15:59
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL61Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event20Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
Statistics for vetoed/disliked maps Program: SC2 / XSplit / OBS Scene Switcher The SCII GOAT: A statistical Evaluation Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series Korean Starcraft League Week 77 Master Swan Open (Global Bronze-Master 2) [GSL 2025] Code S: Season 2 - Semi Finals & Finals
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Flash Announces Hiatus From ASL Player “Jedi” cheat on CSL ASL20 Preliminary Maps SC uni coach streams logging into betting site BGH Mineral Boosts Tutorial Video
Tourneys
[BSL20] Grand Finals - Sunday 20:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Trading/Investing Thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 531 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
Poland17243 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
Hyrule19030 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
Poland17243 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
Hyrule19030 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
Poland17243 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
Poland17243 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
Poland17243 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
Germany546 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
Germany546 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
Spain17970 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
Germany546 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
Poland17243 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
Next event in 3h 1m
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Leta 594
Larva 324
Barracks 53
Dota 2
XaKoH 617
League of Legends
JimRising 745
Counter-Strike
Stewie2K1060
Heroes of the Storm
Khaldor237
Other Games
WinterStarcraft694
SortOf101
kaitlyn73
ProTech55
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Berry_CruncH361
• Hupsaiya 92
• Sammyuel 41
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• lizZardDota2168
League of Legends
• Lourlo1348
• masondota2816
• Stunt496
Upcoming Events
RSL Revival
3h 1m
Clem vs Classic
SHIN vs Cure
FEL
5h 1m
WardiTV European League
5h 1m
BSL: ProLeague
11h 1m
Dewalt vs Bonyth
Replay Cast
1d 17h
Sparkling Tuna Cup
2 days
WardiTV European League
2 days
The PondCast
3 days
Replay Cast
3 days
RSL Revival
4 days
[ Show More ]
Replay Cast
4 days
RSL Revival
5 days
FEL
5 days
RSL Revival
6 days
FEL
6 days
FEL
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
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
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.