Search Results

Search found 2579 results on 104 pages for 'mike krejci'.

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 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

  • 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 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

  • related categories - database design

    - by mike
    Hello! I'm looking for a little database design advice... I have a spreadsheet with a few columns in it. Column 1 being a list of categories and the rest being related categories(to the category in column 1). I'm trying to figure out what the best way to setup the tables would be... My thought so far is to have a table that just lists the categories then have a table with 2 columns that holds the id of the category and the id of a related category.... Would this be the best way to do this? Any better ideas?

    Read the article

  • What is the standard way of using a sitemap with pages that require specific information passed to t

    - by Mike
    Hi, I have a website for which many pages rely on information passed to them (usually in the form of a querystring) or on a session variable. When making a web application, how do you normally handle these particular pages in regards to the sitemap? If you're using the standard ASP.NET menu control, it will render the node on the menu and if you click it, you could get an exception stating that a session variable doesn't exist (if it hasn't been created yet). For example, if you're making a user management area: All of these nodes get rendered, but I don't want the user to click on edit user or delete user without specifying someone to edit or delete. Any tips or suggestions would be greatly appreciated.

    Read the article

  • resource embedding in asp.net

    - by Mike
    I have a project which needs to generate PDF documents. I am using iTextSharp. I have a pdf which needs to be read and then appended to. To read the pdf document, I'm using PdfReader(), which accepts many forms, but I can't figure out how to reference a pdf in my webapplication to PdfReader. My host does not allow Binary Serialization (apparently that's bad), so I don't think I can load from an embedded resource. I've tried just using PdfReader("report.pdf"), but it keeps throwing an exception telling me that the file isn't found. I've tried putting the file in the bin directory, root directory, in the same directory as the class, but this still doesn't work. It works if I use a fully qualified path to the pdf document, but I can't use that when I upload it to my hosting provider. Does anyone have any suggestions on how I should do this? Thanks

    Read the article

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