Search Results

Search found 2581 results on 104 pages for 'mike gifford'.

Page 80/104 | < Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >

  • Update database using restful ASP.NET MVC 1.0

    - by Mike
    We are building an MVC 1.0 application right now and using Linq - SQL for our DAL. Following the restful approach we have multiple action events depending on if you are updating or loading or what not. The two that I'm concerned with at this point are the edit and update action methods. Here is the signatures. public ActionResult Update(int customerId, int Id, AggregateModel viewModel) public ActionResult Edit(int customerId, int Id, AggregateModel viewModel) So the idea is that in the Edit method we load up our viewModel and pass it to the view. The user makes changes to the model and then posts back to the Update method. The first thing I could think of to do would be to get the viewModel from the database again, copy the changes in one by one from the posted back model and then submit it back. This would work but does seem clunky to me. What is the best way to insert those changes into the database at this point?

    Read the article

  • php and XML range into array

    - by Mike
    The code below helps be to get the WHOLE XML and put it into an array. What I'm wondering is, what would be a good way to get the XML only from item 3 - 6 or any arbitrary range instead of the whole document. $mt_arr = array(); $d = new DOMDocument(); $d->load('http://news.google.com/?output=rss'); foreach ($d->getElementsByTagName('item') as $t) { $list = array ( 'title' => $t->getElementsByTagName('title')->item(0)->nodeValue); array_push($mt_arr, $list); } Thanks

    Read the article

  • Transforming a TXT file in a list, getting wrong

    - by Mike
    I have a txt plain file that has a list of numbers. One number per line, like: 978-972-722-649-8 978-972-722-646-7 978-972-722-627-6 978-972-722-625-2 978-972-722-594-1 etc. This list is on a file called file.txt, was created and saved on TextEdit using Western (ISO Latin 1) encoding. Now I am trying to use Applescript to read this file and transform it on a list. I have this script set myDirectory to path to desktop folder as string set myFile to myDirectory & "file.txt" try set open_file to ¬ open for access file myFile without write permission set myList to read open_file using delimiter return close access open_file on error try close access file open_file end try end try after running this script, myList contains just ONE item and this item is "97" (I suppose that is the first two numbers of the first entry). What is going on? Thanks.

    Read the article

  • Simple Thread Programming

    - by mike
    I have started to play with threads in c#, but need now help, here is my code: public partial class Form1 : Form { public Form1() { InitializeComponent(); DoCount(); } public void DoCount() { for (int i = 0; i < 100; i++) { objTextBox.Text = i.ToString(); Thread.Sleep(100); } } } its a simple win forms with a textbox, i want to see the "counting", but as you see in my code, the textbox shows me 99, it count till 99 and then shows up.. i`ll think, i have to manage this in a new thread but dont know how!

    Read the article

  • Quick to develop web app in Java

    - by Mike Q
    Hi all, I need to develop a basic web app very quickly (1 week) for a demo. My requirements are Java (I need to make use of existing Java libraries to access the relevant data) 2 screens One for static data view, maybe some search parameters Other for basic form entry No fancy AJAX required Ideally easy for a web designer to come in and tart it up as necessary, without having to rewrite everything My first stop was going to be to checkout Wicket as I've heard good things about it. I don't have the time right now to dive into anything heavy, which probably writes off JSF in my mind (I played with JSF1, steep learning curve which I've now slid back down). I'm happy to treat the result as throwaway so if there's a framework which starts of well but then doesn't scale up to bigger projects, that would be ok. Any suggestions appreciated on frameworks/approach.

    Read the article

  • Touchpad access in Linux

    - by Mike Hordecki
    Hi! The problem is: How to access x,y,z coordinates of my touchpad? Now that SHMConfig is disabled by default, I've found out that, in order to do it, I need to access a file from /dev/input/. Those files are, sadly, readable by root only. Is there any way to access the touchpad while in user-mode?

    Read the article

  • How to speed up a slow UPDATE query

    - by Mike Christensen
    I have the following UPDATE query: UPDATE Indexer.Pages SET LastError=NULL where LastError is not null; Right now, this query takes about 93 minutes to complete. I'd like to find ways to make this a bit faster. The Indexer.Pages table has around 506,000 rows, and about 490,000 of them contain a value for LastError, so I doubt I can take advantage of any indexes here. The table (when uncompressed) has about 46 gigs of data in it, however the majority of that data is in a text field called html. I believe simply loading and unloading that many pages is causing the slowdown. One idea would be to make a new table with just the Id and the html field, and keep Indexer.Pages as small as possible. However, testing this theory would be a decent amount of work since I actually don't have the hard disk space to create a copy of the table. I'd have to copy it over to another machine, drop the table, then copy the data back which would probably take all evening. Ideas? I'm using Postgres 9.0.0. UPDATE: Here's the schema: CREATE TABLE indexer.pages ( id uuid NOT NULL, url character varying(1024) NOT NULL, firstcrawled timestamp with time zone NOT NULL, lastcrawled timestamp with time zone NOT NULL, recipeid uuid, html text NOT NULL, lasterror character varying(1024), missingings smallint, CONSTRAINT pages_pkey PRIMARY KEY (id ), CONSTRAINT indexer_pages_uniqueurl UNIQUE (url ) ); I also have two indexes: CREATE INDEX idx_indexer_pages_missingings ON indexer.pages USING btree (missingings ) WHERE missingings > 0; and CREATE INDEX idx_indexer_pages_null ON indexer.pages USING btree (recipeid ) WHERE NULL::boolean; There are no triggers on this table, and there is one other table that has a FK constraint on Pages.PageId.

    Read the article

  • How can I determine the "correct" number of steps in a questionnaire where branching is used?

    - by Mike Kingscott
    I have a potential maths / formula / algorithm question which I would like help on. I've written a questionnaire application in ASP.Net that takes people through a series of pages. I've introduced conditional processing, or branching, so that some pages can be skipped dependent on an answer, e.g. if you're over a certain age, you will skip the page that has Teen Music Choice and go straight to the Golden Oldies page. I wish to display how far along the questionnaire someone is (as a percentage). Let's say I have 10 pages to go through and my first answer takes me straight to page 9. Technically, I'm now 90% of the way through the questionnaire, but the user can think of themselves as being on page 2 of 3: the start page (with the branching question), page 9, then the end page (page 10). How can I show that I'm on 66% and not 90% when I'm on page 9 of 10? For further information, each Page can have a number of questions on that can have one or more conditions on them that will send the user to another page. By default, the next page will be the next one in the collection, but that can be over-ridden (e.g. entire sets of pages can be skipped). Any thoughts? :-s

    Read the article

  • Checkbox not checking inside div in Firefox

    - by mike
    Weird problem. I don't know if anyone can shed some light on this? I have a checkbox inside a div. It works fine in IE but not Firefox. I have to click the space around the checkbox that is occupied by the div (sort of like a label) for the checkbox to tick on and off. Directly clicking the checkbox does not show it as ticked on or off, even though in firebug it is showing that it is in a checked state and an unchecked state. Only in FF does this happen.....

    Read the article

  • How do I style just the thumbnail image in this post?

    - by Mike Johnston
    I need help with some CSS styling. I've tried various options with Firebug and cannot sort this out. How can I style the thumbnails on my posts (eg url: http://thatcriticguy.com/index.php?post/4/crossover-9-revamped-reinvented-and-a-must-have) and not style all images in the post at the same time. I have numerous posts on this site and need to only style the ones that are thumbnails that float right. Is there a way to do this without modifying the template code just using CSS?

    Read the article

  • How to "grep" out specific lline ranges of a file

    - by Mike
    There are often times I'll grep -l whatev file to find what I'm looking for. Say the output is 1234: whatev 1 5555: whatev 2 6643: whatev 3 If I want to then just extract the lines between 1234 and 5555, is there a tool to do that? For static files I have a script that does wc -l of the file and then does the math to split it out with tail & head but that doesn't work out so well with log files that are constantly being written to.

    Read the article

  • How to save a complete webpage using the built-in webbrowser in c#

    - by Mike
    Overall I am trying to write out a webpage to PDF. There is a web service that I can use to convert a file to pdf. So what I am trying to do is save out a webpage from the WebBrowser winforms control. I have already tried writing it out the document stream but that just gives me the html of the page and not the images that are used with it. Another way that I looked into, but have not been successful with, is trying to create an image of the WebBrowser document. I found some examples on the web that utilize the DrawToBitmap function but none of them have worked for me. Any assistance would be grateful.

    Read the article

  • How can I run a batch file silently?

    - by Mike Pateras
    I have a batch file with some commands that I need to run with my installer, but I'd rather a console not appear (in Windows). I'm executing the batch file from a WiX installer, via a custom action. I tried adding an @ECHO OFF to the top of the file, but that didn't seem to do anything. Is there a way that I can run this batch file silently?

    Read the article

  • How do I calculate the average direction of two vectors

    - by Mike Broughton
    Hi, I am writing and opengl based iphone app and would like to allow a user to translate around a view based on the direction that they move two fingers on the screen. For one finger I know I could just calculate the vector from the start position to the current position of the users finger and then find the unit vector of this to get just the direction, but I don't know how I would do this for two fingers, I don't think adding the components of the vectors and calculating the average would work so I'm pretty much stuck... thanks in advance

    Read the article

  • C++ function will not return

    - by Mike
    I have a function that I am calling that runs all the way up to where it should return but doesn't return. If I cout something for debugging at the very end of the function, it gets displayed but the function does not return. fetchData is the function I am referring to. It gets called by outputFile. cout displays "done here" but not "data fetched" I know this code is messy but can anyone help me figure this out? Thanks //Given an inode return all data of i_block data char* fetchData(iNode tempInode){ char* data; data = new char[tempInode.i_size]; this->currentInodeSize = tempInode.i_size; //Loop through blocks to retrieve data vector<unsigned int> i_blocks; i_blocks.reserve(tempInode.i_blocks); this->currentDataPosition = 0; cout << "currentDataPosition set to 0" << std::endl; cout << "i_blocks:" << tempInode.i_blocks << std::endl; int i = 0; for(i = 0; i < 12; i++){ if(tempInode.i_block[i] == 0) break; i_blocks.push_back(tempInode.i_block[i]); } appendIndirectData(tempInode.i_block[12], &i_blocks); appendDoubleIndirectData(tempInode.i_block[13], &i_blocks); appendTripleIndirectData(tempInode.i_block[14], &i_blocks); //Loop through all the block addresses to get the actual data for(i=0; i < i_blocks.size(); i++){ appendData(i_blocks[i], data); } cout << "done here" << std::endl; return data; } void appendData(int block, char* data){ char* tempBuffer; tempBuffer = new char[this->blockSize]; ifstream file (this->filename, std::ios::binary); int entryLocation = block*this->blockSize; file.seekg (entryLocation, ios::beg); file.read(tempBuffer, this->blockSize); //Append this block to data for(int i=0; i < this->blockSize; i++){ data[this->currentDataPosition] = tempBuffer[i]; this->currentDataPosition++; } data[this->currentDataPosition] = '\0'; } void outputFile(iNode file, string filename){ char* data; cout << "File Transfer Started" << std::endl; data = this->fetchData(file); cout << "data fetched" << std::endl; char *outputFile = (char*)filename.c_str(); ofstream myfile; myfile.open (outputFile,ios::out|ios::binary); int i = 0; for(i=0; i < file.i_size; i++){ myfile << data[i]; } myfile.close(); cout << "File Transfer Completed" << std::endl; return; }

    Read the article

  • phpDocumentor to wiki?

    - by Mike
    My company is working on end user/developer docs using mediawiki. I'd like to take a lot of the API docs that phpdoc spit out (for specific functions/methods) and have it in wiki markup for easy transfer. Any solutions out there for getting wiki markup or wiki output from phpDoc? I've looked around and found nothing.

    Read the article

  • jquery get selected dropdownlist text

    - by mike
    Hi How can i get the selected text on a dropdowm, ive seen examples of how to do eg $('select option:selected').text() but looking at my code below, how can i modify it to work as the line alert($(this).parent().text()); gets all the list items as opposed to selected text $(document).ready(function () { $('.mutuallyexclusive').live("click", function () { checkedState = $(this).attr('checked'); $('.mutuallyexclusive:checked').each(function () { $(this).attr('checked', false); }); $(this).attr('checked', checkedState); alert($(this).parent().text()); }); });

    Read the article

  • How do I parse this JSON with jQuery?

    - by Mike
    So I had this structure in xml and I was able to parse it successfully. Now what I have done is that I converted this xml into a JSON using www.xmltojson.org but I am not able to parse it . I am setting these files locally on we localhost web server: <script> $(function() { $.ajax({ url:'feed.json', dataType:'json', type:'GET', success:function(json) { /// what to do here }. error: { alert("Parse Failed"); } }); }); </script> I am trying to learn JSON, so I am little unsure as to where I am doing wrong, or even if that is the correct approah. Thanks Mikey.

    Read the article

  • iPhone Accelerometer Values

    - by Mike
    My question is about the iPhone accelerometer. Does the accelerometer measure acceleration or movement of the iPhone? What I mean is if I hold the iPhone and go from 0mph to 60mph, I would expect the measure of acceleration to increase in value from 0 to 60, but once I reach 60, I expect the value to return to 0 since I am "no longer accelerating" but am moving at a constant speed. Now if the accelerometer measure motion, I would expect it to register 0 to 60 and continue to provide a change in value as I move forward at 60mph. Sorry, I looked at a few books, programmed some code (values seemed to small to give a recognizable result over short distances or speeds), and a lot of web searches, and I am trying to get an answer to this question. Thanx!

    Read the article

  • java nested for() loop throws ArrayIndexOutOfBoundsException

    - by Mike
    I'm working through a JPanel exercise in a Java book. I'm tasked with creating a 5x4 grid using GridLayout. When I loop through the container to add panels and buttons, the first add() throws the OOB exception. What am I doing wrong? package mineField; import java.awt.*; import javax.swing.*; @SuppressWarnings("serial") public class MineField extends JFrame { private final int WIDTH = 250; private final int HEIGHT = 120; private final int MAX_ROWS = 5; private final int MAX_COLUMNS = 4; public MineField() { super("Minefield"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container mineFieldGrid = getContentPane(); mineFieldGrid.setLayout(new GridLayout(MAX_ROWS, MAX_COLUMNS)); // loop through arrays, add panels, then add buttons to panels. for (int i = 0; i < MAX_ROWS; i++) { JPanel[] rows = new JPanel[i]; mineFieldGrid.add(rows[i], rows[i].getName()); rows[i].setBackground(Color.blue); for (int j = 0; j < MAX_COLUMNS; j++) { JButton[] buttons = new JButton[i]; rows[i].add(buttons[j], buttons[j].getName()); } } mineFieldGrid.setSize(WIDTH, HEIGHT); mineFieldGrid.setVisible(true); } public int setRandomBomb(Container con) { int bombID; bombID = (int) (Math.random() * con.getComponentCount()); return bombID; } /** * @param args */ public static void main(String[] args) { //int randomBomb; //JButton bombLocation; MineField minePanel = new MineField(); //minePanel[randomBomb] = minePanel.setRandomBomb(minePanel); } } I'm sure I'm over-engineering a simple nested for loop. Since I'm new to Java, please be kind. I'm sure I'll return the favor some day.

    Read the article

  • C++ split string

    - by Mike
    I am trying to split a string using spaces as a delimiter. I would like to store each token in an array or vector. I have tried. string tempInput; cin >> tempInput; string input[5]; stringstream ss(tempInput); // Insert the string into a stream int i=0; while (ss >> tempInput){ input[i] = tempInput; i++; } The problem is that if i input "this is a test", the array only seems to store input[0] = "this". It does not contain values for input[2] through input[4]. I have also tried using a vector but with the same result.

    Read the article

  • Django limit access by group only

    - by Mike
    I only you can limit what a user can do via the user permissions in admin.. But is there a way to limit them in admin via what group you add them to? I want to allow a certain group to do everything in that model if they belong to a certain group thanks!

    Read the article

  • Need some help understanding a weird C behavior

    - by mike
    This part of my code works fine: #include <stdio.h> int main(){ //char somestring[3] = "abc"; int i, j; int count = 5; for((i=0) && (j=0); count > 0; i++ && j++){ printf("i = %d and j = %d\n", i, j); count--; } return 0; } The output as expected: i : 0 and j : 0 i : 1 and j : 1 i : 2 and j : 2 i : 3 and j : 3 i : 4 and j : 4 Things get weird when I uncomment the char string declaration on the first line of the function body. #include <stdio.h> int main(){ char somestring[3] = "abc"; ... } The output: i : 0 and j : 4195392 i : 1 and j : 4195393 i : 2 and j : 4195394 i : 3 and j : 4195395 i : 4 and j : 4195396 What's the logic behind this? I'm using gcc 4.4.1 on Ubuntu 9.10.

    Read the article

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