Search Results

Search found 3056 results on 123 pages for 'ben daniel'.

Page 11/123 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Configurable ruby logger setup: Logger.new().level = variable

    - by Daniel
    Hi, I want to change the logging level of an application (ruby). require 'logger' config = { :level => 'Logger::WARN' } log = Logger.new STDOUT log.level = Kernel.const_get config[:level] Well, the irb wasn't happy with that and threw "NameError: wrong constant name Logger::WARN" in my face. Ugh! I was insulted. I could do this in a case/when to solve this, or do log.level = 1, but there must be a more elegant way! Does anyone have any ideas? -daniel

    Read the article

  • Master / Detail datagridview with relation from type string in C#

    - by Daniel
    Hello, I want to show a master / detail relationship using two datagridviews and DataRelation in C#. The relation between the master and the detail table is an ID from type string (and there is no chance to change the ID to type integer). It seems like the DataGridView is not able to update the detail view when changing the row in the master table. Does anybody know if it is possible to achieve a master / detail view using a string ID and if yes, how? Or do I have to use an external DataGrid from another company? Thanks for any help Daniel

    Read the article

  • Why did this work? ( php dot notation )

    - by Daniel
    Hi, I was writing some php code after a long sint doing ruby and I accidently wrote this: [root@ip-10-160-47-98 test]# cat run.php <?php class MyTest { public function run() { var_dump(this.test); } } $object = new MyTest(); $object->run(); [root@ip-10-160-47-98 test]# php run.php string(8) "thistest" [root@ip-10-160-47-98 test]# Now, this.test should have been $this-test, but the compiler was actually happy to let this run. Does anyone know how (this.test) got converted into a string "thistest"? Compiled and run on php 5.3.2 amazon instance ami-e32273a6 (CentOS 5.4) -daniel

    Read the article

  • Surgical slave reads for Ruby on Rails, mulitple databases.

    - by Daniel
    Greetings, I'm currently working on a multiple database rails application. I want to off load the SELECT queries on to the slave databases for only SOME of the databases or specific models. The issue is that in places, we swap out the current database connection and put in a different one for a short time; to load fixtures or to handle sharding. Does anyone have any recommendations on a ruby gem that 1. will split select/(sql writes) with a considerable amount of control. We want to handle just some models and we are looking for a neat surgical fix. 2. does not monkey around with activerecord. 3. is still being maintained. TIA -daniel

    Read the article

  • Can I get a dump of all my databases *except one* using mysqldump?

    - by Daniel Magliola
    I'm currently using mySQLdump to backup my dev machine and servers. There is one project I just started, however, that has a HUUUUUGE database that I don't really need backed up, and i'll be a big problem to add it to the rest of the backup cycle. I'm currently doing this: "c:\Program Files\mysql\MySQL Server 5.1\bin\mysqldump" -u root -pxxxxxx --all-databases g:\backups\MySQL\mysqlbackup.sql Is it possible to somehow specify "except this database(s)"? I wouldn't like to have to specify the list of DBs manually, since that would mean that I'd have to remember updating my backup batch file every time I create a new DB, and I know that's not gonna happen. EDIT: As you probably guessed from my command line above, i'm doing this on Windows, so I can't do any kind of fancy bash stuff, only wimpy .bat things. Alternatively, if you have other ideas to solve this same issue, they are more than welcome, of course! Thanks Daniel

    Read the article

  • How can I split a PHP form into two sections, before submission to a database?

    - by Daniel Smith
    Hi guys, I have set up a PHP form for a competition, for users to enter and all information to be stored in a database. I used the following NetTut+ tutorial to do so: http://tr.im/SwAd. I've got the form submitting to the database as required, but with so many additional questions being asked, I would like to split the form into two separate sections. Obviously the first page would say continue to the next step before the second step allowing for the form to be submitted to the database. The content that the user sees should be split, but should all be a part of the same form. Step 1 Step 2 before submission. Would anyone know of or recommend any methods to do this? I'm a beginner so please be nice. :) Cheers, Daniel

    Read the article

  • From interpeted to native code: "dynamic" languages compiler support

    - by Daniel
    First, I am aware that dynamic languages is a term used mainly by a vendor; I am using it just to have a container word to include languages like Perl (a favorite of mine), Python, Tcl, Ruby, PHP and so on. They are interpreted but I am interested here to refer to languages featuring strong capability to support the programmer efficiency and the support for typical constructs of modern interpreted languages My question is: there are dynamic languages can be compiled efficiently in native executable code - typically for Windows platforms? Which ones? Maybe using some third part ad-hoc tools? I am not talking about huge executables carrying with them a full interpreter or some similar tricks nor some smart module able to include its own dependances or some required modules, but a honest, straight, standard, solid executable code. If not, there is some technical reason inhibiting the availability of such a best-of-both-world feature? Thanks! Daniel

    Read the article

  • Vim html.erb snippets?? snipMate Need a vim tip!

    - by Daniel Upton
    Hi, I've started using Vim for my rails development (who hasn't!).. And i'm loving it except that when im in a html.erb file (HTML and Ruby).. I get no snipMate snippets, I would like both html and ruby... or just html would be fine, How would i do this? Would i need to write a set of snippets? if so is there a way of pulling in existing snippets without copying them? Is there a way of telling vim to go into html mode when it sees .html erb? Thanks Daniel

    Read the article

  • Shall i learn Assembly Language or C, to Understand how "real programming" works?

    - by Daniel Upton
    Hello, World.. I'm a web developer mostly working in Ruby and C#.. I wanna learn a low level language so i dont look like an ass infront of my (computer science expert) boss. Ive heard a lot of purist buzz about how assembly language is the only way to learn how computers actually work, but on the other hand C would probably be more useful as a language rather than just for theory. So my question is.. Would Learning C teach me enough computer science theory / low level programming to not look like a common dandy (complete tool)? Thanks! Daniel

    Read the article

  • memory of drawables, is it better to have resources inside APK, outside APK or is it the same for me

    - by Daniel Benedykt
    Hi I have an application that draws a lot of graphics and change them. Since I have many graphics, I thought of having the images outside the APK, downloaded from the internet as needed, and saved on the files application folder. But I started to get outOfMemory exceptions. The question is: Does android handle memory different if I load a graphic from APK than if I load it from 'disk'? code using APK: topView.setBackgroundResource(R.drawable.bg); code if image is outside APK: Drawable d = Drawable.createFromPath(pathName); topView.setBackgroundDrawable(d); Thanks Daniel

    Read the article

  • css cache google chrome

    - by Daniel Garcia
    I'm having problems with cache, I think. I have a website in Joomla, and I have some .css (layout.css, position.css, .... ) and I have at home of the website, 3 buttons, I tested in localhost, and when I see the home well, I upload everything to production, to my server. Now, I just edited some styles of these buttons, for example, the width, in order to see them better...but I'm having a problem with the cache, because sometimes I see them with new changes, but other times I see with the old styles.....I realized that this happens especially with chrome Could you help me, please? Best regards, Daniel

    Read the article

  • How do I temporarily monkey with a global module constant?

    - by Daniel
    Greetings, I want to tinker with the global memcache object, and I found the following problems. Cache is a constant Cache is a module I only want to modify the behavior of Cache globally for a small section of code for a possible major performance gain. Since Cache is a module, I can't re-assign it, or encapsulate it. I Would Like To Do This: Deep in a controller method... code code code... old_cache = Cache Cache = MyCache.new code code code... Cache = old_cache code code code... However, since Cache is a constant I'm forbidden to change it. Threading is not an issue at the moment. :) Would it be "good manners" for me to just alias_method the special code I need just for a small section of code and then later unalias it again? That doesn't pass the smell test IMHO. Does anyone have any ideas? TIA, -daniel

    Read the article

  • What could be adding "Pragma:no-cache" to my response Headers? (Apache, PHP)

    - by Daniel Magliola
    I have a website whose maintenance I've inherited, which is a big hairy mess. One of the things i'm doing is improving performance. Among other things, I'm adding Expires headers to images. Now, there are some images that are served through a PHP file, and I notice that they do have the Expires header, but they also get loaded every time. Looking at Response Headers, I see this: Expires Wed, 15 Jun 2011 18:11:55 GMT Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma no-cache Which obviously explains the problem. Now, i've looked all over the code base, and it doesn't say "pragma" anywhere. .htaccess doesn't seem to have anything related either. Any ideas who could be setting those "pragma" (and "cache-control") headers, and how I can avoid it? Thanks! Daniel

    Read the article

  • How can you know what is w3wp.exe doing? (or how to diagnose a performance problem)

    - by Daniel Magliola
    I'm having a performance problem in a site we've made, and I'm not exactly sure how to start diagnosing it. The short description is: We have a very small site (http://hearablog.com) with very little traffic, in a crappy dedicated server, CPU is always very high, sometimes it stays at 100% for minutes, and w3wp.exe is taking most of it. A typical scenario is w3wp.exe takes 60%, and SQL Server takes about 30%. Our DB is pretty small too. Long description and more details: The site is hosted in a very crappy server by Cari.Net. From the beginning we had the feeling that the server didn't quite behave correctly, like some things would take just too long, so this could be a configuration problem from the get go. It may also be that we are getting a virtual server while we're supposed to have a dedicated one, although we have no evidence that'd indicate this, except for the fact that the server tends to be quite slow. The server is Windows 2008 Standard 64-bit, with SQL 2008 Express Hardware is a Celeron 2.80 GHz, 1Gb RAM The website is developed in ASP.Net MVC, using Entity Framework for data access. Now, this is pretty crappy hardware, but i've had other servers with these guys, with equivalent (or worse) HW, and performance is much better than this one. That said, the other servers have W2003 and SQL2005, and I'm using ASP.Net "WebForms" 2.0, no MVC, no LINQ, no EF; so I'm not sure whether going to 2008 / the other stuff means a big performance penalty is expected. I'm serving MP3 files (5-20 Mb) regularly, which is a slightly unusual load, maybe that is causing some kind of problems? Would that cause w3wp to use a lot of CPU? Disk usage seems very low. Memory is usually around 90%, but disk usage seems to indicate it's not paging much. I get tons of e-mails every day about SQL timeouts, for queries taking over 30 seconds, although all our queries are pretty straightforward (or should be, but EF may be screwing it up). This is what resource monitor looks like in one of these "sprints" of 100% CPU, in case there's anything useful there. And a snapshot of some performance counters: Now, what confuses me very much is that CPU usage of w3wp is just so high. It shouldn't be doing much really... So my questions are... Is there any way of finding out "what" it is doing? Maybe even profile it? Any performance counters I should be looking at? Is this to be expected given this hardware/software configuration? Is this could be cause by some kind of configuration failure, where would you start looking? Thank you VERY much. Daniel Magliola

    Read the article

  • Quels mythes sur le métier de développeur se révèlent être vrais ? Un enseignant passe en revue quelques « non-mythes »

    Quels mythes sur le métier de développeur se révèlent être vrais ? Un enseignant passe en revue quelques « non-mythes » Dans une démarche peu habituelle, Mordechai Ben-Arin, professeur au département d'enseignement des sciences à l'institut Weizmann en Israël, s'est attaqué à ce qu'il qualifie de « non-mythes » sur le métier de développeur. Ce sont, d'après lui, les mythes que les enseignants réfutent généralement pour encourager les étudiants à suivre des études de génie logiciel... alors qu'ils ne sont pas forcément faux. Dans un document de 7 pages, Mordechai Ben-Arin (alias Moti) s'attache ainsi à démontrer la véracité de plusieurs lieu commun. Co...

    Read the article

  • Generalize, or Fix The Problem?

    - by Droogans
    Which of these two programmers is "better", from a managerial standpoint? The first programmer is Albert. You tell Al to make a system that will pass you the salt at the dinner table. He does it in less than a day. It works fine. The second programmer is Ben. Ben is told to make a program to pass the salt, and after two days, he's still working on it. It will save time in the long run...if you need pepper, ketchup, etc. There isn't any clear indication that there will be a need for this, but it's not improbable. Who's the better programmer to have working under you, as a manager?

    Read the article

  • Google I/O 2010 - ?Run corp apps on App Engine? Yes we do.

    Google I/O 2010 - ​Run corp apps on App Engine? Yes we do. Google I/O 2010 - ​Run corporate applications on Google App Engine? Yes we do. App Engine, Enterprise 201 Ben Fried, Irwin Boutboul, Justin McWilliams, Matthew Simmons Hear Google CIO Ben Fried and his team of engineers describe how Google builds on App Engine. If you're interested in building corp apps that run on Google's cloud, this team has been doing exactly that. Learn how these teams have been able to respond more quickly to business needs while reducing operational burden. For all I/O 2010 sessions, please go to code.google.com/events/io/2010/sessions.html From: GoogleDevelopers Views: 14 0 ratings Time: 55:53 More in Science & Technology

    Read the article

  • Where to use Controller.HttpContext

    - by Ben
    Hi, In my base controller's constructor I am calling an extension method that checks for specific cookies on the client. Currently I am using System.Web.HttpContext.Current to get the current context. However, I am lead to believe that I should be using Controller.HttpContext since it is more testable and contains additional information about the request. However, Controller.HttpContext returns null on creation (believe this is by design) but also on Initialize and Execute methods (unless I use Routing.RequestContext.HttpContext?). So if I should be using Controller.HttpContext instead of HttpContext.Current, at what point is it available to me in a request? Thanks Ben

    Read the article

  • ISAPI Rewrite rule help ( .html -> .aspx )

    - by ben
    Hello, Recently I'm working on a refactor project from asp to asp.net 3.5. There are lots of .html file uses .inc file for the header and footer in the old site, and needed to be converted to .aspx uses master page. My problem is, for search engine and for bookmark those old pages are all gone Therefore I need to redirect the old .html pages to .aspx. I've been trying to find a way to fix that, finally i found ISAPI_Rewrite might be the tool that i can use. After a few hours reading the document on the site, i still have no clue how to write the syntax at all :( Could anyone give a some examples please? ex. rewrite all urls under www.example.com/en to www.example.com/ rewrite all .html to .aspx The server is using Windows 2000, IIS6, ISAPI_Rewrite 3 Lite Thanks in advance ben :)

    Read the article

  • Can I ReRender a JSF Component from backing bean code?

    - by Ben
    Hi, Can I rerender a jsf ui component when a valuechangelistener method is run? The reason i'm asking is that my valuechangelistener method changes the values of the input boxes but when I run it, they don't seem to be rerender. The following doesn't work: <h:inputText id="inputbox_id"/> <h:selectOneMenu valueChangeListener="#{myBean.changeCountryMenu}"> <a4j:support event="onchange" rerender="inputbox_id" action="#{bean.test}> </h:selectOneMenu> Notice that bean.test() is never run. So the solution I thought of is to rerender the inputbox from the valueChangeListener. If there is some other better solution i'd be glad to hear... Thank you! Ben.

    Read the article

  • NVelocity ASP.NET Examples

    - by Ben
    I'm looking to use NVelocity in my ASP.NET MVC application, not as a view engine, just for rendering some email templates. However, I cannot for the life of me get it to work. I have downloaded it from the castle project and followed the example at http://www.castleproject.org/others/nvelocity/usingit.html#step1 No matter what I try I don't seem to be able to load a template located in my site. The example suggests using the absolute path, which I have tried to no avail: Template t = engine.GetTemplate("/Templates/TestEmail.vm"); So please can someone give me two examples. One of loading a template located in the web site directory and secondly one parsing a string variable (as it is likely that my templates will be stored in a database). Many thanks Ben

    Read the article

  • Building XUL app a-la SongBird

    - by Ben
    Hi, I've started exploring XUL Runner as a potential tool for an upcoming app. I can get some good examples running using the command line xulrunner-bin myapp. How can compile it all in a native looking application, like SongBird does. I understand SongBird packages the entire xul runtime with it, and I'm happy with that. I'm just wondering is there are any tool I can use to compile my xul project as a standalone app? Any Mac and/or PC hint much appreciated! EDIT: I guess what I'm looking for is a way to generate a Mac and/or PC XUL stub application (but not an installer). Is there something like that? cheers Ben

    Read the article

  • Remote debugging in Windows Embedded

    - by Ben Schoepke
    Hi, I'm moving from Windows CE 6 to Windows Embedded Standard 7 for a project and am wondering how remote debugging of .Net apps works with Windows Embedded target devices. In CE with VS2008 and ActiveSync (USB), I can hit F5 and my app is automatically deployed to the target device and executed so I can step through my breakpoints just like I would if I were debugging locally. Is there an equivalent remote debugging solution for Windows Embedded debugging? A quick glance through the Visual Studio "Remote Debugger" documentation makes the whole thing seem a lot clunkier/less integrated. Is there an easy way to debug applications on target devices running Windows Embedded like I would with CE? Thanks, Ben

    Read the article

  • Compare Products Sidebar Item Doesn't Show Products

    - by Ben Gribaudo
    Hello, When I click "Add to Compare" on a product, a message stating that "such-and-such product successfully added to compare list" appears, however the compare products sidebar shows "You have no items to compare." If I do a print_r($this->helper('catalog/product_compare')->getItemCount()) in template/catalog/product/compare/sidebar.phtml, "0" is returned. Why won't the sidebar show the products to compare? Info: Magento version 1.4.0.1 Sessions appear to work for I can add products to the cart and they will stay in the cart as I navigate around the site. Thank you, Ben

    Read the article

  • Can you help me get my head around openssl public key encryption with rsa.h in c++?

    - by Ben
    Hi there, I am trying to get my head around public key encryption using the openssl implementation of rsa in C++. Can you help? So far these are my thoughts (please do correct if necessary) Alice is connected to Bob over a network Alice and Bob want secure communications Alice generates a public / private key pair and sends public key to Bob Bob receives public key and encrypts a randomly generated symmetric cypher key (e.g. blowfish) with the public key and sends the result to Alice Alice decrypts the ciphertext with the originally generated private key and obtains the symmetric blowfish key Alice and Bob now both have knowledge of symmetric blowfish key and can establish a secure communication channel Now, I have looked at the openssl/rsa.h rsa implementation (since I already have practical experience with openssl/blowfish.h), and I see these two functions: int RSA_public_encrypt(int flen, unsigned char *from, unsigned char *to, RSA *rsa, int padding); int RSA_private_decrypt(int flen, unsigned char *from, unsigned char *to, RSA *rsa, int padding); If Alice is to generate *rsa, how does this yield the rsa key pair? Is there something like rsa_public and rsa_private which are derived from rsa? Does *rsa contain both public and private key and the above function automatically strips out the necessary key depending on whether it requires the public or private part? Should two unique *rsa pointers be generated so that actually, we have the following: int RSA_public_encrypt(int flen, unsigned char *from, unsigned char *to, RSA *rsa_public, int padding); int RSA_private_decrypt(int flen, unsigned char *from, unsigned char *to, RSA *rsa_private, int padding); Secondly, in what format should the *rsa public key be sent to Bob? Must it be reinterpreted in to a character array and then sent the standard way? I've heard something about certificates -- are they anything to do with it? Sorry for all the questions, Best Wishes, Ben. EDIT: Coe I am currently employing: /* * theEncryptor.cpp * * * Created by ben on 14/01/2010. * Copyright 2010 __MyCompanyName__. All rights reserved. * */ #include "theEncryptor.h" #include <iostream> #include <sys/socket.h> #include <sstream> theEncryptor::theEncryptor() { } void theEncryptor::blowfish(unsigned char *data, int data_len, unsigned char* key, int enc) { // hash the key first! unsigned char obuf[20]; bzero(obuf,20); SHA1((const unsigned char*)key, 64, obuf); BF_KEY bfkey; int keySize = 16;//strlen((char*)key); BF_set_key(&bfkey, keySize, obuf); unsigned char ivec[16]; memset(ivec, 0, 16); unsigned char* out=(unsigned char*) malloc(data_len); bzero(out,data_len); int num = 0; BF_cfb64_encrypt(data, out, data_len, &bfkey, ivec, &num, enc); //for(int i = 0;i<data_len;i++)data[i]=out[i]; memcpy(data, out, data_len); free(out); } void theEncryptor::generateRSAKeyPair(int bits) { rsa = RSA_generate_key(bits, 65537, NULL, NULL); } int theEncryptor::publicEncrypt(unsigned char* data, unsigned char* dataEncrypted,int dataLen) { return RSA_public_encrypt(dataLen, data, dataEncrypted, rsa, RSA_PKCS1_OAEP_PADDING); } int theEncryptor::privateDecrypt(unsigned char* dataEncrypted, unsigned char* dataDecrypted) { return RSA_private_decrypt(RSA_size(rsa), dataEncrypted, dataDecrypted, rsa, RSA_PKCS1_OAEP_PADDING); } void theEncryptor::receivePublicKeyAndSetRSA(int sock, int bits) { int max_hex_size = (bits / 4) + 1; char keybufA[max_hex_size]; bzero(keybufA,max_hex_size); char keybufB[max_hex_size]; bzero(keybufB,max_hex_size); int n = recv(sock,keybufA,max_hex_size,0); n = send(sock,"OK",2,0); n = recv(sock,keybufB,max_hex_size,0); n = send(sock,"OK",2,0); rsa = RSA_new(); BN_hex2bn(&rsa->n, keybufA); BN_hex2bn(&rsa->e, keybufB); } void theEncryptor::transmitPublicKey(int sock, int bits) { const int max_hex_size = (bits / 4) + 1; long size = max_hex_size; char keyBufferA[size]; char keyBufferB[size]; bzero(keyBufferA,size); bzero(keyBufferB,size); sprintf(keyBufferA,"%s\r\n",BN_bn2hex(rsa->n)); sprintf(keyBufferB,"%s\r\n",BN_bn2hex(rsa->e)); int n = send(sock,keyBufferA,size,0); char recBuf[2]; n = recv(sock,recBuf,2,0); n = send(sock,keyBufferB,size,0); n = recv(sock,recBuf,2,0); } void theEncryptor::generateRandomBlowfishKey(unsigned char* key, int bytes) { /* srand( (unsigned)time( NULL ) ); std::ostringstream stm; for(int i = 0;i<bytes;i++){ int randomValue = 65 + rand()% 26; stm << (char)((int)randomValue); } std::string str(stm.str()); const char* strs = str.c_str(); for(int i = 0;bytes;i++)key[i]=strs[i]; */ int n = RAND_bytes(key, bytes); if(n==0)std::cout<<"Warning key was generated with bad entropy. You should not consider communication to be secure"<<std::endl; } theEncryptor::~theEncryptor(){}

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >