Hacker Newsnew | past | comments | ask | show | jobs | submit | splesjaz's commentslogin


Scrolling randomly through the document my eyes almost popped when I saw [Level 3, Chapter 16: Performance]:

  A pointer to a collection of objects of unknown number. These functions
  should use the VLA notation:
 
      void func(size_t n, double a[n]);
I had no idea this was possible. Do compilers actually do anything with this information or is it just informative?

EDIT: I didn't get a warning out of gcc

  #include <stddef.h>
 
  int last(size_t n, int a[n]) {
    return a[n-1];
  }
 
  int main() {
    int a[] = {0, 1, 2, 3, 4};
    size_t siz = sizeof(a) / sizeof(a[0]);
    return last(siz+1, a);
  }
Compile:

  $ cc --version
  cc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
  Copyright (C) 2013 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  $ cc -Wall -Wextra -std=c11 staticarr.c -o staticarr && ./staticarr ; echo $?
  254
clang 3.8 warns about differing things:

  $ clang-3.8 -Weverything -std=c11 staticarr.c -o staticarr && ./staticarr ; echo $?
  staticarr.c:3:25: warning: variable length array used [-Wvla]
  int last(size_t n, int a[n]) {
                          ^
  staticarr.c:3:5: warning: no previous prototype for function 'last' [-Wmissing-prototypes]
  int last(size_t n, int a[n]) {
      ^
  2 warnings generated.
Still, it's a neat idea from a documentation point of view, and GNU-like compilers seem to accept it.

A bit before is more explanation of on the arr[static ?] notation. I was aware of this and usually prefer to use (Clang/GCC) function annotations to indicate NULL-ness of pointers and such, but I see the advantage in some situations. I don't agree with everything in the document, but it contains a lot of cool things.


I think it's worth clarifying that arrays declared in parameter lists are simply just pointers. It's 100% syntactic sugar. So the `int a[n]` is simply treated as `int * a`, and the value inside of the `[]` is ignored completely. This leads to the weird situation that you declared it as `int a[n]`, but `sizeof(a)` just gives the size of a pointer, not the size of the array.

The only special case is `int a[static n]`, which does tell the compiler that `a` has at-least `n` entries. But `a` is still just a pointer in this instance, so `sizeof(a)` still gives the size of a pointer.

Personally, I'd recommend avoiding the syntax purely because of the `sizeof` issue, but its up to you.


VLAs were added in C99, but not universally adopted (particularly by embedded systems compilers, for obvious reasons), and then made optional in C11.


You're completely right, but I think it's worth clarifying that VLA notation in parameter lists, and actual VLAs are two completely different things. The example he showed doesn't actually use a VLA, it just looks like it does.


I don't see an obvious reason - that's all information that's available on compile-time, there should be no additional run-time cost - or what are you implying?


VLA allows for run-time size determination, not compile time


It's already in the list.


Oops just woke up


That link did not work.

From the article though: http://icube-icps.unistra.fr/img_auth.php/d/db/ModernC.pdf


For people with multiple monitors if you get too much distracted you should try just using 1 monitor it works for me to get my attention to work related things.


Sometimes I am most productive on my iPad with a word processor and a Bluetooth keyboard. I credit it to the focused nature of just a single app. So if I'm having trouble writing, I go there or occasionally I will go totally analog on paper.


You mean the poor going to mars to work there, rich people will stay at earth ( sounds like the expanse )


PLEX goes for ~1Billion ISK per unit[1]

It all depends how you want to make your isk, I don't know what the best way now is but before it used to be in nullsec running anomalies pretty sure you can start after 2-3 months training doing that with an average of 50mil an hour for beginners, one would need about 20-21 hours of spending making money to buy a plex

1 : https://eve-central.com/home/quicklook.html?typeid=29668


Okay, so at least at low levels, ~5 hours of game work a week just to pay for the subscription for that month. Assuming this is about 50% as much fun as you would have if it wasn't a requirement, and that you have other things you would rather spend that money, definitely not worth it at low levels.


You are correct, it absolutely is not worth it at low/medium levels of play.

PLEX becomes worth it if you run a corporation/alliance, run a reaction chain, live in a wormhole, or are multiboxing a 16 rorqual mining setup in delve (YOU KNOW WHO YOU ARE).

At those levels of play, you might be making anywhere from 5 billion ISK to 50 billion ISK per month for only a few hours of time invested, so PLEX makes sense.


I never liked PvE in EVE except for wormholes where I made hundreds of billions but that was with old accounts. I always paid with real money until I made lots of money without doing much. Kinda seems unreal for beginners to pay with in game money ( unless they changed it last year ) specially if you have a job.


thesis: the fundamentals to getting rich (in eve) are 1) being smart and 2) (much less important) having money already

The people who go ratting in null as he described are the people with no imagination, who go into a sandbox game and decide to spend their time doing the one thing in Eve that's most like other mmos: smacking mobs for money. Like he said, that's about 50-100m/hr ranging from "basic setup" to "reasonably pimping" (without the use of capitals). It's minimum wage. (Non-multibox mining is sweatshop wage.)

Other people have mentioned wormholes. Currently it's quite straightforward to get 150m/hr by smacking mobs in there (with a sort-of expensive ship you can afford just fine because you live in a wormhole), and it scales with a few accounts so it just takes four-ish months of training 2 alts to triple that figure. If you are a poor (ingame and irl) newish player and you can pay for one account but not three, then there's a trick involving trial account referral bonuses where if you have an account you are paying for, every time you buy a month of time for it you can make another account that lasts 51 days and has no trial restrictions. This is enough time to train into a specific, fairly cheap ship that is able to survive wormhole mobs in pairs but not alone - so you have a 2-3 day period at the end when both accounts are able to fly those pair ships and together pull 300m/hr. If you make a plex in that period (reasonable) you're home free and continue daisy chaining more such trials as desired.

But wormholes also have planets to extract valuable resources from. Because of the interaction between the mechanics of this activity and the mechanics of wormholes, it turns out that you can make more money doing this in wormholes than anywhere else in the game. Also because of mechanics (resources accumulate passively and the player "fixes up" the setup on a regular basis that he establishes - anywhere from 1h to 3 weeks), the income scales perfectly with number of characters more or less indefinitely. An account (one subscription) can have up to three characters, only one of which can train at a time. It takes a week to get acceptable planetary interaction skills on one character. When all three characters are set up with dead-simple layouts (I'm pretty sure finding optimal PI layouts is NP-complete), they produce the price of a plex + a few hundred mil every 30 days, give or take. About 2.5 characters are enough for a plex per month. I have five characters doing this, which is enough to plex my two accounts right there. I timed my "fix-ups" a few times and estimated that my gross income was about 350m per hour of my active labor. It's about 30 minutes every three days, meaning that I'm plexing two accounts on 5 hours of labor a month (compare to the 1 plex that the above null ratter was making - plus my activity is not risking nearly as much as his). I work slowly and don't have fancy setups; I know other people making more than I do at this and doing less work. The smarter you are, the more money you make with this.

Skill extractors came out last spring, allowing buying and selling of the skillpoints accumulated by subscribed accounts. Turns out that if you optimize a character for this, you can train and sell enough sp in 30 days to buy a plex to keep them subbed and have money left over. Looking at the tool I wrote a while ago to track this[0], a skill farm character currently pays for itself and still has a net profit of 387m at the end of the month with, oh, 2 hours of interaction to buy and sell - so assuming plex are 1b, that's what, 690m/h (gross)?. I have one such skillfarm character - but that character is also one of those five planetary interaction characters, and one of those alts that can get 150m/h smacking mobs from my first wormhole paragraph. Now that it has those skills, I don't need to improve it any more. Extracting all the sp it produces is just fine by me.

So with two accounts, I'm capable of producing around three plex + 400m in about 7 hours a month. (In reality, the safety net of the skillfarm means I just take it a little easier with the PI lol). But I haven't even mentioned trading.

I put about two weeks of training on a sales character and a week on an acquisition character. I had about a 600m or so saved up to use as capital (this was when I only had one account). Put the acquisition character in the main trade hub and the sales character in the third largest hub. Used Excel to pull down a page from a community site comparing the prices in both locations[1]. Did some basic sorting and filtering to find items with good margins, did a sanity check on their daily sale volumes to make sure they would move, and set up a shortlist of ~30 things to stock. I bought 500m worth in the big hub and contracted a player corporation that does hauling to move the stock over to the small hub. Ain't nobody got time to fly their own stock around. I paid their expedited rate, so my sales character got the stock shipment the same day. I posted everything for sale, and logged off. The next evening at the same time I logged into salesguy, updated the prices of the remaining undercut stock to remain competitive, wired all the day's income to acquisitionguy, and repeated. In about a month, maybe two of feeding profits back into stock, I was regularly pulling a profit of 250m a day and shipping 1-2 billion in stock every couple of days. My effort was about 30 min daily, so 500m/hr and 7.5b/month. 15 hours of work per month for 7.5 plexes. But remember, this only needs one account subbed to do. And this wasn't some next level stock market speculation jazz, this is brain-dead arbitrage trading (after you figure out your strategy). In fact, it's kind of mind-boggling when you think about it: with three weeks of prep, $15 of seed capital, some careful thought and a couple of months of busywork I was making aaaaalmost as much per hour as pre-nerf high-class wormhole capital pilots (year of training for each one a least) smacking mobs for money in groups of at least four 3b-value ships. Those guys were pulling 700-800m/hr, I think?

"Well why did you stop trading then?" I couldn't figure out how to duplicate the spreadsheet to expand my operation because Excel xml frame import black magic didn't work the second time, and it made me so mad I decided to write my own tool, and then school and work and other things happened instead. I'm still coasting on the bank account I made during those five months or so for my "spending money" (as opposed to plex money).

All this to say: you usually make bad money in Eve if you do something that lots and lots of other people are doing. It's economics. Newbie exploration in null was hilariously profitable for a long time because most newbies are scared of null and most vets have better things to do with their time - so prices for the stuff that could only be found that way were high. Then everyone (including me) wrote guides for their new recruits about the "one neat trick to making money as a new player" and the prices have been steadily falling since.

Missions are mentioned in the welcome email so a lot of people make it their goal to get up to Level 4 missions in hisec and do that for money. But they don't think to check if anyone has written a blog or guide or anything, and so they end up puttering on with 50m/hr when they could be doubling that with better technique or getting up to 300m/hr by upgrading their equipment and being selective about which missions to accept. And apparently none of them ever find out that there are actually Level 5 missions - in lowsec - and with the proper setup (and that is far from easy to get, I'll admit) you can crank out 1b/hr with a carrier pilot and a few super low investment mission pulling alts. One of my corpmates has done this and screenshotted it for me. It's pretty gross.

TL;DR: the two fundamentals to being rich in Eve are being smart about spotting opportunity and having capital to invest (in stock, in ships, in characters, whatever). What I'm doing isn't even clever - PI, skill extraction, a bit of wormhole pve now and then, trading - but I'm quite satisfied with the return for now. For the more ambitious - everything I do can be done more profitably/efficiently, and I know this because I either know people personally who do or I read their blogs. But that's also why I know this stuff exists in the first place. A good network is a huge asset.

Wew, there I went on an rant about Eve again. rip.

[0]: https://mosbasik.github.io/skillfarming/

[1]: https://eve-central.com/tradetool/


Thanks for the rant, was great. Used to play Eve a lot. In the end I got pretty deep into suicide ganking (destroying ships in 'secure' space at the cost of your own ship(s) for the loot).

At best it was like 400m/ hour but didn't exactly scale easily. I had 7 windows open. Scanner dramiel remote sensor boosted by someone two jumps from target, three battleships with artillery cannons, one destroyer with artillery cannons and a scrambler, someone sensor boosting these ships, and a hauler ready to warp to can. Sometimes I would scan the other direction and be ready to switch gank gates but it depends on system. Goal was to be able to catch almost anything with 1bil+ in cargo. Cruisers, t2 haulers, t3 cruisers, etc. It felt really distopian. Some hits were upwards of 5bil.


>maintaining 7 accounts with 400m/h

Wow... Either 1) you really enjoyed suicide ganking and did it a lot (just like I enjoy writing tools and spreadsheets so my activities aren't "working to plex" but "playing the game"), or 2) this was a few years ago and plex were sub-600m. Leaning towards the second one because I've never heard of arty battleships for suicide ganking. Seems expensive. Did your ships look like this?:

http://pre10.deviantart.net/d525/th/pre/i/2012/089/0/5/eve__...

because Nado battlecruisers have been the large arty ganking platform of choice (they fit battleship guns) since I started around 2013-14.

I guess your destroyer was to volley any shuttles/frigs that came through? Clever.

What routes did you work? Jita/Amarr pipe? Hub undocks? Did you move around to keep from getting a reputation?

I'm always curious to know what players who were active years ago think of newer developments in the body of player knowledge involving their main activites. Early on Eve was like the wild west where people didn't know as much and tried things that seem ludicrous given what we've learned since then. Since you're an instalocking ganker, what do you think of these? Were they something you were aware of / thought about?

[0]: Given: Eve runs in 1 second ticks. Reasoning: it takes one tick for the target to show up on the ganker's screen and another tick for the ganker's scram to apply to the target. Conclusion: ships that align and enter warp in less than 2 seconds are uncatchable without a bubble.

[1]: Infographic for how to make sub-2sec-align interceptors (which are immune to bubbles): http://i.imgur.com/7rYYJpY.png

[2]: Infographic going deeper into the 2sec "common knowledge" rule and showing that 2sec align ships can be caught in edge cases (which has been proven experimentally by now): http://eve.501gu.de/misc/travelceptor_vs_instalocker.png

[3]: Tool written this year using publicly available kill data to determine whether a planned route is likely to include gankers/campers and displaying qualifying info like "Were the kills specifically near gates?" (kills not on gates are likely not a camp) "Were heavy interdictors involved?" (No amount of stabs can counter a HIC infinipoint) etc.: http://eve-gatecheck.space/eve/#Jita:Rens:shortest


https://www.youtube.com/watch?v=N8K18S_RNEQ

This video shows how grid bombing was done, sadly i don't play EVE anymore it's a great game lots of different Players/groups


There were too many meta-exploits in Eve. My alliance lost our player constructed station because we kept on having the server crash underneath us when we were clearly winning a battle to take down an enemy's tower. After the 3rd time that happens, it's harder to get people to the battle.


Recently bought ; Land of Lisp and it should arrive next week. Heard it's a pretty good book to do some fun with Common Liso


Well yea but this isn't something that we discovered today it's been years sadly :(


While SELinux enabled distros usually comes with a targeted mode by default Gentoo hardened has strict mode in it's policy rules, everything is confined with that policy.

Usually only targeted applications are confined by default and allowing unconfined applications to run without any protection.

Apparmor is easy and anyone can understand how it works after reading the wiki, while apparmor also has neat functions you need to compile them in sadly :(

OpenBSD is great, first you can leave it running for a long time without thinking about security bugs or updates, instead Linux you have to keep close eye to kernel updates & application patches, that's why things like mailservers & DNS & NTP and more are running OpenBSD because I know it doesn't need critical updates every week and uptime is critical for me.


VMs are all nice and that but if the exploit can compromise the TBB it's too late already, sandboxing needs to happen in the browser on Linux you can use namespaces + strict seccomp rules but don't know what one would use for Windows. First priority would be to sandbox the browser and work your way down if you want to sandbox more stuff. For Windows EMET can help to prevent certain exploits I guess but yea a browser that can access anything on the filesystem & system calls is badstuff.


VMs are all nice and that but if the exploit can compromise the TBB it's too late already, sandboxing needs to happen in the browser on Linux you can use namespaces + strict seccomp rules but don't know what one would use for Windows.

You can take a look at the sandbox implementation of Firefox (shared with Chrome) to see. TBB uses ESR which predates all that, though.


Working within an assumed breach scenario, the VM is defense in depth. Firefox has holes, and it will continue to be relatively easily exploitable as long as TBB allows for plugins and JavaScript by default. There is reticence from TBB team to disable JS by default even in the face of a few of these 0days, so you have to protect TBB users a level down from the browser and assume it'll be popped.

There are Windows "sandboxes" like Bromium, and as stated, IIRC EMET will stop the stack pivot here.


Last time I checked they were working on a TBB sandbox [1] Let's hope it will be there soon, subgraph has oz[2] and can be used with any program really then there is firejail[3] but these 2 are only on Linux available.

1: https://blog.torproject.org/blog/q-and-yawning-angel 2: https://github.com/subgraph/oz 3: https://github.com/netblue30/firejail


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: