Search Results

Search found 1567 results on 63 pages for 'scott whitlock'.

Page 5/63 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Using SSL and SslStream for peer to peer authentication?

    - by Scott Whitlock
    I need to provide secure communication between various processes that are using TCP/IP sockets for communication. I want both authentication and encryption. Rather than re-invent the wheel I would really like to use SSL and the SslStream class and self-signed certificates. What I want to do is validate the remote process's certificate against a known copy in my local application. (There doesn't need to be a certificate authority because I intend for the certificates to be copied around manually). To do this, I want the application to be able to automatically generate a new certifiate the first time it is run. In addition to makecert.exe, it looks like this link shows a way to automatically generate self-signed certificates, so that's a start. I've looked at the AuthenticateAsServer and AuthenticateAsClient methods of SslStream. You can provide call-backs for verification, so it looks like it's possible. But now that I'm into the details of it, I really don't think it's possible to do this. Am I going in the right direction? Is there a better alternative? Has anyone done anything like this before (basically peer-to-peer SSL rather than client-server)?

    Read the article

  • Best practice for defining CSS rules via JavaScript

    - by Tim Whitlock
    I'm loading a stylesheet that is only required when javascript is enabled. More to the point, it mustn't be present if JavaScript is disabled. I'm doing this as soon as possible (in the head) before any javascript libraries are loaded. (I'm loading all scripts as late as possible). The code for loading this stylesheet externally is simple, and looks like this: var el = document.createElement('link'); el.setAttribute('href','/css/noscript.css'); el.setAttribute('rel','stylesheet'); el.setAttribute('type','text/css'); document.documentElement.firstChild.appendChild(el); It's working fine, but all my CSS file contains at the moment is this: .noscript { display: none; } This doesn't really warrant loading a file, so I'm thinking of just defining the rule dynamically in JavaScript. What's best practice for this?. A quick scan of various techniques shows that it requires a fair bit of cross-browser hacking. P.S. pleeease don't post jQuery examples. This must be done with no libraries.

    Read the article

  • How do you handle files that can't support concurrent edits in Mercurial?

    - by Scott Whitlock
    I'm using Mercurial with TortoiseHg. Each developer has their own repositories, and there's one central repository on the server for synchronizing our changes. (This will sound lame, but we're using it to manage the source for a legacy VB6 project. Nothing we can do about that...) As has been pointed out elsewhere, there is a big problem in VB6 with merging the .frx (form resources) files. So code changes seem to merge fine, but if two developers both make changes at the same time in the form design view, we can't merge. I'm ok with disallowing concurrent edits, but of course the whole point of Mercurial is that it's distributed so there is no option to force a file to be locked before editing. I don't believe there's a Mercurial solution for this, so I'm wondering: other developers who are using Mercurial for version control, do you have some 3rd party tool that assists with locking files for editing in the cases where it's necessary? Did we make a mistake using Mercurial instead of something like SVN?

    Read the article

  • Drupal permissions not showing for custom content type

    - by Tim Whitlock
    I have a custom content type in Drupal which was created using CCK. The create/edit permissions for this type are not showing up in the node module permissions, although other cck types are. This content type is also bound to a module, but this module doesn't have any admin screens, all node creation is done through the standard cck interface. any ideas? I have tried rebuilding the permissions cache

    Read the article

  • How do I open a web browser from a .NET Program? Process.Start() isn't working?

    - by Scott Whitlock
    I have a URL and I want to launch it in the default browser. I've tried two methods: Process.Start("http://stackoverflow.com"); ... and the one detailed in this other question using ShellExecute. In both cases I get the error: Windows cannot find 'http://stackoverflow.com'. Make sure you typed the name correctly, and then try again. It shouldn't be trying to open it as a file though... from what I understand, it should recognize it as a URL and open it in the default browser. What am I missing? By the way: OS = Vista, and .NET = 3.5 EDIT: According to this MS KB article, since Process.Start sets the UseShellExecute by default, it should launch the default browser.

    Read the article

  • How can I force a ListView with a custom panel to re-measure when the ListView width goes below the

    - by Scott Whitlock
    Sorry for the long winded question (I'm including background here). If you just want the question, go to the end. I have a ListView with a custom Panel implementation that I'm using to implement something similar to a WrapPanel, but not quite. I'm overriding the MeasureOverride and ArrangeOverride methods in the custom panel. If I do the naive implementation of a WrapPanel in the MeasureOverride method it doesn't work when the ListView is resized. Let's say the custom panel does a measure and the constraint is a width of 100 and let's say I have 3 items that are 40 wide each. The naive approach is to return a size of 80,80 but when I resize the window that the ListView is in, down to say 75, it just turns on the horizontal scrollbar and never calls measure or arrange again (it does keep measuring and arranging if the width is greater than 80). To get around this, I hard coded the measurement to only have a width of the widest item. Then in the arrange, it gives me more space than I asked for and I use as much horizontal space as I can before wrapping. If I resize the window smaller than the smallest item in the ListView, then it turns on the scrollbar, which is great. Unfortunately this is causing a big problem when I have one of these ListViews with a custom panel nested inside of another one. The outside one works ok, but I can't get the inside one to "take as much as it needs". It always sizes to the smallest item, and the only way around it is to set the MinWidth to be something greater than zero. Anyway, stepping back for a second, I think the real way to fix this is to go back to the Naive implementation of the WrapPanel but force it to re-measure when the ListView width goes below the Size I previously returned as a measurement. That should solve my problem with the nested one. So, that's my question: I have a ListView with a custom panel If I return a measurement width on the panel and the ListView is resized to less than that width, it stops calling MeasureOverride How can I get it to continue calling MeasureOverride?

    Read the article

  • Why doesn't MySQL support millisecond precision?

    - by Byron Whitlock
    So I just found the most frustrating bug ever in MySQL. Apparently the TIMESTAMP field, and supporting functions do not support any greater precision than seconds!? So I am using PHP and Doctrine, and I really need those microseconds (I am using the actAs: [Timestampable] property). I found a that I can use a BIGINT field to store the values. But will doctrine add the milliseconds? I think it just assigns NOW() to the field. I am also worried the date manipulation functions (in SQL) sprinkled through the code will break. I also saw something about compiling a UDF extension. This is not an acceptable workaround because I or a future maintainer will upgrade and poof, change gone. Has anyone found a suitable workaround?

    Read the article

  • Do I need to include the 'this' when using a property name in a closure?

    - by Scott Whitlock
    I'm using a list of Actions to store an undo history for an object. Let's say I have a property of my object called myChildObject and it's being changed, so I want to store the undo action where I would set it back to it's current value: public class Class1 { public Class1() { } private readonly List<Action> m_undoActions = new List<Action>(); private SomeObject myChildObject { get; set; } public void ChangeState(SomeObject newChildObject) { // copies the reference SomeObject existingObject = myChildObject; m_undoActions.Add(() => myChildObject = existingObject); myChildObject = newChildObject; } } Looking at the lambda expression, existingObject is a local variable, so it's using a closure to pass a reference to that variable, but what about the property myChildObject? Do I need to use 'this' to preface it? Do I need to make a copy of the 'this' reference to a local variable first? Thanks for helping me understand this closure stuff.

    Read the article

  • Is there a web site where I can paste a SQL Insert statement and have it break it out by column?

    - by Scott Whitlock
    I've been working on an application that has no discernable data access layer, so all the SQL statements are just built up as strings and executed. I'm constantly confronted by very long INSERT statements where I'm trying to figure out what value in the VALUES list matches up with what column in the column name list. I was about to create a little helper application where I could paste in an INSERT statement and have it show me a list of values matched up with the column names, just for debugging, and I thought, "someone else has probably done this already." Does anyone know of a web site where I can just paste in an INSERT statement and have it show me a two column table with column names in the first column and values in the second column?

    Read the article

  • How does a cryptographically secure random number generator work?

    - by Byron Whitlock
    I understand how standard random number generators work. But when working with crytpography, the random numbers really have to be random. I know there are instruments that read cosmic white noise to help generate secure hashes, but your standard PC doesn't have this. How does a cryptographically secure random number generator get its values with no repeatable patterns?

    Read the article

  • Performance with timestamp conditions

    - by Tim Whitlock
    Which of the following is faster, or are they equivalent? (grabbing recent most records from a TIMESTAMP COLUMN) SELECT UNIX_TIMESTAMP(`modified`) stamp FROM `some_table` HAVING stamp > 127068799 ORDER BY stamp DESC or SELECT UNIX_TIMESTAMP(`modified`) stamp FROM `some_table` WHERE UNIX_TIMESTAMP(`modified`) > 127068799 ORDER BY `modified` DESC or even another combination?

    Read the article

  • Why doesn't MySQL support millisecond / microsecond precision?

    - by Byron Whitlock
    So I just found the most frustrating bug ever in MySQL. Apparently the TIMESTAMP field, and supporting functions do not support any greater precision than seconds!? So I am using PHP and Doctrine, and I really need those microseconds (I am using the actAs: [Timestampable] property). I found a that I can use a BIGINT field to store the values. But will doctrine add the milliseconds? I think it just assigns NOW() to the field. I am also worried the date manipulation functions (in SQL) sprinkled through the code will break. I also saw something about compiling a UDF extension. This is not an acceptable because I or a future maintainer will upgrade and poof, change gone. Has anyone found a suitable workaround?

    Read the article

  • How do I measure the size of a TextBlock in WPF before it is rendered?

    - by Scott Whitlock
    I have a WPF DataTemplate with two TextBlock controls (stacked) and then some other elements underneath. Due to some complicated layout code, I need to know the height of the two TextBlock elements so that I can draw some fancy connector lines, and line up other controls, etc. If I know the text that's going into the TextBlocks, and I know the font, etc., is there some way I can compute or measure the height of these TextBlocks without actually rendering them?

    Read the article

  • messages stuck permanently in session

    - by Tim Whitlock
    I am getting Drupal messages stuck permanently in session, so that after being displayed they are not cleared. The unsetting code in function drupal_get_messages in bootstrap.inc is firing - It's as if the session is sleeping (i.e. serializing to disk) before the messages array is cleared. Have you witnessed such a thing? UPDATE The call that commits the session starts from drupal_page_footer at the bottom of index.php - for some reason this is executing twice per request! once with the emptied messages and then again with the messages back in the array.

    Read the article

  • WPF layout calls MeasureOverride repeatedly in increments of 2?

    - by Scott Whitlock
    I've run into a case where I have a custom Panel (inherits from Panel) and I'm using it as an ItemsPanel in a ListView. When I resize the container that it's in, if I resize it smaller, my panel's MeasureOverride function gets called once, but if I resize it larger (let's say from 100 to 300), it calls MeasureOverride and ArrangeOverride for every value between 100 and 300, in increments of 2 (so 102, 104, etc.). The weird thing is that the container resizes right away (its size gets to 300 immediately). It doesn't seem to matter what I return from MeasureOverride - it just does this. I wish I could make it happen in a really small application and post it here, but I haven't been able to reproduce it like that yet. I can reproduce it all day in my app though. Does anyone know what could cause this?

    Read the article

  • JavaScript pack("d") - binary strings

    - by Tim Whitlock
    I'm trying to replicate the Perl and PHP style pack and unpack functions in JavaScript. Unsigned integers were easy enough, so my pack('n') and pack('N') are ok. But my lack of a computer science background is a hurdle now and I don't know where to start with pack('d') for packing JavaScript's standard floating point. Is there a JavaScript library for this out there? If not, is there a good resource where I can learn how to do this? I am fine with bitwise and binary level operations in JS, I just don't know where to start with the logic. Thanks.

    Read the article

  • How do I open a web browser from C#? Process.Start() isn't working?

    - by Scott Whitlock
    I have a URL and I want to launch it in the default browser. I've tried two methods: Process.Start("http://stackoverflow.com"); ... and the one detailed in this other question using ShellExecute. In both cases I get the error: Windows cannot find 'http://stackoverflow.com'. Make sure you typed the name correctly, and then try again. It shouldn't be trying to open it as a file though... from what I understand, it should recognize it as a URL and open it in the default browser. What am I missing? By the way: OS = Vista, and .NET = 3.5

    Read the article

  • Creating a System.Windows.Controls.Image throws an exception - how do I use the dispatcher to instan

    - by Scott Whitlock
    I'm running my unit tests on a piece of code that does the following in the test: Assert.IsNotNull(target.Icon); Inside the getter for the Icon property, I'm doing this: System.Windows.Controls.Image img = new System.Windows.Controls.Image(); That's throwing this exception: System.InvalidOperationException : The calling thread must be STA, because many UI components require this. I understand what that means, and I understand that I need to use the Dispatcher, but I'm a bit confused about how or why... this is a property of my ViewModel and I don't get any of these exceptions when running the application. Other info: this only started failing when I upgraded to .NET 4.

    Read the article

  • Changing the default UITabBarController background color.

    - by Scott
    Hello, So I have an iPhone application running that is controlled at the highest level by a UITabBarController. It is the default black Tab Bar at the bottom that you see in many iPhone apps. I am kind of new to iPhone SDK programming, and I know I have seen other apps that have their own background color for the Tab Bar at the bottom. I am not sure if they are using this tab bar as I am, as the main controller for their app, but the question applies to this: How do I change the background color of the main UITabBarController in my application? I wanted to change it to a dark shade of green similar to the colors of the navigation bars and labels I have placed in my app. I find it weird how Apple makes it really easy to change the color of Navigation Bars (not controllers), and other things, but when it comes to controllers (in this case a Tab Bar Controller), I cannot find a single way to implement this cleanly and efficiently. Thanks! -Scott

    Read the article

  • WinDbg .for loop

    - by Scott
    I am having trouble getting the WinDbg .for command to work. I would like to dump an array of c++ structs. ?? gpTranData->mpApplCodes[0] works for a single entry but I would like to loop through n of these. .for ($t0=0;$t0<(gpTranData->miApplCodeCount);$t0++){ ?? &gpTranData->mpApplCodes[$t0] } sound logical to me but I get Numeric expression missing from '>miApplCodeCount);$t0++){ ?? &gpTranData->m_pApplCodes[$t0] }' Any ideas? Scott

    Read the article

  • How would you validate a checkbox in ASP.Net MVC 2?

    - by Scott Mayfield
    Using MVC2, I have a simple ViewModel that contains a bool field that is rendered on the view as a checkbox. I would like to validate that the user checked the box. The [Required] attribute on my ViewModel doesn't seem to do the trick. I believe this is because the unchecked checkbox form field is not actually transmitted back during the POST, and therefore the validation doesn't run on it. Is there a standard way to handle checkbox "required" validation in MVC2? or do I have to write a custom validator for it? I suspect the custom validator won't get executed either for the reason mentioned above. Am I stuck checking for it explicitly in my controller? That seems messy... Any guidance would be appreciated. Scott

    Read the article

  • How does Entity Framework 4.0 determine which parameters are required for the factory method of an e

    - by Scott Davies
    Hi, I am working with Entity Framework 4.0 (VS 2010 Beta 2, NOT RC). I can model the EDM and produce the required database. When I ask VS to generate the code for the model, it generates the expected .designer.cs file. When I look at the factory methods for each entity that the designer has generated, I've noticed that it doesn't include all of the properties of the entity. Is it correct to say that the factory method only includes properties that cannot be null ? This appears to be the case, but I'm not entirely sure. Thanks, Scott

    Read the article

  • Joomla 1.5 Media Manager sets incorrect file permissions when uploading

    - by Scott Mayfield
    Howdy all, I have a Joomla 1.5 installation running on Windows Server 2008, installed via the Web Platform Installer. When uploading images with the media manager (native uploader, not the flash bulk uploader), the files arrive on the server correctly, but are given incorrect permissions. Specifically, the IIS_IUSRS group is not given access to the file. I might be incorrect about what group/user is SUPPOSED to get access to the files, but so far, I've found that unless I give IIS_IUSRS access to the uploaded files, they won't appear on the site or in the media manager (appear as broken images). Once I give IIS_IUSRS permission to the files, they work fine. So far, all the research I've done has led me to linux specific fixes that involve either changing the umask on the server, or directly modifying the Joomla codebase to add an appropriate chmod command to the upload process, but I really don't want to modify Joomla directly. I have to believe there's a setting here somewhere that will do the job, either on the Joomla or Windows side of the equation. Any thoughts? Scott

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >