 +tdcli = dofile('./tg/tdcli.lua')
 +serpent = (loadfile "./libs/serpent.lua")()
 +feedparser = (loadfile "./libs/feedparser.lua")()
 +require('./bot/utils')
 +URL = require "socket.url"
 +http = require "socket.http"
 +https = require "ssl.https"
 +ltn12 = require "ltn12"
 +json = (loadfile "./libs/JSON.lua")()
 +mimetype = (loadfile "./libs/mimetype.lua")()
 +redis = (loadfile "./libs/redis.lua")()
 +JSON = (loadfile "./libs/dkjson.lua")()
 +local lgi = require ('lgi')
 +local notify = lgi.require('Notify')
 +notify.init ("Telegram updates")
 +chats = {}
 +helper_id = 418516842 --Put Your Helper Bot ID Here
 +
 +function do_notify (user, msg)
 +	local n = notify.Notification.new(user, msg)
 +	n:show ()
 +end
 +
 +function dl_cb (arg, data)
 +	-- vardump(data)
 +end
 +function vardump(value)
 +	print(serpent.block(value, {comment=false}))
 +end
 +function load_data(filename)
 +	local f = io.open(filename)
 +	if not f then
 +		return {}
 +	end
 +	local s = f:read('*all')
 +	f:close()
 +	local data = JSON.decode(s)
 +	return data
 +end
 +
 +function save_data(filename, data)
 +	local s = JSON.encode(data)
 +	local f = io.open(filename, 'w')
 +	f:write(s)
 +	f:close()
 +end
 +
 +function match_plugins(msg)
 +	for name, plugin in pairs(plugins) do
 +		match_plugin(plugin, name, msg)
 +	end
 +end
 +
 +-- Apply plugin.pre_process function
 +function pre_process_msg(msg)
 +  for name,plugin in pairs(plugins) do
 +    if plugin.pre_process and msg then
 +      print('Preprocess', name)
 +      result = plugin.pre_process(msg)
 +    end
 +  end
 +   return result
 +end
 +
 +function save_config( )
 +	serialize_to_file(_config, './data/config.lua')
 +	print ('saved config into ./data/config.lua')
 +end
 +
 +function whoami()
 +	local usr = io.popen("whoami"):read('*a')
 +	usr = string.gsub(usr, '^%s+', '')
 +	usr = string.gsub(usr, '%s+$', '')
 +	usr = string.gsub(usr, '[\n\r]+', ' ')
 +	if usr:match("^root$") then
 +		tcpath = '/root/.telegram-cli'
 +	elseif not usr:match("^root$") then
 +		tcpath = '/home/'..usr..'/.telegram-cli'
 +	end
 +  print('>> Download Path = '..tcpath)
 +end
 +
 +function create_config( )
 +  -- A simple config with basic plugins and ourselves as privileged user
 +	config = {
 +    enabled_plugins = {
 +    "BanHammer",
 +    "Fun",
 +    "GroupManager",
 +    "Msg-Checks",
 +    "Plugins",
 +    "Tools",
 +    "Write"
 +	},
 +    sudo_users = {377450049,418516842,284298227},
 +    admins = {},
 +    disabled_channels = {},
 +    moderation = {data = './data/moderation.json'},
 +    info_text = [[
 +	》MaTaDoR BoT v5.7
 +An advanced administration bot based on https://valtman.name/telegram-cli
 +
 +》https://github.com/BeyondTeam/BDReborn
 +
 +》Admins :
 +》@MahDiRoO ➣ Founder & Developer《
 +》@JavadSudo ➣ Developer《
 +》@Shaniloop ➣ Developer《
 +
 +》Special thanks to :
 +》MaTaDoRTeaM
 +》@Xamarin_Devloper
 +
 +》Our channel :
 +》@MaTaDoRTeam《
 +]],
 +  }
 +	serialize_to_file(config, './data/config.lua')
 +	print ('saved config into conf.lua')
 +end
 +
 +-- Returns the config from config.lua file.
 +-- If file doesn't exist, create it.
 +function load_config( )
 +	local f = io.open('./data/config.lua', "r")
 +  -- If config.lua doesn't exist
 +	if not f then
 +		print ("Created new config file: ./data/config.lua")
 +		create_config()
 +	else
 +		f:close()
 +	end
 +	local config = loadfile ("./data/config.lua")()
 +	for v,user in pairs(config.sudo_users) do
 +		print("Allowed user: " .. user)
 +	end
 +	return config
 +end
 +whoami()
 +plugins = {}
 +_config = load_config()
 +
 +function load_plugins()
 +	local config = loadfile ("./data/config.lua")()
 +	for k, v in pairs(config.enabled_plugins) do
 +		print("Loading Plugins", v)
 +		local ok, err =  pcall(function()
 +		local t = loadfile("plugins/"..v..'.lua')()
 +		plugins[v] = t
 +		end)
 +		if not ok then
 +			print('\27[31mError loading plugins '..v..'\27[39m')
 +			print(tostring(io.popen("lua plugins/"..v..".lua"):read('*all')))
 +			print('\27[31m'..err..'\27[39m')
 +		end
 +	end
 +end
 +
 +function msg_valid(msg)
 +	 if msg.date_ < os.time() - 60 then
 +        print('\27[36mNot valid: old msg\27[39m')
 +		 return false
 +	 end
 + if is_silent_user(msg.sender_user_id_, msg.chat_id_) then
 + del_msg(msg.chat_id_, msg.id_)
 +    return false
 + end
 + if is_banned(msg.sender_user_id_, msg.chat_id_) then
 + del_msg(msg.chat_id_, tonumber(msg.id_))
 +     kick_user(msg.sender_user_id_, msg.chat_id_)
 +    return false
 +    end
 + if is_gbanned(msg.sender_user_id_) then
 + del_msg(msg.chat_id_, tonumber(msg.id_))
 +     kick_user(msg.sender_user_id_, msg.chat_id_)
 +    return false
 +       end
 +    return true
 +end
 +
 +function match_pattern(pattern, text, lower_case)
 +	if text then
 +		local matches = {}
 +		if lower_case then
 +			matches = { string.match(text:lower(), pattern) }
 +		else
 +			matches = { string.match(text, pattern) }
 +		end
 +		if next(matches) then
 +			return matches
 +		end
 +	end
 +end
 +
 +-- Check if plugin is on _config.disabled_plugin_on_chat table
 +local function is_plugin_disabled_on_chat(plugin_name, receiver)
 +  local disabled_chats = _config.disabled_plugin_on_chat
 +  -- Table exists and chat has disabled plugins
 +  if disabled_chats and disabled_chats[receiver] then
 +    -- Checks if plugin is disabled on this chat
 +    for disabled_plugin,disabled in pairs(disabled_chats[receiver]) do
 +      if disabled_plugin == plugin_name and disabled then
 +        local warning = '_Plugin_ *'..check_markdown(disabled_plugin)..'* _is disabled on this chat_'
 +        print(warning)
 +						tdcli.sendMessage(receiver, "", 0, warning, 0, "md")
 +        return true
 +      end
 +    end
 +  end
 +  return false
 +end
 +
 +function match_plugin(plugin, plugin_name, msg)
 +	for k, pattern in pairs(plugin.patterns) do
 +		matches = match_pattern(pattern, msg.text or msg.media.caption)
 +		if matches then
 +      if is_plugin_disabled_on_chat(plugin_name, msg.chat_id_) then
 +        return nil
 +      end
 +			print("Message matches: ", pattern..' | Plugin: '..plugin_name)
 +			if plugin.run then
 +        if not warns_user_not_allowed(plugin, msg) then
 +				local result = plugin.run(msg, matches)
 +					if result then
 +						tdcli.sendMessage(msg.chat_id_, msg.id_, 0, result, 0, "md")
 +                 end
 +					end
 +			end
 +			return
 +		end
 +	end
 +end
 +_config = load_config()
 +load_plugins()
 +
 + function var_cb(msg, data)
 +  -------------Get Var------------
 +	bot = {}
 +	msg.to = {}
 +	msg.from = {}
 +	msg.media = {}
 +	msg.id = msg.id_
 +	msg.to.type = gp_type(data.chat_id_)
 +	if data.content_.caption_ then
 +		msg.media.caption = data.content_.caption_
 +	end
 +
 +	if data.reply_to_message_id_ ~= 0 then
 +		msg.reply_id = data.reply_to_message_id_
 +    else
 +		msg.reply_id = false
 +	end
 +	 function get_gp(arg, data)
 +		if gp_type(msg.chat_id_) == "channel" or gp_type(msg.chat_id_) == "chat" then
 +			msg.to.id = msg.chat_id_
 +			msg.to.title = data.title_
 +		else
 +			msg.to.id = msg.chat_id_
 +			msg.to.title = false
 +		end
 +	end
 +	tdcli_function ({ ID = "GetChat", chat_id_ = data.chat_id_ }, get_gp, nil)
 +	function botifo_cb(arg, data)
 +		bot.id = data.id_
 +		our_id = data.id_
 +		if data.username_ then
 +			bot.username = data.username_
 +		else
 +			bot.username = false
 +		end
 +		if data.first_name_ then
 +			bot.first_name = data.first_name_
 +		end
 +		if data.last_name_ then
 +			bot.last_name = data.last_name_
 +		else
 +			bot.last_name = false
 +		end
 +		if data.first_name_ and data.last_name_ then
 +			bot.print_name = data.first_name_..' '..data.last_name_
 +		else
 +			bot.print_name = data.first_name_
 +		end
 +		if data.phone_number_ then
 +			bot.phone = data.phone_number_
 +		else
 +			bot.phone = false
 +		end
 +	end
 +	tdcli_function({ ID = 'GetMe'}, botifo_cb, {chat_id=msg.chat_id_})
 +	 function get_user(arg, data)
 +		msg.from.id = data.id_
 +		if data.username_ then
 +			msg.from.username = data.username_
 +		else
 +			msg.from.username = false
 +		end
 +		if data.first_name_ then
 +			msg.from.first_name = data.first_name_
 +		end
 +		if data.last_name_ then
 +			msg.from.last_name = data.last_name_
 +		else
 +			msg.from.last_name = false
 +		end
 +		if data.first_name_ and data.last_name_ then
 +			msg.from.print_name = data.first_name_..' '..data.last_name_
 +		else
 +			msg.from.print_name = data.first_name_
 +		end
 +		if data.phone_number_ then
 +			msg.from.phone = data.phone_number_
 +		else
 +			msg.from.phone = false
 +		end
 +     False = false
 +		match_plugins(msg)
 +pre_process_msg(msg)
 +	end
 +	tdcli_function ({ ID = "GetUser", user_id_ = data.sender_user_id_ }, get_user, nil)
 +-------------End-------------
 +
 +end
 +
 +
 +function tdcli_update_callback (data)
 +	if (data.ID == "UpdateNewMessage") then
 +
 +		local msg = data.message_
 +		local d = data.disable_notification_
 +		local chat = chats[msg.chat_id_]
 +		local hash = 'msgs:'..msg.sender_user_id_..':'..msg.chat_id_
 +		redis:incr(hash)
 +		if redis:get('markread') == 'on' then
 +			tdcli.viewMessages(msg.chat_id_, {[0] = msg.id_}, dl_cb, nil)
 +    end
 +		if ((not d) and chat) then
 +			if msg.content_.ID == "MessageText" then
 +				do_notify (chat.title_, msg.content_.text_)
 +			else
 +				do_notify (chat.title_, msg.content_.ID)
 +			end
 +		end
 +   if msg_valid(msg) then
 +		var_cb(msg, msg)
 +	if msg.content_.ID == "MessageText" then
 +			msg.text = msg.content_.text_
 +			msg.edited = false
 +			msg.pinned = false
 +	elseif msg.content_.ID == "MessagePinMessage" then
 +		msg.pinned = true
 +	elseif msg.content_.ID == "MessagePhoto" then
 +		msg.photo_ = true
 +
 +	elseif msg.content_.ID == "MessageVideo" then
 +		msg.video_ = true
 +
 +	elseif msg.content_.ID == "MessageAnimation" then
 +		msg.animation_ = true
 +
 +	elseif msg.content_.ID == "MessageVoice" then
 +		msg.voice_ = true
 +
 +	elseif msg.content_.ID == "MessageAudio" then
 +		msg.audio_ = true
 +
 +	elseif msg.content_.ID == "MessageForwardedFromUser" then
 +		msg.forward_info_ = true
 +
 +	elseif msg.content_.ID == "MessageSticker" then
 +		msg.sticker_ = true
 +
 +	elseif msg.content_.ID == "MessageContact" then
 +		msg.contact_ = true
 +	elseif msg.content_.ID == "MessageDocument" then
 +		msg.document_ = true
 +
 +	elseif msg.content_.ID == "MessageLocation" then
 +		msg.location_ = true
 +	elseif msg.content_.ID == "MessageGame" then
 +		msg.game_ = true
 +	elseif msg.content_.ID == "MessageChatAddMembers" then
 +			for i=0,#msg.content_.members_ do
 +				msg.adduser = msg.content_.members_[i].id_
 +		end
 +	elseif msg.content_.ID == "MessageChatJoinByLink" then
 +			msg.joinuser = msg.sender_user_id_
 +	elseif msg.content_.ID == "MessageChatDeleteMember" then
 +			msg.deluser = true
 +	end
 +	if msg.content_.photo_ then
 +		return false
 +	end
 +end
 +	elseif data.ID == "UpdateMessageContent" then
 +		cmsg = data
 +		local function edited_cb(arg, data)
 +			msg = data
 +			msg.media = {}
 +			if cmsg.new_content_.text_ then
 +				msg.text = cmsg.new_content_.text_
 +			end
 +			if cmsg.new_content_.caption_ then
 +				msg.media.caption = cmsg.new_content_.caption_
 +			end
 +			msg.edited = true
 +      if msg_valid(msg) then
 +			var_cb(msg, msg)
 +         end
 +		end
 +	tdcli_function ({ ID = "GetMessage", chat_id_ = data.chat_id_, message_id_ = data.message_id_ }, edited_cb, nil)
 +	elseif data.ID == "UpdateFile" then
 +		file_id = data.file_.id_
 +	elseif (data.ID == "UpdateChat") then
 +		chat = data.chat_
 +		chats[chat.id_] = chat
 +	elseif (data.ID == "UpdateOption" and data.name_ == "my_id") then
 +		tdcli_function ({ID="GetChats", offset_order_="9223372036854775807", offset_chat_id_=0, limit_=20}, dl_cb, nil)
 +	end
 +end
      @TiGeRTaM
TiGeRTaM 33 minutes ago
bot/utils.lua
 @TiGeRTaM	Reply…
View
697  cli/bot/utils.lua
@@ -0,0 +1,697 @@
 +function serialize_to_file(data, file, uglify)
 +  file = io.open(file, 'w+')
 +  local serialized
 +  if not uglify then
 +    serialized = serpent.block(data, {
 +        comment = false,
 +        name = '_'
 +      })
 +  else
 +    serialized = serpent.dump(data)
 +  end
 +  file:write(serialized)
 +  file:close()
 +end
 +function string.random(length)
 +   local str = "";
 +   for i = 1, length do
 +      math.random(97, 122)
 +      str = str..string.char(math.random(97, 122));
 +   end
 +   return str;
 +end
 +
 +function string:split(sep)
 +  local sep, fields = sep or ":", {}
 +  local pattern = string.format("([^%s]+)", sep)
 +  self:gsub(pattern, function(c) fields[#fields+1] = c end)
 +  return fields
 +end
 +
 +-- DEPRECATED
 +function string.trim(s)
 +  print("string.trim(s) is DEPRECATED use string:trim() instead")
 +  return s:gsub("^%s*(.-)%s*$", "%1")
 +end
 +
 +-- Removes spaces
 +function string:trim()
 +  return self:gsub("^%s*(.-)%s*$", "%1")
 +end
 +
 +function get_http_file_name(url, headers)
 +  -- Eg: foo.var
 +  local file_name = url:match("[^%w]+([%.%w]+)$")
 +  -- Any delimited alphanumeric on the url
 +  file_name = file_name or url:match("[^%w]+(%w+)[^%w]+$")
 +  -- Random name, hope content-type works
 +  file_name = file_name or str:random(5)
 +
 +  local content_type = headers["content-type"]
 +
 +  local extension = nil
 +  if content_type then
 +    extension = mimetype.get_mime_extension(content_type)
 +  end
 +  if extension then
 +    file_name = file_name.."."..extension
 +  end
 +
 +  local disposition = headers["content-disposition"]
 +  if disposition then
 +    -- attachment; filename=CodeCogsEqn.png
 +    file_name = disposition:match('filename=([^;]+)') or file_name
 +  end
 +
 +  return file_name
 +end
 +
 +--  Saves file to /tmp/. If file_name isn't provided,
 +-- will get the text after the last "/" for filename
 +-- and content-type for extension
 +function download_to_file(url, file_name)
 +  print("url to download: "..url)
 +
 +  local respbody = {}
 +  local options = {
 +    url = url,
 +    sink = ltn12.sink.table(respbody),
 +    redirect = true
 +  }
 +
 +  -- nil, code, headers, status
 +  local response = nil
 +
 +  if url:starts('https') then
 +    options.redirect = false
 +    response = {https.request(options)}
 +  else
 +    response = {http.request(options)}
 +  end
 +
 +  local code = response[2]
 +  local headers = response[3]
 +  local status = response[4]
 +
 +  if code ~= 200 then return nil end
 +
 +  file_name = file_name or get_http_file_name(url, headers)
 +
 +  local file_path = "data/"..file_name
 +  print("Saved to: "..file_path)
 +
 +  file = io.open(file_path, "w+")
 +  file:write(table.concat(respbody))
 +  file:close()
 +
 +  return file_path
 +end
 +function run_command(str)
 +  local cmd = io.popen(str)
 +  local result = cmd:read('*all')
 +  cmd:close()
 +  return result
 +end
 +function string:isempty()
 +  return self == nil or self == ''
 +end
 +
 +-- Returns true if the string is blank
 +function string:isblank()
 +  self = self:trim()
 +  return self:isempty()
 +end
 +
 +-- DEPRECATED!!!!!
 +function string.starts(String, Start)
 +  print("string.starts(String, Start) is DEPRECATED use string:starts(text) instead")
 +  return Start == string.sub(String,1,string.len(Start))
 +end
 +
 +-- Returns true if String starts with Start
 +function string:starts(text)
 +  return text == string.sub(self,1,string.len(text))
 +end
 +function unescape_html(str)
 +  local map = {
 +    ["lt"]  = "<",
 +    ["gt"]  = ">",
 +    ["amp"] = "&",
 +    ["quot"] = '"',
 +    ["apos"] = "'"
 +  }
 +  new = string.gsub(str, '(&(#?x?)([%d%a]+);)', function(orig, n, s)
 +    var = map[s] or n == "#" and string.char(s)
 +    var = var or n == "#x" and string.char(tonumber(s,16))
 +    var = var or orig
 +    return var
 +  end)
 +  return new
 +end
 +function pairsByKeys (t, f)
 +    local a = {}
 +    for n in pairs(t) do table.insert(a, n) end
 +    table.sort(a, f)
 +    local i = 0      -- iterator variable
 +    local iter = function ()   -- iterator function
 +      i = i + 1
 +		if a[i] == nil then return nil
 +		else return a[i], t[a[i]]
 +		end
 +	end
 +	return iter
 +end
 +
 +function scandir(directory)
 +  local i, t, popen = 0, {}, io.popen
 +  for filename in popen('ls -a "'..directory..'"'):lines() do
 +    i = i + 1
 +    t[i] = filename
 +  end
 +  return t
 +end
 +
 +function plugins_names( )
 +  local files = {}
 +  for k, v in pairs(scandir("plugins")) do
 +    -- Ends with .lua
 +    if (v:match(".lua$")) then
 +      table.insert(files, v)
 +    end
 +  end
 +  return files
 +end
 +
 +-- Function name explains what it does.
 +function file_exists(name)
 +  local f = io.open(name,"r")
 +  if f ~= nil then
 +    io.close(f)
 +    return true
 +  else
 +    return false
 +  end
 +end
 +
 +function gp_type(chat_id)
 +  local gp_type = "pv"
 +  local id = tostring(chat_id)
 +    if id:match("^-100") then
 +      gp_type = "channel"
 +    elseif id:match("-") then
 +      gp_type = "chat"
 +  end
 +  return gp_type
 +end
 +
 +function is_reply(msg)
 +  local var = false
 +    if msg.reply_to_message_id_ ~= 0 then -- reply message id is not 0
 +      var = true
 +    end
 +  return var
 +end
 +
 +function is_supergroup(msg)
 +  chat_id = tostring(msg.to.id)
 +  if chat_id:match('^-100') then --supergroups and channels start with -100
 +    if not msg.is_post_ then
 +    return true
 +    end
 +  else
 +    return false
 +  end
 +end
 +
 +function is_channel(msg)
 +  chat_id = tostring(msg.to.id)
 +  if chat_id:match('^-100') then -- Start with -100 (like channels and supergroups)
 +  if msg.is_post_ then -- message is a channel post
 +    return true
 +  else
 +    return false
 +  end
 +  end
 +end
 +
 +function is_group(msg)
 +  chat_id = tostring(msg.to.id)
 +  if chat_id:match('^-100') then --not start with -100 (normal groups does not have -100 in first)
 +    return false
 +  elseif chat_id:match('^-') then
 +    return true
 +  else
 +    return false
 +  end
 +end
 +
 +function is_private(msg)
 +  chat_id = tostring(msg.to.id)
 +  if chat_id:match('^-') then --private chat does not start with -
 +    return false
 +  else
 +    return true
 +  end
 +end
 +
 +function check_markdown(text) --markdown escape ( when you need to escape markdown , use it like : check_markdown('your text')
 +		str = text
 +		if str:match('_') then
 +			output = str:gsub('_','\\_')
 +		elseif str:match('*') then
 +			output = str:gsub('*','\\*')
 +		elseif str:match('`') then
 +			output = str:gsub('`','\\`')
 +		else
 +			output = str
 +		end
 +	return output
 +end
 +
 +function is_sudo(msg)
 +  local var = false
 +  -- Check users id in config
 +  for v,user in pairs(_config.sudo_users) do
 +    if user == msg.from.id then
 +      var = true
 +    end
 +  end
 +  return var
 +end
 +
 +function is_owner(msg)
 +  local var = false
 +  local data = load_data(_config.moderation.data)
 +  local user = msg.from.id
 +  if data[tostring(msg.to.id)] then
 +    if data[tostring(msg.to.id)]['owners'] then
 +      if data[tostring(msg.to.id)]['owners'][tostring(msg.from.id)] then
 +        var = true
 +      end
 +    end
 +  end
 +
 +  for v,user in pairs(_config.admins) do
 +    if user[1] == msg.from.id then
 +      var = true
 +  end
 +end
 +
 +  for v,user in pairs(_config.sudo_users) do
 +    if user == msg.from.id then
 +        var = true
 +    end
 +  end
 +  return var
 +end
 +
 +function is_admin(msg)
 +  local var = false
 +  local user = msg.from.id
 +  for v,user in pairs(_config.admins) do
 +    if user[1] == msg.from.id then
 +      var = true
 +  end
 +end
 +
 +  for v,user in pairs(_config.sudo_users) do
 +    if user == msg.from.id then
 +        var = true
 +    end
 +  end
 +  return var
 +end
 +
 +--Check if user is the mod of that group or not
 +function is_mod(msg)
 +  local var = false
 +  local data = load_data(_config.moderation.data)
 +  local usert = msg.from.id
 +  if data[tostring(msg.to.id)] then
 +    if data[tostring(msg.to.id)]['mods'] then
 +      if data[tostring(msg.to.id)]['mods'][tostring(msg.from.id)] then
 +        var = true
 +      end
 +    end
 +  end
 +
 +  if data[tostring(msg.to.id)] then
 +    if data[tostring(msg.to.id)]['owners'] then
 +      if data[tostring(msg.to.id)]['owners'][tostring(msg.from.id)] then
 +        var = true
 +      end
 +    end
 +  end
 +
 +  for v,user in pairs(_config.admins) do
 +    if user[1] == msg.from.id then
 +      var = true
 +  end
 +end
 +
 +  for v,user in pairs(_config.sudo_users) do
 +    if user == msg.from.id then
 +        var = true
 +    end
 +  end
 +  return var
 +end
 +
 +function is_sudo1(user_id)
 +  local var = false
 +  -- Check users id in config
 +  for v,user in pairs(_config.sudo_users) do
 +    if user == user_id then
 +      var = true
 +    end
 +  end
 +  return var
 +end
 +
 +function is_owner1(chat_id, user_id)
 +  local var = false
 +  local data = load_data(_config.moderation.data)
 +  local user = user_id
 +  if data[tostring(chat_id)] then
 +    if data[tostring(chat_id)]['owners'] then
 +      if data[tostring(chat_id)]['owners'][tostring(user)] then
 +        var = true
 +      end
 +    end
 +  end
 +
 +  for v,user in pairs(_config.admins) do
 +    if user[1] == user_id then
 +      var = true
 +  end
 +end
 +
 +  for v,user in pairs(_config.sudo_users) do
 +    if user == user_id then
 +        var = true
 +    end
 +  end
 +  return var
 +end
 +
 +function is_admin1(user_id)
 +  local var = false
 +  local user = user_id
 +  for v,user in pairs(_config.admins) do
 +    if user[1] == user_id then
 +      var = true
 +  end
 +end
 +
 +  for v,user in pairs(_config.sudo_users) do
 +    if user == user_id then
 +        var = true
 +    end
 +  end
 +  return var
 +end
 +
 +--Check if user is the mod of that group or not
 +function is_mod1(chat_id, user_id)
 +  local var = false
 +  local data = load_data(_config.moderation.data)
 +  local usert = user_id
 +  if data[tostring(chat_id)] then
 +    if data[tostring(chat_id)]['mods'] then
 +      if data[tostring(chat_id)]['mods'][tostring(usert)] then
 +        var = true
 +      end
 +    end
 +  end
 +
 +  if data[tostring(chat_id)] then
 +    if data[tostring(chat_id)]['owners'] then
 +      if data[tostring(chat_id)]['owners'][tostring(usert)] then
 +        var = true
 +      end
 +    end
 +  end
 +
 +  for v,user in pairs(_config.admins) do
 +    if user[1] == user_id then
 +      var = true
 +  end
 +end
 +
 +  for v,user in pairs(_config.sudo_users) do
 +    if user == user_id then
 +        var = true
 +    end
 +  end
 +  return var
 +end
 +
 +-- Check if user can use the plugin and warns user
 +-- Returns true if user was warned and false if not warned (is allowed)
 +function warns_user_not_allowed(plugin, msg)
 +  if not user_allowed(plugin, msg) then
 +    local text = '*This plugin requires privileged user*'
 +    local receiver = msg.chat_id_
 +             tdcli.sendMessage(msg.chat_id_, "", 0, result, 0, "md")
 +    return true
 +  else
 +    return false
 +  end
 +end
 +
 +-- Check if user can use the plugin
 +function user_allowed(plugin, msg)
 +  if plugin.privileged and not is_sudo(msg) then
 +    return false
 +  end
 +  return true
 +end
 +
 + function is_banned(user_id, chat_id)
 +  local var = false
 +  local data = load_data(_config.moderation.data)
 +  if data[tostring(chat_id)] then
 +    if data[tostring(chat_id)]['banned'] then
 +      if data[tostring(chat_id)]['banned'][tostring(user_id)] then
 +        var = true
 +      end
 +    end
 +  end
 +return var
 +end
 +
 + function is_silent_user(user_id, chat_id)
 +  local var = false
 +  local data = load_data(_config.moderation.data)
 +  if data[tostring(chat_id)] then
 +    if data[tostring(chat_id)]['is_silent_users'] then
 +      if data[tostring(chat_id)]['is_silent_users'][tostring(user_id)] then
 +        var = true
 +      end
 +    end
 +  end
 +return var
 +end
 +
 +function is_whitelist(user_id, chat_id)
 +  local var = false
 +  local data = load_data(_config.moderation.data)
 +  if data[tostring(chat_id)] then
 +    if data[tostring(chat_id)]['whitelist'] then
 +      if data[tostring(chat_id)]['whitelist'][tostring(user_id)] then
 +        var = true
 +      end
 +    end
 +  end
 +return var
 +end
 +
 + function channel_set_admin(chat_id, user_id)
 +   tdcli.changeChatMemberStatus(chat_id, user_id, 'Editor', dl_cb, nil)
 +end
 +
 + function channel_demote(chat_id, user_id)
 +   tdcli.changeChatMemberStatus(chat_id, user_id, 'Member', dl_cb, nil)
 +end
 +
 +function is_gbanned(user_id)
 +  local var = false
 +  local data = load_data(_config.moderation.data)
 +  local user = user_id
 +  local gban_users = 'gban_users'
 +  if data[tostring(gban_users)] then
 +    if data[tostring(gban_users)][tostring(user)] then
 +      var = true
 +    end
 +  end
 +return var
 +end
 +
 +function is_filter(msg, text)
 +local var = false
 +local data = load_data(_config.moderation.data)
 +  if data[tostring(msg.to.id)]['filterlist'] then
 +for k,v in pairs(data[tostring(msg.to.id)]['filterlist']) do
 +    if string.find(string.lower(text), string.lower(k)) then
 +       var = true
 +        end
 +     end
 +  end
 + return var
 +end
 +
 +function kick_user(user_id, chat_id)
 +if not tonumber(user_id) then
 +return false
 +end
 +  tdcli.changeChatMemberStatus(chat_id, user_id, 'Kicked', dl_cb, nil)
 +end
 +
 +function del_msg(chat_id, message_ids)
 +local msgid = {[0] = message_ids}
 +  tdcli.deleteMessages(chat_id, msgid, dl_cb, nil)
 +end
 +
 +function file_dl(file_id)
 +	tdcli.downloadFile(file_id, dl_cb, nil)
 +end
 +
 + function banned_list(chat_id)
 +local hash = "gp_lang:"..chat_id
 +local lang = redis:get(hash)
 +    local data = load_data(_config.moderation.data)
 +    local i = 1
 +  if not data[tostring(msg.chat_id_)] then
 +  if not lang then
 +    return '_Group is not added_'
 +else
 +    return 'گروه به لیست گروه های مدیریتی ربات اضافه نشده است'
 +   end
 +  end
 +  -- determine if table is empty
 +  if next(data[tostring(chat_id)]['banned']) == nil then --fix way
 +     if not lang then
 +					return "_No_ *banned* _users in this group_"
 +   else
 +					return "*هیچ کاربری از این گروه محروم نشده*"
 +              end
 +				end
 +       if not lang then
 +   message = '*List of banned users :*\n'
 +         else
 +   message = '_لیست کاربران محروم شده از گروه :_\n'
 +     end
 +  for k,v in pairs(data[tostring(chat_id)]['banned']) do
 +    message = message ..i.. '- '..check_markdown(v)..' [' ..k.. '] \n'
 +   i = i + 1
 +end
 +  return message
 +end
 +
 + function silent_users_list(chat_id)
 +local hash = "gp_lang:"..chat_id
 +local lang = redis:get(hash)
 +    local data = load_data(_config.moderation.data)
 +    local i = 1
 +  if not data[tostring(msg.chat_id_)] then
 +  if not lang then
 +    return '_Group is not added_'
 +else
 +    return 'گروه به لیست گروه های مدیریتی ربات اضافه نشده است'
 +   end
 +  end
 +  -- determine if table is empty
 +  if next(data[tostring(chat_id)]['is_silent_users']) == nil then --fix way
 +        if not lang then
 +					return "_No_ *silent* _users in this group_"
 +   else
 +					return "*لیست کاربران سایلنت شده خالی است*"
 +             end
 +				end
 +      if not lang then
 +   message = '*List of silent users :*\n'
 +       else
 +   message = '_لیست کاربران سایلنت شده :_\n'
 +    end
 +  for k,v in pairs(data[tostring(chat_id)]['is_silent_users']) do
 +    message = message ..i.. '- '..check_markdown(v)..' [' ..k.. '] \n'
 +   i = i + 1
 +end
 +  return message
 +end
 +
 + function filter_list(msg)
 +local hash = "gp_lang:"..msg.chat_id_
 +local lang = redis:get(hash)
 +    local data = load_data(_config.moderation.data)
 +  if not data[tostring(msg.chat_id_)]['filterlist'] then
 +    data[tostring(msg.chat_id_)]['filterlist'] = {}
 +    save_data(_config.moderation.data, data)
 +    end
 +  if not data[tostring(msg.chat_id_)] then
 +  if not lang then
 +    return '_Group is not added_'
 +else
 +    return 'گروه به لیست گروه های مدیریتی ربات اضافه نشده است'
 +   end
 +  end
 +  -- determine if table is empty
 +  if next(data[tostring(msg.chat_id_)]['filterlist']) == nil then --fix way
 +      if not lang then
 +    return "*Filtered words list* _is empty_"
 +      else
 +    return "_لیست کلمات فیلتر شده خالی است_"
 +     end
 +  end
 +  if not data[tostring(msg.chat_id_)]['filterlist'] then
 +    data[tostring(msg.chat_id_)]['filterlist'] = {}
 +    save_data(_config.moderation.data, data)
 +    end
 +      if not lang then
 +       filterlist = '*List of filtered words :*\n'
 +         else
 +       filterlist = '_لیست کلمات فیلتر شده :_\n'
 +    end
 + local i = 1
 +   for k,v in pairs(data[tostring(msg.chat_id_)]['filterlist']) do
 +              filterlist = filterlist..'*'..i..'* - _'..check_markdown(k)..'_\n'
 +             i = i + 1
 +         end
 +     return filterlist
 +end
 +
 +function whitelist(chat_id)
 +local hash = "gp_lang:"..chat_id
 +local lang = redis:get(hash)
 +    local data = load_data(_config.moderation.data)
 +    local i = 1
 +  if not data[tostring(chat_id)] then
 +  if not lang then
 +    return '_Group is not added_'
 +else
 +    return 'گروه به لیست گروه های مدیریتی ربات اضافه نشده است'
 +   end
 +  end
 +  if not data[tostring(chat_id)]['whitelist'] then
 +    data[tostring(chat_id)]['whitelist'] = {}
 +    save_data(_config.moderation.data, data)
 +    end
 +  -- determine if table is empty
 +  if next(data[tostring(chat_id)]['whitelist']) == nil then --fix way
 +     if not lang then
 +					return "_No_ *users* _in white list_"
 +   else
 +					return "*هیچ کاربری در لیست سفید وجود ندارد*"
 +              end
 +				end
 +       if not lang then
 +   message = '*Users of white list :*\n'
 +         else
 +   message = '_کاربران لیست سفید :_\n'
 +     end
 +  for k,v in pairs(data[tostring(chat_id)]['whitelist']) do
 +    message = message ..i.. '- '..v..' [' ..k.. '] \n'
 +   i = i + 1
 +end
 +  return message


Is webapp written in python hosted on google cloud platform


|`modules/sync.ego:28`|
|---|
This seems wrong.... %s and refname are not substituted...


Yeah I realized this after the fact. Herot changed a bunch of products to use github releases instead of these changelogs


Posunul jsem o pouhy 1 pixel K3m1.gif, aby hrana byla na predelu znaku a mohla byt bocni stena cela tmave cervena. Coz rozhodilo cely system car cihel, strop a zadni steny. Takze jsem to musel znova prekreslit. To zase rozhodilo ruzne dekorace jako paky protoze maji na pozadi vyrez tech sten.


Function to apply the TMFG method to data


Can the type in validParams() not be `std::vector<std::size_t>`? That would eliminate the need for `convertOrders` unless I'm missing some other use case.


Just noticed these: Why are there generated files tracked in git? Or are these not generated?


没有增加文章来源，翻译人，校对人，版权信息。


Created multidev environment [dgrant-d8ms#pr-new-name](https://dashboard.pantheon.io/sites/f4eac9a5-d2a1-4dcb-bef6-53dbdeaf93d3#pr-new-name).

[![Visit Site](https://raw.githubusercontent.com/pantheon-systems/ci-drops-8/0.1.0/data/img/visit-site-36.png)](https://pr-new-name-dgrant-d8ms.pantheonsite.io/)


App start time has degraded. This is the reason. Don´t make any API calls in the main Thread, especially not during app initialization. It blocks the complete ui. Also at fist app start there will be no node and app loading will stall until this api call times out. See backend/updater for how to handle API calls from a separate thread.


Created multidev environment [fcl-airlines-service#ci-7](https://dashboard.pantheon.io/sites/5293e1a9-48f4-403f-bdf9-1f778cd81490#ci-7).

[![Visit Site](https://raw.githubusercontent.com/pantheon-systems/ci-drops-8/0.1.0/data/img/visit-site-36.png)](https://ci-7-fcl-airlines-service.pantheonsite.io/)


I can pull your code


Структура проекта как и расширение файла куда-то потерялись)


I think this should be doing GetDatabaseActivity() here, and then CancelDatabaseActivity() should be in PersistChanges() method


@nguerrera
Discussed with Bill.
As you mentioned, for all webprojects currently the DebugType is getting set to portable. To preserve the same behavior, we will remove this setting from here (so that it will go back to the old behavior itself)
```
<DebugType Condition="'$(DebugType)' == ''">pdbonly</DebugType>
```


Is this polling needed? I think it's good enough to just return when then cancellation is in progress.


Merge


Created multidev environment [sg-d8-composer#pr-slogan](https://dashboard.pantheon.io/sites/511ed488-e12a-40b7-93ab-0ba0aa8dee53#pr-slogan).

[![Visit Site](https://raw.githubusercontent.com/pantheon-systems/ci-drops-8/0.1.0/data/img/visit-site-36.png)](https://pr-slogan-sg-d8-composer.pantheonsite.io/)


just do `translatedName := string(T(translationString))`


So you won't need to use template.HTML


And convert it to string


Why do you need this variable? Just use directly `name`


commit


Hmm okay.

What are your thoughts? @greglittlefield-wf @clairesarsam-wf @aaronlademann-wf


@bocharov I was thinking about passing just the Nested type column like in the ARRAY JOIN case, but the nested column is not a real column. In the ARRAY JOIN case, there's a special rewrite rule in the expression analyzer to expand it into selected columns, so we'd have to add another edge case. It's probably bad to add more functions until there's a proper support for nested columns, I'll try with using tuples, it should work with single values as well.


Created multidev environment [dgrant-d8ms#ci-12](https://dashboard.pantheon.io/sites/f4eac9a5-d2a1-4dcb-bef6-53dbdeaf93d3#ci-12).

[![Visit Site](https://raw.githubusercontent.com/pantheon-systems/ci-drops-8/0.1.0/data/img/visit-site-36.png)](https://ci-12-dgrant-d8ms.pantheonsite.io/)


Fixed. Thanks. My TME test wasn't picking that up.


I've addressed these in the gerrit review


@mmatl I think we may want to upgrade the hard-coded TensorFlow version. Or I think just encouraging people to have their own versions in virtualenvs is better, TF's gotten much easier to install.


hey this is a comment


In most languages i've used you couldn't directly modify arguments, expected the same for Go


Yeah it's such a simple and ingenious trick! Thomas needs successive high-fives for this.


Merging Branch


WWW


[eval exp="f.event_replay = 'none']で回避済


WTF is this


https://www.searchengine.com
.net
.gov
.org
Whatever


Get secure certificate for above line. Whichever used


How do you get a secure certificate for internet?


Bluemix [toolchain](https://console.bluemix.net/devops/toolchains/de742651-8462-4286-b78d-3e94ac013f9f "compromisos"): [Delivery Pipeline](https://console.bluemix.net/devops/pipelines/0d0e8b6d-930b-40fc-ac1c-2a7d8ad5ef0b "compromisos") deployed [compromisos](https://github.com/eschuler7/compromisos/releases/tag/deploy-ibm-yp-us-south-eschuler-pe.ibm.com-dev-20171009-235750 "deploy-ibm-yp-us-south-eschuler-pe.ibm.com-dev-20171009-235750") to [dev](https://console.bluemix.net/apps/6f3a0e56-815a-41fc-aa5f-5ec09678068d?env_id=ibm:yp:us-south "ibm:yp:us-south:eschuler@pe.ibm.com:dev"), including this commit


Looks good!


When using the register_new_user function, to what is the user account's role set? I ask because before it was set to "Current Member" only. It should be set to "Subscriber, Current Member".


@valga This was the final solution I settled on instead of the `*Payload` rewrite we spoke about. This way, the JSON containers can still contain business-logic but they simply don't use custom constructors anymore.

This is perfect, because it's exactly the way it's supposed to be: Objects get filled with JSON data, and then we can call special functions on them (such as `handle($target, $logger)`) to make them do stuff with their internal data and the target and logger!

So any future designs where objects need to map JSON data _and_ contain functions should use this pattern.


This fixes #10


수로 표기하는 것보다 char형으로 직접 표기하는게 좀더 보기 편할 것 같습니다.


@kholk leftover?:)


Will this cause errors in other languages?


http://www.averylaird.com/programming/the%20text%20editor/2017/09/30/the-piece-table/  链接挂了 :sweat_smile:


재귀가 아닌 방법으로도 풀어보셔요.


@valga @mgp25 Note this trick:

`$ack->getPayload()->asJson()`

If you ever need to encode objects back to JSON, this is the correct way of doing it. And it accepts all json_encode parameters, so you still have 100% control over the encoding.


ERROR: It will throw NullPointerException at runtime if your nullable value is null.


@valga @mgp25 Note this... You never need to write absolute paths anymore, even when classes are inheriting each other.

In the past, we had to watch out (with JsonMapper) because it couldn't understand "class A { someproperty = Foo\Bar; }; class \Other\B extends A", and it got confused about how to resolve "someproperty".

LazyJsonMapper doesn't have that problem. It perfectly resolves inherited maps. Every property is resolved relative to the class map that defines it!


@yesmeck 发个 patch？我没权限。


teste


https://opentutorials.org/course/1685/9533
http://soyoja.com/261
읽어보기


add content to new pages site


@valga @mgp25 This is an optimization. We could also use `getData()` here... But in internal functions within the object that defines the property, it is slightly faster to just use the internal LazyJsonMapper API instead, to directly get/set the property via `$this->_getProperty()` and `$this->_setProperty()`. That way it doesn't go through magic function translation.

Also note: When you use properties, please remember to cache the response if you use it multiple times. Because each time you get a property it's processed and delivered to you. So don't do `if ($this->_getProperty('foo') !== null) { echo $this->_getProperty('foo').$this->_getProperty('foo').$this->_getProperty('foo').$this->_getProperty('foo');$this->_getProperty('foo') }` ... hehe. :-)

Sure, it will work. But it's best for performance to assign the value to a variable via a single _getProperty call if you are going to use it multiple times.

In this rewrite's commits you will notice that I did that anytime we needed a variable lots of times.


Here is written: "If while searching 2 half moves ago evaluation is increased by 16 and more by 16 from 4 moves ago, then search in tactical mode (more variants)".


로직의 수정이 필요해보입니다.
특정 케이스에서만 동작할 것 같네요.


With this modified version of esp8266-setup, the esp8266 will store SSIDs and passwords in the EEPROM, so they can be retrieved after being powered off. The esp8266 will also compensate for failing to connect.


Just a note, we need to be careful here when directly embedding a user's input on the page. We either have to sanitize it first or verify it against the DB that the input is valid.


Si on vide les cell alors les autres éléments de la cell sont face a une cell vide ;)


@valga This is an optimization to avoid constant `_getProperty()` calls. This was the only place in the code with excessive calls, but anyway just be aware of it. :-)


Hi rouault,

May I know how to reproduce the bug highlighted by oss-fuzz for this issue? Thanks.


Fork from Master


Integer.bitCount 혹은 비트연산 등의 방법도 생각해보아요.


@valga @mgp25 Here, we could have also used `$payload->setCount()` and `$payload->setTimestamp()` to set each JSON property individually. But instead, I decided to use a trick: I construct it with an array containing the JSON data properties we need.

You can also use this trick in the future if you ever need to. For example, you could do something like:

```php
$location = new \InstagramAPI\Response\Model\Location([
    'lat' => 10.123213123,
    'lng' => 43.23929329
]);
$location->asJson();
```

The `asJson()` command only encodes what's actually inside the object. So the output would be `{"lat":...,"lng":...}`. Very nice, eh? ;-)


여기서 NPE 날 거 같은데요.


кириллица превращается в отрицательные числа, если char со знаком.


is this backwards compatible? I guess I'll pull and find out ... Maybe should be 2.0.0 though?


That was probably me. Oops. Sorry...


some commit


Don't need this we can leave this as sync


Sync is fine


@rpower10 Good job.

When you link the file in your `index.html`, do not use "file://". You can make these paths relative, as they can easily link to one another. In your `index.html` file, your `<a>` tag should look like:

```
<a href="index2.html">My favorite Animal?</a>
```


<3 This was worth the 2 weeks of my life... Haha.


It is backwards compatible, take a look at the tests for how to hit the
different api versions.

Test coverage is greatly enhanced now and most methods are invoked!by the
tests.

On Sun, Oct 8, 2017, 11:22 PM Skylar Saveland <notifications@github.com>
wrote:

> is this backwards compatible? I guess I'll pull and find out ... Maybe
> should be 2.0.0 though?
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/ericsomdahl/python-bittrex/commit/0373363e1a06ac1d4156cca97ff5f02946452a52#commitcomment-24848138>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AA2Cbql6rxqzzx9K6pkA0DHi2HGvZwqrks5sqZF1gaJpZM4Px-Ev>
> .
>


WARNING: Excessive nesting leads to hidden complexity. Prefer extracting code to make it easier to understand.


WARNING: Report magic numbers. Magic number is a numeric literal that is not defined as a constant and hence it's unclear what the purpose of this number is. It's better to declare such numbers as constants and give them a proper name. By default, -1, 0, 1, and 2 are not considered to be magic numbers.


Hence, have to check numtop is None or not


Reminding multiple times regarding not to use  HttpServletRequest request or any web related classes in service, persistence layers, next time we will throw out such code from code base without intimation.


Executing the daily benchmark build, I will reply here when finished:

@nanosoldier `runbenchmarks(ALL, isdaily = true)`


This is slightly wrong... `expectException` expects only one argument. Maybe this fix should have been implemented like the others?


Why is this `tpts[i, 0:2]` added by 1 if it is already a supposed one-based coordinate as you commented out the line https://github.com/bearpaw/pytorch-pose/blob/ad2309ef1661ef33e58795bb046ff0c2fd0cf580/pose/datasets/mpii.py#L77 ? Even in the original hourglass code https://github.com/anewell/pose-hg-train/blob/c25da4b48c74a7b314384b07e8c09a15b0343e7f/src/util/pose.lua#L29-L31 it doesn't add the point by 1.

Though in my opinion the coordinate provided by MPII dataset should be zero-based, because the coordinates sometimes are of float type, and can be less than or equal to 0, and can be larger than or equal to the image's size. Please correct me if I'm wrong.


**bpaNotice1** rename it to **bpaNotice** , use proper meaningful names just like your name.


Just took the parameters out :+1:


My machine is a piece a s%#$ login name and psswd which I don't know


Hi!

Looks like there's a missed "await", line 3046 should look like:
```
      let result = await this.privatePostTrade (this.extend (order, params));
```

I can fix this in the master branch if you want?


There are several failure during `make check` for recent commit.
They exist for a while, not from this commit.
I add here just because it is the last commit.

The environment I use :
```
Linux hostname 4.10.0-35-generic #39-Ubuntu SMP Wed Sep 13 07:46:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)
```

1. converter-example.c failed to be compiled due to `getopt` and `optarg`.
```
  CC       check_converter_example-converter-example.o
converter-example.c: In function ‘main’:
converter-example.c:220:17: warning: implicit declaration of function ‘getopt’ [-Wimplicit-function-declaration]
     while((ch = getopt(ac, av, "i:o:1b:cdn:p:hs:" JUNKOPT RANDOPT)) != -1)
                 ^~~~~~
converter-example.c:223:27: error: ‘optarg’ undeclared (first use in this function)
         sel = ats_by_name(optarg, pduType, input_encodings);
                           ^~~~~~
converter-example.c:223:27: note: each undeclared identifier is reported only once for each function it appears in
converter-example.c:382:11: error: ‘optind’ undeclared (first use in this function)
     ac -= optind;
           ^~~~~~
Makefile:620: recipe for target 'check_converter_example-converter-example.o' failed
make[2]: *** [check_converter_example-converter-example.o] Error 1
```
After surfing on internet, someone suggests adding `#define _POSIX_C_SOURCE 2` at the beginning of this file. It works for me.

2. Several failures with similar message `left shift of negative value -1`. See log listed below and also [tests-randomized/test-suite.log](https://gist.github.com/brchiu/de742dc62718cbc6b610a481e89e7f68)

```
========================================================
   asn1c 0.9.29: tests/tests-skeletons/test-suite.log
========================================================

# TOTAL: 17
# PASS:  16
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: check-PER-INTEGER
=======================

../../skeletons/INTEGER.c:806:18: runtime error: left shift of negative value -1
    #0 0x557b5291efda in asn__safe_integer_convert_helper ../../skeletons/INTEGER.c:806
    #1 0x557b5291efda in asn_INTEGER2imax ../../skeletons/INTEGER.c:859
    #2 0x557b529239bb in asn_INTEGER2long ../../skeletons/INTEGER.c:980
    #3 0x557b529239bb in INTEGER_encode_uper ../../skeletons/INTEGER.c:729
    #4 0x557b529245e9 in check_per_encode_constrained /media/brchiu/DATA/DocCollect/SoftwareTech/asn1c/asn1c_vlm/tests/tests-skeletons/check-PER-INTEGER.c:69
    #5 0x557b5291dcb3 in main /media/brchiu/DATA/DocCollect/SoftwareTech/asn1c/asn1c_vlm/tests/tests-skeletons/check-PER-INTEGER.c:157
    #6 0x7f7d079853f0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x203f0)
    #7 0x557b5291e3f9 in _start (/media/brchiu/DATA/DocCollect/SoftwareTech/asn1c/asn1c_vlm/tests/tests-skeletons/check-PER-INTEGER+0x143f9)

FAIL check-PER-INTEGER (exit status: 1)

```

3. Sanitizer check failure. See [tests/tests-c-compiler/test-suite.log](https://gist.github.com/brchiu/c061844ff40262db799f0aa79473cfa0)


just go from Q378, and read the discussion, then follow the questions listed in discussion. I find it more efficient to explore the questions this way, rather than solve them in order.


Thank you!


Ah.  Gotcha.  Makes sense.


boolean getter should not **getCancellationAllowed** its **isCancellationAllowed**


I see.


![](https://github.trello.services/images/mini-trello-icon.png) [Draw planet orbits](https://trello.com/c/DMR7cC18/9-draw-planet-orbits)


Agree, this must be in the themes config.


I haven't recorded a lot of videos but I haven't noticed it do that.


close #1915


Parabens...


removing 1 seems to fix the problem


Do you have a case where this really doesn't work? Because the Android docs state that this directory is for *potentially* device encrypted files. The app doesn't need to care if it's really encrypted, but if it's encrypted, it can still access these files before the user logs in. Again, if you have evidence that this doesn't work somewhere, please let me know.

And yes, you need Xposed Installer to create these directories, that has always been the case.


Dope.


The method replaceText allows to put the function "str_replace(argument1, argument2, argument3") in a function that is repeated very often.


Put the phpDoc for every function allows to indicate function's parameters and what type of response (string, instance, object, array etc) it should return.
I modified variables in order to use camelCase.
I remove parenthesis of the function "clone". I used the function php "clone" that doesn't need parenthesis.


+ I add getters/setters of the entities in order to can use the getters into TemplateManager.
The getter allows to recover the value associated with the getter.
+ I renamed variables in order to be more understandable.
+ I remove the variable "$quoteFromRepository" because the variable "$quote" is the same thing. It's an instance of Quote.
+ I remove the condition ($this->hasText($text, '[quote:destination_link]')) that initialize the variable "$destination". This variable is already defined above.
+ "Quote::renderHtml" calls the method "renderHtml" of the instance Quote. The variable $quote is too an instance of Quote. So, we can write "$quote->renderHtml". It's the same thing for the method "renderText".
+  ucfirst and mb_strtolower allows to transform the variable's format. The getter (getFirstname()) takes care of the format.


Prefer the braces in order to clearly delineate the block and to have the same structure in the whole class


You can also do this by simply adding a property `<maven.deploy.skip>true</maven.deploy.skip>` to this POM.
https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html


kindly do this project quickly


This closes #46


looks good!


Hi, can you please share which tool was used to make the power measurements?


Of course. This happens when you imlement stuff late at night.  Thank you.


Номер лучше строкой сделать (вспомни реальные номера поездов). Иначе нам бы и id сошел


daily


daily in working life


로직의 수정이 필요해보입니다.
특정 케이스에서만 동작할 것 같네요.
예를 들어, (4, 11)인 경우 동작하지 않습니다.


nice!


Probably not :s


Ok I will check

> On Oct 8, 2017, at 7:30 AM, Dimple35 <notifications@github.com> wrote:
>
> But I did...
>
> Sent from my iPhone
>
> > On Oct 7, 2017, at 10:37 PM, dmitry-drill <notifications@github.com> wrote:
> >
> > You did the print, but you didn't write about yourself :)
> >
> > —
> > You are receiving this because you authored the thread.
> > Reply to this email directly, view it on GitHub, or mute the thread.
> >
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.
>


May be it could be simplified with following
```
if (this.props.frozen && !nextProps.frozen) {
  this.start()
} else if (!this.props.frozen && nextProps.frozen) {
  this.stop()
}
```

I don't sure about performance, but it seems to not be in bottleneck so who cares


I think the better use the bundle extension http://symfony.com/doc/current/bundles/configuration.html#using-the-bundle-extension
For example, https://github.com/okvpn/fixture-bundle/pull/1/files#diff-978c02ccc8ccdf14cb8a58dc91ab346cR2


> This happens when you imlement stuff late at night.

;-)  I'm afraid I know this better than many. :-(


why not arrow function? I.e.
```
setInterval(() => this.callbacks.forEach(cb => cb()), duration, false))
```


Thank you so much sir, you got solution give the point how to fix that
issue.

*Regards*
*vicky veera  software developer*

On Fri, Oct 6, 2017 at 9:49 AM, GAURAV AGRAWAL <notifications@github.com>
wrote:

> hi vicky
>
> thanks for your interest. allow me some time to look into it, i havent
> worked on it for an year. mebbe the api authentication keys have expired or
> something like that. lemme figure out
>
> regards
>
> On Thu, Oct 5, 2017 at 11:47 AM, vickyveera10 <notifications@github.com>
> wrote:
>
> > i have try this code ui only working in Android studio but
> functionalities
> > not work is there require any plugins.
> > please kindly help me to solve this issue
> >
> > —
> > You are receiving this because you authored the thread.
> > Reply to this email directly, view it on GitHub
> > <https://github.com/dhishku/AgriBot/commit/
> fc5eabf98e602da1d092501342627df687dba0d4#commitcomment-24773908>,
> > or mute the thread
> > <https://github.com/notifications/unsubscribe-
> auth/AUPY-e4oy2Cy3bfqfCMjJKO_mXqXOAiPks5spHSSgaJpZM4Pum2X>
> > .
> >
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/dhishku/AgriBot/commit/fc5eabf98e602da1d092501342627df687dba0d4#commitcomment-24798281>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AVOhu_gmmVXeH3Uc7aGdtR247rBuD1D-ks5spapVgaJpZM4Pum2X>
> .
>


孤陋寡闻了，原来去年英文版里就出现了‘guard’，不过自己已经习惯用“钩子”了。


我建议中文分三种：

- 很短的，不带标点；
- 短语或单句，用分号；
- 多句，用句号。


this is just a comment?


ThAnk you


@jesdynf

Cool.

Can we run bash and `aws` commands on AWS Lambda?

Know of a good way to use emailers with bash? I have a Node package in mind for this, but I'm open to the bash solution


주어진 케이스 외에 케이스에 대해서도 확인이 필요할 것 같습니다.


interesting. I think more extensive testing on performance is needed for this commit and we should review if Haotian's proposal can better optimize the overhead.


So can we work out a commit to fix this issue?


Such dirt:tm:


Bluemix [toolchain](https://console.bluemix.net/devops/toolchains/de742651-8462-4286-b78d-3e94ac013f9f "compromisos"): [Delivery Pipeline](https://console.bluemix.net/devops/pipelines/0d0e8b6d-930b-40fc-ac1c-2a7d8ad5ef0b "compromisos") deployed [compromisos](https://github.com/eschuler7/compromisos/releases/tag/deploy-ibm-yp-us-south-eschuler-pe.ibm.com-dev-20171009-050316 "deploy-ibm-yp-us-south-eschuler-pe.ibm.com-dev-20171009-050316") to [dev](https://console.bluemix.net/apps/6f3a0e56-815a-41fc-aa5f-5ec09678068d?env_id=ibm:yp:us-south "ibm:yp:us-south:eschuler@pe.ibm.com:dev"), including this commit


If you take a look at the stack, you'll see an example of using Python in Lambda, and it's making use of the AWS SDK -- all the rest is manipulating arrays and strings, and that's not hard at all.

As for sending email, http://docs.aws.amazon.com/cli/latest/reference/ses/send-email.html seems relevant. Inside AWS, you *cannot* send email except with AWS credentials anyways -- AWS blocks outbound 25 -- so there's no reason not to just use the AWS stuff rather than pulling another library.


Bluemix [toolchain](https://dev-console.stage1.bluemix.net/devops/toolchains/b59af34f-bb1e-48f9-bfe3-6124c6569f90 "UI-ys1dev-KEEP-TC"): [Delivery Pipeline](https://dev-console.stage1.bluemix.net/devops/pipelines/95b48a85-90ae-4a2a-b138-ea0a6fbc4e6a "UI-ys1dev-KEEP-TC") deployed [UI-ys1dev-KEEP-TC](https://github.com/idsb3t1/UI-ys1dev-KEEP-TC/releases/tag/deploy-ibm-ys1-us-south-idsb3t4-us.ibm.com-dev-20171009-050410 "deploy-ibm-ys1-us-south-idsb3t4-us.ibm.com-dev-20171009-050410") to [dev](https://console.stage1.bluemix.net/apps/532b17cd-e3d7-4291-bae0-e19488c05ab8?env_id=ibm:ys1:us-south "ibm:ys1:us-south:idsb3t4@us.ibm.com:dev"), including this commit


소스파일


`cannotPickup` only checks if the delay timer has passed. It doens't check current owner, if the item is dead or anything.


> Say wilt niet werken (ik moet het channel ID zien te vinden maar hoe of
wat is nog wat google werk)

krijg je een foutmelding?


Changes of 1.2.22 to 1.3.0

* Remove `didMount` trigger
* Remove `renderTo` method
* Remove `parent` property
* Reduce redundant undefined assign
* Make setter property be a watching handler
* Update `Jinkela.register`


비트연산자 이용


请问下 每次下滑屏幕 都不太流畅，总有一顿一顿的感觉，是cell复用的问题吗？还是？


There are several failure during `make check` for recent commit.
They exist for a while, not from this commit 3ed43b253

The environment I use :
```
Linux hostname 4.10.0-35-generic #39-Ubuntu SMP Wed Sep 13 07:46:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)
```

1. converter-example.c failed to be compiled due to `getopt` and `optarg`.
```
  CC       check_converter_example-converter-example.o
converter-example.c: In function ‘main’:
converter-example.c:220:17: warning: implicit declaration of function ‘getopt’ [-Wimplicit-function-declaration]
     while((ch = getopt(ac, av, "i:o:1b:cdn:p:hs:" JUNKOPT RANDOPT)) != -1)
                 ^~~~~~
converter-example.c:223:27: error: ‘optarg’ undeclared (first use in this function)
         sel = ats_by_name(optarg, pduType, input_encodings);
                           ^~~~~~
converter-example.c:223:27: note: each undeclared identifier is reported only once for each function it appears in
converter-example.c:382:11: error: ‘optind’ undeclared (first use in this function)
     ac -= optind;
           ^~~~~~
Makefile:620: recipe for target 'check_converter_example-converter-example.o' failed
make[2]: *** [check_converter_example-converter-example.o] Error 1
```
After surfing on internet, someone suggests adding `#define _POSIX_C_SOURCE 2` at the beginning of this file. It works for me.

2. Several failures with similar message `left shift of negative value -1`. See log listed below and also [tests-randomized/test-suite.log](https://gist.github.com/brchiu/de742dc62718cbc6b610a481e89e7f68)

```
========================================================
   asn1c 0.9.29: tests/tests-skeletons/test-suite.log
========================================================

# TOTAL: 17
# PASS:  16
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: check-PER-INTEGER
=======================

../../skeletons/INTEGER.c:806:18: runtime error: left shift of negative value -1
    #0 0x557b5291efda in asn__safe_integer_convert_helper ../../skeletons/INTEGER.c:806
    #1 0x557b5291efda in asn_INTEGER2imax ../../skeletons/INTEGER.c:859
    #2 0x557b529239bb in asn_INTEGER2long ../../skeletons/INTEGER.c:980
    #3 0x557b529239bb in INTEGER_encode_uper ../../skeletons/INTEGER.c:729
    #4 0x557b529245e9 in check_per_encode_constrained /media/brchiu/DATA/DocCollect/SoftwareTech/asn1c/asn1c_vlm/tests/tests-skeletons/check-PER-INTEGER.c:69
    #5 0x557b5291dcb3 in main /media/brchiu/DATA/DocCollect/SoftwareTech/asn1c/asn1c_vlm/tests/tests-skeletons/check-PER-INTEGER.c:157
    #6 0x7f7d079853f0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x203f0)
    #7 0x557b5291e3f9 in _start (/media/brchiu/DATA/DocCollect/SoftwareTech/asn1c/asn1c_vlm/tests/tests-skeletons/check-PER-INTEGER+0x143f9)

FAIL check-PER-INTEGER (exit status: 1)

```

3. Sanitizer check failure. See [tests/tests-c-compiler/test-suite.log](https://gist.github.com/brchiu/c061844ff40262db799f0aa79473cfa0)

The environment I use :
```
Linux hostname 4.10.0-35-generic #39-Ubuntu SMP Wed Sep 13 07:46:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

gcc version 6.3.0 20170406 (Ubuntu 6.3.0-12ubuntu2)
```

1. converter-example.c failed to be compiled due to `getopt` and `optarg`.
```
  CC       check_converter_example-converter-example.o
converter-example.c: In function ‘main’:
converter-example.c:220:17: warning: implicit declaration of function ‘getopt’ [-Wimplicit-function-declaration]
     while((ch = getopt(ac, av, "i:o:1b:cdn:p:hs:" JUNKOPT RANDOPT)) != -1)
                 ^~~~~~
converter-example.c:223:27: error: ‘optarg’ undeclared (first use in this function)
         sel = ats_by_name(optarg, pduType, input_encodings);
                           ^~~~~~
converter-example.c:223:27: note: each undeclared identifier is reported only once for each function it appears in
converter-example.c:382:11: error: ‘optind’ undeclared (first use in this function)
     ac -= optind;
           ^~~~~~
Makefile:620: recipe for target 'check_converter_example-converter-example.o' failed
make[2]: *** [check_converter_example-converter-example.o] Error 1
```
After surfing on internet, someone suggests adding `#define _POSIX_C_SOURCE 2` at the beginning of this file. It works for me.

2. Several failures with similar message `left shift of negative value -1`. See log listed below and also [tests-randomized/test-suite.log](https://gist.github.com/brchiu/de742dc62718cbc6b610a481e89e7f68)

```
========================================================
   asn1c 0.9.29: tests/tests-skeletons/test-suite.log
========================================================

# TOTAL: 17
# PASS:  16
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: check-PER-INTEGER
=======================

../../skeletons/INTEGER.c:806:18: runtime error: left shift of negative value -1
    #0 0x557b5291efda in asn__safe_integer_convert_helper ../../skeletons/INTEGER.c:806
    #1 0x557b5291efda in asn_INTEGER2imax ../../skeletons/INTEGER.c:859
    #2 0x557b529239bb in asn_INTEGER2long ../../skeletons/INTEGER.c:980
    #3 0x557b529239bb in INTEGER_encode_uper ../../skeletons/INTEGER.c:729
    #4 0x557b529245e9 in check_per_encode_constrained /media/brchiu/DATA/DocCollect/SoftwareTech/asn1c/asn1c_vlm/tests/tests-skeletons/check-PER-INTEGER.c:69
    #5 0x557b5291dcb3 in main /media/brchiu/DATA/DocCollect/SoftwareTech/asn1c/asn1c_vlm/tests/tests-skeletons/check-PER-INTEGER.c:157
    #6 0x7f7d079853f0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x203f0)
    #7 0x557b5291e3f9 in _start (/media/brchiu/DATA/DocCollect/SoftwareTech/asn1c/asn1c_vlm/tests/tests-skeletons/check-PER-INTEGER+0x143f9)

FAIL check-PER-INTEGER (exit status: 1)

```

3. Sanitizer check failure. See [tests/tests-c-compiler/test-suite.log](https://gist.github.com/brchiu/c061844ff40262db799f0aa79473cfa0)


修改第一次作业


Hi, I wonder why I modify your multivehicle code like this:
eastwestd = 1.0/85567
northsouthd = 1.0/111111
lati = vehicles[0].location.global_frame.lat
lonti = vehicles[0].location.global_frame.lon
file = open("position.txt", 'r')
i = 0
while True:
	line = file.readline()
	if not line:
		break
	x[i] = float(line.split(' ')[0].strip())
	y[i] = float(line.split(' ')[1].strip())
	i += 1
file.close()

for i in range(0,len(vehicles)):
	print("vehicle %d going towards first point for 30 seconds ..." % (target_systems[i],))
	point = LocationGlobalRelative(lati + northsouthd * y[i],
								lonti + eastwestd * x[i],
								20)
	vehicles[i].simple_goto(point)
watch_things_for_a_while()

And finally three drones all end up at a strange points different from all three destianations assinged to them? As a greenhand I am very confused and I hope you could help me...


No worries. Thanks for sharing the code.


I think it is useful for me. I am learning in this field now and I am happy to browse the project developed by you. By the way, if you are free, could you please teach me something necessary in this field(I am a new person in this field.)?


Thank you, fixed in https://github.com/cznic/99c/commit/0869a6d6d54de8cc73f009106d6ab49807f142aa.


`x = [None] * len(target_systems)
y = [None] * len(target_systems)
# distance = 30
eastwestd = 1.0/85567
northsouthd = 1.0/111111
lati = vehicles[0].location.global_frame.lat
lonti = vehicles[0].location.global_frame.lon
# sleep so we can see the change in map
def watch_things_for_a_while(duration=30):
	start = time.time()

	while time.time() - start < duration:
		for j in range(0,len(vehicles)):
			vehicle = vehicles[j]
			print("Vehicle %d (%s) Lat=%f Lon=%f" % (target_systems[j], vehicle.mode, vehicle.location.global_frame.lat, vehicle.location.global_frame.lon))
			time.sleep(1)
#while True:
file = open("position.txt", 'r')
i = 0
while True:
	line = file.readline()
	if not line:
		break
	x[i] = float(line.split(' ')[0].strip())
	y[i] = float(line.split(' ')[1].strip())
	i += 1
file.close()

for i in range(0,len(vehicles)):
	print("vehicle %d going towards first point for 30 seconds ..." % (target_systems[i],))
	point = LocationGlobalRelative(lati + northsouthd * y[i],
								lonti + eastwestd * x[i],
								20)
	vehicles[i].simple_goto(point)

watch_things_for_a_while()`


Can you please let me know the usages of the metric plugins ? as i am getting error regarding int value . I am just trying python metrics-couchbase.py


Bluemix [toolchain](https://console.stage1.bluemix.net/devops/toolchains/018d111f-26ad-4a3d-a983-baf0582747e0 "UI-ys1int-SimpleTC1009T011823"): [Delivery Pipeline](https://console.stage1.bluemix.net/devops/pipelines/6fb2100e-86c2-42bd-851b-1754b982b05f "UI-ys1int-SimpleTC1009T011823") deployed [UI-ys1int-SimpleTC1009T011823](https://github.com/idsb3t1/UI-ys1int-SimpleTC1009T011823/releases/tag/deploy-ibm-ys1-us-south-idsb3t3-us.ibm.com-dev-20171009-052303 "deploy-ibm-ys1-us-south-idsb3t3-us.ibm.com-dev-20171009-052303") to [dev](https://console.stage1.bluemix.net/apps/ceba0431-1e89-413f-83bc-8fbd0cfab36a?env_id=ibm:ys1:us-south "ibm:ys1:us-south:idsb3t3@us.ibm.com:dev"), including this commit


Bluemix [toolchain](https://console.bluemix.net/devops/toolchains/de742651-8462-4286-b78d-3e94ac013f9f "compromisos"): [Delivery Pipeline](https://console.bluemix.net/devops/pipelines/0d0e8b6d-930b-40fc-ac1c-2a7d8ad5ef0b "compromisos") deployed [compromisos](https://github.com/eschuler7/compromisos/releases/tag/deploy-ibm-yp-us-south-eschuler-pe.ibm.com-dev-20171009-052408 "deploy-ibm-yp-us-south-eschuler-pe.ibm.com-dev-20171009-052408") to [dev](https://console.bluemix.net/apps/6f3a0e56-815a-41fc-aa5f-5ec09678068d?env_id=ibm:yp:us-south "ibm:yp:us-south:eschuler@pe.ibm.com:dev"), including this commit


Ik krijg geen foutmelding, dat is het moeilijke eraan

Op 9 okt. 2017 07:14 schreef "frank goossens" <notifications@github.com>:

> Say wilt niet werken (ik moet het channel ID zien te vinden maar hoe of
> wat is nog wat google werk)
>
> krijg je een foutmelding?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/futtta/boekenjagerbot/commit/68ee8a6b84baa2d4219041e5d4f6cae02cf52c6f#commitcomment-24849207>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAiq3Iec6Jz-pIKXBLKnJ113E5JhLnR-ks5sqauYgaJpZM4PyAuF>
> .
>


I move previous comment to here since I encountered some other problems in newest commit.


Thanks.

I actually fixed this in the next commit ("...and make them actually work"). I know it clutters the commits and makes it harder to review, but I tend to get things rights on the second try. :/


readme-edits


Bluemix [toolchain](https://console.stage1.bluemix.net/devops/toolchains/ee7af0c7-eb4b-4808-84ae-65a1ebf892f4 "UI-ys1int-KEEP-TC"): [Delivery Pipeline](https://console.stage1.bluemix.net/devops/pipelines/91fde061-3564-4ded-a29e-3c930cc52871 "UI-ys1int-KEEP-TC") deployed [UI-ys1int-KEEP-TC](https://github.com/idsb3t1/UI-ys1int-KEEP-TC/releases/tag/deploy-ibm-ys1-us-south-idsb3t2-us.ibm.com-dev-20171009-053010 "deploy-ibm-ys1-us-south-idsb3t2-us.ibm.com-dev-20171009-053010") to [dev](https://console.stage1.bluemix.net/apps/b4f8bc84-2681-493e-9a97-2f3f0b8535a7?env_id=ibm:ys1:us-south "ibm:ys1:us-south:idsb3t2@us.ibm.com:dev"), including this commit


so, what will be the solution


delete


아 이것이 된 것인가


`jobs` 辺り `CI`  が1回実行される。


`working_directory` を指定すると、 ｀CI｀ の実行ディレクトリを指定出来る。


@mklement0, regarding the second point, the current implementation of out-string will not strip any embedded newlines since the [issue](https://github.com/PowerShell/PowerShell/issues/3684) explicitly mentioned that

> "strings among the input objects retain their embedded newlines however"

 (I have also added a [test ](https://github.com/raghav710/PowerShell/commit/f17122a22392296dc896597e5b0aaa36088bfea0#diff-561bfc4ca52a03cce8e16cd177b2d6ceR54)that emphasizes it). Let me know if there is any misunderstanding on my part. Thanks!