Search Results

Search found 4473 results on 179 pages for 'mark fish'.

Page 82/179 | < Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >

  • How can one change the primary key using NHibernate.

    - by mark
    Dear ladies and sirs. I want to change the primary key of an entity in database, so that all the relevant foreign key constraints are updated as well./We are using NHibenate as our ORM. Is it possible to do it? Thanks. P.S. I know the practice of changing the primary key is highly discouraged. My problem is that my primary key is backed by a natural Id of the entity, which may sometimes change. We could, theoretically, utilize a unique primary key, unrelated to the natural key of the entity, but this complicates things too much in other places, so this is not an option.

    Read the article

  • script to sum all numbers in a file (linux)

    - by Mark Roberts
    I have a file which contains several thousand numbers, each on it's own line: 34 42 11 6 2 99 ... I'm looking to write a script which will print the sum of all numbers in the file. I've got a solution, but it's not very efficient. (It takes several minutes to run.) I'm looking for a more efficient solution. Any suggestions?

    Read the article

  • Oracle: how to "group by" over a range?

    - by Mark Harrison
    If I have a table like this: pkey age ---- --- 1 8 2 5 3 12 4 12 5 22 I can "group by" to get a count of each age. select age,count(*) n from tbl group by age; age n --- - 5 1 8 1 12 2 22 1 What query can I use to group by age ranges? age n ----- - 1-10 2 11-20 2 20+ 1

    Read the article

  • Non-trivial desktop apps that use Ruby?

    - by Mark A. Nicolosi
    I'm about to start a project developing a Ruby desktop application. I expect to to be fairly big and I want to learn techniques for dividing code among modules and other techniques for managing complexity. Most large apps I've looked at are Rails apps, but these aren't very helpful, because most of the work is done by Rails itself. What source code would you recommend I take a look at? I'm not interested in libraries or Rails apps, because I get how they do things. CLI apps are OK, but I'm mostly interested in GUI apps (I'm using Gtk+, but I can learn just as much from apps using other GUI toolkits).

    Read the article

  • Should I allow my clients to open tickets/access trac?

    - by Mark
    I just installed trac for this project I'm working on, since it's turned out to be a bit bigger than I anticipated. I've added a bunch of tickets with my clients requests which come in the form of emails, phone calls, and meetings. I've also added some stuff I know needs to be done/fixed but they haven't specifically requested. Should I grant them access to trac so they can submit the tickets themselves so I don't have to keep translating (words into tickets) for them? They're very non-technical, so I'm not sure how well it would work; they might open tickets and not provide enough detail, or get confused by all the different fields. If your answer is "no", should I at least let them view the tickets, so they can see what I'm working on, what's been done, hasn't been done? So they can stop calling me to say "xxx doesn't work" when it's already a ticket? (Not that this would work, but I could at least respond "see ticket #42")

    Read the article

  • What is the proper way to handle a fully qualified domain in a GET request?

    - by Mark P Neyer
    I'm writing a proxy server. When I use curl to fetch a page, say http://www.foo.com/pants, curl makes the following request: GET /pants HTTP/1.1 When I have curl send that request through my local proxy, curl changes the GET request to: GET http://www.foo.com/pants HTTP/1.1 This change causes the foo.com server return a 404. Is foo.com broken? Or is the fully qualified domain name only meaningful to proxy servers? Should I always strip http://domain from the requests I send out? Thanks!

    Read the article

  • Reversed Sorted Dictionary?

    - by Mark
    I have a SortedDictionary as defined like this: SortedDictionary<TPriority, Queue<TValue>> dict; But I want to sort the keys in reverse order. I assume I need set the Comparer, but what comparer do I use for a generic TPriority? Note that TPriority implements IComparable.

    Read the article

  • Making a PHP object behave like an array?

    - by Mark Biek
    I'd like to be able to write a PHP class that behaves like an array and uses normal array syntax for getting & setting. For example (where Foo is a PHP class of my making): $foo = new Foo(); $foo['fooKey'] = 'foo value'; echo $foo['fooKey']; I know that PHP has the _get and _set magic methods but those don't let you use array notation to access items. Python handles it by overloading __getitem__ and __setitem__. Is there a way to do this in PHP? If it makes a difference, I'm running PHP 5.2.

    Read the article

  • How to get out information from a DataGridView?

    - by ghost_j1
    I am working on program that calculate the GPAs for university students in C#. I have made a gridview that contains columns for each subject. Its mark as letter and number. After the user "student" insert his/her subject I want to let the user click a button that will get the mark and the number of the credit hours of each subject. Calculate the GPA for the student and put the result in a textbox. I am having trouble getting started. Any advice for a good place to start?

    Read the article

  • Is a https query string secure?

    - by Mark
    I am creating a secure web based API that uses HTTPS however if I allow the users to configure it (include sending password) using a query string will this also be secure or should I force it to be done via a POST?

    Read the article

  • PHPUnit test for error thrown with wrong argument type

    - by Spencer Mark
    I'm just starting with PHPUnit and am ok with all assert* methods, but can't figure out how to test for error thrown when the wrong argument is provided to the method - say hinted with array like so: public function(array $list) { } and then tested with null as argument. Could someone please provide an example of how to test for this sort of errors? I've checked quite a few posts on stackoverflow, but couldn't find the answer to this specific issue. Edit Ok - just to give you an idea of what I'm testing - here's the ArrayHelper::removeIfValueIsEmpty() method: public static function removeIfValueIsEmpty(array $array) { if (empty($array)) { return array(); } return array_filter($array, function($value) { return !Helper::isEmpty($value); }); } and now test: class ArrayHelperTest extends PHPUnit_Framework_TestCase { public function testRemoveIfValueIsEmpty() { $this->assertEmpty( \Cmd\Helper\ArrayHelper::removeIfValueIsEmpty(null), '\Cmd\Helper\ArrayHelper::removeIfValueIsEmpty method failed (checking with null as argument)' ); } } This throws an error: PHPUnit_Framework_Error : Argument 1 passed to Cmd\Helper\ArrayHelper::removeIfValueIsEmpty() must be of the type array, null given

    Read the article

  • Python sort 2-D list by time string

    - by Mark Kennedy
    How do I sort a multi dimensional list like this based on a time string? The sublists can be of different sizes (i.e. 4 and 5, here) I want to sort by comparing the first time string in each sublist (sublist[-4]) x = (['1513', '08:19PM', '10:21PM', 1, 4], ['1290', '09:45PM', '11:43PM', 1, 4], ['0690', '07:25AM', '09:19AM', 1, 4], ['0201', '08:50AM', '10:50AM', 1, 4], ['1166', '04:35PM', '06:36PM', 1, 4], ['0845', '05:40PM', '07:44PM', 1, 4], ['1267', '07:05PM', '09:07PM', 1, 4], ['1513', '08:19PM', '10:21PM', 1, 4], ['1290', '09:45PM', '11:43PM', 1, 4], ['8772', '0159', '12:33PM', '02:43PM', 1, 5], ['0888', '0570', '09:42PM', '12:20AM', 1, 5], ['2086', '2231', '04:10PM', '06:20PM', 1, 5]) The sorted result would be sortedX = (['0690', '07:25AM', '09:19AM', 1, 4], ['0201', '08:50AM', '10:50AM', 1, 4], ['1166', '04:35PM', '06:36PM', 1, 4], ['0845', '05:40PM', '07:44PM', 1, 4], ['1267', '07:05PM', '09:07PM', 1, 4], ['1513', '08:19PM', '10:21PM', 1, 4], ['1513', '08:19PM', '10:21PM', 1, 4], ['1290', '09:45PM', '11:43PM', 1, 4], ['1290', '09:45PM', '11:43PM', 1, 4], ['8772', '0159', '12:33PM', '02:43PM', 1, 5], ['2086', '2231', '04:10PM', '06:20PM', 1, 5], ['0888', '0570', '09:42PM', '12:20AM', 1, 5]) I tried the following: sortedX = sorted(x, key=lambda k : k[-4]) #k[-4] is the first time string and it works but it doesn't respect the sublist size ordering

    Read the article

  • Django: Staff Decorator

    - by Mark
    I'm trying to write a "staff only" decorator for Django, but I can't seem to get it to work: def staff_only(error='Only staff may view this page.'): def _dec(view_func): def _view(request, *args, **kwargs): u = request.user if u.is_authenticated() and u.is_staff: return view_func(request, *args, **kwargs) messages.error(request, error) return HttpResponseRedirect(request.META.get('HTTP_REFERER', reverse('home'))) _view.__name__ = view_func.__name__ _view.__dict__ = view_func.__dict__ _view.__doc__ = view_func.__doc__ return _view return _dec Trying to follow lead from here. I'm getting: 'WSGIRequest' object has no attribute '__name__' But if I take those 3 lines out, I just get a useless "Internal Server Error". What am I doing wrong here?

    Read the article

  • Is it possible to control Visual Studio exception handling from the debugged code itself?

    - by mark
    Dear ladies and sirs. I am wondering if it is possible to control the Visual Studio exception handling options from the code itself. For instance, I would like to turn off stopping on FCE for a certain piece of code, that generates many FCE, however, I would like it to be active for all the other code. Is it possible to do it from code? Something like this: visualStudio.DoNotStopOnFCE() try { // some code generating many FCE } catch {} visualStudio.StopOnFCE() Thanks.

    Read the article

  • Ability to Choose From Multiple SQLite DBs for Iphone Application

    - by Mark
    I am working on the design and implementation of an iPhone application ( a newbie, but I am getting the hang of it) where a person can download specific contact information about teachers based on their majors. The information is currently on different edu websites. And I have exported the information into SQLite databases. Is it possible to develop the application that when it is first initiated, it can give the user the option of which particular SQLite database they want for their application? Or if not, would it be better to merge all the DBs into one DB, and allow the user the option of downloading specific information from the SQLite db. I see that the db's can be downloaded into an app, but have yet to find a solution where there can be an option to download from different SQLite dbs. Thanks!

    Read the article

  • Radio buttons + array elements

    - by Mark
    I have a form that can be dynamically duplicated (with JS) so that the user can enter as much data as he wants. This works great for text inputs, because I just leave the name attribute the same (ending with a []) and then when the values are posted, it just returns me an array. Now I just realized that this doesn't work so well for radio buttons, because the names actually need to be unique for each set. But from the data standpoint, each set only returns one value, so retrieving the data from the POST data wouldn't be a problem, it just screws up the functionality of my form. There's no way around this, is there? I'm just screwed and I can't use arrays?

    Read the article

  • How do you preserve the viewstate while using strongly typed views in asp MVC 2?

    - by Mark Kadlec
    I have an ActionResult returning from a strongly typed view where I manually validate some conditions, pass in an error message, but would like to preserve the users responses. Since my View is strongly typed, I am calling it like this: return View("PrincipalInvestigatorForm", new SmartFormViewModel(sections, questions)); My problem though, is that the error message is displayed but all the users data is wiped. How do I preserve the "ViewState" in MVC? Is there an easy way?

    Read the article

  • Tool or library for end-users to run queries to select (not modify) data?

    - by Mark Rushakoff
    For a utility I'm working on, the client would like to be able to generate graphic reports on the data that has been collected. I can already generate a couple canned graphs (using ZedGraph, which is a very nice library); however, the utility would be much more flexible if the graphs were more programmable or configurable by the end-user. TLDR version I want users to be able to use something like SQL to safely extract and select data from a List of objects that I provide and can describe. What free tools or libraries will help me accomplish this? Full version I've given thought to using IronPython, IronRuby, and LuaInterface, but frankly they're all a bit overpowered for what I want to do. My classes are fairly simple, along the lines of: class Person: string Name; int HeightInCm; DateTime BirthDate; Weight[] WeighIns; class Weight: int WeightInKg; DateTime Date; Person Owner; (exact classes have been changed to protect the innocent). To come up with the data for the graph, the user will choose whether it's a bar graph, scatter plot, etc., and then to actually obtain the data, I would like to obtain some kind of List from the user simply entering something SQL-ish along the lines of SELECT Name, AVG(WeighIns) FROM People SELECT WeightInKg, Owner.HeightInCm FROM Weights And as a bonus, it would be nice if you could actually do operations as well: SELECT WeightInKg, (Date - Owner.BirthDate) AS Age FROM Weights The DSL doesn't have to be compliant SQL in any way; it doesn't even have to resemble SQL, but I can't think of a more efficient descriptive language for the task. I'm fine filling in blanks; I don't expect a library to do everything for me. What I would expect to exist (but haven't been able to find in any way, shape, or form) is something like Fluent NHibernate (which I am already using in the project) where I can declare a mapping, something like var personRequest = Request<Person>(); personRequest.Item("Name", (p => p.Name)); personRequest.Item("HeightInCm", (p => p.HeightInCm)); personRequest.Item("HeightInInches", (p => p.HeightInCm * CM_TO_INCHES)); // ... var weightRequest = Request<Weight>(); weightRequest.Item("Owner", (w => w.Owner), personRequest); // Indicate a chain to personRequest // ... var people = Table<Person>("People", GetPeopleFromDatabase()); var weights = Table<Weight>("Weights", GetWeightsFromDatabase()); // ... TryRunQuery(userInputQuery); LINQ is so close to what I want to do, but AFAIK there's no way to sandbox it. I don't want to expose any unnecessary functionality to the end user; meaning I don't want the user to be able to send in and process: from p in people select (p => { System.IO.File.Delete("C:\\something\\important"); return p.Name }) So does anyone know of any free .NET libraries that allow something like what I've described above? Or is there some way to sandbox LINQ? cs-script is close too, but it doesn't seem to offer sandboxing yet either. I'd be hesitant to expose the NHibernate interface either, as the user should have a read-only view of the data at this point in the usage. I'm using C# 3.5, and pure .NET solutions would be preferred. The bottom line is that I'm really trying to avoid writing my own parser for a subset of SQL that would only apply to this single project.

    Read the article

  • jquery focus on content editable without selecting everything

    - by Mark
    I have a contenteditable element that I want to focus, but only insofar as to place the cursor at the front of the element, rather selecting everything. elem.trigger('focus'); with jquery selects the entire element in chrome. How can I get it to behave the way I want, or is focus perhaps not what I'm looking for. Thanks

    Read the article

  • Best way to store a database password in a startup script / config file?

    - by Mark Harrison
    So our web server apps need to connect to the database, and some other apps have startup scripts that execute at boot time. What's the best way to store the name/password for these applications, in terms of security, e.g. perhaps we don't want sysadmins to know the database password maintainability, e.g. making the configuration easy to change when the password changes, etc. both windows and linux solutions appreciated!

    Read the article

  • Should filters write to the response during or after filtering?

    - by Mark
    I have a filter which processes generated HTML and rewrites certain elements. For example, it adds class attributes to some anchors. Finally, it writes the processed HTML to the response (a subclass of HttpServletResponseWrapper). Naturally, this means that the processed HTML is a different length after it has passed through the filter. I can see two ways of approaching this. One is to iterate over the HTML, using a StringBuilder to build up the processed HTML, and write the processed HTML to the response once all filtering is complete. The other is to iterate over the HTML but to write it to the response as soon as each element has been processed. Which is the better way for this operation, or is there another option which would be preferable? I am looking to minimise temporary memory usage primarily.

    Read the article

  • Rails find by *all* associated tags.id in

    - by mark
    Hi Say I have a model Taggable has_many tags, how may I find all taggables by their associated tag's taggable_id field? Taggable.find(:all, :joins => :tags, :conditions => {:tags => {:taggable_id => [1,2,3]}}) results in this: SELECT `taggables`.* FROM `taggables` INNER JOIN `tags` ON tags.taggable_id = taggables.id WHERE (`tag`.`taggable_id` IN (1,2,3)) The syntax is incredible but does not fit my needs in that the resulting sql returns any taggable that has any, some or all of the tags. How can I find taggables with related tags of field taggable_id valued 1, 2 and 3? Thanks for any advice. :)

    Read the article

  • FindControl() method throws ArithmeticException?

    - by Mark Struzinski
    I have a line of C# in my ASP.NET code behind that looks like this: DropDownList ddlStates = (DropDownList)fvAccountSummary.FindControl("ddlStates"); The DropDownList control is explicitly declared in the markup on the page, not dynamically created. It is inside of a FormView control. When my code hits this line, I am getting an ArithmeticException with the message "Value was either too large or too small for an Int32." This code has worked previously, and is in production right now. I fired up VS2008 to make some changes to the site, but before I changed anything, I got this exception from the page. Anyone seen this one before?

    Read the article

< Previous Page | 78 79 80 81 82 83 84 85 86 87 88 89  | Next Page >