Daily Archives

Articles indexed Monday May 10 2010

Page 12/113 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Why can't I inherit static classes?

    - by User
    I have several classes that do not really need any state. From the organizational point of view, I would like to put them into hierarchy. But it seems I can't declare inheritance for static classes. Something like that: public static class Base { } public static class Inherited : Base { } will not work. Why have the designers of the language closed that possibility?

    Read the article

  • ubuntu: starting program with sudo on boot

    - by The.Anti.9
    I am trying to start xampp when the ubuntu starts on ubuntu 9.10. I tried going to system-preferences-startup applications adding it there, but it didn't work. I surmised it was because it needs to be started as root. I know you can make a startup script some how, but I'm not sure how to do it. How can I make it start xampp when the computer boots, even without logging in? FYI, the command for starting it is sudo /opt/lampp/lampp start

    Read the article

  • Why is my Mac beeping at me in a Sprint-Nextel-PTT kind of way?

    - by Philip
    I'm really stumped about this one. Before on OSX 10.5 and now on OSX 10.6, my Mac occasionally beeps at me. It's a split-second "bee-bee-beep" that sounds vaguely similar to the push-to-talk beep you hear on Sprint/Nextel PTT commercials. I haven't been able to isolate what's running when it happens or what happens before it happens. Possible culprits are Quicksilver, Firefox, DropBox, Evernote helper, TrueCrypt, Wally. Any thoughts? Thanks.

    Read the article

  • Really simple JSON serialization in .NET

    - by Evgeny
    I have some simple .NET objects I'd like to serialize to JSON and back again. The set of objects to be serialized is quite small and I control the implementation, so I don't need a generic solution that will work for everything. Since my assembly will be distributed as a library I'd really like to avoid a dependency on some third-party DLL: I just want to give users one assembly that they can reference. I've read the other questions I could find on converting to and from JSON in .NET. The recommended solution of JSON.NET does work, of course, but it requires distributing an extra DLL. I don't need any of the fancy features of JSON.NET. I just need to handle a simple object (or even dictionary) that contains strings, integers, DateTimes and arrays of strings and bytes. On deserializing I'm happy to get back a dictionary - it doesn't need to create the object again. Is there some really simple code out there that I could compile into my assembly to do this simple job? I've also tried System.Web.Script.Serialization.JavaScriptSerializer, but where it falls down is the byte array: I want to base64-encode it and even registering a converter doesn't let me easily accomplish that due to the way that API works (it doesn't pass in the name of the field).

    Read the article

  • "Send Email" functionality for public web-site

    - by Andrew Florko
    Hello everybody. Public web-site provides list of employees to Internet visitors. Contact information is hidden but visitor can send email via popup email-form. What do you think about automated-scripts/viruses/bot spam activity? Is Capture a "must" for this functionality and what kind of precautions can you suggest also? Thank you in advance

    Read the article

  • Applying a function to an arbitrarily long list of arguments

    - by alphomega
    I want to create a function apply that takes a function with an arbitrary amount of arguments as well as a list of integers, and returns the result of the function (Where each integer in the list is an argument in order. I was thinking something like: apply :: ([Int] -> Int) -> [Int] -> Int apply f x:xs = apply (f x) xs apply f [] = f But I know this won't work because the type signature is wrong - the function doesn't take a list of ints, it just takes some amount of int arguments. Additionally, when I get to the base case the f argument to apply should actually be an integer, violating the type signature anyway. Does anyone know how to deal with this sort of problem?

    Read the article

  • XmlDataProvider and XPath bindings don't allow default namespace of XML data?

    - by Andy Dent
    I am struggling to work out how to use default namespaces with XmlDataProvider and XPath bindings. There's an ugly answer using local-name <Binding XPath="*[local-name()='Name']" /> but that is not acceptable to the client who wants this XAML to be highly maintainable. The fallback is to force them to use non-default namespaces in the report XML but that is an undesirable solution. The XML report file looks like the following. It will only work if I remove xmlns="http://www.acme.com/xml/schemas/report so there is no default namespace. <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type='text/xsl' href='PreviewReportImages.xsl'?> <Report xsl:schemaLocation="http://www.acme.com/xml/schemas/report BlahReport.xsd" xmlns:xsl="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.acme.com/xml/schemas/report"> <Service>Muncher</Service> <Analysis> <Date>27 Apr 2010</Date> <Time>0:09</Time> <Authoriser>Service Centre Manager</Authoriser> Which I am presenting in a window with XAML: <Window x:Class="AcmeTest.ReportPreview" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="ReportPreview" Height="300" Width="300" > <Window.Resources> <XmlDataProvider x:Key="Data"/> </Window.Resources> <StackPanel Orientation="Vertical" DataContext="{Binding Source={StaticResource Data}, XPath=Report}"> <TextBlock Text="{Binding XPath=Service}"/> </StackPanel> </Window> with code-behind used to load an XmlDocument into the XmlDataProvider (seems the only way to have loading from a file or object varying at runtime). public partial class ReportPreview : Window { private void InitXmlProvider(XmlDocument doc) { XmlDataProvider xd = (XmlDataProvider)Resources["Data"]; xd.Document = doc; } public ReportPreview(XmlDocument doc) { InitializeComponent(); InitXmlProvider(doc); } public ReportPreview(String reportPath) { InitializeComponent(); var doc = new XmlDocument(); doc.Load(reportPath); InitXmlProvider(doc); } }

    Read the article

  • Understand Sql Server connectionstring for asp.net

    - by Eatdoku
    Hi, I am trying to understand the differences between the following 2 connectionstrings. one uses servername\instancename and the other one uses the server ip address. Can I specify port number for "serverName\instanceName". I know you can specify port number for ip address, something like '10.0.0.1,xxx'. thanks, Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True; Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;

    Read the article

  • Some general questions about Adobe fonts.

    - by aviraldg
    Questions: The Adobe fonts look distinctly clearer and much better than Arial. Any particular reason? Why does Adobe Caslon Pro show up among "C"s? (I know, Caslon starts with "C", but the font's name starts with "A", right?) Are more fonts like these available somewhere? (By "these", I mean non decorative, regular, and smooth) Why are there two versions of certain fonts like Adobe Heiti, which has: @Adobe Heiti and Adobe Heiti (which are not exactly the same, btw.) Thanks.

    Read the article

  • use/run python's 2to3 as or like a unittest

    - by Vincent
    I have used the 2to3 utility to convert code from the command line. What I would like to do is run it basically as a unittest. Even if it tests the file rather than parts(funtions, methods...) as would be normal for a unittest. It does not need to be a unittest and I don't what to automatically convert the files I just want to monitor the py3 compliance of files in a unittest like manor. I can't seem to find any documentation or examples for this. An example and/or documentation would be great. Thanks

    Read the article

  • It's possible make an OCR in Python to check words...

    - by Shady
    in opened applications? I want to automate firefox in some web page and I don't have a way to "know" if the page already load completely or if it still loading... I was thinking about making an OCR to check the status bar... it's difficult ? For example, when the word DONE appears at the status bar, the program continues to the next command...

    Read the article

  • Using include() to load different page content acts differently locally vs hosted

    - by hookedonwinter
    I have a live site that includes different php files depending on what page the user is trying to access. The header and footer are the same, but in the file, if the user requests filename1.php vs filename2.php, a different php is loaded into the content of the page. Basic CMS stuff. On the live site, it works fine. I just set up a local dev environment, and it doesn't work. The file that is supposed to load into the middle of the page instead is the only file loaded. I'm not saying this well. Here's an example: How it works live: <html> <head> Stuff </head> <body> More stuff <? include( 'some_file.php' ); ?> </body> </html> How it works locally: <? include( 'some_file.php' ); ?> Just that file loads, no other content. Any thoughts on why that one page is loading, but not the surrounding content? If I'm not explaining this well, please let me know.

    Read the article

  • Newbie want to learn: Javascript + HTML5 localstorage

    - by Alai
    So I'm searching for a good crash course on localstorage and interacting with it in Javascript. I want to build a to-do list webapp with some extra functionality but it would be just for 1 user. I don't want to mess with php/mysql and have the server doing anything. Links to tutorials would be best :-D

    Read the article

  • Get rid of XAML Window from Taskbar

    - by griegs
    If I have a XAML window that I show with ShowDialog, is there a way to make it (not) appear in the taskbar? The problem is that I can set the window to be topmost but if that window opens another dialog and I set that also to be topmost, I can put the second behind the first by clicking in the taskbar. This tends to confuse users.

    Read the article

  • How can I tell when a UIWebView has finished drawing to a context?

    - by phopkins
    In my code I'm trying to show a UIWebView as a page is loading, and then, when it's done, capture an image from the web view to cache and display later (so I don't have to reload and render the web page). I have something along the lines of: CGContextRef context = CGBitmapContextCreate(…); [[webView layer] renderInContext:context]; CGImageRef imageRef = CGBitmapContextCreateImage(context); UIImage *image = [UIImage imageWithCGImage:imageRef]; The problem I'm running into is that, due to UIWebView's tiling, sometimes only half of the page is rendered to the context by the time I capture the image. Is there a way to detect or block on UIWebView's background rendering thread so that I can get the image only after all of the rendering has finished?

    Read the article

  • .toggle(true) losing .css (font mismatch)?

    - by James123
    I am losing .css (font mismatch when .toggle(true). How to get back my right .css? $(document).ready(function() { $('tr[@class^=RegText]').hide().children('td'); list_Visible_Ids = []; var idsString, idsArray; idsString = $('#myVisibleRows').val(); idsArray = idsString.split(','); $.each(idsArray, function() { if (this != "") { $('#' + this).siblings('.RegText').toggle(true); list_Visible_Ids[this] = 1; } }); Losing font: $('#' + this).siblings('.RegText').toggle(true); .css working fine if I use below code: $('#' + this).siblings('.RegText').toggle(); But I want expand those sections by setting 'true'. How can I get back my font?

    Read the article

  • Mpi function define

    - by Simone
    I wrote a program in c using MPI (Message Passing Inteface) that compute recursively the inverse of a lower triangular matrix. Every cpu sends 2 submatrices to other two cpus, they compute them and they give them back to the cpu caller. When the cpu caller has its submatrices it has to perform a matrix multiplication. In the recurrence equation the bottle neck is matrix multiplication. I implemented parallel multiplication with mpi in c but i'm not able to embed it into a function. Is it possible? thanks, Simone

    Read the article

  • Entity Framework use of indexes and foreign keys

    - by David
    I want to be able to search a table quite quickly using the Entity Framework, say if I have a Contacts table, a JobsToDo table and a matrix table linking the two tables e.g Contacts_JobsToDo_Mtx and I specify two foreign keys in the Contacts_JobsToDo_Mtx table, if I wanted to search this Mtx table, do I need to specify an index on the two foreign keys? Or by the fact that they are two foreign keys are they considered indexed on them anyway? Will the Entity Framework be able to search through the Mtx table quickly without having to specfiy an index on both keys? Thanks!

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >