text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I've tried this both with and without the 'ExceptionType' parameter. I have an Error.aspx page in both the Views/Shared folder and the Views/thisController folder. But everytime I run this I get a "Server Error in '/' Application." error page, rather than the nice one in Views/Shared.
Any idea what could be going wron... | [
0.24623605608940125,
0.13039906322956085,
0.10111955553293228,
-0.2473432719707489,
0.18395738303661346,
-0.08920285105705261,
0.5756030678749084,
-0.3076985776424408,
-0.39202314615249634,
-0.5792654752731323,
-0.04826067015528679,
0.6168277859687805,
-0.3094457983970642,
0.08246789872646... | |
indeed have this in my web.config
```
<customErrors mode="On"></customErrors>
```
Must be something else at play. | [
0.31923937797546387,
0.23018522560596466,
0.5372406840324402,
0.08452999591827393,
0.29097557067871094,
-0.3816528916358948,
0.1874474436044693,
0.547379195690155,
-0.19855348765850067,
-0.656257152557373,
-0.02278408221900463,
0.5160634517669678,
0.053961411118507385,
0.1954580694437027,
... | |
I have run into an issue with WPF and Commands that are bound to a Button inside the DataTemplate of an ItemsControl. The scenario is quite straight forward. The ItemsControl is bound to a list of objects, and I want to be able to remove each object in the list by clicking a Button. The Button executes a Command, and t... | [
-0.08631478250026703,
-0.22027893364429474,
0.55293869972229,
0.18301816284656525,
-0.03726661205291748,
-0.01487782597541809,
0.09651540964841843,
-0.20274688303470612,
-0.2554799020290375,
-0.4715617597103119,
0.08801589161157608,
0.48484480381011963,
-0.21279428899288177,
0.345544666051... | |
need to do some checks in the "CanExecute" call of the Command to verify that the user has the right permissions.
The problem is that the parameter passed to CanExecute is NULL the first time it's called - so I can't run the logic to enable/disable the command. However, if I make it allways enabled, and then click the... | [
0.018272265791893005,
0.05109671130776405,
0.5393372774124146,
0.06672180444002151,
0.12177368998527527,
-0.05544069781899452,
0.31926608085632324,
-0.5011511445045471,
-0.08931449055671692,
-0.7654669880867004,
0.06486436724662781,
0.58646160364151,
-0.30994999408721924,
0.168756008148193... | |
Width="Auto" Height="Auto">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Button
Content="Delete" | [
-0.4030969440937042,
-0.43991467356681824,
0.5827068090438843,
0.13914258778095245,
0.004418819211423397,
0.3072180449962616,
-0.1470773071050644,
-0.32038065791130066,
-0.6534347534179688,
-0.3044060170650482,
-0.19278772175312042,
0.321510910987854,
0.36237114667892456,
0.089677624404430... | |
FontSize="10"
Command="{Binding Path=DataContext.DeleteCommentCommand, ElementName=commentsList}"
CommandParameter="{Binding}" />
</StackPanel> | [
-0.45232677459716797,
-0.18258462846279144,
0.6565487384796143,
-0.3354801833629608,
-0.05204730108380318,
0.40021926164627075,
0.29569628834724426,
-0.41878974437713623,
-0.23356612026691437,
-0.6290518045425415,
-0.33975979685783386,
0.40618008375167847,
-0.30012375116348267,
-0.36134102... | |
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
```
So as you can see I have a list of Comments objects. I want the CommandParameter of the DeleteCommentCommand to be bound to the Command object.
So I guess my question is: have anyone experienced this problem before? CanExecute gets called on my Com... | [
-0.1858954131603241,
-0.006957520265132189,
0.5007873773574829,
0.0006444868631660938,
-0.4618895351886749,
0.1668725311756134,
0.35640662908554077,
0.052159734070301056,
-0.286879301071167,
-0.6189709305763245,
0.3150891065597534,
0.5575465559959412,
-0.4096837341785431,
0.231240928173065... | |
is executed before the CommandParameter is bound to the button. I have tried to set the CommandParameter before the Command (like suggested) - but it still doesn't work. Any tips on how to control it.
**Update2:** Is there any way to detect when the binding is "done", so that I can force re-evaluation of the command? ... | [
0.19711309671401978,
-0.10369142144918442,
0.45262041687965393,
0.09642898291349411,
-0.06960060447454453,
0.07339219003915787,
0.37873193621635437,
-0.20171445608139038,
-0.4343593120574951,
-0.7947649359703064,
0.042527928948402405,
0.5501993298530579,
-0.2720150947570801,
-0.07240978628... | |
solved it using my trusty TriggerConverter.
```
public class TriggerConverter : IMultiValueConverter
{
#region IMultiValueConverter Members
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// First value is target value.
... | [
-0.6357035040855408,
-0.1623496115207672,
0.6158087253570557,
-0.12705959379673004,
-0.005049995146691799,
0.10885895788669586,
0.1270768642425537,
-0.009018260054290295,
-0.11624860763549805,
-0.604947030544281,
-0.2523532509803772,
0.13965024054050446,
-0.4484531879425049,
0.351538866758... | |
{
throw new NotImplementedException();
}
#endregion
}
```
This value converter takes any number of parameters and passes the first of them back as the converted value. When used in a MultiBinding in your case it looks like the following.
```
<ItemsControl
x:Name="commentsList"
ItemsSource="... | [
0.09539099782705307,
-0.369782954454422,
0.581737220287323,
-0.06217799708247185,
-0.004386128392070532,
0.04760649427771568,
0.11893908679485321,
-0.44260135293006897,
-0.358330637216568,
-0.7880772352218628,
-0.19332832098007202,
0.3799779415130615,
-0.20475700497627258,
0.14065922796726... | |
<Button
Content="Delete"
FontSize="10"
CommandParameter="{Binding}"> | [
-0.45691919326782227,
-0.2655017673969269,
0.3526208996772766,
-0.28701797127723694,
0.13488887250423431,
0.5053277611732483,
0.245805561542511,
-0.10885278880596161,
-0.27899569272994995,
-0.6380537152290344,
-0.2128143608570099,
0.38939714431762695,
-0.2578414976596832,
-0.07283888757228... | |
<Button.Command>
<MultiBinding Converter="{StaticResource TriggerConverter}">
<Binding Path="DataContext.DeleteCommentCommand" | [
-0.15456798672676086,
-0.40673649311065674,
0.5039225816726685,
-0.15564553439617157,
0.15778173506259918,
0.0423116497695446,
0.18359597027301788,
-0.5001806020736694,
-0.20919263362884521,
-0.31780460476875305,
-0.22789284586906433,
0.4529390037059784,
-0.5446394681930542,
0.120431616902... | |
ElementName="commentsList" />
<Binding />
</MultiBinding>
</Button.Command>
</Button> | [
-0.36997300386428833,
-0.2653375267982483,
0.2148876190185547,
-0.2686954140663147,
-0.0930674597620964,
0.04587092250585556,
-0.06389905512332916,
-0.6785488724708557,
-0.16183149814605713,
-0.6849961280822754,
-0.054115839302539825,
0.24217557907104492,
-0.3911116123199463,
-0.1150952205... | |
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
```
You will have to add TriggerConverter as a resource somewhere for this to work. Now the Command property is set not before the value for the CommandParameter has become available. You cou... | [
-0.06416762620210648,
-0.20137493312358856,
0.5218918323516846,
-0.06308268010616302,
0.03483445197343826,
-0.023783978074789047,
0.11517781764268875,
-0.49698883295059204,
-0.3193821310997009,
-0.6656561493873596,
0.07036621868610382,
0.5850837826728821,
-0.12195070832967758,
0.0357247665... | |
CommandParameter instead of . to achieve the same effect. | [
-0.23048490285873413,
-0.416597843170166,
0.20585761964321136,
0.3225001394748688,
-0.3243308365345001,
0.013895994983613491,
0.049527838826179504,
-0.24495257437229156,
-0.02878265455365181,
-0.7817236185073853,
-0.382135272026062,
0.7121790051460266,
-0.13699498772621155,
0.0505870729684... | |
I want to do something like
```
select * from tvfHello(@param) where @param in (Select ID from Users)
```
You need to use **CROSS APPLY** to achieve this
```
select
f.*
from
users u
cross apply dbo.tvfHello(u.ID) f
``` | [
0.7240813374519348,
0.09638644754886627,
0.5413982272148132,
0.009342268109321594,
-0.14968803524971008,
-0.09437504410743713,
0.06548605859279633,
-0.3730103075504303,
-0.1268073469400406,
-0.621157169342041,
-0.11961975693702698,
0.3070375323295593,
-0.1299390196800232,
0.126386553049087... | |
I have the following shell script registered in my "Login Items" preferences but it does not seem to have any effect. It is meant to launch the moinmoin wiki but only works when it is run by hand from a terminal window, after which it runs until the machine is next shut down.
```
#!/bin/bash
cd /Users/stuartcw/Documen... | [
0.08133095502853394,
0.26095396280288696,
0.44177839159965515,
-0.16753670573234558,
0.1766279637813568,
-0.4568416178226471,
0.42213305830955505,
0.3424265682697296,
0.062247708439826965,
-0.6141095161437988,
-0.3890713155269623,
0.9767196178436279,
-0.23740416765213013,
0.009493879973888... | |
it on other systems.
Edit and place this in `/Library/LaunchDaemons` as `com.you.wiki.plist`
```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.you.... | [
-0.20840032398700714,
-0.225799098610878,
0.3464232087135315,
-0.014007835648953915,
0.022542782127857208,
-0.026672957465052605,
-0.05785506218671799,
0.07274875044822693,
-0.1250879317522049,
-0.4613743722438812,
-0.5811161398887634,
0.3159875273704529,
-0.16476379334926605,
-0.240010976... | |
<string>wikiserver.py</string>
</array>
</dict>
</plist>
``` | [
-0.05967114120721817,
-0.13385124504566193,
0.03669467568397522,
0.09761395305395126,
-0.17174848914146423,
0.1499435156583786,
0.03396430239081383,
-0.27268359065055847,
-0.19374319911003113,
-0.667241096496582,
-0.4555037319660187,
0.036161139607429504,
-0.2231893539428711,
-0.0041700876... | |
I am trying to write my first real python function that does something real. What i want to accomplish is searching a given folder, and then open all images and merging them together so they make a filmstrip image. Imagine 5 images stacked on top of eachother in one image.
I have this code now, which should be pretty ... | [
0.47795823216438293,
-0.006106892600655556,
0.4508330523967743,
0.03268467262387276,
-0.27732834219932556,
-0.12455999851226807,
-0.1134941577911377,
-0.19695961475372314,
-0.3444254994392395,
-0.4974006116390228,
0.23672835528850555,
0.5671305060386658,
-0.4510660171508789,
0.049688417464... | |
* len(files)
filename = 'filmstrip.jpg'
filmstrip_url = imgpath + filename
# Create the new image. The background doesn't have to be white
white = (255,255,255)
filmtripimage = Image.new('RGB',(imgwidth, totalheight),white)
row = 0
for file in files:
img = Image.open(file)
... | [
0.4162927269935608,
-0.27380192279815674,
0.3866073787212372,
0.1468382030725479,
-0.35656270384788513,
0.04895010218024254,
-0.18204016983509064,
-0.1915646195411682,
-0.520738422870636,
-0.5398882031440735,
0.05762781947851181,
0.5675485134124756,
-0.2260030061006546,
0.3710421621799469,... | |
row*imgheight
lower = upper + imgheight
box = (left,upper,right,lower)
row += 1
filmstripimage.paste(img, box)
try:
filmstripimage.save(filename, 'jpg', quality=90, optimize=1)
except:
filmstripimage.save(miniature_filename, 'jpg', quality=90)")
```
How do i mo... | [
0.28205445408821106,
0.1225796788930893,
0.4633331894874573,
0.1318628191947937,
-0.023554788902401924,
0.0545758455991745,
-0.025141406804323196,
-0.0836886540055275,
-0.42022520303726196,
-0.4051673710346222,
0.21156972646713257,
0.4911688268184662,
-0.24939854443073273,
0.24163633584976... | |
missing or wrong, anybody got a clue?
Related question: [How to generate a filmstrip image in python from a folder of images?](https://stackoverflow.com/questions/334827/how-to-generate-a-filmstrip-image-in-python-from-a-folder-of-images)
It is not an answer to your question, but It might be helpful:
```
#!/usr/bin/e... | [
0.48852863907814026,
-0.0011240618769079447,
-0.045117009431123734,
0.3663879334926605,
0.03030659258365631,
-0.30129602551460266,
-0.0904780924320221,
-0.2141399383544922,
-0.570026159286499,
0.15185090899467468,
0.15645112097263336,
0.5318450927734375,
-0.40494561195373535,
0.06879679113... | |
for img in images:
image.paste(img, (left, upper))
upper += img.size[1]
return image
if __name__=='__main__':
# Here's how it could be used:
from glob import glob
from optparse import OptionParser
# process command-line args
parser = OptionParser()
parser.add_option("-o", ... | [
-0.2538002133369446,
-0.2083607316017151,
0.7376507520675659,
-0.2192520946264267,
-0.1538979411125183,
0.39909109473228455,
-0.046907708048820496,
-0.2791862189769745,
-0.30038103461265564,
-0.8860735297203064,
-0.30474621057510376,
0.6652145385742188,
-0.7364190816879272,
-0.169838830828... | |
to OUTPUT")
options, filepatterns = parser.parse_args()
outfilename = options.file
filenames = []
for files in map(glob, filepatterns):
if files:
filenames += files
# construct image
images = map(Image.open, filenames)
img = makefilmstrip(images)
img.save(outfi... | [
0.31504032015800476,
-0.25116288661956787,
0.28429192304611206,
-0.10353155434131622,
0.08996406197547913,
0.012938587926328182,
-0.18442988395690918,
-0.08850810676813126,
-0.45178088545799255,
-0.27879735827445984,
-0.1251721829175949,
0.7659134268760681,
-0.5485349893569946,
-0.09339962... | |
I am working on adding in a settings bundle for my application as a cheap way of getting a GUI on my preferences. Is it possible to launch this from a button in my application or will my users always have to access it manually via the built in settings application?
They may have to go to the settings application, depen... | [
0.35269463062286377,
0.0008701847982592881,
0.278495192527771,
-0.0022686112206429243,
0.25410938262939453,
0.12400186061859131,
0.028822394087910652,
-0.18514682352542877,
-0.12233049422502518,
-0.6488221287727356,
0.06909111142158508,
0.6686709523200989,
-0.2608778476715088,
-0.415955603... | |
that are typically configured once and then rarely changed. For example, the Mail application uses these preferences to store the user’s account information and message-checking settings. Because the Settings application has support for displaying preferences hierarchically, manipulating your preferences from the Setti... | [
0.3417379558086395,
-0.22811269760131836,
0.2382548749446869,
0.40744128823280334,
0.3723076581954956,
0.1388290375471115,
0.06447958201169968,
0.11922435462474823,
-0.38039520382881165,
-0.9396405220031738,
-0.12088900804519653,
0.3786430060863495,
-0.440043568611145,
-0.07728099822998047... | |
carefully about whether the Settings application is the right place for them. For instance, utility applications provide custom configuration options on the back of their main view. A special control on the view flips it over to display the options and another control flips the view back. For simple applications, this ... | [
0.32745233178138733,
-0.0671258196234703,
0.5122631192207336,
0.23280569911003113,
0.4358677268028259,
-0.07612480223178864,
0.25865304470062256,
-0.14011648297309875,
-0.3208828270435333,
-0.6596596837043762,
-0.4351445138454437,
0.7206252217292786,
-0.1593114137649536,
-0.134868606925010... | |
I noticed by looking at sample code from Apple, that they tend to design methods that receive structures instead of multiple parameters. Why is that? As far as ease of use, I personally prefer the latter, but as far as performance goes, is there one better choice than the other?
```
[pencil drawPoint:Point3Make(20,40,... | [
0.20465731620788574,
0.27592527866363525,
0.10849479585886002,
0.12405901402235031,
-0.055086709558963776,
0.09451239556074142,
0.10665852576494217,
-0.039978958666324615,
-0.22146748006343842,
-0.6303555965423584,
-0.10269849747419357,
0.43166211247444153,
-0.2164410948753357,
-0.16645061... | |
passing style with performance. You want to **make the best design decision first**, then optimize for performance *only if needed*.
With that being said, Apple does not recommend or prefer passing multiple parameters vs a structure/object. Generalizing this outside of the scope of Objective-C, use individuals paramet... | [
0.11041510105133057,
-0.07840823382139206,
-0.12403129786252975,
0.15839998424053192,
-0.627305269241333,
-0.17435643076896667,
0.488063782453537,
-0.05558208003640175,
-0.32608407735824585,
-0.7643177509307861,
0.03295386582612991,
0.4582221508026123,
-0.35797756910324097,
-0.421683669090... | |
some rules on the relationship between the various members of the object. This allows you to ensure the consumer of your method constructs a valid object prior to calling your method (thus eliminating the need of the method to validate these conditions).
* Pass individual arguments when it is clear the method makes sen... | [
0.34462758898735046,
-0.2161664068698883,
0.18335884809494019,
0.1233445405960083,
-0.036815743893384933,
0.009701088070869446,
0.2863539755344391,
-0.30410119891166687,
-0.09891305863857269,
-0.4751664400100708,
0.05019138380885124,
0.42948147654533386,
-0.1640750914812088,
-0.10351560264... | |
the single id and name parameter rather than some container object.
Now, if there was some method to retrieve orders by many different criterion, it would make more send to create a retrieveOrderByCriteria and pass it some criteria structure. | [
-0.13393999636173248,
-0.13869869709014893,
0.38003259897232056,
0.4029034972190857,
-0.25314512848854065,
-0.08747131377458572,
-0.14028581976890564,
-0.43897294998168945,
-0.3642566502094269,
-0.31358325481414795,
-0.1430564671754837,
0.10468464344739914,
-0.34249696135520935,
0.37377434... | |
I have just installed the GDR RTM version of Visual Studio Team System Database Edition GDR RTM.
It all seems to work wonderfully, but I seem to have to edit XML (Database.sqlpermissions) for specify SQL Permissions.
Am I missing something?
For that matter where is the schema diagram tool?
I understand GDR exposes ... | [
0.12946492433547974,
-0.11466047167778015,
0.7142627239227295,
0.2274656444787979,
-0.17030294239521027,
-0.3118799030780792,
0.11819242686033249,
-0.35776957869529724,
-0.14886614680290222,
-0.6406704783439636,
-0.18570879101753235,
0.755619466304779,
-0.4152141213417053,
0.14695672690868... | |
features.
Comparing Infragistics and DevExpress Grid control I found that:
* DevExpress Grid is faster at loading,
and handles more data, than the
Infragistics grid.
+ 25K rows \* 50 columns: Infragistics load time is 2000ms, DevExpress load
time is 1400ms
+ 50K rows \* 500 columns
- Infragistics 600ms first loa... | [
-0.5026859045028687,
-0.20534177124500275,
0.6457476019859314,
0.16913984715938568,
-0.2740568518638611,
-0.14996746182441711,
0.4450135827064514,
-0.32895389199256897,
0.08688168227672577,
-0.9790890216827393,
-0.16616174578666687,
0.8052701354026794,
-0.2935355305671692,
-0.3014266490936... | |
the UX very nice. The sorting and grouping is easy to use and understand for both the developer and end-user.
Overall I am extremely happy with the library. Their support is excellent. Over the life of this project, I have asked over 20 support questions and have received a good response each time.
I would spend my o... | [
0.22854961454868317,
0.2012168914079666,
0.4096834659576416,
0.17211373150348663,
-0.2874530851840973,
0.15795563161373138,
-0.15569454431533813,
0.24702364206314087,
-0.060092903673648834,
-0.7551229000091553,
-0.22773219645023346,
0.6246165633201599,
-0.03622494637966156,
0.1171724572777... | |
I'm working on a PyGTK/glade application that currently has 16 windows/dialogs and is about 130KB, and will eventually have around 25 windows/dialogs and be around 200KB. Currently, I'm storing all the windows in one monolithic glade file. When I run a window I call it like...
```
self.wTree = gtk.glade.XML("interface... | [
0.12845346331596375,
0.1809275597333908,
0.6448565125465393,
0.051649417728185654,
-0.2303762286901474,
0.35029223561286926,
0.19671623408794403,
-0.05384952574968338,
0.0333794467151165,
-1.3498976230621338,
0.022146347910165787,
0.3339753746986389,
0.17770561575889587,
0.0548032708466053... | |
this? Is one method more resource intensive than another? One thing that would be nice about going to individual glade files is that naming widgets would be easier. For example, I name all my OK buttons "windowxyz\_ok", but I could change it to simply "ok" instead. Makes things simpler. The downside is that it may be a... | [
0.44797033071517944,
0.05418117716908455,
0.4050684869289398,
0.18793435394763947,
-0.20000174641609192,
0.12190276384353638,
0.2068811058998108,
0.18239973485469818,
-0.40182361006736755,
-0.9022427201271057,
-0.01469558384269476,
0.4702643156051636,
-0.05615779012441635,
0.07259564846754... | |
and use less memory, since each call to gtk.glade.XML() parses the whole thing. Sure you can pass in the root argument to avoid creating the widget tree for all windows, but you'd still have to *parse* all the XML, even if you're not interested in it.
* Conceptually its easier to understand if have one toplevel per win... | [
0.12046883255243301,
0.025305891409516335,
0.32933509349823,
0.2656033933162689,
-0.2600984275341034,
-0.16838416457176208,
0.1880006492137909,
0.060978010296821594,
-0.28627410531044006,
-0.846829354763031,
-0.16488517820835114,
0.4831746518611908,
-0.04373984783887863,
0.0380495861172676... | |
I am wondering if there is any way to list all the calls to a function in source code, so that I could see the dependencies if I modify that function.
One method I use is to search the function name in the "Entire Solution" but I am looking for a better way.
Right-click on the call and select "Find All References". | [
0.1840583235025406,
0.31681394577026367,
0.4583944082260132,
0.0736851617693901,
0.04555368795990944,
-0.09139571338891983,
0.22487591207027435,
-0.06156497448682785,
-0.11192396283149719,
-0.3609824478626251,
-0.0473024845123291,
0.7822503447532654,
-0.4561882019042969,
0.4491921961307525... | |
Sometimes two image files may be different on a file level, but a human would consider them perceptively identical. Given that, now suppose you have a huge database of images, and you wish to know if a human would think some image X is present in the database or not. If all images had a perceptive hash / fingerprint, t... | [
0.48260051012039185,
0.06853573024272919,
0.0599372424185276,
0.37338340282440186,
0.09508845955133438,
0.060735348612070084,
-0.13645455241203308,
-0.0022757959086447954,
-0.29557332396507263,
-0.7247908711433411,
0.3330126404762268,
0.5131751894950867,
-0.21378524601459503,
-0.0106148105... | |
UNIX command line tool or a library I could use to compute such a hash without implementing some algorithm from scratch?
edit: relevant code from findimagedupes, using ImageMagick
```
try $image->Sample("160x160!");
try $image->Modulate(saturation=>-100);
try $image->Blur(radius=>3,sigma=>99);
try $image->Normalize()... | [
0.18064524233341217,
-0.2426624596118927,
0.6627118587493896,
0.061467502266168594,
0.02830159105360508,
-0.24513952434062958,
0.16847336292266846,
-0.39712390303611755,
-0.27918741106987,
-0.6778188943862915,
-0.03986155986785889,
0.8253185749053955,
-0.21732975542545319,
-0.1471762657165... | |
"findimagedupes -v fingerprint images" to let it print "perceptive hash", for example. | [
0.16580741107463837,
-0.33224478363990784,
0.1702045053243637,
0.4613279402256012,
-0.1989029198884964,
-0.45536869764328003,
-0.11182837188243866,
-0.07504846900701523,
0.14668141305446625,
-0.4575427770614624,
-0.009167901240289211,
0.5627029538154602,
-0.2287018895149231,
-0.00141165230... | |
Are all the additions to C# for version 4 (dynamic, code contracts etc) expected to run on the current .NET CLR, or is there a planned .NET upgrade as well?
C# 4 will require the .NET 4.0 CLR. | [
0.23921097815036774,
-0.09106539934873581,
0.6279975175857544,
0.035790830850601196,
0.044492870569229126,
-0.2951861321926117,
-0.030454864725470543,
0.09402061253786087,
-0.18364009261131287,
-0.12761041522026062,
-0.3731100857257843,
0.9267576932907104,
-0.32136863470077515,
-0.21596777... | |
I have an application where I would like to have mixed Java and Scala source (actually its migrating a java app to scala - but a bit at a time).
I can make this work in IDEs just fine, very nice. But I am not sure how to do this with maven - scalac can compile java and scala intertwined, but how to I set up maven for... | [
0.5382006168365479,
-0.01805627904832363,
0.06501781195402145,
-0.025462912395596504,
0.09667476266622543,
0.0017490205354988575,
-0.15690098702907562,
-0.14171136915683746,
-0.2777641713619232,
-0.6453143954277039,
0.3711545765399933,
0.5799705982208252,
-0.4640227258205414,
-0.0040938421... | |
mixes java and scala source (scala source of course goes in the /scala directory, as mentioned by someone else).
You can run run mvn compile, test etc... and it will all work as normal. Very nice (it will run scalac first automatically).
For a great IDE, IntelliJ 8 works nicely: add in the scala plug in, then add a... | [
0.15470944344997406,
-0.05848725512623787,
0.5575563907623291,
-0.39764663577079773,
-0.01773458532989025,
0.1338357925415039,
0.2478678673505783,
-0.6853011250495911,
-0.2832006514072418,
-0.6768988966941833,
0.04237821698188782,
0.27046579122543335,
-0.47185784578323364,
0.06389620155096... | |
<id>scala-tools.org</id>
<name>Scala-tools Maven2 Repository</name>
<url>http://scala-tools.org/repo-releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>scala-tools.org</id>
<name>Scala-tools Maven2 Repository</name>
<url>http://scala-... | [
-0.16418583691120148,
0.12774448096752167,
0.33338600397109985,
-0.14017851650714874,
-0.053087301552295685,
0.5694720149040222,
-0.1982160210609436,
-0.42049798369407654,
-0.4531177878379822,
-0.5087053179740906,
-0.4695305824279785,
0.46055328845977783,
-0.17051106691360474,
-0.055697590... | |
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal> | [
0.25244078040122986,
-0.1864584982395172,
-0.5005409717559814,
0.2747141420841217,
-0.2675561010837555,
0.16332489252090454,
0.1040564775466919,
-0.5232734680175781,
-0.6422681212425232,
-0.454880028963089,
0.18254821002483368,
-0.1364888697862625,
-0.5243427157402039,
-0.18818284571170807... | |
</goals>
<phase>compile</phase>
</execution>
<execution>
<id>test-compile</id>
<goals> | [
0.4486894905567169,
-0.08254437893629074,
-0.4561704397201538,
0.34188809990882874,
-0.038926221430301666,
0.12033002823591232,
-0.0063432324677705765,
-0.3849477469921112,
0.04599592462182045,
-0.6132013201713562,
0.09492345154285431,
0.07900894433259964,
-0.09665150195360184,
-0.08177038... | |
<goal>testCompile</goal>
</goals>
<phase>test-compile</phase>
</execution>
<execution> | [
0.5806990265846252,
-0.09677309542894363,
-0.46178460121154785,
0.1618218719959259,
-0.019550539553165436,
-0.0011142437579110265,
0.1596928834915161,
-0.17007379233837128,
0.20229162275791168,
-0.5263472199440002,
-0.14501798152923584,
0.17146535217761993,
-0.12206433713436127,
-0.0307089... | |
<phase>process-resources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions> | [
0.08990662544965744,
-0.3474480211734772,
-0.29410305619239807,
0.18549436330795288,
0.16940729320049286,
0.31041523814201355,
-0.0801435336470604,
-0.21606920659542084,
-0.435621976852417,
-0.5609626770019531,
0.07958133518695831,
-0.24625003337860107,
-0.4316604435443878,
0.1482535153627... | |
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies> | [
-0.11918275058269501,
-0.15643204748630524,
0.0012296593049541116,
-0.22999432682991028,
-0.17962020635604858,
0.2313494235277176,
-0.08271747082471848,
-0.1880146712064743,
0.08346851170063019,
-0.8346521258354187,
-0.2574262022972107,
0.5986125469207764,
-0.5406777262687683,
-0.210620388... | |
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>... | [
0.10216356813907623,
-0.023481974378228188,
0.31340283155441284,
-0.014269595965743065,
0.05153000354766846,
0.09350690990686417,
-0.12317907065153122,
-0.5348793864250183,
-0.19994482398033142,
-0.8288658261299133,
0.005553100258111954,
0.38536038994789124,
-0.4920932948589325,
0.05970789... | |
Some of you may recognize this as Project Euler's problem number 11. The one with the grid.
I'm trying to replicate the grid in a large multidimensional array, But it's giving me a syntax error and i'm not sure why
```
grid = [
[ 08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91, 08 ],
[ 49,... | [
-0.012420116923749447,
0.41744065284729004,
0.21955721080303192,
0.11382234841585159,
-0.11427009105682373,
0.7713822722434998,
0.07277948409318924,
0.2837887704372406,
-0.5827288031578064,
-0.6742448806762695,
-0.07631252706050873,
0.003501115832477808,
-0.36511915922164917,
-0.0208056475... | |
49, 13, 36, 65 ],
...
```
And I get this error:
```
File "D:\development\Python\ProjectEuler\p11.py", line 3
[ 08, 02, 22, 97, 38, 15, 00, 40, 00, 75, 04, 05, 07, 78, 52, 12, 50, 77, 91 , 08 ],
^ SyntaxError: invalid token
```
Why is it throwing an error before the comma?
I think when you start a lit... | [
-0.19807057082653046,
0.3842059373855591,
-0.01666463166475296,
-0.25446847081184387,
-0.01110055297613144,
0.32122281193733215,
0.5333231091499329,
0.00945237185806036,
-0.3533798158168793,
-0.14029613137245178,
-0.2586486041545868,
0.33353444933891296,
-0.250224232673645,
0.0777826458215... | |
Presently I'm starting to introduce the concept of Mock objects into my Unit Tests. In particular I'm using the Moq framework. However, one of the things I've noticed is that suddenly the classes I'm testing using this framework are showing code coverage of 0%.
Now I understand that since I'm just mocking the class, i... | [
0.4202554523944855,
0.51186603307724,
0.014671847224235535,
0.0413893423974514,
-0.558899462223053,
0.18266919255256653,
0.6776729822158813,
0.0051832194440066814,
-0.28726518154144287,
-0.6306450366973877,
0.15544502437114716,
0.43598654866218567,
0.2279672473669052,
0.3860194683074951,
... | |
it?
Here is an example of me trying to Unit Test a class called "MyClass":
```
using Moq;
using NUnitFramework;
namespace MyNameSpace
{
[TestFixture]
public class MyClassTests
{
[Test]
public void TestGetSomeString()
{
const string EXPECTED_STRING = "Some String!";
... | [
0.41769251227378845,
-0.3356758654117584,
0.1933642029762268,
-0.07694251090288162,
0.09487384557723999,
0.11461307108402252,
0.3548545241355896,
-0.06551539152860641,
0.2701561450958252,
-0.31835779547691345,
-0.0909261554479599,
0.5551048517227173,
0.003775776596739888,
0.077108517289161... | |
myMock.Expect(m => m.GetSomeString()).Returns(EXPECTED_STRING);
string someString = myMock.Object.GetSomeString();
Assert.AreEqual(EXPECTED_STRING, someString);
myMock.VerifyAll();
}
}
public class MyClass
{
public virtual string GetSomeString()
... | [
-0.2651837170124054,
0.019481856375932693,
0.6157257556915283,
-0.2729312777519226,
0.27774539589881897,
-0.0024498295970261097,
0.7139022350311279,
0.3561464250087738,
0.15766030550003052,
-0.5124660134315491,
-0.25778600573539734,
0.6200178861618042,
-0.20442278683185577,
0.4507012367248... | |
}
}
}
```
Does anyone know what I should be doing differently?
You are not using your mock objects correctly. When you are using mock objects you meant to be testing how your code interacts with other objects without actually using the real objects. See the code below:
```
using Moq;
using NUnitFramework;
names... | [
0.47210755944252014,
0.1113702654838562,
0.01765156351029873,
0.06407898664474487,
-0.08627603948116302,
-0.006085522938519716,
0.7193378806114197,
-0.29355889558792114,
0.09206929802894592,
-0.7941207885742188,
0.1760377436876297,
0.5497288107872009,
-0.2533271908760071,
0.113183774054050... | |
public void TestGetSomeString()
{
const string EXPECTED_STRING = "Some String!";
Mock<IDependance> myMock = new Mock<IDependance>();
myMock.Expect(m => m.GiveMeAString()).Returns("Hello World"); | [
0.05244738981127739,
-0.07037094980478287,
0.22311387956142426,
-0.1921878159046173,
0.41283118724823,
0.2815876305103302,
0.7653323411941528,
0.21915362775325775,
0.31423419713974,
-0.4335581362247467,
-0.3730744421482086,
0.5379727482795715,
-0.3285863399505615,
0.2688087821006775,
-0.... | |
MyClass myobject = new MyClass();
string someString = myobject.GetSomeString(myMock.Object);
Assert.AreEqual(EXPECTED_STRING, someString);
myMock.VerifyAll();
}
}
public class MyClass
{ | [
-0.31333017349243164,
-0.072586290538311,
0.3772207498550415,
-0.09467211365699768,
0.017735278233885765,
-0.03193982318043709,
0.4955921769142151,
0.012829625979065895,
0.12091691792011261,
-0.4839005172252655,
-0.12876102328300476,
0.6650829315185547,
-0.14692316949367523,
0.041077028959... | |
public virtual string GetSomeString(IDependance objectThatITalkTo)
{
return objectThatITalkTo.GiveMeAString();
}
}
public interface IDependance
{
string GiveMeAString();
} | [
-0.08679165691137314,
-0.2112780213356018,
0.4983927607536316,
0.17914161086082458,
0.12362141162157059,
0.13241027295589447,
0.28303849697113037,
-0.19547942280769348,
0.14600349962711334,
-0.7249512672424316,
-0.20630866289138794,
0.5742765069007874,
-0.31095293164253235,
0.4075025618076... | |
}
```
It doesn't look like it is doing anything useful when your code is just returning a string without any logic behind it.
The real power comes if you `GetSomeString()` method did some logic that may change the result of the output string depending on the return from the `IDependdance` .`GiveMeAString()` method,... | [
-0.0814690813422203,
-0.16309985518455505,
0.5706620812416077,
0.007859774865210056,
-0.05055122449994087,
-0.27800941467285156,
0.5457573533058167,
-0.27269455790519714,
-0.013268559239804745,
-0.6221230626106262,
-0.07219509035348892,
0.6378897428512573,
-0.34275153279304504,
0.305782496... | |
return null;
}
```
Now if you have this line in your test:
```
myMock.Expect(m => m.GiveMeAString()).Returns(null);
```
What will happen to your `GetSomeString()` method? | [
-0.07121231406927109,
-0.03426047042012215,
0.39830246567726135,
-0.2962723970413208,
0.4529593288898468,
-0.05503588914871216,
0.4738500714302063,
-0.2876075804233551,
0.16620875895023346,
-0.4194777011871338,
-0.2716236710548401,
0.5307287573814392,
-0.4148065149784088,
0.149302601814270... | |
I have a MySQL database that I want to *archive*. What is the best way to do this?
Note: I *don't* want to just do a *backup*. I want to do a one time export of the data for long term storage in a way that I can get at on a later date. Particularly, I want to not be tied to MySQL, a database or preferably any given so... | [
0.45558539032936096,
0.13943573832511902,
0.16259156167507172,
0.34662923216819763,
0.11801053583621979,
-0.40221959352493286,
0.17448168992996216,
0.11233174800872803,
-0.22626399993896484,
-0.6245156526565552,
-0.018763039261102676,
0.32199060916900635,
-0.0043212370947003365,
0.11183705... | |
dump stuff to a table using the CSV engine and then burn that to DVD. The is nice because CSV can be loaded by so many different programs. The only gotcha in this is that the bulk of the data is in Blob columns as in binary so I'll need to decode how that is encoded.
Exporting to CSV, encoding binary data with Base64 e... | [
0.3671512305736542,
0.21535195410251617,
-0.09709318727254868,
0.3522978723049164,
-0.2919387221336365,
-0.46822389960289,
-0.18063198029994965,
0.24501988291740417,
-0.435192346572876,
-0.45192891359329224,
-0.01867661438882351,
0.3858746290206909,
-0.4009891152381897,
0.22621923685073853... | |
I am ASP.NET developer from last 5 years and still loving it. There are lots of good voices in air about Ruby on Rails. I want to ask to community, Is there any worth trying to learn Ruby On Rails as a ASP.NET web developer on following point of view.
1. Scalability
2. Documentation
3. Community Support
4. Hosting Sol... | [
0.3957415521144867,
-0.015006775967776775,
0.05230681598186493,
0.15722444653511047,
-0.07796814292669296,
-0.09350170940160751,
0.35143330693244934,
0.22834351658821106,
-0.4277496635913849,
-0.9395933747291565,
0.2696956992149353,
0.6354487538337708,
0.2507074773311615,
-0.05531170964241... | |
is a bit worse than on .NET. But the community is very good and you'll never find yourself searching for a good way to go.
3. See above (it is excellent)
4. Hosting is not a problem: numerous hosting options available.
5. I find transition from development to test and then to production better thought of in Ror than in... | [
0.3944353461265564,
-0.0692056193947792,
0.29609358310699463,
0.15610474348068237,
-0.03430834412574768,
-0.28836098313331604,
0.17155317962169647,
0.126863032579422,
-0.03793451562523842,
-0.6508246660232544,
-0.18818463385105133,
0.5757811069488525,
0.4869832396507263,
0.0238567963242530... | |
Is it possible somehow to close StreamReader after calling ReadToEnd method in construction like this:
```
string s = new StreamReader("filename", Encoding.UTF8).ReadToEnd();
```
Any alternative elegant construction with the same semantics will be also accepted.
I think the method you're really after is [File.ReadAl... | [
-0.1857902556657791,
-0.1293335109949112,
0.5585767030715942,
-0.01865999400615692,
0.06480801850557327,
-0.26539668440818787,
0.31356561183929443,
0.05946708470582962,
-0.2887343466281891,
-0.7414847612380981,
-0.39022597670555115,
0.3931522071361542,
-0.36807018518447876,
0.1736339777708... | |
I'm reading ScottGu's blog about ASP.NET MVC, and found a lot of code cannot compile or doesn't work as expected.
<http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx>
<http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx>
So, did ASP.NET MVC... | [
0.5084468126296997,
-0.059837933629751205,
0.10470577329397202,
-0.2506071925163269,
-0.44921135902404785,
-0.23879343271255493,
0.27513304352760315,
-0.14223849773406982,
-0.025307118892669678,
-0.4550372362136841,
0.011437094770371914,
0.3059453070163727,
-0.36718204617500305,
0.02907513... | |
I have the following piece of code which replaces "template markers" such as %POST\_TITLE% with the contents of a variable called $post\_title.
```
function replaceTags( $template, $newtext ) {
$template = preg_replace( '/%MYTAG%/', $newtext, $template );
return $template;
}
```
The issue is that when $post\... | [
0.5946272611618042,
0.14998546242713928,
0.3523698151111603,
-0.1518707275390625,
0.0021114901173859835,
0.10392798483371735,
0.34071189165115356,
0.04518966004252434,
-0.12870793044567108,
-0.36578792333602905,
0.09152684360742569,
0.3665638566017151,
-0.3036971092224121,
0.49840161204338... | |
preg\_quote() but it doesn't have the desired effect.
According to [preg\_replace manual](http://theserverpages.com/php/manual/en/function.preg-replace.php), preg\_replace() treats this (`$1`) as **[backreference](http://www.regular-expressions.info/brackets.html)**.
(and not a "callback syntax" as mentionned in the... | [
-0.15036699175834656,
0.053231578320264816,
0.6495835781097412,
-0.2793858051300049,
-0.01494416780769825,
0.0249983798712492,
0.3793516755104065,
-0.2068021148443222,
-0.0512409508228302,
-0.2577548623085022,
-0.4351014792919159,
0.9126933813095093,
-0.3412681519985199,
-0.122008562088012... | |
I am trying to run client server UDP program .
My both machines are in different networks. I have set up port forwarding in my router.
My server has two IP Address :
1) External 200.?.?.?
2) Internal 192.168.0.100
While creating UDP server I need to create a socket which is binded to addresss.
What address should I ... | [
0.2031780481338501,
0.09465071558952332,
0.4245694875717163,
-0.06599561870098114,
-0.30847159028053284,
0.2655482292175293,
-0.21559186279773712,
-0.2145782858133316,
-0.5744146108627319,
-0.85159832239151,
0.38050615787506104,
0.3036005198955536,
-0.36604249477386475,
0.5882754325866699,... | |
address? If you specify the External IP address and a port number, the port forwarding on your router should send it to the appropriate node on the network. | [
0.037439387291669846,
0.07797315716743469,
0.4474489390850067,
-0.06174388900399208,
0.15812797844409943,
0.26495248079299927,
0.1288990080356598,
0.11947855353355408,
-0.23381724953651428,
-0.6164944171905518,
-0.2051067054271698,
0.3016817271709442,
-0.03742567077279091,
0.41716170310974... | |
I've written a Custom User Control which returns some user specific data.
To load the Custom User Control I use the following line of code:
```
UserControl myUC = (UserControl).Load("~/customUserControl.ascx");
```
But how can I access `string user` inside the User Control `myUC`?
Let's call your usercontrol "Bob"
... | [
0.2156730741262436,
0.1325051188468933,
0.25594639778137207,
-0.18031537532806396,
0.07071438431739807,
-0.05579053983092308,
0.22952724993228912,
-0.11967774480581284,
-0.23937812447547913,
-0.33327823877334595,
0.1479274183511734,
0.627556562423706,
-0.35425081849098206,
0.28801795840263... | |
way around?
For the first one you should create a property in your usercontrol.
```
class Bob : UserControl{
public string User { get; set;}
}
```
and then set it when after you create "Bob" instance.
```
b.User = theuser;
``` | [
0.2838071882724762,
0.06069646403193474,
0.47046956419944763,
-0.06106823682785034,
0.09670433402061462,
-0.1486443430185318,
0.29280757904052734,
-0.2046377807855606,
-0.33611851930618286,
-0.1919693946838379,
0.036505840718746185,
0.5554224848747253,
-0.5716477036476135,
0.11186750233173... | |
Working with Microsoft SQL Server I found extremely useful SQL Server Profiler and Estimated Execution Plan (available in Management Studio) to optimize queries during development and production system monitoring.
Are there similar tools (open source or commercial) or techniques available for MySQL?
You can get inform... | [
0.05994907766580582,
-0.03859291970729828,
0.08406835049390793,
0.17051462829113007,
-0.13404670357704163,
-0.0834110900759697,
-0.07836636900901794,
-0.1554100066423416,
0.09249216318130493,
-0.8288121223449707,
0.1083143800497055,
0.5212258696556091,
-0.3123036026954651,
0.16018676757812... | |
How do we filter an xml document based on another xml document. I have to remove all the elements which are not there in the lookup xml. Both the input xml and lookup xml has the same root elements, we are using XSLT 1.0.
Ex Input
```
<Root>
<E1 a="1">V1</E1>
<E2>V2</E2>
<E3>V3</E3>
<E5>
<SE51>... | [
0.175551176071167,
-0.474820613861084,
0.07508719712495804,
-0.07461922615766525,
0.09397737681865692,
-0.11247418075799942,
0.14922122657299042,
-0.6469219923019409,
0.09626734256744385,
-0.9748669266700745,
-0.0307976882904768,
0.20739342272281647,
-0.5051882266998291,
-0.374270886182785... | |
<SE62>SEV4</SE62>
</E6>
</Root>
```
Filter Xml
```
<Root>
<E1 a="1"></E1>
<E2></E2>
<E5>
<SE51></SE51>
<SE52></SE52>
</E5>
</Root>
```
Expected Output
```
<Root>
<E1 a="1">V1</E1>
<E2>V2</E2>
<E5>
<SE51>SEv1</SE51>
<SE52>SEV2</SE52>
... | [
-0.43300315737724304,
-0.4373025894165039,
0.16093260049819946,
-0.396802693605423,
-0.39630192518234253,
0.12431701272726059,
-0.035793982446193695,
-0.7056991457939148,
-0.044819820672273636,
-0.9675217270851135,
-0.348926305770874,
0.022008338943123817,
-0.2895362079143524,
-0.306529432... | |
required transformation:
```
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:z="inline:text.xml"
exclude-result-prefixes="z"
>
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<z:filter>
<Root>
<E1 a="1"></E... | [
-0.20594950020313263,
-0.4649239182472229,
0.3930651843547821,
-0.08058024197816849,
-0.05963168293237686,
0.11606438457965851,
0.15780429542064667,
-0.9726089239120483,
-0.11556735634803772,
-0.8244487047195435,
-0.5329617857933044,
0.49090221524238586,
-0.20648565888404846,
-0.2310791015... | |
</E5>
</Root>
</z:filter>
<xsl:variable name="vFilter" select=
"document('')/*/z:filter"/>
<xsl:template match="/">
<xsl:apply-templates select="*[name()=name($vFilter/*)]">
<xsl:with-param name="pFiltNode" select="$vFilter/*"/>
</xsl:apply-templates>
</xsl:template>
... | [
0.04375963285565376,
-0.23554162681102753,
0.48533061146736145,
-0.16416874527931213,
-0.37113580107688904,
0.15716753900051117,
0.13927079737186432,
-1.196891188621521,
-0.3777792751789093,
-0.48070695996284485,
-0.2801845967769623,
0.38787487149238586,
-0.507308840751648,
-0.027938524261... | |
| *">
<xsl:choose>
<xsl:when test="self::text()">
<xsl:copy-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="vFiltNode"
select="$pFiltNode/*[name()=name(current())]"/> | [
-0.0687936469912529,
-0.245709627866745,
0.6179728507995605,
-0.25316861271858215,
0.10923133045434952,
-0.14911873638629913,
0.03189261630177498,
-0.55463045835495,
0.028532633557915688,
-0.38329407572746277,
-0.192557692527771,
0.5532872080802917,
-0.35101374983787537,
0.2273743748664856... | |
<xsl:apply-templates select="self::node()[$vFiltNode]">
<xsl:with-param name="pFiltNode" select="$vFiltNode"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
```
When this transformation... | [
0.11166942864656448,
-0.2779558002948761,
0.4799415171146393,
-0.07913421094417572,
-0.29718947410583496,
0.08250729739665985,
0.22692830860614777,
-0.9077288508415222,
-0.21559551358222961,
-0.7676532864570618,
-0.3288143575191498,
0.36683890223503113,
-0.40854206681251526,
-0.22806243598... | |
<E2>V2</E2>
<E3>V3</E3>
<E5>
<SE51>SEV1</SE51>
<SE511>SEV11</SE511>
<SE52>SEV2</SE52>
</E5>
<E6>
<SE61>SEV3</SE61>
<SE62>SEV4</SE62>
</E6>
</Root>
```
**the wanted result is produced**:
```
<Root>
<E1 a="1">V1</E1>
<E2>V2</E2>
<E3>V3</E3>
<... | [
-0.31408125162124634,
-0.0799466073513031,
-0.0012561706826090813,
-0.11333910375833511,
-0.10859305411577225,
0.24734249711036682,
0.1911727637052536,
-0.8877795934677124,
-0.09240792691707611,
-0.5946446657180786,
-0.46531131863594055,
0.11644979566335678,
0.10341478884220123,
0.06715310... | |
<SE52>SEV2</SE52>
</E5>
<E6>
<SE61>SEV3</SE61>
<SE62>SEV4</SE62>
</E6>
</Root>
```
**Do notice the following details** of this solution:
1. Templates are applied only to elements that have a matching node in the filter-document and also to all text nodes of such elements.
2. The template ... | [
0.4125649929046631,
-0.3419457972049713,
0.3388185501098633,
0.052741557359695435,
0.12641185522079468,
-0.22569164633750916,
0.34227266907691956,
-0.668358564376831,
-0.044037386775016785,
-0.7754778265953064,
0.025579527020454407,
0.3024106025695801,
-0.2352999895811081,
-0.2607384324073... | |
We have a Hibernate/Spring application that have the following Spring beans:
```
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" />
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" />
```
When wiring the ... | [
0.12294898182153702,
0.10148541629314423,
0.24852241575717926,
0.0001903074444271624,
0.017413374036550522,
-0.023595772683620453,
0.4579467177391052,
-0.31821486353874207,
-0.23427684605121613,
-0.6791715621948242,
-0.04524512588977814,
0.5176094770431519,
-0.44817543029785156,
0.02204426... | |
the entities/relationships. No bean definitions are declared in the applicationContext.xml for the domain class that is related to the problem. It is a pojo that should have a static factory method and a private constructor.
How can we make Hibernate (org.springframework.spring-orm.hibernate3 classes i guess) make use... | [
0.0727466344833374,
0.24294330179691315,
0.45189958810806274,
0.12760084867477417,
0.006281227804720402,
-0.019678611308336258,
0.35640037059783936,
-0.12663529813289642,
-0.3193695843219757,
-0.3882046937942505,
0.09272389858961105,
0.5437988042831421,
-0.503801703453064,
0.18376368284225... | |
question. :)
While I haven't used Spring, I have used Hibernate in a project which has classes which must either be instantiated by factory methods or through multiple argument constructors.
You can do this through an Interceptor, which is a class which listens in to several key hibernate events, such as when an objec... | [
0.12861080467700958,
-0.22584761679172516,
0.3158753514289856,
0.017677824944257736,
-0.2814948558807373,
-0.14403708279132843,
0.24859359860420227,
-0.3575831353664398,
-0.017525052651762962,
-0.44052907824516296,
-0.17578159272670746,
0.5416116118431091,
-0.4052780866622925,
0.0512992367... | |
if(entityName.equals(Foo.class.getName())
return Foo.create();
return null;
}
}
```
I'm a little suprised that you are having issues with Hibernate not instantiating objects with a non visible constructor, considering that it can be worked around with reflection and I haven't had that issue i... | [
0.13179458677768707,
-0.209511399269104,
0.19262048602104187,
-0.2170931100845337,
-0.18877990543842316,
-0.43659958243370056,
0.39245930314064026,
-0.11734994500875473,
-0.016147905960679054,
-0.49951061606407166,
0.008182916790246964,
0.6434605121612549,
-0.43562009930610657,
0.054327685... | |
How can I assert my [Ajax](http://en.wikipedia.org/wiki/Ajax_%28programming%29) request and test the JSON output from Ruby on Rails functional tests?
In Rails >= 5
-------------
Use [`ActionDispatch::TestResponse#parsed_body`](https://www.apidock.com/rails/v6.0.0/ActionDispatch/TestResponse/parsed_body).
Example:
``... | [
-0.0006369589827954769,
0.1315706968307495,
0.2405623495578766,
-0.04216943681240082,
-0.5056964755058289,
-0.021501431241631508,
0.32162219285964966,
-0.6536496877670288,
0.08344298601150513,
-0.5617079734802246,
-0.02109561674296856,
0.545471727848053,
-0.005958992056548595,
-0.228859409... | |
In the setup method to a JUnit test case I'm working on I need it to run a sql script on my database before each test case, and then a rollback afterwards.
I have tried using a tokenizer, which added each SQL command to a batch and then executing them. But I can't get working.
So my question is if there is some standa... | [
0.39185070991516113,
0.10424347221851349,
-0.12917622923851013,
-0.013063464313745499,
-0.16947652399539948,
-0.06447066366672516,
0.01223742961883545,
-0.1226181834936142,
-0.053753532469272614,
-0.6325242519378662,
0.10554954409599304,
0.5029715299606323,
-0.4918285012245178,
-0.10301180... | |
mocking object, you can check, if your sql connector class called the right statements.
If you want to test the SQL statement, its results and so on, you should use [DBUnit](http://www.dbunit.org), as Aaron said. | [
0.31682729721069336,
0.41193687915802,
-0.08122885972261429,
0.11296945810317993,
-0.4288893938064575,
0.09358034282922745,
0.599820077419281,
0.3365879952907562,
-0.08867540210485458,
-0.30284789204597473,
0.4246973395347595,
0.22110795974731445,
-0.3226330280303955,
0.4025445282459259,
... | |
How do I create a view dynamically in SQL Server using C#?
Something like this, obviously your connection code will be different (better):
```
SqlConnection conn = null;
conn = new SqlConnection("yourConnectionString");
conn.Open();
string strSQLCommand = "CREATE VIEW vw_YourView AS SELECT YOurColumn FROM YourTable";
... | [
0.14247335493564606,
-0.2129063606262207,
0.817732036113739,
-0.08378944545984268,
-0.09312377125024796,
-0.03281576186418533,
0.20502373576164246,
-0.025838064029812813,
-0.20836511254310608,
-0.6791850328445435,
-0.046500932425260544,
0.8413450121879578,
-0.4195381700992584,
0.3764463663... | |
I have a series of forms that I need a user to complete in sequence, which is perfect for the formwizard app. However, I've some need of the admin application also and would like to set the whole thing up to trigger several forms within the admin app.
Is it possible/easy to integrate a 'formwizard' into the admin app... | [
0.5140480399131775,
-0.009554309770464897,
0.3050164580345154,
0.18299740552902222,
-0.039732981473207474,
0.05595095455646515,
0.09943436831235886,
-0.33280637860298157,
-0.011833501979708672,
-0.8326185941696167,
0.2224329560995102,
0.5343528985977173,
-0.15954679250717163,
-0.1921966522... | |
many forms, which would have been the role of formwizard.
What I have:
Form 1: 10 yes/no questions (each yes corresponds to a new form that needs to be filled out)
if yes is ticked, the corresponding forms are put into a formwizard and displayed for the user to complete.
---
However the suggested option (modelf... | [
0.321552574634552,
-0.0021144887432456017,
0.4750405251979828,
0.21583624184131622,
-0.10235174745321274,
0.1466064155101776,
0.35406386852264404,
-0.3037470877170563,
-0.0010301334550604224,
-0.7412154674530029,
-0.019568081945180893,
0.42615482211112976,
0.0764550045132637,
-0.2872076928... | |
"trigger several forms within the admin app."
The admin app at its core is basically just a wrapper around a bunch of stock ModelForms, so if you just build a formwizard using ModelForms and slap the admin styling on it, you may be 80% of the way there. | [
0.5170403718948364,
-0.007763934321701527,
0.5602114796638489,
0.23013262450695038,
0.1426098495721817,
-0.17650160193443298,
-0.028892947360873222,
-0.34159785509109497,
0.2574276626110077,
-0.4216748774051666,
0.32537344098091125,
0.5233302712440491,
0.057704679667949677,
-0.146539002656... | |
Continuing [my investigation](https://stackoverflow.com/questions/308481/writing-the-f-recursive-folder-visitor-in-c-seq-vs-ienumerable) of expressing F# ideas in C#, I wanted a pipe forward operator. For anything wrapped in a IEnumerable, we already have it, as you can .NextFunc() to your heart's content. But for exam... | [
-0.030025549232959747,
-0.2004748433828354,
0.4813315272331238,
-0.20106469094753265,
0.03698291629552841,
0.1085391417145729,
0.29773348569869995,
-0.4452276825904846,
-0.22281894087791443,
-0.6541375517845154,
-0.10671434551477432,
0.42203429341316223,
-0.3171987235546112,
-0.02088951319... | |
T val, Func<T, R> func) where T : class where R : class
{ return val!=null?func(val):null; }
```
You can then write something like:
```
Func<string, string[]> readlines = (f) => File.ReadAllLines(f);
Action<string, string> writefile = (f, s) => File.WriteAllText(f, s);
Action<string, string> RemoveLinesContaining ... | [
0.13507790863513947,
-0.6198368668556213,
0.7699929475784302,
-0.3655105531215668,
0.004262929316610098,
0.1160350888967514,
0.22378450632095337,
-0.6819170713424683,
-0.2537873387336731,
-0.644313633441925,
-0.37244969606399536,
0.6602028012275696,
-0.5096096992492676,
-0.1788809448480606... | |
.Pipe((s) => writefile(file, s));
};
```
(I know, Filter == Where in C#, and Fold==Aggregate, but I wanted to roll my own, and I could have done WriteAllLines, but that's not the point)
EDIT: corrections as per Earwicker's comment (if I've understood correctly).
I haven't bothered with a raw pipe, but I have tri... | [
0.30665817856788635,
0.06777728348970413,
0.3308863341808319,
-0.21405145525932312,
0.16268011927604675,
0.10774876177310944,
0.20623789727687836,
-0.32334184646606445,
0.1723514199256897,
-0.8747934699058533,
0.10367375612258911,
0.6252792477607727,
-0.38348501920700073,
0.023276221007108... | |
where TIn : class
where TOut: class
{
if (v == null)
return null;
return | [
0.3529755473136902,
-0.1316143423318863,
-0.29593977332115173,
-0.33224397897720337,
-0.13048583269119263,
0.47122737765312195,
0.5507891178131104,
-0.2450191080570221,
0.15553756058216095,
-0.27397316694259644,
-0.15317682921886444,
0.6117761731147766,
-0.03631490468978882,
0.224562674760... | |
f(v);
}
}
```
Then suppose you have an object model that lets you lookup a RecordCompany by name, and then lookup a Band within that RecordCompany, a Member of the Band, and any of these might return null, so this might throw a NullReferenceException:
```
var pixiesDrummer = Music.GetCompany("4ad.com")
... | [
0.15366441011428833,
-0.113423191010952,
0.10832645744085312,
0.05006431043148041,
0.42878323793411255,
-0.035319823771715164,
0.3356240391731262,
-0.27708491683006287,
-0.4297601878643036,
-0.2037695050239563,
-0.2669353783130646,
0.5406054854393005,
-0.4240264296531677,
0.183116406202316... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.