Dunno why but it made my day :D
The Big Programming Thread - Page 675
Forum Index > General Forum |
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
France2522 Posts
Dunno why but it made my day :D | ||
Manit0u
Poland17187 Posts
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? | ||
![]()
tofucake
Hyrule18969 Posts
| ||
Khalum
Austria831 Posts
| ||
Manit0u
Poland17187 Posts
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... | ||
![]()
tofucake
Hyrule18969 Posts
| ||
WarSame
Canada1950 Posts
| ||
Cynry
810 Posts
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
Poland17187 Posts
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: 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. | ||
Cynry
810 Posts
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
Poland17187 Posts
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... 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! | ||
Manit0u
Poland17187 Posts
https://github.com/Sylius/Sylius/pull/3541 Never before has committing 3 lines of code been so profound for me ![]() | ||
AKnopf
Germany259 Posts
*Proudly pins batch to shoulder* (And just in case any cynical internet person thinks I was ironic: I was not) | ||
Artesimo
Germany537 Posts
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
Austria1762 Posts
| ||
Artesimo
Germany537 Posts
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:
fixed it. | ||
Acrofales
Spain17842 Posts
On November 09 2015 04:42 Artesimo wrote: Still same error. Do I always have to define my own constructor in java, even though it is just the default one? EDIT:
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
Germany537 Posts
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.
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
Canada1950 Posts
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. | ||
Manit0u
Poland17187 Posts
| ||
| ||