Search Results

Search found 1516 results on 61 pages for 'ben hooper'.

Page 5/61 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • 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

  • Using the new jQuery Position utility script at an FF extension

    - by Nimrod Yonatan Ben-Nes
    Hi all, I'm trying to use the following code at my FF extension with no success: $('#duck').position({ of: $('#zebra'), my: "left top", at: "left top" }); (the Position manual is at http://docs.jquery.com/UI/Position) I also tried: var doc = gBrowser.selectedBrowser.contentDocument; $('#duck', doc).position({ of: $('#zebra', doc), my: "left top", at: "left top" }); Both without success.... on the other hand when I try the first code example at the web page code itself it work wonderfully... Anyone got any idea what's causing the problem? Cheers and thx in advance! Nimrod Yonatan Ben-Nes

    Read the article

  • Programmatically Setting Text Shadow Properties

    - by Ben Gribaudo
    Hello, PowerPoint has two kinds of shadows--shape and text. Shape shadows may be set by right-clicking on a shape (including a text box), choosing Format Text, then selecting Shadow or using VBA via the Shadow property on each shape: For Each Slide In ActivePresentation.Slides For Each Shape In Slide.Shapes Shape.Shadow.Size = 100 'etc Next Next How do I set text shadow's properties using VBA? In the UI, these may be accessed by right-clicking on text, choosing Format Text Effect, then selecting Shadow. I've done a bit of digging online and have been unable to find where these properties may be accessed via PowerPoint's VBA API. Thank you, Ben

    Read the article

  • Using MobileMe idisk as a git repository

    - by Ben Guest
    I am trying to use git and MobileMe as a version control system for a personal project I am working across several computers. So far i have done the following. Created and empty bare repository on my local computer $ mkdir myproject.git $ cd myproject.git $ git init --bare $ git update-server-info I then copied the myproject.git directory to the mobile me disk, and sync my computer with mobile me. I then switched to the directory where my project was on my local machine, set the remote origin and try to push the local repository to mobile me $ cd myproject $ git remote add origin https://<username>@idisk.me.com/<username>/myproject.git/ $ git push --all Im am then asked for my password twice. The first time is the mobile me password, any other password gets an error. After entering the second password, and believe me i've tried everything, terminal just hangs. So what am I doing wrong? (Besides trying to use mobileme as a git repository) Thanks, Ben.

    Read the article

  • Creating Tables in Word Programatically

    - by Ben
    I am generating tables and writing them to word on the fly. I do not know how many tables there will be each time i write the data to word and the problem I am having is the second table is written inside the first cell of my first table. If there was a third table it is put inside the first cell of my second table. Is there a way to move the cursor out of the table? I have tried creating a new range with each table also but the same thing happens. I have also tried things like tbl.Range.InsertParagraphAfter() The closest I came was using the Relocate method, but this only worked for two tables. Thanks Ben

    Read the article

  • How do I setup a custom Gem.path using JRuby::Rack?

    - by Ben Hogan
    Hi Nick et al, I've been having some fun looking at to source code of JRuby-Rack and Rubygems to try to figure out how to solve a org.jruby.rack.RackInitializationException: no such file to load -- compass in my rackup script cased by require 'compass'. I'm passing in a custom 'gem.path' as a servlet init parameter and it is being correctly picked up by jruby-rack as far as I can tell by debugging in my rackup script: ENV['GEM_PATH'] => '/foo/lib/.jruby/gems' (expected) but rubygems seems to be broken: Gem.path => file:/foo/lib/jruby-complete-1.4.0.jar!/META-INF/jruby.home/lib/ruby/gems/1.8 I'm not sure why rubygems has not adjusted it's gem_path nor the LOAD_PATH, thus breaking require? Thanks again, I'm still a newbie at ruby, jruby, rack and sinatra. Any pointers in the right direction appreciated! Ben

    Read the article

  • WWSAPI and setting "soapenv:Header" values

    - by Ben Burnett
    I'm trying to connect to a web service from a C++ app using WWS. I got the base connection working just fine. My XML message has two parts though, a header (soapenv:Header) and a body (soapenv:Body). the generated functions only fill in the body. How do I set the Header information? I assumed it has something to do with WsSetHeader() or WsAddCustomHeader() but can't seam to find the right values to use in the parameters. Can someone point me in the right direction here? I've been googling and trying to research this now for several days and am finding many sources for basic help with WWSAPI, but nothing seams to go deeper into how to use it for more advanced applications. any good links or resources to find more advanced help on WWSAPI? Thanks, --Ben Burnett www.burnett.ws

    Read the article

  • What is a good resource for HTML character codes -> glyph and...

    - by Ben
    Hi, I've already found a good site to convert HTML character codes to their respective glyphs: http://www.public.asu.edu/~rjansen/glyph_encoding.html However, I need a bit more information. Does anyone know of a site like the one above that also provides information on what type of character code it is? Meaning, is it a special character? Is the glyph visible? Etc... So far I have found some tables with this information, but they aren't as complete as the resource above. I would really like to get my hands on a complete table. Thanks, -Ben

    Read the article

  • Eclipse: How to build an executable jar with external jar?

    - by Ben
    Hi all, I am trying to build an executable jar program which depends on external jar downloaded. In my project, I included them in the build path and can be run and debug within eclipse. When I tried to export it to a jar, I can run the program but I can't when I try to press a button which includes function calls and classes from the external jar. I have edited the environment variables (Windows XP) CLASSPATH to include paths of all the external jar, but it doesn't work. A point to note is that I got compile warnings while exporting my executable jar, but it doesn't show up any description about the warnings. Would someone kindly provide a thorough guide on how to include an external jar program using eclipse? Best regards, KWAN Chiu Yin, Ben

    Read the article

  • C# Application crashes with Buffer Overrun in deployed (.exe) version, but not in Visual Studio

    - by Ben
    Hi, I have a c# Windows Forms application that runs perfectly from within Visual Studio, but crashes when its deployed and run from the .exe. It crashes with a Buffer Overrun error...and its pretty clear that this error is not being thrown from within my code. Instead, windows must be detecting some sort of buffer overrun and shutting down the application from the outside. I don't think there's one specific line of code that is causing it..it simply happens intermittently. Does anybody have any thoughts on what the possible causes of a Buffer Overrun error might be, and why it would only occur in the deployed application and not when run from with Visual Studio? Thanks in advance, Ben

    Read the article

  • Detecting if the user selected "All Users" or "Just Me" in a Custom Action

    - by Ben
    Hi, I'm trying to detect if the user has selected the "All Users" or the "Just Me" radio during the install of my program. I have a custom action setup that overrides several methods (OnCommit, OnBeforeInstall, etc.). Right now I'm trying to find out this information during OnCommit. I've read that the property I want to get at is the ALLUSERS property, but I haven't had any luck finding where it would be stored in instance/local data. Does anyone know of a way to get at it? -Ben

    Read the article

  • How should jruby-jars and jruby-rack be added to the classpath using warbler?

    - by Ben Hogan
    Hi again, I've been reading through the warbler source code, and I can't figure out how the jruby-jars and jruby-rack jars are meant to end up on the servlet classpath? It seems warbler is copying them into web-inf/gems/gems/<gemname>/lib/<jarname>.jar but they are not on the classpath. I'm guessing that if I put them in my ruby apps lib/ folder they would be copied to web-inf/lib and all would be well, however, it seems odd to have 2 copies of the jar in the war file, is that what I am meant to do? Ben

    Read the article

  • Problem updating a database field from my controller

    - by ben
    I have an update method in my users controller that I call from a HTTPService in Flex 4. The update method is as follows: def updateName @user = User.find_by_email(params[:email]) @user.name = params[:nameNew] render :nothing => true end This is console output: Processing UsersController#updateName (for 127.0.0.1 at 2010-05-24 14:12:49) [POST] Parameters: {"action"="updateName", "nameNew"="ben", "controller"="users", "email"="[email protected]"} User Load (0.6ms) SELECT * FROM "users" WHERE ("users"."email" = '[email protected]') LIMIT 1 Completed in 20ms (View: 1, DB: 1) | 200 OK [http://localhost/users/updateName] But when I check my database, the name field is never updated. What am I doing wrong? Thanks for reading.

    Read the article

  • Authenticating stackoveflow programatically - OpenID

    - by Ben Reeves
    I would like to add up and down voting to my iPhone appilcation - MyStacks, for this I need the to be able to authenticate the user with SO. I'm look at adapting the Twitter-OAuth-iPhone library. However The problem I have is obtaining the consumer and secret key. to use OAuth, do I need to obtain a different key for each provider? In order to obtain a consumer key from google the application needs to have a domain name, but this being an iPhone app of course i don't have one, does this mean that I can't use OAuth? Is there any other way to programatically authenticate SO? Thanks, Ben

    Read the article

  • IDbTransaction Rollback Timeout

    - by Ben
    I am dealing with an interesting situation where I perform many database updates in a single transaction. If these updates fail for any reason, the transaction is rolled-back. IDbTransaction transaction try { transaction = connection.BeginTransaction(); // do lots of updates (where at least one fails) transaction.Commit(); } catch { transaction.Rollback(); // results in a timeout exception } finally { connection.Dispose(); } I believe the above code is generally considered the standard template for performing database updates within a transaction. The issue I am facing is that whilst transaction.Rollback() is being issued to SQL Server, it is also timing out on the client. Is there anyway of distinguishing between a timeout to issue the rollback command and a timeout on that command executing to completion? Thanks in advance, Ben

    Read the article

  • LINQ to SQL Translation

    - by Ben
    Hi, Depending on how I map my linq queries to my domain objects, I get the following error The member 'member' has no supported translation to SQL. This code causes the error: public IQueryable<ShippingMethod> ShippingMethods { get { return from sm in _db.ShippingMethods select new ShippingMethod( sm.ShippingMethodID, sm.Carrier, sm.ServiceName, sm.RatePerUnit, sm.EstimatedDelivery, sm.DaysToDeliver, sm.BaseRate, sm.Enabled ); } } This code works fine: public IQueryable<ShippingMethod> ShippingMethods { get { return from sm in _db.ShippingMethods select new ShippingMethod { Id = sm.ShippingMethodID, Carrier = sm.Carrier, ServiceName = sm.ServiceName, EstimatedDelivery = sm.EstimatedDelivery, DaysToDeliver = sm.DaysToDeliver, RatePerUnit = sm.RatePerUnit, IsEnabled = sm.Enabled, BaseRate = sm.BaseRate }; } } This is my testmethod I am testing with: [TestMethod] public void Test_Shipping_Methods() { IOrderRepository orderRepo = new SqlOrderRepository(); var items = orderRepo.ShippingMethods.Where(x => x.IsEnabled); Assert.IsTrue(items.Count() > 0); } How does the way in which I instantiate my object affect the linq to sql translation? Thanks Ben

    Read the article

  • Wrap link around links in tweets with php preg_replace

    - by Ben Paton
    Hello I'm trying to display the latest tweet using the code below. This preg_replace works great for wrapping a link round twitter @usernames but doesn't work for web addresses in tweets. How do I get this code to wrap links around urls in tweets. <?php /** Script to pull in the latest tweet */ $username='fairgroceruk'; $format = 'json'; $tweet = json_decode(file_get_contents("http://api.twitter.com/1/statuses/user_timeline/{$username}.{$format}")); $latestTweet = htmlentities($tweet[0]->text, ENT_QUOTES); $latestTweet = preg_replace('/@([a-z0-9_]+)/i', '<a href="http://twitter.com/$1" target="_blank">@$1</a>', $latestTweet); $latestTweet = preg_replace('/http://([a-z0-9_]+)/i', '<a href="http://$1" target="_blank">http://$1</a>', $latestTweet); echo $latestTweet; ?> Thanks for the help, Ben

    Read the article

  • GXT/GWT html content reloads when switching tabs

    - by Ben
    I am working on a GXT/GWT project. I have two tabs in which content is set based on selections from a drop down menu. The content in one tab is an embedded video (Google Video or youtube video) The problem is that when switching tabs, the video reloads and starts from the beginning again. What I would like is to be able to switch tabs and have the video continue to play or pause when the focus switches to another tab. Any ideas, as always, are greatly appreciated. Cheers, Ben

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >