Search Results

Search found 56 results on 3 pages for 'mikael koskinen'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • isnt as a c# keyword

    - by Mikael
    To check if an object is of a certain class one can write: if (item is Class) why isn't the opposite possible? if (item isnt Class) instead one would write if (!(item is Class) which isn't as easy to read as if "isnt" was a keyword just as "is" is. Is there something that makes it so that only "is" should be available or has "isnt" just been forgotten about?

    Read the article

  • Deleting YouTube videos using Zend/PHP

    - by Mikael
    Hello, I'm using Zend and PHP to upload and delete videos from my home page. The uploading part is working fine but to download is more complicated. $videoEntryToDelete = $yt->getVideoEntry($videoId); $yt->delete($videoEntryToDelete); I use this code to delete a video and the first row do work. The video object is created and I can get all data from it. But when I try to delete it I get this error message: "You must specify an URI to which to post" Do anyone know how to solve this problem? Thanks!

    Read the article

  • KeyUp processed for wrong control

    - by Mikael
    I have made a simple test application for the issue, two winforms each containing a button. The button on the first form opens the other form when clicked. It also subscribes to keyup events. The second form has its button set as "AcceptButton" and in the Clicked event we sleep for 1s and then set DialogResult to true (the sleep is to simulate some processing done) When enter is used to close this second form the KeyUp event of the button on the first form is triggered, even though the key was released well before the second had passed so the second form was still shown and focused. If any key other then enter is pressed in the second form the event is not triggered for the button on the first form. First form: public Form1() { InitializeComponent(); buttonForm2.KeyUp += new KeyEventHandler(cntKeyUp); } void cntKeyUp(object sender, KeyEventArgs e) { MessageBox.Show(e.KeyCode.ToString()); } private void buttonForm2_Click(object sender, EventArgs e) { using (Form2 f = new Form2()) { f.ShowDialog(); } } Second form: private void button1_Click(object sender, EventArgs e) { Thread.Sleep(1000); this.DialogResult = DialogResult.OK; } Does anyone know why the event is triggered for the button on the non active form and what can be done to stop this from happening?

    Read the article

  • Best way to install multiple versions of Apache, PHP and MySQL on a single FreeBSD host

    - by Mikael Roos
    I want a test- and development-environment for web using Apache, PHP and MySQL. I need to be able to test a single web-application with multiple versions of PHP (5.2, 5.3, etc) and multiple versions of MySQL (5.0, 5.1, 5.5, etc). It shall be hosted on a FreeBSD server. My idea is to compile each version into a directory structure and running them on separate portnumbers. For example: opt/apache2.2-php5.2-mysql-5.0 (httpd on port 8801, mysql on port 8802) (directory contains each software, compiled and linked towards eachother) opt/apache2.2-php5.3-mysql-5.1 (httpd on port 8803, mysql on port 8804) (and so on) Any thoughts or suggestions of the best way to setup this type of environment?

    Read the article

  • Does DB2 have an "insert or update" statement?

    - by Mikael Eriksson
    From my code (Java) I want to ensure that a row exists in the database (DB2) after my code is executed. My code now does a select and if no result is returned it does an insert. I really don't like this code since it exposes me to concurrency issuses when running in a multi-threaded environment. What I would like to do is to put this logic in DB2 instead of in my Java code. Does DB2 have an "insert-or-update" statement? Or anything like it that I can use? For example: insertupdate into mytable values ('myid') Another way of doing it would probably be to allways do the insert and catch "SQL-code -803 primary key already exists", but I would like to avoid that if possible.

    Read the article

  • Needing to copy properties before validation

    - by Mikael
    I have a farily complex model needing to be validated, the problem is that this model is used on two different places, one where you register your customer and one where you simply add addresses. Some fields on the address are simply not visible on the register customer form. So when i check if ModelState.IsValid i get false of course since eg. the name is not entered on the billing address, but it is on the customer. That is why i want to before validation occurs, copy a couple of fields to the model, and then validate. I am somewhat lost though and i need help. My action looks something like this: public ActionResult Register(WebCustomer customer) { customer.CopyProperties(); if(TryUpdateModel(customer)) { ... } ... But it always returns false, and ModelState.IsValid continues to be false.

    Read the article

  • How come the Name property is <Unknown> on a FileStream which uses handle constructors?

    - by Mikael Svenson
    Say you get a file handle from some outside DLL and instantiate a FileStream with it. It works just fine for reading and writing. Then you want the path and name of that handle and try to access the Name property of your FileStream object, and it returns 'unknown'. This is true for the constructors which takes file handles: public FileStream(IntPtr handle, ... public FileStream(SafeFileHandle handle, ... I know the short answer, because it's not implemented. The private field _fileName of FileStream is never assigned in those constructors. Seems the API to get the name from a handle involves more than one line of code, but I still think they could have bothered to include this. So the real questions is: Why haven't they? Or did they just forget?

    Read the article

  • Is there an alias for the local machine name in the Windows 7 login screen?

    - by Mikael
    We have many computers connected to a AD. The computers names is auto generated. When I want to log in using a local account, I have to figure out what the computer's name is, and log in using the following syntax: [COMPUTER_NAME]\local_account Now I'm wondering if there is an alias that I can use instead? So instead of logging in using NB-aw35sdds\local_account, I can use something like localhost\local_account.

    Read the article

  • Error after updating to the latest version Azure SDK

    - by Mikael Johansson
    After I updated to the newest version the Azure SDK I have started to get this error several times each day when I press build in Visual Studio. The only way for me to fix it at the moment is to restart my visual studio. The error I get is: Windows Azure Tools: Invalid access to memory location Is there someone else that have got this error? And also what did you do to fix it? Thanks in advance! Update 2012-08-28: The same error still exist in VS2012 and Azure 1.7 SDK. However the frequency have gone down with VS2012.

    Read the article

  • Prepopulate jQuery Data in html

    - by Mikael
    jQuery has the very cool feature/method ".data", i wonder if there is a way to have the data in the code so that jQuery can use it when the rendering of html is done. Suppose i have a repeater and looping out children, and i want to add some data to those children without using classes etc. Will i have to add javascript to that repeater just to add stuff to the "data of jquery" or is there some better way?

    Read the article

  • Creating a new object destroys an older object with different name in C++

    - by Mikael
    First question here! So, I am having some problems with pointers in Visual C++ 2008. I'm writing a program which will control six cameras and do some processing on them so to clean things up I have created a Camera Manager class. This class handles all operations which will be carried out on all the cameras. Below this is a Camera class which interacts with each individual camera driver and does some basic image processing. Now, the idea is that when the manager is initialised it creates two cameras and adds them to a vector so that I can access them later. The catch here is that when I create the second camera (camera2) the first camera's destructor is called for some reason, which then disconnects the camera. Normally I'd assume that the problem is somewhere in the Camera class, but in this case everything works perfectly as long as I don't create the camera2 object. What's gone wrong? CameraManager.h: #include "stdafx.h" #include <vector> #include "Camera.h" class CameraManager{ std::vector<Camera> cameras; public: CameraManager(); ~CameraManager(); void CaptureAll(); void ShowAll(); }; CameraManager.cpp: #include "stdafx.h" #include "CameraManager.h" CameraManager::CameraManager() { printf("Camera Manager: Initializing\n"); [...] Camera *camera1 = new Camera(NodeInfo,1, -44,0,0); cameras.push_back(*camera1); // Adding the following two lines causes camera1's destructor to be called. Why? Camera *camera2 = new Camera(NodeInfo,0, 44,0,0); cameras.push_back(*camera2); printf("Camera Manager: Ready\n"); }

    Read the article

  • Which way is preferred when doing asynchronous WCF calls?

    - by Mikael Svenson
    When invoking a WCF service asynchronous there seems to be two ways it can be done. 1. public void One() { WcfClient client = new WcfClient(); client.BegindoSearch("input", ResultOne, null); } private void ResultOne(IAsyncResult ar) { WcfClient client = new WcfClient(); string data = client.EnddoSearch(ar); } 2. public void Two() { WcfClient client = new WcfClient(); client.doSearchCompleted += TwoCompleted; client.doSearchAsync("input"); } void TwoCompleted(object sender, doSearchCompletedEventArgs e) { string data = e.Result; } And with the new Task<T> class we have an easy third way by wrapping the synchronous operation in a task. 3. public void Three() { WcfClient client = new WcfClient(); var task = Task<string>.Factory.StartNew(() => client.doSearch("input")); string data = task.Result; } They all give you the ability to execute other code while you wait for the result, but I think Task<T> gives better control on what you execute before or after the result is retrieved. Are there any advantages or disadvantages to using one over the other? Or scenarios where one way of doing it is more preferable?

    Read the article

  • Visual C++ function suddenly 170 ms slower (4x longer)

    - by Mikael
    For the past few months I've been working on a Visual C++ project to take images from cameras and process them. Up until today this has taken about 65 ms to update the data but now it has suddenly increased significantly. What happens is: I launch my program and for the first 30 or so iterations it performs as expected, then suddenly the loop time increases from 65 ms to 250 ms. The odd thing is, after timing each function I found out that the part of the code which is causing the slowdown is fairly basic and has not been modified in over a month. The data which goes into it is unchanged and identical every iteration but the execution time which is initially less than 1 ms suddenly increases to 170 ms while the rest of the code is still performing as expected (time-wise). Basically, I am calling the same function over and over, for the first 30 calls it performs as it should, after that it slows down for no apparent reason. It might also be worth noting that it is a sudden change in execution time, not a gradual increase. What could be causing this? The code is leaking some memory (~50 kb/s) but not nearly enough to warrant a sudden 4x slowdown. If anyone has any ideas I'd love to hear them!

    Read the article

  • Visual C++ function suddenly 170x slower

    - by Mikael
    For the past few months I've been working on a Visual C++ project to take images from cameras and process them. Up until today this has taken about 65 ms to update the data but now it has suddenly increased significantly. What happens is: I launch my program and for the first 30 or so iterations it performs as expected, then suddenly the loop time increases from 65 ms to 250 ms. The odd thing is, after timing each function I found out that the part of the code which is causing the slowdown is fairly basic and has not been modified in over a month. The data which goes into it is unchanged and identical every iteration but the execution time which is initially less than 1 ms suddenly increases to 170 ms while the rest of the code is still performing as expected (time-wise). Basically, I am calling the same function over and over, for the first 30 calls it performs as it should, after that it slows down for no apparent reason. It might also be worth noting that it is a sudden change in execution time, not a gradual increase. What could be causing this? The code is leaking some memory (~50 kb/s) but not nearly enough to warrant a sudden 4x slowdown. If anyone has any ideas I'd love to hear them!

    Read the article

  • Pass 2-dimensional array trough view

    - by Mikael
    Hi, I'm trying to print a 2-dimensional array but can't figure it out. My controller uses this code: public ActionResult Test(string str) { DateTimeOffset offset = new DateTimeOffset(DateTime.Now); offset = offset.AddHours(-5); string[,] weekDays = new string[7,2]; for (int i = 0; i < 7; i++) { weekDays[i,0] = String.Format("{0:yyyy-MM-dd:dddd}", offset); //Date weekDays[i,1] = String.Format("{0:dddd}", offset); //Text offset = offset.AddHours(24); } weekDays[0,1] = "Today"; ViewData["weekDays"] = weekDays; return View(); } Now I wan't to print this array of weekdays as a dropdown-list and i thought this would work: <% foreach (var item in (string[,])ViewData["weekDays"]) { %> <option value=" <%= item[0] %> "> <%= item[1] %> </option> <% } %> But that's not the case, this code output just the first char of the string. So anyone got a suggestion? Thanks! /M

    Read the article

  • XML in Authorware 7.01

    - by Mikael
    Let me explain the setup that is being used. Right now I have an authorware program which loads an ocx control. This control receives data in the form on an XML string. This part is working properly. However I need parse this XML string in authorware and have not been successful. I have been trying to use the XMLParser Xtra. The documentation listed here shows how to create a new XMLParser object and then shows how to call the object but never explains how to link the Parser to a XML file or XML string. The information I have been using can be found here https://www.adobe.com/livedocs/authorware/7/using_aw_en/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Using_Authorware_7&file=09_va110.htm#224295 I need more information on how to Parse XML with this function or if there is another way to do this in Authorware. As a side note the documentation says it cannot create or append to XML, I will need to do this also inside of Authorware. Is this possible and if so, how?

    Read the article

  • Setting up Splunk/IronPort WSA

    - by Ciddan
    Hello everyone! I recently stumbled across Splunk 4 (by way of an advert on this very site...) and found that it had an "App" that's designed to work with Cisco IronPort WebSecurity and E-Mail Appliances! That's really awesome, because good IronPort reporting is something our IT-dept. is looking for. Anyways - I'm totally lost on how to configure this thing. I've googled like a mad-man to find a guide or such like - but I haven't found anything. Has anyone here set up IP / Splunk? Any tips/pointers? Regards, Mikael Selander

    Read the article

  • Code Contracts and Pex at MSDN Live 2010

    - by terje
    One of the 6 sessions I and Mikael Nitell is running on MSDN Live 2010 here in Norway is about Code Quality, and part of that session goes through the use of Code Contracts and Pex.  Both fantastic tools ! They can be used togethers, but are also completely independent from each other, and can be used as a single Code Contracts  has to downloaded separately from VS 2010 (works also on VS 2008).   Start looking at http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx . This download is a free download.   Code Contracts originates form the ideas of Bertrand Meyer – Design by Contract, take a look here. Pex is found on the MSDN Subscription download, so it requires an active MSDN Subscription. Start to get it from here http://research.microsoft.com/en-us/projects/pex/downloads.aspx .  The current version as of 14.4.10 is 0.9, which works with the 2010 RC.  A new version is due this week.  Pex is a tool to generate unit tests, and does this very intelligently.  Perfect to make tests for legacy code, but also to make sure you get all paths tested.  See the Reference information and project startup information.

    Read the article

  • Iphone/Android app – chatroom development – what framework & hosting needs?

    - by MikaelW
    I have some experience regarding IPhone and Android development but I am now struggling to solve a new class of problem: apps that involve a client/server chatroom feature. That is, an app when people can exchange text over the internet, and without having the app to constantly “pull” content from the server. So that problem can’t be solved with a normal php/mysql website, there must be some kind of application running on a server that is able to send message from the server to the phone, rather than having the phone to check for new messages every 10 seconds… So I’m looking for ways to solve the different problems here: What framework should I use on the two sides (phone / server)? It should be some kind of library that doesn’t prevent me to write paid apps. It should also be possible to have the same server for the Iphone and android version of the app. What server / hosting solution do I need with what sort of features, I just have no experience regarding server application that can handle and initiate multiple connections and are hosted on hardware that is always online I tried to find resources online but couldn’t so far, either the libraries had the wrong kind of license/language or I just didn’t understand… Sometimes there were nice tutorial but for different needs such as peer2peer chat over local network… Same with the server and the hosting problem, not sure where to start really, I’m calling for help and I promise I will complete this page with notes about the experience I will get :-) Obviously the ideal would be to find a tutorial I missed that include client code, server code and a free scalable server… That being said, If I see something as good, it probably means that I have eaten the wrong kind of mushroom again… So, failing that, any pointer which might help me toward that quest, would be greatly appreciated. Thanks in advance. Mikael

    Read the article

  • Iphone/Android app – chatroom development – what framework & hosting needs?

    - by MikaelW
    I have some experience regarding IPhone and Android development but I am now struggling to solve a new class of problem: apps that involve a client/server chatroom feature. That is, an app when people can exchange text over the internet, and without having the app to constantly “pull” content from the server. So that problem can’t be solved with a normal php/mysql website, there must be some kind of application running on a server that is able to send message from the server to the phone, rather than having the phone to check for new messages every 10 seconds… So I’m looking for ways to solve the different problems here: What framework should I use on the two sides (phone / server)? It should be some kind of library that doesn’t prevent me to write paid apps. It should also be possible to have the same server for the Iphone and android version of the app. What server / hosting solution do I need with what sort of features, I just have no experience regarding server application that can handle and initiate multiple connections and are hosted on hardware that is always online I tried to find resources online but couldn’t so far, either the libraries had the wrong kind of license/language or I just didn’t understand… Sometimes there were nice tutorial but for different needs such as peer2peer chat over local network… Same with the server and the hosting problem, not sure where to start really, I’m calling for help and I promise I will complete this page with notes about the experience I will get :-) Obviously the ideal would be to find a tutorial I missed that include client code, server code and a free scalable server… That being said, If I see something as good, it probably means that I have eaten the wrong kind of mushroom again… So, failing that, any pointer which might help me toward that quest, would be greatly appreciated. Thanks in advance. Mikael

    Read the article

  • MSDN Live 2010 &ndash; Delivered : 24 sessions (4 x 6) on Visual Studio and Team Foundation Server

    - by terje
    We (Mikael Nitell and me) got a whole track on the Norwegian MSDN Live tour this year.  We did these as a pair, and covered 4 cities over 4 days, 6 sessions per day, taking 8 hours to come through it.  The Islandic volcano made the travels a bit rough, but we managed 6 flights out of 8. The first one had to go by van instead, 7-8 hour drive each way together with other MSDN Live presenters – a memorable tour! Oslo was the absolute top point.  We had to change hall to a bigger one. People were crowding, and even the big hall was packed!  The presentations were mostly based on demos, but we had a few slides as well.  They have been uploaded to my SkyDrive.  Info to aliens – some of the text may be Norwegian. The sessions were as follows: Overview of news in Visual Studio and Team Foundation server 2010 Ensuring Quality with VS/TFS 2010 Releasing products with VS/TFS 2010 No More No Repro with VS/TFS 2010 Performance Testing and Parallel Programming with VS/TFS 2010 Migrating to VS/TFS 2010 Tips, tricks, news and some best practices with VS/TFS 2010   In the coming days, I will post up examples from the demos too, with explanations of how they are intended to work. These entries will also contain stuff we had to remove from the actual presentations due to the time constraints. We managed to create recordings of two of the sessions, which will be uploaded to Channel 9 by Microsoft, afaik.   I will update this blog with information about exact locations when that is done. Also note we’re (read:Osiris Data AS) running both Upgrade and Deep Dive courses  on VS/TFS 2010 now in May.  Please look here for more info. If you want to be informed, follow me on Twitter.  All blog entries will be announced on twitter.

    Read the article

< Previous Page | 1 2 3  | Next Page >