Does Windows provide some sort of evented API so I can run some code whenever a drive (say a usb stick) is attached?
Like ReadDirectoryChangesW is for events on the filesystem?
To interact with excel in Powershell it is common to start a new excel as follows:
$x = New-Object -comobject Excel.Application
Instead of that I have an open Excel process already.
(I get it as follows)
$excelprocess = Get-Process | Where-Object {$_.name -eq "excel"} | Sort-Object -Property "Starttime" -descending | Select-Object -First 1
Is there a way to interact with this specific excel process over PS?
I have seen this user interface in some screen shots of some RSS Readers. It is a multi-pane user interface. THere are three panels or "panes" to the window, in other words, the window is divided into three parts and the user is able to mouse over the division and click on the seperation bar and resize the section.
How is this sort of GUI developed in C#?
I have a default.aspx page that needs to be refresh every 10 sec.
My solution so far is a javascript function, but it only works in firefux and not IE.
I'm looking for a way to handle the refresh mecanism in the default.aspx.cs page instead, with some sort of Timer.
Any good simple sugestions/hints or solutions out there that can lead me in the right direction?
I need to sort a 2 dimensional array of doubles on multiple columns using either C or C++. Could someone point me to the algorithm that I should use or an existing library (perhaps boost?) that has this functionality?
I have a feeling that writing a recursive function may be the way to go but I am too lazy to write out the algorithm or implement it myself if it has been done elsewhere. :-)
Thanks
I want to have each instance of some class have a unique integer identifier based on the order that I create them, starting with (say) 0. In Java, I could do this with a static class variable. I know I can emulate the same sort of behavior with Python, but what would be the most 'Pythonic' way to do this?
Thanks
I am using the MapKit for the iPhone and have it setup to get the user's location and display it on the view. But I need to know which state they're in so I know what data to load and display to the user. Is there any way to get that sort of info?
I've written a subscription based web app that I want to charge (by credit card) a monthly fee. There are 3 different plans and once they sign up, they should be billed that amount, automatically, every month until they cancel. Is there an easy way to set this up (some sort of online service maybe?).
Hello, I'm trying to recreate a sort of table layout of a contact form.
Here's the current form: http://www.radonsystems.net/contact-us
and this is what the work-in-progress is like
http://www.radonsystems.net/newsite/?do=contact-us
As you can see, there is an issue with the second form - I just don't know how to fix it.
Any ideas on what I'm doing wrong?
The style (CSS) for that part, is nearly 100% copied over, only that I've changed the font, but kept within same family.
I'm looking for a bus to connect a nios-II core to an external vhdl module i have written. I can probably do it with GPIOs but this seems like a poor way of doing it and pretty much requires me to implement my own bus from scratch. Does altera provide any sort of bus like structure in SOPC I could use to do this? Thanks!
I've got a UITableView that is sortable, but that's it. Right now, I have all the cells set to UITableViewCellEditingStyleNone, but this still moves the TextLabel of the cell over to the right by 40 pixels. Is there anyway to get edit mode, and the sort icon at the right, without shifting the TextLabel over?
I have need to access subversion data (commit messages, files updated, revision numbers, dates modified, author, etc.) externally. Is this something for some sort of subversion hook or is there a decent third party package for this or some other "best practice" way to approach accessing subversion data externally (and by external I mean from a php/ruby or python script... external to subversion itself)?
I run a site where users can upload content that is displayed in a gallery where other users can sort and filter that content. While implementing RSS feeds, I was wondering how common it was for an RSS feed to display items in an order that's different from chronological. For example, displaying content by Most Views first. This could be useful for someone wanting to keep tabs on trending content. How do RSS readers handle this, since most RSS feeds are ordered chronologically?
For some reason this function confused me:
def protocol(port):
return port == "443" and "https://" or "http://"
Can somebody explain the order of what's happening behind the scenes to make this work the way it does.
I understood it as this until I tried it:
Either A)
def protocol(port):
if port == "443":
if bool("https://"):
return True
elif bool("http://"):
return True
return False
Or B)
def protocol(port):
if port == "443":
return True + "https://"
else:
return True + "http://"
Is this some sort of special case in Python, or am I completely misunderstanding how statements work?
I am working on an ASP.Net web application in which several WCF services are being used. At client level, I am creating channel factory mechanism to invoke service operations. Right now, I have created an assembly having classes used for channel factory creation code for every service. As per my assumption this is some sort of
facade pattern. Please help me to find a better approach or any design pattern, which I can use here.
I have a node in Drupal with a few comments. Is there an easyish way to get the CID of every comment within the node? Also, is there a way to sort them by various parameters, chronology, karma of the comment etc. Thank you.
Sorry about the bad heading, but the question was not easy to compress into one sentence...
I have two lists of contigs (list1 and list2). They contain mostly unique contigs, but with some overlap. I want to compare list1 and list2 and then create a list3 that contains all contigs in list1 minus those also present in list2. Is this possible with a simple cat/paste/grep/sort/uniq kind of batch command?
Thanks!
I'm looking to create an invisible window for the processing of certain X events (sort of like NativeWindow in Winforms). Is this possible in GTK#? Or do I need to manually create such a window using P/Invoke to the X libraries?
I have created a simple view consisting of 3 tables in SQL.
By right clicking and selecting Design, in the Object explorer table, i modified my custom view. I just added sortby asc in a field.
The problem is that the changes are not reflected in the outout of the View.
After saving the view, and selecting Open view the sort is not displayed in output.
So what is going on here?
I have set up my POCOs and I have marked their public properties as virtual and I am successfully getting Proxies most of the time (95%) but randomly I am getting EF return some proxies and some non-proxies.
Recycling the app pool when this happens will then fix this instance of the error and it will go away for an amount of time. Then it will re-occur in some other random (it seems) place.
What can cause this sort of behaviour?
Thanks, Kohan
Let's say I run an ActiveRecord query and it returns 3 results, with a bunch of attributes.
I want to add 3 attributes to each record in the Array so I can do sorting at a code-level. These 3 include: num_comments, num_views, last_view.
How do I add these attributes?
How do I then sort the records, in order of precendence, by num_comments AND by num_views AND by last_view?
Why did they never let us do this sort of thing:
Create Proc RunParameterisedSelect
@tableName varchar(100),
@columnName varchar(100),
@value varchar(100)
as
select * from @tableName
where @columnName = @value
You can use @value as a parameter, obviously, and you can achieve the whole thing with dynamic SQL, but creating it is invariably a pain.
So why didn't they make it part of the language in some way, rather than forcing you to EXEC(@sql)?
I use MySQL and it gives no meaningful error messages beyond "syntax wrong close to something or other". This is in sharp contrast to the sort of nice, clear error messages we are used to getting from java compiler and similar. So, are there RDBMS or sql validation tools that provide clearer, meaningful error messages?
There seems to be a plethora of documentation tools for Python. Another one that I've run across is epydoc. It seems like Sphinx is the de facto standard, because it's used to generate the official Python docs. Can someone please sort out the current state of Python's documentation tools for me?