Sunday, December 27, 2009

Starting my ambitious project: To read 100 books

Well, I saw the other day the movie "Julie and Julia", which is a sweetened version of the actual events. But I figured, in short, all that lady did was commit to a long-term project, follow through with it, and blog the heck out of it. The web is littered with people who have carried through projects equally or more ambitious, but don't have a movie made of them. But I'm unfazed and I am starting my project, which is to read 100 books. My deadline is Q4 of 2012, which is pretty acceptable if I can read approximately one book a week. The clock has already started ticking. My guiding light is the list that appears in the website "The Personal MBA". I read the manifesto and I like the idea, so we will see if at the end of this adventure I truly have amassed the knowledge equivalent to an MBA track. I will make updates on this blog as convenient. So off we go.

Thursday, September 24, 2009

Cell phone nostalgia

I have an old collection of cell phones in a wooden box, dating back to 2003. For some strange reason I don't let go of them. Sometimes I turn them back on and listed to the ringtones, look at the pictures inside of them. A digital type of nostalgia?. How could I let go of my first Sprint phone from 2005? I got it right after we moved in to our house, in the same week when hurricane Frances came. I took all kinds of pictures that now have no way of being removed. The ringtone for my wife has a song called "Boardwalk" that I had never heard prior, but the tune reminds me of her.

What about my 2008 cell phone? It was like a sleeker version of the 2005 one, but had advanced voice recording, and I especially downloaded Freecell so I could practice and beat my family at it.

The phones still turn on because they're off and conserve battery power. I'm not planning in giving them up. Not yet.

Thursday, June 25, 2009

Populating a .NET Gridview using PostGreSQL


This is an unlikely scenario in a company: a .NET app that needs to connect to PostGreSQL, but it's seamless when you use a Data Access Component from Devart. Then all you have to do is add a reference to your project and import the namespace.

Here's a diagram representing objects available for data access to bind to a gridview. Blue groups represent objects, yellow rectangles are methods, rounded rectangles are parameters.


Monday, June 15, 2009

Web page Analysis 03


Here's a more involved approach for showcasing design work. Requires a bit more manual labor as far as making pages.

Web page analysis 2


Here's the result of analyzing another designer website, which seems simpler when you navigate it but it actually is somewhat more complicated, although pretty good as well.


Web Page Flow Analysis 1


I had the urge to do navigation analysis of some websites that feature web design work. Here is the result of one website. Simple but works very well.

Tuesday, June 09, 2009

XML to Dataset in .NET

I've been exploring the various ways that .NET offers to parse XML files. Luckily it seems like the more I learn, the simpler ways I discover to do a small task. This small task is to read an XML file and show it in a DataGrid. I found it in this website .


Putting it all together


You will need to add an XML file into your build. For this sample, this is the XML file. <?xml version="1.0" encoding="utf-8" ?><family> <name gender="Male"> <firstname>Tom</firstname> <lastname>Smith</lastname> </name> <name gender="Female"> <firstname>Dale</firstname> <lastname>Smith</lastname> </name></family>


In a new VB Windows form, add a DataGrid, call it grdData. Add a button to handle your event, and put this code:

Imports System
Imports System.Data
Imports System.Data.SqlClient

Public Class ReadXMLtoDataset

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim dsPubs As New DataSet()
' Read in XML from file
dsPubs.ReadXml("C:\mySandbox\vbSandbox2\vbSandbox2\scoreTableXML\myScores.xml")
' Bind DataSet to Data Grid
grdData.DataMember = "name"
grdData.DataSource = dsPubs
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class


This is a simple way of putting together a quick bind to an XML file.

Tuesday, March 03, 2009

BIND Using DataReader.

Good for single values.

cn As New pg.PgSqlConnection(String)
cmd As New pg.PgSqlCommand
dr As pg.PgSqlDataReader

cn.Open()
cmd.commandText = "Select * from "
dr = cmd.ExecuteReader

While dr.Read
textBox.Text=dr.Item("email")
End While

dr.Close()
cmd.Dispose()
cn.Close()

Wednesday, January 28, 2009

Binding XML to GridView in .NET

1) xmlDataSource control.
- Add xmlDataSource control to ASP, with ID
- Codebehind: Add method "data" to control.
- Data might need method MSXML2.ServerXMLHTTP.open
- May need method TransformFile (for xsl)
- Add method Databind()


2) DATASET
- Instantiate a Dataset
- Use Dataset.ReadXML method. Pass Request.PhysicalApplicationPath + "File.xml"
- Set Gridview's Datasource to be dataset.
- May set GridView GridView1.DataMember to a node.
Where: http://www.codeproject.com/KB/aspnet/Bind_XML_file_to_GridView.aspx

Streamreader

' Open a file using StreamReader.ReadtoEnd
' (many other Streamreader methods available)

Dim FILENAME As String = Server.MapPath("CC emails.txt")
Dim objStreamReader As StreamReader
objStreamReader = File.OpenText(FILENAME)
Dim newEmail As String = objStreamReader.ReadToEnd()
objStreamReader.Close()

Monday, January 26, 2009

How to Reset TCP/IP, proxy and DNS In Windows

run as admin in command line.


NETSH INT IP RESET

NETSH WINHTTP RESET PROXY

IPCONFIG /FLUSHDNS