QuestionId
int64
63.3k
59.1M
AnswerCount
int64
0
11
Tags
stringlengths
3
101
CreationDate
stringlengths
23
23
AcceptedAnswerId
stringlengths
6
8
Title
stringlengths
15
150
Body
stringlengths
58
29.2k
Lable
stringclasses
5 values
63,295
3
<redirect><webserver><sunone>
2008-09-15T14:16:54.947
null
How do I get sun webserver to redirect from /
<p>I have Sun webserver iws6 (iplanet 6) proxying my bea cluster. My cluster is under /portal/yadda. I want anyone who goes to </p> <pre><code>http://the.domain.com/ </code></pre> <p>to be quickly redirected to </p> <pre><code>http://the.domain.com/portal/ </code></pre> <p>I have and index.html that does a post and redirect, but the user sometimes sees it. Does anyone have a better way?</p> <p>Aaron</p> <p>I have tried the 3 replies below. None of them worked for me. Back to the drawing board. A</p>
No
295,832
2
<xml><vb.net>
2008-11-17T15:18:02.433
295891
Embed XML element in inline VB code
<p>Consider the following code in VB9:</p> <pre><code>Dim text = "Line1&lt;br/&gt;Line2" Dim markup = &lt;span&gt;&lt;%= text %&gt;&lt;/span&gt;.ToString </code></pre> <p>While I was hoping markup would end up being <code>&lt;span&gt;Line1&lt;br/&gt;Line2&lt;/span&gt;</code>, it actually evaluates to <code>&lt;span&gt;Line1&amp;lt;br/&amp;gt;Line2&lt;/span&gt;</code>.</p> <p>Is there any way to get the value of the variable not to be HTML encoded?</p> <p>P.S.: This is an oversimplified example of what I'm trying to do. I know this could be rewritten a number of ways to make it work, but the way my code is constructed, un-encoding the variable would be optimal. If that's not possible, then I'll go down a different road.</p> <p>More detail: The "text" is coming from a database, where a user can enter free-form text, with carriage returns. The output is HTML, so somehow I need to get the value from the database and convert the carriage returns to line breaks.</p>
No
310,121
2
<c#><gridview><boundfield><headertext>
2008-11-21T20:38:57.793
310145
How do I break the a BoundField's HeaderText
<p>In HTML in the td of a table you can break text by using <code>&lt;BR&gt;</code> between the words. This also works in the HeaderText of a TemplateItem but not the HeaderText of a BoundField. How do I break up the Header text of a BoundField.</p>
No
355,848
7
<javascript><oop>
2008-12-10T12:06:39.020
355878
How can I emulate "classes" in JavaScript? (with or without a third-party library)
<p>How can I emulate classes (and namespaces) in JavaScript?</p> <p>I need to create a JavaScript library and have limited experience with the language. I always thought that it had native support for classes, but it is less related to Java than I had assumed. It seems that everything in JavaScript is actually a function.</p> <p>What I have found out so far makes a lot of sense with it being a dynamic weakly typed language, but this makes it a bit of a departure for people who are used to having a strongly typed language and using a compiler to spot our errors :)</p> <p>I mainly work in C# and Java, and was hoping for something syntacticaly similar so the library would look familiar for our other C# developers that will have to maintain it.</p> <p>I have the following sort of code which works, but I was wondering what other developer's takes would be on this. What are the alternatives? Is there a way that is better? Is there a way that is more readable?</p> <p>I understand that what I want is something similar to C# or Java when I should just accept the fact that this <strong>is JavaScript</strong>, but my aim is to try to ease the learning curve for other developers by making it more familiar and intuitive for them.</p> <pre><code>//Perform the namespace setup (this will actually be done with checking //in real life so we don't overwrite definitions, but this is kept short //for the code sample). var DoctaJonez = new function(); DoctaJonez.Namespace1 = new function(); /** * Class description. */ DoctaJonez.Namespace1.SomeClass = function() { /** * Public functions listed at the top to act like a "header". */ this.publicFunction = privateFunction; /** * Private variables next. */ var privateVariable; /** * Finally private functions. */ function privateFunction() { } } //Create an instance of the class var myClass = new DoctaJonez.SomeClass(); //Do some stuff with the instance myClass.publicFunction(); </code></pre>
No
447,171
1
<ssl>
2009-01-15T15:30:14.030
null
Find out SSL version (V2 or V3)
<p>How can one tell if the SSL communication between a client and a server is SSLv2 or SSLv3?</p>
No
534,119
8
<svn><version-control><cvs>
2009-02-10T20:43:55.263
534254
Semi-editable Files (eg config files) and version control - best practices?
<p>So, I killed the build today by checking in a config file. It knows where the server is (think SQL server or the like), and I've been working against the server which runs on my box. Normally, or rather, under other circumstances, we'd run against the central server. The daily build, of course, didn't find 'my' server, hence the breakage. Then again, editing the config file to point to the 'normal' server before the checkin, and editing it again after checkin is tendious.</p> <p>I've been tempted to have VC just ignore the config file, so that it doesn't get checked in accidentally. On the other hand, the repository should contain a clean, usable version of the file. I can't possibly ignore it and have it checked in at the same time, now, could I?</p> <p>So, what I'm looking for would be a way to have a file which, errr, which checks out, but never checks in. At least in the most common case - should the config file change significantly, some special procedure to get the new version into the repository would be doable.</p> <p>If You folks have come across this problem before, I'd be interested about any solutions You have found. As long as they don't break the build, that is ;)</p>
No
666,828
6
<sql-server><sql-server-2005><tsql><sql>
2009-03-20T16:09:49.430
666878
Create a new db user in SQL Server 2005
<p>how do you create a new database user with password in sql server 2005?</p> <p>i will need this user/password to use in the connection string eg:</p> <pre><code>uid=*user*;pwd=*password*; </code></pre>
No
710,127
2
<objective-c><cocoa>
2009-04-02T15:09:58.250
null
Observing changes of derived properties: CALayer KVO example
<p>Is there a way to observe changes in derived properties? For example, I want to know when a CALayer has been added as a sublayer so that I can adjust its geometry relative to its (new) parent.</p> <p>So, I have a subclassed CALayer, say CustomLayer, and I figured I could register an observer for the property in init:</p> <pre><code>[self addObserver:self forKeyPath:@"superlayer" options:0 context:nil] </code></pre> <p>and implement <code>observeValueForKeyPath:ofObject:change:context</code>. Nothing ever happens because, presumably, superlayer is a derived property (the attr dictionary stores an opaque ID for the parent). Similarly, I can't subclass <code>setSuperlayer:</code> because it is never called. In fact, as far as I can tell there are no instance methods called or public properties set on the sublayer when a parent does <code>[self addSublayer:aCustomLayer]</code>. </p> <p>Then I thought, OK, I'll subclass addSublayer like this:</p> <pre><code>- (void)addSublayer:(CALayer *)aLayer { [aLayer willChangeValueForKey:@"superlayer"]; [super addSublayer:aLayer]; [aLayer didChangeValueForKey:@"superlayer"]; } </code></pre> <p>but still nothing! (Perhaps it's a clue that when I make a simple standalone test class and use the <code>will[did]ChangeValueForKey:</code> then it works.) This is maybe a more general Cocoa KVO question. What should I be doing? Thanks in advance!</p>
No
6,704,769
3
<entity-framework><asp.net-mvc-2>
2011-07-15T09:01:25.847
null
Entity Framework - trying to insert null values when creating a new object
<p>I'm having the same problem that a few of you have had - when trying to insert a new object, EF inserts null values for some of their properties, and the insert fails.</p> <p>First let me describe the structure of our DB. Its an event management system, in which each event needs to be associated with a practice group, stored in a cache table but ultimately fetched from Active Directory. I manually created the join table - is that a problem? Anyway, so Event has a foreign key pointing to EventPracticeGroup, which has a foreign key pointing to PracticeGroupCache. PracticeGroupCache also has a RegionId pointing to the Regions table.</p> <p>The problem comes when trying to insert a new EventPracticeGroup object. Below is the code I'm currently using:</p> <pre><code>var eventPracticeGroup = new EventPracticeGroup(); if (TryUpdateModel&lt;EventPracticeGroup&gt;(eventPracticeGroup)) { /* var eventId = EventScheduleRepository.GetById(Convert.ToInt32(Request.QueryString["EventScheduleId"])).EventId; eventPracticeGroup.Event = EventRepository.GetById(eventId); eventPracticeGroup.PracticeGroupCache = PracticeGroupCacheRepository.GetById(eventPracticeGroup.PracticeGroupCacheId); eventPracticeGroup.PracticeGroupCache.Region = RegionRepository.GetById(eventPracticeGroup.PracticeGroupCache.RegionId); EventPracticeGroupRepository.Add(eventPracticeGroup); */ var eventId = EventScheduleRepository.GetById(Convert.ToInt32(Request.QueryString["EventScheduleId"])).EventId; var theEvent = new Event() { Id = eventId }; EventRepository.Repository.UnitOfWork.Context.AttachTo("Events",theEvent); var practiceGroupCache = new PracticeGroupCache() { Id = eventPracticeGroup.PracticeGroupCacheId }; practiceGroupCache.Region = new Region() { Id = eventPracticeGroup.PracticeGroupCache.RegionId }; eventPracticeGroup.PracticeGroupCache = practiceGroupCache; EventPracticeGroupRepository.Add(eventPracticeGroup); EventPracticeGroupRepository.Save(); return RedirectToAction("Index"); } </code></pre> <p>Anyway... as you can see, I've just tried using stub objects (no help), and I've also tried actually fetching and setting the objects. The error I get is:</p> <blockquote> <p>Cannot insert the value NULL into column 'Name', table 'XXXX.dbo.Regions'; column does not allow nulls. INSERT fails. The statement has been terminated.</p> </blockquote> <p>Obviously name is not a key field. I have checked the EDMX XML - only the Id (primary key columns) have StoreGeneratedPattern set to Identity, as they should (they are int32 identity columns). Not a single foreign key has StoreGeneratedPattern set to identity.</p> <p>if I set Regions.Name to allow nulls, PracticeGroupCaches.Description throws the same error. It seems that every linked object gets set to null. I did have a look with the debugger, when I used the now commented out code, nothing was null and everything had a value. I even got the RegionRepository to return all of the regions, just to see if one of them somewhere had a null name. None did. There are only 2 in my test DB. Our object context is shared per HTTP request.</p> <p>Please can anyone help. At this point I would settle for using the dirtiest workaround as long as it worked.</p> <p>Regards, Jonathan.</p>
No
6,754,944
5
<mysql><database><ubuntu>
2011-07-19T22:36:44.437
6754981
where is my database saved when I create it in MySQL?
<p>I'm completely new to ubuntu and MySQL and I created a new database via:</p> <pre><code>mysql -u root -p create database mydb; </code></pre> <p>Now, in which directory is this database saved and how do I specify where it's saved when I create it?</p>
No
6,779,291
1
<c#><.net><silverlight><xaml><windows-phone-7>
2011-07-21T16:15:30.047
null
Windows Phone ControlTemplate & Converter : problem loading BitmapImage from Image Resource in assembly
<p>This is basically a follow up to my <a href="https://stackoverflow.com/questions/6667916/windows-phone-7-image-checkbox">previous</a> question. I've managed to make this work with the templates, however, I want to make it a bit generic, so that I don't have to go around repeating code all over the place</p> <p>The working version (hardcoded) is this :</p> <pre><code> &lt;UserControl.Resources&gt; &lt;ControlTemplate x:Key="TrebleCheckboxImageTemplate" TargetType="CheckBox"&gt; &lt;Image x:Name="imgTreble" MinWidth="100" Source="Images/treble_checked.png"&gt; &lt;VisualStateManager.VisualStateGroups&gt; &lt;VisualStateGroup x:Name="CheckStates"&gt; &lt;VisualState x:Name="Checked"&gt; &lt;Storyboard&gt; &lt;ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgTreble" Storyboard.TargetProperty="(Image.Source)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="00:00:00"&gt; &lt;DiscreteObjectKeyFrame.Value&gt; &lt;BitmapImage UriSource="Images/treble_checked.png" /&gt; &lt;/DiscreteObjectKeyFrame.Value&gt; &lt;/DiscreteObjectKeyFrame&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;VisualState x:Name="Unchecked"&gt; &lt;Storyboard&gt; &lt;ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgTreble" Storyboard.TargetProperty="(Image.Source)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="00:00:00"&gt; &lt;DiscreteObjectKeyFrame.Value&gt; &lt;BitmapImage UriSource="Images/treble_unchecked.png" /&gt; &lt;/DiscreteObjectKeyFrame.Value&gt; &lt;/DiscreteObjectKeyFrame&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;VisualState x:Name="Indeterminate"/&gt; &lt;/VisualStateGroup&gt; &lt;/VisualStateManager.VisualStateGroups&gt; &lt;/Image&gt; &lt;/ControlTemplate&gt; &lt;/UserControl.Resources&gt; &lt;StackPanel x:Name="LayoutRoot" Background="{StaticResource PhoneForegroundBrush}" Orientation="Horizontal"&gt; &lt;CheckBox Height="72" HorizontalAlignment="Left" Background="White" VerticalAlignment="Top" Template="{StaticResource TrebleCheckboxImageTemplate}" Margin="0,0,10,0" &gt; &lt;Custom:Interaction.Triggers&gt; &lt;Custom:EventTrigger EventName="Click"&gt; &lt;GalaSoft_MvvmLight_Command:EventToCommand CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" Command="{Binding TreblePressedCommand}"/&gt; &lt;/Custom:EventTrigger&gt; &lt;/Custom:Interaction.Triggers&gt; &lt;/CheckBox&gt; &lt;/StackPanel&gt; </code></pre> <p>Of course, the image paths are hardcoded. So, i wanted to make it generic, so that you could just instantiate a checkbox, tell it it's image, and the template would be the same for all.</p> <p>I created an ImageCheckbox control class :</p> <pre><code>public class ImageCheckbox : CheckBox { /// &lt;summary&gt; /// The &lt;see cref="CheckedImagePath" /&gt; dependency property's name. /// &lt;/summary&gt; public const string CheckedImagePathPropertyName = "CheckedImagePath"; /// &lt;summary&gt; /// Gets or sets the value of the &lt;see cref="CheckedImagePath" /&gt; /// property. This is a dependency property. /// &lt;/summary&gt; public string CheckedImagePath { get { return (string)GetValue(CheckedImagePathProperty); } set { SetValue(CheckedImagePathProperty, value); } } /// &lt;summary&gt; /// Identifies the &lt;see cref="CheckedImagePath" /&gt; dependency property. /// &lt;/summary&gt; public static readonly DependencyProperty CheckedImagePathProperty = DependencyProperty.Register( CheckedImagePathPropertyName, typeof(string), typeof(ImageCheckbox), new PropertyMetadata(null)); /// &lt;summary&gt; /// The &lt;see cref="UnCheckedImagePath" /&gt; dependency property's name. /// &lt;/summary&gt; public const string UnCheckedImagePathPropertyName = "UnCheckedImagePath"; /// &lt;summary&gt; /// Gets or sets the value of the &lt;see cref="UnCheckedImagePath" /&gt; /// property. This is a dependency property. /// &lt;/summary&gt; public string UnCheckedImagePath { get { return (string)GetValue(UnCheckedImagePathProperty); } set { SetValue(UnCheckedImagePathProperty, value); } } /// &lt;summary&gt; /// Identifies the &lt;see cref="UnCheckedImagePath" /&gt; dependency property. /// &lt;/summary&gt; public static readonly DependencyProperty UnCheckedImagePathProperty = DependencyProperty.Register( UnCheckedImagePathPropertyName, typeof(string), typeof(ImageCheckbox), new PropertyMetadata(null)); } </code></pre> <p>I created a converter (because I ran into the problem that I must convert the string to be the Uri for the image source)</p> <pre><code>public class StringToImageConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { return null; } if (!UriParser.IsKnownScheme("pack")) { UriParser.Register(new GenericUriParser (GenericUriParserOptions.GenericAuthority), "pack", -1); } if (value is string) { var image = new BitmapImage(); image.UriSource = new Uri(String.Format(@"pack://application:,,/Images/{0}", value as string)); //image.UriSource = new Uri(String.Format(@"pack://application:,,,/Adagio.Presentation;component/Images/{0}", value as string),UriKind.Absolute); image.ImageFailed += new EventHandler&lt;System.Windows.ExceptionRoutedEventArgs&gt;(image_ImageFailed); image.ImageOpened += new EventHandler&lt;System.Windows.RoutedEventArgs&gt;(image_ImageOpened); return image; } if (value is Uri) { var bi = new BitmapImage {UriSource = (Uri) value}; return bi; } return null; } void image_ImageOpened(object sender, System.Windows.RoutedEventArgs e) { throw new NotImplementedException(); } void image_ImageFailed(object sender, System.Windows.ExceptionRoutedEventArgs e) { throw new NotImplementedException(); } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } </code></pre> <p>you can see that the converter has been tried with thousands of different combinations, none of them work... Then, the new xaml :</p> <pre><code>&lt;ControlTemplate x:Key="CheckboxImageTemplate" TargetType="Controls:ImageCheckbox"&gt; &lt;Image x:Name="imgForTemplate" MinWidth="100" Source="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CheckedImagePath, Converter={StaticResource stringToImageConverter}}"&gt; &lt;!-- &lt;VisualStateManager.VisualStateGroups&gt; &lt;VisualStateGroup x:Name="CheckStates"&gt; &lt;VisualState x:Name="Checked"&gt; &lt;Storyboard&gt; &lt;ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgForTemplate" Storyboard.TargetProperty="(Image.Source)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="00:00:00"&gt; &lt;DiscreteObjectKeyFrame.Value&gt; &lt;BitmapImage UriSource="{Binding RelativeSource={RelativeSource TemplatedParent},Path=CheckedImagePath, Converter={StaticResource stringToImageConverter}}" /&gt; &lt;/DiscreteObjectKeyFrame.Value&gt; &lt;/DiscreteObjectKeyFrame&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;VisualState x:Name="Unchecked"&gt; &lt;Storyboard&gt; &lt;ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="imgForTemplate" Storyboard.TargetProperty="(Image.Source)"&gt; &lt;DiscreteObjectKeyFrame KeyTime="00:00:00"&gt; &lt;DiscreteObjectKeyFrame.Value&gt; &lt;BitmapImage UriSource="{Binding RelativeSource={RelativeSource TemplatedParent},Path=UnCheckedImagePath, Converter={StaticResource stringToImageConverter}}" /&gt; &lt;/DiscreteObjectKeyFrame.Value&gt; &lt;/DiscreteObjectKeyFrame&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;VisualState x:Name="Indeterminate"/&gt; &lt;/VisualStateGroup&gt; &lt;/VisualStateManager.VisualStateGroups&gt;--&gt; &lt;/Image&gt; &lt;/ControlTemplate&gt; &lt;StackPanel x:Name="LayoutRoot" Background="{StaticResource PhoneForegroundBrush}" Orientation="Horizontal"&gt; &lt;Controls:ImageCheckbox CheckedImagePath="treble_checked.png" UnCheckedImagePath="treble_unchecked.png" Height="72" HorizontalAlignment="Left" VerticalAlignment="Top" Template="{StaticResource CheckboxImageTemplate}" Margin="0,0,10,0" &gt; &lt;Custom:Interaction.Triggers&gt; &lt;Custom:EventTrigger EventName="Click"&gt; &lt;GalaSoft_MvvmLight_Command:EventToCommand CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" Command="{Binding TreblePressedCommand}"/&gt; &lt;/Custom:EventTrigger&gt; &lt;/Custom:Interaction.Triggers&gt; &lt;/Controls:ImageCheckbox&gt; &lt;/StackPanel&gt; </code></pre> <p>I've tried to make it all work at first, but I don't seem to even get the first Source property of the image to load. The commented part (VisualStateManager states) doesn't work either, but i think it must be the same problem.. in this case I'd need a converter to return an Uri instead of a BitmapImage, because UriSource is of type Uri, and Source is of type Image. I'm getting errors in the converter, where I can't load the images (always falling into the image_imageFailed event). I've set the images as resources in the assembly... what am i doing wrong?? this is driving me crazy!!!!</p> <p>[EDIT] : I've tried doing as suggested, and changed the dependency property to Uri, but I can't get it to work If i say</p> <pre><code>&lt;Controls:ImageCheckbox CheckedImagePath="Images/treble_checked.png" UnCheckedImagePath="Images/treble_unchecked.png" Height="72" HorizontalAlignment="Left" VerticalAlignment="Top" Template="{StaticResource CheckboxImageTemplate}" Margin="0,0,10,0" &gt; </code></pre> <p>and in the template's VisualState :</p> <pre><code>&lt;BitmapImage UriSource="{Binding Path=UnCheckedImagePath, RelativeSource={RelativeSource TemplatedParent}}" /&gt; </code></pre> <p>it tells me that the xaml isn't valid and get an error. If i use TemplateBinding like this :</p> <pre><code>&lt;BitmapImage UriSource="{TemplateBinding UnCheckedImagePath}" /&gt; </code></pre> <p>it doesn't complain, but the image doesn't load (appear blank). I think i'm getting close, but still haven't found the solution...</p> <p>[EDIT 2] : last try...</p> <p>usage :</p> <pre><code>&lt;StackPanel x:Name="LayoutRoot" Background="{StaticResource PhoneForegroundBrush}" Orientation="Horizontal"&gt; &lt;Controls:ImageCheckbox Style="{StaticResource TheImageCheckboxStyle}" CheckedImagePath="Images/treble_checked.png" UnCheckedImagePath="Images/treble_unchecked.png" Height="72" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,0,10,0" &gt; &lt;Custom:Interaction.Triggers&gt; &lt;Custom:EventTrigger EventName="Click"&gt; &lt;GalaSoft_MvvmLight_Command:EventToCommand CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" Command="{Binding TreblePressedCommand}"/&gt; &lt;/Custom:EventTrigger&gt; &lt;/Custom:Interaction.Triggers&gt; &lt;/Controls:ImageCheckbox&gt; &lt;/StackPanel&gt; </code></pre> <p>style (trying to copy what you pasted and removing what i thought are unnecessary parts)</p> <pre><code>&lt;UserControl.Resources&gt; &lt;Style x:Key="TheImageCheckboxStyle" TargetType="Controls:ImageCheckbox"&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="CheckBox"&gt; &lt;Grid Background="Transparent"&gt; &lt;VisualStateManager.VisualStateGroups&gt; &lt;VisualStateGroup x:Name="CheckStates"&gt; &lt;VisualState x:Name="Checked"&gt; &lt;Storyboard&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="Visibility"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0"&gt; &lt;DiscreteObjectKeyFrame.Value&gt; &lt;Visibility&gt;Visible&lt;/Visibility&gt; &lt;/DiscreteObjectKeyFrame.Value&gt; &lt;/DiscreteObjectKeyFrame&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="Source"&gt; &lt;!-- Magic! --&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CheckedImagePath}" /&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;VisualState x:Name="Unchecked"&gt; &lt;Storyboard&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="Visibility"&gt; &lt;DiscreteObjectKeyFrame KeyTime="0"&gt; &lt;DiscreteObjectKeyFrame.Value&gt; &lt;Visibility&gt;Visible&lt;/Visibility&gt; &lt;/DiscreteObjectKeyFrame.Value&gt; &lt;/DiscreteObjectKeyFrame&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="Source"&gt; &lt;!-- Magic! --&gt; &lt;DiscreteObjectKeyFrame KeyTime="0" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=UnCheckedImagePath}" /&gt; &lt;/ObjectAnimationUsingKeyFrames&gt; &lt;/Storyboard&gt; &lt;/VisualState&gt; &lt;/VisualStateGroup&gt; &lt;/VisualStateManager.VisualStateGroups&gt; &lt;Grid Margin="{StaticResource PhoneTouchTargetLargeOverhang}"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="*" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Border x:Name="CheckBackground" Width="32" Height="32" HorizontalAlignment="Left" VerticalAlignment="Center" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding Background}" BorderThickness="{StaticResource PhoneBorderThickness}" IsHitTestVisible="False" /&gt; &lt;Rectangle x:Name="IndeterminateMark" Grid.Row="0" Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="{StaticResource PhoneRadioCheckBoxCheckBrush}" IsHitTestVisible="False" Visibility="Collapsed" /&gt; &lt;!-- Magic! Default to UnCheckedImagePath --&gt; &lt;Image x:Name="CheckMark" Width="24" Height="18" HorizontalAlignment="Center" VerticalAlignment="Center" IsHitTestVisible="False" Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=UnCheckedImagePath}" Stretch="Fill" Visibility="Collapsed" /&gt; &lt;ContentControl x:Name="ContentContainer" Grid.Column="1" Margin="12,0,0,0" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /&gt; &lt;/Grid&gt; &lt;/Grid&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre>
No
6,813,415
4
<wix><ignore><heat>
2011-07-25T08:29:01.313
6818334
Ignoring .svn directories with Wix Heat?
<p>I'm using the Heat tool to generate Wix markup to include a large number of files and folders in my setup. This was working fine, but I just realized that since I added the source folder to my Subversion repository, Heat wants to include the .svn folders too.</p> <p>Is there a way to tell Heat not to harvest files or folders that match a given criteria?</p> <p>I am currently using Wix 3.5.</p>
No
6,859,371
3
<jquery><asp.net><ajax>
2011-07-28T13:01:01.990
7084278
AJAX post to ASP.Net web site is missing parameters
<p>I have created an <code>IHttpAsyncHandler</code> that I'm trying to call using AJAX, with jQuery. The call succeeds, but I can't find my parameters on the server. </p> <p>Here is the AJAX call:</p> <pre><code>function deleteViewModel(typename) { var data = { "viewModel": typename, "operation": "delete" }; $.ajax({ type: "POST", url: "&lt;%= GetAppRoot() %&gt;/viewModelGeneration.ashx", contentType: "application/json", cache: false, data: JSON.stringify(data), beforeSend: function (xhr, settings) { $("[id$=processing]").dialog(); }, success: function (data) { alert('Hey, I succeeded.'); }, error: function (xhr, status, err) { alert('Play a sad trombone and frown.'); }, dataType: "json" }); } </code></pre> <p>The call comes through on the server and is handled by my handler, but I do not see either the <code>viewModel</code> or <code>operation</code> parameters there:</p> <pre><code>public void ProcessRequest(HttpContext context) { // Problem is here - no parameters! var viewModelName = context.Request.Params["viewModel"]; var operation = context.Request.Params["operation"]; // Other stuff... GenerateResponse(context.Response, jsonResp); } </code></pre> <p>I popped open Fiddler to get a look at the request being sent from the client, and it appears to me that the parameters are included:</p> <pre><code>POST http://localhost:4638/admin/viewModelGeneration.ashx HTTP/1.1 Host: localhost:4638 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0 Accept: application/json, text/javascript, */* Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Connection: keep-alive Content-Type: application/json; charset=UTF-8 X-Requested-With: XMLHttpRequest Referer: http://localhost:4638/admin/Admin/ResetViewModels.aspx Content-Length: 123 Cookie: ASP.NET_SessionId=ifmof1ole4yv20jr0frqc0lk; .ASPXFORMSAUTH=836B7EEC539B1304126C156CA20A925DD4FF832E628C807A1CA9DCD00833BDFF36D73C39B9CCFE6EA15CF9FED95157A1CA5F07D588F04A8AFE68ABDBBA82FE9FF8507CB2B471340917616818334BCF0D958CB231A1CA3B9D91B05F2897C44663B5E86FC2FFDFE3C325AB66EC3124144F87B6FC8D3F6C7F92F2FEE745EA71EB333D18E35A7FFA992F8F52FEE509043236 Pragma: no-cache Cache-Control: no-cache {"viewModel":"Rds.ViewModels.Updaters.RegionViewModelUpdater, Rds.ViewModels","operation":"delete"} </code></pre> <p>I'm not sure what's happening that they are not coming across on the server. Any thoughts would be appreciated.</p> <p>UPDATE:</p> <p>Someone suggested to me that Request.Params only supports forms-encoded data. I updated my AJAX call to this, but still no parameters server-side:</p> <pre><code>function updateViewModel(typename, operation) { var parms = { "viewModel": typename, "operation": operation }; $.ajax({ type: "POST", url: "/admin/viewModelGeneration.ashx", contentType: "application/json", cache: false, data: parms, beforeSend: function (xhr, settings) { $("[id$=processing]").dialog(); }, success: onSuccess, error: onError }); } </code></pre>
No
6,917,848
1
<cocoa><class><memory-management>
2011-08-02T19:58:59.007
6917888
How do I make a custom unretained class?
<p>How can I make it so that I can get an unretained instance of a class? You can do this with various Cocoa classes like <code>NSString</code> (<code>[NSString string]</code>) or <code>NSArray</code> (<code>[NSArray array]</code>).</p> <p>How can I do this with my custom class so I can call <code>[MyClass class]</code> instead of <code>[[MyClass alloc]init]</code>?</p>
No
6,950,929
1
<proxy>
2011-08-05T03:01:15.857
null
web service returning reliable proxy addresses
<p>I'm looking for a proxy service (free or subscription) that I can programmatically request a random ip from that I can use to automate some manual testing.</p> <p>I'd like the service to have at least hundreds of ips it can select from to avoid repetition.</p> <p>Anonymity is not required but reasonable reliability is. </p> <p>Any recommendations? Searches just seem to lead me to unreliable, popup crazy, free anonymous proxies lists.</p>
No
6,952,777
1
<jquery>
2011-08-05T07:17:57.130
6953349
jQuery mouse position on mousedown() without mousemove()
<p>Can I get cursor position at <code>mousedown(event)</code> event, without using <code>mousemove(event)</code> continuously (thus waisting resources)? <code>event.pageX</code> returns <code>NaN</code> on <code>mousedown</code></p>
No
6,953,094
0
<objective-c>
2011-08-05T07:50:15.040
null
NSArray Sorting not sorting correctly
<p>I have a class (Piece) which has a NSMutableArray property called attachedBlocks.</p> <p>Whenever piece is initialized, 4 Block objects are initialized and placed in attachedBlocks.</p> <p>At the same time, in my controller class, before I release piece, i add all blocks from piece.attachedBlocks to a NSMutableArray in my controller called boardBlocks. So boardBlocks has every block on the board in its array (hence the name).</p> <p>In a method in my constructor, I try sorting this boardBlock array so all objects on the board are sorted from bottom right to top left locations, so a block at (0,0) would come after (0,1), and (1,0) would come after (2,5). </p> <p>Here is the code for my sorting:</p> <pre><code>//In Block.m: - (NSComparisonResult)compareTo:(Block *)other { if (self.location.y &lt; other.location.y &amp;&amp; self.location.x &lt; other.location.x) { return NSOrderedAscending; } else if (self.location.y == other.location.y &amp;&amp; self.location.x == other.location.x) { return NSOrderedSame; } else { return NSOrderedDescending; } } //In my controller.m - (void)sortTheArray { NSArray *sortedBlocks = [boardBlocks sortedArrayUsingSelector:@selector(compareTo:)]; for (Block *b in boardBlocks) { NSLog(@"%d, %d", b.location.x, b.location.y); } for (Block *b in sortedBlocks) { NSLog(@"(%d, %d)", b.location.x, b.location.y); } } </code></pre> <p>Like I said before, each time a piece object is made, 4 block objects are initialized one after the other.</p> <p>When I do this after one piece was created and released, sorting works. However, when I try to utilize more than one piece, I get the following result:</p> <p>boardBlocks:</p> <p>(8, 17) (7, 18) (8, 18) (9, 18) (6, 17) (7, 17) (5, 18) (6, 18)</p> <p>The first piece consists of blocks at the first four coordinates. The second piece consists of blocks at the second four coordinates</p> <p>The result after sorting:</p> <p>(6, 18) (5, 18) (7, 17) (6, 17) (9, 18) (8, 18) (7, 18) (8, 17)</p> <p>The result should be:</p> <p>(9, 18) (8, 18) (7, 18) (6, 18) (5, 18) (8, 17) (7, 17) (6, 17)</p> <p>Now, you can see that it correctly sorts each piece one at a time (the top 4 coordinates are sorted correctly, and the last 4 are sorted correctly).. but together, they are not sorted correctly because (9, 18) should come before every other coordinate on there.</p> <p>Does the sorting occur when objects are initialized into an array automagically, or when sortedArrayUsingSelector: is called?</p> <p>I can't wrap my head around why it sorts the first four, then the second four, but not the entire array alltogether.</p>
No
6,955,445
4
<android><sqlite>
2011-08-05T11:21:46.610
6955531
SQLite updation upon android app's update
<p>I have an app released on the android market which uses sqlite and displays data. I want to know if I am sending an update for the app by adding features, should I upload a new database? What happens when users already having my app, click on update? Will the database update on its own? If the users are downloading my app for the first time, they will certainly get the new db content...but what about the existing users?? I want to know if I have to explicitly update the database in the program</p>
No
6,978,312
3
<objective-c><ios><animation><uiview><core-animation>
2011-08-08T06:07:45.560
6993110
iOS Core Animation - Fold a Layer
<p>Using Core Animation, I would like to fold a <code>UIView</code> (i.e. it's <code>CALayer</code>) on it's center. i.e. I would set the anchor point as (0.5,0.5) &amp; fold the layer. This image that I created in Photoshop might give the effect I am looking for - </p> <p><img src="https://i.stack.imgur.com/7hvuu.png" alt="enter image description here"></p> <p>So, what's happening is, the layer is being folded on its center, as the fold is happening a little bit of perspective is applied (the infamous <code>m34</code>!). Initially, the view is parallel in X-Y plane with Z axis looking straight to the user. As the fold is happening, bottom half &amp; top half at the same time move back (with some perspective, to give depth &amp; 3D effect) till the entire layer is (parallel) in X-Z plane. Note that once the layer is parallel in X-Z plane, the user will no longer be able to see the Layer. But that's ok, that's the effect I am looking for. A <code>UIView</code> disappearing by folding on it's center.</p> <p>How would one go about doing this in <code>iOS</code>? Without using 2 different layers (for bottom &amp; for top)? Any help is much appreciated...</p> <p><strong>Update:</strong> As @miamk points out, this is the same UI effect used in <strong>"Our Choice"</strong> App or <strong>"Flipboard"</strong> App.</p> <p><strong>UPDATE:</strong> I have offered bounty on this to get more specific answers. Would love to see - </p> <ol> <li>Code samples.</li> <li>Advise from people who have done something like this. </li> <li>Even the way to achieve this in a detailed fashion (algo) is much appreciated.</li> </ol>
No
7,125,782
1
<ruby-on-rails-3><routes>
2011-08-19T18:26:13.920
7126175
Ruby on Rails, Split Model into Two Controllers/Forms, but update action calling parent
<p>I have a model that for edit/update actions only is logically split into two forms. The model is Venue. I created app/controllers/venues_controller.rb. The two sub-forms are Details and Policies, so I created app/controllers/venues/details_controller.rb and app/controllers/venues/policies_controller.rb, as well as their corresponding views. The child controllers do inherit from VenuesController. I added the venues namespace to my routes, so it now looks like: resources :venues namespace :venues do :details, :policies end</p> <p>The routes work correctly, the correct views load, the "edit" action on the sub-controllers is called correctly. However, in the sub-views, I'm using the RESTful form_for(@venue), so when the form is POSTed (PUT) it is going to venue_path, not venue_details_path.</p> <p>I looked at the docs for form_for and can't figure out a way to keep my sub-forms restful. You can add a token for a namespace a la form_for([:namespace, @model]), but in my case, the model name is the namespace, so it's inverted. </p> <p>I really don't want to split the model itself, since that has other implications that would be harder to address. </p> <p>So far, I see two solutions, both of which I don't like: 1. Let both views POST to VenuesController#update and deal with any differences there (more lame controller code) 2. Use form_tag and _tag helpers (more lame view code)</p> <p>Am I missing something obvious? Is there something different I can do in the routes, or is there another way to call form_for? </p> <p>I've scanned some posts about Presenter and Conductor patterns but they don't seem to fit this problem. I've read a few stackoverflow threads about whether creating two controllers for one model koscher (it is), but nothing about this specific issue.</p>
No
7,271,661
3
<algorithm><crc>
2011-09-01T14:17:05.883
7273055
CRC divisor calculation
<p>Im trying to understand CRC and I'm getting confused as how to calculate the 'divisor'.</p> <p>In the <a href="http://en.wikipedia.org/wiki/Cyclic_redundancy_check#Computation_of_CRC" rel="noreferrer">example on wikipedia</a> the divisor is 11 (1011) for input of 11010011101100</p> <pre><code>11010011101100 000 &lt;--- input left shifted by 3 bits 1011 &lt;--- divisor (4 bits) = x³+x+1 ------------------ 01100011101100 000 &lt;--- result </code></pre> <p>How is the divisor calculated? In this example (x³+x+1) x is 2? Where did the 2 come from?</p>
No
7,442,099
1
<ruby-on-rails><ruby-on-rails-3><paypal><activemerchant>
2011-09-16T08:37:02.857
null
active_merchant: A field was longer or shorter than the server allows
<p>I'm implementing paypal direct payment using activemerchant Following is the code</p> <pre><code>def credit_card_details credit_card = ActiveMerchant::Billing::CreditCard.new( :first_name =&gt; 'Bob', :last_name =&gt; 'Bobsen', :number =&gt; '4242424242424242', :month =&gt; '8', :year =&gt; '2012', :verification_value =&gt; '123') errors.add(:expire_year, "Credit card expired") if credit_card.expired? errors.add(:cc_number, "invalid credit card details") unless credit_card.valid? if credit_card.valid? # Capture $10 from the credit card amount = 1000 response = PAYPAL_GATEWAY.purchase(amount, credit_card) if response.success? puts "Successfully charged $#{sprintf("%.2f", amount / 100)} to the credit card #{credit_card.display_number}" else raise StandardError, response.inspect end end end </code></pre> <p>I was trying with other credit card details but it was causing "A field was longer or shorter than the server allows" this error. So I replaced cc details with one specified in active_merchants github page still no luck. I dont understand what is wrong?</p>
No
7,468,149
1
<eclipse><eclipse-rcp><xtext>
2011-09-19T08:23:36.633
13491190
XText in a RCP product
<p>we want to provide the users of our RCP product with a textual editor for our model. Accordingly, we created an EMF model and a XText grammar. The problem is that our RCP app does not the Eclipse IDE's project structure (i.e., we do not have any workspaces or builders), hence we have some troubles in making the XText editor work... </p> <p>does anybody have some suggestions? </p> <p><strong>[EDIT to clarify my question]</strong></p> <p>I have some plugins with the EMF model &amp; XText stuff. If I run those plugins in a "standard" eclipse product, I am able to create and edit textual instances of my model (like in the default XText demo).</p> <p>However, I need to go a step further: those plugins are required in a RCP product I'm working on. This product does <strong>NOT</strong> leverage the project management of eclipse. Accordingly, my RCP cannot add the XText nature to its projects, hence the default XText editor are not properly working.</p> <p>When I searched for solutions, I only found links dated 2009 (which is before XText 2.0). Additionally, there is a bug opened on this issue ( <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=289212" rel="noreferrer">https://bugs.eclipse.org/bugs/show_bug.cgi?id=289212</a> ) but the last comment was made roughly one year ago...</p>
No
7,471,751
2
<asp.net><asp.net-mvc-3><url-routing><asp.net-mvc-areas>
2011-09-19T13:31:49.047
7471892
asp.net mvc 3 areas and url routing configuration
<p>I have problem with create ulr routing for asp.net mvc3 application.</p> <p>My project has this structure : </p> <ul> <li>Areas <ul> <li>EmployeeReport <ul> <li>Controllers <ul> <li>Report </li> </ul></li> <li>Views <ul> <li>Report <ul> <li>List </li> <li>....</li> </ul></li> </ul></li> </ul></li> </ul></li> <li>Controllers <ul> <li>Login </li> </ul></li> <li>Viwes <ul> <li>Login <ul> <li>... </li> </ul></li> </ul></li> </ul> <p>EmployeeReportAreaRegistration.cs : <code></p> <pre><code>public class EmployeeReportAreaRegistration : AreaRegistration { public override string AreaName { get { return "EmployeeReport"; } } public override void RegisterArea(AreaRegistrationContext context) { var routes = context.Routes; routes.MapRoute(null, "vykazy/vykazy-zamestnance", new { Area = "EmployeeReport", controller = "Report", action = "List" }); } } </code></pre> <p></code></p> <p>Global.asax : </p> <p><code></p> <pre><code> routes.MapRoute(null, "prihlasit", new { controller = "Login", action = "Login" }); routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Default", action = "Welcome", id = UrlParameter.Optional }); </code></pre> <p></code></p> <pre><code>When i try load "http://localhost/app_name/vykazy/vykazy-zamestnance i get this exception : The view 'List' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/Report/List.aspx ~/Views/Report/List.ascx ~/Views/Shared/List.aspx ~/Views/Shared/List.ascx ~/Views/Report/List.cshtml ~/Views/Report/List.vbhtml ~/Views/Shared/List.cshtml ~/Views/Shared/List.vbhtml </code></pre> <p>Well, where I do mistake ?</p> <p>Thanks</p>
No
7,544,140
2
<python><c><image-processing><opencv>
2011-09-25T07:09:43.993
7545444
Why does cvSet2D take in a tuple of doubles, and why is this tuple all 0 save for the first element?
<p><code>cvSet2D(matrix, i, j, tuple)</code></p> <p>Hi. I'm dissecting the Gabor Filter code given in <a href="http://www.eml.ele.cst.nihon-u.ac.jp/~momma/wiki/wiki.cgi/OpenCV/Gabor%20Filter.html" rel="nofollow">http://www.eml.ele.cst.nihon-u.ac.jp/~momma/wiki/wiki.cgi/OpenCV/Gabor%20Filter.html</a> . I have a few questions on cvSet2D especially as used in the following code snippets (as given in the link):</p> <p>C code:</p> <pre><code>for (x = -kernel_size/2;x&lt;=kernel_size/2; x++) { for (y = -kernel_size/2;y&lt;=kernel_size/2; y++) { kernel_val = exp( -((x*x)+(y*y))/(2*var))*cos( w*x*cos(phase)+w*y*sin(phase)+psi); cvSet2D(kernel,y+kernel_size/2,x+kernel_size/2,cvScalar(kernel_val)); cvSet2D(kernelimg,y+kernel_size/2,x+kernel_size/2,cvScalar(kernel_val/2+0.5)); } } </code></pre> <p>Python code:</p> <pre><code>for x in range(-kernel_size/2+1,kernel_size/2+1): for y in range(-kernel_size/2+1,kernel_size/2+1): kernel_val = math.exp( -((x*x)+(y*y))/(2*var))*math.cos( w*x*math.cos(phase)+w*y*math.sin(phase)+psi) cvSet2D(kernel,y+kernel_size/2,x+kernel_size/2,cvScalar(kernel_val)) cvSet2D(kernelimg,y+kernel_size/2,x+kernel_size/2,cvScalar(kernel_val/2+0.5)) </code></pre> <p>As I'm aware cvSet2D sets the (j, i)th pixel of a matrix to the equivalent color value of the tuple defined in the last parameter. But why does it take in a tuple of doubles? Isn't it more natural to take in a tuple of ints, seeing that a pixel color is defines as a tuple of ints?</p> <p>Lastly, if I read the docs correctly, the cvScalar method used returns the 4-tuple <code>&lt;given_value_in_double, 0.000000, 0.000000, 0.000000)&gt;</code>. I surmised that cvSet2D takes the first three values and uses it to as the RGB 3-tuple. But, seeing that the output of Gabor Filters are more or less in grayscale, that won't hold being that, the colors produced in my scheme will lean towards red. So, what does cvSet2D do with this tuple?</p> <p>Thank you for anyone who'll take the bother to explain!</p>
No
7,564,803
2
<asp.net><session><c#-4.0><login>
2011-09-27T05:59:01.553
7566018
Using Sessions in an ASP.NET 4.0 Log-In Control
<p>I'm currently developing a website using Visual Studio 2010. As you all might know, creating a new website here automatically adds an Account folder which contains webpages like Login.aspx, etc. I am implementing this Login.aspx which contains the ASP.NET Login control. It's now functioning the way it should but I have a few concerns.</p> <p>Before, I used to create my own UI for the log-in so managing sessions is not a problem to me. But since i'm currently using the Login.aspx which has a CS file almost empty, i don't have an idea where I can start implementing my session. Meaning to say, I don't know how to check programatically if the user has been successfully logged in so I can start implementing my session.</p> <p>I would very much appreciate any pointer regarding this matter.</p> <p>Thanks in advance. :)</p>
No
7,614,345
3
<wordpress>
2011-09-30T18:09:42.130
7620012
Wordpress query_posts posts_per_page not working
<p>Can't figure out why this is not limiting the posts_per_page. It is displaying a very long list of posts, but I only want to show 4</p> <pre><code>query_posts('posts_per_page=4&amp;post_type=page&amp;pagename=media'); if(have_posts() ) : while(have_posts()) : the_post(); </code></pre>
No
7,672,393
2
<c#><asp.net>
2011-10-06T09:23:41.143
7672508
ASP.net page_load doesn't detect session
<p>I have a problem with using <code>session</code> variable in the <code>page_load</code>. I have a page (<code>members.aspx</code>) which is a members area. </p> <p>If the user isn't <code>logged</code> in, it will display a form asking them to login. The form submits their details, checks if ok then sets <code>session</code> variables if <code>OK</code>. It then reloads the page.</p> <p>So if the user has authenticated correctly, it sets <code>Session["memberLoggedIn"] = true</code>. My <code>page_load</code> function then looks like this</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { if (Convert.ToBoolean(Session["memberLoggedIn"]) == true) { Response.Write("OK"); } } </code></pre> <p>There is more code, but essentially, the "OK" should be written. However, it doesn't appear. Even though the <code>session</code> IS set. If I go to the page directly it will then show. It's just for the reloading of the members page from the initial login which stops it. </p> <p>any ideas?!</p> <p>====================== the code to set the session is</p> <pre><code>if (logindetails.Count &gt; 0) { System.Data.DataRow details = logindetails[0]; Session["memberLoggedIn"] = true; } </code></pre> <p>I then just check if <code>(Convert.ToBoolean(Session["memberLoggedIn"]) == true)</code> on all my pages. To be honest it doesn't seem that reliable and I Think sometimes I need to understand the order in which pages are loaded as when I destroy the session on the log out page, some parts still show the logged in features! (but that's another story....)</p>
No
7,690,627
2
<javascript><dom>
2011-10-07T17:17:36.197
7690653
How to retrieve the text of a DOM Text node?
<p>For a given Text node in the DOM, one can use one of these properties to retrieve its text: </p> <ul> <li><code>textContent</code></li> <li><code>data</code></li> <li><code>nodeValue</code></li> <li><code>wholeText</code></li> </ul> <p>But which one to use? Which one is the most reliable and cross-browser supported?</p> <p>(If multiple properties are 100% reliable and cross-browser, then which one would be most appropriate?)</p>
No
7,707,020
2
<javascript><jquery><checkbox>
2011-10-09T22:30:50.303
7707103
JS / JQuery - Trouble with getting checkbox values
<p>I have many checkboxes in a dynamically produced (ASP) photo gallery. Each checkbox has the name 'photos' and contains a photo ID in the value, like this:</p> <pre><code>&lt;form name="selectForm" id="selectForm"&gt; &lt;input type="checkbox" onclick="selectPhoto(&lt;%=rs1.Fields("photoID")%&gt;)" id="checkbox_&lt;%=rs1.Fields("photoID")%&gt;" class="photos" name="photos" value="&lt;%=rs1.Fields("photoID")%&gt;"&gt; &lt;/form&gt; </code></pre> <p>Without submitting a form, when the user clicks the checkbox, I need to create a comma (,) separated list of all the checked values for the checkbox named 'photos'. So this is what I tested but it alerts 'undefined'! The ASP is correct, for those not familiar with it.</p> <pre><code>function selectPhoto(id) { ... other stuff that uses id ... var allValues = document.selectForm.photos.value; alert(allValues); } </code></pre> <p>But as I said above, this returns 'undefined' and I can work out why. When a user selects a photo, I simply need to display a list of all the photo ID's that have been clicked e.g. 1283,1284,1285,1286...</p> <p>Any ideas what I am doing wrong here? Or is there another way to achieve this?</p>
No
7,890,076
2
<wpf><datagrid><cell>
2011-10-25T13:33:36.420
7890969
Access to cell values of a DataGrid in WPF?
<p>We have such a scenario that we have a page including a DataGrid, and now we want to get all data from this DataGrid, but without accessing to the underlying item source of it, i.e., we want to access to the data directly from the DataGrid. It seems to be tricky but not impossible. I found many articles, like this: <a href="http://code.google.com/p/artur02/source/browse/trunk/DataGridExtensions/DataGridHelper.cs" rel="nofollow">DataGridHelper</a>, and this: <a href="http://techiethings.blogspot.com/2010/05/get-wpf-datagrid-row-and-cell.html" rel="nofollow">Get WPF DataGrid row and cell</a>, and many other ones. They are basically the same thing: to define the extension methods on DataGrid with help of another GetVisualChild function to find the target DataGridCell object. However, when I am using it, I can't find the target cell. Specifically, Each row in the DataGrid corresponds to one item from a collection of the DataContext, let's say, it is a collection of type "Employee", and each column of the DataGrid corresponds one property of class Employee, e.g, the Name, Gender, Age. Now my problem is, the above-mentioned GetCell() function always finds a DataGridCell with one Employee object as its content (the property of Content in DataGridCell), and can't go further into each property, no matter what column index I give it. For example, in the GetCell function, there is one line: <code>Dim cell As DataGridCell = DirectCast(presenter.ItemContainerGenerator.ContainerFromIndex(column), DataGridCell)</code>, where the presenter is a DataGridCellsPresenter I got which representing the row I choose, and as soon as I give the column index, naturally I am expecting it to return the control for selected property at position I specified. But it just doesn't work as expected. Any help would be appreciated!</p>
No
7,955,749
3
<php><datetime>
2011-10-31T15:22:39.657
7955793
Changing date formats in PHP < 5.3.0
<p>Given a date string in the format m-d-Y (e.g, "12-09-2011") how can I display it in the format "m/d/Y" <strong>WITHOUT</strong> resorting to regular expressions.</p> <p>Just in case you missed it: <strong><em>without using regular expressions.</em></strong></p> <p>I would prefer to use <code>DateTime::createFromFormat()</code> for this problem, but the server I am using currently doesn't have 5.3.0 on it.</p> <p>I'd also prefer using <code>date('m/d/Y', strtotime("12-09-2011"))</code> but <code>strtotime()</code> doesn't recognize that format properly. It confuses the day and month.</p>
No
7,979,375
5
<c#><textbox><substring>
2011-11-02T11:12:25.287
7979400
Using substring in C# textboxes
<p>I wanted to display the remaining characters using a label beside my textbox just in case the user input exceeded the maximum length of characters.</p> <p>This is my code for remaining characters:</p> <pre><code>private void txtID_TextChanged(object sender, EventArgs e) { int MaxChars = 10 - txtID.Text.Length; labelChars.Text = MaxChars.ToString() + " characters remaining."; } </code></pre> <p>What I wanted to do now is to prevent the user from entering characters in my textbox when he/she already exceeded the character limit. I'm planning to use the <strong>Substring</strong> property of the textbox but I don't know how. Help me out? Thanks.</p>
No
8,131,281
1
<sql><sql-server><sql-server-2008>
2011-11-15T03:53:07.083
null
SQL Server Script Database with Seed Data
<p>I am creating an install script for a Sql server 2008 database using Tasks =>generate Scripts option. This works fine and creates a script including database,schema and seed data.</p> <p>One problem I notice is that the A Stored procedure is created before the table it refers to is created and this gives error when creating the database.</p>
No
8,141,422
1
<email><replication>
2011-11-15T18:44:53.843
9112771
virtual mail replication
<p>I have 2 servers that have mail server, both have mysql, dovecot, postfix installed. One of the servers is a Master, second Slave, there is database replication done which works great however mails are not replicated as they are held as files. How should I replicate emails from the Master server into the Slave server?</p>
No
8,176,500
1
<asp.net-mvc-3><reference><assemblies><gac>
2011-11-18T00:54:31.660
8179138
MVC3 referencing update-able dependencies
<p>I would like create a MVC3 website. I have existing dlls packaged as .net MSI which are installed into the GAC. What is the best way to reference these update-able dlls in MVC3? They will always be installed into the GAC, their version number will be updated accordingly. I don't want to have to manually reference them in my MVC3 project, as every time I re install, the reference will break and I have to update my dependent dll references.</p> <p>Any input would be appreciated. I have looked around for solutions already but nothing seems straight forward.</p> <p>Thanks</p>
No
8,192,177
1
<c#>
2011-11-19T05:45:32.470
null
cannot convert from 'System.IO.TextWriter' to 'System.IO.Stream'
<pre><code> var ssh = new SshClient("ip", "user", "pass"); var input = new MemoryStream(Encoding.ASCII.GetBytes("exit\r\n")); var shell = ssh.CreateShell(input, Console.Out, Console.Out, "xterm", 80, 24, 800, 600, ""); shell.Stopped += delegate(object sender, EventArgs e) { Console.WriteLine("\nDisconnected..."); }; shell.Start(); Thread.Sleep(1000 * 1000); shell.Stop(); </code></pre> <p>error on this line : </p> <pre><code>var shell = ssh.CreateShell(input, Console.Out, Console.Out, "xterm", 80, 24, 800, 600, ""); </code></pre> <p>Errors : Error 3 Argument 2: cannot convert from 'System.IO.TextWriter' to 'System.IO.Stream' D:\applications area\test\ConsoleApplication1\ConsoleApplication1\Program.cs 19 48 ConsoleApplication1</p> <p>Error 4 Argument 3: cannot convert from 'System.IO.TextWriter' to 'System.IO.Stream' D:\applications area\test\ConsoleApplication1\ConsoleApplication1\Program.cs 19 61 ConsoleApplication1</p> <p>any solution ?</p>
No
8,201,197
4
<c#><wpf><mvvm><dependency-injection><unity-container>
2011-11-20T11:27:50.563
8201779
Should I use Microsoft.Practicies.Unity.IUnityContainer in my MVVM application?
<p>Jason Dolinger in his video located here (hot available right now) www.lab49.com/files/videos/Jason%20Dolinger%20MVVM.wmv (from 0.59 to 1.04) uses such code:</p> <pre><code>public partial App: Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); IUnityContainer container = new UnityContainer(); RandomQuoteSource source = new RandomQuoteSource(); container.RegisterInstance&lt;IQuoteSource&gt;(source); WatchList window = container.Resolve&lt;WatchList&gt;(); window.Show(); } } </code></pre> <p>He uses class IUnityContainer which I can not found. As I understand here we just create a window (so <code>container.Resolve</code> call can be replaced with <code>new WatchList(...</code>, also somehow we associate <code>RandomQouteSource</code> as an implementation for <code>IQouteSource</code>, however I don't have clear understanding how this should be used later.</p> <p>The questions are:</p> <ul> <li>how do you create main Windows in your MVVM application, do you also use IUnityContainer for that?</li> <li>is it good technics in general? is it well-known? is it default way to do these things? what alternativies do I have?</li> <li>where can I find Microsoft.Practicies.Unity.dll?</li> </ul>
No
8,235,270
1
<c++><templates><map><functional-programming><c++11>
2011-11-22T23:15:32.943
8235391
c++ function map implementation
<p>I have been playing around with variadic templates in the new c++ standard and came up with a map function (headers + using decs excluded):</p> <pre><code>template&lt;typename T&gt; T square(T i) { return i * i; } template &lt;typename T, typename... Ts&gt; const tuple&lt;Ts...&gt; map(const T f, const Ts...args) { return make_tuple(f(args)...); } int main(int c, char *argv[]) { tuple&lt;int, int&gt; t; int (*fp) (int) = square; t = map(fp, 6, 8); cout &lt;&lt;get&lt;0&gt;(t) &lt;&lt;endl; cout &lt;&lt;get&lt;1&gt;(t) &lt;&lt;endl; return 0; } </code></pre> <p>Which works. As long as all the arguments are the same type for map. If I change the main to use a slightly more general form:</p> <pre><code> tuple&lt;int, float&gt; t; t = map(square, 6, 8.0f); </code></pre> <p>gcc 4.4 reports:</p> <pre><code>In function ‘int main(int, char**)’: error: no matching function for call to ‘map(&lt;unresolved overloaded function type&gt;, int, float)’ </code></pre> <p>Any ideas how to make this work?</p>
No
8,317,802
1
<java><spring><jsp><jstl><el>
2011-11-29T21:12:46.927
8317943
NumberFormatException in a jsp with a list
<p>This question is another problem im having with my application which is described <a href="https://stackoverflow.com/questions/8235049/spring-mvc-binding-issue">here</a>. My model (a level) has a list of requirements which contains two strings, an id and name. The model looks like this:</p> <pre><code>public class Level { private String name; private int id; private int points private List&lt;Requirement&gt; requirements; .... } public class Requirement{ private String name; private String id; .... } </code></pre> <p>and the jsp looks like this:</p> <pre><code>&lt;div id="allRequirements"&gt; &lt;c:forEach var="requirement" items="${RequirementList}"&gt; &lt;div class="requirements"&gt; &lt;input type="hidden" value="${requirement.id}" name="id"/&gt; &lt;h2&gt;&lt;c:out value="${requirement.name}"/&gt;&lt;/h2&gt; &lt;/div&gt; &lt;/c:foreach&gt; &lt;/div&gt; &lt;div id="requiredRequirements"&gt; &lt;c:forEach var="requiredRequirement" items="${level.requirements}"&gt; &lt;div class="requirements"&gt; &lt;input type="hidden" value="${requiredRequirement.id}" name="id"/&gt; &lt;h2&gt;&lt;c:out value="${requiredRequirement.name}"/&gt;&lt;/h2&gt; &lt;/div&gt; &lt;/c:foreach&gt; &lt;/div&gt; </code></pre> <p>The jsp page renders fine and works like a charm until I added the requiredRequirements loop in which the site throws a <code>java.lang.NumberFormatException: For input string: "id"</code> because it tries to parse the string as an int.</p> <p>Does anyone have any idea why the first loop works and the second loop does not work?</p> <p><strong>Edit: Stack trace</strong></p> <pre><code>java.lang.NumberFormatException: For input string: "id" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:447) at java.lang.Integer.parseInt(Integer.java:497) at javax.el.ListELResolver.coerce(ListELResolver.java:174) at javax.el.ListELResolver.getValue(ListELResolver.java:52) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:67) at org.apache.el.parser.AstValue.getValue(AstValue.java:169) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189) at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:985) at org.apache.jsp.WEB_002dINF.jsp.createOrEdit_005fLevelBody_jsp._jspx_meth_c_005fout_005f0(createOrEdit_005fLevelBody_jsp.java:648) at org.apache.jsp.WEB_002dINF.jsp.createOrEdit_005fLevelBody_jsp._jspx_meth_c_005fforEach_005f1(createOrEdit_005fLevelBody_jsp.java:611) at org.apache.jsp.WEB_002dINF.jsp.createOrEdit_005fLevelBody_jsp._jspService(createOrEdit_005fLevelBody_jsp.java:207) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:927) at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:684) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:678) at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103) at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96) at org.apache.tiles.renderer.impl.UntypedAttributeRenderer.write(UntypedAttributeRenderer.java:61) at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:103) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:659) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:337) at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:234) at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:211) at org.apache.tiles.jsp.taglib.RenderTag.doEndTag(RenderTag.java:220) at org.apache.jsp.WEB_002dINF.jsp.layout_jsp._jspx_meth_tiles_005finsertAttribute_005f3(layout_jsp.java:411) at org.apache.jsp.WEB_002dINF.jsp.layout_jsp._jspService(layout_jsp.java:196) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:593) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:530) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:927) at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:684) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:678) at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103) at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96) at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44) at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:103) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:659) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:678) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:633) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:322) at org.apache.tiles.jsp.taglib.InsertDefinitionTag.renderContext(InsertDefinitionTag.java:66) at org.apache.tiles.jsp.taglib.InsertTemplateTag.render(InsertTemplateTag.java:81) at org.apache.tiles.jsp.taglib.RenderTag.doEndTag(RenderTag.java:220) at org.apache.jsp.WEB_002dINF.jsp.createOrEdit_005fLevel_jsp._jspx_meth_tiles_005finsertDefinition_005f0(createOrEdit_005fLevel_jsp.java:87) at org.apache.jsp.WEB_002dINF.jsp.createOrEdit_005fLevel_jsp._jspService(createOrEdit_005fLevel_jsp.java:60) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:574) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:306) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:323) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1719) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) </code></pre> <p>Thanks</p>
No
8,332,143
2
<c#><visual-studio-2010><c#-4.0><silverlight-4.0>
2011-11-30T19:57:38.450
null
how to do this so it does show "No Value" instead of getting caught in an error
<p>I am using the following code which works fine as long as I dont have one of the child node (e.g. URL) missing. If it is missing then my code errors out. How can I make it to not error out and just return a string "No Value" instead.</p> <p>here is my code</p> <pre><code>string widgetsInfo = loaded.Descendants("widget") .Select((w, i) =&gt; new { WidgetIndex = i, URL = w.Descendants("url").FirstOrDefault().Value, Category = w.Descendants("PortalCategoryId").FirstOrDefault().Value }) .Select(w =&gt; String.Format("Index:{0}; URL:{1}; CATEGORY:{2}; ", w.WidgetIndex, w.URL, w.Category)) .Aggregate((acc, next) =&gt; acc + Environment.NewLine + next); </code></pre> <p>here is the xml that I am parsing</p> <pre><code>string xml = @"&lt;?xml version='1.0' encoding='UTF-8'?&gt; &lt;widgets&gt; &lt;widget&gt; &lt;url&gt;~/Portal/Widgets/ServicesList.ascx&lt;/url&gt; &lt;castAs&gt;ServicesWidget&lt;/castAs&gt; &lt;urlType&gt;ascx&lt;/urlType&gt; &lt;parameters&gt; &lt;PortalCategoryId&gt;3&lt;/PortalCategoryId&gt; &lt;/parameters&gt; &lt;/widget&gt; &lt;widget&gt; &lt;url&gt;www.omegacoder.com&lt;/url&gt; &lt;castAs&gt;ServicesWidget&lt;/castAs&gt; &lt;urlType&gt;htm&lt;/urlType&gt; &lt;parameters&gt; &lt;PortalCategoryId&gt;41&lt;/PortalCategoryId&gt; &lt;/parameters&gt; &lt;/widget&gt; &lt;/widgets&gt;"; </code></pre>
No
8,573,508
4
<eclipse><java>
2011-12-20T09:46:21.393
8573541
Get Eclipse IDE to show version of Java RE it's using
<p>I've just installed proper JRE rather than the OpenJDK, I was wondering if there is an easy way to find out which RE Eclipse is using? Maybe in a help menu or something.</p> <p>Thanks</p>
No
8,779,574
1
<ios><uitableview>
2012-01-08T17:25:13.273
8779703
UITableView only with Images
<p>I'm developing an iOS App and I want to make a table view, but only with images like the <a href="http://i.stack.imgur.com/ZwpkE.jpg" rel="nofollow">6G Nano images app</a>. Does anyone know how to implement that?</p>
No
8,877,080
2
<c#><wpf><listbox><anonymous-types><multi-select>
2012-01-16T07:58:22.020
8877209
Retrieving selected values from ListBox with multiselect
<p>I have one WPF ListBox loaded using LINQ:</p> <pre><code>lbxCalculosSec.ItemsSource = from p in database.CALCULOS orderby p.NOMBRECALCULO select new { ID = p.IDCALCULO, NOMBRE = p.NOMBRECALCULO + " - " + p.DESCRIPCIONCALCULO }; lbxCalculosSec.DisplayMemberPath = "NOMBRE"; lbxCalculosSec.SelectedValuePath = "ID"; </code></pre> <p>The listbox has multiselect = true. The problem is when I try to retrieve all the SelectedValue's (ID's) from SelectedItems List.</p> <p>When I inspect one SelectedItem at runtime, the object type is "&lt;>f__AnonymousType0`2"</p> <p>I tried using this:</p> <pre><code>ItemPropertyInfo ID = null; lbxCalculosSec.SelectedItem.GetType().GetProperty("ID").GetValue(ID as ItemPropertyInfo, null) </code></pre> <p>But it didn't work.</p> <p>I need a solution to access ListBox Selected Values (ID fields).</p> <p>Thank you very much in advance.</p> <p>Kind Regards.</p>
No
8,929,554
1
<c++><rtti>
2012-01-19T16:24:09.210
null
Custom run-time type system/ library for C++
<p>In an application I'm making at the moment, I have an <code>EventDispatcher</code> class that works with a base <code>Event</code> class. The dispatcher is not templated, it works with the run-time types of each event; this is to allow scripts to inherit from the base <code>Event</code> class and make their own types of events.</p> <p>It'd like this event dispatcher to handle inheritance of events as well. For example, I have <code>FooEvent</code> that inherits from a <code>FooBaseEvent</code>; whenever a <code>FooEvent</code> occurs, callbacks interested in <code>FooBaseEvent</code> are also notified, but not the other way around.</p> <p>Is there any library that would make this easier? Remember that inheritance checking should be extended to events defined in scripts as well.</p> <p>(The scripting language is Python, but that shouldn't matter so much.)</p> <hr> <p><strong>Edit:</strong> My <code>EventDispatcher</code> has the following interface (Python):</p> <pre><code>class EventDispatcher: def subscribe(self, event_type, callback) -&gt; EventDispatcher.Subscription def post(self, event) class Subscription: def cancel(self) def alive(self) -&gt; bool </code></pre>
No
8,974,040
2
<php><html><simple-html-dom>
2012-01-23T15:27:08.793
8974103
Why is this foreach failing?
<p>The script I am using 'gets' a html page and parses is showing only the .jpg images within, but I need to make some modifications and when i do it simply fails...</p> <p>This works:</p> <pre><code>include('simple_html_dom.php'); function getUrlAddress() { $url = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http'; return $url .'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; } $html = file_get_html($url); foreach($html-&gt;find('img[src$=jpg]') as $e) echo '&lt;img src='.$e-&gt;src .'&gt;&lt;br&gt;'; </code></pre> <p>However, there are some problems... I only want to show images over a certain size, plus some site do not display full URL in the img tag and so need to try to get around that too... so I have done the following:</p> <pre><code>include('simple_html_dom.php'); function getUrlAddress() { $url = $_SERVER['HTTPS'] == 'on' ? 'https' : 'http'; return $url .'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; } $html = file_get_html($url); foreach($html-&gt;find('img[src$=jpg]') as $e) $image = $e-&gt;src; // check to see if src has domain if (preg_match("/http/", $e-&gt;src)) { $image = $image; } else { $parts = explode("/",$url); $image = $parts['0']."//".$parts[1].$parts[2].$e-&gt;src; } $size = getimagesize($image); echo "&lt;br /&gt;&lt;br /&gt;size is {$size[0]}"; echo '&lt;img src='.$image.'&gt;&lt;br&gt;'; </code></pre> <p>This works, but only returns the first image.</p> <p>On the example link below there are 5 images, which the first code shows but does not display them as the src is without the leading domain</p> <p><a href="http://direct.tesco.com/q/R.211-7611.aspx" rel="nofollow">Example link as mentioned above</a></p> <p>Is there a better way to do this? And why does the loop fail?</p>
No
9,036,482
3
<java><frame-rate>
2012-01-27T16:15:33.333
9036801
Is it good practice to cache parts of a 2D drawing?
<p>I'm making a 2D game in Java and one of the main issues causing low FPS (on my slow laptop) is having to re-draw complex structures to a Graphics instance, such as dials with markings.</p> <p>The dial and its markings will never change unless the window is resized, so I thought it would be a good idea to draw to a <code>BufferedImage</code> and just re-draw the image rather than re-drawing the details. The position of the needle obviously changes, so this can just be drawn on top.</p> <p>I've never heard about this being done to improve the FPS of 2D games so I'm wondering if it's actually good practice to store a cache of images or if there's a better way to solve this sort of problem? Are there any issues associated with this that I haven't considered?</p>
No
9,040,355
5
<iphone><notifications><message><center>
2012-01-27T21:32:37.430
null
Alternative to NSDistributedNotificationCenter for comms between iPhone apps
<p>I've been looking for a way to compare timestamps between applications on the same phone in real time, and NSDistributedNotificationCenter sounded like an ideal solution since i may not know the names of the apps listening for it, but it sounds like its not available in iOS.</p> <p>Is there an equivalent way of notifying multiple apps of a time-sensitive event without knowing their name? </p> <p>Coding for iOS 5+ and assuming the apps in question will register for the notification.</p>
No
9,060,146
1
<objective-c><optional-parameters>
2012-01-30T06:26:17.983
9405083
How to make method like UIActionSheet initWithTitle
<p>How can i make method with parameter is unlimited array like this :</p> <pre><code>UIActionSheet *actionSheet = [[[UIActionSheet alloc] initWithTitle:@"Test Title" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Destructive" otherButtonTitles: @"abc", @"xyz", nil] autorelease]; </code></pre> <p>In above code, parameter otherButtonTitles can have unlimit number of NSString like "abc", "xyz",.. Can do this with other type of parameter?<br> Thanks in advance!.</p>
No
9,074,893
3
<ruby-on-rails>
2012-01-31T05:31:54.590
null
undefined local variable or method `config' for main:Object - rails
<p>When I run the rails application, I get the following error:</p> <blockquote> <p>undefined local variable or method "config" for main:Object</p> </blockquote> <p>How can I resolve it?</p>
No
9,141,619
1
<google-maps><jquery-mobile>
2012-02-04T14:37:41.407
18978552
After Upgrading JQuery Mobile to 1.0.1, Code Isn't Working
<p>This works just fine, with JQM 1.0a1:</p> <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE HTML&gt; &lt;html lang="en-US"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Main Page&lt;/title&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" /&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div data-role="page"&gt; &lt;div data-role="header"&gt;&lt;h1&gt;Main Page&lt;/h1&gt;&lt;/div&gt; &lt;div data-role="content"&gt;&lt;p&gt;&lt;a href="#map"&gt;Map&lt;/a&gt;&lt;/p&gt;&lt;/div&gt; &lt;/div&gt; &lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $('#map').live("pagecreate", function() { initialize(1.359,103.818); }); function initialize(lat,lng) { var latlng = new google.maps.LatLng(lat, lng); var myOptions = { zoom: 8, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions); } &lt;/script&gt; &lt;div id="map" data-role="page" data-theme="b" class="page-map" style="width:100%; height:100%;"&gt; &lt;div data-role="header"&gt;&lt;h1&gt;Map Page&lt;/h1&gt;&lt;/div&gt; &lt;div data-role="content" style="width:100%; height:100%; padding:0;"&gt; &lt;div id="map_canvas" style="width:100%; height:100%;"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>But the same using JQM 1.0.1 (<a href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js" rel="nofollow">http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js</a>) doesn't show the map at all. I tried using <code>$('#map').on</code> and <code>"pageinit"</code> to no avail.</p> <p>What am I missing?</p> <p><strong>UPDATE</strong>: same behavior with JQuery 1.6.3</p> <p><strong>UPDATE2</strong>: by giving an absolute size (eg height: 200px; width: 200px;) to the #map-canvas div, it works fine.</p>
No
9,144,856
3
<php><stop-words>
2012-02-04T21:48:10.057
null
Stop Words into a string
<p>I want to create a function in PHP that will return true when it finds that in the string there are some bad words.</p> <p>Here is an example:</p> <pre><code>function stopWords($string, $stopwords) { if(the words in the stopwords variable are found in the string) { return true; }else{ return false; } </code></pre> <p>Please assume that <code>$stopwords</code> variable is an array of values, like:</p> <pre><code>$stopwords = array('fuc', 'dic', 'pus'); </code></pre> <p>How can I do that?</p> <p>Thanks</p>
No
9,178,734
2
<css><less><mixins>
2012-02-07T15:15:05.753
9189245
LESS syntax for .mixin > *
<p>I am using LESS and im trying for a type of mixin.</p> <p>I have this mixin:</p> <pre><code>.mixin, .mixin &gt; * { font:arial; } </code></pre> <p>and i want to use it as a mix in so.</p> <pre><code>.my-class { color:#000; .mixin; } </code></pre> <p>becomes</p> <pre><code>.my-class { color:#000; } .my-class, .my-class &gt; * { font:arial; } </code></pre> <p>But it doesnt work, probobly because i cannot use mixins like that. Or can I? How do i write them then? Cannot find this information in the documentation of LESS.</p>
No
9,240,763
1
<jquery><for-loop>
2012-02-11T13:57:45.603
9240801
Working with for loop and jquery load event for multiple images return only the last loaded one props
<p>I'm working with a <code>jQuery plug-in</code> useful to zoom the resized background images with the mouse interaction.</p> <p>To make it work, I thought to use an <code>array</code> of <code>objects</code> with the <code>width</code> and <code>height</code> of a <code>background-image</code> of every element I bring to it.</p> <p>To do this I've created an empty <code>img</code> element, set the <code>src</code> attribute to the background image, and once it's loaded getting <code>width</code> and <code>height</code>.</p> <p>I've thought to handle it starting in a <code>for loop</code> which prepares every image, when the jQuery event <code>load</code> is called I create the new array element with every info about the loaded image.</p> <p>It seems the <code>load</code> event sets the first loaded image, and apply the same properties to every element loaded after it, how can I avoid this problem?</p> <pre><code>// this is a portion of the plugin var setImageSize = function (i) { return function (e) { // I use the extend method only to get different zoom animation if they are added by the user instances[i] = {id:i, element:this_obj.get(i), settings:$.extend(true, defaults, options)}; instances[i].settings.bg.url = getBackgroundUrl(i); instances[i].settings.bg.width = parseInt($(this).width()); instances[i].settings.bg.height = parseInt($(this).height()); updateDefaultValues(instances[i]); $(instances[i].element).hover(setRollOver(i), setRollOut(i)); $(window).resize(getUpdateDefaultValues(i)); $('#debug').html($('#debug').html() + 'image loaded: ' + i + ' url:' + instances[i].settings.bg.url +'&lt;br/&gt;width: '+ instances[i].settings.bg.width +' height: '+ instances[i].settings.bg.height +'&lt;br&gt;- - - - - &lt;br&gt;'); $(this).remove(); } } var prepareImageSize = function (i) { var img = $('&lt;img id="jquery-background-zoom-'+i+'"/&gt;'); img.hide(); img.bind('load', setImageSize(i)); $('body').append(img); img.attr('src', getBackgroundUrl(i)); } var init = function () { for (var i = 0; i &lt; this_obj.length; i ++) { prepareImageSize (i); } } init(); </code></pre> <p>I've reported a full working example here at <a href="http://jsfiddle.net/tonino/CFPTa/" rel="nofollow">http://jsfiddle.net/tonino/CFPTa/</a></p> <p>In the plug-in I've added a script to see how the images are set, then if you try to interact with the images you'll notice the props of every images are overwritten by the last loaded image, I'm not sure how?</p> <p>It seems like the load event overwrite previous load event or something, how can I fix it?</p>
No
9,309,288
2
<opencl><gpgpu>
2012-02-16T10:09:06.443
9313325
OpenCL- waste of host computing power
<p>I am new to OpenCL, please tell me that the host cpu can be used only for allocating memory to the device, or we can use it can as an openCL device. (Because after the allocation is done, the host cpu will be idle). </p>
No
9,366,780
1
<php><vb.net><vb.net-2010><awesomium>
2012-02-20T18:55:53.723
null
Awesomium with .NET VS2010 (ObjectForScripting)
<p>I'm having some issues finding examples of how to use the Awesomium web browser control in vb.net with objectforscripting. I know that objectforscripting isn't the same for the webcontrol used with awesomium since its HTML5 and not the traditional IE control that comes with vs 2010.</p> <p>The issue I'm having is finding any info/examples on how to communicate with the awesomium web browser control with my javascript. It's quite easy with the IE built in control with objectforscripting. I've found samples of how to do it in C# but I don't see any info of how I could do it just in VB. I've searched several things in google and I just can't seem to find anything on how to do it.</p> <p>So for example, I would have a button in a php page that the webcontrol browsers to and if I click the button it closes the application down. So I need to communicate using window.external with the webcontrol in VB.</p>
No
9,410,414
1
<ruby-on-rails><ruby-on-rails-3><model-view-controller><routes><belongs-to>
2012-02-23T09:38:47.513
9410640
Rails: Forum has_many topics, saving the association?
<p>I might be going about this the wrong way in the first place, so I will give a bit of background first.</p> <p>As you can tell from the title, I am building a forum from scratch. I thought it was working correctly; however, I am a bit unsure as to how to update/save the forum object from within the topics "create" method in it's controller.</p> <p>What I tried to do: In the "New" method, I sent the Forum's id via the routing. So on the new-topic page has a address that looks like this: "localhost:3000/new-topic/1". The one being the Forum's id. In the method itself, I try to attach it to the new topic object.</p> <pre><code>@topic = Topic.new @topic.forum = Forum.find(params[:id]) </code></pre> <p>My create method then tries to use that forum.</p> <pre><code>@topic = Topic.new(params[:topic]) @topic.forum.topics &lt;&lt; @topic #Simplified down. if @topic.save @topic.forum.save ... </code></pre> <p>I get the feeling that I am going about this the wrong way. I was looking at someone's tutorial and they got the forum by calling params[:forum_id] but they didn't show they routing they did to achieve that.</p> <p>How do I do this correctly and/or what is the correct way to route all of this? For the record, I do plan on using this same method for the Topic => Post association. Thanks for any help.</p>
No
9,490,260
1
<c#><json><highcharts>
2012-02-28T21:48:00.390
9575650
Pass JSON data from a .NET WebHandler to redraw Pie Highcharts with new series data
<p>I want to create a page displaying a default pie chart and a few buttons. When the user clicks on the buttons, the page will get new JSON data from a <code>WebHandler</code> and redraw the chart. I'm using .net 2.0, C#, web forms.</p> <p>I have this <code>WebHandler</code> <code>json.ashx</code> generating the JSON:</p> <pre><code>public void ProcessRequest (HttpContext context) { String data = String.Empty; data += "[{\"Male\": 80.0}, {\"Female\": 20.0}]"; context.Response.ContentType = "application/json"; context.Response.Write(data); } </code></pre> <p>Here is my script on the aspx page:</p> <pre><code> var chart = null; $(document).ready(function () { var options = { chart: { renderTo: 'container', defaultSeriesType: 'pie' }, tooltip: { formatter: function () { return '&lt;b&gt;' + this.point.name + '&lt;/b&gt;: ' + this.y + ' (' + this.percentage + '%)'; } }, plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, color: '#000000', connectorColor: '#000000', formatter: function () { return '&lt;b&gt;' + this.point.name + '&lt;/b&gt;: ' + this.y + ' (' + this.percentage + '%)'; } } } }, series: [{ data: [['Yes', 60], ['No', 40]] }] }; var chart = new Highcharts.Chart(options); $("#Gender").click(function () { $.get('json.ashx', function (data) { options.series = data; var chart = new Highcharts.chart(options); }); }); }); </code></pre> <p>when I click on the <code>Gender</code> button, it does not generate the new chart. How do I properly parse the JSON data and feed it to the <code>series.data</code> of the new pie chart?</p>
No
9,519,546
1
<c#><asp.net><.net><user-controls><pagination>
2012-03-01T16:02:27.417
11615051
.NET C# - Passing parent controls to a pagination .ascx control?
<p>On a project I'm working on, I have many &lt;asp:ListView&gt; controls, which are paginated using &lt;asp:DataPager&gt; controls. Instead of copying and pasting the controls to each .aspx page where I have a paginated list, would it be possible to break out the &lt;asp:DataPager&gt; controls into a reusable/modular .ascx control and create a field on it to pass in the PagedControlID?</p> <p>I've tried this in the past but couldn't not seem to target the PagedControlID in the Parent page.</p> <p>Here's what I've got so far. Any help would be much appreciated.</p> <h2>.aspx Page</h2> <pre><code>&lt;abc:Pagination ID="uxPagination" ListControlID="uxEventListView" runat="server" /&gt; </code></pre> <h2>.ascx Pagination Control</h2> <pre><code>&lt;asp:DataPager ID="uxDataPager" PageSize="1" runat="server" /&gt; </code></pre> <h2>.ascx.cs Pagination Control</h2> <pre><code>public partial class ABC_UserControls_Pagination : System.Web.UI.UserControl { private string listControlID; public string ListControlID { get { return listControlID; } set { listControlID = value; } } protected void Page_Load(object sender, EventArgs e) { if (!string.IsNullOrEmpty(ListControlID)) { uxDataPager.PagedControlID = ListControlID; } } } </code></pre>
No
9,604,589
2
<powershell><php>
2012-03-07T15:46:18.340
9604661
Run PHP CLI from Windows Powershell ISE
<p>This question is regarding dollar signs "$" <code>$</code> in Windows PowerShell ISE.</p> <p>I have PHP CLI and want to run one liner command scripts from the prompt in Windows PowerShell ISE.</p> <p><code>php -r "$foo = 'foo';"</code></p> <p>Just returns <code>Parse error: parse error in Command line code on line 1</code> and I've narrowed it down to the pesky dollar sign which is significant in PowerShell. Can I escape it somehow?</p> <p>I also tried </p> <p><code>php -r '$foo = "foo";'</code> </p> <p>and get </p> <p><code>Notice: Use of undefined constant foo - assumed 'foo' in Command line code on line 1</code></p>
No
9,917,131
2
<python><virtualenv>
2012-03-28T23:29:56.047
9917539
virtualenv bug?
<p>I am trying to run the following script in my virtualenv:</p> <pre><code>(python2.7.2-gonvaled1)gonvaled@lycaon:~/.virtualenvs/python2.7.2-gonvaled1$ couchy.py Traceback (most recent call last): File "/home/gonvaled/projects/bin/couchy.py", line 46, in &lt;module&gt; from couchdb_support import CouchdbLists File "/home/gonvaled/projects/test_project/python_modules/couchdb_support.py", line 3615, in &lt;module&gt; from asterisk_support import AsteriskSupport File "/home/gonvaled/projects/test_project/python_modules/asterisk_support.py", line 4, in &lt;module&gt; from starpy_support import AmiCommand File "/home/gonvaled/projects/test_project/python_modules/starpy_support.py", line 7, in &lt;module&gt; from starpy import manager, fastagi, utilapplication, menu File "/usr/lib/python2.5/site-packages/starpy/utilapplication.py", line 2, in &lt;module&gt; from basicproperty import common, propertied, basic, weak File "/usr/lib/python2.5/site-packages/basicproperty-0.6.12a-py2.5-linux-i686.egg/basicproperty/common.py", line 159, in &lt;module&gt; from basictypes import datedatetime_types as ddt File "/usr/lib/python2.5/site-packages/basicproperty-0.6.12a-py2.5-linux-i686.egg/basictypes/datedatetime_types.py", line 4, in &lt;module&gt; from dateutil import parser File "/usr/lib/python2.5/site-packages/python_dateutil-2.1-py2.5.egg/dateutil/parser.py", line 8 from __future__ import unicode_literals SyntaxError: future feature unicode_literals is not defined </code></pre> <p>So somehow python is trying to import from:</p> <pre><code>/usr/lib/python2.5/site-packages/starpy/utilapplication.py </code></pre> <p>This does not make any sense. My virtualenv is very clean:</p> <pre><code>(python2.7.2-gonvaled1)gonvaled@lycaon:~/.virtualenvs/python2.7.2-gonvaled1$ python Python 2.7.2 (default, Mar 29 2012, 00:31:29) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import sys &gt;&gt;&gt; sys.path ['', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7/site-packages/pip-1.1-py2.7.egg', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7/site-packages/Twisted-12.0.0-py2.7-linux-i686.egg', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7/site-packages/zope.interface-3.8.0-py2.7-linux-i686.egg', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7/site-packages/basicproperty-0.6.12a-py2.7-linux-i686.egg', '/home/gonvaled/projects/gonvaled_settings', '/home/gonvaled/django_apps', '/home/gonvaled/projects/test_project/ipc', '/home/gonvaled/projects/test_project/python_modules', '/home/gonvaled/projects/test_project/gdata', '/home/gonvaled/projects/callisto/libraries', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python27.zip', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7/plat-linux2', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7/lib-tk', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7/lib-old', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7/lib-dynload', '/usr/local/python/2.7.2/lib/python2.7', '/usr/local/python/2.7.2/lib/python2.7/plat-linux2', '/usr/local/python/2.7.2/lib/python2.7/lib-tk', '/home/gonvaled/.virtualenvs/python2.7.2-gonvaled1/lib/python2.7/site-packages'] </code></pre> <p>And:</p> <pre><code>(python2.7.2-gonvaled1)gonvaled@lycaon:~/.virtualenvs/python2.7.2-gonvaled1$ pip freeze CouchDB==0.9dev DateUtils==0.5.1 Twisted==12.0.0 basicproperty==0.6.12a pystache==0.4.0 python-dateutil==2.1 pytz==2012b simplejson==2.4.0 six==1.1.0 starpy==1.0.0a12 wsgiref==0.1.2 zope.interface==3.8.0 </code></pre> <p>So to summarize: python is importing from <code>/usr/lib/python2.5/site-packages</code> even though I am inside a virtualenv. How can this be?</p>
No
10,119,397
2
<mysql><database-design>
2012-04-12T07:38:51.677
10119466
database design with variable columns (mysql)
<p>I am working on a problem where I am trying to figure out the best way to design the Db tables for this. Lets say I have multiple books and each book has variable number of pages in it...I need to track page views for every book </p> <p>e.g. Book 1 = 10 pages , Book 2 = 20 pages, Book 3 and 100 pages and so on As the user views each page in a book, I need to log that information.</p> <p>The motive is to come up with some aggregation numbers on the %views of each book. I should be able to say e.g. "70% people read Book 1 upto Page 7 and then drop off" </p> <p>I envision it as </p> <pre><code>book 1 page 1 1000 views book 1 page 2 950 views book 1 page 3 800 views ..... ... book 1 page 10 50 views </code></pre> <p>and with this I can generate a drilldown report of sorts</p> <p>however, with variable page numbers in each book, what is the best way to store this information?</p> <p>any help would be much appreciated</p>
No
10,169,237
1
<ios><iphone><uiimage>
2012-04-16T05:47:46.133
10170414
UIImage from array
<p>I am working with an API which gives me an image as the example below. I am unsure how I can convert this array of values into an image. I have not seen this before.</p> <p>Does anyone know how I can make the following array of values into a UIImage?</p> <p><code>[255,216,255,224,0,16,74,70,73,70,0,1,1,1,0,96,...]</code></p>
No
10,201,830
1
<powershell><active-directory><powershell-2.0>
2012-04-18T02:04:59.870
10204290
Get-ADComputer and MemberOf
<p>I am very new to Powershell and am having an issue when using the <code>Get-ADUser</code> and <code>GetADComputer</code> cmdlets.</p> <p>I am trying to use the <code>Get-ADComputer</code> and <code>Get-ADUser</code> to retrieve the <code>memberOf</code> from Active-Directory of all the users and computers. It only appears to be retrieving information from users and computers that are in 2 or more groups. Any users/computers that are only in 1 group display nothing.</p> <p>For example: If UserA is in group Administrators I get no output when I use MemberOf. But if User2 is in both Administrators and Domains Administrators I get some output. However it will only output one of those groups.</p> <p>Get-ADGroup does the same thing.</p> <p>Is this normal? I can't imagine it is.</p> <p>Here is my code:</p> <pre><code>Get-ADUser -Filter * -Properties * | Select-Object -Property Name,MemberOf | Sort-Object -Property Name </code></pre> <p>Thanks</p>
No
10,216,841
5
<deployment><capistrano>
2012-04-18T19:46:28.317
10290135
Passing parameters to Capistrano
<p>I'm looking into the possibility of using Capistrano as a generic deploy solution. By "generic", I mean not-rails. I'm not happy with the quality of the documentation I'm finding, though, granted, I'm not looking at the ones that presume you are deploying rails. So I'll just try to hack up something based on a few examples, but there are a couple of problems I'm facing right from the start.</p> <p>My problem is that <code>cap deploy</code> doesn't have enough information to do anything. Importantly, it is missing the tag for the version I want to deploy, and this <em>has</em> to be passed on the command line.</p> <p>The other problem is how I specify my git repository. Our git server is accessed by SSH on the user's account, but I don't know how to change <code>deploy.rb</code> to use the user's id as part of the scm URL.</p> <p>So, how do I accomplish these things? </p> <p><strong>Example</strong></p> <p>I want to deploy the result of the first sprint of the second release. That's tagged in the git repository as <code>r2s1</code>. Also, let's say user "johndoe" gets the task of deploying the system. To access the repository, he has to use the URL <code>johndoe@gitsrv.domain:app</code>. So the remote URL for the repository depends on the user id.</p> <p>The command lines to get the desired files would be these:</p> <pre><code>git clone johndoe@gitsrv.domain:app cd app git checkout r2s1 </code></pre>
No
10,248,542
1
<jquery><google-maps>
2012-04-20T14:52:09.893
10251405
possible to get the square coordinates using imgAreaSelect and Google Maps?
<p>I had seen a site do this a long time ago...</p> <p>Is it possible to 'crop' an area in GoogleMaps using imgAreaSelect (http://odyniec.net/projects/imgareaselect/) or jCrop and get the coordinates for the square from it?</p> <p>thx</p>
No
10,304,817
2
<c#><.net><linq><entity-framework-4>
2012-04-24T19:36:31.650
null
LINQ to EF4 Query Where clause not filtering as expected
<p>I've googled for this but can't find anything obviously related, so posting here for some insight. Using LINQ / EF4. Here's the code snippet:</p> <pre><code> private const string JOB_FAILED = "Failed"; // other code.. var successfulJobs = context.Jobs.Where(x =&gt; x.Status != JOB_FAILED); foreach (Job successfulJob in successfulJobs) { context.DeleteObject(successfulJob); } </code></pre> <p>I would expect successfulJobs to contain all jobs where Job.Status != "Failed". However, the code witihn foreach{} executes when Job.Status DOES equal "Failed". Am I missing something fundamental here about LINQ\Lambda?</p> <p>EDIT: Generated SQL as requested, seems ok.</p> <pre><code>SELECT [Extent1].[Id] AS [Id], [Extent1].[Parameters] AS [Parameters], [Extent1].[Status] AS [Status], [Extent1].[Created] AS [Created], [Extent1].[Modified] AS [Modified] FROM [bws].[JobRunner_Tasks] AS [Extent1] WHERE N'Failed' &lt;&gt; [Extent1].[Status] </code></pre>
No
10,314,954
3
<sharepoint><master-pages>
2012-04-25T11:47:33.353
null
Can the SharePoint 2007 site's MasterPage opened?
<p>There was a Sharepoint 2007 site that was maintained without touching the code. People had their masterpage set by using links in the UI, SiteActions>>(under Look &amp; Feel)MasterPage selecting default.master.</p> <p>Now, they need some changes in the masterpage.</p> <p>When I opened the site in Sharepoint designer 2007, the masterpage was referenced as MasterPageFile="~masterurl/default.master".</p> <p>I want to open this master page which they refer to ~masterurl/default.master.</p> <p>I have checked every .master inside the _catalogs folder but nothing is fruitful.</p> <p>My task is to identify the masterpage they have used &amp; to modify it.</p> <p>Help me loacte the master page ~masterurl/default.master</p>
No
10,397,427
4
<git><branch><master>
2012-05-01T12:06:50.330
null
what should the master branch contain in git
<p>I have read about multiple different git branching strategies and I was suprized that the master branch was often used as a 'production-ready' branch and there would be an additional uat and dev branch. I'm thinking to set up our git repository with the same 3 branches, but to let 'master' contain the dev code and add a production and uat branch. That way, developers can simply merge to the default git branch (being 'master'). Is there a reason not to do it like that?</p> <p>gr,</p> <p>Coen</p>
No
10,508,117
2
<android>
2012-05-08T23:53:59.217
10508135
Use onBackPressed to save a file
<p>I want to allow users to save a list of favourite items from a list, so I display the full list using a Listview with checkboxes, and the user will check or uncheck items in the list.</p> <p>When the user presses the back button, I want to be able to save the checked items out to a separate file on the SD card.</p> <p>I'm using the following method in my Activity:</p> <pre><code>@Override public void onBackPressed() { // TODO Auto-generated method stub } </code></pre> <p>However, the list that I create within my OnCreate method is not available within the onBackPressed method - ie it's out of scope.</p> <p>If I try and pass the list into the onBackPressed method as follows:</p> <pre><code>@Override public void onBackPressed(ArrayList&lt;HashMap&lt;String, Object&gt;&gt; checked_list) { // TODO Auto-generated method stub } </code></pre> <p>Then I get the error:</p> <p>"The method onBackPressed(ArrayList>) of type SetFavourites must override or implement a supertype method" and Eclipse prompts to remove the @Override.</p> <p>But when I do this, then the onBackPressed method never gets called.</p> <p>How can I pass variables into the onBackPressed method so that I can perform actions on data within my Activity before exiting?</p> <p>Thanks</p>
No
10,535,227
2
<jsf-2><weblogic><myfaces>
2012-05-10T13:40:04.973
null
No saved view state could be found for the view identifier
<p>When I was running my JSF application on Jetty server it was running fine.</p> <p>But as I moved this to Weblogic server, it started giving me this error.</p> <pre><code>javax.faces.application.ViewExpiredException: /wsListing.xhtmlNo saved view state could be found for the view identifier: /wsListing.xhtml at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:132) at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:26) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1398) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200) at weblogic.work.ExecuteThread.run(ExecuteThread.java:172) </code></pre> <p>wsListing.xhtml is given below:</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:lang="en"&gt; &lt;f:view xmlns:c="http://java.sun.com/jstl/core" xmlns:s="http://www.springframework.org/tags" xmlns:form="http://www.springframework.org/tags/form"&gt; &lt;h:head&gt; &lt;h:outputStylesheet library="css" name="../resources/css/style.css" target="head" /&gt; &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Test Client&lt;/title&gt; &lt;link rel="shortcut icon" href="../resources/images/favicon.ico" /&gt; &lt;link rel="stylesheet" href="../resources/css/style.css" type="text/css" media="all" /&gt; &lt;/h:head&gt; &lt;h:body&gt; &lt;ui:include src="header.xhtml" /&gt; &lt;div id="home-training-container"&gt; &lt;h:form&gt; &lt;table align="center" border="1"&gt; &lt;tr&gt; &lt;td&gt;&lt;h:commandLink value="First Web Service" action="#{wsListingBean.action}"&gt; &lt;f:setPropertyActionListener target="#{wsListingBean.webServiceId}" value="abcService" /&gt; &lt;/h:commandLink&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;h:commandLink value="Second Web Service" action="#{wsListingBean.action}"&gt; &lt;f:setPropertyActionListener target="#{wsListingBean.webServiceId}" value="filterabc" /&gt; &lt;/h:commandLink&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Third Web Service&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Fourth Web Service&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Fifth Web Service&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/h:form&gt; &lt;/div&gt; &lt;ui:include src="footer.xhtml" /&gt; &lt;/h:body&gt; &lt;/f:view&gt; &lt;/html&gt; </code></pre> <p>When I click on any of the command links then this issue is coming:</p> <pre><code>&lt;h:commandLink value="First Web Service" action="#{wsListingBean.action}"&gt; &lt;f:setPropertyActionListener target="#{wsListingBean.webServiceId}" value="abcService" /&gt; </code></pre> <p>Anyone having any idea regarding what this view state is?</p>
No
10,575,893
1
<internet-explorer-8><datepicker><css>
2012-05-13T23:00:46.723
27694630
JsDatePick's data picker appears all broken in appearance in IE8 when used in my page
<p>I tried to use <a href="http://javascriptcalendar.org/" rel="nofollow">JsDatePick</a> .</p> <p>The example HTML supplied with the tool ran just fine in both FireFox and IE8</p> <p>However, when I tried to use the picker in my own HTML page with existing structure and CSS:</p> <ul> <li><p>In FireFox it worked fine (the picker appeared as a calendar next to the input field)</p></li> <li><p>In IE8, the picker apeared as a VERTICAL column of dates, BELOW my page (e.g. you need to scroll down to see it), e.g.</p> <pre><code> ---------------------------------------------- | My main page DIV, sized ~100% page height | | | | &lt;INPUT FIELD&gt; | | | | | | | | | | | | | ---------------------------------------------- ---- BOTTOM OF PAGE HERE --- [1] &lt;-- This was meant to be a 5x7 [2] &lt;-- calendar pop-up appearing [3] &lt;-- under the INPUT FIELD [...] &lt;-- NOTE that the horizontal position is correct, [30] &lt;-- Fully aligned with INPUT FIELD </code></pre></li> </ul> <p>Unfortunately, I'm not enough of a CSS expert to even begin understanding how to troubleshoot it.</p> <ol> <li><p>If anyone used JsDatePick, and ran into this problem, any ideas on how to fix are appreciated</p></li> <li><p>Barring that, what would be the steps I need to take to troubleshoot this (Seemingly CSS conflict) problem?</p> <p>The page has its own stylesheets but one of them is 100% class-limited styles, while the second one has some global styles, BUT nothing with a position defined, and any styles that are not class specific are font style for <code>body</code> and <code>h1</code>.</p></li> </ol>
No
10,577,543
1
<oracle><cursor><sys-refcursor>
2012-05-14T04:34:38.440
10581924
dbms_sql.to_cursor_number - Getting Invalid Cursor error for SYS_REFCURSOR
<p>I have the following code for table and view creation.</p> <pre><code>create table test_company ( comp_id number , comp_name varchar2(500) ) ; insert into test_company values(1, 'CompanyA'); insert into test_company values(2, 'CompanyB'); insert into test_company values(3, 'CompanyC'); create or replace view test_company_view as select * from test_company; </code></pre> <p>And I have the following code for my cursor testing. But <code>dbms_sql.to_cursor_number</code> got error <code>ORA-01001: invalid cursor</code></p> <pre><code>set serveroutput on; declare reader test_company_view%ROWTYPE; datacursor SYS_REFCURSOR; v_cursor_id number; begin open datacursor for select * from test_company_view; v_cursor_id := dbms_sql.to_cursor_number(datacursor); -- ERROR: invalid cursor loop fetch datacursor into reader; exit when datacursor%NOTFOUND; dbms_output.put_line(reader.comp_id); end loop; close datacursor; end; </code></pre> <p>What did I do wrong? Thank you for your helps!</p> <p>I have tried <code>strongly-typed REF CURSOR</code> and <code>weakly-typed REF CURSOR</code> but they got the same error.</p>
No
10,606,076
3
<c#><.net><datetime><time><datetime-format>
2012-05-15T17:44:44.360
10606297
Is there a way to print a calculated time format string in C#?
<p>I know the title might be confusing, but I'm not sure how to word it better....</p> <p>I'm doing this to get the logs of the current hour:</p> <pre><code>'TraceSink-'yyyy-MM-dd HH'-Hourly.log' </code></pre> <p>How can I get the previous hour? i.e.:</p> <pre><code>'TraceSink-'yyyy-MM-dd (HH-1)'-Hourly.log' </code></pre> <p>Is there anything possible with time format like that?</p> <p><strong>EDIT</strong>: I don't have access to the C# code but a exe.config where I can change what goes inside.</p> <p>Like var on DateTime.ToString(var);</p> <p>Am I asking too much?</p>
No
10,707,229
2
<javascript><jquery><forms><jquery-ui>
2012-05-22T17:45:46.537
10731817
jquery: Disable/Enable button not working after reset
<p>I have a form with n multiple choice questions implemented as radio buttons (using <code>jquery-ui</code>). I would like to ensure that all the questions have been answered before allowing the user to submit the form. I am running into two issues while performing this validation:</p> <ul> <li>On initial load, the submit button does not respond to clicks or mouseovers until all questions have a response selected as desired. However, it still appears to be clickable (I would like this to be faded out) </li> </ul> <p><img src="https://i.stack.imgur.com/nGabF.png" alt="enter image description here"></p> <ul> <li>If the reset button is pressed, the submit button is faded out (as desired) but I am unable to re-enable the submit button once the form has been completed.</li> </ul> <p><img src="https://i.stack.imgur.com/rXbPs.png" alt="enter image description here"></p> <p>This is my first time using javascipt/jquery. What is going wrong? How do I achieve the desired functionality across both cases?</p> <hr> <p>Here is the pertinent javascript portion:</p> <pre><code>$(document).ready(function(){ $( '.button' ).button (); $( '.radio-set' ).buttonset (); $( 'input[type="submit"]' ).attr( 'disabled', true ); var progress = 0; var total_fields = $('.response').length /* Track Progress function*/ $('input[type="radio"]').click( function(){ progress = $('input[type="radio"]:checked').length $(".progressbar").progressbar( {value: ( progress / total_fields ) * 100} ) console.log(progress, total_fields) if( progress == total_fields ){ console.log( "Hello from inside the conditional" ) $( 'input[type="submit"]' ).removeAttr( 'disabled' ); } }); $( 'input[type="reset"]' ).click( function(){ progress = 0 $( ".progressbar" ).progressbar( {value: 0} ) $( 'input[type="submit"]' ).attr( 'disabled', true ); }); }); </code></pre> <p>Example of one of the questions within the form (with bacon filler text):</p> <pre><code> &lt;div class="model_feature"&gt; &lt;span class="feature_name" title="M1"&gt;M1&lt;/span&gt; &lt;span class="response radio-set"&gt; &lt;label for="M1-1"&gt;1&lt;/label&gt; &lt;input type="radio" name="M1" id="M1-1" value="1" class="feature-input" autocomplete="off" /&gt; &lt;label for="M1-0"&gt;0&lt;/label&gt; &lt;input type="radio" name="M1" id="M1-0" value="0" class="feature-input" autocomplete="off" /&gt; &lt;label for="M1-Unk"&gt;Unknown&lt;/label&gt; &lt;input type="radio" name="M1" id="M1-Unk" value="Unknown" class="feature-input" autocomplete="off" /&gt; &lt;/span &lt;!-- close response --&gt; &lt;span class="feature_description"&gt;Chicken spare ribs capicola beef brisket hamburger. Kielbasa filet mignon tail ribeye ball tip ground round.&lt;/span&gt; &lt;/div&gt; &lt;!-- close model_feature --&gt; </code></pre> <p>Input and Reset buttons for completeness: </p> <pre><code> &lt;input type="reset" class="button" id="reset-button" /&gt; &lt;input type="submit" class="button" id="submit-button" disabled="disabled" /&gt; </code></pre>
No
10,852,477
1
<asp.net><silverlight><internet-explorer><cookies><browser-cache>
2012-06-01T14:47:37.910
null
How to simulate Full IE cache for ASP.NET or Silverlight app
<p>What is the best approach to similate a browser full cache when debugging a Silverlight or ASP.NET application? There is some intermittent behaviour that I want to make a determination if browser cache or full cookie cache is playing a part in this behaviour I am seeing.</p> <p>Thanks for the help, in advance :)</p>
No
10,865,201
2
<sql-server><tsql><size>
2012-06-02T19:19:10.847
10865279
Database size bigger after delete from table
<p>After I delete huge amount of data from a SQL Server database table, the database size increased.</p> <p>When I run <code>sp_spaceused</code> it shows me 2625.25 MB. It used to be ~ 1800.00 MB before I deleted from table.</p> <p>Is there any specific reason it keeps growing even if I delete data?</p>
No
10,868,406
1
<.net><c#-4.0><.net-4.0><pia><office-pia>
2012-06-03T06:35:48.143
null
c#.net 4.0 - no pia - is this all I need?
<p>Reference the Microsoft.Office.Interop.Excel and set Embed Interop Type to true? </p> <p>Will doing so ensure my app is backward compatible? (As long as I use safe methods that work on all versions.)</p> <p>Or do I have to use something like late binding and all in order for it to be compatible against multiple versions?</p>
No
11,055,976
1
<php><html><wordpress>
2012-06-15T18:06:48.877
11056660
How to retrieve attachments from child pages of a specific Page in WordPress?
<p>How would I retrieve attachments from all <strong>subpages</strong> of a specific Page ID? </p> <p>Example:</p> <p>SPECIFIC PAGE</p> <ul> <li>Child (with attachments) </li> <li>Child (with attachments) </li> <li>Child (with attachments) </li> </ul> <p>I'm currently using this code to retrieve all attachments site-wide, however I would like to limit this to only pull images from all children of a specific Page.</p> <pre><code>&lt;?php $args = array( 'post_type' =&gt; 'attachment', 'numberposts' =&gt; -1, 'post_status' =&gt; null, 'post_parent' =&gt; null ); $attachments = get_posts( $args ); if ($attachments) { foreach ( $attachments as $post ) { setup_postdata($post); the_title(); the_attachment_link($post-&gt;ID, false); the_excerpt(); } } ?&gt; </code></pre> <p>Almost there using this code as per Nick's suggestion below:</p> <pre><code>&lt;?php $mypages = get_pages('child_of=19'); foreach ( $mypages as $mypage ) { $attachments = get_children(array('post_parent' =&gt; $mypage-&gt;ID, 'numberposts' =&gt; 1, 'post_type' =&gt; 'attachment', 'post_mime_type' =&gt; 'image', 'orderby' =&gt; 'rand')); if ($attachments) { foreach ( $attachments as $post ) { setup_postdata($post); the_title(); the_attachment_link($post-&gt;ID, false); the_excerpt(); } } } ?&gt; </code></pre> <p>However, there are two remaining issues:</p> <ol> <li>Limiting the amount of <strong>total photos</strong> pulled. Using 'numberposts' only limits the amount of images pulled from each post</li> <li>Randomization. Orderby => rand only randomizes the images within each post. I would like to randomly shuffle the order for everything. </li> </ol>
No
11,106,123
1
<sql-server-2008><ssas><bids>
2012-06-19T17:22:42.033
11207679
How do you apply a Weight Factor to an M2M Dimensional Relationship in SSAS?
<p>I have a many-to-many relationship with a weight factor column in the bridge table but I don't know how to make use of this when developing my cube in BIDS. Via Google, I have found many descriptions of what a weight factor is and why you would use one (I understand all this perfectly), but I can't find a practical tutorial of how to configure this in a cube in BIDS.</p> <p>Click-by-click instructions would be ideal but if some one could at least point me at the right window I could probably figure out the rest. Thanks in advance.</p>
No
11,190,457
3
<android><android-layout>
2012-06-25T13:42:16.687
11194037
Memory leaks, singleInstance
<p>I've got a couple of activities where I display images with help of <a href="https://github.com/thest1/LazyList/blob/master/src/com/fedorvlasov/lazylist/ImageLoader.java" rel="nofollow noreferrer">this lib</a>. The thing is the app is running out of memory. I tried to gc.clean(), null references, call clear on imageloader object but in vain.</p> <p>In MAT i've found out that I have multiple objects of the same activity and it a default behaviour, if I'm not mistaken. I used singleInstance to suppress multiple instances and it has helped with memory leaks.</p> <p>Right now, due to singleInstance, I'm having troubles with navigation. Do you think I should continue with singleInstance or try to fix memory leak with multiple instances ?</p> <p>Here's ImageView gc roots inspection: <img src="https://i.stack.imgur.com/iDHCE.jpg" alt="enter image description here"></p> <p>UPD:</p> <pre><code> Bitmap bitmap=null; URL imageUrl = new URL(url); HttpURLConnection conn = (HttpURLConnection)imageUrl.openConnection(); conn.setConnectTimeout(30000); conn.setReadTimeout(30000); conn.setInstanceFollowRedirects(true); InputStream is=conn.getInputStream(); OutputStream os = new FileOutputStream(f); Utils.CopyStream(is, os); os.close(); bitmap = decodeFile(f); return bitmap; ImageView imageView = (ImageView) convertView; if(convertView == null){ imageView = new ImageView(_currentActivity); } </code></pre> <p>UPD2(navigation strategies):</p> <p>I've got a constant header with buttons which start home activity(with gallery) and profile activity; secondly there's a subheader wich also holds 3 buttons which point to another 3 activities with listviews(consisting of imageviews + labels).</p> <p>These header, subheader elements are available on every activity in application; The link-buttons do nothing but:</p> <pre><code>startActivity(new Intent(getActivity(), MainActivity.class)); </code></pre> <p>or</p> <pre><code>Intent activityIntent = new Intent(getActivity(), SomeActivityWithListViewInside.class); // passing some data like list id activityIntent.putExtra("list_id", listId); startActivity(activityIntent); </code></pre> <p>So, those activity instances are caused by those startActivity calls - do you think I should play with singleTop or any other intent parameter to avoid this issue ?</p>
No
11,217,948
1
<r>
2012-06-27T00:52:17.860
11217985
call to sapply() works in interactive mode, not in batch mode
<p>I need to execute some commands in batch mode (e.g., via Rscript). They work in interactive mode, but not in batch mode. Here is a minimal example: <code>sapply(1:3, is, "numeric")</code>. Why does this work in interactive mode but return an error in batch mode? Is there a way to make a command like this work in batch mode?</p> <p>More specifically, I need to write scripts and to run them in batch mode. They need to call a function (which I didn't write and can't edit) that looks like this:</p> <pre><code>testfun &lt;- function (...) { args &lt;- list(...) if (any(!sapply(args, is, "numeric"))) stop("All arguments must be numeric.") else writeLines("All arguments look OK.") } </code></pre> <p>I need to pass a list to this function. A command like <code>testfun(list(1, 2, 3))</code> works in interactive mode. But in batch mode, it produces an error: <code>Error in match.fun(FUN) : object 'is' not found</code>. I tried <code>debugger()</code> to get a handle on the problem, but it didn't give me any insight. I also looked through r-help, the R FAQ, R Inferno, but I couldn't find anything that spoke to this problem.</p>
No
11,241,318
1
<centos><virtual-machine><virtualization><virtualbox><samba>
2012-06-28T09:05:15.183
11465419
I can ping my centOS virtual machine but I cant access its shared folders
<p>so this is the setup:</p> <p>I have a Windows XP installed, VirtualBox and a centOS 6.2 virtual machine. I installed Samba, and currently, my VM and host Windows are in the same subnet. I can ping my VM from Windows and vice versa. I have a created a shared folder via Samba like this:</p> <pre><code>[Share] path = /home/share writable = yes guest ok = yes guest only = yes create mode = 0777 directory mode = 0777 share modes = yes </code></pre> <p>*<em>I followed a full tutorial <a href="http://www.server-world.info/en/note?os=CentOS_6&amp;p=samba&amp;f=1" rel="nofollow">here</a></em></p> <p>My problem now is that, when I try to access such folder like this \192.xx.xxx.xxx\home\share (192.xx.xxx.xxx is the IP address of my VM) from Windows "Run", Windows can't find it.</p> <p>P.S. I've turned off my Windows Firewall (although Trend Micro personal firewall is still on)</p>
No
11,486,900
2
<objective-c><cocoa-touch><cocoa><core-data>
2012-07-14T19:46:38.080
11488910
NSOperationQueue designated thread
<p>I want to use an <code>NSOperationQueue</code> to dispatch CoreData operations. However, operation queue behavior is not always the same (e.g. it dispatches using <code>libdispatch</code> on iOS 4.0/OS 10.6 which uses thread pools) and a queue might not always use the same thread (as <code>NSManagedObjectContext</code> requires).</p> <p>Can I force a serial <code>NSOperationQueue</code> to execute on a single thread? Or do I have to create my own simple queuing mechanism for that?</p>
No
11,489,151
1
<objective-c><nsarray><nscoding>
2012-07-15T03:24:14.687
null
Saving nested objects and NSArrays in Objective C using NSCoding
<p>I'm attempting to save an object that has an NSMutableArray of nested objects. I want to use the NSCoding Protocol to save the file under the documents directory. Do I need to encode every object (including the nested ones) or just the super class itself? Right now I'm only encoding the super class' objects. </p> <p>To better illustrate what my object hierarchy looks like:</p> <pre><code>Main Object -NSString -int -NSMutableArray -int -double -char </code></pre>
No
11,494,105
3
<c#><awesomium>
2012-07-15T17:32:47.137
null
C# - Using Awesomium to Interact with Gmail
<p>I'm able to navigate to gmail, but then I want to do something as simple as enter the credientials and click the login button.</p> <pre><code>private void btnSubmit_Click(object sender, EventArgs e) { btnSubmit.Enabled = false; webGmail.LoadURL("http://www.gmail.com"); webGmail.LoadCompleted += ExecuteSomething; } private void ExecuteSomething(object sender, EventArgs eventArgs) { webGmail.ExecuteJavascript(@"&lt;script src = 'http://code.jquery.com/jquery-latest.min.js' type = 'text/javascript'&gt;&lt;/script&gt;"); webGmail.ExecuteJavascript(@"$('#Email').val('foo');"); webGmail.ExecuteJavascript(@"$('#Passwd').val('bar');"); webGmail.ExecuteJavascript(@"$('#signIn').click();"); } </code></pre> <p>Nothing happens. I know using developer tools with Chrome that you cant modify anything on the page. But is there a way of filling in forms?</p> <p><strong>Are there any other better headless browsers? I actually need one that supports a web control that I can put into my form so that I can see what is going on. This is mandatory</strong></p>
No
11,562,215
2
<java><eclipse><memory-leaks><threadpool>
2012-07-19T13:43:48.553
11564125
Getting compile error using getThreadAllocatedBytes() in ecplise
<p>I am trying to monitor my threads in the Quartz scheduler. I need to come up with an estimation of how much memory needed for executing my jobs.</p> <p>I am trying to use the method:</p> <pre class="lang-java prettyprint-override"><code> import java.lang.management.ManagementFactory; ManagementFactory.getThreadMXBean().getThreadAllocationBytes(); </code></pre> <p>However, in Eclipse I am getting an error:</p> <pre><code>The method getThreadAllocationBytes() is undefined for the type ThreadMXBean </code></pre> <p>I searched and found out that the method was introduced in JDK6u25 and since Eclipse is using its own compiler I cannot fix the problem. </p> <p>Compiling the class without Eclipse seems to be a weak solution since I need to be able to compile the project using Eclipse.</p> <p>Can you give me some advice on how to fix this problem?</p>
No
11,565,136
1
<php><cakephp>
2012-07-19T16:23:14.880
11565925
CakeEmail - Send HTML and Plain-text message manually
<p>I want to send a plain-text and html email from CakePHP using the built-in function, but without touching the .ctp files.</p> <p>Here's what i want from the CakeEmail : </p> <pre><code>//Send email to user $email = new CakeEmail('default'); $email-&gt;to($customers['Customer']['email']); $email-&gt;subject('Password reset'); $email-&gt;htmlMessage('&lt;div&gt;Reset the password&lt;/div&gt;'); $email-&gt;textMessage('Password the reset'); $email-&gt;send(); </code></pre> <p>But apparently, these functions don't exist, so anyone know of an alternative solution? I doesn't want to touch the Email folder of CakePHP, as the email layout &amp; content is generated dynamically.</p> <p>Cake version 2.0.6</p> <p>Bascially, i want a CakePHP version of this code : <a href="http://www.daniweb.com/web-development/php/threads/2959/sending-htmlplain-text-emails" rel="nofollow">http://www.daniweb.com/web-development/php/threads/2959/sending-htmlplain-text-emails</a> Capable of sending both HTML and Plain-text email</p>
No
11,580,132
1
<iphone><facebook><image><post><share>
2012-07-20T13:15:24.273
null
Post image on Facebook wall through iPhone app
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/750328/documented-process-for-using-facebook-connect-for-the-iphone-to-upload-photos">Documented process for using facebook connect for the iPhone to upload photos</a> </p> </blockquote> <p>I have aמ iPhone app and would like to know how to make an image which, when clicked, the image will be posted to the user's Facebook profile.</p> <p>The app is based on Facebook, i mean, you register with your Facebook account.</p>
No
11,608,532
3
<python><comparison><set><python-2.x>
2012-07-23T08:03:19.127
11608544
How to hide the 'set' keyword in output while using set in python
<p>Ok so I have two lists in python</p> <pre><code>a = ['bad', 'horrible'] b = ['bad', 'good'] </code></pre> <p>I'm using the set operator to compare the two lists and give an output if a common word exists between the two sets. </p> <pre><code>print set(a) &amp; set (b) </code></pre> <p>This gives the output as,</p> <pre><code>set(['bad']) </code></pre> <p>Is there anyway to remove the keyword 'set' in the output??</p> <p>I want the output to look like</p> <pre><code>['bad'] </code></pre>
No
11,640,681
4
<c++><multithreading><mutex>
2012-07-24T23:19:52.140
11640729
Thread-safe way to build mutex protection into a C++ class?
<p>I'm trying to implement a producer/consumer model multithreaded program in C++ for a project I'm working on. The basic idea is that the main thread creates a second thread to watch a serial port for new data, process the data and put the result in a buffer that is periodically polled by the main thread. I've never written multi-threaded programs before. I've been reading lots of tutorials, but they're all in C. I think I've got a handle on the basic concepts, but I'm trying to c++ify it. For the buffer, I want to create a data class with mutex protection built in. This is what I came up with.</p> <p>1) Am I going about this the wrong way? Is there a smarter way to implement a protected data class?</p> <p>2) What will happen in the following code if two threads try to call <code>ProtectedBuffer::add_back()</code> at the same time?</p> <pre><code>#include &lt;deque&gt; #include "pthread.h" template &lt;class T&gt; class ProtectedBuffer { std::deque&lt;T&gt; buffer; pthread_mutex_t mutex; public: void add_back(T data) { pthread_mutex_lock(&amp;mutex); buffer.push_back(data); pthread_mutex_unlock(&amp;mutex); } void get_front(T &amp;data) { pthread_mutex_lock(&amp;mutex); data = buffer.front(); buffer.pop_front(); pthread_mutex_unlock(&amp;mutex); } }; </code></pre> <p>Edit: Thanks for all the great suggestions. I've tried to implement them below. I also added some error checking so if a thread somehow manages to try to lock the same mutex twice it will fail gracefully. I think.</p> <pre><code>#include "pthread.h" #include &lt;deque&gt; class Lock { pthread_mutex_t &amp;m; bool locked; int error; public: explicit Lock(pthread_mutex_t &amp; _m) : m(_m) { error = pthread_mutex_lock(&amp;m); if (error == 0) { locked = true; } else { locked = false; } } ~Lock() { if (locked) pthread_mutex_unlock(&amp;m); } bool is_locked() { return locked; } }; class TryToLock { pthread_mutex_t &amp;m; bool locked; int error; public: explicit TryToLock(pthread_mutex_t &amp; _m) : m(_m) { error = pthread_mutex_trylock(&amp;m); if (error == 0) { locked = true; } else { locked = false; } } ~TryToLock() { if (locked) pthread_mutex_unlock(&amp;m); } bool is_locked() { return locked; } }; template &lt;class T&gt; class ProtectedBuffer{ pthread_mutex_t mutex; pthread_mutexattr_t mattr; std::deque&lt;T&gt; buffer; bool failbit; ProtectedBuffer(const ProtectedBuffer&amp; x); ProtectedBuffer&amp; operator= (const ProtectedBuffer&amp; x); public: ProtectedBuffer() { pthread_mutexattr_init(&amp;mattr); pthread_mutexattr_settype(&amp;mattr, PTHREAD_MUTEX_ERRORCHECK); pthread_mutex_init(&amp;mutex, &amp;mattr); failbit = false; } ~ProtectedBuffer() { pthread_mutex_destroy(&amp;mutex); pthread_mutexattr_destroy(&amp;mattr); } void add_back(T &amp;data) { Lock lck(mutex); if (!lck.locked()) { failbit = true; return; } buffer.push_back(data); failbit = false; } void get_front(T &amp;data) { Lock lck(mutex); if (!lck.locked()) { failbit = true; return; } if (buffer.empty()) { failbit = true; return; } data = buffer.front(); buffer.pop_front(); failbit = false; } void try_get_front(T &amp;data) { TryToLock lck(mutex); if (!lck.locked()) { failbit = true; return; } if (buffer.empty()) { failbit = true; return; } data = buffer.front(); buffer.pop_front(); failbit = false; } void try_add_back(T &amp;data) { TryToLock lck(mutex); if (!lck.locked()) { failbit = true; return; } buffer.push_back(data); failbit = false; } }; </code></pre>
No
11,694,623
1
<c#><sql-server-ce>
2012-07-27T19:39:47.503
11694843
SQL Server Compact Insertion
<p>i want to insert data into sql server Compact edition the database table screenshot is <a href="http://www.flickr.com/photos/56760865@N04/7657986538" rel="nofollow">Here >>> </a> i Want to add data in users the addition script is as follows</p> <pre><code>SqlCeConnection Con = new SqlCeConnection(); Con.ConnectionString = "Data Source = 'Database.sdf';" + "Password='Password';"; Con.Open(); int Amount=Convert.ToInt32(AmBox.Text), Code=Convert.ToInt32(MCode.Text), Num=Convert.ToInt32(MNum.Text); string Name=Convert.ToString(NBox.Text), FName=Convert.ToString(SOBox.Text), Address=Convert.ToString(AdBox.Text); SqlCeCommand Query =new SqlCeCommand("INSERT INTO Users VALUES " + "(++ID,Name,FName,Address,Code,Num,Amount)",Con); Query.ExecuteReader(); </code></pre> <p>When it runs it generates an error SAYING "The column name is not valid [Node Name (if any) =,Column name=ID ]</p> <p>I don't figure out the problem kindly tell me thanks!</p>
No
11,802,853
1
<c#><entity-framework>
2012-08-03T20:30:18.343
11802879
Initialize new instance of an entity framework object with constructor?
<p>Is it possible to use a constructor with EF entities?</p> <p>I want to add a new instance of an Entity Framework entity and add it to a List&lt;></p> <p>i.e.</p> <pre><code>List&lt;MyObject&gt; objectList = new List&lt;MyObject&gt;(); objectList.Add(new MyObject( "property" , 1); </code></pre> <p>instead of</p> <pre><code>List&lt;MyObject&gt; objectList = new List&lt;MyObject&gt;(); MyObject object = new MyObject(); object.Name = "property1"; object.ID = 1; objectList.Add(object); </code></pre>
No
11,913,501
3
<c++><string><cin>
2012-08-11T09:29:19.913
11913546
Using while(cin>>x)
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/2735315/c-cin-whitespace-question">C++ cin whitespace question</a> </p> </blockquote> <p>I'm having problem trying to understand this piece of code. I'd like to apologize if this question has already been answered but I didn't find it anywhere. I'm a beginner and its a very basic code. The problem is <strong>>></strong> operator stops reading when the first white space character is encountered but why is it in this case it outputs the complete input string even if we have white spaces in our string. It outputs every word of the string in separate lines. How is it that <em>cin>>x</em> can take input even after the white space? Plz help me out with the functioning of this code. Thanks in advance.</p> <pre><code>#include&lt;iostream&gt; #include&lt;string&gt; using std::cout; using std::cin; using std::string; using std::endl; int main() { string s; while (cin &gt;&gt; s) cout &lt;&lt; s &lt;&lt; endl; return 0; } </code></pre>
No
11,934,744
2
<php><regex>
2012-08-13T12:59:15.440
null
Regex : negative assertion
<p>I'm stuck with an easy regex to match URLs in a content. The goal is to remove the folder from the links like "/folder/id/123" and to replace them with "id/123" so it's a short relative one in the same folder.</p> <p>Actually I did</p> <pre><code>$pattern = "/\/?(\w+)\/id\/(\d)/i" $replacement = "id/$2"; return preg_replace($pattern, $replacement, $text); </code></pre> <p>and it seems to work fine.</p> <p>However, the last test that I'd like to to is to test that each url matched does NOT containt http://, if it's an external site which also use the same pattern /folder/id/123.</p> <p>I tried /[^http://] or (?&lt;!html)... and different things without success. Any help would be verys nice :-)</p> <pre><code> $pattern = "/(?&lt;!http)\b\/?(\w+)\/id\/(\d)/i"; ??????? </code></pre> <p>Thanks !</p> <p>Here is some examples : Thanks you VERY MUCH for your help :-)</p> <pre><code>(these should be replaced, "same folder" =&gt; short relative path only) &lt;a href="/mysite_admin/id/414"&gt;label&lt;/a&gt; ==&gt; &lt;a href="id/414"&gt;label&lt;/a&gt; &lt;a href="/mYsITe_ADMIN/iD/29"&gt;label with UPPERCASE&lt;/a&gt; ==&gt; &lt;a href="id/414"&gt;label with UPPERCASE&lt;/a&gt; (these should not be replaced, when there is http:// =&gt; external site, nothing to to) &lt;a href="http://mysite_admin/id/414"&gt;label&lt;/a&gt; ==&gt; &lt;a href="http://mysite_admin/id/414"&gt;label&lt;/a&gt; &lt;a href="http://www.google_admin.com"&gt;label&lt;/a&gt; ==&gt; &lt;a href="http://www.google_admin.com"&gt;label&lt;/a&gt; &lt;a href="http://anotherwebsite.com/id/32131"&gt;label&lt;/a&gt; ==&gt; &lt;a href="http://anotherwebsite.com/id/32131"&gt;labelid/32131&lt;/a&gt; &lt;a href="http://anotherwebsite_admin.com/id/32131"&gt;label&lt;/a&gt; ==&gt; &lt;a href="http://anotherwebsite_admin.com/id/32131"&gt;label&lt;/a&gt; </code></pre>
No
11,949,255
3
<mysql><sql><algorithm><sql-server-2008>
2012-08-14T09:16:06.037
11949727
Get Index of each letter series from dictionary database
<p>I have dictionary database and i have created one UI interface ,to place buttons alphabetically , on click of each Letter , i want to fetch first word in the Letter series </p> <p>Is there any trick or sql query by which i can list out, first word of each series against it's index</p> <p>Note : i also have , Index column for each word in the database.</p>
No
12,179,979
4
<c#><reporting>
2012-08-29T14:14:03.563
12180009
How do I get the current Date in C#
<p>I am using the Reporting feature in Visual Studio and I need to create a prop/variable to store the current date so I can display it on my form. I cannot seem to find the proper way to do this in the report view.</p> <p>I originally tried a property of : </p> <pre><code>public DateTime CurrentDate {get;} </code></pre> <p>This did not work because there is no setter for it. To fix the problem I :</p> <pre><code>public DateTime CurrentDate{get{return DateTime.Now;}} </code></pre> <p>Thanks for the suggestions. They lead me in the right direction.</p>
No
12,271,173
1
<r><linear-regression><least-squares><lm>
2012-09-04T20:51:03.067
12271589
Linear least squares fitting
<p>DF</p> <pre><code> times a b s ex 1 0 59 140 1e-4 1 2 20 59 140 1e-4 0 3 40 59 140 1e-4 0 4 60 59 140 1e-4 2 5 120 59 140 1e-4 20 6 180 59 140 1e-4 30 7 240 59 140 1e-4 31 8 360 59 140 1e-4 37 9 0 60 140 1e-4 0 10 20 60 140 1e-4 0 11 40 60 140 1e-4 0 12 60 60 140 1e-4 0 13 120 60 140 1e-4 3300 14 180 60 140 1e-4 6600 15 240 60 140 1e-4 7700 16 360 60 140 1e-4 7700 # dput(DF) structure(list(times = c(0, 20, 40, 60, 120, 180, 240, 360, 0, 20, 40, 60, 120, 180, 240, 360), a = c(59, 59, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 60, 60), b = c(140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140 ), s = c(1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04, 1e-04), ex = c(1, 0, 0, 2, 20, 30, 31, 37, 0, 0, 0, 0, 3300, 6600, 7700, 7700)), .Names = c("times", "a", "b", "s", "ex"), row.names = c(NA, 16L), class = "data.frame") </code></pre> <p>DF2 </p> <pre><code>prime times mean g1 0 1.0000000 g1 20 0.7202642 g1 40 0.8000305 g1 60 1.7430986 g1 120 16.5172242 g1 180 25.6521268 g1 240 33.9140056 g1 360 34.5735984 #dput(DF2) structure(list(times = c(0, 20, 40, 60, 120, 180, 240, 360), mean = c(1, 0.7202642, 0.8000305, 1.7430986, 16.5172242, 25.6521268, 33.9140056, 34.5735984)), .Names = c("times", "mean"), row.names = c(NA, -8L), class = "data.frame") </code></pre> <p>DF is an example of a larger data frame which actually has hundreds of combinations of the 'a','b', and 's' values which result in different 'ex' values. What I want to do is find the combination of 'a','b', and 's' whose 'ex' values (DF) best fit the 'mean' values (DF2) at equivalent 'times'. This fitting will be a comparison of 8 values at a time (ie, times == c(0,20,40,60,120,180,240,360).</p> <p>In this example, I would want 59, 140, and 1e-4 for the 'a', 'b', and 's' values, because those 'ex' values (DF) best fit the 'mean' values (DF2). </p> <p>I would like 'a','b', and 's' values for those values which 'ex' (DF) best fits 'mean' (DF2) </p> <p>Since I want one possible combination of the 'a','b', and 's' values a linear least squares fit model would be best. I would be comparing 8 values at a time -- where 'times' == 0 - 360. I don't want 'a', 'b', and 's' values which work best for each individual time point. I want 'a', 'b', and 's' values where all 8 'ex' (DF) best fit all 8 'mean' values (DF2) This is where I need help.</p> <p>I have never used linear least squares fitting, but I assume what I'm trying to do is possible. </p> <pre><code> lm(DF2$mean ~ DF$ex,....) # i'm not sure if I should combine the two # data frames first then use that as my data argument, then # where I would include 'times' as the point of comparison, # if that would be used in subset? </code></pre>
No
12,283,113
6
<python><list><sublist>
2012-09-05T13:55:57.937
null
Printing item from a sublist
<pre><code>data = [['a','b'], ['a','c']] print data[0[0]] &gt;&gt;&gt; 0 </code></pre> <p>When I try this, I get an error. How could I print the 1st item from 1st list?</p>
No
12,343,233
1
<maven><ant><cargo>
2012-09-09T21:40:48.437
null
Cargo run / start not working, missing Ant dependency?
<p>I've been trying to set up the cargo-maven2 plugin (although I am using Maven 3; and this is supposed to be ok) so that I can start a container during the pre-integration-test phase and shut it down in the post-integration test phase.</p> <p>I'm having no luck. I keep getting this error message:</p> <pre><code>Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.4:start (start-container) on project microgivr.web: Execution start-container of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.4:start failed: Unable to load the mojo 'start' in the plugin 'org.codehaus.cargo:cargo-maven2-plugin:1.2.4'. A required class is missing: org/apache/tools/ant/BuildException </code></pre> <p>Easy fix, right? Add Ant as a dependency. So I add:</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;org.apache.ant&lt;/groupId&gt; &lt;artifactId&gt;ant&lt;/artifactId&gt; &lt;version&gt;1.8.4&lt;/version&gt; &lt;/dependency&gt; </code></pre> <p>(And lord only know why this should need Ant in the first place.)</p> <p>I can now find org.apache.tools.ant.BuildException on my classpath, but I STILL get this error.</p> <p>So, thinking this is surely some issue with my own build, I decided to start fresh, using the maven2-cargo-plugin archetype documented here: <a href="http://cargo.codehaus.org/Maven2+Archetypes" rel="nofollow">http://cargo.codehaus.org/Maven2+Archetypes</a></p> <p>You know what? Same problem!</p> <p>I've tried different versions of the plugin. I've tried different versions of Ant. No luck.</p> <p>Someone MUST have run into this before. I see mentions of this issue online, but don't see any solutions.</p> <p>Any insight is appreciated!</p>
No
README.md exists but content is empty. Use the Edit dataset card button to edit it.
Downloads last month
102
Edit dataset card