Does anyone check the domain of an email address as part of their verification steps? eg. Confirm that gmail.com exists if the user specified [email protected] as their address.
I have a solution file that requires a third party library (open source). The containing solution uses the typical configuration names of "Debug" and "release".
The 3rd party one has debug and release configs for both DLL and static libs - their names are not "Debug" and "Release".
How do I tell the solution to build the dependency first and how do I correlate which config to the dependant config?
i.e.
MyProject:Debug should build either 3rdParty:debug_shared or 3rdParty:debug_static
Hello everyone,
I am having an application where I have to send several small data per second through the network using UDP. The application need to send the data in real-time (on waiting). I want to encrypt these data and insure that what I am doing is as secure as possible.
Since I am using UDP, there is no way to use SSL/TLS, so I have to encrypt each packet alone since the protocol is connectionless/unreliable/unregulated.
Right now, I am using a 128-bit key derived from a passphrase from the user, and AES in CBC mode (PBE using AES-CBC). I decided to use a random salt with the passphrase to derive the 128-bit key (prevent dictionary attack on the passphrase), and of course use IVs (to prevent statistical analysis for packets).
However I am concerned about few things:
Each packet contains small amount of data (like a couple of integer values per packet) which will make the encrypted packets vulnerable to known-plaintext attacks (which will result in making it easier to crack the key). Also, since the encryption key is derived from a passphrase, this will make the key space way less (I know the salt will help, but I have to send the salt through the network once and anyone can get it). Given these two things, anyone can sniff and store the sent data, and try to crack the key. Although this process might take some time, once the key is cracked all the stored data will be decrypted, which will be a real problem for my application.
So my question is, what is the best practices for sending/encrypting continuous small data using a connectionless protocol (UDP)?
Is my way the best way to do it? ...flowed? ...Overkill? ...
Please note that I am not asking for a 100% secure solution, as there is no such thing.
Cheers
How can escape quotes for use in HTML? My line of code is:
<body onload="setTimeout('window.location='http://somepage.com'', 1000)">
As you can see in the current example, there are two ', and a " being used. How can I escape them for the above to work?
The onload contents are set dynamically for a system I am working on @ work.
I am trying to duplicate an existing DNN portal that I have for testing purposes by creating a duplicate of the database and duplicating the .net files into a new folder.
After I copied the site and changed the webconfig to point to the new site and changed the alias in the database I am getting this error.
This webpage has a redirect loop.
The webpage at http://xxx.us/xxx/default.aspx has resulted in too many redirects. Clearing your cookies for this site or allowing third-party cookies may fix the problem. If not, it is possibly a server configuration issue and not a problem with your computer.
I have a structure defined in my header file:
struct video
{
wchar_t* videoName;
std::vector<wchar_t*> audio;
std::vector<wchar_t*> subs;
};
struct ret
{
std::vector<video*> videos;
wchar_t* errMessage;
};
struct params{
HWND form;
wchar_t* cwd;
wchar_t* disk;
ret* returnData;
};
When I try to add my video structure to a vector of video* I get access violation reading 0xcdcdcdc1 (videoName is @ 0xcdcdcdcd, before I allocate it)
//extract of code where problem is
video v;
v.videoName = (wchar_t*)malloc((wcslen(line)+1)*sizeof(wchar_t));
wcscpy(v.videoName,line);
p->returnData->videos.push_back(&v); //error here
I'm calling pipe.communicate from Python's subprocess module from Python 2.6. I get the following error from this code:
from subprocess import Popen
pipe = Popen(cwd)
pipe.communicate( data )
For an arbitrary cwd, and where data that contains unicode (specifically 0xE9):
Exec. exception: 'ascii' codec can't encode character u'\xe9' in position 507: ordinal not in range(128)
Traceback (most recent call last):
... stdout, stderr = pipe.communicate( data )
File
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py",
line 671, in communicate
return self._communicate(input)
File
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py",
line 1177, in _communicate
bytes_written = os.write(self.stdin.fileno(), chunk)
This is happening, I presume, because pipe.communicate() is expecting ASCII encoded string, but data is unicode.
Is this the problem I'm encountering, and i sthere a way to pass unicode to pipe.communicate()?
Thank you for reading!
Brian
I've been trying to get this working and I can't seem to figure it out. There is an Image control that when I click on it I need to zoom in (using the center/transform point where the mouse is clicked).
I have the zoom transition working great, but when I set transformX & tranformY (with autoCenterTransform false) it doesn't zoom into that point.
Here is my code that only zooms in (not to a specific point)
<fx:Script>
<![CDATA[
protected function imgLogo_clickHandler(event:MouseEvent):void
{
transformer.play();
}
]]>
</fx:Script>
<fx:Declarations>
<s:Parallel id="transformer" target="{imgLogo}">
<s:Scale scaleXBy="0.5" scaleYBy="0.5" />
</s:Parallel>
</fx:Declarations>
<mx:Image id="imgLogo" width="250" x="100" y="100"
maintainAspectRatio="true" source="@Embed('src/logo.png')"
click="imgLogo_clickHandler(event)" />
Any help is greatly appreciated.
Thanks
I have a text file that includes data inside {[]} tags. What would be the suggested way to parse that data so I can just use the data inside the tags?
Example text file would look like this:
'this is a bunch of text that is not {[really]} useful in any {[way]}. I need to {[get]} some items {[from]} it.'
I would like to end up with 'really', 'way', 'get', 'from' in a list. I guess I could use split to do it.. but seems like there might be a better way out there. I have seen a ton parsing libraries, is there one that would be perfect for what I want to do?
I have a ClickOnce application that I would like to "re-brand" for multiple clients.
Is there a way, without separate deployments or branched builds, to change the start menu folder/link of the application?
Obviously once it starts and gets the settings it can rebrand everything else from there...
If I wanted to save a contact form submission to the database, how can I insert the form scope in as the submission? It's been some time since I used Coldfusion.
The contact forms vary depending on what part of the site it was submitted from, so it needs to scale and handle a form with 5 fields or one with 10 fields. I just want to store the data in a blob table.
I am implementing Paging in my application. For this i run a query and get a resultset.
Now i want to get total no of records in this resultset for my paging calculation. How can i get ? i dont want to execute a extra sql which gives me total rows
I would like to get the Type of item that a BindingSource is hooked up to or configured for. The BindingSource.DataSource property can be set to an object, list, or type. If it is a Type, it obviously does not have an bound item yet, but I would still like to get the Type. For a List, I need the item Type, not the list type.
There is a method BindingSource.GetItemProperties, that accomplishes most of what I need. It gets the PropertyDescriptors for the Type, list item, or object specified by the DataSource and DataMember.
The reason I ask, is that I have some components that I would like to re-use, but they are currently setup to work off of an item Type. The Type is mainly used to get PropertyInfos and then build a UI, but PropertyInfo and PropertyDescriptor is not exactly the same, so it is not immediately apparent that they can be reworked to use a PropertyDescriptor collection instead. Then there is cascading refactoring of everything already using these components and that adds up to a lot of work that I would rather not do.
I've looked through the API docs for for a good way to do this, but so far I have not had any luck. Am I missing something or is this just something I can not or should not be doing?
I'm learning WPF and would like to have a collection similar to a LinkedList, to where I can add and remove strings. And I want to have a ListView that listen to that collection with databinding. How can I do bind a simple list collection to a ListView in XAML?
My idea (not working) is something like this:
<Window x:Class="TestApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<LinkedList x:Key="myList"></LinkedList> //Wrong
<Window.Resources>
<Grid>
<ListView Height="100" HorizontalAlignment="Left" Margin="88,134,0,0"
Name="listView1" VerticalAlignment="Top" Width="120"
ItemsSource="{Binding Source={StaticResource myList}}"/> //Wrong
</Grid>
</Window>
All my code (updated version, not working):
<Window x:Class="TestApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TextBox Height="23" HorizontalAlignment="Left" Margin="12,12,0,0"
Name="textBox1" VerticalAlignment="Top" Width="120" />
<Button Content="Button" Height="23" HorizontalAlignment="Right"
Margin="0,12,290,0" Name="button1" VerticalAlignment="Top" Width="75"
Click="button1_Click" />
<ListView Height="100" HorizontalAlignment="Left" Margin="88,134,0,0"
Name="listView1" VerticalAlignment="Top" Width="120"
ItemsSource="{Binding myList}"/>
</Grid>
</Window>
C#-code:
namespace TestApp
{
public partial class MainWindow : Window
{
ObservableCollection<string> myList = new ObservableCollection<string>();
public MainWindow()
{
InitializeComponent();
myList.Add("first string");
}
private void button1_Click(object sender, RoutedEventArgs e)
{
myList.Add(textBox1.Text);
textBox1.Text = myList.Count+"st";
}
}
}
Hi,
My home network consists of a couple XP machines and a windows 7 box. One of the XP boxes is like a shared server accessed via Remote Desktop. I have an account on there and my gf has another.
Previously I was able to save RDC shortcuts to this shared server including credentials. So in order to access the server from a computer on the network, i just needed to open the shortcut. I thus would have two shortcuts, one for my account and one for my gf's.
In windows 7, it seems to store credentials for a box based on machine name. i.e. i can only store one set of credentials per machine name. This seems incredibly stupid so my question is:
In windows 7, is there some way to have RDC shortcuts that use different credentials to login to the same target box?
thanks
I have recently bought myself a new monitor, now I'd had my previous screen well over 5 years now so I'm looking at this one thinking the picture doesn't quite look right (not bad, just different). Rather than just wait until I'm used to the new picture I'd rather get it fine tuned, then get used to it - so I can reap the maximum benefit.
So, can you please suggest reliable ways of configuring an LCD monitor's brightness/contrast/colour/etc to provide the optimum possibly quality image?
I have a situation where something can appear in a format as follows:
---id-H--
Header: data
Another Header: more data
Message: sdasdasdasd
Message: asdasdasdasd
Message: asdasdasd
There may be many messages, or just a couple. I'd prefer not having to step outside of RegEx, because I am using the RegEx to parse some header information above the messages and the messages along with the headers are part of the text I am parsing. The messages attached into the text might be many.
I would also like to use named capture groups, so something like
Message: (?<Message[index of match]>.+)
Where it matches the match as many times as it can with the index filled in. Does anything like this exist in RegEx? (I will eventually be using this in Perl)
We have recently shifted to asp.net mvc, but we still need to support some legacy urls. What is the best way to handle this situation. Is it Application_PreRequestHandlerExecute() event in global.asax, that I need to use or is there any better way?
Now that the MVC 2 framework has been out for a while, I'm finding it very difficult to find documentation & answers specific to MVC2.
What are some good sites specific to MVC2?
I decided to use Amazon S3 for document storage for an app I am creating. One issue I run into is while I need to upload the files to S3, I need to create a document object in my app so my users can perform CRUD actions.
One solution is to allow for a double upload. A user uploads a document to the server my Rails app lives on. I validate and create the object, then pass it on to S3. One issue with this is progress indicators become more complicated. Using most out-of-the-box plugins would show the client that file has finished uploading because it is on my server, but then there would be a decent delay when the file was going from my server to S3. This also introduces unnecessary bandwidth (at least it does not seem necessary)
The other solution I am thinking about is to upload the file directly to S3 with one AJAX request, and when that is successful, make a second AJAX request to store the object in my database. One issue here is that I would have to validate the file after it is uploaded which means I have to run some clean up code in S3 if the validation fails.
Both seem equally messy.
Does anyone have something more elegant working that they would not mind sharing? I would imagine this is a common situation with "cloud storage" being quite popular today. Maybe I am looking at this wrong.
I have a delegate that modifies an object. I pass an object to the delegate from a calling method, however the calling method does not pickup these changes. The same code works if I pass a List as the object. I thought all objects were passed by reference so any modifications would be reflected in the calling method?
I can modify my code to pass a ref object to the delegate but am wondering why this is necessary?
public class Binder
{
protected delegate int MyBinder<T>(object reader, T myObject);
public void BindIt<T>(object reader, T myObject)
{
//m_binders is a hashtable of binder objects
MyBinder<T> binder = m_binders["test"] as MyBinder<T>;
int i = binder(reader, myObject);
}
}
public class MyObjectBinder
{
public MyObjectBinder()
{
m_delegates["test"] = new MyBinder<MyObject>(BindMyObject);
}
private int BindMyObject(object reader, MyObject obj)
{
//make changes to obj in here
}
}
///calling method in some other class
public void CallingMethod()
{
MyObject obj = new MyObject();
MyBinder binder = new MyBinder();
binder.BindIt(myReader, obj); //don't worry about myReader
//obj should show reflected changes
}
I have a template class that has a template member function that needs to be specialized, as in:
template <typename T>
class X
{
public:
template <typename U>
void Y() {}
template <>
void Y<int>() {}
};
Altough VC handles this correctly, apperantly this isn't standard and GCC complains: explicit specialization in non-namespace scope 'class X<T>'
I tried:
template <typename T>
class X
{
public:
template <typename U>
void Y() {}
};
template <typename T>
// Also tried `template<>` here
void X<T>::Y<int>() {}
But this causes both VC and GCC to complain.
What's the right way to do this?
I'm migrating a series of websites from an existing IIS5 server to a brand new IIS7 web server. One of the pages pulls a data file from a blob in the database and serves it to the end user:
Response.ContentType = rs("contentType")
Response.AddHeader "Content-Disposition", "attachment;filename=" & Trim(rs("docName"))&rs("suffix")' let the browser know the file name
Response.AddHeader "Content-Length", cstr(rs("docsize"))' let the browser know the file size
Testing this in the new IIS7 install, I get a "Connection Reset" error in both Internet Explorer and Firefox. The document is served up correctly if the Content-Length header is removed (but then the user won't get a useful progress bar).
Any ideas on how to correct this; whether it be a server configuration option or via code?
Thanks.