Tuesday, February 2, 2010

Google Tablet

It appears that Google is considering developing its own tablet device. A new post on the Chromium web site (the open source project behind Chrome and ChromeOS) shows "visual explorations of how a Chrome OS tablet UI might look in hardware." Among the explored possibilities are:
  • Keyboard interaction with the screen: anchored, split, attached to focus
  • Launchers as an overlay, providing touch or search as means to access web sites
  • Contextual actions triggered via dwell
  • Zooming UI for multiple tabs
  • Tabs presented along the side of the screen (see Side tabs)
  • Creating multiple browsers on screen using a launcher
A short video illustrates some of the concepts being explored:



Chromium is not officially part of Google but the mockups appear to come from Glen Murphy, Google Chrome's designer, suggesting that at the very least, Google is toying with the idea of a tablet device for its Chrome OS.

Unlike Apple, Google is likely to work with multiple partners (think Google Android). As a result, we could see a number of different interpretations with different screen sizes and possibly customized user interfaces.

Monday, February 1, 2010

Zune Phone to debut


Spanish blog MuyComputer claims that Microsoft will present the Zune Phone this February, at the MWC in Barcelona. According to them, it's 100% confirmed. Since the Zune Phone will use Tegra, Nvidia will team with Microsoft for the anti-JesusPhone debut.

Talking to the blog editorial director Javier PĂ©rez Cortijo, he told me that "the Zune Phone presentation at Barcelona's Mobile World Congress 2010 is 100% confirmed." I've been a close friend of Javier for a couple of decades—he was my first editor—and I completely trust his sources and his judgement, so this is a good one. The presentation of the Zune Phone at MWC 2010 seems to be inline with the mention of three phones in the Zune software last week, and previous rumors about its introduction.

MuyComputer says that the Zune Phone will have a 480 x 272 screen, HDMI video out, weigh around 2.45 ounces (70 grams), and use Windows Mobile 7.

Sunday, January 31, 2010

Apple iPad


Apple's just-announced iPad looks like an iPhone on steroids, and it boasts a price tag that's a lot lower than people feared. But many of the enticing rumors about Apple's new tablet—such as chatter about a built-in camera, monthly TV subscriptions, and support for Verizon's 3G network—turned out to be dead wrong. Also: no iPhone for Verizon, at least not yet.You can check out the details on the new iPad right here, and don't get me wrong: judged on its own, away from all the gargantuan hype, and considering its $499 price tag (for the 16GB model), Apple's new tablet is certainly one sexy piece of gadgetry.

But ... is it a category-changer, like the iPod and the iPhone before it? That'll be hard to judge right away, and I still need to see the thing in person before I start making any sweeping generalizations.

That said, some of the coolest would-be features that had been rumored for the iPad failed to materialize Wednesday, starting with ...

No 3G support for Verizon
One of the earliest rumors about the iPad (which I'd still rather call the iTablet) was that it would come with embedded 3G support in addition to Wi-Fi. Well, the 3G part was true (monthly pre-paid plans will start at $14 for 250MB of data, or $29/month unlimited), but alas, no Verizon; instead, we're stuck with good 'ole AT&T (which is either a good or a bad thing, depending on how you feel about AT&T).

No jaw-droppingly new user interface
One of the most amazing things about the original iPhone was its ground-breaking touch interface; just pinch to zoom into a Web page! Tap to turn on the speakerphone! Swipe to flip through your photos! So maybe it was only natural that many of us gadget hounds (myself included) thought that Apple would come up with some new, "Minority Report"-style interface for the iPad ... perhaps some cool haptic feedback for the virtual QWERTY keypad, or maybe (as outlined in some recent patent filings) the ability to sense a finger that's hovering near the screen but not touching it. What we got, instead, was ... pretty much the same touch UI as on the iPhone, except with a lot more room. Not bad, but not all that revolutionary, either.

No built-in camera
The iPhone has a camera, the MacBook has a camera ... heck, even the new iPod Nano has a camera (well, a video-only camera, anyway). So, what about the iPad? Ahhh ... nope, and that's especially disappointing given the chatter from the Wall Street Journal that Apple has been toying with facial-recognition software that could potentially be used to, say, identify the various members of your family and deliver their own, customized iPad interface.



No Flash support
When, oh when, Apple, will you let us view Flash videos and Web modules on the mobile version of Safari? Who knows, but it's definitely not starting with the iPad, which is just as bereft of Flash support as the iPhone and iPod Touch are.

No user-replaceable battery
Steve Jobs claims that the iPad will come with an impressive 10 hours of battery life and a full month of stand-by time. Pretty cool, but as with the iPhone, the iPod Touch, and the latest MacBooks, the iPad battery comes sealed in the case, and there's no way to swap in a new one yourself.

No TV subscriptions
One of the more intriguing recent rumors was that Apple was going around to all the TV and cable networks, trying to sell them on the idea of monthly TV subscriptions that viewers would be able to watch on iTunes, the iPhone, Apple TV, or ... the iPad. Word even had it that Disney's Bob Iger was in San Francisco today, all set to announce a new content deal with Apple, but ... nope, didn't happen. (The writing for this non-event was on the wall, thanks to a recent New York Times story that reported that TV execs looked over Apple's subscription proposals and said "thanks, but no thanks.")

No iPhone software 4.0 announcement
Yet another interesting rumor had it that the reason that there hadn't been a big iPhone software update lately was that the new code was too intertwined with the iPad OS, and therefore we'd get a big announcement today for iPhone software 4.0—complete with full-on app multitasking, UI enhancements, and other goodies. The rumor sure sounded plausible (and hey, the part about the new iPhone software being closely interwoven with the iPad may well be true), but the Apple event came and went Wednesday, with nary a sign of iPhone software 4.0.


Last but not least ... no iPhone for Verizon
Besides the iPad itself, the Apple rumor that seemed to generate the most excitement was the possibility that Steve Jobs would announce the end of Apple's exclusive iPhone deal with AT&T ... and announce an iPhone for Verizon at the same time. After all, most believe that the Apple-AT&T deal is set to expire this summer anyway, so why not get a jump on the news? But as with the talk about the iPad coming with support for Verizon's 3G network ... well, maybe we'll get a Verizon iPhone in June or July, but we didn't see one today.

So, what were you hoping for Wednesday that didn't quite happen?

Hiding page extensions

.htaccess files are a wonderful thing, and incredibly powerful, ignoring the bad experience I had with them on my current web host (fortunately, this project is hosted by another web host, and everything runs perfectly with them :)), and Apache's mod_rewrite module does exactly what we need.

There are a bunch of reasons you'd want to do this, mainly:

* it looks cleaner and easier to read and remember
* by using search-engine–friendly URLs, you're Google PageRank will increase and will increase your website's findability
* it makes your website environment-independent, so if you ever decide to change the technology your site uses, everything would appear seamless to your visitors.

In this case, we're using PHP files, but you can change it to whatever type of file you're using, be it .html, .asp, .cfm, or anything else, as long as they're all the same type. (If you want to do this for multiple file types, just copy lines 2–4 and apply the same technique accordingly.)

Open your text editor and create a file called ".htaccess" with the following code in it, and upload it to your site's root directory (Note: On Unix and unix-like operating systems, files that start with a dot are hidden files, so you may not be able to see the file after you save it. To get around this, omit the preceding dot when naming the file, and then rename the file back to ".htaccess" after you have uploaded it to your webserver):


RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

(adapted from the Apache mailing list)

Using this code, instead of having to type in http://mysite.com/contact.php, you only need to enter http://mysite.com/contact to access that page. And the best part is, you can still access the page with .php on the end of it, so no old incoming links or bookmarks become orphaned as a result of this, and everyone is happy. x

Monday, June 9, 2008

A new way to generate data table and bind to gird view

public DataTable getAlloyElement(string AlloyNo)
{
DataTable dt = new DataTable();
DataTable dtResult = new DataTable();
DataColumn dCol;
dCol = new DataColumn("alloy_element");
dt.Columns.Add(dCol);
dCol = new DataColumn("alloy_target");
dt.Columns.Add(dCol);
dCol = new DataColumn("alloy_actual");
dt.Columns.Add(dCol);
dCol = new DataColumn("colNumber");
dt.Columns.Add(dCol);
dCol = new DataColumn("colName");
dt.Columns.Add(dCol);

dt.Rows.Clear();

if (gbl.cnOAS.State != ConnectionState.Open)
{
gbl.cnOAS.Open();
}

SqlDataAdapter adaAlloy = new SqlDataAdapter("select * from alloys where als_code = '"+AlloyNo+"'", gbl.cnOAS);
if (adaAlloy != null)
{
adaAlloy.Fill(dtResult);
for (int rowCount = 0; rowCount < dtResult.Rows.Count; rowCount++)
{
for (int colCount = 23; colCount < 83; )
{
int colValue = colCount;
if (dtResult.Rows[rowCount][colValue] != null && dtResult.Rows[rowCount][colValue].ToString().Trim() != "" && dtResult.Rows[rowCount][colValue].ToString().Trim() != "0" && dtResult.Columns[colValue].ColumnName.ToString().Trim().ToLower().Contains("als_element"))
{
DataRow dtRow = dt.NewRow();
SqlDataAdapter adaElementDesc = new SqlDataAdapter("select ele_code, ele_description from elements where ele_code = '" + dtResult.Rows[rowCount][colValue].ToString().Trim()+ "'", gbl.cnOAS);
if (adaElementDesc != null)
{
DataTable ele_des = new DataTable();
adaElementDesc.Fill(ele_des);
dtRow["alloy_element"] = ele_des.Rows[0]["ele_code"].ToString().Trim() + " " + ele_des.Rows[0]["ele_description"].ToString().Trim();
}
dtRow["alloy_target"] = dtResult.Rows[rowCount][colValue + 1].ToString(); ;
dtRow["alloy_actual"] = dtResult.Rows[rowCount][colValue + 2].ToString(); ;
dtRow["colNumber"] = colValue;
dtRow["colName"] = dtResult.Columns[colValue].ColumnName.ToString().Trim().ToLower();
dt.Rows.Add(dtRow);
}
colCount = colCount + 4;
}
}
}

DataView dView = new DataView(dt);
dView.Sort = "alloy_element";

//Convert dataview to datatable
DataTable obNewDt = dView.Table.Clone();
int idx = 0;
string[] strColNames = new string[obNewDt.Columns.Count];
foreach (DataColumn col in obNewDt.Columns)
{
strColNames[idx++] = col.ColumnName;
}

System.Collections.IEnumerator viewEnumerator = dView.GetEnumerator();
while (viewEnumerator.MoveNext())
{
DataRowView drv = (DataRowView)viewEnumerator.Current;
DataRow dr = obNewDt.NewRow();
try
{
foreach (string strName in strColNames)
{
dr[strName] = drv[strName];
}
}
catch (Exception ex)
{
// Trace.WriteLine(ex.Message);

}
obNewDt.Rows.Add(dr);
}

dtResult.Dispose();
return obNewDt;
}

Export whole page to excel

Response.Clear();
Response.Buffer = true;
Response.AddHeader("content-disposition", "attachment;filename=AnalyzeData.xls");
Response.Charset = "";
Response.ContentType = "~/ReportOutputs/abc.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
if (Session["griddata"] != null)
{
DataTable dt = (DataTable)Session["griddata"];
for (int i = 0; i < dt.Rows.Count;i++ )
{
((HyperLink)GridView1.Rows[i].FindControl("hyplnkedit")).NavigateUrl="";
}
}
htmlWrite.WriteLine("Analyze Criteria");
htmlWrite.WriteBreak();
form1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();

Removing duplicate entries from grid view

void RemoveDuplicates(System.Data.DataTable dataTable)
{
System.Data.DataTable duplicateTable = dataTable.Clone();
System.Data.DataColumn[] primaryKey = new System.Data.DataColumn[duplicateTable.Columns.Count];
duplicateTable.Columns.CopyTo(primaryKey, 0);
duplicateTable.PrimaryKey = primaryKey;

System.Data.DataRow[] dataRows = new System.Data.DataRow[dataTable.Rows.Count];
dataTable.Rows.CopyTo(dataRows, 0);
foreach (System.Data.DataRow dataRow in dataRows)
if (dataRow.ItemArray[9].ToString() != "")
{
dataRow.ItemArray[9] = "2";
if (duplicateTable.Rows.Contains(dataRow.ItemArray))
dataTable.Rows.Remove(dataRow);
else
duplicateTable.Rows.Add(dataRow.ItemArray);

}

}