Archive | Uncategorized RSS feed for this section

Milk and Water Report Submitted in Supreme Court of Pakistan

5 Jan

Prema is only pure milk Declared by Supreme Court

Fresh Milk

Dairy Milk

Supreme Court Order

Advertisements

Use of Mobile Communication Technology and Information Flow for Crop Yield and ROI Optimizatio

30 May

Use of Mobile Communication Technology and Information Flow for Crop Yield and ROI Optimization

1.      Introduction

 

Pakistan’s high potential for producing food is an internationally established fact.  However, agriculture sector in Pakistan is facing significant challenges.  Some of these challenges are:

i.            Shortage of water and power.

ii.            Rising cost of inputs.

iii.            Extremely high post harvest wastage of farm produce.

Fortunately, progress in mobile communication and information technology has the potential to provide significant support to farmers in surmounting these challenges.  Some of the technologies that can be leveraged include:

i.            Mobile communication and smart consumer devices like phones, pdas etc.

ii.            Internet and cloud computing.

iii.            Cost effective satellite imaging and image processing.

iv.            Plant growth modeling and simulation.

v.            Knowledge synthesis and data mining.

Integrated use of these technologies can lead to optimization of individual farmer’s operations as well as accurate estimation of total farm production at a fine grain spatial as well as temporal resolution. These fine grain estimates can be used to minimize waste by optimizing use of current supply chain infrastructure as well as accurately identifying gaps in this infrastructure.

A number of efforts have been made to leverage mobile communication to assist farmers. These efforts have had mixed results.  A detailed literature search on this topic is beyond the scope of this document.  One of the key short comings in these efforts has been a lack of analysis and understanding of farmers’ end-to-end information flow requirements. This document describes farmers’ information flow needs for optimizing crop yield and ROI.  Major steps in farming, farmer’s information needs for each step, sources of information, challenges and bottlenecks in receiving information and technologies for addressing these challenges are described.

2.      Major Steps in Farming

 

A farmer takes following eight major steps from crop selection to harvesting:

i.            Crop Selection

ii.            Land Preparation

iii.            Seed Selection

iv.            Seed Sowing

v.            Irrigation

vi.            Crop Growth

vii.            Fertilizing

viii.            Harvesting

3.      Farmers’ Sources of information

 

Farmers typically rely on following sources of information:

i.            Agriculture department of provincial government.

ii.            Fellow farmers.

iii.            Field agents of seed, pesticide and fertilizer companies.

iv.            TV and radio programs.

v.            Newspapers.

4.      Challenges and Roadblocks in Information Flow

 

Farmers typically face following challenges in receiving timely and personalized information:

i.            Farmer has to travel to offices of agricultural department for information.  This is a costly and time consuming activity.  Availability of government officials is unpredictable.

ii.            Radio or TV programs are broadcast at a predefined schedule which may or may not be convenient for the farmer.  Information should be available to the farmer on demand and should be personalized to his needs. Majority of farmers in villages either do not have access to newspapers or lack of education makes their access limited.

iii.            Most of the information broadcast may not be specific to a farmer’s needs.

iv.            Fellow farmers don’t have best or most up to date knowledge.

v.            Field agents of pesticide or seed companies are unable to pay frequent and timely visits to all farmers.

5.      Use of Mobile Communication and Information Technologies

A number of information flow problems can be resolved by leveraging information technology to maintain comprehensive personalized knowledge about a farmer’s operations, simulation and modeling tools and two way asynchronous communications between farmers and the IT system using mobile communication technologies.

Cost of these technologies has decreased beyond expectation. Pakistan has one of the least expensive mobile communication networks in the world.  Reasonably priced intelligent mobile devices are capable of taking good quality images and sending these to experts for diagnosis.  Large scale computation for decision making is available all over the world at very affordable prices.  Plant growth modeling and simulation technology is maturing.

6.      Farmers’ Information Needs

Farmers’ information needs for each of these steps are presented next.

6.1  Crop Selection

  • Comparative pricing of different crops.  For some crops government releases prices of the crop at the time of seeding.
  • Market demand and sale potential of the crop.
  • Budget required for the cultivation of each crop.
  • Feasibility of the crop considering climate and quality of land.
  • Crop productivity compared with other alternatives.
  • Affects of any disease in previous crop and steps needed to minimize this impact.
  • Fertilization needed to bring land to its normal fertility depending upon the previous crops and fertilization used.
  • Layout and design of the field with respect to crop and efficient irrigation.
  • Latest techniques for leveling the fields and their cost.
  • Price and quantity needed per acre
  • Average yield and Sprout to sown ratio.
  • Suitability to particular area and climate.
  • Water requirement.
  • Resistance to diseases.
  • Distribution offices.
  • Appropriate time to sow seed.
  • Weather information at sowing time.
  • Best method for the sowing of seeds.
  • Seed sowing depth.
  • Critical time for irrigation.
  • Amount of water to be given to the plants.
  • Frequency of irrigation.
  • Number of plants per unit of are. At times more than optimum number of seeds sprout. Farmers have to reduce density for healthy growth of other plants.
  • Average growth rate of the crop in normal conditions.
  • Comparison of crop growth rate, leaf size, crop color etc. with expected growth for given conditions and input.
  • Interventions needed to maintain expected growth.
  • Frequency, quantity and method for fertilization.
  • Proper time, frequency and method for plowing.
  • Proper time, frequency and method for weeding.
  • Expected pest and virus attacks, symptoms of such attacks, precautionary measure that can be taken in advance to avoid these attacks, immediate actions including pesticide to be used to kill pests and viruses, quantity of pesticide be used per acre,  most effective method for pesticide spray, avoid health issues related to pesticide spray.
  • Proper time and method for harvesting.
  • Comparative market rates.
  • Proper crop storage.
  • Cost of transportation.

6.2  Land Preparation

6.3  Seed Selection

6.4  Seed Sowing

6.5  Irrigation

6.6  Crop Growth

6.7  Harvesting

7.      Conclusions

 

Pakistan’s agriculture sector is ripe for leveraging information technology and mobile communication to optimize crop yield and ROI. Fortunately, several advances in technology have taken place internationally as well as in Pakistan. Key challenge we face is to develop comprehensive understanding of farmers’ information flow needs and develop integrated solutions that provide information to farmers, when and where needed, at their convenience.  Success of this initiative strongly depends upon receiving accurate and timely information from farmers.  The IT system should be capable of efficient information flow management, knowledge synthesis and information delivery to the farmer.  This will be possible only if farmers perceive value in information this system provides them.

 

Dynamically Creating Zipped PDFs in .NET

30 Dec

A very useful article

Bernie Cook's Blog

This post illustrates how you can dynamically create a number of PDFs on the fly, zip them all up, and return the ZIP file via a HTTP response.

I’ve created a sample project which you can download that has a working example of the source code referenced in the post – ZippingPDFs.zip (1.5 MB). For simplicity I went for an ASP.NET web application. The only requirements are that you have Visual Studio 2010 installed.

View original post 619 more words

.NET Basics – Do Work in Background Thread to Keep GUI Responsive

30 Dec

Use of .NET BackGroundWorker

Sean's Stuff

One of the most important things that differentiates a “quick and dirty” application from one that has been designed well is how the application’s user interface behaves during lengthy operations.  The quick-and-dirty approach is to just do all of your work in a button’s Click event handler and not worry about the user interface.  The problem with this is that the GUI will freeze up while the application does whatever work it needs to do.

A well designed application, on the other hand, is one that is careful to do as much work as possible in background threads, keeping the GUI responsive and making sure that it makes it obvious to the user that work is going on in the background and adjusts the GUI to disallow any user actions that don’t apply until after the work finishes.

Under .NET 2.0, doing work on a background thread has become a…

View original post 2,714 more words

Read / Write into App Settings and Connection String Section of App.Config using C#

10 Dec

Business Problem:

We have an application which connects to a database server for operations. Our company recently installed a backup database server for high availability. Now we want our application to connect to backup database server in-case one server goes down.

I have recently wrote code which first checks the availability of database servers and then it updates the App.Config to store the new available database server.

So one can use my code for reading and updating the “App.Config’s” App Settings, Connection Strings sections using C#.

Let me share code.

private bool IsServerConnected(string conString)
{
try
{
using (var l_oConnection = new SqlConnection(conString))
{
try
{
l_oConnection.Open();
return true;
}
catch (SqlException)
{
return false;
}
}
}
catch (SqlException exp)
{
labelOutPut.Text = “Invalid Connection String “;
return false;
}
}

/***********************************************************************/

private void updateAppSettingsSection()
{
/// <summary>
/// Update App Settings Section in App.Config File
/// </summary>
///
string connectionString1 = “Server=localhost;Database=OSL11NOV13;User Id=sa;Password=***;”;
string connectionString2 = “Server=localhost;Database=SecondDB;User Id=sa;Password=****;”;

if (IsServerConnected(connectionString1))
{

string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string configFile = System.IO.Path.Combine(appPath, “App.config”);
ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap();
configFileMap.ExeConfigFilename = configFile;
System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None);

config.AppSettings.Settings[“connString”].Value = connectionString1;
config.Save();
ConfigurationManager.RefreshSection(“appSettings”);

labelOutPut.Text = “Connection String 1 is available and updated”;
}
else if (IsServerConnected(connectionString2))
{

string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string configFile = System.IO.Path.Combine(appPath, “App.config”);
ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap();
configFileMap.ExeConfigFilename = configFile;
System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None);

/***************App Settings Section***********************/
config.AppSettings.Settings[“connString”].Value = connectionString2;

config.Save();

ConfigurationManager.RefreshSection(“appSettings”);

labelOutPut.Text = “Connection String 2 is available and updated”;
}
else
labelOutPut.Text = “None of Connection Strings are available and updated”;

}

/***********************************************************************/

private void readAppSettingsSection()
{

/// <summary>
/// Read App Settigs Section of App.Config File
/// </summary>
/// <param name=”sender”></param>
/// <param name=”e”></param>

string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string configFile = System.IO.Path.Combine(appPath, “App.config”);
ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap();
configFileMap.ExeConfigFilename = configFile;
System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None);

string connTest = config.AppSettings.Settings[“connString”].Value;
labelAppSettings.Text = “App Settings Section: ” + connTest;
}

/***********************************************************************/

private void updateConnStringSection()
{

/// <summary>
/// Updating Connection Strings Section in App.config
/// </summary>
/// <param name=”sender”></param>
/// <param name=”e”></param>

string connectionString1 = “Server=localhost;Database=OSL11NOV13;User Id=sa;Password=****;”;
string connectionString2 = “Server=localhost;Database=SecondDB;User Id=sa;Password=****;”;

if (IsServerConnected(connectionString1))
{

string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string configFile = System.IO.Path.Combine(appPath, “App.config”);
ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap();
configFileMap.ExeConfigFilename = configFile;
System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None);

/***************Connection String Section***********************/
config.ConnectionStrings.ConnectionStrings[“MyConStr”].ConnectionString = connectionString1;
config.Save();
ConfigurationManager.RefreshSection(“connectionStrings”);

labelOutPut.Text = “Connection String 1 is available and updated”;
}
else if (IsServerConnected(connectionString2))
{

string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string configFile = System.IO.Path.Combine(appPath, “App.config”);
ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap();
configFileMap.ExeConfigFilename = configFile;
System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None);

/***************Connection String Section***********************/
config.ConnectionStrings.ConnectionStrings[“MyConStr”].ConnectionString = connectionString2;
config.Save();
ConfigurationManager.RefreshSection(“connectionStrings”);

labelOutPut.Text = “Connection String 2 is available and updated”;
}
else
labelOutPut.Text = “None of Connection Strings are available and updated”;

}

/***********************************************************************/

private void readConnStringSection()
{
/// <summary>
/// Read Connection Strings Section in App.Config
/// </summary>

string appPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
string configFile = System.IO.Path.Combine(appPath, “App.config”);
ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap();
configFileMap.ExeConfigFilename = configFile;
System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None);

string conStrValue=config.ConnectionStrings.ConnectionStrings[“conStrFirst”].ConnectionString;

}

 

Install Both Hyper-V and VMware Workstation on Windows 8 Without Errors

21 Oct

Very good solution … worked for me

WinQuire

One of the cool features of Windows 8 is the ability to run Hyper-V client side. No more needing Windows Server to host the VMs, you can now create and manage your VMs right inside Windows 8 using the client version of Hyper-V. However, if you’re still a die-hard fan of VMware Workstation fan (like me), or want the networking features/functionality of VMware Workstation alongside Hyper-V, you may need to work around a common error that appears if you’ve already enabled Hyper-V before installing Workstation.

If you’ve tried installing VMware Workstation after you enable Hyper-V on Windows 8, you probably encountered this error:

vmware

Fear not, however, because that error is needlessly there. You can still install VMware Workstation, you just need to first disable Hyper-V, then reenable Hyper-V. Enabling/Disabling Hyper-V will leave your existing VMs untouched, albeit, you may need to tell Hyper-V where they are after enabling it again…

View original post 318 more words

How are SharePoint 2010 Theme colors used?

26 Jun

SharePoint 2010 Theme Color Mapping

Corrie Haffly

How exactly are the theme colors used in the SharePoint 2010 v4 master page? If you’re creating your own color scheme, refer to the images and explanation below to understand more of how the colors are used. You’ll also find a download at the end with the SharePoint CSS files – theme comments included – so that you can search through them and pick apart which colors are used where.

More than just ten colors

SharePoint uses a set of theme colors (a .thmx file, which is the same type of file that you’d use for PowerPoint, Word, and other Office themes). These colors are used for fonts, backgrounds, and borders throughout the site. Below, I’ve posted a graphic showing the colors from the “Classic” theme.

If you dissect a themeable stylesheet, you’ll see lines of comments before the CSS for defining colors. This is what tells the theme…

View original post 977 more words

Connection with PI Server C#

16 Oct

First of all you should include the PISDK reference (DLL Files) in your project.

using PISDK;
Server _piserver; /// Make
string strConnectionString = null;
strConnectionString = “UID=pidemo”;
_piserver = myPISDK.Servers[“testsrvr4”]; // You should specify your own parameters
_piserver.Open(strConnectionString);

DateTime startTime = DateTime.Now.AddSeconds(-1);
DateTime endTime = DateTime.Now;
TimeSpan span = new TimeSpan(0, 5, 0);

List values = GetValuesOfPointAsStrings(“MahtabPoint”, startTime, endTime, span); //”MahtabPoint” is my own specified point. You will have to insert it your own in order to get its value.

public List GetValuesOfPoint(string pointName, DateTime startTime, DateTime endTime, TimeSpan span)
{
List values = new List();
PIPoint point = _piserver.PIPoints[pointName];
DateTime tmpTime = startTime;

while (tmpTime < endTime)
{
values.Add(point.Data.ArcValue(tmpTime, RetrievalTypeConstants.rtAtOrBefore));
tmpTime += span;

}
//lbl_test.Text += point.Name.ToString();
return values;
}

public List GetValuesOfPointAsStrings(string pointName, DateTime startTime, DateTime endTime, TimeSpan span)
{
List stringValues = new List();

List values = GetValuesOfPoint(pointName, startTime, endTime, span);

foreach (PIValue value in values)
{
if (value.Value.GetType().IsCOMObject)
{
stringValues.Add((value.Value as DigitalState).Name.ToString());
}
else
{
stringValues.Add((value.Value).ToString());
}
}

return stringValues;
}

Hello world!

10 Dec

Welcome to WordPress.com. After you read this, you should delete and write your own post, with a new title above. Or hit Add New on the left (of the admin dashboard) to start a fresh post.

Here are some suggestions for your first post.

  1. You can find new ideas for what to blog about by reading the Daily Post.
  2. Add PressThis to your browser. It creates a new blog post for you about any interesting  page you read on the web.
  3. Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.