|
please help me how to make a video themes in desktop ang how to connect the weather in vb.net thanks
|
|
|
|
|
Your question is a bit mashed up and unclear, but all I can establish is your trying to make a gadget to pull the weather from somewhere?
1) have you read the documentation? Developing a Gadget for Windows Sidebar Part 1: The Basics[^]
2) I have made a CodeProject gadget, Windows 7 Sidebar Gadget - CodeProject Reputation Watcher[^], you might want to look at how I have done that.
3) Gadgets are zip files, you could always take a peek inside the current windows weather gadget and see how they have built it. Have a look in the Program Files | Windows Sidebar | Gadgets folder, and then look at the internals of the Weather.Gadget
|
|
|
|
|
i
t not the project i am taking about
i need to improve the gadgets.. it like a video desktop if the weather is sunny day the desktop will play a video for sunny day...that why i need to connect my vb.net to internet...
thank you so much
|
|
|
|
|
hi guyz im trying to work with code searching using textbox and listview in vb.net as what i did in vb6
example: here's my data in listview
Apple
Orange
Grapes
in vb6, when im going to put something in textbox like "a" automatically the apple will be selected and highlighted and still my cursor is still in my textbox or lets just say, the focus is still in textbox
unlike in vb.net, here's my code:
Dim foundItem As ListViewItem = _
lvUser.FindItemWithText(searchBox.Text, True, 0, True)
If (foundItem IsNot Nothing) Then
lvUser.TopItem = foundItem
Else
MsgBox("No Record Found!")
End If
when im going to type like "a", nothings happen. it will not highlight the row as what ive expected. when im going to put like lvUser.Items(0).Selected = True, yes it will but the problem is the focus will be in the listview.. do you have any idea? thanks and God bless
|
|
|
|
|
You're assuming that the FindItemWithText method will show the item found. It doesn't. All it does is what it's name suggests, find and item and return it to your code, which BTW, your ignoring the returned item!
If you want to see that item in the ListView, you have to pass the returned item to the ListView EnsureVisible method.
|
|
|
|
|
I was looking at sorting some strings today and noticed that the default comparer orders them wrong -- it sorts "a" before "A", rather than after it, for instance.
So I looked into it and read up a bit and tried the InvariantCulture and the Ordinal comparer -- Ordinal works correctly, and I'll likely use it, but I'm not happy about it.
According to http://msdn.microsoft.com/en-us/library/dd465121.aspx[^]:
"Comparisons that use StringComparison.InvariantCulture and StringComparison.Ordinal work identically on ASCII strings."
Which is not strictly true -- they order these differently.
Does anyone here know how to make a Culture (based on en-US) that does a case-sensitive sort the right way?
Edit: This is interesting... I was experimenting with the System.StringComparer.CurrentCultureIgnoreCase and discovered that it seems to do what I want -- at least in the tests I've made. Which is good.
But that means that it doesn't actually ignore the case!
Scratch that -- it's just an artifact of how I was testing it.
modified on Friday, August 19, 2011 2:13 PM
|
|
|
|
|
One way is to put each characters into an array and the sort the array.
Second option is: convert each chars of string to ASCII value. Sort the value and then reconvert it to chars. Finally, merge the chars. You will get the sorted string.
|
|
|
|
|
That's equivalent to what the Ordinal comparer does. And I'm not sorting a string, I'm sorting a collection of strings.
|
|
|
|
|
Ordinal does an ASCII compare.
PIEBALDconsult wrote: I'll likely use it, but I'm not happy about it
Not happy about what?
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
About having to use the Ordinal comparer to get the correct (desired) case-sensitive sort order.
I should be able to use a "linguistic" (I think that's the term the documentation used) Culture that produces the same sort order of ASCII data.
And if I can create a Culture that does that and set it as my CurrentCulture, so much the better.
|
|
|
|
|
PIEBALDconsult wrote: I should be able to use a "linguistic" (I think that's the term the documentation used) Culture that produces the same sort order of ASCII data.
Different languages treat upper and lower case differently. While English considers a lowercase 'a' to be semantically "less than" the uppercase 'A', it may not be the same with other languages. I think that's why the designers of .NET chose to give us the language-neutral Ordinal option.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Shameel wrote: English considers a lowercase 'a' to be semantically "less than" the uppercase 'A',
Got a reference for that? I think the opposite is true.
|
|
|
|
|
PIEBALDconsult wrote: Got a reference for that?
I don't have a reference, but working with customers, they like to see 'A' on top of lists and 'a' below that.
PIEBALDconsult wrote: I think the opposite is true.
The opposite is true in case of ASCII.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Shameel wrote: they like to see 'A' on top of lists and 'a' below that.
Exactly. That's how I want it, and the Ordinal comparer does it, but the InvariantCulture (and en-US) does it the other way.
Edit: Well not exactly, come to think of it, because the Ordinal comparer also say "Z" < "a", which I don't want.
modified on Friday, August 19, 2011 12:15 PM
|
|
|
|
|
PIEBALDconsult wrote: Exactly. That's how I want it, and the Ordinal comparer does it
The Ordinal comparer uses the ASCII order of the characters.
Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct Hex
-------------------------------------------------------------------------------------
(nul) 0 0000 0x00 | (sp) 32 0040 0x20 | @ 64 0100 0x40 | ` 96 0140 0x60
(soh) 1 0001 0x01 | ! 33 0041 0x21 | A 65 0101 0x41 | a 97 0141 0x61
(stx) 2 0002 0x02 | " 34 0042 0x22 | B 66 0102 0x42 | b 98 0142 0x62
(etx) 3 0003 0x03 | # 35 0043 0x23 | C 67 0103 0x43 | c 99 0143 0x63
(eot) 4 0004 0x04 | $ 36 0044 0x24 | D 68 0104 0x44 | d 100 0144 0x64
(enq) 5 0005 0x05 | % 37 0045 0x25 | E 69 0105 0x45 | e 101 0145 0x65
(ack) 6 0006 0x06 | & 38 0046 0x26 | F 70 0106 0x46 | f 102 0146 0x66
(bel) 7 0007 0x07 | ' 39 0047 0x27 | G 71 0107 0x47 | g 103 0147 0x67
(bs) 8 0010 0x08 | ( 40 0050 0x28 | H 72 0110 0x48 | h 104 0150 0x68
(ht) 9 0011 0x09 | ) 41 0051 0x29 | I 73 0111 0x49 | i 105 0151 0x69
(nl) 10 0012 0x0a | * 42 0052 0x2a | J 74 0112 0x4a | j 106 0152 0x6a
(vt) 11 0013 0x0b | + 43 0053 0x2b | K 75 0113 0x4b | k 107 0153 0x6b
(np) 12 0014 0x0c | , 44 0054 0x2c | L 76 0114 0x4c | l 108 0154 0x6c
(cr) 13 0015 0x0d | - 45 0055 0x2d | M 77 0115 0x4d | m 109 0155 0x6d
(so) 14 0016 0x0e | . 46 0056 0x2e | N 78 0116 0x4e | n 110 0156 0x6e
(si) 15 0017 0x0f | / 47 0057 0x2f | O 79 0117 0x4f | o 111 0157 0x6f
(dle) 16 0020 0x10 | 0 48 0060 0x30 | P 80 0120 0x50 | p 112 0160 0x70
(dc1) 17 0021 0x11 | 1 49 0061 0x31 | Q 81 0121 0x51 | q 113 0161 0x71
(dc2) 18 0022 0x12 | 2 50 0062 0x32 | R 82 0122 0x52 | r 114 0162 0x72
(dc3) 19 0023 0x13 | 3 51 0063 0x33 | S 83 0123 0x53 | s 115 0163 0x73
(dc4) 20 0024 0x14 | 4 52 0064 0x34 | T 84 0124 0x54 | t 116 0164 0x74
(nak) 21 0025 0x15 | 5 53 0065 0x35 | U 85 0125 0x55 | u 117 0165 0x75
(syn) 22 0026 0x16 | 6 54 0066 0x36 | V 86 0126 0x56 | v 118 0166 0x76
(etb) 23 0027 0x17 | 7 55 0067 0x37 | W 87 0127 0x57 | w 119 0167 0x77
(can) 24 0030 0x18 | 8 56 0070 0x38 | X 88 0130 0x58 | x 120 0170 0x78
(em) 25 0031 0x19 | 9 57 0071 0x39 | Y 89 0131 0x59 | y 121 0171 0x79
(sub) 26 0032 0x1a | : 58 0072 0x3a | Z 90 0132 0x5a | z 122 0172 0x7a
(esc) 27 0033 0x1b | ; 59 0073 0x3b | [ 91 0133 0x5b | { 123 0173 0x7b
(fs) 28 0034 0x1c | < 60 0074 0x3c | \ 92 0134 0x5c | | 124 0174 0x7c
(gs) 29 0035 0x1d | = 61 0075 0x3d | ] 93 0135 0x5d | } 125 0175 0x7d
(rs) 30 0036 0x1e | > 62 0076 0x3e | ^ 94 0136 0x5e | ~ 126 0176 0x7e
(us) 31 0037 0x1f | ? 63 0077 0x3f | _ 95 0137 0x5f | (del) 127 0177 0x7f
As you can see from the table, 'Z' (90) is "less than" 'a' (97).
EDIT: Well, the Ordinal comparer uses Unicode ordering which is the same as ASCII for the first 127 characters.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Yes, I know that, but I don't know who gave you the 1, take a 5 for your efforts.
|
|
|
|
|
PIEBALDconsult wrote: I don't know who gave you the 1
I get downvoted all the time and the people who do it do not have the courage to own up and explain it.
PIEBALDconsult wrote: take a 5 for your efforts
Thanks
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
What I came up with as a simple interim solution is this:
private sealed class MyComparer : System.Collections.Generic.IComparer<string>
{
public int
Compare
(
string Op0
,
string Op1
)
{
int result = System.StringComparer.InvariantCultureIgnoreCase.Compare ( Op0 , Op1 ) ;
if ( result == 0 )
{
result = System.StringComparer.InvariantCulture.Compare ( Op0 , Op1 ) * -1 ;
}
return ( result ) ;
}
}
|
|
|
|
|
<?xml version="1.0" encoding="utf-8"?>
<LicenceManager xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://visionontech.com/vbp/LicenceConfiguration">
<ApplicationName>ovE1c/0l6IoKP/KF6bpqv22zqoYuT3Wv</ApplicationName>
<LicenseType>7Ax330npgHE=</LicenseType>
<VersionType>bbUl/DISjDzJkqERNmGqY8eWlTKz+Er3qSWdcEGFDUdsWo9DJrviULY/entknwWw2Z67rm0RnqeB3ENiAa1blfEkGPtfeELVxVG44JG4J5w=</VersionType>
<CompanyName>KWZwGJLdl+pI240K/PURWg==</CompanyName>
<SerialNumber>7515b594-6afb-4f0f-bf4c-13351339191c</SerialNumber>
<MachineID>I50NMYu1RZix+7AuMOhIDyhyFkiepjdK1Sy93luDdi4nCxRLW+Yy259FgXAvKvX9</MachineID>
<Signature>9XvKvAXgF952yY+WLRxCn4idDul39yS1KdjpeikFyhyDIhOMuA7+xiZR1uYMN05I</Signature>
<City>Q6H8NNOnO80=</City>
<CreatedBy>TZdhgIlUIBo2BIm8yvL3ww==</CreatedBy>
<LicenseCreationDate>1xtf7PZmvZQ5e+ohObsHFHokaELQyvIq</LicenseCreationDate>
</LicenceManager>
my laptop licence is
i m using other computer d'not work plz help me brack my code
|
|
|
|
|
Hi,
I have WindowsForms application where I should execute method n-times in a second. The method should be executed inside of its own separate thread. I use thread pool for that purpose.
UI contains text box where I enter the number of times of execution and button, which I click to start processing.
I've tried to use System.Windows.Forms.Timer but it works for smaller number of executions (~ up to 100). It works means for example 50 calls can be done in 1 second. When the number of calls is growing they can't be executed in 1 second. They need more and more time.
The code looks as follows:
private int count = 0;
private int tps;
public Form1()
{
InitializeComponent();
ThreadPool.SetMaxThreads(500, 500);
}
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
timer1.Enabled = true;
tps = Int32.Parse(textBox1.Text);
timer1.Interval = 1000 / tps;
timer1.Start();
label1.Text = "Start time: " + DateTime.Now.ToString("hh:mm:ss.fff");
label2.Text = "End time: ";
}
private void timer1_Tick(object sender, EventArgs e)
{
ThreadPool.QueueUserWorkItem(new WaitCallback(DoWork));
}
private void DoWork(object stateInfo)
{
count++;
listBox1.Items.Add(count);
if (count == tps)
{
count = 0;
timer1.Stop();
label2.Text = label2.Text + " " + DateTime.Now.ToString("hh:mm:ss.fff");
timer1.Enabled = false;
}
label3.Text = listBox1.Items.Count.ToString();
}
Do you have an idea how I can resolve this issue?
Thank you in advance.
Regards,
Goran
|
|
|
|
|
Try System.Timers.Timer[^] which is more accurate than its forms counterpart.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Thanks for your answer.
I've tried to use System.Timers.Timer and the results a bit better. But, there's one thing I've noticed. Sometimes, the number of items I've added to listbox is greater than number I've entered to text box. For example, when I enter 11 to text box, the number of items in list box is 12. The order is as follows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 1. I don't understand why 1 again?
|
|
|
|
|
The bad news is that you can't resolve this issue. If you think about it for a little bit, you'll see why. Here's a hint - you need to execute a task several number of times a second and those tasks take a finite amount of time; creating the threads (or switching to them in a threadpool) also takes a period of time - even if you are running on a multi-core machine, there are only a set number of tasks that can be spawned and run in that period of time.
By the way, you have a marshalling issue in your code (you may be suppressing it, but it still takes time). Basically, you are interacting with a UI component from a none-UI thread. WinForms is STA, so you should be marshalling the calls back to the UI thread.
|
|
|
|
|
Thanks for the answer.
Yes. I supposed this couldn't be resolved to be absolutely accurate. But what to do? I need to write the application that should load test WCF RIA service and the results should be confidential.
|
|
|
|
|
If you are load testing an application, you need to take a different approach. You should be attempting to target it from multiple machines.
|
|
|
|