|
I had to look it up. Is that some British word? I'd never heard it used in the US before, but then again, I'm not in the military.
|
|
|
|
|
I had the benefit of studying Latin at school, which helps. And no - it was a dead language when I studied it, I'm not that old.
|
|
|
|
|
As far as I've heard, I'm the only one among my vast collection of friends and acquaintances who has used it in a sentence, but they all understood what I said.
I learned the word as a child, and don't recall where; I wasn't aware of any connection to the military.
Will Rogers never met me.
|
|
|
|
|
hi
i have attach a Nokia 7610 as GSM to my cell phone. i received a call on my computer using AT command ATA in hyper terminal. but now i want to implement it in c#. any idea how can i do this. i have done all about serial port connection checking in c#.
thanks
|
|
|
|
|
You just need to use the SerialPort class to do this. Below is a sample that should help you get the idea on how to do this:
SerialPort serialPort = new SerialPort("COM1", 115200, Parity.None, 8, StopBits.One);
serialPort.WriteTimeout = 5000;
serialPort.ReadTimeout = 5000;
serialPort.DataReceived += new SerialDataReceivedEventHandler(serialPort_DataReceived);
serialPort.Open();
serialPort.DtrEnable = true;
serialPort.RtsEnable = true;
serialPort.Write("AT+CMGF=1\r\n");
Thread.Sleep(500);
serialPort.Write("AT+CNMI=2,2\r\n");
Thread.Sleep(500);
serialPort.Write(string.Format("AT+CSCA=\"+{0}\"\r\n",serviceCentreAddress));
Thread.Sleep(500);
|
|
|
|
|
thanks but this is i guess sending data from pc. but i want to receive a call on pc. i dont find it how to start. i knw i have to use serial Port class. n i have set the com port and burd rate etc.
but how whn a fon ring the pc receive that call? how should pc come to knw that there is a call? should i write a code in Load()?
|
|
|
|
|
Did you not see that there's a data received event? You'd hook into this.
Please, don't use textspeak when posting in the forums. It's extremely irritating.
|
|
|
|
|
To elaborate on Pete's response, the sample code he provided implemented a hook to capture received data events. All you have to do is write the code that handles those events. You'll probably want to create a buffer to capture the incoming stream of data, based upon the expected size of incoming transmissions, then spawn a separate thread to respond to the message so that your handler doesn't block other incoming streams. Of course, if your application is one which is supposed to wait for a response from the recipient before sending another message, this step won't be necessary. How you handle incoming messages depends a lot on what you're trying to do, but Pete's already given you the entry point you need to capture incoming data.
Will Rogers never met me.
|
|
|
|
|
Hi,
We have a windows app which is installed in many systems..and the server is resided
on different PC..so whenever users loading the app due to many hits to server..the application is becoming very slow..
so i tried to use caching the data ..with expiration..(as we dont have any db changes during expiration time..)
i tried the below article which was posted in codeproject...
"http://www.codeproject.com/KB/cs/webservicecache.aspx"
but this article explains to cache data locally..but i need o cache the data in the server...so that eventhough many users run the app the load will be less...
Please help me regarding the same..
|
|
|
|
|
try some other techniques
|
|
|
|
|
Subin Mavunkal wrote: try some other techniques
This is a really pointless answer and does nothing for CodeProject's reputation, and even less for yours.
The best things in life are not things.
|
|
|
|
|
pradeep455 wrote: but this article explains to cache data locally..but i need o cache the data in the server...so that eventhough many users run the app the load will be less...
That won't help much; database-servers are optimized to return data as fast as possible from their datastore. You'd still have the same amount of network-traffic, and the extra caching-application might consume CPU-time that the database-server wants, moving the delay from one application to another.
Caching on the client side will remove the need to transport the data over the network and moves some work from the server to the local machine. That's the way to go, unless you have a server that never runs into capacity-problems. A simple way to achieve this is to synchronize the database from the server with a local copy. I'd only sync the readonly data; lookuplists do better when local, especially if required often.
Or, if you have those in a real List , serialize them after retrieving them once, save it locally, and deserialize from the local path the next time your app starts.
Bastard Programmer from Hell
|
|
|
|
|
Let me get this right - you have a WinForms/WPF application that connects to a server to retrieve data and manipulate it. You want to retrieve information from the server and use it locally, but you think you will get better performance if you retrieve it from a cache at the server end. Have I understood your requirements properly?
What I am unclear about here, is whether the remote machine is merely a database server, or whether it has web services that serve up the data. The client side architecture is greatly affected by this fact.
If the remote PC is merely a database, then you should just retrieve the data and do any caching locally. It is possible that you are issuing slowdown problems because you are trying to run an enterprise database on a simple PC, and have other issues because of that design.
If the remote PC is a web service (whether or not served up by WCF), then it could make sense to cache the data at the server side.
Unfortunately, we cannot offer any more detailed help because you have not offered sufficient detail as to what your architecture actually is.
|
|
|
|
|
Yes the remote PC is a webservice(serve up the data) ,and the clients are consuming the webservice..
and as u said(caching on server) if this is the case please let me know how to cache on the server..(in webservice)
|
|
|
|
|
You have hosted this in a web server then? If so, you simply need to use a pattern like this:
private MyData GetData()
{
HttpCache myCache = HttpContext.Current.Cache;
MyData data = myCache["MyData"];
if (data == null) return GetDataAndStoreInCache();
return data;
}
private MyData GetAndStoreInCache()
{
MyData data = RetrieveDataHere();
HttpContext.Current.Cache.Insert("MyData", data, null, DateTime.Now.AddHours(6), TimeSpan.Zero);
return data;
}
|
|
|
|
|
Thanks for ur reply...
i need to use this code snippet in webservice code right...?
using HttpContext.Current.Cache instead of HttpRuntime.cache or Microsoft.ApplicationBlocks.cache is better?
Correct me if im wrong..pls let me know which is better to use..
-- Modified Thursday, May 26, 2011 2:08 AM
|
|
|
|
|
You would be OK using HttpRuntime.Cache. Basically, HttpContext.Current.Cache is a version of HttpRuntime.Cache. In fact, all that HttpContext.Current.Cache really does is pass the request onto HttpRuntime.Cache (the big difference being that HttpRuntime.Cache is available for all cases, so you can even use it in a console application if you want).
My sample wasn't meant to be used literally, rather it was to demonstrate some possible techniques. As it stands, it's not a totally robust situation as you could enter a situation where between the time of the lookup and the insert into the cache, another process inserts the data into the cache. If you code this robustly, you need to take this into account.
|
|
|
|
|
pradeep455 wrote: installed in many systems.
please define "many".
does the app run fine when there is only one or two clients active?
Luc Pattyn [My Articles] Nil Volentibus Arduum
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Please use <PRE> tags for code snippets, they improve readability. CP Vanity has been updated to V2.3
|
|
|
|
|
It depends on what the problem is. On a previous job, I had a number of clients (five or so, but could be more) that had to access the same data repeatedly (every minute or so) as they monitored the status of the running system. Because the data required a fair bit of calculation and aggregation I chose to have a Windows Service produce an XML file with the results that the clients could then download at their leisure.
The Service ran on a fifteen-second cycle and produced one of ten files (e.g. SystemStatus.0.xml -- SystemStatus.9.xml) and when it was done it wrote the name of the latest file to the database for the clients to read.
|
|
|
|
|
pradeep455 wrote: Please help me regarding the same..
First step is to actually determine what is causing the slow down.
Attempting to guess bottlenecks is unlikely to be successful.
Did you actually measure the time it took for various parts of your application and server?
|
|
|
|
|
I'm coding up a small script to list users' (all users in our group) permission on each TFS project. I relied on "GetEffectivePermissions" http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.versioncontrolserver.geteffectivepermissions(v=vs.90).aspx
However, after research a little I found out that this API can only be called with "userName" = $YOURSELF$
Any attempt to call "GetEffectivePermission" would result in
TF14014: Cannot query effective item or global permissions for other users.
Any suggestion on how to get around this??
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
<br />
using Microsoft.TeamFoundation;<br />
using Microsoft.TeamFoundation.Client;<br />
using Microsoft.TeamFoundation.VersionControl;<br />
using Microsoft.TeamFoundation.VersionControl.Common;<br />
using Microsoft.TeamFoundation.VersionControl.Client;<br />
<br />
namespace ManageTFS<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
<br />
string TFSConnString = "http://SomeSErver:8080/";<br />
IList<string> PermissionOwners = new List<string>();<br />
string UserName = null;<br />
string[] EffectivePermissions = null;<br />
IDictionary<string, IList<string>> PermissionsDict = new Dictionary<string, IList<string>>();<br />
<br />
try<br />
{<br />
TeamFoundationServer TfsInstance = new TeamFoundationServer(TFSConnString);<br />
Console.WriteLine("Connected to TFS " + TFSConnString);<br />
<br />
VersionControlServer vcs = (VersionControlServer)TfsInstance.GetService(typeof(VersionControlServer));<br />
Console.WriteLine("Connected to VersionControlServer");<br />
<br />
TeamProject[] Projects = vcs.GetAllTeamProjects(true);<br />
Console.WriteLine("Retrieved TFS projects from VersionControlServer");<br />
<br />
PermissionOwners.Add("john.doe");<br />
PermissionOwners.Add("bill.clinton");<br />
PermissionOwners.Add("me.me");<br />
foreach(string Owner in PermissionOwners)<br />
{<br />
foreach (TeamProject p in Projects)<br />
{ <br />
Console.WriteLine(p.ServerItem);<br />
EffectivePermissions = vcs.GetEffectivePermissions(Owner, p.ServerItem); (BLOWS UP HERE)<br />
<br />
PermissionsDict.Add(UserName, EffectivePermissions);<br />
}<br />
}<br />
}<br />
catch (Exception Ex)<br />
{<br />
Console.WriteLine(Ex);<br />
}<br />
<br />
return;<br />
}<br />
}<br />
}<br />
dev
|
|
|
|
|
I have a Microsoft Access 2007 database which stores all the necessary data for my application. The person who designed the database, my plant's manager, mentioned in the past (and is still considering) the ability to select multiple "repair codes" for each record. I know that with Access you can create a field which allows multiple values.
The table containing repair codes has the following fields:
ID (unique ID; auto-generated/incremented)
Code (e.g. "Replaced Front Panel")
Cost (currently uses a default value; not significant here)
In the "Repairs" table there is a field which is linked to the Repair Codes table, called "Repair Code." My manager would like the ability to select more than one code from the "Repair Codes" table, in the respective field inside the "Repairs" table.
How would I go about reading and writing multiple values for the field when dealing with records in the "Repairs" table?
I apologize if I did not elaborate well. :-P
Thanks,
Matt U.
------------- EDIT -------------
I forgot to mention that I have played around with the multiple values in Access itself. I know that when you select multiple values, the field's value will display (in Access) as "1, 3, 8" and so forth (or whichever column you tell it to show). Is there anything special I need to do in order to read each value? I can piece together how to ADD multiple values if I know how to SELECT them.
|
|
|
|
|
1. Not really a C# question.
2. This is a many-to-many join situation (N:N), so a bridge table would help...
In the example below, Mike's repair job (#1) included repair codes 1 and 2 (that association is saved in the REPAIR_TO_CODE table). Jane only involved repair code 2, and Bob only repair code 1.
Make sense..?
CODE
---------
ID Code Cost
1 Replaced something $1.00
2 Adjusted something $2.00
REPAIR
---------
ID Customer (Other Fields...)
1 Mike
2 Jane
3 Bob
REPAIR_TO_CODE
----------------
Repair_FK Code_FK
1 1
1 2
2 2
3 1
|
|
|
|
|
Thanks much for the informative reply. As I am quite new to SQL (aside from SELECT, INSERT, UPDATE and DELETE) I will look into this more. I recently started learning a lot about different SQL commands at W3C. JOIN statements are something I have been taking a lot of interest in so this may be a good time to learn hands-on.
Like I said, we are in no rush to use multiple values. It may very well never get to that point anyhow. But I would like to know where to start in case it comes down to it. And by the looks of it, I can almost guarantee my manager will NOT want to fool with it. He is not particularly fond of modifying things to this extent when it is not absolutely necessary. He just likes to daydream about it, haha.
Thanks again, Timothy.
|
|
|
|
|
Search for normalization, that will help you.
Alternatively you could choose a delimeter like a pipe ("|") and seperate the codes with the delimeter in the one field. (eg: code1|code7|code23) However, I would NOT recommend this, but it could be you encounter this device sooner or later. A bridge table is the way to go.
V.
|
|
|
|