|
Wow ! That's the Ph.D. answer. My reading of the Lazy<T> docs suggests its multi-threading features are robust.
thanks, Bill
«When I consider my brief span of life, swallowed up in an eternity before and after, the little space I fill, and even can see, engulfed in the infinite immensity of spaces of which I am ignorant, and which know me not, I am frightened, and am astonished at being here rather than there; for there is no reason why here rather than there, now rather than then.» Blaise Pascal
|
|
|
|
|
The Lazy<T> threading support can be robust, depending on which LazyThreadSafetyMode value you pass to the constructor. (The default is ExecutionAndPublication , which is the most robust.)
But the Dictionary<TKey, TValue> definitely isn't thread-safe if you modify it.
It's not a problem if you're pre-populating the dictionary with a Lazy<T> for every possible key, and never modifying the contents of the dictionary. But if you have a large set of keys, some of which are rarely used, you might want to avoid the memory overhead.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I have a software that records a wav file with naudio and then I can play the file. Now I shall add dynamic range compression to the file and I have really now idea what to do. I hoped that naudio offers something because there is a class SimpleCompressorStream but I can't find any example how to use it. cscore seems to offer a compressor too but there I can't find any documentation or example either.
I'm very new to the entire audio topic so it would be wonderful to find any example or tutorial for C# about dynamic range compression or any libary that I could use
|
|
|
|
|
Member 13196574 wrote: it would be wonderful to find any example or tutorial Then you need to go and look for them: www.google.com[^].
|
|
|
|
|
That's what I did the past days and so far I didn't find what I was looking for. A lot of compression results are more about data compression like zip and not range compression to make the audio file louder and the other pages were more about the general explaination what range compression is. I didn't find a page whith a good tutorial how to implement it.
|
|
|
|
|
Well maybe no one has yet written one. But if you want help here you need to ask a specific technical question.
|
|
|
|
|
I am not really getting what you were looking for then. A simple search for e.g. 'sound processing library' returns loads of alternatives.
But then: I am not expecting to find a ready-to-call function in my favorite language, isolated from any function that I do not need. I'll take any alternative in any c-class language, from k&r C to C++ to Java to C#, or even Python, and I'd be prepared to rewrite it in a language / form / framework suiting my needs. In other words, I don't expect to use it as a black box but to understand the code.
12-15 years ago I did that for reverb functions, using Csound[^]. A lot has happened with Csound since then. Dynamic compression was not in my list of requirements, but I'd be very surprised if it is not available in the library.
If you consider Csound, you must be prepared to translate from plain C to C#, but that is nice way to get to know the code.
|
|
|
|
|
|
Thank you for the hint. I will take a look at it
|
|
|
|
|
I wana Know how to Campare audio files Waves using c#.net i wana create an application which is More Like Shazam
|
|
|
|
|
Good. So you've got some ideas there for areas you need to research, possibly including reading articles. What do you need from us?
This space for rent
|
|
|
|
|
Pete O'Hanlon wrote: What do you need from us? Since this is the discussion forum and not the QA I would expect they are looking for a discussion.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I suggest to start doing some research.
Using your favorite serach engine with something like "c# compare wav files" would be a good start.
Shazam (service) - Wikipedia[^] is providing also some information:
Quote: Shazam uses a smartphone or computer's built-in microphone to gather a brief sample of audio being played. It creates an acoustic fingerprint based on the sample and compares it against a central database for a match. The keywords are acoustic fingerprint and database which might be the next search terms besides recording audio.
|
|
|
|
|
I want to send a http request from client to server by adding some headers and want to retrieve back those headers at server side .can some one give me the whole code for this i.e., including clent and server if possible.
Thank you in advance .
|
|
|
|
|
When you send those extra headers to the server, you do so by adding them to the collection of default headers, on the server side you can do the same. You can extract them from the headers collection attached with the request.
We do not provide "whole code" for anything, there are however several ways to get the code or explanation from CodeProject, first of all search for this concept "headers c# http client" in the top right corner, and find yourself a useful article.
Secondly, consider using Google and append " codeproject" to search for project content, and the best way is to show us what you have done. Show us your attempt at solving this problem, and we will help you with making it work.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
|
0
down vote
favorite
I am using clientCache in my web.config:
<staticContent>
<clientCache cacheControlMode="UseMaxAge"cacheControlMaxAge="30.00:00:00"/>
</staticContent>
and in the controller on action I am using the OutputCache attribute:
[OutputCache(Duration = 300)] // 300 for 5 mins
The problem is I am getting the error in google speed insight
thanks in advance
|
|
|
|
|
Your question wasn't entirely clear when you posted it on StackOverflow:
.net - Leverage browser caching for images in mvc using c# - Stack Overflow[^]
It's even less clear here, because you didn't link to the screen-shot or tell us what the error is.
As Dávid Molnár said in the StackOverflow comments, you need to update your question to show how the images are being generated, and the HTTP response headers for the image request. You can use the browser's developer tools, or an external tool like Fiddler[^], to see the headers.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi,
I have a text file that contains html tags. I like to use C# to read this file and list all the src attributes of tags.
I was wondering how I can read through my file and list all of them.
Thank you in advance for your time and consideration.
|
|
|
|
|
Use an existing HTML parser: MIL HTML Parser[^] - let it handle the "donkey work" for you.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
That was a nice project but the problem is my content is coming from a json file, not a single html page.
|
|
|
|
|
It would have been nice to include that important little tidbit in your original post.
NewtonSoft's JSON library makes it easy to load and parse a JSON file. After that, you can use what OriginalGriff suggested.
|
|
|
|
|
Oh ok, thanks guys, I will give it a try then
|
|
|
|
|
Actually in the end, I found it much easier for the task to be done in Python using the following code:
import urllib
f = urllib.urlopen("URL")
s = f.read()
f.close()
from bs4 import BeautifulSoup
soup = BeautifulSoup(s)
inputTags = soup.find_all("img", attrs={"src":True})
output = [ x["src"] for x in inputTags ]
print output
And yep I know this is C# forum!
|
|
|
|
|
Warm greetings. I am trying to find out if there is a way of editing/updating something on a website using a piece of software made in C#. By this I mean, if the website prompts a user to enter a number for some field and displays it on the site, then can I not carry out the exact same steps in the software so I don't have to go to the website to enter/amend/?
A quick fictional example. I have built a small software related to a random number generator. This software shows two pieces of information independent of each other. One generates any random number by computer and two, shows a number (using a WebClient Class to scrape data from the website) from the website which asks the user to manually enter any random number which then displays on the site.
Now, is it possible to link these two in a way that when a random number is generated by computer in the software, say number 8, this is then updated on the site which will show it rather than manually going to the site and entering number 8 and then showing it. Is there a specific class that exists for this?
I am sorry for it being long but I hope I was being specific, at least enough to give you a good idea of what it is I am seeking. I hope I don't have to learn another programming language to implement this in my software. I am guessing I need to be familiar with HTML with CSS at maximum.
Thank You.
UPDATE: I have been made to realise this process is called two-way data binding, at least under angular js. My question remains, is there a way of implementing this feature in C# language without learning another?
|
|
|
|