Daily Archives

Articles indexed Wednesday March 31 2010

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

  • How do I do this Database Model in Django?

    - by alex
    Django currently does not support the "Point" datatype in MySQL. That's why I created my own. class PointField(models.Field): def db_type(self): return 'Point' class Tag(models.Model): user = models.ForeignKey(User) utm = PointField() As you can see, this works, and syncdb creates the model fine. However, my current code calculates a length between two Points using raw SQL. cursor.execute("SELECT user_id FROM life_tag WHERE\ (GLength(LineStringFromWKB(LineString(asbinary(utm), asbinary(PointFromWKB(point(%s, %s)))))) < 55)... This says: Select where the length between the given point and the table point is less than 55. How can I do this with Django instead of RAW SQL? I don't want to do cursors and SELECT statements anymore. How can I modify the models.py in order to do this?

    Read the article

  • Cannot run code on device

    - by lostInTransit
    Hi I have some source code which I had developed and later gave to another team. They signed it with their certificate and provisioning profile. Now I have the code back and have set the appropriate values in the project properties for code signing identity (with my cert and profile). But when I run the application on a device, I get an error showing the other team's certificate and prompting that the provisioning profile does not exist. I don't know where it is being referenced. Can someone please help. Thanks.

    Read the article

  • JQUERY CYCLE - Can I add page links to anchors assigned to Cycle's pager?

    - by christianDuncan
    Hello everyone. Seems I've outdone myself. All the while I was creating this pretty little 'latest news' widget that fades on mouseover of each anchor. Then my colleague says, "Hey, Chris, these links don't work" ...oops. I would like to find out if I can have these anchors take the user to the relvent page on click. Currently Cycle is set to do its hocus pocus on mouseover. This is my Cycle code: $('#newsSlider .slides ul').cycle({ fx: 'fade', speed: 1000, timeout: 0, pager: '.slides-nav', pagerEvent: 'mouseover', pagerAnchorBuilder: function(idx, slide) { // return sel string for existing anchor return '.slides-nav li:eq(' + (idx) + ') a'; } And here is the dev site: http://slg-development.co.uk/Gradient_12859/ Any help would be hugely appriciated. Thanks everyone! Christian

    Read the article

  • Are there Any free XSL-FO editors?

    - by Russell
    I am looking for a free WYSIWYG editor of XSL-FO. Specifically, I would like to be able to design the FO file through a visual editor. I am aware of some that are available for purchase and evaluation, however I was wondering if there are any free editors available? Thanks

    Read the article

  • Where did Pylons beautiful error handling go? Using Nginx + Paster + Flup#fcgi_thread

    - by Tony
    I need to run my development through nginx due to some complicated subdomain routing rules in my pylons app that wouldn't be handled otherwise. I had been using lighttpd + paster + Flup#scgi_thread and the nice error reporting by Pylons had been working fine in that environment. Yesterday I recompiled Python and MySQL for 64bit, and also switched to Ngix + paster + Flup#fcgi_thread for my development environment. Everything is working great, but I miss the fancy error reports. This is what I get now, and it is a mess compared to what I got used to: http://drp.ly/Iygeg . And here are the pylons/nginx configs. Pylons: [server:main] use = egg:Flup#fcgi_thread host = 0.0.0.0 port = 6500 Nginx: location / { #include /usr/local/nginx/conf/fastcgi.conf; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param QUERY_STRING $query_string; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_pass_header Authorization; fastcgi_intercept_errors off; fastcgi_pass 127.0.0.1:6500; }

    Read the article

  • A quoi sert la plateforme Microsoft Online Services et que peuvent en faire les entreprises ? Interv

    A quoi sert la plateforme Microsoft Online Services et que peuvent en faire les entreprises ? Début de réponse avec une chef de produit Isabelle Scemla, chef de produit communications unifiées pour Microsoft France, a accepté de nous rencontrer ce 30 mars 2010 au siège de la firme pour discuter des solutions hébergées offertes par Microsoft Online Services . Comment cela fonctionne, à qui est-ce destiné, quels usages peuvent en faire les entreprises, etc... Comptent parmis les points évoqués lors de cet entretien. (voir la vidéo de l'interview en bas de cet article) Si vous souhaitez en savoir plus, un Live Meeting est prévu sur le sujet. Il se déroulera le jeudi 15 avril à partir de 18h30 sous la forme d'un question...

    Read the article

  • WiX tricks and best practices

    - by Si
    We've been using WiX 3 for a while now, and despite the usual gripes about ease of use, it's going reasonably well. What I'm looking for is useful advice regarding: Setting up a WiX project (layout, references, file patterns) Integrating WiX into solutions, and build/release processes Configuring installers for new installations and upgrades Also interested in any good WiX hacks you'd like to share, thanks!

    Read the article

  • Needs some help with an apache mod-rewrite issue

    - by mike
    I've modified my .htaccess file to have the following statement RewriteCond $1 !^index.php$ RewriteRule ^/?([^/]+)$ index.php?c=home&m=details&seo=$1 [L,NS] This allows me to use product URL's like this: http://domain.com/product_name However, when trying to access a file at the same level as index.php, it always calls the RewriteRule above and errors out. I need to be able to access files like below, but each URL currently attempts to load index.php. http://domain.com/about.htm http://domain.com/terms.htm http://domain.com/robots.txt etc Any suggestions on how I can modify my htaccess file to get this to work correctly?

    Read the article

  • SPWeb.Webs, Site vs SubSite

    - by noob.spt
    Hi, I have a very basic question here. I am confused between SPSite. SiteCollection and SPWeb. So my understanding is (or what I could research on this) that, http://My_server TOP Level SIte or SPWEbApplication http://My_server/My_site Site Collection or SPSite Now a site under SPSite that will be referenced through SPWeb. So what are we getting when using SPWeb.Webs. What is a Subsite? Please let me know if I need to rephrase the question or more info is needed. Thanks. SPWeb mySite = SPContext.Current.Web; SPWebCollection sites = mySite.Webs; foreach (SPWeb subSite in sites) { Response.Write(SPEncode.HtmlEncode(subSite.Title) + "<BR>"); }

    Read the article

  • Is there a C pre-processor which eliminates #ifdef blocks based on values defined/undefined?

    - by Jonathan Leffler
    Original Question What I'd like is not a standard C pre-processor, but a variation on it which would accept from somewhere - probably the command line via -DNAME1 and -UNAME2 options - a specification of which macros are defined, and would then eliminate dead code. It may be easier to understand what I'm after with some examples: #ifdef NAME1 #define ALBUQUERQUE "ambidextrous" #else #define PHANTASMAGORIA "ghostly" #endif If the command were run with '-DNAME1', the output would be: #define ALBUQUERQUE "ambidextrous" If the command were run with '-UNAME1', the output would be: #define PHANTASMAGORIA "ghostly" If the command were run with neither option, the output would be the same as the input. This is a simple case - I'd be hoping that the code could handle more complex cases too. To illustrate with a real-world but still simple example: #ifdef USE_VOID #ifdef PLATFORM1 #define VOID void #else #undef VOID typedef void VOID; #endif /* PLATFORM1 */ typedef void * VOIDPTR; #else typedef mint VOID; typedef char * VOIDPTR; #endif /* USE_VOID */ I'd like to run the command with -DUSE_VOID -UPLATFORM1 and get the output: #undef VOID typedef void VOID; typedef void * VOIDPTR; Another example: #ifndef DOUBLEPAD #if (defined NT) || (defined OLDUNIX) #define DOUBLEPAD 8 #else #define DOUBLEPAD 0 #endif /* NT */ #endif /* !DOUBLEPAD */ Ideally, I'd like to run with -UOLDUNIX and get the output: #ifndef DOUBLEPAD #if (defined NT) #define DOUBLEPAD 8 #else #define DOUBLEPAD 0 #endif /* NT */ #endif /* !DOUBLEPAD */ This may be pushing my luck! Motivation: large, ancient code base with lots of conditional code. Many of the conditions no longer apply - the OLDUNIX platform, for example, is no longer made and no longer supported, so there is no need to have references to it in the code. Other conditions are always true. For example, features are added with conditional compilation so that a single version of the code can be used for both older versions of the software where the feature is not available and newer versions where it is available (more or less). Eventually, the old versions without the feature are no longer supported - everything uses the feature - so the condition on whether the feature is present or not should be removed, and the 'when feature is absent' code should be removed too. I'd like to have a tool to do the job automatically because it will be faster and more reliable than doing it manually (which is rather critical when the code base includes 21,500 source files). (A really clever version of the tool might read #include'd files to determine whether the control macros - those specified by -D or -U on the command line - are defined in those files. I'm not sure whether that's truly helpful except as a backup diagnostic. Whatever else it does, though, the pseudo-pre-processor must not expand macros or include files verbatim. The output must be source similar to, but usually simpler than, the input code.) Status Report (one year later) After a year of use, I am very happy with 'sunifdef' recommended by the selected answer. It hasn't made a mistake yet, and I don't expect it to. The only quibble I have with it is stylistic. Given an input such as: #if (defined(A) && defined(B)) || defined(C) || (defined(D) && defined(E)) and run with '-UC' (C is never defined), the output is: #if defined(A) && defined(B) || defined(D) && defined(E) This is technically correct because '&&' binds tighter than '||', but it is an open invitation to confusion. I would much prefer it to include parentheses around the sets of '&&' conditions, as in the original: #if (defined(A) && defined(B)) || (defined(D) && defined(E)) However, given the obscurity of some of the code I have to work with, for that to be the biggest nit-pick is a strong compliment; it is valuable tool to me. The New Kid on the Block Having checked the URL for inclusion in the information above, I see that (as predicted) there is an new program called Coan that is the successor to 'sunifdef'. It is available on SourceForge and has been since January 2010. I'll be checking it out...further reports later this year, or maybe next year, or sometime, or never.

    Read the article

  • Javadoc through Ant task with {@inheritDoc} from J2SE classes

    - by miorel
    I generate documentation for a project using an Ant task. In several places, I wanted to inherit documentation from the standard classes, so I used {@inheritDoc} which allowed me to see the Javadoc in Eclipse, but it wouldn't show up in the HTML files. The problem was that I hadn't included the unzipped src.zip (J2SE source) in the sourcepath. Having fixed that, I now get several hundred warnings about the use of Sun proprietary API in files like lib/jdk-src/java/lang/Class.java. Is there any way to suppress these warnings? It's hard to find relevant problems in this mess. A possible solution I thought of was to run the Javadoc task once without including the J2SE source in the sourcepath, which will reveal any real issues. Then I can run Javadoc a second time with the J2SE source included, discarding the output altogether, which will produce documentation with properly-working {@inheritDoc}s. I'm not entirely sure about the best way to accomplish this in Ant, not to mention that running Javadoc twice would be a dirty fix. Any suggestions?

    Read the article

  • Compiling Java code in terminal having a Jar in CLASSPATH

    - by Masi
    How can you compile the code using javac in a terminal by using google-collections in CLASSPATH? Example of code trying to compile using javac in a terminal (works in Eclipse) import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; public class Locate { ... BiMap<MyFile, Integer> rankingToResult = HashBiMap.create(); ... } Compiling in terminal src 288 % javac Locate.java Locate.java:14: package com.google.common.collect does not exist import com.google.common.collect.BiMap; ^ Locate.java:15: package com.google.common.collect does not exist import com.google.common.collect.HashBiMap; ^ Locate.java:153: cannot find symbol symbol : class BiMap location: class Locate BiMap<MyFile, Integer> rankingToResult = HashBiMap.create(); ^ Locate.java:153: cannot find symbol symbol : variable HashBiMap location: class Locate BiMap<MyFile, Integer> rankingToResult = HashBiMap.create(); ^ 4 errors My CLASSPATH src 289 % echo $CLASSPATH /u/1/bin/javaLibraries/google-collect-1.0.jar

    Read the article

  • jQuery to add vertical scroll bar for a fixed height div container

    - by Michael Mao
    Hi all: This is uni homework so sorry about :my password protected url Please enter usersame as "uts" and password as "10479475", without the wrapper quotes. It it almost completed, please follow simple steps to see where my problem dwells: step1: click on any continent highlighted on world map; step2: click on any city marked on continent map; step3: enter quantity ranging from 1 to 6 into the upper-right table; step4 : there you go, in the table below, once row is equal or greater than 3, then the size of table starts to "overlap" on top of the footer section and continues to grow, which is not what I want. I want to achieve the effect that the table size has a limited max-height, so once actual height exceeds the threshold, then I can have a vertical scroll bar so to "stack up" my table and not to break the overall structure. It turns out that my lazy initial design now gets myself stuck in a problem... Any suggestion and hint on how to get this?

    Read the article

  • ASP.NET MVC: How to serve content while returning status code 404?

    - by Marek
    I would like to serve a user friendly "not found" page in my ASP.NET MVC application while providing a 404 status code. (based on this answer) I already have the mechanism how to catch an invalid route and the custom 404 page is served by my ErrorController/Handle404 action. My current implementation of Handle404: public ActionResult Handle404() { Response.StatusCode = 404; return View("NotFound"); } Currently, IIS serves the page as 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. (the standard IIS page, not my user friendly content) How can I include the 404 status code in the result served by the Handle404 action while still serving the content?

    Read the article

  • Making a rails inflection for possessive strings?

    - by chovy
    I would like to create a method in additional to the default 'foo'.titlecase that will correctly add "possessiveness" to it. The string is a user's name (<- just did one right there! ) For example: "sam" is the user <%= user.titlecase.possessive + ' Profile' % = #Sam's Profile It just needs to handle edge cases like: Steelers's Profile ( should be Steelers' Profile) Ross's Profile ( should be Ross' Profile )

    Read the article

  • Books on Code Contracts in C# 4.0

    - by devoured elysium
    Altough I've known Code Contracts for some time, as I've used it a bit in Java, I would like to start using them in C#, now that they are part of C# 4.0. I am looking on learning material, books or vids. Altough tutorials are also welcome, I'd like to have something comprehensive to read, not the typical "here's how you use Requires and here's how you use Ensures". I am looking for something that really stands out in this area. Thanks

    Read the article

  • PHP session permission problem

    - by Daniel
    Hi I'm trying to initialize a session but i get this error: Warning: session_start() [function.session-start]: open(/tmp/sess_7af3ee9ec1350680bedcf63833d160bd, O_RDWR) failed: Permission denied (13) The session.path is set to /tmp with 777 perms. I try to edit the session.path to "0;777;/tmp" but the session files are created with the wrong permissions(only write). I'm using PHP 5.2 on apache2 and ubuntu 9.10. Any ideas?

    Read the article

  • tar exclude tag

    - by superstar
    I have the following folder structure. myFolder and testFolder have same folders underneath it and I want to exclude only my1 from testFolder and not myFolder "myFolder" which has -my1 -my2 -my3 "testFolder" which has -my1 -my2 -my3 I am trying to use exclude tag along with included folders while creating a tar file. This is what i have, but it does not seem to work. tar -cvf base.tar "/sam/myFolder" "/sam/testFolder" --exclude="/sam/testFolder/my1" I want to exclude my1 from testFolder and not myFolder. can you please suggest a possible solution.

    Read the article

  • How to create a asp.net membership provider hashed password manually?

    - by Anheledir
    I'm using a website as a frontend and all users are authenticated with the standard ASP.NET Membership-Provider. Passwords are saved "hashed" within a SQL-Database. Now I want to write a desktop-client with administrative functions. Among other things there should be a method to reset a users password. I can access the database with the saved membership-data, but how can I manually create the password-salt and -hash? Using the System.Web.Membership Namespace seems to be inappropriate so I need to know how to create the salt and hash of the new password manually. Experts step up! :)

    Read the article

  • Django Form for date range

    - by gramware
    I am trying to come up with a form that lets the user select a date range to generate a web query in Django. I am having errors getting the date to filter with in my view, I am unable to strip the date. Here is my forms.py class ReportFiltersForm(forms.Form): start_date = forms.DateField(input_formats='%Y,%m,%d',widget=SelectDateWidget()) end_date = forms.DateField(input_formats='%Y,%m,%d',widget=SelectDateWidget()) And my view if request.method == 'POST': form = ReportFiltersForm(request.POST) sdy = request.POST['start_date_year'] sdm = request.POST['start_date_month'] sdd = request.POST['start_date_day'] edy = request.POST['end_date_year'] edm = request.POST['end_date_month'] edd = request.POST['end_date_day'] start_date= datetime.date(sdy, sdm, sdd) end_date= datetime.date(edy, edm,edd) Traceback Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 651, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 241, in __call__ response = self.get_response(request) File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 134, in get_response return self.handle_uncaught_exception(request, resolver, exc_info) File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 154, in handle_uncaught_exception return debug.technical_500_response(request, *exc_info) File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 92, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/home/projects/acms/cms/views.py", line 470, in eventreports start_date= datetime.date(sdy, sdm, sdd) TypeError: an integer is required

    Read the article

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