|
"Griff" is fine - but "GRIFF" sounds like you are shouting!
Im fine - busy with this and that, some of it work...you know how it is!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
OG,
I have been after you since PLC times . i cant shout at an all time MVP(sounds like 5 time world champion).
I just envy you .
well i have undertaken an other project OG, its a kino pvdv board, i have to bring it up. My friend will port linux, i will have to a lot other application stuff, dont know how to start. First i need to help him compile the kernel.
Its been 5 hours now ...still compiling, is something wrong? dont know
|
|
|
|
|
Don't know - I don't use Linux that much.
I guess it depends on how fast the computer you are building it on?
Have you tried any of the Linux websites?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
Ahh yes i did that already, actually the linux kernel comprises of : cramfs(compressed file system) and zimage(application settings).
cramfs is the file system, which will appear when you start linux, and zimage will contain your application settings. However i want my application to run on serial baud rate: 9600, usb support, led/lcd interface.
The above job is done and kernel compiled. he wants me to make a web page, I will write a text and that string will display on his LCD. After this is accomplished, we will control LEDs etc etc.
I have told him to write a sample app in C to do this, once done i will use that serial packet to send data from web. Actually OG, this project is for his friend(girl friend ). For once i wont hate female species. At least because of her i got to learn a little Linux.
I never did this for myself and now i am doing it for his gf. I am finding it hard to believe .
Your help is appreciated Og. Its just, if you find time. I will just ask some doubts.
Thanks a ton,
Rahul
|
|
|
|
|
Do one thing:
1> Create a socket list.
2> Connect to each socket in the list.
3> extract the IP address from the socket, using RemoteEndPoint property.
4> Use string.split to extract only IP and not port.
5> Add every IP to the list.
Cover all of these 5 points and post the code here, we will then speak about the Host no part. Believe me friend,
you will learn something from every point.
Also tell me how will you extract the RemoteEndPoint if the socket does not connect OR endpoint is not created?
Just start reading.
Thanks a ton,
Rahul
|
|
|
|
|
Hi All,
I have just written a console app to add booking info to a database based on emails pulled from an inbox. The app seems to work fine but I would like to write some tests to allow me to regularly/quickly test the functionality when somebody decides to send a surprise email format.
The app is pretty basic, an Import class to represent each of the possible client emails and an Importer class to handle the actual creating of the booking in the db both of which have an interface defined to set a base of functionality required by each(IImport and IBookingImporter). Pic of project structure below.
http://www.imagebam.com/image/a1cf9a322230061[^]
I have a basic understanding of testing and have briefly used NUnit before but I'm just wondering if anyone has a good articles or resource(more specific than google) to help set me on the correct road to writing some tests for each of the Imports.
A specific concern would be how i am going to represent/mock i guess, the email service and retrieve the mails.
Although any help or advice would really be appreciated, thanks in advance
|
|
|
|
|
|
Some TDD articles would indeed be good reading, although you're not strictly doing TDD if you add tests afterwards. The most important thing is to isolate the component that you're testing behind boundary interfaces. It seems like you have already isolated the import process service, behind IImport/IBookingImporter. You also need to isolate the input (IMessageProvider, maybe, for the email source) and output (IBookingRecipient for the database connection code). Then you can provide different implementations of those in your unit test library which give fixed, well known messages as input, and log the bookings the database would be asked to make (the output).
|
|
|
|
|
thanks very much for taking the time to reply gentlemen, i will be investigating further when i have some more time to spend on this... cheers again!!!
|
|
|
|
|
Developed a simple auto-backup program on my own computer, OS is windowsxp, mail the backup file of sqlserver automatically as an attachment. Everything is alright on my computer, but after I deployed the program on our server, OS is windows server 2003, there is an exception caught, failure sending the mail. I changed the code, I found out that the program is ok on server 2003 for those files which size are smaller than 3MB, more then 3MB, the program will fail to deliver the file.
I have confirmed that there is no problem on the e-mail provider because the program is alright on windowsxp, even the attachment is more then 3MB. I wonder if there are any settings on server 2003 limited the function.
Please help. Many thanks.
|
|
|
|
|
|
I think I find out the solution.
Stop service IIS ADMIN SERVICE.
Then open the file %system%\system32\inetsrv\MetaBase.xml
change the value of ASPMaxRequestEntityAllowed\AspRequestQueueMax\AspBufferingLimit to the size you want(upload\upload\download)
reboot the system and restore iis admin servicem, everything should be ok then.
|
|
|
|
|
A couple of thoughts, I would consider email an unlikely transport method for a backup.
Are you zipping the .bak or using compression on the backup.
I would consider an FTP server a better destination than email. Or even something like Dropbox.
Just some ideas.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Thank you for the answer, the problem is server 2003 limited the attachement.
Solution:
Stop service IIS ADMIN SERVICE.
Then open the file %system%\system32\inetsrv\MetaBase.xml
change the value of ASPMaxRequestEntityAllowed\AspRequestQueueMax\AspBufferingLimit to the size you want(upload\upload\download)
reboot the system and restore iis admin servicem, everything should be ok then.
|
|
|
|
|
How does one convert a point (in google spherical mercator) to screen coordinates? Well, 0,0, relative to a tile size cx by cy? I've seen some samples by googling, but none of the formulas seem to work.
|
|
|
|
|
|
Hi, I've made a custom webcontrol that works similar to gridview but with a few extra functionalities. The control works just fine, but my designer is showing 2 issues:
- I can't drag the control from the toolbar to a page, the action isn't allowed for unknown reason.
- I have editable templates. Changing an existing template contents works perfect. However, creating a new template from designer view isn't working(it's not persisting to my pagecode). If I create it manually by typing in the template in code view, there is no issue.
I am overriding following methods of the designer
- GetEditableDesignerRegionContent
- SetEditableDesignerRegionContent
- GetDesignTimeHtml
- GetDesignTimeHtml(DesignerRegionCollection regions)
- GetEmptyDesignTimeHtml
following properties:
- ActionLists
- TemplateGroups
My control inherits from DataBoundControl.
My designer control inherits from DataBoundControlDesigner.
Each template property has following attributes:
[TemplateContainer(typeof(CustomItemsControlItem))]
[TemplateInstance(TemplateInstance.Single)]
[PersistenceMode(PersistenceMode.InnerProperty)]
[DefaultValue(null)]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
Am I missing something? If you need code of a specific block, please ask.
|
|
|
|
|
Hi,
My requirement is "By using the web services/WCF of Amazon (and other retailers) I can upload products on Amazon (and other sites) in bulk.".
I done google. read http://docs.developer.amazonservices.com and other articals on different website, but unable to find anything that I can use or understand how to use them.
one more thing for sample application(using Amazon WCF/WS), Is it must to register on Amazon with your "CREDIT CARD DETAILS".
if you know some good articals on it plz provide links.
Thanks in advance.
modified 21-Apr-14 5:24am.
|
|
|
|
|
hi i found http://www.seesharpdot.net/?p=157[^]. it is about How to get album, dvd, and blueray cover art from Amazon. it is not what i am looking for, but helpful in understating "how to start working with Amazon APIs".
|
|
|
|
|
I will have a couple of methods that are called to mark records as deleted:
public DeleteByAddressIdResponse DeleteByAddressId(int Id)
{
Func<ClientAddressEntity, bool> whereClause = ca => ca.AddressId == Id;
return deleteClientAddresses<DeleteByAddressIdResponse >(whereClause);
}
public DeleteByAddressTypeIdResponse DeleteByAddressTypeId(int Id)
{
Func<ClientAddressEntity, bool> whereClause = ca => ca.AddressTypeId == Id;
return deleteClientAddresses<DeleteByAddressTypeIdResponse >(whereClause);
}
public DeleteByClientIdResponse DeleteByClientId(int Id)
{
Func<ClientAddressEntity, bool> whereClause = ca => ca.ClientId == Id;
return deleteClientAddresses<DeleteByClientIdResponse >(whereClause);
}
I'm trying to create a where clause for a Linq To Sql query. I'm not sure how to apply there where clause.
private T deleteClientAddresses<T>(Func<ClientAddressEntity, bool> whereClause) where T : _ResponseBase
{
var response = (T)Activator.CreateInstance(typeof(T));
using (var dc = getDataContext())
{
var entities = (from ca in dc.ClientAddresses select ca);
foreach (var entity in entities)
{
var deleteAddressResponse = DeleteAddress(entity.AddressId);
if (deleteAddressResponse.Result == Result.Success)
{
entity.IsDeleted = true;
try
{
dc.SubmitChanges();
}
catch (Exception e)
{
response.Exception = e;
break;
}
}
else
{
response.Exception = deleteAddressResponse.Exception;
}
}
}
return response;
}
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
You need to call the Where extension method[^] using the method syntax instead of the query syntax.
However, since you're using a Func<T, bool> to filter the records, the filter cannot be translated to a SQL query. As a result, all records will be loaded into memory before being passed to the filter to see if they match. If you change your code to use an Expression<Func<T, bool>> , the filter will be passed to SQL, and only the matching records will be returned.
You can also avoid the Activator.CreateInstance call by adding the new() constraint to your generic type parameter.
private T deleteClientAddresses<T>(Expression<Func<ClientAddressEntity, bool>> whereClause) where T : _ResponseBase, new()
{
var response = new T();
using (var dc = getDataContext())
{
var entities = dc.ClientAddresses.Where(whereClause);
foreach (var entity in entities)
{
...
}
}
return response;
}
public DeleteByAddressIdResponse DeleteByAddressId(int Id)
{
Expression<Func<ClientAddressEntity, bool>> whereClause = ca => ca.AddressId == Id;
return deleteClientAddresses<DeleteByAddressIdResponse>(whereClause);
}
public DeleteByAddressTypeIdResponse DeleteByAddressTypeId(int Id)
{
Expression<Func<ClientAddressEntity, bool>> whereClause = ca => ca.AddressTypeId == Id;
return deleteClientAddresses<DeleteByAddressTypeIdResponse>(whereClause);
}
public DeleteByClientIdResponse DeleteByClientId(int Id)
{
Expression<Func<ClientAddressEntity, bool>> whereClause = ca => ca.ClientId == Id;
return deleteClientAddresses<DeleteByClientIdResponse>(whereClause);
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Great suggestions. Thanks.
So now I have another problem. I have:
public DeleteByAddressIdResponse DeleteAllClientAddressesByClientId(int Id)
{
Expression<Func<ClientAddressEntity, bool>> whereClause = ca => ca.AddressId == Id;
var response = deleteClientAddresses<DeleteByAddressIdResponse >(whereClause);
return response;
}
and
private T deleteClientAddresses<T>(Expression<Func<ClientAddressEntity, bool>> whereClause) where T : _ResponseBase, new()
{
var response = new T();
using (var dc = getDataContext())
{
var entities = dc.ClientAddresses.Where(whereClause);
foreach (var entity in entities)
{
}
}
return response;
}
I'm getting
'System.Data.Linq.Table<Falcon.DAL.Data_Context.ClientAddress>' does not contain a definition for 'Where' and the best extension method overload
I installed system.linq.dynamic[^], which I thought would fix it, but no luck.
If it's not broken, fix it until it is
|
|
|
|
|
Make sure you've got a reference to the System.Core assembly, and using System.Linq; at the top of your file.
Also, your types don't match. The error message reports a type of ClientAddress , whereas your predicate is looking at a type called ClientAddressEntity . You'll need to change the filters to be Expression<Func<Falcon.DAL.Data_Context.ClientAddress, bool>> .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Same error.
And, even after adding a ref to System.Core, in the DAL code Core' is not found in System namespace.
This is bizarre.
If it's not broken, fix it until it is
|
|
|
|
|
Sorry, I just spotted that your types don't match and updated my answer. Your filters are looking at the ClientAddressEntity type, whereas your table contains ClientAddress objects.
Your filters need to be:
Expression<Func<Falcon.DAL.Data_Context.ClientAddress, bool>>
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|