Pretty cool article on REST APIs. I might come back to this later... http://www.fliquidstudios.com/2009/01/13/introduction-to-writing-a-rest-server-in-php/
Sugar Glider
My fiancée wants a sugar glider as a pet. She says either we get a chihuahua or a sugar glider... what am I getting myself into?
They are kinda cute though.
How do I find out if my computer is 32-bit or 64-bit?
Open the Windows start menu and type "msinfo32", then run "msinfo32.exe". This gives access to all system information including 32 or 64 bit, OS information, BIOS version, RAM, processor information and more.
ERROR: the user data image is used by another emulator. aborting
Got this error message after I restarted my system following an install prompt for another program (did not shut down the emulator first): "ERROR: the user data image is used by another emulator. aborting." I fixed it, but had to try a couple different things. Suggestions:
- If the Emulator is open, restart it
- If the Emulator is not opened (my case) try Run configurations > Target > Wipe user data > Run
- Another way to try "Wipe user data" is to click the Android SDK Manager icon in Eclipse, click the AVD you want to start, make sure you check wipe user data, then Launch.
Number 3 worked for me.
Where is My Milk From - The App
With radiation affecting milk in Washington, WhereIsMyMilkFrom.com has been discovered and reblogged left and right as the go-to to find out where your dairy is coming from. In development: Where is My Milk From - the Android App. Here's some mock-ups for the app's look, which will include a clever cow-tipping game in addition to the basic services of the site.
Set up your Facebook to Only Access via a HTTP Secure (HTTPS) Connection
So I found out today - from Mark himself - that Facebook has added the ability to access the site via a HTTP Secure (HTTPS) connection (like Twitter already does). This will drastically increase security for Facebook users.
Basically, HTTPS provides a combination of the HTTP and SSL protocols, which enables encrypted communication between your computer and a web server (THIS IS GOOD). Without it you’re exposed to significantly more security vulnerabilities, especially if you're using a public Wi-Fi to access Facebook. If you're at Starbucks hanging out on their public Wi-Fi network, someone using Firesheep can easily get onto your Facebook account and steal your data. HTTPS makes it a lot harder to do that. On public Wi-Fi networks you should only enter private information (passwords, phone numbers, credit cards numbers) to sites accessible via HTTPS, if at all.
The feature is available as an option on the "Account Settings" page. Click "Account Security," then check the "Secure Browsing (https)" box. If you have Twitter, do the same there.
How to Run Python Scripts in Windows
To process customer domain creations on BrainHoney I need to run a python script on my Windows machine. Here are the steps to set it up:
- Install Python 3.2 (or another version you'd like to install)
- From here (either 32 or 64-bit, depending on your computer): http://www.python.org/download/
- Put it in C:\Python32
- Copy necessary files into C\:Python 32 (these could be images, html pages, anything needed for the script)
- Open a command prompt
- Type "C:\Python32"
- Type "python [yourscript].py"
- Follow script prompts if applicable
Mark Zuckerberg Visits BYU - Technology Forum
This morning I had the pleasure of attending a technology forum at BYU, hosting special guests Senator Orrin Hatch and Facebook CEO Mark Zuckerberg. The forum brought about 10,000 people out, being open to BYU students as well as the public. The forum was held in simple fashion with two chairs, a coffee table and a table ornament being the only furniture on-stage. Senator Hatch led the discussion, playing host to present Mark (he asked that we call him just Mark) with a series of questions previously submitted on the BYU Facebook page.
The event was awesome. I was very impressed with both Senator Hatch and Mark Zuckerberg. Mark looked much like depicted in the The Social Network and on Saturday Night Live, in his token jeans and hoodie. He had a low key demeanor and general quietness about him. He was polite and eloquent and spoke confidently. I mean, he was no rhetorician, but at the same time he definitely didn't sound like your prototypical computer geek. He humbly let everyone know he was a bit nervous, since this was the first time that he had ever talked to a stadium full of people.
Senator Hatch then began to ask Mark Zuckerberg a number of questions previously submitted by on BYU’s Facebook page. Below are the questions and Mark’s answers. I can't type at lightning speed so I couldn't get it all, so some of the answers are verbatim, some are paraphrasing. They're pretty awesome though. I learned SO much. In my opinion every business major, tech major, sociology major, geography major, art major, open major, don't care major, or facebook major should have taken the opportunity to be there.
Let's put it this way... skipping my CS class to be here might have been the best decision I made all semester. If you missed it, at least you can read about it here :). Note: BYU is also going to post some clips on the BYU Facebook page.
Senator Orrin Hatch - "I want to let you know the main reason I invited you here so that you'd finally accept my friend request." (Ha ha ha)
Sen Hatch - "Facebook is moving towards one billion users, all over the world. It's changed the way we do business, changed the way we interact with one another, changed the way we look at political issues, and changed the ways we date (especially at BYU)."
1. How did Facebook get off the ground?
a. I built it when I was a sophomore at Harvard. Not to build a company, pretty certain that it would never be a company. I wanted the product at Harvard. Within 2-3 weeks 70% of Harvard signed up. Then other universities wanted in... b. At the end of sophomore year I moved to Silicon Valley with the intention to go back at the end of summer. When things were going well I decided to take a term off, then another term off, and eventually I realized I wasn't going back. c. You can build a company like this anywhere in the world. If I were doing it again I probably wouldn't choose Silicon Valley. d. Facebook apps are huge, over a million apps. The "We're Related" app was developed by Family Link here in Provo.
2. How do you handle management in the company?
a. People was the biggest predictor of success. b. The success of Facebook is all about the team we built. I think in any company that's true. c. One of the things we focused on in Facebook is keeping it small. Only 2000 employees. Make sure that every person that you add to your company is really great.
Sen Hatch - I'm impressed that you're so successful, worth 13.5 billion dollars.
3. What classes were of most benefit for you? For folks who want to get into the same area as you?
a. "I wasn't in school that long" (crowd applauses) b. Most people don’t know this, but I was a double major at Harvard: Computer science and Psychology. c. It's as much psychology and sociology as it is technology. d. CS Classes have 2 categories
i. Theoretical - very interesting ii. Practical - awesome. Operating systems and other hardware classes enabled me to build the early system.
4. What advice would you give to budding entrepreneurs?
a. "I think you have to really love and believe in what you're doing. I think that's the most important thing." b. If you don't, it actually becomes the rational thing to stop when it comes to challenges.
5. Mark to Sen. Hatch - "I started off as an Engineer, but one thing that is new to me is how the government sees technology. What can government do to promote budding engineers?"
a. Stay out of the way. (Applause.) It's my opinion that one reason we have so much technology and innovation is because of the freedom of companies and the internet that we have here in America.
6. Facebook sees third party developers as important. What is Facebook trying to do to help the developer environment?
a. We're trying to set it up so that we're not the only ones building innovative apps using the Facebook service. b. "A good independent entrepreneurial developer should always be able to do something on their own better than the entire company." (Find your niche!). "We want build a developer’s platform to enable entrepreneurs across the word to build something they want." Biggest industry thus far: gaming. c. "We don't want to build the apps, we want to enable independent entrepreneurs to do this."
7. The internet is powerful and a great utility. Some people think there could be a dark side out there as well. How do we maximize good?
a. Extremely robust privacy controls. People love sharing, but a lot of our job is to protect these people too. We're really focused on safety, particularly children. "We try to build a safe environment. I think that's going to be key."
Sen Hatch chimes in: "I'm crushed because we didn't win last night. But I am so proud of the basketball team. So proud of Jimmer Fredette".
8. What steps is facebook taking to help protect users from 'bad actors'?
a. Besides the normal privacy controls Facebook is one of the first products that allow people to completely go over https. b. Use your social connections to provide extra security.
i. Ask you questions only you would know ii. Show you pictures and ask you to identify friends
9. Using Facebook for education
a. My girlfriend graduated as a teacher, so we've talked about this a lot. b. Gift to Newark education system (100 million) c. Senator Hatch - "Remember BYU next time…" Mark: "Sure. Not sure how to answer that." Ha ha ha
Mark - "It really is humbling to be here, and to see such an audience". (Awww)
10. What do you see as the role of social technology in addressing global issues?
a. At Harvard, we always believed something like this would happen, but we never thought it would be us that built the company to do it. b. The bottom-up effect - It starts with giving people the ability to connect. You now have the ability to stay in touch with people in a much more passive way. c. The internet gives everyone a voice. People have a way to get things out there that just wasn't there 20 years ago. Check out peace.facebook.com - shows relationships between people and countries that were once troubled. In the long-term this will create more understanding between companies, more empathy.
Time winding down… Someone shouts "Ask about the church" Someone else shouts "Ask about Jimmer"
11. What does facebook look for in potential employees, what do byu students need to do to get on Facebook's radar?
a. We look for people that are passionate about something. In a way, it doesn't matter what you're compassionate about. b. If you're an engineer, did you just go through classes or do you build tools on the side? c. If you're into management, what types of management opportunities have you created for yourself? d. We don't want people to join facebook for what it already is. We want people to join facebook because they think it's so broken they want to improve it and help get it somewhere better. People that take initiative to do something, whatever it is they're passionate about.
12. Last question: Are you worried that advertisements take away from Facebook's coolness?
a. Well, everyone wants Facebook for free b. At the least, ad are a way that let you use the service for free c. No information is sold - ads are targeted by Facebook based off of the advertiser’s description, not by you giving your information before-hand. d. On good days, we hope ads are creating valuable, relevant content.
Thank yous… Gift from the students: One sweatshirt for each university in Utah (Weber State, Snow College, UVU, BYU, U of U, USU, etc… there’s like ten). My guess is he won’t wear them because they don't have a zip…
Eclipse Shortcuts
The more you use Eclipse the more efficient you want to be. I'm becoming a big fan on keyboard shortcuts and the time they save me. They make life easier and remove some of the frustration from school projects. Some. Here's my favorites. Ctrl+L - List all shortcuts
Ctrl+space - Autocomplete This has increased my ability for program for android apps both in time and functionality. Hit ctrl+space and it will give you suggestions of what methods you may wants, what parameters to use, and it will auto-import a needed import for the class.
Ctrl+F - Find The traditional find (and replace).
Ctrl+H - Opens search box More than just a find box, this does a ‘find in files’ within the File Search tab. Within here, you can specify what you are looking for in the files, what you file types you want to search in, etc.
Ctrl+Shift+C - Comments a block of code Self-explanatory. Great for debugging. Huge time-saver for multi-line comments.
Ctrl+D - Delete a line Self-explanatory. I spent the last 2 years doing a Shift-End, Delete or Shift-Home, Delete. What a waste of time!
Ctrl+E - Menu for opened files Brings up a list of opened files.
Ctrl+Shift+F - Auto-format Make your code look super nice and formatted!
Ctrl+K - Scan to next occurrence of variable
Ctrl+Click - Takes you to the method that you're currently moused over
Alt+Shirt+R - Rename (Refactor)
F4 - Show class hierarchy Useful for large projects.
Debug mode shortcuts: F5 – Step into a function F6 – Step F7 – Step out of a function
Alt+leftarrow or Alt+rightarrow - Jump back to a line, Jump forward to a line
And the most used at all:
Ctrl+S – Save
BYU Student Fired for Swearing
On March 16, 2011 a BYU student was fired from his job for swearing when a delivery cart slipped and hit his shin (see Deseret News story). There were other factors that came into play, but clearly this was the event that led to his termination. Now... I'm a BYU student and I agree to live the honor code. I know what it is and I willingly try to live by it, same as I do with other principles and teachings of the church. But I'm not perfect, and I don't expect myself or anyone else to be. To me, this event showcases (1) a terrifically terrible act of judgment on the behalf of the management that decided to fire the student, (2) a poor act of judgment on behalf of the student that felt the need to report the behavior to management and (3) another poor act of judgment on behalf of the student who let out the expletive. It doesn't appear to me that this is an issue over the practicality of the Honor Code, as it probably does from the outside looking in. The Honor Code is a set of governing rules that encourage students to live smart, study smart, and improve themselves. The Honor Code is great. It helps students who try and live by it. As I'm sure this student was.
But when other students, student employees and faculty members mistake the BYU Honor Code for a code of perfection by which all must measure up to, that's when it gets ugly. The student probably shouldn't have sworn, but at the same time the co-worker probably could have avoided a huge debacle if he or she had had the judgment to approach him and say "hey, I don't like that, can you watch it next time?" If it was me (and this situation could've easily happened to me or about half of BYU campus) I would listen to a co-worker's request to watch my mouth, and I'd do better next time. And I certainly feel that the management that heard this complaint and immediately fired the student the same day just doesn't get it. They don't understand the point of the Honor Code, if that was their reasoning for firing the student. I mean how could you do that? I really don't understand why a manager would feel justified for letting someone go based off of a swear word let out as a by-product of pain. It just isn't justified in the least. I feel bad for the kid.
That's why I hope that this situation, along with the Brandon Davies situation, can help all of us at BYU to use the Honor Code constructively, and not as a bar of perfection that all persons must keep without exception, oneself included. BYU students agree to live a higher standard that most. But that does not make one person that steps onto BYU campus any better than any other kid on any college campus in the world, whether they're living by the Honor Code or not.
Letter: Fired for swearing
What is Adaptive Release?
Adaptive Release of Content provides controls to release content to users based on a set of rules provided by the course author. The rules may be related to availability, date and time, individual users and user groups (such as course Groups), scores or attempts on any Gradebook item, or review status of another item in the course. To give an analogy, adaptive release is like those old Goosebumps books where the outcome changes depending on the reader's decisions along the way. BrainHoney, in their latest release (Dec 2010), has added support for adaptive release. Teachers now have the ability to:
- Allow students to view a particular unit or resource only after they have attained a minimum score on a quiz.
- Share different materials and resources with students in different sections of the same course.
- Restrict students from taking a test until they have reviewed relevant course materials.
- Make the next assignment available only to those who have read specific material.
Woohoo! Go BrainHoney!
Tiny Wings Master
I JUST COMPLETED THE LAST TINY WINGS OBJECTIVE! WOOHOO!!!
March Madness Picks
National Champion: Kansas Jayhawks
Final Four: Ohio State Buckeyes, Connecticut Huskies, Kansas Jayhawks, BYU Cougars
Android requires compiler compliance level 5.0. Please fix project properties.
In our Android mobile development class we constantly work on projects as a class and then Dr. Liddle sends us the updated zip containing the project to review after our in-class additions. For some reason today I'm having some issues importing the Android project into Eclipse. Problems and fixes below. Problem #1: Android requires .class compatibility set to 5.0. Please fix project properties.
Solution: 1. Fix project: Package Explorer -> Right click the project -> "Android Tools" -> "Fix Project Properties" 2. Restart Eclipse: "File" -> "Restart"
Problem #2: The following error appears many times The method xyz() of type ABC must override a superclass method
Solution: Package Explorer -> Right click the project -> "Properties" -> "Java Compiler" -> "Compiler Compliance Level" = 1.6
Problem #3: The import android.net.http.AndroidHttpClient cannot be resolved
Solution: Package Explorer -> Right click the project -> “Properties” -> "Android" -> "Project Build Target" = 2.3.3
Note: Also try Clean (On Windows: Project -> Clean) then Refresh (F5) at random. There's a good chance this will magically solve all your problems.
Eclipse Error: Type cannot be resolved
Problem running an Android application in Eclipse: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
Solution: In Eclipse, the cause of this problem is that somehow the SYSTEM JRE LIBRARY associated with the project was deleted. Simple fix in Eclipse:
- Right Click Project you are working on from Package Explorer
- Go to Properties
- Go to Java Build Path from the right tree structure
- Go to Libraries Tab
- Choose Add Library Button
- Select JRE System Library
- Hit Next, the Radio button will prompt the Workspace default JRE, and let it be that way
- Hit Finish
Still getting the error, though, in the case of an Android bundle... stay tuned....
To run or not to run
It's been forever since I ran. I probably ran 20? 10? miles last month? Definitely need to get out there and hit the trails. Possible events to get excited about this Spring: 5/1/2010 Provo City Half Marathon 05/22/2010 Big Air Memorial Race 5K 06/11/2010 Utah Valley Marathon 06/18/2010 Ragnar Relay Wasatch Back 2010
I could get excited about a couple of these. With my first couple long-distance races under my belt, injury-free legs, and a new pair of Vibram Five Fingers, I should off to a great season! Boston anyone?
Mac OS not gaining steam?
The Mac OS isn't growing like crazy, despite the increased number of classmates, professors and coworkers working from their Macs. I'm surprised. It's been about even over the last year. Maybe part of this can be explained by the emergence of iOS on iPads and Android on other tablets. Windows has been steadily declining and now occupies about 89% of the market share. Linux is on the decline too.
Optimize your site for SEO
Been learning about increasing SEO for your website lately. Couple tricks: Meta tags in your HTML files. Put the following code in your header, aka in between the < head > and < /head > tags. For example on my site my SEO code looks like this:
<!-- SEO CODE -->
<meta name="description" content="The professional blog and portfolio of Kyle Clegg" />
<meta name="keywords" content="kyle clegg, who is kyle clegg, kyle mitchell clegg, kyle clegg byu" />
<link rel="canonical" href="http://kyleclegg.com/" />
<!-- /CLOSING SEO -->
Now, apply this to your site:
<!-- SEO CODE -->
<meta name="description" content="Company website for eLearning Interactive." />
<meta name="keywords" content="elearning, online learning, online training, hazcom training modules" />
<link rel="canonical" href="http://elearninteractive.net/" />
<!-- /CLOSING SEO -->
Mark Zuckerberg at BYU
BYU News Release: Mark Zuckerberg to give forum address at BYU on March 25, 2011.
This is really exciting for the school and all persons interested in business, technology, creativity or improving the world. I'm super stoked.
Mark Zuckerberg, Orrin Hatch to talk technology, policy at BYU March 25 Mark Zuckerberg, founder and CEO of Facebook, will be featured in a technology forum discussion Friday, March 25, at Brigham Young University. U.S. Senator Orrin Hatch will also participate in the event, which will be held at 11 a.m. in the Marriott Center.
“In a world where technology and communications are changing at an ever-increasing rate, it is important that today’s students have the opportunity to hear and learn from those who are transforming electronic and social media,” said Kelly Flanagan, BYU’s Chief Information Officer and Vice President for Information Technology.
“We are grateful to Senator Hatch for inviting Mr. Zuckerberg to speak at BYU,” Flanagan said. “As chair of the U.S. Senate Republican High-Tech Task Force, Senator Hatch had the chance to meet with Mr. Zuckerberg and candidly discuss the opportunities and challenges that face our particular digital age. We look forward to hearing from Mr. Zuckerberg who, without question, is influencing how we communicate on a world-wide scale.”
In 2004, while a student at Harvard University, Zuckerberg founded Facebook, the world’s largest social network. Named as TIME magazine’s Person of the Year for 2010, the magazine noted, “Facebook has merged with the social fabric of American life, and not just American but human life; nearly half of all Americans have a Facebook account, but 70 percent of Facebook users live outside the U.S.”
Zuckerberg studied computer science at Harvard before moving his company to Palo Alto, Calif. He is now responsible for setting the overall direction and product strategy for the company.
The technology forum will follow a question-and-answer format. Questions will need to be submitted in advance (by Tuesday, March 22) through the BYU Facebook Page (Facebook.com/BYU).
The university will not broadcast or rebroadcast the address to any other locations on or off campus or the BYU Broadcasting network. Video of the technology forum will be posted later on the BYU Facebook Page and the BYUTV Facebook Page.
Powershell 101
Well, I definitely got my hands wet with running Windows PowerShell scripts today. I ran into a number of issues in the process, so I better make note of the solutions for next time around.
First off, PowerShell is Windows' task automation framework. Good for running scripts on windows machines. As far as I can tell, you can run PowerShell in the command prompt with the command call PowerShell.exe: C:\Scripts>PowerShell.exe
. Or, you can open the Start Menu and start typing PowerShell and open Windows PowerShell.
Now, you have a script and want to run it right? Pretty easy right? Not for me. I had to jump through some serious hoops here... so I tried typing Suspend.ps1. No dice. I'd get an error saying the command isn't recognized. Through some bing magic I found that you need to include the complete file path: C:\Scripts\Suspend.ps1
Or, if you are currently in the specified folder you can use the .\ notation: .\Suspend.ps1
It's better to use the full notation, to prevent it from finding a file of the same name in your current Windows path (it looks through the entire path, not just your current directory). FYI - you can see your current path with this command:
$a = $env:path; $a.Split(";")
Anyways, once I figured out how to actually make the call from the command prompt, I kept getting this weird signing error:
File C:\Scripts\Suspend.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-
help about_signing" for more details.
At line:1 char:19
+ C:\Scripts\Suspend.ps1 <<<<
This is where it got tricky. I searched around for a bit and found that by default, windows machines are set to restrict you from running scripts. To see your execution policy try using the command Get-ExecutionPolicy
. If you've never messed with this before, it'll probably say Restricted, like mine did. Now, the simple fix to change this is to use the following command call: Set-ExecutionPolicy RemoteSigned
. If this works for you, congratulations! You're good to good. For me... it didn't. I got some weird error that looked like the following:
Set-ExecutionPolicy : Access to the registry key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell’ is denied.
At line:1 char:20
+ Set-ExecutionPolicy <<<< RemoteSigned
Is this familiar to you? Hopefully not, but it if is. There's a solution.
To fix this and add the RemoteSigned execution policy by hand you'll need to work a little Windows registry magic.
- Open registry by opening the start menu and typing regedit into the search box
- Browse to key HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell
- If “ExecutionPolicy” does not exist, create it as REG_SZ with value “RemoteSigned”
- Open PowerShell and use the command “Get-ExecutionPolicy” to verify it is set correctly
Now, you should be all set. Go back to the command prompt or PowerShell window and run your command. This time when I ran C:\Scripts\Suspend.ps1
it was beautiful.
If you have any other issues send me an email or leave a comment, I may have struggled with it too.
Useful pages for troubleshooting: http://technet.microsoft.com/en-us/library/ee176949.aspx http://bartvdw.wordpress.com/2008/04/22/powershell-executionpolicy/#comment-190