Daily Archives

Articles indexed Tuesday March 23 2010

Page 27/130 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Does Lua support Unicode?

    - by TimK
    Based on the link below, I'm confused as to whether the Lua programming language supports Unicode. http://lua-users.org/wiki/LuaUnicode It appears it does but has limitations. I simply don't understand, are the limitation anything big/key or not a big deal?

    Read the article

  • How to parse kanji numeric characters using ICU?

    - by Aki
    I'm writing a function using ICU to parse an Unicode string which consists of kanji numeric character(s) and want to return the integer value of the string. "?" = 5 "???" = 31 "???????" = 5972 I'm setting the locale to Locale::getJapan() and using the NumberFormat::parse() to parse the character string. However, whenever I pass it any Kanji characters, the parse() method is returning U_INVALID_FORMAT_ERROR. Does anyone know if ICU supports Kanji character strings in the NumberFormat::parse() method? I was hoping that since I'm setting the Locale to Japanese that it would be able to parse Kanji numeric values. Thanks! #include <iostream> #include <unicode/numfmt.h> using namespace std; int main(int argc, char **argv) { const Locale &jaLocale = Locale::getJapan(); UErrorCode status = U_ZERO_ERROR; NumberFormat *nf = NumberFormat::createInstance(jaLocale, status); UChar number[] = {0x4E94}; // Character for '5' in Japanese '?' UnicodeString numStr(number); Formattable formattable; nf->parse(numStr, formattable, status); if (U_FAILURE(status)) { cout << "error parsing as number: " << u_errorName(status) << endl; return(1); } cout << "long value: " << formattable.getLong() << endl; }

    Read the article

  • how to read and edit a doc file in asp.net?

    - by Nimesh
    I have a .doc or .docx file where in after the booking of the hotel room i wanna give the agreement and the receipt in a .doc file. for this i have a text file, To, [NAME] [ADDRESS] Dear.... ...Content;;;... This will be my .doc file. My idea is to read this .doc file and replace the tags, say.([NAME] and [ADDRESS]) with the user's name and address. How can i do this in ASP.NET?

    Read the article

  • Log4j Dynamic Parameter

    - by cedric
    Hi. i have a j2ee web application running on spring framework and using log4j for logging. I have this line in my log4j.properties file. this will insert the logs in my database. How do I set a dynamic value in the message part so that I can somehow append the currently logged in user. The bean object containing info for the current user is in the application context. log4j.appender.dbLog.sql = INSERT INTO LOGGING (log_date, log_level, location, message) VALUES ('%d{yyyy/MM/dd HH:mm:ss}', '%-5p', '%C-%L', '%m')

    Read the article

  • ItemAdded Event for document library in sharepoint 2007

    - by Azra
    hi I am having a document library in share point 2007, I want to validate certain custom properties before a document is uploaded Or Properties are entered when Edit properties event is cliked. I am trying to validate the fields at ItemAdding event whne a documetn is uploaded , however when EditForm.aspx opens up for editing properties, no events firs. How can I troubleshoot the issue? thanks azra

    Read the article

  • XML is case sensitive hence Xml parser (XmlDocument) too...

    - by Narendra Tiwari
    XML is case sensitive hence Xml parser (XmlDocument) too... In below example I am trying to search the <user> element node with name attibute as 'pupu'.  <user name="PuPu" fullname="Priyanka T" email="[email protected]" /> ::translate() functon esures the case insensitive comparision in Xpath expression.   XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("<xml file to load>"); XmlElement userElement = (XmlElement)xmlDoc.DocumentElement.SelectSingleNode("//user[translate(@name,'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') ='pupu']");

    Read the article

  • gluster IOPS performance

    - by Gotys
    Can "gluster" serve FLV files without any front-end server layers just using the built-in HTTP protocol ? How would the IOPS compare to standard apache serving? Would gluster help me with I/O limits of harddrives, if I chained a lot of machines together? Thank you!

    Read the article

  • Is there a vmware appliance for software development?

    - by Ali Shafai
    I use Assembla.com and it does everything I need, SVN, bug tracking, ticketing... the only thing I don't like is that the server is not mine, I'm putting all my company property on a server in the coulds. I was wondering if there is an virtual machine to download and put on my server to serve all Assembla does?

    Read the article

  • Work around for yahoo mail slowness (using 100% cpu)

    - by Tony Lee
    My yahoo mail is very slow sometimes. When it is, I notice that IE8 is using 100% cpu. Using sysinternals process explorer I discovered the thread using all the cpu in IE8 has Flash in the stackwalk. I upgraded flash from 9 to 10, but the problem persists. I'm about to edit hosts to block the flash content by redirecting the yahoo and ad click dns entries. Is there some easier way to get flash to behave? The fix for the long run will be switching to gmail.

    Read the article

  • Magic Mouse and Alum keyboard autosleep?

    - by Moshe
    How does the power management of the wireless keyboard and magic mouse work with iMac? (late 2009) Do I need to manually power off the keyboard and mouse when I shut off my Mac or do they power off/sleep automatically? ( BONUS: How often should the batteries be replaced? )

    Read the article

  • JQuery if statements?

    - by SLAPme
    New to JQuery and was wondering how can I put the following JQuery code in an if statement so that it only runs when the submit button is clicked and does nothing when not clicked I know I'm using the $(".save-button").click(function() is there a way to put it in an if statement? JQuery code. $(function() { $(".save-button").click(function() { $.post($("#contact-form").attr("action"), $("#contact-form").serialize(), function(html) { $("div.contact-info-form").html(html); $('#changes-saved').append('<li>Changes saved!</li>').show().pause(1000).hide(); }); return false; // prevent normal submit }); });

    Read the article

  • GCC problem with raw double type comparisons

    - by Monomer
    I have the following bit of code, however when compiling it with GCC 4.4 with various optimization flags I get some unexpected results when its run. #include <iostream> int main() { const unsigned int cnt = 10; double lst[cnt] = { 0.0 }; const double v[4] = { 131.313, 737.373, 979.797, 731.137 }; for(unsigned int i = 0; i < cnt; ++i) { lst[i] = v[i % 4] * i; } for(unsigned int i = 0; i < cnt; ++i) { double d = v[i % 4] * i; if(lst[i] != d) { std::cout << "error @ : " << i << std::endl; return 1; } } return 0; } when compiled with: "g++ -pedantic -Wall -Werror -O1 -o test test.cpp" I get the following output: "error @ : 3" when compiled with: "g++ -pedantic -Wall -Werror -O2 -o test test.cpp" I get the following output: "error @ : 3" when compiled with: "g++ -pedantic -Wall -Werror -O3 -o test test.cpp" I get no errors when compiled with: "g++ -pedantic -Wall -Werror -o test test.cpp" I get no errors I do not believe this to be an issue related to rounding, or epsilon difference in the comparison. I've tried this with Intel v10 and MSVC 9.0 and they all seem to work as expected. I believe this should be nothing more than a bitwise compare. If I replace the if-statement with the following: if (static_cast<long long int>(lst[i]) != static_cast<long long int>(d)), and add "-Wno-long-long" I get no errors in any of the optimization modes when run. If I add std::cout << d << std::endl; before the "return 1", I get no errors in any of the optimization modes when run. Is this a bug in my code, or is there something wrong with GCC and the way it handles the double type?

    Read the article

  • Ruby on Rails: How to sanitize a string for SQL when not using find?

    - by williamjones
    I'm trying to sanitize a string that involves user input without having to resort to manually crafting my own possibly buggy regex if possible, however, if that is the only way I would also appreciate if anyone can point me in the right direction to a regex that is unlikely to be missing anything. There are a number of methods in Rails that can allow you to enter in native SQL commands, how do people escape user input for those? The question I'm asking is a broad one, but in my particular case, I'm working with a column in my Postgres database that Rails does not natively understand as far as I know, the tsvector, which holds plain text search information. Rails is able to write and read from it as if it's a string, however, unlike a string, it doesn't seem to be automatically escaping it when I do things like vector= inside the model. For example, when I do model.name='::', where name is a string, it works fine. When I do model.vector='::' it errors out: ActiveRecord::StatementInvalid: PGError: ERROR: syntax error in tsvector: "::" "vectors" = E'::' WHERE "id" = 1 This seems to be a problem caused by lack of escaping of the semicolons, and I can manually set the vector='\:\:' fine. I also had the bright idea, maybe I can just call something like: ActiveRecord::Base.connection.execute "UPDATE medias SET vectors = ? WHERE id = 1", "::" However, this syntax doesn't work, because the raw SQL commands don't have access to find's method of escaping and inputting strings by using the ? mark. This strikes me as the same problem as calling connection.execute with any type of user input, as it all boils down to sanitizing the strings, but I can't seem to find any way to manually call Rails' SQL string sanitization methods. Can anyone provide any advice?

    Read the article

  • g_tree_insert overwrites all data

    - by pechenie
    I wonder how I should use the GTree (from GLib) to store data? Every new value I insert into GTree with g_tree_insert routine is overwrite the previous one! GTree *tree; //init tree = g_tree_new( g_str_equal ); //"g_str_equal" is a GLib default compare func //... for( i = 0; i < 100; ++i ) g_tree_insert( tree, random_key(), random_value() ); //insert some random vals // printf( "%d", g_tree_nnodes( tree ) ); //should be 100? NO! Prints "1"!!! What am I doing wrong? Thank you.

    Read the article

  • Suggest joomla html editor extension/software

    - by DMin
    I've started using Joomla 1.5 recently and am using the TinyMCE online WYSIWYG editor that comes with the package to edit articles. I tend to write direct html and javascript rather than use the WYSIWYG functions, I find that after the first time the changes are applied(page updated) most of your html becomes 4-5 separate big paragraphs. Its very hard to find stuff in there cause the content has no formatting -- eg: <p><span id="psy_ass_span" class="pink_heading">Psychometric Assessment</span></p> <div id="psy_ass_div" class="pink_box"><img class="img_right" src="templates/teamwork.jpg" border="0" /> <p><strong>Emporkommen</strong> uses <strong>Psychometric assessment</strong> as a tool in order to gain insight into a person’s personality and psychological thinking. It can help develop team spirit in t <script src="plugins/editors/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js" type="text/javascript"></script> he workplace and assess an individual’s priorities.</p> Plus obviously there is no code highlighting in the editor so you can't figure out what is what. My question is, do you guys know of good(preferably non-commercial) extensions or other softwares or techniques that can make editing html code in Joomla 1.5 articles easier even after applying changes several times.

    Read the article

  • Mono vs .NET Interop curiosity

    - by Olaseni
    I'm developing a huge console application for Unix using C# via Mono. If I develop that app using M Visual Studio and .NET 3.5 and I carefully neglect to use win32 specific API calls, should I expect that application to automatically work in my Unix box? Or should I just get MonoDevelop and go the Mono way?

    Read the article

  • How can I transform XML to invalid XML using XSLT?

    - by Damovisa
    I need to transform a valid XML document to the OFX v1.0.2 format. This format is more or less XML, but it's technically invalid and therefore cannot be parsed as XML. I'm having trouble getting my Xml transformation working because the .Net XslCompiledTransform object insists on interpreting the XSL as an XML document (which is fair enough). If I escape the xml-ish tags using &lt; and &gt, they get removed when I download the file. Here's the start of my XSLT: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text"></xsl:output> <xsl:param name="currentdate"></xsl:param> <xsl:template match="Transactions"> OFXHEADER:100 DATA:OFXSGML VERSION:102 SECURITY:NONE ENCODING:USASCII CHARSET:1252 COMPRESSION:NONE OLDFILEUID:NONE NEWFILEUID:NONE <OFX> <SIGNONMSGSRSV1> <SONRS> <STATUS> <CODE>0 <SEVERITY>INFO </STATUS> <DTSERVER><xsl:value-of select="$currentdate" /> <LANGUAGE>ENG Any suggestions?

    Read the article

  • Lua .NET How to use the standard and third party libraries

    - by Gopalakrishnan Subramani
    I am using Lua inside C# WinForms application for GUI automation testing. I want to use the logging library http://www.keplerproject.org/lualogging/ But I don't know where to copy those logging library files and other standard lua files so that I can use the standard lua logging within the lua scripts. I see something like LUA_PATH but still I don't understand how to make the lua packing strcuture without installing it.

    Read the article

  • Rails "Load more..." instead of pagination.

    - by Joseph Silvashy
    I have a list of elements, and I've been using will_paginate up until now, but I'd like to have something like "load more..." at the bottom of the list. Is there an easy way to accomplish this using will_paginate or do I need to resort to some other method here? From what I know this is a better route anyhow because then I don't need a SQL count of the records. And it really doesn't matter if there are like 9,847 pages, nobody would need the records beyond the first couple pages anyhow.

    Read the article

  • how to extend wpf combo box to bind data?

    - by Shaihan
    i need to bind a collection of objects to a combo box which i can use in different forms. so i want create a custom control which binds the collection to the combo box? how t do it by extending combo box? also how can i define the ItemData template?

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >