Search Results

Search found 1237 results on 50 pages for 'sam'.

Page 28/50 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • jQuery UI Datepicker - Disable specific days

    - by Sam
    Is there any (easy) way to set the jQuery UI Datepicker to disallow selection of specific, predetermined days? I was able to get this approach working, however, it produces a null error which prevents it from displaying in IE. 'natDays[...].0' is null or not an object Thanks in advance! UPDATE: Might help if I included some code, right? Anyway, most of this was taken straight from the aforementioned thread: natDays = [ [7, 23], [7, 24], [8, 13], [8, 14], ]; function nationalDays(date) { for (i = 0; i < natDays.length; i++) { if (date.getMonth() == natDays[i][0] - 1 && date.getDate() == natDays[i][1]) { return [false, natDays[i][2] + '_day']; } } return [true, '']; } function noWeekendsOrHolidays(date) { var noWeekend = $.datepicker.noWeekends(date); if (noWeekend[0]) { return nationalDays(date); } else { return noWeekend; } } $(function() { $("#datepicker").datepicker({ inline: true, minDate: new Date(2009, 6, 6), maxDate: new Date(2009, 7, 14), numberOfMonths: 2, hideIfNoPrevNext: true, beforeShowDay: $.datepicker.noWeekends, altField: '#alternate', }); }); Thanks again!

    Read the article

  • ASP.NET MVC: How to display strongly typed view model, containing list of items, which also contain

    - by Sam Delaney
    Hi, I'm building an app using ASP.NET MVC which I want to use a strongly type view model, which contains a List called items which contains an id int and itemName string. The view model also conatins a List called people, and the Person class contains a List. The way I want to display the information is as a table, with each row having a column of Person name, then n number of columns which contain checkboxes, one for each of the List, and checked based on whether the Person's List (called items) contains the id of the Item. I have the display working fine, but I'm struggling to understand how to name the items so that the posted method can read the data. This is what I have in the BeginForm: <table cellpadding="20"> <thead> <th>Person name</th> <!-- for each of the items, create a column with the item name --> <% foreach( var i in Model.items ) { %> <th><%= Html.Encode(i.itemName) %></th> <% } %> </thead> <% foreach( var p in Model.people ) { %> <tr> <td><%= Html.Encode(p.name) %></td> <!-- for each item, create a column with a checkbox --> <% foreach( var i in Model.items ) { %> <td> <% if( p.items.Contains(i.id) ) { %> <!-- vm is the name of the view model passed to the view --> <%= Html.CheckBox( "vm.people[" + p.id + "].items[" + i.id + "]", true ) %> <% } else { %> <%= Html.CheckBox( "vm.people[" + p.id + "].items[" + i.id + "]", false ) %> <% } %> </td> <% } %> </tr> <% } %> </table> And this code displays the information perfectly. When I click submit, however, I get an Object Reference Not Set.. error message. Can anyone help with this please?

    Read the article

  • Annoying Captcha >> How to programm a form that can SMELL difference between human and robot?

    - by Sam
    Hi folks. On the comment of my old form needing a CAPTHA, I felt I share my problem, perhaps you recognize it and find its time we had better solutions: FACTUAL PROBLEM I know most of my clients (typical age= 40~60) hate CAPTCHA things. Now, I myself always feel like a robot, when I have to sueeze my eyes and fill in the strange letters from the Capcha... Sometimes I fail! Go back etc. Turnoff. I mean comon its 2011, shouldnt the forms have better A.I. by now? MY NEW IDEA (please dont laugh) Ive thought about it and this is my idea's to tell difference between human and robot: My idea is to give credibility points. 100 points = human 0% = robot. require real human mouse movements require mousemovements that dont follow any mathematical pattern require non-instantaneous reading delays, between load and first input in form when typing in form, delays are measured between letters and words approve as human when typical human behaviour measured (deleting, rephrasing etc) dont allow instant pasting or all fields give points for real keyboard pressures retract points for credibility when hyperlinks in form Test wether fake email field (invisible by human) is populated (suggested by Tomalak) when more than 75% human cretibility, allow to be sent without captcha when less than 25% human crecibility, force captcha puzzle to be sure Could we write a A.I. PHP that replaces the human-annoying capthas, meanwhile stopping most spamservers filing in the data? Not only for the fun of it, but also actually to provide a 99% better alternative than CAPTHCA's. Imagine the userfriendlyness of your forms! Your site distinguishing itself from others, showing your audience your sites KNOWS the difference between a robot and a human. Imagine the advangage. I am trying to capture the essense of that distinguishing edge. PROGRAMMING QUESTION: 1) Are such things possible to programm? 2) If so how would you start such programm? 3) Are there already very good working solutions available elsewhere? 4) If it isn't so hard, your are welcome to share your answer/solutions below. 5) upon completion of hints and new ideas, could this page be the start of a new AI captcha, OR should I forget about it and just go with the flow, forget about the whole AI dream, and use captcha like everyone else.

    Read the article

  • Jquery selectors by CSS class in IE is really slow--workarounds?

    - by Sam Lee
    I have a web app where I have several elements with class="classA". I want to select and apply a function to all of them. I am doing the obvious thing, which is $(".classA").each(function () { ... }). This works just fine in Chrome/Safari/Firefox but is really slow in IE. It turns out IE has serious performance issues when selecting things by CSS class in jQuery. I was wondering if anyone has suggestions on good ways to deal with this. I can't use ID selectors because there can be multiple DOM elements I want to select.

    Read the article

  • Accessing a dictionary value by custom object value in Python?

    - by Sam
    So I have a square that's made up of a series of points. At every point there is a corresponding value. What I want to do is build a dictionary like this: class Point: def __init__(self, x, y): self._x = x self._y = y square = {} for x in range(0, 5): for y in range(0, 5): point = Point(x,y) square[point] = None However, if I later create a new point object and try to access the value of the dictionary with the key of that point it doesn't work.. square[Point(2,2)] Traceback (most recent call last): File "<pyshell#19>", line 1, in <module> square[Point(2,2)] KeyError: <__main__.Point instance at 0x02E6C378> I'm guessing that this is because python doesn't consider two objects with the same properties to be the same object? Is there any way around this? Thanks

    Read the article

  • Reading a file N lines at a time in ruby

    - by Sam
    I have a large file (hundreds of megs) that consists of filenames, one per line. I need to loop through the list of filenames, and fork off a process for each filename. I want a maximum of 8 forked processes at a time and I don't want to read the whole filename list into RAM at once. I'm not even sure where to begin, can anyone help me out?

    Read the article

  • PHP not obeying my defined ETags

    - by Sam Bisbee
    What I'm doing I'm pulling an image from the database and sending it to the browser with all the proper headers - the image displays fine. I also send an ETag header, using the SHA1 of the image's content as the tag. The images are getting called semi regularly, so caching is a bit of an issue (won't kill the site, but nice to have). The Problem $_SERVER['HTTP_IF_NONE_MATCH'] is not available to me. As far as I can tell, this is because of PHP's "disobey the cache controls" life style. I can't mess with the session cache limiter, because I don't have access. But, even if I did have access, I wouldn't want to touch it: 99% of the site is under WordPress. The Environment PHP 4 (don't ask) Apache 2.2 WordPress The images live in the database (largeblog), which I can't change. Any guidance, tip/tricks, etc. would be helpful. I don't have much room to change the environmental/structural stuff. Cheers.

    Read the article

  • JNLP File Association: How do I open the file which was double-clicked on?

    - by Sam Barnum
    I've got the following JNLP: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0.10//EN" "http://java.sun.com/dtd/JNLP-6.0.10.dtd"> <jnlp spec="6.0.10" version="1.63" codebase="http://foo.example.com/msi" href="Foo.jnlp"> <information> <title>Foo</title> <vendor> Foo Systems, Inc.</vendor> <homepage href="http://Foo.com"/> <description>Foo Viewer/Editor Application</description> <icon href="splash.gif" width="425" height="102" kind="splash"/> <icon href="Foo.gif" width="64" height="64"/> <offline-allowed/> <shortcut> <desktop/> <menu submenu="Foo Systems, Inc."/> </shortcut> <association mime-type="application-x/wlog" extensions="wlog"/> <association mime-type="application-x/mplot" extensions="mplot"/> </information> <security> <all-permissions/> </security> <resources> <j2se version="1.6+" initial-heap-size="32m" max-heap-size="255m"/> <jar href="jars_deployment/TimingFramework-1.0.jar"/> <jar href="jars_deployment/iText-2.1.5.jar"/> <jar href="jars_deployment/jai_codec.jar"/> <jar href="Foo.jar"/> <jar href="jars_deployment/TimingFramework-1.0.jar"/> <jar href="jars_deployment/iText-2.1.5.jar"/> <jar href="jars_deployment/jai_codec.jar"/> <jar href="jars_deployment/jsch-20090402.jar"/> <property name="apple.laf.useScreenMenuBar" value="true"/> <property name="apple.awt.graphics.UseQuartz" value="false"/> <property name="com.apple.mrj.application.apple.menu.about.name" value="Foo"/> <property name="java.util.logging.config.file" value="/Users/Shared/logging.properties"/> </resources> <application-desc main-class="com.prosc.msi.editor.ui.test.Sandbox"/> </jnlp> Most everything is working. When I double-click a .wlog file, it opens up my application. However, it doesn't open the correct file. I read somewhere that JNLP was supposed to pass parameters to the main method indicating which file caused the app to be launched, but this is not happening (on OS X 10.6). I get an empty array to my application's main method. Probably unrelated, my splash screen doesn't work :( Any pointers on getting this working?

    Read the article

  • Is it possible to have a Ocaml function that accepts only integer lists?

    - by Sam
    I'm writing a recursive function in Ocaml that's supposed to count the number of items in an integer list (Yes I know there's a List.length function but I'm trying to do it myself). However the Ocaml compiler/interpreter forces me to use alpha list all the time. So is it wrong to say that, when a function accepts a list as a parameter, the type of that list must always be alpha? Thanks EDIT: the reason why it's inconvenient for me to use alpha lists is because i can't compare the head of the alpha list with an integer value due to type-matching complaints

    Read the article

  • VS 2008 hangs(slow) when I select "File > Open > Web Site..."

    - by Sam
    When I try to select the following "File Open Web Site" or use the shortcut key "Shift + Alt + O" (which does the same), Visual Studio 2008 hangs with the loading mouse icon for about 8-10 seconds then the file. But if I do "File Open Project/Solution.." or "File Open File..." the explorer window comes up in under a second, instantly most times. Computer Specs: Windows 7 x64 Visual Studio 2008 Pro Edition with Service Pack 1 Intel Core2 Due e6420 @ 3.2GHz 4GB DDR2

    Read the article

  • How to create dependencies in automake?

    - by Sam
    Hello, I have a Makefile.am file right now that looks like this: lib_LIBRARIES = foo.a foo_a_SOURCES = bar.F90 baz.F90 When compiled, bar.F90 gives bar.o. However, bar.F90 depends on several other Fortran files (cat.F90, dog.F90, pig.F90). I want to set up Automake to rebuild bar.o if the source of one of these dependencies change. I've been reading the GNU manuals for automake/autoconf and was unable to find a solution to this. Thanks for reading.

    Read the article

  • Reading HTTP server push streams with Python

    - by Sam
    I'm playing around trying to write a client for a site which provides data as an HTTP stream (aka HTTP server push). However, urllib2.urlopen() grabs the stream in its current state and then closes the connection. I tried skipping urllib2 and using httplib directly, but this seems to have the same behaviour. Is there a way to get the stream to stay open, so it can be checked each program loop for new contents, rather than waiting for the whole thing to be redownloaded every few seconds, introducing lag?

    Read the article

  • Visual Studio error on valid SQL

    - by Sam
    I'm getting an annoying error in visual studio for SQL that executes fine. SELECT InvoiceLines.LineID, InvoiceLines.InvoiceID, InvoiceLines.Text, InvoiceLines.Rate, InvoiceLines.Count, InvoiceLines.Rate * InvoiceLines.Count AS LineTotal, ((InvoiceLines.Rate * InvoiceLines.Count) * (1 + Invoices.VatRate / 100)) * (1 - CAST(Invoices.Discount AS money) * InvoiceLines.ApplyDiscount / 100) AS LineTotalIncVat, InvoiceLines.ApplyDiscount FROM InvoiceLines LEFT JOIN Invoices ON Invoices.InvoiceID = InvoiceLines.InvoiceID What LineTotalIncVat is trying to do is compute the total for the invoice item while adding the vat and subtracting the discount, and yes, probably better to do this in code (would if I could) The error visual studio gives is: There was an error parsing the query [token line number =1, token line offset =14, token in error = InvoiceLines] Even though it will validate and execute without a problem in the query builder...

    Read the article

  • Auto Generate Objects in DBIx::Class ORM in Perl

    - by Sam
    Hello, I started learning DBIx::class and I reach the point where you have to create the Objects that represents tables. Should this classes be created manually ( hard coding all the fields and relationships.....) or there is a way to generate them automatically using the database schema. I read something about loaders, but i did not know where they are really used. Please advice. Thanks

    Read the article

  • Truncating long strings with CSS: feasible yet?

    - by Sam Stokes
    Is there any good way of truncating text with plain HTML and CSS, so that dynamic content can fit in a fixed-width-and-height layout? I've been truncating server-side by logical width (i.e. a blindly-guessed number of characters), but since a 'w' is wider than an 'i' this tends to be suboptimal, and also requires me to re-guess (and keep tweaking) the number of characters for every fixed width. Ideally the truncation would happen in the browser, which knows the physical width of the rendered text. I've found that IE has a text-overflow: ellipsis property that does exactly what I want, but I need this to be cross-browser. This property seems to be (somewhat?) standard but isn't supported by Firefox. I've found various workarounds based on overflow: hidden, but they either don't display an ellipsis (I want the user to know the content was truncated), or display it all the time (even if the content wasn't truncated). Does anyone have a good way of fitting dynamic text in a fixed layout, or is server-side truncation by logical width as good as I'm going to get for now?

    Read the article

  • Windows Service WebBrowser DocumentCompleted Bug

    - by Sam Youtsey
    I've been building a Windows Service to create a WebBrowser object to navigate, login, and download a site's HTML. However, I recently discovered this bug which prevents the DocumentCompleted event from firing if the WebBrowser is not visible: http://support.microsoft.com/kb/259935 I've got to assume this is because the Windows Service doesn't allow for a GUI and therefore this bug is tripped. What is the best workaround for this? Thanks for your help.

    Read the article

  • Best design for generating code from an AST?

    - by Sam Washburn
    I'm working on a pretty complex DSL that I want to compile down into a few high level languages. The whole process has been a learning experience. The compiler is written in java. I was wondering if anyone knew a best practice for the design of the code generator portion. I currently have everything parsed into an abstract syntax tree. I was thinking of using a template system, but I haven't researched that direction too far yet as I would like to hear some wisdom first from stack overflow. Thanks!

    Read the article

  • Difference between SQL 2005 and SQL 2008 for inserting multiple rows with XML

    - by Sam Dahan
    I am using the following SQL code for inserting multiple rows of data in a table. The data is passed to the stored procedure using an XML variable : INSERT INTO MyTable SELECT SampleTime = T.Item.value('SampleTime[1]', 'datetime'), Volume1 = T.Item.value('Volume1[1]', 'float'), Volume2 = T.Item.value('Volume2[1]', 'float') FROM @xml.nodes('//Root/MyRecord') T(item) I have a whole bunch of unit tests to verify that I am inserting the right information, the right number of records, etc.. when I call the stored procedure. All fine and dandy - that is, until we began to monkey around with the compatibility level of the database. The code above worked beautifully as long as we kept the compatibility level of the DB at 90 (SQL 2005). When we set the compatibility level at 100 (SQL 2008), the unit tests failed, because the stored procedure using the code above times out. The unit tests are dropping the database, re-creating it from scripts, and running the tests on the brand new DB, so it's not - I think - a question of the 'old compatibility level' sticking around. Using the SQL Management studio, I made up a quick test SQL script. Using the same XML chunk, I alter the DB compat level , truncate the table, then use the code above to insert 650 rows. When the level is 90 (SQL 2005), it runs in milliseconds. When the level is 100 (SQL 2008) it sometimes takes over a minute, sometimes runs in milliseconds. I'd appreciate any insight anyone might have into that. EDIT The script takes over a minute to run with my actual data, which has more rows than I show here, is a real table, and has an index. With the following example code, the difference goes between milliseconds and around 5 seconds. --use [master] --ALTER DATABASE MyDB SET compatibility_level =100 use [MyDB] declare @xml xml set @xml = '<?xml version="1.0"?> <Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Record> <SampleTime>2009-01-24T00:00:00</SampleTime> <Volume1>0</Volume1> <Volume2>0</Volume2> </Record> ..... 653 records, sample time spaced out 4 hours ........ </Root>' DECLARE @myTable TABLE( ID int IDENTITY(1,1) NOT NULL, [SampleTime] [datetime] NOT NULL, [Volume1] [float] NULL, [Volume2] [float] NULL) INSERT INTO @myTable select T.Item.value('SampleTime[1]', 'datetime') as SampleTime, Volume1 = T.Item.value('Volume1[1]', 'float'), Volume2 = T.Item.value('Volume2[1]', 'float') FROM @xml.nodes('//Root/Record') T(item) I uncomment the 2 lines at the top, select them and run just that (the ALTER DATABASE statement), then comment the 2 lines, deselect any text and run the whole thing. When I change from 90 to 100, it runs all the time in 5 seconds (I change the level once, but I run the series several times to see if I have consistent results). When I change from 100 to 90, it runs in milliseconds all the time. Just so you can play with it too. I am using SQL Server 2008 R2 standard edition.

    Read the article

  • Installing Python in Windows XP

    - by Sam
    My work PC has restrictions that stop me from adding programs to the start menu so when I try to install Python using the Python 2.6.5 Windows installer it can't complete as it tries to add a shortcut to my start menu. Is there a way around this? I.e another way of installing without the need for a shortcut? Edit: I'll also need to install NumPy which I can't do on the Portable version of Python.

    Read the article

  • Webwork actions, the lifecycle of variables declared in the action class.

    - by Sam
    Hi all, I'm using the webwork framework (JIRA plugin development) and was wondering about the lifecycle of the variables in the action class. I have a few private variables in the action class that are set when during the doDefault() method. These are used in the input view to set up jqGrid columns and then when the user has entered some data they click submit which puts the grid data into a hidden input. The next thing that happens is the doValidation() method is called before the doExecute(), which displays the input view if there are any errors. The problem is that the variables set up in the doDefault() method are now null. Can anyone explain to me how the lifecycle of variables works in the webwork actions? Cheers

    Read the article

  • asp.net ajax toolkit combobox doesn't work in hidden div

    - by sam
    I have a combobox inside a hidden div which I use css display = none to make it invisible, but when I make the div visible by setting display = block, the combobox just show the input and its button and ul list all have css as display = 'none', visibility ='hidden'. I can tell it is done by combobox inbuild javascript because I tried to use javascript to set the css manually with no luck. It is a bug of combobox. Urgent help needed. I spent a week to solve this, and our team put a lot trust on the toolkit. Please help me on this, all javascript gurus, thanks. Below is the code to reproduce the bug. When you run it, you can't see the dropdown: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager> <div id="d" style="display:none"> <asp:ComboBox ID="ComboBox1" runat="server"> <asp:ListItem>a</asp:ListItem> <asp:ListItem>d</asp:ListItem> <asp:ListItem>f</asp:ListItem> </asp:ComboBox> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </div> <div ID="Button1" runat="server" onclick="show();">click me</div> <script type="text/javascript"> function show() { var d = $get('d'); d.style.display = 'block'; } </script>

    Read the article

  • How do you get Eclipse/Mylyn to fill out your commit messages for you?

    - by Sam Hasler
    I've setup the following: Installed Mylyn in Eclipse Installed the Bugzilla connector Installed Subversive SVN Integration for the Mylyn Project I've gone to Windows - Preferences - Tasks - Team and clicked Change Set Management and left it with the default Commit Comment Template: ${task.status} - ${connector.task.prefix} ${task.key}: ${task.description} ${task.url} However, if I activate a bugzilla bug in the Task List, and then edit a file, when I commit the changes the commit message isn't filled in. Also, in the Synchronisation perspective there isn't a change set for the task I'm working on. I've tried following the instructions on the Eclipse wiki's Mylyn FAQ for Why does task change set not appear when I modify files? but the bullet point: * Verify that the configured Synchronize View is configured for change sets. points to a section that is no longer in the document. I have a Show Change Sets button, but clicking it only shows me incoming change sets, there aren't any outgoing change sets. What am I missing?

    Read the article

  • Unsuccessful error detection of improperly declared method in GCC 4.2 compiler

    - by sam
    I am using C++ compiler GCC 4.2 in XCode 3.2.2. I have noted that the compiler will successfully compile a method foo even though there are no ellipses. The header and method are properly declared as foo(), but when I do a find and replace either by file or by program-wide it will miss approximately 2-3% of the changes [foo to foo(). This would not be critical if the compiler did not give an erroneous successful build. I have not found that this to occur with: foo(any parameter). Does anyone have any solution? Thank you.

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >