News for hackers. Stuff that matters.

huyegn

I liked the pipelining syntax so much from pyspark and linq that I ended up implementing my own mini linq-like library for python to use in local development. It's mainly used in quick data processing scripts that I run locally. The syntax just makes everything much nicer to work with.

https://datapad.readthedocs.io/en/latest/quickstart.html#ove...

please do update us
What did you do to improve?
Re:Swift Static Linux SDK on Friday June 14, 2024 @03:50PM (#40684364)
Swift for all its niceties still suffers from a habit of inherently tying its conventions to Apple and its "appleisms" when coding. Tasks that should be relatively straightforward to do e.g. iterating through a file line-by-line still requires an awkward amount of code. It's especially noticeable when compared to languages like Go or Python:

https://forums.swift.org/t/text-streaming-in-standard-librar...

While these things are not difficult to solve with some minor additions to the standard library and documentation that emphasizes some basic conventions, the fact that we're on Swift6 and things like this aren't just available speaks to how much further the community needs to evolve to get the language ergonomics right for non apple-y things.

Re:New COVID-19 cases reported across Japan on Tuesday February 18, 2020 @04:37PM (#22360660)
Meanwhile a man from the Westerdam cruise ship, where one passenger already tested positive, escapes quarantine, books ubers, and multiple flights, is arriving back in Seattle:

https://komonews.com/news/local/man-stranded-on-coronavirus-...

Some people can't get more selfish. Also, what a colossal failure on the part of customs and immigration.

Re:Data in SwiftUI, Part 2: Views as a Function of Data on Saturday February 15, 2020 @02:03PM (#22337177)
As someone who has done frontend dev on the web, I find SwiftUI refreshingly good.

Using SwiftUI is the first time ui programming on iOS has clicked for me.

For anyone getting into this, I suggest you take a look at apple's very well done tutorial series before using other sources:

https://developer.apple.com/tutorials/swiftui/tutorials

I spent about 3 days to go through the entire series and the time investment was well worth it.

Re:Sometimes, requiring explanability is counterproductive on Thursday February 06, 2020 @01:15AM (#22253816)
I stated that rather than explainability, for most use cases, people just want calibrated and robust uncertainty estimates NOT low quality and uncalibrated uncertainties estimates.

Your example points to models that provide low quality uncertainty estimates, but that's not true for all deep learning models.

I believe it's these low quality uncertainty estimates that lead people to look toward "explainability" as a solution, but for the majority of use cases, I think people just want better uncertainty estimates so that they can "know when they're model doesn't know".

There are techniques now to get higher quality, calibrated, uncertainty estimates that don't suffer from the problems you mentioned and I've outlined these solutions in my posted link above.

Additionally if you're interested, there is some nice recent research from google on the subject:

https://ai.googleblog.com/2020/01/can-you-trust-your-models-...

and from oxford:

https://arxiv.org/abs/1912.10481v1

Re:Sometimes, requiring explanability is counterproductive on Wednesday February 05, 2020 @11:08PM (#22253352)
That's an interesting idea and I get the motivation. I often wonder if we're already able explain predictions. There are things like gradcam to determine which inputs caused which activations. It's just that the explanations aren't very understandable or satisfying from a human perspective.
Re:Sometimes, requiring explanability is counterproductive on Wednesday February 05, 2020 @02:34PM (#22250247)
I agree with Yann here ... I think the demand for explainability is like a person asking for a "faster horse" when what they really need is a car.

When people ask for explainable models, what they really want (in my opinion) is calibrated and robust uncertainty estimates .

Good uncertainty estimates would let them know when to trust a model's prediction and when to ignore it.

For example, a model trained to predict dog breeds should know nothing about cat breeds, and there should be some way to quantify when it doesn't know!

I've been doing a review of techniques that are becoming more popular in this area:

https://blog.everyhue.me/posts/why-uncertainty-matters/

Re:Queues Don't Fix Overload on Wednesday November 19, 2014 @04:52PM (#8632856)
Absolutely agree with this.

Another nice illustration of how when arrival rate is greater than departure rate we get overflowing queues:

http://setosa.io/blog/2014/09/02/gridlock/index.html

Wow, I just read through the documentation for the Nix package manager and it's a breath of fresh air...Source based builds but with the convenience of pre-compiled binaries hashed with all the input parameters used to create those binaries:

https://nixos.org/nix

Has anyone tried using this for development?

Re:Python for Humans on Tuesday January 03, 2012 @12:15PM (#3420349)
To get around the problem of child subprocesses spewing out too much output and blocking the parent process, one can provide an open file handle to the stdout/stderr arguments of the Popen call. I've ran into this many times and this solution has reliably worked for me every time. This could be documented better in the Python docs.

For quick tasks and scripts, I've found subprocess.check_call, and subprocess.check_output with shell=True are great tools for spawning subprocesses and quickly grabbing output. They're pretty straightforward to use.

Re:Outsourcing Startups on Thursday November 03, 2011 @03:27PM (#3193303)
We're also looking into getting a designer for our site, I'd be interested in hearing how you managed the project.

When you started with your designer, how did you convey the type of look and feel that you wanted to give your business? Did you point them to other similar looking sites or was he/she the one that pushed forward the final vision and design (which BTW looks great)?

Re:Runtime code modification. Erlang? No, Python on Thursday August 18, 2011 @12:12PM (#2899763)
We used this technique once in one of our twisted servers to quickly fix in-memory data structures that had been loaded from old sources.

Recently, my team has been developing most of our newer network services using gevent. It's probably the closest thing to erlang that python has when it comes to programming asynchronous servers.

One of the things I always missed was this manhole feature, but while rummaging around the other day, I found this:

http://www.gevent.org/gevent.backdoor.html

Haven't tried it yet, but it looks like it will achieve the same task :)

Re:Lua/APR - proper standard library for Lua on Friday July 08, 2011 @03:11PM (#2743694)
If you liked Kernighan and Ritchie's "The C Programming Language", then you'll love "Programming In Lua". The first edition is available online here:

http://www.lua.org/pil/

Like K&R, it's style is colloquially terse, yet each sentence is chock full of information. It's a great book for someone who's already coming from another language like Python.

If you're into graphics programming, then http://love2d.org/ would be the perfect vehicle for you to get into Lua while you read PIL.

Re:Duke Nukem Forever Gets Delayed... again on Thursday March 24, 2011 @02:49PM (#2365359)
Part of me thinks this is a genius marketing ploy. Seriously, outside of the few remaining die-hard fans, who even knew that Duke Nukem forever was still being developed? I certainly didn't before this piece of news, and I'll now be watching when they release the thing to see how it goes.
I've been using http://tablib.org/ for awhile now to read in tabular data. With this summary fn and a few other functions to simplify the process of aggregating data into useful views I think you've got a winning solution to the author's complaint.
Re:Don't waste your time by cd-ing in the terminal on Friday February 18, 2011 @07:41PM (#2237924)
Hey Guys,

This is my blog.

FWIW, I've actually switched away from using the script mentioned in the link posted by OP and have moved towards using an improved version below.

http://www.huyng.com/bashmarks-directory-bookmarks-for-the-s...

This new version has 3 commands:

    - "s" for save current directory as a bookmark
    - "g" for jump to bookmark's directory
    - "l" for list all bookmarks.
Re:The Technology Behind Convore on Wednesday February 16, 2011 @05:13PM (#2228572)
We're also using Twisted a lot at my company, IQ Engines. It's powerful and has done a pretty good job for us so far. I just wish the documentation, which is crucial for getting new coworkers up to speed, was better. Do you guys continue to build new services at Justin.TV using it or have you migrated to other eventloops ie Tornado, gevent etc?
It seems like this could be a good opportunity for us to make good use of newly available technologies. Not exactly sure how it would work yet but a Distributed DNS system could be implemented using CouchDB.

Specifically, CouchDB's ability to distribute databases to clients seems like the ideal feature for this technology.

"CouchDB is a peer based distributed database system. Any number of CouchDB hosts (servers and offline-clients) can have independent “replica copies” of the same database, where applications have full database interactivity (query, add, edit, delete). When back online or on a schedule, database changes are replicated bi-directionally."

I've always felt that autojump's "jump" command could be hit or miss when you had directories with similar paths. Because of this, I wrote a tool for myself to quickly jump around to commonly used folders by using short named aliases.

The manual directory alias naming means that you can target the folder that you want much more accurately. Combined with tab-completion, this thing has become a huge productivity booster for me.

link: http://www.huyng.com/bashmarks-directory-bookmarks-for-the-s...

Re:Ask HN: What are some good GoDaddy alternatives? on Monday August 02, 2010 @01:42AM (#1566935)
wanted to upvote nearlyfreespeech. Even though being a registrar is not their main business, their site is a no-bs godsend for managing your domains. My only wish is that they had support for more than the usual .net, .com. .org domains
Re:Ask HN: What's the equivalent to Python, Compiled? on Sunday August 01, 2010 @07:14PM (#1566331)
I initially looked at languages like clojure, but the slow load times of the JVM put me off. Now that you mentioned gcj, I found this note from Rich Hickey: http://groups.google.com/group/clojure/msg/58e3f8e5dfb876c9 which makes it sound like one could compile clojure => java => native binaries.

Ask HN: What's the equivalent to Python, Compiled?

Setting aside the obvious grandaddy of cross-platform compiled languages, C, what would you use if you had to quickly create a suite of commandline utilities that had to work on several platforms (mac, windows, *nix)?The main criteria is that the final binaries must start fast and the programming language must have good libraries for HTTP/Web io

( Read More... | 4 comments | 3 points | on HN )
Re:Ask HN: What's the best way to reinvent myself? on Thursday July 01, 2010 @11:39AM (#1478267)
Hey reinvent,

Send me an email (see the link in my profile) . I can help you get up to speed with Django, real-time systems, and the web industry if you can teach me something valuable about the defense industry.

Re:Node.js is genuinely exciting on Monday November 23, 2009 @12:08PM (#957671)
For those of you who have taken a look at this, is there any library or construct in python that would be equivalent to the Events in Node.js? http://nodejs.org/api.html#_events

That's the deal maker for me... To have custom defined events. Correct me if I'm wrong but even Twisted doesn't have this facility?

Re:Why I like Redis on Thursday October 22, 2009 @07:53PM (#897965)
I LOVE redis, I'm surprised there is so much talk about tokyo cabinet et al, but noone says anything about redis. It's dead simple to setup. The python libraries are super easy to work with. For simple persistence and queue-like abilities there's nothing that can match it.
wow, awesome UI, I looked at source but saw that you minified most of your js. How did you do that sliding panel nav? Do any jquery plugins that you recommend?

I do a lot of jQuery as well but have been frustrated lately by how it's simplicity sometimes also makes it hard to maintain. For example as your app grows, you'll inevitably run into problems where your selectors no longer work because of refactoring and etc... Have you faced the same challenges? If not, what do you do to keep down the complexity?

wow nice ui,I noticed you used jquery for the actual stores but cappuccino for the actual application.
Yep, Gmail's interactivity with its keyboard shortcuts, navigation, settings, chat application and etc is extremely impresive. What's even more amazing is that most of this stuff is all done on one page cross-browser. This is the kind of application I'm talking about. What tools do you use to keep the complexity of such an app under control?

Older »