Daily Archives

Articles indexed Wednesday March 31 2010

Page 10/124 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Get signal names from numbers in Python

    - by Brian M. Hunt
    Is there a way to map a signal number (e.g. signal.SIGINT) to its respective name (i.e. "SIGINT")? I'd like to be able to print the name of a signal in the log when I receive it, however I cannot find a map from signal numbers to names in Python, i.e. import signal def signal_handler(signum, frame): logging.debug("Received signal (%s)" % sig_names[signum]) signal.signal(signal.SIGINT, signal_handler) For some dictionary sig_names, so when the process receives SIGINT it prints: Received signal (SIGINT) Thank you.

    Read the article

  • Windows Live Messenger Activity SDK: Is it possible to use jQuery?

    - by Cheeso
    There's an SDK that lets developers build "activities" and games for use in Windows Live Messenger. The basic approach is to build a web app, that gets approved and hosted by Microsoft. questions Anyone done this? Can you use jQuery in that web app? how do you debug the thing, running within Windows Live Messenger? EDIT: I tried using jQuery, but couldn't get it to do much of anything. I also couldn't debug it at all, when running within the IM client. The IE8 F12 debug tools are not available in that context. I believe the embedded browser was silently not loading external script, and then silently throwing exceptions. So I backed off to use only script in the .HTM file. Since it is Windows Live Messenger, the embedded browser is IE, so the generality made possible in jQuery isn't strictly necessary. I was able to use old-skool DHTML interfaces to get done, what I needed. I'm still interested in seeing examples of what other people have produced in the way of WLM Activities or games, using the Messenger Activity SDK. I think Flash is possible, and I think XAML is also possible, but I haven't seen source code examples for any of those.

    Read the article

  • Cleaner HTML Markup with ASP.NET 4 Web Forms - Client IDs (VS 2010 and .NET 4.0 Series)

    - by ScottGu
    This is the sixteenth in a series of blog posts I’m doing on the upcoming VS 2010 and .NET 4 release. Today’s post is the first of a few blog posts I’ll be doing that talk about some of the important changes we’ve made to make Web Forms in ASP.NET 4 generate clean, standards-compliant, CSS-friendly markup.  Today I’ll cover the work we are doing to provide better control over the “ID” attributes rendered by server controls to the client. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] Clean, Standards-Based, CSS-Friendly Markup One of the common complaints developers have often had with ASP.NET Web Forms is that when using server controls they don’t have the ability to easily generate clean, CSS-friendly output and markup.  Some of the specific complaints with previous ASP.NET releases include: Auto-generated ID attributes within HTML make it hard to write JavaScript and style with CSS Use of tables instead of semantic markup for certain controls (in particular the asp:menu control) make styling ugly Some controls render inline style properties even if no style property on the control has been set ViewState can often be bigger than ideal ASP.NET 4 provides better support for building standards-compliant pages out of the box.  The built-in <asp:> server controls with ASP.NET 4 now generate cleaner markup and support CSS styling – and help address all of the above issues.  Markup Compatibility When Upgrading Existing ASP.NET Web Forms Applications A common question people often ask when hearing about the cleaner markup coming with ASP.NET 4 is “Great - but what about my existing applications?  Will these changes/improvements break things when I upgrade?” To help ensure that we don’t break assumptions around markup and styling with existing ASP.NET Web Forms applications, we’ve enabled a configuration flag – controlRenderingCompatbilityVersion – within web.config that let’s you decide if you want to use the new cleaner markup approach that is the default with new ASP.NET 4 applications, or for compatibility reasons render the same markup that previous versions of ASP.NET used:   When the controlRenderingCompatbilityVersion flag is set to “3.5” your application and server controls will by default render output using the same markup generation used with VS 2008 and .NET 3.5.  When the controlRenderingCompatbilityVersion flag is set to “4.0” your application and server controls will strictly adhere to the XHTML 1.1 specification, have cleaner client IDs, render with semantic correctness in mind, and have extraneous inline styles removed. This flag defaults to 4.0 for all new ASP.NET Web Forms applications built using ASP.NET 4. Any previous application that is upgraded using VS 2010 will have the controlRenderingCompatbilityVersion flag automatically set to 3.5 by the upgrade wizard to ensure backwards compatibility.  You can then optionally change it (either at the application level, or scope it within the web.config file to be on a per page or directory level) if you move your pages to use CSS and take advantage of the new markup rendering. Today’s Cleaner Markup Topic: Client IDs The ability to have clean, predictable, ID attributes on rendered HTML elements is something developers have long asked for with Web Forms (ID values like “ctl00_ContentPlaceholder1_ListView1_ctrl0_Label1” are not very popular).  Having control over the ID values rendered helps make it much easier to write client-side JavaScript against the output, makes it easier to style elements using CSS, and on large pages can help reduce the overall size of the markup generated. New ClientIDMode Property on Controls ASP.NET 4 supports a new ClientIDMode property on the Control base class.  The ClientIDMode property indicates how controls should generate client ID values when they render.  The ClientIDMode property supports four possible values: AutoID—Renders the output as in .NET 3.5 (auto-generated IDs which will still render prefixes like ctrl00 for compatibility) Predictable (Default)— Trims any “ctl00” ID string and if a list/container control concatenates child ids (example: id=”ParentControl_ChildControl”) Static—Hands over full ID naming control to the developer – whatever they set as the ID of the control is what is rendered (example: id=”JustMyId”) Inherit—Tells the control to defer to the naming behavior mode of the parent container control The ClientIDMode property can be set directly on individual controls (or within container controls – in which case the controls within them will by default inherit the setting): Or it can be specified at a page or usercontrol level (using the <%@ Page %> or <%@ Control %> directives) – in which case controls within the pages/usercontrols inherit the setting (and can optionally override it): Or it can be set within the web.config file of an application – in which case pages within the application inherit the setting (and can optionally override it): This gives you the flexibility to customize/override the naming behavior however you want. Example: Using the ClientIDMode property to control the IDs of Non-List Controls Let’s take a look at how we can use the new ClientIDMode property to control the rendering of “ID” elements within a page.  To help illustrate this we can create a simple page called “SingleControlExample.aspx” that is based on a master-page called “Site.Master”, and which has a single <asp:label> control with an ID of “Message” that is contained with an <asp:content> container control called “MainContent”: Within our code-behind we’ll then add some simple code like below to dynamically populate the Label’s Text property at runtime:   If we were running this application using ASP.NET 3.5 (or had our ASP.NET 4 application configured to run using 3.5 rendering or ClientIDMode=AutoID), then the generated markup sent down to the client would look like below: This ID is unique (which is good) – but rather ugly because of the “ct100” prefix (which is bad). Markup Rendering when using ASP.NET 4 and the ClientIDMode is set to “Predictable” With ASP.NET 4, server controls by default now render their ID’s using ClientIDMode=”Predictable”.  This helps ensure that ID values are still unique and don’t conflict on a page, but at the same time it makes the IDs less verbose and more predictable.  This means that the generated markup of our <asp:label> control above will by default now look like below with ASP.NET 4: Notice that the “ct100” prefix is gone. Because the “Message” control is embedded within a “MainContent” container control, by default it’s ID will be prefixed “MainContent_Message” to avoid potential collisions with other controls elsewhere within the page. Markup Rendering when using ASP.NET 4 and the ClientIDMode is set to “Static” Sometimes you don’t want your ID values to be nested hierarchically, though, and instead just want the ID rendered to be whatever value you set it as.  To enable this you can now use ClientIDMode=static, in which case the ID rendered will be exactly the same as what you set it on the server-side on your control.  This will cause the below markup to be rendered with ASP.NET 4: This option now gives you the ability to completely control the client ID values sent down by controls. Example: Using the ClientIDMode property to control the IDs of Data-Bound List Controls Data-bound list/grid controls have historically been the hardest to use/style when it comes to working with Web Form’s automatically generated IDs.  Let’s now take a look at a scenario where we’ll customize the ID’s rendered using a ListView control with ASP.NET 4. The code snippet below is an example of a ListView control that displays the contents of a data-bound collection — in this case, airports: We can then write code like below within our code-behind to dynamically databind a list of airports to the ListView above: At runtime this will then by default generate a <ul> list of airports like below.  Note that because the <ul> and <li> elements in the ListView’s template are not server controls, no IDs are rendered in our markup: Adding Client ID’s to Each Row Item Now, let’s say that we wanted to add client-ID’s to the output so that we can programmatically access each <li> via JavaScript.  We want these ID’s to be unique, predictable, and identifiable. A first approach would be to mark each <li> element within the template as being a server control (by giving it a runat=server attribute) and by giving each one an id of “airport”: By default ASP.NET 4 will now render clean IDs like below (no ctl001-like ids are rendered):   Using the ClientIDRowSuffix Property Our template above now generates unique ID’s for each <li> element – but if we are going to access them programmatically on the client using JavaScript we might want to instead have the ID’s contain the airport code within them to make them easier to reference.  The good news is that we can easily do this by taking advantage of the new ClientIDRowSuffix property on databound controls in ASP.NET 4 to better control the ID’s of our individual row elements. To do this, we’ll set the ClientIDRowSuffix property to “Code” on our ListView control.  This tells the ListView to use the databound “Code” property from our Airport class when generating the ID: And now instead of having row suffixes like “1”, “2”, and “3”, we’ll instead have the Airport.Code value embedded within the IDs (e.g: _CLE, _CAK, _PDX, etc): You can use this ClientIDRowSuffix approach with other databound controls like the GridView as well. It is useful anytime you want to program row elements on the client – and use clean/identified IDs to easily reference them from JavaScript code. Summary ASP.NET 4 enables you to generate much cleaner HTML markup from server controls and from within your Web Forms applications.  In today’s post I covered how you can now easily control the client ID values that are rendered by server controls.  In upcoming posts I’ll cover some of the other markup improvements that are also coming with the ASP.NET 4 release. Hope this helps, Scott

    Read the article

  • SQL Server Analysis Services 2005 crash when disk is full?

    - by squillman
    One of our SQL boxes ran itself out of disk space last night. This particular server has both the database engine and analysis services on it. Database engine was not happy about having no disk space on the volume where all the data files are, but analysis services just plain died. At least, the only thing I have to blame is the full volume. Has anyone experienced a SSAS that they've been able to directly tie to no disk space? I've got nothing else in the SQL or event logs to blame...

    Read the article

  • Delete a directory with pipe (|) in its name?

    - by Dave Jarvis
    Without booting to Linux, how do you delete a directory that was created in Linux on an NTFS partition that contains a pipe in the file name? For example: f:\flac\foreign\Yoshida_Brothers\Best_of_Yoshida_Brothers_|_Tsugaru_Shamisen Tried and failed: Midnight Commander Recursively deleting the parent folder del /f /s /q Yoshida_Brothers del /f /s /q "\\?f:\flac\foreign\Yoshida_Brothers\" rmdir /s Yoshida_Brothers rmdir Best* FileASSASSIN Cannot delete folder Other ideas?

    Read the article

  • one svn account for each programmer?

    - by ajsie
    i should have one svn user for each programmer in the ubuntu server? is this accomplished by using "htpasswd" 4 times for 4 programmers? how do i couple all these users to same group so that i could modify file access specific for the svn group and all its members?

    Read the article

  • Disable work offline in Internet Explorer 8

    - by Roberto Liffredo
    I am using Windows 7, and IE8. Every time I have GMail open in IE8, and I resume from sleep, I get the question about working offline - even if at that momoent the wireless connection is available. This is particularly sad, because all browsing is stopped until I dismiss that dialog, that may be hidden below other windows. As I am not using offline browsing at all, is it possible to disable the functionality altogether, so that I no longer get the question? A bit like in Firefox, where I simply get the error message with page unavailable. I have googled a bit, but no luck so far. Even a direct modification of the registry would be fine, for me.

    Read the article

  • Possible to track Outlook tasks on Windows Mobile

    - by Nick Seeber
    I'm trying to view/add/edit MS Outlook 2007 tasks on a work PDA running Windows Mobile 6 Professional (sync'ed with MS Exchange 2007). 1) is this possible? From a quick Google search I can't find anything... However I may be missing something obvious. 2) if not, any ideas about work-arounds? Thanks

    Read the article

  • How to enable Automatic Sorting of IEnumerable Data in GridView?

    - by ace
    How can I enable automatic sorting of my BLL which returns a List CustomerList:List in a GridView? Customer is my own strongly typed class and CustomerList is a List of customers. I know one approach is to set the AllowSorting property to true in the GridView and handle the OnSorting event and call a sorting method defined in my CustomerList class. However I would like a solution which is automatic in the sense that I do not have to handle the OnSorting Event, it should be like how GridView handles automatic sorting for DataView, DataTable, and DataSet. Is there an Interface I need to implement on my CustomerList or Customer class that will enable that functionality?

    Read the article

  • Can you recommend an alternative for NCover?

    - by Keith
    I'm looking for a good .Net code coverage alternative to NCover (insufficient .Net 3.5 coverage and now pay-for) or VSTS (way too expensive). We currently test with NUnit, but could switch to something with a similar 'layout' for its text fixtures if it were better integrated.

    Read the article

  • Webservice Connection Refused

    - by sidcom
    I have developed a web app using a webservice. Everything works fine in the development environment. I have moved the webservice to the production server in a test folder behind my main website. I can browse to the published service localy on the production server and i can access the remote service from my development machine. If I run my web app in my development environment I can use the remote webservice no problem. If I move the web application to the production environment the browser outputs this error when the application performs the ajax login method. The following javascript error is output to the browser Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500 Source File: www.grav80.com/clients/callswharf/Redshift/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_HiddenField&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a1247b7d8-6b6c-419f-a45f-8ff264c90734%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2009.2.826.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ad2d891f5-3533-469c-b9a2-ac7d16eb23ff%3a16e4e7cd%3a86526ba7%3aed16cbdc%3ab7778d6c Line: 15 The Following error appears in the event log Exception information: Exception type: WebException Exception message: Unable to connect to the remote server Request information: Request URL: www.grav80.com/clients/callswharf/redshift/login.aspx Request path: /clients/callswharf/redshift/login.aspx User host address: 77.68.58.231 User: Is authenticated: False Authentication Type: Thread account name: NT AUTHORITY\NETWORK SERVICE You can view the behaviour in the test environment here. http://www.grav80.com/clients/callswharf/redshift/ You can view the service here http://www.grav80.com/clients/callswharf/redshift/service/g80cms.asmx I hope some on can shine some light on this for me.

    Read the article

  • Building a complex view with Three20 - resources?

    - by psychotik
    I'm using three20 for most of my iPhone app. One of the views I need to create is relatively complex. It needs a top bar (under the nav bar) with some controls and label, an image view below this bar (which occupies most of the body) and another bottom bar with more controls and labels (above the tab bar control). I don't have much UI experience - my only experience with anything UI is laying stuff out using CSS, etc on websites. Apple's online doc seems to assume that the reader knows a bunch about rectangles, layouts, frames, etc or is using InterfaceBuilder. And three20 isn't too well documented either. So my question is: Is it possible to design something like what I describe in IB and then still have a three20-based app use it? If so, any tips/pointers on how would be much appreciated. Can you point me to some documentation that explain how views/controls etc are rendered. I'm pretty sure I can figure it out if I find some decent explanation/tutorial for it.

    Read the article

  • Java: Use jar library's from package manager in Linux.

    - by jonescb
    I'm trying to find the best way to use Java libraries that were installed by the package manager instead of just putting a copy into ${project.root}/lib My distro, Gentoo, has a package for Java libraries like jdbc-postgresql. It's installed to /usr/share/jdbc-postgresql/lib/jdbc-postgresql.jar I assume that this path may be different in Ubuntu, Fedora, or Arch. Is there any way to do like what C does? Where you just add a -lfoo, and the linker would find libfoo.so. I'm using Ant 1.8.0 and Java 1.6.0_19.

    Read the article

  • websvn: change url/websvn to url/something_else?

    - by ajsie
    i have installed websvn using apt-get install websvn in ubuntu server. i can access it through http://url/websvn in my web browser but how do i change this to http://url/something_else ? cause i dont want other to know the path of it. i cant find the configuration for this in /etc. thanks

    Read the article

  • Array of pointers in objective-c

    - by Justin
    I'm getting confused by pointers in objective-c. Basically I have a bunch of static data in my code. static int dataSet0[2][2] = {{0, 1}, {2, 3}}; static int dataSet1[2][2] = {{4, 5}, {6, 7}}; And I want to have an array to index it all. dataSets[0]; //Would give me dataSet0... What should the type of dataSets be, and how would I initialize it?

    Read the article

  • Firefox Sprite Sheet Image Not Showing Up

    - by ttony21
    I'm trying to create a chat room with emoticons. When a user types an emoticon such as :) in the chatroom, the CSS takes the proper image off the sprite sheet. But my code only seems to work in Opera and IE (odd combination). It doesn't show in Firefox or Chrome (if you manage to hone in exactly where the image should be, you can find the image blank.gif which is used as the stand-in to place the background-url over). Does anyone know what might cause this in Firefox/Chrome? Site: ttony21.byethost24.com Relevant CSS: image.emo { width:19px; height:19px; } image#smile { background:url(img/diceSprite.png) 0 0; } image#bigsmile { background:url(img/diceSprite.png) -19px 0; } etc... Relevant HTML: <img class="emo" id = "smile" src="img/blank.gif" width="1" height="1" alt=":)" title=":)" /> <img class="emo" id = "bigsmile" src="img/blank.gif" width="1" height="1" alt=":D" title=":D" /> etc...

    Read the article

  • Problem with detecting the value of the drop down list on the server (servlet) side

    - by Harry Pham
    Client code is pretty simple: <form action="DDServlet" method="post"> <input type="text" name="customerText"> <select id="customer"> <option name="customerOption" value="3"> Tom </option> <option name="customerOption" value="2"> Harry </option> </select> <input type="submit" value="send"> </form> Here is the code on the Servlet Enumeration paramNames = request.getParameterNames(); while(paramNames.hasMoreElements()){ String paramName = (String)paramNames.nextElement(); //get the next element System.out.println(paramName); } When I print out, I only see, customerText, but not customerOption. Any idea why guys? What I hope is, if I select Tom in my option, once I submit, on my servlet I should able to do this: String paramValues[] = request.getParameterValues(paramName); and get back value of 3

    Read the article

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