text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
= ApplicationName) Then
Components = (Applications.GetCollection("Components", AppObject.Key))
Components.Populate()
For Each CompObject In Components
If (CompObject.Name.ToString() = CompName) Then
CompObject.Value("ConstructorString") = "Some n... | [
-0.12590225040912628,
-0.19418840110301971,
0.7780594229698181,
-0.2090606540441513,
0.05338963866233826,
0.09405197203159332,
0.04292286932468414,
-0.6444423198699951,
-0.039952997118234634,
-0.51079922914505,
-0.2684268653392792,
0.42399588227272034,
-0.40030917525291443,
0.1070855632424... | |
Components.SaveChanges()
End If
Next
End If
Next
```
This is one situation in which VB and C# significantly differ, and knowing these things really helps you choose the right tool for the job. | [
0.2814628779888153,
-0.17010153830051422,
0.183944433927536,
0.13297758996486664,
-0.048945728689432144,
-0.29608771204948425,
0.08394452929496765,
-0.09948690980672836,
-0.23493605852127075,
-0.7542519569396973,
-0.028121693059802055,
0.6920098066329956,
-0.24608777463436127,
0.0170203410... | |
What's the most efficient way to calculate the last day of the prior quarter?
Example: given the date 11/19/2008, I want to return 9/30/2008.
Platform is SQL Server
If @Date has the date in question
```
Select DateAdd(day, -1, dateadd(qq, DateDiff(qq, 0, @Date), 0))
```
EDIT: Thanks to @strEagle below, simpler st... | [
-0.043509479612112045,
-0.02005084976553917,
0.6315131187438965,
0.09691532701253891,
0.11831843107938766,
-0.01440325565636158,
-0.15048953890800476,
-0.0108674056828022,
-0.03456027805805206,
-0.4181559979915619,
0.10815118998289108,
0.3415953814983368,
0.10805043578147888,
0.10579612851... | |
About a half dozen times now, I’ve been doing a regular chore in Visual Studio – either running a unit test or simply compiling, updating something from SVN or whatever, and visual studio just disappears… it shuts down and goes away instantly… it is fine when I restart it, and I don’t see the problem again for a while…... | [
0.5942909121513367,
0.29049432277679443,
0.20333106815814972,
0.09599146991968155,
-0.320170134305954,
-0.2112462818622589,
0.612970769405365,
0.424507737159729,
-0.49859753251075745,
-0.5679450631141663,
-0.04709946736693382,
0.3064374625682831,
-0.1596282422542572,
0.22086849808692932,
... | |
quite often. It isn't AnkhSVN because we don't use it. I believe it is C++ intellisense, but that is just a feeling. Sometimes it happens when we are not doing anything. We will go for coffee, come back and it is just gone.
It never happens to me on smaller projects, but happens frequently on our large (several millio... | [
0.1330869346857071,
0.0009457781561650336,
0.33108800649642944,
0.1182088628411293,
-0.10074206441640854,
-0.5579692125320435,
0.27943161129951477,
0.3787584602832794,
-0.4501148760318756,
-0.3978344798088074,
-0.12365356832742691,
-0.0917736068367958,
-0.10625104606151581,
0.1707584857940... | |
C#, .NET 3.5
I am trying to get all of the properties of an object that have BOTH a getter and a setter for the instance. The code I *thought* should work is
```
PropertyInfo[] infos = source.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetProperty | BindingFlags.GetProperty);
... | [
0.16982890665531158,
0.08014887571334839,
0.4724521040916443,
-0.15318606793880463,
-0.01077395211905241,
-0.12326187640428543,
0.17649702727794647,
-0.4244455099105835,
-0.08860092610120773,
-0.5434361696243286,
-0.017000088468194008,
0.5928367972373962,
-0.7205311059951782,
0.11301365494... | |
}
public void ReflectionCopyTo(TType target)
{
PropertyInfo[] infos = this.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetProperty | BindingFlags.GetProperty);
foreach (PropertyInfo info in infos)
info.SetValue(target, info.GetValue(this, null)... | [
0.3285883963108063,
0.05308336019515991,
0.26257604360580444,
0.053782250732183456,
0.2768777012825012,
0.03724720701575279,
0.2622683048248291,
-0.4413927495479584,
0.18169540166854858,
-0.5136229395866394,
-0.0613204687833786,
0.6870351433753967,
-0.21249835193157196,
0.220744788646698,
... | |
*not* work, as well as what I should be doing to not get the error.
Call [`GetGetMethod`](http://msdn.microsoft.com/en-us/library/system.reflection.propertyinfo.getgetmethod.aspx) and [`GetSetMethod`](http://msdn.microsoft.com/en-us/library/system.reflection.propertyinfo.getsetmethod.aspx) on the property - if both res... | [
0.32894864678382874,
-0.10173238813877106,
-0.012308929115533829,
0.13045494258403778,
-0.09068716317415237,
-0.11045240610837936,
0.46064668893814087,
-0.31248971819877625,
-0.26020172238349915,
-0.5391457080841064,
-0.27476760745048523,
0.6911289691925049,
-0.23762810230255127,
-0.004491... | |
I need to display a string which has a white space on a asp.net page.
\*\*\*\*Here is what I am doing:\*\*\*\*
```
cell = New TableCell
cell.Text = value (lets assume value is <" test with whitespace ">
row.Cells.Add(cell)
```
**and it gets rendered as**
```
<tr>
<td>" test with whitespace "</td>
</tr>... | [
0.3778668940067291,
0.11072129756212234,
0.36300405859947205,
-0.1321662813425064,
-0.14811275899410248,
0.030774947255849838,
0.38291865587234497,
-0.3905554711818695,
-0.029580458998680115,
-0.9256120920181274,
-0.0389854721724987,
0.1757413148880005,
-0.4264605939388275,
0.0208340138196... | |
RegEx) to swap out each space for &NBSP;
<http://en.wikipedia.org/wiki/Non-breaking_space> | [
-0.05877327546477318,
-0.1746668517589569,
0.03487036004662514,
0.08732002228498459,
0.4127167761325836,
0.04493460804224014,
0.20458777248859406,
-0.16249899566173553,
-0.3445068597793579,
-0.33123454451560974,
-0.6183086633682251,
0.19741608202457428,
-0.45354944467544556,
0.161385893821... | |
The monthRegex regular expression always returns true, even if dateInput is something like "December 1, 2008" by my thoughts it should match a regular expression by whichever key I pass into it. But that isn't what happens, it just returns true, and detects "JAN" as the month.
```
function dateFormat(dateInput) {
... | [
-0.014889300800859928,
0.11853333562612534,
0.8653596639633179,
-0.3489692807197571,
-0.20459751784801483,
0.08391635119915009,
0.3593091070652008,
0.1023392602801323,
-0.0635809451341629,
-0.306844562292099,
-0.39809104800224304,
0.27751320600509644,
0.20955997705459595,
0.352230519056320... | |
monthHash['JUL']="07";
monthHash['AUG']="08";
monthHash['SEP']="09";
monthHash['OCT']="10";
monthHash['NOV']="11";
monthHash['DEC']="12";
// Find which month we are dealing with
var whichKey = null;
for(var key in monthHash) {
var monthRegex = new RegExp(key, "i")
mont... | [
-0.10572977364063263,
-0.12981019914150238,
0.7516812682151794,
-0.09937752038240433,
0.15145240724086761,
0.25993838906288147,
0.39351916313171387,
-0.062256213277578354,
-0.2037256360054016,
-0.08830850571393967,
-0.5335737466812134,
0.2997002899646759,
0.14447292685508728,
0.32558077573... | |
whichKey = key;
break;
}
}
}
```
Thank you,
Andrew J. Leer
Remove the "monthRegex.compile();" line and it works.
This is because monthRegex.compile(); complies "" as a regex and therefore everything matches it. | [
-0.08975118398666382,
0.19935302436351776,
0.42827120423316956,
-0.08496998995542526,
0.46265700459480286,
-0.053495462983846664,
0.39570310711860657,
-0.04507030174136162,
-0.25018438696861267,
-0.19732657074928284,
-0.48952922224998474,
0.3874121904373169,
-0.3769484758377075,
0.18616181... | |
I would like to serve a different content from a single URL depending on whether the user is a browser or a RSS reader (hence avoiding an example.com/feed URL). Thus www.example.com/posts will return an (X)HTML page to a browser and an RSS feed to a feed reader.
What the architecturally most appropriate way of accompl... | [
0.7253275513648987,
-0.08383647352457047,
0.41590821743011475,
0.05966290459036827,
-0.2635892629623413,
0.040040891617536545,
0.082559734582901,
0.0961550697684288,
-0.1379207819700241,
-0.6873974800109863,
0.05988239496946335,
0.45256710052490234,
-0.41348206996917725,
0.1440786719322204... | |
re-consider this approach, there's nothing wrong with a separate feed URL. | [
0.7445233464241028,
-0.024942487478256226,
-0.16479450464248657,
0.1145525798201561,
-0.3089762330055237,
-0.42553117871284485,
0.3032093346118927,
0.5309227108955383,
-0.03523401916027069,
-0.2316867709159851,
0.033263999968767166,
0.3949810862541199,
-0.11281714588403702,
0.2181351184844... | |
I like Django, but for a particular application I would like to use only parts of it, but I'm not familiar enough with how Django works on the inside, so maybe someone can point me into the right direction as to what I have to check out.
Specifically, I *want to use*:
* The models and database abstraction
* The [cach... | [
0.3378128707408905,
0.6411774754524231,
-0.008677860721945763,
-0.21965338289737701,
-0.4184616506099701,
-0.4758300185203552,
-0.027468809857964516,
0.3250778913497925,
-0.14456486701965332,
-0.5781151652336121,
0.2806577682495117,
0.5890297889709473,
-0.2127837836742401,
-0.0758037641644... | |
using HTTP nor HTML. So basically, I have a different input / output chain than usual.
Can this work?
My personal killer feature in Django is the Object / database mapping that I can do with the models, so if there's another technology (doesn't have to be Python, I'm in the design phase and I'm pretty agnostic about ... | [
0.39386990666389465,
0.36979490518569946,
0.09249453246593475,
0.04497629776597023,
-0.41252443194389343,
-0.3438833951950073,
0.024532726034522057,
0.10401605814695358,
-0.09198517352342606,
-0.6978803277015686,
0.4007450044155121,
0.631827712059021,
-0.31964248418807983,
0.03076012805104... | |
= 'localhost'
DATABASE_NAME = 'ORCL'
DATABASE_USER = 'scott'
DATABASE_PASSWORD = 'tiger'
```
Then in your regular Python code, do
```
import os
os.environ["DJANGO_SETTINGS_MODULE"] = "djangosettings"
```
before you import any Django modules. This will let you use Django's object/db mappings without actual... | [
0.12449504435062408,
0.2393418550491333,
-0.0890156552195549,
-0.3111281096935272,
-0.18411989510059357,
-0.38496577739715576,
0.24064227938652039,
0.16290152072906494,
-0.05971530079841614,
-0.6328193545341492,
-0.2697732448577881,
0.5928571224212646,
-0.44709551334381104,
-0.071510702371... | |
maps URLs to functions based on the function names. There's an example right at the top of the CherryPy home page: <http://cherrypy.org/>
CherryPy has its own caching system, so you can accomplish exactly the same thing as what Django does but without needing to use Django's urlconfig system. | [
0.2516164183616638,
-0.2508646845817566,
-0.10376258194446564,
0.1473219096660614,
-0.24646051228046417,
-0.1635737419128418,
-0.18886737525463104,
0.44971251487731934,
-0.3365315794944763,
-0.3266870677471161,
0.12059728801250458,
0.07691054046154022,
-0.11578751355409622,
0.0452433452010... | |
I am trying to run my Django sites with mod\_wsgi instead of mod\_python (RHEL 5). I tried this with all my sites, but get the same problem. I configured it the standard way everyone recommends, but requests to the site simply time out.
Apache conf:
```
<VirtualHost 74.54.144.34>
DocumentRoot /wwwclients/thymeand... | [
0.11331262439489365,
0.4095446765422821,
0.44463834166526794,
-0.45633774995803833,
-0.1677430272102356,
-0.1811363250017166,
0.6604704260826111,
-0.2359054982662201,
-0.08877567946910858,
-0.6181150674819946,
0.12075155973434448,
0.5368862748146057,
-0.3693678379058838,
0.2690776884555816... | |
thymeandagain user=admin group=admin processes=1 threads=16
WSGIProcessGroup thymeandagain
</VirtualHost>
```
wsgi\_handler.py:
```
import sys
import os
sys.path.append("/wwwclients")
os.environ['DJANGO_SETTINGS_MODULE'] = 'thymeandagain.settings'
import django.core.handlers.wsgi
application = django.core.han... | [
-0.08886238932609558,
0.14246343076229095,
0.5939897298812866,
-0.2508535087108612,
0.025108445435762405,
-0.12741868197917938,
0.7953755259513855,
-0.5327365398406982,
0.03706735000014305,
-0.8424592614173889,
0.042033202946186066,
0.6866243481636047,
-0.3485170602798462,
0.33941513299942... | |
for read(2)able fds
[INFO@1227227903.249712] mcm_get_line():1592
[Thu Nov 20 21:18:17 2008] [notice] caught SIGTERM, shutting down
[Thu Nov 20 21:18:18 2008] [notice] Digest: generating secret for digest authentication ...
[Thu Nov 20 21:18:18 2008] [notice] Digest: done
[Thu Nov 20 21:18:18 2008] [notice] mod_python: ... | [
-0.13565610349178314,
0.23098193109035492,
0.33182984590530396,
0.08547932654619217,
-0.2704674005508423,
-0.42326122522354126,
0.997644305229187,
-0.3205816149711609,
-0.23940922319889069,
-0.5213613510131836,
-0.3852165639400482,
0.9120993614196777,
-0.5651348829269409,
0.010263310745358... | |
[modwsgi.org](http://modwsgi.org) wiki for "mod\_python", I believe there was someone talking about this somewhere in comments | [
0.6996492743492126,
-0.049012988805770874,
0.02381497249007225,
-0.18966105580329895,
-0.150450199842453,
-0.286253422498703,
0.5083599090576172,
0.2880781292915344,
-0.7117084860801697,
-0.26204684376716614,
0.07624276727437973,
0.5292350053787231,
-0.20585517585277557,
-0.103966906666755... | |
I have the following string in the smarty (php templating system) variable $test:
```
<img height="113" width="150" alt="Sunset" src="/test.jpg"/>
```
I want to add "em" to the height and width like this:
```
{$test|replace:'" w':'em" w'|replace:'" a':'em" a'}
```
But this doesn't work... What's the problem and t... | [
0.26502788066864014,
0.11493916064500809,
0.4708744287490845,
0.003239716636016965,
0.16119682788848877,
0.0917794331908226,
0.21594443917274475,
-0.25757384300231934,
0.06825605779886246,
-0.6436885595321655,
0.19689175486564636,
0.5202676653862,
-0.31424909830093384,
0.029141154140233994... | |
matcher and just look for height/width.
otherwise i'd do the replace in PHP if you can. | [
0.5559588074684143,
-0.08578228950500488,
0.39987272024154663,
0.13004812598228455,
-0.3554072380065918,
0.004276503808796406,
-0.11002403497695923,
-0.09956268966197968,
-0.0601249560713768,
-0.6251091957092285,
0.4643603265285492,
0.5660303831100464,
-0.05255071818828583,
0.0386935472488... | |
I need to use C++ to read in text with spaces, followed by a numeric value.
For example, data that looks like:
```
text1
1.0
text two
2.1
text2 again
3.1
```
can't be read in with 2 `"infile >>"` statements. I'm not having any luck with `getline`
either. I ultimately want to populate a `struct` with these 2 data ... | [
0.1384822279214859,
0.1387607902288437,
0.33061864972114563,
0.008324963040649891,
-0.21444755792617798,
-0.128373920917511,
0.1067175343632698,
-0.028597606346011162,
0.027785595506429672,
-0.7634873390197754,
-0.10100217908620834,
0.6507992744445801,
-0.28910768032073975,
-0.218237936496... | |
pair per line, and minimal error recovery) it wouldn't be too bad to getline() the whole thing into a string and then scan it by hand. Otherwise, you're probably better off using a regular expression or parsing library to handle this, rather than reinventing the wheel. | [
0.3193250000476837,
-0.3272656500339508,
0.11739024519920349,
0.3174940049648285,
-0.13557671010494232,
0.2424866259098053,
0.2534564733505249,
-0.18166792392730713,
-0.0537005290389061,
-0.7008028626441956,
-0.09266049414873123,
0.18290874361991882,
-0.34363603591918945,
-0.18121945858001... | |
I need a way of calling a web page from inside my .net appliction.
But i just want to send a request to the page and not worry about the response.
As there are times when the response can take a while so i dont want it to hang the appliction.
I have been trying in side the page\_load event
```
WebClient webC = n... | [
0.2379293590784073,
-0.04933181405067444,
0.8900170922279358,
-0.1899566650390625,
-0.2483992576599121,
-0.010571841150522232,
0.2880215048789978,
-0.2726603150367737,
-0.2510356307029724,
-0.7885003685951233,
-0.11654303967952728,
0.45285263657569885,
-0.06610763818025589,
0.3782020807266... | |
the request in a sepreate thread the page still wouldn't render until all the thread had finished running.
The best way I found was adjusting Doak's method, and just sticking a timeout in there and swallowing the error.
I know its a hack but it does work :P
```
WebRequest wr = WebRequest.Create("http://localhost:49... | [
0.31902167201042175,
-0.18046428263187408,
0.5562785267829895,
-0.09078100323677063,
-0.17042331397533417,
-0.00033613364212214947,
0.8383369445800781,
-0.33510276675224304,
0.1288372427225113,
-0.6088662147521973,
-0.12792937457561493,
0.5272550582885742,
-0.3164874017238617,
0.1169167906... | |
My rails model has code that is attempting to `define_method(method_name)` inside the model.
I keep getting:
```
NoMethodError: undefined method `define_method'
```
What am I doing wrong? Am I doing this in the wrong place. I need this method attached to this model. Where else can I define this method?
EDIT:
For t... | [
-0.019405560567975044,
-0.10924450308084488,
0.2965344190597534,
0.11047490686178207,
-0.08512464910745621,
-0.2674594521522522,
0.3504869043827057,
-0.0952405035495758,
-0.03466511145234108,
-0.4848034083843231,
0.23544292151927948,
0.44840437173843384,
-0.20436453819274902,
0.18523003160... | |
class with a bunch of pre-existing methods,
So, the question is "can I define\_method in a class"?
### Part 1: Yes you can.
The important distinction is than you can define method *in a class* not *in an instance* method
For example:
```
class Cow
define_method "speak" do
"MOOOO"
end
end
Cow.new.speak
=> ... | [
0.20491281151771545,
-0.2504080832004547,
-0.26183778047561646,
0.030358461663126945,
-0.094697006046772,
-0.2979918122291565,
0.32730644941329956,
-0.025252820923924446,
0.03948027268052101,
-0.6588477492332458,
-0.07032979279756546,
0.7496579885482788,
-0.21475523710250854,
0.09982991963... | |
so you have to grab the class, and use that to define the method. Like this:
```
class Cow
def add_speak
self.class.send(:define_method, :speak) do
"MOOOO added"
end
end
end
Cow.new.speak
NoMethodError: undefined method 'speak' for #<Cow:0xb7c48530>
Cow.new.add_speak
Cow.new.speak
=> "MOOOO added"
... | [
0.0050649396143853664,
-0.06582123786211014,
0.05084493011236191,
-0.11060404777526855,
0.035642076283693314,
-0.09584839642047882,
0.11152775585651398,
-0.21740929782390594,
0.14342767000198364,
-0.5160474181175232,
0.010338491760194302,
0.7625696063041687,
-0.1666274219751358,
0.16633141... | |
the method directly to the class, so all other Cows which already exist will automatically also get the speak method added.
### Part 3: What do you do if you want to define a method for only 1 object, not all objects of that class?
Example:
```
class Cow
def add_speak_just_me
class << self
define_method ... | [
0.45483216643333435,
0.07888056337833405,
0.22378768026828766,
-0.1875135451555252,
-0.17269298434257507,
0.2131952941417694,
0.2816843092441559,
-0.20417740941047668,
0.05223136022686958,
-0.31693172454833984,
0.1351161003112793,
0.7696582078933716,
-0.14248818159103394,
0.082659468054771... | |
works, hooray
Cow.new.speak # this new cow doesn't have the method, it hasn't been automatically added
NoMethodError: undefined method `speak' for #<Cow:0xb7c65b1c>
```
How does this work? Down the rabbithole you go!
Read this: <http://dannytatom.me/metaid/> and good luck. It helps when you realise that 'adding a m... | [
0.6304324269294739,
0.08825565129518509,
0.21648015081882477,
0.0022217766381800175,
0.1976134032011032,
0.03096638433635235,
0.8195316195487976,
-0.17382171750068665,
-0.20915988087654114,
-0.6394222974777222,
0.3447507321834564,
0.8067156672477722,
0.13707853853702545,
0.0827735513448715... | |
I'm being asked to look into a problem that occurs intermittently on a WebServer running my team's application.
Essentially, we have a webservice that does a lookup between codes. If you have Code Type A, you can use it to look up the corresponding Code Type B. Periodically, when memory is running low, when this webse... | [
0.33577340841293335,
0.18138174712657928,
-0.12659355998039246,
0.20982573926448822,
0.11886060237884521,
-0.040135011076927185,
0.08225971460342407,
-0.07249919325113297,
-0.27821293473243713,
-0.6169496774673462,
-0.08471725136041641,
0.28263089060783386,
-0.2181437611579895,
0.299187690... | |
to default. I'm guessing that somewhere in the code, it isn't being verified that the cache object is still there and when memory on the server gets low, that object is dumped causing the error. I'd like to be able to recreate the error and verify before I start digging into this code.
Is there a way in IIS manager (o... | [
0.3064786493778229,
-0.0017402032390236855,
-0.012989683076739311,
0.11998450756072998,
0.5171023011207581,
-0.1774083375930786,
0.5409156680107117,
0.1895783394575119,
-0.22053149342536926,
-0.55473393201828,
0.03362567722797394,
0.8628461956977844,
-0.10838010162115097,
0.154192760586738... | |
section of code.
Thanks,
Steve Brouillard
There's nothing magical or about a rails model, it's just a normal class with a bunch of pre-existing methods,
So, the question is "can I define\_method in a class"?
### Part 1: Yes you can.
The important distinction is than you can define method *in a class* not *in an in... | [
0.4825545847415924,
-0.19208543002605438,
-0.43311619758605957,
0.326663076877594,
0.0053181117400527,
-0.25217387080192566,
0.5587109327316284,
-0.06537648290395737,
-0.07009030133485794,
-0.6288584470748901,
0.04840855300426483,
0.6410008072853088,
-0.12544600665569305,
-0.23812340199947... | |
define a method from within an instance method?
You can't define methods from an instance method, so you have to grab the class, and use that to define the method. Like this:
```
class Cow
def add_speak
self.class.send(:define_method, :speak) do
"MOOOO added"
end
end
end
Cow.new.speak
NoMethodError... | [
0.15899914503097534,
-0.07440508902072906,
-0.26635026931762695,
-0.20606718957424164,
-0.12101960927248001,
-0.1130453422665596,
0.3625521659851074,
-0.29512840509414673,
0.24102970957756042,
-0.4769302308559418,
0.06489673256874084,
0.7521703839302063,
-0.2941030263900757,
0.254749238491... | |
we are in the instance, so we can't directly access it.
As above though, we're adding the method directly to the class, so all other Cows which already exist will automatically also get the speak method added.
### Part 3: What do you do if you want to define a method for only 1 object, not all objects of that class?
... | [
0.5055599212646484,
0.17591840028762817,
0.02079896442592144,
-0.11001364886760712,
-0.175680473446846,
0.14587907493114471,
0.31934061646461487,
0.00859852321445942,
0.06597255170345306,
-0.47061190009117126,
0.20462214946746826,
0.6204563975334167,
-0.15726718306541443,
0.177284911274909... | |
end
end
Cow.new.speak
NoMethodError: undefined method 'speak' for #<Cow:0xb7c72b78>
c = Cow.new
c.add_speak_just_me
c.speak
=> "MOOOO added for just me" # it works, hooray
Cow.new.speak # this new cow doesn't have the method, it hasn't been automatically added
NoMethodError: undefined method `speak' for #<Cow:0xb7c6... | [
0.5200952887535095,
0.06362081319093704,
0.2723398506641388,
-0.06401461362838745,
-0.017240742221474648,
0.2553495764732361,
0.6826050281524658,
-0.26375553011894226,
-0.14179685711860657,
-0.5286774039268494,
0.2837667763233185,
0.8851150274276733,
-0.057315465062856674,
0.08665216714143... | |
Anyone getting this error when using the new free chart controls MS bought from Dundas?
"Error executing child request for ChartImg.axd"
On the MSDN forum they suggested it was my web.config:
[MSDN forum post](http://social.msdn.microsoft.com/Forums/en-US/MSWinWebChart/thread/1dc4b352-c9a5-49dc-8f35-9b176509faa1/)
... | [
0.17192009091377258,
0.0204904954880476,
0.35206693410873413,
0.21404516696929932,
0.04692481830716133,
0.08228784799575806,
0.34123361110687256,
0.13377702236175537,
-0.48649007081985474,
-0.6695080399513245,
0.2915741205215454,
0.3370392322540283,
-0.22391292452812195,
0.1645217835903167... | |
topic by adding the POST verb:
```xml
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
```
I've written a more thorough explanation of why... | [
-0.19024401903152466,
-0.029226815328001976,
0.4788743257522583,
0.11756045371294022,
-0.4474750757217407,
-0.09023357927799225,
0.2690824866294861,
0.22040195763111115,
-0.33345529437065125,
-0.502784788608551,
-0.538681149482727,
0.248093381524086,
-0.30528128147125244,
0.117674678564071... | |
I have a simple 2D array of strings and I would like to stuff it into an SPFieldMultiLineText in MOSS. This maps to an ntext database field.
I know I can serialize to XML and store to the file system, but I would like to serialize without touching the filesystem.
```
public override void ItemAdding(SPItemEventPropert... | [
0.44576311111450195,
0.11566795408725739,
0.5064237713813782,
-0.053426168859004974,
-0.04015156999230385,
0.203340083360672,
0.2746763229370117,
-0.2067308872938156,
-0.19140498340129852,
-0.6427537202835083,
0.2522605061531067,
0.40827977657318115,
-0.29770898818969727,
0.179602041840553... | |
list item
properties.AfterProperties["myNoteField"] = matrix; // throws an error
}
```
Looks like I should be able to do something like this:
```
XmlSerializer s = new XmlSerializer(typeof(List<List<string>>));
properties.AfterProperties["myNoteField"] = s.Serialize.ToString();
```
but that doesn't work. All t... | [
-0.03426890820264816,
0.18629036843776703,
0.7611825466156006,
-0.17493936419487,
-0.19330817461013794,
0.06957603245973587,
0.40390175580978394,
-0.5996314287185669,
-0.23135730624198914,
-0.7615041136741638,
-0.3251758813858032,
0.6245474219322205,
-0.36312708258628845,
0.016895296052098... | |
Web parts seem to be used extensively in Sharepoint related development, but examples of using them in asp.net webforms applications are few and far between. I'm implementing a domain specific portal framework and like the "widgetlike" functionality in iGoogle or pageflakes and would like to get that kind of feature in... | [
0.4677216708660126,
-0.3045468032360077,
0.34795138239860535,
0.301486074924469,
-0.23654705286026,
-0.11751114577054977,
-0.11892188340425491,
0.20529919862747192,
-0.1916419267654419,
-0.6514008641242981,
-0.010476046241819859,
0.3660482168197632,
-0.0840953141450882,
0.01387376897037029... | |
would have moved these features into the main product by now.
Are web parts a dead-end technology? If so, are there any alternatives?
i think they are (dead), at least for developing the types of UI modern web-browsers are looking for. My recommendation ... ASP.NET MVC and a nice .js library. It's more work out of th... | [
0.42398521304130554,
-0.06266748905181885,
0.28179821372032166,
0.21682208776474,
0.047120314091444016,
-0.0618436336517334,
0.15059229731559753,
0.19487597048282623,
-0.22571860253810883,
-0.6088330745697021,
-0.03357165306806564,
0.4912160336971283,
0.028245896100997925,
0.04459095001220... | |
I have two classes that are associated with a one-to-one mapping:
```
<class name="Employee" table="Employees">
...
<one-to-one name="Address" class="AddressInfo">
...
</class>
```
I would like to use a criteria expression to get only Employees where the the associated Address class is not null, something like... | [
0.12902092933654785,
-0.03916919603943825,
0.12470097094774246,
0.049058135598897934,
0.026374496519565582,
-0.07828966528177261,
0.0756167322397232,
-0.193190336227417,
-0.10805469006299973,
-0.9516391158103943,
0.09816881269216537,
0.4333269000053406,
-0.22143538296222687,
0.214386731386... | |
like:
```
IList employeesWithAddresses = sess.CreateCriteria(typeof(Employee))
.CreateCriteria("Address", "address").Add( Expression.IsNotNull("Id") )
.List();
``` | [
0.3643411099910736,
0.19842121005058289,
0.20971524715423584,
-0.25914135575294495,
0.1956901103258133,
0.01955481618642807,
0.19603602588176727,
-0.22179476916790009,
-0.04245661944150925,
-0.7124807834625244,
-0.2887018322944641,
0.38077449798583984,
-0.45991048216819763,
0.1412010639905... | |
Is there an equivalent to Apache's VirtualHost for IIS? We want to be able to run multiple websites from one IP and address them with different DNS names.
i.e. I have
```
www.dom1.com
www.dom2.com
www.dom3.com
```
that all point to `123.123.10.1`. Apache would just be running on port 80 and just use virtualhost to... | [
0.2948925197124481,
-0.07742884010076523,
0.3937678933143616,
0.00044555842760019004,
-0.297206312417984,
-0.3447631299495697,
0.19883596897125244,
-0.12871606647968292,
-0.294093519449234,
-0.7620776891708374,
0.07511332631111145,
0.5925229787826538,
-0.18181172013282776,
0.37205153703689... | |
VS.net creates a template when you create a WCF project.
It adds a class to the iService1.cs file:
```
// Use a data contract as illustrated in the sample below to
// add composite types to service operations.
[DataContract]
public class CompositeType
{
bool boolValue = true;
string stringValue = "Hello ";
... | [
0.49691179394721985,
-0.44222521781921387,
0.357715368270874,
-0.07163805514574051,
-0.16289831697940826,
0.14388830959796906,
0.22247469425201416,
-0.47381970286369324,
-0.1292039304971695,
-0.6269054412841797,
0.06378496438264847,
0.3260185122489929,
-0.42273733019828796,
0.1356917023658... | |
public string StringValue
{
get { return stringValue; }
set { stringValue = value; }
}
}
```
Since a WCF service can return any user defined class, why use a DataContract and CompositeType class?
I can return something like:
```
[OperationContract]
MyUserCollection GetUsers();
```
What am... | [
0.16544027626514435,
-0.03195519000291824,
0.3095296323299408,
-0.1671852171421051,
-0.10405723005533218,
-0.1153213381767273,
0.4045802056789398,
-0.0640043318271637,
-0.013981710188090801,
-0.4820535480976105,
-0.12187565863132477,
0.6133023500442505,
-0.3497546315193176,
0.4882913231849... | |
the innards of your service/system, which is a violation of the SOA tenet of explicit boundaries. By using a DataContract, you are publishing the structure of your return types in a loosely-coupled way. | [
0.2776584327220917,
0.25176408886909485,
0.09044153988361359,
0.08169582486152649,
-0.02650081180036068,
-0.0821179673075676,
0.05294922739267349,
-0.20672579109668732,
0.027603156864643097,
-0.4113655686378479,
-0.3249768614768982,
0.42078325152397156,
-0.25391608476638794,
0.039486262947... | |
I am working on a Perl script to read CSV file and do some calculations.
CSV file has only two columns, something like below.
```
One Two
1.00 44.000
3.00 55.000
```
Now this CSV file is very big ,can be from 10 MB to 2GB.
Currently I am taking CSV file of size 700 MB. I tried to open this file in notepad, excel bu... | [
0.392189085483551,
0.3294833302497864,
0.2084447145462036,
-0.17039524018764496,
-0.2730083465576172,
0.18377061188220978,
0.11933791637420654,
0.13092437386512756,
-0.35892435908317566,
-0.8398392200469971,
0.2320036143064499,
0.3469023108482361,
-0.13171985745429993,
0.23294442892074585,... | |
Perl script then I need to process complete file to go to end of file and then read last 1000 lines.
Is there any better way to that? I am new to Perl and any suggestions will be appreciated.
I have searched net and there are some scripts available like [`File::Tail`](https://metacpan.org/pod/File::Tail) but I don't... | [
0.23386645317077637,
-0.1817990243434906,
0.5965718030929565,
0.15932738780975342,
-0.4076666831970215,
0.11367323249578476,
0.25540488958358765,
-0.01251259632408619,
-0.1202782392501831,
-0.5177488327026367,
0.09163153171539307,
0.4502590596675873,
-0.339529424905777,
-0.1676386743783950... | |
Is it possible to somehow change the look/feel of NetBeans? I know it uses Swing and that usually apps using Swing for its UI can usually have their UI scheme changed.
The default appearence for OSX is vomitastic and would even settle for just some sort of barebones `default` look. The whole look is just too distracti... | [
0.3801177442073822,
-0.1713690310716629,
0.42023780941963196,
-0.06266386806964874,
0.012162845581769943,
-0.02041652426123619,
0.09581691026687622,
-0.11179380863904953,
-0.18338149785995483,
-0.4500294625759125,
0.021112579852342606,
0.6733121275901794,
-0.36811238527297974,
-0.177221179... | |
A co-worker asked me how the word "Nuke" relates to CMS? To be honest I never thought about it, and there wasn't any information on the web that I could find.
Francisco Burzi wrote that his Perl script that he used to manage content was called NUKE. His knowledge of that system fueled his adaptation of thatware to php... | [
0.23365826904773712,
0.10546750575304031,
-0.052845582365989685,
0.03652490675449371,
-0.4924962818622589,
-0.4304458200931549,
-0.09519149363040924,
0.48610132932662964,
-0.15866580605506897,
-0.3499285876750946,
0.16267861425876617,
0.34902504086494446,
-0.4444756805896759,
0.37017053365... | |
named as such, but google to the rescue!
<http://74.125.95.132/search?q=cache:atpksHABV2AJ:www.uiarch.org/CMpro-v-p-36.htm+origins+of+name+NUKE+cms&hl=en&ct=clnk&cd=10&gl=us>
in short, "The name was taken from Francisco's user name of Nuke from the days when he was a cracker" | [
0.3908517062664032,
0.29550090432167053,
0.144441157579422,
0.3349335789680481,
-0.012622438371181488,
-0.14259353280067444,
0.22940663993358612,
0.12331309914588928,
-0.12420953065156937,
0.1106826439499855,
-0.2515740394592285,
0.20299671590328217,
-0.20234084129333496,
0.124357350170612... | |
I have an object in SQL (A) that has a many to many relationships with another object (B). I'm currently building an API layer DLL that will allow the user to assign objects of type B into type A. Right now the user would retrieve a list of entries of type A and a list of entries of type B using different LINQ data con... | [
0.43299442529678345,
0.23931145668029785,
0.3614107668399811,
0.021593229845166206,
-0.1600446105003357,
-0.23676902055740356,
-0.03459243103861809,
-0.21704329550266266,
-0.14928624033927917,
-0.5045188069343567,
0.2468031942844391,
0.1653093844652176,
-0.31254321336746216,
0.438491255044... | |
there a way to tell data context A that these objects already exist and don't need to be created? The code I'd like to write looks something like this (I'll call A service and B output):
```
List<Service> svcs = Service.GetServices();
List<Output> outs = Output.GetOutputs();
svcs[0].OutputCollection.Add(outs);
svcs[0... | [
0.05313811078667641,
0.052623726427555084,
0.398762047290802,
-0.165733203291893,
-0.08841712772846222,
0.07881034165620804,
0.17434291541576385,
-0.17847545444965363,
-0.30651935935020447,
-0.7339068651199341,
-0.003625523531809449,
0.4594722390174866,
-0.34505054354667664,
0.284803003072... | |
insight or suggestions would be helpful.
I actually found a different sort of solution and now i feel kind of stupid for even asking the question. What I did inside the Service.Outputs.Add() method was really the problem:
```
public void Add(Output output)
{
OutputCollectionItem oci = new OutputCollectionItem();
... | [
-0.04178685322403908,
0.07887885719537735,
0.4270476698875427,
-0.28843745589256287,
-0.09509356319904327,
0.332224577665329,
0.17578524351119995,
-0.19404074549674988,
-0.05737488344311714,
-0.4554024636745453,
-0.002767808036878705,
0.6895508766174316,
-0.4447445869445801,
0.134114757180... | |
Good afternoon,
I have a web query in `Excel 2002` going against a web page that returns a date column. The dates are returned as `DD/MM/YYYY`, as I would like to show them in my spreadsheet. My machine running Excel has its regional settings set to en-GB, and the only language set under Internet Options is UK English... | [
0.16670648753643036,
0.45513272285461426,
0.857688844203949,
0.0754641517996788,
-0.25009027123451233,
-0.1269175410270691,
0.14860445261001587,
0.385174959897995,
-0.08877445012331009,
-0.4074171185493469,
-0.11986353993415833,
0.35338094830513,
0.08660873025655746,
0.2499302625656128,
... | |
to recognise dates/times. I've had similar problems working with GB to US dates and found that coding your dates into this format saves you a lot of trouble.
```
Universal Date format is : "yyyy-mm-dd hh:mm:ss"
``` | [
0.6167205572128296,
0.2986338436603546,
0.7260087132453918,
-0.0269960705190897,
-0.107329823076725,
-0.02654911018908024,
0.003623268799856305,
0.08323878794908524,
-0.5054800510406494,
-0.6117081642150879,
-0.25153282284736633,
-0.04732799530029297,
-0.09625416249036789,
0.43788576126098... | |
1. Why is operator '&' defined for bool?, and operator '&&' is not?
2. How exactly does this 1) bool? & bool? and 2) bool? and bool work?
Any other "interesting" operator semantics on Nullable? Any overloaded operators for generic T?
Operators on `Nullable<T>` are "lifted" operators. What this means is: if T has the o... | [
-0.19703099131584167,
-0.19019702076911926,
0.34774020314216614,
-0.011553131975233555,
-0.044968683272600174,
-0.09580200910568237,
0.17853716015815735,
-0.3161635398864746,
-0.25862815976142883,
-0.163210928440094,
-0.642363429069519,
0.5702073574066162,
-0.42823100090026855,
-0.30281272... | |
^ << >> == != > < >= <= Only the operators listed above can be
> overloaded. In particular, it is not
> possible to overload member access,
> method invocation, or the =, &&, ||,
> ??, ?:, checked, unchecked, new,
> typeof, as, and is operators.
Likewise, from the ECMA spec, 14.2.7 Lifted operators, the lifted op... | [
-0.475029319524765,
-0.010644256137311459,
0.536072850227356,
0.013768244534730911,
0.05295819416642189,
0.19695772230625153,
0.12787453830242157,
-0.6629654169082642,
-0.42977985739707947,
-0.40484389662742615,
-0.5312349200248718,
0.2412514090538025,
-0.5232815742492676,
-0.0523456446826... | |
the relational operators < > <= >=
So basically, the short-circuiting operators aren't defined as lifted operators.
[edit: added crib sheet]
* Lifted operator: a compiler provided operator on `Nullable<T>`, based on the operators of T - for example: the `int` "+" operator gets "lifted" onto `int?`, defined as:
(int... | [
-0.06981398910284042,
0.09581857174634933,
0.20415572822093964,
0.023450735956430435,
-0.23610244691371918,
0.1186005249619484,
0.04227612540125847,
-0.3360685110092163,
-0.40715187788009644,
0.0991053655743599,
-0.4349256753921509,
0.35329875349998474,
-0.41609251499176025,
0.043015800416... | |
the second operand *might not be evaluated* - i.e.
(expression1, expression2) => expression1() ? expression2() : false;
Or perhaps a simpler example:
```
bool someFlag = Method1() && Method2();
```
if `Method1()` returns false, then `Method2()` isn't executed (since the compiler already knows that the overall answ... | [
-0.12058939039707184,
-0.2524752616882324,
-0.06642348319292068,
-0.24128897488117218,
-0.008867134340107441,
-0.146674245595932,
0.597210705280304,
-0.2842685580253601,
0.18939423561096191,
-0.3225170969963074,
-0.3707309365272522,
0.48374027013778687,
-0.33255454897880554,
-0.07798322290... | |
I am getting an 'access is denied' error when I attempt to delete a folder that is not empty. I used the following command in my attempt: `os.remove("/folder_name")`.
What is the most effective way of removing/deleting a folder/directory that is not empty?
```
import shutil
shutil.rmtree('/folder_name')
```
[Stand... | [
0.0418916679918766,
0.36298248171806335,
0.3609788715839386,
-0.2544872760772705,
0.1500842273235321,
-0.18173453211784363,
0.523733913898468,
-0.219058096408844,
-0.16078203916549683,
-0.6013420224189758,
-0.5153771042823792,
0.5541611313819885,
-0.4138827323913574,
0.5059790015220642,
... | |
I'm trying to use a `break` statement in a `for` loop, but since I'm also using strict subs in my Perl code, I'm getting an error saying:
> Bareword "break" not allowed while
> "strict subs" in use at ./final.pl
> line 154.
Is there a workaround for this (besides disabling strict subs)?
My code is formatted as fol... | [
0.0511351153254509,
0.12550395727157593,
0.3231928050518036,
-0.12888488173484802,
0.07762137800455093,
-0.19953913986682892,
0.4792715311050415,
-0.20230507850646973,
-0.34349945187568665,
-0.32158541679382324,
-0.41998469829559326,
0.19396895170211792,
-0.403817355632782,
-0.039223525673... | |
last;
}
}
``` | [
-0.23802803456783295,
0.19863976538181305,
0.5550756454467773,
-0.34624460339546204,
0.24352747201919556,
-0.27297288179397583,
-0.05348799377679825,
0.3015282452106476,
0.17562241852283478,
-0.46840575337409973,
-0.4054259657859802,
0.6704980731010437,
-0.2610824704170227,
0.2426261752843... | |
I was wondering if there was a way to bind an ArrayList (or any kind of List, for that matter) to a PreparedStatement which will eventually be used to access an Oracle database. I found:
[PreparedStatement IN clause alternatives?](https://stackoverflow.com/questions/178479/alternatives-for-java-sql-preparedstatement-i... | [
0.1428270936012268,
0.2057712972164154,
0.05052942782640457,
-0.020773164927959442,
-0.2089533507823944,
0.0006647362024523318,
-0.12339738756418228,
-0.5978203415870667,
-0.21500705182552338,
-0.21195575594902039,
0.045162271708250046,
0.4267100691795349,
-0.41107550263404846,
0.028710832... | |
ITEM WHERE ID IN (?, ?, ?, ?)
```
Even though you'll generate a new statement for each query, I'd still recommend using a `PreparedStatement`. If your list contains `String` instances, you'll get the necessary escaping to protect from SQL injection.
But even if it's a safe type, like `Integer` objects, some drivers... | [
0.0718332827091217,
0.2090470939874649,
0.10364798456430435,
0.18729545176029205,
-0.2376668006181717,
0.02410455234348774,
0.3518518805503845,
-0.43818262219429016,
-0.323120653629303,
-0.4781010150909424,
-0.23637640476226807,
0.4484902024269104,
-0.28208601474761963,
0.31539201736450195... | |
If I have records:
```
Row Date, LocationID, Account
1 Jan 1, 2008 1 1000
2 Jan 2, 2008 1 1000
3 Jan 3, 2008 2 1001
4 Jan 3, 2008 1 1001
5 Jan 3, 2008 3 | [
-0.32643041014671326,
0.3859732151031494,
0.39177873730659485,
0.12405432015657425,
0.17137348651885986,
0.49485960602760315,
0.4417186677455902,
-0.21082407236099243,
-0.4291212260723114,
-0.46250399947166443,
0.3532486855983734,
-0.06450239568948746,
0.12839768826961517,
0.17740736901760... | |
1001
6 Jan 4, 2008 3 1002
```
I need to get the row (`date`, `locatinid`, `account`) where the row has the most recent date for each distinct `locationid`:
```
4 Jan 3, 2008 1 1001
3 Jan 3, 2008 2 1001
6 Jan 4, 2008 3 | [
-0.2834572196006775,
0.42913946509361267,
0.4859277009963989,
-0.1905188262462616,
0.16360704600811005,
0.22749954462051392,
0.11642827838659286,
0.17620182037353516,
0.08991213142871857,
-0.5067169070243835,
-0.3039686977863312,
-0.06063114479184151,
0.15496543049812317,
0.034209236502647... | |
1002
```
I think this would work:
```
SELECT t1.*
FROM table t1
JOIN (SELECT MAX(Date), LocationID
FROM table
GROUP BY Date, LocationID) t2 on t1.Date = t2.Date and t1.LocationID = t2.LocationID
``` | [
0.043391577899456024,
0.1436844766139984,
0.48008427023887634,
-0.3138543367385864,
0.5958647131919861,
0.058730438351631165,
0.05422227084636688,
-0.19480839371681213,
0.08264224231243134,
-0.6632164716720581,
-0.2556469440460205,
0.21188510954380035,
-0.059370800852775574,
-0.07803843170... | |
I have an API call in my application where I am checking the time taken for a single call. I have put this in a FOR loop and using 10000 calls to get the average times of all calls. Now the issue which came up was that the actual application using the API, is multi-threaded. If I wish to make my application also do the... | [
0.32315683364868164,
0.027389952912926674,
0.12562605738639832,
0.1173914298415184,
-0.09559593349695206,
0.12728922069072723,
0.21548502147197723,
-0.09890241920948029,
-0.4064725339412689,
-0.5015056729316711,
0.25555068254470825,
0.5204764008522034,
-0.4695875644683838,
0.34984856843948... | |
implemented in C++ and if so, what library functions to use and can an example be provided for the same?
Probably the best C++ library to use for threading is the thread library in Boost, but like all C++ threading, you will be forced to manually do your synchronization. You will need to use mutex and lock types to mak... | [
0.03997804969549179,
-0.0021052169613540173,
0.08457973599433899,
0.1399315744638443,
-0.13846521079540253,
-0.31422075629234314,
0.05386394262313843,
-0.07931165397167206,
-0.23354169726371765,
-0.442006915807724,
0.14030754566192627,
0.7108825445175171,
-0.6634872555732727,
-0.2356327325... | |
How would you ensure that only one user is logged in per account at a time?
Assuming cookies are persistent.
Typically the best way is to implement a customization on the provider that checks for last login, as well as adding methods to your code to keep track of user action.
The key is that you must know at what poi... | [
0.5862951278686523,
-0.2613053619861603,
0.27218931913375854,
0.12250565737485886,
0.33495858311653137,
-0.20601294934749603,
0.28463858366012573,
-0.05152782425284386,
-0.6043354868888855,
-0.4014173746109009,
0.22791072726249695,
0.34427323937416077,
0.0588158555328846,
-0.06811924278736... | |
account can login. | [
0.16499529778957367,
0.1424589455127716,
0.30973654985427856,
0.17721600830554962,
0.21884684264659882,
-0.23004518449306488,
0.2850586771965027,
0.547512412071228,
-0.3028881251811981,
-0.4469395875930786,
-0.24286435544490814,
0.39156267046928406,
0.040123019367456436,
0.2987579107284546... | |
I'm setting up CruiseControl.NET and during the build I want to modify my version.txt file and have it checked in. When I do this, CruiseControl.NET doesn't know this checkin was done by the build and so the next time it checks sources, it sees there were modifications and rebuilds again (I have IfModificationExists se... | [
0.2974255681037903,
-0.0913563072681427,
0.5547815561294556,
-0.04516279324889183,
0.1507437825202942,
-0.34845492243766785,
0.34546196460723877,
-0.19448895752429962,
-0.31014329195022583,
-0.548507034778595,
0.24593520164489746,
0.6971559524536133,
-0.15154582262039185,
0.100008182227611... | |
<sourceControlProvider type="svn">
...
</sourceControlProvider>
<exclusionFilters>
<pathFilter>
<pattern>**/Version.txt</pattern>
</pathFilter>
</exclusionFilters>
</sourcecontrol>
```
Documentation is available at:
<http://www.cruisecontrolnet.org/projects/ccne... | [
-0.18093425035476685,
-0.5795378088951111,
0.4581632912158966,
0.12338375300168991,
0.10440929979085922,
-0.2680172622203827,
-0.06096694990992546,
-0.20461063086986542,
-0.7306751608848572,
-0.3517342805862427,
-0.16003116965293884,
0.09929174929857254,
-0.05264217033982277,
-0.0538540519... | |
A lot of programs log things into a text file in a format something like this:
11/19/2008 13:29:01 DEBUG Opening connection to localhost.
11/19/2008 13:29:01 DEBUG Sending login message for user 'ADMIN'.
11/19/2008 13:29:03 DEBUG Received login response 'OK' for user 'ADMIN'.
...
However, I prefer something more s... | [
0.14156457781791687,
0.3469047546386719,
0.4534684121608734,
0.09669197350740433,
-0.4614315927028656,
-0.3433341681957245,
0.7143404483795166,
0.060985684394836426,
-0.27887532114982605,
-0.7101805806159973,
-0.21057553589344025,
0.7728965282440186,
0.09015543758869171,
0.2838632464408874... | |
to my logging component looks for my VB6 programs:
```
Trace.Warn "MMain", "Main(command, other data)", "Deprecated command", _
sCommandName, sOtherData
```
resulting in the following log entry:
```
<Info time="11/17/2008 04:49:45 PM" mod="MMain" proc="Main" entry="Deprecated command" command="The_Bad_Command" ... | [
0.1748868227005005,
0.36872535943984985,
0.30691835284233093,
-0.10223358124494553,
-0.08633652329444885,
0.02489415369927883,
0.43192294239997864,
-0.2729663848876953,
-0.33275049924850464,
-0.45616626739501953,
0.07455993443727493,
0.6955003142356873,
-0.23858706653118134,
0.100404761731... | |
your own [appender](http://logging.apache.org/log4net/release/features.html) (output handler). | [
0.5146954655647278,
-0.15697520971298218,
0.17138227820396423,
-0.11121766269207001,
0.013810929842293262,
-0.07223968952894211,
0.2548830509185791,
-0.32755911350250244,
-0.44464266300201416,
-0.3868270218372345,
-0.2962099015712738,
0.3117334246635437,
-0.3865389823913574,
-0.21781691908... | |
I have a text area and a function to do syntax highlighting on it. Right now it reads the entire RichTextBox. How would I get a string variable containing the current line? Below is the code i currently have.
```
Private Sub HighLight()
Dim rm As System.Text.RegularExpressions.MatchCollection
Dim m As System.T... | [
0.011111021041870117,
0.034490205347537994,
0.8483480215072632,
-0.23936760425567627,
-0.09504211694002151,
0.0936121940612793,
0.24363219738006592,
-0.4026389718055725,
-0.16858743131160736,
-0.3225768804550171,
-0.02127145603299141,
0.5026108026504517,
-0.06130589544773102,
0.29875603318... | |
= System.Text.RegularExpressions.Regex.Matches(LCase(rtbMain.Text), LCase(pass))
For Each m In rm
rtbMain.Select(m.Index, m.Length)
rtbMain.SelectionColor = Color.Blue
Next
rtbMain.Select(x, 0)
rtbMain.SelectionColor = Color.Black
Next
End Sub
```
Not tried i... | [
-0.13948623836040497,
-0.3489859998226166,
0.5410423874855042,
-0.2230599820613861,
0.23191992938518524,
0.31359314918518066,
0.3150217831134796,
-0.7618342041969299,
-0.31023842096328735,
-0.3857537508010864,
-0.3152085244655609,
0.17616568505764008,
-0.4163486063480377,
0.245424017310142... | |
In a Java application (JRE 1.5.0\_12) on Windows XP, I call a native method:
```
public native int attachImage( ... );
```
... which lives in a Visual C++ 6.0 .dll. It displays an application-modal window. Problem is, the application's tray icon doesn't respond to mouseclicks while this window has focus. This is an ... | [
-0.08250918239355087,
0.10767236351966858,
0.402882844209671,
-0.3612484335899353,
-0.12234491109848022,
-0.19410477578639984,
0.4200570583343506,
0.009336425922811031,
-0.16835878789424896,
-0.7914335131645203,
-0.26439225673675537,
0.6830958127975464,
-0.5473411083221436,
0.2248993963003... | |
shell like this:
```
Shell shell = new Shell(display,SWT.APPLICATION_MODAL);
```
For swing, this would be:
```
dialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);
``` | [
0.02266240492463112,
0.013289758935570717,
0.5406280159950256,
-0.28241777420043945,
-0.04388844594359398,
-0.014303475618362427,
-0.11008176952600479,
-0.4776686131954193,
-0.1816204935312271,
-0.6008254885673523,
-0.17792463302612305,
0.7690870761871338,
-0.5832621455192566,
-0.010251900... | |
I'm using VS 2008 to create a C++ DLL (not managed) project and I need convert a char\* to a long long type. Is there an easy way to do it?
Thanks in advance :)
Try `_atoi64.` This takes `char*` and returns `__int64`. | [
0.05833103880286217,
-0.07180708646774292,
0.0633007064461708,
-0.15996776521205902,
-0.01933300495147705,
-0.10388652980327606,
0.47849276661872864,
0.03385176137089729,
0.03172148019075394,
-0.4109993875026703,
0.06138508766889572,
0.6208590269088745,
-0.4174826145172119,
0.1315549165010... | |
I'm building a fairly simple PHP script that will need to send some emails with attachments. I've found these 2 libraries to do this.
Does either one have significant advantages over the other? Or should I just pick one at random and be done with it?
I was going to say that PHPMailer is no longer developed, and Swift... | [
0.24501968920230865,
0.004249424207955599,
0.19633209705352783,
-0.012419391423463821,
-0.3775401711463928,
0.07541714608669281,
0.27131161093711853,
0.28680312633514404,
-0.1495566964149475,
-0.9110602736473083,
0.4511743485927582,
0.4013810157775879,
-0.26478129625320435,
0.0672414749860... | |
no trouble.
Now that PHPMailer is developed again, I think I'll probably give the new version a try.
So, my answer is that both are capable, and that it doesn't matter that much – choose one, learn it, use it. Both offer massive advantages over mail() and abstract away the nuances of email so that you can get on wit... | [
0.2829320728778839,
-0.13714386522769928,
0.05032580345869064,
0.18960155546665192,
-0.3725041151046753,
0.02784574031829834,
0.13680699467658997,
0.31306880712509155,
-0.05175580084323883,
-0.6829137802124023,
0.2851054072380066,
0.5259689092636108,
-0.006995715666562319,
-0.3008236885070... | |
How do you access a MySQL relation using RoR?
Toby is right. You need to learn about table relationships using ActiveRecord.
**The gist**. You need to put the following codes in your models. Here is an example.
In User model:
```
has_many :addresses
```
In the Address model:
```
belongs_to :user
```
This is for... | [
0.21379779279232025,
-0.13705269992351532,
0.2035728394985199,
0.25729653239250183,
-0.12925945222377777,
-0.0316695012152195,
0.22401918470859528,
-0.19230929017066956,
-0.20188413560390472,
-0.6373727321624756,
0.3315763473510742,
0.45220109820365906,
-0.1958017498254776,
0.1360288560390... | |
I have a body of text that I have to scan and each line contains at least 2 and sometimes four parts of information. The problem is that each line can be 1 out of 15-20 different actions.
in ruby the current code looks somewhat like this:
```
text.split("\n").each do |line| #around 20 times..
..............
... | [
0.24703457951545715,
0.06847300380468369,
0.38095909357070923,
-0.30843937397003174,
-0.1691422015428543,
0.16406023502349854,
0.6685860753059387,
-0.3578748404979706,
-0.24019943177700043,
-0.5897186994552612,
-0.09719529747962952,
0.4062388241291046,
-0.3591061532497406,
-0.2835592329502... | |
parse thousands of these files FAST!
Right now I match them with regexes -- however this is intolerably slow. I started with ruby and hopped over to C++ in hopes that I'd get a speed boost and it just isn't happening.
I've casually read on PEGs and grammar based parsing but it looks somewhat difficult to implement. I... | [
0.24180088937282562,
0.5144113302230835,
0.0537666380405426,
-0.08277495950460434,
-0.14211271703243256,
0.04262465983629227,
-0.04814259335398674,
-0.182295560836792,
-0.2338070124387741,
-0.630889356136322,
0.5791269540786743,
0.3052787780761719,
-0.2770575284957886,
-0.03204049170017242... | |
action entailed.. etc..
Sample text that needs to be parsed:
```
buriedtens posts $5
The button is in seat #4
*** HOLE CARDS ***
Dealt to Mayhem 31337 [8s Ad]
Sherwin7 folds
OneMiKeee folds
syhg99 calls $5
buriedtens raises to $10
```
After I collect this information each action is turned into an xml node.
Right ... | [
-0.07364293187856674,
-0.2618032991886139,
0.7057008147239685,
-0.13604532182216644,
-0.4002513587474823,
0.37622711062431335,
0.37604963779449463,
-0.6389395594596863,
-0.5529432892799377,
-0.3496875762939453,
0.050748180598020554,
0.4210193157196045,
-0.041597794741392136,
-0.37246447801... | |
and complicated regex in c++ (all the regexen put together)
33 hands/second -- normal regex style in ruby
```
I'm currently testing antlr to see if we can go any further but as of right now I'm very very happy with spirit's results.
Related question: [Efficiently querying one string against multiple regexes.](https:... | [
-0.34495046734809875,
0.06391996890306473,
0.30833712220191956,
0.07803956419229507,
-0.36882299184799194,
-0.10043330490589142,
0.5692468881607056,
-0.3076936602592468,
-0.3677898347377777,
-0.6151396036148071,
-0.20971326529979706,
0.45851361751556396,
-0.22651717066764832,
-0.2275551855... | |
If a method checks it's input and detects illegal input, what should it do: Raise an exception (or use another error-mechanism) or do nothing/ignoring on the wrong input?
In Java the HashTable-class throws an NullPointerException if given null-references as parameter. This is sometimes annoying, but I think it may hav... | [
0.08265141397714615,
0.019754691049456596,
-0.2370881587266922,
0.022335020825266838,
-0.3020857572555542,
-0.34343084692955017,
0.30181190371513367,
-0.03914093226194382,
-0.37759318947792053,
-0.3586564064025879,
0.12302221357822418,
0.20450688898563385,
-0.5723010897636414,
-0.035801105... | |
on this question?
Definitely throw an exception. Exceptions are annoying on purpose to force you to *do something* about them.
Think of it this way, if your program does nothing on bad input, how are you supposed to let the user know that nothing happened and why? Also, how long will it take you to debug a program tha... | [
0.5324543118476868,
0.07463707029819489,
0.013480301015079021,
0.3040059506893158,
-0.11153152585029602,
-0.3613586723804474,
0.515412449836731,
0.220403254032135,
-0.341617226600647,
-0.4364853799343109,
0.03217827156186104,
0.36019366979599,
-0.21044094860553741,
0.14585241675376892,
0... | |
I'm wondering if there is any way to create a User Account on a Windows XP machine that can be done through scripting from an ActiveX control on a webpage. Specifically, I'd like to know if there's any way to deploy an ActiveX control with computers (that I preconfigure and ship) that will allow use of my webpage from ... | [
0.3601979911327362,
0.2536378800868988,
0.11982180923223495,
0.2525008022785187,
0.24953974783420563,
-0.16733883321285248,
0.12951111793518066,
0.2957870364189148,
-0.21633414924144745,
-0.5490690469741821,
0.030939390882849693,
0.6331757307052612,
-0.0577356331050396,
-0.0893036648631095... | |
link on the desktop; the user receives the machine and logs on (with admin rights) and goes to a web site, where my server determine what the appropriate user accounts are, sends them back as HTML, and the ActiveX control creates the user accounts I specify.
This sort of thing seems like it should be possible, but at ... | [
0.687279462814331,
0.18760620057582855,
0.6548935174942017,
0.12852445244789124,
0.38184070587158203,
-0.1530948132276535,
0.00913691520690918,
0.16426798701286316,
-0.18674905598163605,
-0.8118512630462646,
-0.037885721772909164,
0.5138425827026367,
-0.2890348434448242,
0.3087794780731201... | |
do anything like this? Is this even allowed by the security model of XP? Or is this just opening up a huge security hole that should be avoided entirely?
There is a semicolon after `eval`. | [
0.39296019077301025,
0.3149053752422333,
0.43021848797798157,
0.17549508810043335,
-0.2728899419307709,
-0.5138425230979919,
0.39972785115242004,
0.4060317277908325,
-0.32281187176704407,
0.09988317638635635,
-0.3446619212627411,
0.034581247717142105,
-0.1463884860277176,
0.045734193176031... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.