Search Results

Search found 8 results on 1 pages for 'horacio'.

Page 1/1 | 1 

  • Are the National Computer Science Academy certifications worth it?

    - by Horacio Nuñez
    Hi to every one. I have a question regarding the real value of having NCSA's certifications. Today I reach their site and I easily passed the JavaScript certification within minutes, but I never reach questions related to Literal Javascript Notation (Json), closures or browser specific apis. This facts let me to doubt a bit of the real value of the test (and the proper certification you can have if you pay them $34), but maybe Im wrong and just earned a respected certification within the States for easy questions... in wich case I can spend some time doing other certifications on the same site. Did you have an NCSA certification and think is worth having it in your resume, or you know of a better certification program? thanks in advance, and looking forward to see your considerations.

    Read the article

  • Are the National Computer Science Academy certifications worth it?

    - by Horacio Nuñez
    I have a question regarding the real value of having NCSA's certifications. Today I reach their site and I easily passed the JavaScript certification within minutes, but I never reach questions related to Literal Javascript Notation (Json), closures or browser specific APIs. This facts let me to doubt a bit of the real value of the test (and the proper certification you can have if you pay them $34), but maybe Im wrong and just earned a respected certification within the States for easy questions... in which case I can spend some time doing other certifications on the same site. Did you have an NCSA certification and think is worth having it in your resume, or you know of a better certification program?

    Read the article

  • Make jqGrid fill it's container

    - by Horacio
    I am using the jQuery layout plugin and the jqGrid plugin in one of my projects and they work great except for a little problem... I want the jqGrid to fill up completely the pane (jQuery layout pane) that contains it. Resizing the pane should resize the jqGrid, closing the pane should hide the jqGrid, etc, etc... Both jqGrid and jQuery Layout provide callbacks but when I use them the page layout breaks horribly. Has anyone any experience mixing jqGrid with jQuery Layout? http://www.secondpersonplural.ca/jqgriddocs/index.htm http://layout.jquery-dev.net/

    Read the article

  • Previous power of 2

    - by Horacio
    There is a lot of information on how to find the next power of 2 of a given value (see refs) but I cannot find any to get the previous power of two. The only way I find so far is to keep a table with all power of two up to 2^64 and make a simple lookup. Acius' Snippets gamedev Bit Twiddling Hacks Stack Overflow

    Read the article

  • Variable lenght arguments in log4cxx LOG4CXX_ macros

    - by Horacio
    I am using log4cxx in a big C++ project but I really don't like how log4cxx handles multiple variables when logging: LOG4CXX_DEBUG(logger, "test " << var1 << " and " << var3 " and .....) I prefer using printf like variable length arguments: LOG4CXX_DEBUG(logger, "test %d and %d", var1, var3) So I implemented this small wrapper on top of log4cxx #include <string.h> #include <stdio.h> #include <stdarg.h> #include <log4cxx/logger.h> #include "log4cxx/basicconfigurator.h" const char * log_format(const char *fmt, ...); #define MYLOG_TRACE(logger, fmt, ...) LOG4CXX_TRACE(logger, log_format(fmt, ## __VA_ARGS__)) #define MYLOG_DEBUG(logger, fmt, ...) LOG4CXX_DEBUG(logger, log_format(fmt, ## __VA_ARGS__)) #define MYLOG_INFO(logger, fmt, ...) LOG4CXX_INFO(logger, log_format(fmt, ## __VA_ARGS__)) #define MYLOG_WARN(logger, fmt, ...) LOG4CXX_WARN(logger, log_format(fmt, ## __VA_ARGS__)) #define MYLOG_ERROR(logger, fmt, ...) LOG4CXX_ERROR(logger, log_format(fmt, ## __VA_ARGS__)) #define MYLOG_FATAL(logger, fmt, ...) LOG4CXX_FATAL(logger, log_format(fmt, ## __VA_ARGS__)) static log4cxx::LoggerPtr logger(log4cxx::Logger::getRootLogger()); int main(int argc, char **argv) { log4cxx::BasicConfigurator::configure(); MYLOG_INFO(logger, "Start "); MYLOG_WARN(logger, log_format("In running this in %d threads safe?", 1000)); MYLOG_INFO(logger, "End "); return 0; } const char *log_format(const char *fmt, ...) { va_list va; static char formatted[1024]; va_start(va, fmt); vsprintf(formatted, 1024, fmt, va); va_end(va); return formatted; } And this works perfectly but I know using that static variable (formatted) can become problematic if I start using threads and each thread logging to the same place. I am no expert in log4cxx so I was wondering if the LOG4CXX macros are handling concurrent thread access automatically? or do I have to implement some sort of locking around the log_format method? something that I wan't to avoid due to performance implications. Also I would like to ask why if I replace the vsprintf inside the log_format method with vsnprintf (that is more secure) then I get nothing printed? To compile and test this program (in Ubuntu) use : g++ -o loggertest loggertest.cpp -llog4cxx

    Read the article

  • Dynamically register constructor methods in an AbstractFactory at compile time using C++ templates

    - by Horacio
    When implementing a MessageFactory class to instatiate Message objects I used something like: class MessageFactory { public: static Message *create(int type) { switch(type) { case PING_MSG: return new PingMessage(); case PONG_MSG: return new PongMessage(); .... } } This works ok but every time I add a new message I have to add a new XXX_MSG and modify the switch statement. After some research I found a way to dynamically update the MessageFactory at compile time so I can add as many messages as I want without need to modify the MessageFactory itself. This allows for cleaner and easier to maintain code as I do not need to modify three different places to add/remove message classes: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <inttypes.h> class Message { protected: inline Message() {}; public: inline virtual ~Message() { } inline int getMessageType() const { return m_type; } virtual void say() = 0; protected: uint16_t m_type; }; template<int TYPE, typename IMPL> class MessageTmpl: public Message { enum { _MESSAGE_ID = TYPE }; public: static Message* Create() { return new IMPL(); } static const uint16_t MESSAGE_ID; // for registration protected: MessageTmpl() { m_type = MESSAGE_ID; } //use parameter to instanciate template }; typedef Message* (*t_pfFactory)(); class MessageFactory· { public: static uint16_t Register(uint16_t msgid, t_pfFactory factoryMethod) { printf("Registering constructor for msg id %d\n", msgid); m_List[msgid] = factoryMethod; return msgid; } static Message *Create(uint16_t msgid) { return m_List[msgid](); } static t_pfFactory m_List[65536]; }; template <int TYPE, typename IMPL> const uint16_t MessageTmpl<TYPE, IMPL >::MESSAGE_ID = MessageFactory::Register( MessageTmpl<TYPE, IMPL >::_MESSAGE_ID, &MessageTmpl<TYPE, IMPL >::Create); class PingMessage: public MessageTmpl < 10, PingMessage > {· public: PingMessage() {} virtual void say() { printf("Ping\n"); } }; class PongMessage: public MessageTmpl < 11, PongMessage > {· public: PongMessage() {} virtual void say() { printf("Pong\n"); } }; t_pfFactory MessageFactory::m_List[65536]; int main(int argc, char **argv) { Message *msg1; Message *msg2; msg1 = MessageFactory::Create(10); msg1->say(); msg2 = MessageFactory::Create(11); msg2->say(); delete msg1; delete msg2; return 0; } The template here does the magic by registering into the MessageFactory class, all new Message classes (e.g. PingMessage and PongMessage) that subclass from MessageTmpl. This works great and simplifies code maintenance but I still have some questions about this technique: Is this a known technique/pattern? what is the name? I want to search more info about it. I want to make the array for storing new constructors MessageFactory::m_List[65536] a std::map but doing so causes the program to segfault even before reaching main(). Creating an array of 65536 elements is overkill but I have not found a way to make this a dynamic container. For all message classes that are subclasses of MessageTmpl I have to implement the constructor. If not it won't register in the MessageFactory. For example commenting the constructor of the PongMessage: class PongMessage: public MessageTmpl < 11, PongMessage > { public: //PongMessage() {} /* HERE */ virtual void say() { printf("Pong\n"); } }; would result in the PongMessage class not being registered by the MessageFactory and the program would segfault in the MessageFactory::Create(11) line. The question is why the class won't register? Having to add the empty implementation of the 100+ messages I need feels inefficient and unnecessary.

    Read the article

  • Use javascript variables in Rails view helpers

    - by Horacio
    Using jqGrid I want to generate delete links for each row in the grid. The standard way to do this is to add the links in the gridComplete callback like shown below: gridComplete: function() { var ids = jQuery("#jobs_table").jqGrid('getDataIDs'); for(var i=0;i < ids.length;i++){ var cl = ids[i]; be = '<%= link_to(image_tag("delete.gif", :border=>0, :size=>"20x22", :alt => "delete"),· { :action => 'destroy', :id => 'cl', :method => :delete}, :class => 'ajax') -%>'; jQuery("#jobs_table").jqGrid('setRowData',ids[i],{workflow_state:be}); } }, Using getDataIDs I get a list of IDs that I can use to generate the delete links. The problem is that this is a javascript call that results in a javascript variable. The question is how can I use this variable "cl" inside rails link_to view helper?

    Read the article

1