text:
Q: MySQL Query is updating the database BUT NOT the DataGridView control? I've been studying and trying to teach myself VB.net coding and MySQL from this site: http://www.vbmysql.com/articles/vbnet-mysql-tutorials/the-vbnet-mysql-tutorial-part-4
Thus far I've been successful in grasping all the concepts and following along the code, however, I'm running into a problem with the query I'm calling on one of my buttons.  I'm not getting an error - as I would expect - and it appears the query is updating the database appropriately (this is because I can log into the database and see the entries).
The problem is that the when I call the .Refresh method on the DataGridView control, the content from the database isn't being pulled in.
Is this an error with the query or is it something else?
Here's the entire code of the form (frmMain):
Imports MySql.Data.MySqlClient
Imports System.Data

Public Class frmMain

Private myConnString As String
Private myUserID As Integer

Public WriteOnly Property connectionString() As String
    Set(ByVal value As String)
        myConnString = value
    End Set
End Property

Public WriteOnly Property UserID() As Integer
    Set(ByVal value As Integer)
        myUserID = value
    End Set
End Property

Private Sub cmdRefresh_Click(sender As System.Object, e As System.EventArgs) Handles cmdRefresh.Click

    Dim conn As New MySqlConnection
    Dim myCommand As New MySqlCommand
    Dim myAdapter As New MySqlDataAdapter
    Dim myData As New DataTable
    Dim SQL As String

    SQL = "SELECT CONCAT(u.lastname, ', ', u.firstname) AS Name, s.message AS Message, " _
        & "DATE_FORMAT(e.timestamp, '%b %d %Y - %r') AS 'Date & Time', e.status AS Status " _
        & "FROM event e LEFT JOIN status s ON e.message_id = s.message_id, user u " _
        & "WHERE(e.user_id = u.user_id) " _
        & "AND event_id IN( " _
        & "SELECT MAX(e.event_id) " _
        & "FROM event e " _
        & "GROUP BY e.user_id) " _
        & "ORDER BY Name"

    conn.ConnectionString = myConnString

    Try
        conn.Open()
        Try
            myCommand.Connection = conn
            myCommand.CommandText = SQL
            myAdapter.SelectCommand = myCommand
            myAdapter.Fill(myData)
            dgvStatus.DataSource = myData
            dgvStatus.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
            dgvStatus.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells
        Catch myerror As MySqlException
            MessageBox.Show("There was an error reading from the database: " & vbCrLf & myerror.Message)
        End Try
    Catch myerror As MySqlException
        MessageBox.Show("Error Connecting to Database: " & vbCrLf & myerror.Message)
    Finally
        If conn.State <> ConnectionState.Closed Then
            conn.Close()
        End If
    End Try

End Sub

Private Sub frmMain_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    cboStatus.Items.Add("In")
    cboStatus.Items.Add("Out")
    cboStatus.SelectedIndex = 0

    dgvStatus.ReadOnly = True

    Dim conn As New MySqlConnection
    Dim myCommand As New MySqlCommand
    Dim myAdapter As New MySqlDataAdapter
    Dim myData As New DataTable
    Dim SQL As String

    SQL = "SELECT s.message_id, s.message " _
        & "FROM tutorial.status s " _
        & "WHERE user_id IS NULL and deleted = 'False'"

    conn.ConnectionString = myConnString

    Try
        conn.Open()
        Try
            myCommand.Connection = conn
            myCommand.CommandText = SQL
            myAdapter.SelectCommand = myCommand
            myAdapter.Fill(myData)
            cboMessage.DataSource = myData
            cboMessage.DisplayMember = "message"
            cboMessage.ValueMember = "message_id"
        Catch myerror As MySqlException
            MessageBox.Show("There was an error reading from the database: " & vbCrLf & myerror.Message)
        End Try
    Catch myerror As MySqlException
        MessageBox.Show("Error Connecting to Database: " & vbCrLf & myerror.Message)
    Finally
        If conn.State <> ConnectionState.Closed Then
            conn.Close()
        End If
    End Try

End Sub

Private Sub cmdUpdate_Click(sender As System.Object, e As System.EventArgs) Handles cmdUpdate.Click
    Dim conn As New MySqlConnection
    Dim myCommand As New MySqlCommand

    conn.ConnectionString = myConnString

    myCommand.Connection = conn
    myCommand.CommandText = "INSERT INTO event(user_id, message_id, timestamp, status, creator)" _
        & "VALUES(?UserID, ?MessageID, NOW(), ?Status, ?Creator);"
    myCommand.Parameters.AddWithValue("?UserID", myUserID)
    myCommand.Parameters.AddWithValue("?MessageID", cboMessage.SelectedValue)
    myCommand.Parameters.AddWithValue("?Status", cboStatus.SelectedItem)
    myCommand.Parameters.AddWithValue("?Creator", myUserID)

    Try
        conn.Open()
        myCommand.ExecuteNonQuery()
    Catch myerror As MySqlException
        MessageBox.Show("There was an error updating the database: " & vbCrLf & myerror.Message)
    Finally
        If conn.State <> ConnectionState.Closed Then
            conn.Close()
        End If
    End Try

    cmdRefresh.PerformClick()

End Sub

End Class

A: You need to re-bind the datasource. After:
dgvStatus.DataSource = myData

put
dgvStatus.ResetBindings()

A: It appears I solved my own problem.  While instantiating my main form (frmMain), I neglected one line of code that was intended to pass the UserID parameter from the Login form (frmLogin) to the main form.
I inserted the following line:
mainForm.UserID = UserID

Thanks again.


text:
Q: Build Server - install external control libraries (DevExpress) on build server what's the right way?
We have one build server for our projects.
We have different projects, wich reference different versions of DevExpress.

*

*Should we install every DevExpress
Version on the build server    or

*should every project have its own
folder with DevExpress assemblies.

*Exists an other possible way?

In my opinion:
Advantage 1: It is easier for every developer to maintain his local copy of the project.
Disadvantage 1: DevExpress version hell on build sever because every new release must be installed.
Advantage 2: Every project could be builded without prerequisite.
Disadvantage 2: Every developer must manually put his dlls in a separate Libs folder. If you have dragged a DevExpress control from the toolbox, you must reorganize your references for this dlls.

A: Best solution and hassle free with build servers is to have a shared folder in the source control where you keep the devexpress assemblies or different folders if you use different devexpress versions in different projects and reference those assemblies in the projects. In addition to the devexpress dlls add also App_Licenses.dll to that folder and reference it in all projects that use devexpress assemblies. This when a new version of devexpress is out you need just to update those DLLs instead of installing every time a new devexpress version and this way you can also revert to a previous version in case of a blocker bug or even run different devexpress ver on the same machine.
This solution works perfect with Hudson build integration server and svn.
If you want to make things even easier at new devexpress updates and do not want to run each time project converter to update the version number in the references exclude from you references ', Version=10.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a' so instead of:
<%@ Register TagPrefix="dxe" Namespace="DevExpress.Web.ASPxEditors" Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>
your ref would look like this:
<%@ Register TagPrefix="dxe" Namespace="DevExpress.Web.ASPxEditors" Assembly="DevExpress.Web.ASPxEditors.v10.2" %>
this way you'll need to run the project converter quite rarely when the assembly name changes through major version changes to eg. 11.1

A: I would suggest that you install our installations on the Build server.  There will not be a DLL hell on your machine if you install only installation.  This will guarantee, that your project will be built using a licensed version of our controls and thus no nag screens in a ready built application.  This is what we usually suggest when our customers ask such questions in the support center...

A: Best solution is not to have to install the full product on your build servers.  Instead you can just get it 'licensed' on the server.
Start the installer on your build machine, login to the installer, when your list of products come up, exit the installer.
Now your builds will be authorized!

redpajama_set_name: RedPajamaStackExchange


text:
Q: Doxygen: why is the first element of my enum class not properly copied with copydoc? I have the following code:
/**
 * @brief OpenGL renderer rescale types
 */
enum class RescaleType {
    None, //!< No rescale
    Horizontal, //!< Rescale horizontally
    Vertical, //!< Rescale vertically
    Both //!< Rescale both
};

/**
 * @brief
 *
 * @param type Type of rescaling to apply. It can be one of the following:
 * - RescaleType::None @copydoc RescaleType::None
 * - RescaleType::Horizontal @copydoc RescaleType::Horizontal
 * - RescaleType::Vertical @copydoc RescaleType::Vertical
 * - RescaleType::Both @copydoc RescaleType::Both
 */
void    apply_rescale(RescaleType type);

When running doxygen, everything works fine except the first @copydoc

What am I doing wrong here ? I am new to using Doxygen so maybe the mistake is obvious.
Edit: This was generated with Doxygen 1.9.2

A: For those wondering: this was a bug and was fixed in commit ab74ff26b0f9ba3f31d1dce605c4a1809ca9cb5c and is now part of Doxygen release 1.9.3. Huge thanks to @albert for lightning fast patching :-)


text:
Q: Ubuntu 14.04 LTS Supports Facebook messenger ??... How to install facebook messenger app I installed ubuntu 14.04 LTS yesterday.
While using facebook through browser, it asked whether to install facebook app or not. I said yes and its installed.
But while trying to open the facebook from the icon created on the desktop side bar, it just pops up and displays the initial facebook screen and then hangs. The whole linux hangs and not able to kill any process.. only restart is the possible option.
Also I tried to access the root folder. It says u dont have permission. How to get root permission?. I am the only one user.

A: I think Ubuntu's web app integration has changed in 14.04. When you create a web app for a service like Gmail, Facebook, Ubuntu will now use the same browser used on Ubuntu Mobile. This theoretically makes web apps more consistent between the desktop and mobile versions of Ubuntu, but it's a problem if you actually want to use these apps. This browser doesn't work anywhere near as well and doesn't even have access to the Flash plug-in.
If you want launcher icons for your favorite web apps, you should probably skip Ubuntu's native integration features. Instead, install the Chromium or Chrome web browsers and use the Tools > Create application shortcuts menu option to create launcher icons and separate windows for your preferred web apps.

*

*If you want to uninstall it--

Go to the Software Center and search for the specific web app and uninstall it. E.g.
unity-webapps-gmail or unity-webapps-googledocs

*

*After uninstall you can add it manually using

*

*Open a terminal window.

*Type in the following commands then hit Enter after each.

sudo add-apt-repository ppa:noobslab/apps-dependencies
sudo add-apt-repository ppa:folke-schwinning/personal
sudo apt-get update
sudo apt-get install desktop-facebook
sudo add-apt-repository -r ppa:noobslab/apps-dependencies

I think this will work better...
Thanks


text:
Q: How to launch MobaXterm from right-click context menu on Windows 10 Just like Shift+Right-Click to open a command prompt in that folder, I want to replace the command prompt with MobaXterm on Windows platform

A: Under the settings menu, click on the configuration option. A dialog box should appear with several tabs for various settings. In the General tab, there is an option for Right-click menu on Windows folders.
If they are already set up, it will ask if you want to uninstall the right-click option.

A: In addition to @Herb response, if you want the "Open MobaXterm terminal here" context menu option when right-clicking on the directory background (instead of right-clicking a folder only) you can do add the Windows registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\OpenWithMobaXterm]
@="Open MobaXterm terminal here"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\OpenWithMobaXterm\command]
@="\"C:\\Program Files (x86)\\Mobatek\\MobaXterm\\MobaXterm.exe\" -openfolder \"%v\""


text:
Q: How to Sum Multiple Rows for same value in Excel using a macro with data manipulation I am very novice when it comes to macros and need your help. I need help creating a macro to sum multiple rows for same value into one cell. Here is what I am looking for
Project #  Impacted LOB  Hrs

1111       Operation     500
1111       Operation-IT  1000
1111       Marketing     5000
1111       Marketing-IT  1000
2222       Operation- IT 100
2222       Operation     200
2222       Marketing     200
2222       Marketing-IT  5000

What I am expecting is the following:
PROJECT   IT HOURS NON IT HOURS
1111       2000    5500
2222       5100    400

Below the code I have but the problem is I am not getting one row for each project with totals
Sub First_Macro()
'Dont display delete button:
Application.DisplayAlerts = False
'************ VARIABLES ****************
    'Starting row to analyze:
    StartRow = 5

    'Total rows to analyze:
    NumCols = 80000

    'New worksheet name:
    Dim New_Worksheet_Name As String
    New_Worksheet_Name = "CCB PPL EXTRACT"

    'CCB PPL Extract worksheet name:
    Dim Plan_Worksheet_Name As String
    Plan_Worksheet_Name = "PPL Project Estimates"

     'New worksheet for summary:Total Summary sheet with graph
    Dim New_Worksheet_Summary_Name As String
    New_Worksheet_Summary_Name = "Analyze HRSs Summary"

'*********end variables********
Dim sh As Worksheet, flg As Boolean
'Add Concept Vs. Requirements worksheet:

flg = False
For Each sh In Worksheets
    If sh.Name Like New_Worksheet_Name Then flg = True: Exit For
    'If sh.Name Like BE_Worksheet_Name Then flg = True: Exit For
Next
If flg = True Then
    Sheets(New_Worksheet_Name).Delete
End If
Dim NEW_WS As Worksheet
Set NEW_WS = ThisWorkbook.Sheets.Add(After:= _
     ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
NEW_WS.Name = New_Worksheet_Name

Dim NEW_SUM_WS As Worksheet
Set NEW_SUM_WS = ThisWorkbook.Sheets.Add(After:= _
     ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
NEW_SUM_WS.Name = New_Worksheet_Summary_Name

'GET DATA:
Dim Plan_WS As Worksheet
Set Plan_WS = Worksheets(Plan_Worksheet_Name)
'Set headers in new worksheet:
NEW_WS.Cells(1, 1).Value = "DM ID                                                                                "
NEW_WS.Cells(1, 2).Value = "PROJECT TITLE"
NEW_WS.Cells(1, 3).Value = "STATUS"
NEW_WS.Cells(1, 4).Value = "IMPACTED LOB"
NEW_WS.Cells(1, 5).Value = "CONCEPT HRS"
NEW_WS.Cells(1, 6).Value = "REQUIREMENT HRS"
NEW_WS.Cells(1, 7).Value = "RELEASE DATE"

Dim DM_ID_Array(1 To 20000) As String
Dim DM_PROJECT_TITLE_Array(1 To 20000) As String
Dim DM_PROJECT_STATUS_Array(1 To 20000) As String
Dim DM_CONCEPT_CARD_IT_TOTAL_HRS_Array(1 To 20000) As String
Dim DM_REQ_CARD_IT_TOTAL_HRS_Array(1 To 20000) As String
Dim DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(1 To 20000) As String
Dim DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(1 To 20000) As String
Dim DM_CONCEPT_CARD_BUS_TOTAL_HRS_Array(1 To 20000) As String
Dim DM_REQ_CARD_BUS_TOTAL_HRS_Array(1 To 20000) As String
Dim DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(1 To 20000) As String
Dim DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(1 To 20000) As String
Dim DM_ID_Index As Long
DM_ID_Index = 0

'Loop through rows in colum:
Dim j As Long
j = 1
h = 2
prev_dm_id = Plan_WS.Cells(StartRow, 1).Value
For i = StartRow To NumCols
    DM_ID = Plan_WS.Cells(i, 1).Value
    PROJECT_TITLE = Plan_WS.Cells(i, 6).Value
    Status = Plan_WS.Cells(i, 7).Value
    lob = Plan_WS.Cells(i, 10).Value
    concept_hrs = Plan_WS.Cells(i, 17).Value
    req_hrs = Plan_WS.Cells(i, 19).Value
    release_date = Plan_WS.Cells(i, 39).Value
    If Status = "15. Commitment Complete" Then
        NEW_WS.Cells(h, 1).Value = DM_ID
        NEW_WS.Cells(h, 2).Value = PROJECT_TITLE
        NEW_WS.Cells(h, 3).Value = Status
        NEW_WS.Cells(h, 4).Value = lob
        NEW_WS.Cells(h, 5).Value = concept_hrs
        NEW_WS.Cells(h, 6).Value = req_hrs
        NEW_WS.Cells(h, 7).Value = release_date

        If DM_ID = prev_dm_id Then
            prev_dm_id = DM_ID
            DM_ID_Index = DM_ID_Index + 1
            DM_ID_Array(DM_ID_Index) = DM_ID
            DM_PROJECT_TITLE_Array(DM_ID_Index) = PROJECT_TITLE
            DM_PROJECT_STATUS_Array(DM_ID_Index) = Status
            DM_CONCEPT_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = 0
            DM_REQ_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = 0
            DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = 0
            DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = 0
            DM_CONCEPT_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = 0
            DM_REQ_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = 0
            DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = 0
            DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = 0
            '*****************************************************
            If lob = "Auto Finance" Then
             DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
             DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Auto Finance IT" Then
              DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CARD Business" Then
              DM_CONCEPT_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CARD Canada Business" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CARD Canada IT" Then
              DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CARD Commercial Card IT" Then
              DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CARD Technology" Then
              DM_CONCEPT_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CBB TECHNOLOGY" Then
              DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CCB Architecture, Data, Quality & Chief Development Office" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs

            End If
            If lob = "CCB Operations" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CCB Risk Management" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CHASE WEALTH MGMT" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Commerce Solutions" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Commerce Solutions Technology" Then
              DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CONSUMER AND COMMUNITY BANKING" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CONSUMER BANKING" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "CORPORATE SECTOR" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Digital" Then
               DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
               DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Digital Technology" Then
              DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Infrastructure Risk and Controls" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Marketing Services" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Mortgage Banking" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Mortgage Banking Technology" Then
              DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "OPERATIONS TECHNOLOGY" Then
              DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Student Loans" Then
              DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
            If lob = "Student Loans IT" Then
              DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + concept_hrs
              DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) = DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(DM_ID_Index) + req_hrs
            End If
         End If
End If

    h = h + 1
'End If
Next
'summarize columns
NEW_SUM_WS.Cells(1, 1).Value = "Committed Totals by DM ID"
NEW_SUM_WS.Cells(2, 1).Value = "DM ID "
NEW_SUM_WS.Cells(2, 2).Value = "PROJECT TITLE"
NEW_SUM_WS.Cells(2, 3).Value = "STATUS"
NEW_SUM_WS.Cells(2, 4).Value = "CONCEPT-BUS HRS"
NEW_SUM_WS.Cells(2, 5).Value = "REQ-BUS HRS"
NEW_SUM_WS.Cells(2, 6).Value = "CONCEPT-CARD IT HRS"
NEW_SUM_WS.Cells(2, 7).Value = "REQ-CARD IT HRS"
NEW_SUM_WS.Cells(2, 8).Value = "CONCEPT-NON CARD IT HRS"
NEW_SUM_WS.Cells(2, 9).Value = "REQ-NON CARD IT HRS"
NEW_SUM_WS.Cells(2, 10).Value = "CONCEPT-NON CARD BUS HRS"
NEW_SUM_WS.Cells(2, 11).Value = "REQ-NON CARD BUS HRS"
NEW_SUM_WS.Cells(2, 12).Value = "COMMITMENT DATE"

 Dim jj As Long
jj = 1
For i = 1 To UBound(DM_ID_Array)
    If Len(DM_ID_Array(i)) Then
        NEW_SUM_WS.Cells((2 + i), 1).Value = DM_ID_Array(i)
        NEW_SUM_WS.Cells((2 + i), 2).Value = DM_PROJECT_TITLE_Array(i)
        NEW_SUM_WS.Cells((2 + i), 3).Value = DM_PROJECT_STATUS_Array(i)
        NEW_SUM_WS.Cells((2 + i), 4).Value = DM_CONCEPT_CARD_IT_TOTAL_HRS_Array(i)
        NEW_SUM_WS.Cells((2 + i), 5).Value = DM_REQ_CARD_IT_TOTAL_HRS_Array(i)
        NEW_SUM_WS.Cells((2 + i), 6).Value = DM_CONCEPT_NON_CARD_IT_TOTAL_HRS_Array(i)
        NEW_SUM_WS.Cells((2 + i), 7).Value = DM_REQ_NON_CARD_IT_TOTAL_HRS_Array(i)
        NEW_SUM_WS.Cells((2 + i), 8).Value = DM_CONCEPT_CARD_BUS_TOTAL_HRS_Array(i)
        NEW_SUM_WS.Cells((2 + i), 9).Value = DM_REQ_CARD_BUS_TOTAL_HRS_Array(i)
        NEW_SUM_WS.Cells((2 + i), 10).Value = DM_CONCEPT_NON_CARD_BUS_TOTAL_HRS_Array(i)
        NEW_SUM_WS.Cells((2 + i), 11).Value = DM_REQ_NON_CARD_BUS_TOTAL_HRS_Array(i)
        jj = jj + 1
    End If
 Next i
 End Sub

Thank you very much for your help

A: Use this formula in column D: =if(not(iserr(find("IT", $B2, 1))),"IT HOURS","NON IT HOURS")

Highlight your entire table, go to INSERT > PIVOT TABLE
It will add a new sheet with a Pivot table to your workbook.
With the Pivot table options, add Project to row labels, Type to column labels, and Hrs to values (make a sum).

This should do the sums automatically based on the breakdown by type that you defined.

A: Consider an SQL solution as this is a classic conditional aggregate query. MS Excel can run SQL on its own workbook using the Windows built-in Jet/ACE SQL Engine (.dll file) which is available to all MS Office products, not just a restricted technology for Excel's database sibling, MS Access. Below is the SQL query embedded as string in VBA macro.
SQL Query (using wildcard match on "IT"; incorporate for other searches)
SELECT [Project #]
       SUM(IIF([Impacted LOB] LIKE '%Operation%',
               [Hrs], NULL)) As [IT HOURS]
       SUM(IIF([Impacted LOB] NOT LIKE '%-IT%',
               [Hrs], NULL)) As [NON IT HOURS]
FROM DataTable
GROUP BY [Project #];

Worksheet Setup (structure data much like database tables with columns in first row and same data types; create DATA and RESULTS tabs and leave latter to be populated with macro)

VBA Macro (another connection string commented out)
Sub RunSQL()
On Error GoTo ErrHandle
    Dim conn As Object, rst As Object
    Dim strConnection As String, strSQL As String
    Dim i As Integer, fld As Object

    Set conn = CreateObject("ADODB.Connection")
    Set rst = CreateObject("ADODB.Recordset")

    ' Hard code database location and name
'    strConnection = "DRIVER={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};" _
'                      & "DBQ=C:\Path\To\Workbook.xlsm;"
    strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;" _
                       & "Data Source='C:\Path\To\Workbook.xlsm;" _
                       & "Extended Properties=""Excel 8.0;HDR=YES;"";"

    strSQL = "SELECT [DATA$].[Project #], " _
              & "     SUM(IIF([DATA$].[Impacted LOB] Like '%Operation%', [DATA$].[Hrs], NULL)) As [IT HOURS]," _
              & "     SUM(IIF([DATA$].[Impacted LOB] NOT LIKE '%-IT%', [DATA$].[Hrs], NULL)) As [NON IT HOURS]" _
              & " FROM [DATA$] " _
              & " GROUP BY [DATA$].[Project #];"

    ' Open the db connection
    conn.Open strConnection
    rst.Open strSQL, conn

    ' column headers
    i = 0
    Worksheets("RESULTS").Activate
    Worksheets("RESULTS").Range("A1").Activate
    For Each fld In rst.Fields
        ActiveCell.Offset(0, i) = fld.Name
        i = i + 1
    Next fld

    ' data rows
    Worksheets("RESULTS").Range("A2").CopyFromRecordset rst

    rst.Close
    conn.Close

    MsgBox "Successfully ran SQL query!", vbInformation
    Exit Sub

ErrHandle:
    MsgBox Err.Number & " = " & Err.Description, vbCritical
    Exit Sub
End Sub


text:
Q: Angular 3 dropDown to select birth day I want to display 3 dropDowns : day,month, and year.
in order to select a birthDay.
Angular.ui datePicker has no this option.Is there any other way to do it?

A: You could make use of angular-date-dropdowns library or Combodate library
I would prefer you use angular-date-dropdowns.. Here is an example:
<input rsmdatedropdowns ng-model="dob" />


text:
Q: Model binding on GET request using Web API? Using ASP.NET MVC 4 Web API
public IEnumerable<Item> GetAll(GetItemRequest request) {

This throws an error, Object reference not set to an instance of an object., where request is null.
public IEnumerable<Item> GetAll(int itemId) {

This works just fine, where itemId is non-null.
GetItemRequest model has a single property, public int itemId { get; set; }
What am I missing?

A: Try this:
public IEnumerable<Item> GetAll([FromUri] GetItemRequest request) {


text:
Q: I have one requirement in which I need to print a web page(actually a jsp page created using struts 1.3 ) using brower's print option I have one requirement in which I need to print a web page(actually a jsp page created using struts 1.3 ) using browser's print option in such a way that buttons which are there on that webpage should look little darker in print or in pdf(when we use save as pdf).
I had tried below code inside head tag:
<style>
  @media print {
    .light {color: #000 !important; }
  }
</style>

I put the buttons inside a div and tried to apply .light class on that dive so that only during print or saving it as pdf buttons should be visible darker.
buttons code is as below (struts bean tag is used here):
     <div class="light">
       <bean:message key="button.internet.request.update" />
     </div>
   <% } %>
   </html:submit>
 <% } %>

so I added line no. 1 and 3 just for putting the button code inside a div and applied that .light class. But it didn't work.
Help me appling the css code in bean tag so that button gets printed darker on print page or visible darker in pdf.
Images for proper button and disturbed button I have attached. Proper here means before applying my code and disturbed one is for after applying my code which didn't work.


text:
Q: Can't use Self hosted SonarQube on Azure DevOps Pipelines I am currently trying to integrate SonarQube into my CI/CD pipeline. But I ran into an error.
When setting up I used my own domain to go to my SonarQube instance. For this thread I will use this:
sonar.mydomain.com as my host. This host has a CNAME Record to another domain that uses an IPv6 address.
When I use this domain I get this error: ENOTFOUND and if I use the IPv6 address I get this error: ENETUNREACH. Right now I have used the IPv4 address, but this will regularly change.
So my question now is this. Why is this happening and how (if possible) can you solve it.
If further details are needed please leave a comment.
EDIT:
I forgot to add something. I have tested my domain with curl and it said that it couldn't resolve my domain.
Solution:
I figured something out. In my situation, I didn't use a DDNS provider for my domain name. So the IP address wouldn't be reachable (Also due to it being IPv6 only). I fixed it by using DuckDNS for my DDNS Provider.
Thanks to all the people that helped me resolve this issue.

A:

I have tested my domain with curl and it said that it couldn't resolve my domain.

It seems that there is something wrong with your domain, please contact IT depart to resolve it.
In addition, you could identify the possible IP ranges for Microsoft-hosted agents and then allow them.
Also, if your organization is secured with a firewall or proxy server, you need to add certain IP addresses and domain URLs to the Allow list.
BTW, Microsoft-hosted agents don't support IPV6 as this suggestion ticket earlier reported. Thus we suggest that you use IPV4 address.


text:
Q: Uploading .txt files to firebase storage from Unity C# So far, after some research from the internet I have been able to select .jpeg files from the computer and upload it to the firebase using Unity C#.
But, I cannot figure out, how I should modify the code below to use it for uploading .txt files as well.
If there is some other simpler way to do this task please tell that (if any). Otherwise, tell how I should modify this code so that it fulfills the purpose mentioned above.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;

//For Picking files
using System.IO;
using SimpleFileBrowser;

//For firebase storage
using Firebase;
using Firebase.Extensions;
using Firebase.Storage;
public class UploadFile : MonoBehaviour
{
FirebaseStorage storage;
StorageReference storageReference;
// Start is called before the first frame update
void Start()
{

    FileBrowser.SetFilters(true, new FileBrowser.Filter("Images", ".jpg", ".png"), new FileBrowser.Filter("Text Files", ".txt", ".pdf"));

    FileBrowser.SetDefaultFilter(".jpg");

    FileBrowser.SetExcludedExtensions(".lnk", ".tmp", ".zip", ".rar", ".exe");
    storage = FirebaseStorage.DefaultInstance;
    storageReference = storage.GetReferenceFromUrl("gs://app_name.appspot.com/");

}

public void OnButtonClick()
{
    StartCoroutine(ShowLoadDialogCoroutine());

}

IEnumerator ShowLoadDialogCoroutine()
{

    yield return FileBrowser.WaitForLoadDialog(FileBrowser.PickMode.FilesAndFolders, true, null, null, "Load Files and Folders", "Load");

    Debug.Log(FileBrowser.Success);

    if (FileBrowser.Success)
    {
        // Print paths of the selected files (FileBrowser.Result) (null, if FileBrowser.Success is false)
        for (int i = 0; i < FileBrowser.Result.Length; i++)
            Debug.Log(FileBrowser.Result[i]);

        Debug.Log("File Selected");
        byte[] bytes = FileBrowserHelpers.ReadBytesFromFile(FileBrowser.Result[0]);
        //Editing Metadata
        var newMetadata = new MetadataChange();
        newMetadata.ContentType = "image/jpeg";

        //Create a reference to where the file needs to be uploaded
        StorageReference uploadRef = storageReference.Child("uploads/newFile.jpeg");
        Debug.Log("File upload started");
        uploadRef.PutBytesAsync(bytes, newMetadata).ContinueWithOnMainThread((task) => {
            if (task.IsFaulted || task.IsCanceled)
            {
                Debug.Log(task.Exception.ToString());
            }
            else
            {
                Debug.Log("File Uploaded Successfully!");
            }
        });

    }
}

}

A: As far as I understand it is basically already working as expected but you need to handle the different file types / extensions differently.
I think all you need to actually do is

*

*use the correct file name + extension

*use the correct ContentType depending on the file extension

So maybe something like
IEnumerator ShowLoadDialogCoroutine()
{
    yield return FileBrowser.WaitForLoadDialog(FileBrowser.PickMode.FilesAndFolders, true, null, null, "Load Files and Folders", "Load");

    Debug.Log(FileBrowser.Success);

    if (!FileBrowser.Success)
    {
        yield break;
    }

    //foreach (var file in FileBrowser.Result)
    //{
    //    Debug.Log(file);
    //}

    var file = FileBrowser.Result[0];

    Debug.Log("File Selected: \"{file}\"");

    // e.g. C:\someFolder/someFile.txt => someFile.txt
    var fileNameWithExtension = file.Split('/', '\\').Last();

    if (!fileNameWithExtension.Contains('.'))
    {
        throw new ArgumentException($"Selected file \"{file}\" is not a supported file!");
    }

    // e.g. someFile.txt => txt
    var extensionWithoutDot = fileNameWithExtension.Split('.').Last();

    // Get MIME type according to file extension
    var contentType = extensionWithoutDot switch
    {
        "jpg" => $"image/jpeg",
        "jpeg" => $"image/jpeg",
        "png" => $"image/png",
        "txt" => "text/plain",
        "pdf" => "application/pdf",
        _ => throw new ArgumentException($"Selected file \"{file}\" of type \"{extensionWithoutDot}\" is not supported!")
    };

    // Use dynamic content / MIME type
    var newMetadata = new MetadataChange()
    {
        ContentType = contentType
    };

    // Use the actual selected file name including extension
    StorageReference uploadRef = storageReference.Child($"uploads/{fileNameWithExtension}");
    Debug.Log("File upload started");
    uploadRef.PutBytesAsync(bytes, newMetadata).ContinueWithOnMainThread((task) =>
    {
        if (task.IsFaulted || task.IsCanceled)
        {
            Debug.LogException(task.Exception);
        }
        else
        {
            Debug.Log($"File \"{file}\" Uploaded Successfully!");
        }
    });
}

you most probably will want to replace the throw by proper error handling with user feedback later ;)


text:
Q: Missing records during incremental ETL with long running updates/inserts on temporal tables We use standard approach when loading data from temporal tables - getting all the changes that happened after the last load by comparing period start column value with the latest load timestamp.
As per MSDN documentation (the same apply both for updates and deletes also)

INSERTS: On an INSERT, the system sets the value for the SysStartTime
column to the begin time of the current transaction (in the UTC time
zone) based on the system clock and assigns the value for the
SysEndTime column to the maximum value of 9999-12-31. This marks the
row as open.

Let's assume that we start some long running transaction at 2019-12-02 15:27:00, for example
BEGIN TRAN;
    WAITFOR DELAY '00:03:00';

    UPDATE a
    SET account_balance = 999
    FROM dbo.accounts AS a
    WHERE a.id= 'XXXXX'
COMMIT;

and our last load was at 2019-12-02 15:26:00. So when we run the ETL, it will get all modified changes:
SELECT * FROM dbo.accounts WHERE SysSstart > '2019-12-02 15:26:00'
Let's assume the ETL finished at 2019-12-02 15:28:00 and saved the value.
As we had delay for 3 minutes, then UPDATE finished at 2019-12-02 15:30:00, but SysStart column value will be 2019-12-02 15:27:00 as it was at the beginning of the update transaction. So if we run the ETL again, records updated in this transaction will not be loaded as they will not match SysSstart > '2019-12-02 15:28:00' predicate.
How to handle such situation?

A: It may be a better solution but right now I get these 2 simple ideas (because it seems you just need to know when the last update occurs):

*

*Add a LoadDateTime to your dbo.accounts and use it in your query SELECT * FROM dbo.accounts WHERE LoadDateTime > '2019-12-02 15:26:00'

*Save when the ETL starts and not when it ends


text:
Q: Angular 2 Returning data from subscribe this is my service
 countGroupByEtat(): Observable<number[]> {
    return this.http.get(this.url + 'GroupByEtat', { headers: this.prepareHeaders() })
        .map((res: Response) => {
            let object: Array<any> = [];
            let jsonResults: Array<any> = res.json();
            jsonResults.forEach((jsonResult) => {
                object.push(jsonResult);
            });
            return object;
        })
}

and my method
  getGroupByEtat(): number[] {
    this.serviceDossier.countGroupByEtat()
      .subscribe((data: number[]) => {
        this.objects = data;
        console.log("subsc"+ this.objects)

      })
    return this.objects;
  }

When I want to obtain the value of this.objects after the closing of subscribe I receive an array that is empty, help !

A: Change it to :
 getGroupByEtat(): number[] {
    return this.serviceDossier.countGroupByEtat()
      .subscribe((data: number[]) => {
        this.objects = data;
        console.log("subsc"+ this.objects)

        return this.objects;
      })

  }


text:
Q: How to detect if PS4 doing playback using php? How to detect if PS4 is doing playback or running a game or so with php or js. Is there a REST Api or something like that?

A: This is not possible because there is no open API. You can try to log in with your account into the webpage of the Playstation Network and scrape the content - but that is nothing like a REST API.


text: Q: How to export SQL Server database into Microsoft Access (2007) How can I export SQL Server into Microsoft Access 2007? At present I can view tables but I can't view stored procedures and how to save exported database from SQL Server into MS Access. So that I can call the path in connection string.


text:
Q: API to change touchpad 'Cursor speed' in Win10 dynamically without restarting We need to reduce Win10 touchpad cursor speed certain state in our application. So, i was planning that when the application enter a specific state, we will change touchpad cursor speed at run time by using some Windows API. And when coming out of the specific state, revert the touchpad cursor speed to original value.
However, i did not find any Windows API to change touchpad 'Cursor speed' dynamically without restarting. I found API to change mouse speed (SystemParametersInfo). But this API only changes the mouse cursor speed. It does not  change touchpad cursor speed.
I tried changing the below registry. But the problem with changing registry is that touchpad cursor speed gets updated only after system restart. I need an API to change touchpad cursor speed without restarting system (similar to how we can change mouse speed using SystemParametersInfo)
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PrecisionTouchPad\CursorSpeed
Any suggestions in this regard will be really very helpful.


text:
Q: Gliderjs Horizontal Bar class I'm working with GliderJs and it all seems okay except for the one horizontal bar that comes. I can't seem to find the class (so I can hide it). Anyone know which class it belongs to or what I can do to hide it?
This is what the implementation looks like and i'd like to remove that bar at the bottom.
My code looks like

window.addEventListener('load', function() {
  new Glider(document.querySelector('.glider'), {
    slidesToShow: 1,
    draggable: false,
    dots: ".dots",
    rewind: true,
    arrows: {
      prev: ".glider-prev",
      next: ".glider-next"
    },
  });
})
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/glider-js@1/glider.min.css">

your content here

your content here

your content here

  <button aria-label="Previous" class="glider-prev">

  </button>
  <button aria-label="Next" class="glider-next">

  </button>

A: So, this turns out to be a known Firefox Browser issue.
Solution from the Repository


text:
Q: My video won't start playing, even when i hit play button html this is probably very simple, but I can't find the answer anywhere.
so I try to make a video with just html, but the video won't start playing, not even when i hit the start button, I tried it on IE aswell, and it said: Error: Video playback was aborterd.
Here is my code.
 <!DOCTYPE html>

 <title></title>
 <link rel="stylesheet" type="text/css" href="css/style.css" />

    <video width="600px" controls>
    <source src="video/banner.MP4" type="video/mp4">
      Your browser does not support HTML5 video.
    </video>

A: Here is the updated answer, give it a try,
<!DOCTYPE html>

    <title></title>
    <link rel="stylesheet" type="text/css" href="css/style.css" />

            <video width="600" controls>
                <source src="video/banner.MP4" type="video/mp4">
                Your browser does not support HTML5 video.
            </video>


text:
Q: Anchors without content buggy in Chrome? I stumble (again) on a browser-specific issue, which may have appeard after recent Chrome updates (or maybe existed before).
In certain cases, using absolutely positioned divs with anchors inside does not work if they have no content (except whitespaces).
The simplest JSFiddle: https://jsfiddle.net/odoppfba/5/
HTML:

  a1 - should jump to BLUE but jumps to GREY

  a2 - jumps to the page bottom instead of GREY

Also, if you remove the DIV wrapping these 2 links+text (not the "anchor-wrapper" div), the behavior is broken even further. Removing the comment in CSS resolves the issue, as well as putting any text into anchors.

CSS:
    body { height:2000px; }
.anchor-wrapper {
  position:absolute;
  width:32px;
  height:16px;
}

.anchor-wrapper a:before {
  /*content:"";*/ /* enabling this fixes the behavior, as well as putting any content into anchors or their wrappers */
}

It works fine in all browsers I tested except Chrome.
If any content is set - even empty content "" onto :before - it works as it should in Chrome.
I remember reading about empty anchors malfunctioning in certains browsers (Safari, Opera) long ago, but Chrome? Now? Am I missing something important?
Best regards
D

A: In HTML5 the a element has no name attribute. If you change it to a div element it will work.

The name attribute on the a element is obsolete. Consider putting an id attribute on the nearest container instead.

-- https://www.w3.org/TR/html-markup/a.html


text:
Q: Create files with different names in C I need a program that can make me multiple accouts stored in different files. This is what I've done so far but for some reason ("test" + userName + ".txt", "a"); does not work. Thank you for your time!

int main() {

char choice[10];
printf("create accout (1)");
printf("\nlogin to accout (2)\n");
scanf("%s", &choice);
getchar();

if (strcmp(choice, "1") == 0)
{
    char userName[1000];

    FILE *myFile;
    myFile = fopen("test" + userName + ".txt", "a");
    if (myFile == NULL)
    {
        printf("file does not exist");
    }
    else
    {
        printf("Enter your username: ");
        gets(userName);
        fprintf(myFile, "%s", userName);
        fclose(myFile);
    }
}

A: In C, "strings" (char *), are in fact just pointers to the first element of a zero-terminated array of char, interpreted as a string by the library functions.
You can not simply concatenate such pointers with +, like in some other languages that have explicit string types.
To assemble a string, you'll have to use something like strcat() to an appropriately sized buffer:
 char buffer[MAX_PATH];
 ...
 strcpy(buffer, "test");
 strcat(buffer, userName);
 strcat(buffer, ".txt");
 myFile = fopen(buffer, "a");

Alternatively, you can use sprintf():
 int res = sprintf(buffer, "test%s.txt", userName);
 if (res > 0)
 {
     myFile = fopen(buffer, "a");

etc...


text:
Q: React - Use Bootstrap globally with css modules Pretty new to react and all that stuff, so I need some help here. I recently added the https://github.com/gajus/babel-plugin-react-css-modules plugin to my project. After some troubles I got it to work, so I can now use my local css files with my components. So far so good.
Not I would like to add bootstrap for the whole application. It worked before I added the css-modules plugin...
Here's are the relevant parts of my code (I guess... if I miss something let me know):
index.js (entrypoint of my application):
import 'bootstrap/dist/css/bootstrap.min.css';
...

.babelrc:
{
    "presets": [
        "react"
    ],
    "plugins": [
      ["react-css-modules", {
        "exclude": "node_modules"
      }]
    ]
}

webpack.config.js:
/* webpack.config.js */

const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.exports = {
  devtool: 'eval',

  entry: [
    path.resolve('src/index.js'),
  ],

  output: {
    path: path.resolve('build'),
    filename: 'static/js/bundle.js',
    publicPath: '/',
  },

  module: {
    rules: [
      {
        test: /\.(js|jsx)$/,
        include: path.resolve('src'),
        loader: 'babel-loader',
      },
      {
        test: /\.css$/,
        use: [
          'style-loader',
          {
            loader: 'css-loader',
            options: {
              importLoaders: 1,
              modules: true,
              localIdentName: '[path]___[name]__[local]___[hash:base64:5]', // Add naming scheme
            },
          },
        ],
      },

    ],
  },

  plugins: [
    new HtmlWebpackPlugin({
      inject: true,
      template: path.resolve('src/index.html'),
    }),
  ],
}

Any advise is welcome. Thank you for your time.
Oh btw: I would also like to introduce scss to my application, I don't know how to do that yet (haven't done any researches, but if someone of you knows how to do it and is open to explain that, I would really appreciate it... don't know if its a big change).
Edit:
I totally forgot to add my component:
import React, { Component } from "react";
import { Switch, Route, withRouter } from "react-router-dom";
import './style.css';

export default class HomeContainer extends Component {
  constructor() {

    super();
  }
  /* Test */
  render() {
    return (
      <div styleName="title">
        This woorks (styleprops from "title" are appliced"
        <button type="button" className="btn btn-primary">Primary</button> // Doesn't style the button :(
      </div>
    );
  }
}

A: I found the solution by myself. Gonna post it here, may someone will need it one day:
Define two rules in the webpack config:
{
  test: /\.css$/,
  exclude: /node_modules/,
  use: [
    'style-loader', {
      loader: 'css-loader',
      options: {
        importLoaders: 2,
        modules: true,
        localIdentName: '[path]___[name]__[local]___[hash:base64:5]', // Add naming scheme
      },
    },
  ],
},

// Second CSS Loader, including node_modules, allowing to load bootstrap globally over the whole project.
{
  test: /\.css$/,
  include: /node_modules/,
  use: ['style-loader', 'css-loader']
}


text:
Q: Good analogy for watts vs amps? According to plumbing analogy I've hard time seeing why power is measured in volts*amps, instead of just amps.
I found an analogy from http://science.howstuffworks.com/environmental/energy/question501.htm

Electrical power is measured in watts. In an electrical system power
  (P) is equal to the voltage multiplied by the current.
The water analogy still applies. Take a hose and point it at a
  waterwheel like the ones that were used to turn grinding stones in
  watermills. You can increase the power generated by the waterwheel in
  two ways. If you increase the pressure of the water coming out of the
  hose, it hits the waterwheel with a lot more force and the wheel turns
  faster, generating more power. If you increase the flow rate, the
  waterwheel turns faster because of the weight of the extra water
  hitting it.

This explanation contrasts two ways of increasing the power:

*

*increasing the pressure [volts] or

*increasing the flow rate [amps].

But increasing the pressure also increases the flow rate!? What am I missing here?
Would it be more precise to say that I can increase the power by:

*

*increasing the pressure [volts] while keeping flow rate [amps] the same (by using hose with smaller diameter [increasing resistance]) or

*increasing the flow rate [amps] while keeping the pressure [volts] the same (by using hose with bigger diameter [decreasing resistance]?

Does increasing water pressure while reducing hose diameter (so that flow rate stays the same) really give you more powerful waterwheel?

A: The water analogy is full of leaks. A better analogy, if you need one, is a closed circuit water pumping system such as a central heating hot-water system. Pump = battery, pressure = voltage, radiators = resistors, current = current.
Forget all that for a moment: why does voltage affect power? Increasing the voltage allows us to get the same current through a higher resistance. Since more work is required to do this then the power must be increasing.

A: For a simple water analogy, if you double the pressure, the flow rate will double. This is based on the fluid "load" being equivalent to an electrical resistor.
So you've doubled pressure and accordingly, the  flow rate has doubled and, this naturally and mathematically means the power imparted to the load has risen 4 times.
Nothing wrong with that analogy at all.
If you double the voltage across a resistor, power increases 4 times. Maybe you've seen the formula power = volts squared divided by resistance. The squaring term accounts for the current doubling when you double the voltage.

A: I recently plotted the energy in a screw air compressor ( 3 phase) and thought I would share for you.
Compare the cumulative air flow (at some nozzle velocity) in CFM and the electrical energy consumed in kWh
They are identical.
So power, P=IV times time is Energy is equivalent to cumulative volume of air mass at a fairly constant velocity.   (regulated by pressure and nozzle size)
Orange is CFM and light blue is kCFM-cum.
BLUE is kWh and thin blue is PSI air pressure in the tank.


text:
Q: Send something through / by / per / via email? What would be the correct preposition:

"I will send all further details ____ email" ?

I would guess 'through' or 'by' or 'per' or 'via' all sound kind of right, but I'm not sure what's the best choice.

A: If it were me, I'd use either "by" or "via," and of those two, I'd tend to lean a little more toward "via." You're basically saying you're sending the details "by way of" email and I think that would make the most sense.

A: I'd use 'by'. I would prefer this to 'via' and 'per' which as Latin words I would only use in the specific niches they have occupied in English (e.g. London via Birmingham, £1000 per week). 'Through' has also a connotation of movement in addition to that of indicating an agent, which jars with me.
I know it's been criticized, but "familiar rather than unfamiliar, short rather than long, and Anglo-Saxon rather than Latin" work for me here.


text:
Q: DataTables cell click event not working when table is filtered Hi,
                                jQuery('#TheTable tr').each(function() {
                                    jQuery('td', this).slice(-1).on('click', function() {
                                       var tr = $(this).closest('tr');
                                       var row = table.row( tr );
                                       if (row.data() != undefined){
                                            modalfunc(row.data().id);
                                       }
                                    });
                                });

It's working great when table is loaded but then if user enter something in searchbox and data is filtered - the event is not triggered when clicked on the column's cells.
How to adapt this code to dynamically created elements?


text:
Q: How do I develop on top of forked repo? We have a major repo called team_repo/project, my teammate forked from it, called teammate/project. Then he made some commits to his feature branch and pushed to teammate/project already but has not sent out a pull request to team_repo/project. And now I am asked to build on top of his feature branch and eventually commit the changes to the main branch of team_repo/project, what git commands will I need so that I can preserve both his work and mine in the PR to team_repo/project?

A: You can add your teammates work by adding their remote:
git remote add teammate url
Where teammate is the name you want to refer to the remote as, and url is the url your teammates forked repo.
git fetch teammate to pull down the branches.
You should be able to merge branches then. Use git branch -r to check they have come through.
git checkout teammate/feature assuming your teammates branch was called feature.
git checkout -b teammates-feature to create a branch on the main repo with your teammates code.
git checkout -b my-feature to create a copy that you can work on.
Now you have both branches on your local.
As far as preserving, you can then push these branches to main remote and create separate pull requests.


text:
Q: Advanced animation with Android I'm looking for a tutorial/guide/something which explains how create some advanced animation with Android.
I know that I can create basic animation with "View Animation", but I'm looking for something much more complicated like an explosion or a fire burning or a person walking.
What do you suggest as best approach? Shall I use the "Drawable Animation" and draw frame by frame or there is a better/faster technique? What do you use?

A: Sprite Animation with Android
Actually we do want a low frame rate walking for this tutorial, just like this.

you can have source
for more ref here


text:
Q: c# Web API Query SQL I have a Web API 2 project which is backed by a SQL DB. I have a table, UserAlerts, with fields Lat, Lon, Timestamp, UserID.
I have a UserAlert controller, and UserAlert model with fields matching value and type of the fields in the Db. What is the correct way to query the database and return a JSON object containing the rows which contain UserID=UserID from client?
I have tried
List<UserAlerts> userAlerts = await db.UserAlerts.Where(x => x.UserID == UserID)
            .Select(x => new UserAlerts
            {
                Lat = x.Lat,
                Lon = x.Lon,
                TimeTriggered = x.TimeTriggered,
                TimeEnded = x.TimeEnded,
                UserID = x.UserID
            }).ToListAsync();

But of course I get "The entity or complex type ',namespace>.Models.UserAlerts' cannot be constructed in a LINQ to Entities query.".
Any advice would be appreciated, I hope the question is clear!

A: If the types are the same (they're both called UserAlert after all...), then do you need the .Select() clause at all?  Try:
List<UserAlerts> userAlerts = await db.UserAlerts
                                      .Where(x => x.UserID == UserID)
                                      .ToListAsync();

If the types are in fact different, then you can materialize the collection first before transforming it:
List<UserAlerts> userAlerts = await db.UserAlerts
                                      .Where(x => x.UserID == UserID)
                                      .ToListAsync()
                                      .Select(x => new UserAlerts
                                          {
                                              Lat = x.Lat,
                                              Lon = x.Lon,
                                              TimeTriggered = x.TimeTriggered,
                                              TimeEnded = x.TimeEnded,
                                              UserID = x.UserID
                                          })
                                      .ToListAsync();;

This would incur a performance hit if what you're materializing is considerably more data than what you're transforming it into, so be careful.

A: With

"The entity or complex type ',namespace>.Models.UserAlerts' cannot be constructed in a LINQ to Entities query."

This is because there is a table/class named 'UserAlerts' in your context. You should select anonymously like following
  List<UserAlerts> userAlerts = await db.UserAlerts.Where(x => x.UserID == UserID)
        .Select(x => new
        {
            Lat = x.Lat,
            Lon = x.Lon,
            TimeTriggered = x.TimeTriggered,
            TimeEnded = x.TimeEnded,
            UserID = x.UserID
        }).ToListAsync();


text: Q: Собрать проект под Windows Vista Возможно ли с помощью современных средств сделать билд проекта, использующего библиотеки фреймворка Qt, для Windows Vista? Необходимое условие - компилятор должен быть из серии msvc32b.


text:
Q: Word wrap in MATLAB editor How can I word-wrap long lines of scripts and functions in the MATLAB R2011b Editor?
I don't mean using Ctrl+J to wrap comments, but show a long line over several lines, each (except the last) the width of the editor frame, as in most text editors, so I don't need to scroll horizontally; the effect is purely visual and it remains as a single line in the file.
I could not find a setting in any menu, toolbar or the preferences dialog.
Though I could split the line into multiple lines using "...", I don't want to do this. I want to keep it as one line in the file, just show it wrapped, as in Format > Word Wrap in Windows Notepad.

A: The way to do this is by using the three dots ... For example:
Hc_frame_1 = uicontrol(gcf, ...
'Style', 'frame',...
'Units', 'pixels',...
'Position', [25 250 200 230]);

These three dots tell MATLAB to continue the command on the next line. Without them MATLAB will think that the command is incomplete.

A: There is no way to wrap general text in the editor.
It can be set to do so but just for comments.


text:
Q: Converting string to XMLDocument doesn't create text nodes here's my situation.
I have a string containing XML data:
<tag>
    <anotherTag> data </anotherTag>
</tag>

I take that string and I run it through this code to convert it to a Document:
try {
  DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  DocumentBuilder builder = factory.newDocumentBuilder();
  return builder.parse(new InputSource(new StringReader(sXMLString)));
}
catch (Exception e) {
  // Parser with specified options can't be built
  ceLogger.logError("Unable to build a new XML Document from string provided:\t" + e.getMessage());
  return null;
}

The resulting xml is almost perfect. Its missing the data however and looks like this:
<tag>
    <anotherTag />
</tag>

How can I copy over the text when creating an XML Document and why is it removing the text in the first place?
Edit:
The actual problem ended up being something along the lines of this:
While parsing through the XML structure with my own function this line is there:
if (curChild.getNodeType()==Node.ELEMENT_NODE)
   sResult.append(XMLToString((Element)children.item(i),attribute_mask));

But no such logic exists for TEXT nodes, so they are simply ignored.

A: Your code is correct. The only guess I can make is that you are outputting your code incorrectly. I've tested your code, and used the following method to output, and the XML was displayed correctly with the text node:
public static void outputXML(Document dom) throws TransformerException
{
    Transformer transformer = TransformerFactory.newInstance().newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");

    //initialize StreamResult with File object to save to file
    StreamResult result = new StreamResult(new StringWriter());
    DOMSource source = new DOMSource(dom);
    transformer.transform(source, result);

    String xmlString = result.getWriter().toString();
    System.out.println(xmlString);
}

The output was:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<tag> <anotherTag> data </anotherTag>
</tag>


text:
Q: Is it possible to detect a Form mouseclick from a User Control I have created a User Control and would like to be able to detect when the user clicks on the Form.
I have seen this question which is related but the suggestion to use the  the Leave event doesn't always do what I want because the focus doesn't necessarily change when the user clicks the Form (my control could be the only control on the Form in which case focus stays with my control).
Any ideas?
I want to be able to do something like this from within the User Control:
Private Sub ParentForm_Click(sender As Object, e As System.EventArgs) _
    Handles Me.Parent.Click

End Sub

A: I would do it slightly differently:
Private _form As Control

Private Sub UserControl_ParentChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.ParentChanged

    If _form IsNot Nothing Then
        RemoveHandler _form.Click, AddressOf ParentOnClick
    End If

    _form = Me.FindForm()

    If _form IsNot Nothing Then
        AddHandler _form.Click, AddressOf ParentOnClick
    End If

End Sub

Private Sub ParentOnClick(ByVal sender As Object, ByVal e As EventArgs)
    '...
End Sub

This gives it a little more resillience - if it is not a direct child of a Form, if its parent changes etc.

A: I figured out how to do this myself - for anyone interested I am doing the following:
Private _parentForm As Form

Private Sub UserControl_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    _parentForm = CType(Parent, Form)
    AddHandler _parentForm.Click, AddressOf ParentForm_Click
End Sub

Private Sub ParentForm_Click(sender As Object, e As System.EventArgs)
    debug.writeline("Parent form clicked")
End Sub


text:
Q: Overlaying multiple rasters covering the same area with a single band I have a data set that contains rainfall values for every 5 mins of a day in different rasters (each raster has rainfall for 5 minutes - ie 12*24 = 288 rasters per day). I want to overlay all the rasters together to get the rainfall for the entire day in one raster. all the rasters cover the same area (the UK). what is the best tool to do this? I have access to both QGIS and ARCGIS, but not sure if mosaicking all the rasters per day will give me the total rainfall, or if I should merge. What is the best way to get the total rainfall per day in raster format? Basically what I want is a functionality that will allow me to overlay all the rasters and sum the values for each overlapping point.

A: You  an use the ArcGIS Cell Statistics tool (requires Spatial Analyst extension) with the SUM statistic (or MAX if your 5min values are cumulative) to output a raster of the totals.


text:
Q: Java Android Gson convert boolean to int from response server Help me, guys!
Please, advise a simple solution to convert type boolean from server to int in Android :)
When I log in, i get respone from server like this :
{"status":{"error":0,"code":200,"message":"OK"},"response":{"profile":{"id":114,"username":"k@gmail.com","full_name":"k","phone":"9999999","verified":1,"admin":0,"allow_dev":false,"company":{"id":9,"name":"ООО \"Фингерз медиа\"","email":"info@fingers.by","sample":null,"logo":"http://storage.guardian-glass.fingersmedia.by/0cb56968b3cec1bba301db8d51d1015e.jpg"}},"access_token":"15629e234e04a54a5a44ef2aa4eccb1d"}}

Then I get undefined exception: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected NUMBER but was BOOLEAN
This happens because of JsonElement "allow_dev" is boolean from server, and in Android I have "allow_dev" like int.
This is login method :
 private void login(String email, String pass) {
    showProgress();
    JsonObject params = new JsonObject();
    params.addProperty("username", email);
    params.addProperty("password", pass);
    UserOperationsTask task = new UserOperationsTask(UserOperationsTask.TaskMode.MODE_LOGIN, params) {
        @Override
        public void onLoadFinished(Bundle res) {
            hideProgress();
            String errorMessage = res.getString(UserOperationsTask.RESULT_ERROR_STRING);
            if (errorMessage != null) {
                showMessage(getString(R.string.login_error), getString(R.string.server_request_error));
            } else {
                String json = res.getString(UserOperationsTask.RESULT_JSON_STRING);
                if (json != null) {
                    JsonParser parser = new JsonParser();
                    JsonObject responseData = parser.parse(json).getAsJsonObject();
                    JsonObject companyObj = responseData.getAsJsonObject("profile").getAsJsonObject("company");
                   }
                setRegisteredMode();
            }
        }
    };
    task.execute(this);
}

This method parse response and I tried to convert allow_dev type from boolean to int, but I dont understand whether I'm doing right?
private Bundle parseProfileResponse(Context context, JsonObject responseData) {
    Log.d(TAG, "parseProfileResponse");

    // I tried convert allow_dev type from boolean to int
    String allow_dev_server = String.valueOf(responseData.get("allow_dev"));
    boolean b = allow_dev_server.equals("true");
    int allow_dev = b ? 1 : 0; // true == 1
    Profile profile;
    profile = GsonHolder.getGSONInstance().fromJson(responseData.getAsJsonObject("profile"), Profile.class);
    profile.allow_dev = allow_dev;

    Bundle res = new Bundle();
    res.putParcelable(RESULT_OBJ, profile);
    res.putString(RESULT_JSON_STRING, responseData.toString());
    try {
        Cache.saveToCache(context, profile);
    } catch (RemoteException e) {
        Log.d(TAG, "parseAuthResponse RemoteException: " + e.toString());
        res.putString(RESULT_ERROR_STRING, context.getString(R.string.database_error));
    } catch (OperationApplicationException e) {
        Log.d(TAG, "parseAuthResponse OperationApplicationException: " + e.toString());
        res.putString(RESULT_ERROR_STRING, context.getString(R.string.database_error));
    }
    return res;
}

I have to get "allow_dev" convert it in int and write to database.

A: If you can switch to mappings, you can use everything static typing can give you, comparing to weakly "typed" JsonElement and its subclasses. It has several advantages: compile-time checking, more robust code, IDE support, etc. The major disadvantage is that you have to write custom mappings, however you there tools (online as well) that can try to generate simple mapping classes based on the given sample JSON (for example, a very popular tool here: http://www.jsonschema2pojo.org/).
Now, let's create some mappings. The mappings like the ones below are used rarely: final fields (used for "server responses" that are no supposed to be modified programmatically; Gson can assign such fields anyway); null for non-primitives and some hacks for primitive type defaults values to cheat the compiler (like Integer.value(0) but not simply 0: otherwise, javac may inline constants, thus Gson cannot affect them); no getters/setters (data-transfer objects are just data bags, but yes, getters can work better). Anyway, you can use your style, and the followings mappings are used for demonstration purposes (the mappings code has even compact formatting: one property per line collapsing the annotations).
final class Response<T> {
    final Status status = null;
    final T response = null;
}

final class Status {
    final int error = Integer.valueOf(0);
    final int code = Integer.valueOf(0);
    final String message = null;
}

final class ProfileAndAccessToken {
    final Profile profile = null;
    @SerializedName("access_token") final String accessToken = null;
}

final class Profile {
    final int id = Integer.valueOf(0);
    final String username = null;
    @SerializedName("full_name") final String fullName = null;
    final String phone = null;
    final int verified = Integer.valueOf(0);
    final int admin = Integer.valueOf(0);
    @SerializedName("allow_dev") @JsonAdapter(BooleanToIntTypeAdapter.class) final int allowDev = Integer.valueOf(0);
    final Company company = null;
}

final class Company {
    final int id = Integer.valueOf(0);
    final String name = null;
    final String email = null;
    final String sample = null;
    final URL logo = null;
}

Note two annotations above:

*

*@SerializedName -- this annotation can "rename" fields so you can use even special characters (however it's discouraged, and it's typically used to map incoming JSON property names to javaCamelNamingConventions).

*@JsonAdapter -- this annotation can "attach" a special type adapter to a certain field, so that it could convert JSON properties to the given field and vice versa.

Now let's implement a type adapter that can convert incoming boolean values to local int values and vice versa. Note that type adapters work in streaming manner, so you have to read JSON tokens stream on fly during read, and, of course, generate JSON tokens stream during write.
final class BooleanToIntTypeAdapter
        extends TypeAdapter<Integer> {

    // Public constructors may be evil, and let expose as less as possible
    // Gson can still instantiate this type adapter itself
    private BooleanToIntTypeAdapter() {
    }

    @Override
    @SuppressWarnings("resource")
    public void write(final JsonWriter out, final Integer value)
            throws IOException {
        // If the given value is null, we must write the `null` token to the output JSON tokens stream anyway in order not to break JSON documents
        if ( value == null ) {
            out.nullValue();
            return;
        }
        // Let's assume that we can accept either 0 or 1 that are mapped to false and true respectively
        switch ( value ) {
        case 0:
            out.value(false);
            break;
        case 1:
            out.value(true);
            break;
        default:
            // Or throw an exception as fast as we can
            throw new IllegalArgumentException("Cannot convert " + value + " to a boolean literal");
        }
    }

    @Override
    public Integer read(final JsonReader in)
            throws IOException {
        // Peek the next token type, and if it's null, then return null value too
        if ( in.peek() == NULL ) {
            return null;
        }
        // Otherwise parse the next token as boolean and map it either to 1 or 0
        return in.nextBoolean() ? 1 : 0;
    }

}

That's all you need in Gson. Now, for you entire JSON, since the response mapping class is generic, you have to tell Gson what the T is. Gson accepts java.lang.reflect.Type in the fromJson method, and this type can hold both raw and parameterized types, so Gson could (de)serialize more accurately.
private static final Type profileAndAccessTokenResponse = new TypeToken<Response<ProfileAndAccessToken>>() {
}.getType();

final Response<ProfileAndAccessToken> response = gson.fromJson(JSON, profileAndAccessTokenResponse);
System.out.println(response.response.profile.allowDev);
System.out.println(gson.toJson(response, profileAndAccessTokenResponse));

Output:

0
  {"status":{"error":0,"code":200,"message":"OK"},"response":{"profile":{"id":114,"username":"k@gmail.com","full_name":"k","phone":"9999999","verified":1,"admin":0,"allow_dev":false,"company":{"id":9,"name":"ООО \"Фингерз медиа\"","email":"info@fingers.by","logo":"http://storage.guardian-glass.fingersmedia.by/0cb56968b3cec1bba301db8d51d1015e.jpg"}},"access_token":"15629e234e04a54a5a44ef2aa4eccb1d"}}

Note that the first line is 0: this what is generated with BooleanToIntTypeAdapter. Backing to your code:
String allow_dev_server = String.valueOf(responseData.get("allow_dev"));
boolean b = allow_dev_server.equals("true");
int allow_dev = b ? 1 : 0; // true == 1
Profile profile;
profile = GsonHolder.getGSONInstance().fromJson(responseData.getAsJsonObject("profile"), Profile.class);
profile.allow_dev = allow_dev;

Can be replaced with simple:
final Profile profile = GsonHolder.getGSONInstance().fromJson(responseData.getAsJsonObject("profile"), Profile.class)
// now `Profile.allowDev` is 0 or 1 automatically

Note that responseData can be replace with a particular mapping, so you could even not parse at that line: probably you might simply pass the whole response object as a class mapping rather that JsonObject in your parseProfileResponse -- it would be more robust.


text:
Q: Table alignment I want to ask how I can align this table so all the binary data are all exactly under the corresponding headers "x_i"?
\documentclass[a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tabularx,ragged2e,booktabs,caption}
\newcolumntype{C}[1]{>{\Centering}m{#1}}
\renewcommand\tabularxcolumn[1]{C{#1}}
\begin{document}

\begin{table}
\caption{Table Title}
\centering
\begin{tabular}{||c c c||}
\hline
\text{$\mathcal{C}-x_1$}  &  \text{$\mathcal{C}^x_1$} & \text{$tail_{x_1}
(\mathcal{C})$}\\ [0.5ex]
\hline\hline
$x_2$ $x_3$ $x_4$   &    $x_2$ $x_3$ $x_4$  &    $x_1$ $x_2$ $x_3$ $x_4$ \\
[0.5ex]
\hline\hline
0 0 0    &    0 0 0    &    0 1 0 1    \\ [0.5ex]
0 1 0    &    0 1 0    &    0 1 1 0    \\ [0.5ex]
0 1 1    &    0 1 1    &    0 1 1 1    \\ [0.5ex]
1 0 0    &    1 0 0    &                  \\ [0.5ex]
1 0 1    &               &                  \\ [0.5ex]
1 1 0    &               &                  \\ [0.5ex]
1 1 1    &               &                  \\ [0.5ex]
         &               &                   \\ [1ex]
\hline
\bottomrule[1.25pt]
\end {tabular}
\\[10pt]
\caption*{See This}
\end{table} \vspace{0.5cm}

\end{document}

A: In math testbed I compose code for following table:

MWE:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{amsmath, amssymb}
\usepackage{array, booktabs}
\newcommand\mcx[2]{\multicolumn{#1}{c}{$#2$}}

\usepackage[skip=1ex]{caption}

\begin{document}
    \begin{table}
\caption{Table title}
\label{tab:codetable}
    \centering
\setlength\tabcolsep{3pt}
\begin{tabular}{*{12}{>{\ttfamily}c}}
    \toprule
\mcx{3}{\mathcal{C} - x_1} &
    &   \mcx{3}{\mathcal{C}^x_1} &
        &  \mcx{4}{\text{tail}_{x_1}(\mathcal{C})}   \\
$x_2$ & $x_3$ & $x_4$ &
    & $x_2$ & $x_3$ & $x_4$ &
        & $x_1$ & $x_2$ & $x_3$ & $x_4$              \\
    \cmidrule{1-3}
    \cmidrule{5-7}
    \cmidrule{9-12}
0 & 0 & 0  &&  0 & 0 & 0   &&  0 & 1 & 0 & 1            \\
0 & 1 & 0  &&  0 & 1 & 0   &&  0 & 1 & 1 & 0            \\
0 & 1 & 1  &&  0 & 1 & 1   &&  0 & 1 & 1 & 1            \\
1 & 0 & 0  &&  1 & 0 & 0   &&    &   &   &              \\
1 & 0 & 1  &&    &   &     &&    &   &   &              \\
1 & 1 & 0  &&    &   &     &&    &   &   &              \\
1 & 1 & 1  &&    &   &     &&    &   &   &              \\
    \bottomrule
\end{tabular}
    \end{table}
\dots, see table \ref{tab:codetable}.
\end{document}

Edit:
I had problems with your code. It seems that it contain hidden character or unknown coded characters  which caused problems to my editor. That is main reason that I like to see preamble of your document. Now, hopefully I solve this problem (by retyping your code) :-)


text:
Q: Dynamic set of ngrx entities using @ngrx/entity Is it possible to have a dynamic set of entities using @ngrx/entity?  If so, how is it done?  If not, what is the best practice for handling this situation?
Example
I have dynamic list of contracts I receive from the back-end.  Under each contract I have a table of transactions that I load one by one as they are viewed.  I would like to use @ngrx/entity for the line-items on this table, but because it's dynamic I don't know how to define them.  here is a design:

The only solution I can think of is to only have one entity adapter and replace the table rows each time an accordion opens. I would enforce only one open at a time. I would also have to copy off the entities when one closes so I wouldn't lose data already loaded.
The other option I can think of without using @ngrx/entity and use the same pattern to have the contract entities and then under each of those line-item entities.

A: I don't know what you mean with dynamic entities in this context.
I would have 2 entities: ParentEntities, LineEntities.
You start with loading ParentEntities after you expand a row you can fetch the LineEntities and start populating the state.
With selectors, you can combine parent entities with their line entities. With this data, you can render your view.


text:
Q: '/' home nav item color is showing active even changing of NavLink in ReactJs I'm using NavLink to show the for Routing and showing item active of selected items.By default the home item is showing as active even I switched to other item. Except home others are working as expected.
Help me to sort out this bug.
In the following figure, Home (in red color) as active color even I switched to contact

My code as follows:
import React from "react";
import { withRouter, NavLink } from "react-router-dom";

class TopNav extends React.Component {

  render() {
    return (

          {/*  */} Logo
          <button
            className="navbar-toggler"
            type="button"
            data-toggle="collapse"
            data-target="#navbarNav"
            aria-controls="navbarNav"
            aria-expanded="false"
            aria-label="Toggle navigation"
          >

          </button>

                <NavLink
                  className="nav-link menu-list "
                  activeClassName="active"
                  to="/"
                >
                  Home
                </NavLink>

                <NavLink
                  className="nav-link menu-list"
                  activeClassName="active"
                  to="about"
                >
                  About
                </NavLink>

                <NavLink className="nav-link menu-list"  activeClassName="active" to="contact">
                  Contact
                </NavLink>

    );
  }
}
export default withRouter(TopNav);

A: You can also specify the exact prop on NavLink components. The to prop (and path prop for Route components) match by path prefix, and "/" is a prefix for all routes.

exact: bool
When true, the active class/style will only be applied if
the location is matched exactly.

<NavLink
  className="nav-link menu-list "
  activeClassName="active"
  to="/"
  exact // <-- specify exact match!
>
  Home
</NavLink>


text:
Q: Dynamic Height For This Carousel? I have a carousel that will contain images with the same width but different height. I am unsure how I would adapt my existing code to fit this requirement without resorting to JS. I also want to note that I have content surrounding this carousel on all sides.
Currently, I have hard coded height:390px; in .slides. I have tried changing this to height:auto; but it forced all of the content below the carousel to move up ~375px (I have given my pagination a height of 15px).
HTML:

Slide01

Slide01

Slide01

CSS/LESS:
#carousel {
    -moz-box-shadow: 0 2px 4px #777;
    -webkit-box-shadow: 0 2px 4px #777;
    box-shadow: 0 2px 4px #777;
    width: 630px;

    div.slides {
        position: relative;
        float: left;
        display: block;
        width: 100%;
        height: 390px;
        margin: 0;

        .slide {
            position: absolute;
            left: 0;
            -webkit-transition: opacity 1s ease-in-out;
            -moz-transition: opacity 1s ease-in-out;
            -o-transition: opacity 1s ease-in-out;
            -ms-transition: opacity 1s ease-in-out;
            transition: opacity 1s ease-in-out;
            opacity: 0;
            -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
            filter: alpha(opacity=0);

            img {
                border-top-left-radius:5px 5px;
                border-top-right-radius:5px 5px;
                border-bottom-left-radius:5px 5px;
                border-bottom-right-radius:5px 5px;
            }

            .content {
                color: white;
                font-weight: bold;
                z-index: 10;
                position: absolute;

                bottom: 40px;
                width: 100%;
                text-align: center;

                .text {
                    padding: 0 0 20px 0;
                }
            }
        }

        .slide.opaque, .slide.tempOpaque {
            opacity: 1;
            -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=1)";
            filter: alpha(opacity=1);
        }
    }

    ul.pagination {
        padding: 0;
        margin: 0 auto;
        width: 200px;
        text-align: center;
        list-style-type: none;
        position: relative;
        top: -25px;
        z-index: 9;

        .pag {
            width: 15px;
            height: 15px;
            background: url(images/pagination.png) 0 0 no-repeat;
            position: relative;
            display: inline-block;
            margin: 0;
            padding: 0;

            cursor: hand; cursor: pointer;
        }

        .pag.selected {
            background:url(images/pagination.png) 0 -16px no-repeat;
        }
    }
}

JS:
$(document).ready(function() {
    slidesArray = new Array();
    loadArray(slidesArray, 'slide', '#carousel .slides .slide');
    $("#carousel .pagination .pag").click(function() {
        var nextSlide = $(this).attr("id").replace("pag-slide", "");
        animateTransition(nextSlide);
    });
    var slideTimer = setInterval(function() {
        fadeToNextSlide()
    }, 5000 );
});

function loadArray(array, prefix, path) {
    $(path).each(function(index) {
        array.push(prefix + (index + 1));
    });
}
function animateTransition(nextSlide) {
    $("#carousel .slides .opaque").addClass('tempOpaque');
    $("#carousel .slides .slide").removeClass("opaque");
    setTimeout(function(){
        $('#carousel .slides .slide.tempOpaque').removeClass('tempOpaque');
    },300);
    $("#carousel .slides #slide" + nextSlide).addClass("opaque");
    $("#carousel .pagination .pag").removeClass("selected");
    $('#carousel #pag-slide' + nextSlide).addClass("selected");
}
function fadeToNextSlide() {
    var currentSlide = $('#carousel .slides .opaque').attr('id');
    var nextSlide = $.inArray(currentSlide, slidesArray) + 2;
    if (nextSlide > slidesArray.length) {
        nextSlide = 1;
    }
    animateTransition(nextSlide);
}

A: By updating your animateTransition function to check the image height first (by creating a hidden image element and checking the height of that), you can determine and set the height of the .slides div. Simply add this bit into that function:
$('body').append('');
var theheight=$('#imgheight').height();
$('#imgheight').remove();
$('.slides').height(theheight);

JsFiddle example: http://jsfiddle.net/QvZLg/4/
(if you inspect the element you'll see that the height of the .slides div is set every time the image changes.)
Happy Coding :)


text:
Q: Processing command line data in Java (alternatives to args[]) I write a lot of java tools which get fed information from the command line, which java provides access to via main(args[]). The apps in question are typically Windows tools (so running from command line, or batch files).
From what I have learned through painful experience, Windows does its own (sometimes whacky) conversions and transformations on the argument data depending on what actually called it. Which then gets palmed off onto Java, which does its own parsing and processing, eventually presenting you with args[]. It's this multiple levels of parsing\pre-processing that is currently causing me grief, as it isn't always clear where things are being mangled.
My first question is what actual parsing\conversion does Java actually do before getting to args? From what I can gather, it just takes the argument data supplied by the OS (which I understand is just one long string), and delimits it based on white space (tab, space chars). Is it that simple?
Second question, is it possible to get the unprocessed command line data, as it is passed to Java? While having the args broken up by spaces is often convenient, it falls apart when you start adding more complicated arrangements. So "-foo=bar" might end up as "-foo=" "bar", or "-foo" "=" "bar", or "-foo" "=bar" depending on which way the white-space winds have blown. If the assumptions made in my first question are correct, then you can just build a string by inserting a space between each element in args, but if other processing is done then accessing the raw args becomes more useful.
As a final note, I am aware that there are already a host of libraries available which process command line data in Java. I should probably start using one of those at some point, but for now I just want to understand exactly what is being done, and what alternatives (if any) Java itself provides.

A: The arguments are parsed by the shell and passed in to your program.  Java doesn't do any extra parsing.

A: you can get the whole line, with some special tricks
use
ManagementFactory.getRuntimeMXBean()

and
getInputArguments()

thanks to: How do I get the commandline that started the process


text:
Q: Controlling the mouse from perl in OS X Is here any way control mouse movements and clicks in OS X from perl?
Found several python solutions, but not perl - yet.
If here isn't perl solution, is possible call python (or ruby) code from perl (not mean via fork/exec/system) but like "Inline::Lua" or soo..
thanx.

A: Yeah, I'd suggest you use Python and ATOMac.  There is Inline::Python but I have not used it; it looks pretty mature though.


text:
Q: Navbar links die in Bootstrap 4 until page reload - Rails 5 App I just moved over to Bootstrap 4 and noticed some weird behavior in my app.  All of the navbar links work fine on the first try, including the dropdowns, but after the linked page loads, all of the navbar links are dead.  They come alive again when I reload whatever page I happen to be on.
My code:

    ... some content

  <button class="navbar-toggler" type="button" data-toggle="collapse"
    data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">

  </button>

        ...

         ...

Is this a known issue with Bootstrap 4, or am I seeing something else?

A: When I posted my original question, I didn't specify that this was a Rails 5 application.
Originally, I had tried to load bootstrap using the CDN links provided at the bootstrap site:

  ...

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">

  ...

  ...

  ...

I wrestled with this for some time and couldn't solve the problem.  It seemed that none of my javascript-related bootstrap components (e.g. popovers) worked unless I reloaded the page.
In the end, I gutted all of this and opted for the bootstrap-ruby gem.  When I followed the implementation instructions, everything worked fine.
I'd still be interested in knowing why the CDN solution didn't work.


text:
Q: Generate a JSON instead of an image for the legend with OpenLayers I'm not clear on how I can pass the params to getLegendUrl. My aim is to obtain the JSON and for this scope I use the code below:
  var graphicUrl = wmsSource.getLegendUrl(
    resolution,
    'params': 'application/json',
  );
  console.log(graphicUrl);

In the console I see only the error below concerned to 'params': 'application/json',:

Uncaught SyntaxError: missing ) after argument list

A: The parameters should be an object, it should look like something like this :
var graphicUrl = wmsSource.getLegendUrl( resolution,
     {'REQUEST': '...',
      'LAYER': '...'
     }
);

The exact syntax of the parameters depends on your WMS server. For instance :

*

*MapServer : https://mapserver.org/ogc/wms_server.html

*GeoServer : https://docs.geoserver.org/stable/en/user/services/wms/get_legend_graphic/index.html

*etc.


text:
Q: Need info on java.io.UnixFileSystem.rename0 Could you please explain the below stack trace, I tried to understand the source code but couldn't enough information on what rename0() is doing.
"[STUCK] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE native
java.io.UnixFileSystem.rename0(Native Method)
java.io.UnixFileSystem.rename(UnixFileSystem.java:317)
java.io.File.renameTo(File.java:1248)
com.bea.wli.sb.transports.file.resource.FileResource.renameToUniqueFilePath(FileResource.java:766)

Thanks in advance!

A: Looks like you (or something running on your machine) tried to rename a file or directory.  The major hint comes in the line
java.io.File.renameTo(File.java:1248)

Without knowing what file was being renamed, or what the new name would have been, it is hard to determine exactly why this won't work.


text:
Q: Meteor build TypeError: module.import is not a function In the last couple of days I have been having trouble building. I moved to Meteor 1.4.2, and I'm not sure if that is the problem. I tried going back to Meteor 1.4.1.3 but the problem is still there
The error I am getting is
W20161108-11:17:17.631(11)? (STDERR) /Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/boot.js:333
W20161108-11:17:17.632(11)? (STDERR) }).run();
W20161108-11:17:17.632(11)? (STDERR)    ^
W20161108-11:17:17.632(11)? (STDERR)
W20161108-11:17:17.632(11)? (STDERR) TypeError: module.import is not a function
W20161108-11:17:17.633(11)? (STDERR)     at meteorInstall.node_modules.meteor.webapp.webapp_server.js (/Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/packages/webapp.js:33:26)
W20161108-11:17:17.633(11)? (STDERR)     at fileEvaluate (packages/modules-runtime/packages/modules-runtime.js:171:1)
W20161108-11:17:17.633(11)? (STDERR)     at require (packages/modules-runtime/packages/modules-runtime.js:96:1)
W20161108-11:17:17.633(11)? (STDERR)     at /Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/packages/webapp.js:842:1
W20161108-11:17:17.633(11)? (STDERR)     at /Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/packages/webapp.js:855:3
W20161108-11:17:17.633(11)? (STDERR)     at /Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/boot.js:292:10
W20161108-11:17:17.633(11)? (STDERR)     at Array.forEach (native)
W20161108-11:17:17.634(11)? (STDERR)     at Function._.each._.forEach (/Users/mikkel/.meteor/packages/meteor-tool/.1.4.1_3.89kw9a++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20161108-11:17:17.634(11)? (STDERR)     at /Users/mikkel/senecto/memberapp/.meteor/local/build/programs/server/boot.js:128:5
=> Exited with code: 1

I don't understand what is wrong, meteor reset has no effect, not does removing the build directory.
Any ideas please?

A: As confirmed in the comments, deleting ~/.meteor resolves this issue. When this directory is deleted, Meteor will reinstall all packages, incl. core packages.


text:
Q: Mongodb update using Java I need help in updating MONGO DB. here is my document:
Functions : {
    "cgi0-app" : {
        "calculatedConfigValues" : {
            "floor" : 0.0 ,
            "ceiling" : 49.0 ,
            "calculatedBrokenValue" : 2.033 },
        "userConfigValues" : null },
    "shop-app" : {
        "calculatedConfigValues" : {
            "floor" : 0.0 ,
            "ceiling" : 70.0 ,
            "calculatedBrokenValue" : 2.413 } } }

I am trying to update shop-app's "ceiling" value from 70 to 100 in MongoDB, but not successful. Here is my Code:
BasicDBObject find = new BasicDBObject("Functions.shop app.calculatedConfigValues.floor",0);

BasicDBObject set = new BasicDBObject("$set", new BasicDBObject("Functions.shop-        app.calculatedConfigValues.$.ceiling", 100);

getDB().update(find, set);

Can someone please help me what I am doing wrong?

A: You can't really create DBObjects with that dot notation. You have to nest new BasicDBObjects for each level in the document tree.
DBObject toFind = new BasicDBObject("Functions",
    new BasicDBObject("show-app",
        new BasicDBObject("calculatedConfigValues",
            new BasicDBObject("floor", 0))));

Same for the update object
DBObject update = new BasicDBObject("$set",
    new BasicDBObject("Functions",
        new BasicDBObject("show-app",
            new BasicDBObject("calculatedConfigValues",
                new BasicDBObject("ceiling", 100)))))

Alternatively, you can use this Helper class for translating json strings into DBObject structures like this.
DBObject toFind = (DBObject) JSON.parse(
    "{'Functions.show-app.calculatedConfigValues.floor':0}"
);

But be aware of that using the JSON class may cause performance problems. It's simply faster to build DBObjects manually.

A: Not sure if this will solve your problem, but don't you want to update a specific document within a collection within the DB? So something along these lines:
MongoClient mongo = new MongoClient();
DB db = mongo.getDB(DB_NAME);
db.getCollection(COLLECTION_NAME).update(find, set);

I would also define find in this way, because you want the specific object from that collection.
BasicDBObject obj = new BasicDBObject();
obj.put(..., 0);
DBObject find = db.getCollection(COLLECTION_NAME).findOne(obj);

Let me know if this works.