Archives

Meta

Amazon Cloud Drive is your place for everything digital. Cloud Drive offers free mobile apps, secure access from any computer, and it’s built in to your Amazon devices—so you can access your digital content everywhere you are.

When it comes to files hosting I trust amazon based on my previous experiences, and based on the cheap offers they have.

Also there are many file hosting web services are bases on Amazon cloud hosting and file hosting such as Dropbox which is built on Amazon S3.

So when Amazon released the Cloud drive, I signed up and started using their website, but it is not allowed to upload big files (larger than 2GB) through the website.

And for that reason I download the windows client application,

Downloaded and installed successfully on a windows 8.1 machine.

BUT: when I started to upload or download a file:

– If the file is big or trying to upload a folder, the application get closed without any error messages.

– If I am uploading a single small file an error message appear “this folder/file failed to upload”. http://screencast.com/t/RPU2kiC9SQNP

-If I am downloading a file, nothing happen, it just don’t download it.

On this windows 8.1 machine there are just windows defender anti virus running which is not blocking anything.

To solve this Issue we need to allow this application in Firewall like this http://www.wikihow.com/Add-Exceptions-to-Windows-8-Firewall

as you can notice that we are looping against the services that we already registered in a previous step each AuthenticationClientData represent a service so we create a button to call that service we are adding all the buttons inside single form that calling ExternalLogin action method

as you can notice its a void action. we are using OAuthWebSecurity.RequestAuthentication this function is requesting the authentication from the requested provider service “Facebook – Twitter – etc.” then it returned to The URL to return to when authentication is successful. we are mentioned “ExternalLoginCallback” as a returned back action

First: we have to verify authentication to ensure that the account is successfully authenticated if not redirect users to ExternalLoginFailure action if user is authenticated then we are going to login user to the system using simple membership we are going to talk about that in later posts then check if the current user is logged in add the new account else user is new, ask for their desired membership name then redirect to ExternalLoginConfirmation action with user information at RegisterExternalLoginModel class

In this blog I am going to talk about how to add the powerfull Google Charts to your asp.net MVC 3 Application. Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.

You can notice that the function has three parameters a required parameter message,two optional parameters clientId and group so if we need to send message to all users live in the application we can send only message to send function and leave, if we need to send message to only one user all we have to do is to add client id with message if we want to send a message to a specific group send group name with message only

Step 5: Change user Id

the main problem for us now is the client id, Because it is changeable with each single request to the page so we need to identify users so we can add to helpers the following helper class that will help us to resetting the connection id in hub

because i am using membership to login and security i used membership.GetUser function to get user id. Remember id here is a Guid so if you are using your own implementation and not using membership you have to generate a unique Guid id for each person.

Step 6: Register new user id to Application

Now we have to register the newly generated user id to the application we are going to add the following code in Global.asax

In this toturial we are going through steps to create rss feed from a list of items using .NET’s built in SyndicatedFeed and SyndicatedItem class for content and two classes (Rss20FeedFormatter and Atom10FeedFormatter ) to handle XML generation with correct encoding, formatting and optional fields.

Create an empty mvc3 application and name it “RSSFeed.Website” then add Home controller.

Create a class and name it NewsItem this class we will be used as a model for retrieving feed data from the database “i will fill it manually in a the next step ”

Optional step, Fill in NewsItem list if you have items in database so there is no need to fill the list like that you can get the data from the database and return it in a list of items

public class NewsManager
{
public List<NewsItem> GenerateNews()
{
List<NewsItem> newsItems = new List<NewsItem>();
NewsItem newsItem1 = new NewsItem()
{
Author = "Mohamed Salah",
Body = "Clashes have broken out in several areas of Lebanon following Sunday's funeral of the senior intelligence official, Wissam al-Hassan.The most serious confrontations were in the northern city of Tripoli, where at least three people were killed as Sunni and Shia gunmen exchanged fire.In Beirut, there were clashes between soldiers and armed men in the Sunni Tariq al-Jadida district.Gen Hassan, a Sunni, was killed by a car bomb in the capital on Friday.He was the head of the intelligence branch of the Internal Security Forces and an outspoken critic of Syrian President Bashar al-Assad, a member of the Shia-based Alawite sect.",
Title = "Lebanon sees sectarian clashes after Hassan killing",
PublishedDate = DateTime.Today.AddDays(-5),
ImageUrl = "http://news.bbcimg.co.uk/media/images/63629000/jpg/_63629530_tripoli_reuters.jpg",
Url = "http://www.bbc.co.uk/news/world-middle-east-20025095"
};
newsItems.Add(newsItem1);
NewsItem newsItem2 = new NewsItem()
{
Author = "Mohamed Salah",
Body = "Cuba's revolutionary former leader Fidel Castro has written a strongly-worded article condemning persistent rumours that he is on his death bed.The 86-year-old attacked international media \"lies\", and published photos of himself in Cuba's state media.He said he was in good health, and could not even remember the last time he had a headache.Venezuelan politician Elias Jaua said on Sunday he had a five-hour meeting with Mr Castro the previous day.He presented a photo of the encounter, and said the former Cuban leader was \"very well, very lucid\".",
Title = "Cuba's Fidel Castro attacks 'lies' about his health",
PublishedDate = DateTime.Today.AddDays(-4),
ImageUrl = "http://news.bbcimg.co.uk/media/images/63628000/jpg/_63628162_63628161.jpg",
Url = "http://www.bbc.co.uk/news/world-latin-america-20025624"
};
newsItems.Add(newsItem2);
return newsItems;
}
}

Introduction:

Sometimes when you develop an application, you are going to face some tasks needs to perform a certain action at a given time without any user interaction, example for that a User wants to set an alert in specific time to remind him with a date Or something else like updating records in database periodically. All this tasks needs non-human interaction, so how could you tell the machine to do this job ? that’s the question. Cron Job is the solution for this tasks. Quartz.net has presented an excellent open source job scheduler that can be used for these purposes.

What is Quartz ?

Quartz is a job scheduling system that can be integrated with, or used along side virtually any other software system. The term “job scheduler” seems to conjure different ideas for different people. As you read this tutorial, you should be able to get a firm idea of what we mean when we use this term, but in short, a job scheduler is a system that is responsible for executing (or notifying) other software components when a pre-determined (scheduled) time arrives.

Job , Schedule & Trigger:

At the beginning we have to recognize how the Quartz works. Jobs are Scheduled to run when a given Trigger occurs. Triggers can be created with nearly any combination of the following directives:

at a certain time of day (to the millisecond)

on certain days of the week

on certain days of the month

on certain days of the year

not on certain days listed within a registered Calendar (such as business holidays)

repeated a specific number of times

repeated until a specific time/date

repeated indefinitely

repeated with a delay interval

Quartz in Action:

Let’s go inside the code and see how Quartz works. First we will create a new Console application and get Quartz.net from Nuget Packages.

Now create a new class let’s name it MyJob, this class will be the job that we want it to be done in specific time, as we mention above it has to inherit from IJob interface.

Here we are building a job and specify a name for this job – “job1- ” and group name – “group1″.

JJobs and Triggers are given identifying names as they are registered with the Quartz.NET scheduler. Jobs and triggers can also be placed into ‘groups’ which can be useful for organizing your jobs and triggers into categories for later maintenance. The name of a job or trigger must be unique within its group – or in other words, the true identifier of a job or trigger is its name + group. If you leave the group of the Job or Trigger ‘null’, it is equivalent to having specified SchedulerConstants.DefaultGroup.

After that we have to create Trigger for this job by using TriggerBuilder class.

As we mentioned in the previous example here, we can create a simple asynchronous actions with the signalr library like chat, real-time streaming and so on. in this blog i am going to go with another library from signalr its PersistentConnection. A PersistentConnection is the base class that has an api for exposing a SignalR service over http.

we are going to complete in the the previous application we created

Step 1:Add AdvChatController

we are going to create a new controller called AdvChatController with two action methods Index and Adv. then add index view

here as you notice we can manage the users that are connected to server first on connect action that action will be called when the user connects to the application so we can add the user to a certain group also on disconnect action that action will be called when user leaves the page so we can remove the user from group. also on received function to perform the sending action to certain group

In this tutorial I am going to talk about creating a simple chat application using signalr library with asp.net MVC. If we are trying to do a chat application or any asynchronous actions with client so we have a lot of work to do using ajax and javascript. Now with signalr it’s so simple and easy.

make sure that after Authorization you have to redirect user again using TwitterCallbackAddress that we specified before in web.config here i am redirecting the user to Auth/LoginWithTwitter action method

then we link that action method with a button in our view
Explanation: first the user will go to action method LoginWithTwitter for the first time with no “oauth_token”,”oauth_verifier” so user will redirected to twitter login page according to LoginToTwitter function then returns again to the same action method LoginWithTwitter according to the link we specifie in web.config but this time with “oauth_token” and “oauth_verifier” so user will be authenticated according to LoginToTwitter function through getting GetAccessToken function if user authenticated successfully Twitter API will return OAuthTokenResponse in this step we can set user as authenticated user and with getting user information from twitter using GetsTwitterUser function and redirect to AccountController

At AccountController make sure that the controller is Authorized to allow only authorized users to see its content