• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:09
CEST 15:09
KST 22:09
  • 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
TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Weekly Cups (Oct 13-19): Clem Goes for Four0BSL Team A vs Koreans - Sat-Sun 16:00 CET6Weekly Cups (Oct 6-12): Four star herO85.0.15 Patch Balance Hotfix (2025-10-8)80Weekly Cups (Sept 29-Oct 5): MaxPax triples up3
StarCraft 2
General
The New Patch Killed Mech! Team Liquid Map Contest #21 - Presented by Monster Energy herO joins T1 Weekly Cups (Oct 13-19): Clem Goes for Four TL.net Map Contest #21: Voting
Tourneys
INu's Battles #13 - ByuN vs Zoun Tenacious Turtle Tussle SC2's Safe House 2 - October 18 & 19 Sparkling Tuna Cup - Weekly Open Tournament $1,200 WardiTV October (Oct 21st-31st)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers
Brood War
General
BSL Season 21 BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ BW caster Sayle BSL Team A vs Koreans - Sat-Sun 16:00 CET
Tourneys
[ASL20] Semifinal B Azhi's Colosseum - Anonymous Tournament [Megathread] Daily Proleagues SC4ALL $1,500 Open Bracket LAN
Strategy
Current Meta BW - ajfirecracker Strategy & Training Relatively freeroll strategies Siegecraft - a new perspective
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Dawn of War IV Nintendo Switch Thread ZeroSpace Megathread
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Men's Fashion Thread Sex and weight loss
Fan Clubs
The herO Fan Club!
Media & Entertainment
Series you have seen recently... Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
Formula 1 Discussion 2024 - 2026 Football Thread MLB/Baseball 2023 NBA General Discussion 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 Recent Gifted Posts
Blogs
The Heroism of Pepe the Fro…
Peanutsc
Rocket League: Traits, Abili…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1278 users

The Big Programming Thread - Page 712

Forum Index > General Forum
Post a Reply
Prev 1 710 711 712 713 714 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.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-03-24 00:00:32
March 23 2016 23:51 GMT
#14221
On March 24 2016 06:13 BlueRoyaL wrote:
Browsed through his python script, looks like he's just using beautiful soup to scrape.

I've used HTML Agility Pack for C#/.NET, and it works amazingly:

http://www.nuget.org/packages/HtmlAgilityPack
http://www.mikesdotnetting.com/article/273/using-the-htmlagilitypack-to-parse-html-in-asp-net

In a nutshell, you specify a URL to load, it parses the DOM nodes into a nice tree that you can traverse, query from, etc.

I'm about to start on the backend portion of a personal project soon using it again, it works very well. Cheers!


Thanks. I've figured out it's some library called BeautifulSoup as well.

I've also tried this HTML Agility Pack, and it seems nice. I've gone as far as parsing these kinds of strings (where players and their score are):


"\n\n3 위\nnoinsung\n207\n88\n3342\n"
"\n\n2 위\neternal.pose\n210\n90\n3359\n"


I guess what's needed there is to use some regex to ignore other strings which do not look like those ones. Then, some string split by "\n" delimiter if the front bit of those strings is ignored up to players' names.

Anyway, thanks for help. It's good to learn something new.

Cyx.
Profile Joined November 2010
Canada806 Posts
Last Edited: 2016-03-24 23:24:23
March 24 2016 05:10 GMT
#14222
https://gist.github.com/rauchg/5b032c2c2166e4e36713 oh man I wish I had real life friends who would get this.

