diff --git a/pastes/pastes_20231029120621.csv b/pastes/pastes_20231029120621.csv new file mode 100644 index 0000000..0daa17f --- /dev/null +++ b/pastes/pastes_20231029120621.csv @@ -0,0 +1,4506 @@ +id,title,username,language,date,content +SCCtjfSf,data736,TestGuy1,JSON,Sunday 29th of October 2023 07:00:07 AM CDT,"{ + status: 'Success', + method: 'server', + maindata: 'dd55a87c33884bff743a47e20a7d504ea40aafcc7d183411ca7e07dbe6074f61e1942ee0a93b9658f50fb630228bdc56007693553efdff3352909c9c69487174d9f81d4ff8d59bcdae47cd9e053cb30a597b224bfdacf66a66fd12e180f1e57601f29ea1a1e136111a7e80832e91e9adc6d72f0b8ae26ef47900103c0ec9bb0e', + otherdata: [ + 'd30b725507c45ce33fb0bd3f801f7038', + 'bf930fb90dd7d61efc28ae24ceade624', + 'a5c693b95385294aa229dd63aefe3968', + '5fef725675159e32684fbfd932b3bcca', + 'f8d86a27f198bda31e3b020fbb9f347d', + '01a95d3650356c7d19290c8f7280fcc2', + 'ccf5d2d99efe388f4f71c29ee8cea701', + '0156dd83b8368c59d3e919e87e000401' + ] +}" +M7JPCiD6,Untitled,Riremito,C++,Sunday 29th of October 2023 06:54:37 AM CDT,"void __userpurge CField::OnPacket(int this@, int a2@, int a3@, int a4, void *iPacket) +{ + int v5; // esi + unsigned __int8 v6; // al + _DWORD *v7; // ecx + int v8; // ecx + int v9; // ecx + int v10; // ecx + int v11; // esi + _DWORD *v12; // eax + char v13; // al + _DWORD *v14; // ecx + void *v15; // esi + int v16; // eax + char v17; // al + int *v18; // esi + _DWORD *v19; // ecx + int v20; // [esp-14h] [ebp-14h] BYREF + void *v21; // [esp-10h] [ebp-10h] + int v22; // [esp-Ch] [ebp-Ch] + int v23; // [esp-8h] [ebp-8h] + int v24; // [esp-4h] [ebp-4h] + + if ( a4 > 0x18D ) + { + if ( a4 == 0x1C1 ) + { + sub_A55B50((int)iPacket); + } + else if ( a4 == 0x1C2 ) + { + CWvsContext::OnSetLogoutGiftConfig((int *)dword_D050C0, (int)iPacket); + } + else + { +LABEL_42: + if ( (unsigned int)(a4 - 0xAE) <= 0x6F ) + { + if ( a4 == 0xAE ) + { + CUserPool::OnUserEnterField((_DWORD *)dword_D09584, (int)iPacket); + } + else if ( a4 == 0xAF ) + { + CUserPool::OnUserLeaveField((_DWORD *)dword_D09584, (int)iPacket); + } + else if ( (unsigned int)(a4 - 0xB0) > 0x1E ) + { + if ( (unsigned int)(a4 - 0xCF) <= 0x15 ) + { + v24 = a3; + v23 = a2; + v17 = CInPacket::Decode4((int)iPacket); + v18 = (int *)sub_9CDB10(v17); + if ( v18 && !*(_DWORD *)(dword_D050C0 + 14452) ) + { + if ( !v18[282] ) + { + switch ( a4 ) + { + case 0xD0: + case 0xD1: + case 0xD2: + case 0xD3: + CUserRemote::OnAttack((int)v18, a4, (int)iPacket); + break; + case 0xD4: + CUserRemote::OnSkillPrepare(v18, (int)iPacket); + break; + case 0xD5: + CUserRemote::OnMovingShootAttackPrepare((int)v18, (int)iPacket); + break; + case 0xD6: + CUserRemote::OnSkillCancel(v18, (int *)iPacket); + break; + case 0xD7: + CUserRemote::OnHit(v18, (int)iPacket); + break; + case 0xD8: + CUser::OnEmotion(v18, (int)iPacket); + break; + case 0xD9: + CUserRemote::OnSetActiveEffectItem(iPacket); + break; + case 0xDA: + CUserRemote::OnShowUpgradeTombEffect(iPacket); + break; + case 0xDD: + CUser::OnEffect(v18, (int)iPacket); + break; + case 0xE3: + sub_9D7400(v18, (int)iPacket); + break; + case 0xE4: + CUserRemote::OnThrowGrenade((int)iPacket); + break; + default: + break; + } + } + switch ( a4 ) + { + case 0xCF: + CUserRemote::OnMove(v18, (int)iPacket); + break; + case 0xDB: + CUserRemote::OnSetActivePortableChair(v18, (int)iPacket); + break; + case 0xDC: + CUserRemote::OnAvatarModified(v18, (int)iPacket); + break; + case 0xDE: + CUserRemote::OnSetTemporaryStat(v18, (int)iPacket); + break; + case 0xDF: + CUserRemote::OnResetTemporaryStat(v18, (int)iPacket); + break; + case 0xE0: + CUserRemote::OnReceiveHP(v18, (int)iPacket); + break; + case 0xE1: + CUserRemote::OnGuildNameChanged((int)iPacket); + break; + case 0xE2: + CUserRemote::OnGuildMarkChanged((int)v18, (int)iPacket); + break; + default: + return; + } + } + } + else if ( (unsigned int)(a4 - 229) <= 0x37 ) + { + v19 = *(_DWORD **)(dword_D09584 + 8); + if ( v19 ) + { + switch ( a4 ) + { + case 0xE5: + CUserLocal::OnSitResult(v19, (int)iPacket); + break; + case 0xE6: + CUser::OnEmotion(v19, (int)iPacket); + break; + case 0xE7: + CUser::OnEffect(v19, (int)iPacket); + break; + case 0xE8: + CUserLocal::OnTeleport(v19, (int)iPacket); + break; + case 0xEA: + CUserLocal::OnMesoGive_Succeeded_((int)iPacket); + break; + case 0xEB: + UserLocal::OnMesoGive_Failed(v19, (int)iPacket); + break; + case 0xEC: + CUserLocal::OnFieldFadeInOut((char *)v19, (int)iPacket); + break; + case 0xED: + CUserLocal::OnFieldFadeOutForce((int)iPacket); + break; + case 0xEE: + CUserLocal::OnRandomMesobag_Succeeded((int)iPacket); + break; + case 0xEF: + CUserLocal::OnRandomMesobag_Failed(v19, (int)iPacket); + break; + case 0xF0: + CUserLocal::OnQuestResult((int)iPacket); + break; + case 0xF1: + CUserLocal::OnNotifyHPDecByField((int)iPacket); + break; + case 0xF2: + sub_993760(v19, (char *)iPacket); + break; + case 0xF3: + CUserLocal::OnBalloonMsg(v19, (int)iPacket); + break; + case 0xF4: + CUserLocal::OnPlayEventSound((char *)iPacket); + break; + case 0xF5: + CUserLocal::OnPlayMinigameSound((int)iPacket); + break; + case 0xF6: + sub_995910(iPacket); + break; + case 0xF7: + CUserLocal::OnMakerResult((char **)iPacket); + break; + case 0xF8: + sub_982950((int)iPacket); + break; + case 0xF9: + CUserLocal::OnOpenClassCompetitionPage((int)iPacket); + break; + case 0xFA: + CUserLocal::OnOpenUI((int)iPacket); + break; + case 0xFB: + CUserLocal::OnOpenUIWithOption((int)iPacket); + break; + case 0xFC: + CUserLocal::OnSetDirectionMode(v19, (int)iPacket); + break; + case 0xFD: + CUserLocal::OnSetStandAloneMode((int)iPacket); + break; + case 0xFE: + CUserLocal::OnHireTutor(v19, (unsigned int *)iPacket); + break; + case 0xFF: + CUserLocal::OnTutorMsg(v19, (int)iPacket); + break; + case 0x100: + CUserLocal::OnIncComboResponse(v19, (int)iPacket); + break; + case 0x101: + sub_99B300(v19, (int)iPacket); + break; + case 0x102: + sub_998CC0((int)iPacket); + break; + case 0x103: + sub_98DC00(v19, (int)iPacket); + break; + case 0x104: + CUser::OnRandomEmotion(iPacket); + break; + case 0x105: + CUserLocal::OnResignQuestReturn((int)iPacket); + break; + case 0x106: + CUserLocal::OnPassMateName((int)iPacket); + break; + case 0x107: + CUserLocal::OnRadioSchedule((int)iPacket); + break; + case 0x108: + CUserLocal::OnOpenSkillGuide(iPacket); + break; + case 0x109: + CUserLocal::OnNoticeMsg((int)iPacket); + break; + case 0x10A: + CUserLocal::OnChatMsg((int)iPacket); + break; + case 0x10B: + CUserLocal::OnBuffzoneEffect((int)iPacket); + break; + case 0x10C: + sub_982A60((int)iPacket); + break; + case 0x10D: + CUserLocal::OnTimeBombAttack(v19, (int)iPacket); + break; + case 0x10E: + CUser::OnPassiveMove(v19, (int)iPacket); + break; + case 0x10F: + CUserLocal::OnFollowCharacterFailed(iPacket); + break; + case 0x110: + CUserLocal::OnVengeanceSkillApply(iPacket); + break; + case 0x111: + v19[4547] = 1; + break; + case 0x112: + if ( dword_D0F980 ) + sub_7C7450((unsigned int *)dword_D0F980, iPacket); + break; + case 0x113: + sub_998B40(v19, (int)iPacket); + break; + case 0x114: + sub_982B60((int)iPacket); + break; + case 0x115: + sub_99E350((int)iPacket); + break; + case 0x116: + sub_5777A0(v19 + 4447, (int)iPacket); + break; + case 0x117: + CUserLocal::OnQuestGuideResult((int)iPacket); + break; + case 0x118: + sub_98DDC0((int)iPacket); + break; + case 0x119: + sub_98DF90(v19, (int)iPacket); + break; + case 0x11A: + sub_98F7B0((int)iPacket); + break; + case 0x11B: + sub_982C60((int)iPacket); + break; + case 0x11C: + CUserLocal::OnSkillCooltimeSet((int)iPacket); + break; + default: + return; + } + } + } + } + else + { + CUserPool::OnUserCommonPacket((_DWORD *)dword_D09584, a4, (int)iPacket); + } + } + else if ( (unsigned int)(a4 - 286) > 5 ) + { + if ( (unsigned int)(a4 - 292) <= 0x1A ) + { + switch ( a4 ) + { + case 0x124: + CMobPool::OnMobEnterField(iPacket); + break; + case 0x125: + CMobPool::OnMobLeaveField(iPacket); + break; + case 0x126: + CMobPool::OnMobChangeController(iPacket); + break; + case 0x131: + CMobPool::OnMobCrcKeyChanged(iPacket); + break; + default: + if ( (unsigned int)(a4 - 0x127) <= 0x16 ) + { + v24 = a3; + v23 = a2; + v13 = CInPacket::Decode4((int)iPacket); + v14 = (_DWORD *)sub_441250(v13); + if ( v14 ) + { + if ( a4 == 0x138 ) + { + CMob::OnEscortStopEndPermmision(v14); + } + else + { + switch ( a4 ) + { + case 0x127: + CMob::OnMove((int)iPacket); + break; + case 0x128: + CMob::OnCtrlAck(v14, (int)iPacket); + break; + case 0x12A: + CMob::OnStatSet(v14, (int)iPacket); + break; + case 0x12B: + CMob::OnStatReset(v14, (int)iPacket); + break; + case 0x12C: + CMob::OnSuspendReset(iPacket); + break; + case 0x12D: + CMob::OnAffected(iPacket); + break; + case 0x12E: + CMob::OnDamaged(iPacket); + break; + case 0x12F: + CMob::OnSpecialEffectBySkill(v14, (void **)iPacket); + break; + case 0x132: + CMob::OnHPIndicator(v14, (int)iPacket); + break; + case 0x133: + CMob::OnCatchEffect(iPacket); + break; + case 0x134: + CMob::OnEffectByItem(iPacket); + break; + case 0x135: + CMob::OnMobSpeaking(iPacket); + break; + case 0x136: + CMob::OnMobSkillDelay(v14, (int)iPacket); + break; + case 0x137: + CMob::OnEscortFullPath(v14, (int)iPacket); + break; + case 0x139: + CMob::OnEscortStopSay(v14, (int)iPacket); + break; + case 0x13A: + CMob::OnEscortReturnBefore(v14, iPacket); + break; + case 0x13B: + CMob::OnNextAttack(v14, (int)iPacket); + break; + case 0x13C: + CMob::OnMobTeleportRequest(v14, (int)iPacket); + break; + case 0x13D: + CMob::OnMobAttackedByMob(v14, (int)iPacket); + break; + default: + return; + } + } + } + } + break; + } + } + else if ( (unsigned int)(a4 - 319) > 7 ) + { + if ( (unsigned int)(a4 - 327) <= 2 ) + { + switch ( a4 ) + { + case 0x147: + CEmployeePool::OnEmployeeEnterField(dword_D0B9F0, a3, (int)iPacket); + break; + case 0x148: + CEmployeePool::OnEmployeeLeaveField(iPacket); + break; + case 0x149: + CEmployeePool::OnEmployeeMiniRoomBalloon((int)iPacket); + break; + } + } + else if ( (unsigned int)(a4 - 330) <= 2 ) + { + if ( a4 == 0x14A ) + { + CDropPool::OnDropEnterField((void *)dword_D0B990, (int)iPacket); + } + else if ( a4 == 0x14C ) + { + CDropPool::OnDropLeaveField((int)iPacket); + } + } + else if ( (unsigned int)(a4 - 333) <= 2 ) + { + switch ( a4 ) + { + case 0x14D: + v24 = 0; + v23 = 0; + v22 = 0; + v21 = 0; + v20 = dword_D0BA94; + v12 = (_DWORD *)sub_794940(); + sub_429CE0(v12, (int)&v20, 496); + sub_9F6190(v20, v21, v22, v23, v24); + break; + case 0x14E: + CMessageBoxPool::OnMessageBoxEnterField((void *)dword_D0BA94, (int)iPacket); + break; + case 0x14F: + CMessageBoxPool::OnMessageBoxLeaveField(iPacket); + break; + } + } + else if ( (unsigned int)(a4 - 336) <= 1 ) + { + if ( a4 == 0x150 ) + { + CAffectedAreaPool::OnAffectedAreaCreated((_DWORD *)dword_D0952C, (int)iPacket); + } + else if ( a4 == 0x151 ) + { + CAffectedAreaPool::OnAffectedAreaRemoved(iPacket); + } + } + else if ( (unsigned int)(a4 - 338) <= 1 ) + { + if ( a4 == 0x152 ) + { + CTownPortalPool::OnTownPortalCreated((void *)dword_D0BA98, (int *)iPacket); + } + else if ( a4 == 0x153 ) + { + CTownPortalPool::OnTownPortalRemoved(iPacket); + } + } + else if ( (unsigned int)(a4 - 340) <= 1 ) + { + if ( a4 == 0x154 ) + { + COpenGatePool::OnOpenGateCreated((void *)dword_D0BA9C, (int)iPacket); + } + else if ( a4 == 0x155 ) + { + COpenGatePool::OnOpenGateRemoved(iPacket); + } + } + else if ( (unsigned int)(a4 - 345) <= 3 ) + { + switch ( a4 ) + { + case 0x159: + CReactorPool::OnReactorChangeState((int)iPacket); + break; + case 0x15A: + CReactorPool::OnReactorMove((int)iPacket); + break; + case 0x15B: + CReactorPool::OnReactorEnterField((void *)dword_D0BA80, (int *)iPacket); + break; + case 0x15C: + CReactorPool::OnReactorLeaveField((int)iPacket); + break; + default: + return; + } + } + else if ( a4 == 0x176 ) + { + CScriptMan::OnPacket((_DWORD *)dword_D0BA90, (int)iPacket); + } + else if ( (unsigned int)(a4 - 414) <= 3 ) + { + v24 = a3; + v11 = dword_D0B85C; + switch ( a4 ) + { + case 0x19E: + CFuncKeyMappedMan::OnInit((int *)dword_D0B85C, (int)iPacket); + break; + case 0x19F: + sub_576ED0((_DWORD *)dword_D0B85C, (int)iPacket); + break; + case 0x1A0: + sub_576F00((_DWORD *)dword_D0B85C, (int)iPacket); + break; + case 0x1A1: + *(_DWORD *)(v11 + 1336) = CInPacket::Decode4((int)iPacket); + break; + default: + return; + } + } + else if ( (unsigned int)(a4 - 375) > 1 ) + { + if ( (unsigned int)(a4 - 380) > 1 ) + { + if ( (unsigned int)(a4 - 136) > 2 ) + { + if ( (unsigned int)(a4 - 139) <= 2 ) + { + switch ( a4 ) + { + case 0x8B: + CMapLoadable::OnSetBackEffect((int)iPacket); + break; + case 0x8C: + CMapLoadable::OnSetMapObjectVisible((int)iPacket); + break; + case 0x8D: + CMapLoadable::OnClearBackEffect((char *)(this - 8)); + break; + } + } + else if ( (unsigned int)(a4 - 377) > 1 ) + { + if ( a4 < 426 || a4 > 428 ) + { + if ( (unsigned int)(a4 - 429) <= 4 ) + { + v24 = a3; + v5 = dword_D09980; + switch ( a4 ) + { + case 0x1AE: + CBattleRecordMan::OnDotDamageInfo((_DWORD *)dword_D09980, (int)iPacket); + break; + case 0x1AF: + v6 = CInPacket::Decode1((int)iPacket); + *(_DWORD *)(v5 + 12) = v6; + if ( !v6 ) + { + CWvsContext::UI_Close(dword_D050C0, 0x23u); + *(_DWORD *)(v5 + 8) = 0; + } + break; + case 0x1B0: + sub_4707D0((_DWORD *)dword_D09980, (int)iPacket); + break; + } + } + else if ( (unsigned int)(a4 - 0x1B5) > 3 ) + { + if ( (unsigned int)(a4 - 0x1B9) > 3 ) + { + if ( (unsigned int)(a4 - 0x1BD) > 3 ) + { + if ( (unsigned int)(a4 - 0x156) <= 2 ) + { + switch ( a4 ) + { + case 0x156: + sub_581600((void *)dword_D0BAA0, (int *)iPacket); + break; + case 0x157: + sub_5812D0((int)iPacket); + break; + case 0x158: + sub_5805D0((int)iPacket); + break; + } + } + } + else + { + v10 = this - 8; + if ( *(_DWORD *)(v10 + 636) ) + (*(void (__thiscall **)(_DWORD, int, void *))(**(_DWORD **)(v10 + 636) + 60))( + *(_DWORD *)(v10 + 636), + a4, + iPacket); + } + } + else + { + v9 = this - 8; + if ( *(_DWORD *)(v9 + 632) ) + (*(void (__thiscall **)(_DWORD, int, void *))(**(_DWORD **)(v9 + 632) + 60))( + *(_DWORD *)(v9 + 632), + a4, + iPacket); + } + } + else + { + v8 = dword_D0BAA4; + switch ( a4 ) + { + case 0x1B5: + CMapleTVMan::OnSetMessage(dword_D0BAA4, (int)iPacket); + break; + case 0x1B6: + *(_DWORD *)(dword_D0BAA4 + 8) = 0; + *(_DWORD *)(v8 + 12) = 1; + *(_DWORD *)(v8 + 744) = 0; + break; + case 0x1B7: + CMapleTVMan::OnSendMessageResult((int)iPacket); + break; + default: + return; + } + } + } + } + else + { + CAdminShopDlg::OnPacket((int *)a4, (int)iPacket); + } + } + else + { + CStage::OnPacket((char *)this, a4, (int)iPacket); + } + } + else + { + CStoreBankDlg::OnPacket((int *)a4, (int)iPacket); + } + } + else + { + CShopDlg::OnPacket(a4, (int)iPacket); + } + } + else + { + CNpcPool::OnPacket(a2, (_DWORD *)dword_D0BA88, a4, (char *)iPacket); + } + } + else + { + v24 = a3; + v23 = a2; + v15 = (void *)dword_D0BA84; + v16 = CInPacket::Decode4((int)iPacket); + switch ( a4 ) + { + case 0x11E: + CSummonedPool::OnCreated(v15, v16, (char *)iPacket); + break; + case 0x11F: + CSummonedPool::OnRemoved(v16, (int)iPacket); + break; + case 0x120: + CSummonedPool::OnMove(v16, (int)iPacket); + break; + case 0x121: + CSummonedPool::OnAttack(v16, iPacket); + break; + case 0x122: + CSummonedPool::OnSkill(v16, iPacket); + break; + case 0x123: + CSummonedPool::OnHit(v16, (int)iPacket); + break; + default: + return; + } + } + } + } + else if ( a4 == 0x18D ) + { + CParcelDlg::OnPacket((int)iPacket); + } + else + { + switch ( a4 ) + { + case 0x8E: + CField::OnTransferFieldReqIgnored((int *)iPacket); + break; + case 0x8F: + CField::OnTransferChannelReqIgnored((int)iPacket); + break; + case 0x90: + CField::OnFieldSpecificData((void *)(this - 8), (int)iPacket); + break; + case 0x91: + CField::OnGroupMessage((int)iPacket); + break; + case 0x92: + CField::OnWhisper((LONG *)(this - 8), (int)iPacket); + break; + case 0x93: + CField::OnSummonItemInavailable((int)iPacket); + break; + case 0x94: + CField::OnFieldEffect((void *)(this - 8), (int)iPacket); + break; + case 0x95: + CField::OnFieldObstacleOnOff((int)iPacket); + break; + case 0x96: + CField::OnFieldObstacleOnOffStatus((int)iPacket); + break; + case 0x97: + CField::OnFieldObstacleAllReset((_DWORD *)(this - 8), (int)iPacket); + break; + case 0x98: + sub_5311D0((int)iPacket); + break; + case 0x99: + CField::OnBlowWeather((int)iPacket); + break; + case 0x9A: + CField::OnPlayJukeBox(this - 8, (int)iPacket); + break; + case 0x9B: + CField::OnAdminResult((int)iPacket); + break; + case 0x9C: + CField::OnQuiz((int)iPacket); + break; + case 0x9D: + CField::OnDesc((_DWORD *)(this - 8), (int)iPacket); + break; + case 0x9E: + (*(void (__thiscall **)(int, void *))(*(_DWORD *)(this - 8) + 36))(this - 8, iPacket); + break; + case 0xA1: + CField::OnSetQuestClear((int)iPacket); + break; + case 0xA2: + CField::OnSetQuestTime((int)iPacket); + break; + case 0xA3: + CField::OnSetObjectState((int)iPacket); + break; + case 0xA4: + v7 = *(_DWORD **)(this + 520); + if ( v7 ) + CWnd::Destroy(v7); + break; + case 0xA6: + CField::OnStalkResult((int)iPacket); + break; + case 0xA9: + CQuickslotKeyMappedMan::OnInit((int *)dword_D0B938, (int)iPacket); + break; + case 0xAA: + CField::OnFootHoldInfo((int)iPacket); + break; + case 0xAB: + CField::OnRequestFootHoldInfo((_DWORD *)(this - 8), (int)iPacket); + break; + case 0xAD: + sub_53B4F0((_DWORD *)(this - 8), iPacket); + break; + case 0xC0: + return; + case 0x171: + CField::OnHontaleTimer((char *)iPacket); + break; + case 0x173: + CField::OnChaosZakumTimer((char)iPacket); + break; + case 0x174: + CField::OnHontailTimer((char *)iPacket); + break; + case 0x175: + CField::OnZakumTimer((char *)iPacket); + break; + case 0x17B: + CTrunkDlg::OnPacket((int)iPacket); + break; + case 0x17E: + CRPSGameDlg::OnPacket((int)iPacket); + break; + case 0x17F: + CUIMessenger::OnPacket((char *)iPacket); + break; + case 0x180: + CMiniRoomBaseDlg::OnPacketBase((int)iPacket); + break; + default: + goto LABEL_42; + } + } +}" +A5diCJYd,MOK layout Thai u/ Pali,dksetiavan,JSON,Sunday 29th of October 2023 06:16:31 AM CDT,"OK_Layout_Begin +Name:Thai u/ Pali +๑๒๓๔๕๖๗๘๙๐ +ะาเพหคทชฑ +ฺิุปรกตจฏ +มนวลสย +!?"",.฿ฯ๏๚๛ + ๅโภงฆธฌฒ +อีูผญขถฉฐ +-ณฬ[MC:ฬฺห]ษศ +£¥€$%^&*()№ +~`{}\_-=|+«» +[]@#±/÷'""‹›. +…<>!;:?§, +1234567890 +qwertyuiop +asdfghjkl' +zxcvbnm +OK_Layout_End +" +p2EL3ZXj,MOK layout Thai u/ Sanskrit,dksetiavan,JSON,Sunday 29th of October 2023 06:15:47 AM CDT,"OK_Layout_Begin +Name:Thai u/ Sanskrit +๑๒๓๔๕๖๗๘๙๐ +ะาเพหคทชฑ +ฺิุปรกตจฏ +มนวลสย +!?"",.฿ฯ๏๚๛ +ํๅโภงฆธฌฒ +อีูผญขถฉฐ +-ณฤฦษศ +£¥€$%^&*()№ +~`{}\_-=|+«» +[]@#±/÷'""‹›. +…<>!;:?§, +1234567890 +qwertyuiop +asdfghjkl' +zxcvbnm +OK_Layout_End +" +VDDcCZAL,MOK layout Thai - Pattajoti,dksetiavan,JSON,Sunday 29th of October 2023 06:14:37 AM CDT,"OK_Layout_Begin +Name:Pattajoti +๒๓๔๕ู๗๘๙๐๑๖ +็ตยอร่ดมวแใฌ +้ทงกัีานเไขฺ +บปลหิคสะจพ +ฅฃ""-ุ๎ๅ฿๏๚๛ +๊ฤๆญษึฝซถฒฯฦ +๋ธำณ์ืผชโฆฑํ +ฎฏฐภ[MC:ั้]ศฮฟฉฬ +£¥€$%^&*()№ +~`{}\_-=|+«» +[]@#±/÷'""‹›. +…<>!;:?§, +1234567890 +qwertyuiop +asdfghjkl' +zxcvbnm +OK_Layout_End +" +NvUyDSnS,step motor_V3,bipping,C++,Sunday 29th of October 2023 06:13:15 AM CDT,"#include +#include +#include +#include + +//#define SDA A4 +//#define SLC A5 +#define NOTE_CS6 1109 +#define NOTE_DS6 1245 + +rgb_lcd lcd; + +// Variables globales +const int8_t (SWITCH_PIN) = 2; //interupteur à bascule +const int8_t(rouge) = 5; +const int8_t(vert) = 6; +const int8_t(orange) = 7; +const int8_t (DIR) = 8; +const int8_t (PUL) = 9; +const int8_t (ENA) = 10; +const int8_t BUZ = 11; // BUZzer +const int colorR = 255; +const int8_t colorG = 0; +const int8_t colorB = 0; +const int8_t NUM_TIMERS = 8; +const int8_t TIMER_SWITCH = 7; +const int8_t TIMER_LED_ORANGE = 0; +const int8_t TIMER_LED_VERT = 1; +const int8_t TIMER_LED_ROUGE = 3; +const int8_t TIMER_MOTOR = 2; +const int8_t TIMER_LCD_Origine = 4; +const int8_t TIMER_LCD_avance = 5; +const int8_t TIMER_LCD_toggle = 6; + +unsigned long previousTimers[8]; +unsigned long Nombres_de_pas = 0; + +const unsigned long NOMBRES_DE_PAS_MAX = 120000; +const unsigned long INTERVAL = 500; + +bool stat_switch = false; +bool sense = false; +bool Signal_PWM = false; +bool initOrigineExecuted = false; +bool functionExecuted = false; + + byte L[8] = { 0b00000, 0b11000, 0b01100, 0b00100, 0b01100, 0b10010, 0b10001, 0b00000 }; + +// Énumération pour les différents états +enum Etat { ETAT_ORIGINE, ETAT_AVANCE, ETAT_RETOUR }; + +Etat etatActuel; + +// ISR TIMER +ISR(TIMER1_COMPA_vect){ + if(Signal_PWM == true){ + toggle (PUL); + Nombres_de_pas++; + } + } + +//Les fonctions + +unsigned long potard() { + return map(analogRead(A0), 0, 1023, 11200, 11300); +} + +void toggle(int pin) { + digitalWrite(pin, !digitalRead(pin)); +} + +void checkTimerAndUpdate(unsigned long &previousTime, unsigned long interval, void (*func)()) { + if (micros() - previousTime >= interval) { + previousTime = micros(); + func(); + } +} + +void updateSwitchState(int SWITCH_PIN) { + stat_switch = digitalRead(SWITCH_PIN); +} + +void MOTORAction() { + toggle(PUL); + Nombres_de_pas--; +} + +void LED_VERTAction(const int8_t vert){ + toggle(vert); +} + +void LED_ORANGEAction(const int8_t orange) { + toggle(orange); +} + +void LED_ROUGEAction() { + static int i = 0; + static int8_t i_sens = 1; + analogWrite(rouge, i); + i = i + i_sens; + if(i >= 255) { + i_sens = -1; + } + if(i <= 0) { + i_sens = 1; + } +} + +void checkTimerBasedOnStat(bool stat_switch, unsigned long *previousTimers, unsigned long INTERVAL, void (*LED_VERTAction)(), void (*LED_ORANGEAction)()) { + if (stat_switch == true) { + checkTimerAndUpdate(previousTimers[TIMER_LED_VERT], INTERVAL, LED_VERTAction); + } + else { + checkTimerAndUpdate(previousTimers[TIMER_LED_ORANGE], INTERVAL, LED_ORANGEAction); + } +} + +void verifierConditionsArret(int SWITCH_PIN, const int8_t vert, rgb_lcd lcd, bool &sense, bool &Signal_PWM, bool &stat_switch, unsigned long &Nombres_de_pas, const unsigned long NOMBRES_DE_PAS_MAX) { + if(digitalRead(SWITCH_PIN) == LOW) { + stat_switch = false; + arreterTacheAvance(vert, lcd, sense, Signal_PWM); + } + else if(Nombres_de_pas >= NOMBRES_DE_PAS_MAX) { + arreterTacheAvance(vert, lcd, sense, Signal_PWM); + } +} + +void arreterTacheAvance(const int8_t vert, rgb_lcd lcd, bool &sense, bool &Signal_PWM) { + digitalWrite(vert, LOW); + lcd.clear(); + lcd.home(); + lcd.print(""toggle""); + sense = true; + Signal_PWM = false; +} + +void checkNombreDePas(unsigned long &Nombres_de_pas, bool &sense, bool &initOrigineExecuted, const int8_t orange, const int8_t vert) { + if(Nombres_de_pas == 0) { + sense = false; + initOrigineExecuted = false; + digitalWrite(orange, LOW); + digitalWrite(vert, LOW); + } +} + +void initOrigine(const int8_t orange, const int8_t vert, const int ENA, const int8_t rouge, int BUZ, bool &Signal_PWM) { + digitalWrite(orange, LOW); // éteint LED orange + digitalWrite(vert, LOW); // éteint LED vert + digitalWrite(ENA, HIGH); // moteur libre + digitalWrite(rouge, HIGH); // allumer une LED rouge + tone(BUZ, NOTE_CS6, 80); // note de musique + delay(100); // attend un peu + tone(BUZ, NOTE_DS6, 80); // note de musique + delay(100); // attend un peu + tone(BUZ, NOTE_DS6, 160); // note de musique + Signal_PWM = false; // ordre d'arrêt du moteur + delay(250); // attend un peu + digitalWrite(rouge, LOW); // éteint une LED rouge + + initOrigineExecuted = true; // Retourne vrai pour indiquer que l'initialisation a réussi +} + +void initAvance(int dir, const int8_t vert, const int8_t orange, const int8_t rouge, int ENA, rgb_lcd lcd, unsigned long &Nombres_de_pas) { + digitalWrite(DIR, LOW); // Tache sense de rotation + digitalWrite(vert, HIGH); // allumer LED temoin vert fix + digitalWrite(orange, LOW); // eteindre une LED orange + digitalWrite(rouge, LOW); // eteindre une LED rouge + lcd.clear(); // on efface tout + lcd.home(); // retour à la ligne + lcd.print(""Programme""); // affichage LCD ligne 1 ""programme principale"" + lcd.setCursor(1, 1); // + lcd.print(Nombres_de_pas); // + digitalWrite(ENA, LOW); // moteur sous tention + functionExecuted = true; +} + +void initToggle(int dir, const int8_t rouge, int ENA, rgb_lcd lcd, unsigned long &Nombres_de_pas) { + if (functionExecuted) { // si initAvanceState est true, alors initToggle peut s'exécuter + digitalWrite(DIR, HIGH); + digitalWrite(rouge, LOW); + digitalWrite(ENA, LOW); + lcd.clear(); + lcd.home(); + lcd.print(""toggle""); + lcd.setCursor(1, 1); + lcd.print(Nombres_de_pas); + functionExecuted = false; + } +} + +void LCD_OrigineAction(){ + // fonction qui gère l'affichage de l'écran LCD lorsque le bouton est relacher + // // + OCR1A = potard(); // met à jour la vitesse d'avance avec la valeur de potard + // // + lcd.clear(); // efface l'écran LCD + lcd.home(); // + lcd.print(""Origine""); // affichage LCD ligne 1 ""programme Origine"" + lcd.setCursor(1, 1); // + lcd.print(Nombres_de_pas); // affiche la valeur de Nombres_de_pas + lcd.setCursor(6, 1); // + lcd.print(potard()); // affichage la valauer de potard + lcd.createChar(1,L); // affiche un caractère personnalisé sur la seconde ligne. + lcd.setCursor(11, 1); // + lcd.write(byte(1)); +} + +void LCD_avanceAction(){ + // fonction qui gère l'affichage de l'écran LCD lorsque le moteur tourne + Signal_PWM = true; // met à jour la Signal_PWM pour activer le moteur + + lcd.clear(); // efface l'écran LCD + lcd.home(); // + lcd.print(""Programme""); // affiche ""Programme"" et ""Lambda"" sur la première ligne + lcd.setCursor(10, 0); // + lcd.print(""Lambda""); // + lcd.setCursor(1, 1); // + lcd.print(Nombres_de_pas); // affiche la valeur de Nombres_de_pas sur la seconde ligne + lcd.setCursor(10, 1); // + lcd.print(potard()); // affiche des informations sur la position et la vitesse sur la seconde ligne. + lcd.createChar(1,L); // + lcd.setCursor(15, 1); // + lcd.write(byte(1)); // + } + +void LCD_toggleAction(){ // fonction qui gère l'affichage alternatif de l'écran LCD entre l'affichage de la position actuelle et l'affichage de la position cible + + lcd.clear(); // efface l'écran LCD + lcd.home(); // + lcd.print(""toggle""); // affichage LCD ligne 1 ""toggle"" + lcd.setCursor(10, 0); // + lcd.print(""Lambda""); // + lcd.setCursor(1, 1); // + lcd.print(Nombres_de_pas); // affiche la position actuelle et la position cible sur la première ligne + lcd.setCursor(10, 1); // + lcd.print(potard()); // affiche des informations sur la position et la vitesse sur la seconde ligne. + lcd.createChar(1,L); // + lcd.setCursor(15, 1); // + lcd.write(byte(1)); // + digitalWrite(rouge, LOW); +} + +void etatUrgence(bool &Signal_PWM, const int PUL, const int ENA, const int8_t rouge) { + Signal_PWM = false; // ordre d'arrêt du moteur + digitalWrite(PUL, LOW); // arrêt des impulsions + digitalWrite(ENA, HIGH); // moteur hors tension + digitalWrite(rouge, HIGH); // allumer la LED rouge +} + +void updateEtatActuel(bool &stat_switch, unsigned long &Nombres_de_pas, bool &sense, Etat &etatActuel, const unsigned long NOMBRES_DE_PAS_MAX) { + if(stat_switch == false && Nombres_de_pas == 0 && sense == false){ + etatActuel = ETAT_ORIGINE; + } + if (Nombres_de_pas < NOMBRES_DE_PAS_MAX && stat_switch == true && sense == false){ + etatActuel = ETAT_AVANCE; + } + if(sense == true && Nombres_de_pas > 0){ + etatActuel = ETAT_RETOUR; + } +} + + +void setup() { + + Serial.begin(115200); // ça pulse à 115 200 Hertz + lcd.begin(16, 2); // set up the LCD's number of columns and rows: + lcd.setRGB(colorR, colorG, colorB); // + lcd.print(""initialization""); // Print a message to the LCD. + + pinMode(orange, OUTPUT); // LED orange + pinMode(vert, OUTPUT); // LED vert + pinMode(rouge, OUTPUT); // LED rouge + + pinMode(A0, INPUT); // potentiomètre A0 + pinMode(SWITCH_PIN, INPUT_PULLUP); // configurer la pin 8 comme sortie pour contrôler la direction du moteur + pinMode(DIR, OUTPUT); // direction du moteur + pinMode(PUL, OUTPUT); // vitesse du moteur la frecence est de ~177.77hz + pinMode(ENA, OUTPUT); // frein du moteur >> relaché à l'état haut<< mode automatique à l'état bas>> + pinMode(BUZ, OUTPUT); // BUZzer en sortie 10 s'appel BUZ + + digitalWrite(BUZ, LOW); // broche 10 BUZzer + digitalWrite(SWITCH_PIN, HIGH); // bouton sur OFF + + digitalWrite(vert, HIGH); // eteint LED vert + digitalWrite(orange, HIGH); // allumer LED temoin orange fixe + digitalWrite(rouge, HIGH); // eteint LED rouge + + tone(BUZ, NOTE_DS6, 500); + + delay(500); // 1 seconde + + digitalWrite(vert, LOW); // eteint LED vert + digitalWrite(rouge, LOW); // eteint LED rouge + digitalWrite(orange, LOW); // allumer LED temoin orange fixe + + + previousTimers[TIMER_LCD_toggle] = micros(); // initialiser les valeurs à l'heure courante + previousTimers[TIMER_LCD_avance] = micros(); // initialiser les valeurs à l'heure courante + previousTimers[TIMER_LCD_Origine] = micros(); // initialiser les valeurs à l'heure courante + previousTimers[TIMER_LED_ORANGE] = millis(); // initialiser les valeurs à l'heure courante + previousTimers[TIMER_LED_VERT] = millis(); // initialiser les valeurs à l'heure courante + previousTimers[TIMER_LED_ROUGE] = micros(); // initialiser les valeurs à l'heure courante + previousTimers[TIMER_SWITCH] = micros(); // initialiser les valeurs à l'heure courante + + previousTimers[TIMER_MOTOR] = micros(); // initialiser les valeurs à l'heure courante + + Etat etatActuel = ETAT_ORIGINE; + + + TCCR1A = 0; // configurer Timer1 pour utiliser l'OCR en mode CTC + TCCR1B = (1 << WGM12) | (1 << CS11); + + OCR1A = potard(); // configurer le registre de comparaison de sortie pour un certain nombre de pas + + TIMSK1 |= (1 << OCIE1A); // activer l'interruption associée à OCR1A + + delay(800); // attend un peu + + sei(); // activer les interruptions globales +} + +void loop() { + + checkTimerAndUpdate(previousTimers[TIMER_SWITCH], 250006, updateSwitchState); + + switch (etatActuel) { + case ETAT_ORIGINE: + if (!initOrigineExecuted) {initOrigine(orange, vert, ENA, rouge, BUZ, Signal_PWM);} + checkTimerAndUpdate(previousTimers[TIMER_LED_ROUGE], 10014, LED_ROUGEAction); + checkTimerAndUpdate(previousTimers[TIMER_LCD_Origine], 250006, LCD_OrigineAction); + + break; + + case ETAT_AVANCE: + if(!functionExecuted) {initAvance(DIR, vert, orange, rouge, ENA, lcd, Nombres_de_pas);} + checkTimerAndUpdate(previousTimers[TIMER_LCD_avance], 177797, LCD_avanceAction); + verifierConditionsArret(SWITCH_PIN, vert, lcd, sense, Signal_PWM, stat_switch, Nombres_de_pas, NOMBRES_DE_PAS_MAX); + break; + + case ETAT_RETOUR: + if (functionExecuted) {initToggle(DIR, rouge, ENA, lcd, Nombres_de_pas);} + checkTimerAndUpdate(previousTimers[TIMER_LCD_toggle], 298820, LCD_toggleAction); + checkTimerAndUpdate(previousTimers[TIMER_MOTOR], 3347, MOTORAction); + + checkTimerBasedOnStat(stat_switch, previousTimers, INTERVAL, LED_VERTAction, LED_ORANGEAction); + checkNombreDePas(Nombres_de_pas, sense, initOrigineExecuted, orange, vert); + break; + + default: //ETAT_URGENCE: + etatUrgence(Signal_PWM, PUL, ENA, rouge); + break; + } + + updateEtatActuel(stat_switch, Nombres_de_pas, sense, etatActuel, NOMBRES_DE_PAS_MAX); +} +" +8mMaMahm,MOK layout Hindko,dksetiavan,YAML,Sunday 29th of October 2023 06:08:36 AM CDT,"{ +""title"":""Hindko"", +""onScreen"":{ +""main"":[ +""ھ١٢٣٤٥٦٧٨٩٠"", +""ݩوےرتیَُِٓپ"", +""اسدڇگهجکلْ"", +""[SHIFT]ڈٹچڨبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""عغٚظطذصضزث"", +""ݨؤـڑ[MC:تھ]ئًٌٍ[MC:پھ]"", +""ءشࢿݬࣂحࣁقخّ"", +""[SHIFT]ࣀ[MC:ٹھ][MC:چھ]فࢾں[MC:ݩگ][DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞«»,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +u6JDKvig,MOK layout Arabi Malayalam 2,dksetiavan,YAML,Sunday 29th of October 2023 06:07:21 AM CDT,"{ +""title"":""Arabi Malayalam 2"", +""onScreen"":{ +""main"":[ +""يءزفقصطغذ"", +""[MC:َوْ][MC:َيْ]ا[MC:ِی][MC:ُو]بهگدجڊ"", +""[MC:ٗو][MC:ٝی]َُِپڔکتچڌ"", +""[SHIFT]ْٗٝمنولسی[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""ٓئًٌٍضظعث"", +""[MC:اَوْ][MC:اَيْ]آ[MC:اِي][MC:اُو][MC:بھ]ۼ[MC:گھ][MC:دھ][MC:جھ][MC:ڊھ]"", +""[MC:اٗو][MC:اٝی][MC:اَ][MC:اِ][MC:اُ][MC:پھ]ر[MC:کھ][MC:تھ][MC:چھ][MC:ڌھ]"", +""[SHIFT][MC:اٗ][MC:اٝ]ّژڹۺۻشڿ[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""1234567890"", +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞«»,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""١٢٣٤٥٦٧٨٩٠"", +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +hGu2BTVg,BTC Wallet Credentials have been reset,castlclass_20,GetText,Sunday 29th of October 2023 06:07:19 AM CDT,"Dear User +We have received a request to reset the login information for your Bitcoin wallet. If you did not make this request, please disregard this message. +Your new login credentials will be +slivnimapk:ZsANVg on 212.224.93.130 +You can connect via SSH . +Regards" +0ZVSQTUB,MOK layout Wadaad,dksetiavan,YAML,Sunday 29th of October 2023 06:05:19 AM CDT,"{ +""title"":""Wadaad"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""قو[MC:َِ]رتيَُِٗ"", +""اسدفگهجكل"", +""[SHIFT]زخڎْبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""آة[CO:2]ۆ[MC:رٙ][CO:1]ثئًٌٍ[CO:2]ۉ"", +""ءش[CO:2][MC:دٙ][CO:1]عغحصض[CO:2]ڸ"", +""[SHIFT]ذظطّٓ[CO:2][MC:ن࣪]ـ[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +355UQX21,MOK layout Tamajaq,dksetiavan,YAML,Sunday 29th of October 2023 06:04:44 AM CDT,"{ +""title"":""Tamajaq"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""قو[MC:يٰ]رتيَُِپ"", +""اسدفغهجکل"", +""[SHIFT]زخشْبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""١٢٣٤٥٦٧٨٩٠"", +""﷽ﷻﷺﷸطئًٌٍث"", +""ءصضةگحﷷﷶﷵ"", +""[SHIFT]ظع[MC:تْش]ّﷴﷳﷲ[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +WKufw50W,MOK layout Adamawa Fulfulde,dksetiavan,YAML,Sunday 29th of October 2023 06:04:09 AM CDT,"{ +""title"":""Adamawa Fulfulde"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""ٛوٜرتيَُِݠ"", +""اسدٮغحجكلْ"", +""[SHIFT][MC:نغ]شثࢩبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""[MC:ٛو]ة[MC:ٜی][MC:رّ]ظࢨ[MC:ُو][MC:ِي][MC:َا]ف"", +""ءصطࢡعهخقضّ"", +""[SHIFT]ًٌٍئ[MC:بٔ]ذز[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +ta7CFqwW,MOK layout Ajami Fula,dksetiavan,YAML,Sunday 29th of October 2023 06:02:46 AM CDT,"{ +""title"":""Ajami Fula"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""ٛوٜرتيَُِݠ"", +""اسدٮغحجكلْ"", +""[SHIFT][MC:نغ]شثࢩبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""[MC:ٛو]ة[MC:ٜٮٰ][MC:رّ]ظࢨ[MC:ُو][MC:ِي][MC:َا]ف"", +""ءصطࢡعهخقضّ"", +""[SHIFT]ًٌٍئ[MC:بٔ]ذز[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +8XSduqmH,MOK layout Ajami Hausa,dksetiavan,YAML,Sunday 29th of October 2023 06:02:07 AM CDT,"{ +""title"":""Ajami Hausa"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""عوٜرتیَُِڭ"", +""اسدفغهجكلْ"", +""[SHIFT]زشثڟبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""ظة[MC:ٰٜی]ـئۑًٌٍڨ"", +""ءشطڡڠحخقضّ"", +""[SHIFT]ذ[MC:ُو][MC:ِی][MC:َا]ٻ[MC:َوْ][MC:َیْ][DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +ankQ8ziB,MOK layout Ajami Swahili,dksetiavan,YAML,Sunday 29th of October 2023 06:01:05 AM CDT,"{ +""title"":""Ajami Swahili"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""ڈوٖرتيَُِپ"", +""اسدفڠهجكلْ"", +""[SHIFT]ز[MC:نݝ]چڤبنمھ[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""ٹۏۃظطئًٌٍث"", +""ءشذؤغحخقعّ"", +""[SHIFT]ژ[MC:نْڠ]ݝصضأإـ[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +zwTsvNZu,MOK layout Moroccan Arabic,dksetiavan,YAML,Sunday 29th of October 2023 05:59:41 AM CDT,"{ +""title"":""Moroccan Arabic"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""قوعرتيَُِپ"", +""اسدفڭهجكلْ"", +""[SHIFT]زخشڥبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""ةوضظطئًٌٍث"", +""ءصذـغحآأإّ"", +""[SHIFT]PV[MC:تش]ڨڤٓڜ[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +Z9m9BabP,Clan XP Calculation,mrnosuch,Python,Sunday 29th of October 2023 05:58:58 AM CDT,"#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +import sqlite3 +import datetime + +local_db_path = ""/home/pi/Scripts/blastardbot/bot.db"" # Prod +# local_db_path = ""/home/pi/Scripts/blastardbot/bot-dev.db"" # Dev + + +class UpdateData(): + + def __init__(self, player, slice_date): + + self.player = player + self.slice_date = slice_date + self.type = None + self.incremental = 0 + self.estimated = 0 + self.estimate_rate = None + self.calculated = 0 + self.kills = 0 + self.elapsed = 0 + + + +# What the columns mean: + +# XPClan: Clan XP direct from the API +# timeElapsed: seconds online in game for sample. +# clanXPincremental: amount of XP earned in sample, as calculated +# clanXPcalculated: total amount of clan XP earned as calculated +# clanXPestimated: calculated estimated XP for capped members +# clanXPestimateRate: this is either the rate used for clanXPestimated, or a rate equivalent to the calcuated rate. + + +# Queries + +# This query selects the samples that needs updating +SELECT_FUTURE_SLICES = ''' +SELECT player, date, timeElapsed, XPClan, killsNPC +FROM stats +WHERE clanXPtype is NULL and timeElapsed is NOT NULL +AND (clanXPdataStatus IS NULL or clanXPdataStatus != 'A') +ORDER BY player, date; +''' + +# This query selects the previous sample for a sample being processed +SELECT_PREV_SLICE = ''' +SELECT player, date, XPClan, clanXPtype, clanXPcalculated, timeElapsed, killsNPC +FROM stats +WHERE player = :player +AND date < :slice_date +AND clanXPtype != ""X"" +AND (clanXPdataStatus IS NULL or clanXPdataStatus != 'A') +ORDER BY date desc +LIMIT 1; +''' + +# Used to update the sample in the database +UPDATE_SLICE = ''' +UPDATE stats +SET clanXPtype = :type, + clanXPincremental = :incremental, + clanXPestimated = :estimated, + clanXPestimateRate = :estimate_rate, + clanXPcalculated = :calculated, + killsIncremental = :kills, + timeElapsed = :elapsed +WHERE player = :player +AND date = :slice_date; +''' + +# To determine the estimated XP rate for a member +SELECT_EST_RATE = ''' +SELECT + sum(clanXPestimateRate)/count(*) as 'estimated_rate' +FROM + stats +WHERE + player = :player +AND + date > + ( + SELECT + date(substr(max(date),1,10),'-90 days') + FROM + stats + WHERE + player=:player + AND + clanXPtype = ""I"" + AND + clanXPestimateRate IS NOT NULL + AND + date < :sample_date + ) +AND + date <= :sample_date +AND + clanXPestimateRate IS NOT NULL; +''' + + +### Config + +# For calcuation estimated rates, we only include samples covering 0:30 - 4:00 of game play +DURATION_MIN = 60*30 # 30 minutes +DURATION_MAX = 60*60*4 # 4 hours + +# Discount rates for estimated XP +NORMAL_DISC_RATE = 0.70 # Use this for elapsed time within MIN and MAX +ATYPICAL_DISC_RATE = 0.25 # Use this for elapsed time outside of MIN and MAX + + +# DB Utiity Functions + +def get_rec(cursor, query, query_opts=None): + + result = None + + if query_opts is not None: + cursor.execute(query, query_opts) + else: + cursor.execute(query) + + row = cursor.fetchone() + + if row is not None: + result = dict(row) + + return result + + +def query_db(cursor, query, query_opts=None): + + if query_opts is not None: + cursor.execute(query, query_opts) + else: + cursor.execute(query) + + +def get_next_rec(cursor): + + result = None + + row = cursor.fetchone() + + if row is not None: + result = dict(row) + + return result + + +def update_rec(cursor, query, update_opts=None): + + if update_opts is not None: + cursor.execute(query, update_opts) + else: + cursor.execute(query) + + +######################### +### +### START OF MAIN ROUTINE +### + + +# Open the database + +db = sqlite3.connect(f""file:{local_db_path}"", uri=True) +db.row_factory = sqlite3.Row + +# Start processing loop + + # Fetch player and date for a single first, oldest NULL clanXPtype row (TARGET_ROW) + # clanXPtype values: + # N New + # C Capped + # R Reset + # I Incremental (Normal) + # X No activity (no time online) + # Z Zero (no clan XP) + # B Bugged (no XP earned) + + # First stats are slice 2020-01-29-23 + + # Fetch single oldest clanXPtype row earlier than TARGET_ROW matching TARGET_ROW player + + # if none found, update TARGET_ROW with 0 earned, this is a baseline/first entry + + # if found, update TARGET_ROW with difference, if difference is 0 (non earned, check for CAP) + + +# Load last on data for players + +found = True +table_available = True + +cur = db.cursor() +update_cur = db.cursor() +prev_row_cur = db.cursor() +est_cur = db.cursor() + +query_db(cur, SELECT_FUTURE_SLICES) + +while found and table_available: + + result = get_next_rec(cur) + + if result is None: + + found = False + + else: + + player = result['player'] + pending_slice_date = result['date'] + clan_xp = result['XPClan'] + elapsed = result['timeElapsed'] + total_kills = result['killsNPC'] + + # These are the values we need to populate + + row_description = None + row_type = None + + update_data = UpdateData(player, pending_slice_date) + + if elapsed < 0: + elapsed = 0 # Correct for negative elapsed glitches + + update_data.elapsed = elapsed + + test_start = pending_slice_date + prev_result = get_rec(prev_row_cur, SELECT_PREV_SLICE, {'player': player, 'slice_date' : pending_slice_date}) + + if prev_result is not None: + + prev_calculated = prev_result['clanXPcalculated'] + prev_type = prev_result['clanXPtype'] + if prev_type == ""Z"": + prev_xp = prev_result['clanXPcalculated'] + else: + prev_xp = prev_result['XPClan'] + prev_kills = prev_result['killsNPC'] + + session_kills = total_kills - prev_kills + + update_data.kills = session_kills + + # Are we capped? Two ways to find out. + + # If the previous sample was capped and we have the same amount of XP as that, we are capped + # OR if we have the same XP as the previous row and we've spent time and had some kills (not perfect, but good enough) + + # Also there's a bug where some capped players go to zero and stay that way, and we need to flag + # them as capped and not just zero (which is otherwise a different bug) + + if (prev_xp == clan_xp or (clan_xp == 0 and prev_type == ""C"")) and elapsed > 0 and session_kills > 0 : + + if (clan_xp < 2000000000 and clan_xp >0) or elapsed < 0: + + update_data.type = ""B"" + row_description = ""Bugged"" + update_data.incremental = 0 + update_data.calculated = prev_calculated + + else: + + update_data.type = ""C"" + row_description = ""Capped"" + # We need to calculate ESTIMATED XP here. + + disc_rate = NORMAL_DISC_RATE + if elapsed < DURATION_MIN or elapsed > DURATION_MAX: + disc_rate = ATYPICAL_DISC_RATE + + est_result = get_rec(est_cur, SELECT_EST_RATE, {'sample_date' : update_data.slice_date, 'player': player}) + est_rate = int(est_result['estimated_rate'] * disc_rate) + est_xp = est_rate * elapsed + update_data.estimate_rate = est_rate + update_data.estimated = est_xp + update_data.incremental = 0 + update_data.calculated = prev_calculated + est_xp + + else: + + # Did someone get reset (leave and rejoin)? We can tell because the clan XP will drop below what it was (probably) + + if prev_xp > clan_xp: + + if clan_xp == 0: # If it's zero, this is just a ZERO row + + update_data.type = ""Z"" + row_description = ""Zero clan XP"" + update_data.incremental = 0 + update_data.calculated = prev_calculated + update_data.incremental + + else: # Otherwise we have a member who was reset (left/joined) + + update_data.type = ""R"" + row_description = ""Reset"" + update_data.incremental = clan_xp + update_data.calculated = prev_calculated + update_data.incremental + + else: + + # Was the player not online at all? + + if (elapsed == 0 or session_kills ==0) and (clan_xp - prev_xp) == 0: + + update_data.type = ""X"" + row_description = ""No activity"" + update_data.calculated = prev_calculated + + else: # There was some kind of activity for this sample + + update_data.type =""I"" + row_description = ""Incremental"" + update_data.incremental = clan_xp - prev_xp + update_data.calculated = prev_calculated + update_data.incremental + + # If this session is a more typical duration, we can calc the XP rate + if elapsed >= DURATION_MIN and elapsed <= DURATION_MAX: + # calculate xp rate + update_data.estimate_rate = int(update_data.incremental / elapsed) + + else: + + # This member is new (i.e. first sample for the player) + + update_data.type = ""N"" # New + row_description = ""New"" + session_kills = total_kills + update_data.incremental = clan_xp + update_data.calculated = clan_xp + update_data.kills = session_kills + prev_xp = 0 + + # We do not set an estimate_rate for new players + + display_rate = 0 # Just used for the console display + + if update_data.estimate_rate is not None: + display_rate = update_data.estimate_rate + + if update_data.estimated > 0: + xp_type=""est"" + xp_value = update_data.estimated + else: + xp_type=""inc"" + xp_value = update_data.incremental + + if update_data.type != ""X"": + + # We show samples with no activity without a linefeed on the console, so it's easier to read changes + print(f"" {player:<12}|{update_data.slice_date}|{update_data.type}|cxp: {clan_xp:>12,}|elap: {elapsed:>6,}|kills: {session_kills:>6,}|{xp_type} cxp: {xp_value:>11,}|calc cxp: {update_data.calculated:>12,}|est.rate: {display_rate:>6,}"") + + else: + + print(f"" {player:<12}|{update_data.slice_date}|{update_data.type}|cxp: {clan_xp:>12,}|elap: {elapsed:>6,}|kills: {session_kills:>6,}|{xp_type} cxp: {xp_value:>11,}|calc cxp: {update_data.calculated:>12,}|est.rate: {display_rate:>6,}"", end='\r', flush=True) + + # Save to the database! + update_rec(update_cur, UPDATE_SLICE, vars(update_data)) + + db.commit() + + # We commit after each update so that any contention + # on the database with a lock will fail immediately + # We don't want this process locking the database for any duration, + # since it can resume after failure without issue on a subsequent run + +db.close() +print("""") +print(""Complete."")" +Y0rbXWrd,MOK layout Polish Arabic 2,dksetiavan,YAML,Sunday 29th of October 2023 05:40:00 AM CDT,"{ +""title"":""Polish Arabic 2"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""آڤَرتِ[MC:ُو]يُپ"", +""اسدفڠه[MC:اُ]كلۤ"", +""[SHIFT]زإ[MC:تْس]ّبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""ءج[MC:تْش]ظطـئعْث"", +""[MC:ُنۤ]شذصضحخقوغ"", +""[SHIFT]ڟڑ[MC:تْش]ةًٌٍ[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +vLmiBagf,MOK layout Polish Arabic 1,dksetiavan,YAML,Sunday 29th of October 2023 05:39:23 AM CDT,"{ +""title"":""Polish Arabic 1"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""وَرتِ[MC:ُو]ي[MC:ُ]پ"", +""اسدفغحࢮقل"", +""[SHIFT]زخࢯْبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""ة[MC:َن]ظطءعئُـ"", +""[MC:َون]ثذصضه[MC:دڑ]كج"", +""[SHIFT]شڑچًٌٍّ[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +t0qiQn9c,Lekcja 7 - C#,Akaitori,C#,Sunday 29th of October 2023 05:21:38 AM CDT,"// ROZGRZEWKA +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace pierwiastki +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine(""Podaj symbol lub liczbę atomową pierwiastka: ""); + string danePierwiastka = Console.ReadLine(); + if (danePierwiastka == ""H"" || danePierwiastka == ""1"") + { + Console.WriteLine(""Szukany pierwiastek to Wodór.""); + } + else if (danePierwiastka == ""Li"" || danePierwiastka == ""3"") + { + Console.WriteLine(""Szukany pierwiastek to Lit.""); + } + else if (danePierwiastka == ""Mg"" || danePierwiastka == ""12"") + { + Console.WriteLine(""Szukany pierwiastek to Magnez.""); + } + else if (danePierwiastka == ""O"" || danePierwiastka == ""8"") + { + Console.WriteLine(""Szukany pierwiastek to Tlen.""); + } + else if (danePierwiastka == ""Au"" || danePierwiastka == ""79"") + { + Console.WriteLine(""Szukany pierwiastek to Złoto.""); + } + else + { + Console.WriteLine(""Podany pierwiastek nie występuje w tym programie.""); + } + Console.ReadLine(); + } + } +} + +//ZADANIE 1 - SKLEP +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace sklep +{ + internal class Program + { + static void Main(string[] args) + { + float cenaKlawiatury = 100f; + float cenaMyszy = 80f; + string kodPromocyjny = ""Gigant15""; + Console.WriteLine($""Witaj! \nWybierz numer interesująctego cię przedmiotu: \n"" + + $""1. Podświetlana klawiatura - {cenaKlawiatury:C}\n"" + + $""2. Mysz gamingowa - {cenaMyszy:C}""); + int wybor = int.Parse(Console.ReadLine()); + if (wybor == 1) + { + Console.WriteLine(""Podaj kod prmocyjny:""); + string kodKupca = Console.ReadLine(); + if (kodKupca == kodPromocyjny) + { + Console.WriteLine($""Do zapłaty {cenaKlawiatury * 0.85f}""); + } + else + { + Console.WriteLine($""Do zapłaty {cenaKlawiatury}""); + } + } + else if (wybor == 2) + { + Console.WriteLine(""Podaj kod prmocyjny:""); + string kodKupca = Console.ReadLine(); + if (kodKupca == kodPromocyjny) + { + Console.WriteLine($""Do zapłaty {cenaMyszy * 0.85f}""); + } + else + { + Console.WriteLine($""Do zapłaty {cenaMyszy}""); + } + } + else + { + Console.WriteLine(""Ten produkt nie istnieje""); + } + Console.ReadLine(); + } + } +} + +//ZADANIE 2 - QUIZ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace qiuz +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine(""Witaj w Quizie Gigantów!""); + int poprawneOdpowiedzi = 0; + bool czyGramyDalej = true; + char odpowiedz; + string pyt1 = ""Pytanie 1: Który z tych języków nie jest językiem programowania?""; + string odp1A = ""Java""; + string odp1B = ""Python""; + string odp1C = ""HTML""; + string odp1D = ""C#""; + string pyt2 = ""Pytanie 2: Który z podanych nie jest systemem operacyjnym?""; + string odp2A = ""Windows""; + string odp2B = ""Linux""; + string odp2C = ""Android""; + string odp2D = ""Microsoft""; + + Console.WriteLine(pyt1); + Console.WriteLine($""A: {odp1A}\n B: {odp1B}\n C: {odp1C}\n D: {odp1D}""); + Console.WriteLine(""Wybierz odpowiedź:""); + odpowiedz = char.Parse(Console.ReadLine()); + //gracz może wpisać małą lub wielką literę, więc odpowiedź zawsze warto zmienić na wielką + if (char.ToUpper(odpowiedz) == 'C') + { + poprawneOdpowiedzi++; + Console.WriteLine(""Brawo, gramy dalej! Naciśnij dowolny klawisz.""); + Console.ReadKey(); + Console.Clear(); //czyścimy konsolę + } + else + { + Console.WriteLine(""Niestety, prawidłowa odpowiedź to odpowiedź C. Naciśnij dowolny klawisz.""); + Console.ReadKey(); + Console.Clear(); //czyścimy konsolę + czyGramyDalej = false; + } + + if (czyGramyDalej) + { + Console.WriteLine(pyt2); + Console.WriteLine($""A: {odp2A}\n B: {odp2B}\n C: {odp2C}\n D: {odp2D}""); + Console.WriteLine(""Wybierz odpowiedź:""); + odpowiedz = char.Parse(Console.ReadLine()); + //gracz może wpisać małą lub wielką literę, więc odpowiedź zawsze warto zmienić na wielką + if (char.ToUpper(odpowiedz) == 'D') + { + poprawneOdpowiedzi++; + Console.WriteLine(""Brawo, gramy dalej! Naciśnij dowolny klawisz.""); + Console.ReadKey(); + Console.Clear(); //czyścimy konsolę + } + else + { + Console.WriteLine(""Niestety, prawidłowa odpowiedź to odpowiedź D. Naciśnij dowolny klawisz.""); + Console.ReadKey(); + Console.Clear(); //czyścimy konsolę + czyGramyDalej = false; + } + } + Console.WriteLine($""Udzieliłeś {poprawneOdpowiedzi} poprawnych odpowiedzi.""); + Console.ReadLine(); + } + } +} + +//ZADANIE 3 - Zgadywanka +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Zgadywanka +{ + public partial class Form1 : Form + { + // zmienne na liczbę prób i wylosowaną liczbę do odgadnięcia + int liczbaDoOdgadniecia; + int liczbProb = 0; + public Form1() + { + InitializeComponent(); + // tworzymy generator liczb losowych + Random random = new Random(); + // losujemy liczbę z zakresu 1-1000 + liczbaDoOdgadniecia = random.Next(1, 1001); + // ustawiamy liczbę w textboxie + txtProby.Text = liczbProb.ToString(); + } + + private void btnSprawdz_Click(object sender, EventArgs e) + { + // pobieramy podaną liczbę z textboxa + int podanaLiczba = int.Parse(txtLiczba.Text); + // zwiększamy liczbę prób o jeden + liczbProb++; + // ustawiamy nową liczbę w textboxie + txtProby.Text = liczbProb.ToString(); + // sprawdzamy czy liczba nie jest czasem większa od wylosowanej + if (podanaLiczba > liczbaDoOdgadniecia) + { + // wyświetlamy podpowiedź + MessageBox.Show(""Nie udało się, moja liczba jest mniejsza od podanej""); + } + // sprawdzamy czy liczba nie jest czasem mniejsza od wylosowanej + else if (podanaLiczba < liczbaDoOdgadniecia) + { + // wyświetlamy podpowiedź + MessageBox.Show(""Nie udało się, moja liczba jest większa od podanej""); + } + // w przeciwnym przypadku jest jest równa - czyli zgadliśmy + else + { + // wyświetlamy komunikat + MessageBox.Show(""Brawo udało Ci się odgadnąć wylosowaną liczbę""); + // zamykamy aplikację + Application.Exit(); + } + + } + } +} + +" +jnGwmsvE,MOK layout Chechen Arabic,dksetiavan,YAML,Sunday 29th of October 2023 05:12:39 AM CDT,"{ +""title"":""Chechen Arabic"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""قوەرتيَُِڤ"", +""اسدفگهجكل"", +""[SHIFT]ز[MC:ڔٜ]چۤبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""ڨ[MC:وٙ]ةظطیًٌٍث"", +""ءشذڢغحخڮع"", +""[SHIFT]ضڗڃآـّْ[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +XMk58qPb,Пособие/«Диаметр дерева»,Bobert0032,C++,Sunday 29th of October 2023 05:12:16 AM CDT,"#include +#include + +using namespace std; + +vector> G; // Храним граф в виде списка смежности: для каждой вершины сохраняем номера всех смежных с ней вершин +vector d; // d[v] = x означает, что расстояние до v-ой вершины равняется x + +void dfs(int v) { // dfs(v) посещает все вершины, достижимые из v-ой + for (int nxt : G[v]) { // Перебираем смежные с v-ой вершины + if (d[nxt] == -1) { // Если nxt-ая вершина ещё не посещена, то нужно запустить dfs от неё + d[nxt] = d[v] + 1; // Расстояние до nxt-ой вершины - это расстояние до v-ой решении + 1-о ребро, которое их соединяет + dfs(nxt); // Запускаем dfs из nxt-ой вершины + } + } +} + +void solve() { + int n; + cin >> n; // Считываем кол-во вершин + G.resize(n); + d.resize(n, -1); // Изначально заполняем массив расстояний -1, d[v] = -1 будет означать, что вершина ещё не посещена + for (int i = 0; i < n - 1; ++i) { // Итерируемся по рёбрам + int a, b; + cin >> a >> b; // Считываем концы i-го ребра + // Умееньшаем a и b на 1, так как в задаче нумерация вершин идёт с 1, а нам было бы проще, если бы она шла с 0 + a--; + b--; + // Так как граф неориентированный, то нужно добавить оба ребра: a->b, b->a + G[a].push_back(b); + G[b].push_back(a); + } + d[0] = 0; // Расстояние от 0-ой вершины до самой себя = 0 + dfs(0); // Запускаем обход в глубину из 0-ой вершины + int mx_v = 0; // mx_v - это вершина, до которой расстояние от 0-ой максимально + // Пусть изначально мы думаем, что максимальное расстояние достигается в 0-ой вершине + for (int i = 1; i < n; ++i) { // Перебираем вершину + if (d[i] > d[mx_v]) { // Если расстония от 0-ой вершины до i-ой больше, чем до mx_v-ой, то теперь самая ""дальняя"" вершина - это i + mx_v = i; // Указываем, что теперь самая ""дальняя"" вершина - это i + } + } + for (int i = 0; i < n; ++i) { // Сбрасываем значения массива расстояния + d[i] = -1; + } + d[mx_v] = 0; // Расстояние до mx_v-ой вершины до самой себя равняется 0 + dfs(mx_v); // Запускаем dfs из mx_v-ой вершины + int mx = -1; // mx - максимальное расстояние от mx_v, которое достигается в какой-то вершине + // Изначально делаем его равным -1, так как в таком случае оно точно обновится на какое-то, которое есть в графе + for (auto el : d) { // Итериумся по значениям массива расстояний + mx = max(mx, el); // Если текущее расстояние больше mx, то нужно указать, что текущее расстояние - это максмиальное + } + cout << mx; // Выводим диаметр +} + +int main() { + solve(); + return 0; +}" +ca2pvUZM,MOK layout Lezgi Arabic,dksetiavan,YAML,Sunday 29th of October 2023 05:11:49 AM CDT,"{ +""title"":""Lezgi Arabic"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""ڠوڅرتيَُِپ"", +""اسدفگهجكل"", +""[SHIFT]زڗڃخبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""قۊعظطئًٌٍڢ"", +""آصذءغحثةـ"", +""[SHIFT]ژضچۑّْٓ[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +zTM9NMuY,MOK layout Iske Imla,dksetiavan,YAML,Sunday 29th of October 2023 05:10:07 AM CDT,"{ +""title"":""İske İmlâ"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""قوعرتیَُِپ"", +""اسدفگهجكل"", +""[SHIFT]زڭچۋبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""ئةغظطيًٌٍث"", +""ءصذضࢰحخکآ"", +""[SHIFT]ژ[MC:نک]شـّْۤ[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +Jm9Z03Kk,MOK layout Yana Imla,dksetiavan,YAML,Sunday 29th of October 2023 05:09:21 AM CDT,"{ +""title"":""Yaña İmlâ"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""قوہرتیࢭئۇپ"", +""اسدفگهجكل"", +""[SHIFT]زڭچشبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""عࢱةظطيَُِث"", +""ءصذضغحخّْ"", +""[SHIFT]ژـًٌٍنم[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +3mQtFhMg,MOK layout Buri Wolio,dksetiavan,YAML,Sunday 29th of October 2023 05:06:44 AM CDT,"{ +""title"":""Buri Wolio"", +""onScreen"":{ +""main"":[ +""١٢٣٤٥٦٧٨٩٠"", +""ٚوࣹرتيَُِڤ"", +""اسدفڬهجكلْ"", +""[SHIFT]زڠچۑبنم[DEL]"", +""[TOOL][ALTGR:،][SPACE][][][SYM:.][ENTER]"" +], + +""shifted"":[ +""﷽ﷻﷺﷸﷷﷶﷵﷴﷳﷲ"", +""أةإظطئًٌٍڨ"", +""ءشڊـغحخقثّ"", +""[SHIFT]ذعصضڀنم[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""sym"":[ +""!@#$۞٪&*)(۝"", +""]}{\/_-=|+۩["", +""~؎﷼£¥€:؛'ʺ٭"", +""[SHIFT]؟…؏؞»«,.?[DEL]"", +""[LOCK][ALTGR:‍][SPACE][][][SYM:‌][ENTER]"" +], + +""altGr"":[ +""1234567890"", +"">‎‏‭‮‬‪‫ <"", +""°•ىـ−ٱۤ،﴾﴿;"", +""[SHIFT]ٰٖٜٗ؍٫٬‐۔[DEL]"", +""[LOCK][ALTGR:,][SPACE][][][SYM:.][ENTER]"" +]}} + " +pjKqnZ62,Untitled,dllbridge,C,Sunday 29th of October 2023 05:02:50 AM CDT," + +#include +using namespace std; + + +template +T foo(T t); + + + + +///////////////////////////////////////////////////// +int main() +{ + + cout << foo(3) << "" - "" << foo(3.0) << endl; + +} + + +template +///////////////////////////////////////////////////// +T foo(T t) +{ + + +return t/2; +} + + + + + + + + + + + + + + + +/* + +#include +using namespace std; + + + +int foo(int n); +double foo(double n); + + + +///////////////////////////////////////////////////// +int main() +{ + + cout << foo(3) << "" - "" << foo(3.0) << endl; + +} + + + +///////////////////////////////////////////////////// +int foo(int n) +{ + + +return n/2; +} + + + +///////////////////////////////////////////////////// +double foo(double f) // +{ + +return f/2; +} + + + + + +*/ + + + + + + + + + + + + + + + + + + + + + + + +/* +#include + + + +void foo(int n); + +///////////////////////////////////////////////////// +int main() +{ + + int n = 100; + + foo(n); + + printf(""n from matn = %d\n"", n); +} + + +////////////////////////////////////////////////////// +void foo(int n) +{ + + n = n - 77; +} + + + + +*/ + + + + + + + + + + + + + + +/* +#include +#include + +using namespace std; + + +////////////////////////////////////////////////////////////////////// +int main() +{ + + + queue animals; // create a queue of string + + + animals.push(""Cat""); // push elements into the queue + animals.push(""Dog""); + + cout << ""Queue: ""; + + + + + + while(animals.empty() != 1) // print elements of queue loop until queue is empty + { + + cout << animals.front() << "", ""; // print the element + + animals.pop(); // pop element from the queue + + } + + cout << endl; + + return 0; +} +*/ + + + + + +/* + +#include +#include +using namespace std; + + +void display_queue(queue q); // function prototype for display_queue utility +///////////////////////////////////////////////////// +int main() +{ + + + queue animals; // create a queue of string + + + animals.push(""Cat""); // push element into the queue + animals.push(""Dog""); + animals.push(""Fox""); + + cout << ""Initial Queue: ""; + display_queue(animals); + + + animals.pop(); // remove element from queue + + cout << ""Final Queue: ""; + display_queue(animals); + + return 0; +} + + + +///////////////////////////////////////////////// utility function to display queue +void display_queue(queue q) +{ + + while(q.empty() != 1) + { + cout << q.front() << "", ""; + q.pop(); + } + + cout << endl; +} +*/ + + + + + + + + + + + + + +/* + +#include // push() +#include // front() +using namespace std; // back() + + +//////////////////////////////////////////////////////////// +int main() // +{ + + queue nums; // create a queue of int + + for(int i = 0; i < 97; i++) + { + + nums.push(i+10); + } + + // // push element into the queue + // nums.push(2); + // nums.push(3); + + int front = nums.front(); // get the element at the front + int back = nums.back (); // get the element at the back + cout << ""First element: "" << front << endl; + cout << ""Last element: "" << back << endl; + + + +return 0; +} + + + +*/ + + + + + + + + + + + + + + + + + + + + + +/* + + +#include // push() +#include // size() +using namespace std; + +//////////////////////////////////////////////////////////// +int main() // +{ + + queue languages; // create a queue of string + + languages.push(""Python""); // push element into the queue + languages.push(""C++"" ); + languages.push(""Java"" ); + + int size = languages.size(); // get the size of the queue + cout << ""Size of the queue: "" << size; + +return 0; +} + + + + + +*/ + + + + + + + + + + + + + + +/* +#include +#include +using namespace std; + +//////////////////////////////////////////////////////////// +int main() +{ + + + queue languages; // create a queue of string + + cout << ""Is the queue empty? ""; + + + if(languages.empty()) cout << ""Yes"" << endl; + else cout << ""No"" << endl; + + + cout << ""Pushing elements..."" << endl; + + + languages.push(""Python""); // push element into the queue + languages.push(""C++"" ); + + cout << ""Is the queue empty? ""; + + int nSize; + + if(languages.empty()) // check if the queue is empty + { + cout << ""Yes""; + } + else + { + cout << ""No \t""; + nSize = languages.size(); // get the size of the queue + cout << ""Size of the queue: "" << nSize; + } + +return 0; +} + +*/ + + +// VECTOR /////////////////////////////////////////////////////////////////////////////////// + +/* +#include +#include +using namespace std; + +//////////////////////////////////////////////////////////// +int main() // +{ + + int arr[] = {51, 52, 53, 54, 55}; + + for(int i : arr) // foreach-öèêë + { + std::cout << i << ' '; + } + std::cout << std::endl; + + + std::vector vec = {1, 2, 3, 4, 5}; + + // for(const int& element : vec) + // for(int i : vec) +// { + // std::cout << i << "" ""; + // } + + + for(int i = 0; i < 3; i++) + { + cout << vec[i] << "" ""; + } + +return 0; +} +*/ + + + + + + + + + + + + + + + + + + + + + + + + + + + +/* +#include +#include +using namespace std; + + +//////////////////////////////////////////////////////////// +int main() // +{ + + vector vector1 = {71, 72, 73, 74, 75}; // initializer list + vector vector2 { 6, 7, 8, 9, 10}; // uniform initialization + + vector vector3(5, 12); // method 3 + + cout << ""vector1 = ""; + for(int i = 0; i < vector1.size(); i++) + { + cout << vector1[i] << "" ""; + } + + cout << ""\nvector2 = ""; + for(const int& i : vector2) // ranged loop + { + cout << i << "" ""; + } + + cout << ""\nvector3 = ""; + for(int i : vector3) // ranged loop + { + cout << i << "" ""; + } + +return 0; +} +*/ + + + +/* + + + +#include +#include +using namespace std; + + +//////////////////////////////////////////////////////////// +int main() // +{ + + vector num {1, 2, 3, 4, 5}; + + cout << ""Initial Vector: ""; + + for(const int& i : num) + { + cout << i << "" ""; + } + + num.push_back(6); // add the integers 6 and 7 to the vector + num.push_back(7); + + cout << ""\nUpdated Vector: ""; + + + for( int i : num) + { + cout << i << "" ""; + } + +return 0; +} + +*/ +/* + +#include +#include +using namespace std; + +//////////////////////////////////////////////////////////// +int main() // +{ + + vector num {1, 2, 3, 4, 5}; + + cout << ""Element at Index 0: "" << num.at(0) << endl; + cout << ""Element at Index 0: "" << num[1] << endl; + cout << ""Element at Index 2: "" << num.at(2) << endl; + cout << ""Element at Index 4: "" << num.at(4); + + return 0; +} + +*/ + + + +/* + +#include +#include +using namespace std; + + +////////////////////////////////////////////////////////// +int main() // +{ + + vector num {1, 2, 3, 4, 5}; + + cout << ""Initial Vector: ""; + + for(const int& i : num) + { + cout << i << "" ""; + } + + num.at(1) = 9; // change elements at indexes 1 and 4 + num[3] = 777; + num.at(4) = 7; + + // num.at(14) = 17; // Error + cout << ""\nUpdated Vector: ""; + + for(const int& i : num) + { + cout << i << "" ""; + } + +return 0; +} +*/ + + +/* + +#include +#include +using namespace std; + + +////////////////////////////////////////////////////////// +int main() // +{ + + vector prime_numbers{2, 3, 5, 7}; + + + cout << ""Initial Vector: ""; // initial vector + for(int i : prime_numbers) + { + cout << i << "" ""; + } + + + prime_numbers.pop_back(); // remove the last element + + + cout << ""\nUpdated Vector: ""; // final vector + for(int i : prime_numbers) + { + cout << i << "" ""; + } + +return 0; +} + +*/ + + + + + +" +9Dyg8U2n,Untitled,Josif_tepe,C++,Sunday 29th of October 2023 04:54:38 AM CDT,"#include + +using namespace std; + +int main() +{ + int x = 10; + double y = 5.67; + float z = 10.9; + + cout << x << endl; + cout << y << endl; + cout << z << endl; + return 0; +} +" +qT7qfGkj,Untitled,Josif_tepe,C++,Sunday 29th of October 2023 04:39:01 AM CDT,"#include + +using namespace std; + +int main() +{ + + + cout << ""My first C++ program"" << endl; + + return 0; +} +" +nP99pgYx,Untitled,ShadyDeus,Python,Sunday 29th of October 2023 04:33:41 AM CDT,"import os +import spotipy +from spotipy.oauth2 import SpotifyOAuth +from flask import Flask, request, redirect +from fuzzywuzzy import fuzz + +app = Flask(__name__) + +# Spotify API credentials +SPOTIPY_CLIENT_ID = 'XXX' +SPOTIPY_CLIENT_SECRET = 'XXX' +SPOTIPY_REDIRECT_URI = 'http://localhost:8888/callback' +SPOTIPY_SCOPE = 'user-library-read' + +# Plex music directory +PLEX_MUSIC_DIRECTORY = '\\\\shadyvault\\media\\Musik' + +sp_oauth = SpotifyOAuth(SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET, SPOTIPY_REDIRECT_URI, scope=SPOTIPY_SCOPE) + +@app.route(""/"") +def index(): + auth_url = sp_oauth.get_authorize_url() + print(f""Auth URL: {auth_url}"") # Print auth URL for debugging + return redirect(auth_url) + +@app.route(""/callback"") +def callback(): + print(""Callback received"") # Debug print + print(request.args) # Print request arguments for debugging + + # Check if the user has authorized the app + if 'code' not in request.args: + return ""Error: No authorization code received."" + + # Get an access token from Spotify + token_info = sp_oauth.get_access_token(request.args['code']) + if 'access_token' not in token_info: + return ""Error: No access token received from Spotify."" + + print(""Access token obtained"") # Debug print + + # Create a Spotify object using the access token + access_token = token_info['access_token'] + sp = spotipy.Spotify(auth=access_token) + + # Get user's liked tracks from Spotify + try: + results = sp.current_user_saved_tracks() + spotify_tracks = [item['track']['name'] for item in results['items']] + print(""Spotify tracks obtained"") # Debug print + except Exception as e: + print(f""Error retrieving Spotify tracks: {e}"") + return ""Error: Unable to retrieve Spotify tracks."" + + # Compare with local Plex music collection + missing_songs = [] + for root, _, files in os.walk(PLEX_MUSIC_DIRECTORY): + for file in files: + if file.endswith('.flac'): + local_track_path = os.path.join(root, file) + local_track_name = os.path.splitext(file)[0] + local_artist_album = os.path.basename(os.path.dirname(local_track_path)) + local_artist, local_album = local_artist_album.split('+') + local_track = f'{local_artist} - {local_track_name} ({local_album})' + + # Compare Spotify track names with local track names using fuzzy string matching + for spotify_track in spotify_tracks: + similarity_ratio = fuzz.token_sort_ratio(spotify_track, local_track) + print(f""Comparing: {spotify_track} and {local_track} - Ratio: {similarity_ratio}"") # Debug print + if similarity_ratio > 80: # Adjust the similarity threshold as needed + break + else: + missing_songs.append(local_track) + + # Print missing songs + print(""Missing Songs in Local Collection:"") + for song in missing_songs: + print(song) + + return ""Check your console for missing songs."" + +if __name__ == ""__main__"": + app.run(port=8888) +" +hnSLtCMm,PDF Gen,KisUJaniNA,Java,Sunday 29th of October 2023 04:20:51 AM CDT,"private void createPurchaseReceiptPDF() { + try { + // Get the current date and time to include in the file name + SimpleDateFormat sdf = new SimpleDateFormat(""yyyyMMdd_HHmmss""); + String currentDateTime = sdf.format(new java.util.Date()); + + // Define the file name + String fileName = ""purchase_receipt_"" + currentDateTime + "".pdf""; + + // Create a Document + Document document = new Document(); + + // Create a PdfWriter with the file name + PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(fileName)); + + // Open the document for writing + document.open(); + + // Set the background color of the document + PdfContentByte canvas = writer.getDirectContent(); + canvas.saveState(); + canvas.setColorFill(new BaseColor(45, 52, 71)); // Background color + canvas.rectangle(0, 0, document.getPageSize().getWidth(), document.getPageSize().getHeight()); + canvas.fill(); + canvas.restoreState(); + + // Create a BaseFont for a custom font (you need to provide the font file) + BaseFont consolasFont = BaseFont.createFont(""CONSOLA.TTF"", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); + BaseFont consolasFontBold = BaseFont.createFont(""CONSOLAB.TTF"", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); + + // Create a Font with the custom font and desired size + Font customFont18 = new Font(consolasFont, 12, Font.NORMAL, new BaseColor(204, 204, 204)); + Font customFontBold = new Font(consolasFontBold, 14, Font.NORMAL, new BaseColor(204, 204, 204)); + + // Add content to the document with the custom font + Paragraph title = new Paragraph(""Purchase Receipt"", customFont18); + document.add(Chunk.NEWLINE); + title.setAlignment(Element.ALIGN_CENTER); + document.add(title); + + document.add(new Paragraph(""Date: "" + new java.util.Date(), customFont18)); + document.add(new Paragraph(""Name: "" + usernameField.getText(), customFont18)); + document.add(Chunk.NEWLINE); // Add a newline to create space + + PdfPTable table = new PdfPTable(4); + table.setWidthPercentage(100); + + table.addCell(new PdfPCell(new Phrase(""Item Name"", customFontBold))); + table.addCell(new PdfPCell(new Phrase(""Item Price"", customFontBold))); + table.addCell(new PdfPCell(new Phrase(""Quantity"", customFontBold))); + table.addCell(new PdfPCell(new Phrase(""Total Price"", customFontBold))); + + for (int i = 0; i < jTable3.getRowCount(); i++) { + table.addCell(new PdfPCell(new Phrase(jTable3.getValueAt(i, 0).toString(), customFont18))); + table.addCell(new PdfPCell(new Phrase(jTable3.getValueAt(i, 1).toString(), customFont18))); + table.addCell(new PdfPCell(new Phrase(jTable3.getValueAt(i, 2).toString(), customFont18))); + table.addCell(new PdfPCell(new Phrase(jTable3.getValueAt(i, 3).toString(), customFont18))); + } + + document.add(table); + Paragraph total = new Paragraph(""Grand Total: "" + jTextField30.getText(), customFont18); + total.setAlignment(Element.ALIGN_RIGHT); + document.add(total); + // Close the document + document.close(); + } catch (Exception ex) { + ex.printStackTrace(); + } + }" +FPTzu7em,PowerShell with BingGPT: delete folders matching archive names,0utsidethebox,PowerShell,Sunday 29th of October 2023 04:17:04 AM CDT,"<# There is a folder c:\test that contains multiple files and folders. Create powershell code that deletes only the folders with names that match rar archives located in the same folder c:\test #> + +# Get the list of files and folders in c:\test +$items = Get-ChildItem -Path ""c:\test"" + +# Loop through each item +foreach ($item in $items) { + # Check if the item is a folder + if ($item.PSIsContainer) { + # Get the folder name + $folderName = $item.Name + # Check if there is a file with the same name and .rar extension + $rarFile = ""c:\test\"" + $folderName + "".rar"" + if (Test-Path -Path $rarFile) { + # Delete the folder + Remove-Item -Path $item.FullName -Recurse -Force + } + } +} +" +RnmQBaPj,Untitled,Lilyana93,Python,Sunday 29th of October 2023 04:09:36 AM CDT,"Budget = float(input()) +amount_video_card = int(input()) +amount_processor = int(input()) +amount_ram_memory = int(input()) + +n = amount_video_card * 250 +m = float((n * 0.35) * amount_processor) +p = float((n * 0.10) * amount_ram_memory) +discount = 0 +total = n + p + m + +if amount_video_card > amount_processor: + discount = total * 0.85 + +if Budget >= discount: + print(f""You have {Budget - discount:.2f} leva left!"") + +else: + print(f""Not enough money! You need {discount - Budget:.2f} leva more!"") + +" +KntQMNv9,PowerShell with ChatGPT: delete folders matching archive names,0utsidethebox,PowerShell,Sunday 29th of October 2023 04:01:27 AM CDT,"<# There is a folder c:\test that contains multiple files and folders. Create powershell code that deletes only the folders with names that match rar archives located in the same folder c:\test #> + +$folderPath = ""C:\test"" +$rarFiles = Get-ChildItem -Path $folderPath -Filter ""*.rar"" -File + +foreach ($rarFile in $rarFiles) { + $folderName = $rarFile.BaseName + $folderToDelete = Join-Path -Path $folderPath -ChildPath $folderName + + if (Test-Path -Path $folderToDelete -PathType Container) { + Remove-Item -Path $folderToDelete -Recurse -Force + Write-Host ""Deleted folder: $folderToDelete"" + } +} +" +NfrLmGeW,CSS project,moozxxx555,C++,Sunday 29th of October 2023 03:51:47 AM CDT,"@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,200;1,100;1,300&family=Noto+Sans:wght@500&family=Roboto:ital,wght@1,100;1,300&display=swap'); +* { + margin :0; + padding : 0; + box-sizing: border-box; + font-family: 'Montserrat', sans-serif; + text-decoration: none; +} + +nav{ + width : 100%; + height : 7vw; + background : #be4f0f +} + +.nav-container { + max-width: 90vw; + height : 100%; + margin : 0 auto; + display : flex; + justify-content: space-between; + align-items: center; +} + +.nav-container img { + width : 6vw; + height : 6vw; +} + +.logonav { + width : 10vw; + object-fit : contain; +} + +.nav-profile { + display : flex; + align-self : center; +} + +.nav-profile-name { + color :rgb(7, 7, 7); + font-size: 1.8vw; + font-weight: 800; + margin-right: 10px; +} +.fa-cart-shopping { + font-size: 2vw; + color :blanchedalmond; +} + +.nav-profile-cart { + position : relative; +} + +.cartcount { + position : absolute; + top : -10px; + right : -10px; + width : 25px; + height : 25px; + background-color: red; + border-radius: 50%; + display : flex; + justify-items: center; + justify-content: center; + color :aliceblue; +} + +.container { + width : 90vw; + margin : 0 auto; + display : flex; +} + +.sidebar { + width : 20%; + padding : 20px; + display : flex; + flex-direction: column; +} + +.product { + width : 80%; + padding : 10px; + display : grid; + grid-template-columns: repeat(4, 1fr); + grid-gap : 20px; +} + +.sidebar-search { + padding : 10px; + border : 2px solid transparent; + width : 100%; + outline : none; + border-radius: 10px; + background-color: #f2f2f2; + transition : 0.3s; + margin-bottom: 20px; + font-size: 1.2vw; +} + +.sidebar-search:focus { + border : 2px solid #9c1032; +} + +.sidebar-items { + background-color: #f2f2f2; + margin-bottom: 10px; + padding : 10px; + border-radius: 5px; + border: 1px solid #e5e5e5; + color:black; + transition : 0.3s; + font-size: 1.4vw; +} + +.sidebar-items:hover { + background-color: #e61b36; + color :#e5e5e5; +} + +.top-massage { + margin-left: -65vw; + font-weight: 900; + font-size: 1.5vw; +} + +.product-items { + cursor: pointer; + transition: 0.3s; +} + +.product-items:hover { + transform: scale(1.03); +} + +.product-img { + width : 100%; + height : 17vw; + object-fit: cover; + border-radius: 10px; +} + +.modal { + width : 100%; + height : 100%; + background : rgba(0,0,0,0.5); + position : fixed; + top : 0; + left : 0; + display : flex; + justify-content: center; + align-items: center; +} + +.modal-page { + min-width : 30vw; + max-width : 60vw; + max-height : 30vw; + background-color: #f2f2f2; + border-radius: 15px; + padding : 20px; + overflow: scroll; +} + +.modaldesc-content { + width : 100%; + display : flex; +} + +.modaldesc-detail { + margin-left: 20px; +} + +.modaldesc-img { + width : 20vw; + height : 20vw; + object-fit: cover; + border-radius: 10px; +} + +.btn-control { + display : flex; + justify-content: flex-end; +} + +.btn { + padding :10px 20px; + cursor: pointer; + border : none; + border-radius: 5px; + font-size: 1.2vw; + transition : 0.3s; +} + +.btn-buy { + background: linear-gradient(125deg , #e61b36 , #9c1032); + color :#f2f2f2; + margin-left: 10px; + border : none; +} + +.cartlist { + +} + +.cartlist-items { + width : 40vw; + margin-bottom: 10px; + display : flex; + justify-content: space-between; +} + +.cartlist-detail { + margin-top: 20px; +} + +.cartlist-left { + display : flex; +} + +.cartlist-right { + display : flex; + margin-top: 20px; +} + +.cartlist-left img { + width : 8vw; + height : 8vw; + object-fit: cover; + border-radius: 5px; + margin-right: 10px; +} + +.btnc { + width : 30px; + height : 30px; + border-radius: 50%; + display : flex; + justify-content: center; + align-items: center; + border : 1px solid #000; + cursor: pointer; +} + +.count { + font-size: 1.5vw; + margin: 0 20px; +} + +.product-img1 { + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img2 { + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img3 { + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img4 { + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img5 { + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img6 { + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img7 { + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img8 { + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img9 { + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img10 { + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img11{ + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} + +.product-img12{ + width : 15vw; + height : 15vw; + object-fit: contain; + margin-top: 8px; +} +" +WezjNV0j,TUTZ: get twitter view,Munfaqqiha,C++,Sunday 29th of October 2023 03:42:04 AM CDT,"###################################################################################################################################### +## BACA ATURAN PAKAI ################################################################################################################# +###################################################################################################################################### +## +## (01). Login ke akun twitter kesayangan bangbre, kwkwkwkwkw -:)). +## (02). Buka browser chrome >> dev tools (CTRL+SHIFT+I), klik tab ""Network. +## (03). Pada kolom ""filter"", ketik ""TweetDetail"" lalu buka salah satu link post status bangbre. +## (04). Klik kanan link yang muncul bertuliskan ""TweetDetail"" lalu pilih Copy >> Copy as PowerShell. +## (05). Paste salinan itu ke berkas teks bernama ""info.txt"" (untuk memudahkan proses, jangan simpan ke nama lain yach, kwkwkwkw). +## (06). Paste semua link tautan yang bangbre ingin cek view-nya ke dalam berkas bernama ""link.txt"" (pun untuk memudahkan proses). +## (07). Paste kode yang ada di bawah sampai akhir & simpan ke dalam berkas bernama ""view.ps1"" (ini juga untuk memudahkan proses). +## +## ..... Sambungan keterangan untuk cara pakai berada setelah kode di bawah, kwkwwkkww -:)). +## +###################################################################################################################################### +## COPY MULAI DARI SINI & JANGAN LUPA SIMPAN KE DALAM BERKAS BERNAMA: ""view.ps1"" ##################################################### +###################################################################################################################################### + +Remove-Item -Recurse -Force full.txt, view.txt 2>$null +$url = (gc -Path .\link.txt) | ? {$_.trim() -ne """" } +Write-Output """" +$pcs = 1 +foreach ($uri in $url) { + $num = ""{0:D3}."" -f $pcs + $ids = [System.IO.Path]::GetFileName($uri) + (gc -Path .\data.txt -Encoding UTF8) -replace '""', ""`n"" | sc -Path .\data.txt + $log=([regex]::Match((gc -Path .\data.txt | Select-String -Pattern 'is_translatable' -Context 0,7), ""\d+"")).Value + $log = $log | Select-Object -Last 1 + if (Select-String -Pattern 'k|m' -InputObject $log -Quiet) { + if (Select-String -Pattern 'k' -InputObject $log -Quiet) { + $multi = '1000' + } + elseif (Select-String -Pattern 'm' -InputObject $log -Quiet) { + $multi = '1000000' + } + + $views = $log -replace ""k|m"", """" + $multi = $multi + Write-Output ($views * $multi) + } + + # Write-Output ""$num $uri : $log views"" | Out-File -Append full.txt + Write-Output ""$num $uri : $(""{0:N0}"" -f [int]$log) views"" | Out-File -Append full.txt + Write-Output $log | Out-File -Append view.txt + gc full.txt | Select-Object -Last 1 + $pcs++ + Start-Sleep -Seconds 5 +} + +Write-Output """" | Tee-Object full.txt -Append +Write-Output ""JUMLAH LINK: $((gc link.txt | Where-Object { $_ -match 'http.*' }).Count)"" | Tee-Object full.txt -Append +# $multi = (gc view.txt) -join ' + ' | %{ Invoke-Expression $_ } +$multi = (gc view.txt) -join ' + ' +Write-Output ""PENJUMLAHAN: $multi"" | Tee-Object full.txt -Append +# $total = Invoke-Expression $multi +Write-Output ""TOTAL LIHAT: $(Invoke-Expression $multi | ForEach-Object { ""{0:N0}"" -f $_ })"" | Tee-Object full.txt -Append +Write-Output ""`nLog di atas terekam pula ke dalam berkas bernama """"full.txt"""" & """"view.txt"""" yang ada di direktori kerja.`n"" + +###################################################################################################################################### +## COPY BERAKHIR DI ATAS ITU & JANGAN LUPA SIMPAN KE DALAM BERKAS BERNAMA: ""view.ps1"" ################################################ +###################################################################################################################################### + +######## lanjutan dari aturan pakai di atas, kwwkwk :) +## +## (08). Sampai di sini, bangbre telah punya 3 berkas teks: +## +## 1. info.txt: berisi salinan kode dari devtools chrome. +## 2. link.txt: berisi salinan link post yang akan dicek. +## 3. view.ps1: berisi salinan kode yang berada di atas!. +## #. semuanya itu harus ditaruh ke dalam 1 folder yang sama supaya sukses. +## +## (09). Buka PowerShell (cari di start menu windows). Lalu arahkan (cd) ke dalam folder tempat ketiga .txt di atas. +## (10). Setelah bangbre memastikan 3 file itu, copas kode berikut ke layar PowerShell yang telah ter-cd ke folder dari 3 file .txt: + +$log=(gc -Path .\info.txt); @($log | Select-String -Pattern '\$session' | Select-Object -SkipLast 1) + (gc -Path .\vew.ps1) | sc -Path .\vew.ps1; $log -replace '\/json""', '$0 -OutFile data.txt | select Content | FL' -replace 'alTweetId*.+with_rux', 'alTweetId%22%3A%22${ids}%22%2C%22referrer%22%3A%22me%22%2C%22with_rux' -replace '""accept-encoding"".*""', '' | Select-String -Pattern 'Invoke' -Context 0,1000 | sc -Path .\info.txt;(gc -Path .\vew.ps1)|ForEach-Object {$_;if ($_ -match 'GetFileName'){(gc -Path .\info.txt) -replace [regex]::escape('>')}} | sc -Path .\vew.ps1 + +## (11). Terakhir, untuk mengetahui hasilnya, segera jalankan berkas ""view.ps1"". Caranya, copy lalu paste kode berikut pada layar PowerShell bangbre. + +Write-Host ""Pencet ENTER jika layar PowerShell ada di folder sekerip / CTRL+C untuk keluar"" -BackgroundColor Magenta; Read-Host | PowerShell -ExecutionPolicy Bypass -File vew.ps1 + +## Aksi menegangkan dari sekerip kita ini tonton di: http://www.geocities.ws/munfaqqiha/etc/getview.gif. Moga sakses yach bangbre. Amin, kwkwkwkwkw...hehehehe :-)) +" +VQj1HQdC,Find Function list,thetaz1009,Lua,Sunday 29th of October 2023 03:42:03 AM CDT,"local peripheralSide = ""back"" +local file = fs.open(""Function List.txt"", ""w"") +function monitorSearch() +local names = peripheral.getNames() +local i, name +for i, name in pairs(names) do +if peripheral.getType(name) == ""monitor"" then +test = name +return peripheral.wrap(name) +else +--return nil +end +end +end +local mon = monitorSearch() +local test = peripheral.isPresent(peripheralSide) +local x = 1 +local y = 1 +mon.write(test) +mon.clear() +mon.setCursorPos(x,y) +for i,v in ipairs(peripheral.getMethods(peripheralSide)) +do mon.write(i.."". ""..v) +file.writeLine(i.."". ""..v..""()"") +y = y + 1 +mon.setCursorPos(x,y) +end +y = y + 1 +mon.write(peripheral.getType(peripheralSide)) +file.close()" +LLC8fXS8,Scroll Banter RP HTML (SAFEHOUSE),junijwi,HTML,Sunday 29th of October 2023 03:36:33 AM CDT," + +
+ {{%Post% + +
+

+ {{%Writer Name%}} - {{%Character Name%}} +

+
+ {{%Post Content% +

+ {{l%Paragraph%}} +

+ %end%}} +
+ + %end%}} + +
+" +wGdsXZjA,Scroll Banter RP HTML,junijwi,HTML,Sunday 29th of October 2023 03:19:42 AM CDT," + +
+ + +
+

+ Juni - Elisha +

+
+

+ ""Lorem ipsum dolor sit amet,"" consectetur adipiscing elit. Quisque efficitur ligula laoreet, laoreet elit vel, dictum libero. Curabitur cursus finibus ornare. Etiam nisi dui, mollis at rhoncus nec, malesuada a velit. Ut pulvinar velit eget neque congue bibendum. Vestibulum auctor orci eget euismod hendrerit. Sed quis arcu quis urna faucibus tempor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nullam turpis ipsum, bibendum vitae eros quis, iaculis convallis est. +

+

+ Suspendisse pharetra ultrices lorem. Aenean molestie mauris non blandit pellentesque. Fusce sollicitudin pretium enim, a iaculis urna scelerisque in. Curabitur a urna id lectus cursus aliquam eu eget erat. Cras suscipit enim eget dictum sodales. Nulla ut pellentesque sapien, id maximus erat. Maecenas non massa at diam vehicula volutpat. Morbi ultricies purus a sem imperdiet congue. +

+
+ + + +
+

+ Cory - Hastur

+
+

+ ""Aliquam dictum urna nisl,"" in lacinia eros finibus ut. Nulla elit lectus, ornare ut est sit amet, tempor sagittis elit. Vestibulum tempor ligula lacinia leo cursus fringilla. Nunc rutrum hendrerit volutpat. Curabitur dignissim suscipit dignissim. Suspendisse mattis condimentum sollicitudin. Quisque quis maximus ex. Etiam euismod massa mauris, vitae elementum arcu rutrum sit amet. +

+
+ + +
+" +jGXrczq2,Master craft loop,Typhonack,Lua,Sunday 29th of October 2023 03:01:35 AM CDT,"while true do + -- Run the ""craft"" program and redirect its output to a file + shell.run(""craft > craft_output.txt"") + + -- Read the output file + local craftOutput = """" + local file = fs.open(""craft_output.txt"", ""r"") + if file then + craftOutput = file.readAll() + file.close() + end + + -- Check if ""No crafting table found"" is in the output + if string.match(craftOutput, ""No crafting table found in front of the turtle."") then + -- Turn on the redstone signal to the right side + redstone.setOutput(""Left"", true) + break -- Exit the loop if the message is found + end + + + -- Run the ""craft2"" program + shell.run(""craft2"") + + -- Run the ""move"" program + shell.run(""move"") + + -- Add a delay before repeating + os.sleep(1) -- Adjust the sleep duration as needed +end +" +E3twwjhm,free website source code Pokémon trade and upload web almost finished 🔥,droui,HTML,Sunday 29th of October 2023 02:43:42 AM CDT,"
+
  • < --! POKEMON POST !-- > + +