Showing posts with label quick. Show all posts
Showing posts with label quick. Show all posts

2014-02-27

Level Up - Android Dev: How To Automatically Extract Hardcoded Strings To res/values/strings.xml

This is just one of the many refactoring features of Eclipse. Using this extract feature, you won't even need to open res/values/strings.xml to add the String resources nor manually write out reference to the resource.

This saves a lot of time, and allows the best practice of putting String constants away from the UI/Java files so that localization can be performed easier. This method I'm about to show you is especially productive because it can change all instances of that particular String to point to the xml string resource so that you don't have to do it individually one-by-one. (I'm doing maintenance on code that has everything hardcoded, so this is a lifesaver.)

To automatically extract the String, it's easy enough:

Step 1: Highlight the entire String that you would like extracted and sent to res/values*/strings.xml
Step 2: From the menu bar, select Refactor->Android->"Extract Android String..."
Step 3: Preview options and confirm changes.

Step 2: Automatically extracting string menu option.


Step 3: Many different great refactoring options to choose from.


This works in the XML and Java files for your Android application. And, this is much quicker than manually changing all instances of hardcoded Strings to getString() and @string/.


~ Danial Goodwin ~



2014-02-15

Level Up - Webmaster: How To Shorten Default MediaWiki URL to Short (Canonical) URL Form

This was my first time shortening the URL for MediaWiki to canonical form and it literally took me less than five minutes to fully complete and test. I bet you can do it in two minutes.



Quick and easy directions:
1. Go to MediaWiki ShortURL Builder (Your wiki will have to be temporarily public)
2. Type in your current URL, for me it was " http://danialgoodwin.com/mediawiki/w/"
3. When you click "Go", make sure the article path says "/wiki/$1" or wherever you would like your MediaWiki to appear to users.
4. You now have all the code at your fingertips to place on your server. I used a GUI FTP client (like FileZilla) to transfer the new data because that was the quickest for me.


The Code:
If your configuration is the exact same as mine, then you can use these following sections of code to enable the shortcodes.

At the root of your domain, in the .htaccess file (make it if you don't have it), include (I added the "REGION" comments just for readability and future maintenance):
# REGION Redirects for MediaWiki Short Canonical URLs
RewriteEngine OnRewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/mediawiki/w/index.php [L]RewriteRule ^/?$ %{DOCUMENT_ROOT}/mediawiki/w/index.php [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-fRewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-dRewriteRule ^/?mediawiki/w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/mediawiki/w/thumb.php?f=$1&width=$2 [L,QSA,B]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-fRewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-dRewriteRule ^/?mediawiki/w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/mediawiki/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]
# ENDREGION Redirects for MediaWiki Short Canonical URLs

In your MediaWiki's LocalSettings.php file, insert the following lines (preferably right under "$wgScriptPath" and "$wgScriptExtension" just to keep things organized):
## Added for short URLs.$wgArticlePath = "/wiki/$1";$wgUsePathInfo = true;
## Added for short URLs because .htaccess on root includes 404 thumbnail handler config.$wgGenerateThumbnailOnParse = false;


Note: With this method, you don't even need a /wiki/ directory to make it appear that all the files are there. You should use this method so that when you make changes to the backend, the frontend will still be the same for users, search engines, and SEO. It also makes URLs easier to remember and more.

More detailed information: Manual:Short_URL

~ Danial Goodwin ~



2013-05-15

Get Your Band Name From Wikipedia

Straight to the point some quick fun. First are the directions to get your band name from Wikipedia, then I will tell my results.

Directions:
1. Click here for a random Wikipedia entry. This will be the name of your band.
2. Go to Random Quotations. The last 4 or 5 words of the very last quote on the page is the title of your first album.
3. Click here to go to Flickr’s “Explore the Last Seven Days” page. The third picture, no matter what, will be your album cover.
4. Now add them all together.

My results:
4. So, look out for my newest release, "Raised Writing to a New Low" by Unusual Heat!

2013-02-22

Procrastination Hack - Limit the Time Between Thinking and Doing

"Limit the time between thinking and doing." - Procrastination hack.

I'm sure I've read about this somewhere else, but I didn't find it with a quick "exact-phrase" search.

The goal is to stop putting so many items on a todo list and just do them as you think of them. One of the benefits is that you actually get stuff done rather than just thinking about it.

If you are actively participating in an activity or task, then you clear your mind of another task by writing it down. Current evolution of humans allows us to truly excel at just one task at a time. When we try to do more than one thing at a time, results are typically less than doing each of them individually.

Since I feel this needs an example.. Off the top of my head: I can juggle whilst riding a bike (multitask). But, if I were to do either of them individually, then it would be done much better.

~ Simply Advanced ~



2013-02-21

Quick Notes - 20130221

  • "The Presentation of Self" by Erving Goffman (1959)
    • We define situations.
  • Microsociology, Erving Goffman
  • Wallflower, Perks of Being a
  • Movie: "Tootsie"
  • I now have a proper name for what I've been calling group think (peer influences), which is Solomon Asch and the Asch conformity experiments, aka Asch Paradigm.
  • It seems to be hard to overcome first interactions/experiences. Perhaps, that's because it is when our brain connections are first formed around the new topic. It's harder to break those connections than create new ones. Those new connections group/form around the initial connection. So, that initial feeling will be there for a long time.

  • The only "real" theories we have are based upon a human defined topic (i.e., Euclidean geometry where a line can't intersect itself and parallel lines don't cross)
  • I have tons of excuses, but none is sufficient enough excuse
  • Being deaf-ish in one ear, but still able to detect where sound comes from [audibly]. Perhaps the timing of sounds is used rather than the intensity of sound.
  • People who don't change their desktop background screen may be considered as "not tech-savy", but I haven't changed my screen from the default because I've gotten past procrastination. Changing the background does not significantly effect my ability positively enough to warrant time to look through the great choices of wallpapers that I have used in the past and the many more I have saved.


~ Simply Advanced ~



2013-01-28

Windows 8 Power Users

There is going to be a new paradigm with Windows 8. I'm not just talking about the Modern UI (also was known as Metro UI).

Microsoft provides users many advanced mouse functionalities that hasn't been natively including in an operating system.

Typically, when we think of power users, we think of experts at the keyboard that have memorized many shortcuts and snippets of code. But, the new paradigm shift from Windows 8 is going to provide people the ability to call themselves mouse power users. Perhaps more people will learn about mouse gestures because of this. I'd give it at least another two years before mouse gestures become more mainstream, not just the mouse device gestures.

Personally, I typically prefer the keyboard to mouse, so much so that I created a script that allows keyboards to perform a double-click. But, there are definitely some times that the mouse is faster. Also, for those who don't like to use the keyboard at all there are many programs that you can download to provide your mouse the ability to do pretty much anything.

 - Just Gestures
 - Mouse Gestures

Let me know your experiences with mouse gestures.

~ Simply Advanced ~

*I did not personally try out these programs



2013-01-07

Learn Morse Code Quicker

This should make learning Morse code a little easier than staring at a plain list.

A quick Morse code refresher:
  • Dit is the same as a dot. Dah is the same as a dash.
  • The duration of a dash is three times that of a dot.
  • Letters are separated by a space duration equal to one dash (or three dots).
  • Words are separated by a space duration equal to seven dots.



For more information about Morse code, including numbers.

~ Simply Advanced ~



2012-08-03

Quick Learn - How Jeans Are Made

I like to think I am pretty good at summarizing topics. So, take 7 seconds to learn basically how jeans are made. ;]

1. Get cotton
2. Strengthen cotton, including adding cornstarch
3. Add dye
4. Cut out jean pieces
5. Stitch pieces together
6. Roughen jeans
7. Use laser to add designer creases

http://www.wimp.com/jeansmade/

~ Simply Advanced ~



2012-07-03

Quick Math - Apps and Ideas

tl;dr - Just skim the bullet points.

Just a quick look around on Google Search and I see that there are currently around 600,000 apps available in Google Play. (I don't include iOS apps because same apps are double counted for the iPad versions, so there are actually much less apps there.)

  • 600,000 different apps.

Now, anybody can see that there are multiple apps for every function that you want an app to perform. I will be lenient and say that there is on average 100 apps for every idea/function. Ex: 100 note-taking apps, 100 camera apps, 100 unit converters, flashlights, Angry Birds.. Some have less, some have many more repeats.

  • 6,000 unique apps
So, does that mean there are only 6,000 ideas in the world?


There's got to be more ideas, I'm sure we'll come up with them soon.

~ Simply Advanced ~