I am thinking of using it as a selfhosted dropbox replacement... would you recommend it or something else?
[link] [comments]
I am thinking of using it as a selfhosted dropbox replacement... would you recommend it or something else?
Mitä teette kesäisin? Asun itse Helsingissä ja tuntuu siltä että varmasti moni asia on jäänyt tekemättä ihan siksi koska ei ikinä tullut ajatelleeksi.
I always wanted to know how RAW files work and how editors interpret the data. So I created a small RAW editor that loads Canon CR2 raw files and has some minor editing tools. I'll lay out the few steps necessary which each RAW editor does to get your image to look as it should. I tried to be as simple as possible so still interesting for those who have no idea about programming or computer science.
CR2 file type
I wrote my own file reader but I suggest anyone who wants to try this, use libraries, much easier but of course less fun ;p
The Canon raw file is the one I focused on since I only own Canon cameras. The file is essentially a TIFF file format containing the RAW data encoded as lossless JPEG. There is a lot of meta data contained like EXIF data and other information for decoding purposes. But most of it is not necessary at all and I skipped most of it.
The RAW data is stored as a Lossless JPEG. Decoding the data was a challenge since it is compressed using a rather (at first) confusing encoding technique. What it stores is essentially the difference between one pixel to the next (this also explains why the more noise the larger the files). (Huffman coding)
Luckily Canon decided to have the data uninterrupted by any potential encoding flags, which makes decoding it a breeze.
RAW data
The RAW data looks like this. What you see here is each line of decoded data in grey scale. This might look confusing at first and trust me the indexing of each pixel is pain to handle especially for different cameras. The sensor in this case is read out in two slices which have to be arranged like this:
|-------------------------|-------------------------| | | | | Slice #1 | Slice #2 | | | | |-------------------------|-------------------------|
But each encoded line combines two sensor lines RGRGRG....GBGBGBG and so what you see on that image is this:
|-------------------------|-------------------------| | Line #1 Slice #1 RGRG | Line #2 Slice #1 GBGB | | Line #3 Slice #1 RGRG | Line #4 Slice #1 GBGB | | ... | ... | |-------------------------|-------------------------| | Line #1 Slice #2 RGRG | Line #2 Slice #2 GBGB | | Line #3 Slice #2 RGRG | Line #4 Slice #2 GBGB | | ... | ... | |-------------------------|-------------------------|
You may also notice the black border this is sensor data and is cut off from the final image BUT still used for development purposes which I'll talk about in the next section.
This is how it looks like assembled. Notice the grid like pattern on a pixel basis, this is how the RAW image looks like without any demosaicing and white balancing, which we'll discuss next.
Why slices though? My guess is this allows some type of multithreading and thus the camera can encode the data faster.
RAW data manipulation
Canon stores their 14bit data not exactly as 14bit. First of all they don't set "black" to 0 but have it offset. For my files it was for each color channel [R,G,G,B] -> [2107, 2179, 2180, 2125]. This is calculated using the margin I previously talked about. That margin is not "exposed" thus it is "black". This offset has to be subtracted from each and every pixel.
Now since this is done we have to manipulate each RGB channel with a white balancing multiplier. The RAW file has some WB settings within it but if you use auto WB it will not store the exact settings (or at least I couldn't find them). That is usually done automatically by RAW editors but is essentially the Temp and Tint slider in lightroom. What happens is it applies a multiplier to each channel. Green is usually kept at 1.0 and Red and Blue is adjusted.
After we applied whitebalancing we can finally recreate lost information. What I mean by that is since each pixel only records Red, Green or Blue we have to "interpret" the other colors for each pixel. The sensor array looks like this:
RGRGRGRGRGRG... GBGBGBGBGBGB... RGRGRGRGRGRG... GBGBGBGBGBGB...
A very naive approach is to simple calculate the mean from the neighboring pixels. Works ok but of course for sharp edges it will look blurred out. The more complex the algorithm the better results you will get. I use something in between which tries to detect edges but it's very very basic, so I won't be expecting good 1:1 results nor will small thin lines look anywhere as good as with professional RAW editors. And last but not least since the image is recorded linearly and our eyes more or less see light in a logarithmic scale. I applied a gamma curve (2.2) before any other image manipulation. Otherwise it just looks dark.
Image Manipulation/Editor
This is how my editor looks like. Very straight forward. From top to bottom:
Output Histogram
Input Histogram (makes adjusting the levels easier)
Levels
Temperature white balancing
Tint white balancing
Saturation
Curve
Red, Green, Blue sensor calibration
Most people know the RGB format but a more approachable color space is HSV. HSV encodes color as hue (all colors arranged from 0 to 360 degrees), Saturation and Value (brightness). You can adjust brightness, saturation very easily in this color space.
Most editors have the same tools: Curves, Levels or White, Black, Shadow sliders etc. What they do is essentially the same: They map the brightness value of each pixel to a new one. This is all pretty straight forward if you know how each of these tools map colors. But the more interesting one is the sensor calibration sliders at the bottom.
Each sensor has it's own "characteristics" in how each pixel records its designated color spectrum. They don't just record red, green or blue. They record the amount of red, green and blue. This means that all colors in between will be recorded differently for each sensor. These sliders help me adjust the color bias. Lightroom allows you to shift hue but Canon is pretty dead on with their red green and blue so I only allow a change in contribution. I used a normal distribution at Red, Green and Blue and scale each color using the slider values. I'm most likely wrong with that approach but it works surprisingly well and you can recreate pictures profiles with these sliders as well.
Notice the render button, I can't just update the image each time I modify the input because it takes roughly 200ms to render the full image and another half a second to display it (java sucks at displaying large image files) so I prefer doing it manually instead of waiting every single time. This could be improved upon easily but not worth it ;p
Problems
Demosaicing is the main difficulty with interpreting RAWs, so here some problems that occur when you use a simple/bad algorithm:
And of course all the nice features like lens distortion, CA, noise reduction and other fancy tools are way harder to implement.
Comparison
Quick Lightroom edit vs Mine (Screenshot of my editor for this result)
As you can see my color profile fix is going wrong on that branch. But overall I think it's not that bad, right? ;p
But even for some very demanding scenes (had to do a lot of shadow pushing here) my editor does surprisingly well when scaled to web use: http://bit.ly/2swxYAc far from perfect and I will not stop using lightroom but still I'm happy with the results.
Ask any question, I'll probably won't be around for the next few hours but I'll get back to them first thing I'm back on reddit.
This tool adjust the color temperature of your screen. Your screen will have an orange/red tint which reduces strain on your eyes and may help improve your sleep patterns. It's better for your eyes.
You can notice barely any difference when it's on but when you turn it off you will find how bright your screen is. It's like shining a bright flashlight in your eyes.
You can check it out here. Installing is easy you just submit your geo coords (so it can calculate when the sun is going down) and your good to go. You barely notice it's there but it will help a lot. There is also a GUI available.
I am using it for a few months now and I notice I am able to fall in sleep faster after working in the dark for a while. I can't live without this anymore!
Edit: If you like redshift, consider donating to the developer!
Hey reddit, I wanted to give a quick update on the Internet-Wide Day of Action to Save Net Neutrality that lots of us are planning for July 12th.
There's a huge amount of momentum. This morning PornHub (with 75 million daily visitors) announced that they will be participating. Since we announced earlier this month a ton of other high-traffic sites have signed on including Imgur, Amazon, Namecheap, OK Cupid, Bittorrent, Mozilla, Kickstarter, Etsy, GitHub, Vimeo, Chess.com, Fark, Checkout.com, Y Combinator, and Private Internet Access.
Reddit itself has also joined, along with more than 30 subreddits!
Net neutrality is the basic principle that prevents Internet Service Providers like Comcast and Verizon from charging us extra fees to access the content we want -- or throttling, blocking, and censoring websites and apps. Title II is the legal framework for net neutrality, and the FCC is trying to get rid of it, under immense pressure for the Cable lobby.
This day of action is an incredibly important moment for the Internet to come together -- across political lines -- and show that we don't want our Cable companies controlling what we can do online, or picking winners and losers when it comes to streaming services, games, and online content.
The current FCC chairman, Ajit Pai, is a former Verizon lawyer and seems intent on getting rid of net neutrality and misleading the public about it. But the FCC has to answer to Congress. If we can create another moment of massive online protest like the SOPA Blackout and the Internet Slowdown, we have a real chance of stopping the FCC in its tracks, and protecting the Internet as a free and open platform for creativity, innovation, and exchange of ideas.
So! If you've got a website, blog, Tumblr, or any kind of social media following, or if you are a subreddit mod or active in an online community or forum, please get involved! There's so much we as redditors can do, from blacking out our sites to drive emails and phone calls to organizing in-person meetings with our lawmakers. Feel free to message me directly or email team (at) fightforthefuture (dot) org to get involved, and learn more here.
EDIT: Oh hai, everyone! Very glad you're here. Lots of awesome brainstorming happening in the comments. Keep it coming. A lot of people are asking what sites will be doing on July 12. We're still encouraging brainstorming and creativity, but the basic idea is that sites will have a few options of things they can do to their homepage to show what the web would be like without net neutrality, ie a slow loading icon to show they are stuck in the slow lane, a "site blocked" message to show they could be censored, or an "upgrade your Internet service to access this site" fake paywall to show how we could be charged special fees to access content. Love all your ideas! Keep sharing, and go here for more info about the protest.
EDIT 2: It's worth noting that given the current chairman of the FCC's political orientation, it's extra important that conservatives, libertarians, and others to the right of center speak out on this issue. The cable lobby is working super hard to turn this technological issue into a partisan circus. We can't let them. Net neutrality protects free speech, free markets, innovation, and economic opportunity. We need people and sites from all across the political spectrum to be part of this.
I used Linux exclusively in the early Aughts. I also was an early adopter of the iPod, and at the time, Amarok was the best solution for managing a large library and syncing it with an iPod. I was around for the disaster was was Amarok 2.0 and the shift to KDE 4 where the program lost tons of features and made some controversial UI choices. But when I last used it, the developers seemed to have relented and were bring back much of the 1.x line's features. Things seemed to be looking up for the project.
Now, I haven't used Linux in years but decided to see what some of my favorite programs were up to these days. I was surprised to see Amarok's site hasn't been updated in years and commits to the code had fallen off to nothing. I know the shift to 2.x hemorrhaged users, but did it kill the project? If I were to install a modern distro, what options are out there to manage a 100Gb music collection and sync it to an iPod?
Mitäs hyviä suomidokkaraita r/suomalaiset osaisivat suositella? Etenkin olisi kiva kattella jotain historia tai politiikka-aiheisia, mutta mitkä vaan suomeen liittyvät dokkarit käy. Bonusta jos on heti katseltavina juutubessa tai areenassa tms.
Today was my first day on the job as a Junior Software Developer and was my first non-internship position after university. Unfortunately i screwed up badly.
I was basically given a document detailing how to setup my local development environment. Which involves run a small script to create my own personal DB instance from some test data. After running the command i was supposed to copy the database url/password/username outputted by the command and configure my dev environment to point to that database. Unfortunately instead of copying the values outputted by the tool, i instead for whatever reason used the values the document had.
Unfortunately apparently those values were actually for the production database (why they are documented in the dev setup guide i have no idea). Then from my understanding that the tests add fake data, and clear existing data between test runs which basically cleared all the data from the production database. Honestly i had no idea what i did and it wasn't about 30 or so minutes after did someone actually figure out/realize what i did.
While what i had done was sinking in. The CTO told me to leave and never come back. He also informed me that apparently legal would need to get involved due to severity of the data loss. I basically offered and pleaded to let me help in someway to redeem my self and i was told that i "completely fucked everything up".
So i left. I kept an eye on slack, and from what i can tell the backups were not restoring and it seemed like the entire dev team was on full on panic mode. I sent a slack message to our CTO explaining my screw up. Only to have my slack account immediately disabled not long after sending the message.
I haven't heard from HR, or anything and i am panicking to high heavens. I just moved across the country for this job, is there anything i can even remotely do to redeem my self in this situation? Can i possibly be sued for this? Should i contact HR directly? I am really confused, and terrified.
EDIT Just to make it even more embarrassing, i just realized that i took the laptop i was issued home with me (i have no idea why i did this at all).
EDIT 2 I just woke up, after deciding to drown my sorrows and i am shocked by the number of responses, well wishes and other things. Will do my best to sort through everything.