Daily Archives

Articles indexed Friday April 2 2010

Page 18/105 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • MVVM/ViewModels and handling Authorization

    - by vdh_ant
    Hey guys Just wondering how how people handle Authorization when using MVVM and/or View Models. If I wasn't using VM's I would be passing back the Model and it would have a property which I could check if a user can edit a given object/property but when using MVVM I am disconnecting myself from the business object... and thus doen't know what the security should be any more. Is this a case where the mapper should be aware of the Authorization that is in place and don't copy across the data if the Authorization check fails. If this was the case I am guessing that the mapper would have to see some properties on the VM to let the interface know which fields are missing data because of the Authorization failure. If this does occur within the mapper, how does this fit in with things like AutoMapper, etc. Cheers Anthony

    Read the article

  • [C++] Real time plotting/data logging

    - by Paul
    I'm going to write a program that plots data from a sensor connected to the computer. The sensor value is going to be plotted as a function of the time (sensor value on the y-axis, time on the x-axis). I want to be able to add new values to the plot in real time. What would be best to do this with in C++? Edit: And by the way, the program will be running on a Linux machine

    Read the article

  • Is it possible to alter a marked field´s field function with Word 2007 VBA?

    - by Richard
    Hi, i want do the following: In Word 2007 place the Cursor on a field (or mark that field) and call a macro wich edit the field function of that field. (add some string). I´m even grateful for some tipps what term to google. I used the macro recorder and got following: WordBasic.FormatField Field:="CITATION Gro05 \p 9 \l 1031" Thats obvious creats a new field but where to go from here? To get the selected field i thought about something like this: If Selection.Type = WdFieldType Then ... I hope someone give me some hints :) Bye Richard

    Read the article

  • Running Maven Goals in CLI.

    - by Jeeyoung Kim
    Hello, I have a maven pom.xml file with multiple instances of a same goal defined (inside with different s). I'm wondering how I can run a specific goal via maven command line. I've tried mvn --help, but I couldn't find an entry regarding this.

    Read the article

  • ASP.NET MVC: ensure user always has a session variable set

    - by pcampbell
    Consider an ASP.NET MVC application that requires a session variable be set. It's used throughout the app. It'll be set by either reading a hashed value on the browser cookie, or after having the user login. In the WebForms + Master Page model, I'd check the Page_Load() of the master page. Perhaps not the ultimate event, but it was an easy one to find. How would you check and enforce the existance of a session variable in ASP.NET MVC? Consider that this question might not involve user login details, but some other piece of data (first visit time, perhaps).

    Read the article

  • "AttributeError: fileno" when attemping to import from pyevolve

    - by Corey Sunwold
    I just installed Pyevolve using easy_install and I am getting errors trying to run my first program. I first tried copy and pasting the source code of the first example but this is what I receive when I attempt to run it: Traceback (most recent call last): File "/home/corey/CTest/first_intro.py", line 3, in from pyevolve import G1DList File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/init.py", line 15, in File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/Consts.py", line 240, in import Selectors File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/Selectors.py", line 12, in File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/GPopulation.py", line 11, in File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/FunctionSlot.py", line 14, in File "/usr/lib/python2.6/site-packages/Pyevolve-0.5-py2.6.egg/pyevolve/Util.py", line 20, in AttributeError: fileno I am running python 2.6 on Fedora 11 X86_64.

    Read the article

  • How do you authenticate user generated "apps" for your app?

    - by Brian Armstrong
    I'm think something like Facebook apps here. User generated pieces of code that people can write to interact with my app. I understand how an authenticated API works, but this seems a little more complicated because not only does the APP have to authenticate itself (with a regular api-key) but the USER using the app has to be authenticated somehow too, without giving the app free reign. I've been reading a bit here to see how FB does it: http://wiki.developers.facebook.com/index.php/How_Facebook_Authenticates_Your_Application And it looks like you have to pass a signature in addition to the api-key along with every call, but I'm having trouble wrapping my head around how this gets generated and used on the other end (my server). Figure there must be a simple explanation of this out there? Thanks! P.S. I'm building a Rails app if there are any applicable gems/plugins.

    Read the article

  • Drawing line Continous.

    - by japs
    Hi All, How to draw line continuous in uiview? I have used below code and it works fine but after drawing line straght when i draw another line then first one gets clear if i do not clear that then they join each other. Please suggest some solution. (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); //for( Line *eachLine in lineArray ) // [eachLine drawInContext:context]; CGContextSetLineWidth(context, 2.0); CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor); CGContextSetFillColorWithColor(context, [UIColor redColor].CGColor); if (firstTouch.x != 0.0 && firstTouch.y != 0.0) { CGRect dotRect = CGRectMake(firstTouch.x - 3, firstTouch.y - 3.0, 5.0, 5.0); CGContextAddEllipseInRect(context, dotRect); CGContextDrawPath(context, kCGPathFillStroke); **CGContextMoveToPoint(context, firstTouch.x, firstTouch.y); for (NSString *onePointString in points) { CGPoint nextPoint = CGPointFromString(onePointString); CGContextAddLineToPoint(context, nextPoint.x, nextPoint.y); }** CGContextStrokePath(context); } else { CGContextSetFillColorWithColor(context, self.backgroundColor.CGColor); CGContextAddRect(context, self.bounds); CGContextFillPath(context); } }

    Read the article

  • Case Insensitive URLs with mod_rewrite

    - by Paul Tarjan
    I'd like for any url that doesn't hit an existing file, to do a lookup on the other possible cases and see if those files exist, and if so, 302 to them. If that's not possible, then I'm ok with these compromises: Only check the lowercase version Only check the first path portion For example http://example.com/CoOl/PaTH/CaMELcaSE should redirect to http://example.com/cool/path/camelCase (assuming the latter exists). but of course a full solution is much more useful to me and others

    Read the article

  • Project Euler considered harmful

    - by xxxxxxx
    Hi, I've done some Project Euler problems and I was able to solve them very fast because I already knew all the theory behind them. I learned that "accidentaly" because I also had to learn it for university. I used to also solve olympiad problems, I wasn't very good but I was solving some of the problems. I've reached the conclusion that Project Euler problems are taken out of their context(and olympiad problems as well). That's why they are hard. Mathematics and it's theory is taught in order to make the problems easy. However, Project Euler apparently makes an invitation at making them hard again. Why ? I honestly think this is a complete waste of time. Mathematicians had centuries at their disposal in order to solve math problems and they developed theories to explain properly why certain things happen. I think olympiad problems and Project Euler problems are really useless. What's your take on Project Euler ? Do you get something out of it or do you just find formulas on some websites and implement the code fast and then get the result and solve the problem ?

    Read the article

  • Which CSS editor can give nested formatting like this in one shot automatically?

    - by jitendra
    Which free (offline) CSS tool can give formatting like this in one shot automatically? using any keyboard shortcut of from any command of IDE example This (it can be any type of formatting) #proceed_form ol, #demo_form ol { list-style:none; margin:0; padding:0} #proceed_form ol li, #demo_form ol li { padding:2px 0; margin:0; line-height:normal; height:18px} #proceed_form ol li label, #demo_form ol li label { display:inline-block; width:195px;} into like this #proceed_form ol, #demo_form ol { list-style: none; margin: 0; padding: 0 } #proceed_form ol li, #demo_form ol li { padding: 2px 0; margin: 0; line-height: normal; height: 18px } #proceed_form ol li label, #demo_form ol li label { display: inline-block; width: 195px; } Can we achieve this type of formatting in Dreamweaver? or it not possible in dreamweaver then in any other tool?

    Read the article

  • Library to parse C/C++ source code

    - by John
    Which library should I use to parse C/C++ source code file? I need to parse source file, calculate how much useful strings inside, how much 'for' blocks, 'if' blocks, how much comments inside. I also may need to insert a comment or small piece of code after each 'for' block. Is there any libraries? May be any library included in Microsoft Visual Studio?

    Read the article

  • Modelbinding Failing VS2010 asp.net mvc2

    - by Rob Ellis
    The contactAddModel.Search always comes through as null - any ideas? View declaration <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<rs30UserWeb.Models.StatusIndexModel>" %> ViewModels public class StatusIndexModel { public ContactAddModel contactAddModel; public StatusMessageModel statusMessageModel; } public class ContactAddModel { [Required(ErrorMessage="Contact search string")] [DisplayName("Contact Search")] public string Search { get; set; } } View content <% using (Html.BeginForm("AddContact", "Status")) { %> <div> <fieldset> <legend>Add a new Contact</legend> <div class="editor-label"> <%= Html.LabelFor(m => m.contactAddModel.Search) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(m => m.contactAddModel.Search)%> <%= Html.ValidationMessageFor(m => m.contactAddModel.Search)%> </div> <p> <input type="submit" value="Add Contact" /> </p> </fieldset> </div> <% } %> Controller [HttpPost] public ActionResult AddContact(Models.ContactAddModel model) { if (u != null) { } else { ModelState.AddModelError("contactAddModel.Search", "User not found"); } return View("Index"); }

    Read the article

  • Squid authentication encryption

    - by barbarossa12d
    Hi, I use Squid and the users must authenticate. The users are authenticating in cleartext. I found tutorials about stunnel (http://www.jeffyestrumskas.com/?page_id=3), but the clients also need this software. Is there no possibility that for user authentication SSL (or some other encryption technology) can be used?. Thanks.

    Read the article

  • Remotely sync Time Machine drives

    - by Off Rhoden
    I have an Xserve that runs Time Machine to a local terabyte drive. I also connected my external terabyte drive for a time period and had Time Machine use it to establish the seed data. I plan to take my drive back home with me (out of state) and have the Xserve return to using its local drive for Time Machine. But when I get back home, is there a way to keep my external drive's copy of the Time Machine Backups folder in sync with the Backups folder back on the Xserve? I'm wanting a full copy of the history (makes an awesome remote backup). I've thought of using the unix command rsync. In fact, that's how I had been doing it but I was looking the compactness that Time Machine was able to achieve. Thanks.

    Read the article

  • Redirect user to dir upon SFTP connection.

    - by Gabriel A. Zorrilla
    Hi guys. I have an FTP user which i log in into the server via SFTP and a key file. Right, lovely, works like a charm. Now, by default the user logs to /home/ftp which is not cool. I'd like to know if there is a way to redirect just before the connection to a dir such as /var/www/site.com/public/files/ Mmm? :)

    Read the article

  • Installing Mercurial on Mac OS X 10.6 Snow Leopard

    - by Matthew Rankin
    Installing Mercurial on Mac OS X 10.6 Snow Leopard I installed Mercurial 1.3.1 on Mac OS X 10.6 Snow Leopard from source using the following: cd ~/src curl -O http://mercurial.selenic.com/release/mercurial-1.3.1.tar.gz tar xzvf mercurial-1.3.1.tar.gz cd mercurial-1.3.1 make ALL sudo make install This installs the site-packages files for Mercurial in /usr/local/lib/python2.6/site-packages/. I know that installing Mercurial from the Mac Disk Image will install the files into /Library/Python/2.6/site-packages/, which is the site-packages directory for the Mac OS X default Python install. I have Python 2.6.2+ installed as a Framework with its site-packages directory in: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages With Mercurial installed this way, I have to issue: PYTHONPATH=/usr/local/lib/python2.6/site-packages:"${PYTHONPATH}" in order to get Mercurial to work. Questions How can I install Mercurial from source with the site-packages in a different directory? Is there an advantage or disadvantage to having the site-packages in the current location? Would it be better in one of the Python site-package directories that already exist? Do I need to be concerned about virtualenv working correctly since I have modified PYTHONPATH (or any other conflicts for that matter)? Reasons for Installing from Source Dan Benjamin of Hivelogic provides the benefits of and instructions for installing Mercurial from source in his article Installing Mercurial on Snow Leopard.

    Read the article

  • How can I get a custom made set of checkboxes return values in the postback?

    - by AngryHacker
    I have the following in an aspx page: <td colspan="2"> <% DisplayParties(); %> </td> In the code behind for the aspx page, i have this (e.g. I build HTML for the checkboxes): public void DisplayParties() { var s = new StringBuilder(); s.Append("<input type=\"checkbox\" id=\"attorney\" value=\"12345\"/>"); s.Append("<input type=\"checkbox\" id=\"attorney\" value=\"67890\"/>"); s.Append("<input type=\"checkbox\" id=\"adjuster\" value=\"125\"/>"); Response.WriteLine(s.ToString()); } Not my proudest moment, but whatever. The problem is that when this page posts back via some event on the page, I never get these tags in the Request.Form collection. Is this simply how ASP.NET works (e.g. only server-side control post back) or am I missing something simple. My understanding was that a postback should bring back all the form variables.

    Read the article

  • find the total values get in a variable in php

    - by Hmwd
    hi, i am doing a shopping cart.i had a variable $total.when i add 1st product of price 200 i get $total=200 , when i add 2nd product of price 100 i get $total=200100 when i add 3rd product of price 400 i get $total=200100400 . i want to get $total=700. how to fix this problem? please help me........ thanks, Hmwd

    Read the article

  • Programmatically parse and edit C++ Source Files

    - by Kryten
    Hi, I want to able programmatically parse and edit C++ source files. I need to be able to change/add code in certain sections of code (i.e. in functions, class blocks, etc). I would also (preferably) be able to get comments as well. Part of what I want to do can be explained by the following piece of code: CPlusPlusSourceParser cp = new CPlusPlusSourceParser(“x.cpp”); // Create C++ Source Parser Object CPlusPlusSourceFunction[] funcs = cp.getFunctions(); // Get all the functions for (int i = 0; i &lt funcs.length; i++) { // Loop through all functions funcs[i].append(/* … code I want to append …*/); // Append some code to function } cp.save(); // Save new source cp.close(); // Close file How can I do that? I’d like to be able to do this preferably in Java, C++, Perl, Python or C#. However, I am open to other language API’s.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >