Daily Archives

Articles indexed Friday May 21 2010

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

  • How do you set page level, page-SPECIFIC javascript events using a ContentPlaceHolder?

    - by donde
    I previously asked how to include Javascript in my page when I split the page into a MasterPage and ContentPlaceHolder (.NET 2.0 app) The issue was I only wanted the javascript functions on THAT page so I couldn't just put them on the masterpage. Based on the answers, I will inlcude common fucntions through MasterPage and can put the page-specific function right on the content page. However, 1 question remains: Events. I have 2 Javascript functions that I wanted to load when the page loads ala the HTML below. How do you load javascript page events on the specific content page? Or in the case below, the OnKeyPress event? <body onkeypress="javascript:keypressed();" onload="javascript:setDivVisibility();">

    Read the article

  • Remaking this loop by user?

    - by Elliot
    I'm wondering if theres a best practice for what I'm trying to accomplish... First we have the model categories, categories, has_many posts. Now lets say, users add posts. Now, I have a page, that I want to display only the current user's posts by category. Lets say we have the following categories: A, B, and C User 1, has posted in Categories A and B. In my view I have something like: <% @categories.select {|cat| cat.posts.count > 0}.each do |category| %> <%= category.name %><br/> <% category.posts.select {|post| post.user == current_user}.each do |post| %> <%= post.content %><br/> <% end %> <% end %> For the most part its almost there. The issue is, it will still show an empty category if any posts have been entered in it at all (even if the current user has not input posts into that category. So the question boils down to: How do I make the following loop only count posts in the category from the current user? <% @categories.select {|cat| cat.posts.count 0}.each do |category| % Best, Elliot

    Read the article

  • Is Unit Testing worth the effort?

    - by The Talking Walnut
    I am working to integrate unit testing into the development process on the team I work on and there are some skeptics. What are some good ways to convince the skeptical developers on the team of the value of Unit Testing? In my specific case we would be adding Unit Tests as we add functionality or fixed bugs. Unfortunately our code base does not lend itself to easy testing.

    Read the article

  • TableView as DetailView's subview with a UISplitViewController?

    - by Gerry
    I have a UISplitViewController, I used the iPad template to start. To change the type of view in the detailview area, I'm adding my view types as subviews to the DetailViewController's view. This works for UIViewController derived views, but not for UITableViewController view types?. Why would this be? My problem is rooted in the fact that the manufactured DetailView is the UISplitViewController's delegate. To get the correct popover behaviour, I'd like to keep it add buttons to its toolbar and then based on user selection open different details when master list selections are made. Thanks,

    Read the article

  • how to read LDAP error codes

    - by Padur
    Hello I am having trouble reading ldap error codes. Is there any method or an API to read ldap error codes/sub error codes.Right now I am parsing the exception message and getting the error code. I believe there is a simple way of extracting codes? Padur

    Read the article

  • howto design an invite feature feature?

    - by fenec
    hello i am trying to implement a feature in my facebook application that would give 100 point to someone who would send 10 invitations. however i want a limit that feature for each user to use it only 10 times a day. how should i design my feature to do what i want

    Read the article

  • How to let m2eclipse use nexus repositories instead of maven one

    - by lisak
    I have this situation: An artifact in maven local repo that I don't want to use anymore. Instead, I want it to be downloaded by maven from proxied nexus remote repository. It's a typical situation cause a lot of artifacts are called just name-SNAPSHOT and the artifact is changing but the name is still the same. Eclipse with m2eclipse is running. I delete the entire directory of the artifact in local maven repo m2eclipse "Reindex local maven repository" - which creates a new nexus index for local maven repo I guess Project - maven Update Dependencies - now m2eclipse should run maven, which doesn't see the artifact in local maven repo, so it uses nexus repositories to download it (expected behavior) Instead, the directory structure in maven local repo is recreated and there is this file: "m2e-lastUpdated.properties" with following inside: local|http\://nexus\:8082/nexus-webapp-1.6.0/content/groups/public|javadoc=1274399332215 local|http\://nexus\:8082/nexus-webapp-1.6.0/content/groups/public|sources=1274399332161 and m2eclipse says Missing artifact net.sourceforge.htmlunit:htmlunit:jar:2.8-SNAPSHOT:compile even though the artifact physically exists here: nexus:8082/nexus-webapp-1.6.0/content/repositories/htmlunit-snapshot/net/sourceforge/htmlunit/htmlunit/2.8-SNAPSHOT/htmlunit-2.8-SNAPSHOT.jar Maven just doesn't use this location at all. Trust me I tried everything, this m2eclipse behavior is terrible.

    Read the article

  • Simple C# USING statement for folder

    - by salvationishere
    I am developing a VS 2008 web application in C#. I am trying to include a namespace that is stored in one of my folders. So instead of: using ADONET_namespace it is stored in "Admins" folder. How do I modify this aspx.cs file to include Admins/ADONET_namespace? Currently I get following error from aspx.cs file: The type or namespace name 'ADONET_namespace' could not be found (are you missing a using directive or an assembly reference?)

    Read the article

  • Apache Request IP Based Security

    - by connec
    I run an Apache server on my home system that I've made available over the internet as I'm not always at my home system. Naturally I don't want all my home server files public, so until now I've simply had: Order allow, deny Deny from all Allow from 127.0.0.1 in my core configuration and just Allow from all in the htaccess of any directories I wanted publicly viewable. However I've decided a better system would be to centralise all the access control and just require authentication (HTTP basic) for requests not to 127.0.0.1/localhost. Is this achievable with Apache/modules? If so how would I go about it? Cheers.

    Read the article

  • PHP/GnuPG Decryption -- Syntax error?

    - by NeedBeerStat
    I'm using php to invoke gpg, but I'm getting a pipe error. I thought that if I read in the password from a file, I could then pipe it to the command itself? But, I keep getting: Syntax error: "|" unexpected Here's the code: (Note: The files are being iterated over in a foreach loop...) foreach($files as $k => $v) { $encrypted = $v; $filename = explode('.',$v); $decrypted = $filename[0].'.txt'; shell_exec("echo $passphrase | gpg --no-tty --passphrase-fd 0 -o $decrypted -d $encrypted"); }

    Read the article

  • Show a DB as a directory (Like Sharepoint Does)

    - by Zyd
    Hi, My team and I are programming a sort of Document Manager and the idea is to store them completely on DB. Is there a protocol or Extensions that allows us to show a "Virtual Directory" or files that are really non existent (only in DB). How does Sharepoint do this? I understand that Sharepoint uses WebDav but it implies that the files do exist physically somewhere. We intend to develop this application on .NET 4.0 and deploy it on IIS. Any suggestions? Thanks in advance

    Read the article

  • What is an alternative for split in Perl?

    - by joe
    My file contains a: b d: e f: a:b:c g: a b c d f:g:h h: d d:dd:d J: g,j How can I parse this file into lefthand side values into one array and right hand side to another array? I tried with split, but I am not able to get it back. I want to store them into hash.

    Read the article

  • XML and XSLT: need it to sort only certain child nodes

    - by MT
    Hello, I need to have my XSLT stylesheet sort my XML file's child nodes, but only certain ones. Here's an example of what the XML is like: <?xml version="1.0"?> <xmltop> <child1 num="1"> <data>12345</data> </child1> <child1 num="2"> <data>12345</data> </child1> <child2 num="3"> <data>12345</data> </child2> <child2 num="2"> <data>12345</data> </child2> <child2 num="1"> <data>12345</data> </child2> </xmltop> And this is the XSL file I'm using: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/xmltop"> <xsl:copy> <xsl:apply-templates> <xsl:sort select="@num"/> </xsl:apply-templates> </xsl:copy> </xsl:template> <xsl:template match="child2"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet> This creates problems for me because the nodes are stripped of their tags, and their contents remain, making my XML invalid. I'm not really an expert at XSL so pardon me if this is a dumb question. The <child2>'s are sorted properly. Thank you.

    Read the article

  • Why does my Perl CGI script cause a 500 internal server error?

    - by Nitish
    I get a 500 internal server error when I try to run the code below in a web server which supports perl: #! /usr/bin/perl use LWP; my $ua = LWP::UserAgent->new; $ua->agent("TestApp/0.1 "); $ua->env_proxy(); my $req = HTTP::Request->new(POST => 'http://www.google.com/loc/json'); $req->content_type('application/jsonrequest'); $req->content('{ "cell_towers": [{"location_area_code": "55000", "mobile_network_code": "95", "cell_id": "20491", "mobile_country_code": "404"}], "version": "1.1.0", "request_address": "true"}'); my $res = $ua->request($req); if ($res->is_success) { print $res->content,"\n"; } else { print $res->status_line, "\n"; return undef; } But there is no error when I run the code below: #! /usr/bin/perl use CGI::Carp qw(fatalsToBrowser); print "Content-type: text/html\n\n"; print "<HTML>\n"; print "<HEAD><TITLE>Hello World!</TITLE></HEAD>\n"; print "<BODY>\n"; print "<H2>Hello World!</H2> <br /> \n"; foreach $key (sort keys(%ENV)) { print "$key = $ENV{$key}<p>" ; } print "</BODY>\n"; print "</HTML>\n"; So I think there is some problem with my code. When I run the first perl script in my local machine with the -wc command, it says that the syntax is OK. Help me please.

    Read the article

  • Redmon's Run As User not loading user's enviroment variables

    - by catfish
    I'm attempting to use Redmon http://www.winimage.com/misc/redmon/ to send print jobs to a custom C# application. Redmon "runs" (actually the Print Spooler) as SYSTEM but has an option to Run As User to allow your application to run under the user that printed the job. The problem is that it doesn't appear to load the user's environment. So calling functions like Path.GetTempPath() points to \windows\temp instead of the user's. Also when attempting to run Outlook 2007+ via MAPI calls (to add attachments) it reports form errors due to, I think, the temp folder location. Is there a way to "reload" a profile or atleast get your environment vars within the Impersonated application? The only ideas I've had so far is to rebuild the vars directly from the registry, but I want to avoid this since it's a hack around (avoiding implementation details and all that). Or making a stub program that Redmon calls which then properly Run As User with full profile the custom application. Any other items or tricks?

    Read the article

  • Example of standalone Apache Qpid (amqp) Junit Test

    - by Wiretap
    Does anyone have an example of using Apache Qpid within a standalone junit test. Ideally I want to be able to create a queue on the fly which I can put/get msgs within my test. So I'm not testing QPid within my test, I'll use integration tests for that, however be very useful to test methods handling msgs with having to mock out a load of services.

    Read the article

  • Finding vars from dynamically created namespaces in clojure

    - by Tom Crayford
    The following test fails: (ns clojure_refactoring.rename-fn-test (:use clojure.test)) (deftest test-fn-location (in-ns 'refactoring-test-fn-rename) (clojure.core/refer-clojure) (defn a [b] (inc b)) (in-ns 'clojure_refactoring.rename-fn-test) (is (not= (find-var 'refactoring-test-fn-rename/a) nil)) (remove-ns 'refactoring-test-fn-rename)) That is, find-var (of a var I've just created, in a namespace I've just create) returns nil. This behaviour doesn't happen at the repl, where typing out the steps of the test works just fine. Am I doing something wrong, or is this just something that doesn't work in clojure right now?

    Read the article

  • C# Fake Enum TypeInitializationException

    - by userk
    I'm trying to create a class that works as a flexible enum. I came with this idea, with 2 additional static methods that allow me to add new members to that list and get only members from that list. public class LikeEnum { private static List<LikeEnum> list = new List<LikeEnum>() { new LikeEnum("One"), new LikeEnum("Two") }; private string value; private LikeEnum(string value) { this.value = value; } } Unfortunately the List list is only initialized as null so this doesn't work... Any ideas or suggestions?

    Read the article

  • AS3 and the loader class

    - by Acti67
    Hi, I write here, because after looking for a solution, I could not resolve my error... var test:MovieClip; var sign:Loader = new Loader(); sign.contentLoaderInfo.addEventListener(Event.COMPLETE, completSIGN); sign.load(new URLRequest("http://files.zebest-3000.com/278374/3011/3011.swf")); function completSIGN(e:Event):void { test = MovieClip(e.target.content); addChild(test); } This is the error: TypeError: Error #1009: Il est impossible d'accéder à la propriété ou à la méthode d'une référence d'objet nul. at Main::StateManager() So, the movie (some videos work perfectly and others not) does not want to load in my container ; it seems there is a problem in the mapping... and can't modify the distant movie. Is there an other method of loading a movie inside one other (I have try also to load with bytearray, but it's the same)? Can we catch this error and relocate the instance to help him to find the correct way?

    Read the article

  • Is there a way to simplify this Django query?

    - by Mark
    accepted_bids = Bid.objects.filter(shipment__user=u, status='acc').select_related('shipment') completed_shipments = [] for b in accepted_bids: completed_shipments.append(b.shipment) vehicles_shipped = [] for s in completed_shipments: vehicles_shipped.extend(s.items.all()) In the end, I want a list of shipped vehicles. A vehicle is shipped if it's part of a shipment that's completed. A shipment is completed if it has an accepted bid. I'd prefer not to iterate over the querysets thereby forcing a hit to the DB before its necessary... isn't there a way to get all the associated shipments from a list of bids, for example?

    Read the article

  • Scalable chat site in python

    - by user346572
    Hey guys, I have an idea that I'd like to start implementing that at the crux of it, will basically be a chat website, and will need to support multiple rooms. Quite frankly, I'm not too sure where to begin with regards to setting up a very sturdy/scalable chat system in python (or another language if you guys believe it to be a better alternative), so any suggestions that can get me pointed in the right direction will be greatly appreciated.

    Read the article

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