Archive for the 'Tech-Crunch' Category

how to post web clips to your blog - Press This

Thursday, March 26th, 2009

select a text on any web page and then type below in the address bar and hit enter:

javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f=’http://127.0.0.1/blog/wp-admin/press-this.php’,l=d.location,e=encodeURIComponent,g=f+’?u=’+e(l.href)+’&t=’+e(d.title)+’&s=’+e(s)+’&v=2′;function a(){if(!w.open(g,’t',’toolbar=0,resizable=0,scrollbars=1,status=1,width=720,height=570′)){l.href=g;}}a();void(0);

or drag and drop below link to your browser’s favourite links:

Press This

Microsoft - Funny Memory Values

Monday, February 2nd, 2009

Introduction:  Microsoft has put quite a lot of memory leak detection helpers in Windows NT. They have not done a good job of advertising it. This post describes some of the things I’ve deciphered while debugging code.
Funny Memory Values:  Many times while debugging programs, I will come across memory that is filled with “funny” values. After some playing around (i.e. hacking) with the Win32 API, I was able to figure out what they meant. Some of these values have been documented in places but never all together. The values for the tags presented here are hexadecimal because that’s the way Developer’s Studio presents them in the memory window.  Value   Meaning

0xAB or 0xABAB or 0xABABABAB   Memory following a block allocated by LocalAlloc().

0xBAADF00D   Bad Food. Get it? This is memory allocated via LocalAlloc( LMEM_FIXED, … ). It is memory that has been allocated but not yet written to.

0xFEEE  0xFEEEFEEE   This seems to be memory that has been dedicated to a heap but not yet allocated by HeapAlloc() or LocalAlloc().

0xCC or 0xCCCC or 0xCCCCCCCC   Microsoft Visual C++ compiled code with the /GZ is automatically initialized the uninitialized variable with this value.
0xCD or 0xCDCD or 0xCDCDCDCD   Microsoft Visual C++ compiled code with memory leak detection turned on. Usually, DEBUG_NEW was defined. Memory with this tag signifies memory that has been allocated (by malloc() or new) but never written to the application.
0xDD or 0xDDDD or 0xDDDDDDDD   Microsoft Visual C++ compiled code with memory leak detection turned on. Usually, DEBUG_NEW was defined. Memory with this tag signifies memory that has been freed (by free() or delete) by the application. It is how you can detect writing to memory that has already been freed. For example, if you look at an allocated memory structure (or C++ class) and most of the members contain this tag value, you are probably writing to a structure that has been freed.
0xFD or 0xFDFD or 0xFDFDFDFD   Microsoft Visual C++ compiled code with memory leak detection turned on. Usually, DEBUG_NEW was defined. Memory with this tag signifies memory that is in “no-mans-land.” These are bytes just before and just after an allocated block. They are used to detect array-out-of-bounds errors. This is great for detecting off-by-one errors.

0xFDFDFDFD No man’s land (normally outside of a process)
0xDDDDDDDD Freed memory
0xCDCDCDCD Uninitialized (global)
0xCCCCCCCC Uninitialized locals (on the stack)

using ODBC with PHP

Friday, January 23rd, 2009

Connecting to ODBC

There is an excellent tutorial on using PHP’s ODBC extension at ASPToday, a popular ASP web site. An example taken from the above article:

<?
# connect to a DSN "mydb" with a user and password "marin"
$connect = odbc_connect("mydb", "marin", "marin");

# query the users table for name and surname
$query = "SELECT name, surname FROM users";

# perform the query
$result = odbc_exec($connect, $query);

# fetch the data from the database
while(odbc_fetch_row($result)){
  $name = odbc_result($result, 1);
  $surname = odbc_result($result, 2);
  print("$name $surname\n");
}

# close the connection
odbc_close($connect);
?>

flex-Validating form data

Friday, January 23rd, 2009

http://www.adobe.com/devnet/flex/quickstart/validating_data/

Submitting a Flex form using PHP

Friday, January 23rd, 2009
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml” layout=”absolute”>
  <mx:HTTPService id=”srv” url=”http://www.rudysportfolio.com/flexTest/mail.php” method=”POST”>
    <mx:request>
  <user>{user.text}</user> 
      <email>{email.text}</email>
      <message>{message.text}</message>
    </mx:request>
  </mx:HTTPService>
  <mx:Form>
    <mx:FormItem label=”Name”>
      <mx:TextInput id=”user”/>
    </mx:FormItem>
    <mx:FormItem label=”Email”>
      <mx:TextInput id=”email”/>
    </mx:FormItem>
    <mx:FormItem label=”Message”>
     <mx:TextArea width=”211″ height=”117″ id=”message” />
    </mx:FormItem>     
    <mx:FormItem>
      <mx:Button label=”Submit” click=”srv.send()”/>
    </mx:FormItem>
  </mx:Form>
