Daily Archives

Articles indexed Saturday April 24 2010

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

  • Best Java library(ies) for forgiving command interpreter

    - by vkraemer
    I am looking for a library or set of libraries that will help me write a forgiving command interpreter. A forgiving command interpreter would be a command interpreter which can deal with simple and even not so simple spelling and word order mistakes in the input. My goal is to have an interpreter which would take the input (a command) from a user and then: execute the command, if it is correct. apply corrections to the command, until a correct command is generated and then present that command to the user to confirm whether it is 'what the user meant'.

    Read the article

  • stored values within a custom function

    - by romunov
    My program takes a data.frame and crunches the numbers. At one point, values from j-th column are multiplied by a predefined values that depends on the column name (species name, actually - it's en ecological index). So far, I've been providing these values via a second data.frame by matching column names. What would be an efficient way of integrating fixed variable values within a function? I would like my program to be as portable as possible, without the need for a second data.frame file.

    Read the article

  • How do you perform macro expansion within #ifdef?

    - by Malvineous
    Hi all, I have some fairly generic code which uses preprocessor macros to add a certain prefix onto other macros. This is a much simplified example of what happens: #define MY_VAR(x) prefix_##x "prefix_" is actually defined elsewhere, so it will be different each time the file is included. It works well, but now I have some code I would like to skip if one of the tokens doesn't exist, but this doesn't work: #if defined MY_VAR(hello) What I want it to expand to is this: #ifdef prefix_hello But I can't figure out how. I need to use the MY_VAR() macro to do the expansion, so I can't just hardcode the name. (It's actually for some testing code, the same code gets included with a different prefix each time to test a bunch of classes, and I want to skip a couple of tests for a handful of the classes.) Is this possible with the C++ preprocessor?

    Read the article

  • Javascript calls to an Ajax WebMethod. How to get multiple output params returned?

    - by George
    OK, I know how to call a simple old fashion asmx webservice webthod that returns a single value as a function return result. But what if I want to return multiple output params? My current approach is to separate the params by a dividing character and parse them on teh client. Is there a better way. Here's how I return a single function result. How do I return multiple output values? <asp:ScriptManager ID="ScriptManager1" runat="server"> <Services> <asp:ServiceReference Path="WebService.asmx" /> </Services> function CallHelloWebMethod() { WebService.Hello(OnComplete1, OnTimeOut, OnError); } function OnComplete1(arg) { alert(arg); } function OnTimeOut(arg) { } <WebMethod()> Public Function Hello(ByVal x As String) As String Return "Hello " & x End Function

    Read the article

  • What are some lesser known usages of #pragma?

    - by Xavier Ho
    I've never understood the need of #pragma once when #ifndef #define #endif always works. I've seen the usage of #pragma comment to link with other files , but setting up the compiler settings was easier with an IDE. What are some other usages of #pragma that is useful, but not widely known?

    Read the article

  • PyFacebook with Pylons

    - by ensnare
    I'd like to implement PyFacebook in my Python + Pylons application. Where should I include the package? What's the cleanest way to import it? What directory should I put the files in? Thanks!

    Read the article

  • Infrastructure for a "news-feed"

    - by ensnare
    I'd like to offer a news-feed like feature for users of our website. When the user logs in, he is shown a list of the latest updates across various areas of the site. I'm afraid that this is going to be difficult to scale. What are some networking / database topologies that can support a scalable infrastructure without having lots of copies of the same data? (I'd like to make it so if a piece of data is updated, each user's feed is also updated live). Thanks for the assistance and advice.

    Read the article

  • Warning: session_start(): Cannot send session cache limiter - headers already sent

    - by shyam
    I am receiving this warning in a page while I try starting the session. <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Video</title> </head> -this is the part of the code. There are no characters (not even space) before the first line. This page is reached after logging in from another page, through redirection. Any help? (PHP version is 5.2)

    Read the article

  • How to differentiate between two class of same name in different css on same page.

    - by Rajesh Rolen- DotNet Developer
    on my asp.net page i am linking 2 css files which are used by 2 different controls but the main problem is that one class name is same in both so they are conflicting with each other, please tell me how can i distinguish between them. Both are of jquery, 1 is slider control and another one is time picker control. and they are conflicting on their background image as i want to change background image of slider control's scroller. Please give me solution..

    Read the article

  • php cookie not working

    - by Jacksta
    I am trying to use a cookie with authentication. This page works once entering user and pass <? if ((!$_POST[username]) || (!$_POST[password])) { header("Location: show_login.html"); exit; } $db_name = "testDB"; $table_name = "auth_users"; $connection = @mysql_connect("localhost", "user", "pass") or die(mysql_error()); $db = @mysql_select_db($db_name, $connection) or die(mysql_error()); $sql = "SELECT * FROM $table_name WHERE username ='$_POST[username]' AND password = password('$_POST[password]')"; $result = @mysql_query($sql, $connection) or die(mysql_error()); $num = mysql_num_rows($result); if ($num != 0) { $cookie_name = "auth"; $cookie_value = "ok"; $cookie_expire = "0"; $cookie_domain = "domain.com.au"; setcookie($cookie_name, $cookis_value, $cookie_expire, "/", $cookie_domain, 0); $display_block = " <p><strong>Secret Menu:</strong></p> <ul> <li><a href=\"secretA.php\">secret page A</a> <li><a href=\"secretB.php\">secret page B</a> </ul>"; } else { header("Location: show_login.html"); exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Secret Area</title> </head> <body> <? echo "$display_block"; ?> </body> </html> WHen clicking on either secretA.php or secretB.php I am redirected to log in again, it should work. here is the code. secretB.php <?php if ($_COOKIE[auth] == "ok") { $msg = "<p>Welcome to secret page B, authorised user! </P>"; } else { header( "Location: /show_login.html"); exit; } ?> <HTML> <HEAD> <title>Secret Page B:</title> </HEAD> <BODY> <? echo "$msg"; ?> </BODY> </HTML>

    Read the article

  • preload image with jquery

    - by robertdd
    Updated: firs append a empty image and a span with some text hide the loading image, after it's load it's show the image var pathimg = "path/to/image" + "?" + (new Date()).getTime(); $('#somediv').append('<div><span>loading..</span><img id="idofimage" src="" alt="" ></div>') jQuery("#idofimage").hide().attr({"src":pathimg}) .load(function() { jQuery(this).show(); }); old post ok, I spent 2 days trying to preloaded images but no succes! i have this function: jQuery.getlastimage = function(id) { $.getjs(); $.post('operations.php', {'operation':'getli', 'id':id,}, function(lastimg){ $("#upimages" + id).html('<a href="uploads/'+ lastimg +'?'+ (new Date()).getTime() +'"><img class="thumbs" id="' + id + '" alt="' + lastimg + '" src="uploads/' + lastimg +'?'+ (new Date()).getTime() + '" /></a>'); }); }; lastimg is the name of the image while the image loading i want to appear a gif or a text "Loading...". the function will get something like this: <div class="upimage"> <ul class="thumbs" id="upimagesQueue"> **<li id="#upimagesRIFDIB"> <a href="uploads/0001.jpg?1271800088379"> <img src="uploads/0001.jpg?1271800088379" alt="0001.jpg" id="RIFDIB" class="thumbs"> </a> </li>** <li> .... </li> </ul> </div> i tried like this: ... $.post('operations.php', {'operation':'getli', 'id':id,}, function(lastimg){ $("#upimages" + id) .html('<a href="uploads/'+ lastimg +'?'+ (new Date()).getTime() +'"><img class="thumbs" id="' + id + '" alt="' + lastimg + '" src="uploads/' + lastimg +'?'+ (new Date()).getTime() + '" /></a>') .hide() .load(function() { $(this).show(); }); ... but all the <li> will hide and after is loading the image appear, i want the <li> to apear with a gif or a text in it and after the image is loaded the link and the image to apear! How to do this? Anyone have an idea? Thanks!

    Read the article

  • overriding Method asp.net mvc

    - by parminder
    Hi Experts, Can I override an ActionResult method. Say I have a method Index in AccountController like this public ActionResult Index() { return View(); } Can I have one more method with same name but with differnt parameters like public ActionResult Index(int userid) { return View(); } what will be the entries in the global.asax Regards Parminder

    Read the article

  • What is your opinion of the Telerik Extensions for MVC?

    - by Chad
    I've started digging around with using the Telerik Extensions for MVC. They don't integrate seemlessly into my current project, but I could reorganize things to fit it in. But, I'm wondering if it would be worth it in the end. I've been searching for reviews on the extensions, I haven't seen too many. So I'm asking here. On their website they claim: You can achieve unprecedented performance for your web application with the lightweight, semantically rendered Extensions that completely leverage the ASP.NET MVC model of no postbacks, no ViewState, and no page life cycle. So I'm curious, What is your opinion of the Telerik Extensions for MVC?

    Read the article

  • Invalid user names when creating a LDAP account

    - by h1d
    I'm trying to set up a system where a visitor can enter any user name in a form to create a new user and in the end it gets built on LDAP directory and I'm planning that to be mapped as a UNIX account as well (on Ubuntu Linux) by making the system look up for system accounts on the LDAP. Doing so is fine, but I feel that many user names should be avoided, one of the obvious being 'root' and all the other user names taken for daemons etc. How do you tackle at this problem? Do you make up a list of disallowed user names by checking /etc/passwd? I was thinking that if, internally, the user names could be prepended as 'ldap_' or something, it will avoid any naming conflicts but that seems hard when the LDAP entry name is 'joe' but the system account will look like 'ldap_joe'. Not even sure how that can be achieved.

    Read the article

  • How can i shorten my code for various winform calls in MDI

    - by Shantanu Gupta
    I have a mdi where i have several line of code like the given below. Only chage is Form object which is being opened. So I want to all this work using only single function defination. When I tries to capture sender it gives me ToolStipMenuItem here. But I want its sender to be form name so that I can open its corresponding form. private void purchaseInvoiceToolStripMenuItem_Click(object sender, EventArgs e) { Forms.PurchaseInvoice purinv = new DigitalInvy.Forms.PurchaseInvoice(); purinv.Show(); } private void lederGroupsToolStripMenuItem_Click(object sender, EventArgs e) { Forms.LedgerGroup lgrp = new DigitalInvy.Forms.LedgerGroup(); lgrp.Show(); } private void voucherEntryToolStripMenuItem_Click(object sender, EventArgs e) { Forms.VoucherEntry ventry = new DigitalInvy.Forms.VoucherEntry(); ventry.Show(); } private void currencyToolStripMenuItem_Click(object sender, EventArgs e) { Forms.CurrencyMaster currency = new DigitalInvy.Forms.CurrencyMaster(); currency.Show(); } private void countryToolStripMenuItem_Click(object sender, EventArgs e) { Forms.CountryMaster country = new DigitalInvy.Forms.CountryMaster(); country.Show(); }

    Read the article

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