Showing posts with label productivity. Show all posts
Showing posts with label productivity. Show all posts

2014-12-05

Level Up - Android Studio: How to Boost Productivity By Auto-Generating Getters and Setters

A best practice in Java is to encapsulate field variables by making them private and creating a "getter" and "setter" for each of them, as needed. Doing this with many fields can be a lot of boilerplate code to write. But, thankfully, modern IDEs, like Android Studio provide ways to auto-generate code so that you don't have to manually write it.

For example, if you have a class like the following:

public class MyClass {
    private int mId;
    private String mName;
}

Instead of manually writing each accessor (getter) and mutator (setter), go to the menu and click Code->Generate.. (hotkey `alt+insert), then choose the "Getter and Setter" option.

Done. That was fast. And, it will be just as fast with 20+ fields also.

But, wait! By default, Android Studio will include that "m" prefix (stands for "member" variable) in each of the generated method names, so you'll have method names like "setmId" and "getmId". There is a quick permanent fix for this also!

Go to File->Settings->Code Style->Java->Code Generation, then type a single "m" into the "Field", "Name prefix" field. Hit apply, then you are gone. All future code generations will take those "m" prefixes for field into account. Here's a screenshot to what this sentence means visually.

So easy to save a lot of time with Android Studio

That's it for this post. There are lots of other useful code generators also. If you are doing mindless work, it's probably been automated (or should be). ;)

~ Danial Goodwin ~



2012-12-31

Something New

Lifehacker is probably the best site to find productivity hacks, clever uses for items, and many other interesting topics that tend to make your life better. Today, I am going Lifehacker-diving again. A term that I just made up as I wrote the sentence down. It means that I am going to open up a whole bunch of different articles in different tabs, then just read through them all and possibly follow links to other websites.

Something I thought about doing before is just pasting every single article/link that I read. And, maybe, I'll precursor each of the titles/links with a plus or minus sign as my suggestion, and 0 for neutral (aka depends on reader preference). If the title isn't apparent in the URL, only then will I write it out.

Well, here it goes: (Starting with http://lifehacker.com)
[--] http://lifehacker.com/5941712/how-much-does-your-computer-stress-you-out
[++] http://lifehacker.com/5957553/stop-procrastinating-by-clearing-to-neutral [I do this already =]]
[+] http://www.asianefficiency.com/health/manipulating-bedroom-sleeping-temperature/ [I have performed many experiments with different sleeping arrangements. It is good to try out.]
[+] http://www.asianefficiency.com/habits/morning-rituals-revisited/ [Definitely]
[+] http://lifehacker.com/5971173/three-quick-and-easy-ways-to-quiet-your-mind
[0] http://lifehacker.com/5969720/how-can-i-deal-with-a-slow-internet-connection
[0] http://lifehacker.com/5971740/what-else-can-i-do-with-my-new-ereader-besides-read-and-buy-books
[0] http://lifehacker.com/5971340/how-can-i-get-my-unresponsive-friends-to-actually-return-my-messages
[+] http://blog.getresponse.com/best-time-to-send-email-infographic.html [Summary: Best times are 8-10am and 3-4pm]
[+] http://lifehacker.com/5964285/whats-all-the-fuss-about-evernote-why-do-people-use-it [I am on and off with Evernote. I'm leaning to go paperless receipts with this rather than others though]
[0] http://lifehacker.com/5666954/avoid-everything-buckets-aka-why-i-cant-get-into-apps-like-evernote
[0] http://lifehacker.com/5892905/the-secret-weapon-combines-gtd-and-evernote-into-one-synchronized-productivity-system
[+] http://www.thesecretweapon.org/ and http://www.youtube.com/watch?v=cE3amWDQ2io (related)
[+] http://lifehacker.com/5955229/why-does-everyone-hate-windows-8-should-i-upgrade [I like Windows 8 and think it's great]
[0] http://lifehacker.com/5967154/what-should-i-do-now-that-google-apps-accounts-are-no-longer-free
[+] http://lifehacker.com/5958893/why-its-worth-it-to-purchase-your-own-domain-name [I would like to purchase more domains. I have a list of excellent names to use.]
[+] http://lifehacker.com/5905702/dropbox-google-drive-skydrive-and-others-pricing-per-gb-and-more-compared-in-convenient-charts [I currently use Dropbox, Box, Drive, and SkyDrive. Eventually, I may dish out for just one of them. I just haven't needed to yet.]
[0] http://lifehacker.com/5959742/how-can-i-turn-my-mess-of-ideas-into-something-organized-and-useful [I've already been doing this, hoping to learn more, but this article can defintely benefit other idea guys]
[+] http://lifehacker.com/5957559/how-do-i-answer-when-im-stumped-by-an-important-question
[+] http://dinosaurs.about.com/od/herbivorousdinosaurs/p/parasaurolophus.htm [I don't typically care for about.com, but this was linked in the article and was a good read]
[+] http://lifehacker.com/5853250/how-to-sound-like-you-know-what-youre-talking-about-even-when-you-dont [Make sure you are confident when you do know what you are talking about.]
[+] http://tribalseduction.com/blog/5-ways-to-act-like-an-expert-in-online-communities/
[++] https://www.google.com/search?q=define+ad+nauseam
[0] http://lifehacker.com/5957605/does-it-matter-where-i-buy-my-music
[+] http://lifehacker.com/5971711/what-they-dont-tell-you-about-promotions
[++] http://lifehacker.com/5967464/treat-your-freelance-work-like-a-stock-portfolio-to-meet-your-income-goals
[+] http://99u.com/tips/7258/Why-You-Should-Treat-Your-Freelance-Portfolio-Like-a-Stock-Portfolio
[++] http://lifehacker.com/5968613/what-lying-actually-does-to-your-brain-and-body-every-day [The article is pretty macabre. Seems like there is a lot of stress involved. I double-plussed this just because I feel others should have the great opportunity of reading it]
[++] http://lifehacker.com/5971473/how-to-tackle-three-of-the-toughest-interview-questions [Bookmarked. I am definitely going to read this at least two more times]
[0] http://lifehacker.com/5971774/zombies-run-turns-your-exercise-routine-into-a-game-is-half-off-right-now [I do like zombies. ..in the way that as long as they don't bother me, then I won't bother them =b]
[+] http://lifehacker.com/5971452/how-i-learned-to-rely-on-my-own-memory-and-stop-depending-on-technology [I've worried about the use-it-or-lose-it regarding our brains. I like the poetry of the article. One thing I know I will forget if I don't write it down is thoughts right before going to sleep. I've told myself many times, "Oh, it's such a huge and awesome idea that I couldn't possibly forget it in the morning", but I do. =/ Then again, maybe I haven't worked hard enough to develop that memory skill yet.]
[-] http://lifehacker.com/5972105/should-i-wait-a-few-months-to-see-if-computer-component-prices-drop-or-buy-now
[+] http://lifehacker.com/5836879/what-stress-actually-does-to-you-and-what-you-can-do-about-it [I've also read a lot about Nirvana and Zen and have been able to reach it; I have experienced complete inner peace before and have been able to train myself to completely clear my mind. If somebody asks me about it, then I don't mind sharing. One of the side-effects for me was that after learning how to reach Nirvana, for a while it was too easy to get in the state of mind again. I could be in the middle of a conversation and suddenly, I'm just free from the world, just, there. I'm getting tingling feelings just thinking about it. I find just regular meditation to be more useful for me (someone with very low stress. (people with higher stress should be able to complete clear their mind)). It allows my brain to wander and wonder. I like having thoughts flowing through my head, and being able to think subconciously. Right now I'm thinking it's kinda like knowing your brain is doing an automatic defrag, it's a good thing. I should write another post on just this one topic..]
[+] http://lifehacker.com/5966433/how-to-get-an-energy-boost-without-caffeine
[+++] http://lifehacker.com/5965826/seven-productivity-myths-debunked-by-science-and-common-sense [This is the only three-plussed article. **hinthint** But, as always, remember to take everything with a grain of salt]
[+] http://lifehacker.com/282544/merlin-mann-presents-inbox-zero [Bookmarked to read later. Hopefully, I will learn something new. I already do my part to achieve Inbox Zero. I spread the word around when I can too.]
[+] http://lifehacker.com/5965334/how-to-motivate-people-to-do-things-they-dont-want-to-do [Good enough to want me to read two Wikipedia pages to read another day: http://en.wikipedia.org/wiki/Progressive_disclosure and http://en.wikipedia.org/wiki/Self-determination_theory only because I'm starting to get tired of all the reading now. Time for sleep soon.]
[Only eight more tabs to go, but it could easily turn into sixteen tabs]

Jk, just made a new folder for the rest of the tabs. I think I will try to do another post like this one. At least until I finish up all the ones I opened today.

=====================

Wow, I haven't done this much lifehackering in a very long time. Feels Good.

And now it's time for sleep. I lost two hours of sleep reading through all of these articles. Hopefully, a lot of REM so that these readings stay stored in my head.

~ Simply Advanced ~

ps - One conclusion that you can draw from this elongated list of links is that, if they all have one thing in common, then it would be that I'm interested in that topic. I'd like to hear other people's thoughts about the list.



2012-12-21

Future: No Time Cards, You're Being Watched

Ever get the feeling you're being watched? It'll pass, because you know for a fact that you are being watched, it is the future after all.

The future of work and productivity will include no filling out of punch cards or time sheets. Cameras with facial detection algorithms can easily recognize different faces. High resolution cameras can even read your fingerprints from across the room. These two technologies will detect entering and leaving of a facility. But, what about actual work? Employers want to know if employees are actually working or sleeping at their desks (sleep may be a good thing, just like watching kitten videos). Many companies (including Toyota, Ford, Volkswagen, Daimler) are working on algorithms to detect when a human is tired, excited, or other range of emotions. This technology can easily be applied to workstations to know whether or not people are facing the proper working direction (computer or assembly line) and if their eyes are closed.

..just saying.

~ Simply Advanced ~



2012-12-18

How to Create a Hotkey to Double Click Using AutoHotkey

Just created a hotkey to double-click so that I don't have to use the mouse! It is very much worth it and will speed up coding. There are other areas that I will be more productive in also. Just can't think of them right now.

I used an awesome program called AutoHotkey to achieve this and many other create keyboarding shortcuts/hotkeys/scripts. The following code basically says, "if ctrl is pressed twice consecutively in less than 500ms, then click two times at the caret position."


Ctrl::
    If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
MouseGetPos X,Y
Send {Click  %A_CaretX%,%A_CaretY% 2} ; Moves the cursor
MouseMove (X),(Y) ; Moves back the cursor
    }
Return



  • Instead of using "%A_CaretX%,%A_CaretY%", it is possible to hardcode an x and y value to click on.
  • If you remove the line starting with MouseMove, then the cursor will move to the position the caret is at.


Let me know if this helps. =]

Disclaimer: I have not done an extensive test on all programs to see if this works. But, I know that it works in Notepad++, Eclipse, Notepad, and MS Word 2010. While typing this, the hotkey seems to return (aka double click) the top-left corner.

~ Simply Advanced ~



2012-11-08

Sticky Notes Shortcuts You Didn't Know

The desktop application I am talking about today is Sticky Notes that comes standard in Windows.

I used to think that Sticky Notes was a featureless program. But, one day I decided to try out some formatting shortcut keys that I typically use in other Windows products. So, then I discovered that the application supports Ctrl+b for bold, Ctrl+e for aligning text to center, Ctrl+Shift+> for increasing text size, and more. This has made Sticky Notes much more useful than before.

I used to think that just writing on paper was the quickest way to keep notes and a todo list. But now, for efficiency, I use just one large Sticky Note on my desktop. This has the added benefit of not having to throw away physical paper.

List of hidden Sticky Notes shortcuts:
BoldCtrl+b
ItalicCtrl+i
UnderlineCtrl+u
StrikethroughCtrl+t
Decrease Font SizeCtrl+Shift+<
Increase Font SizeCtrl+Shift+>
Align Text LeftCtrl+l
Align Text RightCtrl+r
Bullet/Numbered ListsCtrl+Shift+L
SubscriptCtrl+=
SuperscriptCtrl+Shift+=


I'd like the chance to answer any questions.
~ Simply Advanced ~



2012-07-24

Get Things Done - Priority List

Recently, a friend commended me for the ability to concentrate and stay productive throughout the day, day after day.

One thing about me is that I treat my [Internet] bookmarks and emails as a todo list. I also have a physical and virtual notepad on both my physical and virtual desktop where I keep track of things I want/need to do.

But, just having todo lists isn't enough for many people. So, for those who don't have the willpower to take a "just do it" attitude towards daily and/or important tasks, there is a solution.



Or

  • Think of your todo lists as priority lists instead. And, there can only be one #1 priority task to do at a time. Then, just do that task without thinking whether or not you should do that one or something else.



Get started now. You don't need to waste time reading more productivity guides and how-to's; Any thing besides what's on the priority list will just waste your valuable time.

~ Simply Advanced ~



2012-06-20

Procrastinating Productivity - It's a Good Thing

It seems the more I feel unproductive, the more I want become productive.

I was just thinking of this because two days ago I played some awesome volleyball for six hours straight. It was great relaxation and social time. And right afterwards I was motivated for some all night Android coding. The entire all-nighter was productive.

It was definitely worth it to take that half-day break.

This is not the only case of having pure productivity, it happens all the time. But, there are certain conditions necessary first. Mainly, having a clear goal/plan-of-attack. Spending 5-10 minutes to create a definite list saves you from unproductive time.
And, my personal condition for productivity is having a clear/clean workspace where I can easily concentrate on only one thing at a time. (I know a few people who can work in messy areas, so whatever works.. make it so)

Someone who has read enough about productivity that any more would be unproductive,
~ Simply Advanced ~