• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:20
CEST 21:20
KST 04:20
  • 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 Tall10HomeStory 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
Weekly Cups (June 30 - July 6): Classic Doubles2[BSL20] Non-Korean Championship 4x BSL + 4x China9Flash Announces Hiatus From ASL66Weekly Cups (June 23-29): Reynor in world title form?14FEL Cracov 2025 (July 27) - $8000 live event22
StarCraft 2
General
The GOAT ranking of GOAT rankings The SCII GOAT: A statistical Evaluation Weekly Cups (June 23-29): Reynor in world title form? Weekly Cups (June 30 - July 6): Classic Doubles Program: SC2 / XSplit / OBS Scene Switcher
Tourneys
RSL: Revival, a new crowdfunded tournament series FEL Cracov 2025 (July 27) - $8000 live event Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays Korean Starcraft League Week 77
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma
Brood War
General
ASL20 Preliminary Maps [ASL19] Finals Recap: Standing Tall SC uni coach streams logging into betting site Flash Announces Hiatus From ASL BW General Discussion
Tourneys
[BSL20] Non-Korean Championship 4x BSL + 4x China [BSL20] Grand Finals - Sunday 20:00 CET CSL Xiamen International Invitational The Casual Games of the Week Thread
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile 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 Stop Killing Games - European Citizens Initiative Summer Games Done Quick 2024! Summer Games Done Quick 2025!
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion 2024 - 2025 Football Thread 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
The Automated Ban List
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: 715 users

The Big Programming Thread - Page 813

Forum Index > General Forum
Post a Reply
Prev 1 811 812 813 814 815 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.
Manit0u
Profile Blog Joined August 2004
Poland17244 Posts
Last Edited: 2016-12-08 03:32:49
December 08 2016 03:32 GMT
#16241
Yeah. Quite a lot of time is being spent on thinking and research. On a good day you can spend about half your time in work actually writing code.

Speaking of thinking and research, I've had an interesting problem to tackle yesterday:
1. Have uploaded files stored in a secure location
2. Make it possible for them to be served directly by the server (serving large files through your application is not good)
3. Make it impossible to discover where the files are through crawling

So basically, pretty much implement the equivalent of an S3 bucket on your own server.

It took me some time to figure out a sensible solution. What most people do nowadays is that they store the files in the public directory (the only way to really have them served directly), in hashed folders. Then you create a service that periodically rehashes folder and/or file names and moves them around. This is pretty clunky and a total bitch to work with if you store the links in your database (since you have to update all the links whenever you move the files around).

I've managed to discover a nice solution to that from the 90's mp3 sharing websites. Then it was just a matter of making it better

Basically, files are uploaded to a secure location on the server (not accessible from the outside). Then, when the link to a file is requested, it generates a random folder in the public asset directory (SecureRandom.hex(64)) and creates a symlink to the file inside it. There's a cron set up on the server that scans this directory and removes all folders older than 30min. This way I get public assets served directly by the server with expiring links. I don't have to move the files around, store and update the links etc. Works like a charm.
Time is precious. Waste it wisely.
Craton
Profile Blog Joined December 2009
United States17247 Posts
December 08 2016 07:43 GMT
#16242
On December 08 2016 06:54 tofucake wrote:
I do about 5 hours of coding most days out of an 8.5 hour day. There's an hour for lunch, 15 minute standup, maybe another meeting, and a bunch of googling

Mines pretty similar, but probably less time spent on code and more on either pointless mandatory meeting(s) or research/design discussions. Research in my case often involves finding Waldo so he can give you some obscure documentation about a system you're going to be interfacing with.

I'm a government contractor currently on a bad project, if you hadn't guessed.

Last project was much closer to your day, with more time spent on actual coding and less on time wasters. It's hard to get a feel for an "average" day, since some days you'll be heads down coding all day and others you'll be in and out of meetings or doing a lot of research/googling.
twitch.tv/cratonz
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-12-08 22:14:44
December 08 2016 22:14 GMT
#16243
Could you recommend a good geometry book? I come across some software problems which require geometry and I'm having a hard time.
mantequilla
Profile Blog Joined June 2012
Turkey779 Posts
December 08 2016 22:24 GMT
#16244
I stumbled across a spring project, http://projects.spring.io/spring-cloud/

among the features it says:

- Distributed/versioned configuration
- Service registration and discovery
- Routing
- Service-to-service calls
- Load balancing
- Circuit Breakers
- Global locks
- Leadership election and cluster state
- Distributed messaging

my question is to what field those things are related to? don't say cloud computing because it's the vaguest term ever Are they about "parallel computing" ?

which books on what topic should I read to have an idea about these concepts?
Age of Mythology forever!
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-12-08 22:54:56
December 08 2016 22:53 GMT
#16245
It reminds me of distributed systems, so it could be that. Here is a link to Wikipedia: https://en.wikipedia.org/wiki/Distributed_computing

I'm not sure what books to recommend though. I'm not an expert. Distributed systems do not have a specific field exactly. They're a popular topic in Computer Science and in industry.
mantequilla
Profile Blog Joined June 2012
Turkey779 Posts
December 08 2016 23:25 GMT
#16246
On December 09 2016 07:53 Shield wrote:
It reminds me of distributed systems, so it could be that. Here is a link to Wikipedia: https://en.wikipedia.org/wiki/Distributed_computing

I'm not sure what books to recommend though. I'm not an expert. Distributed systems do not have a specific field exactly. They're a popular topic in Computer Science and in industry.



just the topic name is very enough thanks


On December 09 2016 07:14 Shield wrote:
Could you recommend a good geometry book? I come across some software problems which require geometry and I'm having a hard time.


is high school euclidean geometry enough or something advanced like linear geometry needed?
Age of Mythology forever!
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2016-12-08 23:53:32
December 08 2016 23:46 GMT
#16247
On December 09 2016 08:25 mantequilla wrote:
Show nested quote +
On December 09 2016 07:53 Shield wrote:
It reminds me of distributed systems, so it could be that. Here is a link to Wikipedia: https://en.wikipedia.org/wiki/Distributed_computing

I'm not sure what books to recommend though. I'm not an expert. Distributed systems do not have a specific field exactly. They're a popular topic in Computer Science and in industry.



just the topic name is very enough thanks


Show nested quote +
On December 09 2016 07:14 Shield wrote:
Could you recommend a good geometry book? I come across some software problems which require geometry and I'm having a hard time.


is high school euclidean geometry enough or something advanced like linear geometry needed?


I think I should start with something simple like high school geometry. It will refresh my memory and it will be a good foundation before more advanced topics. Do you know any good books or online reading material?

Edit: I have found my Distributed Systems lectures. Lecturer recommended the following book back then, but note that I didn't read it. I just depended on lectures' content.

Andrew S. Tanenbaum, Maarten van Steen
Distributed Systems: Principles and Paradigms
Amazon: https://www.amazon.co.uk/Distributed-Systems-Principles-Andrew-Tanenbaum/dp/153028175X/ref=sr_1_1?ie=UTF8&qid=1481241043&sr=8-1&keywords=Distributed systems: principles and paradigms

Actually, comments suggest that it is outdated now. Maybe someone could suggest a more modern book.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2016-12-09 05:18:48
December 09 2016 01:23 GMT
#16248
--- Nuked ---
phar
Profile Joined August 2011
United States1080 Posts
December 09 2016 04:38 GMT
#16249
That Tanenbaum book is good.

Can also find a lot of random stuff online, e.g.
http://highscalability.com/blog/category/facebook
http://highscalability.com/google-architecture
http://book.mixu.net/distsys/single-page.html

etc etc

If you really want to learn how to do it, get a job at a big company and get paid to do it... you'll learn the hard way.
Who after all is today speaking about the destruction of the Armenians?
Manit0u
Profile Blog Joined August 2004
Poland17244 Posts
December 09 2016 07:26 GMT
#16250
Any book recommendations for Ruby and/or Rails?
Time is precious. Waste it wisely.
Silvanel
Profile Blog Joined March 2003
Poland4725 Posts
December 09 2016 09:47 GMT
#16251
On December 09 2016 10:23 Nesserev wrote:
Amazon seems to have a lot of good reviews for:
Distributed Systems: Concepts and Design - George F. Coulouris, Jean Dollimore, Gordon Blair, Tim Kindberg

EDIT:
Speaking of books, just finished 'Expert Python Programming (Second Edition)' by Michal Jaworski and Tarek Ziadé. I would recommend it to anyone who's familiar with Python, but feels like he/she's not fully up-to-snuff with common practices, features, etc. Gonna keep it as a reference book in my desk stack.


Great. Thanks.
Pathetic Greta hater.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2016-12-09 18:24:36
December 09 2016 18:09 GMT
#16252
On December 09 2016 08:46 Shield wrote:
Show nested quote +
On December 09 2016 08:25 mantequilla wrote:
On December 09 2016 07:53 Shield wrote:
It reminds me of distributed systems, so it could be that. Here is a link to Wikipedia: https://en.wikipedia.org/wiki/Distributed_computing

I'm not sure what books to recommend though. I'm not an expert. Distributed systems do not have a specific field exactly. They're a popular topic in Computer Science and in industry.



just the topic name is very enough thanks


On December 09 2016 07:14 Shield wrote:
Could you recommend a good geometry book? I come across some software problems which require geometry and I'm having a hard time.


is high school euclidean geometry enough or something advanced like linear geometry needed?


I think I should start with something simple like high school geometry. It will refresh my memory and it will be a good foundation before more advanced topics. Do you know any good books or online reading material?

Edit: I have found my Distributed Systems lectures. Lecturer recommended the following book back then, but note that I didn't read it. I just depended on lectures' content.

Andrew S. Tanenbaum, Maarten van Steen
Distributed Systems: Principles and Paradigms
Amazon: https://www.amazon.co.uk/Distributed-Systems-Principles-Andrew-Tanenbaum/dp/153028175X/ref=sr_1_1?ie=UTF8&qid=1481241043&sr=8-1&keywords=Distributed systems: principles and paradigms

Actually, comments suggest that it is outdated now. Maybe someone could suggest a more modern book.


My Distributed Systems lecturer taught things outside of the book but the recommended text was also Tanenbaum, I remember the name.

On December 08 2016 04:07 BluzMan wrote:
Quick question to those already in the industry: do you really (the truth now!) write comments in your code? All the open source libraries have these docstrings and fancy annotations, but does your actual production code not meant for public eyes have any?


Every workplace has different standards, but the sanest reason I can recall to always have comments is that all public interfaces have to be documented. Our system relied on a lot of dependency injection, which meant that you could use a service anywhere in the code. So to make sure anyone who used the service would know what you intended it to do, you would document it. This meant documenting expected events to listen for on the event bus, supported range of inputs to the method, what exactly was starting or stopping or connecting or disconnecting, how that lifecycle was intended to be used, what the class was used for, etc. Implementing the interface would be a lot more self-documenting, AbstractBleConnection into ConcreteBleConnection, etc., but it was also expected to document some hairier parts, if only at the top of the file. Specific design decisions for the change should go in the git commit message if they didn't fit elsewhere.

On December 08 2016 06:45 Chocolate wrote:
What does a day at work look like for you guys? I'm interviewing at some places and trying to figure out what to expect or look for. I did see a prototypical intern schedule somewhere that was like "arrive at 8 am, brush up on work, eat breakfast" and then some more stuff and then "6pm, go to company event with mentors" and I knew to stay the fuck away.

But like what do you do in a day? How much coding (both in terms of time and amount of code written, not lines but functionality) actually gets done? This past summer I was more of a glorified sysadmin (and it was in a research setting too...) than anything so I didn't really get to write very much.


The prototypical intern schedule I've had was more like, arrive at 9-1030 before the first meeting or stand-up in the day, work on something until lunch, lunch, potentially a random meeting, work until end of day at 6-7 depending on when you showed up. And by work I mean like, coding, googling, talking to other interns, asking people for help, organizing your tasks. Granted I interned at Microsoft as well, and Microsoft a bit more than other big name companies don't expect interns to be productive until 6 months after they start, which is obviously more than the length of the internship, so intern expectations are lower, but that's why they also really love returning interns.
There is no one like you in the universe.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2016-12-10 20:15:32
December 10 2016 20:12 GMT
#16253
I think im confusing myself pretty hard right now

I have an array of linked lists

my linked lists have nodes, defined in an inner class. here is it's constructor


node(T data) {
this.data = data;
next = null;
tail = this;
}



When I add an element to an index I do:


if(array[index] == null) {
array[index] = new Node<T>(element);
} else {
array[index].tail.next = new Node<T>(element);
array[index].tail = array[index].tail.next;
}


I think this is working for putting 2 elements into an index. But I think when I put a 3rd element into an index, it overwrites the 2nd element. I don't understand why, though..




edit:

geeze, I type this out and instantly solve my problem. I wasn't doing array[index].tail = array[index].tail.next; when I was resizing my array (if it got too full).

Rubber ducky debugging or w/e it's called really works lol
RoomOfMush
Profile Joined March 2015
1296 Posts
December 10 2016 21:13 GMT
#16254
I hope that code is for an assignment, because if you write code like that for production then oh boy are you in trouble.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
December 10 2016 21:21 GMT
#16255
It's for an assignment and that's not the actual code anyways

like, that's not the naming and formatting
mantequilla
Profile Blog Joined June 2012
Turkey779 Posts
Last Edited: 2016-12-10 23:43:14
December 10 2016 23:16 GMT
#16256
always try to "push the logic down" and meditate on encapsulation...

like I hate the things:


if(product.price == null || product.price == 0)


say insted


if(product.isFree())



how do you guys preserve space (indentation) when posting code here??
Age of Mythology forever!
Blitzkrieg0
Profile Blog Joined August 2010
United States13132 Posts
December 11 2016 00:05 GMT
#16257
On December 11 2016 08:16 mantequilla wrote:
how do you guys preserve space (indentation) when posting code here??


There are code tags in bulletin board code. [.code] [./code]
I'll always be your shadow and veil your eyes from states of ain soph aur.
Targe
Profile Blog Joined February 2012
United Kingdom14103 Posts
Last Edited: 2016-12-11 14:04:46
December 11 2016 13:57 GMT
#16258
im producing TAC from the C compiler im working on but im not sure whether the way ive implemented things is overly complicated compared to what it needs to be, does the following seem to be that way?

for my sample program im using :

void main() {
int x = 1;
return x;
}


and the output TAC i get is:

load t0 1
load x t0
load t1 x
ret t1


my implementation of TAC functions like this:
[OPCODE] [DESTINATION] [OPERAND1] [OPERAND2]

tX are temporary registers, 'x' is the variable x, load loads operand1 into destination, ret returns



distributed/parallel books i was recommended at the start of my parallel course:

+ Show Spoiler +
"Highly Parallel Programming", Almasi & Gottlieb, Benjamin Cummings
"Computer Architecture and Parallel Processing", Hwang & Briggs, McGraw-Hill
"Concurrent Programming Principles and Practice", Andrews, Benjamin Cummings
"Introduction to Parallel Computing", Kumar, Grama, Gupta, Karypis, Benjamin Cummings
"Concurrent Programming", Burns & Davies, Addison-Wesley
"Designing and Building Parallel Programs", Foster, Addison Wesley
"Distributed Algorithms", Lynch, Morgan Kaufmann
"Concurrency: State Models & Java Programs" Magee and Kramer, Wiley
"Introduction to High-Performance Scientific Computing" Eijkhout
"Principles of Concurrent and Distributed Programming", Ben-Ari, Prentice Hall
"Communicating Sequential Processes", Hoare, Prentice Hall


idk if that helps
11/5/14 CATACLYSM | The South West's worst Falco main
Acrofales
Profile Joined August 2010
Spain17971 Posts
December 11 2016 19:41 GMT
#16259
On December 11 2016 08:16 mantequilla wrote:
always try to "push the logic down" and meditate on encapsulation...

like I hate the things:

Show nested quote +

if(product.price == null || product.price == 0)


say insted


Show nested quote +
if(product.isFree())



how do you guys preserve space (indentation) when posting code here??


No. Those are two different things. You should then do:

if(!product.hasPrice() || product.isFree())


and that's just dumb. Perfectly okay to use actual logic clauses, as long as it is a fairly clear case.

And for code, use code tags. It says so in the header of this thread...
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2016-12-11 21:50:24
December 11 2016 21:28 GMT
#16260
edit:

figured it out

rubber ducky debugging is the truth
Prev 1 811 812 813 814 815 1031 Next
Please log in or register to reply.
Live Events Refresh
RotterdaM Event
16:00
Rotti Stream Rumble 4k Edition
RotterdaM957
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 957
Hui .144
StarCraft: Brood War
Bisu 1120
firebathero 221
Bonyth 80
sas.Sziky 52
Rock 9
Dota 2
qojqva3458
Pyrionflax22
League of Legends
Grubby3982
Counter-Strike
fl0m1606
Fnx 1429
ScreaM767
shoxiejesuss679
flusha381
sgares117
Heroes of the Storm
Liquid`Hasu71
Other Games
summit1g1255
B2W.Neo929
Beastyqt921
ceh9629
KnowMe191
Mew2King156
mouzStarbuck155
ToD146
oskar134
Trikslyr69
Sick51
ZombieGrub49
Organizations
Other Games
gamesdonequick49841
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 22 non-featured ]
StarCraft 2
• kabyraGe 247
• LUISG 11
• Reevou 10
• OhrlRock 2
• davetesta1
• IndyKCrew
• sooper7s
• AfreecaTV YouTube
• intothetv
• Kozan
• Migwel
• LaughNgamezSOOP
StarCraft: Brood War
• 80smullet 16
• Michael_bg 5
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota2641
League of Legends
• Jankos2367
• TFBlade1126
Other Games
• imaqtpie1745
• Shiphtur511
Upcoming Events
Replay Cast
4h 40m
Sparkling Tuna Cup
14h 40m
WardiTV European League
20h 40m
MaNa vs sebesdes
Mixu vs Fjant
ByuN vs HeRoMaRinE
ShoWTimE vs goblin
Gerald vs Babymarine
Krystianer vs YoungYakov
PiGosaur Monday
1d 4h
The PondCast
1d 14h
WardiTV European League
1d 16h
Jumy vs NightPhoenix
Percival vs Nicoract
ArT vs HiGhDrA
MaxPax vs Harstem
Scarlett vs Shameless
SKillous vs uThermal
uThermal 2v2 Circuit
1d 20h
Replay Cast
2 days
RSL Revival
2 days
ByuN vs SHIN
Clem vs Reynor
Replay Cast
3 days
[ Show More ]
RSL Revival
3 days
Classic vs Cure
FEL
3 days
RSL Revival
4 days
FEL
4 days
FEL
4 days
BSL20 Non-Korean Champi…
4 days
Bonyth vs QiaoGege
Dewalt vs Fengzi
Hawk vs Zhanhun
Sziky vs Mihu
Mihu vs QiaoGege
Zhanhun vs Sziky
Fengzi vs Hawk
Sparkling Tuna Cup
5 days
RSL Revival
5 days
FEL
5 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Dewalt
QiaoGege vs Dewalt
Hawk vs Bonyth
Sziky vs Fengzi
Mihu vs Zhanhun
QiaoGege vs Zhanhun
Fengzi vs Mihu
Liquipedia Results

Completed

BSL Season 20
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
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
CSL Xiamen Invitational
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...

Disclosure: This page contains affiliate marketing links that support TLnet.

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.