View on GitHub

Quorten Blog 1

First blog for all Quorten's blog-like writings

Running Python scripts on Windows

2016-06-24

Categories: python  
Tags: python  

Very important for running Python on Windows. How do you setup Windows so that you can execute Python scripts like regular binaries? Note that Windows needs the Python .py extensions to be sticking around for this to work. No extensionless executables, sorry.

20160624/http://stackoverflow.com/questions/9037346/making-python-scripts-run-on-windows-without-specifying-py-extension

assoc .py=Python.File
ftype Python.File=c:\Python27\python.exe "%1" %*

assoc .py=Python.File
ftype Python.File="C:\Program Files\Python35\python.exe" "%1" %*

Mobile phone and DIY buyers beware! Counterfeits amok!

20160617/https://en.wikipedia.org/wiki/Secure_Digital#Fakes
20160617/https://en.wikipedia.org/wiki/USB_flash_drive#Counterfeit_products
20160617/https://en.wikipedia.org/wiki/Secure_Digital#cite_note-83
20160617/https://en.wikipedia.org/wiki/Chumby
20160617/http://www.bunniestudios.com/blog/?page_id=1022
20160617/https://sosfakeflash.wordpress.com/2008/09/02/h2testw-14-gold-standard-in-detecting-usb-counterfeit-drives/comment-page-2/
20160617/https://fixfakeflash.wordpress.com/2012/02/25/mac-apple-h2testw-alternative-program-called-f3-by-michel-machado/
20160617/https://edwardmallon.wordpress.com/2014/09/22/high-sleep-current-problem-solved/

This link, unfortunately, is unreadable without a JavaScript browser.

20160617/http://technable.net/i-bought-a-fake-mophie-juice-pack-so-you-dont-have-to/

So what were you saying about getting a $2 MicroSD card? Oh, yeah, I better beware on that one. If you’re not a large OEM manufacturer, you probably can’t negotiate a deal for that low of a price. And if you do buy a consumer device for that low of a price, chances are you are getting a counterfeit of despicably low quality. Okay, okay, fine, I guess we shouldn’t go with anything less than $10 in that case, then. After all, the memory card is in fact one of the most important part of the system. You don’t want to loose all your data that you’re trying to scan, do you?

Read on →

Hate windows all you want. What is the easiest way to setup SSH on Windows? Well, there’s PuTTY. But what about through Python?

20160610/https://wiki.python.org/moin/SecureShell
20160610/http://stackoverflow.com/questions/17228943/python-interactive-ssh-client-using-paramiko

I guess, you know the way Windows is, that downloading files from web pages isn’t all that hard. Of course, that is really the only builtin behavior that is guaranteed on Windows systems. ftp? Sometimes that is available, sometimes not. So, those are your options for getting data onto a Windows computer to begin with.

Okay, finally! I found it! It’s in the Paramiko source code repository. Demos. Of course. I just needed to look a little bit harder. Wow, sometimes it really surprises me that ta sub-par results comes out on top in Google search results, but I should have known better. You have been forewarned.

20160610/http://stackoverflow.com/questions/373639/running-interactive-commands-in-paramiko
20160610/https://github.com/paramiko/paramiko/tree/master/demos
20160610/https://github.com/paramiko/paramiko/blob/master/demos/interactive.py

Okay, so it works. Just run demo_simple.py', but don't forget to do data.decode('utf-8') before writes in interactive.py’! Yes, yes, the demo code wasn’t quite ported to Python 3.

Oh yeah, there’s another caveat. ANSI escape sequences don’t get translated inside of your NT command shell.

Read on →

20160605/https://en.wikipedia.org/wiki/Demolition
20160605/https://en.wikipedia.org/wiki/Deconstruction_%28building%29

  • The literal meaning of the word “dilapidated” is “stones have been stolen from a building.

20160614/https://en.wikipedia.org/wiki/Dilapidation
20160614/todo/south-part-episode-historic-sodopista

Efficiency and environmental friendliness. “Environmentalism is not a new idea.” On the contrary, lack of concern for the environment is the new idea, as historically, humans had to reuse and share the same living spaces for thousands of years, and given that their ways of life traditionally did not change much over thousands of years, making sure the environment was the same as you left it was paramount.

Sure, humans could have moved around to keep living in “new” spaces, but as a matter of fact, most human societies have preferred to keep living in the same locations rather than keep moving around to “new” locations. And even among those who did need to keep moving around, they designed their lifestyle around a portable mentality, where they could pack up all their belongings and leave the site where they were formerly living while leaving no traces that they were there.

Of course, in recent times, in industrialized cultures, people’s lifestyles have changed far more in far less time, so some curious new phenomenon have emerged.

Read on →

Abestos

2016-06-06

Categories: mat-sci  
Tags: mat-sci  

20160605/https://en.wikipedia.org/wiki/Asbestos

All the lawsuits over asbestos.

20160605/https://en.wikipedia.org/wiki/Asbestos_and_the_law

Lots of interesting information here. Oh yeah, and about people coming in to pollute the land. So here we have this.

20160605/https://en.wikipedia.org/wiki/Superfund
20160605/https://en.wikipedia.org/wiki/Popcorn_ceiling

Interesting note about asbestos and the discovery of toxicity related to it. Originally, asbestos was not widely used, so it was not thought to require large regulations. However, unfortunately it did experience unexpected growth in use, so regulations banning it appropriately ended up coming late.

Read on →

You know what? This is a good idea, this is a great idea. So great, that I must make it in my inven-sys notes. Over time, when maintaining my notes, especially my house logs, I strive to maintain consistency. Unfortunately, keeping the language consistent isn’t easy, being that as humans don’t have built-in knowledge of language, it tends to drift overtime and increases the total world complexity, even though the complexity for particular humans stays constant. So, what is my proposed solution?

Well, if you ask me, keeping language and vocabulary consistent is something that is really only easy to do over at maximum a three year period. Information that must persist for longer than three years is going to need a way to compensate for language drift. That is, if you are writing formal computer languages in which the functionality will only work if the keywords match exactly.

Read on →

One important observation about hierarchical organization that I must note. Yes, it is very similar to hierarchy-free keyword grouping. However, it’s just that some search queries are more optimal than others, and that if you want to find something exactly, you have to specify every single keyword value in the search query, then sort them into the proper order to get the filesystem path to the object in question.

Oh yeah, and one important note for searching for objects by their image. Here’s the idea. All you need is a series of pictures to effect a 360 degree view of the object in question. Photos can be 2D rotated for matching as necessary, so all you need to do is take the 2D features out of a new photograph and determine which collection of 2D photographs is best matched by this. And, I note this one, storing only the 3D models of the objects in question is a great way to compress the collection of 2D photographs for the object. However, it does imply a cost in regenerating them, and the 2D search is a rather different method of operation. So, those are the caveats, and it may make sense then to store all 2D photographs pre-rendered for computation. The only time it may make sense to not store them is when you want to crunch your data down to fitting in a small storage space.

Anyways, pretty interesting things going on here. And especially with hardware artificial neural networks, doing image searches by photographing will be really fast and efficient.

Pipe dream and Yoko Ono

2016-06-05

Categories: random  
Tags: random  

Now, time to answer some miscellaneous questions. Yeah, I know, this isn’t really worth anyone’s time, but it is interesting that we do have computer systems that allow us to get answers to these questions so quickly.

What’s a “pipe dream”? It’s an English language idom meaning a plan that will likely not work. Etymology: from hallucinations from smoking a pipe.

20160604/https://en.wiktionary.org/wiki/pipe_dream

Who’s Yoko Ono? Oh, some Japanese song artist, that’s all.

20160604/https://en.wikipedia.org/wiki/Yoko_Ono

Wow, that Scanning from Heating paper is a really valuable resource. I was able to find links to other 3D scanners out and about in the market. And guess what? I found information on the API that is used to connect the 3D scanner with the host software too: Nikon Metrology API. Well, that’s 3D scanners for at least one case. I’m going to see if I can find links to more 3D scanners on the market so that I can learn about more software interfaces. This is of course crucial to get right, because doing so will make it dramatically easier to integrate home-grown 3D scanner designs with.

20160604/http://www.nikonmetrology.com/Products/Laser-Scanning/Handheld-scanning/ModelMaker-MMDx
20160604/http://www.nikonmetrology.com/handheld_scanners/mmdx_mmc/
20160604/http://www.nikonmetrology.com/content/download/12579/256644/version/23/file/MMDx-MCAx_EN.pdf
20160604/http://www.nikonmetrology.com/content/download/12579/256644/version/23/file/MMDx-MCAx_EN.pdf

Oh yeah, and “all standard point, mesh and CAD formats, such as IGES, STL, CATIA, UG, Pro/E, STEP, VDA, etc”. I personally note Wavefront OBJ too. As a matter of fact (de facto), Wavefront OBJ seems to have more support across commodity open-source 3D software.

Read on →

Yes, these times sure are amazing. Let’s write out the cost formula for my 3D laser scanner, in the most cost-efficient implementation.

  • $0 paper mache armature
  • $2 laser diode line generator
  • $3 battery holder (or other portable power device)
  • $5 Raspberry Pi Zero
  • $5 Raspberry Pi Zero FPC camera connector
  • $11 32 GB MicroSD card
  • $25 Raspberry Pi Camera

Total: $51 dollars.

And the best thing about this is? The cost for setting up an equivalent Scanning By Heating system is identical. Alternatively, if you want to reuse the as many parts as possible, then it only costs $27 to buy the additional infrared camera and laser diode parts for Scanning By Heating.

Now, let’s consider the alternatives.

  • $0 paper mache armature
  • $3 battery holder (or other portable power device)
  • $11 32 GB SD card
  • $25 laser diode line generator
  • $25 Raspberry Pi Camera
  • $35 Raspberry Pi 3

Total: $99 dollars.

Read on →