₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,160 members, 8,448,910 topics. Date: Tuesday, 21 July 2026 at 04:57 AM

Toggle theme

Mj's Posts

Nairaland ForumMj's ProfileMj's Posts

1 2 3 4 5 6 7 8 9 10 (of 28 pages)

ProgrammingRe: Integrating Your Website With Interswitch Payment Gateway For Beginners by mj(op): 6:32pm On Sep 30, 2013
44smart: any possibility of C# also?
it does not matter which programming language we are using, same principle is what we will use.
ProgrammingRe: Integrating Your Website With Interswitch Payment Gateway For Beginners by mj(op):
I was thinking about what programming language to use, asp.net(C#), PHP or JSP, (sorry I don't code python - Oga Seun no vex), I guess most people coding Python now, were formally PHP coders, therefore I will use PHP to code since most people are familiar with it.
I assume you are familiar with PHP, Mysql and basic web development (HTML, CSS).
If you properly understand how this is done, then you should be able to work with GTPay, Voguepay, Etranzact, ZenithPay and others.
Just to make things easier for beginners, we will create a simple shopping cart system, and that is where we will start from, so get your laptops ready, popcorn and coca-cola. grin grin grin
Tech JobsRe: In Need Of A Webprogrammer For My Magento Ecommerce Website by mj(m): 6:08pm On Sep 29, 2013
Magento Developer - 08067493797.
ProgrammingRe: Integrating Your Website With Interswitch Payment Gateway For Beginners by mj(op): 1:16pm On Sep 29, 2013
All tutorials will take place here sorry, so that you can ask questions here and others can learn from it. Thanks for your understanding.
WebmastersRe: Please Read About A Broke Programmer by mj(m): 10:21am On Sep 29, 2013
Also align yourself with some web design companies in Nigeria, some of them do outsource some of their projects, i work for 4 web design company, the outsource some of their jobs to me.
CelebritiesRe: May D’s ‘N150 Million House’ And An Irresponsible Media by mj(m): 7:04pm On Sep 28, 2013
I really don't want to comment but to be sincere where did May D get 150M to buy a househuh
ProgrammingRe: So You Want To Be A Programmer...? by mj(m): 1:59pm On Sep 28, 2013
ActiveMan: Which programing language have you invented?
I don't need to invent any, there are lots to work with sir.
ProgrammingRe: So You Want To Be A Programmer...? by mj(m): 1:41pm On Sep 28, 2013
Great article, programming is inborn for me.
ProgrammingRe: Update Database Via Wlan by mj(m): 8:00am On Sep 28, 2013
jboy01: thanks for the reply.
But all the computers will be connected together by a wireless router.
Take note of the IP address of the main computer system that host the server, type the IP on the browser address bar of other systems, u should be seeing the applications on your wampserver.
I conducted the election of my department those days in school through this method using wlan, it is a simple process.
ProgrammingRe: Update Database Via Wlan by mj(m): 11:15pm On Sep 27, 2013
Simple way, put your wampserver online, create an adhoc network on the main system, let other systems connect to the network, then open your browser and type the ip address of the main system server.
ProgrammingRe: Update Database Via Wlan by mj(m): 8:36pm On Sep 27, 2013
What server are u using??
ProgrammingIntegrating Your Website With Interswitch Payment Gateway For Beginners by mj(op):
I will show you a quick way to integrate your website with Interswitch payment gateway in order to receive payments on your website. I need just 10 Likes... grin grin grin
ProgrammingRe: How To Create Api In Asp.net Mvc 4 For Beginners by mj(op): 2:49pm On Sep 27, 2013
Part 2: Calling the Web API with Javascript and jQuery
Methods URI
GetAllModerators /api/moderators

GetModeratorById /api/moderators/id

A client can invoke the method by sending an HTTP GET request to the URI. Later, we'll look at how this mapping is done.So let's write a simple javascript client.
In Solution Explorer, expand the Views folder, and expand the Home folder under that. You should see a file named Index.cshtml. Double-click this file to open it.
https://oshadami.com/tutorials/nairaland10.jpg
Replace everything in this file with the following:
<div id="body">
<section class="content-wrapper main-content clear-fix">
<div>
<h2>All Nairaland Moderators</h2>


<table style="border: 1px #dedede solid;font-size: 11px; width: 400px;">
<thead style="background-color:green; border: 1px #dedede solid;font-size: 11px;color:#fff; font-weight:bold;">
<tr>
<td>ID</td> <td>Name</td> <td>Sex</td> <td>Category</td> <td>Signup Date</td>
</tr>
</thead>
<tbody>

</tbody>
</table>
</div>
<div>
<h2>Search by Moderator ID</h2>
<input type="text" id="modId" size="5" />
<input type="button" value="Search" onclick="find();" />
<p id="moderator" />
</div>
</section>
</div>

@section scripts {
<script>
var apiUrl = 'api/moderators';

$(document).ready(function () {
// Sending an AJAX request
$.getJSON(apiUrl)
.done(function (data) {
$.each(data, function (key, item) {
var tr;
tr = $('<tr/>');
tr.append("<td>" + item.Id + "</td>"wink;
tr.append("<td>" + item.Name + "</td>"wink;
tr.append("<td>" + item.Gender + "</td>"wink;
tr.append("<td>" + item.Category + "</td>"wink;
tr.append("<td>" + item.SignupDate + "</td>"wink;
$('table').append(tr);

});
});
});

function formatItem(item) {
return 'Name: ' + item.Name;
}

function find() {
var id = $('#modId').val();
$.getJSON(apiUrl + '/' + id)
.done(function (data) {
$('#moderator').text(formatItem(data));
})
.fail(function (jqXHR, textStatus, err) {
$('#moderator').text('Error: ' + err);
});
}
</script>
}
Getting a List of Moderators
To get a list of moderators, send an HTTP GET request to "/api/moderators".
The jQuery getJSON function sends an AJAX request. For response contains array of JSON objects. The done function specifies a callback that is called if the request succeeds. In the callback, we update the DOM with the moderator information.

$(document).ready(function () {
// Sending an AJAX request
$.getJSON(apiUrl)
.done(function (data) {
$.each(data, function (key, item) {
var tr;
tr = $('<tr/>');
tr.append("<td>" + item.Id + "</td>"wink;
tr.append("<td>" + item.Name + "</td>"wink;
tr.append("<td>" + item.Gender + "</td>"wink;
tr.append("<td>" + item.Category + "</td>"wink;
tr.append("<td>" + item.SignupDate + "</td>"wink;
$('table').append(tr);

});
});
});
Getting a Moderator By ID
To get a moderator by ID, send an HTTP GET request to "/api/moderator/id", where id is the moderator ID.

function find() {
var id = $('#modId').val();
$.getJSON(apiUrl + '/' + id)
.done(function (data) {
$('#moderator').text(formatItem(data));
})
.fail(function (jqXHR, textStatus, err) {
$('#moderator').text('Error: ' + err);
});
}
We still call getJSON to send the AJAX request, but this time we put the ID in the request URI. The response from this request is a JSON representation of a single product.

Running the Application
Press F5 to start debugging the application. The web page should look like the following:
https://oshadami.com/tutorials/nairaland9.jpg
It might not the best in web design, but it shows that our HTTP service is working. You can get a moderator by ID by entering the ID in the text box:
https://oshadami.com/tutorials/nairaland11.jpg

Congratulations, we now have a working web service.
ProgrammingRe: Image Gallery In Asp.net Website by mj(m): 7:38pm On Sep 26, 2013
VURN: Yeah! Better that way
Hav u written any code on it so far? Like the admin page, uploading the images, editing and deleting, etc. What is remaining?
ProgrammingRe: Image Gallery In Asp.net Website by mj(m): 7:11pm On Sep 26, 2013
I believe when an image thumbnail in the gallery is clicked upon, it pops up and show the bigger size of the image, right?
ProgrammingRe: Image Gallery In Asp.net Website by mj(m): 4:09pm On Sep 26, 2013
I need more explanations, where is the image loading from, is it from a db or a folder.
Pls explain what the project is all about. Thanks.
Jobs/VacanciesRe: PHP Web Developers Wanted Urgently by mj(m): 9:21am On Sep 26, 2013
Omogbhollahorn: u dey find php developer watin C# AND JAVA dey find there, well hope u ready to pay sha, or na slave ona dey find #nigerians sha
I thought I am the only one seeing it.
ProgrammingRe: Pls I Need Suggestion On Alternative Mobile Payment Option by mj(m): 10:31am On Sep 24, 2013
Pls what is your mobile phone number or email, let me call or email you. Thanks.
Jobs/VacanciesRe: Urgent Help Needed!!! by mj(m): 3:18pm On Sep 23, 2013
Wow, that's great. All the best in your interview.
Jobs/VacanciesRe: Urgent Help Needed!!! by mj(m): 9:59am On Sep 23, 2013
koleefem05: Thanks MJ for your response.
Is there a way you could help me out on this.
Can I get your contact details?
Won't mind meeting you to help out.
Thanks
Go to this Web address http://proxybrowsing.com/ and type yahoomail.com on the url box, u should be able to login to yahoo if your login credentials have not been compromise. If successful do let me know.
Jobs/VacanciesRe: Urgent Help Needed!!! by mj(m): 7:35am On Sep 23, 2013
That is an issue with yahoo, u better port to Gmail. I believe it has to do with location, my boss was having the same issue accessing her yahoo, i just have to install a software to hid lots of things about my system identity , i was able to login to her email.

First change your location, use USA IP to access or use a proxy browser to yahoo.
ProgrammingHow To Create Api In Asp.net Mvc 4 For Beginners by mj(op):
The first part will be creating the Web API, second part will be Consuming it via Json, third part will be consuming the Web API as a web part in Microsoft Sharepoint Server.
Part One

ASP.NET Web API is a framework for building HTTP services that can be consume by a broad range of clients including browsers, mobiles, iphone and tablets. It is very similar to ASP.NET MVC since it contains the MVC features such as routing, controllers, action results, filter, model binders, IOC container or dependency injection. But it is not a part of the MVC Framework. It is a part of the core ASP.NET platform and can be used with MVC and other types of Web applications like Asp.Net WebForms. It can also be used as an stand-alone Web services application.

So, if you like to expose your service data to the browsers and as well as all these modern devices apps in fast and simple way, you should have an API which is compatible with browsers and all these devices.

In this tutorial, we will use ASP.NET Web API to create a web API that returns a list of Nairaland Moderators. The front-end web page uses jQuery to display the results.

Create a Web API Project
Start Visual Studio and select New Project from the Start page. Or, from the File menu, select New and then Project.
In the Templates pane, select Installed Templates and expand the Visual C# node. Under Visual C#, select Web. In the list of project templates, select ASP.NET MVC 4 Web Application. Name the project "NairalandAPI" and click OK.


https://oshadami.com/tutorials/nairaland1.jpg

In the New ASP.NET MVC 4 Project dialog, select Web API and click OK.
https://oshadami.com/tutorials/nairaland2.jpg

Adding a Model
A model is an object that represents the data in your application. ASP.NET Web API can automatically serialize your model to JSON, XML, or some other format, and then write the serialized data into the body of the HTTP response message. As long as a client can read the serialization format, it can deserialize the object. Most clients can parse either XML or JSON. Moreover, the client can indicate which format it wants by setting the Accept header in the HTTP request message.

Let's start by creating a simple model that represents a moderator.
If Solution Explorer is not already visible, click the View menu and select Solution Explorer. In Solution Explorer, right-click the Models folder. From the context menu, select Add then select Class.

https://oshadami.com/tutorials/nairaland3.jpg

Name the class "Moderator" and click on ADD.
https://oshadami.com/tutorials/nairaland4.jpg
Next, add the following properties to the Moderator class.
namespace NairalandAPI.Models
{
public class Moderator
{
public int Id { get; set; }
public string Name { get; set; }
public char Gender { get; set; }
public String SignupDate { get; set; }
public string Category { get; set; }
}
}
Adding a Controller
A controller is an object that handles HTTP requests. The New Project wizard created two controllers for you when it created the project. To see them, expand the Controllers folder in Solution Explorer.
• HomeController is a traditional ASP.NET MVC controller. It is responsible for serving HTML pages for the site, and is not directly related to Web API.
• ValuesController is an example WebAPI controller.

Go ahead and delete ValuesController, by right-clicking the file in Solution Explorer and selecting Delete.
Add a new controller, as follows:
In Solution Explorer, right-click the the Controllers folder. Select Add and then select Controller.

https://oshadami.com/tutorials/nairaland6.jpg

In the Add Controller wizard, name the controller "ModeratorsController". In the Template drop-down list, selectEmpty API Controller. Then click Add.

https://oshadami.com/tutorials/nairaland7.jpg

The Add Controller wizard will create a file named ModeratorsController.cs in the Controllers folder
If this file is not open already, double-click the file to open it. Replace the code in this file with the following:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NairalandAPI.Models;
using System.Web.Http;
using System.Net;


namespace NairalandAPI.Controllers
{
public class ModeratorsController : ApiController
{
Moderator[] moderators = new Moderator[]
{
new Moderator { Id = 1, Name = "Javanian", Gender ='F', SignupDate = "April 09, 2012", Category = "Programming"},
new Moderator { Id = 2, Name = "Kodewriter", Gender ='M', SignupDate = "December 02, 2009", Category = "Programming"},
new Moderator { Id = 3, Name = "Fayimora", Gender ='M', SignupDate = "March 28, 2005", Category = "Programming"},
new Moderator { Id = 4, Name = "Slyr0x", Gender ='M', SignupDate = "June 24, 2010", Category = "Webmaster"},
new Moderator { Id = 5, Name = "MJ", Gender ='M', SignupDate = "February 28, 2006", Category = "Coming Soon"}

};

public IEnumerable<Moderator> GetAllModerators()
{
return moderators;
}

public Moderator GetModeratorById(int id)
{
var moderator = moderators.FirstOrDefault((p) => p.Id == id);
if (moderator == null)
{
throw new HttpResponseException(HttpStatusCode.NotFound);
}
return moderator;
}

}
}
To keep this example simple, moderators are stored in a fixed array inside the controller class. Of course, in a real application, you would query a database or use some other external data source.

The controller defines two methods that return moderators:

The GetAllModerators method returns the entire list of moderatos as an IEnumerable<Moderator> type.
The GetModeratorById method looks up a single moderator by its ID.

That's it! You have a working web API. Each method on the controller maps to a URI.
Next post will be consuming the Web API.
EducationRe: New Unilorin Multi-functional ID Card Ready by mj(m): 9:04am On Sep 18, 2013
As an alumni of unilorin,I really welcome this development, good one Professor Ambali. But to be sincere Unilorin is not the first school to start using this technology, I remember before gaining admission, my friends in OAU have this type of ID.
Lots of innovation is still needed in the school, I will be back soon.
Jobs/VacanciesRe: Employment Test: 1+1=? Justify Your Assertion by mj(m): 11:22am On Sep 16, 2013
-1 + 1 = 0, the interviewer just want to test u, my brother went for an interview, after passing through 2 stage of the interview already, he went for the 3rd one which is the final, d boss said I have just a question to ask u, what is IP?
My brother said: Internet Protocol.
The boss said, ur right, congrat.
Am sure if I ask that same question here, I will get series of answers.
Jobs/VacanciesRe: Fresh Graduates Needed - Contract Job (4-5 Months) by mj(m): 8:12am On Sep 14, 2013
For those who don't know, GVAPartners is one of the top IT company in Nigeria that uses Microsoft technology to provide solutions for corporate organization, some of the technology are. Net framework, SQL Server, Sharepoint server, etc.

The only issue about GVAPARTNERS is that the employ only people with 5yrs and above experience, which is clearly stated in the company's website.

So my conclusion is that GVAPARTNERS gives you a job not a career, cos right now I have most of their requirements except that 5 yrs and so experience, if I don't work, how do I gain the experience? The don't want you to grow with them, go and learn it, have the experience (5 yrs and above) and come work for us.

For the contract job, pls apply.
ProgrammingRe: Wordpress Plugin Development Tutorial by mj(m): 6:32pm On Sep 12, 2013
Nice one @ PC Guru.
ProgrammingRe: How Can I Use Visual Studio 12 To Build Web Application by mj(m): 10:15pm On Sep 11, 2013
[quote author=uc-mario]But I am much at home with vb.net rather than C#. And what are the difference (s) between ASP.NET Web Form, MVC and Web Pages frameworks?[/quote]Pls do some reading on this link:

http://forums.asp.net/t/1528396.aspx?MVC+vs+Web+Forms
ProgrammingRe: How Can I Use Visual Studio 12 To Build Web Application by mj(m): 2:18pm On Sep 10, 2013
If you encounter any problem, do post it here. I do MVC4 and Sharepoint but c# ooooo, not vb.net.
ProgrammingRe: Wordpress Plugin Development Tutorial by mj(m): 1:59pm On Sep 10, 2013
Nice one Habeeb.
ProgrammingRe: I Need A Php Tutor/mentor by mj(m): 1:57pm On Sep 10, 2013
My opinion keep learning, when you encounter problems post it here, look at the number one post in this section, it is about programming for beginners, each programming language is well defined there.
Pls read the post.
If you are posting a problem, ensure you post what you have done, it helps.
EducationRe: University of Ilorin 2013/2014 Admission by mj(m): 12:47pm On Sep 10, 2013
Please disregard any information that Unilorin has released list of first batch of candidates admitted. The admission list will be released in due course and made available to the general public. Thank you
https://www.facebook.com/UniversityOfIlorin
WebmastersRe: Oop Vs Procedural Php by mj(m): 8:23am On Sep 07, 2013
OOP is the way for me, is just the best.

1 2 3 4 5 6 7 8 9 10 (of 28 pages)