Daily Archives

Articles indexed Thursday May 27 2010

Page 21/122 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Scientific Plotting in Python

    - by user100046
    I have a large data set of tuples containing (time of event, latitude, longitude) that I need to visualize. I was hoping to generate a 'movie'-like xy-plot, but was wondering if anyone has a better idea or if there is an easy way to do this in Python? Thanks in advance for the help, --Leo

    Read the article

  • How to get DataGridViewRow from CellFormatting event?

    - by tomaszs
    I have a DataGridView and handle event CellFormatting. It has a parameter called: DataGridViewCellFormattingEventArgs e With e.RowIndex in it. When i do: DataGridView.Rows[e.RowIndex] I get proper row from collection. But when I click at a header of a column to sort it by other column than default one and user DataGridView.Rows[e.RowIndex] I get unproper row. It is because Rows collection do not reflect order of rows in DataGridView. So how to get propert DataGridViewRow from RowIndex in DataGridView?

    Read the article

  • Android OS 2.2 Permissions: I have absolutely no idea why this simple piece of code doesn't work. Wh

    - by Kevin
    I'm just playing around with some code. I create an Activity and simply do something like this: long lo = currentTimeMillis(); System.out.println(lo); lo *= 3; System.out.println(lo); SystemClock.setCurrentTimeMillis(lo); System.out.println( currentTimeMillis() ); Yes, in my AndroidManifest.xml, I've added: <uses-permission android:name="android.permission.SET_TIME"></uses-permission> <uses-permission android:name="android.permission.SET_TIME_ZONE"></uses-permission> Nothing changes. The SystemClock is never reset...it just keeps on ticking. The error that I'm getting just says that the permission "SET_TIME" was not granted to the program. Protection level 3. The permissions are there...and in the API for 2.2 it says that this feature is supported now. I have no idea what I'm doing wrong. If android.content.Intent; comes into play, please explain. I don't really understand what the idea behind intents! Thanks for any help!

    Read the article

  • How to check dates don't overlap in a table using TSQL.

    - by Jon
    I have a table with start and finish datetimes that I need to determine if any overlap and not quite sure the best way to go. Initially I was thinking of using a nested cursor as shown below which does work, however I'm checking the same records against each other twice and I'm sure it is not very efficient. eg: this table would result in an overlap. id start end ------------------------------------------------------- 1 2009-10-22 10:19:00.000 2009-10-22 11:40:00.000 2 2009-10-22 10:31:00.000 2009-10-22 13:34:00.000 3 2009-10-22 16:31:00.000 2009-10-22 17:34:00.000 Declare @Start datetime, @End datetime, @OtherStart datetime, @OtherEnd datetime, @id int, @endCheck bit Set @endCheck = 0 DECLARE Cur1 CURSOR FOR select id, start, end from table1 OPEN Cur1 FETCH NEXT FROM Cur1 INTO @id, @Start, @End WHILE @@FETCH_STATUS = 0 AND @endCheck = 0 BEGIN -- Get a cursor on all the other records DECLARE Cur2 CURSOR FOR select start, end from table1 and id != @id OPEN Cur2 FETCH NEXT FROM Cur2 INTO @OtherStart, @OtherEnd WHILE @@FETCH_STATUS = 0 AND @endCheck = 0 BEGIN if ( @Start > @OtherStart AND @Start < @OtherEnd OR @End > @OtherStart AND @End < @OtherEnd ) or ( @OtherStart > @Start AND @OtherStart < @End OR @OtherEnd > @Start AND @OtherEnd < @End ) BEGIN SET @endCheck = 1 END FETCH NEXT FROM Cur2 INTO @OtherStart, @OtherEnd END CLOSE Cur2 DEALLOCATE Cur2 FETCH NEXT FROM Cur1 INTO @id, @Start, @End END CLOSE Cur1 DEALLOCATE Cur1

    Read the article

  • Running Teamsite User Admin tool IWUSERADM.exe from ASP.NET

    - by Narendra Tiwari
    It has really been a head scratching task for me. I 've tried many options but nothing worked. Finally I found a workaround on google to achive this by TaskScheduler. PROBLEM When we run Teamsite user administration command line tool IWUSERADM.exe though ASP.Net it gives following error: Application popup: cmd.exe - Application Error : The application failed to initialize properly (0xc0000142). Click on OK to terminate the application. CAUSE No specific cause, it seems to be a bug, supposed to be resolved with this Microsoft patch http://support.microsoft.com/kb/960266. and there is nothing related to permission issue, y web application is impersonated with an administrator account. off course running a bat file from dmin account is a potential secury threat but for this scenario lets conifned our discussion to run the command line tool. RESOLUTION I have not tried this patch as I have not permitted to run this patch on server. Below are the steps to achive the requirement. 1/ Create a batch file which runs the IWUSERADM.exe.         echo - Add Teamsite User    CD E:\Appli\GN00\iw-home\bin    iwuseradm add-user %1 2/ Temporarily create a schedule task and run  the .bat file by scheduled task by ASP.Net code using TaskScheduler http://www.codeproject.com/KB/cs/tsnewlib.aspx. 3/ Here is the function: private int AddTeamsiteUser(string strBatchFilePath, string strUser) { //Get a ScheduledTasks object for the local computer. ScheduledTasks st = new ScheduledTasks(); // Create a task Task t; try{ t = st.CreateTask("~AddTeamsiteUser"); } catch { throw new Exception("Schedule Task ~AddTeamsiteUser already exist."); }    t.SetAccountInformation(yourLogin, yourPassword); //Set the account under which the task should run.  t.Save();  t.Run(); Thread.Sleep(2000); //for sync issue //Remove the scheduled task st.DeleteTask("~AddTeamsiteUser"); return t.ExitCode;   Below are few resources related to the above scenario:- - Task Scheduler Class Library for .NET  http://www.codeproject.com/KB/cs/tsnewlib.aspx - Run a .BAT file from ASP.NET  http://codebetter.com/blogs/brendan.tompkins/archive/2004/05/13/13484.aspx - TaskScheduler Class  http://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler.aspx - Application Hangs whle running iwuseradm.exe through ASP.Net  http://bytes.com/topic/asp-net/answers/733098-system-diagnostics-process-hangs     t.ApplicationName = strBatchFilePath; t.Parameters = strUser; t.Comment = "Adding user to Teamsite Application"

    Read the article

  • How can I get the Terminal raster font to display alt codes in a text editor?

    - by grg-n-sox
    I am working on a project that includes making some ASCII art, except it isn't true ASCII art since I am using a far amount of Windows Alt codes to make it. Anyways, I wanted to make sure that as I am working on it, that it looks exactly how it will in a windows command prompt terminal session. So since command prompt defaults to the Terminal raster font, I figured I would use that. But I quickly noticed that when I use the Terminal typeface in a text editor, it will not render ASCII codes, either at all (as is the case most of the time) or incorrectly. Now, I understand if a font just doesn't support non-ASCII characters, but what I don't get is how the characters do show up correctly in command prompt when they don't in a text editor. I checked the output of the 'chcp' and it was set to 437 by default, which is what I need. Well, either that or 850 but preferably 437 since they got rid of some of the graphics in 437 and replaced them with other Latin characters. Command prompt terminal settings show I am using the Terminal raster font with a 8x12 glyph size. So I try using size 12 in the text editor but no good, even after switching the text encoding to either MS-DOS OEM-US (supposedly an alternative name for CP437) or UTF-8. I just don't get how I am not getting the characters to show up. Also, if it helps, the art I am making is basically modified screen shots from a game I play called Dwarf Fortress that uses characters from the Terminal/Curses typeset, or at least that is how it is reported in the forums by those who make graphics sets to replace the default character set. However, the game doesn't actually use the system's Terminal font. The game's data files includes a bitmap image that is a grid of all the characters the game uses. So it uses this bitmap to render graphics instead of the actual font file. And I basically want to get a text editor to make it so if I type up some ASCII art to look like a screenshot from Dwarf Fortress, that it will actually look like Dwarf Fortress other than the lack of color. Any help?

    Read the article

  • Codeigniter Best Practices for Model functions

    - by user270797
    Say my application has a "Posts" model, and one of the function is add_post(), it might be something like: function add_post($data) { $this-db-insert('posts',$data); } Where $data is an array: $data = array ('datetime'='2010-10-10 01:11:11', 'title'='test','body'='testing'); Is this best practice? It means if you use that function you need to know the names of the database fields where as my understanding of OOP is that you shouldnt need to know how the method works etc etc

    Read the article

  • How to detect that azure application is running development fabric?

    - by Hasan Khan
    How can I reliability detect whether my Azure application is running in development fabric and not in 'the cloud' ? RoleEnvironment.IsAvailable is true for both. I want something that is true in only one case. I'm asking this because I want users of my library to be able to use my library for free in dev fabric. Hence manually putting seperate identifier or flag in config file and keeping two configs for dev and deploy is not feasible.

    Read the article

  • having trouble with zooming in android webview

    - by Talha
    I'm new to android. I'm using webview in scrollview to display my local html page (html has text only). I created two buttons for zoomin and zoomout using behind function zoomIn() & zoomOut() respectively. These functions work fine. The problenm is, when I zoom in, some of the text goes out from both top and bottom and it doesn't appear when I scroll. How can I resolve this?

    Read the article

  • How do I get the action name from a base controller?

    - by griegs
    Hi, I'd like to implement a base controller on one of my controllers. Within that base controller, I'd like to be able to get the current executing ActionResult name. How would I go about doing this? public class HomeController : ControllerBase { public ActionResult Index() { And; public class ControllerBase : Controller { public ControllerBase() { //method which will get the executing ActionResult } }

    Read the article

  • Using FOP to generate french PDF document, having problem with œ character.

    - by Gautham
    I am using iso-8859-15 encoding both in xml data and in the xslt style sheet. But when I try convert XML doc to FO document 'œ' does'nt show up it shows up as '?' Below is the example of the problem I am facing. The xml data is as follows: Nous sommes sous l'emprise du Divin cœur de Celui que mon fils vénère par-dessus in the fo file the same line is generated as : --------Nous sommes sous l'emprise du Divin c?ur de Celui que mon fils vénère par-dessus As you see all the other accents are getting generated fine except for the 'œ'character. Any help is greatly appreciated. This one issue is holding up a project.

    Read the article

  • Detect Browser Refresh vs. Form Submit in ASP.Net MVC 2

    - by Eric J.
    I have an ASP.Net questionnaire application that resubmits data to the same page, showing a different question each time. There are BACK and NEXT buttons to navigate between questions. I would like to detect when the form is submitted due to a browser refresh vs. one of the buttons being pressed. I came across a WebForms approach but don't know how to apply those principals in an MVC 2 application since page events aren't available (as far as I know... I'm pretty new to Microsoft's MVC model). How would one apply that principle to MVC 2? Is there a better way to detect refresh?

    Read the article

  • Select no tabs in a UITabBar

    - by Tom
    Hi, I'm trying to select no tabs at all in my application. At first the first tab is selected, but I'd like to deselect it so no tabs at all would be selected. Don't ask me why, it's just that way the client wants it! hehe Thanks for your help! PS: I already tried: // rootController = UITabBarController rootController.tabBar.selectedItem = 0; rootController.tabBar.selectedItem = nil; [rootController setSelectedIndex:[rootController.items objectAtIndex:0]]; [rootController setSelectedIndex:nil]; [rootController setSelectedIndex:0]; // That one works : (but I can't select 0 or -1 for instance) [rootController setSelectedIndex:2]; Any ideas? Thanks again!

    Read the article

  • Striving to be boring - or at least have boring systems

    - by merrillaldrich
    A developer I work with, whom I respect a great deal, reminded me of this truism today. I'm not sure who came up with the original, but they deserve credit wherever they are: “A good system administrator is a bored system administrator.” As a DBA, this really rings true for me. Being a DBA should not be a thrilling job. Within reason, there should not be myriad surprises, nor a roller coaster ride, wondering what will break each day. There should not be numerous 2 AM calls or frantic fixes. If there...(read more)

    Read the article

  • Any reason why I shouldn't use couchdb for message passing or realtime activity streams?

    - by Up
    While using ampq or xmpp (rabbitmq or ejabbered that could have couchdb as backends) seems like a good fit to deliver real time updates about friend state in a social gaming platform where updates are small but frequent, I can't help but think why wouldn't couchdb be a good platform to deliver such updates? The main advantage I could think of is its ability to filter updates based on friends and availability of changes api, which makes developing such an application and managing it (including replication) quite easy compared to ampq or xmpp where you have to think about how to manage the pubsub nodes and who is subscribed to them at any point in time. However, I can't help but think this is too good to be true, I can't find information on what couchdb's shortcomings are. Somehow, it feels like using MySQL for message passing which is why I am hesitant to using it. Anyone have any experience in using couchdb for such applications? would you recommend another platform to use?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >