OSX Sierra version 10.12.6
if you are getting error like
ERROR: Could not find a valid gem '<some package name>' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
test your TLS v1.2 support
| 'Activate SAP GUI Scripting API in references library. | |
| 'If unavailable in reference library, locate file at C:\program files (x86)\sap\frontend\sapgui\sapfewse.ocx | |
| 'Refer to SAP GUI Scripting API Documentation: | |
| 'https://wiki.scn.sap.com/wiki/display/ATopics/SAP+GUI+Scripting | |
| Sub SAPGUIScripting() | |
| Public objGui As GuiApplication | |
| Public objConn As GuiConnection | |
| Public objSess As GuiSession |
OSX Sierra version 10.12.6
if you are getting error like
ERROR: Could not find a valid gem '<some package name>' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
test your TLS v1.2 support
| # rename MP3 files based on metadata (named artist and title) | |
| # copy this script in the same directory as the MP3 files and run | |
| # renamed MP3 are copied to renamed/ | |
| mkdir renamed; | |
| for f in *.mp3; do | |
| TITLE=`ffmpeg -i "$f" 2>&1 | grep title | sed "s/ \+title \+: //"`; | |
| ARTIST=`ffmpeg -i "$f" 2>&1 | grep artist | sed "s/ \+artist \+: //"`; | |
| TRACK=`ffmpeg -i "$f" 2>&1 | grep track | sed "s/ \+track \+: //"`; | |
| ZERO_TRACK=$(printf %02d ${TRACK}); # zero-padded track number |
| Sub Prueba() | |
| 'Visto en: https://es.stackoverflow.com/questions/183891/error-de-subindice-fuera-de-intervalo-en-excel-macros-vda | |
| Dim ss As Workbook | |
| Dim archivo As Workbook | |
| Dim nombreArchivo As Variant | |
| Set ss = ActiveWorkbook | |
| nombreArchivo = Application.GetOpenFilename(FileFilter:="Excel Files,*.xl*;*.xm*") |
| class Karatsuba | |
| # Multiply two numbers using the Karatsuba | |
| # multiplication algorithm | |
| def multiply(num_1, num_2) | |
| if num_1 < 10 || num_2 < 10 | |
| return num_1 * num_2 | |
| end | |
| m_2 = [num_1.to_s.length, num_2.to_s.length].max/2 | |
| # Split the digit sequences about the middle | |
| high_1, low_1 = num_1.divmod(10**m_2) |
| #! /usr/local/bin/ruby | |
| # coding: utf-8 | |
| # -------------------------------------- | |
| # Check a prime number | |
| # -------------------------------------- | |
| def is_prime(n) | |
| res = (2..Math.sqrt(n)).any? { |i| n % i == 0 } | |
| puts "#{n}: #{res || n == 1 ? '-----' : "PRIME"}" | |
| end |
| lsof -Pnl +M -i4 |
| SELECT salesTable.saleDate, salesTable.saleAmount, 'Reno' AS city, salesTable.reno AS saleQuantity | |
| FROM salesTable | |
| WHERE salesTable.reno > 0 | |
| UNION | |
| SELECT salesTable.saleDate, salesTable.saleAmount, 'Salt Lake City' AS city, salesTable.saltLakeCity AS saleQuantity | |
| FROM salesTable | |
| WHERE salesTable.saltLakeCity > 0 |
| #!/usr/bin/env ruby | |
| # Reads an Excel and writes as JSON | |
| # - Assumes header row containing field names, first sheet is read | |
| # - Keeps null values | |
| # | |
| # TODO: | |
| # - accept filename and read based on extension (xlsx, xls, csv). | |
| # - output actual JSON. | |
| # - clean up. |