Tag Archives: The development tools

Start eclipse and prompt version 1.7.0_ 79 of the JVM is not suitable for this product. Version: 1.8 or greater i…

When you start Eclipse, the following pop-up box pops up:

Solutions:
Find the eclipse.ini file in the Eclipse installation directory and go to the
– vmargs.
– Dosgi requiredJavaVersion = 1.8
prefix
– vm
D:/Program Files/Java/jdk1.8.0 _111/jre/bin/server/JVM. DLL
Note: -vm is to be added before -vmargs
– vm
D:/Program Files/Java/jdk1.8.0 _111/jre/bin/server/JVM. DLL should pay attention to the direction of the slash, if written
– vm
D: \ \ Program Files \ Java \ jdk1.8.0 _111 \ jre \ bin \ server \ JVM DLL
Eclipse will exit automatically after starting Eclipse
There is another option: uninstall JDK 1.7 and install JDK 1.8
 

Reproduced in: https://www.cnblogs.com/nana-blog/p/10385723.html

Git clear saved accounts

Git will automatically save the user name and password you have entered.
Git’s configuration file is ~ /.gitconfig. GitConfig can be opened with Vim ~/. GitConfig from the command line of Git Bash and Mac under Windows.

Windows
 

git config --system --unset credential.helper

 
Mac
 

sudo git config --system --unset credential.helper

 

Reproduced in: https://www.cnblogs.com/sea-breeze/p/9174557.html

Android learning notes 03: some problems and solutions in the learning process

In the process of learning Android development encountered a lot of problems, fortunately, the final search through the Internet have been solved. Now some of the problems I encountered in the process of learning Android development and the solutions are sorted out as follows.
1.R.java cannot be updated in real time
Description of the problem: New variables in the res file are not displayed in real time in R.java.
Solution: Select “Project” from the menu bar and check the “Build Automatically” option.
2.LogCat window is not displayed
Problem description: The LogCat window is not displayed in the lower right corner of Eclipse.
Solution: Select “Windows” from the menu bar, then “Show View”, and finally “LogCat”.
“Android Library Projects Cannot Be Launched
“Android Library Projects Cannot Be Launched” error
Solution: Select “Project” in the menu bar, then “Properties”, select “Android” in the pop-up window, and uncheck the IS Library option.
4. “This text field does not specify an InputType or a hint” error after adding EditText control to XML
Problem description: Add EditText control to XML. Control information is as follows.
& lt; The EditText
android: id = “@ + id/EditText”
android: layout_width = “match_parent”
android: layout_height = “wrap_content” & gt; < /EditText>
Error “This text field does not specify an InputType or a hint” at compile time.
Control lacks android:hint and android:inputType information. The android:hint is used to set the default text prompt displayed when EditText is null. Android: InputType is used to set the text type of EditText, which is used to help the input method display the appropriate keyboard type.
Add android:hint and android:inputType information to the control. Add the control information as follows.
& lt; The EditText
android: id = “@ + id/EditText”
android: hint = “0”
android: inputType = “number”
android: layout_width = “match_parent
” Android: layout_height = “wrap_content” & gt; < /EditText>
5. Warning message “Hardcoded string” XXX “, should use @string resource
Problem description: Add Button control in XML, control information is as follows.
& lt; The Button
android: id = “@ + id/mButton_mc”
android: text = “MC”
android: layout_width = “match_parent
” android: layout_height = “wrap_content” & gt;
& lt; /Button>
At compile time, prompt “Hardcoded string” MC “, should use @string resource warning.
The String MC is used in Android :text. You should define the String in string.xml and then use the String resource by calling the String resource name in string.xml. The advantage of doing this is that it can be a complete change and is useful when supporting multiple languages.
Solution: res–> in the project directory; values–> The following is the information for adding the String MC to string.xml.
< resources>
& lt; string name=”mc”> mc< /string>
< /resources>
Then, in the XML that uses the Button control, you use the string by calling its resource name, as follows.
& lt; The Button
android: id = “@ + id/mButton_mc”
android: text = “@ string/MC”
android: layout_width = “match_parent
” android: layout_height = “wrap_content” & gt;
& lt; /Button>
6. Nested weights are bad for performance
Analysis: When using a nested layout, both parent and child layouts use android:layout_weight, but when it is not required, a warning appears as shown in the title.
Solution: Remove the android:layout_weight that is not required for the sublayout, depending on the situation.
7. The solution to an error message “Please ensure that ADB is correctly located at:XXXXX” when starting the emulator
Executed: When using the correct source code, the following error message “Please ensure that ADB is correctly located at ‘D:\AndroidSDK4.0\ Android-SDK-Windows \ Platform-tools \ Adb.exe ‘and can be executed.”
D:\AndroidSDK4.0\ Android-SDK-Windows-Platform-Tools = D:\AndroidSDK4.0\ Android-SDK-Windows-Platform-Tools = PATH
Waiting for HOME (‘ Android.process.acore ‘) to be launched… Waiting for HOME (‘ Android.process.acore ‘) to be launched… The solution to this problem
Phenomena: When the simulator starts, it cannot start after Waiting for a long time (more than 5 minutes). It keeps saying “Waiting for HOME (‘ Android.process.acore ‘) to be launched…”. Information.  
Solution: Delete the current emulator and create a new one.
9.Android emulator landscape screen and portrait screen toggle
After the emulator is started, select the emulator and press Ctrl +F11 to switch between landscape and portrait screen of the Android emulator.
10. The imported Android project @Override returns an error
Phenology: When importing the Android project source code downloaded from the Internet into Eclipse, @Override returns an error.
On the project that reported the error, right-click on Properties–>; Java Compiler–> Select 1.6 in Compiler Compliance Level to refresh the project, and the error will not be reported.
 

Idea startup project Lombok error, no symbol found

The error message is as follows:

About the solution to this problem on-line machine-made, basic is lombok plug-in installation restart idea, or check the Enable the annotation processing, if these are not solve, might as well have a look at your project using the SDK version is too high lead to do not compatible with lombok, such as my idea version is 2019.3.3, default jdk11, and I install ombok plug-in version is 029-2019.3, the experiment proved that the version are not compatible. Solution:
Click “File” in the upper left corner and select Project Structure, as shown in the picture
: select the Module SDK from 1.8 or any other Lombok version that is compatible with your installation.

fix yahoo finance

Get the Yahoo data in Python

18:42:54, June 11, 2018

Reading count: 71

I learned machine learning in Python. I found a practical tutorial online. I needed to get stock data from Yahoo. The problems and solutions are given below.
Programming environment: Linux Ubuntu16, python3.6, anaconda 1.6.14, conda 4.5.4, pandas 0.23
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Problem 1: An environment interpretation error occurred while downloading Pandas _datareader
Because the Yahoo data needs to be retrieved through the Pandas _datareader module, you need to download and install the package
Environment parse error occurs with Conda Install Pandas _datareader (conda installation is used because anaconda is used to build the Python compile and edit environment) :

python@ubuntu:~$ conda install pandas_datareader
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - pandas_datareader

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/free/linux-64
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/pro/linux-64
  - https://repo.anaconda.com/pkgs/pro/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Solution 1: Then change to PIP Install safari _datareader to install successfully!
Solution two: Later, I found that when I was using Conda to install the module, there were jupyter Notebook still running, so I tried to close it and then used Conda install Rebuild _datareader to find it could be successfully installed.
 
Question 2: ImportError: Cannot import name ‘is_list_like’ when using import pandas_datareader as PDR
I found many methods on the Internet, including the case column on StackFlow, but I still couldn’t find one suitable for me.
Solution one: Then give up searching for a solution online and start groping instead. Because the error message is that the module named ‘is_list_like’ cannot be imported, the code to find the error is in the first line from pandas.core.common.data import is_list_like in the fred.py module. Because the common folder and the modules under that folder cannot be found in the environment, the path to import is_list_like is wrong.
Then, Baidu search: panda IS_list_like finds the official API document of Pandas, and click Source to enter the source code module. It turns out that IS_list_like exists as a method of in the following path

Finally, I get rid of the Fred. Py the first line of the import path into: from pandas. Core. Dtype. Inference import is_list_like, import pandas_datareader modules again success!
 
Question 3: run the following code, appear ImmediateDeprecationError, namely the Yahoo! Finance no longer exists because in 2017 Yahoo! It was bought by Verizon

Yahoo Daily has been immediately deprecated due to large breaks in the API without the  
introduction of a stable replacement

The code is as follows:

     

    import pandas as pd

     

    import datetime

     

    import pandas_datareader.data as web

     

    start = datetime.datetime(
    2010,1,1)

     

    end = datetime.datetime(
    2017,1,1)

     

    df = web.get_data_yahoo(
    ‘SPY’,’yahoo’,start, end)

Baidu has found one solution in the CSDN blog: install Fix_yahoo_finance (PIP Install) and then run the following code before retrieving the data.

     

    import fix_yahoo_finance as fy

     

    fy.pdr_override()

Reproduced in: https://www.cnblogs.com/ziheIT/p/9249676.html

Mac & how to uninstall LANDesk

Mac & how to uninstall LANDesk

Mac – LANDesk – Uninstall LANDesk


https://community.ivanti.com/docs/DOC-22475
https://www.quora.com/How-do-you-remove-LANDESK-from-your-computer
https://community.ivanti.com/docs/DOC-2092

/Library/Application Support/LANDesk/bin/LDUserMenu.app/Contents/MacOS/LDUserMenu




https://blog.csdn.net/cangraoo/article/details/81254848
https://download.csdn.net/download/e345ug/10206162
solution


#!/bin/bash
#####################################################
# LANDesk Agent framework uninstaller
# Description: script to remove landesk agent
# components.
#
# Note: do not use 'rm -rf' on  directories.  Use the
# remove_landesk_dir or one of the other remove_dir
# functions.  They are safer and will protect you
# from making silly mistakes.
#####################################################
REMOVED=0
CLEAN=0
PKGUTIL=
SCRIPT=`/usr/bin/basename $0`
[ -x /usr/sbin/pkgutil ] && PKGUTIL=/usr/sbin/pkgutil

if [ `/usr/bin/id -u` -ne 0 ]; then
    echo "Uninstalling the LANDesk agent requires administrative priveleges."
    echo "Please enter your password to continue or press CTRL-C to cancel."
    sudo "$0" "$@"
    exit 0
fi


function show_help()
{
    echo "LANDesk agent uninstaller"
    echo "Usage: $SCRIPT [ -h | -c ]"
    echo "  options: "
    echo "     -h           Show this help message"
    echo "     -c           Force the uninstall and completely remove the install directories."
    echo "                  The default is to only remove empty directories."
    echo ""
}

function remove_flat_receipt( )
{
    RDIR=$1
    [ -z "$RDIR" ] && fatal "remove_flat_receipt(${RDIR}) must be passed a valid application name"
    # remove the receipt file
    if [ -d /Library/Receipts/$RDIR ]; then
        echo "removing receipt for: $RDIR "
        rm -rf /Library/Receipts/$RDIR
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove receipt: $RDIR. \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_database_receipt( )
{
    OBJ=$1
    [ -z "$OBJ" ] && fatal "remove_database_receipt(${OBJ}) must be passed a valid application name"
    if [ -n "$PKGUTIL" ]; then
        RES=`$PKGUTIL --pkgs | grep $OBJ`
        if [ -n "$RES" ]; then
            echo "Removing receipt database entry for: $OBJ "
            $PKGUTIL --forget $OBJ
        fi
    fi

}

function remove_framework_dir()
{
    FDIR=$1
    echo "Checking $FDIR"
    [ -z "$FDIR" ] && fatal "remove_framework_dir(${FDIR}) must be passed a valid directory"
    # remove the framework directory
    if [ -d /System/Library/Frameworks/${FDIR} ]; then
        echo "removing framework installation: $FDIR"
        rm -rf /System/Library/Frameworks/${FDIR}
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove framework: ${FDIR}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_LaunchDaemon()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_LaunchDaemon(${FNAME}) must be passed a valid file name"
    # remove the framework directory
    if [ -e /Library/LaunchDaemons/${FNAME} ]; then
        echo "removing LaunchDaemon: $FNAME"
        rm -f /Library/LaunchDaemons/${FNAME}
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi

}

function unload_LaunchAgent()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_LaunchAgent(${FNAME}) must be passed a valid file name"

    # unload launch agent
    if [ -f /Library/Application\ Support/LANDesk/bin/launchInContext.sh ]  && [ -e /Library/LaunchAgents/${FNAME} ]; then
        echo "unloading LaunchAgent: $FNAME"
        /Library/Application\ Support/LANDesk/bin/launchInContext.sh console /bin/launchctl unload -S Aqua /Library/LaunchAgents/${FNAME}
        [ "$?" != "0" ] && ( echo "ERROR: failed to unload file: ${FNAME}  \n\t$!"; exit 1 )
    fi
}

function remove_LaunchAgent()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_LaunchAgent(${FNAME}) must be passed a valid file name"
    # remove the framework directory
    if [ -e /Library/LaunchAgents/${FNAME} ]; then
        echo "removing LaunchAgent: $FNAME"
        rm -f /Library/LaunchAgents/${FNAME}
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi

}

function remove_startup()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_startup(${FDIR}) must be passed a valid file name"
    # remove the startup item
    if [ -d "/Library/StartupItems/${FNAME}" ]; then
        echo "removing launch daemon: $FDIR"
        rm -rf "/Library/StartupItems/${FNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi

}

function remove_Preferences()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_Preferences(${FNAME}) must be passed a valid file name"
    # remove the preferences file
    if [ -e "/Library/Preferences/${FNAME}" ]; then
        echo "removing Preference: ${FNAME}"
        defaults delete "/Library/Preferences/${FNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}


function remove_PreferencePane()
{
    FNAME="$@"
    [ -z "$FNAME" ] && fatal "remove_PreferencePane(${FNAME}) must be passed a valid dir name"
    # remove the preference pane directory
    if [ -d "/Library/PreferencePanes/${FNAME}.prefPane" ]; then
        echo "removing Preference: $FNAME"
        rm -rf "/Library/PreferencePanes/${FNAME}.prefPane"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_application_support_application()
{
    FNAME=$1
    [ -z "$FNAME" ] && fatal "remove_application_support_application(${FDIR}) must be passed a valid dir name"
    # remove the preference pane directory
    if [ -d "/Library/Application Support/${FNAME}" ]; then
        echo "removing Application Support directory: $FNAME"
        rm -rf "/Library/Application Support/${FNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${FNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_landesk_dir()
{
    DNAME=$1
    [ -z "$DNAME" ] && fatal "remove_landesk_dir(${DNAME}) must be passed a valid dir name"
    # remove the landesk directory named:
    if [ -d "/usr/local/LANDesk/${DNAME}" ]; then
        echo "removing LANDesk directory: $DNAME"
        rm -rf "/usr/local/LANDesk/${DNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
    if [ -d "/usr/LANDesk/${DNAME}" ]; then
        echo "removing LANDesk directory: $DNAME"
        rm -rf "/usr/LANDesk/${DNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
    if [ -d "/opt/landesk/${DNAME}" ]; then
        echo "removing LANDesk directory: $DNAME"
        rm -rf "/opt/landesk/${DNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_landesk_files()
{
    for DNAME in "$@"; do
        [ -z "$DNAME" ] && fatal "remove_landesk_file(${DNAME}) must be passed a valid filek name"
        # remove the landesk directory named:
        if [ -f "/usr/local/LANDesk/${DNAME}" ]; then
            echo "removing LANDesk file: $DNAME"
            rm -f "/usr/local/LANDesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
        if [ -f "/usr/LANDesk/${DNAME}" ]; then
            echo "removing LANDesk file: $DNAME"
            rm -f "/usr/LANDesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
        if [ -f "/opt/landesk/${DNAME}" ]; then
            echo "removing LANDesk file: $DNAME"
            rm -f "/opt/landesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
    done
}

function remove_landesk_links()
{
    for DNAME in "$@"; do
        [ -z "$DNAME" ] && fatal "remove_landesk_link(${DNAME}) must be passed a valid symlink name"
        # remove the landesk directory named:
        if [ -h "/usr/local/LANDesk/${DNAME}" ]; then
            echo "removing LANDesk link: $DNAME"
            rm -f "/usr/local/LANDesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove link: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
        if [ -h "/usr/LANDesk/${DNAME}" ]; then
            echo "removing LANDesk link: $DNAME"
            rm -f "/usr/LANDesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove link: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
        if [ -h "/opt/landesk/${DNAME}" ]; then
            echo "removing LANDesk link: $DNAME"
            rm -f "/opt/landesk/${DNAME}"
            [ "$?" != "0" ] && ( echo "ERROR: failed to remove link: ${DNAME}  \n\t$!"; exit 1 )
            ((REMOVED++))
        fi
    done
}


function remove_sharedtech()
{
    remove_Preferences com.landesk.cba8.plist
    remove_Preferences com.landesk.msgsys.plist
    remove_Preferences com.landesk.broker.plist

    if [ -e /Library/StartupItems/cba8/cba8 ]; then
        /Library/StartupItems/cba8/cba8 stop
    fi
    remove_startup cba8

    remove_LaunchDaemon com.landesk.pds.plist
    remove_LaunchDaemon com.landesk.pds1.plist
    remove_LaunchDaemon com.landesk.pds2.plist
    remove_LaunchDaemon com.landesk.msgsys.plist
    remove_LaunchDaemon com.landesk.cba8.plist
    remove_LaunchDaemon com.landesk.broker.plist
    remove_LaunchDaemon com.landesk.rotatelog.plist
    remove_LaunchDaemon com.landesk.reboot.plist
    remove_LaunchDaemon com.landesk.vulscan.plist
    remove_LaunchDaemon com.landesk.dispatch.plist
    remove_LaunchDaemon com.landesk.ldlaunch_daemon.plist
    remove_LaunchDaemon com.landesk.scheduler.plist
    remove_LaunchDaemon com.landesk.ldwatch.plist
    remove_LaunchAgent com.landesk.ldusermenu.plist
    remove_LaunchAgent com.landesk.hideScreen.plist
    remove_LaunchAgent com.landesk.ldswprogress.plist
    remove_LaunchAgent com.landesk.remotelaunch.plist
    remove_LaunchAgent com.landesk.dispatch.pl.plist
    remove_LaunchAgent com.landesk.dispatch.ui.plist
    remove_LaunchAgent com.landesk.dispatch.sui.plist
    remove_LaunchAgent com.landesk.ldlaunch_daemon.plist
    remove_LaunchAgent com.landesk.ldNotificationMonitor.plist
    remove_LaunchAgent com.landesk.logged_in.plist
    remove_LaunchAgent com.landesk.logged_out.plist
    remove_LaunchAgent com.landesk.ldwatch.plist
    remove_LaunchAgent com.landesk.ldNotificationMonitor.plist
    remove_LaunchAgent com.landesk.lockscreen.plist

    echo "removing SharedTech: "

    remove_landesk_files  common/{addhandler,makekey,sha1tool,shutdownhandler.sh}
    remove_landesk_files  common/{reboothandler.sh,cba8_uninstall.sh,alert}
    remove_landesk_files  common/{resetguard,cba,proxyhost,ldpgp}
    remove_landesk_files  common/{alertrender,postbsa,ldnacgi,httpclient,ldpds1}
    remove_landesk_files  common/{brokerconfig,pds2_uninstall.sh,pds2d,pds2dis,poweroff.exe,uniqueid}
    remove_landesk_files  common/cbaroot/certs/064eb6a5.0
    remove_landesk_files  common/cbaroot/allowed/{cba8.crt,logodk.gif,hdr_lsdk.gif,ldping,index.tmpl}
    remove_landesk_files  common/cbaroot/services/{filexfer,exec}
    remove_landesk_files  common/cbaroot/alert/alert.xml
    remove_landesk_files  common/stop.time
    remove_landesk_files  common/start.time
    remove_landesk_links /bin/{addhandler,alert,cba,alertrender,makekey,httpclient,ldpgp,ldping,proxyhost}
    remove_landesk_links /bin/{resetguard,sha1tool,shutdownhandler.sh,reboothandler.sh,postbsa,ldnacgi,httpclient}


    cd /opt/landesk/
    STRING_FILES=`ls common/*strings.xml`
    for FILENAME in $STRING_FILES; do
        remove_landesk_files  ${FILENAME}
    done


    #rm -f /opt/landesk/bin/{addhandler,makekey,sha1tool,shutdownhandler.sh,reboothandler.sh,cba8_uninstall.sh}
    #rm -f /opt/landesk/bin/{aler,resetguard,cba,proxyhost,ldpgp,alertrender,postbsa,ldnacgi,httpclient}
    #rm -f /opt/landesk/etc/cbaroot/certs/064eb6a5.0
    #rm -f /opt/landesk/etc/cbaroot/allowed/{cba8.crt,logodk.gif,hdr_lsdk.gif,ldping,index.tmpl}
    #rm -f /opt/landesk/etc/cbaroot/services/{filexfer,exec}
    #rm -f /opt/landesk/etc/cbaroot/alert/alert.xml
    #rm -f /opt/landesk/bin/{addhandler,alert,cba,alertrender,makekey,httpclient,ldpgp,ldping,proxyhost}
    #rm -f /opt/landesk/bin/{resetguard,sha1tool,shutdownhandler.sh,reboothandler.sh,postbsa,ldnacgi,httpclient}
    [ -e /etc/pam.d/cba8 ] && rm -f /etc/pam.d/cba8
    [ -e /etc/xinetd.d/cba8 ] && rm -f /etc/xinetd.d/cba8

    remove_landesk_dir common/cbaroot
    remove_landesk_dir Resources
    remove_landesk_dir common

    /usr/bin/killall -HUP xinetd
}

function remove_crontab()
{
    # remove the crontab
    local crontabTag="# ldms"                                   # used to determine if the crontab file has already setup
    local installed=`sudo crontab -l -u root | grep -c '# ldms'`
    if [ $installed -gt 0 ]; then
        sudo crontab -l | sed '/ldms/d' | sudo crontab -
    fi
}

function remove_firewall()
{
    # remove the port exceptions we put in the firewall at installation
    if [ -e "/Library/Preferences/com.apple.sharing.firewall.plist" ]; then
        local saveDir=`pwd`
        cd /Library/Application\ Support/LANDesk/bin/
        echo `pwd`
        echo "Removing LANDesk Remote Control port exceptions"
        sudo ./ldxmlutil -d -f /Library/Preferences/com.apple.sharing.firewall.plist -k "/firewall/LANDesk Remote Control"
        echo "Removing LANDesk Trageted Multicast port exceptions"
        sudo ./ldxmlutil -d -f /Library/Preferences/com.apple.sharing.firewall.plist -k "/firewall/LANDesk Targeted Multicast"
        echo "Removing LANDesk CBA8 port exceptions"
        sudo ./ldxmlutil -d -f /Library/Preferences/com.apple.sharing.firewall.plist -k "/firewall/LANDesk CBA8"
        cd $saveDir
        echo `pwd`
    fi
    if [ -e "/System/Library/PrivateFrameworks/NetworkConfig.framework/Versions/Current/Resources/firewalltool" ]; then
        sudo /System/Library/PrivateFrameworks/NetworkConfig.framework/Versions/Current/Resources/firewalltool
    else
        echo "Warning the firewall must be restarted"
    fi
}

function remove_framework()
{
    # remove agent framework
    echo "Removing agent framework"
    remove_flat_receipt "LANDeskAgentFramework.pkg"
    remove_database_receipt "LANDeskAgent.framework"
    remove_framework_dir "LANDeskAgent.framework"
}

function remove_pkg_receipts()
{
    remove_flat_receipt "ldslm.pkg"
    remove_flat_receipt "agentconfig.pkg"
    remove_flat_receipt "brokerconfig.pkg"
    remove_flat_receipt "vulscan.pkg"
    remove_flat_receipt "swd.pkg"
    remove_flat_receipt "stuffitutility9.pkg"
    remove_flat_receipt "stuffitutility10.pkg"
    remove_flat_receipt "sharedtech.pkg"
    remove_flat_receipt "remotecontrol.pkg"
    remove_flat_receipt "ldusermenu.pkg"

    remove_database_receipt "com.landesk.agent.sharedtech"
    remove_database_receipt "com.landesk.stuffitutility9"
    remove_database_receipt "com.landesk.stuffitutility10"
    remove_database_receipt "com.landesk.agent.configui"
    remove_database_receipt "com.landesk.agent.ldslm"
    remove_database_receipt "com.landesk.agent.remotecontrol"
    remove_database_receipt "com.landesk.agent.swd"
    remove_database_receipt "com.landesk.agent.vulscan"
    remove_database_receipt "com.landesk.agent.brokerconfig"
    remove_database_receipt "com.landesk.agent.ldusermenu"

}

function remove_config_app()
{
    DNAME=$1
    [ -z "$DNAME" ] && fatal "remove_config_apps(${DNAME}) must be passed a valid dir name"
    # remove the landesk directory named:
    if [ -d "/Applications/Utilities/${DNAME}" ]; then
        echo "removing LANDesk application: $DNAME"
        rm -rf "/Applications/Utilities/${DNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}

function remove_Fuze()
{
    DNAME=$1
    [ -z "$DNAME" ] && fatal "remove_config_apps(${DNAME}) must be passed a valid dir name"
    # remove the landesk directory named:
    if [ -d "/Applications/${DNAME}" ]; then
        echo "removing LANDESK: $DNAME"
        rm -rf "/Applications/${DNAME}"
        [ "$?" != "0" ] && ( echo "ERROR: failed to remove file: ${DNAME}  \n\t$!"; exit 1 )
        ((REMOVED++))
    fi
}


function remove_baseagent()
{
    #remove baseagent
    remove_flat_receipt "baseagent.pkg"
    remove_database_receipt "baseagent"

    remove_landesk_files common/{sendstatus,alertsync,ldcron,lddaemon,ldwatch,ldiscan,ldxmlutil}
    remove_landesk_files common/{ldpds1,brokerconfig,pds2_uninstall.sh,pds2d,pds2dis,poweroff.exe,uniqueid}

    remove_landesk_links bin/{sendstatus,alertsync,ldcron,lddaemon,ldwatch,ldiscan,ldxmlutil}

    remove_LaunchDaemon com.landesk.ldwatch.plist
    remove_Preferences com.landesk.ldms.plist
    # remove preference panes
    remove_PreferencePane "LANDesk Agent"
    remove_PreferencePane "LANDesk Client"
    remove_startup LANDesk
    remove_application_support_application LANDesk

    remove_config_app "LANDesk Agent.app"

    remove_landesk_dir data common
}

function remove_gateway()
{
    remove_config_app "LANDesk Management Gateway.app"
}

function remove_tmc()
{
    remove_LaunchDaemon com.landesk.ldtmc.plist
}

function remove_swd()
{
    remove_LaunchDaemon com.landesk.remote.plist
    remove_landesk_links common/{ldgidget,ldkahuna,sdclient}
}

function remove_rc()
{
    echo "removing rc files"

}

function remove_ldav()
{
# only remove if we installed application
# check /Library/LaunchDaemons/com.landesk.ldav.plist for Disabled
# this will only be set to false if Kaspersky was installed by ldinstallav

    output=""

    if [ -e /Library/LaunchDaemons/com.landesk.ldav.plist ]; then
        output=`/usr/libexec/PlistBuddy -c "print Disabled" /Library/LaunchDaemons/com.landesk.ldav.plist`
        if [ "$?" -eq "0" ] && [ "$output" == "false" ]; then
            echo "detected /Library/LaunchDaemons/com.landesk.ldav.com:Disabled  = ${output}"
            echo "Uninstall Kaspersky AV"
            if [ -e '/Library/Application Support/LANDesk/bin/ldinstallav' ]; then
                /Library/Application\ Support/LANDesk/bin/ldinstallav /uninstall
            fi
            if [ -e '/Library/Application Support/Kaspersky Lab' ]; then
                rm -rf '/Library/Application Support/Kaspersky Lab'
            fi
        fi
    fi

    remove_LaunchDaemon com.landesk.ldav.plist
    remove_LaunchAgent com.landesk.ldav.agent.plist
}

function cleanup_directories()
{
    echo "Attempting to remove directory structure..."
    ECNT=0

    if [ -d "/usr/local/LANDesk" ]; then
        if [ $CLEAN -ne 0 ]; then
            rm -rf "/usr/local/LANDesk"
            return;
        fi
        if [ -d "/usr/local/LANDesk/common" ]; then
            rmdir "/usr/local/LANDesk/common"
            [ $?-eq 0 ] && ((ECNT++))
        fi
        if [ -d "/usr/local/LANDesk/bin" ]; then
            rmdir "/usr/local/LANDesk/bin"
            [ $?-eq 0 ] && ((ECNT++))
        fi

        if [ $ECNT -eq 0 ]; then
            rmdir "/usr/local/LANDesk";
        fi
    fi
    if [ -d "/usr/LANDesk" ]; then
        if [ $CLEAN -ne 0 ]; then
            rm -rf "/usr/LANDesk"
            return;
        fi
        if [ -d "/usr/LANDesk/common" ]; then
            rmdir "/usr/LANDesk/common"
            [ $?-eq 0 ] && ((ECNT++))
        fi
        if [ -d "/usr/LANDesk/bin" ]; then
            rmdir "/usr/LANDesk/bin"
            [ $?-eq 0 ] && ((ECNT++))
        fi

        if [ $ECNT -eq 0 ]; then
            rmdir "/usr/LANDesk";
        fi
    fi
    if [ -d "/opt/landesk" ]; then
        if [ $CLEAN -ne 0 ]; then
            rm -rf "/opt/landesk"
            return;
        fi
        if [ -d "/opt/landesk/common" ]; then
            rmdir "/usr/local/LANDesk/common"
            [ $?-eq 0 ] && ((ECNT++))
        fi
        if [ -d "/opt/landesk/bin" ]; then
            rmdir "/usr/local/LANDesk/bin"
            [ $?-eq 0 ] && ((ECNT++))
        fi

        if [ $ECNT -eq 0 ]; then
            rmdir "/opt/landesk";
        fi
    fi
    [ -e /tmp/postinstaller ] && rm -f /tmp/postinstaller
    [ -e /tmp/LDMSClient.mpkg.zip ] && rm -f /tmp/LDMSClient.mkpg.zip
    [ -e /tmp/LDMSClient.mpkg ] && rm -f /tmp/LDMSClient.mkpg
}

function killAllProcs(  )
{
    sudo /usr/bin/killall $1
    /bin/ps ax | /usr/bin/grep $1 | grep -v grep | /usr/bin/awk '{print $1}' | /usr/bin/xargs sudo kill -9
}

function stop_processes()
{
    # stop our processes

    if [ -e "/Library/LaunchDaemons" ]; then
        [ -f /bin/launchctl ] && /bin/launchctl unload /Library/LaunchDaemons/com.landesk.*
        [ -f /bin/launchctl ] && /bin/launchctl unload /Library/LaunchAgents/com.landesk.*
        killAllProcs "ldslm"
        killAllProcs "ldtmc"
        killAllProcs "ldcron"
        killAllProcs "lddaemon"
        killAllProcs "LDUserMenu"
        killAllProcs "ldremotelaunch"
        killAllProcs "ldNotificationMonitor"
        killAllProcs "LANDesk Agent"
        killAllProcs "ldav"
    else
        killAllProcs "ldwatch"
        killAllProcs "ldcba"
        killAllProcs "ldslm"
        killAllProcs "ldremote"
        killAllProcs "ldtmc"
        killAllProcs "ldcron"
        killAllProcs "lddaemon"
    fi
}

function remove_crashlogs()
{
    # remove user crash logs
    local loglist="ldcba ldremote ldscan ldwatch ldorwell ldobserve ldremotemenu"

    for app in $loglist
    do
        if [ -e "~/Library/Logs/CrashReporter/$app.crash.log" ]; then
            echo " removing user $app.crash.log"
            sudo rm "~/Library/Logs/CrashReporter/$app.crash.log"
            ((REMOVED++))
        fi

        if [ -e "/Library/Logs/CrashReporter/$app.crash.log" ]; then
            echo " removing system $app.crash.log"
            sudo rm "/Library/Logs/CrashReporter/$app.crash.log"
            ((REMOVED++))
        fi
    done
}

function remove_pidfiles()
{
    if [ -e "/var/run/landesk" ]; then
        echo " removing pid files"
        sudo rm -r "/var/run/landesk"
        ((REMOVED++))
    fi
}

function remove_xinetd_files
{
    # remove Xinet files
    local doomedFiles="LANDeskCBA ldpds1 ldpds2 cba8 pds2"
    for target in $doomedFiles; do

        if [ -e "/etc/xinetd.d/$target" ]; then
            echo " removing $target xinet files"
            sudo rm "/etc/xinetd.d/$target"
            ((REMOVED++))
        fi
    done
}

function remove_netinfo_entries()
{
    # get our system version
    local sysVersion=$(uname -r)
    local sysMajorVersion=${sysVersion%%.*}
    local tempMinorVersion=${sysVersion#*.}
    local sysMinorVersion=${tempMinorVersion%%.*}

    if [ $sysMajorVersion -lt 8 ] ; then
        echo "Uninstaller: Uninstalling Jaguar and Panther items"
        sudo nicl . -delete /services/pds
        sudo nicl . -delete /services/pds1
        sudo nicl . -delete /services/pds2
        sudo nicl . -delete /services/cba8
        sudo nicl . -delete /services/msgsys
    else
        echo "Uninstaller: Uninstalling Tiger or later items"
        sudo dscl . -delete /services/pds
        sudo dscl . -delete /services/pds1
        sudo dscl . -delete /services/pds2
        sudo dscl . -delete /services/cba8
        sudo dscl . -delete /services/msgsys
    fi
}

function remove_service_entries()
{
    echo " removing services entries"
    sudo cp -f /etc/services /etc/services.bak
    sudo /bin/sh -c 'sed -e /cba8/d -e /pds/d -e /pds1/d -e /pds2/d -e /msgsys/d /etc/services.bak > /etc/services'
    sudo rm /etc/services.bak
}

function remove_inet_entries()
{
    echo " removing inet entries"
    sudo cp -f /etc/inetd.conf /etc/inetd.conf.bak
    sudo /bin/sh -c 'sed -e /cba8/d -e /pds/d -e /pds1/d -e /pds2/d -e /msgsys/d /etc/inetd.conf.bak > /etc/inetd.conf'
    sudo rm /etc/inetd.conf.bak
}

function update_xinetd()
{
    if [ -e "/var/run/xinetd.pid" ]; then
        echo " hupping xinetd"
        sudo /usr/bin/killall -HUP xinetd
        sudo /bin/sleep 5
    fi
    if [ ! -e "/var/run/xinetd.pid" ]; then
        # If not Xinet, restart it. (The HUP might kill it if there are no services.)
        echo " restarting xinetd"
        sudo xinetd -pidfile /var/run/xinetd.pid
    fi
}

### main ###

for arg in "$@"; do
    case "$arg" in
        -c)
            CLEAN=1
            ;;
        -h)
            show_help
            exit 1
            ;;
    esac
done

#uninstall ldav to ensure Kaspersky gets uninstalled and agents unloaded properly
remove_ldav

#unload launch agents to ensure are stopped in the proper context
unload_LaunchAgent com.landesk.remotelaunch.plist
unload_LaunchAgent com.landesk.usermenu.plist
unload_LaunchAgent com.landesk.ldNotificationMonitor.plist
unload_LaunchAgent com.landesk.ldusermenu.plist
unload_LaunchAgent com.landesk.dispatch.ui.plist
unload_LaunchAgent com.landesk.dispatch.sui.plist
unload_LaunchAgent com.landesk.ldlaunch_daemon.plist
unload_LaunchAgent com.landesk.ldwatch.plist
unload_LaunchAgent com.landesk.lockscreen.plist
unload_LaunchAgent com.landesk.ldlogged_in.plist
unload_LaunchAgent com.landesk.ldlogged_out.plist
unload_LaunchAgent com.landesk.usermenu.plist

stop_processes

remove_crontab

remove_firewall

remove_tmc

remove_rc

remove_swd

remove_baseagent

remove_framework

remove_gateway

remove_sharedtech

remove_pkg_receipts

remove_crontab

remove_firewall

cleanup_directories

remove_crashlogs

remove_pidfiles

remove_xinetd_files

remove_netinfo_entries

remove_service_entries

remove_inet_entries

remove_Fuze "LANDESK Fuse.app"

remove_Fuze "BridgeIT.app"

update_xinetd

defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL

echo "Cleanup complete: $REMOVED elements were removed."


# vim:ts=4:sw=4

Reproduced in: https://www.cnblogs.com/xgqfrms/p/10216954.html

[C + +] G + + compiler class template error message: template argument 1 is invalid

template< typename T>

NamedObject< typename T> ::NamedObject(const char *name, const T& The definition format of value can be compiled smoothly in VS,

but error: template argument 1 is invalid in GCC and should be defined as removing the second typename

template< typename T>

NamedObject< T> ::NamedObject(const char *name, const T& value)

One of the ways to solve the problem of internal server error in flash learning

Recently in learning flask web development, encountered such a problem, is according to the book on the code, run is an Internal server error, because halfway to learn for the sake of convenience, to switch to pycharm to develop, pycharm automatically help me to create a virtual environment, the book says the venv can I do not pollute the environment, but in fact I use, because the initial development on sublime does directly, cause I have a lot of local module, reoccupy pycharm, I changed the environment variable a lot, changed it all to venV, and then this error happened, you can try to delete VENV, use the native environment, and at the same time, change the environment variable back to the native, you can use it. Personal analysis, think should be two environments exist some kind of conflict.

Reproduced in: https://www.cnblogs.com/sgatbl/p/9134283.html

[Android test] solution for error closed after the carriage return of the ADB shell

2019 Unicorn enterprise heavily recruited Python engineer standard & GT; > >

Phenomenon 1: In the process of Monkey test by connecting USB with mobile phone, start a CMD window to input again, and error Closed appears after ADB shell returns. In some cases, this can happen with some cell phones.
Phenomenon 2: Unable to install ***. Apk on device ‘019417a3’: Unable to open Sync Connection!
Personally, I think the reasons for both phenomena are the same.
The solution is as follows:

One: Restart your computer, then look up your phone on your computer and start Eclipse
Second: Mobile phone – Settings – applications – development – USB debugging on and off again
Third: restart the phone, usb debugging on and off again.
Fourth: Try “adb kill-server” and then “adb start-Server “under CMD.
Personally, the second and third methods are more practical

Reproduced in: https://my.oschina.net/u/199776/blog/330604

com.apple.installer . pagecontroller error – 1 PKG installation error

Downloaded a PKG installation file on the Internet;
An error occured on a dozen installations on a MAC

The reason is that the file is directly downloaded from the Internet, there will be permission problems, need to repair the installation permission of the installation software;
My reason is, downloaded is a RAR MAC decompression can not, online decompression, got PKG installation error
I finally downloaded a MAC under the RAR decompression software
http://www.pc6.com/softview/SoftView_53196.html
Reference: https://discussions.apple.com/thread/2628710