text:
Q: How to determine root cause for Communication link failure TCP Provider: The specified network name is no longer available? Here is my latest effort at revising this question. But this time, I am trying to follow the good counsel given by Oded in his article Getting good answers on StackOverflow.
I need to find out how I can determine the root cause for the following error:

Communication link failure
TCP Provider: The specified network name is no longer available

From time to time, I am seeing this error when running a set of SSIS packages. This error can occur when one to many packages are run from:

*

*A SQL Server Agent Job

*A batch file

*In debug mode from BIDS

The full error message I see is as follows:

SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
      An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Communication link failure".
      An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "TCP Provider: The specified network name is no longer available.
      ".
SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
      An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005  Description: "Protocol error in TDS stream".
      An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005  Description: "Communication link failure".
      An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005  Description: "TCP Provider: An existing connection was forcibly closed by the remote host."

This is an overview of how I have designed the ETL process:

*

*Two servers

*Both are virtual machines

*The SSIS packages run on an application server

*The SQL Server database lives on a database server

I use an OLE DB connection manager to connect from the SSIS package on the application server to the SQL Server database on the database server.
The packages run as a file system deployment on the application server and not as a database deployment on the database server.
The main reason for this is that the ETL is integrated with a set of tools no found on and drives not accessible to the database server. These tools include Apex Data Loader for Salesforce and pgAdmin III.
So far I cannot consistently reproduce this error. However, this is what I have observed:

*

*Failure occurs more frequently during regular business hours

*Failure occurs less frequently during off hours

For about a two hour period on a Friday morning I was able to successfully reproduce the error on a specific package.
The error occurred during a large data flow if a child package call that precedes the large data flow was enabled.
The error did not occur during the same large data flow if the child package call that precedes the large data flow was disabled.
The child package in question calls back to the database to retrieve a tiny amount of information for use in an email body and then sends the email.
It feels like maybe a resource limit is being exceeded?
Maybe a connection limit?
I am wondering what tools I should be using to try and determine the root cause of the error.
Technical details about the two servers involved are listed below:

SQL Server and Database Server info:
  Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)   Jun 17 2011 00:54:03   Copyright (c) Microsoft Corporation  Enterprise Edition (64-bit) on Windows NT 6.1  (Build 7601: Service Pack 1) (Hypervisor)
SSIS info:
  Microsoft Visual Studio 2008 Version 9.0.30729.1 SP
  Microsoft .NET Framework Version 3.5 SP1
Application Server info:
  OS name: Microsoft Windows Server 2008 R2 Standard
  Version: 6.1.7601 Service Pack 1 Build 7601

I have researched the error message online and found these, but would really like to get an expert's insight before proceeding:

*

*How to Disable TCP Chimney, TCPIP Offload Engine (TOE) or TCP Segmentation Offload (TSO).

*Using Netsh Commands to Enable or Disable TCP Chimney Offload
Any help is appreciated.
Thanks
UPDATE:
Further testing shows that this is not "an SSIS thing" as the same error is seen at the same rate when using SQL Server Management Studio. The complexity of the query does not make the error more or less likely. In an attempt to resolve, we have tried one fix (below):

*

* #1 How to Disable TCP Chimney, TCPIP Offload Engine (TOE) or TCP Segmentation Offload (TSO).
This was our first attempt. TCP Chimney is now disabled on the Application Server and the Database Server. Testing shows that the same error occurs at the same rate.
So where to go from here? Honestly I am not sure. One seemingly good option remains:

*

*Application Server and Database Server SQL Server installations do not exactly match

*Application Server = SQL Server 2008 (SP1) - 10.0.2531.0 (X64)

*Database Server = SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)

The plan is to upgrade the SQL Server installation on the Application server. Its kind of a hit and hope, but at this point this seems like the best option. Something in my brain tells me that this might be solved by fixing a hardware issue (by that I mean a repair or a replace) and that there might not be anything that hardware and software configuration can do about it.
However, I am still not sure how to go about determining a root cause. I am still left wondering what tools I should be using to diagnose the root cause.

A: Do you have AV software on Application Server side? If yes, try to disable AV - sometime AV blocks TCP/IP traffic. Issue with "The specified network name is no longer available" was solved by disabling AV here:
  https://community.spiceworks.com/topic/239423-the-specified-network-name-is-no-longer-available-while-writing-to-shared-dir

A: The error message indicates that the connection was forcibly closed. You have also mentioned this occur when you run a lot of jobs. Chances are, the network firewall is to blame. You should reach out to the firewall administrator to research the logs in order to see if the firewall closed the connection. If this is the case then two potential solutions exist:

*

*Add an exception to whatever firewall rule is being triggered and causing the connection to be closed.

*Stop running so many jobs concurrently. You should consider running them in sequence. This also adheres to the idea of being a good network citizen.

A: *

*First off did you tried to remove the large send offload setting on the nic ?

*Second point, can you run a wireshark to capture the packets if you can reproduce the error ?

*Third point, did you tried to change the vnic from the VM ? some model can cause issue. (If you use vmxnet3, try e1000, etc..)

*Last point, does you have a vswitch between them, they are on same host, a physical switch between, etc... A badly configured switch can drop traffic, if inside the host the same host and same vswitch it's the best test, as the traffic never leave the server.

A: It seems there are multiple causes for this issue. For me it was the SQL file being too big at about 150MiB. Splitting it into smaller files worked for me.

A: One possible root cause could be the active directory membership count as we experiencer recently. That will among other influence the size of Kerberos token that can influence the SQL server login steps as well.
Details:

*

*The login packet is structurally invalid

*Kerberos Token Size
Note: We observed error log entries on the SQL Server like:

The login packet used to open the connection is structurally invalid; the connection has been closed. Please contact the vendor of the client library.'

On the client we observed the following error message:

A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (.Net SqlClient Data Provider)

This issue was only affecting some AD users. There was no general service interruption.
Using the following command we determined the active directory membership:
PS> $groups = (az ad user get-member-groups --id {user identifier} |ConvertFrom-Json -AsHashtable)
PS> $groups.Count
294

Or we can also use the following command:
PS> $token = [System.Security.Principal.WindowsIdentity]::GetCurrent()
PS> $token.Groups.count
771

Connecting to the server with different providers yield different result:
Microsoft ODBC Driver for SQL Server Version 17.07.0002:
Data Source Name: SOME_NAME
Data Source Description:
Server: SQLSERVER.DOMAIN.COM
Database: CORE_DATABASE
Language: (Default)
Data Encryption: Yes
Trust Server Certificate: Yes
Multiple Active Result Sets(MARS): No
Mirror Server:
Translate Character Data: Yes
Log Long Running Queries: No
Log Driver Statistics: No
Use Regional Settings: No
Use ANSI Quoted Identifiers: Yes
Use ANSI Null, Paddings and Warnings: Yes
Authentication: ActiveDirectoryIntegrated
-----------

Running connectivity tests...

Attempting connection
Connection established
Verifying option settings
INFO: Connection was encrypted without server certificate validation.
Disconnecting from server

TESTS COMPLETED SUCCESSFULLY!

Microsoft SQL Server Native Client Version 11.00.7462:

Data Source Name: SOME_NAME
Data Source Description:
Server: SQLSERVER.DOMAIN.COM
Use Integrated Security: Yes
Database: (Default)
Language: (Default)
Data Encryption: No
Trust Server Certificate: No
Multiple Active Result Sets(MARS): No
Translate Character Data: Yes
Log Long Running Queries: No
Log Driver Statistics: No
Use Regional Settings: No
Use ANSI Quoted Identifiers: Yes
Use ANSI Null, Paddings and Warnings: Yes

-----------

Running connectivity tests...

Attempting connection
[Microsoft][SQL Server Native Client 11.0]TCP Provider: The specified network name is no longer available.

[Microsoft][SQL Server Native Client 11.0]Communication link failure

TESTS FAILED!

SQL Server - was not able to configure:

A: Try using ODBC instead of OLE DB for your connection to the database.


text:
Q: how to use .sass files in ASP.NET I'm trying to use sass files in an ASP.NET web project. I'm using Visual Studio 2013. Here is the sass stylesheet that i'm trying to use in my project :
$red: rgba(255,74,86,1)
.transition
@include transition( all 0.25s cubic-bezier(.53,.01,.35,1.5))

*
font-family: Helvetica , sans-serif
font-weight: light
-webkit-font-smoothing: antialiased

html
background-color: $red //rgba(245,248,252,1)

form
position: relative
display: inline-block
max-width: 700px
min-width: 500px
box-sizing: border-box
padding: 30px 25px
background-color: white
border-radius: 40px
margin: 40px 0
left: 50%
@include translate( -50% , 0 )

h1
color: $red
font-weight: 100
letter-spacing: 0.01em
margin-left: 15px
margin-bottom: 35px
text-transform: uppercase

button
@extend .transition
margin-top: 35px
background-color: white
border: 1px solid $red
line-height: 0
font-size: 17px
display: inline-block
box-sizing: border-box
padding: 20px 15px
border-radius: 60px
color: $red
font-weight: 100
letter-spacing: 0.01em
position: relative
z-index: 1

&:hover , &:focus
  color: white
  background-color: $red

.question
position: relative
padding: 10px 0

&:first-of-type
  padding-top: 0

&:last-of-type
  padding-bottom: 0

label
  @extend .transition
  transform-origin: left center
  color: $red
  font-weight: 100
  letter-spacing: 0.01em
  font-size: 17px
  box-sizing: border-box
  padding: 10px 15px
  display: block
  position: absolute
  margin-top: -40px
  z-index: 2
  pointer-events: none

input[type="text"]
  @extend .transition
  appearance: none
  background-color: none
  border: 1px solid $red
  line-height: 0
  font-size: 17px
  width: 100%
  display: block
  box-sizing: border-box
  padding: 10px 15px
  border-radius: 60px
  color: $red
  font-weight: 100
  letter-spacing: 0.01em
  position: relative
  z-index: 1

  &:focus
    outline: none
    background: $red
    color: white
    margin-top: 30px

  &:valid
    margin-top: 30px

  &:focus ~ label
    @include translate( 0 , -35px )

  &:valid ~ label
    text-transform: uppercase
    font-style: italic
    @include transform( translate( 5px , -35px ) scale(0.6))

which i got it from this site
is the any way to use that style in my project ?

A: This blog post recommends that you use Mindscape Web Workbench. It appears Web Essentials has SASS support, also.
Edit: As Claies mentions in the comments, it appears there's native support in VS 2013 Update 2.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Pull requests as knowledge transfer: an anti-pattern? I assumed that the purpose of pull requests within a team is to get a second set of eyes and basically proofread the code. But lately I am noticing that they can serve an additional function of preventing knowledge silos. The logic is that if every piece of code you write goes through a PR, then we preclude the danger of code which is unfamiliar to anyone except the author, increase the bus factor, and generally drive developers staying in the loop about projects they are not personally developing. If PRs are strategically spread out instead of always assigning to the same person, then these benefits become pretty strong.
By this logic, I am tempted to consider the "proofreading" to be a very secondary benefit of PRs. Correctness is checked in any case by automated and manual tests, careful design, and double checking my own work (though the fresh look from someone else doesn't hurt). The primary purpose of the PR is "FYI" - it is like an announcement to other developers of possibly significant changes I am implementing (if they are definitely significant, I would make an actual announcement eg. during a meeting).
This has impact on how the PRs are made. With the "proofread" logic, the main question is too big and hard to review PR vs. too trivial PR (simple changes that are obviously correct). But with the "FYI" logic, the question is whether the PR encapsulates a change that someone else should know about. Therefore extremely trivial PRs are still a good idea because even though there is no real need to proofread, the change is still worth communicating.
Is my thinking logical, or is this understanding of PRs an antipattern that causes problems down the line?

A: To me, PRs are not a suitable vehicle for teaching domain knowledge. PRs are too random to do that (there is a poor signal to noise level when it comes to interesting information nuggets), the discoverability is low (who wants to dig around old PRs for information? are they searchable?) and there is a mismatch of the audience (everyone who needs to know) and what's practical in a PR.
Having said that, it's not wrong, it's a desirable side effect. I think they are useful to teach implementation strategies and best practices to the original author. But it doesn't completely solve the problem.
If I need people to know how the code works, I do an in-person code walk-through. We also do cross-team sprint demos.

A: It seems to me that your logic is flawed.

*

*Simply reading a PR by itself is unlikely to impart understanding of the code base.

*If only a single person reads and approves each PR and you spread the approvers widely, then each team member will only see a small scattered sample of changes.

*Approving PRs is a pain. People will skip checking the code if they are assigned random PRs and just hit approve.
If we follow your reasoning to its conclusion you would have the least experienced team members approving PRs in order to 'train them up' and the most experienced members not doing any, which seems like a reversal of the standard "second pair of eyes" idea.
PRs are possibly of doubtful use in a commercial setting, but we can all understand the idea of Requesting the owners of the code base review our suggested changes and, if they find the changes acceptable, incorporate them into their code base.
The owners have an interest in maintaining whatever standards they think are required and are necessarily experts in the subject matter, able to judge the PR.
When they have the job of doing the PRs the system works. If you replace them with newbies then they wont have those interests, I don't think they will be motivated to read the PR they will just click accept.

A: Forcing communication through a channel that was not designed with that activity in mind is always an anti-pattern.
Now if the code/documents/etc that you are changing are at the right level of detail, then yes they can be used as a vehicle for communicating domain knowledge. However:

*

*they would need to be viewed by the team (or a large portion there of) which is a lot of overhead, in order to serve that purpose.

*generally speaking those people do not care about this section of the code, as they are working on other things. Doubtlessly they would have to consult the code again later should they become interested.

*and there are more effective ways to communicate with the team: Design Documents, Stories, Presentations, the water cooler...


text:
Q: Android relase APK can't load activities Using Android Studio 2.2, switching activities in my application works perfectly when I use the debug version. However, when I publish my application to the Google Play, I can open the application, but trying to start any other activities (via Intent) will crash the application.
build.gradle:
apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"
    defaultConfig {
        applicationId "net.ddns.opencratebox.mycratebox"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 5
        versionName "0.0.5"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
    compile 'com.google.firebase:firebase-ads:9.4.0'
    compile 'com.google.android.gms:play-services-ads:9.4.0'
    compile 'com.firebase:firebase-client-android:2.3.1'
}

apply plugin: 'com.google.gms.google-services'

Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="net.ddns.opencratebox.mycratebox">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="MyCrateBox"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".source.MVC.View.LaunchActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".source.MVC.View.RegisterActivity" />
        <activity android:name=".source.MVC.View.LoggedActivity" />
    </application>

</manifest>

The only permission I am asking for is INTERNET, and I declared it. Anyway, it has nothing to do with starting activities. I have no idea what is going on, because debug version works so greatly (installing it via USB cable directly from android studio to my Tablet) Many friends tried it too and same result.
So, it does not work if I install it through Google play, but works if I install it via USB from Android Studio.
Anyone has an idea?
P.S. Already tried to put minifyEnabled to false, no results :( I heard that Proguard could remove constructors or piece of code, something like that.
EDIT
Stack trace of the crash event:
09-19 20:42:55.127 31614-31614/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                   Process:

net.ddns.opencratebox.mycratebox, PID: 31614
                                                     java.lang.IllegalStateException: Could not find method
  registerView(View) in a parent or ancestor Context for android:onClick
  attribute defined on view class
  android.support.v7.widget.AppCompatTextView with id 'txvc_register'
                                                         at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.resolveMethod(AppCompatViewInflater.java:327)
                                                         at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:284)
                                                         at android.view.View.performClick(View.java:5280)
                                                         at android.view.View$PerformClick.run(View.java:21239)
                                                         at android.os.Handler.handleCallback(Handler.java:739)
                                                         at android.os.Handler.dispatchMessage(Handler.java:95)
                                                         at android.os.Looper.loop(Looper.java:234)
                                                         at android.app.ActivityThread.main(ActivityThread.java:5526)
                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

The code that should start the other activity:
protected void registerView(View view) {
        Intent intent = new Intent(this, RegisterActivity.class);
        startActivity(intent);
    }

The XML that represents the click button:
<TextView
        android:id="@+id/txvc_register"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/btn_register"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="42dp"
        android:clickable="true"
        android:linksClickable="false"
        android:onClick="registerView"
        android:text="@string/or_register"
        android:textColor="@color/abc_btn_colored_borderless_text_material" />

A: Fixed by simply changing the visibility of my methods called by onClick from protected to public.
public void registerView(View view) {
        Intent intent = new Intent(this, RegisterActivity.class);
        startActivity(intent);
    }


text:
Q: What is the default font of Sublime Text? I was looking and could not find an answer on this one. Which is Sublime Text's default font type?

A: On my system (Windows 8.1), Sublime 2 shows default font "Consolas". You can find yours by following this procedure:

*

*go to View menu and select Show Console

*Then enter this command: view.settings().get('font_face')
You will find your default font.

A: The default font on windows 10 is Consolas

A: Yes. You can use Console of Sublime with (Linux):
Ctrl + `

And type:
view.settings().get('font_face')

Get any setting the same way.

A: On Linux it's Monospace 10 pt. (the exact monospace font used may vary on different Linux distributions or versions), on Windows it's Consolas 10 pt., and on OS X it's Menlo Regular 12 pt.

(The color scheme is Neon, the syntax highlighting is from PackageDev, and the font is Liberation Mono
This information is found in the Packages/Default directory (where Packages is the directory opened by the Preferences → Browse Packages... menu option), in the Preferences (OS).sublime-settings file where OS is one of Windows, Linux, or OSX.
You should only customize the font (or any other setting) in Packages/User/Preferences.sublime-settings, opened by Preferences → Settings—User, as Settings—Default is over-written on upgrade, and also serves as a backup in case you really screw something up in your user settings. This is the case for both the main Sublime settings as well as those for extra packages/plugins.
These default fonts are the same in Sublime Text 2, Sublime Text 3, and the new version currently in development.

A: To add to MattDMo's answer, you can get the exact font that's used on Linux like so (the example is from Xubuntu 14.04):
$ fc-match Monospace
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"


text:
Q: Should I install one, or two ssl certificates? I am confused about SSL certificates in express js and angular.
I would like to make an angular registration system, which in turn will request resources from an api in express js.
The question is as follows:
Should I use ssl certificates in angular server, and in express js server, or only in angular?
Both the express server and the angular server will be on the same machine, and
I need communications between users and the server to be secure.

A: Welcome to Stack Overflow. I would recommend using 2 SSL Certificates one for the angular application and one for the API if setting the applications separately or the API will be used by other applications as well. This is because you have two separate apps that need to use HTTPS, under different domains. I would also recommend putting the applications behind a reverse proxy like Nginx or Apache HAProxy.
If you use a reverse proxy you can do some advanced configuration to use 1 SSL Certificate. There are plenty of tutorials on the web of setting up Nginx for Node. I would check those out.


text:
Q: Eclipse Java Projects in the Cloud I would like use Eclipse projects from my home and office and I don't want export/import them each time before use. Is there any way I can store/use my Eclipse Java project from the cloud like cloud foundry.
Please let me know the options.

A: You could move your Eclipse folder inside a Dropbox folder.
Added bonus: access your project from anywhere.
You could also use GitHub, but then your source code will be open to the community unless you pay for one of their "plans".
Also, consider using Bitbucket, which isn't known as well, but is free.

A: I personally use GitHub to store all my code, and use the Git integration within Eclipse to push and pull code to the master version on GitHub whenever necessary.
This has a few advantages:

*

*I can use a standard Eclipse setup with minimal customisation

*I can work offline (no need to store the actual current workspace in the cloud)

*The git integration within Eclipse is very good

*It integrates well with work done by others (pull requests etc.)

*I can be working on different branches on my laptop and desktop, merging when necessary.

A: Similar to the answers given to others, I've setup an SVN repository on my Dropbox. It's very easy to do and, when using Ivy, it doesn't take much space.

A: There is Git Annex as well which offers a cool set of features worth checking out.


text:
Q: Как расширить класс, чтобы можно было передавать методы с разными аргументами Переписав на код из этого ответа на мой вопрос: Помощь в написании консольного меню С#
В нем и находится весь код класса.
Я не понимаю как использовать методы с разными аргументами
Создаем меню:
    {
        new MenuAction("Пункт 1", //метод),
        new MenuCategory("Подменю 1", new MenuItem[]
        {
            new MenuAction("Пункт 1.1", //метод),
            new MenuBack()
        }),
        new MenuBack("Выход")
    });

Menu menu = new Menu(main);
            menu.Run();

Допустим, что я хочу, чтобы пункт первый выводил все события, должно выглядеть вот так:

Также тут я не до конца понимаю как выходить на время из меню, так как я это решал в предыдущей версии меню рекурсией, но это если вдруг будет попутно, для начала как все-таки реализовывать методы хотелось бы понять.
Это один из самых простых пунктов меню, но дальше, надеюсь станет понятнее и справлюсь сам.
Так выглядит метод, который выводит это само меню
public static class PrintLogic
    {
        public static void PrintTimelineList(List<TimelineEvent> events)
        {
            ConsoleHelper.ClearScreen();
            "Список событий".Center();

            foreach (TimelineEvent line in events)
            {
                string idParticipant = String.Empty;
                if (line.IdParticipant != null)
                {
                    foreach (int id in line.IdParticipant)
                    {
                        idParticipant = idParticipant + $"{id} ";

                    }
                    Console.WriteLine($"{line.DateEvent.ToString("yyyy-MM-dd")} \t" +
                        $"{line.Description}" +
                        $"\nId людей, которые учавстсовали в этом событии: "
                        + idParticipant);
                }
                else
                {
                    Console.WriteLine($"{line.DateEvent.ToString("yyyy-MM-dd")} \t" +
                        $"{line.Description} \t");
                }
            }
        }
    }

Ему нужно передавать в виде аргумента List<TimelineEvent> events, где структура класса TimelineEvent:
public class TimelineEvent
    {
        public DateTime DateEvent { get; set; }
        public string Description { get; set; }
        public List<int> IdParticipant { get; set; }
    }

Считываются данные все с файла и обычно передаю DataReader.readedTimeline.
Если что-то еще нужно, дополню.

A: Берем вот этот класс из ответа
public class MenuAction : MenuItem
{
    public Action<MenuItem> Action { get; }

    public MenuAction(string name, Action<MenuItem> action) : base(name)
    {
        Action = action;
    }
}

И переписываем вот так
public class MenuPrintAction : MenuItem
{
    public Action<List<TimelineEvent>> Action { get; }

    public MenuPrintAction(string name, Action<List<TimelineEvent>> action) : base(name)
    {
        Action = action;
    }
}

Заносим в дерево менюшек
new MenuPrintAction("Пункт 1", PrintLogic.PrintTimelineList),

Полдела сделано, теперь вызвать надо это как-то
case MenuPrintAction printAction:
    printAction.Action(/*сюда вставить ваш список*/);
    break;

Как именно список станет доступен из метода Run - вам решать.

Вы можете этот список даже в самом классе MenuPrintAction хранить, например так.
public class MenuPrintAction : MenuItem
{
    public Action<List<TimelineEvent>> Action { get; }
    public List<TimelineEvent> TimelineEvents { get; }

    public MenuPrintAction(string name, Action<List<TimelineEvent>> action, List<TimelineEvent> timelineEvents) : base(name)
    {
        Action = action;
        TimeLlineEvents = timelineEvents;
    }
}

new MenuPrintAction("Пункт 1", PrintLogic.PrintTimelineList, list),

printAction.Action(printAction.TimelineEvents);

Решать вам, как оно должно работать

Как прикрутить к меню свою програмную логику.
Создайте класс, например такой
public class MyApplication
{
    // здесь какие-то данные
    private int i;

    // здесь какие-то методы
    public void Increment()
    {
        i++;
    }

    public void Print()
    {
        Console.WriteLine(i);
    }
}

Можно создать такой пункт
public class MenuApplication : MenuItem
{
    public Action Action { get; }

    public MenuApplication(string name, Action action) : base(name)
    {
        Action = action;
    }
}

Добавить case
case MenuApplication appAction:
    appAction.Action();
    break;

Создать экземпляр вот так
var app = new MyApplication();

// здесь создание дерева меню

Добавить в дерево
new MenuApplication("Добавить +1", app.Increment),
new MenuApplication("Напечатать", app.Print),

Так понятнее?


text:
Q: Laravel 6.3.0 + Apache2 - Connection is reset after the kernel loads I am having a seemingly unsolvable problem with a recent installation of Laravel. Laravel is installed properly and runs fine with the PHP server but when I want to load it in apache on localhost:80, the connection is reset after the following call in the index.php file.
$response = $kernel->handle(
  $request = Illuminate\Http\Request::capture()
);

The following function somehow resets the http connection and I get a reset connection http error. This does not happen when I try to load an unmapped url, I get a 404 error and laravel runs properly.

I followed the installation guide and all dependencies are installed.
https://laravel.com/docs/4.2/installation
The apache error log says a process is forked and then sigterm:
  cat /var/log/apache2/error.log
    [Wed Oct 16 16:02:18.007501 2019] [ssl:warn] [pid 56037] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
    **[Wed Oct 16 16:02:18.024221 2019] [mpm_prefork:notice] [pid 56037] AH00163: Apache/2.4.41 (Unix) OpenSSL/1.1.1d PHP/7.3.10 configured -- resuming normal operations**
    [Wed Oct 16 16:02:18.024276 2019] [core:notice] [pid 56037] AH00094: Command line: '/opt/local/sbin/httpd'
    [Wed Oct 16 16:04:52.053878 2019] [core:notice] [pid 56037] AH00052: child pid 56042 exit signal Bus error (10)
**[Wed Oct 16 16:29:33.693999 2019] [mpm_prefork:notice] [pid 56037] AH00169: caught SIGTERM, shutting down**

I have many php sites running in my machine working fine with other frameworks.
Many thanks for your help.


text:
Q: Android : How does one uninstall a wear watch face from the emulator? I'm looking to uninstall a custom watch face from a running emulator without resorting to wiping the emulator and rebooting.  Which ADB commands might I send to the emulator to perform this task?

A: Just like any Android device, you can use adb. From a command line:
adb uninstall com.your.package.name

If multiple devices are connected, get their names with adb devices and then use:
adb -s device-name uninstall com.your.package.name

A: For the record, you can also delete a face from a watch as follows

*

*Hook your host phone via usd to a computer with Android SDK

*execute adb in shell mode adb shell

*pm uninstall com.your.package_name
This will remove the package from the phone and the watch
Ideal for situations where you messed your APK signature leaving package name unchanged.


text:
Q: How to pass data to UI thread Good evening.
I have an activity like this. In handleMessage I have access to largeText field and can change it, but I can't do smth  whith stringLinks field, or each other field which is not a UI element(like TextView, Button, EditText, etc).
How can I add to stringLinks ?
public class AboutUsActivity extends Activity {

Handler h;
TextView largeText;
List<String> stringLinks;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    stringLinks = new ArrayList<String>();
    largeText = (TextView) findViewById(R.id.textView1);

    h = new Handler() {

        public void handleMessage(android.os.Message msg) {
            HtmlParser parser;
            StringBuilder result = new StringBuilder();
            try {
                parser = new HtmlParser(String.valueOf(msg.getData()));
                List<TagNode> links = parser.getContentByClassName("ab");
                for (Iterator<TagNode> iterator = stringLinks.iterator(); iterator
                        .hasNext();) {

                    TagNode divElement = (TagNode) iterator.next();
                    result.append(divElement.getText().toString());
                }

            } catch (Exception e) {
                e.printStackTrace();
            }

            largeText.setText(newhtml);       //Work
            stringLinks.add(newhtml);               //doesn't work
        }

    };

    MyHttpClientUsage connect = new MyHttpClientUsage(h);
    try {
        connect.getInfoAbout();
    } catch (HttpException e) {
        e.printStackTrace();
    }
}

}

A: I dont know if I understood you correctly.
If i did, you can use AsyncTask class
Check out their main too methods, doInBackground that executes something in a separate thread and onPostExecute that runs in UI Thread. They can comunicate with each other passing objects, and you can also publish the progress of your task.
It really looks like SwingWorker (maybe you used it if you programmed Swing applications).


text:
Q: Use write() to read stdin/file and print lines - doesn't show number of lines I can make it mirror the line. I tried to print the line with printf, doesn't work because its buffered and only prints when I Ctrl+D.
I'm trying with write() but no output is showing. Why not? I have to use system calls. And if it's a simple thing after the line print, how can I add a space after the number?
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, char *argv[]) {

    int n, i = 0;
    char buf[1];
    int reader=0;

    if(argc > 1){
       reader = open(argv[2],O_RDONLY);
    }

    while(n = read(reader,buf,sizeof(buf)) > 0) {
       if (buf[0] == '\n') {
          i++;
          write(1, &i,sizeof(i));
       }
       write(1,buf,sizeof(buf));
    }
    close(reader);
    return 1;
}

A: here is one version of the program that works correctly
Notice the proper timing of the 'line number' at the beginning of a line, including the first line and no extra line number output after the last line
Notice the usage of the high level I/O rather than the low level read() and write()
Notice the checking for missing command line parameter
Notice the usage statement to stderr when command line parameter missing
Notice the error checking and proper error message to stderr when fopen() fails
Notice that each indent level is consistent and 4 spaces wide
Notice the usage of a variable 'priorCh' to track when the line number needs to be output.
Notice the proper referencing of the main() parameters argc and argv[]
#include <stdio.h>   // printf(), fopen(), fclose(), fgetc(), putc(), perror()
#include <stdlib.h>  // exit(), EXIT_FAILURE

int main(int argc, char *argv[])
{

    int      i = 0;       // line counter
    int      ch;
    int      priorCh = '\0';

    FILE*    reader= NULL;  // init to an invalid value

    if( 1 == argc )
    {
        fprintf( stderr, "USAGE: %s <inputFileName> \n", argv[0] );
        exit( EXIT_FAILURE );
    }

    // implied else, correct number of command line parameters

    reader = fopen(argv[1], "r");
    if( NULL == reader )
    {
        perror( "fopen for input file failed" );
        exit( EXIT_FAILURE );
    }

    // implied else, open successful

    i++;
    printf( "%d ", i );

    while( (ch = fgetc( reader ) ) != EOF )
    {
        if( '\n' == priorCh )
        {
            i++;
            printf( "%d ", i );
        }
        putc( ch, stdout );
        priorCh = ch;
    } // end while

    fclose(reader);
    return 1;
} // end function: main

Here is the output, when using the above file as the input
1 #include <stdio.h>   // printf(), fopen(), fclose(), fgetc(), putc(), perror()
2 #include <stdlib.h>  // exit(), EXIT_FAILURE
3
4
5
6
7
8 int main(int argc, char *argv[])
9 {
10
11     int      i = 0;       // line counter
12     int      ch;
13     int      priorCh = '\0';
14
15     FILE*    reader= NULL;  // init to an invalid value
16
17     if( 1 == argc )
18     {
19         fprintf( stderr, "USAGE: %s <inputFileName> \n", argv[0] );
20         exit( EXIT_FAILURE );
21     }
22
23     // implied else, correct number of command line parameters
24
25
26     reader = fopen(argv[1], "r");
27     if( NULL == reader )
28     {
29         perror( "fopen for input file failed" );
30         exit( EXIT_FAILURE );
31     }
32
33     // implied else, open successful
34
35     i++;
36     printf( "%d ", i );
37
38     while( (ch = fgetc( reader ) ) != EOF )
39     {
40         if( '\n' == priorCh )
41         {
42             i++;
43             printf( "%d ", i );
44         }
45         putc( ch, stdout );
46         priorCh = ch;
47     } // end while
48
49     fclose(reader);
50     return 1;
51 } // end function: main


text:
Q: Visual Studio 2017 form Good day
I am developing a windows app form in VS2017 however i get the following errors
"Cannot assign to txtEmail because its a method group"
"EmployeeRquestFormUI.txtEmail() is a method which is not valid in the given context"
What could be the problem with the code: Please see code below
employeeRequestFormUI.txtJob_Desc = new System.Windows.Forms.TextBox();
employeeRequestFormUI.txtEmail = new System.Windows.Forms.TextBox();
employeeRequestFormUI.txtTelExt = new System.Windows.Forms.TextBox();
employeeRequestFormUI.txtRequestedBy = new System.Windows.Forms.TextBox();
employeeRequestFormUI.radioLaptop = new System.Windows.Forms.RadioButton();
employeeRequestFormUI.radioDesktop = new System.Windows.Forms.RadioButton();
employeeRequestFormUI.txtDepartment = new System.Windows.Forms.ComboBox();
employeeRequestFormUI.richTextBox1 = new System.Windows.Forms.RichTextBox();

A: Look for
EmployeeRquestFormUI.txtEmail()

and remove the braces
EmployeeRquestFormUI.txtEmail


text:
Q: redirect_to Post method ruby on rails I have the following
games_controller
def sheet
  @game=params[:id]
  @champ=params[:ch]
  @w_team=params[:wt]
  @b_team=params[:bt]
  @champ_id=params[:chi]
  @w_team_id=params[:wti]
  @b_team_id=params[:bti]
  render template: "games/sheet.html.erb"

end
scripts.js
function to_sheet(id){
   tokentag = $('#tokentag').val();

   var champ = $("#champ option:selected").text();
   var w_team = $("#team_W option:selected").text();
   var b_team = $("#team_B option:selected").text();
   var champ_id = $("#champ option:selected").val();
   var w_team_id = $("#team_W option:selected").val();
   var b_team_id = $("#team_B option:selected").val();

   $.ajax({
     url:    "/games/sheet",
     type:   "POST",
     data:   {"authenticity_token": tokentag,game_id:id, w_team:w_team, w_team_id:w_team_id, b_team:b_team, b_team_id:b_team_id, champ:champ, champ_id:champ_id},
     success: function(response){
        alert('hola');
     }
   });
 }

routes.rb
resources :games
  post 'games/sheet' => 'games#sheet'

My problem is that games/sheet.html.erb in not display in the web page (is not redirected to it)... it renders only in the "preview" of the debuging part. Do you understand?
I tried with redirect redirect_to :controller=>'games',:action=>'sheet' but it didnt work
Thanks!


text:
Q: Blending issues between InstancedMesh using a ShaderMaterial (trying to reproduce mix-blend-mode: overlay from Figma) I've been working on blending between InstancedMesh using a ShaderMaterial. The blending between the InstancedMesh works fine with THREE.JS blending mode (Additive, Substractive, ...) but i struggle to match the Figma design with thoses (See the attached screenshots, first is the current result with THREE.JS using Additive blend mode, second is the result i need from Figma).
Current Result using Additive Blending
Result needed from Figma
A mix-blend-mode: overlay is used on Figma between all the circles (the InstancedMesh in Three.js), so i tried to add some glsl blend overlay code (https://github.com/jamieowen/glsl-blend) like that in the ShaderMaterial used by the InstancedMesh :
uniform vec3 uColors[6];
uniform float uThresholds[6];

varying vec2 vUv;

float blendOverlay(float base, float blend) {
  return base<0.5?(2.0*base*blend):(1.0-2.0*(1.0-base)*(1.0-blend));
}

vec3 blendOverlay(vec3 base, vec3 blend) {
  return vec3(blendOverlay(base.r,blend.r),blendOverlay(base.g,blend.g),blendOverlay(base.b,blend.b));
}

vec3 blendOverlay(vec3 base, vec3 blend, float opacity) {
  return (blendOverlay(base, blend) * opacity + base * (1.0 - opacity));
}

void main() {
  vec3 color = mix(uColors[0], uColors[1], smoothstep(uThresholds[0], uThresholds[1], vUv.y));

  color = mix(color, uColors[2], smoothstep(uThresholds[1], uThresholds[2], vUv.y));
  color = mix(color, uColors[3], smoothstep(uThresholds[2], uThresholds[3], vUv.y));
  color = mix(color, uColors[4], smoothstep(uThresholds[3], uThresholds[4], vUv.y));
  color = mix(color, uColors[5], smoothstep(uThresholds[4], uThresholds[5], vUv.y));

  gl_FragColor = vec4(blendOverlay(color.rgb, ???), 1.0);
}

I understood that i would need some sampler2D uniforms to use them as texture2D for the blendOverlay method to work, but my problem is how can i render those textures ?
If the overlay was just between a "background" and all the InstancedMesh i could render the InstancedMesh in a renderTarget once and use it as a texture. But here i need the overlay blending to be between all the InstancedMesh objects. Should i render the InstancedMesh one by one in a renderTarget and store every textures ? I'm a bit lost here hehe.


text:
Q: Convert a picture or figure to EPS or PDF file In my document I'm embedding figures using the following code:
\begin{figure}[!t]
  \centering
  \def\svgwidth{1.2\columnwidth}
  \resizebox{\columnwidth}{!}{
    \endlinechar=255\relax
    \begin{picture}(1,0.63636365)
      \put(0,0){\includegraphics[width=\unitlength]{figure.eps}}
      \put(0.50454546,0.58636365){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{some text $ax^2+bx+c=0$.}}}
    \end{picture}
  }
  \caption{Caption.}
  \label{fig:figure}
\end{figure}

Where the image (figure.eps) contains no text and all annotations are added on top of the image using \put commands.
This method works very well (annotations can include any LaTeX macros, which is extremely useful) as long as I'm sticking to TeX. Now, however, I'd like to take the resulting figures (preferably in a vector format) and put them in some other tool.
Questions:

*

*Is there any way of outputting these floats into PDF files with no margins, captions and with page dimensions equal to the specified float size? I imagine I'd have to somehow wrap each float in a .tex file with a custom preamble.

*Is it possible to automate this process so that if I want to dump all my N figures to PDFs I don't have to repeat the step (1) N times.

A: In general I recommend you to place all your complicated figures into separate files and use e.g. the standalone class to be able to compile them separatly and then \input them easily in the main document with the standalone package.
For your existing document you can use the preview package (which is used internally by standalone). It only compiles things wrapped in a preview environment and every such environment as a page. With the tightpage option you get tight pages as I requested.
I would use code like the following to redefine figure to use preview environments and to disable (or include) the \caption.
The resulting PDF should have one picture per page. You can then use the page=<number> option of \includegraphics to include it or split it into several PDFs using tools like pdftk allfigures.pdf burst output figure%02d.pdf or Ghostscript.
\documentclass{article}

\usepackage[active,tightpage]{preview}

\makeatletter
\renewenvironment{figure}[1][]{%
    \begin{preview}%
        \renewcommand\caption[2][]{}% or
        %\def\@captype{figure}% If you want to include the caption
}{%
    \end{preview}%
}
\makeatother

\begin{document}

text text text text

\begin{figure}[!t]
    \rule{5cm}{8cm}% dummy replacement
    \caption{some caption}
\end{figure}

text text text text

\begin{figure}[!t]
    \rule{8cm}{5cm}% dummy replacement
    \caption{some caption}
\end{figure}

text text text text

\end{document}

A: If you're OK with your procedures so far, I suppose you could set \pagestyle{empty} in the preamble, have only one float per page by inserting a \clearpage instruction after each float, and finally break up the resulting n-page pdf file into n separate pdf files. (Setting the pagestyle to empty will simplify cropping each page.)


text:
Q: Mount samba user directory at login on Windows To have user settings shared on a server for Linux clients, I would set up the client to :

*

*bind the user login and password against an LDAP server

*get the user login and password via pam_mount

*mount the home directory to /home/USERNAME via sshfs thanks to pam mount

*unmount the home directory at logout

This way, all users have their home directory and profile on each computer and the home directory is secured.
My question is, how to configure Windows 7 pro to do the same thing ? It would be :

*

*bind the user against the LDAP server

*get the user login and password

*mount the user profile via CIFS to \Users\USERNAME, using its password

*unmount the user directory at logout


text:
Q: Can I use Vue.Draggable to drag files from OS? I am trying to use Vue.draggable inside an upload dropzone of my own making.
Issue:
<draggable></draggable> is inside of the dropzone, so if I start dragging a list item from the draggable array it will trigger the dropzone drag and drop events instead of the draggable ones. Also, dragging files from OS over the <draggable></draggable> opens them and it does not add them to the list.
Uploading works fine only when I drag files from the OS over the dropzone
Vue File:
<template>
      <div
        @drop.prevent="drop"
        @dragover.prevent
        @dragenter.prevent="dragEnter"
        @dragleave.prevent="dragLeave"
        :class="`mid_container ${dragging ? 'dragging' : ''}`"
      >

File name:

Size:

Actions:

          <draggable
            class="file-manager draggable"
            v-model="currentFiles"
            ghost-class="ghost"
            @end="onEnd"
          >
            <transition-group
              class="file-manager transitionGroup"
              type="transition"
              name="flip-list"
            >
              <div
                :class="`sortable file-line ${file.status ? 'wrong-file' : ''}`"
                v-for="(file, index) in currentFiles"
                :key="file.name"
              >

                  {{ file.name }}

                    {{ file.status }}

{{ file.size }} kb

            </transition-group>
          </draggable>

</template>

Can somebody point me out in the right direction on how to join the two ?


text:
Q: Can I possibly use submit type of button with onclick function of javascript? @using (Html.BeginForm("ShowNewProfessionalWindow", "UpdateOrganizationUID"))
{

Organization UID:
 @Html.TextBoxFor(x => x.Org_UID)
         <input type="submit" id="btnSearch" value="Search" onclick="SubmitQuery()" class="login-button" />

}

because when i click the button it goes to beginform then after that it goes to SubmitQuery() but the value of txtOrg_UID is missing.


text:
Q: Laravel 4 blade syntax within my javascript files My home page had some inline javascript that was mixed up with some blade syntax e.g.
    <script type="text/javascript">
        @if(Auth::user())
            if(path.indexOf('/user/' + {{Auth::user()->id}} ) != -1) {
                    $( "#tabs" ).tabs();
            };
        @endif
    </script>

It worked until I wanted to move the javascript to an external file.js. I got error whenever blade syntax was added. Is there a way I can fuse blade syntax in my javascript files.js? I tried renaming to file.blade.js with no luck...

A: Although the accepted solution will work, this is a most definitely an antipattern.
If I saw this not being the one who wrote it, I would be extremely confused to what's going on.
My suggestion is in your PHP file, have a  block, which gets all of the values that you'll need in your external files, then call the external files.
So in your PHP file you would have something like:
<script>
    var userID = "{{ Auth::user()->id }}";
    var isUser = "{{ Auth::user() }}"
</script>

{{ HTML::script('path/to/js/file.js') }}

And in your javascript file:
if(isUser)
{
    if(path.indexOf('/user/' + userID ) != -1) {
        $( "#tabs" ).tabs();
    };
}

A: I was doing the same than @BrandonRomano, but I found a better approach. Sending directly the value from PHP to JS vars using:
PHP-Vars-To-Js-Transformer
PHP:
JavaScript::put([
    'foo' => 'bar',
    'user' => User::first(),
    'age' => 29
]);

JS:
console.log(foo); // bar
console.log(user); // User Obj
console.log(age); // 29

You can set a namespace like:
console.log(server.foo)

A: you can try this save your javascript file in app/views folder and rename it to xxx.blade.php , yes .blade.php because Blade Engine will parse it only if its .blade.php and use @include('your javascript filename') to include the javascript file parsed by Blade, it will work.

A: You are outputing string from PHP, so you have to enclose that string in '
<script type="text/javascript">
    @if(Auth::user())
        if(path.indexOf('/user/' + '{{Auth::user()->id}}' ) != -1) {
                $( "#tabs" ).tabs();
        };
    @endif
</script>


text:
Q: Error on Rss Feed for my blog I searched on this website but didnt get any proper solution for my problem.
I got this website : http://www.droidacid.com/feed/
I am not able to get the Rss feed or xml file of my website.
Actually I need to develop an Android application for my website and need my xml link for the same.
Hope to receive some answers soon or link to a similar problem(I searched but did not get similar problem).
Thanks


text:
Q: How can I find the IP of a shared iTunes library on our network? How can I find the IP address of a computer with a shared iTunes library?  The share shows up in iTunes, but it's with an odd name on a largish network and I need to know which computer is sharing the library.

A: Bonjour Browser will give a list of all Bonjour services on your network. It will list all the computers with their names, IP address and ports. Mac OS X only.

A: In Terminal:
lsof | grep iTunes | grep TCP

A: You want a ZeroConf/Bonjour browser which allows you to see the packets sent out by iTunes.
Under Windows I would suggest the Zeroconf Neighborhood Explorer - http://www.stg.com/zeroconf_explorer.html
If you have a programmer near, there is a very helpful demo program in the jmdns project (Java based)


text:
Q: gheatmap function (ggtree package) returns "Error: Must request at least one colour from a hue palette." when plotting the gheatmap object I'm trying to add a heat map onto a phylogenic tree using the ggtree function gheatmap. Despite no apparent errors appearing in the lines that create the gheatmap object, when trying to plot the object, it returns "Error: Must request at least one colour from a hue palette.". Still get this error when I use all default values for the arguments of gheatmap (including colour choices), a simpler  tree and some random values corresponding to the tips of the tree. I have also tried changing some of the colours and that still didn't fix the error as I'm still unsure which argument is causing the problem.
Here is what I hope is a reproducible example:
library(ggtree)
test.tree <- read.tree(text = "(((A,C), (B,D)), E);")
test.data <- data.frame('taxon' = c('A','B','C','D','E'), 'height' = c(0.7, 0.2, 1.3, 0.55, 0.88))
test.tree.plot <- ggtree(test.tree)

test.plot <- gheatmap(
  test.tree.plot,
  test.data,
  offset = 0,
  width = 1,
  low = "green",
  high = "red",
  color = "white",
  colnames = TRUE,
  colnames_position = "bottom",
  colnames_angle = 0,
  colnames_level = NULL,
  colnames_offset_x = 0,
  colnames_offset_y = 0,
  font.size = 4,
  family = "",
  hjust = 0.5,
  legend_title = "value"
)

plot(test.plot)

A: welcome to SO!
A quick search for this error point to a case when a variable containing only NA is being mapped to an aesthetic (in this case the fill of geom_tile()). Your data does not have any NA's so its probably something happening inside the gheatmap function.
Taking a closer look, on this line https://github.com/YuLab-SMU/ggtree/blob/232394961afb6ce62c8dd90a5b1ee8e5f557185a/R/gheatmap.R#L81 the gheatmap function is expecting that the data frame will have rownames. Except, in your case, the data do not have rownames which results with all NAs after pivoting with gather few steps down the way.
I updated the function to take another argument id_col which sets the column to use for rownames.
With the new function, the code would be:
library(ggtree)
library(magrittr)
library(dplyr)
library(tidyr)
library(ggplot2)
source("ggheatmap.R") # loading the new function (if in a separate file)

test.tree <- read.tree(text = "(((A,C), (B,D)), E);")
test.data <- data.frame('taxon' = c('A','B','C','D','E'),
                        'height' = c(0.7, 0.2, 1.3, 0.55, 0.88)
                        )
test.tree.plot <- ggtree(test.tree)

test.plot <- ggheat(
  test.tree.plot,
  test.data,
  id_col = "taxon", # here is where you set the column with species names
                    # this becomes rownames internaly
                    # and is matched to the tip names
  offset = -3,
  width = 1,
  low = "green",
  high = "red",
  color = "white",
  colnames = TRUE,
  colnames_position = "bottom",
  colnames_angle = 0,
  colnames_level = NULL,
  colnames_offset_x = 0,
  colnames_offset_y = 0,
  font.size = 4,
  family = "",
  hjust = 0.5,
  legend_title = "value"
)

plot(test.plot)

This code makes this image:

The updated function is here:
ggheat <-
  function (p,
            data,
            id_col,
            offset = 0,
            width = 1,
            low = "green",
            high = "red",
            color = "white",
            colnames = TRUE,
            colnames_position = "bottom",
            colnames_angle = 0,
            colnames_level = NULL,
            colnames_offset_x = 0,
            colnames_offset_y = 0,
            font.size = 4,
            family = "",
            hjust = 0.5,
            legend_title = "value")
  {
    colnames_position %<>% match.arg(c("bottom", "top"))
    variable <- value <- lab <- y <- NULL
    width <-
      width * (p$data$x %>% range(na.rm = TRUE) %>% diff) / ncol(data)
    isTip <- x <- y <- variable <- value <- from <- to <- NULL
    df <- p$data
    nodeCo <-
      intersect(
        df %>% filter(is.na(x)) %>% select(.data$parent,
                                           .data$node) %>% unlist(),
        df %>% filter(!is.na(x)) %>%
          select(.data$parent, .data$node) %>% unlist()
      )
    labCo <-
      df %>% filter(.data$node %in% nodeCo) %>% select(.data$label) %>%
      unlist()
    selCo <- intersect(labCo, rownames(data))
    isSel <- df$label %in% selCo
    df <- df[df$isTip | isSel,]
    start <- max(df$x, na.rm = TRUE) + offset
    dd <- as.data.frame(data)
    i <- order(df$y)
    i <- i[!is.na(df$y[i])]
    lab <- df$label[i]

    # drop any rownames, then add them based on the user set id column
    # so the matching downstream can work
    dd <- dd %>% tibble::remove_rownames() %>% tibble::column_to_rownames(id_col)

    dd <- dd[match(lab, rownames(dd)), , drop = FALSE]
    dd$y <- sort(df$y)
    dd$lab <- lab
    dd <- gather(dd, variable, value,-c(lab, y))
    i <- which(dd$value == "")
    if (length(i) > 0) {
      dd$value[i] <- NA
    }
    if (is.null(colnames_level)) {
      dd$variable <- factor(dd$variable, levels = colnames(data))
    }
    else {
      dd$variable <- factor(dd$variable, levels = colnames_level)
    }
    V2 <- start + as.numeric(dd$variable) * width
    mapping <- data.frame(from = dd$variable, to = V2)
    mapping <- unique(mapping)
    dd$x <- V2
    dd$width <- width
    dd[[".panel"]] <- factor("Tree")
    if (is.null(color)) {
      p2 <- p + geom_tile(
        data = dd,
        aes(x, y, fill = value),
        width = width,
        inherit.aes = FALSE
      )
    }
    else {
      p2 <- p + geom_tile(
        data = dd,
        aes(x, y, fill = value),
        width = width,
        color = color,
        inherit.aes = FALSE
      )
    }
    if (is(dd$value, "numeric")) {
      p2 <- p2 + scale_fill_gradient(
        low = low,
        high = high,
        na.value = NA,
        name = legend_title
      )
    }
    else {
      p2 <- p2 + scale_fill_discrete(na.value = NA, name = legend_title)
    }
    if (colnames) {
      if (colnames_position == "bottom") {
        y <- 0
      }
      else {
        y <- max(p$data$y) + 1
      }
      mapping$y <- y
      mapping[[".panel"]] <- factor("Tree")
      p2 <- p2 + geom_text(
        data = mapping,
        aes(x = to, y = y,
            label = from),
        size = font.size,
        family = family,
        inherit.aes = FALSE,
        angle = colnames_angle,
        nudge_x = colnames_offset_x,
        nudge_y = colnames_offset_y,
        hjust = hjust
      )
    }
    p2 <- p2 + theme(legend.position = "right")
    if (!colnames) {
      p2 <- p2 + scale_y_continuous(expand = c(0, 0))
    }
    attr(p2, "mapping") <- mapping
    return(p2)
  }


text:
Q: How To Make Salesforce LWC work only for New Cases and Not on Existing cases I have a requirement where LWC component is fired everytime when a case is opened,I want to change LWC component to work only for NEW cases,what changes needs to be done in the LWC to make it work only for specific case types which are in NEW status
Here is JS code
    import { LightningElement } from 'lwc';
    import {ShowToastEvent} from 'lightning/platformShowToastEvent';

     export default class CaseTypeInformation extends LightningElement {

    connectedCallback() {
        var toast = new ShowToastEvent({
                 'title': 'Case Type Level 1, level 2 and level 3 fields ',
                 'message': 'must be selected before saving'
             });
             this.dispatchEvent(toast);
       }

    }

here is HTML
    <template>

    </template>

here is metaxml
     <?xml version="1.0" encoding="UTF-8"?>
     <LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>52.0</apiVersion>
    <isExposed>true</isExposed>
    <masterLabel> CaseType Levels Info Component</masterLabel>
    <description> CaseType Levels Info Component.</description>
    <targets>
      <target>lightning__RecordPage</target>
      <target>lightning__AppPage</target>
      <target>lightning__HomePage</target>
     </targets>
    </LightningComponentBundle>

A: Few ways to do it.

*

*Ignore LWC completely. Does it have to be a "toast" at all? You could drop to the page a Rich Text Area field, put some text in red and use conditional display rules. Job done, zero code.

*Similar - still use your component as is, but use the component visibility rules to make it display (run) only on New Cases.

*Edit your component to be something like this
import { LightningElement, api, wire } from 'lwc';
import { ShowToastEvent } from 'lightning/platformShowToastEvent';
import { getRecord } from 'lightning/uiRecordApi';
import CASE_STATUS_FIELD from '@salesforce/schema/Case.Status';

export default class CaseTypeInformation extends LightningElement {
    @api recordId;

    @wire(getRecord, { recordId: '$recordId', fields: [CASE_STATUS_FIELD] }) wiredCase({ error, data }){
        if(data && data.fields.Status.value === 'New'){
            this.dispatchEvent(new ShowToastEvent({
                'title': 'Case Type Level 1, level 2 and level 3 fields ',
                'message': 'must be selected before saving'
            }));
        }
    }
}


text:
Q: asp.net mvc - Namespace in view I place using namespace in a view code behind but i can't call any class of this name space in aspx.
In codebehind:
using MVCTest.Controller;

A: try to use in your aspx / ascx file
<%@ import namespace='your namespace' %>

you could also try to import your namespace in the web.config
<system.web>
  <pages>
    <namespaces>
      <add namespace='you namespace' />
    </namespaces>
  </pages>
</system.web>

A: Did you remember to include the assembly as well? E.g. like this:
// system.web / compilation / assemblies
<add assembly="Microsoft.Web.Mvc"/>

A: Add the import statement If you are using the ASP.NET (C#) engine:
<%@ Import Namespace="My.Namespace.Path" %>

<html goes here>
    ...
</html>

OR
Add the using statement to your view if you are using the Razor engine:
@using My.Namespace.Path

@{
    ViewBag.Title = "My Page";
    ...
}

<html goes here>
   ...
</html goes here>

A: Suppose this is your .Cs file say

namespace MVCTest.Controller {
public class Utility

{
   public static void func1()
   {}
}

}

Try calling the function by : Utility.func1()


text:
Q: Loading content with AJAX from different web server doesn't work in IE I've just realized that my code doesn't work in IE for some reason. Its working fine even in IE on www.wowphonefinder.com, but the idea of the AJAX function is to have control under the content of the menu even on our partners side (www.wirefly.com/...). Even when I put the file on some other location then (wowphonefinder.com) its working perfectly fine in all browsers except IE which keeps returning ,,undefined", but not throwing any error or warning on console.
Also I have this line in giveMenu.php ,,header('Access-Control-Allow-Origin: *');" that should allow me to use that file from different server.
Here is the code:
function dajMeni()
  {
     var url = 'http://www.wowphonefinder.com/AJAX/giveMenu.php';
      $.ajax({
                type: "POST", url: url,
                complete: function(data){
                    alert(data.responseText);
                $("#menu").html(data.responseText);
                }
            });
  }

Hope that my question was clear enough. Thanks in advance for your smart answers! :)

A: You can't use AJAX on cross sites, have a look at JSONP.
(duplicate question: Cross-Domain Requests with jQuery )


text:
Q: В БД кириллица записывается как "?????" Сделал регистрацию на сайте asp.net MVC 5, с использованием EF. При добавлении строки в таблицу, поле с кириллицей записывается как "?????".
Столбец типа NVARCHAR(100), так что проблема не в БД. На HTML-странице использую UTF-8 кодировку, как и файл этого контроллера и самой страницы. Выводит из БД русский текст тоже без проблем.
Может, проблема в самом сервере? Или что-то добавить в Web.config?
Пробовал добавлять в connectionStrings параметр charset=utf8 в разные места, ловил исключения:

*

*The underlying provider failed on ConnectionString.

*Keyword not supported: 'charset'.
Установлена английская Visual Studio Enterprise 2015 (v.14.0.25420.01 Update 3). В настройках проекта: Neutral Language: Russian (Russia)

Код страницы:
@model HotelSystem.hs_users

@{
    Layout = null;
}

<!DOCTYPE html>

    <meta name="viewport" content="width=device-width" />
    <meta charset="utf-8">
    <title>HotelSystem - Регистрация</title>
    @Scripts.Render("~/bundles/modernizr")
    <link href="@Url.Content("~/Content/bootstrap.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/register_form.css")" rel="stylesheet" type="text/css" />

    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/jqueryval")
    @Html.Partial("_Header")
    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })

            <fieldset>

Создание аккаунта

                @Html.EditorFor(model => model.username, new { htmlAttributes = new { @placeholder = "Логин" } })
                @Html.ValidationMessageFor(model => model.username, "", new { @class = "text-danger" })

                @Html.EditorFor(model => model.email, new { htmlAttributes = new { @placeholder = "Email" } })
                @Html.ValidationMessageFor(model => model.email, "", new { @class = "text-danger" })

                @Html.EditorFor(model => model.password, new { htmlAttributes = new { @placeholder = "Пароль" } })
                @Html.ValidationMessageFor(model => model.password, "", new { @class = "text-danger" })

                @Html.EditorFor(model => model.confirmPassword, new { htmlAttributes = new { @placeholder = "Подтверждение пароля" } })
                @Html.ValidationMessageFor(model => model.confirmPassword, "", new { @class = "text-danger" })

                @Html.EditorFor(model => model.fullname, new { htmlAttributes = new { @placeholder = "Полное имя" } })
                @Html.ValidationMessageFor(model => model.fullname, "", new { @class = "text-danger" })

                <input type="submit" name="submit" value="Регистрация" class="submit action-button" />
            </fieldset>

    }

    @Scripts.Render("~/bundles/bootstrap")

Код контроллера:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;

namespace HotelSystem.Controllers
{
    public class userController : Controller
    {
        HotelSystemDatabaseEntities1 db = new HotelSystemDatabaseEntities1();

        ...

        public ActionResult register()
        {
            return View();
        }

        [HttpPost]
        [ValidateAntiForgeryToken]
        public ActionResult register(hs_users U)
        {
            if (ModelState.IsValid)
            {
                U.role = 1;
                U.time = DateTime.Now;
                db.hs_users.Add(U);
                db.SaveChanges();
                ModelState.Clear();
                U = null;
                return RedirectToAction("index", "home");
            }
            return View(U);
        }

        [HttpPost]
        public JsonResult doesUserNameExist(string username)
        {
            int user = 0;
            try
            {
                user = db.hs_users.Count(u => u.username == username);
            }
            catch { }

            if (user == 0)
            {
                return Json(true);
            }
            else
            {
                return Json(false);
            }
        }

        [HttpPost]
        public JsonResult doesEmailAddressExist(string email)
        {
            int user = 0;
            try
            {
                user = db.hs_users.Count(u => u.email == email);
            }
            catch { }

            if (user == 0)
            {
                return Json(true);
            }
            else
            {
                return Json(false);
            }
        }
    }
}

Код модели:
namespace HotelSystem
{
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Web.Mvc;

    public partial class hs_users
    {
        public long ID { get; set; }

        [Required(ErrorMessage = "Заполните поле")]
        [Remote("doesUserNameExist", "user", HttpMethod = "POST", ErrorMessage = "Такой логин уже зарегистрирован")]
        [RegularExpression(@"^(?!.*\.\.)(?!.*\.$)[^\W][\w.]{2,49}$", ErrorMessage = "Некорректный логин")]
        public string username { get; set; }

        [Required(ErrorMessage = "Заполните поле")]
        [StringLength(50, ErrorMessage = "Пароль должен быть от {2} до {1} символов", MinimumLength = 6)]
        [DataType(DataType.Password)]
        public string password { get; set; }

        [Required(ErrorMessage = "Заполните поле")]
        [System.Web.Mvc.Compare("password", ErrorMessage = "Введенные пароли не совпадают")]
        [DataType(DataType.Password)]
        public string confirmPassword { get; set; }

        [Required(ErrorMessage = "Заполните поле")]
        public string fullname { get; set; }

        [Required(ErrorMessage = "Заполните поле")]
        [Remote("doesEmailAddressExist", "user", HttpMethod = "POST", ErrorMessage = "Такой Email уже зарегистрирован")]
        [EmailAddress(ErrorMessage = "Введите корректный Email")]
        public string email { get; set; }

        public System.DateTime time { get; set; }

        public int role { get; set; }
    }
}

Connection string из файла Web.config:
<connectionStrings>
    <add
        name="HotelSystemDatabaseEntities1"
        connectionString="
            metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;
            provider=System.Data.SqlClient;
            provider connection string="
            data source=(LocalDB)\MSSQLLocalDB;
            attachdbfilename=|DataDirectory|\HotelSystemDatabase.mdf;
            integrated security=True;
            multipleactiveresultsets=True;
            application name=EntityFramework""
        providerName="System.Data.EntityClient" />
</connectionStrings>

A: EF кэширует модель базы в момент рефреша. У вас в Model1.edmx/edmx:StorageModels написано следующее:
<Property Name="fullname" Type="varchar" MaxLength="100" Nullable="false" />

И это заставляет EF криво мапить данные.
Рефреш модели на основе базы решает проблему.

A: Если в запросе задается юникодная константа, то перед ней нужно обязательно ставить символ N. Чтобы показать разницу, достаточно простого запроса:
SELECT '致死罪 ANSI', N'致死罪 UNICODE'

??? ANSI   致死罪 UNICODE
Если не указывать N перед константой, то SQL Server будет пытаться искать подходящий символ в ANSI кодировке. Если не найдет, то подставит знак вопроса.


text:
Q: Hola necesit0 hacer un programa en C++ dudas Necesito hacer un menú en el que el usuario debe elegir una opción del menú.
No se saldrá del menú hasta que el usuario seleccione salir (opcion de salir).
Tiene que ser con la función while

A: No te voy a hacer el código porque pienso que así no aprendes tú. Pero te dejo el razonamiento para que puedas hacerlo tú:
1.Utiliza la sentencia do while( es mejor que while en estos casos). Se saldrá del while si opcion==valordesalida. Supon que quieres salir del bucle si el usuario inserta 0, pues seria: do{}while(opcion!=0);
2.Creas una variable opcion que se la pides al usuario dentro del do while.
3.Realizas un switch(opcion) y segun el valor insertado realizas alguna cosa.
4.Usa el caso default para poner algun mensaje de error, porque sería un valor no valido.
Espero haberte ayudado,un saludo.


text:
Q: Interpolation spaces defined by singular value decomposition Let $ X $ and $Y$ be Hilbert space, $A:X \to Y $ compact and injective, $(\sigma_n;v_n,u_n)$ be its singular value decomposition, that is,
$$
Av_n = \sigma_n u_n \\
A^* u_n = \sigma_n v_n
$$
Since $\mathcal{N}(A) = \{ 0 \}$, $ \{ v_n \} $ form a complete orthonormal basis of $X$. Now we define $X_0$ as the completion of $X$ in norm
$$
\Vert x \Vert_{X_0} := (\sum_j \sigma^2_j\vert \langle x, v_j \rangle \vert^2)^{\frac{1}{2}}
$$
Set $\theta = 1-2\mu$, $p=2$,
$$
X_\mu :=[X_0,X]_{\theta,p}, \quad \mu \in (0,\frac{1}{2})
$$
where $[\cdot,\cdot]_{\theta,p}$ denotes the interpolation space.
Question: Can we determine that $X_\mu$ is the completion of $X$ in norm
$$
\Vert x \Vert_{X_\mu} := (\sum_j \sigma^{4\mu}_j\vert \langle x, v_j \rangle \vert^2)^{\frac{1}{2}}
$$
?


text:
Q: PHP- Display data in textarea My goal is to display all emails inside a text area.
<?php
$q = "SELECT * FROM `Clients`";
$userData = mysql_query($q);

while($user = mysql_fetch_assoc($userData)){
    echo $user['Email'];
}
?>

it should echo all info into here:
<input type="text" name="text" >

I get the information fine from the DB, but im not sure how to echo the ALL the data into a SINGLE text field..

A: PHP Code
$userData = mysql_query($q);
$userEmails = array();
while($user = mysql_fetch_assoc($userData)){
    $userEmails[] = $user['Email'];
}

HTML (example with a comma separated email string)
<input type="text" value="<?php echo implode(', ', $userEmails); ?>" />

A: You need to do in following manner:-
<?php
$q = "SELECT * FROM `Clients`";
$userData = mysql_query($q);
$email = array(); // create an array
  while($user = mysql_fetch_assoc($userData)){
       $email[] =  $user['Email']; // assign each email to that array
  }
?>

<textarea><?php echo implode(','$email);?></textarea> // implode the array by `,` now all emails will show wiith `,` seperation.

Note:- this is the way how you need to do. Checking variables and do the necessary changes is on you. thanks.


text:
Q: MS Access VBA DoCmd.TransferText How to Separate Columns? The following line should import a semi-colon ; delimited .csv text file to a table.
DoCmd.TransferText TransferType:=acImportDelim, SpecificationName:=specNote, TableName:="tblImport", FileName:="K:\path\file.csv"

However this puts all the fields in one field.
What is going wrong here?
Any suggestions?
I specified

*

*File format: Delimited

*Field delimiter: ;
I set this through the import wizard and saved this specification. With the wizard all went good.
I want to share the specification but I dont know how to do that?
Many thanks.

A: Is specNote a variable or the name of your specification?
If the latter, try:
DoCmd.TransferText _
TransferType:=acImportDelim, _
SpecificationName:="specNote", _
TableName:="tblImport", _
FileName:="K:\path\file.csv"


text:
Q: Function that copies a file from Sharepoint URL to a local path in Microsoft Access VBA? Hi I have a button in an Access form that loads files from my computers shared network drive but doesnt load files from our sharepoint.
So I'm trying to just create a function that, with a URL and a path, copies the file at the end of the URL and copies it to the path
I don't know if it matters, but my computer has limited internet access so it can only access our sharepoint site and no other websites


text:
Q: bootstrap 4 slider carousel multi carousel inner How can I make all the carousel inner slide by group at the same time when I click the menu of slide 3?
I try to use bootstrap carousel to control all the item slide at the same time but I found it's not working for me. anyone knows?

slide 2

slide 3

Sample


text:
Q: How to store real time data to a database? I have a server which is observing IoT data and I need to store it to a database so that I can build metrics of some kind.
The data is being received on a websocket connection, one piece of data might look something like this:
{
  id: 23,
  type: "light"
  status: "on"
  timestamp: 1607975079
}

There can be a large amount of data being observed and I thought that it may not be a great idea to add each event to the database in real time as it may cause bottlenecks.
Are there strategies with this type of scenarios where I can use an in memory buffer of some kind and then save a chunk of data to the database every 30 minutes?
Is this a sensible approach or are there other ways that this should be handled?

Any suggestions would be appreciated.
Thanks

A: You can use Redis as a buffer, and create a separated worker to save in bulk the data from the buffer to your database.
The idea is shown in the Docker Voting App:
https://github.com/dockersamples/example-voting-app
You can build all the components in node.js, take into account the language mix in the example above is to show Dockers capability.

A: You can create a buffer and add events there. When a certain number of events accumulate upload the buffer to the database.
Pseudocode:
const buffer = [];

event.on('event', data => {
  buffer.push(event);

  if (buffer.length === 10) {
    DataBase
      .bulkCreate(buffer);

    buffer = [];
  }
});

Or you can use Cron:
const buffer = [];

event.on('event', data => {
  buffer.push(event);
};

const job = () => {
  DataBase
    .bulkCreate(buffer);

  buffer = [];
};

cron.schedule('*/30 * * * *', () => {
  job();
}).start();


text:
Q: Using the parameters that are read from excel in the API I have two parameters [username and password]. These two could be read from excel into the API. But when I use these values in the API, I could not get the response in the API. Kindly help me with the solution. Thanks in advance.
I am using excel to read the parameters.
println ("...Fetching Username         : "+Username)
println (".. Fetching Password         : "+Password)
WS.sendRequest(findTestObject('SIT_BDA/LoginAPI',[ ('Username'): Username, ('Password') : Password]))

I wanted to use the username and password which are being read from the excel and get the response in the API.

A: To read XLS you can use Data Files in Katalon Studio. Create a new one and set input file.
To write XLS file you can use Apache POI Java API, which you can set in a custom keyword. There is a detailed tutorial.


text:
Q: NameError: global name is not defined I know there are a bunch of similar questions, but they didn't help me to understand my problem. Also I have 3 modules:
First one is model:
from datetime import datetime
from elixir import *
from run_test import create_db
from sqlalchemy.schema import UniqueConstraint
class ValueTest(Test):
    value = Field(Integer)
    def __init__(self, name, value):
        '''
        Constructor
        '''
        self.name = name;
        self.value = value

If I run the test method from the second module named run_test, there aren't any problems
from model import *
def main():
    test();
def test():
    test = ValueTest("test",2)
if __name__ == "__main__":
    main()

But when I try something like that, I get the the well known error NameError: global name 'ValueTest' is not defined
import run_test
def main():
    run_test.test()
if __name__ == '__main__':
    main()

A: When you import a module, you don't import the names it has imported; you only import the names it defines itself.  You still need to do from model import ValueTest in the last script.
If from foo import * imported every name that foo imported into its own scope, a single import something might also import every symbol in os or sys for example.  It would be a nightmare.

Actually, this is not true.  The symbols imported from the module are only those defined by the __all__ list set in that module.  (If not present, all symbols not starting with _ are indeed imported.)
Thanks Ethan for the correction.

A: The problem is you have circular imports happening.  run_test is importing model, which in turn is importing run_test.  Strange things happen when circular imports are used.  If you can, put the common functions (create_db, in your example) into another module, then model can import it from there and not from run_test.


text:
Q: Tally Values of Each Column I have a List each Object containing a string xvalue:
Object.xvalue = "112"
Object.xvalue = "332"
Object.xvalue = "213"

I want to create a new List that contains the counts of each column:
Object #1: (1,3,2)
 int var1 = 1
 int var2 = 1
 int var3 = 1

Object #2: (1,3,1)
 int var1 = 2
 int var2 = 0
 int var3 = 1

Object #3: (2,2,3)
  int var1 = 0
  int var2 = 2
  int var3 = 1

Is this something that I could do using LINQ?
If not could someone provide some pointers for accomplishing this?

A: I assume you want the following:
var counts = list.Select(s => new
                 {
                     var1 = s.Count(c => c == '1'),
                     var2 = s.Count(c => c == '2'),
                     var3 = s.Count(c => c == '3')
                 });

For a solution scalable to detecting all the possible values, you perhaps need something like this:
var counts = list.Select(s => s.GroupBy(c => c)
                               .ToDictionary(g => g.Key, g => g.Count()));

This would count all the characters in the strings.

A: var input = "112";

var result = input
             .GroupBy(c => c).Select(g => new {Key = g.Key, Count = g.Count()});

After this you can do anything with the values and assign them to any variable you want.

A: OK, so I didn't understand the question correctly at first so my first answer was a little off, here is my second attempt, I decided against doing everything in linq because that can get very confusing very quickly, here is a version that allows any sort of chars, and gives the counts for all columns.
    private class Example
    {
        public string xvalue { get; set; }
    }

    //this will give you matches per column for any amount of chars
    public static Dictionary<char, int[]> GetCount(IEnumerable<Example> matchAgainst,params char[] matches)
    {

        //maybe there is an easier way to do this in linq I am not sure
        List<string> flattenedColumns = new List<string>();
        foreach ( var target in matchAgainst )
        {
            for ( int i = 0 ; i < target.xvalue.Length ; i++ )
            {
                if ( flattenedColumns.Count <= i )
                {
                    flattenedColumns.Add ( string.Empty );
                }
                flattenedColumns [ i ] += target.xvalue [ i ];
            }
        }

        //now compose based on the chars
        return ( from c in matches
                 select new
                     {
                         CharTarget = c ,
                         Counts = ( from col in flattenedColumns
                                    select col.Count ( ( ch ) => ch == c ) ).ToArray ( )
                     } ).ToDictionary ( rslt => rslt.CharTarget , rslt => rslt.Counts );
    }

    public static void Do ( )
    {
        string curr = "";
        List<Example> exampleList = new List<Example> ( );
        for(int i=0;i<10;i++)
            for(int j=0;j<10;j++)
                for ( int k = 0 ; k < 10 ; k++ )
                {
                    curr= i+""+j+""+k;
                    exampleList.Add ( new Example { xvalue = curr } );
                }

        var matches = GetCount ( exampleList , '1' , '2' , '3' );
        var var1Col1 = matches [ '1' ] [ 0 ];
        var var2Col1 = matches [ '2' ] [ 0 ];
        //...
    }

NOTE:
I am not sure if this is the best way to flatten the columns but it seemed like the most straight forward.
And this is a more generic version, where I am assuming that the columns are just arrays of object, to flatten the columns I just use aggregate and a privately defined class that represents if an object has been turned into an
private class Row
{
    public object[] Columns {get;set;}
}

public static Dictionary<object, int[]> GetCountByIndex(IEnumerable<Row> matchAgainst, params object[] matches)
{
    bool firstTime = true;
    return
    ( from key in matches
        let flatCols = ( from Row row in matchAgainst select row.Columns ).Aggregate ( ( a , b ) =>
        {
            var retlen = a.Length;

            if ( b.Length > a.Length )
                retlen = b.Length;

            object [ ] retv = new object [ retlen ];
            //use bool flag to determine first time objects are being aggregated
            if (!firstTime)
            {
                //do every other join
                for ( int i = 0 ; i < retlen ; i++ )
                {
                    List<object> curr = null;
                    if ( i >= a.Length )
                    {
                        curr = new List<object> ( );
                    }
                    else
                    {
                        curr = a [ i ] as List<object>;
                    }
                    if ( i < b.Length )
                    {
                        curr.Add ( b [ i ] );
                    }
                    retv [ i ] = curr;
                }

            }
            else
            {
                //intialization
                for ( int i = 0 ; i < retlen ; i++ )
                {
                    List<object> curr = new List<object>( );
                    if ( i < a.Length )
                    {
                        curr.Add ( a [ i ] );
                    }
                    if ( i < b.Length )
                    {
                        curr.Add ( b [ i ] );
                    }
                    retv [ i ] = curr;
                }
                firstTime = false;

            }
            return retv;
        } )
        select new
        {
            Key = key ,
            Value = ( from object obj in flatCols
                    select ( ( List<object> ) obj ).Count ( c => key.Equals ( c ) ) ).ToArray ( )

        } ).ToDictionary ( keySel => keySel.Key , valSel => valSel.Value );
}


text:
Q: Error Jenkins, Could not transfer artifact org.jfrog.jade.plugins.common: Error when push source code in kubernetes, error jenkins show
Could not transfer artifact org.jfrog.jade.plugins.common:jade-plugin-common:pom:1.3.8 from/to bintray-nitram509-jbrotli (http://dl.bintray.com/nitram509/jbrotli): Access denied to: http://dl.bintray.com/nitram509/jbrotli/org/jfrog/jade/plugins/common/jade-plugin-common/1.3.8/jade-plugin-common-1.3.8.pom
image
But, when i build my project by mvn clean install in return build succes,  but in jenkis it shows error build failed
How to fix this error ? because when i click the link suggest, it shows forbidden
pom.xml

4.0.0
org.idx
lmsadmin
war
0.0.1-SNAPSHOT
lmsadmin Maven Webapp
http://maven.apache.org

org.springframework.boot
spring-boot-starter-parent
1.5.2.RELEASE

<build>
<plugins>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>3.3.1</version>
</plugin>
</plugins>
</build>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>

    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.session</groupId>
        <artifactId>spring-session-data-redis</artifactId>
        <version>1.3.1.RELEASE</version>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>4.3.7.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>net.bull.javamelody</groupId>
        <artifactId>javamelody-spring-boot-starter</artifactId>
        <version>1.74.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.3.6</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpasyncclient</artifactId>
        <version>4.0.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.3.6</version>
    </dependency>

    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20140107</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.1</version>
    </dependency>
    <dependency>
        <groupId>com.mashape.unirest</groupId>
        <artifactId>unirest-java</artifactId>
        <version>1.4.9</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.2</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.5</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.directory.studio</groupId>
        <artifactId>org.apache.commons.io</artifactId>
        <version>2.4</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml</groupId>
        <artifactId>classmate</artifactId>
        <version>1.3.3</version>
    </dependency>

    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.3.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.15</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.15</version>
    </dependency>
    <dependency>
        <groupId>net.sourceforge.jexcelapi</groupId>
        <artifactId>jxl</artifactId>
        <version>2.6.12</version>
    </dependency>
    <dependency>
        <groupId>com.itextpdf</groupId>
        <artifactId>itextpdf</artifactId>
        <version>5.4.2</version>
    </dependency>
    <dependency>
        <groupId>com.itextpdf.tool</groupId>
        <artifactId>xmlworker</artifactId>
        <version>5.4.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox-tools</artifactId>
        <version>2.0.3</version>
    </dependency>
    <dependency>
        <groupId>net.sf.cssbox</groupId>
        <artifactId>pdf2dom</artifactId>
        <version>1.6</version>
    </dependency>
</dependencies>

<properties>
    <java.version>1.8</java.version>
</properties>


text:
Q: problem in installing rails hi all i am getting problem while installing rails in  by gem :
i have written in terminal

gem install rails

Successfully installed rails-3.0.3
1 gem installed
Installing ri documentation for rails-3.0.3...
File not found: lib

what i need to do next and how to install rails using gem.

A: I had the same problem. I continued with the error. I do not see anything breaking. And I can code peacefully. So, probably you do not need to worry.

sudo apt-get install build-essential libopenssl-ruby libfcgi-dev
sudo apt-get install ruby irb rubygems ruby1.8-dev
sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install rails
sudo gem install sqlite3-ruby

If you dont find path do this: (for Unix based systems)
Quoted from the book, but anyone else would suggest the same
If you can't find the rails command, you may need to add
/var/lib/gems/1.8/bin to your PATH environment variable.
 You can do this by adding a line to your .bashrc file:

export PATH=/var/lib/gems/1.8/bin:$PATH

OK as aditya sanghi has mentioned, I do lack rdoc gem-- so probably running this will help
gem install rdoc rails

A: I've seen this error when you dont have the "rdoc" gem installed. Can you do a "gem list" and show us a list of gems installed?
Try running "gem install rdoc rails".


text:
Q: How to disable IE message for reference information with JavaScript? How to disable IE (browsers) message for reference information with JavaScript?
this is the situation:
I have a form that i submit, after submitting i reload the page and appears the following message :
"To display this page Firefox has to resend information that will repeat previous actions (such as a demand or confirmation of an order)."
i need help...
Thanks
ps: sorry I'm not English :)

A: Take a look at the POST/Redirect/GET pattern.

A: This message appears whenever you reload a page that was received from an HTTP POST.
It appears because HTTP POSTs are intended to be non-repeatable.
For example, if you buy something online, the website will usually send an HTTP POST to its server saying that you spent X dollars.  Without that warning, it would be possible for Firefox or IE to automatically reload the page, sending a second HTTP POST.  This would tell the server that you spent X dollars a second time, and would make you very angry.  Therefore, the browsers have that warning.
To get rid of it, change your page to an HTTP GET.
For example:
<form method="GET">

Alternatively, you can keep it an HTTP POST, and have the server send a redirect in response to the POST, telling the browser to send an HTTP GET to a separate page.  This means that you don't have the risk of sending the request twice, as I described above.


text:
Q: Export Python Arrays to Matlab I am a beginner with Python and I am encountering the following problem.
I deal with sensors data. Each sensor gives me a np.array with varying size (n,p). For the moment, I just add the new array into a list, and then convert this list in a array, which gives an array of arrays.
I would like to export the final result (equivalent to a multi-dimensionnal array with variable size) in a written file that I want to be readable in Matlab to test advanced algorithms on it.
My question is the following : is there a better way to collect the data to export it in Matlab? And what could be a possible way to write a Matlab readable file from this multi-dimensional array?

A: Yes there is a better way : use scipy !!
Then you can use savemat method to "Save a dictionary of names and arrays into a MATLAB-style .mat file"
the code would be something like this:
import numpy, scipy.io
your_array = a multi dimential matrix
scipy.io.savemat('your direction and name', mdict={'arr': your_array})