Monday, October 19, 2009
Send HTTP post in actionscript
//Load up all the variables you want to POST
sendInfo.username = "";
sendInfo.password = "!";
sendInfo.sendAndLoad("http://urlhere",sendInfo,"GET");
Tuesday, August 25, 2009
Testing Sendmail Linux redhat 5
sends output to sendmail.out file
Tuesday, July 14, 2009
Monday, June 29, 2009
Monday, June 22, 2009
Thursday, June 11, 2009
Saving Skype voice mails to your pc
Step 1. Install http://www.pamela-systems.com/products/
Step 2. Play the Skype voice mail
Step 3. The voice mail will be saved as a .mov into your movies folder
Step 4. Install ffmpeg on your mac
Step 5. convert the .mov into an .mp3 or wav using ffmpeg
- Step2
Run Audacity and import the music you want to convert. To do this, click on "File" and select "Open." Then select the file you want to convert to mono. Make sure the file you are converting is already in stereo.
- Step3
Look at the box that appears after you import your file. You should see blue waveforms. To the left of the waveforms, you will see a bunch of numbers and other settings in a box. In the top left corner of the box, locate the arrow (which is to the left of the 1.0 number).
- Step4
Click the arrow and select "Split Stereo Track" from the drop-down menu. Now you will notice that track has been split into left and right channels that you can control.
- Step5
Click the arrow by the top (Left channel) waveform (this will also be to the left of top waveform's 1.0 marking). Select "mono" from the drop-down menu.
- Step6
Click on the lower (Right channel) arrow. This will be located to the left of the lower waveform's 1.0 marking. Select "mono" from the drop-down menu. At this point, the boxes to the left of the top and bottom waveforms should both say "mono." If either still says "right" or "left," ensure that you followed the above steps and switched each channel to mono in the drop-down menu.
- Step7
Export your now mono song by clicking on the File tab and selecting one of the export options. Choose the directory you want to export the file to and you're done.
Your done
Tuesday, May 12, 2009
Consuming XML Iphone SDK

Below is the project to consume XML in Iphone using the NSXMLParser , i will be updating this regularly. Download it here Code
Friday, April 24, 2009
Thursday, April 23, 2009
Update twitter status ASP.NET C#

Here is a quick and easy way to update twitter via asp.net c#
1. Download and add this .dll to your bin (asp.net 3.0) http://code.google.com/p/twitterizer/
2. Here is your code
Download here
Monday, April 20, 2009
Google MAPS iphone UIWEBVIEW

I had a task to create a web view based on a zip code input via an iphone app here is the result
Download it here
Thursday, April 16, 2009
Replace blank spaces in VI
Thursday, April 2, 2009
Wednesday, March 25, 2009
Monday, March 23, 2009
RSS reader IPHONE SDK 2.1
NSString * path = @"http://rss.cnn.com/rss/money_latest.rss";
With
NSString * path = @"Yours";
download the zip here
Monday, March 16, 2009
Google charts with visualazation via SVG and VML
sample here
http://www.mobilegreatness.com/charts.html
Wednesday, March 4, 2009
WAP forms Verizon Open wave devices
Tuesday, March 3, 2009
Ad mobs ads iphone sdk
Google Adsense SMS
a.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Keep Text Messaging FREE AND SAFE click our ad below.");
Response.Write("
");
// Response.Write("Visit www.mobilegreatness.com From your PC to get your Free SMS widget");
// Response.Write("To support us, please click on below google ad");
//Response.Write("
");
string googleScheme = "http://";
string googleHost = Server.UrlEncode(googleScheme + Request.ServerVariables["HTTP_HOST"]);
double googleTime = (DateTime.Now - new
DateTime(1970, 1, 1)).TotalSeconds;
double googleDt = (1000 * googleTime) + Math.Round(1000 * Timer() -
(int)Timer());
string https = Request.ServerVariables["HTTPS"];
if (https.IndexOf("on") > -1)
{
googleScheme = "https://";
}
string googleAdUrl = "http://pagead2.googlesyndication.com/pagead/ads?ad_type=text_image&channel=" +
"&client=ca-mb-pub-3965045331381248" +
"&color_border="+googleColor("555555", googleTime) +
"&color_bg="+ googleColor("EEEEEE", googleTime) +
"&color_link=" + googleColor("400058", googleTime) +
"&color_text=" + googleColor("000000", googleTime) +
"&color_url=" + googleColor("008000", googleTime) +
"&dt=" +googleDt +
"&format=mobile_single" +
"&host="+googleHost +
"&ip=" + Server.UrlEncode(Request.ServerVariables["REMOTE_ADDR"]) +
"&markup=xhtml&oe=utf8&output=xhtml" +
"&ref=" + Server.UrlEncode(Request.ServerVariables["HTTP_REFERER"])
+"&url=" + googleHost +
Server.UrlEncode(Request.ServerVariables["URL"]) +
"&useragent=" +
Server.UrlEncode(Request.ServerVariables["HTTP_USER_AGENT"]) +
googleScreenRes();
WebClient wc = new WebClient();
string googleAdOutput = wc.DownloadString(googleAdUrl);
Response.Write(googleAdOutput);
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create(googleAdUrl);
HttpWebResponse resp = null;
try
{
req.Timeout =
Int32.Parse(ConfigurationManager.AppSettings["Google_Timeout_Msec"]);
resp = (HttpWebResponse)req.GetResponse();
Stream responseStream = resp.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream,
Encoding.UTF8);
googleAdOutput = streamReader.ReadToEnd();
}
catch (HttpException htex)
{
}
catch (Exception exception)
{
googleAdOutput = "";
}
finally
{
// According to MS doc. it's only necessary to close either
if (resp != null) {
resp.Close();
}
}
}
string googleColor(string value, double random)
{
string[] colorArray = value.Split(',');
return colorArray[(int)random % colorArray.Length];
}
string googleScreenRes()
{
string screenRes = Request.ServerVariables["HTTP_UA_PIXELS"];
char delimiter = 'x';
if (screenRes == null)
{
screenRes = Request.ServerVariables["HTTP_X_UP_DEVCAP_SCREENPIXELS"];
delimiter = ',';
}
if (screenRes != null)
{
string[] resArray = screenRes.Split(delimiter);
if (resArray.GetUpperBound(0) + 1 == 2)
{
return "&u_w=" + resArray[0] + "&u_h=" + resArray[1];
}
}
return "";
}
double Timer()
{
return (DateTime.Now - DateTime.Now.Date).TotalSeconds;
}
}
a.aspx
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Web" %>
<% double googleTime = (DateTime.Now - new DateTime(1970,1,1)).TotalSeconds; double googleDt = (1000 * googleTime) + Math.Round(1000 * Timer() -(int)Timer()); string googleScheme = "http://"; string https = Request.ServerVariables["HTTPS"]; if (https.IndexOf("on") > -1)
{
googleScheme = "https://";
}
string googleHost = Server.UrlEncode(googleScheme +Request.ServerVariables["HTTP_HOST"]);
string googleAdOutput = "";
string googleAdUrl = "http://pagead2.googlesyndication.com/pagead/ads?" +
"ad_type=text_image" +
"&channel=" +
"&client=ca-mb-pub-3965045331381248" +
"&color_border=" + googleColor("555555", googleTime) +
"&color_bg=" + googleColor("EEEEEE", googleTime) +
"&color_link=" + googleColor("400058", googleTime) +
"&color_text=" + googleColor("000000", googleTime) +
"&color_url=" + googleColor("008000", googleTime) +
"&dt=" + googleDt +
"&format=mobile_single" +
"&host=" + googleHost +
"&ip=" + Server.UrlEncode(Request.ServerVariables["REMOTE_ADDR"]) +
"&markup=xhtml" +
"&oe=utf8" +
"&output=xhtml" +
"&ref=" + Server.UrlEncode(Request.ServerVariables["HTTP_REFERER"]) +
"&url=" + googleHost +
Server.UrlEncode(Request.ServerVariables["URL"]) +
"&useragent=" +
Server.UrlEncode(Request.ServerVariables["HTTP_USER_AGENT"]) +
googleScreenRes();
HttpWebRequest req = (HttpWebRequest)
WebRequest.Create(googleAdUrl);
HttpWebResponse resp;
try {
req.Timeout =
Int32.Parse(ConfigurationManager.AppSettings["Google_Timeout_Msec"]);
resp = (HttpWebResponse)req.GetResponse();
Stream responseStream = resp.GetResponseStream();
StreamReader streamReader = new StreamReader(responseStream,Encoding.UTF8);
googleAdOutput = streamReader.ReadToEnd();
resp.Close();
} catch (Exception exception) {
// Something went wrong. This is a good place to log theexception.
googleAdOutput = "";
}
%> -->
AJAX Timer asp.net Datagrid
protected void Page_Load(object sender, EventArgs e)
{
GridData.DataSource = getData();
GridData.DataBind();
Page.DataBind();
}
protected void Timer1_Tick(object sender, EventArgs e)
{
//Label1.Text = "Total Messages of " + DateTime.Now.ToLongTimeString();
}
public static DataTable getData()
{
DataSet ds = new DataSet();
try
{
OdbcConnection conn = new OdbcConnection(ConfigurationManager.ConnectionStrings["connection_string"].ConnectionString);
string query = String.Format("Stored Procedure");
OdbcDataAdapter adap = new OdbcDataAdapter(query, conn);
adap.Fill(ds);
}
catch (Exception ex)
{
}
return ds.Tables[0];
}
}
ajax.aspx
Delete ALL mail out of queue SENDMAIL
0,15,30,45 * * * * find /var/spool/mqueue -type f -print0 | xargs -0 rm -rf
as you can see it will do it every 15 minutes works perfect fedora sendmail
CURL post from asp.net to php
public string HttpPost(string uri, string parameters)
{
WebRequest webRequest = WebRequest.Create(uri);
webRequest.ContentType = "application/x-www-form-urlencoded";
webRequest.Method = "POST";
byte[] bytes = Encoding.ASCII.GetBytes(parameters);
Stream os = null;
try
{
webRequest.ContentLength = bytes.Length;
os = webRequest.GetRequestStream();
os.Write(bytes, 0, bytes.Length);
}
catch (WebException ex)
{
}
finally
{
if (os != null)
os.Close();
}
try
{
WebResponse webResponse = webRequest.GetResponse();
if (webResponse == null)
{ return null; }
StreamReader sr = new StreamReader(webResponse.GetResponseStream());
return sr.ReadToEnd().Trim();
}
catch (WebException ex)
{
}
return null;
}
objmm.HttpPost("http://phppaghere", "from_number=" + dtVot.Rows[0]["fromphonenumber"].ToString() + "&to_number=" + phonenumber);
$this->key,
'phonenumber' => $member_phone_number,
'memberid' => $member_id,
'programid' => $program_id,
'shortcode' => "something_here"
);
try {
logger('info', "Error Message");
$client = new SoapClient($this->WSDL);
$client->SOAPMETHODHERE($params);
} catch (SoapFault $exception) {
mailer('err', "EXCEPTION IN Calling : " . $exception);
}
$this->sendMessage($member_id, $this->confirmMsgID);
}
}
//ELSE NUM_ROWS <= 0 //DONT DO ANYTHING, THIS PHONE IS NEVER SEEN BEFORE //SOMEONE JUST SENDING OUT OF THE BLUE logger('info', " DOING NOTHING"); } private function sendMessage($member_id, $message_id){ logger('info', "SEND MESSAGE function::Sending msg ID=" . $message_id . " To memmberid=" . $member_id); class_exists('Outgoing_Message_Queue') || require('classes/outgoing_message_queue.php'); $outgoing_message_obj = new Outgoing_Message_Queue($message_id); $outgoing_message_obj->sendToMember($member_id);
}
}
?>

Consuming a web SOAP web service (asmx) with iphone (sdk)
here i go
View controller
//
// Hello_SOAPAppDelegate.m
// Hello_SOAP
//
// Created by Dave McAnall on 11/2/08.
// Copyright __MyCompanyName__ 2008. All rights reserved.
//
#import "Hello_SOAPViewController.h"
@implementation Hello_SOAPViewController
@synthesize greeting, tonumber,fromnumber,nameInput, webData, soapResults, xmlParser;
-(IBAction)buttonClick:(id)sender
{
recordResults = FALSE;
NSString *soapMessage = [NSString stringWithFormat:
@"\n"
"
"
"
"
"
"
"
"
"
"
];
NSLog(soapMessage);
NSURL *url = [NSURL URLWithString:@"http://yourasmx.asmx"];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]];
[theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[theRequest addValue: @"http://tempuri.org/SendTextToFriend" forHTTPHeaderField:@"SOAPAction"];
[theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
[theRequest setHTTPMethod:@"POST"];
[theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if( theConnection )
{
webData = [[NSMutableData data] retain];
}
else
{
NSLog(@"theConnection is NULL");
}
[nameInput resignFirstResponder];
[fromnumber resignFirstResponder];
[tonumber resignFirstResponder];
}
-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
[webData setLength: 0];
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[webData appendData:data];
}
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
NSLog(@"ERROR with theConenction");
[connection release];
[webData release];
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSLog(@"DONE. Received Bytes: %d", [webData length]);
NSString *theXML = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding];
NSLog(theXML);
[theXML release];
if( xmlParser )
{
[xmlParser release];
}
xmlParser = [[NSXMLParser alloc] initWithData: webData];
[xmlParser setDelegate: self];
[xmlParser setShouldResolveExternalEntities: YES];
[xmlParser parse];
[connection release];
[webData release];
}
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *) namespaceURI qualifiedName:(NSString *)qName
attributes: (NSDictionary *)attributeDict
{
if( [elementName isEqualToString:@"SendTextToFriendResult"])
{
if(!soapResults)
{
soapResults = [[NSMutableString alloc] init];
}
recordResults = TRUE;
}
}
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
if( recordResults )
{
[soapResults appendString: string];
}
}
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
if( [elementName isEqualToString:@"SendTextToFriendResult"])
{
recordResults = FALSE;
greeting.text = soapResults;
[soapResults release];
soapResults = nil;
}
}
/*
Implement loadView if you want to create a view hierarchy programmatically
- (void)loadView {
}
*/
/*
Implement viewDidLoad if you need to do additional setup after loading the view.
- (void)viewDidLoad {
[super viewDidLoad];
}
*/
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Release anything that's not essential, such as cached data
}
- (void)dealloc
{
[xmlParser release];
[super dealloc];
}
@end
Header
//
// Hello_SOAPViewController.h
// Hello_SOAP
//
// Created by Dave McAnall on 11/2/08.
// Copyright __MyCompanyName__ 2008. All rights reserved.
//
#import
@interface Hello_SOAPViewController : UIViewController
{
IBOutlet UITextField *nameInput;
IBOutlet UITextField *tonumber;
IBOutlet UITextField *fromnumber;
IBOutlet UILabel *greeting;
NSMutableData *webData;
NSMutableString *soapResults;
NSXMLParser *xmlParser;
BOOL *recordResults;
}
@property(nonatomic, retain) IBOutlet UITextField *nameInput;
@property(nonatomic, retain) IBOutlet UITextField *tonumber;
@property(nonatomic, retain) IBOutlet UITextField *fromnumber;
@property(nonatomic, retain) IBOutlet UILabel *greeting;
@property(nonatomic, retain) NSMutableData *webData;
@property(nonatomic, retain) NSMutableString *soapResults;
@property(nonatomic, retain) NSXMLParser *xmlParser;
-(IBAction)buttonClick: (id) sender;
@end
XIB




