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 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
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 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)?
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!
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 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 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'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?).
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 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.
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'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'm using nested routes and I want to provide some sort of a shortcut method. (I'm using RoR 3.0)
The routes look like this.
resources :countries do
resources :regions do
resources :wineries
end
end
To access a winery route I want to be able to define a function that removes the need to specify a country and region each time. Like:
def winery_path(winery)
country_region_winery_path (winery.country, winery.region, winery)
end
Where should I do this? How can I get that to be available whereever url_for is available?
The typical use-case is for simple things like @Override, but clearly you can do a lot more with them. If you push the limits of them, you get things like Project Lombok, though my understanding is that that's a huge abuse of annotations. What exactly can you do? What sort of things can you do at compile-time and run-time with annotations? What can you not do?
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?
I just wanted to start a blog but couldn't think of an appropriate name. The name should be geeky in some sort of way. I'm not very creative today, so what are your proposals?
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 apologize if this is a subjective or repeated question. It's sort of awkward to search for, so I wasn't sure what terms to include.
What I'd like to know is what the basic foundation tools/functions are in C when you don't include standard libraries like stdio and stdlib.
What could I do if there's no printf(), fopen(), etc?
Also, are those libraries technically part of the "C" language, or are they just very useful and effectively essential libraries?
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?
Hi, in VIM sometimes when saving, I accidentally hit capital W instead of its lowercase brother. I am prompted for my system password, so I assume it is running a sudo command of some sort, but do you know what?
Thank you!
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?
Hi All,
I have font folder of volta regular with license but i dont know how to use it in web site. Coz i dont want to replace it while user's machine don't have that font please tell me any solution to sort out this problem, Did have to upload it on server ?
Thanks
Mayur