Search Results

Search found 23 results on 1 pages for 'egil jansson'.

Page 1/1 | 1 

  • How do I protect static files with ASP.NET form auhentication on IIS 7.5?

    - by Egil Hansen
    Hi all I have a website running on a IIS 7.5 server with ASP.NET 4.0 on a shared host, but in full trust. The site is a basic "file browser" that allows the visitors to login and have a list of files available to them displayed, and, obviously, download the files. The static files (mostly pdf files) are located in a sub folder on the site called data, e.g. http://example.com/data/... The site uses ASP.NET form authentication. My question is: How do I get the ASP.NET engine to handle the requests for the static files in the data folder, so that request for files are authenticated by ASP.NET, and users are not able to deep link to a file and grab files they are not allowed to have? Best regards, Egil.

    Read the article

  • Why do MSTests Assert.AreEqual(1.0, double.NaN, 0.0) pass?

    - by Egil Hansen
    Short question, why do Assert.AreEqual(1.0, double.NaN, 0.0) pass when Assert.AreEqual(1.0, double.NaN) do not? Is it an error in MSTest or am I missing something here? Best regards, Egil. Update: Should probably add, that the reason behind my question is, that I have a bunch of unit tests that unfortunately passed due to the result of some linear algebraic matrix operation being NaN or (+/-)Infinity. The unit tests are fine, but since Assert.AreEqual on doubles with a delta will pass when actual or/and expected are NaN or Infinity, I was left to believe that the code I was testing was correct.

    Read the article

  • Backward compatibility with event-sourcing

    - by Tomas Jansson
    How do you stay backward compatible with event-sourcing? Let say you release a version that has one kind of event, let call it X. You know how to handle that event in all the systems that extracts the events from the event source. In a later release you make a change to event X or delete it, how do you stay backward compatible with that? To have a fully functional system you need to be able to handle the old event as the same time as you need to handle the updated version. Or if you delete that event type, then you will be stuck with code that is only there to handle legacy events which in my head can be a little bit messy in the long run.

    Read the article

  • How do you end up with event-sourcing if you use a xDD approach?

    - by Tomas Jansson
    When working in a TDD or BDD manner your unit tests are supposed to drive your design. But how do you end up with event-sourcing using a xDD techniques? As I see it event sourcing is something you need to adopt early on to take full advantage of it. Lets say that you start without event-sourcing and do a release. Later on when you are releasing version 2.0 you realize that it would be great to use event-sourcing, but at that point you alread have missed all the events from version 1.0 so it makes it much harder to implement. Or do you take some kind of backup of your db from before event-sourcing and use that as base line and then add event-sourcing on top of that?

    Read the article

  • Ubuntu Apache 10 second timeout

    - by Andreas Jansson
    Hi, I'm debugging an API I'm building using netcat to send raw HTTP requests. The thing is that Apache closes the connection after 10 seconds, giving me very little time to type. I know that I could pipe a file to nc, or use any other workaround, but I'd like it to work as it's supposed to. The Timeout directive in apache2.conf is at its default of 300 seconds, KeetAliveTimeout at 15 seconds. Where could this 10 second timeout possibly be defined? I'm running Ubuntu 10.04 Desktop. Thanks, Andreas

    Read the article

  • Connecting to Exchange Server 2003 over POP using openssl s_client

    - by Andreas Jansson
    Hi, I'm trying to fetch emails programmatically from Exchange 2003 over POP. As a proof of concept I'm trying to connect using openssl s_client. I've started the POP service on my Exchange server. Trying to connect using openssl s_client -connect MYEXCHANGESERVER:995 returns 20303:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:188: Trying openssl s_client -connect MYEXCHANGESERVER:995 -starttls pop3 returns CONNECTED(00000003) write:errno=32 Forgive a newb - I'm basically shooting wildly in the dark with no idea on what I'm supposed to be doing. In the past I've read my GMail over openssl s_client, and setting up those certificates was easy and well documented. I would imagine I need to set up some sort of certificate here as well, and I've looked a bit at using a .pfx file. But like I said, I'm completely lost here. Thankful for any advice, Andreas

    Read the article

  • Passing touch events on to subviews

    - by Egil Jansson
    I have a view within a UIScrollView that loads an additional subview when the user presses a certain area. When this additional subview is visible, I want all touch events to be handled by this - and not by the scrollview. It seems like the first couple events are being handled by the subview, but then touchesCancelled is called and the scrollview takes over the touch detection. How can I make sure that the subview gets all the events as long as the movement activity is being performed on this view? This is my implementation on touchesMoved - which I thought would do the job... -(void) touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [[touches allObjects] objectAtIndex:0]; CGPoint touchPt = [touch locationInView:self]; UIView *hitView = [self hitTest:touchPt withEvent:event]; UIView *mySubView = subviewCtrl.view; if(hitView == mySubView) { [subviewCtrl.view touchesMoved:touches withEvent:event]; } else { NSLog(@"Outside of view..."); } }

    Read the article

  • When is 'drawRect' called?

    - by Egil
    I have some custom drawing code in drawRect which also performs some calculation of sizes. When is the earliest I can be sure that this code has been loaded, e.g. if I want to modify it's containers size accordingly?

    Read the article

  • Google Closure Library - Adding non-TreeNode children to a TreeNode

    - by Andreas Jansson
    Hi, I'm using the Google Closure Library and goog.ui.tree in particular to build a tree structure GUI component. It works pretty well out of the box, but I'd like to add a few extra controls to each of the leaves (goog.ui.Checkboxes in particular). The problem is that Component.addChild has been overridden in BaseNode so that each added child is treated as a child tree node as opposed to a child component. In effect plenty of errors are thrown if you try to add anything else than an actual tree node as a child, as these children are traversed and BaseNode-specific functions are called on them. I must admit I'm quite a Closure newb, but I reckon there must be some workaround for this, right? Essentially all I want to do is have a bunch of checkboxes appear next to each leaf in my tree. Thanks, Andreas

    Read the article

  • No memory window in Visual Studio 2010

    - by Fredrik Jansson
    I have VS2010 Premium RTM version on Windows 7 Ultimate x64. In the documentation they refer to the Memory 1-4 windows, supposedly under Debug-Windows-Memory. I have "Enable address-level debugging" enabled in VS (Options-Debugging). The problem is that I have no Memory menu item under Debug-Windows during debug of a c++ program. Under Debug-Windows I have only: Breakpoints Parallel Tasks Parallel Stacks Watch - Locals Call Stack Threads Have anyone else experienced this (and hopefully solved it)?

    Read the article

  • How to enable and use HTTP PUT and DELETE with Apache2 and PHP?

    - by Andreas Jansson
    Hi, It should be so simple. I've followed every tutorial and forum I could find, yet I can't get it to work. I simply want to build a RESTful API in PHP on Apache2. In my VirtualHost directive I say: <Directory /> AllowOverride All <Limit GET HEAD POST PUT DELETE OPTIONS> Order Allow,Deny Allow from all </Limit> </Directory> Yet every PUT request I make to the server, I get 405 method not supported. Someone advocated using the Script directive, but since I use mod_php, as opposed to CGI, I don't see why that would work. People mention using WebDAV, but to me that seems like overkill. After all, I don't need DAV locking, a DAV filesystem, etc. All I want to do is pass the request on to a PHP script and handle everything myself. I only want to enable PUT and DELETE for the clean semantics. Thanks, Andreas

    Read the article

  • Design - Where should objects be registered when using Windsor

    - by Fredrik Jansson
    I will have the following components in my application DataAccess DataAccess.Test Business Business.Test Application I was hoping to use Castle Windsor as IoC to glue the layers together but I am bit uncertain about the design of the gluing. My question is who should be responsible for registering the objects into Windsor? I have a couple of ideas; Each layer can register its own objects. To test the BL, the test bench could register mock classes for the DAL. Each layer can register the object of its dependencies, e.g. the business layer registers the components of the data access layer. To test the BL, the test bench would have to unload the "real" DAL object and register the mock objects. The application (or test app) registers all objects of the dependencies. Can someone help me with some ideas and pros/cons with the different paths? Links to example projects utilizing Castle Windsor in this way would be very helpful.

    Read the article

  • Maven and db4o dependency

    - by Jens Jansson
    I'm intrigued to test new frameworks in the Java world, and decided to create a new project that takes advantage of Maven and db4o. I'm starting to get a hang of Maven, but I have a hard time adding db4o as a dependency to the project. First problem is that db4o doesn't exist in the official Maven repositories. Next up comes the problem that db4o seem to have recently restructured their whole site's URI:s, so I'm getting 'site not found' messages all the time when I try to navigate their site. I found somewhere a potential Maven repository that should be at https://source.db4o.com/maven but I get all the time "Error reading archetype catalog https://source.db4o.com/maven Unable to locate resource in repository" when I try to access it. So, any suggestions on how I'll get db4o up through Maven? I've managing Maven through Eclipse with the M2Eclipse plugin.

    Read the article

  • Getting all objects with a certain element inside a collection of strings with criteria API.

    - by Jens Jansson
    Hey. I'm trying to build a Hibernate Criteria query to find entities that have a specific element inside a collection. We can take as an example a Book -object that looks like this: public class Book { private Long id; private String title; private Set<String> authors = new HashSet<String>(); } The entity is mapped like this: <class name="Book" table="Book"> <id name="id" column="BOOK_ID"> <generator class="native"/> </id> <property name="title"/> <set name="authors" table="Book_Authors"> <key column="BOOK_ID"/> <element type="string" column="AUTHORS"/> </set> </class> Now I would like to find out which books are written by Matt. With pure SQL I can do a query like this: String author = "Matt"; String query = "SELECT * FROM Book " + "WHERE BOOK_ID IN " + "(SELECT BOOK_ID FROM Book_Authors " + "WHERE authors = :author )"; List<Book> result = session.createSQLQuery(query) .addEntity(Book.class) .setParameter("author", author) .list(); This works all good and well, and I get out all books that Matt has been a part of writing. The project I work in, however, uses the Criteria API instead of raw SQL, and I haven't found a way to express the same query in that form. I've taken a look on the Restrictions API and the closest I've found is Restions.in(propertyName, collection) but that works the other way around (one value in object, many values to match against). Any ideas?

    Read the article

  • Hibernate: fetching multiple bags efficiently

    - by Jens Jansson
    Hi! I'm developing a multilingual application. For this reason many objects have in their name and description fields collections of something I call LocalizedStrings instead of plain strings. Every LocalizedString is basically a pair of a locale and a string localized to that locale. Let's take an example an entity, let's say a book -object. public class Book{ @OneToMany private List<LocalizedString> names; @OneToMany private List<LocalizedString> description; //and so on... } When a user asks for a list of books, it does a query to get all the books, fetches the name and description of every book in the locale the user has selected to run the app in, and displays it back to the user. This works but it is a major performance issue. For the moment hibernate makes one query to fetch all the books, and after that it goes through every single object and asks hibernate for the localized strings for that specific object, resulting in a "n+1 select problem". Fetching a list of 50 entities produces about 6000 rows of sql commands in my server log. I tried making the collections eager but that lead me to the "cannot simultaneously fetch multiple bags"-issue. Then I tried setting the fetch strategy on the collections to subselect, hoping that it would do one query for all books, and after that do one query that fetches all LocalizedStrings for all the books. Subselects didn't work in this case how i would have hoped and it basically just did exactly the same as my first case. I'm starting to run out of ideas on how to optimize this. So in short, what fetching strategy alternatives are there when you are fetching a collection and every element in that collection has one or multiple collections in itself, which has to be fetch simultaneously.

    Read the article

  • "Forced constness" in std::map<std::vector<int>,double> > ?

    - by Peter Jansson
    Consider this program: #include <map> #include <vector> typedef std::vector<int> IntVector; typedef std::map<IntVector,double> Map; void foo(Map& m,const IntVector& v) { Map::iterator i = m.find(v); i->first.push_back(10); }; int main() { Map m; IntVector v(10,10); foo(m,v); return 0; } Using g++ 4.4.0, I get his compilation error: test.cpp: In function 'void foo(Map&, const IntVector&)': test.cpp:8: error: passing 'const std::vector<int, std::allocator<int> >' as 'this' argument of 'void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = int, _Alloc = std::allocator<int>]' discards qualifiers I would expect this error if I was using Map::const_iterator inside foo but not using a non-const iterator. What am I missing, why do I get this error?

    Read the article

  • Finding existing tickets before opening new ones on trac

    - by Jens Jansson
    We're using Trac as the task management tool at the project we work in. However, Trac search is maybe not the most intuitive search out there, and we end up having multiple duplicates as the reporters can't effectively find if there already is a reported ticket of the question he or she found. Stack Overflow's "Related Questions" concept is great and works magnificently! I was wondering if someone has heard of some similar plugin to Trac, or if you have solved this problem some other way.

    Read the article

  • nvcc not found, but only when using sudo

    - by dsp_099
    I can't get ANYTHING working on linux. I'm trying to compile CudaMiner. sudo make: ypt-jane.o `test -f 'scrypt-jane.cpp' || echo './'`scrypt-jane.cpp mv -f .deps/cudaminer-scrypt-jane.Tpo .deps/cudaminer-scrypt-jane.Po nvcc -g -O2 -Xptxas "-abi=no -v" -arch=compute_10 --maxrregcount=64 --ptxas-options=-v -I./compat/jansson -o salsa_kernel.o -c salsa_kernel.cu /bin/bash: nvcc: command not found make[2]: *** [salsa_kernel.o] Error 127 make[2]: Leaving directory `/var/progs/CudaMiner' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/progs/CudaMiner' make: *** [all] Error 2 So, kind of interesting: nvcc: nvcc fatal : No input files specified; use option --help for more information Whereas sudo nvcc: sudo: nvcc: command not found Huh?? I have identical exports listed in ~/.bashrc AND /etc/bash.bashrc. (Nvcc is located in: /usr/local/cuda-5.0/bin/nvcc) I also tried changing the current path, to no avail: $ sudo bash -c 'echo $PATH' /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin $ PATH=$PATH:/usr/local/cuda-5.0/bin/nvcc $ sudo bash -c 'echo $PATH' /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin Thanks in advance!

    Read the article

1