</mx:Application>

and my php file:

<?php

$address = “rugu87@hotmail.com”;

$subject = “subject line tester”;

$body = $_POST[’user’] . ” had this to say:\n” . stripslashes($_POST[’message’]);

$extra_header_str = “From:” . $_POST[’email’];

$mailsend = mail($address,$subject,$body,$extra_header_str);

echo $mailsend;

?>



				

Flex-Webservice - validate Zipcode

Friday, January 23rd, 2009

The following example adds a web service to process form input data. In this example, the user enters a ZIP code, and then selects the Submit button. After performing any data validation, the submit event listener calls the web service to obtain the city name, current temperature, and forecast for the ZIP code.

<?xml version="1.0"?>
<!-- containers\layouts\FormDataSubmitServer.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <!-- Define the web service connection.
        The specified WSDL URI is not functional. -->
    <mx:WebService id="WeatherService"
        wsdl="/ws/WeatherService?wsdl">
        <mx:operation name="GetWeather">
            <mx:request>
                <ZipCode>{zipCode.text}</ZipCode>
            </mx:request>
        </mx:operation>
    </mx:WebService>

    <mx:Script>
        <![CDATA[
            private function processValues():void {
                // Check to see if ZIP code is valid.
                WeatherService.GetWeather.send();
            }
        ]]>
    </mx:Script>

    <mx:Form>
        <mx:FormItem label="Zip Code">
               <mx:FormHeading label="Zip Code Form"/>
            <mx:TextInput id="zipCode"
                width="200"
                text="Zip code please?"/>
            <mx:Button
                width="60"
                label="Submit"
                click="processValues();"/>
        </mx:FormItem>
    </mx:Form>

    <mx:VBox>
        <mx:TextArea
            text=
              "{WeatherService.GetWeather.lastResult.CityShortName}"/>
        <mx:TextArea
            text=
              "{WeatherService.GetWeather.lastResult.CurrentTemp}"/>
        <mx:TextArea
            text=
          "{WeatherService.GetWeather.lastResult.DayForecast}"/>
    </mx:VBox>
</mx:Application>


The following example adds a load event and a fault event to the form. In this example, the form is defined as one child of a ViewStack container, and the form results are defined as a second child of the ViewStack container:

<?xml version="1.0"?>
<!-- containers\layouts\FormDataSubmitServerEvents.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <!-- Define the web service connection.
        The specified WSDL URI is not functional. -->
    <mx:WebService id="WeatherService"
        wsdl="/ws/WeatherService?wsdl"
        result="successfulCall();"
        fault="errorCall();">
        <mx:operation name="GetWeather">
            <mx:request>
                <ZipCode>{zipCode.text}</ZipCode>
            </mx:request>
        </mx:operation>
    </mx:WebService>

    <mx:Script>
        <![CDATA[
            import mx.controls.Alert;

            private function processValues():void {
                // Check to see if ZIP code is valid.
                WeatherService.GetWeather.send();
            }

            private function successfulCall():void {
                vs1.selectedIndex=1;
            }

            private function errorCall():void {
                Alert.show("Web service failed!", "Alert Box", Alert.OK);
            }
        ]]>
    </mx:Script>

    <mx:ViewStack id="vs1">
        <mx:Form>
               <mx:FormHeading label="Zip Code Form"/>
               <mx:FormItem label="Zip Code">
                <mx:TextInput id="zipCode"
                    width="200"
                    text="Zip code please?"/>
                <mx:Button width="60"
                    label="Submit"
                    click="processValues();"/>
            </mx:FormItem>
        </mx:Form>

        <mx:VBox>
            <mx:TextArea
                text=
                    "{WeatherService.GetWeather.lastResult.CityShortName}"/>
            <mx:TextArea
                text=
                    "{WeatherService.GetWeather.lastResult.CurrentTemp}"/>
            <mx:TextArea
                text=
                    "{WeatherService.GetWeather.lastResult.DayForecast}"/>
        </mx:VBox>
    </mx:ViewStack>
</mx:Application>

DesiCow.com - find cheap tickets directly from the agents

Monday, November 17th, 2008

DesiCow.com

Searching Best Deals For Flight  -  There are innumerable ways to search flight ticket deals and book it for your pleasant journey. While browsing the net for best deal on airfare, I found DesiCow.com a good place to start with where you can post the deal you want and several available travel agents will start bidding for your request. Since agents are always can give concession from their side so the bidding will end up with a good deal for you.

I’m sure, you will find it interesting.

http://www.desiCow.com

DesiCow.com

Code Blot due to templates

Saturday, April 26th, 2008

1. [Multiple instantiations] Temp is instantiated in more than one
translation unit, so when the objs are linked together, the exe has
more than one copy of Temp
’s member functions.

2. [Duplicate instantiations] Temp and Temp could be share a
single underlying binary implementation, but they don’t. The most
common example is when T1 and T2 are both pointer types, but it would
also apply if T1=int and T2=long on a machine where int and long are
the same size.

3. [Near-duplicate instantiations] Temp and Temp are
individually instantiated for non-type parameters n and m, even
though the resulting member functions are almost identical. This
would be the case for e.g., FixedSizeBuffer and
FixedSizeBuffer
.

4. [Excessive inlining] Because many compilers require that all template
code be in header files, all such code is inlined, and that makes
executables bigger than they would be if template functions that are
large and frequently called could be outlined.

5. [Excessive instantiation] All the member functions of Temp are
instantiated, even though only a few are called. (This is
nonstandard behavior, but, at least in the past, it was a problem
with some compilers.)

6. [Gratuitous types] Temp and Temp are both instantiated, but
if templates didn’t exist, programmers would make do with a single
untemplatized implementation. For example, programmers instantiate
both Stack and Stack, but if they lacked templates, they’d
get by with only IntStack.

More at

social goodworking blog - Whatgives.com - New Social Network from eBay

Thursday, April 10th, 2008

eBay GivingWorks recently launched blog and social network called whatgives?!

WhatGives!? is a social goodworking blog that’s all about you and us, and the great things we can do together. The idea? Simple. The more we talk about what’s going on in our heads and in our world, the better chance we have to make it better. The Internet is all about bringing people together, and what better reason to do that than for good?

Each blog entry is tied into an eBay GivingWorks (non-profit division of eBay to support non-profits raise funds on eBay) auction with the accompanying badge code, send to a friend functionality and the “add to” Delicious (a Yahoo! company), StumbleUpon (an eBay company), Digg, Reddit, Furl, Yahoo! and Facebook links. The site encourages members to comment on each entry and allows you to create a profile that showcases which non-profits you believe in. The profile can also include 5 photos of themselves, a short bio, and links to blogs and other public profiles on the web.

One huge set-back to this site is the ability to connect with other members with similar charity interests. How am I suppose to find other members who support the Leukemia & Lymphoma Society or Boys and Girls Club? The “socialize” page (shown below) was an attempt by eBay but the only thing you can do there is search by name and location.

whatgives.com

check it out

Google App Engine

Wednesday, April 9th, 2008

Google isn’t just talking about hosting applications in the cloud any more. Google is launching Google App Engine (Update: The site is live), an ambitious new project that offers a full-stack, hosted, automatically scalable web application platform. It consists of Python application servers, BigTable database access (anticipated here and here) and GFS data store services.

More details from Google:

Today we’re announcing a preview release of Google App Engine, an application-hosting tool that developers can use to build scalable web apps on top of Google’s infrastructure. The goal is to make it easier for web developers to build and scale applications, instead of focusing on system administration and maintenance.

Leveraging Google App Engine, developers can:

  • Write code once and deploy. Provisioning and configuring multiple machines for web serving and data storage can be expensive and time consuming. Google App Engine makes it easier to deploy web applications by dynamically providing computing resources as they are needed. Developers write the code, and Google App Engine takes care of the rest.
  • Absorb spikes in traffic. When a web app surges in popularity, the sudden increase in traffic can be overwhelming for applications of all sizes, from startups to large companies that find themselves rearchitecting their databases and entire systems several times a year. With automatic replication and load balancing, Google App Engine makes it easier to scale from one user to one million by taking advantage of Bigtable and other components of Google’s scalable infrastructure.
  • Easily integrate with other Google services. It’s unnecessary and inefficient for developers to write components like authentication and e-mail from scratch for each new application. Developers using Google App Engine can make use of built-in components and Google’s broader library of APIs that provide plug-and-play functionality for simple but important features.

Google App Engine: The Limitations

The service is launching in beta and has a number of limitations.

First, only the first 10,000 developers to sign up for the beta will be allowed to deploy applications.

The service is completely free during the beta period, but there are ceilings on usage. Applications cannot use more than 500 MB of total storage, 200 million megacycles/day CPU time, and 10 GB bandwidth (both ways) per day. We’re told this equates to about 5M pageviews/mo for the typical web app. After the beta period, those ceilings will be removed, but developers will need to pay for any overage. Google has not yet set pricing for the service.

One current limitation is a requirement that applications be written in Python, a popular scripting language for building modern web apps (Ruby and PHP are among others widely used). Google says that Python is just the first supported language, and that the entire infrastructure is designed to be language neutral. Google’s initial focus on Python makes sense because they use Python internally as their scripting language (and they hired Python creator Guido van Rossum in 2005).

More at tech-crunch


Your Ad Here