There are people who are proud that they don’t need much sleep.
Don’t listen to them. People who don’t sleep enough make more mistakes, they are dumber than they could be, they ruin their health, their sex life, to name just a few of the most important downsides.
Yes, it’s easy to reduce the amount of time you’re sleeping every day and the negative effects aren’t obvious. People sleep just a few hours every night feel powerful and agitated – mostly because of the adrenaline levels you get from the stress of lack of sleep. But adrenaline also makes reckless and unreliable. It bends you towards risky behavior which causes accidents and disasters like the world financial crisis.
If you’re one of these people, stop it. The additional hours don’t really make you more productive, no matter how much you would like to make yourself believe. Your ruler is broken – a sleep-deprived brain isn’t able to notice just how tired it really is. And even at the best of times, it costs your company almost $2’000 every year for every employee.
- Sleep Habits: More Important Than You Think
- How long can humans stay awake? (Scientific American)
- Sleep deprivation (Wikipedia)
- Effects of sleep deprivation on cognitive performance (Wikipedia)
After signing up, you’ll find yourself in the documents page:
Click “Create” to create a new one. I’d like to design an office chair, so I’ll use “Office Chair” as document name.
Onshape will now display the workbench:
Read “Interface Basics” to learn how to manipulate the UI. I’d like to get started with my chair. The first thing that it needs is wheels.
Let’s create a circle … circle … where is the circle? Where is anything???
Turns out that Onshape wants to you to create a “sketch” first. Think of a sketch as an outline of something. With the tools that you can see now, you can turn this outline into a 3D object. Sounds a bit dry but wait for it. To create a sketch, click on the “Sketch” button (next to the pencil).
There are three important points here:
- Onshape tells us what we need to do next.
- The new sketch was added to the features.
- Blue things are important or active. In this case, the “Sketch Plane” selector is active and Onshape wants us to select a plane. If it turns grey, make sure you click it again or the next step won’t work.
What does that “a sketch plane” mean? Onshape is a 3D CAD but you probably only have a 2D mouse. That means Onshape somehow has to reduce one dimension. It does that by letting you select a plane on which all your lines, rectangles and circles will be. We’ll see how that works out later when we create more complex shapes.
Currently, we want to create a wheel and a wheel should stand on the floor (or it won’t move). So we have the choice of the “Front” and the “Right” plane. I chose the “Front” plane. Just move the mouse over the plane you want and it should turn yellow. If you click, the “selection” will be added to the sketch:
As you can see, the blue field turned white, the text changed to “Front plane” and there is now an additional rectangle in the 3D view. If you rotate the view, you’ll see that the new rectangle is always parallel to the “Front” rectangle which is what we want.
Also the missing primitive drawing tools (line, rectangle, circle) are now available.
Let’s build a wheel. Let’s start with a circle. Click the green button and … Where did the drawing tools go??? Where is my sketch? What is going on?
Well, the drawing tools are only visible as long as you’re editing a sketch. So double-click on “Sketch 1” or right-click it and select “Edit”. And the tools are back.
Let’s add a circle:
- Click the Circle button at the top (it turns grey to indicate that it’s now active)
- Click somewhere in the drawing area and drag the circle as big as you want.
I had my first doubt here: How do I enter a diameter or radius? How am I supposed to construct something instead of simply sketching a design? Turns out that Onshape has solved this problem in a really nice and intuitive way. But let’s assume that we have no idea and we just continue working.
If you rotate the view, then the planes “Front”, “Sketch 1” and the circle should look like they are parallel.
Your workspace should now look like this: “Sketch 1” in the list of features and a dull grey circle. Let’s turn the circle into a cylinder. Click “Extrude” (first button to the right of sketch).
Important things here: The extrude operation has been added after the sketch. That means it can use our sketch as outline for the operation.
The options for extrude are what we want (“Solid” and “New”). The next option (active) is the outline to extrude. Hover inside the circle and it will turn yellow. When you click, the magic will happen.
If you drag the arrow around, you can see that the number in the Extrude form changes. That’s the amount by which the outline gets extruded. You can also edit the value directly. Enter “1 cm”. The software will display “0.394 in” and update the cylinder. If you edit the value, you’ll see “1 cm” again. So the software remembers what you originally wanted. Keep that in mind.
Most wheels have round edges. The “Fillet” tool does that for us. Click on the tool without closing the “Extrude 1” form:
As you can see, the last tool was finished for us and a new one was added. “Fillet 1” is waiting for us to select the corners we want to round. If you hover over the two ends of the cylinder, they’ll turn yellow (as in the image above). When they do, click to add them. There is no need for Ctrl or Shift, Onshape always toggles the selection when you click on something.
You’ll notice something strange: When you select the first circle, the edge will be rounded. But when you select the second one, the effect will be gone. Why?
In the form, you can see that the correct edges are selected. The problem is that the radius of the fillet (0.2 in) is too big; 0.4 in is greater than 1 cm, so Onshape simply can’t do what we want. Enter “3 mm” to fix that:
Select “Centimeters”. The form won’t update right away, you have to close and reopen it.
Let’s add an axis around which the wheel should rotate. Create a new sketch (“Sketch 2”). Select the side of the wheel as “sketch plane” which is closest to the plane of “Sketch 1”.
Add a circle. This time, hover the mouse near the center of the wheel until the center point lights up. That tells Onshape that you want a circle which has the same center as the first one:
The important part here is the little icon with the two lines and the white point. This is a constraint, specifically the “Coincident constraint” which makes sure that those two points will stay in the same place, even when you move one. This will start to make sense later.
After adding the circle, we want to make sure it’s exactly 1 cm. How do we do that?
With the dimension tool. Click it and the circle. You’ll get an entry field where you can enter “1 cm” to set the diameter of the circle:
Click extrude to add a 6 mm long cylinder. You need to click inside of the new circle to make this happen. If you click on the circle, you get a hollow cylinder. We want a massive one.
Important bits here:
- The option “Solid” is active.
- The option “Add” is active. This adds the new volume to the part selected at the bottom (“Part 1”)
- “Face of Sketch 2” is selected which is our circle. That’s the outline that gets extruded.
To create the second wheel, we add a mirror operation. Click “Mirror”, select the wheel somewhere. It will turn yellow-ish:
The field “Mirror plane” is red, indicating some kind of problem. Note that the field with “Part 1” is active, so click anything would change this field. We don’t want that. Click on the field “Mirror plane,” instead. You should now be able to select the top of the axis:
which will give you this result:
Two wheels, connected with an axis.
How big are the wheels? If you remember, we just dragged a circle. Dimension tool to the rescue!
Double click “Sketch 1” to edit it. Everything else will be hidden.
Apply the dimension tool to the circle. Enter “6 cm”. Click the green button to get:
And that’s the power of Onshape: The tool remembers all the steps that you made to create something. If you go back and change a step, it will adjust all the later steps. That means you can really “sketch” (as in “quickly draw something”). When you feel the need to improve a step, go back to it, make the change and everything else will be updated.
As the last part of this tutorial, let’s add the handle which connects the axis between the wheels and the base of the chair.
I’ll construct a simple handle from a box and a cylinder. For the box, I first need a rectangle which goes between the wheels.
While I could rotate the view carefully and aim between the wheels, there is a more simple way: Hide the second wheel for a moment. To do this, right-click on “Mirror 1” and select “Suppress” from the context menu:
We can now easily create a sketch in the same plane as the extruded tip of the axis. Draw a rectangle around the axis which should extend somewhat to the left side of the wheel without extending over the wheel itself:
Extrude it. Options: “Solid”, “New”, Change “Blind” to “Symmetric”, “0.8 cm” thick, and make sure you click on the area of the rectangle outside of the circle which marks the axis. That way, we get a hole in the new box for free:
If you don’t get a hole, remove the selection of “Face of Sketch 3” with the little red “x” next to it (not the big one at the top!) and click again.
Time for the last sketch: The cylinder at the top.
- Click “Sketch”
- Select the top of the new box
- Switch to “Top” view
- Draw a circle
But we want the circle to be perfectly aligned. For that, we need construction lines.
- Delete the circle again (try Undo)
- Create a vertical line near the right end of the box. Make sure the “coincident” symbol is visible when you click. When you click a second time, you should also see the “perpendicular” symbol.
- Select the vertical line
- Click the “Construction” tool to turn it into a dashed construction line
- Click the “Dimension” tool
- Select the vertical line and the right edge of the box.
- Enter “0.4 cm” as distance
- Create a circle with the center point at the midpoint construction line
- Use the dimension tool to give the circle a diameter of 6 mm
The final result should look like this:
Finally, extrude the circle by 2.5 cm:
This doesn’t look right. In the “Extrude” form, “Surface” is selected but we need “Solid.”
What the …? Where is my cylinder??
Turns out that it makes a difference what you select before you extrude. If you select the circle outline, you get only a tube. But if you click inside of the circle, the whole area is extruded. So to fix the problem, just click inside of the circle (instead of the circle itself) to get:
Make sure “Add” is selected and “Part 2”.
- Unsuppress “Mirror 1”
- Rename the tab from “Part Studio 1″” to “Wheel Parts”
Not bad for just a few minutes of work. Next part: Chair Base with 5 spokes.
They say that “good” people have nothing to hide and, therefore, nothing to fear from surveillance.
Everyone of us has something to hide. When we are confronted with out dark side, immediate, temporary loss of memory sets in and we say “I have nothing to hide” because we can’t remember on the spot. The source of this behavior isn’t “being good”, it’s peer pressure and guilt.
Everyone reading these lines has hidden something. Maybe you were not 100% honest when filing your last tax return. Or you lied to the police how many drinks you had. You lie to yourself when you’re speeding, thinking that you’re such a great driver, you can’t possible cause an accident. Maybe you had an affair, or a “harmless” flirt or maybe you visit a brothel. A few years ago, it was social suicide to let anyone, even your best friends, know that you’re homosexual. It still is in many parts of the world. In the “first world,” it’s what has happened during the last party, an awkward sickness, embarrassing thoughts, which odd web sites you’re visiting.
Everyone of us has something to hide. The average person, perfect in sync with the medium of society, is a myth.
People lose jobs over Twitter posts, party photos on Facebook. Some never get a job because of a criminal record or their family name. Police officers with access to surveillance equipment spy on their spouses or look into women’s bathrooms. Many partners of NSA agents were under surveillance without any official mandate.
When secret services pile up incriminating evidence against someone, they don’t tell the police. In most states, they aren’t allowed to. They keep it. For when it’s needed. When “someone” decides that “something” needs to be done and there is no legal way.
Not convinced? Well, if “nothing to hide” was true, then why do politicians, agencies and companies absolutely and firmly reject to let us see what they are doing? “Nothing to hide” is always only used as an argument to watch someone else. It implies “I have nothing to hide, so you don’t need to even try. Go away. Nothing to see here.” (Adam D. Moore, author of Privacy Rights: Moral and Legal Foundations, from “Nothing to hide argument“)
That’s why we need to be concerned about surveillance. We need to discuss what we want to achieve and what the costs are.
Do we want to make mass surveillance illegal? We could but we’d have to close down Google and Facebook.
Do we want total surveillance? Can we evolve all the societies on planet Earth to an extent where we can be honest with anyone about absolutely anything? Do we want to? How many people would get that killed?
Or do we have to strike a balance, find out how much surveillance is healthy, what the open and hidden costs are, how to control the people who use it – because it’s in the nature of most humans to do anything as long as they can get away with it.
It’s not a discussion many people want to have, we have so many things on our minds, but as usual: If we don’t make up our minds, someone else will do it for us. Only with out best interests in mind, of course.
Imagine this situation: You’re working on some code and you get an exception when you run the unit tests. Next to the output is a link with the text: “User Joe had the same exception two months ago and fixed it with the commit b8cfda02.”
Standard development teams have about 10 people. That means you have a super computer with 40-80 cores, 160 GB of RAM and 20 TB of disk space connected with a fast LAN in your office already. That beast is usually idling while it waits for the developers to press keys. It would be pretty simple to install a clustered log analyzer on this hardware which simply reads all the log files and reports which Maven and running JUnit test creates. It would be as simple to connect the same database to your version control. That means this system could track all the errors and exceptions that you get when you run unit tests or the whole application.
This information could then be used to detect when someone in the team gets a new exception plus the change sets which fixes them. If the system detects an exception which it has seen before, it can tell you which developer has fixed it or who is currently working on it – instead of wasting your time, you could see the code which contains the solution or ask someone who has already solved the problem.
With proper filtering, the data could be split into internal and framework code. That way, the system could report to library projects where consumers struggle most.
On the large scale of things, this system can tell you which parts of the system are most brittle.
As usual with big data, there are some downsides. The same system would tell you which developer breaks the code most often. Who writes the worst code. If your manager isn’t able to see the human value in his charges, this might not be your best bet.
- The Next Best Thing – Series in my blog where I dream about the future of software development
I had some trouble to get hibernate (suspend to disk with power off) to work properly on openSUSE 13.2. You can find the problems that I ran into and how I solved them below.
Getting a Boot Menu
Since a while, Linux systems try to hide the fact that they’re Linux. You switch the PC on and after a few seconds, you see a desktop. I hate that. So the first step is to get the boot menu back. Edit
/etc/default/grub and look for
GRUB_TIMEOUT. It’s 0 now, set it 8:
... GRUB_DEFAULT=saved GRUB_HIDDEN_TIMEOUT=8 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=8 ...
Note: You can’t use YaST for this. YaST can only modify
GRUB_HIDDEN_TIMEOUT which is not very useful IMO.
After making these changes, run
grub2-mkconfig as explained at the top of
/etc/default/grub to update Grub 2’s configuration.
See also: GRUB Manual 2.00: Simple configuration
If you tend to get this dialog when you try to hibernate:
then someone else is logged in. In my case, I sometimes have a root shell lying around somewhere or an SSH session. There are two solutions to this problem:
- Hibernate. Wait. Realize that the system won’t hibernate. Log in again. Find the error dialog. Close it. Find the root shell. Log out root. Try again. Don’t forget to mumble curses all the time since it’s 2:00am and you want to go to bed instead of fighting a security policy.
- Tell polkit that if the user in front of the display wants to hibernate, then simply do it!
To do the second, edit the file
/etc/polkit-default-privs.local and append this line:
After making the change, you need to run
/sbin/set_polkit_default_privs to activate the changes; no reboot or relog necessary.
The first word in the line is the operation, the second one is the permissions. The default for
auth_admin:auth_admin:yes which means “ask for root privileges” which makes sense for a server or a shared PC where people connect remotely.
auth_self means “Authentication by the owner of the session that the client originates from is required” which should be good enough for any standalone/private PC.
Related: Polkit man page
Hibernate KDE With a Single Click
Something that I’m missing since a long time is a way to hibernate a KDE desktop at the push of a button. Options from worst to best:
- Open the start menu. Try to navigate to the shutdown options without accidentally closing the menu. Wonder which of the options is the right one for the millionth time. Click and hope for the best.
- Open a root shell, keep it open at all times and run the command
- Use KShutdown
- Allow yourself to execute the command
sudowithout asking for a password. Put
sudo /usr/sbin/pm-hibernateinto a script and wrap the script with an icon on the desktop.
- Issue the hibernate command via shell script and wrap the script with an icon on the desktop.
Options #1 is too cumbersome. #2 wastes too many resources. #3 isn’t standard and I’ve found it increasingly difficult to find the binary for my system. #4 doesn’t lock your screen so anyone able to turn on your computer can mess with it.
So here is how to do #5. First, we need a shell script
$HOME/bin/hibernate with this content:
#!/bin/bash dbus-send \ --session \ --dest=org.freedesktop.PowerManagement \ --type=method_call \ /org/freedesktop/PowerManagement org.freedesktop.PowerManagement.Hibernate
How let’s create a button for the script:
- Make the script executable with
chmod +x $HOME/bin/hibernate
- Right click on the desktop, add applet “Folder View” (German: “Ordner”).
- Create a new folder
$HOME/Hibernateand select this new folder in the settings. That gives you a small window on the desktop that you can size and move – perfect to position our button.
- Right click in the new window and create a shortcut for a program.
- Enter “Hibernate” as name on the first tab.
- On the program tab, select the script.
- Click OK.
- Open the properties for the new shortcut.
- Click the icon to replace it.
- In the new dialog, select “Actions” and search for “hib” which should offer you “system-suspend-hibernate” Click the icon to select it.
- Click OK
- Size and move the folder view to have the button where you want it.
Slightly adjusted version of a Dilbert strip:
Ten minutes pass.
Boss: Wow, you’re fast.
Engineer: … Yes.