text:
Q: Sql errorjava.sql.SQLIntegrityConstraintViolationException I have written a Java servlet program and run it through local Tomcat 7, But it was showing following error :
   Sql errorjava.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("SYSTEM"."PASSMANAGER"."PASS")

When i post values was not reading password.It showing password is null.
My source code is in following page :
 http://stackoverflow.com/questions/13889694/the-requested-resource-is-not-available

If anyone know the solution please help me...........

A: hey correct your code in servlet .it will work
 password=req.getParameter("pass");


text:
Q: Where does Google Drive store auto backed up photos? I've set up photos and videos automatic backup on the Google Drive's iOS app following these instructions and I took a photo using my iPhone to test it.
After a while I could find the picture and open it on the "Recent" tab on the website. But I don't know where it is stored (the name of the folder). I also have Google Drive installed on my mac and I couldn't find it there either.
Does anyone know where can I find it?

A: I may be wrong, as I don't have Google Drive set to back up Photos, but I think you need to access them from the Google Photos website or mobile app, not from Drive.
I will do a little experimenting, but I believe this is the case.
EDIT
Yes, it appears they do not show in a folder in Drive by default. You have to enable the feature to mirror them in Drive. Otherwise, access them through Google Photos or Google+.
http://www.slashgear.com/what-you-need-to-know-about-google-drives-photos-backup-06377675/

redpajama_set_name: RedPajamaStackExchange


text:
Q: .htaccess How to redirect root URL to subdirectory files, rewrite to clean URL AND not affect subdomains? Haven't been able to find what I'm looking for in .htaccess QA's on here so forgive me if this is duplicate. I have the following problem with a static HTML site. Structure is below.
My relative paths in info.html and contact.html have to use /home/css/style.css while index.html uses /css/style.css. Thanks for help.
Root
- .htaccess
↳ Drupal
  - .git
↳ Dev
  - .git
↳ Home
  - .htaccess
  - .git
  - css
  - js
  - img
  - info.html
  - contact.html
  - index.html

Goal

*

*Dev.example.com to use all the files from /Dev

*example.com to use all the files from example.com/home

*example.com/info to redirect from example.com/home/info.html.

*example.com/contact to redirect from example.com/home/contact.html.

What I've tried so far
in root .htaccess
      # Set a default home directory, (this subfolder always loads)
  # RewriteEngine On
  # RewriteCond %{THE_REQUEST} ^GET\ /home/
  # # RewriteCond %{HTTP_HOST} ^(www\.)?example.com$
  # RewriteRule ^home/(.*) /$1 [L,R=301]

  # RewriteCond %{HTTP_HOST} ^(www\.)?example.com$
  # RewriteRule !^home/ home%{REQUEST_URI} [L]

  Options -Indexes

  ErrorDocument 404 /missing.html

  # compress text, html, javascript, css, xml:
  AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4.0[678] no-gzip
  BrowserMatch bMSIE !no-gzip !gzip-only-text/html

  <FilesMatch "\.(htm|html|css|js)$">
  AddDefaultCharset UTF-8
  </FilesMatch>

  RedirectMatch 404 "(?:.*)/(?:\.git|file_or_dir)(?:/.*)?$"

  # remove .html from html file names
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule .*[^/]$ %{REQUEST_URI}/ [L,R=301]
  RewriteCond %{REQUEST_FILENAME}.html -f
  RewriteRule ^(.+)/$ $1.html [L]

And in Root/drupal .htaccess
default drupal stuff

Closest answers I could find on SO:

*

*.htaccess rewrite to redirect root URL to subdirectory

*Changing all my website links: what is the best way?

*Redirecting root of site to subdirectory using .htaccess

*htaccess subdirectory URLS to root

EDIT: I ended up following, partially, the advice given because I have separate git repos per subdirectory. Thanks @Jon Lin and @tttony!
New problem: My .htaccess in root doesn't let me view my drupal installation in subfolder.

*

*Drupal.examples.com uses all the drupal files from /Drupal**

A: The easiest thing to do, by far, is just make home your document root and not have to worry about having a subdirectory.
But for what you have to work, the first thing you need to do is route everything to /home and not just the / request:
RewriteEngine On
RewriteRule ^(.*)$ /home/$1 [L]

Secondly, this condition:
RewriteCond %{REQUEST_FILENAME}.html -f

will always fail if you have a trailing slash, since it'll try to check for files that look like this:
/home/contact/.html

Try this instead:
# remove .html from html file names
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .*[^/]$ %{REQUEST_URI}/ [L,R=301]
RewriteCond %{REQUEST_URI} ^/(.*)/$
RewriteCond %{DOCUMENT_ROOT}/home/%1.html -f
RewriteRule ^(.+)/$ $1.html [L]

A: I've had that issues with sub-folders, you can try use RewriteBase in your root .htaccess
RewriteEngine On
RewriteBase /home/

