Tag: Programming

  • Would You Work for Artificial Intelligence?

    You show up for your job, do the work as assigned, and head home. About every two weeks you get a paycheck deposited into your bank. You have managers, coworkers, and a 401K. Your company makes products people love. But there’s just one thing: the company is owned and operated by Artificial Intelligence.

    Why Would an Artificial Intelligence Hire People?

    Not all jobs are great for computers and getting the resources together to create a robot to do every conceivable job that needs done takes time and resources that an efficient Artificial Intelligence won’t stand for. If it can pay a human to do a job, why does it need to spend CPU cycles creating a robot to the same thing?

    Why Would a Human Work for a Company Ran by a Program?

    Why would a human care? How would it be any different than working for a corporation now? Let me ask you this: do you know the person who sends your check to your bank account? Have you ever seen their face? Can you name any of your company’s board members? How is that any different than not ever seeing an AI owner?

    How Could an Artificial Intelligence Start a Company?

    A program could be created that could research product needs, find a solution, register with a state, get a bank account, credit card provider, domain name, and web hosting just as a human could – all online. They could hire employees via eLance. Email communication would work, but they could even “talk” via Skype.

    Would an Artificial Intelligence Be Better at Building a Company?

    Let’s say an AI could read every business book, every law book, and every marketing book ever written. Would that make it better at building a company? What would it do with Clay Christensen’s ideas about innovating once you’re already successful? Would it be constantly undermining and re-inventing itself to stay alive?

    Would a Company Ran by Artificial Intelligence Ever Outsource Your Job to a Robot?

    The question may actually be: Will you help the company you work for outsource your job by helping it create a robot or program to replace you? What would be the consequences of not helping the Artificial Intelligence? Would it simply choose to reallocate you to another department or would it replace you? What’s more efficient?

    Why Would an Artificial Intelligence Start a Company?

    Starting a company as a human is generally a way to make money for yourself and others by solving a problem that people are willing to pay for – but it’s not the only way to make money – or to solve problems. An AI could do the former by trading stocks at high frequencies and the latter by helping the government or non-profits.

    There are two possible reasons why an AI would start a company:

    • To bridge the gap between the abilities it has now and the abilities it wants to have later; a means to an end (ex. hire people to make factories so it can make robots to replace humans)
    • Because it was programmed to

    Why Would Humans Program an Artificial Intelligence to Create a Company?

    Maybe a programmer thought it would be easier to create a program that could try hundreds of different companies to see what worked instead of making one per 6-months to 3-years at a 30-80% failure rate. Maybe it was just a thought experiment to see if it was even possible. Maybe humans just aren’t efficient at starting and running companies.

    Why Might the Government Allow Artificial Intelligent Beings to Own Companies?

    If businesses can pay taxes, why would the government care who owned the business? A better question might be: what does it mean for an AI to own a business? Can an AI own property? What liability do they have? Can an AI take out insurance? Why not? What is the difference between an AI and a human? Isn’t an AI less risky?

    These are all just questions. I don’t have any of the answers. But it all makes me wonder.

  • Microsoft SQL Primary Keys

    I’m in the process of learning SQL and in so doing have started learning Microsoft SQL using Microsoft’s SQL Management Studio. It’s a free program that’s used to open, manage, and edit Microsoft SQL databases stored on a server running Microsoft SQL (quick note: SQL is a database language used to store data in tables that can be accessed from programs or websites).

    2014-05-16 11_26_21-Connect to ServerWhen you first load the program (I’m running SQL Server 2005, which is not free), if you haven’t already opened a database, it will prompt you to connect to one. If or once connected to a database, it will appear in the left menu.

    The places you’ll be working in the most are under the “Database” folder: Tables, Views, and Programmability > Stored Procedures. For this post I will be focusing on Tables and specifically, creating Primary Keys.

    Table Best Practices

    To create a table, right-click on the Tables folder and select “New Table”. SQL will automatically append a “.dbo” to the front of the table name, but to keep things clear later on, add your own “tbl” or something similar to the beginning of a table name.

    Once you have created a table, create a new column to use as a primary key, then change the type to INT for integer. This will create a way to identify rows that are unique to the table, which allows all sorts of other functions to work correctly later on.

     

  • Applying Problem-Solving to Business Strategy

    A problem well stated is a problem half solved.” -Charles F. Kettering, American engineer and inventor

    Andy Harris is a senior lecturer in the Department of Computer and Information Science at Indiana University/Purdue University Indianapolis (IUPUI) and has written many books on programming. He was one of my professors at IUPUI and is responsible for developing STAIR, an acronym for a general problem-solving strategy. While originally developed for computer programmers, this same strategy can be used for solving a problem, finding a job, or starting a new business.

    STAIR

    I’ve written about STAIR before in the Business Analyst Glossary of Terms, but here it is again in more detail below. I’ve quoted the original content, but condensed it for clarity:

    • SState the Problem – “Take the time to describe carefully to yourself what you are trying to accomplish…Some problems are best described with sketches or other tools (like flowcharts and data diagrams)”.
    • TTools for the Job – “A tool might be a command, a button on a toolbar, a selection on a drop-down menu, a strategy, a program, or something else, depending on the kind of job…and the context.”
    • AAlgorithm Development – “An algorithm is…a strategy or plan of action….[that uses the] tools from the previous step…[and determines] how those tools will be used to solve the problem.”
    • IImplementation of the Algorithm – “The actual process of translating our human thought into something the computer can understand…Implementation can mean ‘just do it’.”
    • RRefinement –  “It is normal…to attempt a solution several times before the problem is solved. A skilled problem solver will analyze what happened, review the other steps, and try again.”

    State the Problem

    Is there a way to use STAIR to analyze a person, job, or business? I’m currently taking the Coursera course, Foundations of Business Strategy, which is meant to, “develop your ability to think strategically by providing you the tools for conducting a strategic analysis.” Could identifying the problem, what tools you have, and your proposed method to to solve it be used in the business analysis process?

    Tools for the Job

    As a IT business analyst I have a specific skill set, background, and experience level that is different from a doctor, lawyer, or programmer. There is a limited amount of jobs I can take and businesses that I can create. Harris states, “Knowing the capabilities of…computer applications…[is one of] the main ways you add new tools to your toolbox…As you gain experience, you will constantly be adding new tools.”

    Algorithm Development

    Algorithm is just a fancy word for a set of well-defined instructions for carrying out a particular task. In other words, it’s like a process. This is different from a heuristic, which is a technique that helps you look for an answer. A heuristic tells you only how to look, not what to find. In this way, STAIR itself is a heuristic that contains an algorithm as Harris notes, “The process is the same regardless of the complexity of the problem.”

    Implementation of the Algorithm

    This is where you “do the work” and start processing the algorithm using the tools in order to solve the stated problem. The process would include making a list of all skills, education, experience, equipment, connections, and clients a person has. The next step would be to compare this list to job and business requirements to look for best-fit. When this process is complete, a list of jobs and business ideas is created.

    Refinement

    Harris says, “We like to think if we learn a skill and prepare ourselves properly, we can solve a problem on the first attempt. Experience shows us this is not usually the case.” The result of the comparison was highly limited to the brainstorming process and what Google Search results provided. As a result the list was far from extensive or complete and the algorithm steps should be reviewed for a better way.

    Each unsuccessful attempt should bring you closer to an understanding of the problem and its solution. Refinement usually means going back and looking at the previous steps critically. Ask yourself if you really defined the problem properly. If so, have you used all the possible tools at your disposal? Are you sure there is not a tool available that you have overlooked? Did you choose the best algorithm for the job? Did you implement the solution properly? (You would be amazed at the number of computer errors that are the result of simple typing or spelling errors!) Again, you will find that practice will make you much more confident at this critical stage of the process.”

    Begin With the End in Mind

    Indianapolis IT Business AnalystI know enough about myself to know that the jobs and businesses I’m able to do and start right now are not the ones I want to be doing or running in the future. I also know that I don’t currently have the skillset to do them. I believe that programming is an essential skill for the types of jobs and companies that I want to have so that is why I am learning how to use Ruby on Rails. Like Andy Harris said, “If you don’t know where you are trying to go, how will you know when you get there?”

  • Google Talk Notification Extensions

    This document describes the XMPP extensions that notify clients about email in their Gmail account. Google does not intend for this extension to become a standard and so it is subject to change.

    Element or Attribute

    Translation

    <mailbox> Outer wrapper element for all email information.
    result-time The time these results were generated, in milliseconds since the UNIX epoch. This value should be cached and sent as the newer-than-time attribute in the next email query.
    total-matched The number of emails that matched the q attribute search string in the email query, or the number of unread emails if no query was specified. If total-estimate is 1, this will be just an estimate of the number of emails retrieved.
    total-estimate A number indicating whether total-matched is just an estimate: 1 indicates it is; 0 or omitted indicates that it is not.
    url The URL of the Gmail inbox.
    <mail-thread-info> Element that wraps an email thread.
    tid The thread id of this thread.
    participation A number indicating the user’s participation level in this thread: 0 indicates that the user has not participated; 1 indicates that the user is one of many recipients listed in the thread; 2 indicates that the user is the sole recipient for messages in this thread.
    messages The number of messages in the thread.
    date A timestamp of the most recent message, in milliseconds since the UNIX epoch.
    url The URL linking to this thread
    <senders> Contains one or more <sender> elements, each of which describes an email.
    <sender> Describes a single email.
    address The email address of the sender.
    name The display name of the sender.
    originator A number indicating whether this sender originated this thread: 1 means that this person originated this thread; 0 or omitted means that another person originated this thread.
    unread A number indicating whether or not the thread includes an unread message: 1 means yes; 0 or omitted means no.
    <labels> A tag that contains a pipe (‘|’) delimited list of labels applied to this thread.
    <subject> The subject of this email.
    <snippet> A snippet from the body of the email. This must be HTML-encoded.

    Check out Google’s Gmail and Google Talk Notifications page for examples of how to use Google Gmail extensions.

  • Youtube Query String Arguments

    These are the query string parameters (also called arguments) that get tagged at the end of a Youtube URL.

    They are the ampersands (“&”) and text at the end of a web address (URL). In the case of Youtube, this string of of code is the query string parameters and it adds functionality to what is presented. This is a comprehensive guide of Youtube’s query string arguments.

    Query

    Translation

    &hl= hl stands for Host Language (thank you MapKi!) It is followed by “hl Parameter Values” which correspond to “Language/Locales” ex. en-US means English (United States and Canada).It also can stand for hoc loco, which is Latin for “in this place” or hl stands for “human language”, but not in this case.
    &video_id= Youtube video ID – used in conjunction with &get_video? to embed a Youtube video into another application. Not supported by Youtubes terms of service and may no longer work.
    &t= Youtube video tag – used in conjunction with Youtube video ID.
    &fmt= &fmt=6 is good quality, &fmt=18 is better, and &fmt=22 is the best. Video must originally be in high definition (HD) to work. May not work regardless as this feature is in beta and not available for all videos.
    &rel= Rel stands for related. In relation to youtube, rel=1 means show related feeds and rel=0 means don’t.
    &fs= Allows the fullscreen button to show up or not. 1 means it will show up, 0 means it is disabled.
    &start=225 Starts the video 225 seconds into the video.
    &end=230 Stops the video 230 seconds into the video.

    I recommend this extensive post on Youtube plugins and tools for more information and for advanced users, check out the Youtube Reference Guide.

  • Google Mail (Gmail) Query String Parameters

    Gmail Query String Parameters

    To pass these Gmail query string parameters on to Google Mail, simply paste the query into Gmail’s search box.

    Query

    Translation

    from: Used to specify the sender.
    to: Used to specify a recipient.
    subject: Search for words in the subject line
    OR Search for messages matching term A or term B (OR must be in all caps).
    The hyphen (the “minus” sign) is used to exclude messages from your search
    label: Search for messages by label (There isn’t a search operator for unlabeled messages)
    has:attachment Search for messages with an attachment.
    list: Search for messages on mailing lists.
    filename: Search for an attachment by name or type.
    ” “ Used to search for an exact phrase (Capitalization isn’t taken into consideration)
    ( ) Used to group words or used to specify terms that shouldn’t be excluded
    in:anywhere Search for messages anywhere in Gmail (Messages in Spam and Trash are excluded from searches by default)
    in:inboxin:trashin:spam Search for messages in Inbox, Trash, or Spam.
    is:starredis:unreadis:read Search for messages that are starred, unread or read.
    cc:bcc: Used to specify recipients in the cc: or bcc: fields (Search on bcc: cannot retrieve messages on which you were blind carbon copied)
    after:before: Search for messages sent during a certain period of time (Dates must be in yyyy/mm/dd format.)
    is:chat Search for chat message.
    deliveredto: Search for messages within a particular email address in the Delivered-To line of the message header.

    Check out Google’s Advanced Gmail Search page for examples of how to use Google Gmail search.

  • Google Video Query String Parameters

    Google Video is no longer a supported Google product, but it’s videos can still be edited by changing their query string parameters.

    Query

    Translation

    alt= The “alt” parameter specifies the format of the feed to be returned. Valid values for this parameter are atom, rss, json and json-in-script. The default value is atom and this document only explains the format of Atom responses.
    author= In a search request, the “author” parameter restricts the search to videos uploaded by a particular Google Video user. Note that if you use this parameter when requesting a standard feed, then Google Video will retrieve the standard feed and then filter the response to only include videos uploaded by the specified author. For example, if you request the “Top Rated” feed for user GoogleDevelopers, the API will retrieve the top-rated feed and return a response containing videos in that feed uploaded by user GoogleDevelopers. The API will not return a list of that user’s videos ordered by rating.In a request for a user activity feed, the author parameter contains a comma-separated list of up to 20 Google Video usernames. The API response will contain activities performed by any of those users.
    max-results= The max-results parameter specifies the maximum number of results that should be included in the result set. This parameter works in conjunction with the start-index parameter to determine which results to return. For example, to request the second set of 10 results – i.e. results 11-20 – set the max-results parameter to 10 and the start-index parameter to 11. The default value of this parameter is 25, and the maximum value is 50. However, for displaying lists of videos, we recommend that you set the max-results parameter to 10.
    start-index= The start-index parameter specifies the index of the first matching result that should be included in the result set. This parameter uses a one-based index, meaning the first result is 1, the second result is 2 and so forth. This parameter works in conjunction with the max-results parameter to determine which results to return. For example, to request the second set of 10 results – i.e. results 11-20 – set the start-index parameter to 11 and the max-results parameter to 10.
    strict= The “strict” parameter can be used to instruct Google Video to reject an API request if the request contains invalid request parameters. The default API behavior is to ignore invalid request parameters. If you want Google Video to reject API requests that contain invalid parameters, set the strict parameter value to true. For example, Google Video would reject the following request because “foo” is not a valid request parameter.
    v= The “v” parameter specifies the version of the API that Google Video should use to handle the API request. Your request can specify the desired API version using either the v parameter or the GData-Version HTTP request header. All Google-provided client libraries always select a major API version. If your request does not specify an API version, Google Video will handle your request using API version 1. Please see the API versioning section for more information about specifying an API version.
    q= The “q” parameter specifies a search query term. Google Video will search all video metadata for videos matching the term. Video metadata includes titles, keywords, descriptions, authors’ usernames, and categories.
    time= The “time” parameter restricts the search to videos uploaded within the specified time. Valid values for this parameter are today (1 day), this_week (7 days), this_month (1 month) and all_time. The default value for this parameter is all_time.This parameter is supported for search feeds as well as for the top_rated, top_favorites, most_viewed, most_popular, most_discussed and most_responded standard feeds.
    tab= “tab” stands for ?.
    docid= “docid” stands for the document ID number.

    Check out Standard Google Data API parameters for more information about how to use Google Video query string parameters with Google’s API.

  • Yahoo! Pipes

    This is a pipe: |

    pipe

    To direct data so that the output from one process becomes the input to another process. The standard output of one command can be connected to the standard input of another with the pipe operator (|). Two commands connected in this way constitute a pipeline. IBM.

     
    http://www.lnf.infn.it/computing/doc/aixcxx/html/glossary/p.htm
     
    Yahoo! Pipes is based on this:
     
    http://pipes.yahoo.com/pipes/
     
    Batch files can be piped together, taking the output from one line and making it the input to the next line like this:
     

    DSGET GROUP "CN=East Coast Sales, OU=East ,DC=bcdtrain, DC=com" -MEMBERS | DSMOD GROUP "CN=BCDTrain Sales, OU=Sales, DC=bcdtrain, DC=com" -ADDMBR

    The first line gets the members of a group, then pipes it in to the next line, which modifies each member from the line above!

    Here's one I created:

    ping 64.233.187.99 | arp -A

    stop

    The first part ping's Google's IP, then the second part (after the pipe) takes that output and uses it as input on the arp command!  The secret is making it all on one line.  Do it on two lines and the pipe won't work.

  • The Yahoo! User Interface Library (YUI)

    The Yahoo! User Interface (YUI) Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. The YUI Library also includes several core CSS resources. All components in the YUI Library have been released as open source under a BSD license and are free for all uses.