instruction stringlengths 0 30k ⌀ |
|---|
Privatizing a BlogEngine.Net Installation |
|c#|.net|asp.net|blogs| |
I have a blogengine.net install that requires privatization.
I'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met.
How can I anonymize my blogEngine.net install so that readers must log in to read my posts? |
Blogs almost always have an RSS feed for comments. If you have that, then you can determine the exact number of comments, since the feeds 99% of the time follow a standard. Even if the blog is your own, if you are already generating an RSS feed, then don't bother making a call to your DB. You already did that to genera... |
Moving ViewState out of the page? |
|asp.net|viewstate|scaling| |
We are trying to lighten our page load as much as possible. Since ViewState can sometimes swell up to 100k of the page, I'd love to completely eliminate it.
I'd love to hear some techniques other people have used to move ViewState to a custom provider.
That said, a few caveats:
* We serve on average 2 Million ... |
Unless you really need high performance on multiple embedded platforms, don't change how you code for performance reasons until you profile!
Code that's written awkwardly to optimize for performance is hard to debug and hard to maintain. Write a test case, and profile it on your target. Once you know the actual co... |
Not that this is necessarily better, but you could have an inner loop which always goes up to FIZZ, and an outer loop which repeats it all some certain number of times. You've then perhaps got to special case the final few steps if MAXCOUNT is not evenly divisible by FIZZ.
That said, I'd suggest doing some researc... |
There may indeed be a performance hit for having to resolve the name of the variable before looking up the class definition. But, without declaring classes dynamically you have no real way to do "dyanmic" or "meta" programming. You would not be able to write code generation programs or anything like a domain-specific l... |
If you are calculating a number mod some power of two, you can use the bit-wise and operator. Just subtract one from the second number. For example:
x % 8 == x & 7
x % 256 == x & 255
A few caveats:
1. This **only works** if the second number is a power of two.
2. It's only equivalent if the modulus i... |
C++
factorial(int n)
{
for(int i=1, f = 1; i<=n; i++)
f *= i;
return f;
} |
This is basically ASP.NET vs PHP.. If you (or the developers) have lots of experience with PHP, you use LAMP, or if they have used ASP.NET a lot, you chose WISA..
That said, while not strictly **L**AMP, Apache/MySQL/PHP will run on pretty much any platform you can name, which I would consider a big plus.
> There ... |
Visual Studio optimisations: [http://stackoverflow.com/questions/8440/visual-studio-optimizations#8453][1]
[1]: visual-studio-optimizations |
How do I marshall a lambda (Proc) in Ruby? |
|ruby|proc|lambda|serialization| |
Joe Van Dyk [asked the Ruby mailing list][1]:
> Hi,
> In Ruby, I guess you can't marshal a lambda/proc object, right? Is
that possible in lisp or other languages?
> What I was trying to do:
> `l = lamda { ... }`
> `Bj.submit "/path/to/ruby/program", :stdin => Marshal.dump(l)`
> So, I'm sending Backgro... |
|ruby|serialization|lambda|proc| |
Joe Van Dyk [asked the Ruby mailing list][1]:
> Hi,
> In Ruby, I guess you can't marshal a lambda/proc object, right? Is
that possible in lisp or other languages?
> What I was trying to do:
l = lamda { ... }
Bj.submit "/path/to/ruby/program", :stdin => Marshal.dump(l)
> So, I'm sending Backgro... |
This is called memoization and there is a very good article about memoization [Matthew Podwysocki][1] posted these days. It uses Fibonacci to exemplify it. And shows the code in C# also. Read it [here][2].
[1]: http://codebetter.com/blogs/matthew.podwysocki/default.aspx
[2]: http://codebetter.com/blogs/matthe... |
Why is an s-box input longer than its output? |
Isn't there a Limit of 25 Total Threads in the IIS Configuration? At least in IIS 6 i believe. If you exceed that limit, interesting things (read: loooooooong response times) may happen. |
"Project files" is potentially vague - if the files in question aren't primarily ASCII files and are Word documents or what have you, I'm not sure that traditional source control tools will really work.
SVN et. al. will happily support binary files, but you if that's all you're using it for then you don't really get... |
You need to go the nHibernate style, in my experience, and have it so that you have some kind of map, between your objects and the database. This allows your objects to have some things that are hard to represent in a database but are easier represented in POCOs.
Generation gets you started, by giving you classes th... |
Is it possible to track allocation/deallocation in C#? |
|c#|memory|hook|allocation| |
As far as I can tell, this is isn't possible, so I'm really just hoping for a left field undocumented allocation hook function. I want a way to track allocations like in [_CrtSetAllocHook][1], but for C#/.net. The only visibility to the garbage collector/allocation appears to be [GC.CollectionCount][2]. Anyone have ... |
[Perforce Merge Tool][1]
Even though Perforce is obviously not free the merge tool is. It's 100x better than the default TortoiseSvn one. To integrate with TortoiseSvn set the merge tool to:
C:\Path-To\P4Merge.exe %base %theirs %mine %merged
[1]: http://www.perforce.com/perforce/products/merge.html |
In FF3, you can:
<div style="display: table; margin: 0px auto 0 auto;">test<br>test</div>
This has the advantage of using whatever element makes most semantic sense (replace the div with something better, if appropriate), but the disadvantage that it fails in IE (grr...)
Other than that, without setting th... |
Of course, you _should_ write it this way:
SELECT *
FROM a
LEFT JOIN b ON b.id=a.id
The a,b syntax is evil. |
Chrome does support the netscape plugin api, but that is for displaying certain kinds of content.
You seem to be after a extention api, really firefox is the only major browser to encourage and support third party extentions to browsing capability (that aren't simply new toolbars)
Nothing in the developer documen... |
<pre><code>select * from a, b where a.id = b.id</code></pre>
Requires that a row exist in where b.id = a.id in order to return an answer
<pre><code>select * from a, b where a.id *= b.id</code></pre>
Will fill the columns from b with nulls when there wasn't a row in b where b.id = a.id. |
I'm only just beginning to use them, but from what I've seen 2.0 pretty assumes SOAP. |
ANSI-82 syntax
select
*
from
a
, b
where
a.id *= b.id
ANSI-92
select
*
from
a
left outer join b
on a.id = b.id
|
I'm guessing you're talking about .rdl files from Reporting Services? (If not, my answer might be wrong)
They're basically just XML, so you could load each one of them in and do an XPath query to get the node that contains the datasource and update it. |
Oh! Yup, I've been through that, but using the raw Windows API calls some time ago, while developing an ActiveX control that detected the insertion of any kind of media. I'll try to unearth the code from my backups and see if I can tell you how I solved it. I'll subscribe to the RSS just in case somebody gets there fir... |
From the [Google Site][1]
1. Click the Page menu page menu.
2. Select Report a bug or broken website.
3. Choose an issue type from the drop-down menu. The web address of the webpage you're on is recorded automatically.
4. If possible, add key details in the 'Description' field, including steps to repr... |
The Google Code site for the Chrome project is available at:
http://code.google.com/chromium/
Facilities available allow you to:
<li>File bug reports;</li>
<li>Join the Google group discussions;</li>
<li>Submit a patch;</li>
Plus there are links to the development blog and a whole bunch of other useful stuf... |
This is the home page for the Code: http://code.google.com/chromium/
And here's more info: http://dev.chromium.org/getting-involved including the bug list |
I have a blogengine.net install that requires privatization.
I'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met.
How can I privatize my blogEngine.net install so that readers must log in to read my posts? |
Looking at these posts:
- [How to use solutions and projects between Visual Studio 2005 and 2008][1]
- [Running VS2008 & VS 2005 side by side - project file difference][2]
You will only need to change a few lines if you do it manually. So i guess this is trivial if you automate it.
[1]: http://blogs.... |
Yes. But never in dead code. That would be silly. |
@John (37448):
Sorry, I might have misled you with the name (bad choice). I'm not really looking for a decorator function, or anything to do with decorators at all. What I'm after is for the html(self) def to use ClassX or ClassY's __repr__. I want this to work without modifying ClassX or ClassY. |
@John (37448):
Sorry, I might have misled you with the name (bad choice). I'm not really looking for a decorator function, or anything to do with decorators at all. What I'm after is for the html(self) def to use ClassX or ClassY's `__repr__`. I want this to work without modifying ClassX or ClassY. |
Sure - e.g. if you want to traverse a tree structure what else would you use ?
Maybe you would like to have something like a maximum depth to be sure you're not writing an infinite loop. (if this makes sense in your example) |
Check out Chapter 6 of [Programming Collective Intelligence](http://www.amazon.com/Programming-Collective-Intelligence-Building-Applications/dp/0596529325) |
In case you missed it, there's a link to a more detailed article as well in the comments: <http://blogs.msdn.com/jeffwilcox/archive/2007/10/01/using-google-analytics-with-rich-managed-web-applications-in-silverlight.aspx> |
In case you missed it, there's a link to a more detailed article as well in the comments: <http://blogs.msdn.com/jeffwilcox/archive/2007/10/01/using-google-analytics-with-rich-managed-web-applications-in-silverlight.aspx>
Edit: As David pointed out, this article covers the reverse scenario more (how to write your si... |
The sorting method and the XOR method have the same time complexity. The XOR method is only O(n) if you assume that bitwise XOR of two strings is a constant time operation. This is equivalent to saying that the size of the integers in the array is bounded by a constant. In that case you can use Radix sort to sort the a... |
|cryptography| |
http://en.wikipedia.org/wiki/S-box
I can't understand where the extra bits are coming from in this article about s-boxes. Why doesn't the s-box take in the same number of bits for input as output? |
Is there some way to speed up recursion by remembering child nodes? |
|recursion| |
For example,
Look at the code that calculates the n-th Fibonacci number:
fib(int n)
{
if(n==0 || n==1)
return 1;
return fib(n-1) + fib(n-2);
}
The problem with this code is that it will generate stack overflow error for any number greater than 15 (in most computers).
... |
|performance|recursion| |
Is this a deliberately chosen example? (eg. an extreme case you're wanting to test)
As it's currently O(1.6^n) i just want to make sure you're just looking for answers on handling the general case of this problem (caching values, etc) and not just accidentally writing poor code :D
Looking at this specific case yo... |
Is this a deliberately chosen example? (eg. an extreme case you're wanting to test)
As it's currently O(1.6^n) i just want to make sure you're just looking for answers on handling the general case of this problem (caching values, etc) and not just accidentally writing poor code :D
Looking at this specific case yo... |
I've found the [TheoryOrg Unofficial BitTorrent Specification][1] to be the best online source for Bittorrent information. Also, the Monotorrent code is fairly simple and easy to understand. There's also a project called "GCT" which implements JGroups style P2P for LAN/Multicast environments, and its code is similarl... |
A few things that have bitten me:
* `:main:` -- RDoc uses only the last one evaluated; best to make sure there's only one in your project and you don't also use the `--main` command-line argument.
* same as previous, but for `:title:`
* `:section:` doesn't work very well |
What Python way would you suggest to check whois database records? |
|python|system-administration|whois| |
I'm trying to get a webservice up and running that actually requires to check whois databases. What I'm doing right now is ugly and I'd like to avoid it as much as I can: I call gwhois command and parse its output. Ugly.
I did some search to try to find a pythonic way to do this task. Generally I got quite much noth... |
If you use the "Exec" method, it returns a reference, so you can poll the "Status" property to determine when it is complete. Here is a sample from [msdn][1]:
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec(ZipCommand)
Do While oExec.Status = 0
... |
I use [KDiff3][1] as a 3-way merge tool. It does a decent job.
[1]: http://kdiff3.sourceforge.net/ |
I have used both at work and at home. They are both very cool in their own right. The only time i would recommend using TFS though is if you will be using more of the features than just the source control. If all you need is source control you cant go wrong with SVN and this is why.
1. [VisualSVN Server][1] That is ... |
I think its a symptom, not a cause, as fever is a symptom of an infection.
When you install windows updates, at least in xp and up, a folder called SXS is maintained for rolling them back. These rollback points are also stored in reg keys.
The size of the sxs(side by side) folder grows exponentially and definitel... |
Is your relationship bidirectional, i.e., does `EntityType` have an `Entity` property? If so, you can probably do something like `entity.Name from EntityType where name = ?`
|
View of allocated memory |
|.net|memory| |
I'm looking for a tool ($, free, open source; I don't care) that will allow me to view not just the memory statistics for a .NET program, but also the object hierarchy. I'd really like to be able to drill down each thourgh each object and view it's foot print, as well as all the object's it references.
I've looked a... |
See the [Issues tab][1] on Chrome's Google Code page.
[1]: http://code.google.com/p/chromium/issues/list |
Google is calling it [Chromium][1] on Google Code
The [Chromium Bug Reporting Page][2] is there and has the link to submit bugs listed. (Google Account Required)
[1]: http://code.google.com/chromium/
[2]: http://dev.chromium.org/for-testers/bug-reporting-guidelines |
"env" simply executes the first thing it finds in the PATH env var. To switch to different python, prepend the directory for that python's executable to the path before invoking your script. |
Thanks guys, I used a combination of both your answers @Christian and @Jonathan for my specific need.
"http://" + Request.ServerVariables["SERVER_NAME"] + Request.RawUrl.ToString()
I don't need to worry about secure http, needed the servername variable and the RawUrl handles the path from the domain name and... |
Should you register new extensions with Apple? |
|macos|apple|adc| |
Do I need to register new extension types with Apple before I release an application that would create them on OS X? |
If you are running the scripts then you can set your PATH variable to point to a private bin directory first:
$ mkdir ~/bin
$ ln -s `which python2.4` ~/bin/python
$ export PATH=~/bin:$PATH
Then when you execute your python script it'll use python 2.4. You'll have to change your login scripts to chan... |
Linked sub-reports (at least in CR XI) share the main report's datasource - presumably your report is already configured so that's not an option for you? |
Server centered vs. client centered architecture |
|.net|architecture| |
For a typical business application, should the focus be on client processing via AJAX i.e. pull the data from the server and process it on the client or would you suggest a more classic ASP.Net approach with the server being responsible for handling most of the UI events? I find it hard to come up with a good 'default ... |
No, there's no need to register extensions. |
I'm taking a look at : http://code.google.com/p/fjcore/source/checkout
A dependency free image processing library. |
You can certainly create RESTful web services in ASP.NET 2.0, for [example][1], but there are no high-level APIs to do all the donkey work for you, as provided by WCF in .NET 3.5.
[1]: http://blogs.msdn.com/dseven/archive/2007/02/10/boise-code-camp-enabling-rest-in-asp-net.aspx |
I have actually created a REST web service with asp.net 2.0. Its really no different than creating a web page.
When I did it, I really didn't have much time to research how to do it with an asmx file so I did it in a standard aspx file. I know thier is extra overhead by doing it this way but as a first revision it w... |
|c#|query-string| |
I have a "showall" query string parameter in the url, the parameter is being added dynamically when "Show All/Show Pages" button is clicked.
I want the ability to toggle "showall" query string parameter value depending on user clicking the "Show All/Show Pages" button.
I'm doing some nested "if's" and string.Rep... |
I have a "showall" query string parameter in the url, the parameter is being added dynamically when "Show All/Show Pages" button is clicked.
I want the ability to toggle "showall" query string parameter value depending on user clicking the "Show All/Show Pages" button.
I'm doing some nested "if's" and string.Rep... |
Fixed Legend in Google Maps Mashup |
|html|google-maps| |
I have a page with a Google Maps mashup that has pushpins that are color-coded by day (Monday, Tuesday, etc.) The IFrame containing the map is dynamically sized, so it gets resized when the browser window is resized.
I'd like to put a legend in the corner of the map window that tells the user what each color means.... |
|javascript|html|google-maps| |
The GC will **not** call dispose. It *may* call your finalizer, but even this isn't guaranteed under all circumstances.
See this [article][1] for a discussion of the best way to handle this.
[1]: http://blogs.msdn.com/arich/archive/2004/09/23/233683.aspx |
I don't think so. You have control over when Dispose is called, which means you could in theory write disposal code that makes assumptions about (for instance) the existence of other objects. You have no control over when the finalizer is called, so it would be iffy to have the finalizer automatically call Dispose on y... |
I don't think so. You have control over when Dispose is called, which means you could in theory write disposal code that makes assumptions about (for instance) the existence of other objects. You have no control over when the finalizer is called, so it would be iffy to have the finalizer automatically call Dispose on y... |
Ah, in that case, perhaps code like this will be useful? It doesn't really have anything to do with decorators, but demonstrates how to pass arguments to a class's initialization function and to retrieve those arguments for later.
import cgi
class ClassX(object):
def __repr__ (self):
... |
Simple audio input API on a Mac? |
|macos|audio| |
I'd like to pull a stream of PCM samples from a Mac's line-in or built-in mic and do a little live analysis (the exact nature doesn't pertain to this question, but it could be an FFT every so often, or some basic statistics on the sample levels, or what have you).
What's a good fit for this? Writing an AudioUnit th... |