Daily Archives

Articles indexed Tuesday January 11 2011

Page 20/37 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Subclassing Satchmo's Category model, but then getting the error "'Manager' object has no attribute 'root_categories'"

    - by hellsgate
    I'm using Satchmo as part of a website I'm currently building. At the moment I'm trying add more functions to the Satchmo Category class, but obviously I'm not going to make any changes to the Satchmo files. So, I thought that subclassing the Category class would give me a new class which contains all the Satchmo Category properties and methods while allowing me to add my own. However, either Python subclassing doesn't work like that, or I am doing it wrong. Here is the code I'm using to subclass Category: from product.models import Category class MyCategory(Category): """ additional functions to pull data from the Satchmo store app """ One of the methods I can normally use from the Category class is: Category.objects.root_categories() however, when I try to access MyCategory.objects.root_categories() I get the following error: AttributeError: 'Manager' object has no attribute 'root_categories' Can anyone point me in the right direction for solving this?

    Read the article

  • php domDocument variables

    - by geoffs3310
    Hi, I have the following code at the moment: $ip = '195.72.186.157'; $xmlDoc = new DOMDocument(); $xmlDoc->loadXML(file_get_contents('http://www.geoffmeierhans.com/services/geo-locator/locate/?ip='.$ip.'&output=xml')); foreach($xmlDoc->getElementsByTagName('city') as $link) { $links = array('text' => $link->nodeValue); } $city = $links['text']; echo $city; Is there a better way to get the city variable? Since there is only one tag called city a loop isn't really needed but I can't get it to work any other way

    Read the article

  • Problem sending email with Codeigniter - Headers sent in the message body

    - by Brian
    Having a strange issue with the email class in codeigniter. When I send email directly to my gmail account email address, it works fine. However if I send email to a different email address and use POP3 to import that email address into gmail, then for some reason all the headers are included in the message. Here's the code for sending the email: $this->email->clear(); $config['mailtype'] = "html"; $this->email->initialize($config); $this->email->set_newline("\r\n"); $this->email->from('[email protected]', 'Website'); $this->email->to('[email protected]'); $this->email->message($message); Here's what arrives in my inbox when the email is sent to an account which is imported into gmail via POP3: Date: Fri, 7 Jan 2011 15:07:04 +0000 From: "Website" <[email protected]> Reply-To: "[email protected]" <[email protected]> X-Sender: [email protected] X-Mailer: CodeIgniter X-Priority: 3 (Normal) Message-ID: <[email protected]> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_4d272c1835c46" This is a multi-part message in MIME format. Your email application may not support this format. --B_ALT_4d272c1835c46 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit this is the email message content --B_ALT_4d272c1835c46 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable <html> <body> <p>this is the email message content </p> </body> </html> --B_ALT_4d272c1835c46--

    Read the article

  • eclispe workspace backup

    - by MarcoS
    What do I lose if I skip the .metadata/ directory when doing the back-up of my eclipse workspace? (is there some documentation describing what eclipse stores in this directory)? I've noticed that it changes very often (essentially every time that I use eclipse (galileo). I've seen this question, but I'm not interested in doing a back-up of plug-ins and settings (also because I'm not sure that they would work properly when restored after a re-installation of my PC or on a new PC). I'm just interested in doing a back-up of my projects (source code, libraries, possible data, .svn and .git directories). So, can I safely ignore the .metadata/ directory?

    Read the article

  • Add links to specific words within span tag in PHP

    - by dazhall
    I have a list of words that I'd like to add a link to, I can do this fairly easily using preg_match_all and preg_replace: $str = "<span class=\"cz\">Dám si jedno pivo prosím.</span> = I'll have a beer please."; preg_match_all('/[a-ztúuýžácdéeínórš]+/i',$str,$matches); $matches = array_unique($matches[0]); foreach ($matches as $match) { if(!empty($words[$match])) { $str = preg_replace("/(^|[^\w]){1}(".preg_quote($match,"/").")($|[^\w]){1}/i", '\\1<a href="#">\\2</a>\\3', $str); } } echo $str; What I'd like to do is restrict the linking to only within the span tag. My brain is all regex-ed out, so any help would be appreciated! Thanks! Darren.

    Read the article

  • How do I use HttpWebRequest GET method w/ ContentType="application/json"

    - by Stephen Patten
    Hello, This one is real simple, run this Silverlight4 example with the ContentType property commented out and you'll get back a response from from my service in xml. Now uncomment the property and run it and you'll get an ProtocolViolationException, what should happen is the service returns JSON formatted data. HttpWebRequest wreq = (HttpWebRequest)WebRequestCreator.ClientHttp.Create(new Uri("http://stephenpattenconsulting.com/Services/GetFoodDescriptionsLookup(2100)")); //wreq.ContentType = "application/json"; wreq.BeginGetResponse((cb) => { HttpWebRequest rq = cb.AsyncState as HttpWebRequest; HttpWebResponse resp = rq.EndGetResponse(cb) as HttpWebResponse; // Exception StreamReader rdr = new StreamReader(resp.GetResponseStream()); string result = rdr.ReadToEnd(); rdr.Close(); }, wreq); EDIT: While perusing SO, I noticed similar posts, like this one Why am I getting ProtocolViolationException when trying to use HttpWebRequest? and this one How do I use HttpWebRequest with GET method EDIT: The WCF 4 end point is 'adapted' from this link http://geekswithblogs.net/michelotti/archive/2010/08/21/restful-wcf-services-with-no-svc-file-and-no-config.aspx. I can use Fiddler's request builder to to construct the proper requests and changing the content type does yield the correct results.

    Read the article

  • Silverlight Cream for January 11, 2011 -- #1024

    - by Dave Campbell
    1,000 blogposts is quite a few, but to die-hard geeks, 1000 isn't the number... 1K is the number, and today is my 1K blogpost! I've been working up to this for at least 11 months. Way back at MIX10, I approached some vendors about an idea I had. A month ago I contacted them and others, and everyone I contacted was very generous and supportive of my idea. My idea was not to run a contest, but blog as normal, and whoever ended up on my 1K post would get some swag... and I set a cut-off at 13 posts. So... blogging normally, I had some submittals, and then ran my normal process to pick up the next posts until I hit a total of 13. To provide a distribution channel for the swag, everyone on the list, please send me your snail mail (T-shirts) and email (licenses) addresses as soon as possible.   I'd like to thank the following generous sponsors for their contributions to my fun (in alphabetic order): and Rachel Hawley for contributing 4 Silverlight control sets First Floor Software and Koen Zwikstra for contributing 13 licenses for Silverlight Spy and Sara Faatz/Jason Beres for contributing 13 licenses for Silverlight Data Visualization controls and Svetla Stoycheva for contributing T-Shirts for everyone on the post and Ina Tontcheva for contributing 13 licenses for RadControls for Silverlight + RadControls for Windows Phone and Charlene Kozlan for contributing 1 combopack standard, 2 DataGrid for Silverlight, and 2 Listbox for Silverlight Standard And now finally...in this Issue: Nigel Sampson, Jeremy Likness, Dan Wahlin, Kunal Chowdhurry, Alex Knight, Wei-Meng Lee, Michael Crump, Jesse Liberty, Peter Kuhn, Michael Washington, Tau Sick, Max Paulousky, Damian Schenkelman Above the Fold: Silverlight: "Demystifying Silverlight Dependency Properties" Dan Wahlin WP7: "Using Windows Phone Gestures as Triggers" Nigel Sampson Expression Blend: "PathListBox: making data look cool" Alex Knight From SilverlightCream.com: Using Windows Phone Gestures as Triggers Nigel Sampson blogged about WP7 Gestures, the Toolkit, and using Gestures as Triggers, and actually makes it looks simple :) Jounce Part 9: Static and Dynamic Module Management Jeremy Likness has episode 9 of his explanation of his MVVM framework, Jounce, up... and a big discussion of Modules and Module Management from a Jounce perspective. Demystifying Silverlight Dependency Properties Dan Wahlin takes a page from one of his teaching opportunities, and shares his knowledge of Dependency Properties with us... beginning with what they are, defining them in code, and demonstrating their use. Customizing Silverlight ChildWindow Style using Blend Kunal Chowdhurry has a great post up about getting your Child Windows to match the look & feel of the rest of youra app... plus a bunch of Blend goodness thrown in. PathListBox: making data look cool File this post by Alex Knight in the 'holy crap' file along with the others in this series! ... just check out that cool Ticker Style Path ListBox at the top of the blog... too cool! Web Access in Windows Phone 7 Apps Wei-Meng Lee has the 3rd part of his series on WP7 development up and in this one is discussing Web Access... I mean *discussing* it... tons of detail, code, and explanation... great post. Prevent your Silverlight XAP file from caching in your browser. Michael Crump helps relieve stress on Silverlight developers everywhere by exploring how to avoid caching of your XAP in the browser... (WPFS) MVVM Light Toolkit: Soup To Nuts Part I Jesse Liberty continues his Windows Phone from Scratch series with a new segment exploring Laurent Bugnion's MVVMLight Toolkit beginning with acquiring and installing the toolkit, then proceeds to discuss linking the View and ViewModel, the ViewModel Locator, and page navigation. Silverlight: Making a DateTimePicker Peter Kuhn attacks a problem that crops up on the forums a lot -- a DateTimePicker control for Silverlight... following the "It's so simple to build one yourself" advice, he did so, and provides the code for all of us! Windows Phone 7 Animated Button Press Michael Washington took exception to button presses that gave no visual feedback and produced a behavior that does just that. Using TweetSharp in a Windows Phone 7 app Tau Sick demonstrates using TweetSharp to put a twitter feed into a WP7 app, as he did in "Hangover Helper"... all the instructions from getting Tweeetshaprt to the code necessary. Bindable Application Bar Extensions for Windows Phone 7 Max Paulousky has a post discussing some real extensions to the ApplicationBar for WP7.. he begins with a bindable application bar by Nicolas Humann that I've missed, probably because his blog is in French... and extends it to allow using DelegateCommand. How to: Load Prism modules packaged in a separate XAP file in an OOB application Damian Schenkelman posts about Prism, AppModules in separate XAPs and running OOB... if you've tried this, you know it's a hassle.. Damian has the solution. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Windows user account gets automatically locked

    - by vdboor
    One of the user accounts on a Windows 2003 server is frequently locked. Each time the "Account is locked" (roughly translated) checkbox is enabled in the Account Properties - Account tab. The event viewer only mentions that the account is locked, or that I've unlocked it. However, I don't see any message why the account gets locked in the first place. Are there know reasons why an account gets locked, or is there a way to find out why this happens?

    Read the article

  • Fix a tomcat6 error message "/bin/bash already running" when starting tomcat?

    - by Andrew Austin
    I have a Ubuntu 10.04 machine that has tomcat6 on it. When I start tomcat6 with /etc/init.d/tomcat6 start I get * Starting Tomcat servlet engine tomcat6 /bin/bash already running. and the server fails to start. Unfortunately, there is nothing in /var/log/tomcat/catalina.out to help debug the issue. With some cleverly placed echo statements it seems to be the line from /etc/init.d/tomcat6: start-stop-daemon --start -u "$TOMCAT6_USER" -g "$TOMCAT6_GROUP" \ -c "$TOMCAT6_USER" -d "$CATALINA_TMPDIR" \ -x /bin/bash -- -c "$AUTHBIND_COMMAND $TOMCAT_SH" The only thing I've changed in this script is TOMCAT6_USER=root. In servers.xml, the only thing I've changed is <Connector port="80" protocol="HTTP/1.1" from port 8080. I have tried reinstalling the package by first removing everything sudo apt-get --purge remove tomacat6 and then sudo apt-get install tomcat6 but this has not solved the issue. I have also restarted the server multiple times in hopes of some magic. Everything was working until I restarted my server. Any ideas?

    Read the article

  • Replacement for public folder workflow, I'm confused as to how sharepoint does it.

    - by RodH257
    For years Microsoft has been slowly phasing out public folders, perhaps exchange 2010 really is the LAST TIME they'll be shipped... I've heard sharepoint is the replacement, but I don't understand full, can someone give me an idea of how to replace this workflow? In our office, we have projects, they have a project number, ie 10353. Each job folder has a public folder, organized in a hierachy like Projects Year Folder Subfolders The main subfolder we use is for genera correspondence. When an email is received that relates to a project, it is dragged and dropped (or right click move to) a public folder. Adding public folder favourites for each user helps this. When an email is sent, we have a custom email form, which is the default email form, but with a project number field next to the subject line. When you enter the job number in there, it carbon copies our filing system in, which reads the job number and puts the email in the public folder for you. if you need to refer to emails, you go to public folder and find them there. This isn't the best with large jobs, but it works ok. Now, I have limited experience with sharepoint (well, WSS), we've used it to do some neat discussion boards/polls etc as an intranet site, but I haven't seen much of its integration with outlook. The great thing about our solution is how tightly it integrates with outlook which is exactly where the emails are. If you want to forward an old email, you go to public folder and forward it, simple. Any solution that replaces it should be at least as easy as this. Improvements we would like would be to have better searching of emails, better support in exchange (ie future version) and also, custom forms in outlook are being phased out (the VBA kind), so avoiding these would be good. Does sharepoint do this? or what solutions do this kind of thing?

    Read the article

  • IIS 6 Windows Authentication in ASP.Net app fails

    - by Kjensen
    I am trying to install an ASP.Net app on an IIS6 webserver. The site requires the user to authenticate with windows, and this works on several other apps on the same server. In IIS I have enabled anonymous access and windows authentication. In web.config, authentication is set to: <authentication mode="Windows"/> and authorization...: <authorization> <allow roles="Users"/> <deny users="*"/> </authorization> Ie. allow all users in role "Users" and deny everybody else. This is the approach that is working with several other apps on the same server. If I run the site, I am prompted for username and password. If I remove the line: <deny users="*"/> I can access the site and everything works - but the user credentials are not passed to the site (Page.User.Identity.Name returns a blank string in ASP.Net). The site has identical (inherited) file permissions as other working sites on the server. The only difference in authentication/authorization between this site and the other working sites is, that this runs Asp.Net 4 (but there are other working asp.net 4 sites on the server as well). What am I missing here? Where should I look?

    Read the article

  • Where in the stack is Software Restriction Policies implemented?

    - by Knox
    I am a big fan of Software Restriction Policies for Microsoft Windows and was recently updating our settings for this. I became curious as to where Microsoft implemented this technology in the stack. I can imagine a very naive implementation being in Windows Explorer where when you double click on an exe or other blocked file type, that Explorer would check against the policy. I call this naive because obviously this wouldn't protect against someone typing something in a CMD window. Or worse, Adobe Reader running an external application. On the other hand, I can imagine that software restriction policies could be implemented deep in the stack almost at the metal. In this case, the low level loader would load into memory the questionable file, but mark the memory in the memory manager as non-executable data. I'm pretty sure that Microsoft did not do the most naive implementation, because if I block Java using a path block, Internet Explorer will crash if it attempts to load Java. Which is what I want. But I'm not sure how deep in the stack it's implemented and any insight would be appreciated.

    Read the article

  • Unattended install of IIS 6 with PHP / FastCGI

    - by Ciaran
    I'm trying to figure out the best method of installing PHP on IIS 6 unattended. I've figured that to install IIS 6 unattended I need to use sysocmgr and modify a registry key before hand to point at the correct sources folder to prevent being asked for an installation disc. The bit I'm caught up on at the moment is the process of installing FastCGI. The info I've read about installing FastCGI so far is that the installer unpacks 3 files and "registers" them with IIS. Question is, does anyone know what happens with these three files so I can handle it without using the installer? Also, if anyone has experience with the steps I need to take following the FastCGI install, I'd appreciate help.

    Read the article

  • Ubuntu 10.10 and packetfence

    - by BrNathan
    I asked in the Ubuntu area, but thought I would get a better answer here. Was anyone able to install packetfence on Ubuntu 10? I tried a tutorial, but didn't have any luck. Some of the services installed and are working apache with php, snort, pfdetect, and pfdhcplistener. I can even get info with pfcmd node view all, but for the life of me I can't get it to work with apache2. When I run pfcmd service pf start I also get an error uninitialized value $_[7] in join at /usr/local/pf/lib/pf/class.pm line 170

    Read the article

  • How to send Ctrl+Alt+F1 to window (to switch terminal remotely, not locally)?

    - by Vi
    when I press Ctrl+Alt+F{1..12}, it switches me to other virtual terminal. When I have VNC/rdesktop client (and there it is VMWare/Virtualbox with other Linux) I want to switch virtual terminal remotely, but just pressing Ctrl+Alt+F1 switches things locally. VirtualBox/VMWare often provides special means to send Ctrl+Alt+Del, but not Ctrl+Alt+F1. (I already know that I can log in over ssh and chvt)

    Read the article

  • Desktop file for my pythin script

    - by Jason94
    Hi! I would like to make a .desktop file for my Python script, but so far the only thing i have is a clickable icon on my desktop! It does nothing when i click it, so im guessing there is something wrong with the execution :) The desktop file: [Desktop Entry] Version=1.0 Type=Python Exec=/home/user/MyDocs/Python/EasySteer/Main.py Name=EasySteer Icon=steering_wheel X-Icon-Path=/usr/share/icons and I also tried: [Desktop Entry] Version=1.0 Type=Application Exec=/usr/bin/xterm "python /home/user/MyDocs/Python/EasySteer/Main.py" Name=EasySteer Icon=steering_wheel X-Icon-Path=/usr/share/icons But nothing works :D if it matters this is for my Nokia N900 mobile phone that runs Maemo linux, but i think the basics are the same.

    Read the article

  • How do I assign a new keyboard shortcut in Excel 2010

    - by PatZ
    I need a keyboard shortcut for Merge & Center. I'd like it to be Ctrl+Shift+M. I am unfamiliar with Macros as was suggested in another answer and when I go to Options, I can't find shortcuts...I tried to follow the Help info, but as was already answered the Excel Customize Ribbon doesn't have the same options that Word 2010 does. So, how do I go about it step by step? I know this is for superuser...and I'm not one...but I hope to be one some day. Please help me on the way. Thanks.

    Read the article

  • ubuntu 10.04 span window across workspaces

    - by jakerman999
    I'm using an old server machine as a linux box desktop, and as such I have a lot of power but not a lot of display options. I cannot increase my resolution past 800x600 and recently this has become just to small. I have mostly been able to workaround windows being to large for a workspace by moving them with the alt key, but I would like to use something a little more versatile. My plan is to have a setup where I can open a windows (say firefox) on the top-left workspace and then resize it so that it fills four workspaces in an emulated "wall of monitors" fashion. I already have my workspaces arranged like this, but I am not seeing any options for allowing programs/windows to exist on more than one workspace at a time, I know that what I am trying to accomplish is possible (or was at some point in time) because when I google my solution pages appear with people trying to do the opposite (windows already appear on more than one workspace and they dislike it). Any help is much appreciated.

    Read the article

  • how to remove background layer of djvu file

    - by Jon
    Hello, I've downloaded some files from the Internet Archive. They come in different file formats and most of the time I use pdf. However, sometimes the scans are saves in colour instead of b/w. This makes it difficult/impossible to read on a dedicated ebook reader. In that case I downloaded the djvu files as on the PC you can select which layer (color, bw,fore,back) one would like to see. Selecting the bw gives excellent results. However, the ebook reader does not has this option. The question is, how can I remove /extract a layer from the djvu file and save only this layer. So far I've tried the following two approaches: 1) select bw in the djvu viewer on the PC and printed to postscript file. Followed by a ps2pdf conversion. This works, but generates a fairly large pdf file. Sure, I can again upload it to any2djvu but it just seems to much manual work for each file. 2) I tried the shared annotation feature and said (mode bw). This works on the PC as desired but is ignored on the ebook reader as the other layers are still present. Any help or suggestions would be greatly appreciated.

    Read the article

  • Missing disk space in Windows XP

    - by Jørn Schou-Rode
    On my mother's Lenovo laptop, Windows XP claims that the hard drive is almost full. According to the properties window, 52.7 out of 55.2 GB is in use: By deleting temp files from Internet Explorer, System Restore, Recycle bin, Windows Update, System Cleanup, I managed to free up about one GB. That's still 50 GB in use, which still is a lot more than I expected. Hence, I gave good old WinDirStat a spin, and here's the output: It might be hard to read here, but the first line says that the total amount of disk space in use on drive C is 24.3 GB. So Windows claims usage of 52.7 GB and WinDirStat can only account for 24.3 GB. Where is the other half of that disk space being used? I hope someone has an answer, or some tricks or tips to do further research. UPDATE: The laptop in question has an SSD hard drive. I am aware that these disk (at least the earlier ones) have a limited life-time. Could the symptoms described be caused by wear and tear on the SSD?

    Read the article

  • Network configuration for several LANs and a shared server

    - by Grodriguez
    I want to setup a network on a building to provide shared services to all homes within the building. This should work as follows: Each home has a private LAN (e.g. 192.168.0.x) and an ADSL router for Internet access. Private LANs from each home should not "see" each other. There will be a shared server on the building which must be accessible from every home. I am not sure what is the best way to achieve this. Can someone point in the right direction? Thanks.

    Read the article

  • Windows 7 Display Color Calibration Wizard

    Windows 7 comes complete with plenty of new features for you to get the most out of your PC. While some of them may be obvious the operating system has some tools that can help make your life easier. This series will discuss those tools and how to use them. To kick things off let s take a look at the Display Color Calibration Wizard.... Comcast? Business Class - Official Site Learn About Comcast Small Business Services. Best in Phone, TV & Internet.

    Read the article

  • Are things slow for you today - Check your DNS

    - by simonsabin
    Domain name resolution is a very common cause of delays when doing anything over the network whether its accessing a web page or connecting to SQL Server. Everything uses DNS. TCP/IP works with IP addresses and not friendly names. When using names you have to have a way of resolving names to IP addresses and thats what DNS does. If your DNS is wrong then you'll get delays and also potentially odd results. For instance if you have multiple DNS servers configured you may find that occasionally...(read more)

    Read the article

  • T-SQL Tuesday #014:I Hereby Resolve

    - by AllenMWhite
    It's another T-SQL Tuesday! Like many others, I really don't make New Year's Resolutions. They're too easy to forget about and it's too easy to "justify" why it just wasn't practical (and sometimes it's true.) That said, there are some things I'm working on changing for this year. Last year was the first full year for my new business venture, and it has been successful so far. I'm confident it's going to continue on this path, and we'll be doing even better this time next year. With that success...(read more)

    Read the article

  • Is nesting types considered bad practice?

    - by Rob Z
    As noted by the title, is nesting types (e.g. enumerated types or structures in a class) considered bad practice or not? When you run Code Analysis in Visual Studio it returns the following message which implies it is: Warning 34 CA1034 : Microsoft.Design : Do not nest type 'ClassName.StructueName'. Alternatively, change its accessibility so that it is not externally visible. However, when I follow the recommendation of the Code Analysis I find that there tend to be a lot of structures and enumerated types floating around in the application that might only apply to a single class or would only be used with that class. As such, would it be appropriate to nest the type sin that case, or is there a better way of doing it?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >