1,720 karma · joined Jul 15, 2011 (15y ago) · 894 submissions
comment 12y ago · link · parent
When that kind of response comes from the site's moderator, I really don't see the level of toxicity improving any time soon.
It's likely statistically factual, but in context it's just another of the "mean, stupid things" that Paul Graham called you out as being here to address. And you appear to have done nothing to investigate whether the previous user's post was factually correct before slinging personal accusations.
If this gets me hellbanned too, so be it. Conversation and community on this site is a toxic mess that leaves people afraid to post anything. The main good thing is following users like patio11 and tptacek.
http://blog.ycombinator.com/meet-the-people-taking-over-hack...
comment 12y ago · link · parent
How closely that approximates the desired scenario with regards to e.g. hiring and social signalling is another question. It would presumably be bounded by the status of e.g. Microsoft Japan, which is in turn bounded by Sony. Which is to say, not as good, but possibly good enough for most intents which don't involve hiring new grads shoulder-to-shoulder with Sony.
comment 12y ago · link · parent
"Oh, that's easy, I could implement all that in a weekend" - One, no. And two, no. Problems are always deeper than they seem, and it's usually the extra 90% that determines how well it works.
comment 12y ago · link · parent
The work is generally entangled per the terms of your contract. If you want to do anything particular with it, the contract needs to cover that.
Specific things you may be thinking of:
* Showing off "portfolio samples" based on incomplete work - this is apt to annoy clients if you're not careful with it, and any given portfolio sample is unlikely to make or break your ability to land clients. If you think it might, you need to take a hard look at your sales process.
* Code reuse - this should be something your contract already covers for all projects. This code is mine, I am licensing this particular configuration of it for you to use based on specific terms, and assuming that you complete your end of the contract (i.e. pay me).
comment 12y ago · link · parent
from requests_oauthlib import OAuth1Session
import json
keys = json.loads(open(keyfile).read())
# {"TWITTER_CONSUMER_KEY": "blah_blah_blah",
# "TWITTER_CONSUMER_SECRET": "blah_blah_blah",
# "TWITTER_ACCESS_TOKEN": "blah_blah_blah",
# "TWITTER_ACCESS_TOKEN_SECRET": "blah_blah_blah",}
def twitter():
return OAuth1Session(keys['TWITTER_CONSUMER_KEY'],
client_secret=keys['TWITTER_CONSUMER_SECRET'],
resource_owner_key=keys['TWITTER_ACCESS_TOKEN'],
resource_owner_secret=keys['TWITTER_ACCESS_TOKEN_SECRET'])
def tweet(status, reply_to=None):
endpoint = 'https://api.twitter.com/1.1/statuses/update.json'
data = {'status': status}
r = twitter().post(endpoint, data=data)
return r.status_code
def tweet_with_image(status, imgfile, reply_to=None):
endpoint = 'https://api.twitter.com/1.1/statuses/update_with_media.json'
data = {'status': status}
if reply_to is not None:
data.update({'in_reply_to_status_id': reply_to})
r = twitter().post(endpoint, data=data, files={'media[]': open(imgfile, 'rb').read()})
return r.status_codecomment 12y ago · link · parent
Sure, people could go out and spend the time to learn just about anything. In practice, they won't, because that's competing with all the other anythings they could be doing.
Sell the thing that actually has significant barrier to entry.
You take care of the easy thing too, because making the client spend meaningful attention on something that would take you five minutes is just silly, and you're there so they don't have to worry about that stuff. But sell the hard thing.
comment 12y ago · link · parent
Your target market is thus (more or less) restricted to people who don't yet meet that level of experience and professionalism. You get the contractors that have no existing clients and no clue how to approach companies, and you get the project owners who are out to get bargain-basement labor and firmly believe they'll be the one poster who gets lucky and finds a contractor who works on the internet yet is too inexperienced to realize what that means for their billable rates.
This is still a potential market, but you've lost the more desirable end of the pool before you even leave the gate. And even if that is the end of the pool you want to provide value to - you can provide far more value by helping them move upstream, rather than trying to stamp out another marketplace which is a bad solution from its conception.
comment 12y ago · link · parent
Is it more important to shorten the time to display the current request, or to shorten the time for new pages to be rendered? Single-page apps marginally increase the current request's time-to-render in exchange for improving navigation between pages. For some purposes that provides a significant benefit, other times it doesn't.
comment 12y ago · link · parent
Mind you, it's a tool I'm very good with, and that I get intrinsic enjoyment from when using it. But I don't do it 24/7, and I also get intrinsic enjoyment from woodworking, soldering, cooking...
Some people are invested in getting you to believe a narrative where coders code, all the time, 80 hours a week even if you don't pay them, like they're one-dimensional widgets instead of people. If anyone tries to feed you that line, I'd take a good hard think about why.
comment 12y ago · link · parent
The main issue, irrespective of language, is that the implementation of your final model is often a distinct step from the last output of your experimental tools. If you just take what it gives you and try to deploy that, it will often provide extremely suboptimal performance.
The methods for implementing your final model could involve raw Python, NumPy, the Python wrapper for an external library, writing and consuming custom C libs...it depends on the complexity of the hyperplanes.
But e.g. scikit-learn already wraps libsvm and liblinear. If your SVM (etc.) is slow, it's very unlikely to be because you used Python.
If you're e.g. trying to do Facebook-level heavy lifting, your experiences may vary. But again, that would be a challenge for any tools. The solution is to use sampling, parallelism, etc. - and to implement and optimize your final model as a separate step from designing it.
comment 12y ago · link · parent
What you have to understand is that pythonic Python is largely a matter of invoking C libraries, and that Python only really runs at "interpreted" speed the first time you invoke the code.
It's no more slow than a shell script which serves to invoke grep and sed would be, because you're relying on the underlying optimized tools to execute the bits that would actually benefit from optimization. The microseconds it takes to switch from one to the other are almost never going to be a meaningful slice of the total execution time.
Instead of picking over the mostly insignificant delays that are left, Python has said "hey, let's optimize for readability & developer sanity instead — things that actually affect project outcomes." And then you go knock off 10 different issues you wouldn't have had time for, and you don't stab yourself in the eye with a fork while trying to make sense of the old code.
comment 12y ago · link · parent
The whole 2 vs. 3 is, if anything, an embarrassing interlude in getting to the fact that it's currently both amazing for beginners and one of the most versatile professional languages. Where it's not the best, it's often fighting "mainly good for this one problem area" tools and languages to a draw...while still being great for dozens of other problem areas.
Cracks about "really easy to use orbital death cannons being handed out to anyone who asks" aside - your best comparison is probably a trench knife. Simple, elegant, gets the job done whatever that job happens to be.
comment 12y ago · link · parent
And I only say "probably" because it sounds like you're looking for a local W-2 gig, and there are some places (e.g. rural Idaho) where there's likely to be a shortage of potential employers.
Elsewhere, consider "any company with senior programmers to report to" as a location which is probably hiring, or at least entertaining applicants - regardless of what any public listings may say about what openings exist, or how much experience or what madcap assortment of skills any job postings say that they'd like (yes, like).
comment 12y ago · link · parent
This is normally used for e.g. selling fake likes. It's taken as a given that you will have regular churn as accounts are detected, occasionally high spikes of turnover as fraud detection and safeguards change, that kind of stuff. Often the action of converting network behavior into currency activity is what burns accounts.
Given an alternative way of rapidly converting part of that network into a compelling quantity of USD, and the fact that you're routinely rotating accounts anyway...offering to pay money or money-equivalents for Facebook connections in an automated fashion is pretty much screaming for fraudsters to call in the biggest airstrike they can before you come to your senses.
comment 12y ago · link · parent
foo_script.py
from flask import render_template
from flask_wtf import Form
from wtforms import TextField
from wtforms.validators import DataRequired
class ScriptForm(Form):
param1 = TextField('Param1', validators=[DataRequired()])
param2 = TextField('Param2', validators=[DataRequired()])
param3 = TextField('Param3', validators=[DataRequired()])
@app.route('/foo-script', methods=('GET', 'POST'))
def foo_script():
form = ScriptForm()
if form.validate_on_submit():
do_stuff(form.data)
else:
return render_template('foo_script.html', form=form)
def do_stuff(data):
for key in data:
print '%s: %s' % (key, data[key])
foo_script.html {% extends "base.html" %}
{% block content %}
<h3>Run foo script:</h3>
<form method="POST" action="{{ url_for('foo_script') }}">
{{ form.hidden_tag() }}
{{ form.param1.label }} {{ form.param1 }}
{{ form.param2.label }} {{ form.param2 }}
{{ form.param3.label }} {{ form.param3 }}
<input type="submit" value="Run foo script">
</form>
{% endblock %}
base.html <!DOCTYPE html>
<html lang="en">
<head>
<title>FooCorp Script Service</title>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>
app.py from flask import Flask
app = Flask(__name__)
app.config.from_pyfile('config.py')
import foo_script, bar_script, baz_script
config.py # You need this for CSRF protection & cookie signing
SECRET_KEY = randomly_generated_secret_key
You should also look into Flask's blueprints at some point if it keeps growing. But it's not really essential, just another tool to help you keep projects organized. Flask is mostly "do whatever makes sense in your specific case" rather than imposing many global constraints on structure.Also, I'd use gunicorn if you're deploying your own server. It's a bit less intimidating to get set up than uWSGI, and the main tradeoff is that it doesn't support quite as many thousands of users (i.e. not relevant).
comment 12y ago · link · parent
Internal if you have the IT resources & infrastructure for that to be reasonably painless. VPS if you need to access it from multiple public locations and don't want to expose an internal server, or if "internal server" isn't a thing where you work. Heroku if you don't know how to admin Linux or don't want to spend the time worrying about it.
comment 12y ago · link · parent
https://flask-wtf.readthedocs.org/en/latest/
It can also handle file uploads.
https://flask-wtf.readthedocs.org/en/latest/form.html
You'd need to define a model which describes the form fields, handle it in your view, and add it to your page template.
forms.py
from flask_wtf import Form
from wtforms import TextField, PasswordField
from wtforms.validators import DataRequired
class LoginForm(Form):
email = TextField('Email', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
views.py from forms import LoginForm
@app.route('/login', methods=('GET', 'POST'))
def login():
form = LoginForm()
if form.validate_on_submit():
email = form.data.get('email', None)
password = form.data.get('password', None)
do_login_stuff(email, password)
else:
return render_template('login_page.html', form=form)
login_page.html {% extends "base.html" %}
{% block content %}
<h3>Log in:</h3>
<form method="POST" action="{{ url_for('login') }}">
{{ form.hidden_tag() }}
{{ form.email.label }} {{ form.email }}
{{ form.password.label }} {{ form.password }}
<input type="submit" value="Log in">
</form>
{% endblock %}comment 12y ago · link · parent
If people are actually getting use out of it, go back and pretty it up a bit with a Bootstrap template or whatever, it doesn't take much here to have meaningful effects on user perception. It mostly just has to be nice enough that it looks reasonably professional when people show it off in meetings, which is NOT a cutting-edge design problem.
Add more pages for more scripts as needed, and tag users with permissions so you know which scripts should be exposed to which users.
If merited, go back and add fancy features like generating PDF reports and emailing them to the head of department every week.
comment 12y ago · link · parent
Either they can meet your compensation requirements, or they can't and you go elsewhere, or you find a compromise if you both want it to work.
If you're a decent engineer who can get things done and out the door to some reasonable professional standard, there are a LOT of elsewheres.
comment 12y ago · link · parent
Jamming (active):
Broadcast so much noise at the relevant frequencies that it drowns out any other signal the devices might try to interact with. You throw a lot of power into going LALALALALALALALA at the frequency bands you expect the devices you want to jam to be interacting at, then they can't hear each other over you. It's actually not a particularly hard engineering problem until you start worrying about heat and efficiency - you just build a transmitter and broadcast noise at high power.
Blocking (passive):
Use a Faraday cage or sheer mass to prevent signals from being broadcast into or out of an enclosed area. Mass attenuates signals depending on thickness, density, and frequency. A Faraday cage uses a powered metal mesh to maintain constant voltage at a surface, which can kill most transmissions without the need to turn your building into a bunker.
But assuming this is actually allowed by your local laws, you still shouldn't do it. It's hazardous and unethical since it will also disrupt e.g. emergency communications. If you're bothered by impolite cell phone use, you should pursue a social remedy which allows for extreme cases where manners are not the biggest concern, rather than a technical one which is blind to significant edge cases.
For military applications:
You don't have an enclosed area to work with, so you mostly use jamming devices with as much power as you can manage. But this gets used less than you might think from Hollywood, since a major cost of using them is that you're very loudly shouting your general position to anyone who cares about that and access to some basic electronics. Also the really good ones are set up as buildings or vehicles, it's not going to be small if you want power on the order of "shout so loud a civilian radio station can't hear itself think."
Passive compliments:
Anti-radar stealth technology, which is where you try to make yourself as much of a pain in the ass to make out clearly as you can manage. This is far more difficult since you don't have a controlled environment to play with, but there's still a lot you can do with clever shapes and surface design. Also the point is less to make yourself invisible, than it is to reduce the amount of advance warning that an opponent would get, or their ability to respond to changes in your vector.
Chaff countermeasures are easier, you basically launch a bunch of stuff that's highly reflective at the frequencies people are trying to track you with. I think this is mostly an air-to-air thing. It actually works pretty well, at least in terms of "make it less likely that you get shot down." But if the other guy has reasonably modern targeting systems, you can bet he's got chaff too since it amounts to a thing that shoots out tinfoil confetti.