|
Just use a borderless form.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - coming soon ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
OK... but how do i find out, WHERE the Window should have its location?
And... "close" the form... how works that? Because, if it's a DialogForm i can't close it by clicking somewhere else!
modified on Tuesday, October 14, 2008 8:38 AM
|
|
|
|
|
I am not getting right direction to add plugin for IE in C#.
In my project I added BHO .But I want to add it as a browser Extension.
If anyone knows how to do it.so help me out.
Will be very much thankfull to all....
email:bishu_473@yahoo.co.in
regards
bishwajeet
|
|
|
|
|
I have a problem when I want call funtion in gridview by using templatefield.
The scenario is like this :
I want to call function : % of Compliance = getComplaince(field1,field2) in gridview. For your information field1 and field2 to in this gridview was set visible=false.
For example field1 = 1, field2 =1
The code is like below :
Field 1 Field 2 Application Definition % of Compliance
1 1 SMP Sistem Maklumbalas getCompliance(1,1)
2 1 E-App E-Application getComplaince(2,1)
getCompliance Function
1 public string getCompliance(int applicationID, int serviceID)
2 {
3 serviceCalculation c = new serviceCalculation();
4 string itemAB = c.getItemAB(serviceID, applicationID, lblError);
5 string[] splitItem = itemAB.Split(',');
6 string comply = c.countCompliant(splitItem[0].ToString(), splitItem[1].ToString());
7 return comply + "%";
8 }
getItemAB Function
1 public string getItemAB(int service, int applicationID, Label lblError)
2 {
3 database d = new database("S15TeRS");
4 int valueA = 0;
5 int valueB = 0;
6 double percentage = 0.0;
7 int counter = 0;
8 string query = "SELECT ss.ValueA,ss.ValueB,ss.Percentage FROM StateService ss" +
9 " INNER JOIN papv2.dbo.tblState s ON s.stateID = ss.stateID" +
10 " WHERE" +
11 " ss.ApplicationID='" + applicationID + "' AND ss.Service ='" + service + "'" +
12 " UNION" +
13 " SELECT ks.ValueA, ks.ValueB, ks.Percentage FROM KawasanService ks" +
14 " INNER JOIN papv2.dbo.tblKawasan k ON k.kawasanID = ks.kawasanID" +
15 " WHERE ks.ApplicationID='"+ applicationID +"' AND ks.Service='"+ service +"'" +
16 " UNION" +
17 " SELECT cs.ValueA, cs.ValueB, cs.Percentage FROM CawanganService cs" +
18 " INNER JOIN papv2.dbo.tblCawangan c ON c.cawanganID = cs.cawanganID" +
19 " INNER JOIN papv2.dbo.tblKawasan k ON k.kawasanID = c.cawanganID" +
20 " WHERE cs.ApplicationID='"+ applicationID +"' AND cs.Service='"+ service +"'";
21
22 try
23 {
24 d.Query = query;
25 d.InitDataReader();
26 while (d.findMoreRows())
27 {
28 counter++;
29 valueA += Int32.Parse(d.returnRow("ValueA"));
30 valueB += Int32.Parse(d.returnRow("ValueB"));
31 percentage += double.Parse(d.returnRow("Percentage"));
32 }
33 return valueA + "," + valueB;
34 }
35 catch (Exception ex)
36 {
37 lblError.Text = ex.Message.ToString();
38 return "";
39 }
40 }
41
countComplaint Function
1 public string countCompliant(string x, string y)
2 {
3 if (!(x.Trim().Equals("")) && !(y.Trim().Equals("")))
4 {
5 double a = double.Parse(x);
6 double b = double.Parse(y);
7 double compliant = b / a * 100;
8 double roundComplaint = Math.Round(compliant, 2);
9 return roundComplaint.ToString();
10 }
11 else
12 return "";
13 }
|
|
|
|
|
Hi
I am trying to set two different background images to two different resolution monitors.
I know that i can use somthing like
<br />
const int SPI_SETDESKWALLPAPER = 20 ;<br />
const int SPIF_UPDATEINIFILE = 0x01;<br />
const int SPIF_SENDWININICHANGE = 0x02;<br />
<br />
[DllImport("user32.dll", CharSet=CharSet.Auto)]<br />
static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni) ;<br />
<br />
<br />
and so on to get and set the wallpaper for a single monitor, but i am not sure how to expand this to work with 2 or more monitors.
I have had a look at the Screens.AllScreens class, but that seems more about the resolution and so on.
Anyone have any thoughts on how to do this?
|
|
|
|
|
Does windows even support this ??
ASCII tables, HTML entities, types, string formats and more info for the serious coder at: www.codecharts.com
|
|
|
|
|
I think theres a program called ultramon that can do it, and my nvidia graphics driver software can assign a diffferent image to each monitor.
Im very sure its possible.
|
|
|
|
|
yeah. Makes sense that is is driver-dependent. I cant do it on my Matrox G550.
ASCII tables, HTML entities, types, string formats and more info for the serious coder at: www.codecharts.com
|
|
|
|
|
I have been working on a notepad program that has sorting functions, I am having problems sorting large files, I have been getting outofmemoryexceptions, my test machines have had overkill amounts of memory, so that's not the issue. I have made sure to null and dispose my variables and objects, using "USING" code blocks as frequently as possible. I can't seem to solve this problem. I believe that an external sorting algorithm would be the only possible solution. But I can't find anything on it. I have read an outline of a the idea. but I just can't figure out how to implement one. I have scoured google, yahoo, ask, and dogpile for hours. there just doesn't seem to be any examples of a external merge sort anywhere. There is plenty of proof it exists, collage syllabuses with external merge sort in title, a wikki page describing its usage, I just can't find any C# help about.
if anyone could help me with an example, or a code snippet, or just a more in depth explanation that i might grow on.
I am at a loss,
Thanks,
DiamondDrake
|
|
|
|
|
External sorting is just a term to mean a sort algorithm that can sort a large load of data without requiring it to all be loaded into memory at the same time.
The simplest example is the external merge sort. You just divide the data into equal sized blocks that you can handle. Sort each block and write it back to disk. Then load the first few values of each block into input buffers, and merge them into an output buffer. When the output buffer fills, write it to disk and clear it. If an input buffer empties, load some extra values from it's associated block.
This wikipedia article has a step by step process, and a few useful links. http://en.wikipedia.org/wiki/External_sort[^]
Before you consider this though, make sure you really need it. If you are sorting hundreds and hundreds of megabytes of data, then yes you need to do something like this. How big is the data file you are sorting? If it can sensibly be held in ram in one go, then you probably don't need to do external sorting.
Simon
|
|
|
|
|
I appreciate the reply, and I am sorting text files that could possibly contain up to 4 million lines, I have written a method to sort lines of text by a column, or columns selected on the first line. this requires creating several copies of this 4 million line doc in memory. and leads to an out of memory exception, my method works perfect with 500 thousand lines or less, my test doc is 1 million lines, and it runs out of memory.
I get the idea, and i have read that wiki page already. I get the idea. I just don't understand how you can sort in chunks, I understand how to separated the document into parts, and sort each of those, then loading segments of each part and sorting those together and appending them to a file. but that doesn't actually sort all the data does it?
it doesn't seem right.
or at least I can't seem to get it to work right.
|
|
|
|
|
Easiest thing is probably an example.
Take the numbers 0 to 9.
1 7 3 5 2 9 8 4 6 0
Lets assume you can only load 5 at a time into memory.
Load the first block of 5.
1 7 3 5 2 - Lets call this block A.
Now sort block A, using what ever method you want.
1 2 3 5 7.
Now save block A to disk.
Now load the next block.
9 8 4 6 0 - Lets call this block B.
Sort block B.
0 4 6 8 9.
Now save block B to disk.
A - 1 2 3 5 7
B - 0 4 6 8 9
Now you create an input buffer for each block, and 1 output buffer
In this case, we've already said we can manage 5 in memory at a time, so lets make our input buffers 1 item big, and our output buffer 3 items big.
Load the first items from blocks A & B into the input buffers.
InA: 1
InB: 0
Out: Nothing yet.
Now you take the lowest of all the input buffers. In this case buffer B. Move it to the output buffer.
InA: 1
InB: Empty
Out: 0
As buffer B is now empty, you load the next item from B into the buffer. (In this case 4)
InA: 1
InB: 4
Out: 0
Now you just repeat the process. So you move the lowest value to the output buffer.
InA: Empty
InB: 4
Out: 0 1
Then load the next item from A into the empty input buffer.
InA: 2
InB: 4
Out: 0 1
Then move the lowest to the output buffer
InA: Empty
InB: 4
Out: 0 1 2
Now the output buffer is full (remember we said the output buffer was 3 big). So you write the output buffer to disk.
InA: Empty
InB: 4
Out: Empty
Final sorted on disk: 0 1 2
Now you need to load the next value from block A (because InA has become empty)
InA: 3
InB: 4
Out: Empty
Then move the lowest to the output buffer
InA: Empty
InB: 4
Out: 3
Then load the next for any empty input buffers
InA: 5
InB: 4
Out: 3
Move lowest to the output buffer
InA: 5
InB: Empty
Out: 3 4
Load for any empty input buffers
InA: 5
InB: 6
Out: 3 4
Is it starting to be clear now?
1st, Divide into manageable blocks.
Sort each block and write back to disk.
Load the first bit of each block into an input buffer.
Process the input buffers, and move the lowest value into the output buffer.
Every time an input buffer runs empty, you load the next few data items from the associated block.
Every time the output buffer fills up, you write it to disk, and append it to the data already there.
Obviously, this is a simple example. You wouldn't really do this with a list of 10 numbers. And your block sizes and buffers would be much bigger.
Essentially, it's just a merge sort, but your not keeping each block in memory.
Good luck
Simon
|
|
|
|
|
Thanks, It makes perfect sense now. I appreciate it endlessly.
DiamondDrake
|
|
|
|
|
|
how can i use that treeview in crystal report viewer? it´s always blank.
At least in the sample codes i download!!!
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
I have a database that has many types of variables; varchar, int, date, image.
I connect it to my c# application, even builted a fine dataset to fit my report.
OK, all data is present in my report, but the images aren´t there!!!
The IBLOBfieldObject suitable for pictures is always blank.
In dataset the image is a byte[], right? YES
I even trigger the same procedure in a datagridview and the pictures appear there!!!
I dont have a clue
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
You do not have the correct format recorded images in a database
You can use this code
private void Button3_Click(object sender, System.EventArgs e)
{
Stream imgStream = UploadFile.PostedFile.InputStream;
int imgLen = UploadFile.PostedFile.ContentLength;
string imgContentType = UploadFile.PostedFile.ContentType;
byte[] imgBinaryData = new byte[imgLen];
int n = imgStream.Read(imgBinaryData,0,imgLen);
String idis = Request.QueryString["id"];
int busid = System.Convert.ToInt32(idis);
int RowsAffected = SaveToDB( imgBinaryData,imgContentType, busid);
}
private int SaveToDB(byte[] imgbin, string imgcontenttype, int busid)
{
SqlConnection sqlConnection1 = new SqlConnection(ConfigurationSettings.AppSettings["povezava"]);
if (sqlConnection1.State==ConnectionState.Closed)
{
sqlConnection1.Open();
}
SqlCommand command = new SqlCommand( "update posta1 set signature = @imgData " +
" where id = @ID", sqlConnection1 );
SqlParameter param1 = new SqlParameter( "@imgData", SqlDbType.Image );
param1.Value = imgbin;
command.Parameters.Add( param1 );
SqlParameter param4 = new SqlParameter( "@ID", SqlDbType.VarChar,10);
param4.Value = dfPosta.Text;
command.Parameters.Add( param4 );
int numRowsAffected = command.ExecuteNonQuery();
sqlConnection1.Close();
return numRowsAffected;
}
|
|
|
|
|
Hi Ted,
thanks a lot for the post, iam going to check it out.
I really dont get many post/anwsers on crystal reports
again thanks
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hi, ted
you are missing assembles, and by the way i already have a routine to read image (byte []), not the question here.
I was asking about loading the pictures in crystal report, it seems everthing is ok but i didn´t know that CR doesn´t load all image types.
I know you are only trying to help
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Hy
I think CR only .gif format can't load
|
|
|
|
|
Hi all,
ı wanna learn that how can i write as html on a word document. When i send the string with .typetext(); it writes it as a string. How can i do that ??
thx...
thanks for everything i have...
|
|
|
|
|
TALHAKOSEN wrote: ı wanna learn How can i do that ??
Less typing, more reading. Let us know if that helps.
led mike
|
|
|
|
|
In order to write *anything* on a word document, you have to make sure you lay it on a flat surface, and smooth it out completely (wrinkles in the document tend to distort newly added text). Then - and only then - can you write on the document. After you're done writing on the document, make sure you spray some sort of fixative over the text so it doesn't run when you spill fluids on the document.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Alternatively, he can always use some form of whiteout on the screen whenever he makes a mistake.
|
|
|
|
|
Pete O'Hanlon wrote: use some form of whiteout on the screen whenever he makes a mistake
Ah, yes, that's always the classic solution
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|