text:
Q: Where does the Azure ML profiler run? Where does the model profiler run in Azure ML?
The doc here explains how to register a dataset, specify the inference configuration (scoring script and environment) and run the profiler.
I am trying to profile a tensorflow model and I get this error, which essentially tells nothing about what went wrong:
{
    "name": "tf-profiler-experiment3",
    "createdTime": "2020-05-11T18:19:46.827933+00:00",
    "state": "Failed",
    "requestedCpu": 3.5,
    "requestedMemoryInGB": 15.0,
    "requestedQueriesPerSecond": 0,
    "error": {
        "code": "ModelProfilingJobFailed",
        "statusCode": 500,
        "message": "An internal server error occurred. Please try again. If the problem persists, contact support",
        "details": []
    }
}

So where exactly are 3.5 CPUs and 15 GB requested? And where to find the details of the error?


text:
Q: Swift 3 UITableViewCell Alamofire Image Update how would I update my imageView inside UITableViewCell from URL via Alamofire on a regular interval (e.g. every 1 second)?

A: Can you not just do it with a timer?
E.G:
var changeImageTimer= Timer.scheduledTimerWithTimeInterval(1.0, target: self, selector: Selector("changeImage"), userInfo: nil, repeats: true)

func changeImage()
{
    //Code to change your image here
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: After windows update ran this morning, PC boots to black screen I am running Windows 8.1, and this morning I was prompted to reboot. I have been putting it off for a few days and it would no longer allow me to postpone. I restarted adding the updates and now when I boot I get nothing but a black screen. I can get to the bios, but not safe mode / windows recovery screen. The windows logo never comes up and hitting F8 nor shift + F8 does anything, due to the fact that I don't think windows exists in a non-corrupted state.
Is there anything I can do, other than going to someone else's house / computer and creating a boot disk / flash drive?

A: 1st of all, try running Windows in safe mode see more about
http://pcsupport.about.com/od/windows-8/a/open-advanced-startup-options-windows-8.htm
After you boot in safe mode, Windows should load the default drivers for the video card.
If Windows is running in safe mode, you have a driver issue. You can try this driver
 - http://www.geforce.com/drivers/results/73218
not sure if it will work...


text:
Q: AngularJS ng-options with several fields I have a collection of objects with user info.
"Id": "1",
"Firstname": "ABCDEF",
"Lastname": "GHIJK",
"Middlename": ""

In my select options I want to display two fields - Firstname Lastname. I don't get how to do it and how to bind it to ng-model.

A: Just an additional update,
I had to show the Last name enclosed in brackets so here is how I modified the answer and got it working.
<select
   name="users"
   ng-model="selectedUser"
   ng-options="user.Id as user.Firstname + ' (' + user.Lastname + ') ' for user in users">
</select>

A: Considering the format of your array object to be like this.
$scope.userInfo = [
                    {"Id": "1", "Firstname": "ACDEF", "Lastname": "GHIJK", "Middlename": ""},
                    {"Id": "2", "Firstname": "BADEF", "Lastname": "HIGJK", "Middlename": ""},
                    {"Id": "3", "Firstname": "CDBEF", "Lastname": "IIHJK", "Middlename": ""},
                ]

You can display two fields like this and and bind it to the model as shown below.
<select ng-model="userInfo" ng-options="s.Firstname +' '+ s.Lastname for s in userInfo" class="span2"> </select>

A: You can try this :
<select
  name="users"
  ng-model="selectedUser"
  ng-options="user.Id as user.Firstname + ' ' + user.Lastname for user in users">
</select>

More information in the documentation : https://docs.angularjs.org/api/ng/directive/select

A: Theres is always in a non ng-options scenario, where you can bind two params from the ng-repeat item:
  <select name="user" ng-model="vm.asignedUser">
    <option value="">Select user</option>
    <option value="{{ {'name':user.name, 'id': user.id} }}" ng-repeat="user in vm.users">
      {{ user.nombreLargo }}
    </option>
  </select>

A: This worked for me:
<select ng-model="color" ng-options="(c.name+' '+c.shade) for c in colors"></select>

Source: https://groups.google.com/d/msg/angular/ljJd5x1Tgrk/bZuVWCA1hO4J


text:
Q: Delete rows with null values from a csv file in c# How can I delete a row which contains null values from a comma separated csv file in c# ?
Example:
|      FirstName      |     LastName     |      Email    |    Address   |
|---------------------|------------------|---------------|--------------|
|          lmn        |         lmn      |lmn@lmn.com    |DemoAddress   |
|          xy         |         xy       |xy@xy.com      |DemoAddress   |
|          demo       |         demo     |               |              |
|          demo2      |         demo2    |xy@xy.com      |DemoAddress   |

Outcome:
|      FirstName      |     LastName     |      Email    |    Address   |
|---------------------|------------------|---------------|--------------|
|          lmn        |         lmn      |lmn@lmn.com    |DemoAddress   |
|          xy         |         xy       |xy@xy.com      |DemoAddress   |
|          demo2      |         demo2    |xy@xy.com      |DemoAddress   |

I tried the following code but doesn't work as expected
        private string filterCSV(string strFilePath)
        {
            var columnIndex = 3;
            var line = File.ReadAllLines(strFilePath);
            var n = line.Where(x => x[columnIndex].Equals(""));
            string result = string.Join("\r", not.ToArray());

            return result;

        }

A: Adding answer for future reference
private void RemoveBlanks(string datapath)
        {
            List<CSV> records;
            using (var reader = new StreamReader(datapath))
            using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
            {
                records = csv.GetRecords<CSV>().ToList();
                for(int i = 0; i < records.Count;++i)
                {
                    if (records[i].Email== "" && records[i].Address == "")
                    {

                        records.RemoveAt(i);
                    }
                }

            }
            using (var writer = new StreamWriter(datapath))
            using (var csv = new CsvWriter(writer, CultureInfo.InvariantCulture))
            {
                csv.WriteRecords(records);
            }
        }


text:
Q: Cannot get update property from prototype In the following code I do not understand why the last console.log does not return 'kj18', although the pro-type has been changed before that line.
Could you please provide me an explanation?

var studentId = 'ab73';

function Student() {
  this.studentId = 'b0e1';
}

console.clear()

console.log(new Student().studentId);

Student.prototype.studentId = 'kj18'
Student.prototype.classId = '5e'

console.log(new Student().classId)
console.log(new Student().studentId) // why is not kj18

A: Because the assignment in the function Student() gets executed when you create a new instance from Student and it all happens after this assignment: Student.prototype.studentId = 'kj18'

A: Adding a log to the "constructor" helps explain it.

var studentId = 'ab73';

function Student() {
  this.studentId = 'b0e1';
  console.log('assigned b0e1')
}

console.log(new Student().studentId);

Student.prototype.studentId = 'kj18'
console.log('assigned kj18')
Student.prototype.classId = '5e'

console.log(new Student().classId)
console.log(new Student().studentId) // why is not kj18


text:
Q: Automated commits with Jenkins Following scenario: a cicd pipeline at an openshift account where I have very limited accesses (just logging outputs, secrets and redeploy). I used to build my images in Jenkins, where I had the "build periodically" option. I work with an upper abstraction layer , built upon redhat openshift, that contains its own pipeline to build images but not an "scheduled / automated build function", hence I have to redeploy my 40+ microservices periodically so that I can keep the pods clear of vulnerabilities. A huge piece of manual work...
I don't plan to move my image building back to Jenkins, but I was wondering if is it possible to , for instance, using Jenkins to check in my git repositories and generate some automated commit of sorts (like a readme file update), which in turn would trigger a build automatically at my openshift cluster.
Might sound like a crazy idea but , has anyone ever came across a similar scenario? Could it be doable? I have both Jenkins and TravisCI avaliable for my project.
I tried thinking how a cronjob of sorts would help me getting this done, but since to my limited OC access scope, I don't think I would be able to even create a cron.


text:
Q: Java level issue with Maven compilation I'm facing a weird issue. In Maven I am setting the Java level to 1.8. In my code I have some Java 11 syntax, namely:
final Optional<Stock> stock = stockRepo.findById(id);
if (stock.isEmpty()) {
    throw new StockNotFoundException("Stock not found, id: " + id);
}

The code gets compiled just OK, I was expecting it to fail.
In the pom I have:
<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <encoding>${project.build.sourceEncoding}</encoding>
            </configuration>
        </plugin>
...

Maven prints the following logs with -X option
[DEBUG] Command line options:
[DEBUG] -d /Users/user/Desktop/java_dev/projects/stockapp-spring-boot/stockapp/target/classes -classpath /Users/user/Desktop/java_dev/projects/stockapp-spring-boot/stockapp/target/classes:/Users/user/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.6.2/spring-boot-starter-web-2.6.2.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot-starter/2.6.2/spring-boot-starter-2.6.2.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot/2.6.2/spring-boot-2.6.2.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.6.2/spring-boot-autoconfigure-2.6.2.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.6.2/spring-boot-starter-logging-2.6.2.jar:/Users/user/.m2/repository/ch/qos/logback/logback-classic/1.2.9/logback-classic-1.2.9.jar:/Users/user/.m2/repository/ch/qos/logback/logback-core/1.2.9/logback-core-1.2.9.jar:/Users/user/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.17.0/log4j-to-slf4j-2.17.0.jar:/Users/user/.m2/repository/org/apache/logging/log4j/log4j-api/2.17.0/log4j-api-2.17.0.jar:/Users/user/.m2/repository/org/slf4j/jul-to-slf4j/1.7.32/jul-to-slf4j-1.7.32.jar:/Users/user/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar:/Users/user/.m2/repository/org/yaml/snakeyaml/1.29/snakeyaml-1.29.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.6.2/spring-boot-starter-json-2.6.2.jar:/Users/user/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.13.1/jackson-datatype-jdk8-2.13.1.jar:/Users/user/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.13.1/jackson-datatype-jsr310-2.13.1.jar:/Users/user/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.13.1/jackson-module-parameter-names-2.13.1.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.6.2/spring-boot-starter-tomcat-2.6.2.jar:/Users/user/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.56/tomcat-embed-core-9.0.56.jar:/Users/user/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.56/tomcat-embed-websocket-9.0.56.jar:/Users/user/.m2/repository/org/springframework/spring-web/5.3.14/spring-web-5.3.14.jar:/Users/user/.m2/repository/org/springframework/spring-beans/5.3.14/spring-beans-5.3.14.jar:/Users/user/.m2/repository/org/springframework/spring-webmvc/5.3.14/spring-webmvc-5.3.14.jar:/Users/user/.m2/repository/org/springframework/spring-context/5.3.14/spring-context-5.3.14.jar:/Users/user/.m2/repository/org/springframework/spring-expression/5.3.14/spring-expression-5.3.14.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot-starter-security/2.6.2/spring-boot-starter-security-2.6.2.jar:/Users/user/.m2/repository/org/springframework/spring-aop/5.3.14/spring-aop-5.3.14.jar:/Users/user/.m2/repository/org/springframework/security/spring-security-config/5.6.1/spring-security-config-5.6.1.jar:/Users/user/.m2/repository/org/springframework/security/spring-security-core/5.6.1/spring-security-core-5.6.1.jar:/Users/user/.m2/repository/org/springframework/security/spring-security-crypto/5.6.1/spring-security-crypto-5.6.1.jar:/Users/user/.m2/repository/org/springframework/security/spring-security-web/5.6.1/spring-security-web-5.6.1.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/2.6.2/spring-boot-starter-data-jpa-2.6.2.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot-starter-aop/2.6.2/spring-boot-starter-aop-2.6.2.jar:/Users/user/.m2/repository/org/aspectj/aspectjweaver/1.9.7/aspectjweaver-1.9.7.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/2.6.2/spring-boot-starter-jdbc-2.6.2.jar:/Users/user/.m2/repository/com/zaxxer/HikariCP/4.0.3/HikariCP-4.0.3.jar:/Users/user/.m2/repository/org/springframework/spring-jdbc/5.3.14/spring-jdbc-5.3.14.jar:/Users/user/.m2/repository/jakarta/transaction/jakarta.transaction-api/1.3.3/jakarta.transaction-api-1.3.3.jar:/Users/user/.m2/repository/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3.jar:/Users/user/.m2/repository/org/hibernate/hibernate-core/5.6.3.Final/hibernate-core-5.6.3.Final.jar:/Users/user/.m2/repository/org/jboss/logging/jboss-logging/3.4.2.Final/jboss-logging-3.4.2.Final.jar:/Users/user/.m2/repository/net/bytebuddy/byte-buddy/1.11.22/byte-buddy-1.11.22.jar:/Users/user/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/Users/user/.m2/repository/org/jboss/jandex/2.2.3.Final/jandex-2.2.3.Final.jar:/Users/user/.m2/repository/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar:/Users/user/.m2/repository/org/hibernate/common/hibernate-commons-annotations/5.1.2.Final/hibernate-commons-annotations-5.1.2.Final.jar:/Users/user/.m2/repository/org/glassfish/jaxb/jaxb-runtime/2.3.5/jaxb-runtime-2.3.5.jar:/Users/user/.m2/repository/org/glassfish/jaxb/txw2/2.3.5/txw2-2.3.5.jar:/Users/user/.m2/repository/com/sun/istack/istack-commons-runtime/3.0.12/istack-commons-runtime-3.0.12.jar:/Users/user/.m2/repository/org/springframework/data/spring-data-jpa/2.6.0/spring-data-jpa-2.6.0.jar:/Users/user/.m2/repository/org/springframework/data/spring-data-commons/2.6.0/spring-data-commons-2.6.0.jar:/Users/user/.m2/repository/org/springframework/spring-orm/5.3.14/spring-orm-5.3.14.jar:/Users/user/.m2/repository/org/springframework/spring-tx/5.3.14/spring-tx-5.3.14.jar:/Users/user/.m2/repository/org/slf4j/slf4j-api/1.7.32/slf4j-api-1.7.32.jar:/Users/user/.m2/repository/org/springframework/spring-aspects/5.3.14/spring-aspects-5.3.14.jar:/Users/user/.m2/repository/org/springframework/boot/spring-boot-starter-validation/2.6.2/spring-boot-starter-validation-2.6.2.jar:/Users/user/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.56/tomcat-embed-el-9.0.56.jar:/Users/user/.m2/repository/org/hibernate/validator/hibernate-validator/6.2.0.Final/hibernate-validator-6.2.0.Final.jar:/Users/user/.m2/repository/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar:/Users/user/.m2/repository/org/liquibase/liquibase-core/4.5.0/liquibase-core-4.5.0.jar:/Users/user/.m2/repository/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar:/Users/user/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar:/Users/user/.m2/repository/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.13.1/jackson-module-jaxb-annotations-2.13.1.jar:/Users/user/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.13.1/jackson-annotations-2.13.1.jar:/Users/user/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.13.1/jackson-core-2.13.1.jar:/Users/user/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.13.1/jackson-databind-2.13.1.jar:/Users/user/.m2/repository/jakarta/xml/bind/jakarta.xml.bind-api/2.3.3/jakarta.xml.bind-api-2.3.3.jar:/Users/user/.m2/repository/jakarta/activation/jakarta.activation-api/1.2.2/jakarta.activation-api-1.2.2.jar:/Users/user/.m2/repository/org/springframework/spring-core/5.3.14/spring-core-5.3.14.jar:/Users/user/.m2/repository/org/springframework/spring-jcl/5.3.14/spring-jcl-5.3.14.jar:/Users/user/.m2/repository/org/projectlombok/lombok/1.18.22/lombok-1.18.22.jar:/Users/user/.m2/repository/org/mapstruct/mapstruct-processor/1.3.1.Final/mapstruct-processor-1.3.1.Final.jar:/Users/user/.m2/repository/org/mapstruct/mapstruct/1.3.1.Final/mapstruct-1.3.1.Final.jar: -sourcepath /Users/user/Desktop/java_dev/projects/stockapp-spring-boot/stockapp/src/main/java:/Users/user/Desktop/java_dev/projects/stockapp-spring-boot/stockapp/target/generated-sources/annotations: -s /Users/user/Desktop/java_dev/projects/stockapp-spring-boot/stockapp/target/generated-sources/annotations -g -nowarn -target 1.8 -source 1.8 -encoding UTF-8

Any clue?

A: There is no specific Java 11 syntax in the provided code. There is a use of an API not present in JDK8, so if you try compiling this with JDK8 it will fail. But you are probably compiling with JAVA_HOME set to JDK11+.
The syntax difference would be something like:
final var stock = stockRepo.findById(id);


text:
Q: C++ WinRT UWP XAML Data binding ItemsSource and SelectedIndex to IObservableVector does not work I am using Visual Studio 2019 16.4.3, Microsoft.Windows.CppWinRT 2.0.200117.5, Windows 10 1809 Pro and targeting 10.0.17763.0.
I am trying to port a C++/CX app to C++ WinRT.  I am using data binding of the ItemsSource, SelectedIndexand SelectedItem properties of a combo box but I am running into issues.
For the ItemsSource I am binding to a IObservableVector<String>. The property is implemented using IObservableVector<hstring> and initialized with single_threaded_observable_vector(std::vector<hstring>({L"One", L"Two", L"Three"}))
When starting the application I am getting the following exception:
Exception thrown at 0x766B19B2 in BlankCppWinRT.exe: Microsoft C++ exception: winrt::hresult_no_interface at memory location 0x03AED210. occurred
Is this supposed to work? How do I data bind a ItemsSource to a collection of strings? This works in C# and C++/CX. What is the equivalent in C++ WinRT?
When I remove the two way binding to SelectedIndex the application starts and shows the three strings in the combo box, with an empty selected item. But when I try to set the selected index in code by myComboBox().SelectedIndex(0); (in the constructor) I am getting the same exception. Whereas the same line works in the Loaded handler of the page.
Details below.
Any ideas?
Call stack of exception:
    KernelBase.dll!_RaiseException@16() Unknown
    vcruntime140d_app.dll!_CxxThrowException(void * pExceptionObject, const _s__ThrowInfo * pThrowInfo) Line 133    C++
>   BlankCppWinRT.exe!winrt::throw_hresult(const winrt::hresult result) Line 4623   C++
    BlankCppWinRT.exe!winrt::check_hresult(const winrt::hresult result) Line 4700   C++
    BlankCppWinRT.exe!winrt::impl::as<winrt::Windows::Foundation::IReference<winrt::hstring>,winrt::impl::abi<winrt::Windows::Foundation::IUnknown,void>::type>(winrt::impl::abi<winrt::Windows::Foundation::IUnknown,void>::type * ptr) Line 1941  C++
    BlankCppWinRT.exe!winrt::Windows::Foundation::IUnknown::as<winrt::Windows::Foundation::IReference<winrt::hstring>>() Line 2026  C++
    BlankCppWinRT.exe!winrt::unbox_value<winrt::hstring>(const winrt::Windows::Foundation::IInspectable & value) Line 2872  C++
    BlankCppWinRT.exe!winrt::impl::convertible_observable_vector<winrt::hstring,std::vector<winrt::hstring,std::allocator<winrt::hstring>>>::IndexOf(const winrt::Windows::Foundation::IInspectable & value, unsigned int & index) Line 2547    C++
    BlankCppWinRT.exe!winrt::impl::produce<winrt::impl::convertible_observable_vector<winrt::hstring,std::vector<winrt::hstring,std::allocator<winrt::hstring>>>,winrt::Windows::Foundation::Collections::IVector<winrt::Windows::Foundation::IInspectable>>::IndexOf(void * value, unsigned int * index, bool * winrt_impl_result) Line 566    C++
    Windows.UI.Xaml.dll!DirectUI::ItemCollection::IndexOf(IInspectable * value, unsigned int * index, unsigned char * found) Line 139   C++
    Windows.UI.Xaml.dll!DirectUI::ItemsControl::IsHostForItemContainer(Windows::UI::Xaml::IDependencyObject * pContainer, unsigned char * pIsHost) Line 1939    C++
    Windows.UI.Xaml.dll!DirectUI::ComboBox::IsHostForItemContainer(Windows::UI::Xaml::IDependencyObject * pContainer, unsigned char * pIsHost) Line 1239    C++
    Windows.UI.Xaml.dll!DirectUI::ItemContainerGenerator::ItemFromContainerImpl(Windows::UI::Xaml::IDependencyObject * container, IInspectable * * returnValue) Line 767    C++
    Windows.UI.Xaml.dll!DirectUI::ItemContainerGeneratorGenerated::ItemFromContainer(Windows::UI::Xaml::IDependencyObject * pContainer, IInspectable * * ppReturnValue) Line 222    C++

This is my XAML code:
<Page
    x:Class="BlankCppWinRT.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BlankCppWinRT"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" Loaded="OnLoaded">

    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Button Margin="8" Width="160" x:Name="myButton" Click="ClickHandler">Click Me</Button>
        <ComboBox Margin="8" Width="160" x:Name="myComboBox" ItemsSource="{x:Bind Path=BoxItems}" SelectedIndex="{x:Bind Path=SelectedBoxItemIndex, Mode=TwoWay}"/>
    </StackPanel>
</Page>

This the .idl file:
namespace BlankCppWinRT
{
    [bindable]
    [default_interface]
    runtimeclass MainPage : Windows.UI.Xaml.Controls.Page, Windows.UI.Xaml.Data.INotifyPropertyChanged
    {
        MainPage();
        Windows.Foundation.Collections.IObservableVector<String> BoxItems{get;};
        Int32 SelectedBoxItemIndex;
        protected void RaisePropertyChanged(String propertyName);
    }
}

This MainPage.h:
#pragma once

#include "MainPage.g.h"

namespace winrt::BlankCppWinRT::implementation
{
    struct MainPage : MainPageT<MainPage>
    {
        MainPage();

        Windows::Foundation::Collections::IObservableVector<hstring> BoxItems();

        int32_t SelectedBoxItemIndex();
        void SelectedBoxItemIndex(int32_t value);

        void ClickHandler(Windows::Foundation::IInspectable const& sender, Windows::UI::Xaml::RoutedEventArgs const& args);

        void RaisePropertyChanged(hstring const& propertyName);
        winrt::event_token PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const& handler);
        void PropertyChanged(winrt::event_token const& token) noexcept;

        void OnLoaded(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::RoutedEventArgs const& e);

    protected:
        template<typename T>
        bool SetProperty(T& storage, const T& value, const hstring& propertyName)
        {
            if (storage == value)
                return false;
            storage = value;
            RaisePropertyChanged(propertyName);
            return true;
        }

    private:
        event<winrt::Windows::UI::Xaml::Data::PropertyChangedEventHandler> m_propertyChanged;

    private:
        Windows::Foundation::Collections::IObservableVector<hstring> m_boxItems;
        int m_selectedBoxItemIndex{};
    };
}

namespace winrt::BlankCppWinRT::factory_implementation
{
    struct MainPage : MainPageT<MainPage, implementation::MainPage>
    {
    };
}

This is MainPage.cpp:
#include "pch.h"
#include "MainPage.h"
#include "MainPage.g.cpp"

using namespace winrt;
using namespace Windows::UI::Xaml;

namespace winrt::BlankCppWinRT::implementation
{
    MainPage::MainPage()
        : m_boxItems{single_threaded_observable_vector(std::vector<hstring>({L"One", L"Two", L"Three"}))}
    {
        InitializeComponent();
        //causes exception
        //myComboBox().SelectedIndex(0);
    }

    Windows::Foundation::Collections::IObservableVector<hstring> MainPage::BoxItems()
    {
        return m_boxItems;
    }

    int32_t MainPage::SelectedBoxItemIndex()
    {
        return m_selectedBoxItemIndex;
    }

    // data binding to SelectedBoxItemIndex causes exception

    void MainPage::SelectedBoxItemIndex(int32_t value)
    {
        SetProperty(m_selectedBoxItemIndex, value, L"SelectedBoxItemIndex");
    }

    void MainPage::ClickHandler(IInspectable const&, RoutedEventArgs const&)
    {
        myButton().Content(box_value(L"Clicked"));
        SelectedBoxItemIndex(2);
    }

    void MainPage::RaisePropertyChanged(hstring const& propertyName)
    {
        m_propertyChanged(*this, PropertyChangedEventArgs(propertyName));
    }

    winrt::event_token MainPage::PropertyChanged(Windows::UI::Xaml::Data::PropertyChangedEventHandler const& handler)
    {
        return m_propertyChanged.add(handler);
    }

    void MainPage::PropertyChanged(winrt::event_token const& token) noexcept
    {
        m_propertyChanged.remove(token);
    }

    void MainPage::OnLoaded(winrt::Windows::Foundation::IInspectable const& sender, winrt::Windows::UI::Xaml::RoutedEventArgs const& e)
    {
        // works
        myComboBox().SelectedIndex(0);
    }
}

A: As a stopgap fix, you could go to the Windows.Foundation.Collections.h to override the IndexOf() method. When unbox_value fails, catch the hresult_no_interface exception and return false. For more details, you can refer to this thread.
bool IndexOf(Windows::Foundation::IInspectable const& value, uint32_t& index) const
{
    //return IndexOf(unbox_value<T>(value), index);
    try
    {
        return IndexOf(unbox_value<T>(value), index);
    }
    catch (hresult_no_interface const&)
    {
        return false; // unbox_value failed, "value" wasn't even a boxed T
    }
}


text:
Q: MySQL - join/group concat returning too many items I've got a simple query which brings up wins, draws and losses in a head-to-head matches table.
SELECT
    SUM(CASE WHEN score_w > score_m THEN 1 ELSE 0 END) AS wins_w,
    SUM(CASE WHEN score_m > score_w THEN 1 ELSE 0 END) AS wins_m,
    SUM(CASE WHEN score_w = score_m THEN 1 ELSE 0 END) AS draws
FROM 6dos7me3xn8

All is well. I get a single row, with the data I need as columns.
Now I want to also pull out a group concat'd list of the most recent three match dates. I tried:
SELECT
    SUM(CASE WHEN mn.score_w, 0) > mn.score_m THEN 1 ELSE 0 END) AS wins_w,
    SUM(CASE WHEN mn.score_m > mn.score_w THEN 1 ELSE 0 END) AS wins_m,
    SUM(CASE WHEN mn.score_w = mn.score_m THEN 1 ELSE 0 END) AS draws,
    GROUP_CONCAT(jn.date) AS recent
FROM 6dos7me3xn8 mn
JOIN (SELECT date FROM 6dos7me3xn8 ORDER BY date DESC LIMIT 3) jn

...but the LIMIT is having no effect, seemingly - I get all of the dates group concat'd, not just 3.
I also tried removing the JOIN and replacing the GROUP_CONCAT with
GROUP_CONCAT((SELECT date FROM 6dos7me3xn8 ORDER BY date DESC LIMIT 3)) AS recent

...but that errors with 'Subquery returns more than 1 row.'
I'm sure it's something simple, but what am I doing wrong?

A: You are doing a cross join.  TO get the most recent three dates, you can use:
FROM (SELECT mn.*, DENSE_RANK() OVER (ORDER BY date desc) as seqnum
      FROM 6dos7me3xn8 mn
     ) mn
WHERE seqnum <= 3

A: If you are running MySQL 8.0, you can do this with window functions:
select
    sum(score_w > score_m) as wins_w,
    sum(score_m > score_w) as wins_m,
    sum(score_w = score_m) as draws,
    group_concat(case when rn <= 3 then date end) as recent
from (
    select t.*, row_number() over(order by date desc) rn
    from `6dos7me3xn8` t
) t

The subquery ranks records by descending date; we can then use that information in the outer query. Note that you don't need the case expressions: MySQL evaluates true/false conditions as 1/0 in numeric contet.
In earlier versions, the simpler approach is probably a row-limiting subquery:
select
    sum(score_w > score_m) as wins_w,
    sum(score_m > score_w) as wins_m,
    sum(score_w = score_m) as draws,
    (select group_concat(date) from (select date from `6dos7me3xn8` order by date desc limit 3) t) as recent
from `6dos7me3xn8`

A: You have no ON clause to specify the relationship between the subquery and the table you're joining it to. So you get a full cross product.
You also need ORDER BY to make it return the 3 most recent dates, not any 3 dates.
SELECT
    SUM(CASE WHEN mn.score_w, 0) > mn.score_m THEN 1 ELSE 0 END) AS wins_w,
    SUM(CASE WHEN mn.score_m > mn.score_w THEN 1 ELSE 0 END) AS wins_m,
    SUM(CASE WHEN mn.score_w = mn.score_m THEN 1 ELSE 0 END) AS draws,
    GROUP_CONCAT(jn.date) AS recent
FROM 6dos7me3xn8 mn
JOIN (
    SELECT DISTINCT date
    FROM 6dos7me3xn8
    ORDER BY date DESC
    LIMIT 3
) jn ON jn.date = mn.date


text:
Q: What is a greedy algorithm for this problem that is minimally optimal + proof? The details are a bit cringe, fair warning lol:
I want to set up meters on the floor of my building to catch someone; assume my floor is a number line from 0 to length L. The specific type of meter I am designing has a radius of detection that is 4.7 meters in the -x and +x direction (diameter of 9.4 meters of detection). I want to set them up in such a way that if the person I am trying to find steps foot anywhere in the floor, I will know. However, I can't just setup a meter anywhere (it may annoy other residents); therefore, there are only n valid locations that I can setup a meter. Additionally, these meters are expensive and time consuming to make, so I would like to use as few as possible.
For simplicity, you can assume the meter has 0 width, and that each valid location is just a point on the number line aformentioned. What is a greedy algorithm that places as few meters as possible, while being able to detect the entire hallway of length L like I want it to, or, if detecting the entire hallway is not possible, will output false for the set of n locations I have (and, if it isn't able to detect the whole hallway, still uses as few meters as possible while attempting to do so)?
Edit: some clarification on being able to detect the entire hallway or not

A: To prove that your solution is optimal if it is found, you merely have to prove that it finds the lexicographically last optimal solution.
And you do that by induction on the size of the lexicographically last optimal solution.  The case of a zero length floor and no monitor is trivial.  Otherwise you demonstrate that you found the first element of the lexicographically last solution. And covering the rest of the line with the remaining elements is your induction step.
Technical note, for this to work you have to be allowed to place monitoring stations outside of the line.

A: Given:

*

*L (hallway length)

*a list of N valid positions to place a meter (p_0 ... p_N-1) of radius 4.7

You can determine in O(N) either a valid and minimal ("good") covering of the whole hallway or a proof that no such covering exists given the constraints as follows (pseudo-code):
// total = total length;
// start = current starting position, initially 0
// possible = list of possible meter positions
// placed = list of (optimal) meter placements, initially empty
boolean solve(float total, float start, List<Float> possible, List<Float> placed):

   if (total-start <= 0):
        return true; // problem solved with no additional meters - woo!
   else:
        Float next = extractFurthestWithinRange(start, possible, 4.7);
        if (next == null):
             return false; // no way to cover end of hall: report failure
        else:
             placed.add(next); // placement decided
             return solve(total, next + 4.7, possible, placed);

Where extractFurthestWithinRange(float start, List<Float> candidates, float range) returns null if there are no candidates within range of start, or returns the last position p in candidates such that p <= start + range -- and also removes p, and all candidates c such that p >= c.
The key here is that, by always choosing to place a meter in the next position that a) leaves no gaps and b) is furthest from the previously-placed position we are simultaneously creating a valid covering (= no gaps) and an optimal covering (= no possible valid covering could have used less meters - because our gaps are already as wide as possible). At each iteration, we either completely solve the problem, or take a greedy bite to reduce it to a (guaranteed) smaller problem.
Note that there can be other optimal coverings with different meter positions, but they will use the exact same number of meters as those returned from this pseudo-code. For example, if you adapt the code to start from the end of the hallway instead of from the start, the covering would still be good, but the gaps could be rearranged. Indeed, if you need the lexicographically minimal optimal covering, you should use the adapted algorithm that places meters starting from the end:
// remaining = length (starts at hallway length)
// possible = positions to place meters at, starting by closest to end of hallway
// placed = positions where meters have been placed
boolean solve(float remaining, List<Float> possible, Queue<Float> placed):

   if (remaining <= 0):
        return true; // problem solved with no additional meters - woo!
   else:
        // extracts points p up to and including p such that p >= remaining - range
        Float next = extractFurthestWithinRange2(remaining, possible, 4.7);
        if (next == null):
             return false; // no way to cover start of hall: report failure
        else:
             placed.add(next); // placement decided
             return solve(next - 4.7, possible, placed);


text:
Q: animate header with Angular 5 I am getting to grips with angular animations and I am trying to make a header that will animate properly.
I have been following this tutorial:
https://netbasal.com/reactive-sticky-header-in-angular-12dbffb3f1d3
which is helping me create my header, but I don't want it to do exactly what they are doing, which is why I need some help.
First of all, when scrolling down the page; I don't want the entire header to vanish. Instead I want it to shrink to around 10px; when I scroll back up I would like it to go to 60px;
I have changed the animation to this:
trigger('toggle', [
  state(
    VisibilityState.Hidden,
    style({ opacity: 1, height: '10px' })
  ),
  state(
    VisibilityState.Visible,
    style({ opacity: 1, height: '60px' })
  ),
  transition('* => *', animate('200ms ease-in'))
])

which works to an extend.
I have some content inside my template that doesn't shrink when the header does.
my CSS for the header component looks like this:
:host {
  position: fixed;
  top: 0;
  width: 100%;
  text-align: center; // TODO: only for testing, remove later
  background-color: indigo; // TODO: only for testing, remove later
}

and the HTML looks like this:

This is the header

So, the first part of this question, is how do I make the content (whatever it is) hide when the menu is compressed? I am sure that is the easy part :)
The second part to this, is I want to add a new event/animation. When you hover over the menu in it's compressed form, I would like it to expand to it's original size (as if you are scrolling up the page).
This is hard for me and I would appreciate any help you can give me.

* Update *
I managed to get the second part to work.
I changed my HTML to this:

This is the header

And added a new property and 2 new methods to the component:
private wasVisible = this.isVisible;

mouseEnter() {
  this.wasVisible = this.isVisible === true;
  this.isVisible = true;
}

mouseLeave() {
  this.isVisible = this.wasVisible === true;
}

So, when I hover of the component, if it is already visible it will stay that way and when I leave, it will reset to whatever it was like before I entered the component.
If the component was compressed, it will uncompress it and when we move out, it will put it back to being compressed.
Now I just need to figure out how to sort the content.

A: Hide content:
Make the member variable isVisible public so you can use it in the view, then hide content with *ngIf="isVisible".
Hovering:
Add two methods with @HostListener("mouseenter") and @HostListener("mouseleave") to the component, implement them like this:
@HostListener("mouseenter")
onMouseEnter() {
  this.isVisible = true;
}

@HostListener("mouseleave")
onMouseLeave() {
  this.isVisible = false;
}

A: so, the only way I could think to do this was to apply a class to the element. So I modified my toggle method to this:
@HostBinding('@toggle')
get toggle(): VisibilityState {
  if (this.isVisible) {
    this.renderer.removeClass(this.element.nativeElement, 'collapsed');
  }
  else {
    this.renderer.addClass(this.element.nativeElement, 'collapsed');
  }
  return this.isVisible ? VisibilityState.Visible : VisibilityState.Hidden;
}

This allowed me to add modify the CSS of the component like this:
:host {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    text-align: center; // TODO: only for testing, remove later
    background-color: indigo; // TODO: only for testing, remove later
    .header {
        visibility: visible;
        opacity: 1;
        transition: visibility .2s, opacity .2s linear;
    }
    &.collapsed .header {
        visibility: hidden;
        opacity: 0;
    }
}

Now, I am not sure if the CSS will render as smoothly as the Angular animation, but it is the only solution I have found so far.

For reference, here is the entire component:
import { Component, AfterViewInit, HostBinding, HostListener, ElementRef, Renderer2 } from '@angular/core';
import { animate, state, style, transition, trigger } from '@angular/animations';
import { distinctUntilChanged, filter, map, pairwise, share, throttleTime } from 'rxjs/operators';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/fromEvent';

enum VisibilityState {
  Visible = 'visible',
  Hidden = 'hidden'
}

enum Direction {
  Up = 'Up',
  Down = 'Down'
}

@Component({
  selector: 'piiick-header',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.scss'],
  animations: [
    trigger('toggle', [
      state(
        VisibilityState.Hidden,
        style({ height: '10px' })
      ),
      state(
        VisibilityState.Visible,
        style("*")
      ),
      transition('* => *', animate('200ms ease-in'))
    ])
  ]
})
export class HeaderComponent implements AfterViewInit {
  private isVisible = true;
  private wasVisible = this.isVisible;

  constructor(private renderer: Renderer2, private element: ElementRef) { }

  @HostBinding('@toggle')
  get toggle(): VisibilityState {
    if (this.isVisible) {
      this.renderer.removeClass(this.element.nativeElement, 'collapsed');
    }
    else {
      this.renderer.addClass(this.element.nativeElement, 'collapsed');
    }
    return this.isVisible ? VisibilityState.Visible : VisibilityState.Hidden;
  }

  @HostListener('mouseenter')
  mouseEnter() {
    this.wasVisible = this.isVisible === true;
    this.isVisible = true;
  }

  @HostListener('mouseleave')
  mouseLeave() {
    this.isVisible = this.wasVisible === true;
  }

  ngAfterViewInit() {
    const scroll$ = Observable.fromEvent(window, 'scroll').pipe(
      throttleTime(10),
      map(() => window.pageYOffset),
      pairwise(),
      map(([y1, y2]): Direction => (y2 < y1 ? Direction.Up : Direction.Down)),
      distinctUntilChanged(),
      share()
    );

    const scrollUp$ = scroll$.pipe(
      filter(direction => direction === Direction.Up)
    );

    const scrollDown = scroll$.pipe(
      filter(direction => direction === Direction.Down)
    );

    scrollUp$.subscribe(() => (this.isVisible = true));
    scrollDown.subscribe(() => (this.isVisible = false));
  }
}


text:
Q: Android disable recyclerview vertical scroll up expanding the bottomsheet I have the following layout which I include in a coordinator layout and provide bottomsheet behavior to it. I set peek height of this bottomsheet as 60%. When I scroll up the recyclerview, the bottomsheet expands. I do not want the bottomsheet to expand/collapse until user drags it manually. How can I achieve this behavior. Thanks!
<?xml version="1.0" encoding="utf-8"?>
<layout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <FrameLayout
        android:id="@+id/frame_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:id="@+id/linear_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="40dp">

                <ImageView
                    android:id="@+id/image"
                    android:layout_width="match_parent"
                    android:layout_height="30dp"
                    android:focusable="true"
                    android:scaleType="center"
                    android:layout_gravity="clip_horizontal"
                    android:src="@drawable/image"
                    android:visibility="gone"/>
            </androidx.appcompat.widget.Toolbar>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/recycler_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clipToPadding="false"/>
        </LinearLayout>
    </FrameLayout>
</layout>


text:
Q: MVC Authorisation issue / repeated loggin request I have set up a authorisation schema to handle access to subdomain sites as well as to make sure only site related data is accessible by the users.
I use 'standard' codefirst  forms authorisation in which I have added property SiteId to all the methods as well as all the tables. (example is shown bellow- sorry for the length of it)
This way, users that log in in different subdomain sites can use the same user name in their subdomain.
I also use siteID in all other tables to make sure that authorised users working with ,for example, customer data are working with customer data that is related to their subdomain only.
Locally, on dev machine, it works without a problem.
However, once I placed the app to web host, I get redirected to login screen every few minutes. And once it happens on one of the sites I get redirected from all the other sites I'm logged in.
(site1.myapp.com, site2.maypp.com, ....)
All the sites point to the same application (site1.myapp.com)
So the questions are:
1) if anyone has an idea/experience in what may be the cause/solution for this and

2) perhaps suggestion on different (better) implementation method

Could there be something with caching that is causing the system to ask for login authorisation so often?
Following is the example of the current set up that I have:
public class User
{

    //Membership required
    [Key()]
    public virtual Guid UserId { get; set; }
    public int SiteID { get; set; }
    [Required()]
    [MaxLength(20)]
    public virtual string Username { get; set; }
    [Required()]
    [MaxLength(250)]
    [DataType(DataType.EmailAddress)]
    public virtual string Email { get; set; }
    ...

Membership provider is using the siteID is as well:
public class CodeFirstMembershipProvider : CodeFirstExtendedProvider
        {

            private string _ApplicationName;
            private int siteID = Convert.ToInt16(new AppSettings()["SiteID"]);
            ...
            ...

            public override string ExtendedValidateUser(string userNameOrEmail, string password)
            {
            ...
            ...
                using (DbContext context = new DbContext())
                {
                    User user = null;
                    user = context.Users.FirstOrDefault(Usr =>( Usr.Username == userNameOrEmail ) && (Usr.SiteID == siteID));
                    if (user == null)
                    {
                        user = context.Users.FirstOrDefault(Usr => (Usr.Email == userNameOrEmail ) && (Usr.SiteID == siteID));
                    }
                    ...
                    ...

In each controller I have:
[Authorize]
public class CustomerController : Controller
{
    int siteID = Convert.ToInt16(new AppSettings()["SiteID"]);
...

    public ViewResult Index()
    {
        var data = (from k in context.Customers
                    from ks in context.CustomerSites
                    where ((k.CustomerID == ks.CustomerID) && (ks.SiteID == siteID) && (ks.CompleteAccess == true))
                    select (k)).ToList();
         ...
         ...

SiteID is being cached by using AppSettings class::
/// <summary>
/// This class is used to manage the Cached AppSettings
/// from the Database
/// </summary>
public class AppSettings
{

  /// This indexer is used to retrieve AppSettings from Memory (only siteID for now)

  public string this[string Name]
  {
   get
   {
     //See if we have an AppSettings Cache Item
     if (HttpContext.Current.Cache["AppSettings"] == null)
     {
         int? SiteID = 0;
        //Look up the URL and get the Tenant/Site Info
        using (DbContext dc =
           new DbContext())
        {
           Site result =
                  dc.Sites
                  .Where(a => a.Host ==
                     HttpContext.Current.Request.Url.
                        Host.ToLower())
                  .FirstOrDefault();

           if (result != null)
           {
              SiteID = result.SiteID;               }
        }
        AppSettings.LoadAppSettings(SiteID, FirmaID);
     }

     Hashtable ht =
       (Hashtable)HttpContext.Current.Cache["AppSettings"];
     if (ht.ContainsKey(Name))
     {
        return ht[Name].ToString();
     }
     else
     {
        return string.Empty;
     }
  }

}
/// <summary>
/// This Method is used to load the app settings from the
/// database into memory
/// </summary>
public static void LoadAppSettings(int? SiteID)
{
  Hashtable ht = new Hashtable();

  //Now Load the AppSettings
  using (DbContext dc =
     new DbContext())
  {
      ht.Add("SiteID", SiteID);
  }

  //Add it into Cache (Have the Cache Expire after 3 Hour)
  HttpContext.Current.Cache.Add("AppSettings",
     ht, null,
     System.Web.Caching.Cache.NoAbsoluteExpiration,
     new TimeSpan(3, 0, 0),
     System.Web.Caching.CacheItemPriority.NotRemovable, null);
     }
  }

A: Aargh....after many things i have tried it turned out to be, as usually, very simple issue/solution:
As this app is hosted on a shared web host I needed to add machine key in the web.config.
(and this is why i couldn't reproduce this error on my development machine.)
Link to generate one is here:Machine key generator


text:
Q: How to convert '1,0' to integer As the title says, how would I go about converting '1,0' into 1,0 I've been getting  ValueError: invalid literal for int() with base 10: '1,0'

A: First of all, 1,0 is generally not valid syntax for a float. You have to use 1.0. Second you can't convert 1.0 to an int, as this is a float. Use float("1.0") instead. If you need an int you can round the parsed float, e.g.
round(float("1.0"))

A: you can use:
int(float('1,0'.replace(',', '.')))


text:
Q: doesn't have a field "clientMutationId" in Relay mutations when I am trying to update a record in Relay using Relay Mutations I getting an error like this.

doesn't have a field "clientMutationId"

But I did't declare any clientMutationId in my GraphQL schema. Here  is my code in Relay
function updateZipdata1(){
  console.log("update zip");
   return new Promise((resolve, reject) => {
    var Connection = require('tedious').Connection;
    var Request = require('tedious').Request;
    var config = {
        userName: 'xxx',
        password: 'xxxx',
        server: 'xxxx',
        options: {
            database: 'xxxx'

        }
     }
    var results = [];
    var connection = new Connection(config);
    connection.on('connect', (err)=> {
         if (err) {
            console.log(err)
            reject(err);
        }
        var ZipCode="123456";
        var RecNo="789456";

        var sql = "update dbo.xrxZip set ZipCode='"+ZipCode+"' where RecNo='"+RecNo+"'";
        var request = new Request(sql,
            (err, rowCount)=> {
                if (err) {
                    console.log('SQLError');
                    connection.close();
                    reject(err);
                }
                else {
                  console.log("sql:"+rowCount)
                    connection.close();
                    resolve(results);
              }
            });
            request.on('row', (columns)=> {
            var row = {};
            columns.forEach((column)=> {
                if (column.isNull) {
                    row[column.metadata.colName] = null;
                } else {
                    row[column.metadata.colName] = column.value;
                }
            });
            console.log("hai:"+results)
            results.push(row);

        });
          connection.execSql(request);
      })
   })
};

my GraphQL schema:
var zipType = new GraphQLObjectType({
  name: 'Zipcode',
  fields: () => ({

    ZipCode: {type: GraphQLString},
    City: {type: GraphQLString},
    ShortCode:{type: GraphQLString},
    State:{type: GraphQLString},
    Phone:{type: GraphQLString},
    TaxCode:{type: GraphQLString},
    Tax:{type: GraphQLString},
    RecNo:{type: GraphQLString}

  }),
});

var zipCodeType = new GraphQLObjectType({
  name: 'Zip',
  fields: () => ({
    zipcodes: {type: new GraphQLList(zipType)},
  }),
});

export var Schema = new GraphQLSchema({
  mutation: new GraphQLObjectType({
    name: "Mutation",
     fields: () => ({
      UpdateZipcode:{
        type: zipCodeType,
        args: {
          ZipCode: {type: GraphQLString}
        },
        resolve: (root,{ZipCode}) =>updateZipdata,

      }
    })
  })
})
 const updateZipdata = {
 zipcodes: updateZipdata1(), // Calling the function
};

When I run it in terminal for hard coded ZipCode and RecNo it is working without any error. But when I try to execute in Relay I am getting an error like as mentioned above.
Hear is my Relay code:
This is subclass in Relay for mutations.
export default class updateZipMutation extends Relay.Mutation {
  getMutation() {
    alert("getMutation");
    return Relay.QL`mutation{UpdateZipcode}` ;
  }
  getVariables() {
    alert("getVariables");
    return { RecNo: this.props.data.RecNo,ZipCode:this.props.data.ZipCode,City:this.props.data.City,Phone:this.props.data.Phone,ShortCode:this.props.data.ShortCode,Tax:this.props.data.Tax,TaxCode:this.props.data.TaxCode,State:this.props.data.State};
  }
  getFatQuery() {
    alert("getFatQuery")
    return Relay.QL`
      fragment on Zipcode {
          RecNo,
          ZipCode,
          City,
          Phone,
          ShortCode,
          Tax,
          TaxCode,
          State
      }
    `;
  }
  getConfigs() {
    alert("getConfigs");
    return [{
      type: 'zipCodeType',
      fieldIDs:{
        RecNo: this.props.data.RecNo
      },
    }];
  }
}

Here is my main class in Relay calling the subclass for mutations:
export default class zips extends React.Component {
 Relay.Store.update(
      new updateZipMutation({        //I am getting the data from form
        data: { RecNo, ZipCode,City,Phone,ShortCode,Tax,TaxCode,State},
      })
    );
  }
}

any one please give me suggestions how to resolve it, and how to work on mutations. Any help much appreciated.

A: Relay mutations must have clientMutationId field that is accepted in their input and is returned as is in the resulting payload. Relay uses them to track which mutation server have response to. In addition for Relay, mutations must accept one argument - input. It can be a InputObject type, but it must be formed like that. Here is detailed guide on Relay GraphQL Mutation inteface https://facebook.github.io/relay/docs/graphql-mutations.html#content
In your case you could do something like this:
export var Schema = new GraphQLSchema({
  mutation: new GraphQLObjectType({
    name: "Mutation",
     fields: () => ({
      UpdateZipcode:{
        type: zipCodeType,
        args: {
          input: {type: new GraphQLInputObjectType({
            name: "UpdateZipCodeInput",
            fields: {
              clientMutationId: { type: String },
              ZipCode: { type: String },
          })}
        },
        resolve: (root,{input: { clientMutationId, ZipCode}) => ({
          ...updateZipCode(ZipCode),
          clientMutationId,
        }),
      }
    })
  })
})

A: Just use Relay helper function from graphql-relay package
mutationWithClientMutationId

It will provide a Relay compatible mutation
https://github.com/graphql/graphql-relay-js#mutations


text:
Q: Validating SSIS 2012 packages programatically via SSIS Catalog Managed Object Model I'd like to validate and then execute SSIS package stored in SSIS Catalog (Project Deployment Model) via objects from Microsoft.SqlServer.Management.IntegrationServices namespace.
When I execute Validate method from PackageInfo class it only runs validation, but no wait till its end. In one example I've found author fires validation in 'fire and forget' mode - why fire it when we don't bother with result? In another one execution is fired without previous validation.

*

*Should I verify package before every execution?

*If so, how to do it in synchronous mode?

*I'm also curious with ValidationOperation Status property. It's
wrapped catalog.validations status column and can have, inter
alia, values succeeded (7) and completed (9) - what is
difference between them?

A: Ad 2: I was able to wait for validation result in a loop:

var validationId = package.Validate(false, PackageInfo.ReferenceUsage.UseAllReferences, null);
ValidationOperation validation = package.Parent.Parent.Parent.Validations[validationId];
do
{
    Thread.Sleep(1000);
    validation.Refresh();
}
while (!validation.Completed);


text:
Q: append input only to currently hoverd li I'm trying to show an input field inside the currently hovered upon ul.
This code kind of works:
$('ul').hover(function(){
  $(this).append('
<input type="text"> <button>Knapp></button>
');
},
function () {
      $(this).find("input:last").fadeOut('fast');
      $(this).find("button:last").fadeOut('fast');
    }

);

But it shows an input field for all the parents as well :/
I tried to remove the divs from the parents with find
      $(this).parents().find("input:last").fadeOut('fast');

But of course that code also finds the one that's inside the currently hovered ul...

A: you are append to the ul so it will work on all ul so try to specyfy the ul on which you want to append
and simpler approach is add a id or class to the ul
$('#one').hover(function(){
  $(this).append('
<input type="text"> <button>Knapp></button>
');
},
function () {
      $(this).find("input:last").fadeOut('fast');
      $(this).find("button:last").fadeOut('fast');
    }

);

A: This will happen because
the the childrens of ul are the part of ul so input will appended to them
you can use a condition
like hasClass or like ul>li

A: Thanks to your input I changed my approach somewhat and now it works well enough.
I added an input field at the end of ever ul.
Hide it with css
Make it so that only the currently hovered on has class active (remove class from parents & children) and only show divs that are direct children of ul with class active :)
$('ul').hover(function(){
      $(this).addClass('active');
      $(this).parents().removeClass('active');
      $(this).children().removeClass('active');
    }, function(){
      $(this).removeClass('active');
    });

HTML

<input type="text"> <button>Add main task</button>

<input type="text"> <button>Add goal</button>

The public

: :Follow our journey

<input type="text"> <button>Add main task</button>

<input type="text"> <button>Add goal</button>

CSS
 ul.active>div{
            display: block;
    }


text:
Q: Android View performClick() and callOnClick() difference What is the difference in usage between performClick() and callOnClick()? It seems that they work the same way, then why does View have two methods?

A: The Javadoc for both methods is pretty self-explanatory too:
public boolean performClick ()

Added in API level 1
Call this view's OnClickListener, if it is defined. Performs all
  normal actions associated with clicking: reporting accessibility
  event, playing a sound, etc.

public boolean callOnClick ()

Added in API level 15
Directly call any attached OnClickListener. Unlike performClick(),
  this only calls the listener, and does not do any associated clicking
  actions like reporting an accessibility event.


text:
Q: Biasing regression by repeating variables I'm building linear discrimination analyses and logistic regressions and I am trying to bias the regressions to favor specific variables. Each variable represents chemical information from a specific geneID. Since the pool of geneIDs is large I have to group the genes together based on biological activity pathways and direction of correlation. Chemical information is averaged together within one group. I was wondering if it was ok to duplicate chemical information for a geneID that is relevant to multiple biological pathways. In the same respect, if the direction of correlation is reversed is it ok to switch the sign of the chemical information to make the direction of correlation match the biological group.
Ex:
AR - reproductive organ development - spermatogenesis- positive correlation

biological groups:
reproductive organ development- positive correlation
spermatogenesis- negative correlation

Would AR chemical info have to go in the group it is most related to, or could it go in both? Biological I would want to bias the output like that to stress the importance of AR in this pathway, but is it mathematically sound?
Thanks!


text:
Q: How do I create a shortcut to a java application using Wix How do I create a shortcut that launches a java application with arguments in Wix? This is my current schema and it compiles but doesn't place the shortcut on the desktop.
<DirectoryRef Id="DesktopFolder">
    <Component Id="Shortcut" Guid="GUID-HERE">
            <Shortcut
                        Id="desktopFoobarApp"
                        Name="Foobar 1.0"
                        Directory='DesktopFolder'
                        WorkingDirectory='INSTALLDIR'
                        Target="java"
                        Arguments="-jar [INSTALLDIR]FoobarApp.jar -v -f [INSTALLDIR]conf.cfg"
                        Icon="icon.ico" />
        <RegistryValue Root="HKCU" Key="Software\Microsoft\FoobarApp" Name="installed" Type="integer" Value="0" KeyPath="yes"/>
    </Component>
</DirectoryRef>

A: I've found out that you need to add the entire path to the target. The following code works:
<DirectoryRef Id="DesktopFolder">
    <Component Id="Shortcut" Guid="GUID-HERE">
            <Shortcut
                        Id="desktopFoobarApp"
                        Name="Foobar 1.0"
                        Directory='DesktopFolder'
                        WorkingDirectory='INSTALLDIR'
                        Target="[System64Folder]javaw.exe"
                        Arguments='-jar "[INSTALLDIR]FoobarApp.jar" -v -f "[INSTALLDIR]conf.cfg"'
                        Icon="icon.ico" />
        <RegistryValue Root="HKCU" Key="Software\Microsoft\FoobarApp" Name="installed" Type="integer" Value="0" KeyPath="yes"/>
    </Component>
</DirectoryRef>

A: I think you need to put <Shortcut> tag between <File> tag
Try this:
</File Id="id" Name="file name" Source="file source path">
    <Shortcut Id="desktopFoobarApp"  Name="Foobar 1.0" Directory='DesktopFolder'
              WorkingDirectory='INSTALLDIR' Target="java"
              Arguments="-jar [INSTALLDIR]FoobarApp.jar -v -f [INSTALLDIR]conf.cfg"
              Icon="icon.ico" />
</File>


text:
Q: Showing that $\lim_{x \to 1} \left(\frac{23}{1-x^{23}}-\frac{11}{1-x^{11}} \right)=6$ How does one evaluate the following limit?
$$\lim_{x \to 1} \left(\frac{23}{1-x^{23}}-\frac{11}{1-x^{11}} \right)$$
The answer is $6$.
How does one justify this answer?
Edit: So it really was just combine the fraction and use L'hopital's rule twice (because function and its first derivative are of indeterminate form at $x=1$). This problem is more straightforward than it seems at first.

A: Both fractions are unbounded as $x\rightarrow 1$. But if we rewrite
$$\frac{23}{1-x^{23}}-\frac{11}{1-x^{11}}=\dfrac{23(1-x^{11})-11(1-x^{23})}{(1-x^{23})(1-x^{11})}=\dfrac{11x^{23}-23x^{11}+12}{1-x^{23}-x^{11}+x^{34}}$$
we can use L'Hopital since both sides tend to 0 as $x$ tends to 1. Differentiating both sides give
$$\dfrac{253x^{22}-253x^{10}}{-23x^{22}-11x^{10}+34x^{33}}=253\dfrac{x^{12}-1}{-23x^{12}-11+34x^{23}}$$
Both sides still tend to 0, so we differentiate again and get
$$253\dfrac{12x^{11}}{-276x^{11}+782x^{22}}$$
which tends to
$$253\dfrac{12}{-276+782}=6$$

A: As $t\to0$, we have
$$\frac{23}{1-(1+t)^{23}}=-\frac{23}{23t+253t^2+O(t^3)}=-\frac{1}{t}\cdot\frac{1}{1+11t+O(t^2)}=-\frac{1}{t}\left(1-11t+O(t^2)\right)$$
Likewise
$$\frac{11}{1-(1+t)^{11}}=-\frac{11}{11t+55t^2+O(t^3)}=-\frac{1}{t}\cdot\frac{1}{1+5t+O(t^2)}=-\frac{1}{t}\left(1-5t+O(t^2)\right)$$
So the difference is
$$-\frac{1}{t}\left(1-11t-1+5t+O(t^2)\right)=6+O(t)$$
And your limit is $6$.

A: This answer does not use L'Hopital (personal taste), only a standard identity restated below, the binomial theorem, and a straightforward Taylor expansion to first order at $0$.
Using the identity $1-x^{2n+1} = (1-x)\sum_{k=0}^{2n} x^k$, we can rewrite
$$\begin{align*}
\frac{23}{1-x^{23}} -  \frac{11}{1-x^{11}}
&= \frac{1}{1-x}\left(\frac{23}{\sum_{k=0}^{22}x^k} -  \frac{11}{\sum_{k=0}^{10}x^k} \right)\\
&= \frac{1}{1-x}\left(\frac{23\sum_{k=0}^{10}x^k}{\sum_{k=0}^{22}x^k\sum_{k=0}^{10}x^k} -  \frac{11\sum_{k=0}^{22}x^k}{\sum_{k=0}^{10}x^k\sum_{k=0}^{22}x^k} \right)\\
&= \frac{1}{\sum_{k=0}^{10}x^k\sum_{k=0}^{22}x^k}\cdot\frac{1}{1-x}\left(23\sum_{k=0}^{10}x^k - 11\sum_{k=0}^{22}x^k \right)\\
\end{align*}$$
Let us focus on the parenthesis (the first factor converges to $\frac{1}{11\cdot 23}$ by continuity, the second is the problematic one that will be "offset" by the parenthesis).
Writing $x=1+h)$ (where we will have $h\to 0$), we get, for any fixed integer $n$,
$$\begin{align*}
\sum_{k=0}^{n}x^k
&= \sum_{k=1}^{n}(1+h)^k
= \sum_{k=1}^{n} \sum_{\ell=0}^k \binom{k}{\ell} h^\ell \\
&= \sum_{k=0}^{n}(1+kh +o(h)) \\
&= (n+1)+\frac{n(n+1)}{2}h +o(h)
\end{align*}$$
when $h\to 0$, as $n$ is a constant. In particular, this implies
$$\begin{align*}
23\sum_{k=0}^{10}x^k - 11\sum_{k=0}^{22}x^k
&= 23\cdot 11+23\cdot \frac{11\cdot10}{2}h - 11\cdot 23-11\cdot \frac{22\cdot 23}{2}h + o(h)\\
&= 23\cdot 11\cdot (-6h) + o(h)\\
&= 23\cdot 11\cdot 6(1-x) + o(1-x)
\end{align*}$$
Overall, we thus have
$$\begin{align*}
\frac{23}{1-x^{23}} -  \frac{11}{1-x^{11}}
&= \frac{23\cdot 11}{\sum_{k=0}^{10}x^k\sum_{k=0}^{22}x^k}\cdot\frac{6(1-x)+o(1-x)}{1-x} \\
&= \frac{23\cdot 11}{\sum_{k=0}^{10}x^k\sum_{k=0}^{22}x^k}\cdot (6+o(1)) \xrightarrow[x\to1]{} \frac{23\cdot 11}{23\cdot 11} \cdot 6 = 6
\end{align*}$$
as claimed.

A: That is the same as
$$ \lim_{x\to 0}\left[\frac{23}{1-(1-x)^{23}}-\frac{11}{1-(1-x)^{11}}\right]=\lim_{x\to 0}\left[\frac{23}{23x-253x^2}-\frac{11}{11-55x^2}\right]$$
(we exploited the binomial theorem and neglected terms with high order, since we can, see the comments below) or as
$$ \lim_{x\to 0}\frac{1}{x}\left[\frac{1}{1-11x}-\frac{1}{1-5x}\right]=\lim_{x\to 0}\left[\frac{-5+11}{(1-11x)(1-5x)}\right]=11-5=\color{red}{6}.$$
With the same approach, for any $n,m\in\mathbb{N}^+$,
$$ \lim_{x\to 1}\left[\frac{m}{1-x^m}-\frac{n}{1-x^n}\right]= \color{red}{\frac{m-n}{2}}.$$
In other terms, the function $f_n(x)=\frac{n}{1-x^n}$ has a simple pole at $x=1$. If we remove the contribute given by such simple pole, we are left with a holomorphic function in a neighbourhood of $x=1$. In particular, $$\lim_{x\to 1}\left[\frac{n}{1-x^n}+\frac{1}{1-x}\right]=\frac{n-1}{2}.$$

A: $\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}\require{cancel}
&\color{#f00}{\lim_{x \to 1}\pars{{23 \over 1 - x^{23}} - {11 \over 1 - x^{11}}}} =
\lim_{x \to 1}\bracks{{1 \over 1-x}
\pars{{23 \over \sum_{k = 0}^{22}x^{k}} - {11 \over \sum_{k = 0}^{10}x^{k}}}}
\\[5mm] = &\
\lim_{x \to 1}
\bracks{23\,{\sum_{k = 1}^{22}k\,x^{k - 1} \over
\pars{\sum_{k = 0}^{22}x^{k}}^{2}} -
11\,{\sum_{k = 1}^{10}k\,x^{k - 1} \over \pars{\sum_{k = 0}^{10}x^{k}}^{2}}}
\qquad\pars{~By\ L'H\hat{o}pital\ Rule}
\\[5mm] = &\
23\,{\sum_{k = 1}^{22}k \over \pars{\sum_{k = 0}^{22}1}^{2}} -
11\,{\sum_{k = 1}^{10}k \over \pars{\sum_{k = 0}^{10}1}^{2}}
\\[5mm] = &\
\underbrace{\cancel{23}\,{22\cancel{\pars{22 + 1}}/2 \over \cancel{23^{2}}}}_{\ds{=\ 11}}\ -\
\underbrace{\cancel{11}\,{10\cancel{\pars{10 + 1}}/2 \over \cancel{11^{2}}}}_{\ds{=\ 5}}\ = \ 11 - 5 = \color{#f00}{6}
\end{align}

A: This is definitely the best method to solve this question:
$$Let\space L = \lim_{x \to 1} \left(\frac{p}{1-x^{p}}-\frac{q}{1-x^{q}} \right)$$$\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ $\space$ Replace $x$ by $\frac{1}{x}$
$$\space L = \lim_{{x} \to 1} \left(\frac{p}{1-{\frac{1}{x}}^{p}}-\frac{q}{1-{\frac{1}{x}}^{q}} \right)$$
$$\space L = \lim_{{x} \to 1} \left(\frac{-px^p}{1-{{x}}^{p}}-\frac{-qx^q}{1-{{x}}^{q}} \right)$$
Adding both the equations we get $2L={p-q}$
And we are done

A: $$ =\lim_{x \to 1} \frac{23 - 23x^{11} -11 + 11x^{23}}{1 - x^{11} - x^{23} + x^{34}} = \lim_{x \to 1} \frac{-23\cdot 11 x^{10} + 11\cdot 23 x^{22}}{-11x^{10} - 23x^{22} + 34x^{33}} =$$$$= \lim_{x \to 1} \frac{-23\cdot 11 \cdot 10 x^9 + 11\cdot 23 \cdot 22x^{21}}{-11\cdot 10 \cdot x^9 - 23\cdot 22x^{21} + 34\cdot 33 x^{32}} = \frac {3036}{506} = 6 $$
where we used Hopital twice

A: $\lim_\limits{x\to1}\frac {23(1-x^{11})-11(1-x^{23})}{(1-x^{11})(1-x^{23})}$
$\lim_\limits{x\to1}\frac {12-23x^{11}+ 11x^{23}}{(1-x^{11})(1-x^{23})}$
Now we could apply L'Hopitals at this point, or we can use algebra.
Using algebra, numerator and denominator both divide by $(x-1)^2$
$1-x^{11} = (1-x)\sum_\limits{i=0}^{10} x^i\\
1-x^{23} = (1-x)\sum_\limits{i=0}^{22} x^i$
$11x^{23} -23x^{11}+ 12 = (x-1)(11 x^{22}\cdots 11x^{11} - 12x^{10}\cdots +12)\\ =(x-1)^2 (11x^{21} + 2\cdot11 x^{20} + 3\cdot11 x^{19}\cdots +12\cdot 11 x^{10} + 12\cdot 10 x^9\cdots +12\cdot 2x + 12 $
Evaluated at 1.
The denominator:
$\sum_\limits{i=0}^{10} x^i = 11, \sum_\limits{i=0}^{22} x^i = 23$
the numerator:
$11 \sum_\limits{i=1}^{11} i + 12 \sum_\limits{i=1}^{11} i = (23)(11)(12)/2$
and the ratio  $= 6$

A: The following standard formula is well known $$\lim_{x \to 1}\frac{x^{n} - 1}{x - 1} = n = \lim_{t \to 0}\frac{(1 + t)^{n} - 1}{t}\tag{1}$$ and it appears that we can go very easily to the next step if $n$ is a positive integer and derive the formula $$\lim_{x \to 1}\frac{x^{n} - 1 - n(x - 1)}{(x - 1)^{2}} = \lim_{t \to 0}\frac{(1 + t)^{n} - 1 - nt}{t^{2}} = \frac{n(n - 1)}{2}\tag{2}$$ The simplest approach to prove $(2)$ is to use Binomial theorem. Hence we have $$x^{n} - 1 = n(x - 1) + \frac{n(n - 1)}{2}(x - 1)^{2} + o((x - 1)^{2})$$ and therefore
\begin{align}
\frac{n}{1 - x^{n}} &= \dfrac{n}{n(1 - x) - \dfrac{n(n - 1)}{2}(x - 1)^{2} + o((x - 1)^{2})}\notag\\
&= \frac{1}{1 - x}\left(1 - \frac{n - 1}{2}(1 - x) + o((1 - x))\right)^{-1}\notag\\
&= \frac{1}{1 - x}\left(1 + \frac{n - 1}{2}(1 - x) + o(1 - x)\right)\notag\\
&= \frac{1}{1 - x} + \frac{n - 1}{2} + o(1)\tag{3}
\end{align}
It follows that $$\frac{n}{1 - x^{n}} - \frac{m}{1 - x^{m}} = \frac{n - m}{2} + o(1)$$ and hence $$\lim_{x \to 1}\left(\frac{n}{1 - x^{n}} - \frac{m}{1 - x^{m}}\right) = \frac{n - m}{2}$$ and putting $n = 23, m = 11$ we get the desired limit as $6$.

The gymnastics of series division to reach $(3)$ can be avoided in another manner by using $(2)$ directly. We have
\begin{align}
L &= \lim_{x \to 1}\frac{n}{1 - x^{n}} - \frac{m}{1 - x^{m}}\notag\\
&= \lim_{x \to 1}\frac{n(1 - x^{m}) - m(1 - x^{n})}{(1 - x^{n})(1 - x^{m})}\notag\\
&= \lim_{x \to 1}\frac{n(1 - x^{m}) - mn(1 - x) + mn(1 - x) - m(1 - x^{n})}{(1 - x^{n})(1 - x^{m})}\notag\\
&= \lim_{x \to 1}\dfrac{n(1 - x^{m}) - mn(1 - x) + mn(1 - x) - m(1 - x^{n})}{\dfrac{(1 - x^{n})(1 - x^{m})}{(1 - x)^{2}}\cdot(1 - x)^{2}}\notag\\
&= \frac{1}{mn}\lim_{x \to 1}n\frac{1 - x^{m} - m(1 - x)}{(1 - x)^{2}} - m\frac{1 - x^{n} - n(1 - x)}{(1 - x)^{2}}\notag\\
&= \frac{1}{mn}\left(\frac{nm(1 - m)}{2} - \frac{mn(1 - n)}{2}\right)\text{ (using (2))}\notag\\
&= \frac{n - m}{2}\notag
\end{align}

A: Write $P_n(x)=1+x+x^2+\dots+x^n$; then our function is
$$
\frac{23P_{10}(x)-11P_{22}(x)}{(1-x)P_{22}(x)P_{10}(x)}
$$
We can notice that
$$
\lim_{x\to1}P_{22}(x)P_{10}(x)=23\cdot11
$$
so we just need to compute
$$
\lim_{x\to1}\frac{11P_{22}(x)-23P_{10}(x)}{x-1}=
11P_{22}'(1)-23P_{10}'(1)
$$
by definition of derivative. Since
$$
P_n'(x)=1+2x+3x^2+\dots+nx^{n-1}
$$
we have
$$
P_n'(1)=\frac{n(n+1)}{2}
$$
Thus, reinserting $23\cdot11$ at the denominator, our limit is
$$
\frac{11\cdot22\cdot23-23\cdot10\cdot11}{2\cdot23\cdot11}=
\frac{22-10}{2}=6
$$
More generally,
\begin{align}
\lim_{x\to1}\left(\frac{m}{1-x^m}-\frac{n}{1-x^n}\right)
&=
\lim_{x\to1}\frac{mP_{n-1}(x)-nP_{m-1}(x)}{(1-x)P_{m-1}(x)P_{n-1}(x)}
\\[6px]
&=
\frac{nP_{m-1}'(1)-mP_{n-1}'(1)}{mn}
\\[6px]
&=
\frac{n(m-1)m-m(n-1)n}{2mn}
\\[6px]
&=
\frac{m-n}{2}
\end{align}

A: Dumping my answer here to a different but similar question which was labeled as a duplicate and would no longer accept the answer that I had already typed.
$\lim\limits_{t\to1}\frac{5}{1-t^5}-\frac{2}{1-t^2}=$
$\lim\limits_{t\to1}\frac{5}{(1-t)(1+t+t^2+t^3+t^4)}-\frac{2}{(1-t)(1+t)}=$
$\lim\limits_{t\to1}\frac{5+5t-2-2t-2t^2-2t^3-2t^4}{(1-t)(1+t+t^2+t^3+t^4)(1+t)}$
Clearly the numerator evaluates to $0$ when $t=1$ so $t-1$ must be a factor.
$\lim\limits_{t\to1}\frac{5+5t-2-2t-2t^2-2t^3-2t^4}{(1-t)(1+t+t^2+t^3+t^4)(1+t)}=$
$\lim\limits_{t\to1}\frac{2t^4+2t^3+2t^2-3t-3}{(t-1)(1+t+t^2+t^3+t^4)(1+t)}=$
$\lim\limits_{t\to1}\frac{2t^3+4t^2+6t+3}{(1+t+t^2+t^3+t^4)(1+t)}=$
$\frac{2+4+6+3}{(1+1+1+1+1)(1+1)}=\frac{15}{(5)(2)}=\frac32$
(Long division was used to obtain $\frac{2t^4+2t^3+2t^2-3t-3}{t-1}=2t^3+4t^2+6t+3$ )


text:
Q: Is there a way to diagnose why git init --bare doesn't create specific directories? I'm attempting to run Gitolite on my LEDE-Project router.  I've followed the instructions provided here to satisfactorily install the necessary dependencies onto my router.  My router reports Git version
2.11.0, as does the computer I'm running this on.  The package for Git on LEDE-Project and OpenWRT can be found here, as they're sharing those repos.
When I create a new repository in the Gitolite way, I get an error message similar to this:

2017-03-06.03:11:23  28046   die could not symlink /root/.gitolite/hooks/common/update to gitolite-admin.git/hooks<> at
   /root/gitolite/src/lib/Gitolite/Conf/Store.pm line 368.<>

After a good nights' sleep, I eventually worked the cause of this down to this specific mailing list post, which suggested that git init --bare was not producing the right directories.

Try "git init --bare" in an empty directory and tell me if you see a
  .git/hooks directory in it.
Assuming you don't, you'll have to fix that somehow.  Gitolite expects a
  'git init --bare' to create a hooks directory.

Seems like a reasonable assumption.  My machine does this just fine.
git init --bare foo
Initialized empty Git repository in /home/makoto/workspace/foo/foo/
cd ~/foo
ls -la
drwxrwxr-x 7 makoto makoto 4096 Mar  6 13:15 .
drwxrwxr-x 3 makoto makoto 4096 Mar  6 13:15 ..
drwxrwxr-x 2 makoto makoto 4096 Mar  6 13:15 branches
-rw-rw-r-- 1 makoto makoto   66 Mar  6 13:15 config
-rw-rw-r-- 1 makoto makoto   73 Mar  6 13:15 description
-rw-rw-r-- 1 makoto makoto   23 Mar  6 13:15 HEAD
drwxrwxr-x 2 makoto makoto 4096 Mar  6 13:15 hooks
drwxrwxr-x 2 makoto makoto 4096 Mar  6 13:15 info
drwxrwxr-x 4 makoto makoto 4096 Mar  6 13:15 objects
drwxrwxr-x 4 makoto makoto 4096 Mar  6 13:15 refs

On my router...not so much.
git init --bare foo
Initialized empty Git repository in /root/foo/
cd foo/
ls -la
drwxr-xr-x    4 root     root          4096 Mar  6 13:21 .
drwxr-xr-x    1 root     root          4096 Mar  6 13:21 ..
-rw-r--r--    1 root     root            23 Mar  6 13:21 HEAD
-rw-r--r--    1 root     root            66 Mar  6 13:21 config
drwxr-xr-x    4 root     root          4096 Mar  6 13:21 objects
drwxr-xr-x    4 root     root          4096 Mar  6 13:21 refs

The issue as far as Gitolite is concerned is that specifically the hooks/ folder doesn't exist.  I can't figure out why this is, though.
Is there a way for me to diagnose what folders are created when git init --bare is run?  I get the feeling that I can figure the rest out if I can figure out what's actually being executed when the command is run.

A: It is as if, on your server, the template used for creating a new repo has an incomplete content (ie one without hooks)
That template folder would be in <git>/share/git-core/templates, with <git> being the installation folder (on Windows ./mingw64/share/git-core/templates, on Linux, /usr/share/git-core/templates)
The lack of hooks can be intentional on a server which does not want any hook executed on it for security reason. (For instance, you cannot add hooks to a GitHub bare repo)


text:
Q: could one ruby on rails application use two sqlite3 database? in my config/database.yml file
# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: sqlite3
  database: db/test.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000

otherdb:
  adapter: sqlite3
  database: /c/Users/dsun/Documents/apeers/db/development.sqlite3
  pool: 5
  timeout: 10000

and in my model, I call the new database via:establish_connection :otherdb
but this returns an error,database configuration does not specify adapter
so is it the problem that sqlite3 can not use 2 db in one time?
if so, how can I fix this.

A: Yes, of course, but in each model you should define wich database to use.
You can use method establish_connection to define which database should use current model.
More here http://api.rubyonrails.org/classes/ActiveRecord/Base.html. But I can recommend to create several base active record classes to define the database name in each, and then just inherit your model classes from them.


text:
Q: Wireshark only catches all kinds of packets but I only see ARP, 0x0800, 0x8912, etc. Why do I not see TCP or UDP packets?
As you can see, Wireshark is definitely capturing a lot of TCP packets. But it is displaying only ARP, 0x0800, 0x8912, etc. If I put TCP as a filter I get blank. Why can't I see TCP packets?

A: So I just found the solution on another site. Problem was that Wireshark was set to not recognize ipv4 and ipv6. But you can fix that by going to Analyze->Enabled Protocols and make sure that ipv4 and ipv6 are selected.


text:
Q: Counting and Grouping Strings in Drools Expert 6.5, with accumulate or collect keyword How to compute the percentage of Vs in a list with drools rules. In case of percentage  of V are 80%, then fire a drools rule.
I have a ArrayList that will have only two values: V and N.
List<String> list = new ArrayList<>();

How  to count the number of  V with drools rules, every V and N will worth 1, get total sum sum of V and N.
In java
  Map<String, Long> counted = list.stream()
             .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
    System.out.println("Counted: "+counted);

The expression above prints

Counted: {V=4, N=15}

After get the the values, there will be an drols rule expression, which in case of 80 % occurrence the count V appearance prints "ok" otherwise prints not allowed.

A: Here is a rule that computes the percentage of Vs in the list:
rule "countVN"
when
  $vn: ArrayList( $s: size )
  accumulate( String( toString == "V" ) from $vn;
              $cnt: count( 1 );
              $cnt.doubleValue()/$s >= 0.8 )
then
  System.out.println( "80% or more" );
end

This fires just for the >= 80% case. If you need a result in any case, use
  ...
  accumulate( String( toString == "V" ) from $vn;
              $cnt: count( 1 ))
then
  if( $cnt.doubleValue()/$s >= 0.8 ) ...


text:
Q: Values list vs Iterating I have to extract value of id field from each model instance in queryset. What is more efficient - iterating through queryset with use of list comprehension or values list method with flat argument setted to true and then converted to list?

A: values_list will be more performant as it will only fetch the requested fields from the database and it will not instantiate model instances.
Quoting the Django documentation:

It is useful when you know you're only going to need values from a small number of the available fields and you won't need the functionality of a model instance object. It's more efficient to select only the fields you need to use.


text:
Q: Angular 6 Karma Test Subclass with @Input decorator There seems to be no answer to the related questions, so I'm asking this one for my specific case.
I'm looking to unit test an Angular 6 component that is a subclass of a base component.  That base component has an @Input decorator.  Abstract base class like this:
import { Component, Input } from '@angular/core';
import { dateToUsFormat } from '../../helpers/date-helpers';

@Component({
    selector: 'abstract-widget',
    templateUrl: './abstract-widget.component.html',
    styleUrls: ['./abstract-widget.component.scss']
})

export class AbstractWidgetComponent {
    @Input() widgetData;
    constructor() {
    }
}

The implementation class like this:
import { Component, OnInit } from '@angular/core';
import { AbstractWidgetComponent } from '../abstract-widget/abstract-widget.component';

@Component({
  selector: 'widget-title',
  templateUrl: './widget-title.component.html',
  styleUrls: ['./widget-title.component.scss']
})

export class WidgetTitleComponent extends AbstractWidgetComponent implements OnInit {

  ngOnInit() {
  }
  get titleReturn () {
    return widget_data.visual.title;
  }
}

So, it seems pretty simple.  Unfortunately, writing unit tests for this little chunk of code seems to be impossible.  What I want to do is instantiate the widget_title component with a AbstractWidgetComponent having a specific widgetData.
My code so far looks like:
describe('WidgetTitleComponent', () => {
    let component: WidgetTitleComponent;
    let fixture: ComponentFixture<WidgetTitleComponent>;

    beforeEach(async(() => {
        TestBed.configureTestingModule({
            imports: [ MatCardModule, AbstractWidgetComponent ],
            declarations: [ WidgetTitleComponent ],
            schemas: [ NO_ERRORS_SCHEMA  ]
        })
            .compileComponents();
    }));

    beforeEach(() => {
        fixture = TestBed.createComponent(WidgetTitleComponent);
        component = fixture.componentInstance;
        component.widgetData = {visual: {title: 'This is a Sample Title'}};
        fixture.detectChanges();
    });

    it('should create', () => {
        expect(component).toBeTruthy();
        expect(component.titleReturn()).toBe('This is a Sample Title');
    });
});

This code provides me with the error, "cannot find name 'widget_data'."  To which I say, "Sure enough.....  But where do I put that?"  I've tried several variations but I'm a little confused.
I'm not an expert in either Angular or injection, but I've looked through several resources including: This GitHub Link, with its associated blog post and this Microsoft post.  I was (possibly mistakenly) hoping for a fairly simple way to instantiate the base class and inject it to be automatically run through Jasmine. Both these links involve building an entirely new class.
Is there a way to make this simple, or am I going to need to build a test injection class to go with the base class?
Note upon resolution:
I added the no_errors_schema as expected and just set the component property to have the value I wanted during the beforeEach.

A: You should have the AbstractWidgetComponent in the declarations array. Import is for all the modules, declared with @ngModule.
You could also choose to ignore them using NO_ERRORS_SCHEMA : details in this post

A: As I see it the problem is not related to jasmine or the fact that you're extending another component (a normal serve of the code above, should give you the same error as well).
'widget_data' doesn't exists, and I guess that you wanna access some property of the extended 'widgetData' (@Input)?
If that is the case you should access it by using 'this.widgetData' instead. This should solve your error and after that you should be able to test your component as "normal" components using @Input. (and as already mentioned keep your components to declarations instead of imports).
https://angular.io/guide/testing#component-with-inputs-and-outputs
If not and you wanna access 'widget_data.visual.title' you need to declare it.


text:
Q: VS2005 - Automatically requesting checkout of form on open, with "View Designer" I'm trying to integrate our Source Control(SourceAnywhere) with VS and are getting a lot of push back because of this one issue.
Almost every time we open some of our Windows forms using 'View Designer' it edits the file (* appears beside file name).  Nothing has yet been changed, I've tried comparing the before and after files and they are exactly the same.  If we have the solution bound it will check the file out, but even if its not bound it still 'edits' the file.  When you try to check the file back in, it doesn't get a new version or anything.
I've done some searching and haven't been able to find any way to change this behavior.
This is a huge pain point for me as if someone already has the form checked out and someone else tries to open it, they just get told that it can't be checked out, and the form won't open.  Or, someone who has no intention to edit the form, will now have the form checked out but hasn't made any changes.
Thoughts?

A: This usually happens when there are controls within the form that have "Dock" set. If the IDE feels it needs to resize the form, then those controls will also be resized, and all of that information needs to get re-written to the source file. In the case where you're editing a form named "Form1" this source file is not Form1.cs, but rather Form1.Designer.cs - try comparing that file with the version from source control.
Alternatively, move to a source control system that doesn't use locking by default (for example, Subversion) or disable that feature in SourceAnywhere. This will require users to manage merge conflicts, but allows multiple users to work on a single file at the same time.


text:
Q: Maven: How to read system properties from a file and pass those properties into a Cargo container? I would like a robust way of reading all system properties from an env.properties file and pass those properties' names and values into the Cargo container instead of hard coding the values as in the followings.
<groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <configuration>
            <container>
                <containerId>${cargo.container}</containerId>
                <type>installed</type>
                <home>${cargo.container.home}</home>
                <systemProperties>
                    <somedb.name>sdm-db</somedb.name>
                    <somedb.user>Administrator</somedb.user>
                    <somedb.password>password</somedb.password>
                </systemProperties>
            </container>

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>properties-maven-plugin</artifactId>
    <version>1.0-alpha-2</version>
    <executions>
    <execution>
    <id>read-env.properties</id>
    <phase>initialize</phase>
    <goals>
        <goal>read-project-properties</goal>
    </goals>
    <configuration>
        <files>
        <file>env.properties</file>
        </files>
    </configuration>
    </execution>
    </executions>
    </plugin>

I wonder if properties-maven-plugin is a way to go? After reading properties from a file, how do I pass them into Cargo container?
I got an error saying: Could not load properties from URL [file://${env.properties}]: ${env.properties}
Any advice is greatly appreciated.


text:
Q: Component mounted twice I have a simple component which is rendered by a click function, but it gets rendered twice, this is my code.
<SeeCompany
    :is="create"
    v-bind:companyId="companySelected"
    @closeChild="closeModule"
  />

when i clicked in the button i change the create value to 'SeeCompany' so it gets mounted, but it repeats the same component text twice on the screen.
<b-button block
    @click="create = 'SeeCompany'"
    class="m-sides"
    variant="outline-primary">
        Ver
</b-button>

here is the image:

EDIT: Here is the code in the mounted
export default class SeeCompany extends Vue {

    @Prop({ default: 0 }) private companyId !: number;

    constructor() {
        super();
    }

    private mounted() {
      console.log(this.companyId); --> This is consoling two ceros (0) and the passed value for instance = 1;
    }
}

A: There are two main uses for is.

*

*Working around limitations in in-DOM templates.

*Dynamic components.

For more information see https://v2.vuejs.org/v2/api/#is.
We can ignore the former case as it isn't relevant here.
Typically the second case looks a bit like this:
<component :is="childName" />

Here childName is a property of the component and determines the name of the child component to use. In your example you called it create.
The actual tag name used in the template doesn't really matter. It is common to use the dummy tag <component> for this purpose to avoid misleading future maintainers who may not immediately notice the :is. Whenever you see <component> you know you're in a dynamic component scenario.
When we talk about dynamic components it is important to appreciate exactly what we mean by 'dynamic' in this context. We are specifically talking about which component to use. We are not talking about determining whether or not to create the component in the first place.
In the code in the question the value of create is initially set to an empty string, ''. This is then passed to :is. If you inspect the DOM you'll find that this creates a comment node. While this does make some sense I am unclear if this is officially supported. I've not seen this behaviour documented anywhere and I suspect you may be getting lucky by falling down an internal code path that's intended for other things. It is not something I would be confident relying on in future versions of Vue.
The specific code of interest is:
<SeeCompany
  v-bind:is="create"
  v-bind:companyId="1"
/>
<SeeOther
  v-bind:is="create"
  v-bind:companyId="1"
/>

So if you inspect the DOM when create is '' you should find two comment nodes.
When create gets set to SeeCompany this is equivalent to:
<SeeCompany
  is="SeeCompany"
  v-bind:companyId="1"
/>
<SeeOther
  is="SeeCompany"
  v-bind:companyId="1"
/>

In turn this is equivalent to:
<SeeCompany
  v-bind:companyId="1"
/>
<SeeCompany
  v-bind:companyId="1"
/>

The result is the creation of two SeeCompany components. The original SeeOther tag is irrelevant here. This is why, as noted earlier, the convention exists to use a <component> tag to avoid being misleading.
Of course this isn't what you actually wanted the code to do. I'm unclear what the target behaviour is so I'm going to cover a few variations.
If you just want to show the components conditionally you'd use v-if instead:
<SeeCompany
  v-if="create"
  v-bind:companyId="1"
/>
<SeeOther
  v-if="create"
  v-bind:companyId="1"
/>

Usually you'd want create to be a proper boolean, false or true. So set the initial value to false with @click="create = true".
Of course this would show both SeeCompany and SeeOther at the same time. That may not be what you want either. Perhaps you only want to show one at once. For that you might do something like this:
<SeeCompany
  v-if="create === 'SeeCompany'"
  v-bind:companyId="1"
/>
<SeeOther
  v-if="create === 'SeeOther'"
  v-bind:companyId="1"
/>

Here the initial value of create should be a falsey value of some kind, possibly '', with @click="create = 'SeeCompany'" and @click="create = 'SeeOther'" on appropriate buttons.
If the props for the components are all the same, and especially if there are more than two components involved, you could try to simplify this using is:
<component
  :is="create"
  v-if="create"
  v-bind:companyId="1"
/>

This is shorter but arguably not as clear.


text:
Q: An algebraic strengthening of the Saturation Conjecture The Saturation Conjecture (proved by Knutson-Tao) asserts that
$c_{n\mu,n\nu}^{n\lambda}\neq 0\Rightarrow c_{\mu,\nu}^{\lambda} \neq
0$, where $c$ denotes a Littlewood-Richardson coefficient and $n$ is a
positive integer. Let $\mathfrak{o}$ be a (commutative) discrete valuation
ring
with a finite residue field $k=\mathfrak{o}/\mathfrak{p}$. Let $M$ be
a finite $\mathfrak{o}$-module. (For instance, we can take
$\mathfrak{o}$ to be the $p$-adic integers $\mathbb{Z}_p$, in which
case $M$ is a finite abelian $p$-group.) Thus there is a unique partition
$\lambda=(\lambda_1,\lambda_2,\dots,\lambda_r)$ such that
  $$ M \cong \bigoplus_{i=1}^r
  (\mathfrak{o}/\mathfrak{p}^{\lambda_i}).  $$
We call $\lambda$ the type of $M$. A fundamental result of Philip
Hall is that if $M$ has type $\lambda$, then there exists a submodule
$N$ of type $\mu$ and cotype $\nu$ (i.e., $M/N$ has type $\nu$) if and
only if $c^{\lambda}_{\mu\nu}\neq 0$. See Macdonald, Symmetric
Functions and Hall Polynomials, Chapter II, (4.3).
Now suppose that $M$ has type $n\lambda$, and $N$ has type $n\mu$ and
cotype $n\nu$.  Is there is a submodule $L$ of $M$ of type
$\lambda$, such that $L\cap N$ has type $\mu$ and cotype (with respect
to $L$) $\nu$?


text:
Q: What is this weird character? some time ago i found this weird character that i can t put it here because it doesn't work but i have images of it. It looks like a space character in the begin but it isn't.
When i google it i get this here and some random character in the search bar. Also i can't find it in the Unicode/ASCII library of characters
Does anyone what this character is and it's purpose?

A: Based on your Google search string, you have a long series of the character U+3164, the "Hangul Filler." Hangul is the Korean alphabet.


text:
Q: Как удалить слово из файла Программа находит длинное слово в файле, подскажите как его можно удалить?
import java.util.Scanner;
import java.io.File;
import java.io.FileNotFoundException;

public class WordFinder {
     public static void main(String [ ] args) throws FileNotFoundException {
    new WordFinder().getLongestWord();
 }

public String getLongestWord() throws FileNotFoundException {

    String longestWord = "";
    String current;
    Scanner scan = new Scanner(new File("file.txt"));

    while (scan.hasNext()) {
        current = scan.next();
        if (current.length() > longestWord.length()) {
            longestWord = current;
        }

    }
    System.out.println(longestWord);
            return longestWord;
        }
}

A: Вот мой вариант решения. Для простоты понимания я разбил единый свой код на методы.
В методе findLongestString - мы берем имя файла, сканируем его и с помощью сравнения длины строк (if (longest.length() < currentWord.length())) находим самое длинное слово. Если таких длинных слов 2 или более - программа возвращает значение только первого большого слова, попавшегося на пути. После возврата значения return longest мы присваиваем полученное слово переменной longest в main-методе, чтобы в дальнейшем использовать его в другом методе (мог сделать через глобальную переменную вместо локальной сделать, но так не интересно было бы:) )
В методе deleteWord я беру полученное длинное слово и имя файла. Далее я создаю считывание файла и запись файла (потому что в Java я, лично, не знаю другого способа замены/удаления строк). Зачем мне нужны эти две вещи? Я считываю файл, в котором есть длинное слово и если строка не является тем словом, я записываю данные во временный файл temp.txt, если является - я пропускаю запись данной строки в файл с помощью continue. В итоге, после прочтения файла я получил 2 файла - temp.txt и test2.txt (как у меня в примере). Файл temp,txt - новый полученный файл после удаления строки, а test2.txt - старый. Что нужно дальше сделать?) Правильно, заменить один файл другим. Делаем это через tempFile.renameTo(inputFile);.
В методе printFile я просто вывожу на экран файл. Т.к. я записал эту функцию в конце - программа выведет файл test2.txt с удаленным длинным словом.
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class WordFinder {

    public static void main(String[] args) {
        String filename = "test2.txt";
        WordFinder wordFinder = new WordFinder();
        String longest = wordFinder.findLongestString(filename);
        wordFinder.deleteWord(longest, filename);
        wordFinder.printFile(filename);

    }

    public String findLongestString(String filename) {
        String longest = "";
        try {
            Scanner scanner = new Scanner(new File(filename));
            while(scanner.hasNextLine()) {
                String currentWord = scanner.nextLine();
                if (longest.length() < currentWord.length()) {
                    longest = currentWord;
                }
            }
            scanner.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return longest;
    }

    public void deleteWord(String longestWord, String filename) {
        try {
            File inputFile = new File(filename);
            File tempFile = new File("temp.txt");

            BufferedReader reader = new BufferedReader(new FileReader(inputFile));
            BufferedWriter writer = new BufferedWriter(new FileWriter(tempFile));

            String currentLine;
            while((currentLine = reader.readLine()) != null) {
                if(currentLine.equals(longestWord))
                        continue;
                writer.write(currentLine+"\n");
            }
            writer.close();
            reader.close();
            tempFile.renameTo(inputFile);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void printFile(String filename) {
        try {
            Scanner scanner = new Scanner(new File(filename));
            while(scanner.hasNextLine()) {
                System.out.println(scanner.nextLine());
            }
            scanner.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}