₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,111 members, 8,420,410 topics. Date: Thursday, 04 June 2026 at 06:52 PM

Toggle theme

SmartK1's Posts

Nairaland ForumSmartK1's ProfileSmartK1's Posts

1 2 3 (of 3 pages)

ProgrammingRe: Let Share Codes by SmartK1(op): 9:45am On Nov 06, 2007
DOT NET: Anyone looking for ways to avoid page refresh re-sending your data. Check out
http://jarednevans.typepad.com/technoblog/2005/01/jareds_techno_b.html
Jokes EtcRe: The Substitute Husband by SmartK1(m): 2:29pm On Nov 05, 2007
filaria i dof
ProgrammingRe: Post Your "c" Program Questions Here by SmartK1(m): 1:59pm On Nov 05, 2007
yea man. i need a c program to convert any number to words in c. thanx in advance. I have developed a similar stuff using VB and c# but its not perfect.

10x in advance.
ProgrammingRe: Google-ize your site by SmartK1(op): 1:52pm On Nov 05, 2007
Hi man. sorry for wasting ur time. i posted the code on another thread 'let share codes' i feel its still belongs there.
RomanceRe: Are U Really Keen On Marrying A Virgin by SmartK1(m): 1:35pm On Nov 05, 2007
what is really the big stuff about marrying a virgin? promiscuity is a thing of the mind a virgin girl could become wayward after been married(its very possible)
Good talk my guy.

why not marry who has tasted life and is more sensible now(don't know not mean the really reckless girls ooooooo who just did everything possible Undecided).
As virginity is not a criterion, so is taste-noodle not a criterion.

But whatever sha i don't care if a girl is a virgin or not for as long as i dig her stylee, i go marry am
Good conclusion.

Who cares about virginity. I pray I never meet a virgin in my entire life. Of what use? You want somebody to come to my house and start misbehaving just cos I met her virgin and then she is everything. God forbid.

I am not saying that marrying a virgin is not good but I cant marry one (sorry, cant meet one). Impossible.

Good luck.
RomanceRe: Why Do We Have To Marry? by SmartK1(m): 1:23pm On Nov 05, 2007
O ga ooo.

One thing that annoys me most is when we bring GOD name in a matter that should be based purely on intelligent discussion. I consider it as an attempt to peep at a supposedly correct answer in an examination. However, the answer may be wrong.

Meanwhile, I consider marriage as just 'an agreement between 2 people to leave together because they share stuffs in common, and to add more to the already annoying problem of over-population(?)' simple. Ordained by God(?) i don't know. is it not in the 'holy Books' that
i. u must not kill (unconditional). Why do u buy guns for soldiers and policemen? to kill ants and games ?
ii. u should not judge(unconditional). Why do u send your sibblings to school to become lawers and judges.
iii. etc.

Leave God alone and discuss a matter of intelligence with intelligence.

Good luck.
ProgrammingRe: Let Share Codes by SmartK1(op): 12:15pm On Nov 05, 2007
i've just started studyin Java, got a supposed to be compiler but i don't know hw to test what i've studied.
Have u installed SDK. Which compiler are u talking about? What editor are u using.

it seems every body in this blog is too advanced 4 me. is there any other blog where the young developers can meet?
U can ask ur questions here or u can simply start ur question on a thread if u feel its worthwhile.

Good Luck.
ProgrammingRe: Let Share Codes by SmartK1(op): 11:39am On Nov 05, 2007
Hi guys,
I was doing a project recently and I needed to interact with server without post back. Guess wath I did: I created a webservice and called the webservice from client with javascript and i could now upate my UI with javascript. isn't that cool. I guess i may share some of the codes with u.
Note: this is for aspnet developers (the sample code is c# though simple enough to convert).

i. Create a webservice called MyService
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;

/// <summary>
/// Project: Byaxiom Service
/// Company: Byaxiom Solutions Limited, http://www.byaxiom.com
/// Author: I. A. Rahman
/// Created: October 2007
/// </summary>
[WebService(Namespace = "http://www.byaxiom.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService()]
public class MyService : System.Web.Services.WebService
{
public MyService()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}

public string doSomething(string tabID)
{
string retVal = "Up Smart.";//do your business logics here
return retVal; //return back to javascript
}
}

ii. create an aspx code to consume the guy




<%@ Page Language="C#" AutoEventWireup="true" CodeFile="default.aspx.cs" Inherits="default" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Poolsol Portal 1.0</title>
<link href=", /stylesheets/main.css" rel="stylesheet" type="text/css" />
<link href=", /stylesheets/content.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src=", /scripts/moduleProcess.js"></script>

<script type="text/javascript" language="javascript" >
function doSomethingFromWebService(action){
MyService.doSomething(action, doSomethingComplete, doSomethingError, doSomethingTimeOut);
}


function doSomethingComplete(arg)
{
document.getElementsByID("<%ReturnTextBox.ClientID %>"wink.value=arg;
}
function doSomethingTimeOut(arg)
{
alert("timeOut has occured"wink;
}
function doSomethingError(arg)
{
alert("error has occured: " + arg._message);
}

</script>
</head>

<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/MyService.asmx" />
</Services>
</asp:ScriptManager>
<table border="0" width="100%" style="border-collapse: collapse" id="mainTable">
<tr>
<td id="master_header_left" >&nbsp;<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="doSomethingFromWebService(1)" />
<asp:TextBox ID="ReturnTextBox" runat="server"></asp:TextBox></td>
</tr>
</table>
</form>
</body>
</html>

SO, GOOD LUCK.
WebmastersEliminating Scrollbars From Iframes by SmartK1(op): 3:31pm On Nov 02, 2007
Hi guys,
I was working on a project that made use of iframe extensively some days ago and I had this problem of eliminatin the annoying scrolbars from the damn thing.

Thank God for Google cos I googled it and i got the solution, this is how i solved it:

http://www.wolfcreekconsulting.com/support/techlib/web/DynamicallyResizedIframes.php

Good luck
ProgrammingRe: Let Share Codes by SmartK1(op): 7:14pm On Nov 01, 2007
c u guys morrow with something new. sorry for long-time-no-c. i have 2 busy lately.
Dating And Meet-up ZoneRe: Which Lady And Guy Would You Like To Date On Nairaland by SmartK1(m): 6:53pm On Nov 01, 2007
What does it matter? most guys like beautiful women. Most women like handsome and rich guys (maybe rich shld come first). Here u cant determine who is beautiful or who is rich.

I guess 4 guys anyone goes , U know what I mean. As far as u behave.

4 me. I recommend putting our pic online especially 4 females. Maybe market may come sometimes.

Good luck.
ProgrammingRe: Programming Language To Study by SmartK1(m): 6:48pm On Nov 01, 2007
Learn C#. its good 4 both desktop and web if u ask. It combines securty of JAVA with RAD of VB, sytax of C, OOP of C++ grin grin grin grin grin

Dont mind me. Just learn c#. Its the best 4 u, 4 now.
Christianity EtcRe: Was Jesus Married And Did He Fake His Death? by SmartK1(m): 6:11pm On Nov 01, 2007
I beleive that there is no way to discuss senstivie issues like religion without hurting some ppls feelings especially those that have personalised GOD (their father, master, etc).

If someone beleives Jesus was married so be it 4 him. If someone says God has no child so be it. Afterall, "man made God in his image" (or God made man in his image). Whichever. Anyway, we can still create more images as we like since world creation and documentation followed a kind of process that i would call backward-integration system:

create (by God)-> document (by men)

and thus we have several versions of documents that may or may not be verified cos the creator would not just confirm if the specs in the docs are right or wrong. So enjoy urself while it lasts

Good luck.

Note: Everybody (sorry most ppl) makes money from religions and not only Da Vinci write. What about all these men of God (?).
ProgrammingGoogle-ize your site by SmartK1(op): 4:40pm On Nov 01, 2007
I just created a portal framework recently with C# and I feel I should share some concept I used with u guys.

I recently observed google and yahoo mails and tripped. I therefore did nothing new ( I guess) but just visualized what has been done in yahoo and google and implemented my own.

Description: I created a page that embeds other pages in them through d use of iframe. The only thing spectacular here is that the page is not known at design time and therefore one or two tricks are needed to load different page into iframe at run-time. Also user has to be validated whether he/she has right to that page before the page is loaded.

Steps:
i. Create a webservice that take a parameter to and returns string (of the page to be displayed)
ii. Call the sebservice through javascript proxy and get the resturn type
iii. Set the iframe to the return string.
iv. Enjoy your meal.

Note: make sure u check your Session user in the webservice before u authorize the real page return otherwise return noaccess page or something.

Good luck.
ProgrammingRe: Software Packaging by SmartK1(m): 2:24pm On Oct 31, 2007
Gates loses title as world's richest man.accordint g to cnn. you can read more from this link.
www.news.com/2100-1001-239838.html
Pleeeeaaaseee, next time u are posting information try and confirm how updated the information is. This article was written in the year 2000, u can guess how current it is.

Good luck.
RomanceRe: Why Do We Have To Marry? by SmartK1(m): 10:42am On Oct 31, 2007
Pls attck me if u wish.

Its best if u are married and happy in it. Its worst if u are married and sad in it. U may take a calculated risk or uncalculated (if u wish).

Anyway, we always look for every opportunity to call God's name to suit our needs. I dont care what u quote, marry if u feel its right 4 u and would not negatively affect u and others(, ) otherwise do as u beleive its OK.

The bottom line: TRY AND LIVE A HAPPY LIFE AND TRY UR BEST TO ALWAYS MAKE OTHERS HAPPY TOO. forget about societal dos and donts especially african society.
Tech JobsRe: Programmers With Expeirence In Web Solutions Wanted. Salary Very Attractive! by SmartK1(m): 9:30am On Oct 31, 2007
Oops! ur email address does not work man!
ProgrammingRe: How Do I Create A Desktop Shortcut For My Application? by SmartK1(m): 6:11pm On Oct 30, 2007
TRY THIS: (from CodeProject)

/**********************************************************************
* Function, : CreateShortcut
* Parameters, : lpszFileName - string that specifies a valid file name
* lpszDesc - string that specifies a description for a
shortcut
* lpszShortcutPath - string that specifies a path and
file name of a shortcut
* Returns, : S_OK on success, error code on failure
* Description, : Creates a Shell link object (shortcut)
**********************************************************************/
HRESULT CreateShortcut(/*in*/ LPCTSTR lpszFileName,
/*in*/ LPCTSTR lpszDesc,
/*in*/ LPCTSTR lpszShortcutPath)
{
HRESULT hRes = E_FAIL;
DWORD dwRet = 0;
CComPtr<IShellLink> ipShellLink;
// buffer that receives the null-terminated string
// for the drive and path
TCHAR szPath[MAX_PATH];
// buffer that receives the address of the final
//file name component in the path
LPTSTR lpszFilePart;
WCHAR wszTemp[MAX_PATH];

// Retrieve the full path and file name of a specified file
dwRet = GetFullPathName(lpszFileName,
sizeof(szPath) / sizeof(TCHAR),
szPath, &lpszFilePart);
if (!dwRet)
return hRes;

// Get a pointer to the IShellLink interface
hRes = CoCreateInstance(CLSID_ShellLink,
NULL,
CLSCTX_INPROC_SERVER,
IID_IShellLink,
(void**)&ipShellLink);

if (SUCCEEDED(hRes))
{
// Get a pointer to the IPersistFile interface
CComQIPtr<IPersistFile> ipPersistFile(ipShellLink);

// Set the path to the shortcut target and add the description
hRes = ipShellLink->SetPath(szPath);
if (FAILED(hRes))
return hRes;

hRes = ipShellLink->SetDescription(lpszDesc);
if (FAILED(hRes))
return hRes;

// IPersistFile is using LPCOLESTR, so make sure
// that the string is Unicode
#if !defined _UNICODE
MultiByteToWideChar(CP_ACP, 0,
lpszShortcutPath, -1, wszTemp, MAX_PATH);
#else
wcsncpy(wszTemp, lpszShortcutPath, MAX_PATH);
#endif

// Write the shortcut to disk
hRes = ipPersistFile->Save(wszTemp, TRUE);
}

return hRes;
}

/*********************************************************************
* Function, : ResolveShortcut
* Parameters, : lpszShortcutPath - string that specifies a path
and file name of a shortcut
* lpszFilePath - string that will contain a file name
* Returns, : S_OK on success, error code on failure
* Description, : Resolves a Shell link object (shortcut)
*********************************************************************/
HRESULT ResolveShortcut(/*in*/ LPCTSTR lpszShortcutPath,
/*out*/ LPTSTR lpszFilePath)
{
HRESULT hRes = E_FAIL;
CComPtr<IShellLink> ipShellLink;
// buffer that receives the null-terminated string
// for the drive and path
TCHAR szPath[MAX_PATH];
// buffer that receives the null-terminated
// string for the description
TCHAR szDesc[MAX_PATH];
// structure that receives the information about the shortcut
WIN32_FIND_DATA wfd;
WCHAR wszTemp[MAX_PATH];

lpszFilePath[0] = '\0';

// Get a pointer to the IShellLink interface
hRes = CoCreateInstance(CLSID_ShellLink,
NULL,
CLSCTX_INPROC_SERVER,
IID_IShellLink,
(void**)&ipShellLink);

if (SUCCEEDED(hRes))
{
// Get a pointer to the IPersistFile interface
CComQIPtr<IPersistFile> ipPersistFile(ipShellLink);

// IPersistFile is using LPCOLESTR,
// so make sure that the string is Unicode
#if !defined _UNICODE
MultiByteToWideChar(CP_ACP, 0, lpszShortcutPath,
-1, wszTemp, MAX_PATH);
#else
wcsncpy(wszTemp, lpszShortcutPath, MAX_PATH);
#endif

// Open the shortcut file and initialize it from its contents
hRes = ipPersistFile->Load(wszTemp, STGM_READ);
if (SUCCEEDED(hRes))
{
// Try to find the target of a shortcut,
// even if it has been moved or renamed
hRes = ipShellLink->Resolve(NULL, SLR_UPDATE);
if (SUCCEEDED(hRes))
{
// Get the path to the shortcut target
hRes = ipShellLink->GetPath(szPath,
MAX_PATH, &wfd, SLGP_RAWPATH);
if (FAILED(hRes))
return hRes;

// Get the description of the target
hRes = ipShellLink->GetDescription(szDesc,
MAX_PATH);
if (FAILED(hRes))
return hRes;

lstrcpyn(lpszFilePath, szPath, MAX_PATH);
}
}
}

return hRes;
}


//USAGE
void HowToCreateShortcut()
{
LPCTSTR lpszFileName = _T("C:\\Work\\Window.exe"wink;
LPCTSTR lpszShortcutDesc = _T("Anything can go here"wink;
LPCTSTR lpszShortcutPath =
_T("C:\\Documents and Settings\\Administrator\\Desktop\\Sample Shortcut.lnk"wink;

CreateShortcut(lpszFileName, lpszShortcutDesc, lpszShortcutPath);
}

void HowToResolveShortcut()
{
LPCTSTR lpszShortcutPath =
_T("C:\\Documents and Settings\\Administrator\\Desktop\\Sample Shortcut.lnk"wink;
TCHAR szFilePath[MAX_PATH];

ResolveShortcut(lpszShortcutPath, szFilePath);
}
ProgrammingRe: How Do I Create A Desktop Shortcut For My Application? by SmartK1(m): 6:46pm On Oct 23, 2007
its beter to do that in the installer like Inno Setup, Installshield, etc.
Phone/Internet MarketRe: Easy Access To Mtn Midnight Calls by SmartK1(m): 5:24pm On Oct 09, 2007
08022814912
Truly Easy Access to MTN

Try somewhere else
ProgrammingRe: Visual Basic Expert Please Save A Soul by SmartK1(m): 1:58pm On Oct 09, 2007
Project at what level, OND, Bsc, Masters, etc. I may have something u can readily use. contact me at mcrahmsmart@yahoo.co.uk
ProgrammingRe: Asp.net, Vb.net, C# Help Needed by SmartK1(m): 10:43am On Oct 08, 2007
Hi KB,
I think I am interested in the project. U may contact me thru. mcrahmsmart@yahoo.co.uk or mcrahmsmart@gmail.com.
ProgrammingRe: 10 Tech Certifications That Actually Mean Something by SmartK1(m): 12:46pm On Sep 26, 2007
sucks. Where are MCSDs, MCADs, ,
ProgrammingRe: Post Ur Vb 6.0 Questions Here by SmartK1(m): 3:42pm On Sep 25, 2007
luckyCO
Sorry, I have been away 4 long,

Consider yourself spending 3.5GB or more of .Net development environment to 450MB or less of Vb6.0.
That argument would have been too good some years back. Consider these:
i. i just bought 120G HD (laptop) for N14,000 last week, so, how much is 3.5GB
ii. .NET framework (all that is needed to run .NET app) does not require up 3.5GB (just 200MB is enough).
iii. Its good for some of us who invested on VB long time ago to continue. But if you are just starting up, how relevant will it be in the next 3 years (when you are supposed to start enjoying the dividend of knowledge)
iv. How many employers now look for VB6.0 programmer/ developer.
v. ,

Yours trully,
Smart K.
ProgrammingRe: Web Applications Are Not The Way Out by SmartK1(m): 12:42pm On Sep 21, 2007
a job well done.
ProgrammingRe: Let Share Codes by SmartK1(op): 12:29pm On Sep 21, 2007
some how, this post is not active. why? or is there another code sharing link on this forumn where developers hang out?,
Not exactly that I know of but there also similar forums in programming. Its just a matter of time.
ProgrammingRe: Let Share Codes by SmartK1(op): 9:50am On Sep 21, 2007
Sorry Fikzy,
will get back to u b4 end of work today. i have been very busy lately.
TV/MoviesRe: 80% Of Nollywood Films Are Wack by SmartK1(m): 3:15pm On Sep 12, 2007
Huhhhhhh , this is topic I love to the bottom of my heart.

NIJA FILM IS A RIGHT-OFF. FINISH.

However, I wont like to forget good guys like Tunde Kelani, Tade Ogidan, etc.

Someone said we are coming up. Indeed. Watch Aye (by Ogunde, 197X) and compare it with some films by Ola-Iya, Ara-Kangudu, etc and you would be sorry for Nigerian films industry. Compare Glamour Girls (1987) with nonsense films they produce now. truly, we coming up BUT IN THE NEGATIVE.
ProgrammingRe: Let Share Codes by SmartK1(op): 9:57am On Sep 12, 2007
Hi all,
I have been writing aspx some times now and I discovered that I have been writing the same function every time, so I decided to put it in a class and just call the function from the class whenever I need the function.
Here is a class that helps you to upload image file e.g. passport (u dont need to bother urself everytime doing the same ):


public class UploadManager
{
public bool UploadFile(ref FileUpload f, ref string message)
{
if (!f.HasFile)
{
message = "No file is selected.";
return false;
}
HttpContext context = HttpContext.Current;
string sessionid = context.Session.SessionID;
string fileExtension = Path.GetExtension(f.FileName).ToLower();
string[] allowedExtensions = new string[] { ".jpeg", ".jpg" };
int totallegth = allowedExtensions.Length;
for (int counter = 0; counter < totallegth; counter++)
{
if (fileExtension == allowedExtensions[counter])
{
Bitmap myImage = new Bitmap(120, 140);
try
{
string path = context.Server.MapPath("~/UploadedImages/"wink;
string filename = sessionid + DateAndTime.get_Now().Millisecond.ToString() + ".jpg";
string fullpath = path + filename;
f.PostedFile.SaveAs(fullpath);
myImage = new Bitmap(fullpath);
if (((myImage.Width >= 110) & (myImage.Width <= 130)) & ((myImage.Height >= 130) & (myImage.Height <= 150)))
{
message = "~/UploadedImages/" + filename;
return true;
}
message = "Invalid Picture size! The Passport Photograph must be of size 120 X 140px";
return false;
}
catch (Exception exception1)
{
ProjectData.SetProjectError(exception1);
Exception ex = exception1;
AppException.LogError(ex.Message);
message = "Image could not be uploaded at the moment.";
ProjectData.ClearProjectError();
return false;
ProjectData.ClearProjectError();
}
finally
{
myImage.Dispose();
}
}
}
message = "Invalid Picture format! The Passport Photograph must a jpeg.";
return false;
}

}

Usage:
UploadManager um = new UploadManager();

if (um.UploadFile(this.filPassport, message) )
{
this.imgPassport.ImageUrl = message;
ViewState("picPath"wink = message;
}
else
{
this.lblErrorMesage = message;
}

Enjoy and pls let me know if u have any problem using the class.

Good luck.
TV/MoviesRe: Nigeria has a Satellite in Orbit! (NigeriaSat-1) by SmartK1(m): 5:48pm On Sep 11, 2007
On top of the plans to build the new satellite, Nigerian engineers will apparently undergo training on the new design so that in the future, Nigeria can manufacture it's own.
Just like Ajaokuta Steel Company (?). Nija, make una wake up: No Nigerian leader takes a decision because it favours the country. Try and find out about the whole contract and u would be surprised.
Nairaland GeneralRe: Software Engneering And Networking Engrneering Which Is Better? by SmartK1(m): 4:50pm On Sep 11, 2007
What do you mean by 'better'? In terms of ease of learning, income generation, job availability, durability, etc or what. Please let us know.

1 2 3 (of 3 pages)