Daily Archives

Articles indexed Thursday March 25 2010

Page 15/127 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Persisting complex data between postbacks in ASP.NET MVC

    - by Robert Wagner
    I'm developing an ASP.NET MVC 2 application that connects to some services to do data retrieval and update. The services require that I provide the original entity along with the updated entity when updating data. This is so it can do change tracking and optimistic concurrency. The services cannot be changed. My problem is that I need to somehow store the original entity between postbacks. In WebForms, I would have used ViewState, but from what I have read, that is out for MVC. The original values do not have to be tamper proof as the services treat them as untrusted. The entities would be (max) 1k and it is an intranet app. The options I have come up are: Session - Ruled out - Store the entity in the Session, but I don't like this idea as there are no plans to share session between URL - Ruled out - Data is too big HiddenField - Store the serialized entity in a hidden field, perhaps with encryption/encoding HiddenVersion - The entities have a (SQL) version field on them, which I could put into a hidden field. Then on a save I get "original" entity from the services and compare the versions, doing my own optimistic concurrency. Cookies - Like 3 or 4, but using a cookie instead of a hidden field I'm leaning towards option 4, although 3 would be simpler. Are these valid options or am I going down the wrong track? Is there a better way of doing this?

    Read the article

  • Visual Studio - "attach to particular instance of the process" macro

    - by Steve
    I guess prety much everyone who does a lot of debugging have a handy macro in Visual Studio (with shortcut to it on a toolbar) which when called automatically attaches to a particular process (identified by name). it saves a lot of time rather than clicking "Debug" - "Attach to the process ...", but it only works if one is running a single instance of the process one wants to attach to. If theres is more than one instance of particular process in memory - the first one (with a smaller PID?) is being choose by debugger. Does anyone have a macro which shows a dialog (if more that 1 process with a specified name running) and lets developer to select to one he/she really wants to attach to. I guess the selection could be made based on a windwow caption text (which would be suffice in most of cases) and when the particular instance is selected macro passes the PID of the process to the Debugger object? If someone has that macro or knows how to write it - please share. Thanks.

    Read the article

  • Regex, encoding, and characters that look a like

    - by hack.augusto
    First, a brief example, let's say I have this "/[0-9]{2}°/" regex and this text "24º". The text won't match, obviusly ... (?) really, it depends on the character encoding. Here is my problem, I do not have control on which chars the user uses, so, I need to cover all possibilities in the regex /[0-9]{2}[°º]/, or even better, assure that the text has only the chars I'm expecting °. But I can't just remove the unknow chars otherwise the regex won't work, I need to change it to the chars that looks like it and I'm expecting. I have done this through a little function that maps the "look like" to "what I expect" and change it, the problem is, I have not covered all possibilities, for example, today I found a new "-", now we got three of them, just like latex =D - -- --- ,cool , but the regex didn't work. Does anyone knows how I might solve this?

    Read the article

  • How to get parameter values from an XmlNode in C#

    - by Brian
    How do I get the values for parameters in a XmlNode tag. For example: <weather time-layout="k-p24h-n7-1"> <name>Weather Type, Coverage, and Intensity</name> <weather-conditions weather-summary="Mostly Sunny"/> </weather> I want to get the value for the parameter 'weather-summary' in the node 'weather-conditions'.

    Read the article

  • ASP.NET MVC: routing help

    - by pcampbell
    Consider two methods on the controller CustomerController.cs: //URL to be http://mysite/Customer/ public ActionResult Index() { return View("ListCustomers"); } //URL to be http://mysite/Customer/8 public ActionResult View(int id) { return View("ViewCustomer"); } How would you setup your routes to accommodate this requirement? How would you use Html.ActionLink when creating a link to the View page?

    Read the article

  • Why index_merge is not used here?

    - by user198729
    Setup: mysql> create table t(a integer unsigned,b integer unsigned); mysql> insert into t(a,b) values (1,2),(1,3),(2,4); mysql> create index i_t_a on t(a); mysql> create index i_t_b on t(b); mysql> explain select * from t where a=1 or b=4; +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | t | ALL | i_t_a,i_t_b | NULL | NULL | NULL | 3 | Using where | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ Is there something I'm missing?

    Read the article

  • Emulating hyperlink functionality in datawindow text fields

    - by mortalitysequence
    The idea is rather simple. Some datawindow (not web datawindow) varchar fields contain detailed descriptions. I was wondering if it is possible to provide the following (wikipedia-like) functionality to users: The ability to click (or dbl-click or whatever) on specific words of the text, while reading (which somehow should be indicated as clickable - it would be perfect if they could be colored blue but I don't think this is possible) and open a relevant window (or response). Do you think something like this could be implemented?

    Read the article

  • Expected ')' before '*' token

    - by Danni
    So this is more of a syntax problem. I keep getting the error "Expected ')' before '*' token" on the line: #include "CDocumentObserver.h" #include "CViewPlayerDlg.h" /* * Class: CViewPlayer * */ class CViewPlayer : public wxWindow, public CDocumentObserver { public: CViewPlayer(CViewPlayerDlg *dlg); //here in CViewPLayer.h. The .cpp constructor looks like: #include "CViewPlayer.h" #include "wx/prec.h" #include "CViewPlayerDlg.h" using namespace std; BEGIN_EVENT_TABLE(CViewPlayer, wxWindow) EVT_PAINT(CViewPlayer::OnPaint) END_EVENT_TABLE() CViewPlayer::CViewPlayer(CViewPlayerDlg *dlg) : wxWindow(dlg, wxID_ANY, wxDefaultPosition, wxSize(dlg->GetDocument()->GetSize()), wxBORDER_SUNKEN), CDocumentObserver(dlg->GetDocument()), mStartTime(0), mPlayTime(0), mPlaying(false) { SetBackgroundColour(wxColour(128, 128, 128)); SetClientSize(GetDocument()->GetSize()); } What causes this error? I thought it was that something was wrong in the constructor of the .cpp but I have no idea. Dianna

    Read the article

  • How to bulk insert from CSV when some fields have new line character?

    - by z-boss
    I have a CSV dump from another DB that looks like this (id, name, notes): 1001,John Smith,15 Main Street 1002,Jane Smith,"2010 Rockliffe Dr. Pleasantville, IL USA" 1003,Bill Karr,2820 West Ave. The last field may contain carriage returns and commas, in which case it is surrounded by double quotes. I use this code to import CSV into my table: BULK INSERT CSVTest FROM 'c:\csvfile.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) SQL Server 2005 bulk insert cannot figure out that carriage returns inside quotes are not row terminators. How to overcome?

    Read the article

  • Best Java 'framework' for LOW-END 3D Graphics?

    - by CodeJustin.com
    I've made my share of 2D games on various platforms but I have never developed a 3D game. I want to make a small "mmorpg". I already made my server in python and it works just fine with my flash 2D game but I decided I want to step it up and try out 3D. I want to make a 3D game for the web browser and I think Java might be a good choice for this. So basically I'm just looking for a straight forward and well documents 'framework' to make LOW-END 3D games. Keep in mind that I will be targeting peoples with very low-end PC's (plus my 3d modeling skills aren't great so I wouldn't mind hiding it somewhat, haha)

    Read the article

  • Weird result with apache vs lighttpd in reverse proxy.

    - by northox
    I have an Apache server running in reverse proxy mode in front of a Tomcat java server. It handle HTTP and HTTPS and send those request back and forth to the Tomcat server on an internal HTTP port. I'm trying to replace the reverse proxy with Lighttpd. Here's the problem: while asking for the same HTTPS url, while using Apache as the reverse proxy, the Tomcat server redirect (302) to an HTTPS page but with Lighttpd it redirect to the same page in HTTP (not HTTPS). What does Lighttpd could do different in order to have a different result from the backend server? In theory, using Apache or Lighttpd server as a reverse proxy should not change anything... but it does. Any idea? I'll try to find something by sniffing the traffic on the backend tomcat server.

    Read the article

  • Google Wave Robots API v2

    Google Wave Robots API v2 Pamela Fox describes how Wave Robots works, and new features in Robots API v2. From: GoogleDevelopers Views: 2 0 ratings Time: 17:28 More in Science & Technology

    Read the article

  • How to limit access to Exchange 2003 Mobile Activesync server by user?

    - by micilin
    So I was asked to set up an Exchange Activesync mobile gateway. That's done. It's a separat eExchange 2003 front-end server configured for SSL, and I've put an off-domain ISA server in front of it. Now I'm being asked to limit which users can connect to it. By default an Exchange front-end server allows any user who has a mail account to connect to the front -end server. So I'm looking at the permissions on the various IIS sites/apps on the server, but I know that it's easy to break Exchange Front-end server perms. So I've got the following in IIS: Exadmin Exchange EchWeb Microsoft-SErver-ActiveSync MobileAdmin OMA And a couple of others that I dont think are relevant. Can I change the permissions on one of these to restrict who can connect to Activesync? As a bonus: Can I do it in a way that does not affect ordinary browser based Exchange Access? Thanks in Advance!!

    Read the article

  • SQL Server 2005 database design - many-to-many relationships with hierarchy

    - by Remnant
    Note I have completely re-written my original post to better explain the issue I am trying to understand. I have tried to generalise the problem as much as possible. Also, my thanks to the original people who responded. Hopefully this post makes things a little clearer. Context In short, I am struggling to understand the best way to design a small scale database to handle (what I perceive to be) multiple many-to-many relationships. Imagine the following scenario for a company organisational structure: Textile Division Marketing Division | | ---------------------- ---------------------- | | | | HR Dept Finance Dept HR Dept Finance Dept | | | | ---------- ---------- ---------- --------- | | | | | | | | Payroll Hiring Audit Tax Payroll Hiring Audit Accounts | | | | | | | | Emps Emps Emps Emps Emps Emps Emps Emps NB: Emps denotes a list of employess that work in that area When I first started with this issue I made four separate tables: Divisions - Textile, Marketing (PK = DivisionID) Departments - HR, Finance (PK = DeptID) Functions - Payroll, Hiring, Audit, Tax, Accounts (PK = FunctionID) Employees - List of all Employees (PK = EmployeeID) The problem as I see it is that there are multiple many-to-many relationships i.e. many departments have many divisions and many functions have many departments. Question Giving the database structure above, suppose I wanted to do the following: Get all employees who work in the Payroll function of the Marketing Division To do this I need to be able to differentiate between the two Payroll departments but I am not sure how this can be done? I understand that I could build a 'Link / Junction' table between Departments and Functions so that I can retrieve which Functions are in which Departments. However, I would still need to differentiate the Division they belong to. Research Effort As you can see I am an abecedarian when it comes to database deisgn. I have spent the last two days resaerching this issue, traversing nested set models, adjacency models, reading that this issue is known not to be NP complete etc. I am sure there is a simple solution?

    Read the article

  • Java Date exception handling try catch

    - by user69514
    Is there some sort of exception in Java to catch an invalid Date object? I'm trying to use it in the following method, but I don't know what type of exception to look for. Is it a ParseException. public boolean setDate(Date date) { this.date = date; return true; }

    Read the article

  • Lua - Iterate Through Table With nil Values

    - by Tony Trozzo
    My lua function receives a table that is of the array form: { field1, field2, nil, field3, } No keys, only values. I'm trying to convert this to a pseudo CSV form by grabbing all the fields and concatenating them into a string. Here is my function: function ArenaRewind:ConvertToCSV(tableName) csvRecord = "\n" for i,v in pairs(tableName) do if v == nil then v = "nil" end csvRecord = csvRecord .. "\"" .. v .. "\"" if i ~= #tableName then csvRecord = csvRecord .. "," end end return csvRecord end Not the prettiest code by any means, but it seems to iterate through them and grab all the non-nil values. The other table iteration function is ipairs() which stops as soon as it hits a nil value. Is there any easy way to grab all of these fields including the nil values? The tables are various sizes, so I hope to refrain from accessing each part like an array [i.e., tableName[1] through tableName[4]) and just grabbing the nil values that way. Thanks in advance.

    Read the article

  • How read value from XmlNode

    - by klerik123456
    I have a Xml file and I try to read value from node Ticket, but my output is still empty. Can somebody help me ? Xml docmunet : <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Header> <TicketHeader xmlns="http://tempuri.org/"> <Ticket> heslo </Ticket> </TicketHeader> </soap:Header> <soap:Body> <test xmlns="http://tempuri.org/"/> </soap:Body> </soap:Envelope> My code : doc= new XmlDocument(); doc.Load(path); XmlNode temp = doc.SelectSingleNode("//Ticket"); textBox3.Text=temp.InnerXml;

    Read the article

  • Can I avoid explicit 'self'?

    - by bguiz
    I am fairly new to Python and trying to pick it up, so please forgive if this question has a very obvious answer! I have been learning Python by following some pygame tutorials. Therein I found extensive use of the keyword self, and coming from a primarily Java background, I find that I keep forgetting to type self. For example, instead of self.rect.centerx I would type rect.centerx, because, to me, rect is already a member variable of the class. The Java parallel I can think of for this situation is having to prefix all references to member variables with this. Am I stuck prefixing all member variables with self, or is there a way to declare them that would allow me to avoid having to do so? Even if what I am suggesting isn't "pythonic", I'd still like to know if it is possible. I have taken a look at these related SO questions, but they don't quite answer what I am after: Python - why use “self” in a class? Why do you need explicitly have the “self” argument into a Python method?

    Read the article

  • Prototypes Object.extend with multiple objects that contain there own functions.

    - by erickreutz
    How would I achieve something along the lines of this.. var Persistence = new Lawnchair('name'); Object.extend(Lawnchair.prototype, { UserDefaults: { setup: function(callback) { // "save" is a native Lawnchair function that doesnt //work because // "this" does not reference "Lawnchair" // but if I am one level up it does. Say if I defined // a function called UserDefaults_setup() it would work // but UserDefaults.setup does not work. this.save({key: 'key', value: 'value'}); // What is this functions scope? // How do I access Lawnchairs "this" } }, Schedule: { refresh: function(callback) { } } }); //this get called but doesnt work. Persistence.UserDefaults.setup();

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >