Search Results

Search found 74 results on 3 pages for 'han cnx'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Strategies for serializing an object for auditing/logging purpose in .NET?

    - by Jiho Han
    Let's say I have an application that processes messages. Messages are just objects in this case that implements IMessage interface which is just a marker. In this app, if a message fails to process, then I want to log it, first of all for auditing and troubleshooting purposes. Secondly I might want to use it for re-processing. Ideally, I want the message to be serialized into a format that is human-readable. The first candidate is XML although there are others like JSON. If I were to serialize the messages as XML, I want to know whether the message object is XML-serializable. One way is to reflect on the type and to see if it has a parameter-less constructor and the other is to require IXmlSerializable interface. I'm not too happy with either of these approaches. There is a third option which is to try to serialize it and catch exceptions. This doesn't really help - I want to, in some way, stipulate that IMessage (or a derived type) should be xml-serializable. The reflection route has obvious disadvantages such as security, performance, etc. IXmlSerializable route locks down my messages to one format, when in the future, I might want to change the serialization format to be JSON. The other thing is even the simplest objects now must implement ReadXml and WriteXml methods. Is there a route that involves the least amount of work that lets me serialize an arbitrary object (as long as it implements the marker interface) into XML but not lock future messages into XML?

    Read the article

  • SmartGWT RestDataSource

    - by Han Fastolfe
    Hi all, I'm using SmartGWT/SmartClient LGPL, I can't use the Pro, due to project ties. I would like to create a RestDataSource from a jdbc connection, to be exposed from the server to the SmartGWT client. How could it be done? Any help is greatly appreciated.

    Read the article

  • How to intercept 401 from Forms Authentication in ASP.NET MVC?

    - by Jiho Han
    I would like to generate a 401 page if the user does not have the right permission. The user requests a url and is redirected to the login page (I have deny all anonymous in web.config). The user logs in successfully and is redirected to the original url. However, upon permission check, it is determined that the user does not have the required permission, so I would like to generate a 401. But Forms Authentication always handles 401 and redirects the user to the login page. To me, this isn't correct. The user has already authenticated, the user just does not have the proper authorization. In other scenarios, such as in ajax or REST service scenario, I definitely do not want the login page - I need the proper 401 page. So far, I've tried custom Authorize filter to return ViewResult with 401 but didn't work. I then tried a normal Action Filter, overriding OnActionExecuting, which did not work either. What I was able to do is handle an event in global.asax, PostRequestHandlerExecute, and check for the permission then write out directly to response: if (permissionDenied) { Context.Response.StatusCode = 401; Context.Response.Clear(); Context.Response.Write("Permission Denied"); Context.Response.Flush(); Context.Response.Close(); return; } That works but it's not really what I want. First of all, I'm not even sure if that is the right event or the place in the pipeline to do that. Second, I want the 401 page to have a little more content. Preferably, it should be an aspx page with possibly the same master page as the rest of the site. That way, anyone browsing the site can see that the permission is denied but with the same look and feel, etc. but the ajax or service user will get the proper status code to act on. Any idea how this can be achieved? I've seen other posts with similar requests but didn't see a solution that I can use. And no, I do not want a 403.

    Read the article

  • does sfWidgetFormSelect provide a string or an int of the selected item?

    - by han
    Hey guys, I'm having an annoying problem. I'm trying to find out what fields of a form were changed, and then insert that into a table. I managed to var_dump in doUpdateObjectas shown in the following public function doUpdateObject($values) { parent::doUpdateObject($values); var_dump($this->getObject()->getModified(false)); var_dump($this->getObject()->getModified(true)); } And it seems like $this-getObject()-getModified seems to work in giving me both before and after values by setting it to either true or false. The problem that I'm facing right now is that, some how, sfWidgetFormSelect seems to be saving one of my fields as a string. before saving, that exact same field was an int. (I got this idea by var_dump both before and after). Here is what the results on both var dumps showed: array(1) {["annoying_field"]=> int(3)} array(1) {["annoying_field"]=>string(1)"3"} This seems to cause doctrine to think that this is a modification and thus gives a false positive. In my base form, I have under $this->getWidgets() 'annoying_field' => new sfWidgetFormInputText(), under $this->setValidators 'annoying_field' => new sfValidatorInteger(array('required' => false)), and lastly in my configured Form.class.php I have reconfigured the file as such: $this->widgetSchema['annoying_field'] = new sfWidgetFormSelect(array('choices' => $statuses)); statuses is an array containing values like {""a", "b", "c", "d"} and I just want the index of the status to be stored in the database. And also how can I insert the changes into another database table? let's say my Log table? Any ideas and advice as to why this is happen is appreciated, I've been trying to figure it out and browsing google for various keywords with no avail. Thanks! Edit: ok so I created another field, integer in my schema just for testing. I created an entry, saved it, and edited it. this time the same thing happened!

    Read the article

  • Strategy in storing ad-hoc numbers/constants?

    - by Jiho Han
    I have a need to store a number of ad-hoc figures and constants for calculation. These numbers change periodically but they are different type of values. One might be a balance, a money amount, another might be an interest rate, and yet another might be a ratio of some kind. These numbers are then used in a calculation that involve other more structured figures. I'm not certain what the best way to store these in a relational DB is - that's the choice of storage for the app. One way, I've done before, is to create a very generic table that stores the values as text. I might store the data type along with it but the consumer knows what type it is so, in situations I didn't even need to store the data type. This kind of works fine but I am not very fond of the solution. Should I break down each of the numbers into specific categories and create tables that way? For example, create Rates table, and Balances table, etc.?

    Read the article

  • Console output window in DLL

    - by user303907
    Hello, I am trying to redirect the output from my DLL to an external console window for easy debugging. I have been told about AllocConsole but I am not able to reproduce it, i.e. the console window does not appear. My current environment is Visual Studio 2005. I tried the following example which is gotten off the Internet, AllocConsole(); HANDLE han = GetStdHandle(STD_OUTPUT_HANDLE); WriteConsole(han,"hello",6,new DWORD,0); yet nothing happens. Can someone point me in the right direction if creating a console window via DLL is possible in the first place. Thanks in advance!

    Read the article

  • ¿Oficina sin papeles?

    - by [email protected]
    Recientemente hemos organizado un evento de Digitalización para mostrar algunos de los últimos productos de Oracle en éste área.Siempre tendemos a pensar que en España estamos retrasados en estas tecnologías y que el mercado no está preparado para eliminar el papel. En algunos casos es cierto, pero también nos hemos llevado sorpresas con clientes extremadamente avanzados en la gestión electrónica del papel.Para los clientes que no tienen una solución corporativa ya desplegada, nuestra oferta de Imaging les parece completa e integrada, porque les permite digitalizar el papel en el punto más cercano a su recepción y posteriormente realizar todo el trámite interno de forma digital.Este proceso es el que se muestra en la siguiente imágen: Sobre todo en el entorno financiero los clientes ya tienen grandes infraestructuras desplegadas (algunos con funcionalidades muy sofisticadas que han desarrollado a medida durante estos últimos años).En estos casos, su interés está centrado en 2 capacidades clave de nuestros productos: La digitalización distribuidaEl OCR inteligenteCuando ya disponemos de una infraestructura de digitalización centralizada, tenemos varios puntos de mejora con los que conseguir mayores ratios de ahorro en la gestión del papel. Uno de ellos es digitalizar en origen, de forma que ahorraremos en logística de desplazamiento y almacenamiento de papel (reducimos valijas) y en velocidad de arranque de los procesos (desde el momento de la recepción).El hecho de poder hacer esto sólo con un explorador de internet es muy novedoso para los clientes.El no instalar ninguna pieza de software de cliente parece que es un requisito que muchos clientes estaban demandando desde hace tiempo. De hecho, estamos realizando demos en vivo con un escáner del cliente (solo necesitamos el driver de windows para ese escáner). El resultado es sorprendente porque mostramos cómo: escaneamos con sólo un explorador de internet; el documento escaneado, con sus metadatos, se incorporan al gestor documental; y se dispara su workflow de aprobación.Hacer esto en segundos es algo que genera mucho interés en los clientes de cara a acelerar la gestión de muchos de sus trámites en papel.Por último, lo más novedoso de la oferta es el OCR inteligente. Hay quien ya tiene absolutamente operativas sus infraestructuras de digitalización con todas estas capacidades, y buscan un paso más allá con el reconocimiento inteligente de todos los metadatos posibles.El beneficio es rápido, claramente cuantificable y muy alto. El software de OCR inteligente se basa en lógica difusa y nos permite definir los umbrales de validación totalmente adecuados a nuestros factores de confianza. Es decir, configuramos el umbral para que cuando el software acepta un acierto tengamos la seguridad total de que dichos metadatos se han reconocido perfectamente. En caso contrario, el software lanza una validación manual.¿Qué pasa si conseguimos que para determinados documentos, el 40%, 50%, 60% o incluso el 70% u 80% de ellos fueran procesados 100% automáticamente?. El ahorro es inmenso, la reducción del tiempo de proceso también, y la integración con nuestras infraestructuras de digitalización es muy sencilla (basta con desviar unos cuantos documentos de un tipo concreto a Oracle Forms Recognition y evaluar el resultado).Os animo a que veáis estos productos y consigamos hacer realidad la reducción de papel.

    Read the article

  • Una de codecs, HTML5 y navegadores

    - by Eugenio Estrada
    Quien haya estado un pelín atento a las noticias tecnológicas, sabrá que esta semana Google en su conferencia Google IO ha publicado su códec de vídeo VP8 para entrar en la guerra de los codecs en los navegadores. Este códec lo ha liberado en el formato WebM que incluye el códec Ogg para el audio, todo envuelto en un contenedor Matroska (MKV para los amigos). Lo interesante es que parece que lo han optimizado para un uso mejor en Web tanto para escritorio, móvil y ahora televisión (con Google TV...(read more)

    Read the article

  • Why does aptitude want to remove a bunch of files?

    - by Mediterran81
    Recently I encountered dependencies resolve issues when using APTITUDE (it is my favorite). Nevertheless, I started to feel that APTITUDE does not behave as it is supposed to be in 64 bits systems while apt-get works fine. Can someone confirm that APTITUDE is buggy in Ubuntu 11.10 amd64? Edit: For example, when tried to install ntfs-config using APTITUDE, it asked me to remove over 100 packages (skype for example), while using apt-get worked fine. han@L502X:~$ sudo aptitude install ntfs-config [sudo] password for han: The following NEW packages will be installed: ntfs-3g{ab} ntfs-config 0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/640 kB of archives. After unpacking 2,466 kB will be used. The following packages have unmet dependencies: ntfs-3g: Conflicts: ntfsprogs but 2.0.0-1ubuntu4 is installed. The following actions will resolve these dependencies: Remove the following packages: 1) flashplugin-downloader 2) flashplugin-installer 3) libasound2 4) libasound2-plugins 5) libasyncns0 6) libatk1.0-0 7) libaudio2 8) libavahi-client3 9) libavahi-common3 10) libc6 11) libcairo2 12) libcomerr2 13) libcups2 14) libcurl3 15) libdatrie1 16) libdb5.1 17) libdbus-1-3 18) libdbusmenu-qt2 19) libexpat1 20) libffi6 21) libflac8 22) libfontconfig1 23) libfreetype6 24) libgcc1 25) libgcrypt11 26) libgdk-pixbuf2.0-0 27) libglib2.0-0 28) libgnutls26 29) libgpg-error0 30) libgssapi-krb5-2 31) libgtk2.0-0 32) libice6 33) libidn11 34) libjack-jackd2-0 35) libjasper1 36) libjpeg62 37) libjson0 38) libk5crypto3 39) libkeyutils1 40) libkrb5-3 41) libkrb5support0 42) liblcms1 43) libldap-2.4-2 44) libmng1 45) libnspr4 46) libnspr4-0d 47) libnss3 48) libnss3-1d 49) libogg0 50) libpango1.0-0 51) libpcre3 52) libpixman-1-0 53) libpng12-0 54) libpulse0 55) libqt4-dbus 56) libqt4-declarative 57) libqt4-network 58) libqt4-script 59) libqt4-sql 60) libqt4-xml 61) libqt4-xmlpatterns 62) libqtcore4 63) libqtgui4 64) librtmp0 65) libsamplerate0 66) libsasl2-2 67) libsasl2-modules 68) libselinux1 69) libsm6 70) libsndfile1 71) libspeexdsp1 72) libsqlite3-0 73) libssl1.0.0 74) libstdc++6 75) libtasn1-3 76) libthai0 77) libtiff4 78) libuuid1 79) libvorbis0a 80) libvorbisenc2 81) libwrap0 82) libx11-6 83) libxau6 84) libxcb-render0 85) libxcb-shm0 86) libxcb1 87) libxcomposite1 88) libxcursor1 89) libxdamage1 90) libxdmcp6 91) libxext6 92) libxfixes3 93) libxft2 94) libxi6 95) libxinerama1 96) libxrandr2 97) libxrender1 98) libxss1 99) libxt6 100) libxv1 101) nspluginviewer 102) nspluginwrapper 103) ntfsprogs 104) skype 105) sni-qt 106) zlib1g Leave the following dependencies unresolved: 107) flashplugin-downloader recommends libasound2-plugins (>= 1.0.16) Accept this solution? [Y/n/q/?]

    Read the article

  • Search option: jqGrid + PHP

    - by Felix Guerrero
    Hi, I'm trying to get work this code: $("#list").jqGrid({ url: 'docente.php', datatype: 'json', mtype: 'POST', postData: {c : "", n: "", a: "", d: "", t: "", e: "", f: "", g: $('#selectD').value(), p: "", call: "report"}, colNames: ['C&eacute;dula','Nombres', 'Apellidos', 'Direcci&oacute;n', 'E-mail','Tel&eacute;fono', 'Profesi&oacute;n'], colModel: [ { name:'rows.cedula', index: 'cedula', search:true, jsonmap: 'cedula', width: 150, align: 'left', sortable:true}, { name:'rows.nombre', index: 'nombre', jsonmap: 'nombre', width: 150, align: 'left'}, { name:'rows.apellido', index: 'apellido', jsonmap: 'apellido', width: 240, align: 'left'}, { name:'rows.direccion', index: 'direccion', jsonmap: 'direccion', width: 330, align: 'left'}, { name:'rows.email', index: 'email', jsonmap: 'email',width: 200, align: 'left'}, { name:'rows.telefono', index: 'telefono', jsonmap: 'telefono', width: 170, align: 'left'}, { name:'rows.descripcion_profesion', index: 'descripcion_profesion', jsonmap: 'descripcion_profesion',width: 120, align: 'left'}], pager: '#pager', rowNum: 8, autowidth: true, rowList: [10, 20], sortname: 'cedula', sortorder: 'asc', viewrecords: true, caption: 'Docentes', jsonReader : { root: "rows", repeatitems: false }, height: 350, width: 900 }); $("#list").jqGrid('navGrid','#pager',{search:true, searchtext: "buscar",edit:false,add:false,del:false}); The HMTL I'm using: <div id="reporte"> <table id="list"></table> <div id="pager"> </div> <div> And the PHP code: $total_pages = 0; $limit=10; $count = Profesor::CountAll(); if($count> 0) $total_pages= ceil($count/$limit); else $total_pages=0; $cnx = new PDO("mysql:host=localhost;dbname=appsms","root",""); $rows = array(); $strQuery="select cedula, nombre, apellido, direccion, telefono, email, descripcion_profesion from Profesor join Profesion on " . " (profesor.profesion_id = profesion.id) and (profesor.grado_id_grado = '" .$this->grado . "') order by cedula;"; $stmt = $cnx->prepare($strQuery); $stmt->execute(array("reporte")); $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); $response->page = 1; $response->total= $total_pages; $response->records = sizeof($rows); $i=0; foreach($rows as $result){ $response->rows[$i] = $result; $i++; } echo json_encode($response); The JSON I get: {"page":1,"total":1,"records":2, "rows":[{"cedula":"v-108984103","nombre":"Soneia","apellido":"Rond\u00f3n Contreras","direccion":"El Rosal, calle 2-44","telefono":"04544247008457","email":"[email protected]","descripcion_profesion":"Docente"}, {"cedula":"v-135254741","nombre":"Judith","apellido":"Rangel M\u00e1rquez","direccion":"Sabaneta","telefono":"04247644152499","email":"","descripcion_profesion":"Docente"}]} It loads the query from PHP but the search option doesn't work neither the sorting function on "cedula"'s column. What I need to do?. Thanks in advance.

    Read the article

  • Python: inserting double or single quotes around a string

    - by Jessy
    Im using python to access a MySQL database and im getting a unknown column in field due to quotes not being around the variable. code below: cur = x.cnx.cursor() cur.execute('insert into tempPDBcode (PDBcode) values (%s);' % (s)) rows = cur.fetchall() How do i manually insert double or single quotes around the value of s? I've trying using str() and manually concatenating quotes around s but it still doesn't work. The sql statement works fine iv double and triple check my sql query.

    Read the article

  • Sector bancario, un reto de transformación tecnológica

    - by Fabian Gradolph
    El sector financiero se encuentra en un momento clave. No sólo por la coyuntura económica actual, sino también por cuestiones estructurales y normativas que obligan a las entidades bancarias -normalmente a la cabeza de la innovación tecnológica, por cierto- a seguir dando pasos hacia el futuro, manteniendo la tecnología en el corazón de su estrategia de negocio. Así se ha puesto de manifiesto en el encuentro que se ha celebrado hoy en Madrid: Oracle in Banking, donde expertos de Oracle, clientes de la compañía y analistas han puesto sobre la mesa algunos de los desafíos a los que se enfrenta el sector e ideas para aprovechar al máximo la tecnología en la resolución de estos desafíos. El evento ha sido todo un éxito, con asistencia masiva de clientes y partners. En la imagen que ilustra este artículo pueden verse, por este orden: una panorámica de la sala, Modesto Villajos, Regional Sales Manager de Oracle, quien ejerció de maestro de ceremonias. Leopoldo Boado, Country Manager de Oracle España, quien realizó la introducción, Alex Kwiatkowski, de IDC, quien expuso los prinicipales desafíos a los que se enfrenta la banca, y Máximo Díez, Senior Director Financial Services de Oracle, que planteó las diferentes estrategias de transformación que pueden emprender los bancos. El evento se completó con intervenciones de clientes de Oracle (Banco Espírito Santo -BES- de Portugal; y BBVA, de España), y presentaciones y demostraciones técnicas.  De particular interés fue la intervención de Alex Kwiatkowski. De acuerdo con su punto de vista hay cuatro áreas esenciales a las que se enfrenta el sector. La primera de ellas es el marco regulatorio. El sector financiero está sometido a una constante presión normativa (probablemente acrecentada en estos tiempos de incertidumbre), no sólo a nivel nacional, sino también a nivel europeo y global. El cumplimiento exquisito de todas estas normas es esencial para el buen funcionamiento del sistema. La segunda área crítica es la necesidad de ofrecer una experiencia de usuario multicanal satisfactoria, de forma que se potencie la retención de clientes. A veces es difícil darnos cuenta, pero hoy en día nuestras interacciones con el banco han alcanzado una gran diversidad de canales (sucursal, ATM, Internet, banca telefónica, banca móvil...). Esto supone un permanente desafío tecnológico y de procesos para las entidades financieras. El tercer elemento crítico es el del incremento de la eficiencia de las operaciones, manteniendo los costes bajo control o incluso reduciéndolos aún más. Por último, las entidades bancarias tienen ante sí el reto de encontrar nuevas fuentes de ingresos, de forma que el foco deje de estar únicamente en la reducción de costes y la minimización de riesgos. Lo cierto es que en la actualidad, la atención principal se centra en estos dos puntos, pero como mencionó Alex Kwiatkowski "los CIO`s de los bancos se van a plantar en la mesa del CEO con la necesidad de realizar renovaciones completas de los sistemas de core banking y la necesidad de invertir en el desarrollo de nuevos canales". Máximo Díez también enfatizó esta necesidad en su presentación. Los bancos tienen la obligación de econtrar nuevas fórmulas para impulsar el crecimiento, pero la implementación de estrategias en este sentido presenta fuertes desafíos a causa de las limitaciones de los sistemas IT existentes. No hay duda de que se presenta un futuro muy interesante en el ámbito tecnológico para el sector financiero. Lo que Oracle puede hacer y ofrece a las entidades financieras puede encontrarse en este enlace: Financial Services.

    Read the article

  • C++ question: boost::bind receive other boost::bind

    - by user355034
    I want to make this code work properly, what should I do? giving this error on the last line. what am I doing wrong? i know boost::bind need a type but i'm not getting. help class A { public: template <class Handle> void bindA(Handle h) { h(1, 2); } }; class B { public: void bindB(int number, int number2) { std::cout << "1 " << number << "2 " << number2 << std::endl; } }; template struct Wrap_ { Wrap_(Han h) : h_(h) {} template<typename Arg1, typename Arg2> void operator()(Arg1 arg1, Arg2 arg2) { h_(arg1, arg2); } Han h_; }; template inline Wrap_<Handler> make(Handler h) { return Wrap_<Handler> (h); } int main() { A a; B b; ((boost::bind)(&B::bindB, b, _1, _2))(1, 2); ((boost::bind)(&A::bindA, a, make(boost::bind(&B::bindB, b, _1, _2))))(); /i want compiled success and execute success this code/ }

    Read the article

  • Useful SVN and Git commands – Cheatsheet

    - by Madhan ayyasamy
    The following snippets will helpful one who user version control systems like Git and SVN.svn checkout/co checkout-url – used to pull an SVN tree from the server.svn update/up – Used to update the local copy with the changes made in the repository.svn commit/ci – m “message” filename – Used to commit the changes in a file to repository with a message.svn diff filename – shows up the differences between your current file and what’s there now in the repository.svn revert filename – To overwrite local file with the one in the repository.svn add filename – For adding a file into repository, you should commit your changes then only it will reflect in repository.svn delete filename – For deleting a file from repository, you should commit your changes then only it will reflect in repository.svn move source destination – moves a file from one directory to another or renames a file. It will effect your local copy immediately as well as on the repository after committing.git config – Sets configuration values for your user name, email, file formats and more.git init – Initializes a git repository – creates the initial ‘.git’ directory in a new or in an existing project.git clone – Makes a Git repository copy from a remote source. Also adds the original location as a remote so you can fetch from it again and push to it if you have permissions.git add – Adds files changes in your working directory to your index.git rm – Removes files from your index and your working directory so they will not be tracked.git commit – Takes all of the changes written in the index, creates a new commit object pointing to it and sets the branch to point to that new commit.git status – Shows you the status of files in the index versus the working directory.git branch – Lists existing branches, including remote branches if ‘-a’ is provided. Creates a new branch if a branch name is provided.git checkout – Checks out a different branch – switches branches by updating the index, working tree, and HEAD to reflect the chosen branch.git merge – Merges one or more branches into your current branch and automatically creates a new commit if there are no conflicts.git reset – Resets your index and working directory to the state of your last commit.git tag – Tags a specific commit with a simple, human readable handle that never moves.git pull – Fetches the files from the remote repository and merges it with your local one.git push – Pushes all the modified local objects to the remote repository and advances its branches.git remote – Shows all the remote versions of your repository.git log – Shows a listing of commits on a branch including the corresponding details.git show – Shows information about a git object.git diff – Generates patch files or statistics of differences between paths or files in your git repository, or your index or your working directory.gitk – Graphical Tcl/Tk based interface to a local Git repository.

    Read the article

  • Ruby on Rails free books

    - by Madhan ayyasamy
    The following links has ruby on rails tutorials, you can download directly from there website, its fully free of cost..:)Beginning Ruby: From Novice to Professional Building Dynamic Web 2.0 Websites with Ruby on RailsRuby on Rails For DummiesAgile Web Development with RailsThe Ruby Way: Solutions and Techniques in Ruby ProgrammingBeginning Ruby on RailsRails RecipesRails CookbookAjax on RailsThe Art of Rails Programmer to Programmer

    Read the article

  • Hiding the Flash Message After a Time Delay

    - by Madhan ayyasamy
    Hi Friends,The flash hash is a great way to provide feedback to your users.Here is a quick tip for hiding the flash message after a period of time if you don’t want to leave it lingering around.First, add this line to the head of your layout to ensure the prototype and script.aculo.us javascript libraries are loaded:Next, add the following to either your layout (recommended), your view templates or a partial depending on your needs. I usually add this to a partial and include the partial in my layouts. "flash", :id = flash_type % "text/javascript" do % setTimeout("new Effect.Fade('');", 10000); This will wrap the flash message in a div with class=‘flash’ and id=‘error’, ‘notice’ or ‘warn’ depending on the flash key specified.The value ‘10000’ is the time in milliseconds before the flash will disappear. In this case, 10 seconds.This function looks pretty good and little javascript stunts like this can help make your site feel more professional. It’s also worth bearing in mind though, not everybody can see well or read as quickly as others so this may not be suitable for every application.Update:As Mitchell has pointed out (see comments below), it may be better to set the flash_type as the div class rather than it’s id. If there is the possibility that you’ll be showing more than one flash message per page, setting the flash_type as the div id will result in your HTML/XHTML code becoming invalid because the unique intentifier will be used more than once per page.Here is a slightly more complex version of the method shown above that will hide all divs with class ‘flash’ after a time delay, achieving the same effect and also ensuring your code stays valid with more than one flash message! "flash #{flash_type}" % "text/javascript" do % setTimeout("$$('div.flash').each(function(flash){ flash.hide();})", 10000); In this example, the div id is not set at all. Instead, each flash div will have class “div” and also class of the type of flash message (“error”, “warning” etc.).Have a Great Day..:)

    Read the article

  • Date Time Format in RUBY

    - by Madhan ayyasamy
    The following snippets is very useful when we render views dates in various format in ruby on rails."Format meaning:  %a - The abbreviated weekday name (``Sun'')  %A - The  full  weekday  name (``Sunday'')  %b - The abbreviated month name (``Jan'')  %B - The  full  month  name (``January'')  %c - The preferred local date and time representation  %d - Day of the month (01..31)  %H - Hour of the day, 24-hour clock (00..23)  %I - Hour of the day, 12-hour clock (01..12)  %j - Day of the year (001..366)  %m - Month of the year (01..12)  %M - Minute of the hour (00..59)  %p - Meridian indicator (``AM''  or  ``PM'')  %S - Second of the minute (00..60)  %U - Week  number  of the current year,          starting with the first Sunday as the first          day of the first week (00..53)  %W - Week  number  of the current year,          starting with the first Monday as the first          day of the first week (00..53)  %w - Day of the week (Sunday is 0, 0..6)  %x - Preferred representation for the date alone, no time  %X - Preferred representation for the time alone, no date  %y - Year without a century (00..99)  %Y - Year with century  %Z - Time zone name  %% - Literal ``%'' character   t = Time.now   t.strftime("Printed on %m/%d/%Y")   #=> "Printed on 04/09/2003"   t.strftime("at %I:%M%p")            #=> "at 08:56AM""Have a great day!

    Read the article

  • Rails Easy Data Dumping

    - by Madhan ayyasamy
    Hi Friends,The following useful snippets,you can find out the easiest way of ruby on rails environment data dumping. You’ll often need to get data from production to dev or dev to your local or your local to another developer’s local. One plug-in we use over and over is Yaml_db. This nifty little plug-in enables you to dump or load data by issuing a Rake command. The data is persisted in a yaml file located in db/data.yml. This is very portable and easy to read if you need to examine the data.01rake db:data:dump02 03example data found in db/data.yml04 05---06campaigns:07  columns:08  - id09  - client_id10  - name11  - created_at12  - updated_at13  - token14  records:15  - - "1"16    - "1"17    - First push18    - 2008-11-03 18:23:5319    - 2008-11-03 18:23:5320    - 3f2523f6a66521  - - "2"22    - "2"23    - First push24    - 2008-11-03 18:26:5725    - 2008-11-03 18:26:5726    - 9ee8bc427d94

    Read the article

  • Difference between IN and FIND_IN_SET

    - by Madhan ayyasamy
    Hi Friends,You may be confused with IN() and FIND_IN_SET() MYSQL functions. There are specific case/situation for both functions where to use which Mysql function. Look at below explanation about IN() and FIND_IN_SET()IN() : This function is used when you have a list of possible values and a single value in your database.Example: WHERE memberid IN (1,2,3)FIND_IN_SET() : This function is used where you have comma separated list of values stored in database and want to see if a certain value exists in that comma seperated list.Example: WHERE FIND_IN_SET( ‘table column name like id’, 'dynamic idlist' )

    Read the article

  • How to Inspect Javascript Object

    - by Madhan ayyasamy
    You can inspect any JavaScript objects and list them as indented, ordered by levels.It shows you type and property name. If an object property can't be accessed, an error message will be shown.Here the snippets for inspect javascript object.function inspect(obj, maxLevels, level){  var str = '', type, msg;    // Start Input Validations    // Don't touch, we start iterating at level zero    if(level == null)  level = 0;    // At least you want to show the first level    if(maxLevels == null) maxLevels = 1;    if(maxLevels < 1)             return '<font color="red">Error: Levels number must be > 0</font>';    // We start with a non null object    if(obj == null)    return '<font color="red">Error: Object <b>NULL</b></font>';    // End Input Validations    // Each Iteration must be indented    str += '<ul>';    // Start iterations for all objects in obj    for(property in obj)    {      try      {          // Show "property" and "type property"          type =  typeof(obj[property]);          str += '<li>(' + type + ') ' + property +                  ( (obj[property]==null)?(': <b>null</b>'):('')) + '</li>';          // We keep iterating if this property is an Object, non null          // and we are inside the required number of levels          if((type == 'object') && (obj[property] != null) && (level+1 < maxLevels))          str += inspect(obj[property], maxLevels, level+1);      }      catch(err)      {        // Is there some properties in obj we can't access? Print it red.        if(typeof(err) == 'string') msg = err;        else if(err.message)        msg = err.message;        else if(err.description)    msg = err.description;        else                        msg = 'Unknown';        str += '<li><font color="red">(Error) ' + property + ': ' + msg +'</font></li>';      }    }      // Close indent      str += '</ul>';    return str;}Method Call:function inspect(obj [, maxLevels [, level]]) Input Vars * obj: Object to inspect * maxLevels: Optional. Number of levels you will inspect inside the object. Default MaxLevels=1 * level: RESERVED for internal use of the functionReturn ValueHTML formatted string containing all values of inspected object obj.

    Read the article

  • Custom field names in Rails error messages

    - by Madhan ayyasamy
    The defaults in Rails with ActiveRecord is beautiful when you are just getting started and are created everything for the first time. But once you get into it and your database schema becomes a little more solidified, the things that would have been easy to do by relying on the conventions of Rails require a little bit more work.In my case, I had a form where there was a database column named “num_guests”, representing the number of guests. When the field fails to pass validation, the error messages is something likeNum guests is not a numberNot quite the text that we want. It would be better if it saidNumber of guests is not a numberAfter doing a little bit of digging, I found the human_attribute_name method. You can override this method in your model class to provide alternative names for fields. To change our error message, I did the followingclass Reservation ... validates_presence_of :num_guests ... HUMAN_ATTRIBUTES = { :num_guests = "Number of guests" } def self.human_attribute_name(attr) HUMAN_ATTRIBUTES[attr.to_sym] || super endendSince Rails 2.2, this method is used to support internationalization (i18n). Looking at it, it reminds me of Java’s Resource Bundles and Spring MVC’s error messages. Messages are defined based off a key and there’s a chain of look ups that get applied to resolve an error’s message.Although, I don’t see myself doing any i18n work in the near-term, it is cool that we have that option now in Rails.

    Read the article

  • Useful links

    - by Madhan ayyasamy
    Difference between STI vs Polymorphic associationsSTI vs PolymorphicDifference between habtm vs has_many :throughhabtm vs throughCapistrano Guide linkCapistrano guideRails application without database stuffclass Car < ActiveRecord::Baseself.abstract = trueendAnother link: rails without databaseNamed scope useful linkNamed scopeDifference between http and https verbhttp vs httpsRails 2.3 useful guide websiterails 2.3 guide

    Read the article

  • El éxito del Customer Experience

    - by Noelia Gomez
    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 Desde hace más de un año Oracle está apostando por soluciones que supongan un cambio en la gestión de la relación con el cliente, mejorando su experiencia para fidelizarle mientras las empresas ahorran en costes. Por otro lado, son muchas las empresas las que se han dado cuenta de esta necesidad y de que las redes sociales permiten una conexión con el cliente que antes no se había logrado, pudiendo detectar necesidades antes desconocidas. Por todo ello, el pasado 29 de Octubre Contact Center, en colaboración con Oracle, quiso invitar la los especialistas de Customer Experience de las mayores empresas de España en una jornada ejecutiva para descubrir las novedades en este área e intercambiar opiniones con otros expertos. Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Calibri","sans-serif";} Fernando Rumbero, Iberia Applications Cluster Leader de Oracle, abrió las ponencias hablando de la “Tercera Revolución”, una presentación que nos abrió la perspectiva de la realidad en la que vivimos, clientes, usuarios y empresas. Por su parte, Victor Lopez, Sales Consulting Director de Oracle, nos condujo en Un recorrido por el mundo del cliente para lograr ofrecer una experiencia que este espera. Después, conocimos casos prácticos de la mano de Albert Valls, especialista en CX, que nos mostró los resultados de algunos de nuestros clientes y como han logrado alcanzar sus objetivos. Tras un breve descanso que dio lugar al networking, escuchamos a la ponencia más esperada de la jornada: ¿Por qué Linkedin tienen 249 millones de usuarios? Francesc Arbiol, Head of Iberia, Linkedin, fue el responsable de responder a esta pregunta, dándonos las claves para ofrecer un servicio de alta calidad y rentable con Oracle RightNow. En el momento para preguntas y respuestas, moderado por Guillermo San Roman, Applications Sales Director de Oracle, los asistentes estuvieron muy activos y fueron muchas las interacciones con los ponentes y entre los propios asistentes. En este espacio se pusieron de manifiesto las preguntas más latentes de este escenario: ¿Estamos preparados para dar respuesta y comprender al cliente de hoy? ¿Cómo dirigir y priorizar las actividades para alcanzar el mejor resultado?Infraestructuras y claves para aprender a liderar la experiencia de cliente. ¿Cómo integrar a todas las áreas de la empresa en el proceso de Customer Experience? Proactividad y multicanalidad: dos principios básicos en el Customer Experience La jornada se cerró con un coctel en el que el prevaleció el intercambio de opiniones y encuentros entre profesionales. Sin duda un evento de los que te hacen irte a casa con miles de ideas en la cabeza. ¿Estuviste en el encuentro? Cuéntanos, ¿qué te pareció? ¿No pudiste asistir? Ponte en contacto con nosotros y nos acercaremos a tu oficina.   /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

    Read the article

< Previous Page | 1 2 3  | Next Page >