Let's consider a WPF client-server application.
What is the best practice to create the client, so that every time it is launched, it checks for updates and if any available, update the client application?
Hi,
As in the question. Do you know any good (it would be nice if free) WYSIWYG html editor for WinForms (C#)? There is only one requirement: it has to be manage code only (by this I mean, it can't use mshtml COM object (WebBrowser control)).
I've found this: http://www.modeltext.com/html/ but there is no download/buy option.
I will be really thankful for any answer
I realize that it's generally not a good idea to do this but the reason why I want to is because it's a really heavy page and I want to show the user progress of the download and when it's done load the page. I can either do this with some kind of spinner but is it possible for me to show the actual progress? Can I see how much and what data has been downloaded? Let's say I use jQuery for the AJAX-request how do I do this? If you have other suggestions please feel free to suggest.
I have an advanced function in PowerShell, which roughly looks like this:
function Foo {
[CmdletBinding]
param (
[int] $a = 42,
[int] $b
)
}
The idea is that it can be run with either two, one or no arguments. However, the first argument to become optional is the first one. So the following scenarios are possible to run the function:
Foo a b # the normal case, both a and b are defined
Foo b # a is omitted
Foo # both a and b are omitted
However, normally PowerShell tries to fit the single argument into a. So I thought about specifying the argument positions explicitly, where a would have position 0 and b position 1. However, to allow for only b specified I tried putting a into a parameter set. But then b would need a different position depending on the currently-used parameter set.
Any ideas how to solve this properly? I'd like to retain the parameter names (which aren't a and b actually), so using $args is probably a last resort. I probably could define two parameter sets, one with two mandatory parameters and one with a single optional one, but I guess the parameter names have to be different in that case, then, right?
Hi, so the question ist pretty much the title. I have a 3d volume loaded as raw data
[256, 256, 256] = size(A). It contains only values of zero's and ones, where the 1's represent the structure and 0's the "air". I want to visualize the structure in matlab and then run an algorithm on it and put an overlay on it, let's say in the color red.
So to be more precise:
How do i visualize the 3d volume. 0's transparent, 1's semitransparent?
Plot a line in the 3 d vis as an overlay?
I already read the mathworks tutorials and they didn't help.
I tried using the set command, but it fails completly saying for every property i try "invalid root property".
I hope someone can help.
In a simple CakePHP model where User hasMany Item (and Item belongsTo User)-
Suppose 50 users, have each 10 items.
How can I find() only 5 users, each with the latest 5 items he has?
When I impose a limit in the find, it only limits the number of users, not the number of associated Items.
Thanks!
i'd like to record sounds played by tapping with a two dimensional array using the time and the sound id.
is there any code example anywhere?
thanx blacksheep
Hi guys.
I made a website using AJAX (with jquery) for the navigation.
The pages of the site are sliding and I use remove() to destroy the old page.
Every thing seems alright, but some times the browser crashes when he tries to remove the old page containing a Flash object.
I suppose this is because Flash is still executing the Flash object.
My question is simple.
How do i remove this Flash's object for my page without having the browser crashing on my face ?
Is there a way to stop the Flash execution before removing the object ?
Thanks for your help.
I plan to port some camera and multimedia algorithms and functionality on a Qualcomm Snapdragon platform running Android. I need OpenGL ES 2.0 acceleration for many algorithms.
Which platform is the right one? Also, where can I purchase this? The Android dev platform on Google's website supports on OpenGL ES 1.x
Thanks for any input.
Hi all,
we have a project written in Delphi that we want to convert to C#. Problem is that we have some passwords and settings that are encrypted and written into the registry. When we need a specified password we get it from the registry and decrypt it so we can use it. For the conversion into C# we have to do it the same way so that the application can also be used by users that have the old version and want to upgrade it.
Here is the code we use to encrypt/decrypt strings in Delphi:
unit uCrypt;
interface
function EncryptString(strPlaintext, strPassword : String) : String;
function DecryptString(strEncryptedText, strPassword : String) : String;
implementation
uses
DCPcrypt2, DCPblockciphers, DCPdes, DCPmd5;
const
CRYPT_KEY = '1q2w3e4r5t6z7u8';
function EncryptString(strPlaintext) : String;
var
cipher : TDCP_3des;
strEncryptedText : String;
begin
if strPlaintext <> '' then
begin
try
cipher := TDCP_3des.Create(nil);
try
cipher.InitStr(CRYPT_KEY, TDCP_md5);
strEncryptedText := cipher.EncryptString(strPlaintext);
finally
cipher.Free;
end;
except
strEncryptedText := '';
end;
end;
Result := strEncryptedText;
end;
function DecryptString(strEncryptedText) : String;
var
cipher : TDCP_3des;
strDecryptedText : String;
begin
if strEncryptedText <> '' then
begin
try
cipher := TDCP_3des.Create(nil);
try
cipher.InitStr(CRYPT_KEY, TDCP_md5);
strDecryptedText := cipher.DecryptString(strEncryptedText);
finally
cipher.Free;
end;
except
strDecryptedText := '';
end;
end;
Result := strDecryptedText;
end;
end.
So for example when we want to encrypt the string asdf1234 we get the result WcOb/iKo4g8=.
We now want to decrypt that string in C#. Here is what we tried to do:
public static void Main(string[] args)
{
string Encrypted = "WcOb/iKo4g8=";
string Password = "1q2w3e4r5t6z7u8";
string DecryptedString = DecryptString(Encrypted, Password);
}
public static string DecryptString(string Message, string Passphrase)
{
byte[] Results;
System.Text.UTF8Encoding UTF8 = new System.Text.UTF8Encoding();
// Step 1. We hash the passphrase using MD5
// We use the MD5 hash generator as the result is a 128 bit byte array
// which is a valid length for the TripleDES encoder we use below
MD5CryptoServiceProvider HashProvider = new MD5CryptoServiceProvider();
byte[] TDESKey = HashProvider.ComputeHash(UTF8.GetBytes(Passphrase));
// Step 2. Create a new TripleDESCryptoServiceProvider object
TripleDESCryptoServiceProvider TDESAlgorithm = new TripleDESCryptoServiceProvider();
// Step 3. Setup the decoder
TDESAlgorithm.Key = TDESKey;
TDESAlgorithm.Mode = CipherMode.ECB;
TDESAlgorithm.Padding = PaddingMode.None;
// Step 4. Convert the input string to a byte[]
byte[] DataToDecrypt = Convert.FromBase64String(Message);
// Step 5. Attempt to decrypt the string
try
{
ICryptoTransform Decryptor = TDESAlgorithm.CreateDecryptor();
Results = Decryptor.TransformFinalBlock(DataToDecrypt, 0, DataToDecrypt.Length);
}
finally
{
// Clear the TripleDes and Hashprovider services of any sensitive information
TDESAlgorithm.Clear();
HashProvider.Clear();
}
// Step 6. Return the decrypted string in UTF8 format
return UTF8.GetString(Results);
}
Well the result differs from the expected result. After we call DecryptString() we expect to get asdf1234but we get something else.
Does anyone have an idea of how to decrypt that correctly?
Thanks in advance
Simon
I get the following HTTP response headers in a particular response. All looks okay. However I have noticed that the content-length appears twice...
Content-Length: 2424
ntCoent-Length: 2424
Is there a particular reason why the content-length is returned a second time as ntCoent-Length?
HTTP/1.0 200 OK
Date: Wed, 26 May 2010 09:38:19 GMT
Server: Apache
P3P: CP="NOI DSP COR CURa ADMa TA1a OUR BUS IND UNI COM NAV INT"
Accept-Charset: iso-8859-1, unicode-1-1;q=0.8
Expires: Sun, 15 Jul 1990 00:00:00 GMT
Pragma: no-cache
Cache-Control: no-cache
Content-Language: en
ntCoent-Length: 2424
Connection: close
Content-Type: text/html;charset=iso-8859-1
Content-Length: 2424
I'm trying to make a radio group specifying a bunch of options, and an extra option "other" with a text input to specify. The code for this particular radio button I'm using is
<input type='radio' name='RadioInput' value='Other' id='RadioInput_Other' />
<label for='RadioInput_Other'>Ohter:
<input type='text' name='RadioInput_Other_Value' id='RadioInput_Other_Value' value='' />
</label>
The idea is that if you give focus to the text input, the radio button corresponding to it is selected. The code above almost does this (since the text input is inside the label). However, it also shifts focus to the radio button (which is annoying, since whatever you type next is lost).
Is there any way to prevent this using XHTML1.0 / CSS2? Preferably without using javascript.
I investigated a couple of tools but they were really annoying and not polished. kSar for exampe is supposed to graph sar output, but it doesn't work. There's a perl script around (sar2rrd) that's supposed to convert sar output in rrd format and generate graphs. Doesn't work. (at least it doesn't like the output of "atsar" as per debian/ubuntu package). Tried munin but it wants to mess with http servers, and for some reason it didn't really work, too. It displayed errors in the webpage generated by the http server it put on port 4949.
So, is there a simple install and forget tool to generate daily load,cpu,memory,network graphs? It seems strange to me that this problem has not been solved, maybe I'm looking in the wrong places
Hi,
I have a standard Postfix/Cyrus setup with email account like [email protected]. Users authenticate via IMAP. I want to create an email alias account like [email protected] and authenticate it to the same IMAP mailbox as [email protected].
Can I do this via Postfix aliases? What are the possibilities here.
Regards,
Angel
Where could I get best step by step instructions (with some simple explanations) how to setup domain controller on Windows Server 2008 R2 Server Core?
I don't know what do I need? Do I need DNS as well and AD and so on and so forth. I don't know enough about these things, but I need to set them up to prepare development environment. I would also like to know how to configure firewall on DC machine, to make it visible on other machines because I've setup DC somehow but I can't connect to it...
This is my HW config:
Linksys internet router with DHCP
my dev machine is Windows 7
my DC machine is a VM in my dev machine
my dev machine has a network adapter to linksys and a virtual adapter to DC
DC machine has two network adapters: one to linksys (to be inetrnet connected) and one to host (my dev Win7 machine)
I am changing the password of a truecrypt file container. This takes around 1 minute. Why?
time truecrypt --text --change /tmp/user1.tc --keyfiles= --new-keyfiles= --password=known --new-password=known --random-source=/dev/null"
If I use strace I see that it basically does not do anything: it simply reads lots of random data from /dev/urandom (even if i specified /dev/null as random source) and finally changes the password:
open("/dev/urandom", O_RDONLY) = 6
read(6, "\36&{\351\212\212\343\202\34\313\242\312I\326\235\245\224\300\354O)\270Q\200 \201J\227\224\311_\212\367"..., 640) = 640
close(6) = 0
What is the average weight of a SATA hard drive for desktops of 3.5" form factor. I think they make up for most of the weight inside the cabinet. Is it usually over 2.2 pounds (1 Kg)??
How to type 10,20,30 etc using Photoshop "vertical type tool"?
I need like this
1
2
3
4
6
7
8
9
10
but in photoshop it's comes like this
1
2
3
4
6
7
8
9
1
0
can i take div element within the td element of the table. bcoz when i taking, it's not showing in the design mode of asp.net VWD?
syntax is
<td width="33%" id="tdselected" runat="server">
<div id="divSelectedList" runat="server" class="divListStyle">
</div>
<asp:ListBox ID="lstSelected" Style="z-index: -1" runat="server" Width="200px" Height="176px"
onmouseover="ShowDiv('SelectedList')" onmouseout="HideDiv('SelectedList')">
<asp:ListItem>PIYUSH</asp:ListItem>
</asp:ListBox>
</td>
actually i am looking for some best html editor for my CMS system. witch support (PHP, JQUERY)
i found TinyMCE but it dont have image upload functionality, after i found
phpimage for this but every time i goto
http://sourceforge.net/tracker/?func=detail&aid=2844769&group_id=103281&atid=738747
and click on files, i get normal TinyMCE my question is how to find phpimage to download and configure it.
if you know any other FREE HTML editor with image uplaod let me know.
Thanks
Im building an ad-system where users can dynamically create 'fields' for each ad type.
My models and example values:
AdType:
| id | name
|----|-----
| 1 | Hotel
| 2 | Apartment
AdOption:
| id | ad_type_id | name
|----|------------|-----
| 1 | 1 | Star rating
| 2 | 1 | Breakfast included?
| 3 | 2 | Number of rooms
AdValue: (Example after saving)
| id | ad_id | ad_option_id | value
|----|-------|---------------|------
| 1 | 1 | 1 (stars) | 5
| 2 | 1 | 2 (breakfast) | true
Ad: (Example after saving)
| id | description | etc....
|----|-----------------|--------
| 1 | very nice hotel | .......
So lets say I want to create a new ad, and I choose Hotel as the ad type.
Then I need my view to dynamically create fields like this: (I'm guessing?)
[Label] Star rating:
[hidden_field :ad_id] [hidden_field :ad_option_id] [text_field :value]
[Label] Breakfast included?
[hidden_field :ad_id] [hidden_field :ad_option_id] [text_field :value]
And also, how to save the values when the ad record is saved
I hope this is understandable. If not just ask and I'll try to clarify.
If given subnet address e.g. 192.168.10.0/24
How to determine mask length ? (/24)
How to determine mask address ? (255.255.255.0)
How to determine network address ? (192.168.10.0)
Hello!
Im trying to store to array of ints in a jagged array:
while (dr5.Read())
{
customer_id[i] = int.Parse(dr5["customer_id"].ToString());
i++;
}
dr5 is a datareader. I am storing the customer_id in an array, i also want to store scores in another array.
I want to have something like below within the while loop
int[] customer_id = { 1, 2 };
int[] score = { 3, 4};
int[][] final_array = { customer_id, score };
Can anyone help me please ?