But I found that it's better to use just one .htaccess file in the root folder
# remove .html from html file names
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .*[^/]$ %{REQUEST_URI} [L,R=301]
RewriteCond home/%{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ home/$1.html [L]


text:
Q: Perl reading from file into hash I would like to read the contents of a file into a hash structure. The header of the file should be the key in the hash structure, as well as the values being the content listed below each column.
The file that I am going to read from will look something like this.
Recv-Q Send-Q             Local Address:Port               Peer Address:Port
0      128                            *:111                           *:*      users:(("rpcbind",1268,8))
0      128                            *:53845                         *:*      users:(("rpc.statd",1404,9))
0      128                            *:22                            *:*      users:(("sshd",1577,3))
0      128                    127.0.0.1:631                           *:*      users:(("cupsd",1452,7))
0      100                    127.0.0.1:25                            *:*      users:(("master",1686,12))

I would like to have say Port as a key, containing the keys: 111, 53845, 22, 631, 25. How would I go about in order to read this file into the hash in the structure that I outlined?

A: If your data is tab-delimited, as you mention in a comment above, you can use the split function to split a string (e.g. a line from a file) into an array of values. On most systems, if perl is installed properly, you can look at the documentation of that function with the command perldoc -f split.
# Read the first line of the file:
my $header = <$fh>;
chomp $header;
my @fields = split /\t/, $header;
#
# Then read the rest of the lines:
my %data;
while (my $line = <$fh>)
{
    my @values = split /\t/, $line;
    @data{@fields} = @values;
    ... # do something with %data here
}

If your data is delimited some other way, you'll have to modify how you split each line into fields.

A: I'll offer you a basic starter for 10 on how to parse your data.
#!/usr/bin/env perl

use strict;
use warnings;
use Data::Dumper;
my @header = split ( " ", <DATA> );

my %service_on;

while ( <DATA> ) {
    my ( $recvq, $sendq, $locaddr_port, $peeraddr_port, $thing ) = split;
    my ( $locaddr, $port ) = split ( ":", $locaddr_port );
    $service_on{$port} = $thing;
}

print Dumper \%service_on;

__DATA__
Recv-Q Send-Q             Local Address:Port               Peer Address:Port
0      128                            *:111                           *:*      users:(("rpcbind",1268,8))
0      128                            *:53845                         *:*      users:(("rpc.statd",1404,9))
0      128                            *:22                            *:*      users:(("sshd",1577,3))
0      128                    127.0.0.1:631                           *:*      users:(("cupsd",1452,7))
0      100                    127.0.0.1:25                            *:*      users:(("master",1686,12))

You can do a 'named field' approach if you wish, but if your data format is consistent, it doesn't matter too much. Bear in mind that your data doesn't actually look like it's tab delimited - if it isn't, splitting on whitespace is easier... but it's also going to 'break' on Peer Addr.
If you want to go down that road, you need to look at slices of a hash. However, that isn't going to work as you have a field without a header row, which might just be discarded if you do.
E.g.:
while ( <DATA> ) {
    my %fields;
    @fields{@header} = split;
    my ( $locaddr, $port ) = split ( ":", $fields{$port_field} );
    print Dumper \%fields;
}


text:
Q: UWP changing the Tick color on a Sider control I am in the process of learning to use UWP ( Universal Windows Platform). I am struggling to figure out how change the color of the Tick marks on a Slider control. The generic control does not have a property for this. Searches via Google, come up with 'SliderTickBarFill' but they do not explain how to acquire such a property. I fear this may mean installing 3rd party custom controls - however, this is also mentioned on the Microsoft site ( https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.slider?view=winrt-19041 ). I would greatly appreciate help to execute what I believe should be a very simple thing, but which is driving me to distraction. ( maybe I can't see the wood for the trees ? ).

A:
If several sliders are used, and I wanted different tick colors for each one ( due to different backgrounds ), is it possible to change them on an individual basis

For your requirement, the better way is custom Slider, and add dependency property for Tick, and you could change it dynamically.
<local:CustomSlider
    MySliderTickBarFill="Red"
    TickFrequency="1"
    TickPlacement="BottomRight"
    Value="10" />

CustomSlider control template
public sealed class CustomSlider : Slider
{
    public CustomSlider()
    {
        this.DefaultStyleKey = typeof(CustomSlider);
    }

    public SolidColorBrush MySliderTickBarFill
    {
        get { return (SolidColorBrush)GetValue(MySliderTickBarFillProperty); }
        set { SetValue(MySliderTickBarFillProperty, value); }
    }

    // Using a DependencyProperty as the backing store for MySliderTickBarFill.  This enables animation, styling, binding, etc...
    public static readonly DependencyProperty MySliderTickBarFillProperty =
        DependencyProperty.Register("MySliderTickBarFill", typeof(SolidColorBrush), typeof(CustomSlider), new PropertyMetadata(0));

}

Style  replace default TickBar fill propety with  Fill="{TemplateBinding MySliderTickBarFill}"
<Style TargetType="local:CustomSlider">
    <Setter Property="Background" Value="{ThemeResource SliderTrackFill}" />
    <Setter Property="BorderThickness" Value="{ThemeResource SliderBorderThemeThickness}" />
    <Setter Property="Foreground" Value="{ThemeResource SliderTrackValueFill}" />
    <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" />
    <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" />
    <Setter Property="ManipulationMode" Value="None" />
    <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" />
    <Setter Property="FocusVisualMargin" Value="-7,0,-7,0" />
    <Setter Property="IsFocusEngagementEnabled" Value="True" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="local:CustomSlider">
                <Grid Margin="{TemplateBinding Padding}">
                    <Grid.Resources>
                        <Style x:Key="SliderThumbStyle" TargetType="Thumb">
                            <Setter Property="BorderThickness" Value="0" />
                            <Setter Property="Background" Value="{ThemeResource SliderThumbBackground}" />
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="Thumb">
                                        <Border
                                            Background="{TemplateBinding Background}"
                                            BorderBrush="{TemplateBinding BorderBrush}"
                                            BorderThickness="{TemplateBinding BorderThickness}"
                                            CornerRadius="4" />
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </Grid.Resources>

                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <ContentPresenter
                        x:Name="HeaderContentPresenter"
                        Grid.Row="0"
                        Margin="{ThemeResource SliderTopHeaderMargin}"
                        x:DeferLoadStrategy="Lazy"
                        Content="{TemplateBinding Header}"
                        ContentTemplate="{TemplateBinding HeaderTemplate}"
                        FontWeight="{ThemeResource SliderHeaderThemeFontWeight}"
                        Foreground="{ThemeResource SliderHeaderForeground}"
                        TextWrapping="Wrap"
                        Visibility="Collapsed" />
                    <Grid
                        x:Name="SliderContainer"
                        Grid.Row="1"
                        Background="{ThemeResource SliderContainerBackground}"
                        Control.IsTemplateFocusTarget="True">
                        <Grid x:Name="HorizontalTemplate" MinHeight="{ThemeResource SliderHorizontalHeight}">

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Grid.RowDefinitions>
                                <RowDefinition Height="{ThemeResource SliderPreContentMargin}" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="{ThemeResource SliderPostContentMargin}" />
                            </Grid.RowDefinitions>
                            <Rectangle
                                x:Name="HorizontalTrackRect"
                                Grid.Row="1"
                                Grid.ColumnSpan="3"
                                Height="{ThemeResource SliderTrackThemeHeight}"
                                Fill="{TemplateBinding Background}" />
                            <Rectangle
                                x:Name="HorizontalDecreaseRect"
                                Grid.Row="1"
                                Fill="{TemplateBinding Foreground}" />
                            <TickBar
                                x:Name="TopTickBar"
                                Grid.ColumnSpan="3"
                                Height="{ThemeResource SliderOutsideTickBarThemeHeight}"
                                Margin="0,0,0,4"
                                VerticalAlignment="Bottom"
                                Fill="{TemplateBinding MySliderTickBarFill}"
                                Visibility="Collapsed" />
                            <TickBar
                                x:Name="HorizontalInlineTickBar"
                                Grid.Row="1"
                                Grid.ColumnSpan="3"
                                Height="{ThemeResource SliderTrackThemeHeight}"
                                Fill="{ThemeResource SliderInlineTickBarFill}"
                                Visibility="Collapsed" />
                            <TickBar
                                x:Name="BottomTickBar"
                                Grid.Row="2"
                                Grid.ColumnSpan="3"
                                Height="{ThemeResource SliderOutsideTickBarThemeHeight}"
                                Margin="0,4,0,0"
                                VerticalAlignment="Top"
                                Fill="{TemplateBinding MySliderTickBarFill}"
                                Visibility="Collapsed" />
                            <Thumb
                                x:Name="HorizontalThumb"
                                Grid.Row="0"
                                Grid.RowSpan="3"
                                Grid.Column="1"
                                Width="8"
                                Height="24"
                                AutomationProperties.AccessibilityView="Raw"
                                DataContext="{TemplateBinding Value}"
                                FocusVisualMargin="-14,-6,-14,-6"
                                Style="{StaticResource SliderThumbStyle}" />
                        </Grid>
                        <Grid
                            x:Name="VerticalTemplate"
                            MinWidth="{ThemeResource SliderVerticalWidth}"
                            Visibility="Collapsed">

                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="{ThemeResource SliderPreContentMargin}" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="{ThemeResource SliderPostContentMargin}" />
                            </Grid.ColumnDefinitions>
                            <Rectangle
                                x:Name="VerticalTrackRect"
                                Grid.RowSpan="3"
                                Grid.Column="1"
                                Width="{ThemeResource SliderTrackThemeHeight}"
                                Fill="{TemplateBinding Background}" />
                            <Rectangle
                                x:Name="VerticalDecreaseRect"
                                Grid.Row="2"
                                Grid.Column="1"
                                Fill="{TemplateBinding Foreground}" />
                            <TickBar
                                x:Name="LeftTickBar"
                                Grid.RowSpan="3"
                                Width="{ThemeResource SliderOutsideTickBarThemeHeight}"
                                Margin="0,0,4,0"
                                HorizontalAlignment="Right"
                                Fill="{TemplateBinding MySliderTickBarFill}"
                                Visibility="Collapsed" />
                            <TickBar
                                x:Name="VerticalInlineTickBar"
                                Grid.RowSpan="3"
                                Grid.Column="1"
                                Width="{ThemeResource SliderTrackThemeHeight}"
                                Fill="{ThemeResource SliderInlineTickBarFill}"
                                Visibility="Collapsed" />
                            <TickBar
                                x:Name="RightTickBar"
                                Grid.RowSpan="3"
                                Grid.Column="2"
                                Width="{ThemeResource SliderOutsideTickBarThemeHeight}"
                                Margin="4,0,0,0"
                                HorizontalAlignment="Left"
                                Fill="{TemplateBinding MySliderTickBarFill}"
                                Visibility="Collapsed" />
                            <Thumb
                                x:Name="VerticalThumb"
                                Grid.Row="1"
                                Grid.Column="0"
                                Grid.ColumnSpan="3"
                                Width="24"
                                Height="8"
                                AutomationProperties.AccessibilityView="Raw"
                                DataContext="{TemplateBinding Value}"
                                FocusVisualMargin="-6,-14,-6,-14"
                                Style="{StaticResource SliderThumbStyle}" />
                        </Grid>

                    </Grid>

                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal" />

                            <VisualState x:Name="Pressed">

                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPressed}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPressed}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPressed}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPressed}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundPressed}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPressed}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPressed}" />
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>

                            <VisualState x:Name="Disabled">

                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderContentPresenter" Storyboard.TargetProperty="Foreground">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderHeaderForegroundDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="TopTickBar" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BottomTickBar" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LeftTickBar" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RightTickBar" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTickBarFillDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundDisabled}" />
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>

                            <VisualState x:Name="PointerOver">

                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalTrackRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPointerOver}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalTrackRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackFillPointerOver}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPointerOver}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderThumbBackgroundPointerOver}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderContainerBackgroundPointerOver}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalDecreaseRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPointerOver}" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalDecreaseRect" Storyboard.TargetProperty="Fill">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource SliderTrackValueFillPointerOver}" />
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>

                        </VisualStateGroup>
                        <VisualStateGroup x:Name="FocusEngagementStates">
                            <VisualState x:Name="FocusDisengaged" />
                            <VisualState x:Name="FocusEngagedHorizontal">

                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="False" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HorizontalThumb" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="True" />
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="FocusEngagedVertical">

                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SliderContainer" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="False" />
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalThumb" Storyboard.TargetProperty="(Control.IsTemplateFocusTarget)">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="True" />
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>

                        </VisualStateGroup>

                    </VisualStateManager.VisualStateGroups>
                </Grid>

            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

A: You can change the SliderTickBarFill brush color by overwriting it in the Page resources like so:
<Page
    ...>
    <Page.Resources>
        <SolidColorBrush x:Key="SliderTickBarFill" Color="Red"/>
    </Page.Resources>

    <Grid>
        <Slider Width="250" HorizontalAlignment="Center" VerticalAlignment="Center" TickPlacement="BottomRight" TickFrequency="10"/>
    </Grid>
</Page>

Without the SolidColorBrush in the page resources my slider looks like this:

After adding it:

Tip: This method should be able to be used for overwriting most default brushes of most controls.


text:
Q: Are Open JDK and JDK7 the same thing? Are Open JDK and JDK7 the same thing?

A: Open JDK is a free (but not certified) implementation of the JLS (java language specification) where JDK7 is the next version of Sun's JDK which is currently 1.6 (or just Java 6 as the marketing devision of Sun called it).

A: OpenJDK was initially based only on the JDK 7.0 version of the Java platform.
Since February 15, 2008, there are two separate OpenJDK projects:

*

*The main OpenJDK project, which is based on the JDK 7.0 version of the Java platform

*The JDK 6 project, which provides an Open-source version of Java 6.0.

I hope this clears the confusion a bit.

A: It appears to be a Solaris<-->OpenSolaris situation, viz. there's an open-source project with as much code as possible; the fixes get transferred back to the main software, which the vendor supports and sells.  OpenJDK is a project.  OpenJDK version 7 and JDK7 appear to be largely but not exactly the same (per here).


text:
Q: When Pycharm open file by specific coding, why is it the wrong coding? I met a problem about pycharm coding when open the py file:
steps:

*

*new a test.py by notepad++ and using # -- coding:utf-8 --

*then save the file as gb2312

*open the file by pycharm
finally, the file in pycharm is the wrong encoding....
step 1 & 2: new file test.py and save the file as gb2312:

step 3: new file test.py:

computer environment:
win10
python2.7
pycharm2019.1.1
problem desc and personal thoughts:
I tried the problem many times. but it made me troubled for a long time.
Our Projects so large that contains so many utf-8 files, so I meet this problem when I use pycharm. Other people use vscode , but I prefer to Pycharm, so I want to try.
as notepad++ or vscode when open file can select the coding that u want, but
pycharm can't if u use  # -*- coding:utf-8 -*-
i don't konw why?

A: your file has saved as gbk2312,but "coding:utf-8" will tell pycharm to open it with utf-8.It's contradictory


text:
Q: How can I change a button's color on hover? I need to change the color of a button on hover.
Here is my solution, but it doesn't work.
a.button {
   display: -moz-inline-stack;
   display: inline-block;
   width: 391px;
   height: 62px;
   background: url("img/btncolor.png") no-repeat;
   line-height: 62px;
   vertical-align: text-middle;
   text-align: center;
   color: #ebe6eb;
   font-family: Zenhei;
   font-size: 39px;
   font-weight: normal;
   font-style: normal;
   text-shadow: #222222 1px 1px 0;
}
a.button a:hover{
     background: #383;
}

A: a.button a:hover means "a link that's being hovered over that is a child of a link with the class button".
Go instead for a.button:hover.

A: a.button:hover{
    background: #383;  }

works  for me but in my case
#buttonClick:hover {
background-color:green;  }

A: Seems your selector is wrong, try using:
a.button:hover{
     background: #383;
}

Your code
a.button a:hover

Means it is going to search for an a element inside a with class button.


text:
Q: T-SQL stored procedure does not return zero by COUNT(*) on an empty SELECT result I am using the Spring Framework's StoredProcedure (I am extending it, of course) to get a result set and an output parameter (@totalRowsReturned) which is an Integer. The problem is that when the resultset being returned is supposed to be an empty list, I am getting a NullPointerException when I try to retrieve the output parameter (totalRows, which naively I would expect it to be zero).
I would like to mention that the code works fine when the result set being found is not empty.
My questions are:

*

*Why isn't @totalRowsReturned being set to zero in this case? (Or in case it is, why can't I retrieve it through the Java code?)

*How can I make this code (Java code + T-SQL code) work in such a way that @totalRowsReturned will be set to zero when required, and I could retrieve it through the Java code?
Dao:
List<Book> books = null;
int totalRows = 0;

Map<String, Object> results = storedProcedure.execute(parameters);
books = (List<Book>) results.get("rs");
totalRows = (Integer) results.get("totalRowsReturned"); // NullPointerException on this line if total rows are supposed to be zero!!

T-SQL stored procedure:
CREATE PROCEDURE Find_Books

    @authorName Varchar(250),
    @totalRowsReturned INTEGER OUTPUT

AS

BEGIN

    SET NOCOUNT ON;
    DECLARE @SelectQuery NVARCHAR(2000)

    SET @SelectQuery = 'SELECT @totalRows=COUNT(*) OVER() FROM book b WHERE b.author_name = @authorName'

    Execute sp_Executesql @SelectQuery, N'@authorName VARCHAR(250), @totalRows int OUTPUT', @authorName, @totalRows=@totalRowsReturned OUTPUT

-- Select resultset goes here...

END

UPDATE:
Actually, my stored procedure looks more like this (the change is the additional @first_id = b.book_id in the SELECT):
CREATE PROCEDURE Find_Books

    @authorName Varchar(250),
    @totalRowsReturned INTEGER OUTPUT

AS

BEGIN

    SET NOCOUNT ON;
    DECLARE @SelectQuery NVARCHAR(2000)

    DECLARE @first_id int
    DECLARE @first_id_local_returned int

    SET @SelectQuery = 'SELECT @first_id = b.book_id, @totalRows=COUNT(*) OVER() FROM book b WHERE b.author_name = @authorName'

    Execute sp_Executesql @SelectQuery, N'@authorName VARCHAR(250), @first_id int OUTPUT, @totalRows int OUTPUT', @authorName, @first_id=@first_id_local_returned OUTPUT, @totalRows=@totalRowsReturned OUTPUT

    -- Select resultset goes here... I am using the value of @first_id_local_returned in this SELECT...

END

The problem is, that when there are no rows returned from the SELECT, b.book_id is not defined, so I get an org.springframework.dao.TransientDataAccessResourceException ... Column 'book.book_id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
So it seems like if I keep the OVER(), then @totalRows=COUNT(*) OVER() fails when there are zero rows returned, and if I remove the OVER(), then @first_id = b.book_id fails.
Any idea how I overcome this?

A: COUNT(*) OVER () is not the correct thing to use here. Just use COUNT(*)
COUNT(*) OVER () returns a result set with as many rows as the COUNT. e.g if the result is 3 the result set will be
3
3
3

The effect of your query is then to repeatedly re-assign the value 3 to the @totalRows variable as many times as there are rows which is completely pointless.
Conversely if COUNT(*) = 0 then the COUNT(*) OVER () result set is empty so your variable is never assigned to at all.
COUNT(*) will always give you a single row scalar resultset here that you can assign to the variable and will have a more efficient execution plan without unnecessary common subexpression spools too.
Edit
In response to your question in the comments. This does the same thing as your linked article. It can use a narrower index to find the (say) 10,000th Employee then joins onto Department only for the 1 subsequent page of records. This paging method only works correctly because each employee has exactly one department.
WITH E1(RN, EmployeeID)
     AS (SELECT ROW_NUMBER() OVER (ORDER BY EmployeeID),
                EmployeeID
         FROM   Employees)
SELECT TOP (@maximumRows) e.*,
                          d.Name AS DepartmentName
FROM   Employees e
       INNER JOIN Departments d
         ON e.DepartmentID = d.DepartmentID
WHERE  EmployeeID >= (SELECT EmployeeID
                      FROM   E1
                      WHERE  RN = @startRowIndex)
ORDER  BY e.EmployeeID

A: You need to use an aggregate function on b.book_id.
You can use min()
SELECT @first_id = min(b.book_id), @totalRows=COUNT(*) FROM book ...

or max() if that is more appropriate in your case
SELECT @first_id = max(b.book_id), @totalRows=COUNT(*) FROM book ...

A: I'm not 100% sure what you're trying to do, but I think it's something like this (you really don't want/need dynamic SQL in this case):
CREATE PROCEDURE Find_Books
    @authorName Varchar(250),
    @totalRowsReturned INTEGER OUTPUT
AS
BEGIN
    SET NOCOUNT ON;
    SET @totalRowsReturned = SELECT COUNT(*)
        FROM book b WHERE b.author_name = @authorName
    SELECT b.book_id
        FROM book b WHERE b.author_name = @authorName
END


text:
Q: Get Cell reference for TOP 3 numbers within a Range (Excel VBA) I have a Range of Cells in Excel with numbers (Let's say A1:Z1) and I want to get three highest numbers. Answer to this part of the question I found here - Finding highest and subsequent values in a range
But I want also to get the cell reference of these values.
firstVal = Application.WorksheetFunction.Large(rng,1)
secondVal = Application.WorksheetFunction.Large(rng,2)
thirdVal = Application.WorksheetFunction.Large(rng,3)

A: After getting the values, try looping through the range and assign range variables to these. Then print the addresses of the range variables:
Sub TestMe()

    Dim firstVal As Double
    Dim secondVal As Double
    Dim thirdVal As Double
    Dim rng As Range
    Set rng = Worksheets(1).Range("A1:B10")

    With Application
        firstVal = Application.WorksheetFunction.Large(rng, 1)
        secondVal = Application.WorksheetFunction.Large(rng, 2)
        thirdVal = Application.WorksheetFunction.Large(rng, 3)
    End With

    Dim myCell As Range
    Dim firstCell As Range
    Dim secondCell As Range
    Dim thirdCell As Range

    For Each myCell In rng
        If myCell.Value = firstVal And (firstCell Is Nothing) Then
            Set firstCell = myCell
        ElseIf myCell.Value = secondVal And (secondCell Is Nothing) Then
            Set secondCell = myCell
        ElseIf myCell.Value = thirdVal And (thirdCell Is Nothing) Then
            Set thirdCell = myCell
        End If
    Next myCell

    Debug.Print firstCell.Address, secondCell.Address, thirdCell.Address

End Sub

The check firstCell Is Nothing is done to make sure that in case of more than one top variable, the second one is assigned to the secondCell. E.g., if the range looks like this:

then the top 3 cells would be A2, A3, A1.

A: Not very efficient but you can specify how many addresses to return:
Sub Tester()

    Debug.Print Join(Largest(ActiveSheet.Range("A1:Z1"), 3), ", ")

End Sub

Function Largest(rng As Range, howMany As Long)
    Dim rv(), n As Long, c As Range, lg
    ReDim rv(1 To howMany)
    n = 1
    Do
        lg = Application.Large(rng, n)
        For Each c In rng
            If c.Value = lg Then
                If IsError(Application.Match(c.Address, rv, 0)) Then
                    rv(n) = c.Address
                    n = n + 1
                    Exit For
                End If
            End If
        Next c
    Loop While n <= howMany
    Largest = rv
End Function


text:
Q: How to return value from unit test? I have the following problem.I have a process that is done in 3 steps:
Step 1 -> Step 2 ->Step 3

I want to be able to test all combinations.
Step1
Step1+Step2
Step2
Step2+Step3
Step1+Step2+Step3

In order to do this i would like to be able to return something from each of my Unit Tests.
I do not want to create global variables and mutate them every single time.
class TestPipeline
{
[Testcase]
public Int Step1()
{
   ////do something
   Int outputStep1=doSomeStuff();
   return outputStep1;
}

[Testcase]
public Int Step2()
{
   Int inputStep1=Step1();
   Int outputStep2=doSomething(inputStep1);
   return outputStep2;
}
[Testcase]
public void Step3()
{
   Int inputStep2=Step2();
   Int result=doSomethingElse(inputStep2);
}
}

How can this be done ?

A: It sounds to me that you need helper methods that you can reuse, you're most of the way there, just need to extract out the methods.
As for getting the combinations correct I'd just hard-code the combinations. It looks like your steps are sequential so there won't be such a test as Step2+Step3 because it would really be Step1+Step2+Step3.
Tests are normally data driven and having logic in the test to vary behaviour based on data with something such as Combinatorial adds unwanted logic into the test.
class TestPipeline
{
    private int doSomeStuff()
    {
        return someStuff;
    }

    private int doSomething(int someStuff)
    {
        return something;
    }

    private int doSomethingElse(int something)
    {
        return somethingElse;
    }

    [Testcase]
    public void Step1()
    {
       ////do something
       int outputStep1 = doSomeStuff();
       return outputStep1;
    }

    [Testcase]
    public void Step1Step2()
    {
       int inputStep1 = doSomeStuff();
       int outputStep2 = doSomething(inputStep1);
       return outputStep2;
    }

    [Testcase]
    public void Step1Step2Step3()
    {
       int inputStep1 = doSomeStuff();
       int outputStep2 = doSomething(inputStep1);
       int result = doSomethingElse(inputStep2);
    }
}


text:
Q: How do i Access the keys of a JSON Object in Javascript? I am receiving Data from an MQTT Server, which is giving me data after some intervals. The Data received is in the form of JSON Object. I want to store the values of the data that I  get and then pass it to my Database. But I am getting error Accessing its Keys.
This is my Function which is fetching the JSON Data.
function mqtt_messsageReceived(topic, message, packet) {

    if(message !== null && message !== undefined )
    {
        var myMessages = message;
       console.log('Messages are '+ myMessages);

    }

};

This is my Console Log JSON  Data.
Messages are {"Temp":26.50,"Door":1,"Fan1":0,"Fan2":0,"Time":"22-8-2018 16:05","mac":"5ccf7f5a4ba4"}

I Want to access Temp from this JSON Object.
I have tried doing :
console.log('Temp is '+myMessages.Temp);

But it only gives me an Error - Temp is undefined.
I have Tried Fetching many ways, one way was with  Object.values
var myMessages = Object.values(message);

All I get is some random numbers
My  Messages are 123,34,84,101,109,112,34,58,50,52,46,53,48,44,34,68,111,111,114,34,58,49,44,34,70,97,110,49,34,58,48,44,34,70,97,110,50,34,58,49,44,34,84,105,109,101,34,58,34,50,50,45,56,45,50,48,49,56,32,49,54,58,49,54,34,44,34,109,97,99,34,58,34,53,99,99,102,55,102,53,97,52,98,97,52,34,125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

Can anyone Help here ??

A: You can use JSON.parse:
console.log(JSON.parse(myMessages)["Temp"]);


text:
Q: logging errors and iexpress wizard I've attached a pair of DLL files (about 10) and the resulting exe file into one containing the whole exe file using the IExpress Wizard. In my program, I log errors using the log4net library. Before packing (that is, as Visual Studio creates in the Release version), login works correctly and a file with logs (application.log) is created. However, after 'packing' it all into one thing, everything works fine apart from creating a log file. I checked in the temporary Windows folder to which the project is 'unpacked', all DLLs are there and the original exe file, however, this log file is missing. The project is written in WPF. What did I do wrong?
Thanks for help!


text:
Q: Python - OPCDA read from remote server with OpenOPC I have huge problem with OPCDA and OpenOPC. I should (must) read a set of tags from a remote server, I have no access to the machine in any way. I only know the IP and the OPC server name.
Testing OpenOPC locally with this code all work fine. Otherwise, changing the hostname with the remote one nothing work with 0x800706BA error.
import OpenOPC
import time

try:
    opc = OpenOPC.client()

    opc.servers()

    #change localhost to remote
    opc.connect('Matrikon.OPC.Simulation.1', 'localhost')

    srvList = opc.list()

    print(srvList)

    tags = opc.read(opc.list('Simulation Items.Random.Int*'), group='myTest')

    for name, value, quality, tagTime in opc.read(opc.list('Simulation Items.Random.Int*'), group='myTest'):
    print(name, value, quality, tagTime)

    for tag in tags:
        print(tag)

    except Exception as e:
        print('OPC failed')
        print(str(e))
        pass
    finally:
        print('END')

Anyone have any ideas on this?
Not having access to the server (set with anonymous logon), I have done DCOM configurations as much as possible.
Does anyone know a procedure for a possible solution?
Thanks!


text:
Q: Highcharts datagrouping issue I am facing a strange problem with highcharts(highstock) datagrouping. I want to show grouped data in week or month and at the same time zoom the chart to a specific period (I am using chart.yAxis[0].min = ). When the width of the overall chart is high and when I set the the zoom level to a short period (say a few months), data is not grouped to the period I specify.
Refer to the fiddle link below. I have specified datagrouping as 'month' ({units:[['month',[1]]], enabled:true}) and yAxis[0].min as 29 Jul 2010. You will observe that data is not grouped in months.
Now try to reduce the width jsfiddle result panel by dragging the divider. When the size of the result area (or the chart) is reduced, datagrouping starts working.
http://jsfiddle.net/amit657/of1mv8yv/2/
Any idea how can I force datagrouping and at the same zoom the chart to show data for a specific period?

A: To force data grouping set forced in dataGrouping to true.
Example: http://jsfiddle.net/of1mv8yv/4/
...
        dataGrouping: {
            units: [
                ['month', [1]]
            ],
            enabled: true,
            forced: true
        }
...


text:
Q: Regex to find a string that star with '-' and end with ')' that not contain '(' I working in convert a dictionary text file to JSON. And I want to delete some strings in the dictionary file by Sublime text 3 search.
Ex:
@addle-head /'ædlhed/ (addle-pate) /'ædlpeit/
-pate)
/'ædlpeit/
*  danh từ
- người đầu óc lẫn quẫn

I want to find and delete string "-pate)".
I've tried this code after google not contain string regex and AND operator regex:
/^-((?!\().)*$/gm
But it just can find a string start with '-' and not contain '('.
I expect a regex that can find string that and with ')' too.
Update:
The answer of MonkeyZeus is perfect for me. But I onky need a string that starts with '-' so I need to add '^' to the begin of the Regex like vs97 said in the comment. Thank all of you very much.

A: You mean like this?
^-[^()]+\)$

Edited per the comment.
https://regex101.com/r/oGZ20d/6

A: You can also tackle this problem by using Negative Lookahead:
^-(?!\().+\)$

Regex Demo. Top right corner you can find explanation for all parts of the regex.

A: Please try this :
\-{1}[^()]*\)


text:
Q: GTK+ update appears to have messed up my application fonts A few hours ago I installed a set of updates including GTK+ and I've noticed that my application menu fonts now look unsightly.
For example Netbeans

And Pinta

How can I revert back to the nicer looking fonts?

Accordint to /var/log/apt/history.log this is the last update I did before my fonts got messed up
Commandline: aptdaemon role='role-commit-packages' sender=':1.1740'
Upgrade:
libreoffice-style-breeze:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-math:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-gtk3:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-java-common:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-base:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-core:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-style-oxygen:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
google-chrome-stable:amd64 (64.0.3282.186-1, 65.0.3325.146-1),
libreoffice-kde:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libpq5:amd64 (9.6.7-0ubuntu0.17.10, 9.6.8-0ubuntu0.17.10),
python3-uno:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-style-galaxy:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-base-core:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-ogltrans:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-impress:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-style-elementary:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
ure:amd64 (5.4.5-0ubuntu0.17.10.4, 5.4.5-0ubuntu0.17.10.5),
libreoffice-sdbc-hsqldb:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-writer:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-common:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
fonts-opensymbol:amd64 (2:102.10+LibO5.4.5-0ubuntu0.17.10.4, 2:102.10+LibO5.4.5-0ubuntu0.17.10.5),
libreoffice-pdfimport:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
uno-libs3:amd64 (5.4.5-0ubuntu0.17.10.4, 5.4.5-0ubuntu0.17.10.5),
libreoffice-style-tango:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-gnome:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-calc:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-base-drivers:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-draw:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5),
libreoffice-avmedia-backend-gstreamer:amd64 (1:5.4.5-0ubuntu0.17.10.4, 1:5.4.5-0ubuntu0.17.10.5)

A: Result! ... Well, sort of.
I backed up and then cleared ~/.gtkrc-2.0 and all fonts and menus now look pretty decent apart from some Netbeans menus. For example although the Team menu looks nice

The profile menu next to it looks awful. The problem appears to be the grayed out menus

BTW here's my old ~/.gtkrc-2.0. The new one is currently blank.
include "/usr/share/themes/Breeze/gtk-2.0/gtkrc"
style "user-font"
{
    font_name="Noto Sans Regular"
}
widget_class "*" style "user-font"
gtk-font-name="Noto Sans Regular 10"
gtk-theme-name="Breeze"
gtk-icon-theme-name="breeze"
gtk-fallback-icon-theme="gnome"
gtk-toolbar-style=GTK_TOOLBAR_ICONS
gtk-menu-images=1
gtk-button-images=1


text:
Q: How to add attchment and signature in email through programming in iPhone App/ How can I add video/image/audio as an attachment programmatically in the email in iPhone app iPhone and how can I add Signature? I think it can be done by using html tags but how it can be done. Can you please any sample code for this.
Thanks-

A: To send attachments: You can use MFMailComposeViewController to send attachments from your app.
1. Add MessageUI framework, and do #import <MessageUI/MFMailComposeViewController.h>
2. In your email button action or however you are sending email, add :
if([MFMailComposeViewController canSendMail]) //IMPORTANT: check if mail can be sent to avoid crash
{
    MFMailComposeViewController*mailController=[[MFMailComposeViewController alloc] init];

    NSURL*yourUrl=[NSURL fileURLWithPath:yourFilePath];
    NSData*attachData=[NSData dataWithContentsOfURL:yourUrl];

    mailController.mailComposeDelegate=self;
    [mailController addAttachmentData:attachData mimeType:@"yourExtension" fileName:@"yourFileName.yourExtension"];
    [mailController setSubject:@"Test Subject"];
    [mailController setTitle:@"Test Title"];

    if(mailController!=nil)
    {
        [self presentModalViewController:mailController animated:YES];
    }

    [mailController release];
}

else //give a prompt showing no mail accounts found
{
    UIAlertView*emailAlert=[[UIAlertView alloc] initWithTitle:@"No Email Account Found." message:@"Please set an email account." delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
    [emailAlert show];
    [emailAlert release];
}

To set signature: I guess it uses the signature relative to the mail account that has been set. Sorry no idea on how to change it programmatically.


text:
Q: React.Children with non-element children Given a component receives a function as a child (callback as a child pattern, also known as render prop pattern):
<Foo>{() => <Bar/>}</Foo>

React.Children.count(props.children) === 0 in Foo.
The documentation doesn't seem to mention that React.Children accepts only valid React elements, so the fact that child function is ignored looks odd.
How does React.Children treat non-element children and why?
References to official sources and/or source code are welcome.

A: Update:
Disclaimer: It's not a solution but just an eye where we could look at.
I'm not sure but if it is indeed needed to be fixed in React itself, then I would suggest to change in the following function:
React Element
export function isValidElement(object) {
  return (
    typeof object === 'object' &&
    object !== null &&
    object.$$typeof === REACT_ELEMENT_TYPE
  );
}

This code:
typeof object === 'object'

To something like:
typeof Object.create(object) === 'object'

And also add a Symbol for such something like:
 Symbol.for('react.function')

in the React Symbol.
Current solution to count those children with:
this.props.children.length

This lets you count the function as child component as a children. this.props.children includes any type of element, expressions, or component whilst this.props.children inside React.Children function as child is being ignored as children. Continue reading bellow to understand it better...
Here's a demo.

React doesn't consider function as child component as CHILDREN.
However, I have just submitted an issue and if you wish you can keep following there.
The docs specifies that the React.Children.count only counts the component in children.
You probably already have known what exactly is children in react.
React takes everything as children except the function as child.
Here's the reference where it states:

React components don't support functions as children.

If you wish you can look deeper here.
So, you have function as a child in <Foo /> component so it does return 0 as it's not being considered as children.
You can optionally count those expressions as its children then you may convert them to array first and then count like:
class CountExpression extends React.Component {
  render() {
    const children = React.Children.toArray(this.props.children)
    return
{React.Children.count(children)}

  }
}

{ /* Counts 2 */ }
<CountExpression>
  {'one'}
  {'two'}
  { () =>
Still, this will be ignored as child and is not included in array
}
</CountExpression>

Here's a draft demo if you want to have a look.
More on using children...
Look at the following example how children is being counted:
class CountChildren extends React.Component {
  render() {
    return
{React.Children.count(this.props.children)}

  }
}

{ /* Renders 1 */ }
<CountChildren>
  Simply a text!
</CountChildren>

{ /* Renders 2 */ }
<CountChildren>

Html element

  <ChildComponent />
</CountChildren>

{ /* Renders 3 */ }
<CountChildren>
  Simply a text!

Html element

  <ChildComponent />
</CountChildren>

{ /* Renders 3 */ }
<CountChildren>
  Simply a text!

Html element

  <ChildComponent />
  { /* ignores it as it's not a component */ }
  { () =>
Function as a child component
 }
</CountChildren>

So, you can notice that React can accept any type of children regardless of array, a function, or an object, etc.
If you wish you can also ignore rendering the children checking it with a condition. For eg.:
class SingleChildComponent extends React.Component {
  render() {
    return (

        {
          Array.isArray(this.props.children) ?
            'Sorry, you can only pass single child!' :
            this.props.children()
        }

    )
  }
}

{ /* Renders 'Sorry, you can only pass single child!' */ }
<SingleChildComponent>

First children

  <SecondChildren />
</SingleChildComponent>

{ /* Renders `<p>Single child</p>` */ }
<SingleChildComponent>

Single child

</SingleChildComponent>

If you wish, you can convert the children to array and sort it out like below:
class SortComponent extends React.Component {
  render() {
    const children = React.Children.toArray(this.props.children)
    return <>{ children.sort().join(', ') }</>
  }
}

{ /* Renders 'Computer, Furniture, Machine' */ }
<SortComponent>
  {'Machine'} { /* First child */ }
  {'Computer'} { /* Second child */ }
  {'Furniture'} { /* Third child */ }
</SortComponent>

Enforcing a single child:
Bad:
class OnlyChildComponent extends React.Component {
  render() {
    return this.props.children()
  }
}

{ /* Enforcing it as a single child component */ }
OnlyChildComponent.propTypes = {
  children: React.PropTypes.func.isRequired
}

If there are more children, then it just shows warning in the console and let the program execute next.
Good:
class OnlyChildComponent extends React.Component {
  render() {
    return React.Children.only(this.props.children)()
  }
}

If there are more than one child, then it will throw an error! And it halts the program execution. It's perfect to avoid mess with our component.

A: According to the docs:

React.Children.count returns the total number of components in children, equal to the
  number of times that a callback passed to map or forEach would be
  invoked.

What the above statement means is that if the children element passed to a component is iteratable then only the count will be incremented.

Now lets look at the code snippet that React internally used to calculate count.
React.children.count uses the following code
The major piece of code is
function traverseAllChildren(children, callback, traverseContext) {
  if (children == null) {
    return 0;
  }

  return traverseAllChildrenImpl(children, '', callback, traverseContext);
}

So if children is null, it returns 0.
function traverseAllChildrenImpl(
  children,
  nameSoFar,
  callback,
  traverseContext,
) {
       ...
    switch (type) {
      case 'string':
      case 'number':
        invokeCallback = true;
        break;
      case 'object':
        switch (children.$$typeof) {
          case REACT_ELEMENT_TYPE:
          case REACT_PORTAL_TYPE:
            invokeCallback = true;
        }
    }
  }

  if (invokeCallback) {
    // Other code
    return 1;
  }

So from the above code we infer that we children is String, Number it will return 1;
Moving on to the next part
if (Array.isArray(children)) {
    for (let i = 0; i < children.length; i++) {
      child = children[i];
      nextName = nextNamePrefix + getComponentKey(child, i);
      subtreeCount += traverseAllChildrenImpl(
        child,
        nextName,
        callback,
        traverseContext,
      );
    }
  }

It implies that for each element within the children array, the count is incremented.
const iteratorFn = getIteratorFn(children);
if (typeof iteratorFn === 'function') {

For functions provided as children which are iteratable such as Maps, Sequence it will iterate though the elements and calculate the subtree count
For an object it will return an error.
invariant(
    false,
    'Objects are not valid as a React child (found: %s).%s',
    childrenString === '[object Object]'
      ? 'object with keys {' + Object.keys(children).join(', ') + '}'
      : childrenString,
    addendum,
  );

A demo for the above piece of information is in the codesandbox here

A: TLDR
From the official doc:

React.Children provides utilities for dealing with the this.props.children opaque data structure.

In other words, the React.Children namespace is full of utility functions that are helpful when using this.props.children for its primary intended purpose within the composition model.
The composition model uses the special children property for things that can be rendered directly into the output of a parent component, so utility functions like React.children.count are programmed to only include things that can be directly rendered.
Because a function cannot be directly rendered into the output of a parent component, it is not included in the results from React.Children.count.

What is the children prop?
The children prop is a special prop that React uses to pass a component its children.
As I'm sure you know, JSX is just syntactic sugar for React.createElement.
The call signature for React.createElement looks like this:
React.createElement(type, props, ...children)

So when a component is passed children in JSX like this:
<Foo>

child1

child2

</Foo>

...it results in this code:
React.createElement(Foo, null,
  React.createElement("div", null, "child1"),
  React.createElement("div", null, "child2")
);

...where the children are passed as the trailing arguments and are available in the component as the special children prop.

What is the children prop for?
The children prop is a special prop used for component composition.
From the Composition vs Inheritance doc:

React has a powerful composition model, and we recommend using composition instead of inheritance to reuse code between components.

...and later:

We recommend that such components use the special children prop to pass children elements directly into their output

So the composition model uses the special children prop to allow for reusable components:
// Renders its children within a container div with class "foo":
const Foo = (props) => (
{props.children}
);

What can be passed in the children prop?
Well...anything.  There are no actual restrictions on what can be passed in the children prop...
...but only certain things can be passed to a component using children for the composition model and expecting to render the child "directly into their output".
So this is valid:
<Foo>some text</Foo>

...and this is valid:
<Foo>
something
</Foo>

...and even this is valid:
<Foo>
  <Foo>
    some text
  </Foo>
</Foo>

...but this is not valid:
<Foo>{() => 'some text'}</Foo>

...since Foo cannot render a function directly into its output.

Why are functions ever passed as children?
As you pointed out, this is the result of the Render Props pattern.
In the doc describing the Render Props pattern it starts with passing a render function as a render prop.
Then it points out that using a prop named render is completely arbitrary and the prop name could be anything...
...and it ends by pointing out that:

we could just as easily use the children prop!

...and showing how a render function could be passed in as the children prop.
But then it includes this warning:

Since this technique is a little unusual, you'll probably want to explicitly state that children should be a function in your propTypes when designing an API like this.

In other words, this is a non-standard use of the special children prop.

Passing something arbitrary as children
As I noted earlier, anything can be passed as children.
So taking it a step further, here is a component that expects an Object containing three functions, header, body, and footer:
const ExpectsObject = (props) => (

    {props.children.header()}
    {props.children.body()}
    {props.children.footer()}

);

This highly unusual component would be used like this:
<ExpectsObject>
  {{
    header: () => (
header
),
    body: () => (
body
),
    footer: () => (
footer
)
  }}
</ExpectsObject>

...and this works just fine.
But again, this is a very non-standard use of the special children property and would require careful documentation, and since this approach does not follow the composition model the utility functions in the React.Children namespace don't know how to handle the custom object in children.
In fact, calling React.Children.count with this particular object as children causes the utility function to throw an error.

Why does React.Children.count not count a function?
So why is a function not included in the count returned by React.Children.count?
React.Children.count is designed to be a utility method for the composition model and associated use of the special children property.
Because a function cannot be rendered directly into the output of a component following the composition model, it is not included in the count returned by React.Children.count.

A: As others have stated, the documentation states that React.Children.count(children) only returns the count of the number of children that are valid React Components.
React.Children does not ignore other types of children, and if you need to get the count, you only need to determine the length of the array in the root child Object, just like you would in vanilla js. If you look at react-motion, you'll see that they specify that children must be type of func:
Mouse.propTypes = {
  children: PropTypes.func.isRequired
};

And they further ensure that there's only one child with React.Children.only (docs):
render(): ReactElement {
    const renderedChildren = this.props.children(this.state.currentStyle);
    return renderedChildren && React.Children.only(renderedChildren);
  }

React does not handle different types of children on its own, instead, you have to handle them yourself. I put together a code sandbox to show you why.


text:
Q: Define multiple setter methods in concern with custom names I want to define multiple custom methods to set values for custom user fields in the UserConcern, that are not stored in the DB, but are fetched from outer source. I tried the code below, which results in ``': undefined local variable or method get_custom_attrs' for UserConcern:Module (NameError)
get_custom_attrs.each do |key|
  define_method(key) do
    // returning the value for this key
  end
end

private

def get_custom_attrs
  OuterConcern::FIELDS - User.attribute_names
end

I obviously can't use this method on the top level. If I switch to using a constant variable within the concern, such as CUSTOM_FIELDS = [:custom1, custom2, ...] that will work, but it's not dynamic and I'll have to change it every time a field is changed, added or deleted.

A: get_custom_attrs is being executed at the class level, whilst def get_custom_attrs defines the method at the instance level. You need get_custom_attrs to exist as a class method, so you want something like
class MyAwesomeClass
  class << self
    private
    def get_custom_attrs
      [:a1,:a2,:a3] # or whatever
    end
  end
  get_custom_attrs.each do |attr|
    # Some stuff happens here
  end
end


text:
Q: How to concatenate a variable into an array string on VBA I'd like to use a variable inside an array like this
path = "C:\test\folder\"

Array("ODBC;DSN=MS Access Database;DBQ=path;")

but am unable to concatenate the variable into this array correctly.
Do you have a suggestion on how to do this?

A: You can add strings with the & operator directly into commands such as:
Array("ODBC;DSN=MS Access Database;DBQ=" & path & ";")


text:
Q: Setting up mstest.exe with Jenkins for a C# Core 2.0 I'm trying to set up a Jenkins server for my C# Project. The Server currently runs on my localhost as I'm testing it out.
So far, I've managed to restore NuGet packages, and build the project, using 2 steps in the Build config.
Now, I'm trying to have it execute our unit tests. The tests are made using Microsoft's own test framework.
I initially tried to use the plugin to run the tests, and also set it up using a windows bat file, both result in the same problem.
The dll assembly cannot be found.
My bat command looks like this:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\MSTest.exe" /resultsfile:"%WORKSPACE%\Results.trx" /testcontainer:"%WORKSPACE%\msTests\bin\Release\netcoreapp2.0\msTest.dll" /nologo, the result being: Test file not found.
I assume this is because Jenkins removes the build assemblies on success? How can I disable that? Or something else I'm doing wrong?

A: If you are using dotnet core you should be using the dotnet test command.
https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test?tabs=netcore21


text:
Q: Xcode 6.1 6A1052d Text View disappear after expand label or button size
*

*Drag label or button into storyboard

*Drag Text View to storyboard.

*Try to expand width or height for label or button with mouse drag the corners, the Text View will disappear in Storyboard view controller.


text:
Q: Cannot check if a local variable is null in Chrome Extension I'm trying to retrieve a value from Chrome local storage using this code:
var populateNum = localStorage.getItem('mynum');
if (populateNum)
  {
    document.getElementById("txtInput").value = populateNum;
  }

However, I'm getting the error:

Uncaught TypeError: Cannot set property 'value' of null

The error is showing in Chrome as being on this line:
if (populateNum)

Here is the error showing in Chrome://extensions:

I've tried using .length==0 but get the same error.
Any idea what I'm doing wrong?
Thanks, Mark


text:
Q: How do I mapped an oracle table column of type NVARCHAR2(100) to JPA fields? I have an oracle table that contains 4 columns, one of them is a localizedText of type NVARCHAR2(100).
When I import the table using Eclipse (MARS) environment JPA class, it creates a class but then create a field private Object localizedText. Which errors out when i run the code since during runtime it does not accept a field of type object.
How do I change the private Object localizedText; definition to work with an oracle NVarChar2(100) type column?
Thanks

A: Define the attribute as String in your JPA class


text:
Q: Sonarlint path fail to YAML vscode I am a new user in VScode. I get an error in the VScode : sonarlint path fail to YAML. When I click into the setting, the following message comes out.
Sonarlint: Path To Node Executable
(Not synced)
Path to a Node.js executable (14.17.0 or more recent) used to analyze JavaScript and TypeScript code. On Windows, backslashes must be escaped, e.g. C:\\Program Files\\NodeJS\\14-lts\\bin\\node.exe
It seems I need to rename the path, but I don't know what the path is as I cannot find NodeJS in my program files. Much appreciate if anyone here can give an advice.


text:
Q: Stripe - STPPaymentCardTextField - How to add zip/postal code field? Stripe's iOS SDK's "STPPaymentCardTextField" has only 4 fields for generating a token for a card :
1. credit card number
2. expiration month
3. expiration year
4. CVC field
Is there another field available for programmatically adding zip/postal code to the STPPaymentCardTextField?
Or should I use a separate textfield(s) to handle additional parameters (and possibly other fields for the STPCard)?

A: There's not currently a field on STPPaymentCardTextField allowing for zip entry; see this response from the repo maintainers suggesting you use a separate UITextField to capture the data - https://github.com/stripe/stripe-ios/issues/264.

A: The stripe SDK repo is a pretty good resource for this sort of question:
https://github.com/stripe/stripe-ios/blob/master/Stripe/STPCardParams.m
You can set the zipcode with the addressZip field as in:
public func submitForm(cardHolderName: String, ccNumber: String, securityCode: String, expirationDate: String, zipcode: String) {
    let stripeCard = STPCardParams()
    let expirationDateSplit = expirationDate.componentsSeparatedByString("/")
    let expMonth = UInt(Int(expirationDateSplit[0])!)
    let expYear = UInt(Int(expirationDateSplit[1])!)

    stripeCard.number = ccNumber
    stripeCard.cvc = securityCode
    stripeCard.expMonth = expMonth
    stripeCard.expYear = expYear
    stripeCard.addressZip = zipcode

    STPAPIClient.sharedClient().createTokenWithCard(stripeCard) { (token:STPToken?, error:NSError?) -> Void in
        if let err = error {
            self.handleError(err)
        } else if let toke = token {
            self.sendTokenToBackend(toke)
        }
    }
}

A:    //let s = STPCardParams()
    let paymentConfig = STPPaymentConfiguration()
    paymentConfig.publishableKey = "Your Public Key here"
    paymentConfig.requiredBillingAddressFields = STPBillingAddressFields.full

    let theme = STPTheme.default()

   // let addCardViewController = STPAddCardViewController.init(configuration: paymentConfig, theme: theme);
    let addCardViewController = STPAddCardViewController.init(configuration: paymentConfig, theme: theme)
    addCardViewController.delegate = self

    // Present add card view controller
    let navigationController = UINavigationController(rootViewController: addCardViewController)
    DispatchQueue.main.async {
        self.present(navigationController, animated: true)

    }


text:
Q: Confused about inputstreams and reading from files I tried to understand the logic behind inputstreams and reading from files, but I fail to understand how you can read from a file using an inputstream.
My understanding is that when using input devices like a keyboard, you send input data through the input stream to the system. If you are reading from an input stream, aren't you reading the input data that's being send to the system at that time?
If we are creating an inputstream with the following code:
FileInputStream test = new FileInputStream("loremipsum.txt");

And if we try to read from the newly created inputstream with test.read(); how is there any data flowing through the inputstream? As no inputdata has been input from an input device at the time, but has already been input way beforehand. Is there something I'm missing out on? It almost seems to me as input streams are used in two different ways: Java using inputstreams to read data from a source and input devices using to input data to a source.

A: Java streams are a general concept / interface - a stream of data that you need to open, then read the data from (or write data to for output streams), then close. The basic stream only supports sequential reading / writing, no random access. Also, the data may or may not be readily available when you attempt to read from the stream, so the read may or may not block.
This abstraction allows us to use the same approach regardless of where we read the data from - it might be keyboard, a file, a network connection, output form another program or even some kind of generator that generates an endless sequence of data. Simply put, reading the input from file behaves the same as if someone in the background opened the file and typed its content on the keyboard really fast.
There are ways in Java to read the file in another ways (e.g. random access instead of sequential), but if you need to read the file from start to end, streams are a useful abstraction.


text:
Q: Encoding a cipher Question:
It's time to practice our spy craft and encode a simple cipher. Write a function encode() that asks the user for the message to be encoded and for an integer key value. The cipher will shift each character in the message by adding the key to the character's Unicode value. For example, 'A' (unicode 65) shifted 3 produces 'D' (unicode 68).
Please make sure your output is only the cipher text.
The output should be:
enter a message: The time has come, the Walrus said
enter a key: 7
[ol'{ptl'ohz'jvtl3'{ol'^hsyz'zhpk

A: This is a simple caesar cipher
Here is the code anyway
def encrypt(text, s):
    result = ""
    # transverse the plain text
    for i in range(len(text)):
        char = text[i]
        # Encrypt uppercase characters in plain text
        if (char.isupper()):
            result += chr((ord(char) + s-65) % 26 + 65)
        # Encrypt lowercase characters in plain text
        else:
            result += chr((ord(char) + s - 97) % 26 + 97)
    return result

A: You could consider using chr, ord, and str.join(iterable):
def get_int_input(prompt: str) -> int:
    while True:
        try:
            return int(input(prompt))
        except ValueError:
            print('Error: Enter an integer, try again...')

def encode(message: str, key: int) -> str:
    return ''.join(chr(ord(ch) + key) for ch in message)

def main() -> None:
    message = input('Enter a message: ')
    key = get_int_input('Enter a key: ')
    encoded = encode(message, key)
    print(encoded)

if __name__ == '__main__':
    main()

Example Usage:
Enter a message: The time has come, the Walrus said
Enter a key: 7
[ol'{ptl'ohz'jvtl3'{ol'^hsy|z'zhpk

A: You can use chr() and ord() to shift each character and join() to put the result back together:
s = "The time has come, the Walrus said"
k = 7

e = "".join(chr(ord(c)+k) for c in s)

print(e)
[ol'{ptl'ohz'jvtl3'{ol'^hsy|z'zhpk


text:
Q: Ubuntu Partition Permissions I have just one partition with all my data on it. I want to change it's permission to allow any user to change, create and delete files and to be able to do that through LiveCD.
Also even after formatting the file system of the partition, I still want to be able to use my files after installing another system.

I tried to change permissions by running Nautilus as root but after logging in to the LiveCD, I still found my files locked.

A: Try using the terminal command chmod 777 /path/to/folder/or/file.


text:
Q: Convert Unicode to Dictionary

Version: Python 2.7.10.
I have the following:
r = requests.post(url = API_ENDPOINT, headers = headers, data = data)
print(r.text)
print(type(r.text))
print(r.text[2])

The output
{"type":"quote","symbol":"SPY","bid":266.52,"bidsz":5,"bidexch":"P","biddate":"1513040398000","ask":266.55,"asksz":100,"askexch":"P","askdate":"1513040399000"}
{"type":"trade","symbol":"SPY","exch":"P","price":"266.31","size":"0","cvol":"83077533","date":"1513040400000","last":"266.31"}
{"type":"summary","symbol":"SPY","open":"265.58","high":"266.38","low":"265.4793","prevClose":"265.51","close":"266.31"}
<type 'unicode'>
b

I would like to get the output "SPY".
I added the following:
new = simplejson.loads(r.text)
print(new)

Now, I get the following:
Traceback (most recent call last):
  File "example.py", line 63, in <module>
    new = simplejson.loads(r.text)
  File "/Library/Python/2.7/site-packages/simplejson/__init__.py",
line 518, in loads
    return _default_decoder.decode(s)
  File "/Library/Python/2.7/site-packages/simplejson/decoder.py",
line 373, in decode
    raise JSONDecodeError("Extra data", s, end, len(s))
simplejson.errors.JSONDecodeError: Extra data: line 1 column 160 -
line 1 column 407 (char 159 - 406)

I changed:
r = requests.post(url = API_ENDPOINT, headers = headers, data =
data).json()

Now, I get:
Traceback (most recent call last):
  File "example.py", line 51, in <module>
    r = requests.post(url = API_ENDPOINT, headers = headers, data =
data).json()
  File "/Library/Python/2.7/site-packages/requests/models.py", line
884, in json
    self.content.decode(encoding), **kwargs
  File "/Library/Python/2.7/site-packages/simplejson/__init__.py",
line 518, in loads
    return _default_decoder.decode(s)
  File "/Library/Python/2.7/site-packages/simplejson/decoder.py",
line 373, in decode
    raise JSONDecodeError("Extra data", s, end, len(s))
simplejson.errors.JSONDecodeError: Extra data: line 1 column 160 -
line 1 column 407 (char 159 - 406)

I added:
new = json.dumps(r.text)
print(new)
print(type(new))

Now, output is:
"{\"type\":\"quote\",\"symbol\":\"SPY\",\"bid\":266.52,\"bidsz\":5,\"bidexch\":\"P\",\"biddate\":\"1513040398000\",\"ask\":266.55,\"asksz\":100,\"askexch\":\"P\",\"askdate\":\"1513040399000\"}
{\"type\":\"trade\",\"symbol\":\"SPY\",\"exch\":\"P\",\"price\":\"266.31\",\"size\":\"0\",\"cvol\":\"83077533\",\"date\":\"1513040400000\",\"last\":\"266.31\"}
{\"type\":\"summary\",\"symbol\":\"SPY\",\"open\":\"265.58\",\"high\":\"266.38\",\"low\":\"265.4793\",\"prevClose\":\"265.51\",\"close\":\"266.31\"}"

<type 'str'>

If I do:
for line in r.text.splitlines():
    d = json.loads(line)

I get:
Traceback (most recent call last):
File "example.py", line 54, in <module>
d = json.loads(line)
File "/System/Library/Frameworks/Python.
framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in
loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/
Versions/2.7/lib/python2.7/json/decoder.py", line 369, in decode
raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column 158 - line 1 column 404
(char 157 - 403)

So I tried:
for line in r.text.splitlines():
    print(line)
    print("\n\n")

And I got:
{"type":"quote","symbol":"SPY","bid":267.18,"bidsz":1,"bidexch":"P","biddate":"1513213200000","ask":267.22,"asksz":3,"askexch":"P","askdate":"1513213200000"}
{"type":"quote","symbol":"SPY","bid":267.18,"bidsz":1,"bidexch":"P","biddate":"1513213200000","ask":267.22,"asksz":3,"askexch":"P","askdate":"1513213200000"}

So even though there should be two lines, it interprets everything as a single line.
How can I convert r.text to a dictionary?

A: You should be using this .json():
r.json()

A: I believe what you are receiving is JSON Lines format.  Each line of the response is a single json string.   I simulated the response:
import json

class r: pass
r.text = u'''\
{"type":"quote","symbol":"SPY","bid":266.52,"bidsz":5,"bidexch":"P","biddate":"1513040398000","ask":266.55,"asksz":100,"askexch":"P","askdate":"1513040399000"}
{"type":"trade","symbol":"SPY","exch":"P","price":"266.31","size":"0","cvol":"83077533","date":"1513040400000","last":"266.31"}
{"type":"summary","symbol":"SPY","open":"265.58","high":"266.38","low":"265.4793","prevClose":"265.51","close":"266.31"}
'''

print(r.text)
print(type(r.text))
print(r.text[2])

# Parse JSON a line at a time:
for line in r.text.splitlines():
    d = json.loads(line)
    print d['symbol']

Output:
{"type":"quote","symbol":"SPY","bid":266.52,"bidsz":5,"bidexch":"P","biddate":"1513040398000","ask":266.55,"asksz":100,"askexch":"P","askdate":"1513040399000"}
{"type":"trade","symbol":"SPY","exch":"P","price":"266.31","size":"0","cvol":"83077533","date":"1513040400000","last":"266.31"}
{"type":"summary","symbol":"SPY","open":"265.58","high":"266.38","low":"265.4793","prevClose":"265.51","close":"266.31"}

<type 'unicode'>
t
SPY
SPY
SPY


text:
Q: Deja Vu wont restore backup I have a problem when I try to restore a backup from an external hard drive. Deja Vu wont accept the password, it'll just keep prompting me for the password again and again, I'm absolutely sure that it's the correct one. When I tried running:
sudo deja-dup --restore

It will start normally but it will wait for my hard drive to "connect", I've tried using different USB ports to no avail.
I don't know what else to do, please tell me, is there any hope for retrieving my files?

A: Brow, i was facing the same problem than you.
I did the following: I deleted all from backup then i created a new backup without password.
Right now (12-31-2014: 08:16), Deja Vu Backup is restoring all my files from my notebook to my desktop.
I don't know if the problem was the password, or if was some corrupt file. However, it's working. This is the only thing matter =D


text:
Q: How to play next file using Audio Queue Services What is the right way to play next file using Audio Queue Services? When "play next" button is pressed should I first call AudioQueueStop and then AudioQueuePrime/AudioQueueStart or it is enough to just fill buffers with next file data?
The problem is that the latter gives me sound glitches on iPhone.

A: Did you find a good solution?
You may have to reset the audio queue also, as the encoding might be different for each file.


text:
Q: vboxconfig fails for signed modules In fedora 30 I signed the kernel modules for virtualbox (see e.g. here or here). After a modprobe for each of them I verify they have been loaded and then start a vboxconfig. That fails, however, and I cannot find out why.
All commands as root.
# lsmod | grep vbox
vboxpci                28672  0
vboxnetflt             32768  0
vboxnetadp             28672  0
vboxdrv               499712  3 vboxpci,vboxnetadp,vboxnetflt

# /sbin/vboxconfig
MY_PATH="/usr/lib/virtualbox"
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: You must sign these kernel modules before using VirtualBox:
  vboxdrv vboxnetflt vboxnetadp vboxpci
See the documenatation for your Linux distribution..
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.

# dmesg | tail -20
[20275.658123] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[20275.658412] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[20275.666192]  sda: sda1
[20275.667431] sd 0:0:0:0: [sda] Attached SCSI removable disk
[20275.929374] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[20781.983099] sda: detected capacity change from 62109253632 to 0
[20785.288217] usb 2-2: USB disconnect, device number 2
[21014.468966] rfkill: input handler enabled
[21024.550884] rfkill: input handler disabled
[24065.704492] perf: interrupt took too long (3203 > 3165), lowering kernel.perf_event_max_sample_rate to 62000
[29997.822876] perf: interrupt took too long (4019 > 4003), lowering kernel.perf_event_max_sample_rate to 49000
[31001.218858] vboxdrv: loading out-of-tree module taints kernel.
[31001.223112] vboxdrv: Found 8 processor cores
[31001.239256] vboxdrv: TSC mode is Invariant, tentative frequency 1992006120 Hz
[31001.239257] vboxdrv: Successfully loaded version 6.0.12 (interface 0x00290008)
[33547.206587] VBoxNetAdp: Successfully started.
[33547.219277] VBoxNetFlt: Successfully started.
[33547.229107] VBoxPciLinuxInit
[33547.229111] vboxpci: IOMMU found
[33564.239275] VBoxPciLinuxLinuxUnload


text:
Q: How to make LaTeX (tabu, hhline) tables keep rowheights? i want to typeset a long table across several columns / pages and want the table rows to keep register. my code looks basically like this:
\documentclass{book}
\usepackage{pagegrid}
\usepackage{fontspec}
\usepackage{tabu}
\usepackage{hhline}
\usepackage{multicol}
\setlength{\parskip}{0mm}
\setlength{\parindent}{0mm}
\setlength{\arrayrulewidth}{0.15mm}
\setlength{\doublerulesep}{0.5mm}
\begin{document}

\begin{multicols}{3}

{\setlength{\tabcolsep}{2mm}
\begin{tabu} to \linewidth { | X[1,l,m] | }
\hhline{|=|}
1 first line \\
\hhline{|=|}
2 secondline \\
\hhline{|=|}
\end{tabu}}

\vfill
\columnbreak

{\setlength{\tabcolsep}{2mm}
\begin{tabu} to \linewidth { | X[1,l,m] | }
\hhline{|-|}
1 first line \\
\hhline{|-|}
2 secondline \\
\hhline{|-|}
\end{tabu}}

\vfill
\columnbreak

{\setlength{\tabcolsep}{2mm}
\begin{tabu} to \linewidth { | X[1,l,m] | }
\hhline{|~|}
1 first line \\
\hhline{|~|}
2 secondline \\
\hhline{|~|}
\end{tabu}}

\end{multicols}
\end{document}

in reality those two-line tables really have 50 rows and extend over the entire page height. i need to insert double horizontal lines at various points in the tables, and of course those need space and add to table height—which causes the rows accross the pages to get out of sync. i should add that each partial table will have different numbers of lines occurring at different points, so using 'vertical glue' between rows (if that's possible) to make each stretch to page height wouldn't be ideal.
is there any way to force all rows to maintain height? in the past when faced with this problem in HTML/CSS, i always tried to typeset all the typographic elements but hid them from view where not needed. this greatly simplified things because you get away without many calculations, you just switch on what's need at a certain point. i'm not aware of any way to do that in (Xe)LaTeX.
how can i make all table rows keep in sync and 'add lines between table cells where needed', as it were?

A: You can make hhline always use a double line space:
\documentclass{book}
\usepackage{pagegrid}
\usepackage{fontspec}
\usepackage{tabu}
\usepackage{hhline}
\usepackage{multicol}
\setlength{\parskip}{0mm}
\setlength{\parindent}{0mm}
\setlength{\arrayrulewidth}{0.15mm}
\setlength{\doublerulesep}{0.5mm}
\makeatletter
\def\HH@add#1{\toks@\expandafter{\the\toks@#1\HH@box\z@\z@}}
\makeatletter
\begin{document}

\begin{multicols}{3}

{\setlength{\tabcolsep}{2mm}
\begin{tabu} to \linewidth { | X[1,l,m] | }
\hhline{|=|}
1 first line \\
\hhline{|=|}
2 secondline \\
\hhline{|=|}
\end{tabu}}

\vfill
\columnbreak

{\setlength{\tabcolsep}{2mm}
\begin{tabu} to \linewidth { | X[1,l,m] | }
\hhline{|-|}
1 first line \\
\hhline{|-|}
2 secondline \\
\hhline{|-|}
\end{tabu}}

\vfill
\columnbreak

{\setlength{\tabcolsep}{2mm}
\begin{tabu} to \linewidth { | X[1,l,m] | }
\hhline{|~|}
1 first line \\
\hhline{|~|}
2 secondline \\
\hhline{|~|}
\end{tabu}}

\end{multicols}
\end{document}


text:
Q: Guidance with programmatic animations I'd like to run a programatic animation in my app without blocking the runloop. What's a good way to do this?
Is there a way to do something similar to a CADisplayLink loop that the OpenGL templates do? Can I just set up that same runloop but do view transformations instead of updating a GL View?
Edit: I've gotten a display link up and running but I'm not sure how to make it work so that I can execute a block every n seconds? Any tips for working with CADisplayLink?
Edit 2:
Essentially, I'm trying to cause a view to pulse or transform. I'm not quite sure how to do this. The CADisplayLink fires many times per second, so I'm unsure how to calculate the change per frame.
I've set up a CADisplayLink in my view, like so:
@interface SomeView
@property (nonatomic, strong) CADisplayLink *displayLink;
@end

@implementation SomeView
//...
 - (id)init
 {
   self = [super init]

   if (self) {

    _displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(update)];
    [_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode: runMode:NSDefaultRunLoopMode];
   }

   return self;
 }

 - (void)update
 {
   // What can I put here to smoothly resize a view with transforms?
 }
 @end

Can someone explain how to do this?


text:
Q: Is programming Windows Phone 7 different from normal .NET programming? I know that there must be some differences. I have a Silverlight component (Timeline) and I want to make it work on Windows Phone 7. do I need to make a lot of changes ? I know .NET and Silverlight but I'm new to mobile phones programming.

A: The UI component of the Windows Phone 7 is supposed to be the same as Silverlight 3, so your timelines should work, as long as they worked properly in Silverlight 3.
The differences are in the APIs (phone-specific stuff... accelerometers, location, etc) and the BCL (Base Class Libraries) because Windows Phone 7 uses the .Net Compact Framework, where Silverlight uses its own implementation of the BCL.
These issues, coupled with the smaller screen and usability differences based on the small touch screen, will make it so you can't simply run the same app easily on the phone. You CAN, however, share a lot of your code, including much of your view code, when porting to the phone.

A: I don't know Silverlight but a lot of the .Net framework is not available in WinMo (it usually says on the MSDN pages if it's available or not).
You might have to change your app for other reasons though, since it'll have a smaller screen and you have to be careful about battery usage etc.
The following link has a list of differences:
http://msdn.microsoft.com/en-us/library/ff426930%28VS.96%29.aspx


text:
Q: Is Excel Alt+Enter same as Newline character \n ? I am loading data from excel column which contain multiple lines separated by alt+enter. can i use the new line \n in java to match this alt+enter in data loaded from the cells during validation? is alt+enter in excel same as \n ?

A: The documentation of excel say that alt+enter puts char(10).
char(10) is Line-Feed (LF), so it is the same character as \n in java.
\r (CR) and \n (LF), are named after the typewriter actions of pulling the page carriage back to the start and scrolling it up a line.

A: Alt+Enter in Excel is equivalent to CR+LF in Windows Format. We can check by copying the required text from Excel Cell (containing Alt+Enter) in Notepad++ (check the below snapshot)
Snapshot from Notepad++:

In Excel, Alt+Enter is a Line Break character equivalent to Chr(10)