Daily Archives

Articles indexed Sunday June 6 2010

Page 9/76 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • jquery prepend to textarea text()

    - by synapz
    I have a text area. I can set the text of it with $("#mytextarea").text("foo") I can prepend to the text area like this: $("#mytextarea").prepend("foo") But I cannot prepend to the jquery text() object like this: $("#mytextarea").text().prepend("foo") The reason I want to do this is so that if my user gets me to prepend this text: $("#mytextarea").prepend("<script>alert('lol i haxed uuu!')</script>") ...the script executes and I lose. Help?

    Read the article

  • Setting a profile property in asp.net MVC while creating a user.

    - by twal
    In my application, an authorized user will Register a new customer and set their username and password, etc. The customer will not be registering them self. I have the following code in a class file which creates the new user, and it works just fine. public MembershipCreateStatus CreateUser(string userName, string password, string email, string employeeID) { if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName"); if (String.IsNullOrEmpty(password)) throw new ArgumentException("Value cannot be null or empty.", "password"); if (String.IsNullOrEmpty(email)) throw new ArgumentException("Value cannot be null or empty.", "email"); MembershipCreateStatus status; /// _membershipProvider.CreateUser("asdas","ds123BB", email, "asdasd", "asdasdad", true, null, out status); _membershipProvider.CreateUser(userName, password, email, null, null, true, null, out status); string answer = status.ToString(); return status; } However I would also like to set an employeeID property for the profile when creating this user. how would I set the EmployeeID when creating a new user?? Thanks

    Read the article

  • Rails Controller Tests for Captcha using Shoulda, Factory Girl, Mocha

    - by Siva
    Can someone provide a strategy/code samples/pointers to test Captcha validations + Authlogic using Shoulda, Factory Girl and Mocha? For instance, my UsersController is something like: class UsersController < ApplicationController validates_captcha ... def create ... if captcha_validated? # code to deal with user attributes end ... end In this case, how do you mock/stub using Shoulda / Factory Girl / Mocha to test valid and invalid responses to the Captcha image? Appreciate your help, Siva

    Read the article

  • PHP/MySQL Printing Duplicate Labels

    - by Michael
    Using an addon of FPDF, I am printing labels using PHP/MySQL (http://www.fpdf.de/downloads/addons/29/). I'd like to be able to have the user select how many labels to print. For example, if the query puts out 10 records and the user wants to print 3 labels for each record, it prints them all in one set. 1,1,1,2,2,2,3,3,3...etc. Any ideas? <?php require_once('auth.php'); require_once('../config.php'); require_once('../connect.php'); require('pdf/PDF_Label.php'); $sql="SELECT $tbl_members.lastname, $tbl_members.firstname, $tbl_members.username, $tbl_items.username, $tbl_items.itemname FROM $tbl_members, $tbl_items WHERE $tbl_members.username = $tbl_items.username"; $result=mysql_query($sql); if(mysql_num_rows($result) == 0){ echo "Your search criteria does not return any results, please try again."; exit(); } $pdf = new PDF_Label("5160"); $pdf->AddPage(); // Print labels while($rows=mysql_fetch_array($result)){ $name = $rows['lastname'].', '.$rows['firstname'; $item= $rows['itemname']; $text = sprintf(" * %s *\n %s\n", $name, $item); $pdf->Add_Label($text); } $pdf->Output('labels.pdf', 'D'); ?>

    Read the article

  • How to set App as site.com/ in Kohana3

    - by Drew
    Hi all! I've only just started using Kohana ( 3 hours ago), and so far it's blown my socks off (and I'm wearing slippers, so that's quite impressive). Right now, I have a controller 'Controller_FrontPage' with associated views and models and I'm trying to get it accesible from the root of my website (eg, http://www.mysite.com/). If I edit the default controller in the bootstrap from: Route::set('default', '(<controller>(/<action>(/<id>)))') ->defaults(array( 'controller' => 'welcome', 'action' => 'index', )); to 'controller' => '', I get an error, could not find controller_ (which makes sense), and if I change it to 'controller' => '/', I get an error, could not find controller_/ (which also makes sense). If I set 'controller' => 'FrontPage', everything works fine, but all my links (html::anchor(...)) point to http://www.mysite.com/FrontPage/*. Is there a way to have all the anchors point to http://www.mysite.com/*?

    Read the article

  • Why am I getting an error on Heroku that suggests I need to migrate my app to Bamboo?

    - by user242065
    When I type: git push heroku master, this is what happens @68-185-86-134:sample_app git push heroku master Counting objects: 110, done. Delta compression using up to 2 threads. Compressing objects: 100% (94/94), done. Writing objects: 100% (110/110), 87.48 KiB, done. Total 110 (delta 19), reused 0 (delta 0) -----> Heroku receiving push -----> Rails app detected ! This version of Rails is only supported on the Bamboo stack ! Please migrate your app to Bamboo and push again. ! See http://docs.heroku.com/bamboo for more information ! Heroku push rejected, incompatible Rails version error: hooks/pre-receive exited with error code 1 To [email protected]:blazing-frost-89.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to '[email protected]:blazing-frost-89.git' My .gems file: rails --version 2.3.8 My .git/config file: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true ignorecase = true [remote "origin"] url = [email protected]:csmeder/sample_app.git fetch = +refs/heads/*:refs/remotes/origin/* [remote "heroku"] url = [email protected]:blazing-frost-89.git fetch = +refs/heads/*:refs/remotes/heroku/*

    Read the article

  • Authentication Error when accessing Sharepoint list via web service

    - by Joe
    I wrote a windows service a few months ago that would ping a Sharepoint list using _vti_bin/lists.asmx function GetListItemChanges. It was working fine until a few weeks ago when my company upgraded our Sharepoint instance to SP1. Now whenever my service attempts to access Sharepoint I receive an 401.1 authentication error: Error: You are not authorized to view this page You do not have permission to view this directory or page using the credentials that you supplied. Please try the following: Contact the Web site administrator if you believe you should be able to view this directory or page. HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials. Internet Information Services (IIS) I have checked and my privileges on the site have not changed. here is the code In which I call the list: Lists listsService = new Lists(); listsService.Credentials = new NetworkCredential("UserName", "Password", "domain"); Result = listsService.GetListItemChanges("List name", null, dTime.ToString(), null); It has also been brought to my attention that basic authentication may have been disabled on our farm. I don't believe I'm using that but I may be mistaken.

    Read the article

  • FIX: A dump file is not generated for a .NET Framework 2.0-based application after the application c

    981878 ... FIX: A dump file is not generated for a .NET Framework 2.0-based application after the application closesThis RSS feed provided by kbAlerz.com.Visit kbAlertz.com to subscribe. It's 100% free and you'll be able to recieve e-mail or RSS updates for the technologies you pick from the Microsoft Knowledge Base....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Referenced assemblies of a .NET Framework 2.0-based 32-bit application are loaded multiple times

    981266 ... Referenced assemblies of a .NET Framework 2.0-based 32-bit application are loaded multiple timesThis RSS feed provided by kbAlerz.com.Visit kbAlertz.com to subscribe. It's 100% free and you'll be able to recieve e-mail or RSS updates for the technologies you pick from the Microsoft Knowledge Base....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • A memory leak occurs in a .NET Framework 2.0-based application that uses the AesCryptoServiceProvide

    981575 ... A memory leak occurs in a .NET Framework 2.0-based application that uses the AesCryptoServiceProvider classThis RSS feed provided by kbAlerz.com.Visit kbAlertz.com to subscribe. It's 100% free and you'll be able to recieve e-mail or RSS updates for the technologies you pick from the Microsoft Knowledge Base....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • A hotfix is available that improves the performance of CLR when a .NET Framework 3.5 SP1-based appli

    981619 ... A hotfix is available that improves the performance of CLR when a .NET Framework 3.5 SP1-based application runs in a virtualized environmentThis RSS feed provided by kbAlerz.com.Visit kbAlertz.com to subscribe. It's 100% free and you'll be able to recieve e-mail or RSS updates for the technologies you pick from the Microsoft Knowledge Base....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • IIS7 Compression Configuration

    - by Level1Coder
    Hi, Previously when I used IIS6, I used IIS6 Metabase Explorer to edit Metabase.xml and manually turned on compression, specified the compression level and the file extensions to compress. IIS7 seems a bit different, there is no Metabase.xml file in the system32\inetsrv folder. Enabling compression is easy to turn on by checking the checkbox in the Compression module. But how do I manually tweak and set the compression levels and file extensions to compress? I also ran across an article saying that IIS7 also automatically throttles the compression if your CPU load is 50% then compression is turned off. Where are all these settings located?

    Read the article

  • Windows Vista to Windows 7 Gbit LAN slow file copy

    - by ashgromnies
    I have two computers with gigabit LAN, one running Windows 7 and the other running Vista. I have a D-Link DIR-655 router, with gigabit LAN ports. I created a shared directory on the Vista computer, mapped it as a network drive on the Win 7 computer, and tried copying a 2 GB file... and it's going at 900 KB/s Yep... 900 kilobytes per second, about 7 Mb/s. Why so slow? Any ideas?

    Read the article

  • Where i am doing wrong in this?

    - by kumar
    <script type="text/javascript"> $(document).ready(function() { $('#PbtnSubmit').attr('disabled', 'disabled'); $('#PbtnCancel').attr('disabled', 'disabled'); $('#PbtnSelectAll').click(function() { $('#PricingEditExceptions input[type=checkbox]').attr('checked', 'checked'); $('#PbtnSubmit').removeAttr('disabled'); $('#PbtnCancel').removeAttr('disabled'); $('fieldset').find("input,select,textarea").removeAttr('disabled'); }); $('#PbtnCancel').click(function() { $('#PricingEditExceptions input[name=PMchk]').attr('checked', false); $('#PbtnSubmit').attr('disabled', 'disabled'); $('#PbtnCancel').attr('disabled', 'disabled'); $('fieldset').find("input:not(:checkbox),select,textarea").attr('disabled', 'disabled'); $('#genericfieldset').find("input,select,textarea").removeAttr('disabled'); }); $('#PbtnSubmit').click(function() { $('#PricingEditExceptions input[name=PMchk]').each(function() { if ($("#PricingEditExceptions input:checkbox:checked").length > 0) { var checked = $('#PricingEditExceptions input[type=checkbox]:checked'); var PMstrIDs = checked.map(function() { return $(this).val(); }).get().join(','); $('#1_exceptiontypes').attr('value', exceptiontypes) $('#1_PMstrIDs').attr('value', PMstrIDs); } else { alert("Please select atleast one exception"); return false; } }); }); function validate_excpt(formData, jqForm, options) { var form = jqForm[0]; } // post-submit callback function showResponse(responseText, statusText, xhr, $form) { if (responseText[0].substring(0, 16) != "System.Exception") { $('#error-msg-ID span:last').html('<strong>Update successful.</strong>'); } else { $('#error-msg-ID span:last').html('<strong>Update failed.</strong> ' + responseText[0].substring(0, 48)); } $('#error-msg-ID').removeClass('hide'); } $('#exc-').ajaxForm({ target: '#error-msg-ID', beforeSubmit: validate_excpt, success: showResponse, dataType: 'json' }); $('.button').button(); }); </script> This is my button.. at very first when page load I am trying Make Disabled PbtnSubmit and PbtnCancel and when we click PbtnSelectAll I am enabling back again.. but its not doing with this code. is that something I am doing worng in this? thanks

    Read the article

  • cancel stream request from WCF server to client

    - by ArsenMkrt
    Hi, I posted about stream request here [wcf-chunk-data-with-stream]:http://stackoverflow.com/questions/853448/wcf-chunk-data-with-stream I solved that task but now when i close request in client part server continue to send data. is it possible to cancel stream request from WCF server to client?

    Read the article

  • Java Matcher groups: Understanding The difference between "(?:X|Y)" and "(?:X)|(?:Y)"

    - by user358795
    Can anyone explain: Why the two patterns used below give different results? (answered below) Why the 2nd example gives a group count of 1 but says the start and end of group 1 is -1? public void testGroups() throws Exception { String TEST_STRING = "After Yes is group 1 End"; { Pattern p; Matcher m; String pattern="(?:Yes|No)(.*)End"; p=Pattern.compile(pattern); m=p.matcher(TEST_STRING); boolean f=m.find(); int count=m.groupCount(); int start=m.start(1); int end=m.end(1); System.out.println("Pattern=" + pattern + "\t Found=" + f + " Group count=" + count + " Start of group 1=" + start + " End of group 1=" + end ); } { Pattern p; Matcher m; String pattern="(?:Yes)|(?:No)(.*)End"; p=Pattern.compile(pattern); m=p.matcher(TEST_STRING); boolean f=m.find(); int count=m.groupCount(); int start=m.start(1); int end=m.end(1); System.out.println("Pattern=" + pattern + "\t Found=" + f + " Group count=" + count + " Start of group 1=" + start + " End of group 1=" + end ); } } Which gives the following output: Pattern=(?:Yes|No)(.*)End Found=true Group count=1 Start of group 1=9 End of group 1=21 Pattern=(?:Yes)|(?:No)(.*)End Found=true Group count=1 Start of group 1=-1 End of group 1=-1

    Read the article

  • Can someone explain this block of ASP.NET MVC code to me, please?

    - by Pure.Krome
    Hi folks, this is the current code in ASP.NET MVC2 (RTM) System.Web.Mvc.AuthorizeAttribute class :- public virtual void OnAuthorization(AuthorizationContext filterContext) { if (filterContext == null) { throw new ArgumentNullException("filterContext"); } if (this.AuthorizeCore(filterContext.HttpContext)) { HttpCachePolicyBase cache = filterContext.HttpContext.Response.Cache; cache.SetProxyMaxAge(new TimeSpan(0L)); cache.AddValidationCallback( new HttpCacheValidateHandler(this.CacheValidateHandler), null); } else { filterContext.Result = new HttpUnauthorizedResult(); } } so if i'm 'authorized' then do some caching stuff, otherwise throw a 401 Unauthorized response. Question: What does those 3 caching lines do? cheers :)

    Read the article

  • How important is managing memory in Objective-C?

    - by Alex Mcp
    Background: I'm (jumping on the bandwagon and) starting learning about iPhone/iPad development and Objective-C. I have a great background in web development and most of my programming is done in javascript (no libraries), Ruby, and PHP. Question: I'm learning about allocating and releasing memory in Objective-C, and I see it as quite a tricky task to layer on top of actually getting the farking thing to run. I'm trying to get a sense of applications that are out there and what will happen with a poorly memory-managed program. A) Are apps usually released with no memory leaks? Is this a feasible goal, or do people more realistically just excise the worst offenders and that's ok? B) If I make an NSString for a title of a view, let's say, and forget to deallocate it it, does this really only become a problem if I recreate that string repeatedly? I imagine what I'm doing is creating an overhead of the memory needed to store that string, so it's probably quite piddling (a few bytes?) However if I have a rapidly looping cycle in a game that 'leaks' an int every cycle or something, that would overflow the app quite quickly. Are these assumptions correct? Sorry if this isn't up the community-wiki alley, I'm just trying to get a handle on how to think about memory and how careful I'll need to be. Any anecdotes or App Store-submitted app experiences would be awesome to hear as well.

    Read the article

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