working on it ...

Filters

Explore Public Snippets

Sort by

Found 32k snippets matching: open

    public by lbottaro modified Feb 16, 2013  463102  0  7  0

    Excel function to calculate the average of positive data in range

    This excel function calculate the average of a specific range of cells, regarding only positive values. Zero or less than zero value won't be used in average calculation. The italian version of this snippet can be used as well on OpenOffice 3.
    =SUMIF(B2:B6;">0")/MAX(COUNTIF(B2:B6;">0");1)
    
    # Italian version
    =SOMMA.SE(B2:B6;">0")/MAX(CONTA.SE(B2:B6;">0");1)

    public by teslamint modified Jun 25, 2013  234630  0  4  0

    modified version of coova-chilli patch for OpenWrt. This patch re-add firewall rules when reload firewall. https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html

    modified version of coova-chilli patch for OpenWrt. This patch re-add firewall rules when reload firewall. https://lists.openwrt.org/pipermail/openwrt-devel/2012-December/018075.html: coova-1.3.0-custom.patch
    Index: files/chilli.init
    ===================================================================
    --- files/chilli.init   (리비전 0)
    +++ files/chilli.init   (리비전 0)
    @@ -0,0 +1,61 @@
    +#!/bin/sh /etc/rc.common
    +
    +START=30
    +STOP=90
    +
    +config_cb() {
    +    chilli_inst=$2
    +    if [ "$chilli_inst" != "" ]
    +    then
    +       rm -f /var/run/chilli_${chilli_inst}*
    +       chilli_conf=/var/run/chilli_${chilli_inst}.conf
    +       eval "start_chilli_$chilli_inst=1"
    +    fi
    +}
    +
    +option_cb() {
    +    case "$1" in
    +        # UCI settings
    +       network)
    +           . /lib/functions/network.sh
    +           local ifname
    +           network_get_device ifname $2
    +           echo "dhcpif=\"$ifname\"" >> $chilli_conf
    +           ;;
    +       disabled)
    +           eval "start_chilli_$chilli_inst=0"
    +           ;;
    +        # boolean settings
    +       dhcpbroadcast|nodynip|vlanlocation|locationstopstart|locationcopycalled|locationimmediateupdate|locationopt82|coanoipcheck|noradallow|proxymacaccept|proxyonacct|dhcpmacset|dhcpradius|noc2c|eapolenable|uamanydns|uamanyip|uamnatanyip|nouamsuccess|nowispr1|nowispr2|domaindnslocal|radsec|macauth|macreauth|macauthdeny|macallowlocal|strictmacauth|strictdhcp|ieee8021q|only8021q|radiusoriginalurl|swapoctets|statusfilesave|wpaguests|openidauth|papalwaysok|mschapv2|chillixml|acctupdate|dnsparanoia|seskeepalive|usetap|noarpentries|framedservice|scalewin|redir|injectwispr|redirurl|routeonetone|nousergardendata|uamgardendata|uamotherdata|withunixipc|uamallowpost|redirssl|uamuissl|layer3|patricia|redirdnsreq|dhcpnotidle|ipv6|ipv6only)
    +           [ "$2" = "true" -o "$2" = "1" ] && echo "$1" >> $chilli_conf
    +           ;;
    +       *)
    +           echo "$1=\"$2\"" >> $chilli_conf
    +           ;;
    +    esac
    +}
    +
    +start_chilli() {
    +    local cfg="$1"
    +    local start_chilli=$(eval "echo \$start_chilli_$cfg")
    +    [ "$start_chilli" = "0" ] && return
    +    local base=/var/run/chilli_${cfg}
    +    chilli -c ${base}.conf \
    +       --pidfile ${base}.pid \
    +       --cmdsocket ${base}.sock \
    +       --unixipc ${base}.ipc &
    +}
    +
    +start() {
    +    config_load chilli
    +    config_foreach start_chilli chilli
    +}
    +
    +stop() {
    +    ls /var/run/chilli*.pid 2>/dev/null && {
    +       kill $(cat /var/run/chilli*.pid)
    +       sleep 1
    +       killall -9 chilli &
    +       rm -f /var/run/chilli*
    +    }
    +}
    Index: files/chilli.firewall
    ===================================================================
    --- files/chilli.firewall       (리비전 0)
    +++ files/chilli.firewall       (리비전 0)
    @@ -0,0 +1,33 @@
    +#!/bin/sh
    +
    +chilli_firewall() {
    +    local cfg="$1"
    +    local tun ipup addr mask net dhcpif uamport uamuiport
    +
    +    config_get tun "$cfg" tundev
    +    config_get ipup "$cfg" ipup
    +    config_get addr "$cfg" uamlisten
    +    config_get net "$cfg" net
    +    config_get dhcpif "$cfg" dhcpif
    +    config_get uamport "$cfg" uamport
    +    config_get uamuiport "$cfg" uamuiport
    +
    +    if [ -f /var/run/chilli.$tun.sh ]; then
    +        [ "$(iptables -t filter -vL | grep $tun)" != "" ] && . /var/run/chilli.$tun.sh
    +        DEV=$tun
    +        ADDR=$addr
    +        MASK=255.255.255.0
    +        NET=$net
    +        DHCPIF=$dhcpif
    +        UAMPORT=$uamport
    +        UAMUIPORT=$uamuiport
    +        . $ipup
    +    fi
    +
    +}
    +
    +chilli_post_core_cb() {
    +    config_load chilli
    +    config_foreach chilli_firewall chilli
    +}
    +
    Index: Makefile
    ===================================================================
    --- Makefile    (리비전 37020)
    +++ Makefile    (작업 사본)
    @@ -8,16 +8,13 @@
     include $(TOPDIR)/rules.mk
    
     PKG_NAME:=coova-chilli
    -PKG_VERSION:=1.2.9
    +PKG_VERSION:=1.3.0
     PKG_RELEASE:=1
    
     PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
    -PKG_SOURCE_URL:=http://ap.coova.org/chilli
    -PKG_MD5SUM:=a493d0562fc3b05fe86d8ad65f7f2dc0
    +PKG_SOURCE_URL:=http://coova-chilli.s3.amazonaws.com/
    +PKG_MD5SUM:=dc0037e3cdebcb60508081b4e42e984a
    
    -PKG_FIXUP:=autoreconf
    -PKG_INSTALL:=1
    -
     include $(INCLUDE_DIR)/package.mk
    
     define Package/coova-chilli
    @@ -25,33 +22,102 @@
       SECTION:=net
       CATEGORY:=Network
       DEPENDS:=+kmod-tun +librt
    -  TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version)
    -  URL:=http://www.coova.org/CoovaChilli
    +  TITLE:=Wireless LAN HotSpot controller
    +  URL:=http://www.coova.org/
     endef
    
    +define Package/coova-chilli-miniportal
    +  SUBMENU:=Captive Portals
    +  SECTION:=net
    +  CATEGORY:=Network
    +  DEPENDS:=+coova-chilli
    +  TITLE:=CoovaChilli MiniPortal
    +  URL:=http://www.coova.org/
    +endef
    +
     define Package/coova-chilli/description
            CoovaChilli is an open source access controller for wireless LAN
            access points and is based on ChilliSpot. It is used for authenticating
            users of a wireless (or wired) LAN. It supports web based login (UAM)
    -       which is today's standard for public HotSpots and it supports Wireless
    -       Protected Access (WPA) which is the standard of the future.
    -       Authentication, authorization and accounting (AAA) is handled by your
    -       favorite radius server.
    +       which is today's standard for public HotSpots and it supports Wireless Protected
    +       Access (WPA) which is the standard of the future. Authentication,
    +       authorization and accounting (AAA) is handled by your favorite
    +       radius server.
     endef
    
    -define Package/coova-chilli/conffiles
    -/etc/chilli.conf
    +define Build/Configure
    +  (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
    +               $(TARGET_CONFIGURE_OPTS) \
    +                CFLAGS="$(strip $(TARGET_CFLAGS)) -DNEED_DN_SKIPNAME" \
    +                CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
    +                LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
    +               ac_cv_func_malloc_0_nonnull=yes \
    +               ac_cv_func_realloc_0_nonnull=yes \
    +               ac_cv_func_memcmp_working=yes \
    +               ac_cv_func_setvbuf_reversed=no \
    +                ./configure \
    +                       --target=$(GNU_TARGET_NAME) \
    +                       --host=$(GNU_TARGET_NAME) \
    +                       --build=$(GNU_HOST_NAME) \
    +                       --program-prefix="" \
    +                       --program-suffix="" \
    +                       --prefix=/usr \
    +                       --sysconfdir=/etc \
    +                       --exec-prefix=/usr \
    +                       --bindir=/usr/bin \
    +                       --datadir=/usr/share \
    +                       --includedir=/usr/include \
    +                       --infodir=/usr/share/info \
    +                       --libdir=/usr/lib \
    +                       --libexecdir=/usr/lib \
    +                       --localstatedir=/var \
    +                       --mandir=/usr/share/man \
    +                       --sbindir=/usr/sbin \
    +                       --enable-shared \
    +                       --disable-static \
    +                       --with-gnu-ld \
    +                       --enable-miniconfig \
    +                       --enable-miniportal \
    +                       --enable-chilliredir \
    +                       --enable-chilliproxy \
    +                       --enable-binstatusfile \
    +        );
     endef
    
    +define Build/Compile
    +       $(MAKE) -C $(PKG_BUILD_DIR) \
    +               DESTDIR="$(PKG_INSTALL_DIR)" \
    +               all install
    +endef
    +
    +define Build/InstallDev
    +       $(INSTALL_DIR) $(1)/usr/include
    +       $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
    +       $(INSTALL_DIR) $(1)/usr/lib
    +       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib/
    +endef
    +
    +
    +define Package/coova-chilli-miniportal/install
    +       $(INSTALL_DIR) $(1)/etc/chilli
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/www $(1)/etc/chilli/
    +endef
    +
     define Package/coova-chilli/install
    -       $(INSTALL_DIR) $(1)/etc
    -       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
    -       $(INSTALL_DIR) $(1)/etc/chilli
    -       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/
    +       $(INSTALL_DIR) $(1)/etc/chilli
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/up.sh $(1)/etc/chilli/
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/down.sh $(1)/etc/chilli/
    +       $(CP) $(PKG_INSTALL_DIR)/etc/chilli/wwwsh $(1)/etc/chilli/
    +       $(INSTALL_DIR) $(1)/etc/init.d
    +       $(CP) files/chilli.init $(1)/etc/init.d/chilli
    +       $(INSTALL_DIR) $(1)/lib/firewall
    +       $(CP) files/chilli.firewall $(1)/lib/firewall/chilli.sh
            $(INSTALL_DIR) $(1)/usr/sbin
    -       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
    +       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
            $(INSTALL_DIR) $(1)/usr/lib/
            $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
     endef
    
     $(eval $(call BuildPackage,coova-chilli))
    +$(eval $(call BuildPackage,coova-chilli-miniportal))
    
    

    public by Carlos Rosquillas modified Jul 2, 2014  183592  0  4  0

    Open

    Open: gistfile1.m
    #import "Open.h"
    
    @implementation Open
    
    - (void)open:(CDVInvokedUrlCommand*)command
    {
        __weak Open* this = self;
        
        CDVPluginResult* commandResult = nil;
    
        NSString* path = [command.arguments objectAtIndex:0];
    
        if (path != nil && [path length] > 0) {
    
            NSURL* url = [NSURL URLWithString:path];
            NSError* err;
    
            if (url.isFileURL && [url checkResourceIsReachableAndReturnError:&err] == YES) {
    
                QLPreviewController* previewCtrl = [[QLPreviewController alloc] init];
                previewCtrl.delegate = this;
                previewCtrl.dataSource = this;
    
                UIViewController* context = [[[UIApplication sharedApplication] keyWindow] rootViewController];
                [context presentViewController:previewCtrl animated:YES completion:nil];
    
                NSLog(@"cordova.bridge.open - Success!");
                commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@""];
    
            } else {
                NSLog(@"cordova.bridge.open - Invalid file URL");
                commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
            }
        } else {
            NSLog(@"cordova.bridge.open - Missing URL argument");
            commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
        }
    
        [this.commandDelegate sendPluginResult:commandResult callbackId:command.callbackId];
    }
    
    #pragma - QLPreviewControllerDataSource Protocol
    
    - (NSInteger) numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller
    {
        return 1;
    }
    
    - (id <QLPreviewItem>) previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
    {
        return self;
    }
    
    #pragma - QLPreviewItem Protocol
    
    - (NSURL*)previewItemURL
    {
        return self.url;
    }
    
    @end
    
    
    

    public by RSrini modified May 14, 2015  151272  1  3  0

    pkg-config opencv

    pkg-config opencv: pkg-config-opencv
    pkg-config opencv --cflags
    pkg-config opencv --libs
    pkg-config opencv --modversion
    
    
    
    

    public by cghersi modified Apr 10, 2014  6560  3  9  5

    How to open a dockable window in Notepad++ in C#

    This code has been refined thanks to the hints given in the Plugin Tutorial Demo that can be found here: https://sourceforge.net/projects/sourcecookifier/files/other%20plugins/NppPlugin.NET.v0.5.zip/download
    public static void OpenForm(Form form, string title, int dialogID)
    {
        NppTbData _nppTbData = new NppTbData();
        _nppTbData.hClient = form.Handle;
        _nppTbData.pszName = title;
    
        // the dlgDlg should be the index of funcItem where the current function pointer is in
        _nppTbData.dlgID = dialogID;
    
        // define the default docking behaviour
        _nppTbData.uMask = NppTbMsg.DWS_DF_CONT_RIGHT | NppTbMsg.DWS_ICONTAB | NppTbMsg.DWS_ICONBAR;
        //_nppTbData.hIconTab = (uint)tbIcon.Handle;
        _nppTbData.pszModuleName = PluginName;
        IntPtr _ptrNppTbData = Marshal.AllocHGlobal(Marshal.SizeOf(_nppTbData));
        Marshal.StructureToPtr(_nppTbData, _ptrNppTbData, false);
    
        try
        {
            SendMessage(nppData._nppHandle, NppMsg.NPPM_DMMREGASDCKDLG, 0, _ptrNppTbData);
        }
        catch (Exception exc)
        {
            if (log != null)
                log.ErrorFormat("Cannot open form due to {0}", exc.Message);
        }
    }
    
    
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
    public struct NppTbData
    {
        public IntPtr hClient;            // HWND: client Window Handle
        public string pszName;            // TCHAR*: name of plugin (shown in window)
        public int dlgID;                // int: a funcItem provides the function pointer to start a dialog. Please parse here these ID
        // user modifications
        public NppTbMsg uMask;                // UINT: mask params: look to above defines
        public uint hIconTab;            // HICON: icon for tabs
        public string pszAddInfo;        // TCHAR*: for plugin to display additional informations
        // internal data, do not use !!!
        public RECT rcFloat;            // RECT: floating position
        public int iPrevCont;           // int: stores the privious container (toggling between float and dock)
        public string pszModuleName;    // const TCHAR*: it's the plugin file name. It's used to identify the plugin
    }
    
    
    [DllImport("user32")]
    public static extern IntPtr SendMessage(IntPtr hWnd, NppMsg Msg, int wParam, IntPtr lParam);
    

    public by Mark McKenna modified Jan 12, 2016  58682  1  3  0

    OpenKeychain Linked Identity

    OpenKeychain Linked Identity: openpgp.txt
    This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
    
    Token for proof:
    [Verifying my OpenPGP key: openpgp4fpr:a7a924de638c681a8deafad42b5dc759b1eb76a7]
    
    

    public by JKCPR modified Sep 26, 2014  4584  2  7  4

    Rich Snippet Data Layout Examples

    Open Graph, Rich Snippet Data, SEO. Layouts include -Minimal on page - Standard Twitter Card - Advanced Authorship - Business Markup - Product Markup G+, Twitter & FB layouts
    Minimal OG 
    +++++++++++++++++++++++++++++++++++++++
    
    
    <!-- Place this data between the <head> tags of your website -->
    <title>Page Title. Maximum length 60-70 characters</title>
    <meta name="description" content="Page description. No longer than 155 characters." />
    
    <!-- Twitter Card data -->
    <meta name="twitter:card" value="summary">
    
    <!-- Open Graph data -->
    <meta property="og:title" content="Title Here" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="http://www.example.com/" />
    <meta property="og:image" content="http://example.com/image.jpg" />
    <meta property="og:description" content="Description Here" />
    
    
    Standard OG
    +++++++++++++++++++++++++++++++++++++++++
    
    
    Standard Social Media Tag Template: Article
    
    <!-- Place this data between the <head> tags of your website -->
    <title>Page Title. Maximum length 60-70 characters</title>
    <meta name="description" content="Page description. No longer than 155 characters." />
    
    <!-- Twitter Card data -->
    <meta name="twitter:card" content="summary">
    <meta name="twitter:site" content="@publisher_handle">
    <meta name="twitter:title" content="Page Title">
    <meta name="twitter:description" content="Page description less than 200 characters">
    <meta name="twitter:creator" content="@author_handle">
    <-- Twitter Summary card images must be at least 200x200px -->
    <meta name="twitter:image" content="http://www.example.com/image.jpg">
    
    <!-- Open Graph data -->
    <meta property="og:title" content="Title Here" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="http://www.example.com/" />
    <meta property="og:image" content="http://example.com/image.jpg" />
    <meta property="og:description" content="Description Here" /> 
    <meta property="og:site_name" content="Site Name, i.e. Moz" />
    <meta property="fb:admins" content="Facebook numeric ID" />
    
    
    FULL MONTY OG SHOWTIME
    ++++++++++++++++++++++++++++++++++++++++
    
    Full Social Media Tag Template: Article
    
    <!-- Update your html tag to include the itemscope and itemtype attributes. -->
    <html itemscope itemtype="http://schema.org/Article">
    
    <!-- Place this data between the <head> tags of your website -->
    <title>Page Title. Maximum length 60-70 characters</title>
    <meta name="description" content="Page description. No longer than 155 characters." />
    
    <!-- Google Authorship and Publisher Markup -->
    <link rel="author" href="https://plus.google.com/[Google+_Profile]/posts"/>
    <link rel="publisher" href=”https://plus.google.com/[Google+_Page_Profile]"/>
    
    <!-- Schema.org markup for Google+ -->
    <meta itemprop="name" content="The Name or Title Here">
    <meta itemprop="description" content="This is the page description">
    <meta itemprop="image" content="http://www.example.com/image.jpg">
    
    <!-- Twitter Card data -->
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@publisher_handle">
    <meta name="twitter:title" content="Page Title">
    <meta name="twitter:description" content="Page description less than 200 characters">
    <meta name="twitter:creator" content="@author_handle">
    <!-- Twitter summary card with large image must be at least 280x150px -->
    <meta name="twitter:image:src" content="http://www.example.com/image.html">
    
    <!-- Open Graph data -->
    <meta property="og:title" content="Title Here" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="http://www.example.com/" />
    <meta property="og:image" content="http://example.com/image.jpg" />
    <meta property="og:description" content="Description Here" />
    <meta property="og:site_name" content="Site Name, i.e. Moz" />
    <meta property="article:published_time" content="2013-09-17T05:59:00+01:00" />
    <meta property="article:modified_time" content="2013-09-16T19:08:47+01:00" />
    <meta property="article:section" content="Article Section" />
    <meta property="article:tag" content="Article Tag" />
    <meta property="fb:admins" content="Facebook numberic ID" />
    
    
    PRODUCT TEMPLATE
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++
    
    Product Social Media Tag Template
    
    <!-- Update your html tag to include the itemscope and itemtype attributes. -->
    <html itemscope itemtype="http://schema.org/Product">
    
    <!-- Place this data between the <head> tags of your website -->
    <title>Page Title. Maximum length 60-70 characters</title>
    <meta name="description" content="Page description. No longer than 155 characters." />
    
    <!-- Schema.org markup for Google+ -->
    <meta itemprop="name" content="The Name or Title Here">
    <meta itemprop="description" content="This is the page description">
    <meta itemprop="image" content="http://www.example.com/image.jpg">
    
    <!-- Twitter Card data -->
    <meta name="twitter:card" content="product">
    <meta name="twitter:site" content="@publisher_handle">
    <meta name="twitter:title" content="Page Title">
    <meta name="twitter:description" content="Page description less than 200 characters">
    <meta name="twitter:creator" content="@author_handle">
    <meta name="twitter:image" content="http://www.example.com/image.html">
    <meta name="twitter:data1" content="$3$3">
    <meta name="twitter:label1" content="PricePrice">
    <meta name="twitter:data2" content="BlackBlack">
    <meta name="twitter:label2" content="ColorColor">
    
    <!-- Open Graph data -->
    <meta property="og:title" content="Title Here" />
    <meta property="og:type" content="article" />
    <meta property="og:url" content="http://www.example.com/" />
    <meta property="og:image" content="http://example.com/image.jpg" />
    <meta property="og:description" content="Description Here" />
    <meta property="og:site_name" content="Site Name, i.e. Moz" />
    <meta property="og:price:amount" content="15.0015.00" />
    <meta property="og:price:currency" content="USDUSD" />
    
    BUSINESS MARKUP
    +++++++++++++++++++++++++++++++++
    
    <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# business: http://ogp.me/ns/business#">
      <meta property="fb:app_id"                            content="302184056577324" /> 
      <meta property="og:type"                              content="business.business" /> 
      <meta property="og:url"                               content="Put your own URL to the object here" /> 
      <meta property="og:title"                             content="Sample Business" /> 
      <meta property="og:image"                             content="https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png" /> 
      <meta property="business:contact_data:street_address" content="Sample Contact data: Street Address" /> 
      <meta property="business:contact_data:locality"       content="Sample Contact data: Locality" /> 
      <meta property="business:contact_data:postal_code"    content="Sample Contact data: Postal Code" /> 
      <meta property="business:contact_data:country_name"   content="Sample Contact data: Country Name" /> 
      <meta property="place:location:latitude"              content="Sample Location: Latitude" /> 
      <meta property="place:location:longitude"             content="Sample Location: Longitude" /> 
    
    

    public by johansonkatherine modified Jun 19, 2014  2851  3  6  1

    PHP Code to Protect a Word Document Using Aspose for Cloud API

    The following technical tip shows how php developers can protect their word documents in cloud using Aspose for Cloud SDK in php.
    use Aspose\Cloud\Common\AsposeApp;
    use Aspose\Cloud\Common\Product;
    use Aspose\Cloud\Common\Utils;
    use Aspose\Cloud\Words\Document;
    
    /**** Section 1 ****/
    Product::$baseProductUri = 'http://api.aspose.com/v1.1';
    AsposeApp::$appSID = "xxxxxxxxxxxxxxxxxxxxxxxx";
    AsposeApp::$appKey = "xxxxxxxxxxxxxxxxxxxxxxxx";
    AsposeApp::$outPutLocation = getcwd() . "/output/";
    /**** End Section 1 ****/
    
    /**** Section 2 ****/
    $fileName = "Test.docx";
    $password = "123456";
    $protectionType = "AllowOnlyComments";
    
    $doc = new Document($fileName);
    $result = $doc->protectDocument($password, $protectionType);
    /**** End Section 2 ****/
    			

    public by AndreaBuffa modified Jun 14, 2014  1912  7  5  2

    Open a subshell remotely

    Suppose you want a script that create a tar, copy and unzip it on a server...
    //  A typical use is when you are working on a web site locally and you want to deploy it to a server.
    tar -C . -cf - "$dirname" | ssh user@192.168.0.254 "tar -C /www/ -xvf -; # other commands.."
    // furthermore you can add whatever command you want, like chmod for your files permissions.. 
    

    public by Tech_JA modified Jan 15, 2015  2055  0  6  0

    Open new activity

    Intent i = new Intent(getApplicationContext(), nextscreen.class);
    StartActivity(i);
    • Public Snippets
    • Channels Snippets