(context for those who aren't aware: http://www.haneycodes.net/npm-left-pad-have-we-forgotten-how-to-program/ )
Thaniri
Profile Blog Joined March 2011
1264 Posts
Last Edited: 2016-03-24 06:10:09
March 24 2016 06:09 GMT
#14223
Is this from that Kik debacle? I thought it was basic knowledge that you download a library and not link to a website. For example on the Jquery site 10 links to download it before you scroll down to the link to it just to avoid this problem.

Node.js was destroyed?

+ Show Spoiler +
Why would you want to install a 500kb dependency that has only one function you need, when you can install a 10kb dependency that has it?

Would you want each of your five 20kb dependencies to re-implement the same 5kb function, increasing the code you must send to the client by 20%, or would it be more optimal for each of those dependency to use the same 5kb function?

The author comes from rants about practices of developers from different programming environment, without experience, without figuring how things came to be in the first place. If he did give an effort to think from the perspective from Node.JS developers he’d have addressed the previous two points.

This is like going to a friend’s house and complaining everything is put in the wrong place. It would have been wise to immerse in Node.JS conventions and observe for a while before making comment


Anyone have an idea as to why downloading this left-padding thing would cost 500kb of resources, whereas linking to it costs 10kb? That doesnt make sense to me.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-03-24 07:18:36
March 24 2016 06:52 GMT
#14224
--- Nuked ---
Cyx.
Profile Joined November 2010
Canada806 Posts
March 25 2016 01:48 GMT
#14225
On March 24 2016 15:09 Thaniri wrote:
Anyone have an idea as to why downloading this left-padding thing would cost 500kb of resources, whereas linking to it costs 10kb? That doesnt make sense to me.

I don't think that commenter knew what he was talking about?... The debacle was that literally the entire npm ecosystem chose to take on a dependency on the 11-line 'left-pad' package rather than implementing a leftpad() function themselves

Whether or not this is a Good Thing (tm) is of course up to you... but the whole thing I think really illustrates why Javascript is a super fucking weird place for a C++ programmer :D
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
March 25 2016 06:00 GMT
#14226

if (!isset($var) && intval($var) > 0) {
...
}


The things I find...
Time is precious. Waste it wisely.
waffelz
Profile Blog Joined June 2012
Germany711 Posts
March 25 2016 08:56 GMT
#14227
Stupid Problem that stole me way too much time by now and shouldn’t even exist:

I got a python-script that I run when logging into windows. To start it I use a .cmd like this:

@echo off
START python [path] \MIN

The .cmd itself works great however ever since I installed pythontools for visual studio, on startup instead of launching the script like it used to be, a popup appears where windows asks me how I would like to run it(using python or visual studio) only to close that popup a split-second later while not executing my script at all.
+ Show Spoiler +
Not like that I already specified in the goddamn .cmd which way I want it to open. But wait, I don’t want to open this script. Let me just real quick give you these 2 options instead. Oh that was too fast for you to click? Well, have a kick to the shin instead while I proceed to do nothing of what you asked me to and laugh in binary. That’s how I imagine the situation by now.

The weird thing is that it only does this on login. If I execute the .cmd at any other time, it works just fine. At this point my only solution left is to uninstall pythontools for visual studio and accept that all OS can be quite amazing at times....

- Everything worked just fine previously
- Installing pythontools for visual studio broke things
- Open .py-files is correctly set to python launcher
- .cmd works just fine at any other point then logging in
- Already reinstalled python to no effect
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
Ropid
Profile Joined March 2009
Germany3557 Posts
March 25 2016 10:30 GMT
#14228
What happens if you use the full path and name of the Python .exe?
"My goal is to replace my soul with coffee and become immortal."
waffelz
Profile Blog Joined June 2012
Germany711 Posts
March 25 2016 10:39 GMT
#14229
On March 25 2016 19:30 Ropid wrote:
What happens if you use the full path and name of the Python .exe?


Already tried that to no effect.
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
March 25 2016 13:14 GMT
#14230
Trying to fix one small issue, I navigate to the code and see this:


public function someFun()
{
error_reporting(0);
ini_set('display_errors', 0);

// 500 lines of code
}


At this point I know I'm in trouble...
Time is precious. Waste it wisely.
waffelz
Profile Blog Joined June 2012
Germany711 Posts
Last Edited: 2016-03-25 14:03:37
March 25 2016 14:03 GMT
#14231
On March 25 2016 17:56 waffelz wrote:
Stupid Problem that stole me way too much time by now and shouldn’t even exist:

I got a python-script that I run when logging into windows. To start it I use a .cmd like this:

@echo off
START python [path] \MIN

The .cmd itself works great however ever since I installed pythontools for visual studio, on startup instead of launching the script like it used to be, a popup appears where windows asks me how I would like to run it(using python or visual studio) only to close that popup a split-second later while not executing my script at all.
+ Show Spoiler +
Not like that I already specified in the goddamn .cmd which way I want it to open. But wait, I don’t want to open this script. Let me just real quick give you these 2 options instead. Oh that was too fast for you to click? Well, have a kick to the shin instead while I proceed to do nothing of what you asked me to and laugh in binary. That’s how I imagine the situation by now.

The weird thing is that it only does this on login. If I execute the .cmd at any other time, it works just fine. At this point my only solution left is to uninstall pythontools for visual studio and accept that all OS can be quite amazing at times....

- Everything worked just fine previously
- Installing pythontools for visual studio broke things
- Open .py-files is correctly set to python launcher
- .cmd works just fine at any other point then logging in
- Already reinstalled python to no effect


Well, I managed to hack my way around the problem... I just added a wait-statement to my .cmd file. I have no idea why but now my pythonscripts get started properly
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
tofucake
Profile Blog Joined October 2009
Hyrule19144 Posts
March 25 2016 14:35 GMT
#14232
On March 25 2016 22:14 Manit0u wrote:
Trying to fix one small issue, I navigate to the code and see this:


public function someFun()
{
error_reporting(0);
ini_set('display_errors', 0);

// 500 lines of code
}


At this point I know I'm in trouble...

oh sweet zombie jesus

how many things melt down when you turn on errors?
Liquipediaasante sana squash banana
Wrath
Profile Blog Joined July 2014
3174 Posts
March 25 2016 15:53 GMT
#14233
On March 25 2016 15:00 Manit0u wrote:

if (!isset($var) && intval($var) > 0) {
...
}


The things I find...


Forgive my ignorance but from my limited understanding... Um... What is he trying to do again? Is he checking for $var to be not set and try to get an integer value from it?
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
March 25 2016 20:08 GMT
#14234
On March 26 2016 00:53 WrathSCII wrote:
Show nested quote +
On March 25 2016 15:00 Manit0u wrote:

if (!isset($var) && intval($var) > 0) {
...
}


The things I find...


Forgive my ignorance but from my limited understanding... Um... What is he trying to do again? Is he checking for $var to be not set and try to get an integer value from it?


Pretty much. This condition can only be true if the variable is at the same time not defined or null and still greater than zero, which can't happen since the integer value of a null/undefined value is 0.
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
Last Edited: 2016-03-25 21:09:00
March 25 2016 21:06 GMT
#14235
On March 25 2016 23:35 tofucake wrote:
Show nested quote +
On March 25 2016 22:14 Manit0u wrote:
Trying to fix one small issue, I navigate to the code and see this:


public function someFun()
{
error_reporting(0);
ini_set('display_errors', 0);

// 500 lines of code
}


At this point I know I'm in trouble...

oh sweet zombie jesus

how many things melt down when you turn on errors?


I don't even want to know. I've discovered the painful way that even if you do stuff like:


fopen('php://output', 'w');


To say send csv data without having to save it to file first you get a bunch of html stuff in there unless you do ob_clean() first...

I even forgot such functions exist in PHP and I'm not sure if it's the case of ZF1 being super shitty or this many-years-old project screwing it up even more.

On March 26 2016 05:08 Morfildur wrote:
Show nested quote +
On March 26 2016 00:53 WrathSCII wrote:
On March 25 2016 15:00 Manit0u wrote:

if (!isset($var) && intval($var) > 0) {
...
}


The things I find...


Forgive my ignorance but from my limited understanding... Um... What is he trying to do again? Is he checking for $var to be not set and try to get an integer value from it?


Pretty much. This condition can only be true if the variable is at the same time not defined or null and still greater than zero, which can't happen since the integer value of a null/undefined value is 0.


Yes. Also, I now believe it might be a work of some prankster developer since I keep coming across stuff like:


if (false) {
// Hehe
} else {
// actual code here
}
Time is precious. Waste it wisely.
tofucake
Profile Blog Joined October 2009
Hyrule19144 Posts
March 25 2016 21:54 GMT
#14236
my first thought was maybe it's supposed to be


if (!(isset($var) && intval($var) > 0)) {
...
}
Liquipediaasante sana squash banana
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
Last Edited: 2016-03-26 01:43:15
March 26 2016 01:36 GMT
#14237
My first thought was that the isset negation is erroneous.

And a question to you guys. If you were to code a rather large system based on the web app (DMS/QMS that runs in the browser), which language/framework would you choose?

You can be as biased in your opinion as you like. I'm researching possible options for some hopefully not too distant future.
My boss would like to try with Java (Spring) - personally I have nothing against it except it seems that whenever you have to write something in it you have to write an entire essay worth of code (I do get some serious boner when looking at H2 specs though). Would you consider Scala (Scalatra) or Groovy (GRails) within the Java ecosystem?

Just fire away with your experiences with modern web frameworks (I'm leaning towards Django although I'd definitely like to get some experience with Java-stuff).
Time is precious. Waste it wisely.
Djagulingu
Profile Blog Joined December 2010
Germany3605 Posts
March 26 2016 10:17 GMT
#14238
On March 26 2016 10:36 Manit0u wrote:
My first thought was that the isset negation is erroneous.

And a question to you guys. If you were to code a rather large system based on the web app (DMS/QMS that runs in the browser), which language/framework would you choose?

You can be as biased in your opinion as you like. I'm researching possible options for some hopefully not too distant future.
My boss would like to try with Java (Spring) - personally I have nothing against it except it seems that whenever you have to write something in it you have to write an entire essay worth of code (I do get some serious boner when looking at H2 specs though). Would you consider Scala (Scalatra) or Groovy (GRails) within the Java ecosystem?

Just fire away with your experiences with modern web frameworks (I'm leaning towards Django although I'd definitely like to get some experience with Java-stuff).

I have no idea about Scalatra but we use some Groovy within our Java ecosystem, use of groovy is definitely not web-related though, we use that in our rule engine. We put groovy scripts in the database and run those scripts whenever the rule is invoked. Works pretty well. 10/10 would use again.

Might wanna check out Vaadin. It also works well with Java ecosystem as far as I've read so far.
"windows bash is a steaming heap of shit" tofucake
Manit0u
Profile Blog Joined August 2004
Poland17386 Posts
March 26 2016 10:58 GMT
#14239
This Vaadin thing looks amazing. I'll definitely look into that.
Time is precious. Waste it wisely.
FFGenerations
Profile Blog Joined April 2011
7088 Posts
Last Edited: 2016-03-26 11:27:22
March 26 2016 11:22 GMT
#14240
just dropping in to say i just left my junior programming job after 6 months (after giving 6 weeks notice)

i saved up some money (4500 lol) and going to take a year to learn to draw and try to become an artist instead

just thought you'd like to kno since you saw me pass my uni degree last year (barely) and go on from there

programming was pretty much what i expected - hard, relentless, lonely 9 hour days with a lot of feeling like shit for being incompetent (in my eyes), a lack of traditional skills progression due to the nature of my particular job and not being smart enough to make larger leaps in progression/understanding and also not having any real interest in it, and ultimately feeling like i was wasting my life , just a human machine that might aswell not even exist

i made a good friend (the guy who sat next to me for 6 months) and everyone had really kind words for me

maybe i will use my (limited) skills in the future that i learnt in the job to combine with my art. i mean the option is there (i worked with flash/as) just i am shit at it and not smart enough and hate it so fuck. lol

the dream now is to get good enough at drawing then digital art and maybe make my own visual novel game for some sort of commercial release. that would be the dream i start monday . and got ~10+ months to succeed (else its back to applying for programming jobs or my mom will go mad lol)

also im looking for a cheap place to live FYI
Cool BW Music Vid - youtube.com/watch?v=W54nlqJ-Nx8 ~~~~~ ᕤ OYSTERS ᕤ CLAMS ᕤ AND ᕤ CUCKOLDS ᕤ ~~~~~~ ༼ ᕤ◕◡◕ ༽ᕤ PUNCH HIM ༼ ᕤ◕◡◕ ༽ᕤ
Prev 1 710 711 712 713 714 1032 Next
Please log in or register to reply.
Live Events Refresh
INu's Battles
11:00
INu's Battle #13
ByuN vs ZounLIVE!
IntoTheiNu 77
LiquipediaDiscussion
Replay Cast
10:00
LiuLi Cup #46 - Day 1
CranKy Ducklings240
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Harstem 503
sas.Sziky 9
StarCraft: Brood War
Britney 33936
Calm 11750
Hyuk 5297
Horang2 2799
Bisu 2665
GuemChi 1540
Flash 1435
Jaedong 1218
Larva 564
Soma 500
[ Show more ]
EffOrt 387
actioN 381
Mong 310
Light 288
Soulkey 272
Mini 253
Hyun 202
Snow 189
hero 151
Pusan 121
TY 104
JYJ84
Barracks 80
ggaemo 74
Killer 73
Mind 65
Sea.KH 61
JulyZerg 59
Aegong 50
Rush 38
Noble 35
ToSsGirL 28
Movie 27
sorry 26
Sharp 20
soO 19
scan(afreeca) 19
Sacsri 16
yabsab 16
Bale 13
SilentControl 11
Terrorterran 8
Shine 8
HiyA 7
Dota 2
Gorgc4990
qojqva2590
Dendi1040
XaKoH 505
420jenkins285
XcaliburYe217
Counter-Strike
olofmeister2883
x6flipin438
Heroes of the Storm
Khaldor206
Other Games
summit1g12066
singsing2411
B2W.Neo703
hiko613
Lowko296
Sick283
Pyrionflax251
Hui .125
Happy110
oskar71
Mew2King47
ToD25
Organizations
StarCraft: Brood War
lovetv 14
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 4
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 25
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis7636
Other Games
• WagamamaTV311
Upcoming Events
Monday Night Weeklies
2h 51m
Replay Cast
9h 51m
WardiTV Invitational
21h 51m
WardiTV Invitational
1d 1h
PiGosaur Monday
1d 10h
Replay Cast
1d 20h
Tenacious Turtle Tussle
2 days
The PondCast
2 days
OSC
2 days
WardiTV Invitational
3 days
[ Show More ]
Online Event
4 days
RSL Revival
4 days
RSL Revival
4 days
WardiTV Invitational
4 days
Afreeca Starleague
5 days
Snow vs Soma
Sparkling Tuna Cup
5 days
WardiTV Invitational
5 days
CrankTV Team League
5 days
RSL Revival
6 days
Wardi Open
6 days
CrankTV Team League
6 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
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

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
BSL 21 Non-Korean Championship
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
CranK Gathers Season 2: SC II Pro Teams
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 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.