Search Results

Search found 9 results on 1 pages for 'flipdoubt'.

Page 1/1 | 1 

  • Why do Finder and du report different file size?

    - by flipdoubt
    I am writing a geektool 3 script to show the size of a particular VMware Fusion virtual machine. Get Info in Finder says the file is "52.91 GB". I run the following du command to get the file size: > du -hs ~/Documents/Virtual\ Machines.localized/MY-PRECIOUS-7.vmwarevm | awk '{print $1}' This du -hs command returns the file size as "49G". What accounts for the difference from what Finder reports? Alternatively, I have tried replacing the -s option with the -d option like so: du -hd ~/Documents/Virtual\ Machines.localized/MY-PRECIOUS-7.vmwarevm | awk '{print $1}' This du -hd command returns the file size as "59G". What accounts for the difference between Finder, du -hd, and du -hs? Also, this du -hd command produces no output in geektool 3. What gives?

    Read the article

  • When did my Mac's HD last sleep?

    - by flipdoubt
    Is there any app or log that says when my MacBook Pro's hard drive last went into sleep mode? I ask because each night when I close the MBP's lid without being plugged into a power source, the power light goes into its snooze rhythm but the battery is half-drained by the next morning. It certainly looks like it is asleep, but the power drain seems to indicate otherwise.

    Read the article

  • Why does text from Assembly.GetManifestResourceStream() start with three junk characters?

    - by flipdoubt
    I have a SQL file added to my VS.NET 2008 project as an embedded resource. Whenever I use the following code to read the file's content, the string returned always starts with three junk characters and then the text I expect. I assume this has something to do with the Encoding.Default I am using, but that is just a guess. Why does this text keep showing up? Should I just trim off the first three characters or is there a more informed approach? public string GetUpdateRestoreSchemaScript() { var type = GetType(); var a = Assembly.GetAssembly(type); var script = "UpdateRestoreSchema.sql"; var resourceName = String.Concat(type.Namespace, ".", script); using(Stream stream = a.GetManifestResourceStream(resourceName)) { byte[] buffer = new byte[stream.Length]; stream.Read(buffer, 0, buffer.Length); // UPDATE: Should be Encoding.UTF8 return Encoding.Default.GetString(buffer); } } Update: I now know that my code works as expected if I simply change the last line to return a UTF-8 encoded string. It will always be true for this embedded file, but will it always be true? Is there a way to test any buffer to determine its encoding?

    Read the article

  • Where do you store the private key for your code signing certificate?

    - by flipdoubt
    I recently acquired a code signing certificate for my employer, but I am not the InstallShield developer who will sign the binaries before distribution. I know I can export the certificate along with its private key, but where do I store it so the InstallShield developer can install it on his machine? Should I remove it from my machine once I give it to the person doing the signing? Where do I store the master copy? Obviously, source control is not the best place, unless I lock down that directory in SVN.

    Read the article

  • What does "active directory integration" mean in your .NET app?

    - by flipdoubt
    Our marketing department comes back with "active directory integration" being a key customer request, but our company does not seem to have the attention span to (1) decide on what functional changes we want to make toward this end, (2) interview a broad range of customer to identify the most requested functional changes, and (3) still have this be the "hot potato" issue next week. To help me get beyond the broad topic of "active directory integration," what does it mean in your .NET app, both ASP.NET and WinForms? Here are some sample changes I have to consider: When creating and managing users in your app, are administrators presented with a list of all AD users or just a group of AD users? When creating new security groups within your app (we call them Departments, like "Human Resources"), should this create new AD groups? Do administrators assign users to security groups within your app or outside via AD? Does it matter? Is the user signed on to your app by virtue of being signed on to Windows? If not, do you track users with your own user table and some kind of foreign key into AD? What foreign key do you use to link app users to AD users? Do you have to prove your login process protects user passwords? What foreign key do you use to link app security groups to AD security groups? If you have a WinForms component to your app (we have both ASP.NET and WinForms), do you use the Membership Provider in your WinForms app? Currently, our Membership and Role management predates the framework's version, so we do not use the Membership Provider. Am I missing any other areas of functional changes? Followup question Do apps that support "active directory integration" have the ability to authenticate users against more than one domain? Not that one user would authenticate to more than one domain but that different users of the same system would authenticate against different domains.

    Read the article

  • How can I find the method that called the current method?

    - by flipdoubt
    When logging in C#, how can I learn the name of the method that called the current method? I know all about System.Reflection.MethodBase.GetCurrentMethod(), but I want to go one step beneath this in the stack trace. I've considered parsing the stack trace, but I am hoping to find a cleaner more explicit way, something like Assembly.GetCallingAssembly() but for methods.

    Read the article

  • How do I simulate "Is In" using Linq2Sql

    - by flipdoubt
    I often find myself with a list of disconnected Linq2Sql objects or keys that I need to re-select from a Linq2Sql data-context to update or delete in the database. If this were SQL, I would use IS IN in the SQL WHERE clause, but I am stuck with what to do in Linq2Sql. Here is a sample of what I would like to write: public void MarkValidated(IList<int> idsToValidate) { using(_Db.NewSession()) // Instatiates new DataContext { // ThatAreIn <- this is where I am stuck var items = _Db.Items.ThatAreIn(idsToValidate).ToList(); foreach(var item in items) item.Validated = DateTime.Now; _Db.SubmitChanges(); } // Disposes of DataContext } Or: public void DeleteItems(IList<int> idsToDelete) { using(_Db.NewSession()) // Instatiates new DataContext { // ThatAreIn <- this is where I am stuck var items = _Db.Items.ThatAreIn(idsToValidate); _Db.Items.DeleteAllOnSubmit(items); _Db.SubmitChanges(); } // Disposes of DataContext } Can I get this done in one trip to the database? If so, how? Is it possible to send all those ints to the database as a list of parameters and is that more efficient than doing a foreach over the list to select each item one at a time?

    Read the article

  • How do I simulate "In" using Linq2Sql

    - by flipdoubt
    I often find myself with a list of disconnected Linq2Sql objects or keys that I need to re-select from a Linq2Sql data-context to update or delete in the database. If this were SQL, I would use IN in the SQL WHERE clause, but I am stuck with what to do in Linq2Sql. Here is a sample of what I would like to write: public void MarkValidated(IList<int> idsToValidate) { using(_Db.NewSession()) // Instatiates new DataContext { // ThatAreIn <- this is where I am stuck var items = _Db.Items.ThatAreIn(idsToValidate).ToList(); foreach(var item in items) item.Validated = DateTime.Now; _Db.SubmitChanges(); } // Disposes of DataContext } Or: public void DeleteItems(IList<int> idsToDelete) { using(_Db.NewSession()) // Instatiates new DataContext { // ThatAreIn <- this is where I am stuck var items = _Db.Items.ThatAreIn(idsToValidate); _Db.Items.DeleteAllOnSubmit(items); _Db.SubmitChanges(); } // Disposes of DataContext } Can I get this done in one trip to the database? If so, how? Is it possible to send all those ints to the database as a list of parameters and is that more efficient than doing a foreach over the list to select each item one at a time?

    Read the article

  • How can I request local pages in the background of an ASP.NET MVC app?

    - by flipdoubt
    My ASP.NET MVC app needs to run a set of tasks at startup and in the background at a regular interval. I have implemented each task as a controller action and listed the app-relative path to the action in the database. I implemented a TaskRunner process that gets the urls from the database and requests each one at a regular interval using WebRequest.Create, but this throws a UriFormatException. I cannot use this answer or any code that plucks values from HttpContext.Current.Request without getting an HttpException with the message "Request is not available in this context". The Request object is not available because my code uses System.Threading.Timer to do background processing, as recommended here. Here are my questions: Is there really no way to make local web requests within an ASP.NET web app? Is there really no way to dynamically ascertain the root path to the web app even using static dependencies in ASP.NET? I was trying to avoid storing the app's root path in the database (as FogBugz does with its "Maintenance Path"), but is this best option?

    Read the article

1