Search Results

Search found 540 results on 22 pages for 'charles peterson'.

Page 7/22 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Too many JavaScript and CSS files on my ASP.NET MVC 2 Master Page?

    - by Zack Peterson
    I'm using an EditorTemplate DateTime.ascx in my ASP.NET MVC 2 project. <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<DateTime>" %> <%: Html.TextBox(String.Empty, Model.ToString("M/dd/yyyy h:mm tt")) %> <script type="text/javascript"> $(function () { $('#<%: ViewData.TemplateInfo.GetFullHtmlFieldId(String.Empty) %>').AnyTime_picker({ format: "%c/%d/%Y %l:%i %p" }); }); </script> This uses the Any+Time™ JavaScript library for jQuery by Andrew M. Andrews III. I've added those library files (anytimec.js and anytimec.css) to the <head> section of my master page. Rather than include these JavaScript and Cascading Style Sheet files on every page of my web site, how can I instead include the .js and .css files only on pages that need them--pages that edit a DateTime type value?

    Read the article

  • Why does javascript's "in" operator return true when testing if 0 exists in an array that doesn't co

    - by Mariano Peterson
    For example, this returns true, and makes sense: var x = [1,2]; 1 in x; // true This returns false, and makes sense: var x = [1,2]; 3 in x; // false However this returns true, and I don't understand why: var x = [1,2]; 0 in x; You can quickly test it by putting this in your browser's address bar: javascript:var x=[1,2]; alert(0 in x); Why does the "in" operator in Javascript return true when testing if "0" exists in array, even when the array doesn't appear to contain "0"?

    Read the article

  • Interface helpers or delegating interface parent

    - by Craig Peterson
    If I have an existing IInterface descendant implemented by a third party, and I want to add helper routines, does Delphi provide any easy way to do so without redirecting every interface method manually? That is, given an interface like so: IFoo = interface procedure Foo1; procedure Foo2; ... procedure FooN; end; Is anything similar to the following supported? IFooHelper = interface helper for IFoo procedure Bar; end; or IFooBar = interface(IFoo) procedure Bar; end; TFooBar = interface(TInterfacedObject, IFoo, IFooBar) private FFoo: IFoo; public procedure Bar; property Foo: IFoo implements IFoo; end; I'm specifically wondering about ways to that allow me to always refer to IFoo, IFooBar, or TFooBar, without switching between them, and without adding all of IFoo's methods to TFooBar.

    Read the article

  • trie reg exp parse step over char and continue

    - by forest.peterson
    Setup: 1) a string trie database formed from linked nodes and a vector array linking to the next node terminating in a leaf, 2) a recursive regular expression function that if A) char '*' continues down all paths until string length limit is reached, then continues down remaining string paths if valid, and B) char '?' continues down all paths for 1 char and then continues down remaining string paths if valid. 3) after reg expression the candidate strings are measured for edit distance against the 'try' string. Problem: the reg expression works fine for adding chars or swapping ? for a char but if the remaining string has an error then there is not a valid path to a terminating leaf; making the matching function redundant. I tried adding a 'step-over' ? char if the end of the node vector was reached and then followed every path of that node - allowing this step-over only once; resulted in a memory exception; I cannot find logically why it is accessing the vector out of range - bactracking? Questions: 1) how can the regular expression step over an invalid char and continue with the path? 2) why is swapping the 'sticking' char for '?' resulting in an overflow? Function: void Ontology::matchRegExpHelper(nodeT *w, string inWild, Set<string> &matchSet, string out, int level, int pos, int stepover) { if (inWild=="") { matchSet.add(out); } else { if (w->alpha.size() == pos) { int testLength = out.length() + inWild.length(); if (stepover == 0 && matchSet.size() == 0 && out.length() > 8 && testLength == tokenLength) {//candidate generator inWild[0] = '?'; matchRegExpHelper(w, inWild, matchSet, out, level, 0, stepover+1); } else return; //giveup on this path } if (inWild[0] == '?' || (inWild[0] == '*' && (out.length() + inWild.length() ) == level ) ) { //wild matchRegExpHelper(w->alpha[pos].next, inWild.substr(1), matchSet, out+w->alpha[pos].letter, level, 0, stepover);//follow path -> if ontology is full, treat '*' like a '?' } else if (inWild[0] == '*') matchRegExpHelper(w->alpha[pos].next, '*'+inWild.substr(1), matchSet, out+w->alpha[pos].letter, level, 0, stepover); //keep adding chars if (inWild[0] == w->alpha[pos].letter) //follow self matchRegExpHelper(w->alpha[pos].next, inWild.substr(1), matchSet, out+w->alpha[pos].letter, level, 0, stepover); //follow char matchRegExpHelper(w, inWild, matchSet, out, level, pos+1, stepover);//check next path } } Error Message: +str "Attempt to access index 1 in a vector of size 1." std::basic_string<char,std::char_traits<char>,std::allocator<char> > +err {msg="Attempt to access index 1 in a vector of size 1." } ErrorException Note: this function works fine for hundreds of test strings with '*' wilds if the extra stepover gate is not used Semi-Solved: I place a pos < w->alpha.size() condition on each path that calls w->alpha[pos]... - this prevented the backtrack calls from attempting to access the vector with an out of bounds index value. Still have other issues to work out - it loops infinitely adding the ? and backtracking to remove it, then repeat. But, moving forward now. Revised question: why during backtracking is the position index accumulating and/or not deincrementing - so at somepoint it calls w->alpha[pos]... with an invalid position that is either remaining from the next node or somehow incremented pos+1 when passing upward?

    Read the article

  • Procedure expects parameter which was not supplied.

    - by Tony Peterson
    I'm getting the error when accessing a Stored Procedure in SQL Server Server Error in '/' Application. Procedure or function 'ColumnSeek' expects parameter '@template', which was not supplied. This is happening when I call a Stored Procedure with a parameter through .net's data connection to sql (System.data.SqlClient), even though I am supplying the parameter. Here is my code. SqlConnection sqlConn = new SqlConnection(connPath); sqlConn.Open(); // METADATA RETRIEVAL string sqlCommString = "QCApp.dbo.ColumnSeek"; SqlCommand metaDataComm = new SqlCommand(sqlCommString, sqlConn); metaDataComm.CommandType = CommandType.StoredProcedure; SqlParameter sp = metaDataComm.Parameters.Add("@template", SqlDbType.VarChar, 50); sp.Value = Template; SqlDataReader metadr = metaDataComm.ExecuteReader(); And my Stored Procedure is: USE [QCApp] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[ColumnSeek] @template varchar(50) AS EXEC('SELECT Column_Name, Data_Type FROM [QCApp].[INFORMATION_SCHEMA].[COLUMNS] WHERE TABLE_NAME = ' + @template); I'm trying to figure out what I'm doing wrong here. Edit: As it turns out, Template was null because I was getting its value from a parameter passed through the URL and I screwed up the url param passing (I was using @ for and instead of &)

    Read the article

  • TortoiseSVN Error: "OPTIONS of 'https://...' could not connect to server (...)"

    - by Zack Peterson
    I'm trying to setup a new computer to synchronize with my SVN repository that's hosted with cvsdude.com. I get this error: Here's what I did (these have worked in the past): Downloaded and installed TortoiseSVN Created a new folder C:\aspwebsite Right-clicked, chose SVN Checkout... Entered the following information, clicked OK: URL of repository: https://<reponame>-svn.cvsdude.com/aspwebsite Checkout directory: C:\aspwebsite Checkout depth: Fully recursive Omit externals: Unchecked Revision: HEAD revision Got TortoiseSVN error: OPTIONS of 'https://<reponame>-svn.cvsdude.com/aspwebsite': could not connect to server (https://<reponame>-svn.cvsdude.com) Rather than getting the error, TortoiseSVN should have asked for my username and password and then downloaded about 90MB. Why can't I checkout from my Subversion repository? Kent Fredric wrote: Either their security certificate has expired, or their hosting is broken/down. Contact CVSDude and ask them whats up. It could also be a timeout, because for me their site is exhaustively slow.. It errors after only a couple seconds. I don't think it's a timeout. Matt wrote: Try visiting https://[redacted]-svn.cvsdude.com/aspwebsite and see what happens. If you can visit it in your browser, you ought to be able to get the files in your SVN client and we can work from there. If it fails, then there's your answer. I can access the site in a web browser.

    Read the article

  • Default controller name is removed on browser refresh (CodeigniterPHP/Nginx issue?)

    - by tim peterson
    For all pages in my codeigniter app except my default controller, when I refresh the browser the url isn't affected as one would expect. However for my default controller, main.php, when when I refresh the browser at "http://localhost/main" or "http://mysite.com/main", the main part is stripped off the url. So the browser bar shows just "http://localhost" or "http://mysite.com". Totally lost on where to start with this but was just wondering if anyone has come across this before...? Here's what I think could be the relevant part of my nginx.conf (if Nginx is the problem). if ($request_uri ~* ^(/main(/index)?|/index(.php)?)/?$) { rewrite ^(.*)$ / permanent; }

    Read the article

  • How do I create a multiple-table check constraint?

    - by Zack Peterson
    Please imagine this small database... Diagram Tables Volunteer Event Shift EventVolunteer ========= ===== ===== ============== Id Id Id EventId Name Name EventId VolunteerId Email Location VolunteerId Phone Day Description Comment Description Start End Associations Volunteers may sign up for multiple events. Events may be staffed by multiple volunteers. An event may have multiple shifts. A shift belongs to only a single event. A shift may be staffed by only a single volunteer. A volunteer may staff multiple shifts. Check Constraints Can I create a check constraint to enforce that no shift is staffed by a volunteer that's not signed up for that shift's event? Can I create a check constraint to enforce that two overlapping shifts are never staffed by the same volunteer?

    Read the article

  • design function: underlying structure to store list of results for print to file

    - by forest.peterson
    is this a good approach to print a list of items to csv file with a sublist attached to each item. The gist of the function is when an item is found that does not exactly macth then a list of close matches is generated - this works now writing out one list at a time to a command window. For export to a csv file I think all the lists must be generated, stored and then written at once. Right now I use a struct to store the attributes printed, each struct is an item on the list - these structs are then added to a sorted stack and when printed they pop off into write out. Is a stack of stacks of structs a good design?

    Read the article

  • Preserving case in HTTP headers with Ruby's Net:HTTP

    - by emh
    Although the HTTP spec says that headers are case insensitive; Paypal, with their new adaptive payments API require their headers to be case-sensitive. Using the paypal adaptive payments extension for ActiveMerchant (http://github.com/lamp/paypal_adaptive_gateway) it seems that although the headers are set in all caps, they are sent in mixed case. Here is the code that sends the HTTP request: headers = { "X-PAYPAL-REQUEST-DATA-FORMAT" => "XML", "X-PAYPAL-RESPONSE-DATA-FORMAT" => "JSON", "X-PAYPAL-SECURITY-USERID" => @config[:login], "X-PAYPAL-SECURITY-PASSWORD" => @config[:password], "X-PAYPAL-SECURITY-SIGNATURE" => @config[:signature], "X-PAYPAL-APPLICATION-ID" => @config[:appid] } build_url action request = Net::HTTP::Post.new(@url.path) request.body = @xml headers.each_pair { |k,v| request[k] = v } request.content_type = 'text/xml' proxy = Net::HTTP::Proxy("127.0.0.1", "60723") server = proxy.new(@url.host, 443) server.use_ssl = true server.start { |http| http.request(request) }.body (i added the proxy line so i could see what was going on with Charles - http://www.charlesproxy.com/) When I look at the request headers in charles, this is what i see: X-Paypal-Application-Id ... X-Paypal-Security-Password... X-Paypal-Security-Signature ... X-Paypal-Security-Userid ... X-Paypal-Request-Data-Format XML X-Paypal-Response-Data-Format JSON Accept */* Content-Type text/xml Content-Length 522 Host svcs.sandbox.paypal.com I verified that it is not Charles doing the case conversion by running a similar request using curl. In that test the case was preserved.

    Read the article

  • How to write a custom solution using a python package, modules etc

    - by morpheous
    I am writing a packacge foobar which consists of the modules alice, bob, charles and david. From my understanding of Python packages and modules, this means I will create a folder foobar, with the following subdirectories and files (please correct if I am wrong) foobar/ __init__.py alice/alice.py bob/bob.py charles/charles.py david/david.py The package should be executable, so that in addition to making the modules alice, bob etc available as 'libraries', I should also be able to use foobar in a script like this: python foobar --args=someargs Question1: Can a package be made executable and used in a script like I described above? Question 2 The various modules will use code that I want to refactor into a common library. Does that mean creating a new sub directory 'foobar/common' and placing common.py in that folder? Question 3 How will the modules foo import the common module ? Is it 'from foobar import common' or can I not use this since these modules are part of the package? Question 4 I want to add logic for when the foobar package is being used in a script (assuming this can be done - I have only seen it done for modules) The code used is something like: if __name__ == "__main__": dosomething() where (in which file) would I put this logic ?

    Read the article

  • Red 5, First setup "ssl_error_rx_record_too_long" error message

    - by charles horvath
    I am using Windows 7 and I installed Red 5 0.9.1 just recently. After it installed I put 127.0.0.1 as the IP adress and 5080 as http port. After I start the service in windows I try to connect to the localhost in firefox (http://localhost:5080) and get this error An error occurred during a connection to localhost:5080. SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long) I checked my global flash settings and allowed localhost to pass along with the Red 5 folder in C/programfiles/red5. I currently have the up to date versions of JDK and JRE also. Any tips on what might be wrong?

    Read the article

  • Deleting entire lines in a text file based on a partial string match with Windows PowerShell

    - by Charles
    So I have several large text files I need to sort through, and remove all occurrences of lines which contain a given keyword. So basically, if I have these lines: This is not a test This is a test Maybe a test Definitely not a test And I run the script with 'not', I need to entirely delete lines 1 and 4. I've been trying with: PS C:\Users\Admin (Get-Content "D:\Logs\co2.txt") | Foreach-Object {$_ -replace "3*Program*", ""} | Set-Content "D:\Logs\co2.txt" but it only replaces the 'Program' and not the entire line.

    Read the article

  • osx run app on every file in folder

    - by Charles
    I want to use jsmin to minify every js file in a directory, and js files in subfolders as well. I would want to use the compiled vers of jsmin found here: http://www.ejeliot.com/blog/73 What is the osx equivalent of a batch file? Looking for something like this for OSX: http://superuser.com/questions/116417/run-a-batch-command-for-every-file-in-a-directory Thanks.

    Read the article

  • What's up with stat on MacOSX/Darwin? Or filesystems without names...

    - by Charles Stewart
    In response to a question I asked on SO, Give the mount point of a path, one respondant suggested using stat to get the device name associated with the volume of a given path. This works nicely on Linux, but gives crazy results on MacOSX 10.4. For my system, df and mount give: cas cas$ df Filesystem 512-blocks Used Avail Capacity Mounted on /dev/disk0s3 58342896 49924456 7906440 86% / devfs 194 194 0 100% /dev fdesc 2 2 0 100% /dev <volfs> 1024 1024 0 100% /.vol automount -nsl [166] 0 0 0 100% /Network automount -fstab [170] 0 0 0 100% /automount/Servers automount -static [170] 0 0 0 100% /automount/static /dev/disk2s1 163577856 23225520 140352336 14% /Volumes/Snapshot /dev/disk2s2 409404102 5745938 383187960 1% /Volumes/Sparse cas cas$ mount /dev/disk0s3 on / (local, journaled) devfs on /dev (local) fdesc on /dev (union) <volfs> on /.vol automount -nsl [166] on /Network (automounted) automount -fstab [170] on /automount/Servers (automounted) automount -static [170] on /automount/static (automounted) /dev/disk2s1 on /Volumes/Snapshot (local, nodev, nosuid, journaled) /dev/disk2s2 on /Volumes/Sparse (asynchronous, local, nodev, nosuid) Trying to get the devices from the mount points, though: cas cas$ df | grep -e/ | awk '{print $NF}' | while read line; do echo $line $(stat -f"%Sdr" $line); done / disk0s3r /dev ???r /dev ???r /.vol ???r /Network ???r /automount/Servers ???r /automount/static ???r /Volumes/Snapshot disk2s1r /Volumes/Sparse disk2s2r Here, I'm feeding each of the mount points scraped from df to stat, outputting the results of the "%Sdr" format string, which is supposed to be the device name: Cf. stat(1) man page: The special output specifier S may be used to indicate that the output, if applicable, should be in string format. May be used in combination with: ... dr Display actual device name. What's going on? Is it a bug in stat, or some Darwin VFS weirdness? Postscript Per Andrew McGregor, try passing "%Sd" to stat for more weirdness. It lists some apparently arbitrary subset of files from CWD...

    Read the article

  • How do I fix this Windows 7 wireless connectivity issue?

    - by Charles Randall
    I have a laptop with an Intel Wireless Centrino 6300 module. Recently, the machine has stopped properly connecting to my wireless router. It will get stuck in a loop of connecting, then disconnecting and reconnecting. While connected, it will simply say "No Internet Access." Running inSSIDer 2.0, it shows my network jumping around between two channels -- I know this isn't the case, because I've set my router to sit on one single channel. My MacBook Pro, Boxee Box, PS3, and Xbox 360 all connect fine to the wireless and have no problems at all. I know it's not the wireless module, as I bought a second one recently assuming the first had died -- but I get the same behavior with both. Sometimes, I can fix the issue temporarily by deleting the network (Using the Manage Wireless Networks page), and then re-adding it (via standard wireless methods). Then it will work for a few days. But inevitably the problem comes back, and now the laptop simply won't connect to the wireless at all, even if I take steps that usually work. Since I've ruled out the hardware, and it's unlikely some kind of interference issue (because I would expect to see it on any multitude of other devices), I would think at this point that it's a problem with Windows itself. One thing that might be a hint, even though I delete the network, when I add it again, it's always listed as "Wireless Network Connection 2" even though there isn't another in the list.

    Read the article

  • Strange. Asterisk key plays random Windows sound when pressed

    - by Charles
    This is a new one on me. When I press the "asterisk", or * button on my number pad (but not SHIFT+8), Windows makes either a "Exclamation" or "Windows ding" sound. I haven't noticed a pattern to which sound is made. Logitech K200 keyboard No special key mapping software or Logitech software running Realtek sound to stereo through optical cable. Visual Studio 2010, Chrome, Fiddler, WinRAR, Notepad++, and Dropbox running. No unusual behavior otherwise. A solution isn't terribly important but my curiosity is both piqued and stumped. This doesn't normally happen and nothing odd has taken place otherwise. Ideas?

    Read the article

  • Most common account names used in ssh brute force attacks

    - by Charles Stewart
    Does anyone maintain lists of the most frequently guessed account names that are used by attackers brute-forcing ssh? For your amusement, from my main server's logs over the last month (43 313 failed ssh attempts), with root not getting as far as sshd: cas@txtproof:~$ grep -e sshd /var/log/auth* | awk ' { print $8 }' | sort | uniq -c | sort | tail -n 13 32 administrator 32 stephen 34 administration 34 sales 34 user 35 matt 35 postgres 38 mysql 42 oracle 44 guest 86 test 90 admin 16513 checking

    Read the article

  • What comment-spam filtering service works?

    - by Charles Stewart
    From an answer I gave to another question: There are comment filtering services out there that can analyse comments in a manner similar to mail spam filters (all links to the client API page, organised from simplest API to most complex): Steve Kemp (again) has an xml-rpc-based comment filter: it's how Debian filters comments, and the code is free software, meaning you can run your own comment filtering server if you like; There's Akismet, which is from the WordPress universe; There's Mollom, which has an impressive list of users. It's closed source; it might say "not sure" about comments, intended to suggest offering a captcha to check the user. For myself, I'm happy with offline by-hand filtering, but I suggested Kemp's service to someone who had an underwhelming experience with Mollom, and I'd like to pass on more reports from anyone who has tried these or other services.

    Read the article

  • easy Switching to open folders on a mac

    - by Charles
    How do I easily switch to an open folder on a mac? In windows, which I'm used to using, I can see all my opened folders in my vertical taskbar, all i need to do to switch to another window is click on the folder in the task bar. There's no taskbar in mac, and when i have a lot of folders opened, ie, lots of finder windows, how can I switch between them? The way i'm doing it is, i put expose on an active corner and switch that way. However that's still damn hard, because first i have to bring up expose, and then find my window. The folders are placed in a random position between opened apps, the folders are not in a list, and on a big screen i have to scan the whole screen in order to find the one i want... etc. Is it really this hard just to switch to a different folder on a mac? :(

    Read the article

  • Running Safari from the command line adds current directory to the URL

    - by Charles Anderson
    I am trying to run the Safari browser (on Mac OS 10.4) from the command line, as follows: /Applications/Safari.app/Contents/MacOS/Safari http://localhost/dev/myfile.html However, Safari starts up and tries to access file:///Users/charlesanderson/scripts/http://localhost/dev/myfile.html /Users/charlesanderson/scripts happens to be my current directory. Can someone explain why Safari does this? Firefox is much better behaved?

    Read the article

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