Search Results

Search found 116 results on 5 pages for 'hugh powell'.

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

  • Using WHMCS API with a C# .NET Application

    - by Brett Powell
    I just started taking a class on C# .NET and have found it really fascinating how simple it is. I have been using C++ for years, so the simplistic nature is actually hitting me as somewhat confusing. I would like to do something along these lines... http://wiki.whmcs.com/API:Example_Usage Would it be easy to do this from a C# .NET application, or would I still be in about the same boat as C++ (build libcurl, grab a bunch of other libs, etc)?

    Read the article

  • C++ _beginthreadex in cygwin

    - by Hugh
    Hello all, I am aware that _beginthreadex is part of the MSCVRT functions and therefore not accessible via Cygwin/MinGW uintptr_t _beginthreadex( void *security, unsigned stack_size, unsigned ( __stdcall *start_address )( void * ), void *arglist, unsigned initflag, unsigned *thrdaddr ); However, _beginthreadex does call upon CreateThread(). HANDLE CreateThread( LPSECURITY_ATTRIBUTES secAttr, SIZE_T stackSize, LPTHREAD_START_ROUTINE threadFunc, LPVOID param, DWORD flags, LPDWORD threadID ); However, does anyone have a wrapper or a URL to a library that is compatible with Cygwin/WinGW. Or can offer some advice? As this is the last little piece of moving from VSutdio Project over to makefiles for Windows/Darwin/Linux. Thanks.

    Read the article

  • How do I copy a python function to a remote machine and then execute it?

    - by Hugh
    I'm trying to create a construct in Python 3 that will allow me to easily execute a function on a remote machine. Assuming I've already got a python tcp server that will run the functions it receives, running on the remote server, I'm currently looking at using a decorator like @execute_on(address, port) This would create the necessary context required to execute the function it is decorating and then send the function and context to the tcp server on the remote machine, which then executes it. Firstly, is this somewhat sane? And if not could you recommend a better approach? I've done some googling but haven't found anything that meets these needs. I've got a quick and dirty implementation for the tcp server and client so fairly sure that'll work. I can get a string representation the function (e.g. func) being passed to the decorator by import inspect string = inspect.getsource(func) which can then be sent to the server where it can be executed. The problem is, how do I get all of the context information that the function requires to execute? For example, if func is defined as follows, import MyModule def func(): result = MyModule.my_func() MyModule will need to be available to func either in the global context or funcs local context on the remote server. In this case that's relatively trivial but it can get so much more complicated depending on when and how import statements are used. Is there an easy and elegant way to do this in Python? The best I've come up with at the moment is using the ast library to pull out all import statements, using the inspect module to get string representations of those modules and then reconstructing the entire context on the remote server. Not particularly elegant and I can see lots of room for error. Thanks for your time

    Read the article

  • Is it possible to run Visual Studio Database Edition schema migrations from the command line?

    - by Damian Powell
    Visual Studio 2008 Database Edition (Data Dude) has the ability to perform schema comparisons between databases and generate a script which migrates from one database to the other. Is it possible to perform this comparison and generate the migration script from the command line? If so, what are the command line tools, and are the same tools used in equivalent versions of Visual Studio 2010?

    Read the article

  • What disables "Run Project" in Expression Blend 3

    - by Hugh
    I am developing a Sketchflow (Silverlight) project in Expression Blend 3. It has been working fine up until today, now I cannot run the project. Specifically in the Project menu the "Run Project" option is now greyed out (all the other options are fine). F5 also doesn't have any effect. I've obviously messed up the code somewhere but I can't find any information on what could cause the "Run Project" option to be disabled. This would obviously help the troubleshooting. Does anybody know what controls this functionality? I can build the project no problem. And if I package the project (so it runs outside Expression) this also works fine. It is just launching it from Expression that doesn't work.

    Read the article

  • Challenge: Neater way of currying or partially applying C#4's string.Join

    - by Damian Powell
    Background I recently read that .NET 4's System.String class has a new overload of the Join method. This new overload takes a separator, and an IEnumerable<T> which allows arbitrary collections to be joined into a single string without the need to convert to an intermediate string array. Cool! That means I can now do this: var evenNums = Enumerable.Range(1, 100) .Where(i => i%2 == 0); var list = string.Join(",",evenNums); ...instead of this: var evenNums = Enumerable.Range(1, 100) .Where(i => i%2 == 0) .Select(i => i.ToString()) .ToArray(); var list = string.Join(",", evenNums); ...thus saving on a conversion of every item to a string, and then the allocation of an array. The Problem However, being a fan of the functional style of programming in general, and method chaining in C# in particular, I would prefer to be able to write something like this: var list = Enumerable.Range(1, 100) .Where(i => i%2 == 0) .string.Join(","); This is not legal C# though. The closest I've managed to get is this: var list = Enumerable.Range(1, 100) .Where(i => i%2 == 0) .ApplyTo( Functional.Curry<string, IEnumerable<object>, string> (string.Join)(",") ); ...using the following extension methods: public static class Functional { public static TRslt ApplyTo<TArg, TRslt>(this TArg arg, Func<TArg, TRslt> func) { return func(arg); } public static Func<T1, Func<T2, TResult>> Curry<T1, T2, TResult>(this Func<T1, T2, TResult> func) { Func<Func<T1, T2, TResult>, Func<T1, Func<T2, TResult>>> curried = f => x => y => f(x, y); return curried(func); } } This is quite verbose, requires explicit definition of the parameters and return type of the string.Join overload I want to use, and relies upon C#4's variance features because we are defining one of the arguments as IEnumerable rather than IEnumerable. The Challenge Can you find a neater way of achieving this using the method-chaining style of programming?

    Read the article

  • Out of Memory When Loading Java Entities

    - by Hugh Buchanan
    I have a terrible problem that hopefully has a very simple answer. I am running out of memory when I perform a basic If I have code like this: MyEntity myEntity; for (Object id: someIdList) { myEntity = find(id); // do something basic with myEntity } And the find() method is a standard EntityManager related method: public MyEntity find(Object id) { return em.find(mycorp.ejb.entity.MyEntity.class, id); } This code worked a couple of weeks ago, and works fine if there are fewer items in the database. The resulting error I am facing is: java.lang.OutOfMemoryError: GC overhead limit exceeded The exception is coming from oracle toplink calling some oracle jdbc methods. The loop exists because an EJBQL such as "select object(o) from MyEntity as o" will overload the application server when there are lots of records.

    Read the article

  • Which languages support *recursive* function literals / anonymous functions?

    - by Hugh Allen
    It seems quite a few mainstream languages support function literals these days. They are also called anonymous functions, but I don't care if they have a name. The important thing is that a function literal is an expression which yields a function which hasn't already been defined elsewhere, so for example in C, &printf doesn't count. EDIT to add: if you have a genuine function literal expression <exp>, you should be able to pass it to a function f(<exp>) or immediately apply it to an argument, ie. <exp>(5). I'm curious which languages let you write function literals which are recursive. Wikipedia's "anonymous recursion" article doesn't give any programming examples. Let's use the recursive factorial function as the example. Here are the ones I know: JavaScript / ECMAScript can do it with callee: function(n){if (n<2) {return 1;} else {return n * arguments.callee(n-1);}} it's easy in languages with letrec, eg Haskell (which calls it let): let fac x = if x<2 then 1 else fac (x-1) * x in fac and there are equivalents in Lisp and Scheme. Note that the binding of fac is local to the expression, so the whole expression is in fact an anonymous function. Are there any others?

    Read the article

  • Dangers of Windows API and Administrator accounts?

    - by Brett Powell
    I wrote a game server plugin last night that allowed me to create a user account and set it as administrator, which is a huge problem. Of course the simple fix is to create a basic user account with limited privileges for the game servers, so they would not have access to do things like this. I wanted to find out if there's anything else in the Windows API that would create such a huge vulnerability though? I guess I want to just make sure that when the client's game servers accounts are moved to limited access accounts, we won't have to worry about any of them using the windows API to sabotage the machines. There is already enough exploits in the game itself to worry about, without having to worry about client's taking over the machines with plugins lol. Some of the questions relative would be... Can you disable/enable Remote Desktop from c++? Can you get a list of AD user groups from c++? (not that a user belongs to, but a complete list)

    Read the article

  • app-engine-patch and "object_detail" view didn't work

    - by Hugh
    Hi(Sorry for my ugly english) When I calling the flowing: http://192.168.62.90:8000/blog/entry/?agphdXR1bW4xOTEychALEgpibG9nX2VudHJ5GCYM will use this: urlpatterns = patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), (r'^$', list_detail.object_list, entry_info), (r'^entry/(?P<object_id>.*)$', list_detail.object_detail, {'queryset': Entry.all(), 'template_name': 'sample_test_page.html'}), ) and the error is: Generic view must be called with either an object_id or a slug/slug_field. I want to know why this didn't work for me.

    Read the article

  • How do you pass or share variables between django views?

    - by Hugh
    Hi, I'm kind of lost as to how to do this: I have some chained select boxes, with one select box per view. Each choice should be saved so that a query is built up. At the end, the query should be run. But how do you share state in django? I can pass from view to template, but not template to view and not view to view. Or I'm truly not sure how to do this. Please help!

    Read the article

  • WPF Issues with Control Layout

    - by Brett Powell
    I am making an application that connects to our billing software using its API, and I am running into a few issues getting the layout working properly. I want to make it so that when one of the expanders is minimized, the other window fills the gap, and when it is expanded again the other expander goes back to where it was. Right now when the arrow is clicked on one, there is just an empty gap. I used a DockPanel as the parent which I assumed would automatically do this, but it isn't working. Second question, is there a way to make these areas resizable? I don't want to try and get too frisky with allowing the user to undock the menus (don't even know if that is possible with just straight WPF) but it would be nice if they could change the width/height of them. Also, just a newbie question to C#, but what is the equivalent of a C++ header file? It looks like you just use .cs files, but I am not sure. I want to extract all of my functions that pull the data from the billing software and put them into a different file to clean up the code. Here is my XAML... <Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Billing Management" Height="550" Width="754" xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared" WindowStartupLocation="CenterScreen" WindowStyle="ThreeDBorderWindow"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="22" /> <RowDefinition /> </Grid.RowDefinitions> <Menu Height="22" Name="menu1" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Top" HorizontalContentAlignment="Left" IsEnabled="True" IsMainMenu="True"> <MenuItem Header="_File"> <MenuItem Header="_Open" /> <MenuItem Header="_Close" /> <Separator/> <MenuItem Header="_Exit" /> </MenuItem> </Menu> <TabControl Name="tabControl1" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" BorderThickness="1" Padding="0" TabStripPlacement="Bottom" UseLayoutRounding="False" FlowDirection="LeftToRight" Grid.Row="1"> <TabItem Header="Main" Name="tabItem1" Margin="0"> <DockPanel Name="dockPanel1" LastChildFill="True"> <ListBox Height="100" Name="listBox3" DockPanel.Dock="Top" /> <ListBox Name="listBox4" Width="200" DockPanel.Dock="Right" /> <DockPanel Height="Auto" Name="dockPanel2" Width="Auto" VerticalAlignment="Stretch" LastChildFill="True"> <shared:AnimatedExpander Header="Staff Online" Width="200" Name="expanderStaffOnline" IsExpanded="True" Height="194" BorderThickness="0" DockPanel.Dock="Top" VerticalContentAlignment="Stretch"> <ListBox Name="listboxStaffOnline" Width="Auto" Height="Auto" Margin="0" VerticalAlignment="Stretch" Loaded="listboxStaffOnline_Loaded" /> </shared:AnimatedExpander> <shared:AnimatedExpander Header="Test Menu 2" Height="Auto" Name="animatedExpander1" BorderThickness="1" Margin="0,0,0,0" IsExpanded="True" VerticalContentAlignment="Stretch"> <ListBox Height="Auto" HorizontalAlignment="Stretch" Name="listBox6" VerticalAlignment="Stretch" Margin="0" BorderThickness="1" /> </shared:AnimatedExpander> </DockPanel> <ListBox Height="100" Name="listboxAdminLogs" DockPanel.Dock="Bottom" Loaded="listboxAdminLogs_Loaded" /> <ListBox Name="listBox5" /> </DockPanel> </TabItem> <TabItem Header="Support" Name="tabItem2" Margin="0"> </TabItem> <TabItem Header="Clients" /> <TabItem Header="Billing" /> <TabItem Header="Orders" /> </TabControl> </Grid> </Window>

    Read the article

  • How do I draw a filled circle onto a graphics object in a hexadecimal colour? (C#)

    - by George Powell
    I need to draw a circle onto a bitmap in a specific colour given in Hex. The "Brushes" class only gives specific colours with names. Bitmap bitmap = new Bitmap(20, 20); Graphics g = Graphics.FromImage(bitmap); g.FillEllipse(Brushes.AliceBlue, 0, 0, 19, 19); //The input parameter is not a Hex //g.FillEllipse(new Brush("#ff00ffff"), 0, 0, 19, 19); <<This is the kind of think I need. Is there a way of doing this? The exact problem: I am generating KML (for Google earth) and I am generating lots of lines with different Hex colours. The colours are generated mathematically and I need to keep it that way so I can make as many colours as I want. I need to generate a PNG icon for each of the lines that is the same colour exactly.

    Read the article

  • Inject App Settings using Windsor

    - by Damian Powell
    How can I inject the value of an appSettings entry (from app.config or web.config) into a service using the Windsor container? If I wanted to inject the value of a Windsor property into a service, I would do something like this: <properties> <importantIntegerProperty>666</importantIntegerProperty> </properties> <component id="myComponent" service="MyApp.IService, MyApp" type="MyApp.Service, MyApp" > <parameters> <importantInteger>#{importantIntegerProperty}</importantInteger> </parameters> </component> However, what I'd really like to do is take the value represented by #{importantIntegerProperty} from an app settings variable which might be defined like this: <appSettings> <add key="importantInteger" value="666"/> </appSettings> EDIT: To clarify; I realise that this is not natively possible with Windsor and the David Hayden article that sliderhouserules refers to is actually about his own (David Hayden's) IoC container, not Windsor. I'm surely not the first person to have this problem so what I'd like to know is how have other people solved this issue?

    Read the article

  • How to test for existence of a script-scoped variable in PowerShell?

    - by Damian Powell
    Is it possible to test for the existence of a script-scoped variable in PowerShell? I've been using the PowerShell Community Extensions (PSCX) but I've noticed that if you import the module while Set-PSDebug -Strict is set, an error is produced: The variable '$SCRIPT:helpCache' cannot be retrieved because it has not been set. At C:\Users\...\Modules\Pscx\Modules\GetHelp\Pscx.GetHelp.psm1:5 char:24 While investigating how I might fix this, I found this piece of code in Pscx.GetHelp.psm1: #requires -version 2.0 param([string[]]$PreCacheList) if ((!$SCRIPT:helpCache) -or $RefreshCache) { $SCRIPT:helpCache = @{} } This is pretty straight forward code; if the cache doesn't exist or needs to be refreshed, create a new, empty cache. The problem is that calling $SCRIPT:helpCache while Set-PSDebug -Strict is in force casues the error because the variable hasn't been defined yet. Ideally, we could use a Test-Variable cmdlet but such a thing doesn't exist! I thought about looking in the variable: provider but I don't know how to determine the scope of a variable. So my question is: how can I test for the existence of a variable while Set-PSDebug -Strict is in force, without causing an error?

    Read the article

  • Where can I find a good definition of a Software construct?

    - by Hugh
    I have scoured for 2 hours now across the internet, I have found courses with modules on software constructs but no clear definition only hints as to what one is. As far as I understand the definition it is an object that can be defined with a purpose for example a TCP/IP connection uses a Port which is a Software construct. Can anyone refer me to a full definition or give a more robust one?

    Read the article

  • Dynamically creating page definitions in Cherrypy

    - by Hugh
    Hi, I've been looking around the CherryPy documentation, but can't quite get my head around what I want to do. I suspect it might be more of a Python thing than a CherryPy thing... My current class looks something like this: import managerUtils class WebManager: def A(self, **kwds): return managerUtils.runAction("A", kwds) A.enabled = True def B(self, **kwds): return managerUtils.runAction("B", kwds) B.enabled = True def C(self, **kwds): return managerUtils.runAction("C", kwds) C.enabled = True Obviously there's a lot of repetition in here. in managerUtils.py, I have a dict that's something like: actions = {'A': functionToRunForA, 'B': functionToRunForB, 'C': functionToRunForC} Okay, so that's a slightly simplistic view of it, but I'm sure you get the idea. I want to be able to do something like: import managerUtils class WebManager: def __init__(self): for action in managerUtils.actions: f = registerFunction(action) f.enabled = True Any ideas of how to do this?

    Read the article

  • Per-process CPU usage on Win95 / Win98 / WinME

    - by Hugh Allen
    How can you programmatically measure per-process (or better, per-thread) CPU usage under windows 95, windows 98 and windows ME? If it requires the DDK, where can you obtain that? Please note the Win9x requirement. It's easy on NT. EDIT: I tried installing the Win95/98 version of WMI, but Win32_Process.KernelModeTime and Win32_Process.UserModeTime return Null (as do most Win32_Process properties under win9x).

    Read the article

  • How can I ensure that a Java object (containing cryptographic material) is zeroized?

    - by Jeremy Powell
    My concern is that cryptographic keys and secrets that are managed by the garbage collector may be copied and moved around in memory without zeroization. As a possible solution, is it enough to: public class Key { private char[] key; // ... protected void finalize() throws Throwable { try { for(int k = 0; k < key.length; k++) { key[k] = '\0'; } } catch (Exception e) { //... } finally { super.finalize(); } } // ... }

    Read the article

  • use viewengine only within certain area

    - by Daniel Powell
    Is it possible to use a custom view engine for a specific area only? I have tried public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( "Forms_default", "Forms/{client}/{controller}/{action}/{id}", new { client="Generic",action = "Index", id = UrlParameter.Optional } ); ViewEngines.Engines.Clear(); ViewEngines.Engines.Add(new ClientSpecificViewEngine()); } Within my area but this seems to be a site wide affect as I'm getting errors specific to the custom view engine when visiting pages outside the area.

    Read the article

  • How do I draw a filled circle onto a graphics object in a hexadecimal colour?

    - by George Powell
    I need to draw a circle onto a bitmap in a specific colour given in Hex. The "Brushes" class only gives specific colours with names. Bitmap bitmap = new Bitmap(20, 20); Graphics g = Graphics.FromImage(bitmap); g.FillEllipse(Brushes.AliceBlue, 0, 0, 19, 19); //The input parameter is not a Hex //g.FillEllipse(new Brush("#ff00ffff"), 0, 0, 19, 19); <<This is the kind of think I need. Is there a way of doing this? The exact problem: I am generating KML (for Google earth) and I am generating lots of lines with different Hex colours. The colours are generated mathematically and I need to keep it that way so I can make as many colours as I want. I need to generate a PNG icon for each of the lines that is the same colour exactly.

    Read the article

  • Checking if Date is within Range

    - by Brett Powell
    So I am using a scripting language with c++ syntax, and trying to think of the best way to check if a date is within range. The problem I am running into is that if the current day is in a new month, the check is failing. Here is what my code looks like... if(iMonth >= iStartMonth && iMonth <= iEndMonth) { if(iDay >= iStartDay && iDay <= iEndDay) { if(iYear >= iStartYear && iYear <= iEndYear) { bEnabled = true; return; When I have something like this... (Pulled in from cfg file specified by client) Start date: 3 27 2010 End Date: 4 15 2010 Current Date: 3 31 2010 The day check fails because if(iDay <= iEndDay) does not pass. The scripting language doesn't have a lot of time related functions, and I cant compare timestamps because im allowing users to put like "03:27:2010" and "04:15:2010" as start/end dates in a config file. Im assuming I am just not thinking straight and missing an easy fix.

    Read the article

  • SQL Query Update is not working

    - by Brett Powell
    Hey guys, I am using pawn script for something, and everything works great except for one of my queries. For some reason, it will not work, and I am hoping it is simple enough someone can spot my mistake as I have been banging my head on it for days. http://ampaste.net/m6a887d30 The two highlighted lines are the queries that are not working. The other one works fine, but the values for 'class1kills' and 'class2kills' remain at 0. Here is a screenshot from phpmyadmin incase I did something silly. http://brutalservers.net/sql.png

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >