Shortcuts
Page Top (Home) - Command Up Arrow Key.
I had to google for far too long to discover the key above.
I've been going through a low intensity keyboard-shortcut-learning-spree as of late. I've learned a number of new ones for windows, chrome, eclipse, and a couple for mac. I find this to be highly effective during peer programming.
I'll compile a comprehensive list of the ones I know, sometime soon.
Technocratic Intervention
Sunday, September 20, 2015
Saturday, June 13, 2015
Rant on the often condescending and patronizing culture on SE and SO
I often find myself reading articles on StackOverlow and StackExchange as part of my profession. Often I find very useful posts that have been closed or flagged negatively in some way by one or many moderators, even though clearly the content is helpful to thousands, as evident in the up-votes, favourites, the number of answers, and constructive comments that are received on such posts.
There is a clear problem with this setup, as is evident in the tone of such flaggings. Often there is a condescending, arrogant, and patronizing tone in such flaggings or some of the early comments by more experienced members. This problem was recognized long ago in this post: Could we please be a bit nicer to new users? and the many comments and answers that follow below it, yet the problem still exists today - 6 years later.
I recently posted on the robotics stack exchange site, about an artificial intelligence topic that has been around for some time, though certainly not a mainstream topic. Firstly, there is no AI SE site, and so I chose the robotics site. Secondly, being my first post, I was excited and perhaps posted too many questions in that one post, as pointed out by the first comment, along with another correction in that comment:
"First, OP stands for "Original Poster" - the person that asked the question. This is you. Second, questions that should be asked here are questions that are closed-ended, in that they should have 1 correct answer. The only question you have asked that meets this criteria is 1.3 ... I would ask that you edit your question to only ask that one, and take all of the other questions to the Robotics chat room."
The tone in the OP bit is obviously a bit blunt. I assumed from other posts that OP may have meant Operator, analogous to Moderator (mod). Well yeah, that would be me, thanks for pointing that out, twice. I let go of that one quickly.
What actually irked me is this:
"Welcome to robotics ________, but I'm afraid that open ended questions like this really aren't a good fit for a stack exchange site. We prefer practical, answerable questions based on actual problems that you face. Take a look at How to Ask and tour for more information on how stack exchange works."
The second comment was posted after I had already changed the question I was asking to the one that qualified as not 'open-ended'. With italics on top. I've been on SO for over 3 years now, so I'm familiar with what constitutes a good question. None of my questions have been negatively flagged on SO. Though I haven't been a heavy user, I've been more of an 'asker' instead of an 'answerer' there, and so I know how to ask questions. Was there really a need for a second redundant comment that is both trying to welcome me and moderate in the same sentence? Cookie-cutters aren't always necessary or appropriate.
Sometimes the arrogance is apparent in some of the mod's usernames, profiles, and obviously some of the comments they make. It was more subtle, and perhaps more coordinated here. The tone in these comments are not welcoming, rude, redundant, and certainly discouraging of a good discussion. My question is certainly all if not most of these:
- inspire answers that explain “why” and “how”
- tend to have long, not short, answers
- have a constructive, fair, and impartial tone
- invite sharing experiences over opinions insist that opinion be backed up with facts and references
- are more than just mindless social fun
Wednesday, April 22, 2015
How to move a window back on screen in Windows
I run into this once in a while, and usually I've resolved it by right clicking on the relevant window's taskbar item, pressing ALT and then the down arrow key to get to the window menu where move is an option.
With windows 7 and 8, right clicking on the taskbar item no longer displays that menu, nor does the ALT + down always work. So, here's what gets you to that menu for a given hidden taskbar item: ALT + SPACE. Pressing M will select move. Clicking the left or right arrow keys will move the window.
With windows 7 and 8, right clicking on the taskbar item no longer displays that menu, nor does the ALT + down always work. So, here's what gets you to that menu for a given hidden taskbar item: ALT + SPACE. Pressing M will select move. Clicking the left or right arrow keys will move the window.
Friday, October 17, 2014
Switching between JDKs and Displaying Hidden Files on OSX 10.9.5
Switching between JDKs
Running Eclipse on OS X 10.9.5, one of the plugins I use warned me that it required Java 7 to run. So I set out to install JDK 7. My choices were to either replace JDK 6 with 7 or to install it alongside 6 and switch between the two if (when) required. Both appeared straight forward choices, though I went with the latter so that I can just switch instead of re-installing when needed.
This required the setting of some environment variables, namely JAVA_HOME and the modification of PATH (which I'm used to doing quickly on Windows). Not an expert OS X user, I thought of which 'top-most' config file to append these vars into so that all users (just cuz) and all launch methods would use them. I remembered that .bashrc is part of a hierarchy that is used to construct the lookup path, and so I'd likely want to place it somewhere near root. Since that file or no such related file exists there, I could have just modified the ones under my /Users/<user>/ dir.
Googling a bit further, I (re)learned of /etc/launchd.conf - config file for a launch daemon. Then I stumbled upon this little handy tool Change Java version on Mac OS. It didn't work at first. Turns out that the /etc/launchd.conf file needs to be created if it doesn't exist; issued this to do that: sudo touch /etc/launchd.conf. The tool worked after that.
Hidden Files
I also learned about a couple of ways to display hidden files in finder (didn't feel like cd'ing and using nano to check out launchd.conf, and just wanted to learn to do this anyway), though this didn't go as smoothly as expected. At first I issued:
- defaults write com.apple.Finder AppleShowAllFiles YES; killall Finder
Which didn't work, so I tried:
- sudo chflags -R nohidden /*
Which also didn't work, so I found:
- defaults write com.apple.Finder AppleShowAllFiles -bool YES; killall -HUP Finder
Which also didn't work at first, but strangely, re-issuing the first one (after some time) worked. My guess is that finder didn't want to restart properly. So, it is either the first or last one that worked.
Relevant links
- http://serverfault.com/questions/16355/how-to-set-global-path-on-os-x?newreg=4e5834a8f05247cfa9028f1ee6b4475c
- http://stackoverflow.com/questions/15826202/where-is-java-7-installed-on-mac-os-x
- http://monkehworks.com/set-java-7-as-default-jvm-on-mac-osx-mountain-lion/
- http://stackoverflow.com/questions/17885494/how-can-i-change-mac-oss-default-java-vm-returned-from-usr-libexec-java-home
- http://stackoverflow.com/questions/21964709/how-to-change-default-java-version
- http://stackoverflow.com/questions/11685179/how-i-can-see-hidden-files-on-finder-on-a-mac
- http://www.guigarage.com/2013/02/change-java-version-on-mac-os/
Monday, January 6, 2014
Connecting to MSSQL Server from Java
I found this basic code snippet useful during the troubleshooting of a certain application-database connectivity issue. It selects the date-time from the `master` DB, similar to Oracle's `dual` table used for testing purposes. A DB user needs to exist, though you can probably use the default sysadmin `sa` user. The project with this snippet needs to have the MSSQL JDBC driver (sqljdbc4.jar) on its project classpath. As of now, version 4.0 of the driver can be run in JRE 7, but not JDK 7; it works fine in JDK 6. Driver download link: Microsoft JDBC Driver 4.0 for SQL Server.
public class TestDBConnectivity { public static void main(String[] args) { String connectionUrl="jdbc:sqlserver://remoteServer:8081;DatabaseName=master;user=userName;Password=userPassword"; Connection con = null; Statement stmt = null; ResultSet rs = null; try { con = DriverManager.getConnection(connectionUrl); String SQL = "SELECT GETDATE() AS CurrentDateTime"; stmt = con.createStatement(); rs = stmt.executeQuery(SQL); while (rs.next()) { System.out.println("result: " + rs.getString("CurrentDateTime")); } } catch (Exception e) { e.printStackTrace(); } finally { if (rs != null) try { rs.close(); } catch(Exception e) {} if (stmt != null) { try { stmt.close(); } catch(Exception e) {} } if (con != null) { try { con.close(); } catch(Exception e) {} } } } }
Source: Connecting to SQL Server 2008 from Java
public class TestDBConnectivity { public static void main(String[] args) { String connectionUrl="jdbc:sqlserver://remoteServer:8081;DatabaseName=master;user=userName;Password=userPassword"; Connection con = null; Statement stmt = null; ResultSet rs = null; try { con = DriverManager.getConnection(connectionUrl); String SQL = "SELECT GETDATE() AS CurrentDateTime"; stmt = con.createStatement(); rs = stmt.executeQuery(SQL); while (rs.next()) { System.out.println("result: " + rs.getString("CurrentDateTime")); } } catch (Exception e) { e.printStackTrace(); } finally { if (rs != null) try { rs.close(); } catch(Exception e) {} if (stmt != null) { try { stmt.close(); } catch(Exception e) {} } if (con != null) { try { con.close(); } catch(Exception e) {} } } } }
Source: Connecting to SQL Server 2008 from Java
Wednesday, August 28, 2013
Monday, July 22, 2013
DB Isolation Levels, Locks, Dirty Reads, Non-Repeatable Reads, and Phantom Reads
A good wikipedia article on Isolation (of the I in ACID): https://en.wikipedia.org/wiki/Isolation_(database_systems). Introduces well the concepts of the various levels of isolation, the required locking for each level, and the observed results per level.
Subscribe to:
Posts (Atom)