Search Results

Search found 2396 results on 96 pages for 'alex zylman'.

Page 63/96 | < Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >

  • Branching logic in an MVC view

    - by Alex Kilpatrick
    I find myself writing a lot of code in my views that looks like the code below. In this case, I want to add some explanatory HTML for a novice, and different HTML for an expert user. <% if (ViewData["novice"] != null ) { % some extra HTML for a novice <% } else { % some HTML for an expert <% } % This is presentation logic, so it makes sense that it is in a view vs the controller. However, it gets ugly really fast, especially when ReSharper wants to move all the braces around to make it even uglier (is there a way to turn that off for views?). My question is whether this is proper, or should I branch in the controller to two separate views? If I do two views, I will have a lot of duplicated HTML to maintain. Or should I do two separate views with a shared partial view of the stuff that is in common?

    Read the article

  • formation an external hard disk

    - by Alex
    I am trying to format an external hard disk to FAT32 (i need it to wrok with some hardware that expects it to be in fat32). When i am trying to format it vie windows the only option I'm getting is to format it to NTFS. Another strange thing is that when i am trying to format one of my own partitions (on the hard disk that is running the OS) i can do it only in NTFS while another partition my OS can format in both NTFS and FAT32. What can cause such a bihavior and how can I format the external hard dist to FAT32?

    Read the article

  • How to let the matcher to match the second invocation on mock?

    - by Alex Luya
    I have an interface like this public interface EventBus{ public void fireEvent(GwtEvent<?> event); } and test code(testng method) looks like this: @Test public void testFireEvent(){ EventBus mock=mock(EventBus.class); //when both Event1 and Event2 are subclasses of GwtEvent<?> mock.fireEvent(new Event1()); mock.fireEvent(new Event2()); //then verify(mock).fireEvent(argThat(new Event2Matcher())); } Event2Matcher looks like this: private class Event2Matcher extends ArgumentMatcher<Event2> { @Override public boolean matches(Object arg) { return ((Event2) arg).getSth==sth; } } But get an error indicating that: Event1 can't be cast to Event2 And obviously,the matcher matched the first invoking mock.fireEvent(new Event1()); So,the statement within matcher return ((Event2) arg).getSth==sth; Will throw out this exception.So the question is how to let verify(mock).fireEvent(argThat(new Event2Matcher())); to match the second invoking?

    Read the article

  • How to discard time intervals with Time Series / XYPlots using JFreeChart?

    - by Alex Arnon
    Hi All, I am building a set of chart displays, one of which is for a month display of daily trading - that is, one point of data per day (closing). Since there is no trade during weekends and holidays, I need to discard these data points. Not only that, but data points should still appear adjacent to each other, regardless of any gaps in time. This can be seen in any such chart e.g. in the 3 month graph for Nasdaq on Yahoo Finance - see how weekends are skipped. My question is: how should one correctly implement this in JFreeChart? Thanks in advance!

    Read the article

  • Find Rank in Microsoft Report

    - by Alex Essilfie
    Is there any way I can find the rank of a set of values in Microsoft Reports? For instance, in order to produce a table like the one below, what function/formula do I enter in the Rank column? +------+-----+ |Value | Rank| +------+-----+ | 12 | 3 | | 30 | 5 | | 5 | 1 | | 10 | 2 | | 24 | 4 | +------+-----+ Update Values in the value column are produced from calculations on the report-side so I cannot find the rank using a query.

    Read the article

  • Best option for Google App Engine Datastore and external database?

    - by Alex
    I need to get an App Engine app talking to and sharing data with an external database, The best option i can come up with is outputting the external database data to an xml file and then processing this in my app engine app and storing it inside the datastore, although the data being shared is sensitive data such as login details so outputting this to an xml file is not exactly a great idea, is it possible for the app engine app to directly query the database? or is there a secure option for using xml files? oh and im using python/django and the external database will be hosted on another domain

    Read the article

  • Storing object as a column in LINQ

    - by Alex
    Hello, i have some class which constructs itself from string, like this: CurrencyVector v = new CurrencyVector("10 WMR / 20 WMZ"); it's actually a class which holds multiple currency values, but it does not matter much. I need to change type of column in my LINQ table (in vs 2010 designer) from String to that class, CurrencyVector. If i do it - i get runtime error when LINQ runtime tries to cast String as CurrencyVector (when populating the table from database). Adding IConvertible did not help. I wrapped these columns in properties, but it's ugly and slow solution. Searching internet gave no results.

    Read the article

  • Why is String final in Java?

    - by Alex
    From when I learned that the class java.lang.String is declared as final in Java, I was wondering why is that? I didn't find any answer back then, but this post: How to create a replica of String class in Java? reminded me of my query. Sure, String provides all the functionality I ever needed, and never thought of any operation that would require an extension of class String, but still you'll never know what someone might need! So, does anyone know what was the intent of the designers when they decided to make it final? See also: Why is String a sealed class in C#?

    Read the article

  • Setting minOccurs="0" (not required) on web service parameters of type int

    - by Alex Angas
    I have an ASP.NET 2.0 web method with the following signature: [WebMethod] public QueryResult[] GetListData( string url, string list, string query, int noOfItems, string titleField) I'm running the disco.exe tool to generate .wsdl and .disco files from this web service for use in SharePoint. The following WSDL for the parameters is being generated: <s:element minOccurs="0" maxOccurs="1" name="url" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="list" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="query" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="noOfItems" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="titleField" type="s:string" /> Why does the int parameter have minOccurs set to 1 instead of 0 and how do I change it? I've tried the following without success: [XmlElementAttribute(IsNullable=false)] in the parameter declaration: makes no difference (as expected when you think about it) [XmlElementAttribute(IsNullable=true)] in the parameter declaration: gives error "IsNullable may not be 'true' for value type System.Int32. Please consider using Nullable instead." changing the parameter type to int? : keeps minOccurs="1" and adds nillable="true" [XmlIgnore] in the parameter declaration: the parameter is never output to the WSDL at all

    Read the article

  • Solving a cyclical dependency in Ninject (Compact Framework)

    - by Alex
    I'm trying to use Ninject for dependency injection in my MVP application. However, I have a problem because I have two types that depend on each other, thus creating a cyclic dependency. At first, I understand that it was a problem, because I had both types require each other in their constructors. Therefore, I moved one of the dependencies to a property injection instead, but I'm still getting the error message. What am I doing wrong? This is the presenter: public class LoginPresenter : Presenter<ILoginView>, ILoginPresenter { public LoginPresenter( ILoginView view ) : base( view ) { } } and this is the view: public partial class LoginForm : Form, ILoginView { [Inject] public ILoginPresenter Presenter { private get; set; } public LoginForm() { InitializeComponent(); } } And here's the code that causes the exception: static class Program { /// <summary> /// The main entry point for the application. /// </summary> [MTAThread] static void Main() { // Show the login form Views.LoginForm loginForm = Kernel.Get<Views.Interfaces.ILoginView>() as Views.LoginForm; Application.Run( loginForm ); } } The exception happens on the line with the Kernel.Get<>() call. Here it is: Error activating ILoginPresenter using binding from ILoginPresenter to LoginPresenter A cyclical dependency was detected between the constructors of two services. Activation path: 4) Injection of dependency ILoginPresenter into property Presenter of type LoginForm 3) Injection of dependency ILoginView into parameter view of constructor of type LoginPresenter 2) Injection of dependency ILoginPresenter into property Presenter of type LoginForm 1) Request for ILoginView Suggestions: 1) Ensure that you have not declared a dependency for ILoginPresenter on any implementations of the service. 2) Consider combining the services into a single one to remove the cycle. 3) Use property injection instead of constructor injection, and implement IInitializable if you need initialization logic to be run after property values have been injected. Why doesn't Ninject understand that since one is constructor injection and the other is property injection, this can work just fine? I even read somewhere looking for the solution to this problem that Ninject supposedly gets this right as long as the cyclic dependency isn't both in the constructors. Apparently not, though. Any help resolving this would be much appreciated.

    Read the article

  • Why is it that I cannot insert this into Django correctly?

    - by alex
    new_thing = MyTable(last_updated=datetime.datetime.now()) new_thing.save() >>>>select * from MyTable\G; last_updated: 2010-04-01 05:26:21 However, in my Python console...this is what it says... >>> print datetime.datetime.now() 2010-04-01 10:26:21.643041 So obviously it's off by 5 hours. By the way, the database uses "SYSTEM" as its time, so they should match perfectly. mysql> SELECT current_time; +--------------+ | current_time | +--------------+ | 10:30:16 | +--------------+ >>> print datetime.datetime.now() 2010-04-01 10:30:17.793040

    Read the article

  • Jquery validation, step by step validate on click function.

    - by Alex
    Trying to get jquery validation plugin work with my step by step form and here is the function i made. It works but only with first step. Any other step or final submit wont work in that case. If anyone could have a look whats wrong with my code i would appreciate the most. Thank you. function StepByStep(){ var a = { rules: { fieldname1: "required", fieldname2: "required", } } var b = { rules: { fieldname3:"required" } } var aStep = $("form").validate(a); var bStep = $("form").validate(b); $('input.nextStep').click(function(){ if (aStep.form()) { //open step 2 function } return false }); $('input.submit').click(function(){ if (bStep.form()) { $('form').submit(); } return false }); }

    Read the article

  • How do I implement "cash out" on my site using PayPal?

    - by Alex
    I have a credit system set up on my site where user A can purchase a document from user B, let's say for 1 credit and user B's account gets credited, let's say for $1. User B can then "cash out" and recieve the money they earned from my (the site's) PayPal account into their PayPal account (let's assume that their email address is valid for now). When user A purchases a credit, they are taken to PayPal where they can login and complete the purchase, for this purpose I have an IPN listener set up on my site that stores credit information to my site's database. However, I can't find a mechanism to send the "cash out" information (i.e. user's email and amount to be paid) to PayPal. To elaborate: I understand that PayPal sends the IPN when someone purchases from me, but how do I post from my site to PayPal when the user clicks the "cash out" button? I have seen mention of Mass Pay, but can't seem to locate any code samples to go from. Am I missing something, or is there perhaps a different (and better) way to do this? Thanks!

    Read the article

  • Why is the compiler caching my "random" and NULLED variables?

    - by alex gray
    I am confounded by the fact that even using different programs (on the same machine) to run /compile, and after nilling the vaues (before and after) the function.. that NO MATTER WHAT.. I'll keep getting the SAME "random" numbers… each and every time I run it. I swear this is NOT how it's supposed to work.. I'm going to illustrate as simply as is possible… #import <Foundation/Foundation.h> int main(int argc, char *argv[]) { int rPrimitive = 0; rPrimitive = 1 + rand() % 50; NSNumber *rObject = nil; rObject = [NSNumber numberWithInt:rand() % 10]; NSLog(@"%i %@", rPrimitive, rObject); rPrimitive = 0; rObject = nil; NSLog(@"%i %@", rPrimitive, rObject); return 0; } Run it in TextMate: i686-apple-darwin11-llvm-gcc-4.2 8 9 0 (null) Run it in CodeRunner: i686-apple-darwin11-llvm-gcc-4.2 8 9 0 (null) Run it a million times, if you'd like. You can gues what it will always be. Why does this happen? Why oh why is this "how it is"?

    Read the article

  • Building Boost with LSB C++ Compiler

    - by Alex Farber
    I want to build my program with LSB C++ Compiler from the Linux Standard Base http://www.linuxfoundation.org/collaborate/workgroups/lsb. Program depends on the Boost library, built with gcc 4.4 version. Compilation fails. Is it possible to build the Boost library with LSB C++ Compiler? Alternatively, is it possible to build the Boost library with some old gcc version, what version is recommended? My final goal is to get my executable and third-party Boost libraries running on most Linux distributions. Generally, what can be done to get better binary compatibility for Linux distributions, developing C++ closed-source application depending on the Boost library?

    Read the article

  • makefile from Linux doesn't work in OpenSolaris

    - by Alex Farber
    In OpenSolaris OS, when I run makefile generated by Eclipse CDT on the Linux OS, I get an error on the first -include line. The same error was in FreeBSD, and was solved by executing gmake instead of make. In OpenSolaris (just installed) gmake doesn't work (command not found). What package should I install and how exactly, to build Linux-generated C++ project in OpenSolaris?

    Read the article

  • Select...Case VB.NET to C# Equivalent

    - by Alex Essilfie
    I just started using C# and I've got a couple of issues. I hook several controls to one event handler as in the following and I want to perform a slightly different action for each control: Private Sub Button_Click(sender as Object, e as EventArgs) _ Handles button1.Click, Button2.Click 'do a general activity Select CType(sender, Button).Name Case button1.Name 'do something Case button2.Name 'do something else Case Else 'do the defalut action End Select End Sub Is there any way of doing the above select statement in C# without having to use nested ifs?

    Read the article

  • Javascript function as a parameter to another function?

    - by Alex
    Hello there, I'm learning lots of javascript these days, and one of the things I'm not quite understanding is passing functions as parameters to other functions. I get the concept of doing such things, but I myself can't come up with any situations where this would be ideal? My question is: When do you want to have your javascript functions take another function as a parameter? Why not just assign a variable to that functions return value and pass that variable to the function like so: // Why not do this var foo = doStuff(params); callerFunction(foo); //instead of this callerFunction(doStuff); I'm confused as to why I would ever choose to do things as in my second example. Why would you do this? What are the use cases? Thanks!!

    Read the article

< Previous Page | 59 60 61 62 63 64 65 66 67 68 69 70  | Next Page >