Daily Archives

Articles indexed Thursday May 6 2010

Page 22/118 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • iPhone settings screen

    - by malleswar
    Hi Friends, I want to design a screen like settings screen. Like in grouped uitableview I want to place the controls. Can any one please provide me any application sample or code ? Thanks in advance. Regards, Malleswar

    Read the article

  • Django : debugging templatetags

    - by interstar
    How on earth do people debug Django templatetags? I created one, based on a working example, my new tag looks the same to me as the existing one. But I just get a 'my_lib' is not a valid tag library: Could not load template library from django.templatetags.my_lib, No module named my_lib I know that this is probably because of something failing when defining the lib. But how do I see what's going on? What do you use to debug this situation?

    Read the article

  • How to test custom template tags in Django?

    - by Mark Lavin
    I'm adding a set of template tags to a Django application and I'm not sure how to test them. I've used them in my templates and they seem to be working but I was looking for something more formal. The main logic is done in the models/model managers and has been tested. The tags simply retrieve data and store it in a context variable such as {% views_for_object widget as views %} """ Retrieves the number of views and stores them in a context variable. """ # or {% most_viewed_for_model main.model_name as viewed_models %} """ Retrieves the ViewTrackers for the most viewed instances of the given model. """ So my question is do you typically test your template tags and if you do how do you do it?

    Read the article

  • django 'if' statement improperly formatted

    - by Zayatzz
    Im getting strangest error in django so far: 'if' statement improperly formatted Template that raises the error is this: {% if diff >= 0 %} <span class="pos">+{{ diff }} {% else %} <span class="neg">-{{ diff }} {% endif %} </span> <span>{{ a }}</span> view that has a and diff in context is this: def add(request, kaart_id): if request.is_ajax() and request.method == 'POST': x = Kaart.objects.get(id=kaart_id) x.pos += 1 x.save x = Kaart.objects.get(id=kaart_id) from django.utils import simplejson diff = x.pos - x.neg a = "(+1)" context = { 'diff':diff, 'a':a } return render_to_response('sum.html', context, context_instance=RequestContext(request)) It does not matter what equation i use in if, , =, ==.. they all raise the same error. and as far as i can tell its all by the book: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#id5 Alan.

    Read the article

  • How do I detect server status in a port scanner java implementation

    - by akz
    I am writing a port scanner in Java and I want to be able to distinct the following 4 use cases: port is open port is open and server banner was read port is closed server is not live I have the following code: InetAddress address = InetAddress.getByName("google.com"); int[] ports = new int[]{21, 22, 23, 80, 443}; for (int i = 0; i < ports.length; i++) { int port = ports[i]; Socket socket = null; try { socket = new Socket(address, port); socket.setSoTimeout(500); System.out.println("port " + port + " open"); BufferedReader reader = new BufferedReader( new InputStreamReader(socket.getInputStream())); String line = reader.readLine(); if (line != null) { System.out.println(line); } socket.close(); } catch (SocketTimeoutException ex) { // port was open but nothing was read from input stream ex.printStackTrace(); } catch (ConnectException ex) { // port is closed ex.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (socket != null && !socket.isClosed()) { try { socket.close(); } catch (Exception e) { e.printStackTrace(); } } } } The problem is that I get a ConnectionException both when the port is closed and the server cannot be reached but with a different exception message: java.net.ConnectException: Connection timed out: connect when the connection was never established and java.net.ConnectException: Connection refused: connect when the port was closed so I cannot make the distinction between the two use cases without digging into the actual exception message. Same thing happens when I try a different approach for the socket creation. If I use: socket = new Socket(); socket.setSoTimeout(500); socket.connect(new InetSocketAddress(address, port), 1000); I have the same problem but with the SocketTimeoutException instead. I get a java.net.SocketTimeoutException: Read timed out if port was open but there was no banner to be read and java.net.SocketTimeoutException: connect timed out if server is not live or port is closed. Any ideas? Thanks in advance!

    Read the article

  • Django Custom Template Tages: Inclusion Tags

    - by Harry
    Hello world! Im trieng to build my own template tags Im have no idea why I get the errors I get, im following the django doc's. this is my file structure of my app: pollquiz/ __init__.py show_pollquiz.html showpollquiz.py This is showpollquiz.py: from django import template from pollquiz.models import PollQuiz, Choice register = template.Library() @register.inclusion_tag('show_pollquiz.html') def show_poll(): poll = Choice.objects.all() return { 'poll' : poll } html file: <ul> {% for poll in poll <li>{{ poll.pollquiz }}</li> {% endfor </ul> in my base.html file im am including like this {% load showpollquiz %} and {% poll_quiz %} Bu then I get the the error: Exception Value: Caught an exception while rendering: show_pollquiz.html I have no idea why this happens. Any ideas? Please keep in mind Im still new to Django

    Read the article

  • Can someone explain facelets ?

    - by Guru
    I have been involved in JSF + Facelets dev for a month or so. I used composition, insert, define and other tags from facelets. I am finding it difficult to understand what facelets really give me? What are its alternatives ? What is that View Handler technology?I am not able to find good material / online notes on the same. Can someone explain in laymen terms - What it is? Thanks

    Read the article

  • TFS 2008 Build and deploy to Inetpub web folder

    - by mattgcon
    I have TFS2008 and have a build running, however, I want to automate the deployment of the build folder and place the build into the inetpub folder it belongs to. I.E.: Run Build After Build, automatically place the new built solution into Inetpub/wwwroot/websitefolder I have tried xcopy, robocopy and synctoy 2.1 and I cannot get any of them to work. Can anyone at all please help me with this dilemna? Thank you in advance

    Read the article

  • FM Transmitter for the Home

    - by greggannicott
    After asking this question regarding piping music through my home I'm looking to buy an FM transmitter. I'd like to connect it to my home pc (ie. into the speaker port), and I'd then control the output with my iPhone (ie. using Apple's Remote software). The problem is, given that almost every FM transmitter is advertised to be used in the car (ie. an iTrip) it's proving very tricky knowing which one would be ideal for the home. First, has anyone tried this? Did it work ok or was there simply to much interference for it work. Secondly, if it did work ok, can anyone recommend a reasonable transmitter? For what I need it seems like an ideal solution, so given that I'm struggling to find information regarding it I'm starting to believe it's not as ideal as it first seems. Thanks in advanance.

    Read the article

  • Issuew while checking in in TFS client explorer 2005

    - by Mini
    We have recently installed Team Explorer client for 2005 and TFS server 2008.. We have been using VS2005 and VSS earlier. To connect to TFS server 2008 we have installed a hotfix VS80sp1-KB932544-X86-ENU.exe. Everything has been setup well. However I noticed that when the files are checked out and u make some modifications , during checking in resolve confict dialog box asking to merge changes done by others isn't appearing. Instead the file is getting checked in overwriting the changes done by others. Is there some setting that needs to be done on TFS server 2008? Kindly help.

    Read the article

  • Render ViewComponent from another component codebehind

    - by George Polevoy
    I'm trying to render a component from withing another component. public override void Render() // ... var block = new Block(); block.Init(EngineContext, Context); block.Render(); // ... } The problem is that Block component can't find it's template. ResourceProcessingException Message: Unable to process resource 'components\CustomReportComponentComponent\default.vm': Resource could not be located I guess, other problems can arise because the component is not properly initialized. Is it possible to initialize a component from within another component's Render method, so it renders just as if called from a .vm?

    Read the article

  • Looping over a Cfquery or a Struct ?

    - by Somu
    Hi I have a query which retrieves Some data. I want to display that data considering some conditions in different div tags. Now my question is, I am doing this by looping the query once and getting the data in three different structs and using these structs while displaying. Is this a good approach or looping through the query everytime in each div to check the condition is the rirht approach ? <tr > features: #getAttributes.seat# Disclosures: #getTicketAttributes.seat#

    Read the article

  • How to access data using VBSCRIPT from a stored procedure which contains values in Temp table ?

    - by Srivigneshwar
    Hi , for testing purpose I wrote a VBscript which will fetch values from Sybase by executing a stored procedure which contains values in temp table. When I run the script I get the following errors , "Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record." or "Item cannot be found in the collection corresponding to the requested name or ordinal." Somewhere when I was googling I found that , the above error message will be shown when we use temp table in stored procedure, if that is the reason , then how can I access data via VBscript by executing the stored procedure ??

    Read the article

  • GZIP .htaccess and php session problem

    - by Suresh
    Hi, I am trying to implement GZIP compression for my website. I copied the below code in my .htaccess file: ExpiresActive On ExpiresDefault A604800 Header append Cache-Control "public" <IfModule mod_deflate.c> <FilesMatch "\.(js|css)$"> SetOutputFilter DEFLATE </FilesMatch> </IfModule> what happens is when I type username and password the page reloads but still the login form is displayed but session is set. When I refresh the page using ctrl + R the login form goes and the username is displayed. what will be the problem. wwaiting for ur reply.

    Read the article

  • Zend Framework - Deny access to folders other than public folder

    - by Vincent
    All, I have the following Zend application structure: helloworld - application - configs - controllers - models - layouts - include - library - public - .htaccess - index.php - design - .htaccess The .htaccess in the root folder has the following contents: ##################################################### # CONFIGURE media caching # Header unset ETag FileETag None Header unset Last-Modified Header set Expires "Fri, 21 Dec 2012 00:00:00 GMT" Header set Cache-Control "max-age=7200, must-revalidate" SetOutputFilter DEFLATE # ##################################################### ErrorDocument 404 /custom404.php RedirectMatch permanent ^/$ /public/ The .htaccess in the public folder has the following: Options -MultiViews ErrorDocument 404 /custom404.php RewriteEngine on # The leading %{DOCUMENT_ROOT} is necessary when used in VirtualHost context RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -s [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -l [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] My vhost configuration is as under: <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "C:\\xampp\\htdocs\\xampp\\helloworld\\" ServerName helloworld ServerAlias helloworld <Directory "C:\\xampp\\htdocs\\xampp\\helloworld\\"> Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory> </VirtualHost> Currently, if the user visits, http://localhost, my .htaccess files above make sure, the request is routed to http://localhost/public automatically. If the user visits any other folder apart from public folder from the address bar, he gets a directory listing of that folder. How can I make sure to deny the user access to every other folder except the public folder? I want the user to be redirected to the public folder if he visits any other folder. However, if the underlying code requests something from other folders, (ex: ) it should still work.. Thanks

    Read the article

  • regular expressions: love or hate or alternatives?

    - by yamspog
    While I can see the value and usefulness of regular expressions, I also find that they are extremely complicated and difficult to create and debug. I am often at the point where I find their usefulness is offset by the difficulty in creating expressions. I am a bit astonished by the fact that there is nothing quite like them and that there hasn't been an effort to recreate them use a more verbose or less arcane syntax. so, are regular expressions here to stay? are there alternatives that are gaining traction? do other people just ignore them and write hundreds of lines of string compare functions?

    Read the article

  • biginteger calucation prfoblem

    - by murali
    hi i am using the following code but the parameters are not passed to the methods. BigInteger p = BigInteger.valueOf(0); BigInteger u1 = obj.bigi_calc(g1, l); in this g1,l are long values the method is private BigInteger bigi_calc(long g1, long l){ BigInteger cal = BigInteger.valueOf(g1); BigInteger cal1= BigInteger.valueOf(l); for(BigInteger f = BigInteger.ONE;f.compareTo(cal1)>0;f=f.add(BigInteger.ONE)){ //BigInteger p= BigInteger.valueOf(0); p = cal.multiply(cal1); System.out.println("check p"+p); } // System.out.println("check p"+p); return p; } the elipse shows that it may be out of sync.. but the paramerters are not passed to the functions.. can you plz help me to slove this problem

    Read the article

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