Last edit: @dye in #hi 1 week ago - Slack Archive

2

History

Revision: 5259 by @dye in #hi 1 week agoSlack Archive

2

Revision: 5246 by @dye in #hi 1 week agoSlack Archive

{lua}
print(args)
if (args == "December_2018")  then
	print(1)
elseif (args == "2" or args == "3") then
	print(2)
elseif (args == "2_3" or args == "3_5") then
	print(3)
else
    print(5)
end

Revision: 5245 by @dye in #hi 1 week agoSlack Archive

{lua}
print(args)
if (args == "1")  then
	print(1)
elseif (args == "2" or args == "3") then
	print(2)
elseif (args == "2_3" or args == "3_5") then
	print(3)
else
    print(5)
end

Revision: 5244 by @dye in #hi 1 week agoSlack Archive

{lua}

print(args)


if (args == "December_2018")  then
	print(1)
elseif (args == "2" or args == "3") then
	print(2)
elseif (args == "2_3" or args == "3_5") then
	print(3)
else
    print(5)
end

Revision: 5243 by @dye in #hi 1 week agoSlack Archive

{lua}

print(args)


if (args == "December_2018")  then
	print(1)
elseif (args == "November_2018" or args == "January_2019") then
	print(2)
else
    print("Starting Point: `!OpenSlack`")
end

Revision: 5242 by @dye in #hi 1 week agoSlack Archive

test

Revision: 5241 by @dye in #hi 1 week agoSlack Archive

{lua}

print(args)


if (args == "1")  then
	print(1)
elseif (args == "2" or args == "3") then
	print(2)
elseif (args == "2_3" or args == "3_5") then
	print(3)
else
    print(5)
end

Revision: 5240 by @dye in #hi 1 week agoSlack Archive

{lua}

print(args)


if (args == "1")  then
	print(1)
elseif (args == "2" or args == "3") then
	print(2)
elseif (args == `2 3` or args == `3 5`) then
	print(3)
else
    print(5)
end

Revision: 5239 by @dye in #hi 1 week agoSlack Archive

{lua}

print(args)


if (args == "1")  then
	print(1)
elseif (args == "2" or args == "3") then
	print(2)
elseif (args == "2 3" or args == "3 5") then
	print(3)
else
    print(5)
end

Revision: 5238 by @dye in #hi 1 week agoSlack Archive

{lua}

print(args)


if (args == "1")  then
	print(1)
elseif (args == "2" or args == "3") then
	print(2)
elseif (args == "2 3" or args == "3 5") then
	print(3)
else
    print(5)
end

if (args == "December 2018")  then
	print(1)
elseif (args == "November 2018" or args == "January 2019") then
	print(2)
else
    print("Starting Point: `!OpenSlack`")
end

Revision: 5237 by @dye in #hi 1 week agoSlack Archive

{lua}

print(args)

if (args == "December 2018")  then
	print(1)
elseif (args == "November 2018" or args == "January 2019") then
	print(2)
else
    print("Starting Point: `!OpenSlack`")
end

Revision: 5236 by @dye in #hi 1 week agoSlack Archive

{lua}

if (args == "December 2018")  then
	print(1)
elseif (args == "November 2018" or args == "January 2019") then
	print(2)
else
    print("Starting Point: `!OpenSlack`")
end

Revision: 5178 by @dye in #hi 2 months agoSlack Archive

2

Revision: 5176 by @dye in #hi 2 months agoSlack Archive

{lua}

local messageTable = {
'\n*Transfer: The Past*\n\n\n*2017/03 The First Internal Announcement*',

'```\nYingli Zhu\nIf I am a cadet in 42us, is any possible I can transfer to 42Paris and get a student visa?\n\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\n\nYingli Zhu\nWow, sounds good. My us visa will end in this year. I am trying to keep working in 42\nDo you know how to transfer to Paris?\n\nDavid Ye\n@yzhu  just send an email to 42US\n\nYingli Zhu\nI ask staff, they do not know about that\n\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\n\nMatt Grimes\nKwame is the one who said it, so contact him directly\n\nDavid Ye\nNot just Kwame, Gaetan also said that.\n\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\n\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```',

'```\nKWAME YAMGNANE\n- Co-Founder and Managing Director (2016-2018)\n\nGAETAN JUVIN\n- Chief Pedagogic Officer\n\nhttps://www.42.us.org/the-university/team/\n```',

'\n*2018/10/31 The Difference between Switching Before/After the Cadet Start Date*',

"```\nJean-Loup Naddef\nI switched from Paris campus to fremont's one, all it took me was giving some chocolate to Gaetan.\n\nMeo Leung\nIt depends:\na. If your 42 curriculum has already begun (and you are actively enrolled) in 42 SV you do not need to choose a Start date, you only need to give Gtn chocolate & croissants :eyes:\nb. If you just completed your piscine and have not chosen a 42 SV Start date, then you will need to ask to be transferred to the France admissions site to select a Start date. :stuck_out_tongue: (and probs still give Gtn chocolate & croissants)\n\nfrom a thread in #cadets October 31st, 2018\nhttps://42schoolsiliconvalley.slack.com/archives/C2BTT0LD6/p1541039050135700?thread_ts=1540957016.113300&cid=C2BTT0LD6\n```",

'\n*2019/02/25 New Requirments Added by The Paris Management*\n\n- You must be Level 7 or higher in the Cadet curriculum.\n- You also have to have a clean record.\n\n\nMore in the pinned files in <#C1GSY923Z|visa>'

}

for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5175 by @dye in #hi 2 months agoSlack Archive

2

Revision: 5173 by @dye in #hi 2 months agoSlack Archive

{lua}

local messageTable = {

'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n42 launches *`42 Network`*, its international network of 20 partner campuses, on June 18th 2019.\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new campuses.* "They are being asked to prove themselves upstream to avoid wild tourism," says Sophie Viger, who also states to establish "`quotas`" in the workforce to prevent some cities are stormed, such as Tokyo, at the expense of others . [Google Translation]\n> [start.lesechos.fr]\n\n*Low Structural Costs*\n\n> The national and international spin-off of the school is facilitated by the fact that the infrastructure to run it is relatively small. "*We have designed a cheap system" that can work "with three employees per site*, " said Sophie Viger.\n> In France, the school has about forty employees, responsible in particular for defining the educational content. [Google Translation]\n> https://www.maddyness.com/2019/06/18/ecole-42-international/\n\n> Financing side, it ensures: "no funds from Niel". *The money comes from consortia of companies, philanthropists and public funding from host countries.*\n> [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n     - `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)'

}

if (channel.type ~= "im" and channel.id ~= "C1GSY923Z") then
 print(string.format("Hi, \60@%s\62, this factoid is only available in <#C1GSY923Z|visa>, or through messaging me directly.", user.id))
else
 for i,v in ipairs(messageTable) do print(v .. '\n') end
end

Revision: 5172 by @dye in #hi 2 months agoSlack Archive

{lua}

local messageTable = {

'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n42 launches *`42 Network`*, its international network of 20 partner campuses, on June 18th 2019.\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new campuses.* "They are being asked to prove themselves upstream to avoid wild tourism," says Sophie Viger, who also states to establish "`quotas`" in the workforce to prevent some cities are stormed, such as Tokyo, at the expense of others . [Google Translation]\n> [start.lesechos.fr]\n\n*Low Structural Costs*\n\n> The national and international spin-off of the school is facilitated by the fact that the infrastructure to run it is relatively small. "*We have designed a cheap system" that can work "with three employees per site*, " said Sophie Viger.\n> In France, the school has about forty employees, responsible in particular for defining the educational content. [Google Translation]\n> https://www.maddyness.com/2019/06/18/ecole-42-international/\n\n> Financing side, it ensures: "no funds from Niel". *The money comes from consortia of companies, philanthropists and public funding from host countries.*\n> [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n     - `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)'

}

if (channel.type ~= "im" and channel.id ~= "C1GSY923Z") then
 print(string.format("\60@%s\62, this factoid is only available in <#C1GSY923Z|visa>, or through messaging me directly.", user.id))
else
 for i,v in ipairs(messageTable) do print(v .. '\n') end
end

Revision: 5171 by @dye in #hi 2 months agoSlack Archive

{lua}

local messageTable = {

'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n42 launches *`42 Network`*, its international network of 20 partner campuses, on June 18th 2019.\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new campuses.* "They are being asked to prove themselves upstream to avoid wild tourism," says Sophie Viger, who also states to establish "`quotas`" in the workforce to prevent some cities are stormed, such as Tokyo, at the expense of others . [Google Translation]\n> [start.lesechos.fr]\n\n*Low Structural Costs*\n\n> The national and international spin-off of the school is facilitated by the fact that the infrastructure to run it is relatively small. "*We have designed a cheap system" that can work "with three employees per site*, " said Sophie Viger.\n> In France, the school has about forty employees, responsible in particular for defining the educational content. [Google Translation]\n> https://www.maddyness.com/2019/06/18/ecole-42-international/\n\n> Financing side, it ensures: "no funds from Niel". *The money comes from consortia of companies, philanthropists and public funding from host countries.*\n> [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n     - `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)'

}

if (channel.type ~= "im" and channel.id ~= "C2VQ5USPK") then
 print(string.format("\60@%s\62, this factoid is only available in <#C2VQ5USPK|_cantina>, or through messaging me directly.", user.id))
else
 for i,v in ipairs(messageTable) do print(v .. '\n') end
end

Revision: 5170 by @dye in #hi 2 months agoSlack Archive

{lua}
local messageTable = {

'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n42 launches *`42 Network`*, its international network of 20 partner campuses, on June 18th 2019.\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new campuses.* "They are being asked to prove themselves upstream to avoid wild tourism," says Sophie Viger, who also states to establish "`quotas`" in the workforce to prevent some cities are stormed, such as Tokyo, at the expense of others . [Google Translation]\n> [start.lesechos.fr]\n\n*Low Structural Costs*\n\n> The national and international spin-off of the school is facilitated by the fact that the infrastructure to run it is relatively small. "*We have designed a cheap system" that can work "with three employees per site*, " said Sophie Viger.\n> In France, the school has about forty employees, responsible in particular for defining the educational content. [Google Translation]\n> https://www.maddyness.com/2019/06/18/ecole-42-international/\n\n> Financing side, it ensures: "no funds from Niel". *The money comes from consortia of companies, philanthropists and public funding from host countries.*\n> [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n     - `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)'

}

for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5169 by @dye in #hi 2 months agoSlack Archive

{lua}
local messageTable = {

'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n42 launches *`42 Network`*, its international network of 20 partner campuses, on June 18th 2019.\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new campuses.* "They are being asked to prove themselves upstream to avoid wild tourism," says Sophie Viger, who also states to establish "`quotas`" in the workforce to prevent some cities are stormed, such as Tokyo, at the expense of others . [Google Translation]\n> [start.lesechos.fr]\n\n*Low Structural Costs*\n\n> The national and international spin-off of the school is facilitated by the fact that the infrastructure to run it is relatively small. "*We have designed a cheap system" that can work "with three employees per site*, " said Sophie Viger.\n> In France, the school has about forty employees, responsible in particular for defining the educational content. [Google Translation]\n> https://www.maddyness.com/2019/06/18/ecole-42-international/\n\n> Financing side, it ensures: "no funds from Niel". *The money comes from consortia of companies, philanthropists and public funding from host countries.*\n> [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n   - `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)'

}

for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5168 by @dye in #hi 2 months agoSlack Archive

{lua}
local messageTable = {

'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n42 launches *`42 Network`*, its international network of 20 partner campuses, on June 18th 2019.\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new campuses.* "They are being asked to prove themselves upstream to avoid wild tourism," says Sophie Viger, who also states to establish "`quotas`" in the workforce to prevent some cities are stormed, such as Tokyo, at the expense of others . [Google Translation]\n> [start.lesechos.fr]\n\n*Low Structural Costs*\n\n> The national and international spin-off of the school is facilitated by the fact that the infrastructure to run it is relatively small. "*We have designed a cheap system" that can work "with three employees per site*, " said Sophie Viger.\n> In France, the school has about forty employees, responsible in particular for defining the educational content. [Google Translation]\n> https://www.maddyness.com/2019/06/18/ecole-42-international/\n\n> Financing side, it ensures: "no funds from Niel". *The money comes from consortia of companies, philanthropists and public funding from host countries.*\n> [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n- `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)'

}

for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5167 by @dye in #hi 2 months agoSlack Archive

{lua}
local messageTable = {

'ok'}

for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5166 by @dye in #hi 2 months agoSlack Archive

{lua}
local messageTable = {

'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n42 launches *`42 Network`*, its international network of 20 partner campuses, on June 18th 2019.\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new campuses.* "They are being asked to prove themselves upstream to avoid wild tourism," says Sophie Viger, who also states to establish "`quotas`" in the workforce to prevent some cities are stormed, such as Tokyo, at the expense of others . [Google Translation]\n> [start.lesechos.fr]\n\n*Low Structural Costs*\n\n> The national and international spin-off of the school is facilitated by the fact that the infrastructure to run it is relatively small. "*We have designed a cheap system" that can work "with three employees per site*, " said Sophie Viger.\n> In France, the school has about forty employees, responsible in particular for defining the educational content. [Google Translation]\n> https://www.maddyness.com/2019/06/18/ecole-42-international/\n\n> Financing side, it ensures: "no funds from Niel". *The money comes from consortia of companies, philanthropists and public funding from host countries.*\n> [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n   - `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)
'}

for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5165 by @dye in #hi 2 months agoSlack Archive

{lua}local messageTable = {
'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n42 launches *`42 Network`*, its international network of 20 partner campuses, on June 18th 2019.\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new campuses.* "They are being asked to prove themselves upstream to avoid wild tourism," says Sophie Viger, who also states to establish "`quotas`" in the workforce to prevent some cities are stormed, such as Tokyo, at the expense of others . [Google Translation]\n> [start.lesechos.fr]\n\n*Low Structural Costs*\n\n> The national and international spin-off of the school is facilitated by the fact that the infrastructure to run it is relatively small. "*We have designed a cheap system" that can work "with three employees per site*, " said Sophie Viger.\n> In France, the school has about forty employees, responsible in particular for defining the educational content. [Google Translation]\n> https://www.maddyness.com/2019/06/18/ecole-42-international/\n\n> Financing side, it ensures: "no funds from Niel". *The money comes from consortia of companies, philanthropists and public funding from host countries.*\n> [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n   - `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)
'}

for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5164 by @dye in #hi 2 months agoSlack Archive

{lua}local messageTable = {'
*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n42 launches *`42 Network`*, its international network of 20 partner campuses, on June 18th 2019.\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new campuses.* "They are being asked to prove themselves upstream to avoid wild tourism," says Sophie Viger, who also states to establish "`quotas`" in the workforce to prevent some cities are stormed, such as Tokyo, at the expense of others . [Google Translation]\n> [start.lesechos.fr]\n\n*Low Structural Costs*\n\n> The national and international spin-off of the school is facilitated by the fact that the infrastructure to run it is relatively small. "*We have designed a cheap system" that can work "with three employees per site*, " said Sophie Viger.\n> In France, the school has about forty employees, responsible in particular for defining the educational content. [Google Translation]\n> https://www.maddyness.com/2019/06/18/ecole-42-international/\n\n> Financing side, it ensures: "no funds from Niel". *The money comes from consortia of companies, philanthropists and public funding from host countries.*\n> [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n   - `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)
'}

for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5163 by @dye in #hi 2 months agoSlack Archive

{lua}local messageTable = {'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n42 launches *`42 Network`*, its international network of 20 partner campuses, on June 18th 2019.\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new campuses.* "They are being asked to prove themselves upstream to avoid wild tourism," says Sophie Viger, who also states to establish "`quotas`" in the workforce to prevent some cities are stormed, such as Tokyo, at the expense of others . [Google Translation]\n> [start.lesechos.fr]\n\n*Low Structural Costs*\n\n> The national and international spin-off of the school is facilitated by the fact that the infrastructure to run it is relatively small. "*We have designed a cheap system" that can work "with three employees per site*, " said Sophie Viger.\n> In France, the school has about forty employees, responsible in particular for defining the educational content. [Google Translation]\n> https://www.maddyness.com/2019/06/18/ecole-42-international/\n\n> Financing side, it ensures: "no funds from Niel". *The money comes from consortia of companies, philanthropists and public funding from host countries.*\n> [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n- `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)'}

for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5162 by @dye in #hi 2 months agoSlack Archive

{lua}local messageTable = {'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n> Paris, June 18th 2019 – Six years after its creation in *Paris*, three years after opening a second campus in Fremont, in the heart of the *Silicon Valley*, and two years after opening *42 Lyon (former 101)*, 42 pursues its founding vision: make digital an opportunity for all, everywhere. \n\n> Completely open to the world with partnerships with *Belgium (le 19)*, *Morocco (1337 Khouribga and Ben Guérir)*, *Finland (Hive)*, *Netherlands (Codam)* and *Russia (School 21)*, the pioneer school reached a new milestone today with the launch of *`42 Network`*: first international network in computer excellence, accessible to all, for free. A network which will unite *20 partner campuses* worldwide in 2020, including 13 under the colors of 42.\n\n*11 campuses join 42 Paris and 42 Fremont*\n\n42 Rio, 42 São Paulo, 42 Jakarta, 42 Yerevan, 42 Tokyo, 42 Bogota, 42 Angoulême, 42 Madrid, 42 Québec, School 21 (Novossibirsk), School 21 (Kazan)\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can also be felt in the setup of cross-campus projects (three campuses of different countries) that gives them a taste of real professional experience (collaboration with partners from various work cultures and time zones). \n\n> *Only students with level 7 or higher can request a transfer to one of these new [start.lesechos.fr]\n\n*More to Come*\n\n> The school does not stop there and *plans on opening a dozen campuses per year*. "We are solicited from all sides and several future partnerships are already in the pipeline, as with Germany", concludes the director, which aims to double its workforce within two years, from 7,000 to 15,000 students in the network 42. [Google Translation]\n> [start.lesechos.fr]\n\n- [The Official Site](https://www.42.fr/un-reseau-international/)\n- `It contains the information of each 42 Network School.`\n- [Press Release](https://www.42.us.org/wp-content/uploads/2019/06/42-lauches-42-Network_English-press-release_VOK-converted-1.pdf)\n- [start.lesechos.fr](https://start.lesechos.fr/etudes-formations/universites-grandes-ecoles/l-ecole-42-annonce-l-ouverture-de-11-nouveaux-campus-15293.php)'}for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5161 by @dye in #hi 2 months agoSlack Archive

{lua}
local messageTable = {
'*`42 Network`*\n\nhttps://i.imgur.com/Wdx3wEZ.gif\n\n> Paris, June 18th 2019 – Six years after its creation in *Paris*, three years after opening a second campus in Fremont, in the heart of the *Silicon Valley*, and two years after opening *42 Lyon (former 101)*, 42 pursues its founding vision: make digital an opportunity for all, everywhere. \n\n> Completely open to the world with partnerships with *Belgium (le 19)*, *Morocco (1337 Khouribga and Ben Guérir)*, *Finland (Hive)*, *Netherlands (Codam)* and *Russia (School 21)*, the pioneer school reached a new milestone today with the launch of *`42 Network`*: first international network in computer excellence, accessible to all, for free. A network which will unite *20 partner campuses* worldwide in 2020, including 13 under the colors of 42.\n\n*11 campuses join 42 Paris and 42 Fremont*\n\n42 Rio\n42 São Paulo\n42 Jakarta\n42 Yerevan\n42 Tokyo\n42 Bogota\n42 Angoulême\n42 Madrid\n42 Québec\nSchool 21 (Novossibirsk)\nSchool 21 (Kazan)\n\n*The Brand of 42*\n\n> The network will bring together the schools already partners as well as the news. A way for the school to spread its innovative pedagogy around the world and spread the "brand 42".\n> "*The idea is to be recognizable in any business*," says Sophie Viger, school principal. "When you recruit a student of 42, you can be sure that he has all the knowledge to be a good developer, no matter where you go." [Google Translation]\n> [start.lesechos.fr]\n\n*Transfer Within the 42 Network*\n\n`!Transfer` for more\n\n> *42 encourages the mobility of its students* which, once they have mastered the fundamentals, can *go to any other campus of the network* while benefiting from the same education environment. This wide-open international strategy can '
}
for i,v in ipairs(messageTable) do print(v .. '\n') end

Revision: 5144 by @dye in #hi 2 months agoSlack Archive

{lua}

local messageTable = {
'*2017/03 The First Internal Announcement*',

'```\nYingli Zhu\nIf I am a cadet in 42us, is any possible I can transfer to 42Paris and get a student visa?\n\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\n\nYingli Zhu\nWow, sounds good. My us visa will end in this year. I am trying to keep working in 42\nDo you know how to transfer to Paris?\n\nDavid Ye\n@yzhu  just send an email to 42US\n\nYingli Zhu\nI ask staff, they do not know about that\n\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\n\nMatt Grimes\nKwame is the one who said it, so contact him directly\n\nDavid Ye\nNot just Kwame, Gaetan also said that.\n\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\n\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```',

'```\nKWAME YAMGNANE\n- Co-Founder and Managing Director (2016-2018)\n\nGAETAN JUVIN\n- Chief Pedagogic Officer\n\nhttps://www.42.us.org/the-university/team/\n```',

'*2018/10/31 The Difference between Switch Before/After the Cadet Start Date*',

"```\nJean-Loup Naddef\nI switched from Paris campus to fremont's one, all it took me was giving some chocolate to Gaetan.\n\nMeo Leung\nIt depends:\na. If your 42 curriculum has already begun (and you are actively enrolled) in 42 SV you do not need to choose a Start date, you only need to give Gtn chocolate & croissants :eyes:\nb. If you just completed your piscine and have not chosen a 42 SV Start date, then you will need to ask to be transferred to the France admissions site to select a Start date. :stuck_out_tongue: (and probs still give Gtn chocolate & croissants)\n\nfrom a thread in #cadets October 31st, 2018\nhttps://42schoolsiliconvalley.slack.com/archives/C2BTT0LD6/p1541039050135700?thread_ts=1540957016.113300&cid=C2BTT0LD6\n```"



}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
	print(messageTable[4] .. '\n')
  print(messageTable[5] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5143 by @dye in #hi 2 months agoSlack Archive

{lua}

local messageTable = {
'*2017/03 The First Internal Announcement*',

'```\nYingli Zhu\nIf I am a cadet in 42us, is any possible I can transfer to 42Paris and get a student visa?\n\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\n\nYingli Zhu\nWow, sounds good. My us visa will end in this year. I am trying to keep working in 42\nDo you know how to transfer to Paris?\n\nDavid Ye\n@yzhu  just send an email to 42US\n\nYingli Zhu\nI ask staff, they do not know about that\n\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\n\nMatt Grimes\nKwame is the one who said it, so contact him directly\n\nDavid Ye\nNot just Kwame, Gaetan also said that.\n\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\n\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```',

'```\nKWAME YAMGNANE\n- Co-Founder and Managing Director (2016-2018)\n\nGAETAN JUVIN\n- Chief Pedagogic Officer\n\nhttps://www.42.us.org/the-university/team/\n```',

'*2018/10/31 The Difference between Switch Before/After the Cadet Start Date*',

"```\nJean-Loup Naddef\nI switched from Paris campus to fremont's one, all it took me was giving some chocolate to Gaetan.\nMeo Leung\nIt depends:\na. If your 42 curriculum has already begun (and you are actively enrolled) in 42 SV you do not need to choose a Start date, you only need to give Gtn chocolate & croissants :eyes:\nb. If you just completed your piscine and have not chosen a 42 SV Start date, then you will need to ask to be transferred to the France admissions site to select a Start date. :stuck_out_tongue: (and probs still give Gtn chocolate & croissants)\nfrom a thread in #cadets October 31st, 2018\nhttps://42schoolsiliconvalley.slack.com/archives/C2BTT0LD6/p1541039050135700?thread_ts=1540957016.113300&cid=C2BTT0LD6\n```"



}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
	print(messageTable[4] .. '\n')
  print(messageTable[5] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5142 by @dye in #hi 2 months agoSlack Archive

{lua}

local messageTable = {
'*2017/03 The First Internal Announcement*',

'```\nYingli Zhu\nIf I am a cadet in 42us, is any possible I can transfer to 42Paris and get a student visa?\n\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\n\nYingli Zhu\nWow, sounds good. My us visa will end in this year. I am trying to keep working in 42\nDo you know how to transfer to Paris?\n\nDavid Ye\n@yzhu  just send an email to 42US\n\nYingli Zhu\nI ask staff, they do not know about that\n\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\n\nMatt Grimes\nKwame is the one who said it, so contact him directly\n\nDavid Ye\nNot just Kwame, Gaetan also said that.\n\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\n\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```',

'```\nKWAME YAMGNANE\n- Co-Founder and Managing Director (2016-2018)\n\nGAETAN JUVIN\n- Chief Pedagogic Officer\n\nhttps://www.42.us.org/the-university/team/\n```',

'*2018/10/31 The Difference between Switch Before/After the Cadet Start Date*',

"```\nJean-Loup Naddef\nI switched from Paris campus to fremont's one, all it took me was giving some chocolate to Gaetan.\n\nMeo Leung\nIt depends:\na. If your 42 curriculum has already begun (and you are actively enrolled) in 42 SV you do not need to choose a Start date, you only need to give Gtn chocolate & croissants :eyes:\nb. If you just completed your piscine and have not chosen a 42 SV Start date, then you will need to ask to be transferred to the France admissions site to select a Start date. :stuck_out_tongue: (and probs still give Gtn chocolate & croissants)\n\nfrom a thread in #cadets October 31st, 2018\nhttps://42schoolsiliconvalley.slack.com/archives/C2BTT0LD6/p1541039050135700?thread_ts=1540957016.113300&cid=C2BTT0LD6\n```"



}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
	print(messageTable[4] .. '\n')
  print(messageTable[5] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5141 by @dye in #hi 2 months agoSlack Archive

{lua}

local messageTable = {
'*2017/03 The First Internal Announcement*',

'```\nYingli Zhu\nIf I am a cadet in 42us, is any possible I can transfer to 42Paris and get a student visa?\n\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\n\nYingli Zhu\nWow, sounds good. My us visa will end in this year. I am trying to keep working in 42\nDo you know how to transfer to Paris?\n\nDavid Ye\n@yzhu  just send an email to 42US\n\nYingli Zhu\nI ask staff, they do not know about that\n\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\n\nMatt Grimes\nKwame is the one who said it, so contact him directly\n\nDavid Ye\nNot just Kwame, Gaetan also said that.\n\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\n\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```',

'```\nKWAME YAMGNANE\n- Co-Founder and Managing Director (2016-2018)\n\nGAETAN JUVIN\n- Chief Pedagogic Officer\n\nhttps://www.42.us.org/the-university/team/\n```',

'*2018/10/31 The Difference between Switch Before/After the Cadet Start Date*',

"```\nJean-Loup Naddef\nI switched from Paris campus to fremont's one, all it took me was giving some chocolate to Gaetan.\nMeo Leung\nIt depends:\na. If your 42 curriculum has already begun (and you are actively enrolled) in 42 SV you do not need to choose a Start date, you only need to give Gtn chocolate & croissants :eyes:\nb. If you just completed your piscine and have not chosen a 42 SV Start date, then you will need to ask to be transferred to the France admissions site to select a Start date. :stuck_out_tongue: (and probs still give Gtn chocolate & croissants)\nfrom a thread in #cadets October 31st, 2018\nhttps://42schoolsiliconvalley.slack.com/archives/C2BTT0LD6/p1541039050135700?thread_ts=1540957016.113300&cid=C2BTT0LD6\n```"



}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
	print(messageTable[4] .. '\n')
  print(messageTable[5] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5140 by @dye in #hi 2 months agoSlack Archive

{lua}

local messageTable = {
'*2017/03 The First Internal Announcement*',

'```\nYingli Zhu\nIf I am a cadet in 42us, is any possible I can transfer to 42Paris and get a student visa?\n\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\n\nYingli Zhu\nWow, sounds good. My us visa will end in this year. I am trying to keep working in 42\nDo you know how to transfer to Paris?\n\nDavid Ye\n@yzhu  just send an email to 42US\n\nYingli Zhu\nI ask staff, they do not know about that\n\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\n\nMatt Grimes\nKwame is the one who said it, so contact him directly\n\nDavid Ye\nNot just Kwame, Gaetan also said that.\n\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\n\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```',

'```\nKWAME YAMGNANE\n- Co-Founder and Managing Director (2016-2018)\n\nGAETAN JUVIN\n- Chief Pedagogic Officer\n\nhttps://www.42.us.org/the-university/team/\n```',

'*2018/10/31 The Difference between Switch Before/After the Cadet Start Date*',

"```\nJean-Loup Naddef\nI switched from Paris campus to fremont's one, all it took me was giving some chocolate to Gaetan.\n\nMeo Leung\nIt depends:\na. If your 42 curriculum has already begun (and you are actively enrolled) in 42 SV you do not need to choose a Start date, you only need to give Gtn chocolate & croissants :eyes:\nb. If you just completed your piscine and have not chosen a 42 SV Start date, then you will need to ask to be transferred to the France admissions site to select a Start date. :stuck_out_tongue: (and probs still give Gtn chocolate & croissants)\n\nfrom a thread in #cadets October 31st, 2018\nhttps://42schoolsiliconvalley.slack.com/archives/C2BTT0LD6/p1541039050135700?thread_ts=1540957016.113300&cid=C2BTT0LD6\n```"



}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
	print(messageTable[4] .. '\n')
  print(messageTable[5] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5139 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*2017/03 The First Internal Announcement*',

'```\nYingli Zhu\nIf I am a cadet in 42us, is any possible I can transfer to 42Paris and get a student visa?\n\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\n\nYingli Zhu\nWow, sounds good. My us visa will end in this year. I am trying to keep working in 42\nDo you know how to transfer to Paris?\n\nDavid Ye\n@yzhu  just send an email to 42US\n\nYingli Zhu\nI ask staff, they do not know about that\n\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\n\nMatt Grimes\nKwame is the one who said it, so contact him directly\n\nDavid Ye\nNot just Kwame, Gaetan also said that.\n\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\n\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```',

'```\nKWAME YAMGNANE\n- Co-Founder and Managing Director (2016-2018)\n\nGAETAN JUVIN\n- Chief Pedagogic Officer\n\nhttps://www.42.us.org/the-university/team/\n```',

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5138 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\nYingli Zhu\nIf I am a cadet in 42us, is any possible I can transfer to 42Paris and get a student visa?\n\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\n\nYingli Zhu\nWow, sounds good. My us visa will end in this year. I am trying to keep working in 42\nDo you know how to transfer to Paris?\n\nDavid Ye\n@yzhu  just send an email to 42US\n\nYingli Zhu\nI ask staff, they do not know about that\n\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\n\nMatt Grimes\nKwame is the one who said it, so contact him directly\n\nDavid Ye\nNot just Kwame, Gaetan also said that.\n\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\n\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```',
'```\nKWAME YAMGNANE\n- Co-Founder and Managing Director (2016-2018)\n\nGAETAN JUVIN\n- Chief Pedagogic Officer\n\nhttps://www.42.us.org/the-university/team/\n```'
}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5137 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'```\nYingli Zhu\nIf I am a cadet in 42us, is any possible I can transfer to 42Paris and get a student visa?\n\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\n\nYingli Zhu\nWow, sounds good. My us visa will end in this year. I am trying to keep working in 42\nDo you know how to transfer to Paris?\n\nDavid Ye\n@yzhu  just send an email to 42US\n\nYingli Zhu\nI ask staff, they do not know about that\n\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\n\nMatt Grimes\nKwame is the one who said it, so contact him directly\n\nDavid Ye\nNot just Kwame, Gaetan also said that.\n\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\n\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```'

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5136 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'```\n\nYingli Zhu\n\nIf I am a cadet in 42us, is any possible I can transfer to 42Paris and get a student visa?\n\nMatt Grimes\n\nAccording to Kwame, you can do that whenever\n\nParis campus does not have dorms, tho\n\nYingli Zhu\n\nWow, sounds good. My us visa will end in this year. I am trying to keep working in 42\n\nDo you know how to transfer to Paris?\n\nDavid Ye\n\n@yzhu  just send an email to 42US\n\nYingli Zhu\n\nI ask staff, they do not know about that\n\nDavid Ye\n\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\n\nMatt Grimes\n\nKwame is the one who said it, so contact him directly\n\nDavid Ye\n\nNot just Kwame, Gaetan also said that.\n\nGaetan JUVIN\n\nSend me an email :slightly_smiling_face:\n\nPosted in #visa March 31st, 2017\n\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n\n```'

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5135 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'```\nYingli Zhu\nIf I am being a cadets in 42us, is any possible I can transfer to 42Paris and get student visa?\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\nYingli Zhu\nWow, sounds good. My us visa will be end in this year. I am trying to keep work in 42\nDo you know how to transfer to Paris?\nDavid Ye\n@yzhu  just send an email to 42US\nYingli Zhu\nI ask staff, they do not know about that\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\nMatt Grimes\nKwame is the one who said it, so contact him directly\nDavid Ye\nNot just Kwame, Gaetan also said that.\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```'

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5134 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'```\nYingli Zhu\nIf I am being a cadets in 42us, is any possible I can transfer to 42Paris and get student visa?\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\nYingli Zhu\nWow, sounds good. My us visa will be end in this year. I am trying to keep work in 42\nDo you know how to transfer to Paris?\nDavid Ye\n@yzhu  just send an email to 42US\nYingli Zhu\nI ask staff, they do not know about that\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\nMatt Grimes\nKwame's the one who said it, so contact him directly\nDavid Ye\nNot just Kwame, Gaetan also said that.\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```'

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5133 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'```\nYingli Zhu\nIf I am being a cadets in 42us, is any possible I can transfer to 42Paris and get student visa?\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\nYingli Zhu\nWow, sounds good. My us visa will be end in this year. I'm trying to keep work in 42\nDo you know how to transfer to Paris?\nDavid Ye\n@yzhu  just send an email to 42US\nYingli Zhu\nI ask staff, they don't know about that\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked do not know about that? Did he/she ask the other staff at that time to confirm?\nMatt Grimes\nKwame's the one who said it, so contact him directly\nDavid Ye\nNot just Kwame, Gaetan also said that.\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```'

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5132 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'```\nYingli Zhu\nIf I am being a cadets in 42us, is any possible I can transfer to 42Paris and get student visa?\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\nYingli Zhu\nWow, sounds good. My us visa will be end in this year. I'm trying to keep work in 42\nDo you know how to transfer to Paris?\nDavid Ye\n@yzhu  just send an email to 42US\nYingli Zhu\nI ask staff, they don't know about that\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked don\\'t know about that? Did he/she ask the other staff at that time to confirm?\nMatt Grimes\nKwame's the one who said it, so contact him directly\nDavid Ye\nNot just Kwame, Gaetan also said that.\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```'

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5131 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'```\nYingli Zhu\nIf I am being a cadets in 42us, is any possible I can transfer to 42Paris and get student visa?\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\nYingli Zhu\nWow, sounds good. My us visa will be end in this year. I'm trying to keep work in 42\nDo you know how to transfer to Paris?\nDavid Ye\n@yzhu  just send an email to 42US\nYingli Zhu\nI ask staff, they don't know about that\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked don\'t know about that? Did he/she ask the other staff at that time to confirm?\nMatt Grimes\nKwame's the one who said it, so contact him directly\nDavid Ye\nNot just Kwame, Gaetan also said that.\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```'

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5130 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'```\nYingli Zhu\nIf I am being a cadets in 42us, is any possible I can transfer to 42Paris and get student visa?\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\nYingli Zhu\nWow, sounds good. My us visa will be end in this year. I'm trying to keep work in 42\nDo you know how to transfer to Paris?\nDavid Ye\n@yzhu  just send an email to 42US\nYingli Zhu\nI ask staff, they don't know about that\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked don't know about that? Did he/she ask the other staff at that time to confirm?\nMatt Grimes\nKwame's the one who said it, so contact him directly\nDavid Ye\nNot just Kwame, Gaetan also said that.\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```'

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5129 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'```\nYingli Zhu\nIf I'm being a cadets in 42us, is any possible I can transfer to 42Paris and get student visa?\nMatt Grimes\nAccording to Kwame, you can do that whenever\nParis campus does not have dorms, tho\nYingli Zhu\nWow, sounds good. My us visa will be end in this year. I'm trying to keep work in 42\nDo you know how to transfer to Paris?\nDavid Ye\n@yzhu  just send an email to 42US\nYingli Zhu\nI ask staff, they don't know about that\nDavid Ye\nIn the last meeting with the staffs, they said send email. Maybe the staff you asked don't know about that? Did he/she ask the other staff at that time to confirm?\nMatt Grimes\nKwame's the one who said it, so contact him directly\nDavid Ye\nNot just Kwame, Gaetan also said that.\nGaetan JUVIN\nSend me an email :slightly_smiling_face:\nPosted in #visa March 31st, 2017\nhttps://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1490938219916313\n```'

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5115 by @dye in #hi 2 months agoSlack Archive

 2

Revision: 5114 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'Third Item'

}

local linkTable = {
'https://brew.sh/'
}


  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[1] .. '>\n')

Revision: 5113 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'Third Item'

}

local linkTable = {
'https://brew.sh/'
}

if (channel.type ~= "im") then
  print(who .. ', this factoid is only available through messaging me directly.\n' )
else
  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[6] .. '>\n')
end

Revision: 5112 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'Third Item',
'

Revision: 5111 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: First Item: icon*',
'```\n Second Item: TextBox```',
'Third Item',
'Forth Item 

Revision: 5110 by @dye in #hi 2 months agoSlack Archive

{lua}
local who = string.format("\60@%s\62", user.id)

local messageTable = {
'*:42bounce: Copy and paste the following to install brew :*',
'```\nmkdir $HOME/.brew && curl -fsSL https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C $HOME/.brew\nmkdir -p /tmp/.$(whoami)-brew-locks\nmkdir -p $HOME/.brew/var/homebrew\nln -s /tmp/.$(whoami)-brew-locks $HOME/.brew/var/homebrew/locks\nexport PATH=\"$HOME/.brew/bin:$PATH\"\nbrew update && brew upgrade```',
'Afterwards make sure you add the following lines to your `.zshrc`.',
'```mkdir -p /tmp/.$(whoami)-brew-locks\nexport PATH=\"$HOME/.brew/bin:$PATH\"```',
'>*Note:*\n>Does this look too complicated?\n>DM \60@U2NNW0FPH\62 with `!brewbeta` for an experimental wrapper script.',
'Click here for more information about brew.'
}

local linkTable = {
'https://brew.sh/'
}

if (channel.type ~= "im") then
  print(who .. ', this factoid is only available through messaging me directly.\n' )
else
  print(messageTable[1] .. '\n')
  print(messageTable[2] .. '\n')
  print(messageTable[3] .. '\n')
  print(messageTable[4] .. '\n')
  print(messageTable[5] .. '\n')
  print('<' .. linkTable[1] .. '|' .. messageTable[6] .. '>\n')
end

Revision: 5109 (deleted) by @dye in #hi 2 months agoSlack Archive

Your Factoid Content

'

Revision: 5108 (deleted) by @dye in #hi 2 months agoSlack Archive

Your Factoid Content

'

Revision: 5107 (deleted) by @dye in #hi 2 months agoSlack Archive

https://42schoolsiliconvalley.slack.com/files/U5KDC6S5N/FJ0RQT8R4/Town_hall_notes_for_April.txt

Revision: 5106 (deleted) by @dye in #hi 2 months agoSlack Archive

https://42schoolsiliconvalley.slack.com/files/U5KDC6S5N/FJ0RQT8R4/Town_hall_notes_for_April.txt

Revision: 5105 (deleted) by @dye in #hi 2 months agoSlack Archive

https://42schoolsiliconvalley.slack.com/archives/C1GSY923Z/p1540024909000100?thread_ts=1539962408.000100&cid=C1GSY923Z

Revision: 5066 (deleted) by @dye in #hi 3 months agoSlack Archive

t1

'

Revision: 5065 (deleted) by @dye in #hi 3 months agoSlack Archive

t1

'

Revision: 3829 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}
local a="hi"function getAllMainContent()local b=[[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]local c={b,"Community Knowledge is in the *PINNED* files.","There are hidden treasure in this channel; Can *YOU* find them?","Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?","I heared I can get help with my visa in this channel, is that true?"}return c end;function getMainContent()local c=getAllMainContent()local d=math.random(1,table.getn(c))if channel.name==a then return c[d]else return c[1]end end;function printMainContent()print(getMainContent())end;function printArray(e)for d=1,#e do print(string.format("\n%d=========\n",d))print(e[d])print(string.format("\n%d=========\n",d))end end;function printAllMainContent()local f=getAllMainContent()printArray(f)end;function getData()local g=[[
[{"title":"Zero-Knowledge-Transmission is the core Pedagogic Philosophy of `42`.","content":"","source":"[42 Africa In Tech Kwame Yamgnane](https://www.youtube.com/watch?v=GRYrywkxe3o)"},{"title":"t2","content":"c2","source":"s2"}]
]]local h=[[
[{"title":"Plain repetition is dull; a bit of randomness brings some fun.","content":"","source":""},{"title":"According to Adam Grant's study, the `worst` performers in an organization are `Givers`.","content":"Guess who are the `best` performers? ","source":"Learn more about [Takers, Matchers, and Givers](https://www.youtube.com/watch?v=YyXRYgjQXX0)"},{"title":"nt3","content":"c3","source":""}]
]]local i=json.load(g)local j=json.load(h)local k=table.getn(i)local l=table.getn(j)local m=k+l;return i,k,j,l,m end;function printDYKArray(e)local n;for d=1,#e do print(string.format("\n%d=========\n",d))n=e[d]print(string.format("\n*%s*\n%s\n%s\n",n.title,n.content,n.source))print(string.format("\n%d=========\n",d))end end;function printAllDYK()local i,k,j,l,m=getData()print(string.format("\n=====FT=====\n"))printDYKArray(i)print(string.format("\n====NFT=====\n"))printDYKArray(j)end;function getRandomItem()local i,k,j,l,m=getData()local d=math.random(1,m)if d<=k then return i[d]else return j[d-k]end end;function getItem()return getRandomItem()end;function printDidYouKnow()local n=getItem()print(string.format("\n*%s*\n%s\n%s\n",n.title,n.content,n.source))end;function main()if args=="reset"then resetHistory()print("History has been reset.\n")return elseif args=="printAllMainContent"then printAllMainContent()return elseif args=="all"then printAllMainContent()printAllDYK()return end;printMainContent()print("\n============\n*Did You Know?*\n============")printDidYouKnow()end;main()

Revision: 3828 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}
local a="hi"function getAllMainContent()local b=[[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]local c={b,"Community Knowledge is in the *PINNED* files.","There are hidden treasure in this channel; Can *YOU* find them?","Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?","I heared I can get help with my visa in this channel, is that true?"}return c end;function getMainContent()local c=getAllMainContent()local d=math.random(1,table.getn(c))if channel.name==a then return c[d]else return c[1]end end;function printMainContent()print(getMainContent())end;function printArray(e)for d=1,#e do print(string.format("\n%d=========\n",d))print(e[d])print(string.format("\n%d=========\n",d))end end;function printAllMainContent()local f=getAllMainContent()printArray(f)end;function getData()local g=[[
[{"title":"Zero-Knowledge-Transmission is the core Pedagogic Philosophy of `42`.","content":"","source":"[42 Africa In Tech Kwame Yamgnane](https://www.youtube.com/watch?v=GRYrywkxe3o)"},{"title":"t2","content":"c2","source":"s2"}]
]]local h=[[
[{"title":"Plain repetition is dull; a bit of randomness brings some fun.","content":"","source":""},{"title":"nt2","content":"According to Adam Grant's study, the *worst* performers in an organization are `Givers`. Guess who are the *best* performers? ","source":"Learn more about [Takers, Matchers, and Givers](https://www.youtube.com/watch?v=YyXRYgjQXX0)"},{"title":"nt3","content":"c3","source":""}]
]]local i=json.load(g)local j=json.load(h)local k=table.getn(i)local l=table.getn(j)local m=k+l;return i,k,j,l,m end;function printDYKArray(e)local n;for d=1,#e do print(string.format("\n%d=========\n",d))n=e[d]print(string.format("\n*%s*\n%s\n%s\n",n.title,n.content,n.source))print(string.format("\n%d=========\n",d))end end;function printAllDYK()local i,k,j,l,m=getData()print(string.format("\n=====FT=====\n"))printDYKArray(i)print(string.format("\n====NFT=====\n"))printDYKArray(j)end;function getRandomItem()local i,k,j,l,m=getData()local d=math.random(1,m)if d<=k then return i[d]else return j[d-k]end end;function getItem()return getRandomItem()end;function printDidYouKnow()local n=getItem()print(string.format("\n*%s*\n%s\n%s\n",n.title,n.content,n.source))end;function main()if args=="reset"then resetHistory()print("History has been reset.\n")return elseif args=="printAllMainContent"then printAllMainContent()return elseif args=="all"then printAllMainContent()printAllDYK()return end;printMainContent()print("\n============\n*Did You Know?*\n============")printDidYouKnow()end;main()

Revision: 3827 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}
local a="hi"function getAllMainContent()local b=[[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]local c={b,"Community Knowledge is in the *PINNED* files.","There are hidden treasure in this channel; Can *YOU* find them?","Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?","I heared I can get help with my visa in this channel, is that true?"}return c end;function getMainContent()local c=getAllMainContent()local d=math.random(1,table.getn(c))if channel.name==a then return c[d]else return c[1]end end;function printMainContent()print(getMainContent())end;function printArray(e)for d=1,#e do print(string.format("\n%d=========\n",d))print(e[d])print(string.format("\n%d=========\n",d))end end;function printAllMainContent()local f=getAllMainContent()printArray(f)end;function getData()local g=[[
[{"title":"Zero-Knowledge-Transmission is the core Pedagogic Philosophy of `42`.","content":"","source":"[42 Africa In Tech Kwame Yamgnane](https://www.youtube.com/watch?v=GRYrywkxe3o)"},{"title":"t2","content":"c2","source":"s2"}]
]]local h=[[
[{"title":"nt1","content":"c1","source":"s1"},{"title":"nt2","content":"c2","source":"s2"},{"title":"nt3","content":"c3","source":""}]
]]local i=json.load(g)local j=json.load(h)local k=table.getn(i)local l=table.getn(j)local m=k+l;return i,k,j,l,m end;function printDYKArray(e)local n;for d=1,#e do print(string.format("\n%d=========\n",d))n=e[d]print(string.format("\n*%s*\n%s\n%s\n",n.title,n.content,n.source))print(string.format("\n%d=========\n",d))end end;function printAllDYK()local i,k,j,l,m=getData()print(string.format("\n=====FT=====\n"))printDYKArray(i)print(string.format("\n====NFT=====\n"))printDYKArray(j)end;function getRandomItem()local i,k,j,l,m=getData()local d=math.random(1,m)if d<=k then return i[d]else return j[d-k]end end;function getItem()return getRandomItem()end;function printDidYouKnow()local n=getItem()print(string.format("\n*%s*\n%s\n%s\n",n.title,n.content,n.source))end;function main()if args=="reset"then resetHistory()print("History has been reset.\n")return elseif args=="printAllMainContent"then printAllMainContent()return elseif args=="all"then printAllMainContent()printAllDYK()return end;printMainContent()print("\n============\n*Did You Know?*\n============")printDidYouKnow()end;main()

Revision: 3826 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local a="hi"function getAllMainContent()local b=[[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]local c={b,"Community Knowledge is in the *PINNED* files.","There are hidden treasure in this channel; Can *YOU* find them?","Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?","I heared I can get help with my visa in this channel, is that true?"}return c end;function getMainContent()local c=getAllMainContent()local d=math.random(1,table.getn(c))if channel.name==a then return c[d]else return c[1]end end;function printMainContent()print(getMainContent())end;function printArray(e)for d=1,#e do print(string.format("\n%d=========\n",d))print(e[d])print(string.format("\n%d=========\n",d))end end;function printAllMainContent()local f=getAllMainContent()printArray(f)end;function getData()local g=[[
[
      {
        "title": "Zero-Knowledge-Transmission is the core Pedagogic Philosophy of `42`",
        "content": "",
        "source": "[42 Africa In Tech Kwame Yamgnane](https://www.youtube.com/watch?v=GRYrywkxe3o)"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      }
]

]]local h=[[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      }
]
]]local i=json.load(g)local j=json.load(h)local k=table.getn(i)local l=table.getn(j)local m=k+l;return i,k,j,l,m end;function printDYKArray(e)local n;for d=1,#e do print(string.format("\n%d=========\n",d))n=e[d]print(string.format("\n*%s*\n%s\n%s\n",n.title,n.content,n.source))print(string.format("\n%d=========\n",d))end end;function printAllDYK()local i,k,j,l,m=getData()print(string.format("\n=====FT=====\n"))printDYKArray(i)print(string.format("\n====NFT=====\n"))printDYKArray(j)end;function getRandomItem()local i,k,j,l,m=getData()local d=math.random(1,m)if d<=k then return i[d]else return j[d-k]end end;function getItem()return getRandomItem()end;function printDidYouKnow()local n=getItem()print(string.format("\n*%s*\n%s\n%s\n",n.title,n.content,n.source))end;function main()if args=="reset"then resetHistory()print("History has been reset.\n")return elseif args=="printAllMainContent"then printAllMainContent()return elseif args=="all"then printAllMainContent()printAllDYK()return end;printMainContent()print("\n============\n*Did You Know?*\n============")printDidYouKnow()end;main()

Revision: 3825 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"
function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()
  local responses = getAllMainContent();
  local i = math.random(1, table.getn(responses))
  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end

function printMainContent()
  print(getMainContent())
end

function printArray(arr)
  for i=1, #arr do
    print(string.format("\n%d=========\n", i))
    print(arr[i])
    print(string.format("\n%d=========\n", i))
  end
end

function printAllMainContent()

  local all = getAllMainContent()
  printArray(all)
end

function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "Zero-Knowledge-Transmission is the core Pedagogic Philosophy of `42`",
        "content": "",
        "source": "[42 Africa In Tech Kwame Yamgnane](https://www.youtube.com/watch?v=GRYrywkxe3o)"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      }
]

]]
  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      }
]
]]
  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end

function printDYKArray(arr)
  local item
  for i=1, #arr do
    print(string.format("\n%d=========\n", i))
    item = arr[i]
    print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
    print(string.format("\n%d=========\n", i))
  end
end

function printAllDYK()
  local ft, n_ft, nft, n_nft, n_total = getData()
  print(string.format("\n=====FT=====\n"))
  printDYKArray(ft)
  print(string.format("\n====NFT=====\n"))
  printDYKArray(nft)
end

function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end
end

function getItem()
  return getRandomItem()
end

function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  elseif (args == "all") then
      printAllMainContent()
      printAllDYK()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3824 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"
function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()
  local responses = getAllMainContent();
  local i = math.random(1, table.getn(responses))
  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end

function printMainContent()
  print(getMainContent())
end

function printArray(arr)
  for i=1, #arr do
    print(string.format("\n%d=========\n", i))
    print(arr[i])
    print(string.format("\n%d=========\n", i))
  end
end

function printAllMainContent()

  local all = getAllMainContent()
  printArray(all)
end

function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "*Zero-Knowledge-Transmission* is the core Pedagogic Philosophy of `42`",
        "content": "",
        "source": "[42 Africa In Tech Kwame Yamgnane](https://www.youtube.com/watch?v=GRYrywkxe3o)"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      }
]

]]
  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      }
]
]]
  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end

function printDYKArray(arr)
  local item
  for i=1, #arr do
    print(string.format("\n%d=========\n", i))
    item = arr[i]
    print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
    print(string.format("\n%d=========\n", i))
  end
end

function printAllDYK()
  local ft, n_ft, nft, n_nft, n_total = getData()
  print(string.format("\n=====FT=====\n"))
  printDYKArray(ft)
  print(string.format("\n====NFT=====\n"))
  printDYKArray(nft)
end

function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end
end

function getItem()
  return getRandomItem()
end

function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  elseif (args == "all") then
      printAllMainContent()
      printAllDYK()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3823 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"
function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()
  local responses = getAllMainContent();
  local i = math.random(1, table.getn(responses))
  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end

function printMainContent()
  print(getMainContent())
end

function printArray(arr)
  for i=1, #arr do
    print(string.format("\n%d=========\n", i))
    print(arr[i])
    print(string.format("\n%d=========\n", i))
  end
end

function printAllMainContent()

  local all = getAllMainContent()
  printArray(all)
end

function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "*Zero-Knowledge-Transmission* is the core Pedagogic Philosophy of `42`",
        "content": "",
        "source": "[42 Africa In Tech Kwame Yamgnane](https://www.youtube.com/watch?v=GRYrywkxe3o)"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      }
]

]]
  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      }
]
]]
  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end

function printDYKArray(arr)
  local item
  for i=1, #arr do
    print(string.format("\n%d=========\n", i))
    item = arr[i]
    print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
    print(string.format("\n%d=========\n", i))
  end
end

function printAllDYK()
  local ft, n_ft, nft, n_nft, n_total = getData()
  print(string.format("\n=====FT=====\n"))
  printArray(ft)
  print(string.format("\n====NFT=====\n"))
  printArray(nft)
end

function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end
end

function getItem()
  return getRandomItem()
end

function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  elseif (args == "all") then
      printAllMainContent()
      printAllDYK()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3822 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end

function printArray(arr)
  for i=1, #arr do
    print(string.format("\n%d=========\n", i))
    print(arr[i])
    print(string.format("\n%d=========\n", i))
  end
end

function printAllMainContent()

  local all = getAllMainContent()
  printArray(all)
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "*Zero-Knowledge-Transmission* is the core Pedagogic Philosophy of `42`",
        "content": "",
        "source": "[42 Africa In Tech Kwame Yamgnane](https://www.youtube.com/watch?v=GRYrywkxe3o)"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      }
]
]]
  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end

function printAllDYK()
  local ft, n_ft, nft, n_nft, n_total = getData()
  print(string.format("\n=====FT=====\n"))
  printArray(ft)
  print(string.format("\n====NFT=====\n"))
  printArray(nft)
end

function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end
end

function getItem()
  return getRandomItem()
end

function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  elseif (args == "all") then
      printAllMainContent()
      printAllDYK()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3821 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(string.format("\n%d=========\n", i))
    print(all[i])
    print(string.format("\n%d=========\n", i))
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3820 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(string.format("\n%d---------\n", i))
    print(all[i])
    print(string.format("\n%d---------\n", i))
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3819 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(string.format("\n---------%d\n", i))
    print(all[i])
    print(string.format("\n---------%d\n", i))
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3818 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(string.format("\n---------%d\n", i))
    print(all[i])
    print('\n---------\n')
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3817 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(string.format("\n---------%d\n', i))
    print(all[i])
    print('\n---------\n')
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3816 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(all[i])
    print('\n---------\n')
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3815 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(all[i])
    print('---------\n')
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3814 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(all[i])
    print('\n')
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") then
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3813 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(all[i])
    print('\n')
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") 
  then 
      resetHistory() 
      print("History has been reset.\n")
      return
  elseif (args == "printAllMainContent") 
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3812 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(all[i])
    print('\n')
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") 
  then 
      resetHistory() 
      print("History has been reset.\n")
      return
  else if (args == "printAllMainContent") 
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3811 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(all[i])
    print('\n')
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") 
    then 
      resetHistory() 
      print("History has been reset.\n")
      return
  else if (args == "printAllMainContent") 
    then
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3810 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(all[i])
    print('\n')
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
    else if (args == "printAllMainContent") then
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3809 by @dye in #hi 11 months agoSlack Archive

{lua}

local channelName = "hi"

function getAllMainContent()

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is that true?"
  }

  return responses
end

function getMainContent()

  

  local responses = getAllMainContent();

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(responses[1])
  end
end



function printMainContent()
  print(getMainContent())
end


function printAllMainContent()

  local all = getAllMainContent()
  for i=1, #all do
    print(all[i])
    print('\n')
  end
end


function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
      resetHistory() 
      print("History has been reset.\n")
      return
    else if (args == "printAllMainContent")
      printAllMainContent()
      return
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3808 by @dye in #hi 11 months agoSlack Archive

{lua}

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    full,
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure in this channel by themselves.\nAre you `born2treasure-hunt`?",
    "I heared I can get help with my visa in this channel, is it true?"
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end
end

function printMainContent()
  print(getMainContent())
end

function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
    resetHistory() 
    print("History has been reset.\n")
    return 
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3807 by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge is in the *PINNED* files.",
    "There are hidden treasure in this channel; Can *YOU* find them?",
    "Only `0.42%` of the channel visitors discovered the hidden treasure by themselves.\nAre you `born2treasure-hunt`?",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end
end

function printMainContent()
  print(getMainContent())
end

function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
    resetHistory() 
    print("History has been reset.\n")
    return 
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3806 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end
end

function printMainContent()
  print(getMainContent())
end

function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
    resetHistory() 
    print("History has been reset.\n")
    return 
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3805 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local d = fdata
function resetHistory()
  d.history = nil
end

function initHistory(n_total)
  local h = {}
  for i=1, n_total do
    h[i] = false
  end
  d.history = h
  return h
end

function printHistory()
  local h = d.history
  local l = table.getn(h)
  print(l)
  for i=1, l do
    print(h[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end
end

function printMainContent()
  print(getMainContent())
end

function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
    resetHistory() 
    print("History has been reset.\n")
    return 
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3804 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local d = fdata
function resetHistory()
  d.history = nil
end

function initHistory(n_total)
  local h = {}
  for i=1, n_total do
    h[i] = false
  end
  d.history = h
  return h
end

function printHistory()
  local h = d.history
  local l = table.getn(h)
  print(l)
  for i=1, l do
    print(h[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end
end

function printMainContent()
  print(getMainContent())
end

function getData()
  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)
  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  return ft, n_ft, nft, n_nft, n_total
end


function getRandomItem()

  local ft, n_ft, nft, n_nft, n_total = getData()

  local i = math.random(1, n_total)
  if (i <= n_ft) then return ft[i] else return nft[i - n_ft] end

end


function getItem()
  return getRandomItem()
end


function printDidYouKnow()
  local item = getItem()
  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))
end

function main()
  if (args == "reset") then 
    resetHistory() 
    print("History has been reset.\n")
    return 
  end
  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()
printHistory(n_total)

Revision: 3803 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local a=fdata;function resetHistory()a.history=nil end;function initHistory(n_total)local b={}for c=1,n_total do b[c]=false end;a.history=b;return b end;function printHistory()local b=a.history;local d=table.getn(b)print(d)for c=1,d do print(b[c])print("\n")end end;function getMainContent()local e="hi"local f=[[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]local g={"Community Knowledge ","s2","s3","s4","s5",f}local c=math.random(1,table.getn(g))if channel.name==e then return g[c]else return f end end;function printMainContent()print(getMainContent())end;function getData()local h=[[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]local i=[[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]local j=json.load(h)local k=json.load(i)local l=table.getn(j)local m=table.getn(k)local n_total=l+m;return j,l,k,m,n_total end;function getNonReapeatItem()local j,l,k,m,n_total=getData()local b=a.history;if b==nil then b=initHistory(n_total)end;local n,c=math.random(1,n_total)print(string.format("\nfirst i = %d\n",c))if b[c]==true then n=c+1;if n>n_total then n=1 end;while n~=c and b[n]==true do n=n+1;if n>n_total then n=1 end end;if n==c then b=initHistory(n_total)end;c=n end;b[c]=true;print(string.format("actual i = %d\n",c))a.history=b;if c<=l then return j[c]else return k[c-l]end end;function getItem()return getNonReapeatItem()end;function printDidYouKnow()local o=getItem()print(string.format("\n*%s*\n%s\n%s\n",o.title,o.content,o.source))end;function main()if args=="reset"then resetHistory()print("History has been reset.\n")return end;printMainContent()print("\n============\n*Did You Know?*\n============")printDidYouKnow()end;main()printHistory(n_total)

Revision: 3795 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.h = nil
end

function initData()
  d.h = true
end

function changeData()
  local h = d.h

  print("before changing:\n\t")
  print(h)

  if (h == true) then h = false
  else h = true end

  d.h = h
end



if (args == "reset") then reset() end

if d.h == nil then initData() end

changeData()

Revision: 3794 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.h = nil
end

function initData()
  d.h = true
end

function changeData()
  local h = d.h

  print("before changing:\n\t")
  print(h)

  h = !h

  d. = h
end



if (args == "reset") then reset() end

if d.h == nil then initData() end

changeData()

Revision: 3789 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local history = fdata.history

function resetHistory()
  history = nil
end


function initHistory(n_total)
  history = {}
  for i=1, n_total do
    history[i] = false
  end
end

function printHistory()
  local l = table.getn(history)
  print(l)
  for i=1, l do
    print(history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)
  local q = i + 1
  print(string.format("\nfirst i = %d\n", i))


  if (history[i] == true) 
  then

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and history[q] == true) do
        q = q + 1
      end

      if (q == i) then initHistory(n_total) end

      i = q
      
  end

  history[i] = true
  print(string.format("actual i = %d\n", i))



  -- Really Important!!!
  fdata.history = history


  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3788 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local history = fdata.history

function resetHistory()
  history = nil
end


function initHistory(n_total)
  history = {}
  for i=1, n_total do
    history[i] = false
  end
end

function printHistory()
  --local l = table.getn(history)
  local l = #history
  print(l)
  for i=1, l do
    print(history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)
  local q = i + 1
  print(string.format("\nfirst i = %d\n", i))


  if (history[i] == true) 
  then

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and history[q] == true) do
        q = q + 1
      end

      if (q == i) then initHistory(n_total) end

      i = q
      
  end

  history[i] = true
  print(string.format("actual i = %d\n", i))



  -- Really Important!!!
  fdata.history = history


  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3787 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local history = fdata.history

function resetHistory()
  history = nil
end


function initHistory(n_total)
  history = {}
  for i=1, n_total do
    history[i] = false
  end
end

function printHistory()
  local l = table.getn(history)
  print(l)
  for i=1, l do
    print(history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)
  local q = i + 1
  print(string.format("\nfirst i = %d\n", i))


  if (history[i] == true) 
  then

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and history[q] == true) do
        q = q + 1
      end

      if (q == i) then initHistory(n_total) end

      i = q
      
  end

  history[i] = true
  print(string.format("actual i = %d\n", i))



  -- Really Important!!!
  fdata.history = history


  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3786 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local history = fdata.history

function resetHistory()
  history = nil
end


function initHistory(n_total)
  history = {}
  for i=1, n_total do
    history[i] = false
  end
end

function printHistory()
  local l = table.getn(history)
  print(l)
  for i=1, l do
    print(history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)
  local q = i + 1
  print(string.format("first i = %d\n", i))


  if (history[i] == true) 
  then

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and history[q] == true) do
        q = q + 1
      end

      if (q == i) then initHistory(n_total) end

      i = q
      
  end

  history[i] = true
  print(string.format("actual i = %d\n", i))



  -- Really Important!!!
  fdata.history = history


  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3785 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local history = fdata.history

function resetHistory()
  history = nil
end


function initHistory(n_total)
  history = {}
  for i=1, n_total do
    history[i] = false
  end
end

function printHistory()
  local l = table.getn(history)
  print(l)
  for i=1, l do
    print(history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)
  local q = i + 1
  print(string.format("first i = %d\n", i))


  if (history[i] == true) 
  then

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and history[q] == true) do
        q = q + 1
      end

      if (q == i) then initHistory(n_total) end

      i = q
      
  end

  history[i] = true
  fdata.history = history


  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3784 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  for i=1, n_total do
    d.history[i] = false
  end
end

function printHistory()
  local l = table.getn(d.history)
  print(l)
  for i=1, l do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)
  local q = i + 1
  print(string.format("first i = %d\n", i))


  if (d.history[i] == true) 
  then

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q] == true) do
        q = q + 1
      end

      if (q == i) then initHistory(n_total) end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3783 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false
end

function printHistory()
  local l = table.getn(d.history)
  print(l)
  for z=1, l do
    print(d.history[z])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)
  local q = i + 1
  print(string.format("first i = %d\n", i))


  if (d.history[i] == true) 
  then

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q] == true) do
        q = q + 1
      end

      if (q == i) then initHistory(n_total) end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3782 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false
end

function printHistory()
  local l = table.getn(d.history)
  print(l)
  for z=1, l do
    print(d.history[z])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)
  local q = i + 1
  print("first i = %d\n", i)


  if (d.history[i] == true) 
  then

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q] == true) do
        q = q + 1
      end

      if (q == i) then initHistory(n_total) end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3781 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false
end

function printHistory()
  local l = table.getn(d.history)
  print(l)
  for z=1, l do
    print(d.history[z])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory(n_total) end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3780 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false
end

function printHistory()
  local l = table.getn(d.history)
  print(l)
  for z=1, l do
    print(d.history[z])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3779 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false


  print("\n")
  print(table.getn(d.history))
  print("\n")
  print(n_total)
end

function printHistory()
  local l = table.getn(d.history)
  print(l)
  for z=1, l do
    print(d.history[z])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3778 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false


  print("\n")
  print(table.getn(d.history))
  print("\n")
  print(n_total)
end

function printHistory()
  local l = #d.history
  print(l)
  for z=1, l do
    print(d.history[z])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3777 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false


  print("\n")
  print(table.getn(d.history))
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

printHistory()


Revision: 3776 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false


  print("\n")
  print(table.getn(d.history))
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3775 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false


  print("\n")
  print(table.getn(d.history))
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  print(n_total)
  print("\n")

  if (d.history == nil) then initHistory(n_total) end
  printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3774 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false


  print("\n")
  print(table.getn(d.history))
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3773 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false


  print("\n")
  print(table.getn(d.history))
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  --printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3772 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false


  print("\n")
  --print(table.getn(d.history)
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  --printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3771 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[1] = false

  d.history[n_total] = false


  print("\n")
  print(table.getn(d.history)
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  --printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3770 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[n_total] = false


  print("\n")
  print(table.getn(d.history)
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  --printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3769 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[n_total] = false

  local l = #d.history
  --print(l)
  print("\n")
  print(table.getn(d.history)
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  --printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3768 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[n_total] = false

  local l = #d.history
  print(l)
  print("\n")
  print(table.getn(d.history)
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  --printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3767 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[d.history] = false

  local l = #d.history
  print(l)
  print("\n")
  print(table.getn(d.history)
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  --printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3766 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[d.history] = false
  print(#d.history)
  print("\n")
  print(table.getn(d.history)
  print("\n")
  print(n_total)
end

function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  --printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3765 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory(n_total)
  d.history = {}
  d.history[d.history] = false
end

function printHistory()
  print(#d.history)
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft

  if (d.history == nil) then initHistory(n_total) end
  printHistory()
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end





function main()

  if (args == "reset") then resetHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3764 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory()
  d.history = {}
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "nt1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "nt2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "nt3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "nt4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "nt5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "nt6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end


function main()

  if (args == "reset") then resetHistory() end

  if (d.history == nil) then initHistory() end
  printHistory()

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3763 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory()
  d.history = {}
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end


function main()

  if (args == "reset") then resetHistory() end

  if (d.history == nil) then initHistory() end
  printHistory()

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3762 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory()
  d.history = {}
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


function printHistory()
  for i=1, #d.history do
    print(d.history[i])
    print("\n")
  end 
end


function main()

  if (d.history == nil) then initHistory() end
  printHistory()

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3761 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory()
  d.history = {}
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end



function main()

  if (d.history == nil) then initHistory() end
  print(d.history)

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3760 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory()
  d.history = {}
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) 
  then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      i = q
      
  end

  d.history[i] = true

  if (i <= n_ft) 
  then 
    return ft[i]
  else
    return nft[i - n_ft]
  end
end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end



function main()

  if (d.history == nil) then initHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3759 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory()
  d.history = {}
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      d.history[q] = true

      if (q <= n_ft) then return ft[q] end

      return nft[q - n_ft]

  end



end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end



function main()

  if (d.history == nil) then initHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

main()

Revision: 3758 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory()
  d.history = {}
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      d.history[q] = true

      if (q <= n_ft) then return ft[q] end

      return nft[q - n_ft]

  end



end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end



function main()

  if (d.history == nil) then initHistory() end

  printMainContent()
  print("\n============\n*Did You Know?*\n============")
  printDidYouKnow()
end

Revision: 3757 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory()
  d.history = {}
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q ~= i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      d.history[q] = true

      if (q <= n_ft) then return ft[q] end

      return nft[q - n_ft]

  end



end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printMainContent()
print("\n============\n*Did You Know?*\n============")
printDidYouKnow()

Revision: 3756 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function resetHistory()
  d.history = nil
end


function initHistory()
  d.history = {}
end

function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "Community Knowledge ",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end




function getNonReapeatItem()

  -- 42-related items
  local json_ft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- non-42-related items
  local json_nft = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  -- parse json data to Lua object
  local ft = json.load(json_ft)
  local nft = json.load(json_nft)



  local n_ft = table.getn(ft)
  local n_nft = table.getn(nft)
  local n_total = n_ft + n_nft
  
  -- pick a non-repeated random item

  local i = math.random(1, n_total)


  if (d.history[i] == true) then
      local q = i + 1

      -- reach limit, start from 1
      if (q > n_total) then q = 1 end

      while (q != i and d.history[q]) do
        q = q + 1
      end

      if (q == i) then initHistory() end

      d.history[q] = true

      if (q <= n_ft) then return ft[q] end

      return nft[q - n_ft]

  end



end


function getItem()
  return getNonReapeatItem()
end


function printDidYouKnow()
  
  local item = getItem()

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printMainContent()
print("\n============\n*Did You Know?*\n============")
printDidYouKnow()

Revision: 3755 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local s = {}
s[1] = true
s[2] = true
s[5] = true



function changeS(i)

if (s[i] == nil) then s[i] = true end

end


function pS()
  for i=1, #s do
    print(s[i])
    print("\n")
  end 
end




function changeAllS()
  for i=1, #s do
    changeS(i)
  end 
end


pS()
changeAllS()
print("\n")
pS()
changeAllS()
print("\n")

Revision: 3754 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local s = {}
s[1] = true
s[2] = true
s[5] = true



function changeS(i)

if (s[i] == true) then s[i] = false end

end


function pS()
  for i=1, #s do
    print(s[i])
    print("\n")
  end 
end




function changeAllS()
  for i=1, #s do
    changeS(i)
  end 
end


pS()
changeAllS()
print("\n")
pS()
changeAllS()
print("\n")

Revision: 3753 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local s = {}
s[1] = true
s[2] = true
s[5] = true



function changeS(i)

if (s[i] == true) then s[i] = false end

end


function pS()
  for i=1, #s do
    print(s[i])
    print("\n")
  end 
end




function changeAllS()
  for i=1, #s do
    changeS(i)
  end 
end


pS()
changeAllS()
print("\n")
pS()

Revision: 3752 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local s = {}
s[1] = true
s[2] = true
s[5] = true



function changeS(i)

if (s[i] == true) then s[i] = false end

end


function pS()
  for i=1, #s do
    print(s[i])
    print("\n")
  end 
end




function changeAllS()
  for i=1, #s do
    changeS(i)
  end 
end


pS()
changeAllS()
pS()

Revision: 3751 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local s = {}
s[1] = true
s[2] = true


function changeS(i)

if (s[i] == true) then s[i] = false end

end


function pS()
  for i=1, #s do
    print(s[i])
    print("\n")
  end 
end




function changeAllS()
  for i=1, #s do
    changeS(i)
  end 
end


pS()
changeAllS()
pS()

Revision: 3750 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local s = {}
s[1] = true
s[2] = true


function changeS(i)

if (s[i] == true) then s[i] = false end

end


function pS()
  for i=1, #s do
    print(s[i])
  end 
end




function changeAllS()
  for i=1, #s do
    changeS(i)
  end 
end


pS()
changeAllS()
pS()

Revision: 3749 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local s = {}
s[1] = true
s[2] = true


function changeS(i)

if (s[i] == true) then s[i] = false end

end


function pS()
  for i=1, #s do
    print(s[i]..'\n')
  end 
end




function changeAllS()
  for i=1, #s do
    changeS(i)
  end 
end


pS()
changeAllS()
pS()

Revision: 3748 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local s = {}
s[1] = true
s[2] = true


function changeS(i)

if (s[i] == true) then s[i] = false end

end


function pS()
  for i=1, #s do
    print(s[i])
  end 
end




function changeAllS()
  for i=1, #s do
    changeS(i)
  end 
end


pS()
changeAllS()
pS()

Revision: 3747 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

local s = {}
s[1] = true
s[2] = true


function changeS(i)

if (s[i] == true) then s[i] = false end

end


function pS()
  for i, #s do
    print(s[i])
  end 
end




function changeAllS()
  for i, #s do
    changeS(i)
  end 
end


pS()
changeAllS()
pS()

Revision: 3746 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function initData()
  d.history = {11, 12, 13}
end

function changeData()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1 + h[1]

  d.history = h
end



if (args == "reset") then reset() end

if d.history == nil then initData() end

changeData()

Revision: 3745 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function initData()
  d.history = {11, 12, 13}
end

function changeData()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1 + h[1]

  d.history = h
end


-- uncomment the next line to reset
--reset()

if d.history == nil then initData() end

changeData()

Revision: 3744 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function initData()
  d.history = {11, 12, 13}
end

function changeData()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1 + h[1]

  d.history = h
end


-- uncomment the next line to reset
reset()

if d.history == nil then initData() end

changeData()

Revision: 3743 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function initData()
  d.history = {11, 12, 13}
end

function changeData()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] += 1

  d.history = h
end


-- uncomment the next line to reset
reset()

if d.history == nil then initData() end
changeData()

Revision: 3742 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function reload()
  local h = {11, 12, 13}

  d.history = h
end

function pull()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1

  d.history = h
end


--reset()
if d.history == nil then reload() end
pull()

Revision: 3741 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function reload()
  local h = {11, 12, 13}

  d.history = h
end

function pull()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1

  d.history = h
end


reset()
if d.history == nil then reload() end
pull()

Revision: 3740 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function reload()
  local h = {11, 12, 13}

  d.history = h
end

function pull()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1

  d.history = h
end


--reset()
if d.history == nil then reload() end
pull()

Revision: 3739 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function reload()
  local h = {11, 12, 13}

  d.history = h
end

function pull()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1

  d.history = h
end


//reset()
if d.history == nil then reload() end
pull()

Revision: 3738 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function reload()
  local h = {11, 12, 13}

  d.history = h
end

function pull()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1

  d.history = h
end


if d.history == nil then reload() end
pull()

Revision: 3737 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function reload()
  local h = {11, 12, 13}

  d.history = h
end

function pull()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1

  d.history = ch
end


if d.history == nil then reload() end
pull()

Revision: 3736 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function reload()
  local h = {11, 12, 13}

  d.history = h
end

function pull()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1

  d.history = ch
end



reset()
if d.history == nil then reload() end
pull()

Revision: 3735 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function reload()
  d.history = [12, 21, 56]
end

function pull()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1

  d.history = ch
end

if d.history == nil then reload() end


reset()
pull()

Revision: 3734 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reset()
  d.history = nil
end

function reload()
  d.history = {12, 21, 56}
end

function pull()
  local h = d.history

  print("before changing:\n\t")
  print(h[1])

  h[1] = 1

  d.history = ch
end

if d.history == nil then reload() end


reset()
pull()

Revision: 3733 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


local d = fdata

function reload()
  d.history = {12, 21, 56}
end

function pull()
  local h = d.history

  print("before changing:\n\t")
  print(h)

  h[1] = 1

  d.history = ch
end

if d.history == nil then reload() end

pull()

Revision: 3732 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end


function getData()


  local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  return json.load(js)

end


function printDidYouKnow()
  
  local data = getData()
  local i = math.random(1, table.getn(data))
  local item = data[i]

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printMainContent()
print("\n============\n*Did You Know?*\n============")
printDidYouKnow()

Revision: 3731 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end


function getData()


  local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  return json.load(js)

end


function printDidYouKnow()
  
  local data = getData()
  local i = math.random(1, table.getn(data))
  local item = data[i]

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printMainContent()
print("\n==============\n*Did You Know ......*\n==============")
printDidYouKnow()

Revision: 3730 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end


function getData()


  local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  return json.load(js)

end


function printDidYouKnow()
  
  local data = getData()
  local i = math.random(1, table.getn(data))
  local item = data[i]

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printMainContent()
print("\n=============\n*Did You Know ...*\n=============")
printDidYouKnow()

Revision: 3729 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end


function getData()


  local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  return json.load(js)

end


function printDidYouKnow()
  
  local data = getData()
  local i = math.random(1, table.getn(data))
  local item = data[i]

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printMainContent()
print("\n==============\n*Did You Know ...*\n==============")
printDidYouKnow()

Revision: 3728 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end


function getData()


  local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  return json.load(js)

end


function printDidYouKnow()
  
  local data = getData()
  local i = math.random(1, table.getn(data))
  local item = data[i]

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printMainContent()
print("\n==============\n*Did You Know ...\n==============")
printDidYouKnow()

Revision: 3727 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end


function getData()


  local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

  return json.load(js)

end


function printDidYouKnow()
  
  local data = getData()
  local i = math.random(1, table.getn(data))
  local item = data[i]

  print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printMainContent()
print("\n===========\n*Did You Know ...\n===========")
printDidYouKnow()

Revision: 3726 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function getMainContent()

  local channelName = "hi"

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  local responses = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local i = math.random(1, table.getn(responses))

  if (channel.name == channelName)
  then
    return(responses[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end

printMainContent()

Revision: 3725 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function getMainContent()

  local channelName = "hi"



  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]


  local arr = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  print(table.getn(arr)..'\n')
  local i = math.random(1, table.getn(arr))

  if (channel.name == channelName)
  then
    return(arr[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end

printMainContent()

Revision: 3724 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function getMainContent()

  local channelName = "hi"

  local arr = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5",
    full
  }

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  print(table.getn(arr)..'\n')
  local i = math.random(1, table.getn(arr))

  if (channel.name == channelName)
  then
    return(arr[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end

printMainContent()

Revision: 3723 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}


function getMainContent()

  local channelName = "hi"

  local arr = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5"
  }

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  print(table.getn(arr)..'\n')
  local i = math.random(1, table.getn(arr))

  if (channel.name == channelName)
  then
    return(arr[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end

printMainContent()

Revision: 3722 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function getMainContent()

  local arr = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5"
  }

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  print(table.getn(arr)..'\n')
  local i = math.random(1, table.getn(arr))

  if (channel.name == "hi")
  then
    return(arr[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end

printMainContent()

Revision: 3721 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

printMainContent()

function getMainContent()

  local arr = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5"
  }

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  print(table.getn(arr)..'\n')
  local i = math.random(1, table.getn(arr))

  if (channel.name == "hi")
  then
    return(arr[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end

Revision: 3720 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}



function getMainContent()

  local arr = {
    "s1",
    "s2",
    "s3",
    "s4",
    "s5"
  }

  local full = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

  print(table.getn(arr)..'\n')
  local i = math.random(1, table.getn(arr))

  if (channel.name == "hi")
  then
    return(arr[i])
  else
    return(full)
  end

end

function printMainContent()

  print(getMainContent())

end

Revision: 3719 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}
print(channel.name..'\n')

	local arr = {
		"1",
		"2",
		"more",
		"M",
		"m"
	}

	print(table.getn(arr)..'\n')
	local i = math.random(1, table.getn(arr))

if (channel.name == "hi")
then
	print(arr[i])
else
	print("Standard")
end

Revision: 3718 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}
print(channel.name..\n)

	local arr = {
		"1",
		"2",
		"more",
		"M",
		"m"
	}

	print(table.getn(arr))
	local i = math.random(1, table.getn(arr))

if (channel.name == "hi")
then
	print(arr[i])
else
	print("Standard")
end

Revision: 3717 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}
print(channel.name)

	local arr = {
		"1",
		"2",
		"more",
		"M",
		"m"
	}

	print(table.getn(arr))
	local i = math.random(1, table.getn(arr))

if (channel.name == "hi")
then
	print(arr[i])
else
	print("Standard")
end

Revision: 3716 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}
print(channel.name)

Revision: 3715 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}
print(channel.Name)

Revision: 3714 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "Please read the *PINNED* items in \n- <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and \n- <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications \n\nYou need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3713 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "Please read the *PINNED* items in \n- <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3712 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "Please read the *PINNED* items in - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3711 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3710 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "[[Please read the *PINNED* items in 
- <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
- <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS You need to `Reset Cache` App, but old messages beyond 10k will be lost.]]",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3709 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "[[Please read the *PINNED* items in 
- <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
- <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.]]",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3708 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "[[Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications
You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.]]",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3707 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "[[Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.]]",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3706 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "\\nPlease read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3705 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "\nPlease read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3704 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()


	local s1 = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]


	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": s1,
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3703 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3702 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": '
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.
		',
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3701 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": '
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications
You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.
		',
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3700 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": '[[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications\n
You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.
        ]]',
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3699 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": '[[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.
        ]]',
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3698 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "[[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.
        ]]",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3697 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n*%s*\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3696 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)

	print(table.getn(parsed))
	
	local i = math.random(1, table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n%s\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3695 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)

	print(table.getn(parsed))
	
	local i = math.random(table.getn(parsed) + 1)
	local item = parsed[i]

	print(string.format("\n%s\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3694 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      },
      {
        "title": "t4",
        "content": "c4",
        "source": "s4"
      },
      {
        "title": "t5",
        "content": "c5",
        "source": "s5"
      },
      {
        "title": "t6",
        "content": "c6",
        "source": ""
      }
]

]]

	return json.load(js)

end


function printDidYouKnow(parsed)

	print(table.getn(parsed))
	
	local i = math.random(table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n%s\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3693 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	return json.load(js)

end

function printDidYouKnow(parsed)

	print(table.getn(parsed))
	
	local i = math.random(table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n%s\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3692 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	return json.load(js)

end

function printDidYouKnow(parsed)

	print(table.getn(parsed))
	math.randomseed( os.time() )
	local i = math.random(table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n%s\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3691 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	return json.load(js)

end

function printDidYouKnow(parsed)

	print(table.getn(parsed))
	local i = math.random(table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n%s\n%s\n%s\n", item.title, item.content, item.source))
	
	item = parsed[3]

	print(string.format("\n%s\n%s\n%s\n", item.title, item.content, item.source))

end


printDidYouKnow(getData())

Revision: 3690 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	return json.load(js)

end

function printDidYouKnow(parsed)

	print(table.getn(parsed))
	local i = math.random(table.getn(parsed))
	local item = parsed[i]

	print(string.format("\n%s\n%s\n%s\n", item.title, item.content, item.source))
end

printDidYouKnow(getData())

Revision: 3689 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	return json.load(js)

end

function printDidYouKnow(parsed)

	print(table.getn(parsed))
	local i = math.random(table.getn(parsed))
	local item = parsed[i]

	print(string.format("%s\n%s\n%s\n", item.title, item.content, item.source))
end

printDidYouKnow(getData())

Revision: 3688 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	return json.load(js)

end

function printDidYouKnow(parsed)

	
	print(parsed[1].title)
	print('\n')
	
	print(parsed[2].title)
	print('\n')

	print(parsed[3].content)
	print('\n')
end

printDidYouKnow(getData())

Revision: 3687 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	return json.load(js)

end

function p(parsed)

	
	print(parsed[1].title)
	print('\n')
	
	print(parsed[2].title)
	print('\n')

	print(parsed[3].content)
	print('\n')
end

p(getData())
p(getData())

Revision: 3686 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	return parsed = json.load(js)

end

function p(parsed)

	
	print(parsed[1].title)
	print('\n')
	
	print(parsed[2].title)
	print('\n')

	print(parsed[3].content)
	print('\n')
end

p(getData())
p(getData())

Revision: 3685 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function getData()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	return parsed = json.load(js)

end

function p(parsed)

	
	print(parsed[1].title)
	print('\n')
	
	print(parsed[2].title)
	print('\n')

	print(parsed[3].content)
	print('\n')
end

p()
p()

Revision: 3684 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

function p()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	local parsed = json.load(js)
	
	print(parsed[1].title)
	print('\n')
	
	print(parsed[2].title)
	print('\n')

	print(parsed[3].content)
	print('\n')
end

p()
p()

Revision: 3683 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function pMainContent()

	local s = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

   print(s);
end



function p()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	local parsed = json.load(js)
	print(parsed[1])
	print(parsed[2])
	print(parsed[3])

end



pMainContent()
p()

Revision: 3682 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function pMainContent()

	local s = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

   print(s);
end



function p()

	local js = [[
[
      {
        "title": "t1",
        "content": "c1",
        "source": "s1"
      },
      {
        "title": "t2",
        "content": "c2",
        "source": "s2"
      },
      {
        "title": "t3",
        "content": "c3",
        "source": ""
      }
]

]]

	local parsed = json.load(js)
	print(parsed)

end



pMainContent()
p()

Revision: 3681 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function pMainContent()

	local s = [[
Please read the *PINNED* items in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

   print(s);
end


pMainContent()
pMainContent()

Revision: 3680 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function pMainContent()

	local s = [[
Please read the *PINNED items* in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost.

]]

   print(s);
end


pMainContent()
pMainContent()

Revision: 3679 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function pMainContent()

	local s = "Please read the *PINNED items* in 
  - <#C1GSY923Z|visa> for the *Summary of Rough Cases* at the border and 
  - <#C9LDCS2UQ|bifrost> for the *Student Visa* approach with California College of Communications

You need to `Reset Cache` (Settings -> Advanced) in order to load the updated pinned `md` files in the iOS App, but old messages beyond 10k will be lost."

   print(s);
   print('\n')
end


pMainContent()
pMainContent()

Revision: 3678 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


function max(num1, num2)

   if (num1 > num2) then
      result = num1;
   else
      result = num2;
   end

   return result; 
end


print("The maximum of the two numbers is ",max(10,4))
print("The maximum of the two numbers is ",max(5,6))

Revision: 3677 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


print(user)
print("\n")

print(channel)
print("\n")

ptable(slack)
print("\n")

Revision: 3676 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


print(user)
print("\n")

ptable(channel)
print("\n")

ptable(slack)
print("\n")

Revision: 3675 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


ptable(user)
print("\n")

ptable(channel)
print("\n")

ptable(slack)
print("\n")

Revision: 3674 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


ptable(user)
print("\n")

print(channel)
print("\n")

print(slack)
print("\n")

Revision: 3673 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


ptable(argv)
print("\n")

print(args)
print("\n")

Revision: 3672 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}


ptable(argv)
print("\n")

ptable(args)
print("\n")

Revision: 3671 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}




ptable(argv)
print("\n")

Revision: 3670 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

print(string.format("%s\n%s\n%s\n%s\n%s\n", argv, args, user.name, channel, slack))
print("\n")


ptable(argv)
print("\n")


Revision: 3669 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

print(string.format("%s\n%s\n%s\n%s\n%s\n", argv, args, user.name, channel, slack))
print("\n")


ptable(argv)
print("\n")

ptable(args)
print("\n")

ptable(user)
print("\n")

ptable(channel)
print("\n")

ptable(slack)
print("\n")

Revision: 3668 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

print(string.format("%s\n%s\n%s\n%s\n%s\n", argv, args, user.name, channel, slack))
print("\n")


print(argv)
print("\n")

print(args)
print("\n")

print(user.name)
print("\n")

print(channel.users)
print("\n")

print(slack)
print("\n")

Revision: 3667 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

print(string.format("%s\n%s\n%s\n%s\n%s\n", argv, args, user.name, channel, slack))
print("\n")


print(argv)
print("\n")

print(args)
print("\n")

print(user.name)
print("\n")

print(channel)
print("\n")

print(slack)
print("\n")

Revision: 3666 (deleted) by @dye in #hi 11 months agoSlack Archive

{lua}

print(string.format("%s\n%s\n%s\n%s\n%s\n", argv, args, user, channel, slack))
print("\n")


print(argv)
print("\n")

print(args)
print("\n")

print(user)
print("\n")

print(channel)
print("\n")

print(slack)
print("\n")

Revision: 3665 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

print(string.format("%s\n%s\n%s\n%s\n%s\n", argv, args, user, channel, slack))

print("\n")


print(user)
print("\n")

print(channel)
print("\n")

print(slack)
print("\n")

Revision: 3664 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

print(string.format("%s\n%s\n%s\n%s\n%s\n", argv, args, user, channel, slack))

print("\n")


print(user)
print("\n")

Revision: 3663 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

print(string.format("%s\n%s\n%s\n%s\n%s\n", argv, args, user, channel, slack))

Revision: 3662 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

print(argv)
print(args)

print(user)
print(channel)
print(slack)

Revision: 3661 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

local example_dataname = "technology/computer_sciences"

ptable(corpus.info[example_dataname])
-- field: "computer_sciences"
-- description: "names of technologies related to computer science"
-- source: ""
-- length: 197

print(corpus[example_dataname][2])

Revision: 3660 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

local test_content = "123456789"
local paste_url = bot.paste(test_content)
local resp, err = requests.get(paste_url)
print(test_content == resp:text())

Revision: 3659 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

s = "https://www.42.us.org/"
s1 = "https://www.youtube.com/watch?v=9m_K2Yg7wGQ"

print(string.format("%s\n%s\n", s, s1))

Revision: 3658 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

s = "Good Text"
s1 = "New text"

print(string.format("%s\n%s\n", s, s1))

Revision: 3657 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

d = 5; m = 11; y = 1990
print(string.format("%02d/%02d/%04d", d, m, y))

Revision: 3656 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}


print(string.format("pi = %.4f", 3.14456653))

Revision: 3655 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}


print(string.format("pi = %.4f", PI))

Revision: 3654 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

print(string.char(97))                    
i = 99; print(string.char(i, i+1, i+2))
print(string.format("pi = %.4f", PI))
d = 5; m = 11; y = 1990
print(string.format("%02d/%02d/%04d", d, m, y))

Revision: 3653 (deleted) by @dye in #[IM @dye] 11 months agoSlack Archive

{lua}

print(string.char(97))                    
i = 99; print(string.char(i, i+1, i+2))