text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I have a custom security principal object which I set in the global.asax for the current thread and all is well, no problems normally.
However, I'm just adding a dynamic image feature by having a page serve up the image and whenever that dynamic image page is loaded the System.Web.HttpContext.Current.Session is null i... | [
-0.08376653492450714,
-0.29684215784072876,
0.5817449688911438,
-0.02871823124587536,
-0.4716659486293793,
-0.14224345982074738,
0.6713799238204956,
0.30564892292022705,
-0.2854997217655182,
-0.4683261513710022,
0.03487412631511688,
0.4539833962917328,
-0.3972046673297882,
0.31783556938171... | |
is loaded when the browser comes across an image tage in the original page i.e.
I'm guessing that this is some aspect of the fact that the browser is requesting that page without sending some credentials with it?
Any help would be greatly appreciated.
John,
I'm assuming you're using an ashx handler for the handler.... | [
0.28683343529701233,
0.03376920148730278,
0.025106748566031456,
0.25744664669036865,
-0.3100183606147766,
-0.0277229193598032,
0.38661396503448486,
0.10973722487688065,
-0.3206677734851837,
-0.5666978359222412,
-0.3293432593345642,
0.4214116036891937,
-0.6619099378585815,
-0.03618083521723... | |
I have a Rails app with some basic models. The website displays data retrieved from other sources. So I need to write a Ruby script that creates new instances in my database. I know I can do that with the test hooks, but I'm not sure that makes sense here.
I'm not sure what this task should look like, how I can invoke... | [
0.2821674942970276,
0.19797657430171967,
-0.0036958903074264526,
-0.004902439657598734,
0.0007467351388186216,
0.19145961105823517,
0.5932059288024902,
-0.3592282235622406,
-0.047105591744184494,
-0.8716280460357666,
0.48216623067855835,
0.6752706170082092,
-0.42589572072029114,
-0.1579565... | |
way to my newbie brain, since presumably Rails is doing all the magic work behind the scenes to set all that stuff up. So how do I set up my little script?
I agree with the answer above but you have to include => :environment in your task or it will not load the Rails environment.
e.g.,
```
namespace :send do
names... | [
0.21778035163879395,
0.09167896956205368,
0.19075283408164978,
-0.1388823539018631,
0.25495922565460205,
-0.27563440799713135,
0.6214681267738342,
-0.15042398869991302,
-0.2590934932231903,
-0.7364463210105896,
0.1814786046743393,
0.4855493903160095,
-0.20350085198879242,
-0.09022621810436... | |
User.trial_about_to_expire.has_not_been_notified_of_trial_expiry.each do |user|
UserMailer.deliver_trial_expiring_warning(user)
user.notified_of_trial_expiry = true
user.save
end
end
end
end
end
``` | [
0.28899499773979187,
0.3623405694961548,
0.7910341620445251,
-0.3658677339553833,
0.37254849076271057,
-0.1040823683142662,
0.39048653841018677,
-0.08856570720672607,
-0.15964505076408386,
-0.5970385074615479,
-0.18132100999355316,
0.33546701073646545,
-0.5156808495521545,
0.67418152093887... | |
What's the best method to pass parameters to SQLCommand? You can do:
```
cmd.Parameters.Add("@Name", SqlDbType.VarChar, 20).Value = "Bob";
```
or
```
cmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = "Bob";
```
or
```
cmd.Parameters.Add("@Name").Value = "Bob";
```
It seems like the first one might be some... | [
0.04682913050055504,
0.002111095702275634,
0.2836824357509613,
0.05835941433906555,
-0.08301953226327896,
0.021394163370132446,
0.20709918439388275,
-0.35055458545684814,
-0.13040997087955475,
-0.48974210023880005,
0.15910468995571136,
0.7891557812690735,
-0.34439390897750854,
-0.034200746... | |
I am using HtmlAgilityPack. I create an HtmlDocument and LoadHtml with the following string:
```
<select id="foo_Bar" name="foo.Bar"><option selected="selected" value="1">One</option><option value="2">Two</option></select>
```
This does some unexpected things. First, it gives two parser errors, EndTagNotRequired. Se... | [
-0.19783811271190643,
-0.23094235360622406,
0.48881077766418457,
-0.310793399810791,
-0.021740606054663658,
0.32666200399398804,
-0.0006549126119352877,
-0.28027284145355225,
-0.1330016553401947,
-0.6305112838745117,
0.12815281748771667,
0.41774338483810425,
-0.20451763272285461,
-0.206821... | |
HTML generation code, so I don't want it to make any decision for me or give any errors unless the HTML is truly malformed. Is there some way to make it behave how I want? I tried setting some of the options for HtmlDocument, specifically:
```
doc.OptionAutoCloseOnEnd = false;
doc.OptionCheckSyntax = false;
doc.Opt... | [
0.15983328223228455,
-0.18880262970924377,
0.277482807636261,
-0.06010041385889053,
-0.061721477657556534,
-0.11610298603773117,
0.5835248827934265,
0.03257574141025543,
-0.19872669875621796,
-0.7297962307929993,
-0.05076981708407402,
0.6543222665786743,
-0.4456576406955719,
0.108031764626... | |
quick browse of the source suggests the error might be fixable by commenting out line 92 of HtmlNode.cs:
```
// they sometimes contain, and sometimes they don 't...
ElementsFlags.Add("option", HtmlElementFlag.Empty);
```
(Actually no, they always contain label text, although a blank string would also be valid text. ... | [
0.13837775588035583,
0.0285839531570673,
0.34455353021621704,
-0.14084509015083313,
-0.02322300709784031,
-0.37891584634780884,
0.6195844411849976,
0.11952666938304901,
-0.29166191816329956,
-0.7131039500236511,
-0.4704512059688568,
0.3099409341812134,
-0.5735097527503967,
-0.0309842824935... | |
I am making a little GUI frontend for a app at the moment using wxPython.
I am using `wx.StaticText()` to create a place to hold some text, code below:
```
content = wx.StaticText(panel, -1, "Text Here", style=wx.ALIGN_CENTRE)
```
I have a button when clicked retrieves data from MySQL, I am wanting to change the va... | [
0.11509319394826889,
0.0988331139087677,
0.6693340539932251,
-0.11732836812734604,
-0.004495317582041025,
-0.08352749049663544,
0.2126392275094986,
-0.020527128130197525,
-0.14375847578048706,
-0.8509100079536438,
-0.1383296251296997,
0.7151452898979187,
-0.4389936327934265,
0.187258884310... | |
this.
Hope you guys understand what I am trying to do, I am new to Python :)
Cheers
`wx.TextCtrl` has a style called `wx.TE_READONLY` . Use that to make it read-only.
As a sidenode, you can use the [C++ wxWidgets Manual](http://docs.wxwidgets.org/stable/wx_contents.html) for wxPython aswell. Where special handling f... | [
0.43537384271621704,
0.12372977286577225,
0.3695337176322937,
-0.0817108228802681,
-0.3076173961162567,
-0.4178783893585205,
0.38003793358802795,
0.14468726515769958,
-0.1878465712070465,
-0.6246582865715027,
-0.1782011240720749,
0.5828704237937927,
0.03474050387740135,
-0.2007432729005813... | |
I have moved from C# to 9-5pm VB.NET
Any tricks i should know? Where does VB.NET differ the most apart from syntax?
Where have namespaces gone?
[Note: just found <http://converter.telerik.com/> brilliant]
Cheers
John
Have you looked at this answer?: [What are the most important functional differences between C# an... | [
0.47635066509246826,
0.2473711222410202,
0.7383235096931458,
-0.08945085853338242,
-0.09513458609580994,
-0.37144866585731506,
0.26446154713630676,
-0.08987114578485489,
-0.5655049085617065,
-0.4812745749950409,
-0.10905047506093979,
0.723892092704773,
0.36848050355911255,
-0.0827225372195... | |
Method chaining is the only way I know to build fluent interfaces.
Here's an example in C#:
```
John john = new JohnBuilder()
.AddSmartCode("c#")
.WithfluentInterface("Please")
.ButHow("Dunno");
Assert.IsNotNull(john);
[Test]
public void Should_Assign_Due_Date_With_7DayTermsVia_Invoice_Builder()
... | [
0.13760718703269958,
-0.30931201577186584,
0.7243236303329468,
-0.25673991441726685,
0.20638608932495117,
-0.14317581057548523,
0.6204482316970825,
-0.3740910291671753,
0.013666425831615925,
-0.231434166431427,
0.10943685472011566,
0.7627586126327515,
-0.37097591161727905,
0.38343828916549... | |
.WithPaymentTerms(PaymentTerms.SevenDays)
.Generate();
Assert.IsTrue(invoice.DateDue == now.AddDays(7));
}
```
So how do others create fluent interfaces. How do you create it? What language/platform/technology is needed?
You can create a fluent interface in any version of .NET or any other la... | [
0.2291353940963745,
0.01613069884479046,
0.5754018425941467,
-0.09620632231235504,
0.07866474241018295,
0.1777830272912979,
0.6597241759300232,
-0.05465254187583923,
-0.04003727436065674,
-0.7507154941558838,
-0.12700119614601135,
0.793627917766571,
-0.39481669664382935,
-0.019864432513713... | |
// do something
return this;
}
public JohnBuilder WithfluentInterface(string s)
{
// do something
return this;
}
public JohnBuilder ButHow(string s)
{
// do something
return this;
}
}
```
Usage:
```
John = new JohnBuilder()
.AddSmartCode("c#")... | [
0.40651020407676697,
0.007002344820648432,
0.5907381772994995,
-0.2703768312931061,
0.2311205416917801,
0.11976296454668045,
0.5490958094596863,
-0.21497216820716858,
-0.38622477650642395,
-0.5658082962036133,
-0.5082006454467773,
0.5073268413543701,
-0.20696835219860077,
0.156308323144912... | |
I have a vector-like class that contains an array of objects of type `"T"`, and I want to implement 4 arithmetic operators, which will apply the operation on each item:
```
// Constructors and other functions are omitted for brevity.
template<class T, unsigned int D>
class Vector {
public:
// Add a value to each ... | [
0.14508643746376038,
-0.41235998272895813,
0.2888841927051544,
0.09896823018789291,
-0.005417917855083942,
0.3314075171947479,
0.07229768484830856,
-0.6663442254066467,
-0.07296097278594971,
-0.5033626556396484,
-0.01916370913386345,
0.6098436713218689,
-0.48119962215423584,
0.071744509041... | |
}
}
void operator -= (const T&) { ... }
void operator *= (const T&) { ... }
void operator /= (const T&) { ... }
private:
T items[D];
};
```
Because operators will contain the same boilerplate code (looping over every element and applying appropriate operation), I thought I could generalize it:
`... | [
0.19496972858905792,
-0.5016930103302002,
0.10586819052696228,
0.010218539275228977,
0.3482082486152649,
0.23849806189537048,
0.1945340782403946,
-0.508238673210144,
-0.26356562972068787,
-0.3495464324951172,
-0.24663306772708893,
0.9501969218254089,
-0.5484634041786194,
-0.125126272439956... | |
void operator *= (const T& value) { do_for_each(???, value); }
void operator /= (const T& value) { do_for_each(???, value); }
private:
void
do_for_each(std::binary_function<void, T, T>& op, T value) {
std::for_each(data, data + D, std::bind2nd(op, value));
}
T data[D];
};
```
Now, the pr... | [
-0.17087844014167786,
-0.16143818199634552,
0.11729845404624939,
-0.357799768447876,
0.12527987360954285,
-0.02848259173333645,
0.29739323258399963,
-0.4508195221424103,
-0.0013790491502732038,
-0.3470182716846466,
-0.2817096412181854,
0.7176005244255066,
-0.42233067750930786,
-0.195219770... | |
work if `"T"` is `"int"`).
First, you should really return a reference from your operator+=, since you can later use them to implement operator+, operator- and so on. I will change that accordingly.
Also, your do\_for\_each has to be a template, since it has to know the precise type of the function object, as binary f... | [
0.2182898223400116,
-0.397767573595047,
0.339736670255661,
-0.2361060082912445,
0.12070544064044952,
-0.07387153059244156,
0.13472825288772583,
-0.7734237313270569,
-0.020067211240530014,
-0.7566636800765991,
-0.14768551290035248,
0.7609599828720093,
-0.47689077258110046,
-0.28570079803466... | |
return *this;
}
Vector& operator -= (const T& value) {
do_for_each(std::minus<T>(), value);
return *this;
}
Vector& operator *= (const T& value) {
do_for_each(std::multiplies<T>(), value);
return *this;
}
Vector& operator /= (const T& value) {
do_f... | [
0.15312452614307404,
-0.47443971037864685,
0.39816737174987793,
-0.37368425726890564,
0.34155240654945374,
0.3346039950847626,
-0.13062873482704163,
-0.6183262467384338,
-0.16029851138591766,
-0.37553900480270386,
-0.22057268023490906,
0.5590404868125916,
-0.7242975831031799,
-0.1376377642... | |
return *this;
}
private:
template<typename BinFun>
void do_for_each(BinFun op, const T& value) {
std::transform(data, data + D, data, std::bind2nd(op, value));
}
T data[D];
};
```
[std::transform](http://www.sgi.com/tech/stl/transform.html) will just pass each element to the function obj... | [
0.16905833780765533,
-0.5611037015914917,
0.36228832602500916,
-0.27691787481307983,
0.03803680092096329,
0.03120393492281437,
0.1765693873167038,
-0.6140060424804688,
0.3161052465438843,
-0.4873558282852173,
-0.4987218677997589,
0.5556120276451111,
-0.5206455588340759,
0.05033072456717491... | |
I've been utilizing `NHibernate 2.0.1.4000` on all current .NET 3.5 SP1 projects and have had no problems with any other queries (utilizing either the Query or Criteria APIs), until some new business logic dictated the necessity of a new query in this particular project against the application's database that needs to ... | [
0.13364346325397491,
0.16131159663200378,
0.20259210467338562,
-0.4436134397983551,
-0.07508325576782227,
-0.3726414740085602,
0.25258997082710266,
0.03583080694079399,
-0.18789289891719818,
-0.5797340273857117,
0.0781535804271698,
0.2719108760356903,
-0.16350175440311432,
0.57841527462005... | |
mode log4net log files, which I have reviewed and haven't yet helped, and I have verified that my class for the table does specify the property I'm checking for is a nullable property (DateTime?) to avoid the problems that can cause by forcing updates to the record, etc., which isn't happening here...
Here's the query... | [
0.11262094974517822,
-0.47268107533454895,
0.6336764693260193,
0.11019659042358398,
0.05427973344922066,
-0.2767748534679413,
0.42783525586128235,
-0.2561386823654175,
-0.2931576669216156,
-0.5760810375213623,
-0.07350027561187744,
0.8375782370567322,
-0.4719594419002533,
0.127417564392089... | |
solve this? I've tried using HQL alternatively, same problems... Am I missing something here with regards to returning records with a specific null property?
First, you should really return a reference from your operator+=, since you can later use them to implement operator+, operator- and so on. I will change that acc... | [
-0.134780615568161,
-0.11687884479761124,
0.28393450379371643,
0.06053297594189644,
0.1040707528591156,
0.03532891348004341,
0.16673031449317932,
-0.3329618573188782,
-0.23147933185100555,
-0.7289916276931763,
0.0210503488779068,
0.6467806696891785,
-0.581549882888794,
-0.04540371894836426... | |
T& value) {
do_for_each(std::plus<T>(), value);
return *this;
}
Vector& operator -= (const T& value) {
do_for_each(std::minus<T>(), value);
return *this;
}
Vector& operator *= (const T& value) {
do_for_each(std::multiplies<T>(), value);
return *this... | [
0.0419677197933197,
-0.38112905621528625,
0.612557053565979,
-0.23822198808193207,
0.3337636888027191,
0.44984644651412964,
-0.15066441893577576,
-0.6692500114440918,
-0.2074294239282608,
-0.3357715904712677,
-0.3203015923500061,
0.6112009882926941,
-0.6978169083595276,
-0.1695341467857360... | |
/= (const T& value) {
do_for_each(std::divides<T>(), value);
return *this;
}
private:
template<typename BinFun>
void do_for_each(BinFun op, const T& value) {
std::transform(data, data + D, data, std::bind2nd(op, value));
}
T data[D];
};
```
[std::transform](http://www.s... | [
0.36175841093063354,
-0.5925590395927429,
0.38446491956710815,
-0.30549168586730957,
0.08953749388456345,
0.15560108423233032,
0.14203466475009918,
-0.7154383659362793,
0.19347502291202545,
-0.5463373064994812,
-0.45676782727241516,
0.4667012095451355,
-0.4847663342952728,
0.12722668051719... | |
I have a dropdown box and a literal tag inside an Update Panel. On the selection change event of the dropdown up requery the database and repopulate the literal tag and then call UPdatePanel.Update().
below, is there are way i can avoid having to create a new Oledbconnection each time as this seems slow. Can i reuse a... | [
0.09529642760753632,
-0.01686049811542034,
0.5891826748847961,
-0.08055693656206131,
0.18980109691619873,
-0.01876404508948326,
0.19997386634349823,
-0.16826428472995758,
-0.1109316498041153,
-0.8268524408340454,
-0.1305309236049652,
0.766013503074646,
-0.43516913056373596,
0.1817199438810... | |
var objConn = new OleDbConnection(dataSource);
string id = People[cboPeople.Text];
UpdateLiteral(objConn, id);
}
```
With .NET is not a good idea to keep your connection alive longer than needs. Good practice would be to put a using statement around it (so it always gets cleaned up):
```
string dataSource = C... | [
-0.05042603239417076,
0.033385369926691055,
0.5292407870292664,
-0.17474642395973206,
0.21471068263053894,
-0.17011277377605438,
0.06300925463438034,
-0.13136492669582367,
-0.5469733476638794,
-0.6672712564468384,
-0.21889039874076843,
0.36302605271339417,
-0.5944702625274658,
0.1727181822... | |
a connection is needed it is used from the pool. So the overhead is not as much as you think and it is not slow. In actual fact you will find that it will use the same connection as long as only one at a time is needed.
The danger with keeping connections open is that they never get closed, and in high demand situatio... | [
0.37738361954689026,
-0.27221331000328064,
0.23147737979888916,
0.5624486207962036,
0.3690357208251953,
-0.20935530960559845,
0.028335396200418472,
0.03377838805317879,
-0.5626363158226013,
-0.6197134852409363,
0.1734839230775833,
0.47326529026031494,
-0.29124367237091064,
0.08266097307205... | |
I was hoping to automate some tasks related to SubVersion, so I got SharpSvn. Unfortunately I cant find much documentation for it.
I want to be able to view the changes after a user commits a new revision so I can parse the code for special comments that can then be uploaded into my ticket system.
If you just want to... | [
0.42558014392852783,
-0.16025002300739288,
0.4075583815574646,
0.05856233462691307,
-0.3841003179550171,
-0.3597643971443176,
0.24924065172672272,
0.10530506074428558,
-0.27342548966407776,
-0.4241389036178589,
0.21663759648799896,
0.7551118731498718,
0.019090868532657623,
0.02185743488371... | |
you can use two routes:
1. A post-commit hook that processes changes one at a time
2. A scheduled service that calls 'svn log -r <last-retrieved>:HEAD' every once in a while.
The last daily builds of SharpSvn have some support for commit hooks, but that part is not really api-stable yet.
You could create a post comm... | [
-0.1110076829791069,
-0.2818121314048767,
0.7237851023674011,
-0.2844257950782776,
0.19424456357955933,
0.15944001078605652,
0.3010995388031006,
-0.2127818912267685,
-0.21311594545841217,
-0.5635225176811218,
-0.29850324988365173,
0.41978996992111206,
-0.3424670100212097,
0.226034745573997... | |
out ci);
// ci contains information on the commit e.g.
Console.WriteLine(ci.LogMessage); // Has log message
foreach(SvnChangeItem i in ci.ChangedPaths)
{
//
}
}
}
```
(For a complete solution you would also have to hook the post-revprop-change, as your users might change the log message... | [
-0.008737914264202118,
-0.29728248715400696,
0.5309327840805054,
-0.13840538263320923,
0.30612659454345703,
0.04371867701411247,
0.10184615850448608,
-0.12796299159526825,
-0.29435279965400696,
-0.7576082944869995,
-0.1735328733921051,
0.30669456720352173,
-0.4902358055114746,
0.3961903154... | |
I came across the case where depending on the execution path I may need to invoke an inclusion of .js file from controller. Is there a nice way of doing it? (besides setting some view variable with actual .js include code)?
See the view helper headScript(). I'm just writing this off the top of my head but I think it wo... | [
0.08022817224264145,
-0.1570577621459961,
0.699952244758606,
-0.19397646188735962,
-0.21391065418720245,
-0.03467908501625061,
0.1917186677455902,
-0.10930449515581131,
-0.2622697651386261,
-0.7574352025985718,
0.046111270785331726,
0.7443577647209167,
-0.4474644958972931,
0.18074944615364... | |
It seems with the built in friendly routing library in .NET MVC, it would allow us to do something like this.
In case it's not obvious what I want to with the built in stuff in .NET MVC, I want to a url starting with www to be automatically redirected to a non-www url using the MVC framework.
There are a number of way... | [
0.5175567269325256,
0.1197308674454689,
0.4337072968482971,
-0.010258150286972523,
-0.1698327362537384,
-0.2620120942592621,
0.27564340829849243,
0.10333649814128876,
-0.08708518743515015,
-0.5727965235710144,
0.3542645275592804,
0.570434033870697,
-0.3085373640060425,
-0.02452423982322216... | |
rewriting.
It was [discussed on the ASP.NET forums](http://forums.asp.net/t/1324018.aspx) and I chose to use a WwwFilter on each controller. This has worked for me, no issues. | [
0.5003153085708618,
-0.3236260712146759,
0.6111831068992615,
0.11608473211526871,
0.09803100675344467,
0.012194494716823101,
-0.06486146152019501,
-0.17367850244045258,
-0.418559730052948,
-0.6499857902526855,
0.11241715401411057,
0.4958881735801697,
-0.18641336262226105,
0.135669350624084... | |
If I am posting a question about a query against an Oracle database, what should I include in my question so that people have a chance to answer me? How should I get this information?
Simply providing the poorly performing query may not be enough.
Ideally, get the full query plan using DBMS\_XPLAN.DISPLAY\_CURSOR usin... | [
0.27789077162742615,
-0.1750640571117401,
0.3148757517337799,
0.11788772791624069,
-0.12123484909534454,
0.06857477128505707,
0.2110859602689743,
-0.2615170180797577,
0.1082429364323616,
-0.8864735960960388,
-0.20503750443458557,
0.5463370680809021,
-0.46851179003715515,
-0.179122924804687... | |
database parameters, it is useful to know (especially anything optimizer related).
select \* from v$parameter where rownum < 5 and isdefault != 'TRUE';
\*If you do a
alter session set events '10053 trace name context forever, level 1'
and parse a query, there'll be a log file that will include all the parameters used... | [
0.136363685131073,
-0.21656902134418488,
0.5533350706100464,
0.36264780163764954,
0.1849338263273239,
-0.20897015929222107,
0.11787012219429016,
-0.1144087016582489,
-0.23122404515743256,
-0.6640762686729431,
0.17786693572998047,
0.23783621191978455,
0.027342576533555984,
0.386935770511627... | |
from v$sql.
Also, who do you THINK it should be able to run faster. Do you think there's a better plan, or are you just crossing your fingers. | [
0.6138883233070374,
-0.238018199801445,
-0.05659695342183113,
0.4134065508842468,
-0.05364347994327545,
-0.303338885307312,
0.04179394245147705,
0.4216335415840149,
-0.270689457654953,
-0.3114551603794098,
0.33118686079978943,
0.5243527889251709,
-0.11644109338521957,
-0.007231877185404301... | |
I'm building a small web app in PHP that stores some information in a plain text file. However, this text file is used/modified by all users of my app at some given point in time and possible at the same time.
So the questions is. What would be the best way to make sure that only one user can make changes to the file ... | [
0.5718578696250916,
-0.032495249062776566,
0.667458176612854,
-0.08982254564762115,
0.27168363332748413,
-0.007818819023668766,
0.23320263624191284,
-0.38492459058761597,
0.005210968665778637,
-0.6415764689445496,
-0.039435941725969315,
0.6144514679908752,
-0.40142109990119934,
0.097645759... | |
// truncate file
fwrite($fp, "Write something here\n");
fflush($fp); // flush output before releasing the lock
flock($fp, LOCK_UN); // release the lock
} else {
echo "Couldn't get the lock!";
}
fclose($fp);
```
Take a look at the <http://www.php.net/flock> | [
0.10801412165164948,
-0.18643486499786377,
0.43080323934555054,
-0.48999345302581787,
0.21195557713508606,
-0.10207933187484741,
0.6745224595069885,
-0.49216794967651367,
-0.003901373129338026,
-0.09479556977748871,
-0.1640942096710205,
0.604613721370697,
-0.5741112232208252,
-0.0264193378... | |
I am develop a medium system in ASP.net with MS SQL Server Database and I wonder **what is the best way to create a model layer with LINQ or create own classes that dealing with database?**
The best way is subjective, but I think the easiest is to use [LINQ to SQL.](http://weblogs.asp.net/scottgu/archive/2007/05/19/usi... | [
0.1582442820072174,
0.22429364919662476,
0.5025258660316467,
0.04029252752661705,
0.026485588401556015,
-0.33087158203125,
0.20321901142597198,
-0.0953361764550209,
-0.18269775807857513,
-0.5294683575630188,
0.0485876128077507,
0.510672926902771,
-0.07688401639461517,
-0.05759869143366814,... | |
Here's what I got so far (that doesn't work). At this point I thought my target was Ansi encoded, but I really don't want to have to know at this point. My browser seems to be able to determine what encoding to use, How can I?
```
static void GetUrl(Uri uri, string localFileName)
{
HttpWebRequest request = (HttpWe... | [
0.1391611099243164,
-0.3232716917991638,
0.5304808020591736,
-0.10898254811763763,
-0.07280035316944122,
0.2354043424129486,
0.4571772813796997,
-0.24198098480701447,
-0.032235037535429,
-0.9687507152557373,
-0.35734912753105164,
0.5726766586303711,
-0.47495219111442566,
0.2214503884315490... | |
File.OpenWrite(localFileName);
using (StreamWriter sw = new StreamWriter(fileStream, Encoding.Default))
{
sw.Write(reader.ReadToEnd());
sw.Flush();
sw.Close();
}
}
```
---
**After answers** (currently only tested on a UTF-8 site):
```
static void GetUrl(Uri uri, string localFile... | [
-0.09250399470329285,
-0.0754028856754303,
0.7793723940849304,
-0.30638471245765686,
0.19268852472305298,
0.36062368750572205,
0.5426356792449951,
-0.3557005524635315,
0.08324353396892548,
-0.8207994103431702,
-0.48758700489997864,
0.4213641285896301,
-0.18166375160217285,
0.07190689444541... | |
Encoding encoding = Encoding.GetEncoding(response.CharacterSet);
StreamReader reader = new StreamReader(response.GetResponseStream(), encoding);
using (StreamWriter sw = new StreamWriter(localFileName, false, encoding))
{
sw.Write(reader.ReadToEnd());
sw.Flush();
... | [
-0.24640221893787384,
-0.4053060710430145,
0.861846387386322,
-0.20528090000152588,
0.26693081855773926,
0.40900513529777527,
0.2911217212677002,
-0.27745816111564636,
0.17731086909770966,
-0.9086884260177612,
-0.32196804881095886,
0.47228601574897766,
-0.1905871331691742,
0.13083475828170... | |
response.Close();
}
}
```
There are three ways how web-browsers try to detect character encoding.
Look for (if it's HTML):
```
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
```
or (for XHTML)
```
<?xml version="1.0" encoding="ISO-8859-1"?>
```
or sometimes it's even specified in htt... | [
-0.17768576741218567,
-0.12344206869602203,
0.4543301463127136,
-0.09084228426218033,
-0.24208131432533264,
0.375835657119751,
0.15291042625904083,
-0.2792445421218872,
-0.03641894832253456,
-0.8431335091590881,
-0.42112997174263,
0.5017133355140686,
-0.3046688735485077,
-0.175195634365081... | |
How can I make Emacs show blank spaces (like a space, a tab, a line-jump, etc). Many other editors like Kate and Eclipse have this feature and I find it very useful to see when code is indent-broken because of mix of spaces and tabs (particularly Python).
[WhiteSpace](https://www.emacswiki.org/emacs/WhiteSpace) mode is... | [
-0.11343763768672943,
-0.2392122447490692,
0.441989928483963,
0.03494198992848396,
0.045063894242048264,
0.08781527727842331,
0.4655410647392273,
-0.0029352435376495123,
-0.42477068305015564,
-0.677424430847168,
-0.3317360281944275,
0.5107375383377075,
-0.349179744720459,
-0.14537553489208... | |
With wxWidgets I use the following code:
```
HWND main_window = ...
...
wxWindow *w = new wxWindow();
wxWindow *window = w->CreateWindowFromHWND(0, (WXHWND) main_window);
```
How do I do the same thing in Qt? The `HWND` is the handle of the window I want as the parent window for the new QtWidget.
Use the create meth... | [
0.173760786652565,
-0.044126372784376144,
0.828406572341919,
-0.1726299226284027,
-0.06622461974620819,
-0.16128328442573547,
0.34120115637779236,
-0.2901787757873535,
0.11593425273895264,
-0.9424472451210022,
-0.16817636787891388,
0.6120424270629883,
-0.2934626042842865,
0.368431180715560... | |
I am trying to wire up dependency injection with Windsor to standard asp.net web forms. I think I have achieved this using a HttpModule and a CustomAttribute (code shown below), although the solution seems a little clunky and was wondering if there is a better supported solution out of the box with Windsor?
There are ... | [
0.3600819408893585,
-0.07980933040380478,
0.36867010593414307,
-0.17222777009010315,
0.04116891697049141,
0.180717334151268,
0.27542078495025635,
-0.3156434893608093,
-0.2082512229681015,
-0.6977649331092834,
-0.023185066878795624,
0.7084661722183228,
-0.41334569454193115,
-0.0674690604209... | |
Logger.Write("page loading");
}
[Inject]
public ILogger Logger { get; set; }
}
// WindsorHttpModule.cs
public class WindsorHttpModule : IHttpModule
{
private HttpApplication _application;
private IoCProvider _iocProvider;
public void Init(HttpApplicatio... | [
-0.08108677715063095,
0.0003853572125080973,
0.1226920560002327,
0.04944765567779541,
-0.01688138209283352,
0.1682422161102295,
0.41305631399154663,
-0.3497387766838074,
-0.32680612802505493,
-0.5313729047775269,
-0.33894312381744385,
0.3794426918029785,
-0.48716598749160767,
-0.0250793807... | |
{
_application = context;
_iocProvider = context as IoCProvider;
if(_iocProvider == null)
{
throw new InvalidOperationException("Application must implement IoCProvider");
} | [
-0.106174536049366,
0.18606233596801758,
0.1849612444639206,
-0.0916585773229599,
0.22364211082458496,
-0.16597913205623627,
0.6427330374717712,
-0.437623530626297,
-0.14905621111392975,
-0.42027947306632996,
-0.5491804480552673,
0.24593158066272736,
-0.48570090532302856,
0.429600119590759... | |
_application.PreRequestHandlerExecute += InitiateWindsor;
}
private void InitiateWindsor(object sender, System.EventArgs e)
{
Page currentPage = _application.Context.CurrentHandler as Page;
if(currentPage != null)
{
InjectPropertiesOn(currentP... | [
-0.47776511311531067,
-0.0637255385518074,
0.6803694367408752,
-0.31003695726394653,
0.28071358799934387,
0.07797731459140778,
0.5990681052207947,
-0.45002806186676025,
-0.10439940541982651,
-0.5039869546890259,
-0.5781161189079285,
0.43400466442108154,
-0.48280468583106995,
0.356415361166... | |
currentPage.InitComplete += delegate { InjectUserControls(currentPage); };
}
}
private void InjectUserControls(Control parent)
{
if(parent.Controls != null)
{
foreach (Control control in parent.Controls) | [
-0.4348585903644562,
-0.2376413196325302,
0.6268563270568848,
-0.050805047154426575,
0.3767227232456207,
0.07187394797801971,
0.32257160544395447,
-0.17033416032791138,
-0.0019346734043210745,
-0.5375215411186218,
-0.29772505164146423,
0.3857349753379822,
-0.402474969625473,
0.401485502719... | |
{
if(control is UserControl)
{
InjectPropertiesOn(control); | [
-0.6541993021965027,
-0.37340712547302246,
0.40930458903312683,
-0.27568092942237854,
0.5644798874855042,
-0.2159912884235382,
0.10105505585670471,
-0.1371021717786789,
0.4794451594352722,
-0.35485467314720154,
-0.5317631959915161,
0.8161457777023315,
-0.4817394018173218,
0.030022259801626... | |
}
InjectUserControls(control);
}
}
}
private void InjectPropertiesOn(object currentPage)
{
PropertyInfo[] properties = currentPage.GetType().GetProperties(); | [
-0.19502343237400055,
-0.33862099051475525,
0.5674039721488953,
-0.30771535634994507,
0.38351571559906006,
-0.14351671934127808,
0.2670535147190094,
-0.4027748107910156,
-0.0902160182595253,
-0.5594617128372192,
-0.40115347504615784,
0.8527487516403198,
-0.3855235278606415,
0.3699279725551... | |
foreach(PropertyInfo property in properties)
{
object[] attributes = property.GetCustomAttributes(typeof (InjectAttribute), false);
if(attributes != null && attributes.Length > 0)
{
object valueToInject = _iocProvider.Container.Resolve(prop... | [
-0.25368979573249817,
0.040209393948316574,
0.300687700510025,
-0.20823726058006287,
0.28259462118148804,
-0.10040262341499329,
0.2354007214307785,
-0.6516136527061462,
0.16209518909454346,
-0.40448153018951416,
-0.5481261610984802,
0.6219701170921326,
-0.1558491438627243,
0.18014879524707... | |
property.SetValue(currentPage, valueToInject, null);
}
}
}
}
// Global.asax.cs
public class Global : System.Web.HttpApplication, IoCProvider
{
private IWindsorContainer _container;
public override void | [
-0.12521158158779144,
-0.22229619324207306,
0.3191754221916199,
0.10001639276742935,
0.2833094000816345,
-0.1660347729921341,
0.243397518992424,
-0.036650098860263824,
-0.36088940501213074,
-0.587864339351654,
-0.2644791305065155,
0.45275476574897766,
-0.29601600766181946,
0.53000944852828... | |
Init()
{
base.Init();
InitializeIoC();
}
private void InitializeIoC()
{
_container = new WindsorContainer();
_container.AddComponent<ILogger, Logger>();
} | [
-0.2966153025627136,
-0.16681167483329773,
0.23853886127471924,
-0.15347199141979218,
0.38809749484062195,
0.3773735761642456,
0.10530384629964828,
-0.2106303572654724,
-0.27181926369667053,
-0.39490699768066406,
-0.3088613748550415,
0.1076400950551033,
-0.53327876329422,
0.213318660855293... | |
public IWindsorContainer Container
{
get { return _container; }
}
}
public interface IoCProvider
{
IWindsorContainer Container { get; }
}
```
I think you're basically on the right track - If you have not already I would suggest taking a look at Rhino Igloo, an WebFo... | [
0.10654310882091522,
-0.055749278515577316,
0.30724871158599854,
0.09799640625715256,
-0.21670278906822205,
-0.3358585834503174,
0.27743086218833923,
0.07290574908256531,
-0.4673178791999817,
-0.6780698895454407,
-0.10903353989124298,
0.48851609230041504,
-0.20324301719665527,
0.1357123851... | |
and the source is [here](https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/trunk/rhino-igloo) - Ayende (the Author of Rhino Igloo) tackles the issue of using Windsor with webforms quite well in this project/library.
I would cache the reflection info if you're going to inject the entire nested set of controls... | [
0.40006324648857117,
0.24085815250873566,
-0.011038794182240963,
0.20249056816101074,
-0.19775062799453735,
0.12413350492715836,
0.056483134627342224,
-0.23096150159835815,
-0.39103269577026367,
-0.3046276271343231,
0.3006408214569092,
0.5618711113929749,
0.05050184205174446,
-0.1692707836... | |
I'm looking for a tool that will generate an assembly/project dependency diagram in Visio (or as close as possible) to assist me with breaking up some of our system into more manageable trunks.
The ability to include/exclude non-project dependencies is a must (i.e. include/exclude System. assemblies).
Try ReSharper. (... | [
0.8490884900093079,
-0.16078627109527588,
0.16843728721141815,
0.179442897439003,
0.1789044737815857,
-0.11878839135169983,
-0.049329839646816254,
-0.12479312717914581,
-0.3551843464374542,
-0.7131608724594116,
0.012180029414594173,
0.6423617005348206,
-0.3167346715927124,
-0.1239573061466... | |
Are these two terms interchangeable?
CIL is the term used in the [CLI Standard](http://www.ecma-international.org/publications/standards/Ecma-335.htm). MSIL is (I suppose) CIL created by MS tools. Effectively they are synonymous.
[Brad Abrams says this.](http://blogs.msdn.com/brada/archive/2005/09/20/CILorMSIL.aspx) | [
0.3668815493583679,
-0.08632537722587585,
0.6754776835441589,
0.19501028954982758,
0.16299520432949066,
-0.43767860531806946,
-0.6834754347801208,
0.24430681765079498,
-0.6157028079032898,
-0.44753116369247437,
-0.2914310097694397,
0.061651743948459625,
-0.19366659224033356,
0.674767971038... | |
i need to check whether the user clicking the browser Refresh button and redirect to error page. Can we do this in javascript or any server side methods in ASP.net
If you give each link you present a unique ID (e.g. a GUID) in the URL as a parameter, then you can keep track of all the requests you've processed. (You co... | [
0.35676831007003784,
-0.04692402109503746,
0.40192732214927673,
0.07843863219022751,
-0.2216760516166687,
-0.3630130887031555,
0.257133811712265,
0.003456876380369067,
-0.11971677839756012,
-1.1075689792633057,
0.1429419070482254,
0.5653622150421143,
-0.15962253510951996,
0.093465551733970... | |
you see it again, redirect to an error page.
It's pretty ugly though, and users could just edit the URL to change the GUID slightly. (You could fix this last flaw by recording the GUID when you *generate* it, and update the table to indicate when it's been *used*.)
In general, users expect to be able to refresh the p... | [
0.5045710206031799,
-0.08983203768730164,
0.21879811584949493,
0.15213534235954285,
-0.2280735820531845,
-0.3663168251514435,
0.374629944562912,
0.24754340946674347,
-0.5092371106147766,
-0.6963124871253967,
0.10349391400814056,
0.3299429714679718,
-0.19167488813400269,
0.05689718201756477... | |
Is there a good way in C++ to implement (or fake) a type for a generic vector of vectors?
Ignore the issue of when a vector of vectors is a good idea (unless there's something equivalent which is always better). Assume that it does accurately model the problem, and that a matrix does not accurately model the problem. ... | [
0.18405722081661224,
-0.033346597105264664,
0.18723104894161224,
0.006919747218489647,
-0.09168943762779236,
-0.17438091337680817,
0.2049635350704193,
-0.16632261872291565,
-0.037428028881549835,
-0.5014433860778809,
-0.045591190457344055,
0.5424391627311707,
-0.6593604683876038,
-0.150596... | |
that's not possible, since typedef can't be templated.
```
#define vecvec(T) vector< vector<T> >
```
is close, and would save duplicating the type across every templated function which operates on vecvecs, but would not be popular with most C++ programmers.
You want to have template-typedefs. That is *not* yet suppo... | [
0.04914034903049469,
-0.15083575248718262,
0.560871958732605,
-0.04610671475529671,
-0.2562595307826996,
-0.14130330085754395,
0.1260720193386078,
-0.11044032871723175,
-0.17004920542240143,
-0.7473475933074951,
-0.1300332397222519,
0.5437403321266174,
-0.48984119296073914,
0.2410695105791... | |
Maybe this is an easy question, maybe not. I have a select box where I hardcode with width. Say 120px.
```html
<select style="width: 120px">
<option>REALLY LONG TEXT, REALLY LONG TEXT, REALLY LONG TEXT</option>
<option>ABC</option>
</select>
```
I want to be able to show the second option so that the user can ... | [
0.5681121349334717,
-0.14365187287330627,
0.4892280101776123,
-0.14701169729232788,
-0.11691472679376602,
-0.1612992137670517,
0.2012908011674881,
-0.21062195301055908,
-0.24371065199375153,
-0.9213302135467529,
0.054521385580301285,
0.8338508009910583,
-0.16256143152713776,
-0.47622093558... | |
try and set the `title` attribute to each option. This is non-standard HTML (if you care for this minor infraction here), but IE (and Firefox as well) will display the entire text in a mouse popup on mouse hover.
* You could use JavaScript to show the text in some positioned DIV when the user selects something. IMHO th... | [
0.42778193950653076,
-0.2862555682659149,
0.2298067808151245,
0.025585025548934937,
0.07874598354101181,
-0.3329851031303406,
0.33263903856277466,
-0.028060758486390114,
-0.1465955376625061,
-0.6523374915122986,
-0.28683507442474365,
0.7071861624717712,
-0.20678487420082092,
-0.15286879241... | |
use a select box at all, but [implement its functionality using other markup and CSS](http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2359319&SiteID=1). Not my favorite but I wanted to mention it.
If you are adding a long option later through JavaScript, look here: [How to update HTML “select” box dynamically in... | [
0.2136114239692688,
-0.510867714881897,
0.500281810760498,
-0.13023681938648224,
0.016086824238300323,
-0.38652583956718445,
0.14332927763462067,
-0.11012499034404755,
-0.2950706481933594,
-0.6577867269515991,
-0.3873288333415985,
0.35768577456474304,
-0.3464295268058777,
-0.27531483769416... | |
Is it possible to catch an recycle event in the global.asax?
I know Application\_End will be triggered but is there a way to know that it was triggered by a recycle of the application pool?
thx, Lieven Cardoen aka Johlero
So, here is an idea how this could work.
Based on my [previous answer](https://stackoverflow.co... | [
-0.0661327913403511,
-0.14015446603298187,
0.2573945224285126,
0.006563514471054077,
0.10305771976709366,
-0.044733479619026184,
0.012878951616585255,
-0.3905951976776123,
-0.860802948474884,
0.059636253863573074,
-0.14535047113895416,
0.12147942185401917,
-0.38846758008003235,
0.076974868... | |
get called.
I suggest following strategy:
In the (regular) ProcessExit handler (which we suppose will not be called on a application pool recycling), write some file to disk like "`app_domain_end_ok.tmp`".
Then in the Application\_Start of your global.asax check for this file. If it doesn't exist it is a sign that t... | [
0.21643280982971191,
-0.0905047357082367,
0.6382240056991577,
0.16210880875587463,
0.19600823521614075,
-0.4792735278606415,
0.46520355343818665,
0.34137558937072754,
-0.3478465676307678,
-0.7275294065475464,
-0.2830698788166046,
0.59539395570755,
-0.35301119089126587,
0.26927825808525085,... | |
I'm looking for an open-source SGML parser written in plain C. This is to parse bona-fide SGML, not malformed stuff.
Any ideas?
This came up on a fast Google search ([sgml c parser](http://www.google.com/search?q=sgml+c+parser)): <http://www.w3.org/Library/src/SGML.html>. Does that help?
Or perhaps this one: <http:/... | [
0.34493207931518555,
0.31056156754493713,
0.15406100451946259,
0.17690537869930267,
-0.2603934109210968,
-0.02059824950993061,
0.04080871492624283,
0.1370086520910263,
-0.14884616434574127,
-0.45095235109329224,
0.2992168962955475,
0.2046974152326584,
-0.1599312573671341,
0.114777669310569... | |
I have class with a member function that takes a default argument.
```
struct Class
{
void member(int n = 0)
{}
};
```
By means of std::tr1::mem\_fn I can invoke it:
```
Class object;
std::tr1::mem_fn(&Class::member)(object,10);
```
That said, if I want to invoke the *callable* member on the object with ... | [
-0.37244948744773865,
0.0558052621781826,
0.43192246556282043,
-0.1630496382713318,
0.2049025446176529,
-0.0012682267697528005,
0.35786694288253784,
-0.6233246326446533,
0.07999858260154724,
-0.48586854338645935,
-0.36380839347839355,
0.6815680861473083,
-0.34325605630874634,
0.21279700100... | |
_Res std::tr1::_Mem_fn<_Res (_Class::*)(_ArgTypes ...)>::operator()(_Class*, _ArgTypes ...) const [with _Res = void, _Class = Class, _ArgTypes = int]
```
Still, the I have the same problem when Class::member is overloaded by members that takes different arguments...
Default functions are bound at call time, but can't... | [
-0.33135950565338135,
-0.07719994336366653,
0.715871274471283,
-0.12536512315273285,
0.07395708560943604,
-0.01954190619289875,
0.4702368676662445,
-0.5855761170387268,
-0.18908308446407318,
-0.6595221161842346,
-0.3742241859436035,
0.9523096084594727,
-0.13195529580116272,
0.3367178738117... | |
`mem_fn`, but you can't do both in one object. You would have to write your own wrapper class for that.
As for overloads, you will have to explicitly specify the template arguments for `mem_fn` so the right function pointer is picked as in `mem_fn<void(int)>(&Class::member)`. | [
-0.20069052278995514,
-0.08129599690437317,
0.029462607577443123,
-0.10076211392879486,
0.05421272665262222,
0.0029949455056339502,
0.2021275758743286,
-0.22124798595905304,
-0.15322479605674744,
-0.5092053413391113,
-0.19237302243709564,
0.5596246719360352,
-0.3979543149471283,
0.11793735... | |
How can I change the master volume level? Using this code
```
[DllImport ("winmm.dll")]
public static extern int waveOutSetVolume (IntPtr hwo, uint dwVolume);
waveOutSetVolume (IntPtr.Zero, (((uint)uint.MaxValue & 0x0000ffff) | ((uint)uint.MaxValue << 16)));
```
I can set the wave volume but if the master volume is... | [
0.3596733510494232,
-0.24896247684955597,
1.1963906288146973,
-0.23945502936840057,
-0.06428004056215286,
0.09786751121282578,
0.4165586829185486,
-0.7964916825294495,
-0.2837567925453186,
-0.30718883872032166,
0.26663798093795776,
0.7484670877456665,
-0.15836389362812042,
0.46927005052566... | |
SOURCE = 0x80000000
}
[Flags] enum MIXER : uint{
GETLINEINFOF_DESTINATION = 0x00000000,
GETLINEINFOF_SOURCE = 0x00000001,
GETLINEINFOF_LINEID = 0x00000002,
GETLINEINFOF_COMPONENTTYPE = 0x00000003,
GETLINEINFOF_TARGETTYPE = 0x00000004,
GETLINEINFOF_QUE... | [
0.2208641916513443,
-0.381442129611969,
0.9829133749008179,
-0.23586344718933105,
-0.04727200046181679,
0.32562804222106934,
0.1531592458486557,
-0.44643834233283997,
0.07963191717863083,
-0.34209728240966797,
0.08837324380874634,
0.5637158751487732,
-0.491013765335083,
0.13510540127754211... | |
= 0x00000000,
GETLINECONTROLSF_ONEBYID = 0x00000001,
GETLINECONTROLSF_ONEBYTYPE = 0x00000002,
GETLINECONTROLSF_QUERYMASK = 0x0000000F,
GETCONTROLDETAILSF_VALUE = 0x00000000,
GETCONTROLDETAILSF_LISTTEXT = 0x00000001,
GETCONTROLDETAILSF_QUERYMASK = 0x0000000F,
OBJECTF_MIXER ... | [
-0.09272011369466782,
-0.3638773262500763,
1.0897681713104248,
-0.37761422991752625,
-0.17943719029426575,
0.027256574481725693,
0.0972391664981842,
-0.6091838479042053,
-0.22693376243114471,
-0.4127886891365051,
-0.04038015380501747,
0.6689030528068542,
-0.32835498452186584,
0.05256449058... | |
OBJECTF_WAVEIN = 0x20000000,
OBJECTF_MIDIOUT = 0x30000000,
OBJECTF_MIDIIN = 0x40000000,
OBJECTF_AUX = 0x50000000,
OBJECTF_HANDLE = 0x80000000, | [
-0.2877321243286133,
-0.36458081007003784,
0.6878299117088318,
-0.24735727906227112,
0.017048398032784462,
0.2997063398361206,
-0.18978635966777802,
-0.3001069128513336,
-0.2995091378688812,
-0.8135562539100647,
0.2613533139228821,
0.6129578351974487,
-0.15474209189414978,
0.28347283601760... | |
OBJECTF_HMIXER = OBJECTF_HANDLE | OBJECTF_MIXER,
OBJECTF_HWAVEOUT = OBJECTF_HANDLE | OBJECTF_WAVEOUT,
OBJECTF_HWAVEIN = OBJECTF_HANDLE | OBJECTF_WAVEIN,
OBJECTF_HMIDIOUT = OBJECTF_HANDLE | OBJECTF_MIDIOUT,
OBJECTF_HMIDIIN = | [
0.246353417634964,
-0.22737424075603485,
0.6550524830818176,
-0.3529922366142273,
-0.28488293290138245,
0.4245736300945282,
0.062140051275491714,
-0.5061178207397461,
-0.28943607211112976,
-0.4964187741279602,
-0.33666369318962097,
0.6255813241004944,
-0.18254704773426056,
0.27830055356025... | |
OBJECTF_HANDLE | OBJECTF_MIDIIN
}
[Flags] enum MIXERCONTROL_CT : uint{
CLASS_MASK = 0xF0000000,
CLASS_CUSTOM = 0x00000000,
CLASS_METER = 0x10000000,
CLASS_SWITCH = 0x20000000,
CLASS_NUMBER = 0x30000000,
CLASS_SLIDER = 0x40000000,
CLASS_FADER = 0x5000000... | [
0.1380089521408081,
-0.5674177408218384,
0.8861654996871948,
-0.07162705063819885,
0.03754132613539696,
0.3138619065284729,
0.07395994663238525,
-0.5537158250808716,
-0.10003659129142761,
-0.5366418361663818,
0.26205193996429443,
0.5948933959007263,
-0.2508634626865387,
0.28221845626831055... | |
0x60000000,
CLASS_LIST = 0x70000000,
SUBCLASS_MASK = 0x0F000000,
SC_SWITCH_BOOLEAN = 0x00000000,
SC_SWITCH_BUTTON = 0x01000000,
SC_METER_POLLED = 0x00000000,
SC_TIME_MICROSECS = 0x00000000,
SC_TIME_MILLISECS = 0x01000000,
SC_LIST_SINGLE = 0x00000000,
SC_LIST_MUL... | [
-0.0020585479214787483,
-0.3792499303817749,
0.6454659700393677,
0.03716045618057251,
0.16523747146129608,
0.19990046322345734,
0.15798896551132202,
-0.3359747529029846,
-0.41106897592544556,
-0.825443685054779,
0.011421356350183487,
0.10487350821495056,
-0.14501938223838806,
0.39405995607... | |
UNITS_BOOLEAN = 0x00010000,
UNITS_SIGNED = 0x00020000,
UNITS_UNSIGNED = 0x00030000,
UNITS_DECIBELS = 0x00040000, /* in 10ths */
UNITS_PERCENT = 0x00050000, /* in 10ths */
}
[Flags] enum MIXERCONTROL_CONTROLTYPE : uint{
CUSTOM = MIXERCONTROL_CT.CLASS_CUSTOM | MIXERCONTROL_C... | [
-0.01902857795357704,
-0.21064908802509308,
0.7330793142318726,
0.3359583616256714,
-0.11052107065916061,
0.5883010625839233,
0.18320900201797485,
-0.6001235246658325,
-0.11130597442388535,
-0.20877577364444733,
0.12011106312274933,
0.4007473886013031,
0.07979922741651535,
0.57241630554199... | |
PEAKMETER = SIGNEDMETER + 1,
UNSIGNEDMETER = MIXERCONTROL_CT.CLASS_METER | MIXERCONTROL_CT.SC_METER_POLLED | MIXERCONTROL_CT.UNITS_UNSIGNED,
BOOLEAN = MIXERCONTROL_CT.CLASS_SWITCH | MIXERCONTROL_CT.SC_SWITCH_BOOLEAN | MIXERCONTROL_CT.UNITS_BOOLEAN,
ONOFF = BOOLEAN + 1,
MUTE ... | [
-0.031627047806978226,
-0.24291013181209564,
0.7179638147354126,
0.11143689602613449,
-0.34145262837409973,
0.16019117832183838,
0.5687363147735596,
-0.38036802411079407,
0.11396641284227371,
-0.03188162297010422,
-0.017352139577269554,
0.9287402629852295,
-0.17838357388973236,
0.301642805... | |
= BOOLEAN + 4,
STEREOENH = BOOLEAN + 5,
BASS_BOOST = BOOLEAN + 0x00002277,
BUTTON = MIXERCONTROL_CT.CLASS_SWITCH | MIXERCONTROL_CT.SC_SWITCH_BUTTON | MIXERCONTROL_CT.UNITS_BOOLEAN,
DECIBELS = MIXERCONTROL_CT.CLASS_NUMBER | MIXERCONTROL_CT.UNITS_DECIBELS,
SIGNED = MIXER... | [
-0.0288237314671278,
0.03677177429199219,
0.5374391078948975,
-0.09146363288164139,
-0.17567619681358337,
0.49105286598205566,
0.18008463084697723,
-0.6304168701171875,
0.10967861860990524,
-0.01740942895412445,
-0.041504353284835815,
0.6658784747123718,
-0.05032915249466896,
0.47924390435... | |
= MIXERCONTROL_CT.CLASS_NUMBER | MIXERCONTROL_CT.UNITS_PERCENT,
SLIDER = MIXERCONTROL_CT.CLASS_SLIDER | MIXERCONTROL_CT.UNITS_SIGNED,
PAN = SLIDER + 1,
QSOUNDPAN = SLIDER + 2,
FADER = MIXERCONTROL_CT.CLASS_FADER | MIXERCONTROL_CT.UNITS_UNSIGNED,
VOLUME = FADE... | [
0.03136039152741432,
-0.06021202355623245,
0.7546402812004089,
0.07503046840429306,
-0.14379431307315826,
0.7880824208259583,
-0.0619489848613739,
-0.5589712262153625,
-0.15752236545085907,
0.10209213197231293,
0.2321770191192627,
0.4667641520500183,
0.11111462116241455,
0.7563295960426331... | |
= FADER + 2,
TREBLE = FADER + 3,
EQUALIZER = FADER + 4,
SINGLESELECT = MIXERCONTROL_CT.CLASS_LIST | MIXERCONTROL_CT.SC_LIST_SINGLE | MIXERCONTROL_CT.UNITS_BOOLEAN,
MUX = SINGLESELECT + 1,
MULTIPLESELECT = MIXERCONTROL_CT.CLASS_LIST | MIXERCONTROL_CT.SC_LIST_MULTIPLE | MIXER... | [
-0.11542248725891113,
-0.25667712092399597,
1.0164066553115845,
0.14484485983848572,
0.19070009887218475,
0.7084652781486511,
0.1296299546957016,
-0.5923881530761719,
-0.21987581253051758,
-0.3707522749900818,
0.03646725416183472,
0.3509620726108551,
-0.16950830817222595,
0.623529553413391... | |
= MIXERCONTROL_CT.CLASS_TIME | MIXERCONTROL_CT.SC_TIME_MICROSECS | MIXERCONTROL_CT.UNITS_UNSIGNED,
MILLITIME = MIXERCONTROL_CT.CLASS_TIME | MIXERCONTROL_CT.SC_TIME_MILLISECS | MIXERCONTROL_CT.UNITS_UNSIGNED
}
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
struct MIXERLINE{
[StructLayout(Layou... | [
0.5847253799438477,
-0.23664723336696625,
0.8181508779525757,
-0.2855270802974701,
-0.04023575782775879,
0.5241857171058655,
0.3459373414516449,
-0.449077308177948,
0.3314231336116791,
-0.40242084860801697,
0.06816501915454865,
0.5700364112854004,
-0.17943105101585388,
0.33757925033569336,... | |
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=MAXPNAMELEN)]
public string szPname;
}
public uint cbStruct;
public uint dwDestination;
public uint dwSource;
public uint dwLineID;
public MIXERLINE_LINEF fdwLine;
public uint | [
0.5024864077568054,
-0.02032468095421791,
0.35753676295280457,
-0.04506438225507736,
0.25577348470687866,
0.12056075036525726,
0.7339430451393127,
-0.5721861720085144,
0.04538057744503021,
-0.37843671441078186,
-0.4477463662624359,
0.5860781669616699,
-0.15368156135082245,
0.32255524396896... | |
dwUser;
public uint dwComponentType;
public uint cChannels;
public uint cConnection;
public uint cControls;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=MIXER_SHORT_NAME_CHARS)]
public string szShortName;
[MarshalAs(UnmanagedType.ByValTSt... | [
0.49030235409736633,
0.2654421031475067,
0.2786281108856201,
-0.13949699699878693,
0.09747747331857681,
0.07958992570638657,
0.5694877505302429,
-0.4110000729560852,
0.027213960886001587,
-0.12824088335037231,
-0.5631437301635742,
0.5769569873809814,
-0.2967108488082886,
0.2630189061164856... | |
SizeConst=MIXER_LONG_NAME_CHARS)]
public string szName;
public TargetInfo Target;
}
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
struct MIXERCONTROL{
[StructLayout(LayoutKind.Explicit)]
public struct BoundsInfo{
[FieldOffset(0)]
public int lMinimum;
... | [
0.38211366534233093,
-0.4283789098262787,
0.6048172116279602,
-0.4423174560070038,
0.13117706775665283,
0.49806657433509827,
0.562853217124939,
-0.6075764894485474,
-0.06918485462665558,
-0.1476711630821228,
0.07035567611455917,
0.7260724902153015,
-0.5070730447769165,
0.1386226862668991,
... | |
dwMinimum;
[FieldOffset(4)]
public uint dwMaximum;
[FieldOffset(8), MarshalAs(UnmanagedType.ByValArray, SizeConst=4)]
public uint[] dwReserved;
}
[StructLayout(LayoutKind.Explicit)]
public struct MetricsInfo{
[FieldOffset(0)]
public uint cSteps;
[F... | [
-0.08238299190998077,
-0.30085957050323486,
0.3117508590221405,
-0.037849538028240204,
0.03952345624566078,
0.1679449826478958,
0.3512480854988098,
-0.307888001203537,
-0.0025116559118032455,
-0.7175120711326599,
-0.22106695175170898,
0.5941104292869568,
-0.12041661143302917,
0.04835633561... | |
[FieldOffset(4), MarshalAs(UnmanagedType.ByValArray, SizeConst=5)]
public uint[] dwReserved;
}
public uint cbStruct;
public uint dwControlID;
public MIXERCONTROL_CONTROLTYPE dwControlType;
public uint | [
0.20697680115699768,
-0.0722230076789856,
0.27777358889579773,
-0.20767179131507874,
0.12312089651823044,
0.045747771859169006,
0.6986557841300964,
-0.42522358894348145,
0.09199006855487823,
-0.21461643278598785,
-0.41492384672164917,
0.5228670239448547,
-0.18985891342163086,
0.29182872176... | |
fdwControl;
public uint cMultipleItems;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=MIXER_SHORT_NAME_CHARS)]
public string szShortName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst=MIXER_LONG_NAME_CHARS)]
public string szName;
public Bou... | [
0.18932507932186127,
0.10886047035455704,
0.5328750610351562,
-0.18101142346858978,
0.30312877893447876,
0.009339318610727787,
0.5675121545791626,
-0.4657132923603058,
-0.045241545885801315,
0.025457248091697693,
-0.5662926435470581,
0.5024904608726501,
-0.29157599806785583,
0.236848726868... | |
Bounds;
public MetricsInfo Metrics;
}
[StructLayout(LayoutKind.Explicit)]
struct MIXERLINECONTROLS{
[FieldOffset(0)]
public uint cbStruct;
[FieldOffset(4)]
public uint dwLineID;
[FieldOffset(8)]
public uint dwControlID;
[FieldOffset(8)] // not a typo! overlaps previou... | [
0.14404159784317017,
-0.28460797667503357,
0.3702494204044342,
0.0892590805888176,
-0.010298768058419228,
0.04030534625053406,
0.3005508780479431,
-0.4909781813621521,
-0.12148619443178177,
-0.2601490914821625,
-0.19056211411952972,
0.38255491852760315,
-0.09912633150815964,
-0.02160220034... | |
public uint cbmxctrl;
[FieldOffset(20)]
public IntPtr pamxctrl;
}
[StructLayout(LayoutKind.Explicit)]
struct MIXERCONTROLDETAILS{
[FieldOffset(0)]
public uint cbStruct;
[FieldOffset(4)]
public uint dwControlID;
[FieldOffset(8)]
public uint cChannels;
[FieldOffset(12)]
pub... | [
0.5296450853347778,
0.18645232915878296,
0.33543941378593445,
-0.2852686047554016,
-0.000014539004041580483,
0.05869629606604576,
0.42220455408096313,
-0.4786660075187683,
0.028055164963006973,
-0.18266279995441437,
-0.20696671307086945,
0.5387462377548218,
-0.2611711323261261,
-0.03579509... | |
IntPtr paDetails;
}
[StructLayout(LayoutKind.Sequential)]
struct VOLUME{
public int left;
public int right;
}
struct MixerInfo{
public uint volumeCtl;
public uint muteCtl;
public int minVolume;
public int maxVolume;
}
[DllImport("WinMM.dll", CharSet=CharSet.Auto)]
static extern uint mixerGetL... | [
0.19987469911575317,
-0.2329433262348175,
1.130216360092163,
-0.11805228888988495,
-0.10400112718343735,
0.5632166862487793,
0.5475435853004456,
-0.6975999474525452,
0.050601840019226074,
-0.15864096581935883,
-0.3828185200691223,
0.7822313904762268,
-0.13803279399871826,
0.383480668067932... | |
mxl = new MIXERLINE();
MIXERLINECONTROLS mlc = new MIXERLINECONTROLS();
mxl.cbStruct = (uint)Marshal.SizeOf(typeof(MIXERLINE));
mlc.cbStruct = (uint)Marshal.SizeOf(typeof(MIXERLINECONTROLS));
mixerGetLineInfo(IntPtr.Zero, ref mxl, MIXER.OBJECTF_MIXER | MIXER.GETLINEINFOF_DESTINATION);
mlc.dwLineID... | [
0.10344009101390839,
-0.13915911316871643,
1.203440546989441,
-0.1593218743801117,
0.0323750302195549,
0.5175052881240845,
0.4094865918159485,
-0.6002283096313477,
-0.2815028131008148,
-0.15164121985435486,
-0.24370431900024414,
0.4207055866718292,
-0.2797606587409973,
0.584811806678772,
... | |
MIXERCONTROL mxc = (MIXERCONTROL)Marshal.PtrToStructure((IntPtr)((int)mlc.pamxctrl + (int)mlc.cbmxctrl * i), typeof(MIXERCONTROL));
switch(mxc.dwControlType){
case MIXERCONTROL_CONTROLTYPE.VOLUME:
rtn.volumeCtl = mxc.dwControlID;
rtn.minVolume = mxc.Bounds.lMinimum;
r... | [
0.10262308269739151,
-0.2648562788963318,
1.0144630670547485,
0.04461189731955528,
-0.05441322550177574,
0.509766697883606,
0.4604678452014923,
-0.7511535882949829,
-0.09185045957565308,
-0.13033533096313477,
-0.3451083302497864,
0.481986403465271,
-0.15352922677993774,
0.6474660634994507,... | |
rtn.muteCtl = mxc.dwControlID;
break;
}
}
Marshal.FreeHGlobal(mlc.pamxctrl);
return rtn;
}
static VOLUME GetVolume(MixerInfo mi){
MIXERCONTROLDETAILS mcd = new MIXERCONTROLDETAILS();
mcd.cbStruct = (uint)Marshal.SizeOf(typeof(MIXERCONTROLDETAILS));
mcd.dwControlID ... | [
0.15520033240318298,
0.07653152942657471,
1.045102596282959,
-0.17709225416183472,
0.060387324541807175,
0.06563454121351242,
0.7199715375900269,
-0.6999987363815308,
-0.35666510462760925,
-0.1940402388572693,
-0.34401199221611023,
0.47105318307876587,
-0.018786372616887093,
0.427354782819... | |
mcd.paDetails = Marshal.AllocHGlobal((int)mcd.cbDetails);
mixerGetControlDetails(IntPtr.Zero, ref mcd, MIXER.GETCONTROLDETAILSF_VALUE | MIXER.OBJECTF_MIXER);
VOLUME rtn = (VOLUME)Marshal.PtrToStructure(mcd.paDetails, typeof(VOLUME));
Marshal.FreeHGlobal(mcd.paDetails);
return rtn;
}
static bool... | [
0.11090648174285889,
0.18568122386932373,
0.7216787934303284,
-0.2103302925825119,
-0.00505993003025651,
0.07468932867050171,
0.7604093551635742,
-0.9111350774765015,
-0.20821329951286316,
-0.13149866461753845,
-0.3293962776660919,
0.4236011505126953,
-0.144045889377594,
0.383987158536911,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.