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 generate the feed, so it makes sense that you would just traverse the XML nodes. That way you don't have additional overhead (depending on how often you want to get this information).
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 unique visitors per hour. * Because of this, Database reads have been a serious issue in performance, so I don't want to store ViewState in the database. * We also are behind a load balancer, so any solution has to work with the user bouncing from machine to machine per postback. Ideas?
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 cost of modulus, then decide if the alternate solution is worth coding.
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 research and performance profiling on your intended platforms to get a clear idea of the performance constraints you're under. There may be much more productive places to spend your optimisation effort.
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 language construct. We use this convention all over the place in some of the core classes of our internal framework to make the URL to controller mappings work. I have also seen it in many commercial open source applications (I'll try and dig for an example and post it). Anyway, the point of my answer is that it seems well worth what is probably a slight performance decrease if it makes more flexible, dynamic code. The other trade-off that I should mention, though, is that performance aside, it does make the code slightly less obvious and readable unless you are very careful with your variable names. Most code is written once, and re-read and modified many times, so readability is important.
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 is always positive. The C and C++ standards don't specify the sign of the modulus when the first number is negative. A bit-wise and gets rid of the sign bit, so it will always be positive (i.e. it's a true modulus, not a remainder). It sounds like that's what you want anyways though. 3. **Your compiler probably already does this when it can, so in most cases it's not worth doing it manually.**
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 is never more apparent than when you need to scale the platform out and you suddenly realize you need to sink mountains of developer time into making a scripting language as fast as a compiled one. Arguing the benefits of a compiled language for web-applications is a bit silly, really. The language itself shouldn't ever limit the application, if it's designed sensibly.. Many big sites are coded in PHP for example. Again, that said, if the developers are familiar with ASP.Net, they are going to code better in that, so it will scale better.. Same with PHP. Basically, choose a reasonable language that the developer(s) know, and then the appropriate server...
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 BackgroundJob a lambda object, which contains the context/code for what to do. But, guess that wasn't possible. I ended up marshaling a normal ruby object that contained instructions for what to do after the program ran. > Joe [1]: http://www.zenspider.com/pipermail/ruby/2008-August/004223.html
|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 BackgroundJob a lambda object, which contains the context/code for what to do. But, guess that wasn't possible. I ended up marshaling a normal ruby object that contained instructions for what to do after the program ran. > Joe [1]: http://www.zenspider.com/pipermail/ruby/2008-August/004223.html
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/matthew.podwysocki/archive/2008/08/01/recursing-into-recursion-memoization.aspx
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 most of the useful features and generally end up confusing the non-technical users. SVN (and git, etc.) are tools designed for programmers - if you're just looking for a good way to manage document revisions and keep a history, I'm guessing there are better tools for your particular platform (though I don't know enough to recommend a particular one). That said, if they are mostly ASCII files, I suspect TortoiseSVN is your best bet.
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 that meet your schema, but if you plan on maintaining anything or testing anything, mapping is pain now for pleasure later. Subsonic is a great model, and its open source, if you must go generation, use their templates in myGeneration to get a leg up. **BTW: I've done what you are doing, and I ended up with something very similar to subsonic, and now advise my clients to take the subsonic source, and fork it for themselves.**
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 any other .net memory mojo? [1]: http://msdn.microsoft.com/en-us/library/cy8c7wz5.aspx [2]: http://msdn.microsoft.com/en-us/library/system.gc.collectioncount(VS.80).aspx
[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 the width, your best bet is to use javascript to precisely position the left-hand edge. I'm not sure if you'd class that as a 'quirky trick', though. It really depends on what you want to do, of course. Given your simple test case, a div with text-align: center would have exactly the same effect.
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 documentation points to a browser enhancing api - google seem to want to keep a tight reign on the look and feel of the application. You might find a more conclusive answer on the development site: dev.chromium.org, and some of the developers might be on irc on #chromium on freenode.
<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 first.
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 reproduce the issue you're experiencing. 5. Keep 'Send source of current page' and 'Send screenshot of current page' checkboxes selected. 6. Click the Send report button to report a Google Chrome bug. I don't see any reference to public bug tracking... [1]: http://www.google.com/support/chrome/bin/answer.py?answer=95760&query=bug&topic=&type=
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 stuff.
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.msdn.com/djpark/archive/2007/11/07/how-to-use-solutions-and-projects-between-visual-studio-2005-and-2008.aspx [2]: http://codebetter.com/blogs/jeffrey.palermo/archive/2007/11/27/running-vs2008-amp-vs-2005-side-by-side-project-file-difference.aspx
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 silverlight app so that it plays well with Analytics).
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 array in O(n). If the numbers are not bounded, then bitwise XOR takes time O(k) where k is the length of the bit string, and the XOR method takes O(nk). Now again Radix sort will sort the array in time O(nk).
|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). Assume that we are calculating fib(10). In this process, say fib(5) is calculated a lot of times. Is there some way to store this in memory for fast retrieval and thereby increase the speed of recursion? I am looking for a generic technique that can be used in almost all problems.
|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 you could have something along the lines of: var cache = []; function fib(n) { if (n < 2) return 1; if (cache.length > n) return cache[n]; var result = fib(n - 2) * fib(n - 1); cache[n] = result; return result; } Which degenerates to O(n) in the worst case :D
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 you could have something along the lines of: var cache = []; function fib(n) { if (n < 2) return 1; if (cache.length > n) return cache[n]; var result = fib(n - 2) + fib(n - 1); cache[n] = result; return result; } Which degenerates to O(n) in the worst case :D [Edit: * does not equal + :D ] [Yet another edit: the Haskell version (because i'm a masochist or something) fibs = 1:1:(zipWith (+) fibs (tail fibs)) fib n = fibs !! n ]
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 similarly easy to understand (if a bit buggy). [1]: http://wiki.theory.org/BitTorrentSpecification
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 nothing - [this old discussion list link][1] has a way to check if domain exist. Quite not what I was looking for... But still, it was best anwser Google gave me - everything else is just a bunch of unanwsered questions. Any of you have succeeded to get some method up and running? I'd very much appreciate some tips, or should I just do it the opensource-way, sit down and code something by myself? :) [1]: http://mail.python.org/pipermail/python-list/2000-March/028122.html
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 WScript.Sleep 100 Loop [1]: http://msdn.microsoft.com/en-us/library/ateytk4a(VS.85).aspx
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 a full SVN server with a nice plugin to manage it with. It lets you use windows authentication right through the UI. Easy. 2. [Tortoise][2] Its tortoise, enough said. 3. [ankhsvn][3] It is a great SCC plugin. For those that want full VS IDE integration the latest version is a full SCC plugin. So you now get full integration for free. The above set up is 100% free and will get you through anything you need for source control. [1]: http://www.visualsvn.com/server/ [2]: http://tortoisesvn.tigris.org/ [3]: http://ankhsvn.open.collab.net/
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 definitely has been linked to why, when some people simple reinstall with sp3 instead of installing sp1 and rolling up to sp3 they get better performance, even with the same programs installed.
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 at things like Ants Profiler from RedGate, but it's not quite what I want: I can't view specific instances.
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 includes the querystring if present.
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 change your PATH. Alternatively run your python script with the explicit interpreter you want: $ /path/to/python2.4 <your script>
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 architecture' from which to start. Maybe someone has an open source example application which they could recommend.
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 was fine. protected void PageLoad(object sender, EventArgs e) { using (XmlWriter xm = XmlWriter.Create(Response.OutputStream, GetXmlSettings())) { //do your stuff xm.Flush(); } } /// <summary> /// Create Xml Settings object to properly format the output of the xml doc. /// </summary> private static XmlWriterSettings GetXmlSettings() { XmlWriterSettings xmlSettings = new XmlWriterSettings(); xmlSettings.Indent = true; xmlSettings.IndentChars = " "; return xmlSettings; } That should be enough to get you started, I will try and post more later. Also if you need basic authentication for your web service it can be done, but it needs to be done manually if you aren't using active directory.
|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.Replace() on the url, is there a better way? All manipulations are done on the server.
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.Replace() on the url, is there a better way? All manipulations are done on the server. p.s. Toran, good suggestion, however I HAVE TO USE URL PARAMETER due to some other issues.
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. The Google Maps API includes a <code><a href="http://code.google.com/apis/maps/documentation/reference.html#GScreenOverlay">GScreenOverlay</a></code> class that has the behavior that I want, but it only lets you specify an image to use as an overlay, and I'd prefer to use a DIV with text in it. What's the easiest way to position a DIV over the map window in (for example) the lower left corner that'll automatically stay in the same place relative to the corner when the browser window is resized?
|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 your behalf.
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 your behalf. ---------- EDIT: I went away and tested, just to make sure: class Program { static void Main(string[] args) { Fred f = new Fred(); f = null; GC.Collect(); GC.WaitForPendingFinalizers(); Console.WriteLine("Fred's gone, and he's not coming back..."); Console.ReadLine(); } } class Fred : IDisposable { ~Fred() { Console.WriteLine("Being finalized"); } void IDisposable.Dispose() { Console.WriteLine("Being Disposed"); } }
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): return "<class X>" class HTMLDecorator(object): def __init__ (self, wrapped): self.__wrapped = wrapped def html (self): sep = cgi.escape (repr (self.__wrapped)) return sep.join (("<H1>", "</H1>")) inst_x=ClassX() inst_b=True print HTMLDecorator(inst_x).html() print HTMLDecorator(inst_b).html()
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 that just passes the sound through and incidentally hands it off somewhere for analysis? Writing a JACK-aware app and figuring out how to get it to play with the JACK server? Ecasound? This is a cheesy proof-of-concept hobby project, so simplicity of API is the driving factor (followed by reasonable choice of programming language).