How to easily siphon water from pool cover

Time to open up the pool. This time I’ll use my brain and figure out how to do this better.

Yucky Method
The cheapest way to do this is by getting a short length of hose, putting one end in the pool, the other in your mouth and getting the air out. Once that is done, if you take the end and lower it below the other end in the pool, the laws of physics take over, and planet will try to make the two ends of the hose have the same water pressure. Thus, the water starts draining out.

But, that is yucky. You have to really put your arms in that dirty water, and you may get some of it when you suck out the air. I see little wiggly worms in there.

My Method
Get one of those large plastic water jugs. Like the ones used in water dispensers.

pool-siphon

  1. Put a hole in the cap so that you can push the hose thru.
  2. Fill the jug with water.
  3. Put the cover back on the jug.
  4. Now one end of the hose is in the jug. Take the other end and stick it in the pool.
  5. Carefully, move the jug closer to the pool and upend the jug.
  6. Water will start draining from the jug into the pool. This will remove the air in the hose!
  7. Pull the hose in the jug so that it is bottom of jug. This will allow you to flip the jug over again and prevent air to get into the hose.
  8. Bring the jug below the height of the other end in the water.
  9. Now when you flip the jug over, the pool water will be draining out.

Writing down the steps makes it seem complicated. All your trying to do is remove the air from the old hose your using to siphon out the water. It’s just like that motor gas siphoning technique.

An even better better way?
This video shows an alternative method. I didn’t try this, but the video shows it working. If you have a long enough hose, you can connect put that hose in the pool. Turn on the water. When all the bubbles have stopped coming from the end in the pool, turn off the faucet. Disconnect end of the hose at the faucet side. If the height of the pool is higher than the final end of the hose you should start getting water draining from the pool.

Or you can buy a pump. I once bought a cheap pump and it didn’t last one day of use.

Links

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

Do tablets have a black screen of death problem?

Just happened to my tablet, a Samsung Tab Pro 10.1. If you search online for this you find many discussions and pleas for help. Does this happen to other brands of laptops?

BTW, there is also a White Screen of Death associated with iPod, iPad, or iPhone.

On restart, the screen would not show. Sound is ok, buttons seem functional. A restart or reset using button combinations did not fix this.

The Fix
Luckily I found some instructions on how to fix this. Remove the back cover, disconnect the LCD cable, wait for a few minutes, then reconnect.

One person wrote Galaxy Tablet Reboot Trick. I did not try that first.

Notes

  1. Doing this may void your warranty.
  2. Don’t use a metal device to pry the back cover off. Get a plastic prying device that are sold in kits for this kind of thing. Or use a guitar pick.
  3. Getting the cover off takes a lot of careful prying.
  4. Some people recommend you disconnect the battery connector before you disconnect the LCD connector.
  5. Getting the cover back on is just as hard. I still don’t have it seating well.

Background
Note that all (?) electronic components that have multiple connected parts will have issues. When I worked with metrology components or Electrochemical control devices, sometimes the only thing that would fix them was to disconnect and reconnect some device or subsystem, wait a while, then turn the unit back on. I just read that this is one technique to ‘fix’ ECU units on some automobiles.

Links

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

maven-tomcat7-plugin not extracting the war file

The Apache Tomcat Maven Plugin has a great feature: it can create a runnable jar file with an embedded Tomcat server.

I tried this on a simple ‘Hello world!’ webapp to see if this works. It didn’t. When you run the jar: java -jar target\hello.jar, it would fail saying that the hello.war could not be found.

Of course I tried many different configurations and Maven POM file changes. Web searches did not point to an issue. Finally at the end I found something. There is a bug in the plug-in version 2.2. Errrrr.

Anyway, here is a suggestion to get around it. Made the changes, it works.

Links

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

Why not store numbers as diff of previous number?

This morning had a thought. We store numbers in a fixed sized memory space. So if we use four bytes to store numbers we would need eight bytes to store the numbers 5 and 6. But, what if we store 5 in four bytes and then 6 in two bit, as a delta? The bits can indicate +1, 0, -1., here an increment of the 5 by one. Larger increments would use more bits of course. Thus, we naturally get compression.

Subject areas: mobile computing, Internet of Things.

True, this wouldn’t work as a ‘live’ memory storage, the I/O would be complex. Or would it? In constrained devices such as Wearable Computing, for example, a smart watch, or in an Internet Of Things remote device, memory limitations may require compressed storage.

As usual, this is not a new idea. It is related to “Delta Encoding” or “Data differencing”. An interesting article on how delta coding could be used for compression is “Effective compression using frame-of-reference and delta coding”.

I have not seen this delta encoding memory approach mentioned anywhere yet.

Links

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

Got my Raspberry PI’s wifi and keyboard configured

Hit a bump getting the wifi dongle working. So I started following some instructions. Now that gave me another problem, the keyboard was not mapped correctly. When I typed a double quote I got an ‘@’ symbol. Turns out that the locale and keyboard were not set correctly for North America.

To fix the locales: Remapping the Keyboard
To fix the keyboard layout this video gave the simplest approach: Raspberry Pi – Change keyboard layout to US from default British layout
To fix the wifi problem this page was the solution: How to Set Up the Ralink RT5370 WiFi Dongle on Raspian

Test … my third monitor is now showing a page on the web. Cool. The Raspberry Pi 2 (Model B) is pretty fast.

Updates
May 24, 2015: I was having issues where the device would lock with blank screen and not respond to mouse or keyboard. Looks like the issue is the WI-FI dongle and the USB subsystem in this Linux. The log shows USB errors. Nothing seemed to fix this. The usual suggestion is to use an external powered USB. On a chance I updated the Linux OS and now the system is working fine. I can leave the PI on.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

JSON as a configuration language

JSON as a configuration data file is already a given. I wrote about this before. Google has now made this even more powerful by open sourcing Jsonnet, a “mini-language”, domain specific language (DSL) on this data format. Jsonnet it supports inline comments. Nice!

If your scratching your head and wondering why, JSON is JavaScript, then you don’t understand what JSON is. JSON is a ‘data-interchange format’. It happens to be based on a subset of the JavaScript language, but it could have been in Python, Groovy, or any other scripting language. Undoubtedly, JavaScript’s ubiquitous use on the web is why JSON was optimal.

Links

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

SvnKit E170001: Negotiate authentication failed: ‘No valid credentials provided’

In a new project, attempts to programmatically access our Subversion server using SvnKit fails with an E170001 error. But, only on one Windows 7 workstation.

After a lot of searching on web for answers finally found something that helped. I had to add system property: svnkit.http.methods=Basic,Digest,Negotiate,NTLM

So, using SvnCli, which I used to debug this, you add the property using the “-D” switch to the command line.

java -Dsvnkit.http.methods=Basic,Digest,Negotiate,NTLM -cp "SvnCli\*" org.tmatesoft.svn.cli.SVN --username *** --password *** list

I also had to add this property to the Tomcat app server.

Solution?
While this does fix the problem in this instance, since only one workstation is effected, it is probably hiding an underlying configuration setup issue.

I wonder what percentage of the nation’s GDP is spent on configuration and its issues.

Original stacktrace:

Mar 18, 2015 11:40:31 AM org.tmatesoft.svn.core.internal.util.DefaultSVNDebugLogger log
SEVERE: CLI: svn: E170001: Negotiate authentication failed: 'No valid credentials provided'
org.tmatesoft.svn.core.SVNException: svn: E170001: Negotiate authentication failed: 'No valid credentials provided'
        at org.tmatesoft.svn.cli.AbstractSVNCommandEnvironment.handleWarning(AbstractSVNCommandEnvironment.java:401)
        at org.tmatesoft.svn.cli.svn.SVNListCommand.run(SVNListCommand.java:95)
        at org.tmatesoft.svn.cli.AbstractSVNCommandEnvironment.run(AbstractSVNCommandEnvironment.java:142)
        at org.tmatesoft.svn.cli.AbstractSVNLauncher.run(AbstractSVNLauncher.java:79)
        at org.tmatesoft.svn.cli.svn.SVN.main(SVN.java:26)
        at org.tmatesoft.svn.cli.SVN.main(SVN.java:22)
svn: E170001: Negotiate authentication failed: 'No valid credentials provided'

Environment

  • Java 1.7
  • SvnKit 1.8.8
  • Tomcat 7

Links

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

How to edit React jsx scripts in Eclipse?

I was about to use React in a new project when I hit a development PITA. How do you edit the JSX scripts within a page using Eclipse?

Background
In React, you can use JSX files or JSX script embedded in the page. The JSX transformer converts these to standard JavaScript at compile or in the browser.
Note: Embedding JSX scripts in a page is most likely a very bad thing to do.

Eclipse allows the use of shortcut key bindings for various views and content types.

Example
From the React docs, below is a sample jsx script. When this is embedded in an HTML file within Eclipse, such as index.html, there is no way to edit the script using the normal Editing key bindings. Even indentation of highlighted lines fails. Weird, I even tried to create a new key binding for TAB or ctrl+i, to no avail.

<script type="text/jsx">
	var HelloWorld = React.createClass({
	  render: function() {
		return (
		  <p>
			Hello, <input type="text" placeholder="Your name here" />!
			It is {this.props.date.toTimeString()}
		  </p>
		);
	  }
	});

	setInterval(function() {
	  React.render(
		<HelloWorld date={new Date()} />,
		document.getElementById('example')
	  );
	}, 500);
</script>

If I discover how to get around this, I’ll post here. Of course, you can put your jsx code into an external js file, that Eclipse has no problem with.

References

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

OCR using Smart Select on the Galaxy Note 4

In my last blog post I had to copy some text from some old photocopies I made years ago. Not wanting to retype the whole thing I wanted to use Optical Character Recognition (OCR). This is 2015, do we really have to copy by typing?

Google Drive is capable of doing this, but did not work for me. So I finally tried to do this with my Samsung Galaxy Note 4. Here is how:

  1. Take out the pen and you’ll get the circular menu for some pen features.
  2. Ignore that menu for now
  3. Take a picture of the page using the camera
  4. Open that picture
  5. Bring the pen tip close to the picture and double click the pen’s button
  6. You get that circular pen menu again from step 1 above
  7. Now pick Smart Select option
  8. Draw a rectangle on the text you want from the photo
  9. When you finish the rectangle, the image is captured, and half second later that image will get a “T” in top right corner.
  10. Click that “T” text icon.
  11. Now the text will be presented and a share symbol.
  12. Click the share symbol and pick someplace to send the text

Sounds like a lot of steps, but once done its pretty effortless.

I used Google Keep to share the captured text. That way I could open Keep on my desktop using Chrome Browser and access the text snippets I captured on the phone. Pretty awesome!

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

Relation generation rules from ER diagrams

A few general purpose purpose rules can help in creating relational database models. I found these rules years ago in a library and photocopied them. Of course, these are for very simple situations and not intended for a database professional’s use.

Rules

Rule 1

When the degree of a binary relationship is 1:1 with the membership class of both entities obligatory, only one relation is required. The primary key of this relation can be the entity key from either entity.

Rule 2

When the degree of a binary relationship is 1:1 with the membership class of one entity obligatory, and the other nonobligatory, two relations are required. There must be one relation for each entity for each entity, with the entity key serving as the primary key for the corresponding relation. Additionally, the entity key from the nonobligatory side must be added as an attribute in the relation on the obligatory side.

Rule 3

When the degree of a binary relations is 1:1 with the membership class of neither entity obligatory, three relations are required one for each entity, with the entity key serving as the primary key for the corresponding relation, and one for the relationship. The relationship will have among its attributes the entity keys from each entity.

Rule 4

When the degree of a binary relationship is 1:n with the membership class of the n-side obligatory, two relations are required: one for each entity, with the entity key from each entity serving as the primary
key for the corresponding relation. Additionally, the entity key from the 1-side must be added as an attribute in the relation on the n-side.

Rule 5

When the degree of a binary relationship is 1:n with the membership class of the n-side nonobligatory, three relations are required: one for each entity with the entity key from each entity serving as the
primary key for the corresponding relation, and one for the relationship. The relationship will have among its attributes the entity keys from each entity.

Rule 6

When the degree of a binary relationship is m:n, three relations are required: one for each entity, with the entity key from each entity serving as the primary key for the corresponding relation, and one
for the relationship. The relation from the relationship will have among its attributes the entity keys from each entity.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.