7 – Incorrect string value: ‘xF0x9Fx92x99’ for column “‘comment_body_value'”

How can I fix the following error I get from a Drupal 7 site?

Incorrect string value: ‘xF0x9Fx92x99’ for column “‘comment_body_value’

I read it is about users posting emojis that cannot be handled by Drupal/MySQL.

I don’t care if the comments are being stripped off the emojis, or converted as long as it does not trigger an error to the end-user. The simpler the solution the better.
I found a few modules, for example the Emoji Scrub module that isn’t covered by the security advisory policy.

Is my singly linked list python code incorrect?

I would first like to address that I am new to both Stack Exchange and data structures. After foolishly posting this question on stackoverflow another user kindly directed me here. Before you read any further I apologise for any bad formatting as this is my first question. Thanks.

I have recently tried converting a singly linked list from a C program into my own python program. I have tested the code myself but I am still unsure if the program has been converted properly. I would like someone to peer review my code to see if there are any errors in methodology, too many methods, any missing methods, etc.

I have tried implementing some of my own singly linked list operations based from the advice from this website: https://afteracademy.com/blog/types-of-linked-list-and-operation-on-linked-list

The original C Program: https://people.eng.unimelb.edu.au/ammoffat/ppsaa/c/listops.c

My own python code:

class Node():
        
    # Node for a single linked list
    def __init__(self, data):
        self.data = data
        self.next = None
        


class LinkedList():

    def __init__(self):
        self.head = None
        self.foot = None

    def length(self):

        '''Returns the length of a linked list.'''

        current_node = self.head
        node_total = 0
        while (current_node != None):
            node_total += 1
            current_node = current_node.next
        return node_total

    def is_empty_list(self):

        '''Checks if a linked list is empty.'''

        return self.head == None

    def stack_insert(self, data):

        '''Inserts a node at the HEAD of the list;
           LIFO (Last In, First Out).'''

        new_node = Node(data)
        # Makes new_node.next point to next node (defualt None if 1st insertion)
        new_node.next = self.head
        # Makes the HEAD of linked list point to new node
        self.head = new_node

        if (self.foot == None):
            # First insertion into linked list; node becomes HEAD & FOOT
            self.foot = new_node

    def queue_append(self, data):

        '''Appends a node at the FOOT of the list;
           FIFO (First In, First Out).'''

        new_node = Node(data)
        
        if (self.head == None):
            # First insertion into linked list; node becomes HEAD & FOOT
            self.head = self.foot = new_node
        
        else:
            # Makes the original last node point to the newly appended node
            self.foot.next = new_node
            # Makes the newly appended list as the official FOOT of the linked list
            self.foot = new_node

    def insert_after(self, data, index):

        '''Inserts a NEW node AFTER a specific node indicated by index.'''

        # Need to ensure provided index is within range
        if (index < 0):
            print("ERROR: 'insert_after' Index cannot be negative!")
            return
        elif (index > (self.length() -1)):
            print("ERROR: 'insert_after' Index exceeds linked list range!")
            return

        # Use stack_insert to insert as first item
        elif (self.is_empty_list()) or (index == 0):
            self.stack_insert(data)
            return

        # Use queue_insert to append as last item
        elif (index == (self.length() -1)):
            self.queue_append(data)
            return

        new_node = Node(data)
        prior_node = self.head
        current_node = self.head
        search_index = 0
        
        # Keep traversering through nodes until desired node
        while (search_index != index):
            prior_node = current_node
            current_node = current_node.next
            search_index += 1
        
        # Makes prior node is point to target node
        prior_node = current_node
        # Makes current node point to the node AFTER target node (default None of last node)
        current_node = current_node.next

        # Makes target node point to newly added node
        prior_node.next = new_node
        # Makes newly added node point to original node that WAS AFTER target node
        new_node.next = current_node


    def delete_head(self):

        '''Deletes the HEAD node.'''

        # Linked list is empty
        if self.is_empty_list():
            return

        old_head = self.head
        # Adjusts the head pointer to step past original HEAD
        self.head = self.head.next

        if (self.head == None):
            # The only node just got deleted
            self.foot = None

    def delete_foot(self):

        '''Deletes the FOOT node.'''

        # Linked list is empty
        if self.is_empty_list():
            return

        old_foot = self.foot
        prior_node = self.head
        current_node = self.head

        # Need to keep cycling until final node is reached
        while (current_node.next != None):
            prior_node = current_node
            current_node = current_node.next
        
        # Adjust newly FOOT node to point to nothing
        prior_node.next = None
        # Makes linked list forget about original FOOT node
        self.foot = prior_node

    def delete_node(self, index):

        '''Deletes a target node via index.'''

        # Linked list is empty
        if self.is_empty_list():
            return

        # Need to ensure index is within proper range
        elif (index < 0):
            print("ERROR: 'delete_node' Index cannot be negative!")
            return
        elif (index > (self.length() -1)):
            print("ERROR: 'delete_node' Index exceeds linked list range")
            return
        
        prior_node = self.head
        current_node = self.head
        search_index = 0

        # Keep travsersing though nodes until desired node
        while (search_index != index):
            prior_node = current_node
            current_node = current_node.next
            search_index += 1

        # Adjusts node PRIOR to target node to point to the node the AFTER target node
        prior_node.next = current_node.next

    def update_node(self, new_data, index):

        '''Updates target node data via index.'''

        # Linked list is empty
        if self.is_empty_list():
            print("ERROR: 'update_node' Linked list is empty; no node data to update!")
            return
        
        # Need to ensure index is within proper range
        elif (index < 0):
            print("ERROR: 'update_node' Index cannot be negative!")
            return
        elif (index > (self.length() -1)):
            print("ERROR: 'update_node' Index exceeds linked list range!")

        current_node = self.head
        search_index = 0

        # Keep traversing through nodes until desired node
        while (search_index != index):
            current_node = current_node.next
            search_index += 1

        # Can now change data
        current_node.data = new_data

    def get_node_data(self, index):

        '''Extracts that data from a specific node via index.'''

        # Linked list is empty
        if self.is_empty_list():
            print("ERROR: 'update_node' Linked list is empty; no node data to update!")
            return
        
        # Need to ensure index is within proper range
        elif (index < 0):
            print("ERROR: 'update_node' Index cannot be negative!")
            return
        elif (index > (self.length() -1)):
            print("ERROR: 'update_node' Index exceeds linked list range!")

        # Index matches HEAD or FOOT
        if (index == 0):
            return self.head.data
        elif (index == (self.length() -1)):
            return self.foot.data
        
        current_node = self.head
        search_index = 0

        # Keep traversing though nodes until desired node
        while (search_index != index):
            current_node = current_node.next
            search_index += 1
        
        return current_node.data

terminal – Gvim loads incorrect colorscheme unless I run the command again

In my ~/.vimrc file, I have my colors set up like this:

" Access colors present in 256 colorspace
let base16colorspace=256

" Vim colorscheme
colorscheme default

" Lightline colorscheme
let g:lightline = { 'colorscheme': 'base16' }

default refers to a colorscheme file generated by base16-universal-manager. The UI and syntax highlighting loads fine in vim. :colorscheme reports base16-onedark.

vim with base16 theme

However, when Gvim loads, it seems like the UI has correct colors, but the syntax highlighting has different colors. :colorscheme reports base16-onedark.

gvim with incorrect colors

I couldn’t figure out what was wrong. I didn’t have a ~/.gvimrc file. I tried creating one with the colorscheme setting. I tried shortening the setting name to color. I deleted that file since it didn’t help.

I found out that the correct colors get applied when I select the theme in the menu under Edit > Color Scheme. I ended up figuring out that did the same thing as specifying the theme as a command. I entered the same thing in ~/.vimrc and it worked. :colorscheme default. :colorscheme reports base16-onedark.

gvim with correct colors

Except when I exit and restart Gvim, it goes back to the wrong colors.

~/.vimrc in its entirety:

" ~/.vimrc ======================================

" Plugins ---------------------------------------

" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')

" Sensible universal defaults
Plug 'tpope/vim-sensible'

" Lightline statusline/tabline
Plug 'itchyny/lightline.vim'

" base16 lightline
Plug 'daviesjamie/vim-base16-lightline'

" Language pack
Plug 'sheerun/vim-polyglot'

" Indent guides
Plug 'nathanaelkane/vim-indent-guides'

" Comment stuff out
Plug 'tpope/vim-commentary'

" Git gutter
Plug 'airblade/vim-gitgutter'

" Tree explorer
Plug 'scrooloose/nerdtree'

" Iconify vim plugins; Needs to be loaded last
Plug 'ryanoasis/vim-devicons', { 'on': 'NERDTreeToggle' }

" Initialize plugin system
call plug#end()

" Colors ----------------------------------------

" Access colors present in 256 colorspace
let base16colorspace=256

" Vim colorscheme
colorscheme default

" Lightline colorscheme
let g:lightline = { 'colorscheme': 'base16' }

" Spaces & tabs ---------------------------------

" Number of visual spaces per TAB
set tabstop=2

" Number of spaces in tab when editing
set softtabstop=2

" Convert tabs to spaces
set expandtab

" Indent size
set shiftwidth=2

" Show indent guides by default
" let g:indent_guides_enable_on_vim_startup = 1

" UI config -------------------------------------

" Show line numbers
set number

" Show command in bottom bar
set showcmd

" Highlight current line
set cursorline

" Redraw only when we need to
set lazyredraw

" Hide mode information already shown in Lightline
set noshowmode

" Configure encoding
set encoding=UTF-8

" GUI font
if has("gui_running")
    set guifont=Iosevka 11
endif

" Folding ---------------------------------------

" Enable folding
set foldenable

" 99 = all folds are open; 0 = all folds are closed
set foldlevelstart=99

" Nested fold max
set foldnestmax=10

" Space open/closes folds
nnoremap <space> za

" Fold based on indent level
set foldmethod=indent

" Other -----------------------------------------

" Enable mouse support
set mouse=a

" Put these in an autocmd group, so that you can revert them with:
" ":augroup vimStartup | au! | augroup END"
augroup vimStartup
  au!

  " When editing a file, always jump to the last known cursor position.
  " Don't do it when the position is invalid, when inside an event handler
  " (happens when dropping a file on gvim) and for a commit message (it's
  " likely a different one than last time).
  autocmd BufReadPost *
     if line("'"") >= 1 && line("'"") <= line("$") && &ft !~# 'commit'
     |   exe "normal! g`""
     | endif
augroup END

" Clipboard as default register
set clipboard=unnamedplus

" NERDTree --------------------------------------

" Open automatically when vim starts with no file specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

" Open automatically when vim starts by opening a directory
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()(0)) && !exists("s:std_in") | exe 'NERDTree' argv()(0) | wincmd p | ene | endif

" Keyboard shortcut
map <C-n> :NERDTreeToggle<CR>

" Close vim if the only window left open is NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif

" Icons
let g:NERDTreeDirArrowExpandable = ''
let g:NERDTreeDirArrowCollapsible = ''

~/.vim/colors/default.vim generated by base16-universal-manager:

" vi:syntax=vim

" base16-vim (https://github.com/chriskempson/base16-vim)
" by Chris Kempson (http://chriskempson.com)
" OneDark scheme by Lalit Magant (http://github.com/tilal6991)

" This enables the coresponding base16-shell script to run so that
" :colorscheme works in terminals supported by base16-shell scripts
" User must set this variable in .vimrc
"   let g:base16_shell_path=base16-builder/output/shell/
if !has("gui_running")
  if exists("g:base16_shell_path")
    execute "silent !/bin/sh ".g:base16_shell_path."/base16-onedark.sh"
  endif
endif

" GUI color definitions
let s:gui00        = "282c34"
let g:base16_gui00 = "282c34"
let s:gui01        = "353b45"
let g:base16_gui01 = "353b45"
let s:gui02        = "3e4451"
let g:base16_gui02 = "3e4451"
let s:gui03        = "545862"
let g:base16_gui03 = "545862"
let s:gui04        = "565c64"
let g:base16_gui04 = "565c64"
let s:gui05        = "abb2bf"
let g:base16_gui05 = "abb2bf"
let s:gui06        = "b6bdca"
let g:base16_gui06 = "b6bdca"
let s:gui07        = "c8ccd4"
let g:base16_gui07 = "c8ccd4"
let s:gui08        = "e06c75"
let g:base16_gui08 = "e06c75"
let s:gui09        = "d19a66"
let g:base16_gui09 = "d19a66"
let s:gui0A        = "e5c07b"
let g:base16_gui0A = "e5c07b"
let s:gui0B        = "98c379"
let g:base16_gui0B = "98c379"
let s:gui0C        = "56b6c2"
let g:base16_gui0C = "56b6c2"
let s:gui0D        = "61afef"
let g:base16_gui0D = "61afef"
let s:gui0E        = "c678dd"
let g:base16_gui0E = "c678dd"
let s:gui0F        = "be5046"
let g:base16_gui0F = "be5046"

" Terminal color definitions
let s:cterm00        = "00"
let g:base16_cterm00 = "00"
let s:cterm03        = "08"
let g:base16_cterm03 = "08"
let s:cterm05        = "07"
let g:base16_cterm05 = "07"
let s:cterm07        = "15"
let g:base16_cterm07 = "15"
let s:cterm08        = "01"
let g:base16_cterm08 = "01"
let s:cterm0A        = "03"
let g:base16_cterm0A = "03"
let s:cterm0B        = "02"
let g:base16_cterm0B = "02"
let s:cterm0C        = "06"
let g:base16_cterm0C = "06"
let s:cterm0D        = "04"
let g:base16_cterm0D = "04"
let s:cterm0E        = "05"
let g:base16_cterm0E = "05"
if exists("base16colorspace") && base16colorspace == "256"
  let s:cterm01        = "18"
  let g:base16_cterm01 = "18"
  let s:cterm02        = "19"
  let g:base16_cterm02 = "19"
  let s:cterm04        = "20"
  let g:base16_cterm04 = "20"
  let s:cterm06        = "21"
  let g:base16_cterm06 = "21"
  let s:cterm09        = "16"
  let g:base16_cterm09 = "16"
  let s:cterm0F        = "17"
  let g:base16_cterm0F = "17"
else
  let s:cterm01        = "10"
  let g:base16_cterm01 = "10"
  let s:cterm02        = "11"
  let g:base16_cterm02 = "11"
  let s:cterm04        = "12"
  let g:base16_cterm04 = "12"
  let s:cterm06        = "13"
  let g:base16_cterm06 = "13"
  let s:cterm09        = "09"
  let g:base16_cterm09 = "09"
  let s:cterm0F        = "14"
  let g:base16_cterm0F = "14"
endif

" Neovim terminal colours
if has("nvim")
  let g:terminal_color_0 =  "#282c34"
  let g:terminal_color_1 =  "#e06c75"
  let g:terminal_color_2 =  "#98c379"
  let g:terminal_color_3 =  "#e5c07b"
  let g:terminal_color_4 =  "#61afef"
  let g:terminal_color_5 =  "#c678dd"
  let g:terminal_color_6 =  "#56b6c2"
  let g:terminal_color_7 =  "#abb2bf"
  let g:terminal_color_8 =  "#545862"
  let g:terminal_color_9 =  "#e06c75"
  let g:terminal_color_10 = "#98c379"
  let g:terminal_color_11 = "#e5c07b"
  let g:terminal_color_12 = "#61afef"
  let g:terminal_color_13 = "#c678dd"
  let g:terminal_color_14 = "#56b6c2"
  let g:terminal_color_15 = "#c8ccd4"
  let g:terminal_color_background = g:terminal_color_0
  let g:terminal_color_foreground = g:terminal_color_5
  if &background == "light"
    let g:terminal_color_background = g:terminal_color_7
    let g:terminal_color_foreground = g:terminal_color_2
  endif
elseif has("terminal")
  let g:terminal_ansi_colors = (
         "#282c34",
         "#e06c75",
         "#98c379",
         "#e5c07b",
         "#61afef",
         "#c678dd",
         "#56b6c2",
         "#abb2bf",
         "#545862",
         "#e06c75",
         "#98c379",
         "#e5c07b",
         "#61afef",
         "#c678dd",
         "#56b6c2",
         "#c8ccd4",
         )
endif

" Theme setup
hi clear
syntax reset
let g:colors_name = "base16-onedark"

" Highlighting function
" Optional variables are attributes and guisp
function! g:Base16hi(group, guifg, guibg, ctermfg, ctermbg, ...)
  let l:attr = get(a:, 1, "")
  let l:guisp = get(a:, 2, "")

  if a:guifg != ""
    exec "hi " . a:group . " guifg=#" . a:guifg
  endif
  if a:guibg != ""
    exec "hi " . a:group . " guibg=#" . a:guibg
  endif
  if a:ctermfg != ""
    exec "hi " . a:group . " ctermfg=" . a:ctermfg
  endif
  if a:ctermbg != ""
    exec "hi " . a:group . " ctermbg=" . a:ctermbg
  endif
  if l:attr != ""
    exec "hi " . a:group . " gui=" . l:attr . " cterm=" . l:attr
  endif
  if l:guisp != ""
    exec "hi " . a:group . " guisp=#" . l:guisp
  endif
endfunction


fun <sid>hi(group, guifg, guibg, ctermfg, ctermbg, attr, guisp)
  call g:Base16hi(a:group, a:guifg, a:guibg, a:ctermfg, a:ctermbg, a:attr, a:guisp)
endfun

" Vim editor colors
call <sid>hi("Normal",        s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
call <sid>hi("Bold",          "", "", "", "", "bold", "")
call <sid>hi("Debug",         s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Directory",     s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Error",         s:gui00, s:gui08, s:cterm00, s:cterm08, "", "")
call <sid>hi("ErrorMsg",      s:gui08, s:gui00, s:cterm08, s:cterm00, "", "")
call <sid>hi("Exception",     s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("FoldColumn",    s:gui0C, s:gui01, s:cterm0C, s:cterm01, "", "")
call <sid>hi("Folded",        s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("IncSearch",     s:gui01, s:gui09, s:cterm01, s:cterm09, "none", "")
call <sid>hi("Italic",        "", "", "", "", "none", "")
call <sid>hi("Macro",         s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("MatchParen",    "", s:gui03, "", s:cterm03,  "", "")
call <sid>hi("ModeMsg",       s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("MoreMsg",       s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("Question",      s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Search",        s:gui01, s:gui0A, s:cterm01, s:cterm0A,  "", "")
call <sid>hi("Substitute",    s:gui01, s:gui0A, s:cterm01, s:cterm0A, "none", "")
call <sid>hi("SpecialKey",    s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("TooLong",       s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Underlined",    s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Visual",        "", s:gui02, "", s:cterm02, "", "")
call <sid>hi("VisualNOS",     s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("WarningMsg",    s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("WildMenu",      s:gui08, s:gui0A, s:cterm08, "", "", "")
call <sid>hi("Title",         s:gui0D, "", s:cterm0D, "", "none", "")
call <sid>hi("Conceal",       s:gui0D, s:gui00, s:cterm0D, s:cterm00, "", "")
call <sid>hi("Cursor",        s:gui00, s:gui05, s:cterm00, s:cterm05, "", "")
call <sid>hi("NonText",       s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("LineNr",        s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("SignColumn",    s:gui03, s:gui01, s:cterm03, s:cterm01, "", "")
call <sid>hi("StatusLine",    s:gui04, s:gui02, s:cterm04, s:cterm02, "none", "")
call <sid>hi("StatusLineNC",  s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("VertSplit",     s:gui02, s:gui02, s:cterm02, s:cterm02, "none", "")
call <sid>hi("ColorColumn",   "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorColumn",  "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorLine",    "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("CursorLineNr",  s:gui04, s:gui01, s:cterm04, s:cterm01, "", "")
call <sid>hi("QuickFixLine",  "", s:gui01, "", s:cterm01, "none", "")
call <sid>hi("PMenu",         s:gui05, s:gui01, s:cterm05, s:cterm01, "none", "")
call <sid>hi("PMenuSel",      s:gui01, s:gui05, s:cterm01, s:cterm05, "", "")
call <sid>hi("TabLine",       s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("TabLineFill",   s:gui03, s:gui01, s:cterm03, s:cterm01, "none", "")
call <sid>hi("TabLineSel",    s:gui0B, s:gui01, s:cterm0B, s:cterm01, "none", "")

" Standard syntax highlighting
call <sid>hi("Boolean",      s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Character",    s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("Comment",      s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("Conditional",  s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Constant",     s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Define",       s:gui0E, "", s:cterm0E, "", "none", "")
call <sid>hi("Delimiter",    s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("Float",        s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Function",     s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Identifier",   s:gui08, "", s:cterm08, "", "none", "")
call <sid>hi("Include",      s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("Keyword",      s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Label",        s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Number",       s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("Operator",     s:gui05, "", s:cterm05, "", "none", "")
call <sid>hi("PreProc",      s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Repeat",       s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Special",      s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("SpecialChar",  s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("Statement",    s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("StorageClass", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("String",       s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("Structure",    s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("Tag",          s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("Todo",         s:gui0A, s:gui01, s:cterm0A, s:cterm01, "", "")
call <sid>hi("Type",         s:gui0A, "", s:cterm0A, "", "none", "")
call <sid>hi("Typedef",      s:gui0A, "", s:cterm0A, "", "", "")

" C highlighting
call <sid>hi("cOperator",   s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("cPreCondit",  s:gui0E, "", s:cterm0E, "", "", "")

" C# highlighting
call <sid>hi("csClass",                 s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("csAttribute",             s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("csModifier",              s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("csType",                  s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("csUnspecifiedStatement",  s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("csContextualStatement",   s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("csNewDecleration",        s:gui08, "", s:cterm08, "", "", "")

" CSS highlighting
call <sid>hi("cssBraces",      s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("cssClassName",   s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("cssColor",       s:gui0C, "", s:cterm0C, "", "", "")

" Diff highlighting
call <sid>hi("DiffAdd",      s:gui0B, s:gui01,  s:cterm0B, s:cterm01, "", "")
call <sid>hi("DiffChange",   s:gui03, s:gui01,  s:cterm03, s:cterm01, "", "")
call <sid>hi("DiffDelete",   s:gui08, s:gui01,  s:cterm08, s:cterm01, "", "")
call <sid>hi("DiffText",     s:gui0D, s:gui01,  s:cterm0D, s:cterm01, "", "")
call <sid>hi("DiffAdded",    s:gui0B, s:gui00,  s:cterm0B, s:cterm00, "", "")
call <sid>hi("DiffFile",     s:gui08, s:gui00,  s:cterm08, s:cterm00, "", "")
call <sid>hi("DiffNewFile",  s:gui0B, s:gui00,  s:cterm0B, s:cterm00, "", "")
call <sid>hi("DiffLine",     s:gui0D, s:gui00,  s:cterm0D, s:cterm00, "", "")
call <sid>hi("DiffRemoved",  s:gui08, s:gui00,  s:cterm08, s:cterm00, "", "")

" Git highlighting
call <sid>hi("gitcommitOverflow",       s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("gitcommitSummary",        s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("gitcommitComment",        s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitUntracked",      s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitDiscarded",      s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitSelected",       s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("gitcommitHeader",         s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("gitcommitSelectedType",   s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitUnmergedType",   s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitDiscardedType",  s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("gitcommitBranch",         s:gui09, "", s:cterm09, "", "bold", "")
call <sid>hi("gitcommitUntrackedFile",  s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("gitcommitUnmergedFile",   s:gui08, "", s:cterm08, "", "bold", "")
call <sid>hi("gitcommitDiscardedFile",  s:gui08, "", s:cterm08, "", "bold", "")
call <sid>hi("gitcommitSelectedFile",   s:gui0B, "", s:cterm0B, "", "bold", "")

" GitGutter highlighting
call <sid>hi("GitGutterAdd",     s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("GitGutterChange",  s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("GitGutterDelete",  s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")
call <sid>hi("GitGutterChangeDelete",  s:gui0E, s:gui01, s:cterm0E, s:cterm01, "", "")

" HTML highlighting
call <sid>hi("htmlBold",    s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("htmlItalic",  s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("htmlEndTag",  s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("htmlTag",     s:gui05, "", s:cterm05, "", "", "")

" JavaScript highlighting
call <sid>hi("javaScript",        s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("javaScriptBraces",  s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("javaScriptNumber",  s:gui09, "", s:cterm09, "", "", "")
" pangloss/vim-javascript highlighting
call <sid>hi("jsOperator",          s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsStatement",         s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsReturn",            s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsThis",              s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("jsClassDefinition",   s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsFunction",          s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsFuncName",          s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsFuncCall",          s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsClassFuncName",     s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("jsClassMethodType",   s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("jsRegexpString",      s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("jsGlobalObjects",     s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsGlobalNodeObjects", s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsExceptions",        s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("jsBuiltins",          s:gui0A, "", s:cterm0A, "", "", "")

" Mail highlighting
call <sid>hi("mailQuoted1",  s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("mailQuoted2",  s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("mailQuoted3",  s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("mailQuoted4",  s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("mailQuoted5",  s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("mailQuoted6",  s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("mailURL",      s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("mailEmail",    s:gui0D, "", s:cterm0D, "", "", "")

" Markdown highlighting
call <sid>hi("markdownCode",              s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("markdownError",             s:gui05, s:gui00, s:cterm05, s:cterm00, "", "")
call <sid>hi("markdownCodeBlock",         s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("markdownHeadingDelimiter",  s:gui0D, "", s:cterm0D, "", "", "")

" NERDTree highlighting
call <sid>hi("NERDTreeDirSlash",  s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("NERDTreeExecFile",  s:gui05, "", s:cterm05, "", "", "")

" PHP highlighting
call <sid>hi("phpMemberSelector",  s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpComparison",      s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpParent",          s:gui05, "", s:cterm05, "", "", "")
call <sid>hi("phpMethodsVar",      s:gui0C, "", s:cterm0C, "", "", "")

" Python highlighting
call <sid>hi("pythonOperator",  s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonRepeat",    s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonInclude",   s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("pythonStatement", s:gui0E, "", s:cterm0E, "", "", "")

" Ruby highlighting
call <sid>hi("rubyAttribute",               s:gui0D, "", s:cterm0D, "", "", "")
call <sid>hi("rubyConstant",                s:gui0A, "", s:cterm0A, "", "", "")
call <sid>hi("rubyInterpolationDelimiter",  s:gui0F, "", s:cterm0F, "", "", "")
call <sid>hi("rubyRegexp",                  s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("rubySymbol",                  s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("rubyStringDelimiter",         s:gui0B, "", s:cterm0B, "", "", "")

" SASS highlighting
call <sid>hi("sassidChar",     s:gui08, "", s:cterm08, "", "", "")
call <sid>hi("sassClassChar",  s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("sassInclude",    s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("sassMixing",     s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("sassMixinName",  s:gui0D, "", s:cterm0D, "", "", "")

" Signify highlighting
call <sid>hi("SignifySignAdd",     s:gui0B, s:gui01, s:cterm0B, s:cterm01, "", "")
call <sid>hi("SignifySignChange",  s:gui0D, s:gui01, s:cterm0D, s:cterm01, "", "")
call <sid>hi("SignifySignDelete",  s:gui08, s:gui01, s:cterm08, s:cterm01, "", "")

" Spelling highlighting
call <sid>hi("SpellBad",     "", "", "", "", "undercurl", s:gui08)
call <sid>hi("SpellLocal",   "", "", "", "", "undercurl", s:gui0C)
call <sid>hi("SpellCap",     "", "", "", "", "undercurl", s:gui0D)
call <sid>hi("SpellRare",    "", "", "", "", "undercurl", s:gui0E)

" Startify highlighting
call <sid>hi("StartifyBracket",  s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifyFile",     s:gui07, "", s:cterm07, "", "", "")
call <sid>hi("StartifyFooter",   s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifyHeader",   s:gui0B, "", s:cterm0B, "", "", "")
call <sid>hi("StartifyNumber",   s:gui09, "", s:cterm09, "", "", "")
call <sid>hi("StartifyPath",     s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifySection",  s:gui0E, "", s:cterm0E, "", "", "")
call <sid>hi("StartifySelect",   s:gui0C, "", s:cterm0C, "", "", "")
call <sid>hi("StartifySlash",    s:gui03, "", s:cterm03, "", "", "")
call <sid>hi("StartifySpecial",  s:gui03, "", s:cterm03, "", "", "")

" Java highlighting
call <sid>hi("javaOperator",     s:gui0D, "", s:cterm0D, "", "", "")

" Remove functions
delf <sid>hi

" Remove color variables
unlet s:gui00 s:gui01 s:gui02 s:gui03  s:gui04  s:gui05  s:gui06  s:gui07  s:gui08  s:gui09 s:gui0A  s:gui0B  s:gui0C  s:gui0D  s:gui0E  s:gui0F
unlet s:cterm00 s:cterm01 s:cterm02 s:cterm03 s:cterm04 s:cterm05 s:cterm06 s:cterm07 s:cterm08 s:cterm09 s:cterm0A s:cterm0B s:cterm0C s:cterm0D s:cterm0E s:cterm0F

charts – BarChart has incorrect partial Graphics elements?

Use ChartElements -> {Graphics[{LightBlue, Rectangle[RoundingRadius -> .3]}], {1, 1}}:

BarChart[data, PlotLabel -> "Name", BarOrigin -> Left, Ticks -> None, 
 BarSpacing -> 0, LabelingFunction -> After, 
 ChartElements -> {Graphics[{LightBlue, Rectangle[RoundingRadius -> .3]}], {1, 1}}, 
 ChartLabels -> {"Communication", "Collaboration", "Timeliness", 
   "Prof. Dev.", "Habits of Mind"}]

enter image description here

ChartElements >> Details:

enter image description here

Multicolumn[
 Table[Labeled[
   BarChart[data, PlotLabel -> "Name", BarOrigin -> Left, 
    Ticks -> None, BarSpacing -> 0, LabelingFunction -> After, 
    ChartElements -> {Graphics[{LightBlue, 
        Rectangle[RoundingRadius -> .3]}], wh}, 
    ChartLabels -> {"Communication", "Collaboration", "Timeliness", 
      "Prof. Dev.", "Habits of Mind"}, ImageSize -> 300], wh, Top], 
    {wh, {{1, 1}, {1, All}, {All, 1}, All, {1, 1/2}, {1/2, 1}}}], 
  2, Appearance -> "Horizontal"]

enter image description here

index – MySQL: message “Incorrect key file for table” “try to repair it”

I’m using MySQL 5.7.10

I have a table like this, with 100M rows and a size of 16GB .

CREATE TABLE `my_table` (
    `id` DOUBLE NOT NULL AUTO_INCREMENT,
    `entity_id` DOUBLE NOT NULL,
    `concept_id` VARCHAR(50) NOT NULL COLLATE 'utf8_spanish_ci',
    `value` DOUBLE(15,6) NOT NULL,
    `increment` DOUBLE(10,6) NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    INDEX `IDX_concept` (`concept_id`),
    INDEX `IDX_entity` (`entity_id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
ROW_FORMAT=DYNAMIC
AUTO_INCREMENT=118166425

Once a month, I execute:

ALTER TABLE my_table ENGINE=InnoDB;

My intention is to defrag the table, so the data are put together and the size keeps as low as possible.

This time, it failed and the failure message is: “Incorrect key file for table ‘my_table’; try to repair it”.

I have made the following steps:

  1. Create a table like this: my_table2.
  2. Use mysqldump to dump my_table data in a file.
  3. Replace the create and the inserts to be done in “my_table2”.
  4. Execute the file. my_table2 is created and each row in my_table exists in my_table2.
  5. Execute ALTER TABLE my_table2 ENGINE=InnoDB;

And it failed too, with the same message “Incorrect key file for table ‘my_table2’; try to repair it”.

How could I fix the error? Thank you.

EDIT 1: I have executed CHECK TABLE for both tables, and the result is status OK, for both of them.

mysql – SQL Error [1292] “Truncated incorrect INTEGER value” – with Varchar columns and CASE. Why?

In a MySQL 5.7 environment, when trying to insert a varchar value into a varchar field, I get the error:

SQL Error (1292) (22001): Data truncation: Truncated incorrect INTEGER value: ‘1876301/347’

The source and target columns are both of the datatype varchar.

Here’s a small demo to reproduce an example of the error (it occurs on the last insert):

create table SRC 
(
    Z varchar(20) null,
    A varchar(63) null,
    B varchar(30) null
);

insert into SRC
select 'XYZ', '1876301/347', null
;



create table TGT
(
    C varchar(63) null
)
;

To generate the error, now run this: (is the 3rd WHEN that matches, meaning it’s trying to insert the value from SRC.A into TGT.C)


insert into TGT
(
    C
)
select 
    CASE
        WHEN if(Z in ('XYZ'), A, NULL) IS NULL AND B IS NULL THEN NULL
        WHEN if(Z in ('XYZ'), A, NULL) IS NULL AND B IS NOT NULL THEN B
        WHEN if(Z in ('XYZ'), A, NULL) IS NOT NULL AND B IS NULL THEN A
        WHEN if(Z in ('XYZ'), A, NULL) IS NOT NULL AND if(Z in ('XYZ'), A, NULL) = B THEN A 
        ELSE if(Z in ('XYZ'), A, NULL)
    END AS C
from 
    SRC 

It seems to be related to there being a case statement, as, when I try to simply insert the same value directly, it works fine.

insert into TGT
(
    C
)
select 
    A
from 
    SRC 

It also works fine with the CASE STATEMENT if I use INSERT IGNORE INTO..., but I’d rather not use that.

magento2 – getFinalPrice Configurable Product incorrect in the backend Magento 2

First, I will update in full detail about my environment.

  • Magento 2.3.2.
  • Created 1 Configurable Product.
  • Create Catalog Rule Price for that Configurable product. (eg: Discound 10%). -> Save, Apply.
  • bin/magento c: f && bin/magento indexer:reindex.

    Configurable Product on Backend

    Configurable Product on Backend
    Catalog Price Rule on Backend
    Catalog Price Rule on Backend

    Configurable Product on Frontend
    Configurable Product on Frontend
    Now, we have a Configurable Product.
    When I try to use getFinalPrice funcion for simple products (I have put debug in file: MagentoCatalogControllerAdminhtmlProductEdit.php line 52)

$_children = $product->getTypeInstance()->getUsedProducts($product);
$_children(0)->getFinalPrice ();

Return: $ 99 -> Incorrect
Return Backend
In Frontend: I put the debug in MagentoCatalogviewfrontendtemplatesproductviewaddtocart.phtml line 9

$_children =
$_product->getTypeInstance()->getUsedProducts($_product);
$_children(0)->getFinalPrice();

Return: $89 -> Correct.
Return Frontend

Database:

catalog_product_index_price table
catalog_product_index_price
Am I mistaken here? Or what was wrong with me? Can anyone explain it to me? Thanks!

ledger – Incorrect Network – Bitcoin Stack Exchange

I was hoping someone could help with a transaction please.

I sent BTC to my binance account via my ledger. I think I used BTC segwit to send but sent it to the BTC address on binance- I was not aware there was a BTC segwit address on binance when sending.

Will I still receive the BTC in my binance account as the BTC address was still connected to my binance account?

Many Thanks

mining pools – Higher Hashrate VS Incorrect Shares

I recently started mining eth on my 5700 bios flashed to XT, mining on Nanopool. Getting around 48MH/s but i saw a method by Red Panda Mining which can increase my MH/s by around 10 giving me 60MH/s but a high ratio of incorrect shares using a config edit on Phoenix Miner. Im wondering if this is worth the increase in hashrate but ultimately still leads me to incorrect shares. My incorrect share rate is 2:1 using this edit. Thoughts?