Search Results

Search found 416 results on 17 pages for 'charlie murphy'.

Page 11/17 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to override the default init.tcl

    - by Sean Murphy
    I'm working on a project where I want to make use of TCL as the command interpreter. I have a working c library object which I can load from within the tcl shell but my problem is finding a way to automatically do this while starting a tclsh. Essentially my ultimate goal is to be able to run a script and have it load my library and run some initial startup tcl code before dropping me back to the tclsh command prompt in interactive mode. e.g. tclsh -f myscript.tcl --then-switch-to-interactive or EXPORT TCLINIT=myscript.tcl tclsh The basic goal is to avoid having to distribute tclsh but rather rely in local user installations of tcl. All I would like to distribute is my library, a startup script and a shell command to launch the tclsh with the library preloaded. I've tried using the environment variables TCLINIT and TCL_LIBRARY but they seem to have no effect. The only workable solutions I've found so far are to add "source myscript.tcl" to either the end of /usr/share/tcltk/tcl8.5.init.tcl or ~/.tclshrc However both of these "solutions" are non perfect as they require modification of the default users workspace. It strikes me that there must be a way to handle this in TCL, but my research so far hasn't yielded anything. Does anyone have any suggestions?

    Read the article

  • Sanity check on this idea for an Image Viewer in a web app

    - by Charlie Flowers
    I have an approach in mind for an image viewer in a web app, and want to get a sanity check and any thoughts you stackoverflowers might have. Here's the whirlwind nutshell summary: I'm working on an ASP.NET MVC application that will run in my company's retail stores. Even though it is a web application, we own the store machines and have control over them. We have a "windows agent" running on the store machine which we can talk to via http post (it is a WCF service, and our web app has permission to talk to it from the browser). One of the web pages needs to be an "image viewer" page with some common things like Rotate & Zoom. Now, there are some WebForms controls that offer Rotate and Zoom. However, they take up server resources and generate a good bit of traffic between the server and the browser. For example, the Rotate function would cause an ajax call to the server, which would then generate a new image written to a .NET Canvas object, which would then be written to a file on the server, which would then be returned from the ajax call and refreshed inside the browser. Normally, that's a pretty good way of doing things. But in our case, we have code running on the store machine that we can communicate with. This leads me to consider the following approach: When the user asks to view an image, we tell our "windows agent" to download it from our image server to the store machine. We then redirect our browser to our image viewer page, which will pull the image from the local file we just wrote to the store machine. When the user clicks "Rotate", we cause JavaScript code in the browser to call our "windows agent" software, asking it to perform the "Rotate" function. The "windows agent" does the rotation using the same kind of imaging control that would formerly have been used on the server, but it does so now on the store machine. Javascript in the browser then refreshes the image on the page to show the newly rotated image. Zoom and similar features would be implemented the same way. This seems to be much more efficient, scalable, and responsive for the end-users. However, I've never heard of anything like it being done, mostly because it's rare to have this combination of a web app plus a "windows agent" on the client machine. What do you think? Feasible? Reasonable? Any pitfalls I overlooked or improvements / suggestions you can see? Has anyone done anything like this who would like to offer the wisdom of experience? Thanks!

    Read the article

  • How to start a process from another application and then open a terminal to that process in gnu scre

    - by Charlie
    I'd like to be able to launch a process from a GUI application (right now I'm thinking specifically of letting an eclipse user -- possibly via a plugin -- click a button to launch a build using my organization's build system). I don't want this process to stop when I stop the parent application, and I want to be able to "switch into it" later, as though I launched it from a command line. I've seen GNU screen described as good for most of what I'm asking for, but I'm not sure about the "launch the process from another application" part. Can this be done if the GUI application was itself launched from within screen? Can this be done if it wasn't? I'd be very interested in seeing how! Update: Prepending "screen" to a command line looks like a good way to start a process in screen from a shell, but I'm trying to find a way to do this without being taken straight into that session. I want to "send" the command to a screen session, where it will be started in a new window in that session.

    Read the article

  • python Illegal instruction on AIX5.2

    - by Charlie Epps
    hi,everyone: I run my python script functions like this: read from a text file, and store the data as dict. But when in the loop, an Illegal instruction occurs. why this happens? the psu-code is : d={} datafile=open('a.txt') # a big text file for line in datafile: line=line.rstrip('\n') for token in line.split(): print("Parsing line %d." % token[0]) d[(int(token[0]))]=token[1:] then the message is like this: Parsing line 1. Parsing line 2. ............ Parsing line 1065 Illegal instruction what's the problem? my platform is python 2.6.2 on AIX 5.2. please help me, thanks!

    Read the article

  • Detecting if Excel file has been closed

    - by Charlie
    Hi StackOverflow, I've spent the past 3 hours trawling the web for answers to no avail, so I hope you can help me. I'm writing an application which automates Excel. The application has an option to "show/hide the excel sheet" so you can look at it, make any final changes and so forth. Closing the application will naturally close the instance of Excel, however, there is a small chance that someone may exit out of Excel directly, without thinking. This breaks my application and I can't seem to find anyway of "checking if the same workbook is still open, and if not, re-opening it", before saving it I've tried all sorts of things: checking if the Excel Application is null (when it's !=null it will save correctly, but when it "is" null (or at least, something other than !=null it won't even hit the breakpoint so I'm completely lost :( Help please?

    Read the article

  • STL map--> sort by value?

    - by Charlie Epps
    Hi I wonder how can I implement the STL map sorting by value. For example, I have a map m map<int, int>; m[1] = 10; m[2] = 5; m[4] = 6; m[6] = 1; and then.. I'd like to sort that with the m's value. So, if I print the map, I'd like to get the result like m[6] = 1 m[2] = 5 m[4] = 6 m[1] = 10 this. How can I sort like this way? Is there any way that I can deal with the key and value with sorted values?

    Read the article

  • Minimizing all open windows in C#

    - by Charlie Somerville
    I saw this C++ code on a forum which minimizes all open windows #define MIN_ALL 419 #define MIN_ALL_UNDO 416 int main(int argc, char* argv[]) { HWND lHwnd = FindWindow("Shell_TrayWnd",NULL); SendMessage(lHwnd,WM_COMMAND,MIN_ALL,0); Sleep(2000); SendMessage(lHwnd,WM_COMMAND,MIN_ALL_UNDO,0); return 0; } How can I access the FindWindow and SendMessage API function and the HWND type in C#.net?

    Read the article

  • Regarding using LinkedIn API?

    - by Charlie Epps
    Hi all, My idea is to connect to LinkedIn through the API and work on the public data. My area of concern is where to find Linkedin API and how to use it. I have search a lot but landed no where. Please help me in this regard.

    Read the article

  • How does sizeof calculate the size of structures

    - by Gearoid Murphy
    I know that a char and an int are calculated as being 8 bytes on 32 bit architectures due to alignment, but I recently came across a situation where a structure with 3 shorts was reported as being 6 bytes by the sizeof operator. Code is as follows: #include <iostream> using namespace std ; struct IntAndChar { int a ; unsigned char b ; }; struct ThreeShorts { unsigned short a ; unsigned short b ; unsigned short c ; }; int main() { cout<<sizeof(IntAndChar)<<endl; // outputs '8' cout<<sizeof(ThreeShorts)<<endl; // outputs '6', I expected this to be '8' return 0 ; } Compiler : g++ (Debian 4.3.2-1.1) 4.3.2. This really puzzles me, why isn't alignment enforced for the structure containing 3 shorts?

    Read the article

  • How do I access the CodeDomProvider from a class inheriting from Microsoft.VisualStudio.TextTemplating.VSHost.BaseCodeGeneratorWithSite?

    - by Charlie
    Does anyone know how to get a CodeDomProvider in the new Microsoft.VisualStudio.TextTemplating.VSHost.BaseCodeGeneratorWithSite from the Visual Studio 2010 SDK? I used to get access to it just by in mere inheritance of the class Microsoft.CustomTool.BaseCodeGeneratorWithSite, but now with this new class it is not there. I see a GlobalServiceProvider and a SiteServiceProvider but I can't find any example on how to use them. Microsoft.VisualStudio.TextTemplating.VSHost.BaseCodeGeneratorWithSite: http://msdn.microsoft.com/en-us/library/bb932625.aspx I was to do this: public class Generator : Microsoft.VisualStudio.TextTemplating.VSHost.BaseCodeGeneratorWithSite { public override string GetDefaultExtension() { // GetDefaultExtension IS ALSO NOT ACCESSIBLE... return this.InputFilePath.Substring(this.InputFilePath.LastIndexOf(".")) + ".designer" + base.GetDefaultExtension(); } // This method is being called every time the attached xml is saved. protected override byte[] GenerateCode(string inputFileName, string inputFileContent) { try { // Try to generate the wrapper file. return GenerateSourceCode(inputFileName); } catch (Exception ex) { // In case of a faliure - print the exception // as a comment in the source code. return GenerateExceptionCode(ex); } } public byte[] GenerateSourceCode(string inputFileName) { Dictionary<string, CodeCompileUnit> oCodeUnits; // THIS IS WHERE CodeProvider IS NOT ACCESSIBLE CodeDomProvider oCodeDomProvider = this.CodeProvider; string[] aCode = new MyCustomAPI.GenerateCode(inputFileName, ref oCodeDomProvider); return Encoding.ASCII.GetBytes(String.Join(@" ", aCode)); } private byte[] GenerateExceptionCode(Exception ex) { CodeCompileUnit oCode = new CodeCompileUnit(); CodeNamespace oNamespace = new CodeNamespace("System"); oNamespace.Comments.Add(new CodeCommentStatement(MyCustomAPI.Print(ex))); oCode.Namespaces.Add(oNamespace); string sCode = null; using (StringWriter oSW = new StringWriter()) { using (IndentedTextWriter oITW = new IndentedTextWriter(oSW)) { this.CodeProvider.GenerateCodeFromCompileUnit(oCode, oITW, null); sCode = oSW.ToString(); } } return Encoding.ASCII.GetBytes(sCode ); } } Thanks for your help!

    Read the article

  • Raw Video file from website

    - by Charlie
    I would like to make an app that will download videos files that can be played later. At first i thought I could have a UIWeb view and then try to access the cache of it and get the file that way but unfortunately i don't have access to that. After trying that my next thought would be get the direct link to the video file. Essentially what download helper does on fire fox. Any idea of where i could look at for help or any body have any better idea? Is there any stringByEvaluatingjavascript that might be of use or is there away to access the cache on a webview in your own app? Thanks for any help!

    Read the article

  • Please help us non-C++ developers understand what RAII is

    - by Charlie Flowers
    Another question I thought for sure would have been asked before, but I don't see it in the "Related Questions" list. Could you C++ developers please give us a good description of what RAII is, why it is important, and whether or not it might have any relevance to other languages? I do know a little bit. I believe it stands for "Resource Acquisition is Initialization". However, that name doesn't jive with my (possibly incorrect) understanding of what RAII is: I get the impression that RAII is a way of initializing objects on the stack such that, when those variables go out of scope, the destructors will automatically be called causing the resources to be cleaned up. So why isn't that called "using the stack to trigger cleanup" (UTSTTC:)? How do you get from there to "RAII"? And how can you make something on the stack that will cause the cleanup of something that lives on the heap? Also, are there cases where you can't use RAII? Do you ever find yourself wishing for garbage collection? At least a garbage collector you could use for some objects while letting others be managed? Thanks.

    Read the article

  • dynamic grid style form that lets you update multiple rows in a single post in asp.net mvc

    - by Charlie Bear
    I'm starting out with MVC but not sure it's the best option. I need to create a form that is based upon a collection. Eg it might look like this: product Price Item 1 [textbox] Item 2 [textbox] [submit button] where "item" is pulled from the database and textbox allows users to update the price. essentially this is a type of datagrid but i don't want webforms style update each row one at a time i need to update the entire set of text boxes in one post. Ideally I don't want a javascript based solution as it has to work without javascript. Is this possible in MVC or should I stick to webforms (where I could do this in a repeater by iterating through he repeater items on postback)

    Read the article

  • Problem running oracle script from command line using sqlplus

    - by Charlie
    I'm having a problem trying to run my sql script into oracle using sqlplus. The script just populates some dummy data: DECLARE role1Id NUMBER; user1Id NUMBER; role2Id NUMBER; user2Id NUMBER; role3Id NUMBER; user3Id NUMBER; perm1Id NUMBER; perm2Id NUMBER; perm3Id NUMBER; perm4Id NUMBER; perm5Id NUMBER; BEGIN INSERT INTO PB_USER(USER_ID,USER_NAME, USER_EMAIL, USER_ACTIVEYN) VALUES(PB_USER_ID_SEQ.nextval, 'RoleDataManagerTests_Username', '[email protected]',' '); INSERT INTO ROLES(ROLE_ID, ROLE_NAME) VALUES(PB_ROLE_ID_SEQ.nextval, 'Test role 1'); INSERT INTO ROLES(ROLE_ID, ROLE_NAME) VALUES(PB_ROLE_ID_SEQ.nextval, 'Test role 2'); INSERT INTO ROLES(ROLE_ID, ROLE_NAME) VALUES(PB_ROLE_ID_SEQ.nextval, 'Test role 3'); SELECT ROLE_ID INTO role1Id FROM ROLES WHERE ROLE_NAME = 'Test role 1'; SELECT USER_ID INTO user1Id FROM PB_USER WHERE USER_NAME = 'RoleDataManagerTests_Username'; INSERT INTO USERS_ROLES(USER_ID, ROLE_ID) VALUES(user1Id, role1Id); SELECT ROLE_ID INTO role2Id FROM ROLES WHERE ROLE_NAME = 'Test role 2'; SELECT USER_ID INTO user2Id FROM PB_USER WHERE USER_NAME = 'RoleDataManagerTests_Username'; INSERT INTO USERS_ROLES(USER_ID, ROLE_ID) VALUES(user2Id, role2Id); SELECT ROLE_ID INTO role3Id FROM ROLES WHERE ROLE_NAME = 'Test role 3'; SELECT USER_ID INTO user3Id FROM PB_USER WHERE USER_NAME = 'RoleDataManagerTests_Username'; INSERT INTO USERS_ROLES(USER_ID, ROLE_ID) VALUES(user3Id, role3Id); INSERT INTO PERMISSIONS(PERMISSION_ID, KEY, DESCRIPTION) VALUES (PB_PERMISSION_ID_SEQ.nextval, 'perm1', 'permission 1'); INSERT INTO PERMISSIONS(PERMISSION_ID, KEY, DESCRIPTION) VALUES (PB_PERMISSION_ID_SEQ.nextval, 'perm2', 'permission 2'); INSERT INTO PERMISSIONS(PERMISSION_ID, KEY, DESCRIPTION) VALUES (PB_PERMISSION_ID_SEQ.nextval, 'perm3', 'permission 3'); INSERT INTO PERMISSIONS(PERMISSION_ID, KEY, DESCRIPTION) VALUES (PB_PERMISSION_ID_SEQ.nextval, 'perm4', 'permission 4'); INSERT INTO PERMISSIONS(PERMISSION_ID, KEY, DESCRIPTION) VALUES (PB_PERMISSION_ID_SEQ.nextval, 'perm5', 'permission 5'); SELECT PERMISSION_ID INTO perm1Id FROM PERMISSIONS WHERE KEY = 'perm1'; SELECT PERMISSION_ID INTO perm2Id FROM PERMISSIONS WHERE KEY = 'perm2'; SELECT PERMISSION_ID INTO perm3Id FROM PERMISSIONS WHERE KEY = 'perm3'; SELECT PERMISSION_ID INTO perm4Id FROM PERMISSIONS WHERE KEY = 'perm4'; SELECT PERMISSION_ID INTO perm5Id FROM PERMISSIONS WHERE KEY = 'perm5'; INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role1Id, perm1Id); INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role1Id, perm2Id); INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role1Id, perm3Id); INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role2Id, perm3Id); INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role3Id, perm4Id); INSERT INTO ROLES_PERMISSIONS(ROLE_ID, PERMISSION_ID) VALUES(role3Id, perm5Id); END; / My script works fine when I run it using Oracle SQL Developer but when I use the sqlplus command line tool this is what's outputted and then it just hangs: SQL*Plus: Release 11.1.0.7.0 - Production on Tue May 11 09:49:34 2010 Copyright (c) 1982, 2008, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production With the Partitioning, Oracle Label Security, OLAP, Data Mining Scoring Engine and Real Application Testing options I'm running the tool using this command line, which works fine for other scripts: sqlplus username/password@server/dbname @Setup.sql Any ideas? Thanks.

    Read the article

  • Anyone have experience calling Rake from MSBuild for code gen and other benefits? How did it go? Wha

    - by Charlie Flowers
    While programming in C# using Visual Studio 2008, I often wish for "automatic" code generation. If possible, I'd like to achieve it by making my MSBuild solution file call out to Rake, which would call Ruby code for the code generation, having the resulting generated files automatically appear in my solution. Here's one business example (of many possible examples I could name) where this kind of automatic code generation would be helpful. In a recent project I had an interface with some properties that contained dollar amounts. I wanted a second interface and a third interface that had the same properties as the first interface, except they were "qualified" with a business unit name. Something like this: public interface IQuarterlyResults { double TotalRevenue { get; set; } double NetProfit { get; set; } } public interface IConsumerQuarterlyResults { double ConsumerTotalRevenue { get; set; } double ConsumerNetProfit { get; set; } } public interface ICorporateQuarterResults { double CorporateTotalRevenue { get; set; } double CorporateNetProfit { get; set; } } In this example, there is a "Consumer Business Unit" and a "Corporate Business Unit". Every property on IQuarterlyResults becomes a property called "Corporate" + [property name] on ICorporateQuarterlyResults, and likewise for IConsumerQuarterlyResults. Why make interfaces for these, rather than merely having an instance of IQuarterlyResults for Consumer and another instance for Corporate? Because, when working with the calculator object I was building, the user had to deal with 100's of properties, and it is much less confusing if he can deal with "fully qualified" property names such as "ConsumerNetProfit". But let's not get bogged down in this example. It is only an example and not the main question. The main question is this: I love using Ruby and ERB for code generation, and I love using Rake to manage dependencies between tasks. To solve the problem above, what I'd like to do is have MSBuild call out to Rake, and have Rake / Ruby read the list of properties on the "core" interface and then generate the code to make all the dependent interfaces and their properties. This would get triggered every time I do a build, because I'd put it into the MSBuild file for the VS.NET solution. Has anyone tried anything like this? How did it work out for you? What insights can you share about pros, cons, tips for success, etc.? Thanks!

    Read the article

  • What should the name of this class be?

    - by Tim Murphy
    Naming classes is sometimes hard. What do you think name of the class should be? I originally created the class to use as a cache but can see its may have other uses. Example code to use the class. Dim cache = New NamePendingDictionary(Of String, Sample) Dim value = cache("a", Function() New Sample()) And here is the class that needs a name. ''' <summary> ''' Enhancement of <see cref="System.Collections.Generic.Dictionary"/>. See the Item property ''' for more details. ''' </summary> ''' <typeparam name="TKey">The type of the keys in the dictionary.</typeparam> ''' <typeparam name="TValue">The type of the values in the dictionary.</typeparam> Public Class NamePendingDictionary(Of TKey, TValue) Inherits Dictionary(Of TKey, TValue) Delegate Function DefaultValue() As TValue ''' <summary> ''' Gets or sets the value associated with the specified key. If the specified key does not exist ''' then <paramref name="createDefaultValue"/> is invoked and added to the dictionary. The created ''' value is then returned. ''' </summary> ''' <param name="key">The key of the value to get.</param> ''' <param name="createDefaultValue"> ''' The delegate to invoke if <paramref name="key"/> does not exist in the dictionary. ''' </param> ''' <exception cref="T:System.ArgumentNullException"><paramref name="key" /> is null.</exception> Default Public Overloads ReadOnly Property Item(ByVal key As TKey, ByVal createDefaultValue As DefaultValue) As TValue Get Dim value As TValue If createDefaultValue Is Nothing Then Throw New ArgumentNullException("createValue") End If If Not Me.TryGetValue(key, value) Then value = createDefaultValue.Invoke() Me.Add(key, value) End If Return value End Get End Property End Class

    Read the article

  • jQuery UI selectable won't work with anything besides '#selectable'

    - by Ross Murphy
    I am trying to use 2 instances of the jquery selector UI on my site and it won't seem to work with anything besides '#selectable' as the ordered list id. Here is my code.. <script type="text/javascript"> $(document).ready(function() { $("#selectable").selectable(); }); </script> <ol id="selectable"> <li class="ui-widget-content">Item 1</li> <li class="ui-widget-content">Item 2</li> <li class="ui-widget-content">Item 3</li> <li class="ui-widget-content">Item 4</li> <li class="ui-widget-content">Item 5</li> <li class="ui-widget-content">Item 6</li> <li class="ui-widget-content">Item 7</li> </ol> But if i try to use something other than selectable, it doesn't work.. anyone have similar issues?

    Read the article

  • Git-Based Source Control in the Enterprise: Suggested Tools and Practices?

    - by Bob Murphy
    I use git for personal projects and think it's great. It's fast, flexible, powerful, and works great for remote development. But now it's mandated at work and, frankly, we're having problems. Out of the box, git doesn't seem to work well for centralized development in a large (20+ developer) organization with developers of varying abilities and levels of git sophistication - especially compared with other source-control systems like Perforce or Subversion, which are aimed at that kind of environment. (Yes, I know, Linus never intended it for that.) But - for political reasons - we're stuck with git, even if it sucks for what we're trying to do with it. Here are some of the things we're seeing: The GUI tools aren't mature Using the command line tools, it's far to easy to screw up a merge and obliterate someone else's changes It doesn't offer per-user repository permissions beyond global read-only or read-write privileges If you have a permission to ANY part of a repository, you can do that same thing to EVERY part of the repository, so you can't do something like make a small-group tracking branch on the central server that other people can't mess with. Workflows other than "anything goes" or "benevolent dictator" are hard to encourage, let alone enforce It's not clear whether it's better to use a single big repository (which lets everybody mess with everything) or lots of per-component repositories (which make for headaches trying to synchronize versions). With multiple repositories, it's also not clear how to replicate all the sources someone else has by pulling from the central repository, or to do something like get everything as of 4:30 yesterday afternoon. However, I've heard that people are using git successfully in large development organizations. If you're in that situation - or if you generally have tools, tips and tricks for making it easier and more productive to use git in a large organization where some folks are not command line fans - I'd love to hear what you have to suggest. BTW, I've asked a version of this question already on LinkedIn, and got no real answers but lots of "gosh, I'd love to know that too!"

    Read the article

  • Only the last run in a for loop in Javascript works

    - by Mengfei Murphy
    Here is a for loop written by Javascript. It is trying to apply queries for websql. for (var i = 0; i < 10; i++){ db.transaction(function (tx){ tx.executeSql('INSERT INTO ProjSetsT (ProjID) VALUES (?);', [i]); }); } The attempt is obvious, I tried to add values "0, 1, 2, ... 9" into column ProjID in table ProjSetsT. It does not work. I only got the last element, i.e. "9" inserted, but not the first eight numbers. Is there any syntax mistakes?

    Read the article

  • Is there an exponent operator in C#?

    - by Charlie
    For example, does an operator exist to handle this? float Result, Number1, Number2; Number1 = 2; Number2 = 2; Result = Number1 (operator) Number2; In the past the ^ operator has served as an exponential operator in other languages, but in C# it is a bit-wise operator. Do I have to write a loop or include another namespace to handle exponential operations? If so, how do I handle exponential operations using non-integers?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >