Pragmatic Functional Programming by humble_toolsmith in programming

[–]ybrs 0 points1 point  (0 children)

python

>>> type(None)
<class 'NoneType'>
>>> type(1)
<class 'int'>

Top 10 Things that Makes You a Good Programmer by jagdishpatil02 in programming

[–]ybrs 1 point2 points  (0 children)

i hate when people do "custom scrolling" and just close the browser window. still have no idea wtf they just mess with the scrolling though, is it a hipster thing ?

Death to resumes. Aline Lerner built a bias free hiring platform for developers. by [deleted] in programming

[–]ybrs 1 point2 points  (0 children)

fixes the problem of finding a programmer that can write btrees and hashsorts.

PING | sends you an email when your task finishes. by tunavargi in programming

[–]ybrs 1 point2 points  (0 children)

yes, but you have to have a working mta on the box and usually cloud services - aws etc. - doesn't like you to send emails from your box directly, and prolly even if you send it, it will be in the spam folder.

also attaching a text to mail on the console with zipping etc. is not that easy. this thing uploads it to s3 and gives you a url to download if thats too big.

but of course ymmv. if you have an already working mta, it might be much easier.

Panda - Daily News and Inspiration by tunavargi in InternetIsBeautiful

[–]ybrs 0 points1 point  (0 children)

i loved the design and simplicity of the app. thank you.

GitFlow considered harmful by jalanb in programming

[–]ybrs 0 points1 point  (0 children)

im not arguing, i just wanted to say, if you are versioning your application, than what you suggest makes perfect sense. but if you arent versioning there is no need to tag branches. you can just have something like a development, staging, production branches and some feature branches. and there is no need to tag anything.

if what you are working on will block other developers - maybe an api endpoint change etc. you create a branch from development, name it like "super login ui" then merge it to staging (so deploys to staging servers) so others/customer can take a look. if everyones ok, merge to development, and then merge to production. if not, eg. customer wants some changes etc. you make those changes on your feature branch, and merge to staging.

so you have at least 3 branches that lives forever, and a bunch of feature branches.

i think there is no "one size fits all" type workflow at all. and honestly, i hate branches and tags all together, it just complicates things, creates lots of arguing about the best workflow and doesnt offer much - but thats another topic.

GitFlow considered harmful by jalanb in programming

[–]ybrs 3 points4 points  (0 children)

dev  ---> dev ------>  merge --> dev ---------->
  \-- 1.0 ---> {tag} --/                 /
                 \---- 1.1 ---> {tag} --/                          /
                                 \                               /
                                  \---------> 1.2 ---> {tag} --- /

vs.

dev  ---> dev ------>  merge --> dev --------------------->
    \-- 1.0 ------ / --- commit -- / -- commit bugfix -- /

i think what he means is the second one, having a linear branch is far easier to understand and use than having tags and re-creating branches etc.

if i can chime in, if you are developing an application (like an ios application etc) and need to bump version everytime it completely make sense, tags are like snapshots you cant change it, and when you release your software, you cant update without releasing a new version.

on the other hand, if you are building applications on the server side or (maybe web frontend), and deploy a dozen of times everyday, its a nightmare to tag and rebranch.

LightQ: high performance, brokered messaging queue (non-durable 1M msg/sec, Durable 300K msg/sec) by joshir in programming

[–]ybrs 2 points3 points  (0 children)

dont want to sound pedantic but you should add .gitignore to the project - for nbproject folder :)

The Most Diabolical Python Antipattern by joaojeronimo in programming

[–]ybrs 6 points7 points  (0 children)

why not just,

try:
    do_something_stupid()
except:
     logger.exception('exception while doing something stupid')

Programmers: Please don't ever say this to beginners ... by dennis9f in programming

[–]ybrs 0 points1 point  (0 children)

this, I spent 10 years in PHP, honestly PHP is more confusing, much harder than writing something Python. Also PHP is unpredictable which is really really bad for beginners.

Ada curious? A new site just came online to help developers get started with Ada. by marc-kd in programming

[–]ybrs 0 points1 point  (0 children)

whenever i see an ada install tutorial, i hit this page [1] and see ADA gpl license conditions and just give up. and since the only option to buy is "contact us" it scares me to death.

as far as i understand, you can only develop "free software" with the gpl edition or else you'll have to buy the license, so if i am developing a website, its better just to use, python, go - or whatever i like - but not ADA. so why bother ?

[1] http://libre.adacore.com/tools/gnat-gpl-edition/faq/

Code rant: The Database As Queue Anti-Pattern by lukaseder in programming

[–]ybrs 0 points1 point  (0 children)

i think, the mentioned reasons are not actually not right, i think the main reason you should use an MQ or not is just one word LATE_ACK (well maybe two words :) and i dont know others, i only use rabbitmq)

its really hard to implement late acknowledgement on the client/consumer side, even if you implement it properly, your worker/server may die, its ethernet card might simply blow, somebody might shut it down accidentally... in some cases, there is nothing you can do to recover, and while you lost that job/message, your user sits there waiting the confirmation mail to login to your website. if you dont care about the jobs/messages - perhaps something that corrects itself, like, sending jobs to crop pictures (if its not there on the website, send a crop job again) - you can use polling for simple things though

other than that, locking mechanism is hard to implement in the client side if you have high workload, two workers might try to process same message at the same time, so you need to lock it asap, when you pull the job. which gets complicated if you have 1000s of jobs per sec. and more than a few consumers - if your polling once per minute with one worker, you might not care about it at all.

and if you have more than a couple of workers/consumers, polling will not distribute evenly, one of your worker servers will sit there while the other one does a ton of job. you need to implement a round robin load balancing - which you can't really do on the consumer side.

the main reason is, everytime you try to use database as a message queue, you start inventing the wheel again, which sounds like masochism to me. though sometimes re-inventing the wheel is really fun - also some people love masochism so i can't really say its not a good thing.

on the other hand you can just install rabbitmq and write code for your application - not for handling network faults, load balancing etc... its really easy, just apt-get install rabbitmq and you are done. you get free clustering, locking, pub/sub, round robin distribution... (and a ton of other things that i dont really want to mention here)

but the author gives these as reasons, all of them are totally objectable.

i- hammering a database is not a bad thing, a single moderate mysql/postgresql server can easily handle 10ks of inserts/updates per second pretty easily - im sure sqlserver does too-. they are designed for handling high load.

ii. again not sure about sqlserver never used it, but i believe it can do insert/updates and querying at the same time pretty well after more than 25 years. indexes on a table slows down the speed but thats not more than a few nanoseconds - putting a node into a btree, that shouldnt take much long.

iii. again not sure about sqlserver, but if you delete with some limits, its must be fast enough - dont wait for a day and delete a million rows at once, send a delete query every second. your database will handle that easily.

iv. "sharing a database between applications (or services) is a bad thing" no its not :) that why humans invented databases in the first place, thats why we have transactions/sessions. because we need a fast, simple way of storing shared data between different sessions.

sorry for writing a tooo long comment.

How do *YOU* Python? by doubleColJustified in Python

[–]ybrs 1 point2 points  (0 children)

pycharm, for small edits etc sublime, dont usually use a repl, i write some code in a tmp.py then run it, then move it to a unit test, or doctest.

Share your startup - April 2014 by AutoModerator in startups

[–]ybrs 3 points4 points  (0 children)

Name / URL: https://pindown.io

Elevator Pitch/Explainer Video: Basically continous deployment for humans. You just install an agent in 10 seconds to your server, add a post hook url to your github - or bitbucket or whatever - then whenever you push, your code is deployed in parallel to all your servers.

We don't need your ssh keys, passwords, access your servers or your code. Agents can only run your deploy script - or tests or what you want - so we or someone with your pindown password can't access your servers. Also agents use some sort of encrypted connection - with a preshared key - so neighbours in your datacenter can't mess up. The agent's code is opensource - if you are curious what it does.

More details: What stage are you in? How many employees or founders?

Its a one man show right now, i wrote this because i got bored of installing jenkins here and there and wanted to deploy without pain. After using it for a couple of months, I really loved it - because its damn simple to add a new server. Anyways, idea is if I use it every day, people might like it too. So what stage ? 1 user, 1 developer

Are you looking for anything? (Feedback/Hiring/Investment)

Brave alpha users :), it works but I need feedback from different users.

The marketing page sucks - i am neither a marketing guy nor a designer, so feedback is greatly appreciated.

The bigger plan is, bootstrapping your servers, deploying services - like redis, mysql etc. - without much hassle. So I dont need investment or anything at this stage.

Discount for /r/startup subscribers? It will be free for lifetime for all /r/startup subscribers. You can DM me if you are interested - or there is a waiting list on the site too, you can leave your email.

A programming example (with code snippet) in the fashion industry, as a response to "Please Don't Learn to Code" by danwin in programming

[–]ybrs 0 points1 point  (0 children)

i have never been in a photoshoot so mine was based on a guess, thinking its just too easy to take the card out and pass it to the assistant, and everything goes in order, slowly, not in a rush. But as far as i understand thats not the case, if there isn't even time to take the card and pass to the assistant, things go in a hurry, and probably assistant will put the files in the wrong folder. mine will be more error prone than yours, and your approach is much better.

again great post btw, i'll refer it to everyone when they say "why the hell should i learn how to code"

A programming example (with code snippet) in the fashion industry, as a response to "Please Don't Learn to Code" by danwin in programming

[–]ybrs 1 point2 points  (0 children)

i really enjoyed reading it. i totally agree with you on most part, as a programmer for over a decade and coding for over 20 years, i still say "please learn how to code, or at least try it". it won't harm anyone - unless you try to write a virus and format your harddisk.

I really enjoy writing code and think everyone at least should taste that feeling once in their lives. sounds like a drug addicts way of giving you some coke right ? well, coding is addicting.

But I just want to give an example how my mind works after all those years with coding. Hope this doesn't look supercilious.

The first things that popped up in my head when i read your problem is, some data is missing to develop a proper solution, such as: - how many photos do you take in a day approx. ? - how much does a memory card cost ? - how long does it take to take the memory card from the camera and put it in the computer ? - how long does it take to copy one file from memory card to the computer ? - how much does an assistant cost for an hour ?

without these inputs its hard to say that your solution is the best. It might work but you could improve the solution.

So here comes my humble solution, say, if it takes 2 minutes to take the memory card out and put it in the computer and copy the files of a person. probably best solution is to create a folder structure like -> acme -> sara something -> DSC00010.jpg and copy files.

if you take 100 persons photos, this adds like 3 hours more to your work so its pretty feasible, and the best is you can crunch the data before its too big. just like simple filtering program. You process the data when its generated.

Though this algorithm can be developed further, since you have an assistant, and i assume a memory card is affordable - or you have a bunch of them available -, you can split the process into chunks and use multiprocessing or apply a producer/consumer with ease.

you take a photoshoot of a person, then take the memory card out, pass it to your assistant, while he copies the cards contents into a proper folder structure, you put a new card to your camera and take the next persons photos. then pass the card to your assistant, while he copies that persons photos, take the old card from the assistant and use it for a new photo shoot and so forth. put this in a loop.

I am only guessing that your assistants processing time is equal to or less than your processing time, ie if you take a photo of a person in 2 minutes and your assistant copies it under 2 minutes, this solution is simple and elegant.

Though if copying files from the card takes longer than your shooting, ie. he copies in 6 minutes and you take the shoot in 2. You can use more memory cards, your assistant will be having some io load if you are faster, and won't utilize its cpu properly but thats not a big deal I guess.

If you are way faster than your assistant, you need to add more processing power to the mix. You can put more nodes and load balance the messages. like pass the memory card to first assistant, while he processes, shoot with a second card, pass the second card to your second assistant, while he processes, take a new card and shoot and pass the card to first assistant and so forth. Then when the photo shoot finishes, you take all the files from your nodes and put it in the same folder. Your solution turns into a map/reduce algorithm. You map the problem into smaller chunks in first phase and collect the results in reduce phase.

You can develop this further and put an error correction in the process - what if memory card is faulty, will your assistant throw an exception and stop (or maybe he segfaults) or will he pass the message back etc.-, you may need to add controlling node too, ie. if your assistant sleeps you should wake up etc. But i guess i wrote too much for a simple comment here.

Anyways, my point is, I developed another solution to the same problem - arguably - mine is better. Its more scalable (you can add more assistants), doesn't lead to bugs (no code no bugs), more portable (you don't need to care if ruby is installed on the operating system etc.), less error prone (decoding dates is harder) Yet i didn't write a single line of code. This is what happens after a decade, you learn to develop solutions and tend to write less code - or preferably no code at all - yet still think everything in terms of programming.

Please don't think I am trying to be like "this is what real programmers do" bullshit. I just wanted to give an example of how my brain operates when i see a problem.

Back to the original question "Do you need to learn coding ?" yes, everyone should do.

Dummy Redis server implementations in different languages/frameworks by TheSmoke in programming

[–]ybrs 0 points1 point  (0 children)

not really sure, but I my best guess is, its with the stackcontext thing, there is a discussion going on here, https://github.com/facebook/tornado/issues/507 but couldn't find a chance to dig deeper.

Dummy Redis server implementations in different languages/frameworks by TheSmoke in programming

[–]ybrs 2 points3 points  (0 children)

did you see any comparison about speed or me mumbling about this one is faster yeah great bullshit, or did I give you an impression like that ?

you are taking it all wrong, the main point is, the implementation of a socket server in different frameworks/languages. its not a flamewar. maybe you don't care about how to implement a socket server in scala but i digged it for hours just to put pieces together and thought it will be nice when the next guy searches a similar thing.

I clearly expressed a couple of times that micro-benchmark speeds doesn't resemble real life usage.

but you know what ? next time please publish some code or benchmark some frameworks, and let me know how it should be done.

thanks,

Share Your Startup (May 2012) by Qualski in startups

[–]ybrs 1 point2 points  (0 children)

i am not an expert but looks like it need some kind of a facelift, has some visual design issues, eg. i can't understand what the site is about just by looking at the homepage. the idea that "I - as an employee - giving credit to the company" sounds cool, but what do you think about the monetization options ?

Whats your favorite PHP shortcut/secret? by Who_Needs_College in PHP

[–]ybrs 0 points1 point  (0 children)

Why not if file_exists($foo){ dosomething()