Daily Archives

Articles indexed Tuesday January 4 2011

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

  • Problem with validating ModelForm

    - by user561640
    I use ModelForm to create my form. All works fine except 1 thing - validating the unique field. Code: class Article(models.Model): ... title = models.CharField(max_length=255, unique=True, error_messages={'max_length' : 'max translation', 'unique' : 'unique translation', 'required' : 'req translation',}) ... class ArticleForm(ModelForm): ... title = forms.CharField(max_length=255, min_length=3, error_messages={'required' : 'req translation', 'min_length' : 'min translation', 'max_length' : 'max translation', 'unique' : 'unique translation',}) But when I save my form with non-unique title I don't get my custom translated error but I get default error. How to fix it, that my unique field error is displayed?

    Read the article

  • How do I make faint words in search bar that go away when you click/type?

    - by Razor Storm
    So, for instance facebook's search bar has faint word that says "search", but when you click on the bar, it becomes blank and you may begin typing, when you click away the "search" goes back. Similarly, SO's ask a question title box has faint words that go away when you start typing. I'm not too sure what this effect is called, but I'm wondering if theres a jQuery plugin that helps to achieve this. This isn't particularly difficult to program, but I thought why reinvent the wheel if someone already made a plugin for it.

    Read the article

  • How can you Merge sort a .Net framework LinkedList (of T)

    - by Andronicus
    There's a few questions discussing Merge sorting a LinkedList, but how can I do it with the C# LinkedList? Since the LinkedListNode Next and Previous properties are read-only most of the in-place algorithms I've come across are not possible. I've resorted to removing all the nodes, sorting them with a .OrderBy(node = node.Value) and then re-inserting them into the Linked list, but it's fairly crude.

    Read the article

  • WCF: intercept message send/receive progress in client

    - by Cullen Tsering
    Hello gurus, I have a desktop application sending/receiving messages (not files) to/from a WCF service. How do I intercept the total size of the message to be transferred and receive feedback (number of bytes transferred) during the transmission so a progress bar maybe displayed to the desktop app user? How many approaches are there? What is the best one given my application scenario? Any comments or suggestions will be greatly appreciated, Cullen

    Read the article

  • Html Agility Pack: Setting an HtmlNode's Attribute Value isn't reflected in the HtmlDocument.

    - by Avi
    In Html Agility Pack, when I set an attribute of an HtmlNode, should I see this in the HtmlDocument from which the node was selected? Lets say that htmlDocument is an HtmlDocument. So the simplified code looks like this: HtmlNode documentNode = htmlDocument.DocumentNode; HtmlNodeCollection nodeCollection = documentNode.SelectNodes(someXPath); foreach(var node in nodeCollection) if(SomeCondition(node)) node.SetAttributeValue("class","something"); Now, I see the class attribte of node change, but I don't see this change reflected in the htmlDocument's html.

    Read the article

  • Is it possible to merge two MySQL databases into one?

    - by Mike L.
    Lets say I have two MySQL databases with some complex table structures. Neither database has the same table name. Lets say these tables contain no rows (they do but I could truncate the tables, the data is not important right now, just testing stuff). Lets say I need these 2 databases merged into one. For instance: DB1: cities states DB2: index subindex posts I want to end up with a single DB that contains: cities states index subindex posts Is this possible?

    Read the article

  • remove the id attribute from a div using jquery?

    - by getaway
    i want to remove the id attribute from this image: <img width="270" class="thumb" id="thumb" height="270" src="img/1_1.jpg" /> i tried doing this: $('img#thumb').RemoveAttr('id','none'); but its not remving it! thanks EDIT: $('img#thumb').attr('src', response); $('img#thumb').attr('id', 'nonthumb'); this deosnt load the picture, or in this case the src!! but when i remove the id attribute, it works fine

    Read the article

  • Utilizing Generics to make a Class structure more mutable…

    - by Keith Barrows
    While the ASP.NET GridView control supports automatic paging I found it faster to use custom paging in several situations.  I found myself rewriting the same code over and over just to add the basic sorting capabilities to an ASP.NET GridView object.  So today I took just a little bit of time to encapsulate it all into a Class I can use and reuse on any page with a GridView.  In fact, it will probably take longer to write this blog entry than it took to encapsulate the functionality...(read more)

    Read the article

  • Top 10 Posts in 2010

    - by dwahlin
    Blogging’s a lot of fun and a great way to share what you’ve learned. It’s also a great way to learn based upon comments people leave that help you see things in an entirely new way in some cases.  Since we’ve now moved on to 2011 (Happy New Year’s!) I wanted to list the Top 10 posts from my blog during 2010 based on individual views.  Thanks to everyone who follows my blog and adds comments from time to time. Here’s wishing everyone a great 2011!   1. Reducing Code by Using jQuery Templates 2. Integrating HTML into Silverlight Applications 3. Silverlight is Dead, the Moon is Made of Cheese, and HTML 5 is Ready for Prime Time 4. Understanding the Role of Commanding in Silverlight 4 Applications 5. New Article – Getting Started with WCF RIA Services 6. Simplify Your Code with LINQ 7. My Favorite iPad Apps….So Far 8. Final Release of Silverlight Tools for Visual Studio 2010 Released 9. Handling WCF Service Paths in Silverlight 4 – Relative Path Support 10. Tales from the Trenches – Building a Real-World Silverlight Line of Business Application   Getting Started with the MVVM Pattern in Silverlight Applications – Posted late 2009 so I’m giving it honorable mention status since it’s still one of the most popular posts.

    Read the article

  • Routing in ASP.Net 4.0 Web Forms

    - by nikolaosk
    In this blog post I would like to talk about a new ASP.Net 4.0 feature, URL Routing . I know this issue has been explained from various people on the web but I will give my own example. We could implement routing since ASP.Net 3.5 SP1 but it was there primarily to support ASP.Net MVC . Even in that release you could implement rounting in web forms but it was a quite difficult thing to do. However in ASP.Net 4.0 there is an integrated support for routing. It becomes easy to map requests in your site...(read more)

    Read the article

  • Hostname issue (Linux)

    - by Dremarturg
    Hey, I have a strange problem: I have a mail-server. And I have a strange issue with hostnames on ubuntu. When I send an e-mail there is a line in the headers: Received from domain (ip6-localhost [127.0.0.1]) but my hosts file does not have domain.com The domain does not really fit in since domain.com was just for testing and I want to get rid of this! /etc/hosts and etc/hostname do not have an entry for domain.com. Any ideas? (Reverse DNS is okay)

    Read the article

  • MySQL root user can't access database

    - by Ed Schofield
    Hi all, We have a MySQL database ('myhours') on a production database server that is accessible to one user ('edsf') only, but not to the root user. The command 'SHOW DATABASES' as the root user does not list the 'myhours' database. The same command as the 'edsf' user lists the database: mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | information_schema | | myhours | +--------------------+ 2 rows in set (0.01 sec) Only the 'edsf' user can access the 'myhours' database with 'USE myhours'. Neither user seems to have permission to grant further permissions for this database. My questions are: Q1. How is it that the root user does not have permission to use the database? How could this have come about? The output of SHOW GRANTS FOR 'root'@'localhost'; looks fine to me: GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*xxx' WITH GRANT OPTION Q2. How can I recover this situation to make this database visible to the MySQL root user and grant further permissions on it? Thanks in advance for any help! -- Ed

    Read the article

  • SSL Certificate

    - by Dremarturg
    Hey, I have a mail-server running and I want to buy a SSL-Certificate as they are pretty cheap now. I use mail.domain.com as reverse-DNS, POP3 and SMTP clients use mail.domain.com (some use pop3.domain.com and smtp.domain.com) for sending and receiving e-mails. The SSL-Submission asks me for a domain - is it mail.domain.com or domain.com as I do not have a Wildcard-SSL? I just want to use it for Mail. Or is it possible to use it for both by using domain.com? (Apache and Postfix/Courier on the same server and IP)

    Read the article

  • Intermittently uncommunicative subnets

    - by mhd
    Last week proved me a veritable Cassandra: I've always said that it's a bad idea to have only one firewall/router, without a backup or failover. And thus our Cisco PIX went haywire, refusing to route properly. And of course, the only one available here on short notice is me, and while I'm quite grounded in Linux, I'm really a developer not a sysadmin (the fact that this hit me on sysadmin appreciation day is a bit ironic). Anyway, this weekend I tried to hack up a temporary solution: I used an old server with enough NICs (two built-in, four on a card) to serve as a gateway and firewall. Due to some problems with the raid controller, I got only two router distros running, and between Untangle and Ebox I decided for the latter. Now everything is quite okay. I've got all the different subnets we've got here (all with separate switches) talking to each other and even to the internet (Cisco 2800 router, T1 lines). But from time to time (20-60 minute intervals), I get a total routing failure. Our main, office subnet can't talk to our server subnet and can't connect to the internet. This is not the end of a gradual slowdown, either everything's working perfectly or I get a total lack of communication for about two minutes each time. Now I'm a bit at wits end what to check. At least with the default EBox setup, nothing in /var/log shows anything weird and it doesn't exactly have lots of built-in monitoring tools. So I'm hoping someone here could give me some pointers about what to look out for. I did change the ethernet cable from the office switch to the firewall, with no results. I might change switches, although within the switch it seems to work ok enough. Edit: I'm not sure whether this is the sole cause of the problem, but after I noticed a few DHCP entries just before the last drop of connectivity, I tried to reproduce that. And alas, whenever I renew a DHCP connection, I can't access other subnets anymore. Running ISC DHCPD 3.0.6.

    Read the article

  • Best Free Windows Imaging Software For Servers

    - by Justin
    We are running two physical servers both Windows 2003, not virtualized. What is the best free (if any) windows software to take a full image backup of the entire drives? If possible, while the image is taking place, it should not bring the hosts to their knees with excess CPU or I/O usage. The servers have RAID mirroring, but after hearing a few horror stories about hacked systems, we need to have weekly full image backups, so we can simply revert to a pre-hacked image. Thanks.

    Read the article

  • Latexmk on OS X

    - by Barum Rho
    Does anyone use latexmk on OS X with either Preview or another PDF, dvi, or PS reader? I've recently switched from Linux and installed MacTex to use Latex. I am used to using Vim to edit the source file and having latex -pvc running so that it will update the preview on xdvi upon save. I am aware that I can run xdvi using XQuartz, but I have it setup to run fullscreen, so it is not very useful when I don't want to go into X11 mode altogether. The problem with using Preview is that it will only update from the PDF file when Preview receives focus. I could not figure out if there is a command to trigger Preview to reload the PDF file.

    Read the article

  • Thunderbird: mails not displayed while everything worked a few minutes ago

    - by roland
    Hi all, I upgraded my Kaspersky and I closed everything before launching the upgrade process. Everything went well, but when I launched my Thunderbird, no mail and content were displayed. Everything is blank. Strangely my accounts are detected when expanding Tools/Account Settings. I completely closed Kaspersky and launched Thunderbird again, but it fixed nothing :( It is as if closing Thunderbird has damaged a core file. Any idea how to fix it? Thanks. Roland

    Read the article

  • Huh? JDK not found? (on Windows 7 64-bit)

    - by Android Eve
    I am setting up a development environment for the latest Android 2.3 on a fresh install of Windows 7 64-bit. I first installed the 64-bit JDK 6 (jdk-6u23-windows-x64.exe). Then, I installed 64-bit Eclipse Classic 3.6 (eclipse-SDK-3.6.1-win32-x86_64.zip). Then, I proceed to install the Android SDK Starter Package: installer_r08-windows.exe. But... upon start it says: "Java SE Development Kit (JDK) not found." Why? I just installed it. Is this a mismatch between 32-bit and 64-bit? How do I solve this? Update (1): I tried setting the %JAVA_HOME% environment variable, as well as setting the Installed JREs in Eclipse, as suggested below. None of these solved the problem. It appears that I am not the only experiencing the problem, as this thread suggests: http://stackoverflow.com/questions/1919340/android-sdk-setup-under-windows-7-pro-64-bit I wonder whether there is a 64-bit version of the Android SDK. Update (2): I used the zip version instead (android-sdk_r08-windows.zip), ran android.bat, updated all SDK packages, and installed the ADT plugin (8.0.1), not before having to check: 'Contact all update sites during install to find required software'. We'll see how this goes... Update (3): It worked! (going to accept @bubu's answer shortly) -- but why doesn't the emulator include the HelloAndroid app when I run it (Ctrl+F11) from Eclipse?

    Read the article

  • Live overclocking on Windows

    - by Cyclone
    I saw this question and just had to ask. How can I do this on my own PC, where do I find this software if it exists for your computer and what can I do? I never considered overclocking before because I know myself and I know I'd mess up my hardware in some stupid accident or mistake, but if I can just do it through software it'd be nice to give it a shot. It's an Inspiron 1520 laptop, and I'd be happy to provide any other information you need to assist me in this.

    Read the article

  • Is there an Installer Analyser tool that can list what Registry Keys will be created?

    - by EvoGamer
    I can think of 3 ways to achieve my goal: Create a clean VPC, install a given piece of software, and compare the before and after states. Somehow reverse-engineer the installer. Somehow redirect the output of the installer in question so that all registry calls and copy/move file commands are recorded, but not executed. The first option can be done manually, or potentially automated, but I feel it's rather OTT for my needs. The second could cause all sorts of licencing issues, not to mention it may not always return a correct result. Also, without delving into hex editing, I can't think of a way that it would be possible to do manually (some installers - eg Anti-Virus software - may react unfavourably on automated attempts to investigate the installer). The third option shows the most promise, although if the first could be stripped down into a lightweight throwaway environment, it would work pretty much the same way. However, I'm not sure how to do it. So my question is: What tools are available (if any) and/or how could I find out this information manually? I'm not looking to reverse-engineer anything (if I can help it), but I just want to know exactly what changes are being made to my PC by a given piece of software.

    Read the article

  • Thunderbird 3.1.7 file system and file extensions

    - by Sharon Bode
    I have lost all email messages and folders in my Thunderbird program. Where can I look for them? The messages were organized in folders for several years. My system is Windows XP. I have looked in the Thunderbird Profiles default profile folder. I can see Inbox and Trash but none of the other folders I have set up are visible. I cannot directly open Inbox or Trash so I don't know if my lost messages are in these folders. Others in the Community Forum seem to have the same problem but no one has answered them or me. Is there someone in this community who can help? Thank you, Sharon Bode

    Read the article

  • Automatic acronym and jargon expansion tool

    - by Ivo Bosticky
    Are there any tools that would help with comprehension of technical documents that contain a mix of domain specific and company specific acronyms and jargon? A tool that is functionally similar to the automatic acronym expansion done by Wikileaks in their Afgan War Diary (as seen at http://213.251.145.96/id/310B4FC4-2F89-4653-A546-1AD5D55BD9F7/) but ideally supports PDF or Microsoft Word documents. The list of acronyms and jargon and their expanded text could be provided in a separate file.

    Read the article

  • SQL SERVER – 2008 – Unused Index Script – Download

    - by pinaldave
    Download Missing Index Script with Unused Index Script Performance Tuning is quite interesting and Index plays a vital role in it. A proper index can improve the performance and a bad index can hamper the performance. Here is the script from my script bank which I use to identify unused indexes on any database. Please note, if you should not drop all the unused indexes this script suggest. This is just for guidance. You should not create more than 5-10 indexes per table. Additionally, this script sometime does not give accurate information so use your common sense. Any way, the scripts is good starting point. You should pay attention to User Scan, User Lookup and User Update when you are going to drop index. The generic understanding is if this values are all high and User Seek is low, the index needs tuning. The index drop script is also provided in the last column. Download Missing Index Script with Unused Index Script -- Unused Index Script -- Original Author: Pinal Dave (C) 2011 SELECT TOP 25 o.name AS ObjectName , i.name AS IndexName , i.index_id AS IndexID , dm_ius.user_seeks AS UserSeek , dm_ius.user_scans AS UserScans , dm_ius.user_lookups AS UserLookups , dm_ius.user_updates AS UserUpdates , p.TableRows , 'DROP INDEX ' + QUOTENAME(i.name) + ' ON ' + QUOTENAME(s.name) + '.' + QUOTENAME(OBJECT_NAME(dm_ius.OBJECT_ID)) AS 'drop statement' FROM sys.dm_db_index_usage_stats dm_ius INNER JOIN sys.indexes i ON i.index_id = dm_ius.index_id AND dm_ius.OBJECT_ID = i.OBJECT_ID INNER JOIN sys.objects o ON dm_ius.OBJECT_ID = o.OBJECT_ID INNER JOIN sys.schemas s ON o.schema_id = s.schema_id INNER JOIN (SELECT SUM(p.rows) TableRows, p.index_id, p.OBJECT_ID FROM sys.partitions p GROUP BY p.index_id, p.OBJECT_ID) p ON p.index_id = dm_ius.index_id AND dm_ius.OBJECT_ID = p.OBJECT_ID WHERE OBJECTPROPERTY(dm_ius.OBJECT_ID,'IsUserTable') = 1 AND dm_ius.database_id = DB_ID() AND i.type_desc = 'nonclustered' AND i.is_primary_key = 0 AND i.is_unique_constraint = 0 ORDER BY (dm_ius.user_seeks + dm_ius.user_scans + dm_ius.user_lookups) ASC GO Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL Download, SQL Index, SQL Performance, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • History of open source software

    - by Victor Sorokin
    I've been always interested, out of the pure self-amusement, in the history of open software used today: who were the people which started it and what were the reasons to start what were design decisions at the start how software evolved over the time Specifically, I'm interested in following software: GCC X Linux kernel Java Of course, there is plenty of information in Internet to google for, but I thought it would be nice to have list of interesting resources at this site. I hope some of visitors of this site have similar interest and can share a link or two they found particularly amusing/interesting. To make this entry more question-like, here's straight question: what are the most interesting/amusing links about history of open source software?

    Read the article

  • Maintainability of Boolean logic - Is nesting if statements needed?

    - by Vaccano
    Which of these is better for maintainability? if (byteArrayVariable != null) if (byteArrayVariable .Length != 0) //Do something with byteArrayVariable OR if ((byteArrayVariable != null) && (byteArrayVariable.Length != 0)) //Do something with byteArrayVariable I prefer reading and writing the second, but I recall reading in code complete that doing things like that is bad for maintainability. This is because you are relying on the language to not evaluate the second part of the if if the first part is false and not all languages do that. (The second part will throw an exception if evaluated with a null byteArrayVariable.) I don't know if that is really something to worry about or not, and I would like general feedback on the question. Thanks.

    Read the article

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