Power Query does not stop loading lines after table ended - loading
Well, my problem is basically what the title says: I have a table that retrieves data from a table in another excel file, and now, doesn't stop loading lines, well after said table ended.
The script that I have (see bellow), has another table innerjoined, but that table, also from PowerQuery, that retrieves a table from yet another excel file, loads just fine. No problems. The main one is the one that does not stop until like 3000000 lines (original table is 3000 lines).
I can't understand the problem, because this has been working just fine.
let
Origem = Excel.Workbook(File.Contents("\\SERVIDOR\Registo de defeitos\REGISTO_DEFEITOS_2016.xlsm"), null, true),
REGISTRY_Table = Origem{[Item="REGISTRY",Kind="Table"]}[Data],
#"Tipo Alterado" = Table.TransformColumnTypes(REGISTRY_Table,{{"FINDER", type text}, {"DATA", type date}, {"ORDEM FABRICO", Int64.Type}, {"REFERÊNCIA", Int64.Type}, {"LOTE", type text}, {"OPERADOR", type text}, {"PRENSA", Int64.Type}, {"TURNO", Int64.Type}, {"PRODUÇÃO TOTAL#(lf)(Nº DE PEÇAS)", Int64.Type}, {"A", Int64.Type}, {"B", Int64.Type}, {"C", Int64.Type}, {"D", Int64.Type}, {"E", Int64.Type}, {"F", Int64.Type}, {"Z", Int64.Type}, {"L", Int64.Type}, {"M", Int64.Type}, {"N", Int64.Type}, {"O", Int64.Type}, {"P", Int64.Type}, {"QUANTIDADE DE PEÇAS OK#(lf)(PRENSA)", Int64.Type}, {"QUANTIDADE DE PEÇAS NOK#(lf)(PRENSA)", Int64.Type}, {"% DEFEITOS#(lf)(PRENSA)", type number}, {"% DETECÇÃO DE DEFEITOS#(lf)(PRENSA)", type number}, {"DATA DE INSPECÇÃO", type date}, {"QUANTIDADE DE PEÇAS VERIFICADA#(lf)(Nº DE PEÇAS)", Int64.Type}, {"TIPO DE INSPECÇÃO", type text}, {"A ", Int64.Type}, {"B ", Int64.Type}, {"C ", Int64.Type}, {"D ", Int64.Type}, {"E ", Int64.Type}, {"F ", Int64.Type}, {"Z ", Int64.Type}, {"L ", Int64.Type}, {"M ", Int64.Type}, {"N ", Int64.Type}, {"O ", Int64.Type}, {"P ", Int64.Type}, {"PEÇAS RETRABALHADAS ""OK""#(lf)(Nº DE PEÇAS)", Int64.Type}, {"LOTE#(lf)FECHADO", type text}, {"QUANTIDADE DE PEÇAS OK#(lf)(INSP. FINAL)", Int64.Type}, {"QUANTIDADE DE PEÇAS NOK#(lf)(INSP. FINAL)", Int64.Type}, {"% DEFEITOS#(lf)(INSP. FINAL)", type number}, {"QUANTIDADE DE PEÇAS OK#(lf)(FINAL)", Int64.Type}, {"QUANTIDADE DE PEÇAS NOK#(lf)(FINAL)", Int64.Type}, {"% DEFEITOS#(lf)(FINAL)", type number}, {"CONTABILIZAÇÃO DE PEÇAS", Int64.Type}, {"TESTER", Int64.Type}, {"MÊS", type text}, {"ANO", Int64.Type}, {"MÊS INSP.", type text}, {"ANO INSP.", Int64.Type}}),
#"Colunas Removidas" = Table.RemoveColumns(#"Tipo Alterado",{"TESTER"}),
#"Consultas Intercaladas" = Table.NestedJoin(#"Colunas Removidas",{"FINDER"},TabelaRegistos,{"FINDER"},"NewColumn",JoinKind.Inner),
#"Expandido NewColumn" = Table.ExpandTableColumn(#"Consultas Intercaladas", "NewColumn", {"Nº DE CAVIDADES", "PRODUÇÃO PREVISTA (nº de cargas/h)", "AJUSTE DE OBJECTIVO PRODUÇÃO PREVISTA#(lf)(nº de cargas/h)", "PRODUÇÃO TOTAL#(lf)(nº de peças)", "A ", "B ", "C ", "D ", "E ", "F ", "G ", "H ", "I ", "Z ", "PRENSA SEM PARAGEM PARA REFEIÇÕES?", "J ", "TEMPO DE PARAGEM NÃO PROGRAMADA (min)", "TEMPO DE PARAGEM PROGRAMADA (min)", "AJUSTE DE TEMPO DE TURNO#(lf)(min)", "LOTE FECHADO", "OBSERVAÇÕES", "PRODUÇÃO EFECTIVA#(lf)(nº de cargas/h)", "PERFORMANCE#(lf)(%)", "DISPONIBILIDADE#(lf)(%)", "QUALIDADE PRENSA#(lf)(%)", "QUALIDADE#(lf)(%)", "OEE OBJECTIVO#(lf)(%)", "WE OBJECTIVO#(lf)(%)", "OEE PRENSA#(lf)(%)", "OEE#(lf)(%)", "Δ OEE#(lf)(Δ%)", "WE PRENSA#(lf)(%)", "WE#(lf)(%)", "Δ WE#(lf)(Δ%)", "TEMPO DE TRABALHO DISPONÍVEL#(lf)(min)", "TEMPO DE TRABALHO COM PARAGENS PROGRAMADAS#(lf)(min)", "TEMPO DE TRABALHO COM PARAGENS NÃO PROGRAMADAS#(lf)(min)", "TEMPO DE LABORAÇÃO EFECTIVO#(lf)(min)", "EFICÁCIA DE UTILIZAÇÃO#(lf)(%)", "FINDER", "COMMENTS", "NOME MÊS", "AProg", "BProg", "CProg", "DProg", "EProg", "FProg", "GProg", "HProg", "IProg", "Zprog", "ANProg", "BNProg", "CNProg", "DNProg", "ENProg", "FNProg", "GNProg", "HNProg", "INProg", "ZNprog"}, {"Nº DE CAVIDADES", "PRODUÇÃO PREVISTA (nº de cargas/h)", "AJUSTE DE OBJECTIVO PRODUÇÃO PREVISTA#(lf)(nº de cargas/h)", "PRODUÇÃO TOTAL#(lf)(nº de peças)", "A ", "B ", "C ", "D ", "E ", "F ", "G ", "H ", "I ", "Z ", "PRENSA SEM PARAGEM PARA REFEIÇÕES?", "J ", "TEMPO DE PARAGEM NÃO PROGRAMADA (min)", "TEMPO DE PARAGEM PROGRAMADA (min)", "AJUSTE DE TEMPO DE TURNO#(lf)(min)", "LOTE FECHADO", "OBSERVAÇÕES", "PRODUÇÃO EFECTIVA#(lf)(nº de cargas/h)", "PERFORMANCE#(lf)(%)", "DISPONIBILIDADE#(lf)(%)", "QUALIDADE PRENSA#(lf)(%)", "QUALIDADE#(lf)(%)", "OEE OBJECTIVO#(lf)(%)", "WE OBJECTIVO#(lf)(%)", "OEE PRENSA#(lf)(%)", "OEE#(lf)(%)", "Δ OEE#(lf)(Δ%)", "WE PRENSA#(lf)(%)", "WE#(lf)(%)", "Δ WE#(lf)(Δ%)", "TEMPO DE TRABALHO DISPONÍVEL#(lf)(min)", "TEMPO DE TRABALHO COM PARAGENS PROGRAMADAS#(lf)(min)", "TEMPO DE TRABALHO COM PARAGENS NÃO PROGRAMADAS#(lf)(min)", "TEMPO DE LABORAÇÃO EFECTIVO#(lf)(min)", "EFICÁCIA DE UTILIZAÇÃO#(lf)(%)", "FINDER.1", "COMMENTS", "NOME MÊS", "AProg", "BProg", "CProg", "DProg", "EProg", "FProg", "GProg", "HProg", "IProg", "Zprog", "ANProg", "BNProg", "CNProg", "DNProg", "ENProg", "FNProg", "GNProg", "HNProg", "INProg", "ZNprog"}),
#"Colunas Removidas1" = Table.RemoveColumns(#"Expandido NewColumn",{"PRODUÇÃO TOTAL#(lf)(nº de peças)"}),
#"Personalizado Adicionado" = Table.AddColumn(#"Colunas Removidas1", "PRODUÇÃO TOTAL OBJECTIVO (Nº DE PEÇAS)", each [Nº DE CAVIDADES]*[#"PRODUÇÃO PREVISTA (nº de cargas/h)"]*[#"TEMPO DE TRABALHO COM PARAGENS NÃO PROGRAMADAS#(lf)(min)"]/60),
#"Tipo Alterado1" = Table.TransformColumnTypes(#"Personalizado Adicionado",{{"PRODUÇÃO TOTAL OBJECTIVO (Nº DE PEÇAS)", Int64.Type}}),
#"Trimestre Inserido" = Table.AddColumn(#"Tipo Alterado1", "TRIMESTRE", each Date.QuarterOfYear([DATA]), type number),
#"Personalizado Adicionado1" = Table.AddColumn(#"Trimestre Inserido", "PRODUÇÃO TOTAL OBJECTIVO (TEMPO EFECTIVO)", each [Nº DE CAVIDADES]*[#"PRODUÇÃO PREVISTA (nº de cargas/h)"]*[#"TEMPO DE LABORAÇÃO EFECTIVO#(lf)(min)"]/60),
#"Tipo Alterado2" = Table.TransformColumnTypes(#"Personalizado Adicionado1",{{"PRODUÇÃO TOTAL OBJECTIVO (TEMPO EFECTIVO)", Int64.Type}}),
#"Colunas com Nome Mudado" = Table.RenameColumns(#"Tipo Alterado2",{{"PRODUÇÃO TOTAL OBJECTIVO (Nº DE PEÇAS)", "PRODUÇÃO TOTAL OBJECTIVO (TEMPO COM PARAGENS NÃO PROGRAMADAS)"}}),
#"Colunas Reordenadas" = Table.ReorderColumns(#"Colunas com Nome Mudado",{"FINDER", "DATA", "ORDEM FABRICO", "REFERÊNCIA", "LOTE", "OPERADOR", "PRENSA", "TURNO", "PRODUÇÃO TOTAL#(lf)(Nº DE PEÇAS)", "A", "B", "C", "D", "E", "F", "Z", "L", "M", "N", "O", "P", "QUANTIDADE DE PEÇAS OK#(lf)(PRENSA)", "QUANTIDADE DE PEÇAS NOK#(lf)(PRENSA)", "% DEFEITOS#(lf)(PRENSA)", "% DETECÇÃO DE DEFEITOS#(lf)(PRENSA)", "DATA DE INSPECÇÃO", "QUANTIDADE DE PEÇAS VERIFICADA#(lf)(Nº DE PEÇAS)", "TIPO DE INSPECÇÃO", "A ", "B ", "C ", "D ", "E ", "F ", "Z ", "L ", "M ", "N ", "O ", "P ", "PEÇAS RETRABALHADAS ""OK""#(lf)(Nº DE PEÇAS)", "LOTE#(lf)FECHADO", "QUANTIDADE DE PEÇAS OK#(lf)(INSP. FINAL)", "QUANTIDADE DE PEÇAS NOK#(lf)(INSP. FINAL)", "% DEFEITOS#(lf)(INSP. FINAL)", "QUANTIDADE DE PEÇAS OK#(lf)(FINAL)", "QUANTIDADE DE PEÇAS NOK#(lf)(FINAL)", "% DEFEITOS#(lf)(FINAL)", "CONTABILIZAÇÃO DE PEÇAS", "MÊS", "ANO", "MÊS INSP.", "ANO INSP.", "Nº DE CAVIDADES", "PRODUÇÃO PREVISTA (nº de cargas/h)", "AJUSTE DE OBJECTIVO PRODUÇÃO PREVISTA#(lf)(nº de cargas/h)", "A ", "B ", "C ", "D ", "E ", "F ", "G ", "H ", "I ", "Z ", "PRENSA SEM PARAGEM PARA REFEIÇÕES?", "J ", "TEMPO DE PARAGEM NÃO PROGRAMADA (min)", "TEMPO DE PARAGEM PROGRAMADA (min)", "AJUSTE DE TEMPO DE TURNO#(lf)(min)", "LOTE FECHADO", "OBSERVAÇÕES", "PRODUÇÃO EFECTIVA#(lf)(nº de cargas/h)", "PERFORMANCE#(lf)(%)", "DISPONIBILIDADE#(lf)(%)", "QUALIDADE PRENSA#(lf)(%)", "QUALIDADE#(lf)(%)", "OEE OBJECTIVO#(lf)(%)", "WE OBJECTIVO#(lf)(%)", "OEE PRENSA#(lf)(%)", "OEE#(lf)(%)", "Δ OEE#(lf)(Δ%)", "WE PRENSA#(lf)(%)", "WE#(lf)(%)", "Δ WE#(lf)(Δ%)", "TEMPO DE TRABALHO DISPONÍVEL#(lf)(min)", "TEMPO DE TRABALHO COM PARAGENS PROGRAMADAS#(lf)(min)", "TEMPO DE TRABALHO COM PARAGENS NÃO PROGRAMADAS#(lf)(min)", "TEMPO DE LABORAÇÃO EFECTIVO#(lf)(min)", "EFICÁCIA DE UTILIZAÇÃO#(lf)(%)", "FINDER.1", "COMMENTS", "NOME MÊS", "TRIMESTRE", "AProg", "BProg", "CProg", "DProg", "EProg", "FProg", "GProg", "HProg", "IProg", "Zprog", "ANProg", "BNProg", "CNProg", "DNProg", "ENProg", "FNProg", "GNProg", "HNProg", "INProg", "ZNprog", "PRODUÇÃO TOTAL OBJECTIVO (TEMPO COM PARAGENS NÃO PROGRAMADAS)", "PRODUÇÃO TOTAL OBJECTIVO (TEMPO EFECTIVO)"}),
#"Colunas Removidas2" = Table.RemoveColumns(#"Colunas Reordenadas",{"FINDER.1", "FINDER"}),
#"Personalizado Adicionado2" = Table.AddColumn(#"Colunas Removidas2", "PERFORMANCE LÍQUIDA (%)", each [#"QUANTIDADE DE PEÇAS OK#(lf)(FINAL)"]/[#"PRODUÇÃO TOTAL OBJECTIVO (TEMPO EFECTIVO)"]),
#"Colunas Removidas3" = Table.RemoveColumns(#"Personalizado Adicionado2",{"NOME MÊS"}),
#"Colunas Reordenadas1" = Table.ReorderColumns(#"Colunas Removidas3",{"DATA", "ORDEM FABRICO", "REFERÊNCIA", "LOTE", "OPERADOR", "PRENSA", "TURNO", "PRODUÇÃO TOTAL#(lf)(Nº DE PEÇAS)", "A", "B", "C", "D", "E", "F", "Z", "L", "M", "N", "O", "P", "QUANTIDADE DE PEÇAS OK#(lf)(PRENSA)", "QUANTIDADE DE PEÇAS NOK#(lf)(PRENSA)", "% DEFEITOS#(lf)(PRENSA)", "% DETECÇÃO DE DEFEITOS#(lf)(PRENSA)", "DATA DE INSPECÇÃO", "QUANTIDADE DE PEÇAS VERIFICADA#(lf)(Nº DE PEÇAS)", "TIPO DE INSPECÇÃO", "A ", "B ", "C ", "D ", "E ", "F ", "Z ", "L ", "M ", "N ", "O ", "P ", "PEÇAS RETRABALHADAS ""OK""#(lf)(Nº DE PEÇAS)", "LOTE#(lf)FECHADO", "QUANTIDADE DE PEÇAS OK#(lf)(INSP. FINAL)", "QUANTIDADE DE PEÇAS NOK#(lf)(INSP. FINAL)", "% DEFEITOS#(lf)(INSP. FINAL)", "QUANTIDADE DE PEÇAS OK#(lf)(FINAL)", "QUANTIDADE DE PEÇAS NOK#(lf)(FINAL)", "% DEFEITOS#(lf)(FINAL)", "CONTABILIZAÇÃO DE PEÇAS", "MÊS", "TRIMESTRE", "ANO", "MÊS INSP.", "ANO INSP.", "Nº DE CAVIDADES", "PRODUÇÃO PREVISTA (nº de cargas/h)", "AJUSTE DE OBJECTIVO PRODUÇÃO PREVISTA#(lf)(nº de cargas/h)", "A ", "B ", "C ", "D ", "E ", "F ", "G ", "H ", "I ", "Z ", "PRENSA SEM PARAGEM PARA REFEIÇÕES?", "J ", "TEMPO DE PARAGEM NÃO PROGRAMADA (min)", "TEMPO DE PARAGEM PROGRAMADA (min)", "AJUSTE DE TEMPO DE TURNO#(lf)(min)", "LOTE FECHADO", "OBSERVAÇÕES", "PRODUÇÃO EFECTIVA#(lf)(nº de cargas/h)", "PERFORMANCE#(lf)(%)", "DISPONIBILIDADE#(lf)(%)", "QUALIDADE PRENSA#(lf)(%)", "QUALIDADE#(lf)(%)", "OEE OBJECTIVO#(lf)(%)", "WE OBJECTIVO#(lf)(%)", "OEE PRENSA#(lf)(%)", "OEE#(lf)(%)", "Δ OEE#(lf)(Δ%)", "WE PRENSA#(lf)(%)", "WE#(lf)(%)", "Δ WE#(lf)(Δ%)", "TEMPO DE TRABALHO DISPONÍVEL#(lf)(min)", "TEMPO DE TRABALHO COM PARAGENS PROGRAMADAS#(lf)(min)", "TEMPO DE TRABALHO COM PARAGENS NÃO PROGRAMADAS#(lf)(min)", "TEMPO DE LABORAÇÃO EFECTIVO#(lf)(min)", "EFICÁCIA DE UTILIZAÇÃO#(lf)(%)", "COMMENTS", "AProg", "BProg", "CProg", "DProg", "EProg", "FProg", "GProg", "HProg", "IProg", "Zprog", "ANProg", "BNProg", "CNProg", "DNProg", "ENProg", "FNProg", "GNProg", "HNProg", "INProg", "ZNprog", "PRODUÇÃO TOTAL OBJECTIVO (TEMPO COM PARAGENS NÃO PROGRAMADAS)", "PRODUÇÃO TOTAL OBJECTIVO (TEMPO EFECTIVO)", "PERFORMANCE LÍQUIDA (%)"}),
#"Personalizado Adicionado3" = Table.AddColumn(#"Colunas Reordenadas1", "100%", each 1),
#"Personalizado Adicionado4" = Table.AddColumn(#"Personalizado Adicionado3", "90%", each 0.9),
#"Personalizado Adicionado5" = Table.AddColumn(#"Personalizado Adicionado4", "85%", each 0.85),
#"Personalizado Adicionado6" = Table.AddColumn(#"Personalizado Adicionado5", "80%", each 0.80),
#"Personalizado Adicionado7" = Table.AddColumn(#"Personalizado Adicionado6", "70%", each 0.70),
#"Personalizado Adicionado8" = Table.AddColumn(#"Personalizado Adicionado7", "60%", each 0.60),
#"Personalizado Adicionado9" = Table.AddColumn(#"Personalizado Adicionado8", "50%", each 0.50)
in
#"Personalizado Adicionado9"
Thanks to all that can help.
Possibly something is wrong with your key values:
1 Excel table can not have 3 million lines as the maximum is just over 1 million, so logically the source of your issue is at the step where the nested table is expanded: #"Expandido NewColumn".
I ran a small test with 2 tables, each with keys 1-10 and an inner join resulting in a table with 10 rows. So far so good.
Next I emptied the contents of the key columns of each table and ran the query again, resulting in 10 x 10 = 100 rows as each key in either table corresponds with 10 keys in the other table.
So my suggestion would be to verify the values in your FINDER columns.
If this is not the cause, then please share: which is the first step that is causing the issue: you can check each step in the Query Editor.
Related
How to send a discord.js random embed?
I'm looking for a code that would let me send an random embed that I created when someone types a command. For the moment with the code that I have, all embeds are being sent but I want the bot to only send a random one, not all 4. Is this possible ? module.exports = class PizzaTest extends BaseCommand { constructor() { super('pizzatest', 'fun', []); } async run(client, message, args) { const capreseEmbed = new Discord.MessageEmbed() .setTitle('• Attention, pizza en livraison! 🚀') .setDescription(`<#${message.author.id}>, il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Caprese** ! \n\n *Les ingrédients sont: Mozarella, Olives, Tomates Séchées & Basilic.*`) .setThumbnail('https://i.imgur.com/McSXASC.png') .setFooter(message.author.username, message.author.displayAvatarURL()) .setTimestamp() .setColor("#baff58"); const reineEmbed = new Discord.MessageEmbed() .setTitle('• Attention, pizza en livraison! 🚀') .setDescription(`<#${message.author.id}>, il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Reine** ! \n\n *Les ingrédients sont: Mozarella, Jambon, Champignons & Basilic.*`) .setThumbnail('https://i.imgur.com/AKStODY.png') .setFooter(message.author.username, message.author.displayAvatarURL()) .setTimestamp() .setColor("#baff58"); const vegeEmbed = new Discord.MessageEmbed() .setTitle('• Attention, pizza en livraison! 🚀') .setDescription(`<#${message.author.id}>, il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Végétarienne** ! \n\n *Les ingrédients sont: Mozarella, Olives, Poivrons, Champignons & Basilic.*`) .setThumbnail('https://i.imgur.com/U0qrSk9.png') .setFooter(message.author.username, message.author.displayAvatarURL()) .setTimestamp() .setColor("#baff58"); const andalouseEmbed = new Discord.MessageEmbed() .setTitle('• Attention, pizza en livraison! 🚀') .setDescription(`<#${message.author.id}>, il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Andalouse** ! \n\n *Les ingrédients sont: Mozarella, Poivrons, Boulette de Boeuf & Sauce Andalouse.*`) .setThumbnail('https://i.imgur.com/dvgkC4K.png') .setFooter(message.author.username, message.author.displayAvatarURL()) .setTimestamp() .setColor("#baff58"); message.channel.send(capreseEmbed).catch(err => console.log(err)); message.channel.send(reineEmbed).catch(err => console.log(err)); message.channel.send(vegeEmbed).catch(err => console.log(err)); message.channel.send(andalouseEmbed).catch(err => console.log(err)); } } I know that I can use something like .setDescription(description) with all of them stated at the beginning but I need the description and thumbnail to match so that wouldn't work I guess ? Thank you!
Here's an easy way: const Thumbnail = [ 'https://i.imgur.com/McSXASC.png', 'https://i.imgur.com/AKStODY.png', 'https://i.imgur.com/U0qrSk9.png', 'https://i.imgur.com/dvgkC4K.png', ] const Description = [ ', il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Caprese** ! \n\n *Les ingrédients sont: Mozarella, Olives, Tomates Séchées & Basilic.*`', ', il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Végétarienne** ! \n\n *Les ingrédients sont: Mozarella, Olives, Poivrons, Champignons & Basilic.*`', ', il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Végétarienne** ! \n\n *Les ingrédients sont: Mozarella, Olives, Poivrons, Champignons & Basilic.*`', ', il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Andalouse** ! \n\n *Les ingrédients sont: Mozarella, Poivrons, Boulette de Boeuf & Sauce Andalouse.*`', ] let random = Math.floor(Math.random() * Thumbnail.length) const embed = new Discord.MessageEmbed() .setTitle('• Attention, pizza en livraison! 🚀') .setDescription( '`' + message.author.username + Description[random]) .setThumbnail(Thumbnail[random]) .setFooter(message.author.username, message.author.displayAvatarURL()) .setTimestamp() .setColor("#baff58") message.channel.send(embed)
Yes this is possible and very simple to do: const capreseEmbed = new Discord.MessageEmbed() .setTitle('• Attention, pizza en livraison! 🚀') .setDescription(`<#${message.author.id}>, il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Caprese** ! \n\n *Les ingrédients sont: Mozarella, Olives, Tomates Séchées & Basilic.*`) .setThumbnail('https://i.imgur.com/McSXASC.png') .setFooter(message.author.username, message.author.displayAvatarURL()) .setTimestamp() .setColor("#baff58") const reineEmbed = new Discord.MessageEmbed() .setTitle('• Attention, pizza en livraison! 🚀') .setDescription(`<#${message.author.id}>, il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Reine** ! \n\n *Les ingrédients sont: Mozarella, Jambon, Champignons & Basilic.*`) .setThumbnail('https://i.imgur.com/AKStODY.png') .setFooter(message.author.username, message.author.displayAvatarURL()) .setTimestamp() .setColor("#baff58") const vegeEmbed = new Discord.MessageEmbed() .setTitle('• Attention, pizza en livraison! 🚀') .setDescription(`<#${message.author.id}>, il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Végétarienne** ! \n\n *Les ingrédients sont: Mozarella, Olives, Poivrons, Champignons & Basilic.*`) .setThumbnail('https://i.imgur.com/U0qrSk9.png') .setFooter(message.author.username, message.author.displayAvatarURL()) .setTimestamp() .setColor("#baff58") const andalouseEmbed = new Discord.MessageEmbed() .setTitle('• Attention, pizza en livraison! 🚀') .setDescription(`<#${message.author.id}>, il semblerait que ta commande soit prête. Tu viens de recevoir une magnique pizza **Andalouse** ! \n\n *Les ingrédients sont: Mozarella, Poivrons, Boulette de Boeuf & Sauce Andalouse.*`) .setThumbnail('https://i.imgur.com/dvgkC4K.png') .setFooter(message.author.username, message.author.displayAvatarURL()) .setTimestamp() .setColor("#baff58") var embedArr = [capreseEmbed, reineEmbed, vegeEmbed, andalouseEmbed]; let randomEmbed = embedArr[Math.floor(Math.random() * embedArr.length)]; message.channel.send(randomEmbed); At first we define all embeds, like you already did. Then we store them in an array. From that array we want to get a value from a random index. That is done in randomEmbed. Then we send the random embed into the channel.
Skrollr - how to permit the scroll of a long text of unknown size until the end
Please what is the trick so that a long text of several pages (filled for example with text "Lorem ipsum ...") of unknown length (no known in advance) become visible beyond one page which is freezes (not able to see after) because skrollr ? My simple skrollr code that bug to scrool to the end of a long text (size not fixed) beyond one page: <div id = "corpsDiv" data-0 = "transform: translateY (100vh)" data-500 = "transform: translateY (100vh)" data-900 = "transform: translateY (0vh)"> Lorem ipsum dolor sit amet. <BR> Qui cupiditate nisi est praesentium omnis et reprehenderit veniam <BR> Est dolor perspiciatis ea placeat quaerat <BR> et galisum provident aut cumque iste sed reiciendis esse <BR> ... etc <BR> </div>
As no one answered, I share with you the solution that I found to help others : <script type="text/javascript"> /* function : recalculSkrollr() === Création dynamique du dernier attribut skrollr positionnant la fin du div de texte Corps de page pour pouvoir la scroller Nota : comme le div de texte ci-dessus "corpsDiv" est dynamique (ie de hauteur inconnue à l'avance selon le contenu et la taille d'écran), et que skrollr ne sait donc pas afficher toute sa hauteur (ne connaissant pas sa valeur non figée no plus arbitrairement par le css), alors seule la première page de ce div de texte (positionné à 0vh par skrollr via data-0) sera visible, sans pouvoir la scroller tant qu'un attribut skrollr, indiquant jusqu'où scroller, ne sera pas créé pour voir l'intégralité de ce div, soit tant qu'un attribut skrollr data-{hauteur_px_du_div} indiquant une valeur égale de translation Y négative (vers le haut) de {hauteur_vh_du_div} (vh pour être homogène avec les autres unités vh des data skrollr du div) ne sera pas dynamiquement créé, ce qui est fait (nécessairement après ce div) ici à la fin de cette page. */ function recalculSkrollr() { // Calcul du viewport height en cours (via la taille de l'écran) screenHeight= window.innerHeight || (document.body && document.body.clientHeight) || 800; viewHeight = screenHeight / 100; // View port (1% de la hauteur d'écran) // Calcul hauteur du div en px (taille du div inconnue à l'avance) afin de pouvoir le scroller (ici scrollTop=0 car div par encore au-dessus du top à 0) vcorpsDiv = document.getElementById('corpsDiv'); hauteurPxCorpsDiv = vcorpsDiv.offsetHeight; // Garder une hauteur minimum (150 vh) pour afficher correctement un corpsDiv qui serait trop petit (skrollr perturbé sinon) hauteurPxCorpsDiv = Math.max(hauteurPxCorpsDiv , 150 * viewHeight); // Calcul hauteur du div (en vh) pour permettre à skrollr de translater le div vers le haut hauteurVhCorpsDiv = Math.trunc(hauteurPxCorpsDiv / viewHeight); // Calcul du décalage du div (en vh) vers le haut une fois entièrement scrollé (en soustrayant l'offset déjà appliqué dans la déclaration html du corpsDiv via son attribut skrollr data-0="transform:translateY(100vh)") offsetVhCorpsDiv = 100; decaleVhCorpsDiv = hauteurVhCorpsDiv - offsetVhCorpsDiv; // Calcul de l'attribut skrollr (libellé et valeur du tag) à créer dynamiquement afin de pouvoir scroller entièrement le div csstag='data-'+hauteurPxCorpsDiv; cssvalue='transform:translateY(-'+decaleVhCorpsDiv+'vh)'; // pas besoin à priori des accolades css : cssvalue = '{' + cssvalue + '}' // Création de l'attibut skrollr permettant de scroller le div jusqu'au bout document.getElementById('corpsDiv').setAttribute(csstag, cssvalue); // Création de l'attibut height du div cssheight = hauteurVhCorpsDiv + 'vh'; document.getElementById('corpsDiv').style.height = cssheight; } recalculSkrollr(); // Décaler dans le temps (500ms) l'init du scroll pour laisser le temps à la page de se charger (sinon le scrollr.menu avec une url #xxx restera en haut) setTimeout(function() { /* ==== Initialisation du gestionnaire skrollr (voir source et doc https://prinzhorn.github.io/skrollr/ ) */ var skroller = skrollr.init({ constants: { // Position vertical avant et après l'ouverture du portail (en px) pour l'animer dans l'image d'entete avantportail: function() { // Calcul d'une constante dynamique (possible aussi d'accéder à l'instance skrollr avec `this` par ex. `this.relativeToAbsolute`) positionVhCible = 50; // position cible à atteindre en unité vh (1/100 du viewport height) positionPxCible = positionVhCible * viewHeight; return positionPxCible; }, apresportail: function() { positionVhCible = 140; // position cible à atteindre en vh positionPxCible = positionVhCible * viewHeight; return positionPxCible; } } }); //The options (second parameter) are all optional. The values shown are the default values. skrollr.menu.init(skroller, { //skrollr will smoothly animate to the new position using `animateTo`. animate: true, //The easing function to use. easing: 'sqrt', //Multiply your data-[offset] values so they match those set in skrollr.init scale: 1, //This event is triggered right before we jump/animate to a new hash. change: function(newHash, newTopPosition) { //console.log(hash, top); } }); }, 500); // Recharger la page si la page change de taille afin de recalculer les attributs dynamiques de skrollr function pageResize() { document.location.reload(); } window.onresize = pageResize; </script>
Nativescript RadListView StaggeredLayout Issue
I have a Nativescript Angular project where I am using RadListView trying to use the staggered layout. It works fine on Android but on iOS there is a spacing issue that I cannot figure out what is causing it. HTML <GridLayout class="page page-content" rows="*"> <GridLayout margin="10"> <RadListView height="100%" [items]="dataItems"> <ng-template tkListItemTemplate let-item="item" backgroundColor="transparent"> <StackLayout rows="auto, auto" borderWidth="1" borderColor="#ccc" margin="10"> <Label class="h3" [text]="item.name"></Label> <Label class="descriptionLabel" [text]="item.description" textWrap="true"></Label> </StackLayout> </ng-template> <ListViewStaggeredLayout tkListViewLayout scrollDirection="Vertical" spanCount="2"></ListViewStaggeredLayout> </RadListView> </GridLayout> </GridLayout> TypeScript dataItems = [{name: "Item 1", description: "Lorem ipsum dolor sit amet."}, {name: "Item 2", description: "Maecenas ac massa eu odio porta efficitur at non leo"}, {name: "Item 3", description: "Nunc vitae tortor sodales, varius magna quis, faucibus justo."}, {name: "Item 4", description: "In finibus sem"}, {name: "Item 5", description: "Duis sed sem porttitor"}, {name: "Item 6", description: "Blandit est vel, viverra nisi."}, {name: "Item 7", description: "Etiam at nisl ultricies, consectetur libero non, iaculis est."}, {name: "Item 8", description: "Curabitur at lorem"}, {name: "Item 9", description: "Non lectus tempus congue ultricies eget tellus."}, {name: "Item 10", description: "In sed dolor sit amet velit tempus iaculis."}, {name: "Item 11", description: "Duis dictum nunc in neque"}, {name: "Item 12", description: "Mauris dignissim mi sit amet nulla tristique, id posuere urna volutpat mauris gravida purus."}, {name: "Item 13", description: "Etiam accumsan sapien eget eros convallis porttitor."}, {name: "Item 14", description: "Vivamus ac arcu"}, {name: "Item 15", description: "Vestibulum at elit eget sapien fringilla"}, {name: "Item 16", description: "Maecenas tempus enim et velit bibendum, eu consequat erat volutpat."}];
I'm unable to reproduce the issue on my end either with or without the extra GridLayouts. At least in my opinion those layouts are not required actually. Here is the link to Playground.
File Browser not as part of the Kendo UI Editor
I am looking for a way to get stand alone File Browser control just like in the Kendo UI Editor. The presented solution in their forum uses Image Browser which has file type restrictions and thumbnails that we do not need.
If you are looking for file browser not as part of the Kendo UI Rich Text Editor control, not image browser, you can accomplish this (although it is not officially supported by Telerik/Progress). You can use: kendoFileBrowser <div class="file-borwser-js"></div> $(".file-borwser-js").kendoFileBrowser({ "messages": { "deleteFile": "Сигурни ли сте че искате да изтриете \"{0}\"?", "directoryNotFound": "Директория с посоченото име не бе открита.", "emptyFolder": "Празна папка", "invalidFileType": "Избраният файл \"{0}\" не е валиден. Поддържаните файлови формати са {1}.", "orderBy": "Подреди по:", "orderBySize": "Големина", "orderByName": "Име", "overwriteFile": "Файл с име \"{0}\" вече съществува в тази папка. Искате ли да го презапишете?", "uploadFile": "Качи файл", "dropFilesHere": "преместете с мишката файлове тук за да ги качите", "search": "Търси" }, "transport": { "type": "filebrowser-aspnetmvc", "read": { "url": "/FileBrowser/Read" }, "uploadUrl": "/FileBrowser/Upload", "destroy": { "url": "/FileBrowser/Destroy" }, "create": { "url": "/FileBrowser/Create" }, "fileUrl": "/FileBrowser/File?path={0}" } }); The way I got this is from the inline Javascript that is downloaded with the Kendo Editor. And copied the "fileBrowser" element. Then I used this element as parameter of kendoFileBrowser() jQuery(function(){jQuery("#_0__Content").kendoEditor({"tools":[{"name":"bold"},{"name":"italic"},{"name":"underline"},{"name":"strikethrough"},{"name":"justifyLeft"},{"name":"justifyCenter"},{"name":"justifyRight"},{"name":"justifyFull"},{"name":"insertUnorderedList"},{"name":"insertOrderedList"},{"name":"outdent"},{"name":"indent"},{"name":"createLink"},{"name":"unlink"},{"name":"insertImage"},{"name":"insertFile"},{"name":"subscript"},{"name":"superscript"},{"name":"createTable"},{"name":"addColumnLeft"},{"name":"addColumnRight"},{"name":"addRowAbove"},{"name":"addRowBelow"},{"name":"deleteRow"},{"name":"deleteColumn"},{"name":"viewHtml"},{"name":"formatting"},{"name":"cleanFormatting"},{"name":"fontName"},{"name":"fontSize"},{"name":"foreColor"},{"name":"backColor"}],"messages":{"bold":"Получер","italic":"Курсив","underline":"Подчертай","strikethrough":"Зачертай","superscript":"Горен индекс","subscript":"Долен индекс","justifyCenter":"Центрирай","justifyLeft":"Подравни отляво","justifyRight":"Подравни отдясно","justifyFull":"Подравни","insertOrderedList":"Вмъкни номериран списък","insertUnorderedList":"Вмъкни списък","indent":"Добави отстъп","outdent":"Премахни отстъп","createLink":"Направи препратка","unlink":"Премахни препратка","insertImage":"Вмъкни картина","insertFile":"Вмъкни файл","insertHtml":"Вмъкни HTML","fontName":"Шрифт","fontNameInherit":"(наследен шрифт)","fontSize":"Размер на шрифта","fontSizeInherit":"(наследен размер)","formatBlock":"Избери формат","styles":"Стилове","backColor":"Цвят на фона","foreColor":"Цвят","viewHtml":"Виж HTML-а","dialogUpdate":"Обнови","createTable":"Създай таблица"},"imageBrowser":{"messages":{"deleteFile":"Сигурни ли сте че искате да изтриете \"{0}\"?","directoryNotFound":"Директория с посоченото име не бе открита.","emptyFolder":"Празна папка","invalidFileType":"Избраният файл \"{0}\" не е валиден. Поддържаните файлови формати са {1}.","orderBy":"Подреди по:","orderBySize":"Големина","orderByName":"Име","overwriteFile":"Файл с име \"{0}\" вече съществува в тази папка. Искате ли да го презапишете?","uploadFile":"Качи файл","dropFilesHere":"преместете с мишката файлове тук за да ги качите","search":"Търси"},"transport":{"read":{"url":"/ImageBrowser/Read"},"type":"imagebrowser-aspnetmvc","thumbnailUrl":"/ImageBrowser/Thumbnail","uploadUrl":"/ImageBrowser/Upload","destroy":{"url":"/ImageBrowser/Destroy"},"create":{"url":"/ImageBrowser/Create"},"imageUrl":"/ImageBrowser/Image?path={0}"}},"fileBrowser":{"messages":{"deleteFile":"Сигурни ли сте че искате да изтриете \"{0}\"?","directoryNotFound":"Директория с посоченото име не бе открита.","emptyFolder":"Празна папка","invalidFileType":"Избраният файл \"{0}\" не е валиден. Поддържаните файлови формати са {1}.","orderBy":"Подреди по:","orderBySize":"Големина","orderByName":"Име","overwriteFile":"Файл с име \"{0}\" вече съществува в тази папка. Искате ли да го презапишете?","uploadFile":"Качи файл","dropFilesHere":"преместете с мишката файлове тук за да ги качите","search":"Търси"},"transport":{"read":{"url":"/FileBrowser/Read"},"type":"filebrowser-aspnetmvc","uploadUrl":"/FileBrowser/Upload","destroy":{"url":"/FileBrowser/Destroy"},"create":{"url":"/FileBrowser/Create"},"fileUrl":"/FileBrowser/File?path={0}"}}});}); Tested on Kendo UI: 2015.1.318 I have tried to post it on their forum as an answer, but apparently you have to be super premium to do so and I am posting it here.
$.ajax statusCode function never receive parameters
According to the official jQuery doc : If the request is successful, the status code functions take the same parameters as the success callback; if it results in an error, they take the same parameters as the error callback. But in fact, it's not. With this code : function saveCampagne (data){ $.ajax({ url : url, type : "GET", data : data, statusCode:{ 201 : function(campagne){ // JSON Decode var Campagne = JSON.parse(campagne); $("#zone-message").append('<div class="alert fade in" data-alert="alert"><a class="close" data-dismiss="alert" href="#">×</a><p><strong>C\'est Fait !</strong> La campagne a été ajoutée sous la référence #'+Campagne.id+'. Elle sera validée prochainement par un administrateur.</p></div>'); return Campagne; }, 200 : function(){ $("#zone-message").append('<div class="alert alert-error fade in" data-alert="alert"><a class="close" data-dismiss="alert" href="#">×</a><p><strong>Woops !</strong> Une erreur est survenue dans la création de la nouvelle campagne. Merci de ré-essayer ultérieurement.</p></div>'); } }, success : function(campagne){ }, error : function(){ $("#zone-message").append('<div class="alert alert-error fade in" data-alert="alert"><a class="close" data-dismiss="alert" href="#">×</a><p><strong>Woops !</strong> Une erreur est survenue dans la création de la nouvelle société. Merci de ré-essayer ultérieurement.</p></div>'); } }); } i'm able to make the .append but the function never get data (passed through campagne, like success ) in my 201 : function(campagne){...} Any Idea why it's not working like the doc say how it's works ?
Try removing the success and error handlers.