skysight-inc/HackerNews huggingface dataset:
This sort of approach is a pain to use, because you keep having to cast when you're in the debugger, and there's zero type safety. And I'm afraid I don't have much positive to say about something like "((Vector2i * )arr3->data)[0].x = 333".

You can do better than this!

What is an array? It's 3 variables: base, length and capacity. So why not decide that an array is just that. 3 variables of the right size and type.

#define ARRAY(T,S) T S;size_t S##_length;size_t S##_capacity

Then you can make one like this:

ARRAY(int,xs);

You'll also need to initialise and these destroy array "objects".

#define ARRAY_INIT(S) \
do { \
S=NULL; \
(S##_length)=0; \
(S##_capacity)=0; \
} while(0)

#define ARRAY_DESTROY(S) \
do { \
Array_Free(S); \
ARRAY_INIT(S); \
} while(0)

Add you'll probably want to add an item to an array too.

#define ARRAY_ADD(S,X) \
do { \
if((S##_length)>=(S##_capacity)) { \
S=Array_Grow(S, \
sizeof *S, \
&(S##_length), \
&(S##_capacity)); \
S[S##_length++]=(X); \
} while(0)

So you might use them like this:

ARRAY(int,xs);
ARRAY_INIT(xs);
for(int i=0;i<100;++i)
ARRAY_ADD(xs,i);
ARRAY_DESTROY(xs);

Array_Free is very simple, and Array_Grow is barely more complicated (however I wrote it off the cuff, so of course it could still be wrong). Both of these mainly exist just to keep stdlib.h out of the header.

void Array_Free(void *p) {
free(p);
}

void *Array_Grow(void *base,size_t stride,size_t *length,size_t *capacity) {
*capacity+=*capacity/2;
*capacity=MAX(*capacity,MAX(MIN_CAPACITY,*length));
return realloc(base,*capacity*stride);
}

Array accesses and iteration and the like are just done in the traditional way:

for(size_t i=0;i<xs_length;++i) {
printf("%d\n",xs[i]);
}

Even performs nicely with -O0.

For a full implementation you'll probably also need a way of generating a static array. (I mainly found myself needing this for test code, which uses globals for convenience; most arrays I create normally are locals, or parts of structs.)

You'll also need a parameters list for use in a function declaration or definition, and a macro that expands to all 3 variables.

#define ARRAY_PARAMS(T,S) T *S,size_t S##_length,size_t S##_capacity
#define ARRAY_ARG(S) S,S##_length,S##_capacity

Like then you might have a function that takes a pointer to an "array":

void FunctionThatTakesAnArray(ARRAY_PARAMS(T,*p));

And you call it like this:

ARRAY(T,myarray);
FunctionThatTakesAnArray(ARRAY_ARG(&myarray));

(I found this cropped up often enough that I needed the macro, but it was less common than I thought.)

There's more you can do, but the above is the long and the short of it.

This might all look terrible - or perhaps it sort of looks OK, but you're just not sure that it would actually work - but I've used this in a prototype project and thought it worked out well. (I've been using C for 20+ years, so hopefully even if I've got no taste, I've at least got a rough feel for what works out OK and what's going to end up a disaster.)
The link to SolarDome explains the dome uses single glass, so the dome has virtually no isolation. In other words, it freezes inside unless they have external energy sources for heating.
>while pretending to be sciency.

It's almost as though it's science fiction...
I think Clojure is so much better with emacs, and teaching working tooling is the key to teaching a language. That's because actually doing the coding is the key to understanding the language. Emacs is by far the best editor out there for this language. One of the trickiest aspects to picking up emacs is the emacs init files, which the author provided. I just think it's awesome that he takes you from zero to a working development environment and doesn't leave getting code running as an exercise for the reader (which would mean many wouldn't get it running).
MFA 1988 Intermedia (my BA was in Film). I did most of my master's degree in a Photography department using xerography (Photocopy) as my main medium, so I was friendly with technology to begin with. Got a Mac fairly early, in 1987, as soon as I realized I could set professional-looking type on it. I was always interested in both precise exression and flexible experimentation.

As someone who matured as an artist on the cusp of the transition from analog to digital, I feel I have a one foot firmly planted in both. Analog is more forgiving, the digital environment requires rigor. Now I am more or less a designer by paid profession (and a sound artist by chosen profession) and I make web sites for a living, mainly for cultural institutions. (Mostly using Drupal, in case you are interested.) I went from xerox to here by essentially being fascinated by publishing, the sheer difficulty and amount of work it took to put words on paper; and thence to the web, where it became somewhat (ahem) easier.
Ooh, this is me. I was into both computers and art in high school. I'd thought myself basic and pascal, worked as an assistant at an engineering company and was in a special art program at school. I went to a small liberal arts college unsure of which to pursue. I told my advisor I was unsure whether I wanted art or computer major. He happened to be the art dean, so that's what I signed up for, thinking I could change it if I wanted. I took some computer courses, but they were so outdated- stuff I already knew. So I stuck with art. I assumed I would do graphic design, since that seems the natural marriage of the two, but focused on fine art because I enjoyed that more. I applied for a developer position doing some web dev, taught myself VB and C#, and did a little graphic design. But the company needed more line-of-business apps, reports, etc. So that's what I did. My manager and I eventually started a consulting company, doing similar for all sorts of organizations.

I actually don't do fine art or graphic design much these days, though do want to do more on the side. For intranet apps it's just easier/cheaper to get a canned layout than design one from scratch. I do value my art education for teaching me some mental approaches to problem solving in app dev. In painting (usually), you work general to specific. Block in the big picture, then break down into more and more detail gradually. I take this approach in my apps: understand the problem, then go and block out the main classes, pages, etc. I gradually add code, adjust layouts, etc until it does what the customer needs. I also grew a thick skin in critique that I think helped me listen to criticism better ;)

I do feel I had some lucky breaks to be a fine arts major with a paying job. People took a chance on me that maybe not all art majors would get. But I do 15 years later still appreciate both and am glad for my art major.
Looking at the list of code that this person created, I don't think it's wanted on Windows anyway. It's just a bunch of low-level utils that are already built-in to Windows or have better third-party alternatives.

If this guy had built something good like VLC media player - nobody would have listened to him and it would have been forked, ported and his version would have been forgotten by now.

(Oh and I bet more than half of his crummy apps will easily run on Apple's OS and Apple is arguably worse than Microsoft had ever been.)
> if your doing it on a Thinkpad

What's so special about the fedora Thinkpad combo?
A good explanation of ripe atlas can be found at Cisco ipj journal http://ipj.dreamhosters.com/wp-content/uploads/2015/10/ipj18...
For those who did not read it or missed it, at the end of the article there is a link to Jørgen Veisdal's 2013 undergraduate thesis paper.

http://www.jorgenveisdal.com/files/jorgenveisdal-thesis13.pd...
But there's also the inherent difficulties like deciding if something fits your budget, or if you have room for it, or which of a set of options you want.

I'd expect a tiny reduction in difficulty of ordering something (especially while making it harder to be sure what something you're ordering) wouldn't help much. What I would expect to matter, is how easy the entire process is compared to at other stores.

Unless they're just counting on preying on poorly-thought-out impulse buys?
I graduated with a degree in Graphic Design and worked as a designer for a little over a year before I made the switch to full time development. It really depends on if you are doing back-end or front-end programming, because it can affect each in a different way. For back-end, you might think through problems in a different way than someone with a CS degree would, which can be really helpful on a team and bring a different perspective. With that said, your skills would definitely be more apparent working on the front-end. Developers with a design eye/background are a designers dream. You will notice little design flaws (offset padding, font style, font size, etc.) that other developers might miss. As a designer who used to work with developers, that can be the most frustrating and time consuming thing of all time. So for me personally, it's definitely transferred over well for me and made me both a better developer AND designer.
You can't just pluck a price out of thin air. I mean, you could, but it probably wouldn't provide the results you want.

You have to examine a number of things like the type of customer you're going after, the market environment, your name recognition, your runway and many others. Here's a simple framework that might be helpful. [0]

There is no law that you have to (or even should) price similarly to substantially similar products. There are many market inefficiencies that may allow you to charge much more than your supposed competitors. I'm writing a book on that very subject right now. [1]

In the meantime, here's an example of a pricing page teardown that I performed on Safari Books.[2] Looking at the mistakes they made may provide you with some insight into the types of problems that you will want to avoid.

* [0] https://taprun.com/framework/

* [1] http://taprun.com/premium/

* [2] https://taprun.com/examples/safari/
I think it's more of an internet company trying to run a business in a country without respecting the law which applies to you if you do business there.
This is in fact the case for many countries beside Russia and there is no valid reason for another country to allow a company, which is running operations from a country known to not respecting a persons privacy regardless of its citizenship, to run a business in your country without been able to protect your citizens.
Totally agreed. Actors and artists have to develop a thick skin or else they would whimper daily. :D

Any job where you are sort of putting yourself out there in the form of your work can be quite demoralizing, especially with the wrong people in charge. Programmers can be just as touchy about their work as artists--I've seen it personally. Some of this may have to do with cultural diffs. Some cultures seem (at least to me, with limited exposure) to be more or less amenable to "being nice" about criticism.
Why is this in English? Both the ad itself, and the prompt for Siri - which is presumably set to Swedish on most people's phones in Sweden?
I loved westworld. I think it shows imagination and elevates TV. But it starts at a point where the AI is already real. They robots are able to parse reality in all 5 senses in real time and respond. The are physically sophisticated, are supposed to be bio-chemical and match humans in dexterity and motion.

Season 1 focuses on the next step which is consciousness and choice, and the 2 critical theories to explain the emergence of these in the show is bicameralism and memory. It doesn't dwell too much on the how and focuses more on the consequences of it, which is a fascinating journey.
Well said.

Similar path here. I'd just add that visual design (and to a lesser extent, interaction design and ux design) is becoming commoditized due to common CSS libraries and patterns, WYSIWYG website building tools, more accessible design tools like Sketch, and a general convergence and consensus on best practices.

I switched to web development from product/digital design, then more recently to iOS development. I'm really glad I have a design background, especially with iOS/mobile where users have a higher experience bar, and where pretty much any interaction is not just achievable but easy.
I have a degree in Fine Arts and am mostly doing painting nowadays.

Developing your very own attitude towards things and being able to defend it helped me in many ways outside art.
Unfortunate that it isn't published on Packagist, or installable via Composer.
I .. am reading this in my bed. I need to reflect.
Physical activity reduces heart disease deaths for older adults
Yeah I don't think the idea is taken seriously for humans. But it's an interesting way to program a robot.
Setting up arch and installing apps on it is a PITA. Especially for those who don't know what to choose. Debian-based distros used to be ok for development.
Just go to a bodega?
Things like this always make me think of Martian settlement and what kinds if clever building methods we might discover there.
The thing is, we get dispointed when the code just looks like "C compiled with C++ compiler", with all security exploits that entails.

A good example is how Turbo Vision, Object Windows Library, Visual Components Library, Qt look like and the concessions Microsoft had to make to Afx so that it got rebranded into MFC and appealed to the Windows C developers.
AI and Machine learning, while important technologies, are at a high risk of becoming a buzzword (if they haven't already). To what extent do you agree with the fact that the end output or experience matters more than the tools (like AI, etc) used to create them?
I want something like std::vector, but I don't want exceptions. How does C++ help in this case?
Solar in the arctic circle? Isn't the arctic circle defined as the place where the sun doesn't shine in winter?

During the summer, I'm sure it's great there. The architecture is beautiful. But it just doesn't seem practical year-round.
They can at least set a PIN for voice purchasing. Which IMO should be the default behavior..
This gets messy in a couple of ways; for example, what if you want to pass two of them to a function? Then the names of the parameters generated by the ARRAY_ARG macro will clash and you'll have to add a counter to it, etc. (Also I'm not sure that you can concatenate `* p` with `_length` in `S##_length` where `S` is `* p`, and the same thing for the other, but I understand what you meant.) You'll also have potentially very confusing errors for the users of your library when they happen to create a variable whose name collides with one that the macro generates. And those are just the cursory observations.
>"especially since the bookstore is named after a pioneering woman engineer."

Wow this is quite creepy. You took something that on its face was not derogatory and created your own prurient association and then projected it onto someone else.

I think maybe the only person you have shamed and embarrassed is yourself.
This is so 2014. I remember when when Xbox users with Kinect had this happen.

http://www.bbc.com/news/technology-27827545
Why would a robot inherently want to make a better robot, or change itself?
This sounds super interesting to me!

I watched the video and it led me to install Sonic Pi and start messing around. Very cool stuff, will be interesting to see where electronic music goes in the future.

As someone who is still an EE student but is super into music production and film in my spare time, can I ask how you ended up where you are and to what degree your creative background helps out?
Richard Stallman: Reasons Not to Use Netflix
Good point. Is anyone aware of a FOSS implementation of "personal audio assistants"? Because the Orwellian creepy factor is way up there.
> The best development OS is the production OS [...] Ubuntu (Server) and RHEL and Centos are ubiquitous.

As is SUSE Linux Enterprise and openSUSE. People often forget about us.
Antergos. It's Arch without the initial pain of setting everything up. The "arch way" is that you set everything up yourself so that you know how to fix it if it ever breaks, but I find the Arch wiki to be so good, that you can usually figure it out. So if you have time and want to build a custom system, Arch. But if you just want a base image to start with, Antergos.
std::vector is a container in a c++ standard library. C++ is a language. You're mixing apples and oranges.

What I'm saying is that you can use C++ without having to use STL and you can use C++ just fine to implement your own exceptionless container if you want (and many such implementations exist already).

And you can also compile with exceptions disabled. Should your code throw it will terminate the process.
There is a fully functional house inside the dome. The dome itself has no insulation, but the massive 'dead' air space between the dome and the house provides a huge amount of insulation.

The dome by itself isn't that interesting. It's the dome/house system that provides the benefits. It means they can spend a lot less on heating fuel.
This is an excellent initiative. Can you shoot me an email to discuss how we can work together (it's on my profile) ? My company used to work with Prestashop a lot.
Oh sweet, thanks a lot benzimmer & kirankn!
What's the advantage of this instead of not connecting to any wifi networks?
Unfortunately __typeof__ is non-standard. Despite its usefulness it always gets left out of the standard (and with weird excuses, I think last time it was lack of implementations - despite the fact that eg. both GCC and LLVM implement it).

Interestingly, C11 defines _Generic selection, a kind of a switch for types, but its usefulness is hindered by the fact that it cannot be used in conjunction with sizeof.
It will help you either use std::vector with a custom allocator that does not throw exceptions, or else write your own non-throwing vector class with templates, which would, I hope, be more maintainable and easier to use correctly than an equivalent written in C.
I love "stupid" questions like this.

We can say that the vast majority of living beings on Earth do not seem to seek any form of radical self improvement beyond ordinary developmental learning and mastery of survival skills. There is no intrinsic reason that there must be an impulse to exceed oneself. Why would AI be different?
Don't even get me started on the mac client... constantly drops calls, other end complains that sound quality is terrible despite high quality headphones, screen sharing stops suddenly mid presentation, can't see scheduled meeting directly in app, and overall horrible UX.

Also, despite the rigid security policy where I work, the mac client stores my password in the keychain.
I like my C alternative better. I pass growth factors/increments as parameters to the vector macros so that I can affect how it grows on capacity exhaustion during each call and I have macros for creating and closing uninitialized gaps. C++ loses on many potential optimizations by insisting that its types always be in fully well-defined states except inside methods. Moreover the particular GNU implementation of the STL on Linux completely fails to turn certain vectors methods into memsets, memcpies and memmoves where it could, which pesimizes those particular ops by like two decimal orders of magnitude. The insistence on using new/delete based allocators instead of reallocs is a significant pessimization too. Reallocs perform, on average, several tens of percents better than new allocs followed by copies. An even more noticable pessimization is in the compilation times. Including `<vector>` adds good chunks of a second to the build time of an average-length translation unit. In comparison, working with C, even with all my generics included, on top of a good build system makes me feel as if I was working with a scripting language. No lags.
Renaming a Win32 executable to main.exe launch the Xbox DVR popup
People already live there year round (in houses similar to the one inside the dome). The dome just provides better protection against the elements (preventing wind from hitting the house is a likely a _huge_ win in thermal efficiency).
Given what I've heard about NSA, they are far more reasonable than our FSB (successor of KGB if anyone doesn't know). Our guys can easily use their right to "take for investigation" some servers just to protect a business of some of their colonels or friend of a colonel. And that makes storing a data in Russia a bit of a lottery.
Messed around with it for a bit: https://0x0.st/fPF.webm

Used:
-filter_complex "[0:v] selectivecolor=greens='0 1 0':yellows='-1 -1 1':magentas='1 0.5 -1':blues='1 -0.9 1':reds='-1 0.1 -1' [x] ; [0:v] scale=w=360:h=-1 [y] ; [x] [y] overlay=format=yuv420 [out]" -map "[out]"
I wonder, which physics claims that space and time don't exist (how could it, "exists" is a metaphysical concept, physics only cares about mathematically describing the world and making predictions), and how do ancient traditions making claims work as an argument to anything (seeing as ancient traditions have made every claim form the world being in the back of a turtle to a middle-eastern bronze age carpenter being the son of the creator of the universe)?
This is not just a rogue request from some crazy official, but part of a larger plan to subdue and scare off foreign tech companies and replace them with 'local' tech, controlled by the state.

These people are not playing games - this is ideological warfare in action.

Tech companies should get political - that means get ready to temporarily loose certain markets in exchange for defending some core principles.

They might refuse to accept it, but tech companies are currently the most powerful (dormant) political players in the world - this is why Putin et al want to either control or eliminate them.

They should ignore the request, then be ready to close their offices and offer to relocate all employees to a foreign country.

No Google, AppStore and Google Play means back to the 90s.
Data jurisdiction is by itself an enormous and nuanced topic. There's a very interesting case to be made about giving your users a choice, as both having data in your own country or some foreign sovereignty come with different trade offs.
> I'm really sad X11 is legacy software myself, as an aside. It's a disaster, sure, but now we have one more layer of "uhhhh..." for all the UX-types to get scared away by: it used to be "(WinAPI) vs ((Qt)/(GTK+)/(Xlib/XCB))", which was embarrassing enough; now it's "(WinAPI) vs (X11((Qt)/(GTK+)/(Xlib/XCB))/Wayland((Qt)/(GTK+)/(???)))" which is just plain annoying for low-level graphics hacker wannabes - I can make a WinAPI app in C that opens a window in a few KB, where as to do that in Linux now I HAVE to support XCB and also write my own tiny UI for Wayland.

That's worse than this: you will quite possibly need features that are not implemented through Wayland, but through each different Desktop Environment, through different APIs, since Wayland ditched many X11(+standardised extensions) features.
Elon Musk thinks it's probably that we're in a simulation.

Odds are we're living in a simulation, says Elon Musk

http://www.theverge.com/2016/6/2/11837874/elon-musk-says-odd...
Is there a simple way to write the ARRAY_PUSH_BACK without a macro?