text:
#include "HomeBudget.h"
#ifdef flagDEBUG
#include <Sql/sch_schema.h>
#endif
#include <Sql/sch_source.h>

#define TOPICFILE <HomeBudget/src.tpp/all.i>
#include <Core/topic_group.h>
#define TOPICFILE <HomeBudget/help.tpp/all.i>
#include <Core/topic_group.h>

#define IMAGEFILE <HomeBudget/HomeBudget.iml>
#define IMAGECLASS Images
#include <Draw/iml_source.h>

#define TFILE <HomeBudget/HomeBudget.t>
#include <Core/t.h>

int64 GetInsertedId()
{
	return sqlite3_last_insert_rowid(db);
}

struct ConvMonth : Convert
{
	Value Format(const Value &q) const
	{
		Date dt = (Date) q;
		return q.IsNull() ? "" : ::Format("%Month %.4d", dt.month, dt.year);
	}
};

struct ConvDouble : Convert
{
	Value Format(const Value &q) const
	{
		return q.IsNull() ? Null : ::Format("%.2f", q);
	}
};

struct DispPM : GridDisplay
{
	virtual void Paint(Draw &w, int x, int y, int cx, int cy, const Value &val, dword style,
			           Color &fg, Color &bg, Font &fnt, bool found, int fs, int fe)
	{
		if(!val.IsNull())
		{
			int t = int(val) < 0 ? 0 : 1;
			SetCenterImage(t ? Images::Plus : Images::Minus);
		}
		else
			SetCenterImage(Null);
		GridDisplay::Paint(w, x, y, cx, cy, Value(""), style, fg, bg, fnt, found, fs, fe);
	}

};

Date ScanDate(String &s)
{
	if(s.IsEmpty())
		return Null;
	int year  = atoi(s.Left(4));
	int month = atoi(s.Mid(5, 2));
	int day   = atoi(s.Right(2));

	return Date(year, month, day);
}

HomeBudget::HomeBudget()
{
	lang = 0;
}

void HomeBudget::Setup()
{
	CtrlLayout(*this, String(t_("Home budget")) + " 1.0");

	Icon(Images::SmallIcon());
	LargeIcon(Images::LargeIcon());

	tab.Add(money.SizePos(), t_("Expenses"));
	tab.Add(spl.Horz(groups, categories), t_("Categories"));
	spl.SetPos(2000);

	money.AddIndex(ID);
	money.AddColumn(CAT_ID, t_("Category")).Edit(category).SetConvert(category);
	money.AddColumn(PM, t_("Plus / Minus")).SetDisplay(Single<DispPM>()).NoConvertion().Edit(plusminus);
	money.AddColumn(VALUE, t_("Value")).Edit(val).Default(0).SetConvert(Single<ConvDouble>());
	money.AddColumn(DT, t_("When")).Edit(dt).Default(GetSysDate());
	money.AddColumn(DESC, t_("Describe")).Edit(es);
	money.Appending().Removing().Editing().Accepting().Canceling();
	money.RejectNullRow();
	money.WhenInsertRow = THISBACK(InsertMoney);
	money.WhenUpdateRow = THISBACK(UpdateMoney);
	money.WhenRemoveRow = THISBACK(RemoveMoney);
	money.SetToolBar();

	Date dt = GetSysDate();
	dt.day = 1;

	month.AddIndex(ID);
	month.AddColumn(DT, t_("Month")).Edit(months).SetConvert(Single<ConvMonth>()).Default(dt);
	month.Appending().Removing().Editing().Accepting().Canceling();
	month.WhenInsertRow = THISBACK(InsertDate);
	month.WhenUpdateRow = THISBACK(UpdateDate);
	month.WhenRemoveRow = THISBACK(RemoveDate);
	month.WhenChangeRow = THISBACK(ChangeDate);
	month.WhenAcceptRow = THISBACK(AcceptDate);
	month.WhenNewRow    = THISBACK(NewDate);
	month.SetToolBar();

	groups.AddIndex(ID);
	groups.AddColumn(NAME, t_("Name")).Edit(eg);
	groups.Appending().Removing().Editing().Accepting().Canceling();
	groups.RejectNullRow();
	groups.SetToolBar();
	groups.WhenInsertRow = THISBACK(InsertGroup);
	groups.WhenUpdateRow = THISBACK(UpdateGroup);
	groups.WhenRemoveRow = THISBACK(RemoveGroup);
	groups.WhenChangeRow = THISBACK(ChangeGroup);

	categories.AddIndex(ID);
	categories.AddColumn(NAME, t_("Name")).Edit(ec);
	categories.AddColumn(DEFVALUE, t_("Default value")).Edit(defval).SetConvert(Single<ConvDouble>());
	categories.AddColumn(PM, t_("Plus / Minus")).Edit(dlpm).SetConvert(dlpm).Default(-1);
	categories.AddColumn(INNEWMONTH, t_("Default for a new month")).Edit(yesno).SetConvert(yesno).Default(0);
	categories.WhenInsertRow = THISBACK(InsertCategory);
	categories.WhenUpdateRow = THISBACK(UpdateCategory);
	categories.WhenRemoveRow = THISBACK(RemoveCategory);
	categories.WhenModification = THISBACK(UpdateCategories);
	categories.Appending().Removing().Editing();
	categories.RejectNullRow();
	categories.SetToolBar();

	mostpr.AddColumn(t_("Name"));
	mostpr.AddColumn(t_("Amount")).SetConvert(Single<ConvDouble>()).AlignCenter();
	mostcat.AddColumn(t_("Name"));
	mostcat.AddColumn(t_("Amount")).SetConvert(Single<ConvDouble>()).AlignCenter();

	tabmost.Add(mostpr.SizePos(), t_("Product"));
	tabmost.Add(mostcat.SizePos(), t_("Category"));

	dlpm.Add(-1, t_("Minus")).Add(1, t_("Plus"));
	plusminus.Add(-1, t_("Minus")).Add(1, t_("Plus"));
	yesno.Add(0, t_("No")).Add(1, t_("Yes"));

	GenMonthList(dt.year);

	SQL & Delete(MONEY).Where(IsNull(CAT_ID));

	LoadDates();
	LoadGroups();

	UpdateCategories();

	if(month.GetCount() > 0)
	{
		month.GoEnd();
		UpdateSummary();
	}
	EnableMoney();
	Sizeable().Zoomable();

	category <<= THISBACK(UpdateValue);
	exit <<= THISBACK(Close);
	options <<= THISBACK(Options);
	about <<= THISBACK(About);
	newcat <<= THISBACK(NewCategory);
	help <<= THISBACK(Help);

	category.DropFocus();
	dlpm.DropFocus();
	months.DropFocus();
	yesno.DropFocus();

	newcat.SetImage(Images::SmallPlus());
	category.AddFrame(newcat);

	dosummary = true;
}

void HomeBudget::Serialize(Stream &s)
{
	int version = 1;
	s / version;
	SerializePlacement(s);
	s % spl;
	s % lang;
	//s % categories;
	//s % money;
}

void HomeBudget::GenMonthList(int year)
{
	months.Clear();
	for(int i = 0; i < 12; i++)
		months.Add(Date(year, i + 1, 1), Format("%Month %.4d", i + 1, year));
}

void HomeBudget::LoadMoney(int dtid)
{
	money.Clear();
	SQL & Select(ID, CAT_ID, PM, VALUE, DT, DESC).From(MONEY).Where(DT_ID == dtid);
	while(SQL.Fetch())
	{
		money.Add();
		money(ID) = SQL[ID];
		money(CAT_ID) = SQL[CAT_ID];
		money(PM) = SQL[PM];
		money(VALUE) = SQL[VALUE];
		money(DT) = ScanDate(String(SQL[DT]));
		money(DESC) = SQL[DESC];
	}
}

void HomeBudget::LoadDates()
{
	month.Clear();
	SQL & Select(ID, DT).From(DATES);
	while(SQL.Fetch())
		month.Add(SQL[0], ScanDate(String(SQL[1])));
}

void HomeBudget::LoadGroups()
{
	groups.Clear();
	SQL & Select(ID, NAME).From(GROUPS);
	while(SQL.Fetch())
		groups.Add(SQL);

	if(!groups.IsEmpty())
		groups.SetCursor(0);
	else
		categories.Disable();
}

void HomeBudget::LoadCategories(int group_id)
{
	categories.Clear();
	SQL & Select(ID, NAME, DEFVALUE, PM, INNEWMONTH).From(CATEGORIES).Where(GR_ID == group_id);
	while(SQL.Fetch())
		categories.Add(SQL);
}

int HomeBudget::GetCategorySign()
{
	SQL & Select(PM).From(CATEGORIES).Where(ID == money.Get(CAT_ID));
	Value v = SQL.Fetch() ? SQL[0] : 0;
	LOG(v);
	return v;
}

void HomeBudget::UpdateCategories()
{
	category.Clear();
	SQL & Select(ID.Of(CATEGORIES), NAME.Of(CATEGORIES), NAME.Of(GROUPS))
		.From(CATEGORIES, GROUPS)
		.Where(GR_ID == ID.Of(GROUPS))
		.OrderBy(NAME.Of(GROUPS), NAME.Of(CATEGORIES));

	while(SQL.Fetch())
		category.Add(SQL[0], Format("%s - %s", SQL[2], SQL[1]));
}

void HomeBudget::InsertGroup()
{
	SQL & Insert(GROUPS)
		(NAME, groups(1));
	groups(0) = GetInsertedId();

	categories.Clear();
	categories.Enable();
}

void HomeBudget::UpdateGroup()
{
	SQL & ::Update(GROUPS)
		(NAME, groups(1))
		.Where(ID == groups(0));
}

void HomeBudget::RemoveGroup()
{
	if(categories.IsEmpty())
	{
		SQL & Delete(GROUPS).Where(ID == groups(0));
	}
	else
	{
		PromptOK(t_("You can't remove this group. It is not empty."));
		groups.CancelRemove();
	}

	if(groups.GetCount() == 1)
		categories.Disable();
}

struct AddNewCat : WithNewCategoryLayout<TopWindow>
{
	typedef AddNewCat CLASSNAME;
	bool newgroup;

	AddNewCat()
	{
		newgroup = false;
		CtrlLayoutOKCancel(*this, t_("New item"));
		addgroup.SetImage(Images::SmallPlus());
		addgroup <<= THISBACK(NewGroup);
		groups <<= THISBACK(SelGroup);
		addgroup.NoWantFocus();

		int cnt = 0;
		try
		{
			SQL & Select(ID, NAME).From(GROUPS);
			while(SQL.Fetch())
			{
				groups.Add(SQL[0], SQL[1]);
				cnt++;
			}
		}
		catch(SqlExc &e)
		{
			Exclamation("[* " + DeQtfLf(e) + "]");
		}

		bool isgroup = cnt > 0;
		if(isgroup)
			groups.SetIndex(0);
		else
			ok.Disable();

		pm = 1;
	}

	void SelGroup()
	{
		ok.Enable();
	}

	void NewGroup()
	{
		WithNewGroupLayout<TopWindow> dlg;
		CtrlLayoutOKCancel(dlg, t_("New category"));
		if(dlg.Execute() == IDOK)
		{
			try
			{
				SQL & ::Insert(GROUPS)(NAME, ~dlg.name);
				int64 id = GetInsertedId();
				groups.Add(id, ~dlg.name);
				groups <<= id;
				ok.Enable();
				newgroup = true;
			}
			catch(SqlExc &e)
			{
				Exclamation("[* " + DeQtfLf(e) + "]");
			}
		}
	}
	bool IsNewGroup() { return newgroup; }
};

void HomeBudget::NewCategory()
{
	AddNewCat dlg;

	if(dlg.Execute() == IDOK)
	{
		SQL & ::Insert(CATEGORIES)
		    (GR_ID, ~dlg.groups)
			(NAME, ~dlg.name)
			(DEFVALUE, 0)
			(PM, dlg.pm == 0 ? 1 : -1)
			(INNEWMONTH, 0);

		int64 id = GetInsertedId();
		UpdateCategories();
		money.Set(CAT_ID, id);
		UpdateValue();

		int gid = ~dlg.groups;

		if(dlg.IsNewGroup())
		{
			groups.Add(Value(gid), dlg.groups.GetValue());
			groups.GoEnd();
			categories.Enable();
		}
		int c = groups.GetCursor();
		if(c >= 0 && gid == groups(c, 0))
			LoadCategories(gid);
	}
}

void HomeBudget::InsertCategory()
{
	SQL & Insert(CATEGORIES)
	    (GR_ID, groups(ID))
		(NAME, categories(NAME))
		(DEFVALUE, categories(DEFVALUE))
		(PM, categories(PM))
		(INNEWMONTH, categories(INNEWMONTH));

	categories(0) = GetInsertedId();
}

void HomeBudget::UpdateCategory()
{
	SQL & ::Update(CATEGORIES)
		(NAME, categories(NAME))
		(DEFVALUE, categories(DEFVALUE))
		(PM, categories(PM))
		(INNEWMONTH, categories(INNEWMONTH))
		.Where(ID == categories(ID));

	UpdateSummary();
}

void HomeBudget::ChangeGroup()
{
	LoadCategories(groups(ID));
}

void HomeBudget::RemoveCategory()
{
	SQL & ::Select(CAT_ID, NAME).From(MONEY, CATEGORIES).Where(CAT_ID == categories(ID) && ID.Of(CATEGORIES) == categories(ID)).Limit(1);
	if(SQL.Fetch())
	{
		PromptOK(Format(t_("Item '%s' can't be removed. It is used in calculations."), AsString(SQL[1])));
		categories.CancelRemove();
	}
	else
		SQL & ::Delete(CATEGORIES).Where(ID == categories(ID));
}

void HomeBudget::InsertMoney()
{
	SQL & ::Insert(MONEY)
		(DT_ID,  dtid)
		(CAT_ID, money(CAT_ID))
		(PM,     money(PM))
		(VALUE,  money(VALUE))
		(DT,     money(DT))
		(DESC,   money(DESC));

	money(ID) = GetInsertedId();

	//to trzeba robic tylko dla ostatniej kategori do automatycznego wstawienia
	if(dosummary)
		UpdateSummary();
}

void HomeBudget::UpdateMoney()
{
	SQL & ::Update(MONEY)
		(DT_ID,  dtid)
		(CAT_ID, money(CAT_ID))
		(PM,     money(PM))
		(VALUE,  money(VALUE))
		(DT,     money(DT))
		(DESC,   money(DESC))
		.Where(ID == money(ID));

	UpdateSummary();
}

void HomeBudget::RemoveMoney()
{
	SQL & ::Delete(MONEY).Where(ID == money(ID));
	UpdateSummary();
}

void HomeBudget::InsertDate()
{
	SQL & ::Insert(DATES)(DT, month(1));
	month(0) = dtid = (int) GetInsertedId();
	EnableMoney();
}

void HomeBudget::EnableMoney(int cnt)
{
	money.Enable(cnt < 0 ? month.GetCount() > 0 : cnt);
}

void HomeBudget::UpdateDate()
{
	SQL & ::Update(DATES)(DT, month(1)).Where(ID == month(ID));
}

void HomeBudget::RemoveDate()
{
	SQL.Begin();
	SQL & ::Delete(MONEY).Where(DT_ID == month(ID));
	SQL & ::Delete(DATES).Where(ID == month(ID));
	SQL.Commit();
	bool en = month.GetCount() <= 1 ? false : true;
	EnableMoney(en);
	if(!en)
		money.Clear();
}

void HomeBudget::ChangeDate()
{
	dtid = month(ID);
	LoadMoney(dtid);
	UpdateSummary();
	GenMonthList(((Date) month(DT)).year);
}

void HomeBudget::NewDate()
{
	money.Clear();
	UpdateSummary();
}

void HomeBudget::AcceptDate()
{
	if(!month.IsNewRow())
		return;

	dosummary = false;
	db.Begin();
	Sql sql(db);
	sql * Select(ID, DEFVALUE, PM).From(CATEGORIES).Where(INNEWMONTH == 1);
	while(sql.Fetch())
	{
		money.Add();
		money(CAT_ID) = sql[0];
		money(VALUE) = sql[1];
		money(PM) = sql[2];
		InsertMoney();
		money.RefreshNewRow();
	}
	db.Commit();
	dosummary = true;
	UpdateSummary();
}

void HomeBudget::UpdateSummary()
{
	if(!month.IsCursor())
		return;

	float p = 0, tp = 0;
	float m = 0, tm = 0;
	float r = 0, tr = 0;

	SQL & ::Select(PM, SqlSum(VALUE))
		.From(MONEY, DATES)
		.Where(DT.Of(DATES) < month(DT) && DT_ID == ID.Of(DATES) && NotNull(VALUE))
		.GroupBy(PM);

	while(SQL.Fetch())
	{
		int pm = SQL[PM];
		float v = (float) int(SQL[1]);
		if(pm < 0)
			tm = v;
		else
			tp = v;
	}

	tr = tp - tm;

	SQL & ::Select(PM, SqlSum(VALUE))
		.From(MONEY)
		.Where(DT_ID == dtid && NotNull(VALUE))
		.GroupBy(PM);

	while(SQL.Fetch())
	{
		int pm = SQL[PM];
		float v = (float) int(SQL[1]);
		if(pm < 0)
			m = v;
		else
			p = v;
	}

	mostpr.Clear();
	SQL & ::Select(NAME, SqlId("sum(value) as val"))
		.From(MONEY, CATEGORIES)
		.Where(DT_ID == dtid && CAT_ID == ID.Of(CATEGORIES) && PM.Of(MONEY) < 0)
		.GroupBy(CAT_ID)
		.OrderBy(Descending(SqlId("val")));

	while(SQL.Fetch())
		mostpr.Add(SQL);

	mostcat.Clear();
	SQL & ::Select(NAME.Of(GROUPS), SqlId("sum(value) as val"))
		.From(MONEY, GROUPS, CATEGORIES)
		.Where(DT_ID == dtid && PM.Of(MONEY) < 0 && CAT_ID == ID.Of(CATEGORIES) && GR_ID == ID.Of(GROUPS))
		.GroupBy(GR_ID)
		.OrderBy(Descending(SqlId("val")));

	while(SQL.Fetch())
		mostcat.Add(SQL);

	r = p - m;
	plus.SetText(Format("%.2f", p));
	minus.SetText(Format("%.2f", m));
	SetRest(rest, r);
	SetRest(prev_month, tr);
	SetRest(real_rest, r + tr);
}

void HomeBudget::ClearSummary()
{
	plus.SetText("");
	minus.SetText("");
	rest.SetText("");
	prev_month.SetText("");
	real_rest.SetText("");
	mostpr.Clear();
	mostcat.Clear();
}

void HomeBudget::SetRest(StaticText &rest, float r)
{
	if(r == 0)
	{
		rest.SetText("0.00");
		rest.SetInk(Black);
	}
	else if(r > 0)
	{
		rest.SetText(Format("+%.2f", r));
		rest.SetInk(Green);
	}
	else
	{
		rest.SetText(Format("%.2f", r));
		rest.SetInk(LtRed);
	}
}

void HomeBudget::UpdateValue()
{
	SQL & Select(DEFVALUE).From(CATEGORIES).Where(ID == money.Get(CAT_ID));
	Value v = SQL.Fetch() ? SQL[0] : 0;
	money.Set(VALUE, v);
	money.Set(PM, GetCategorySign());
}

void HomeBudget::Options()
{
	WithOptionsLayout<TopWindow> dlg;
	CtrlLayoutOK(dlg, t_("Options"));
	dlg.lang.Add(0, "English").Add(1, "Polski").SetIndex(lang);
	dlg.clear <<= THISBACK(ClearAll);
	if(dlg.Execute() != IDOK)
		return;
	lang = ~dlg.lang;
}

void HomeBudget::ClearAll()
{
	try
	{
		SQL & ::Delete(CATEGORIES);
		SQL & ::Delete(GROUPS);
		SQL & ::Delete(MONEY);
		SQL & ::Delete(DATES);
		//SQL.ExecuteX("VACUUM");

		LoadDates();
		LoadGroups();
		UpdateCategories();
		money.Clear();
		categories.Clear();
		EnableMoney();

		PromptOK(t_("Database was cleared"));
	}
	catch(SqlExc &e)
	{
		Exclamation("[* " + DeQtfLf(e) + "]");
	}
}

void HomeBudget::About()
{
	WithAboutLayout<TopWindow> dlg;
	CtrlLayoutCancel(dlg, t_("O programie"));
	dlg.info.NoSb();
	Size sz = dlg.info.GetSize();
	dlg.info.SetQTF(GetTopic(String("HomeBudget/src/About$") + (lang == 0 ? "en-us" : "pl-pl")), Zoom(150, 1400));
	dlg.info.SetZoom(Zoom(1, 1));
	dlg.Execute();
}

void HomeBudget::Help()
{
	PromptOK(t_("No help available yet"));
/*	HomeBudgetHelp dlg;
	dlg.AddTree(0, Images::Plus(), "HomeBudget/help/Introduction$pl-pl", "Wprowadzenie");
	dlg.AddTree(0, Images::Plus(), "HomeBudget/help/T0$pl-pl", "Instrukcja");
	dlg.AddTree(0, Images::Plus(), "HomeBudget/src/About$pl-pl", "ala");
	dlg.Execute();
*/
}

HomeBudgetHelp::HomeBudgetHelp()
{
}

Topic HomeBudgetHelp::AcquireTopic(const String& topic)
{
	Topic t;
	t = GetTopic(topic);
	t.text = (const char *) GetTopic(topic);
	//String path = topic;
	//if(FileExists(path))
	//	t.text = ReadTopic(LoadFile(path)) .text;
	return t;
}

//rozwiazac zapisywnie kolumn
GUI_APP_MAIN
{
	db.LogErrors(true);
	#ifdef flagDEBUG
	db.SetTrace();
	#endif

	#ifndef flagDEBUG
	FileIn fi("HomeBudget.db3");
	if(fi.IsError() || fi.GetSize() <= 0)
	{
		Exclamation(t_("Database file is corrupted"));
		return;
	}
	fi.Close();
	#endif

	if(!db.Open(ConfigFile("HomeBudget.db3")))
	{
		Exclamation(t_("Can't create or open database file"));
		return;
	}

	SQL = db;

	#ifdef flagDEBUG
	SqlSchema sch(SQLITE3);
	StdStatementExecutor se(db);
	All_Tables(sch);
	if(sch.ScriptChanged(SqlSchema::UPGRADE))
		Sqlite3PerformScript(sch.Upgrade(), se);
	if(sch.ScriptChanged(SqlSchema::ATTRIBUTES))
	{
		Sqlite3PerformScript(sch.Attributes(), se);
	}
	if(sch.ScriptChanged(SqlSchema::CONFIG))
	{
		Sqlite3PerformScript(sch.ConfigDrop(), se);
		Sqlite3PerformScript(sch.Config(), se);
	}
	sch.SaveNormal();
	#endif

	try
	{
		HomeBudget hb;

		LoadFromFile(hb);

		if(hb.lang == 0)
			SetLanguage(LNGC_('E','N','U','S', CHARSET_UNICODE));
		else
			SetLanguage(LNGC_('P','L','P','L', CHARSET_UNICODE));
		hb.Setup();
		hb.Run();
		StoreToFile(hb);
	}
	catch(SqlExc &e)
	{
		Exclamation("[* " + DeQtfLf(e) + "]");
	}

}


text:
package info.breezes.wordman.db;

import info.breezes.orm.annotation.Column;
import info.breezes.orm.annotation.Table;

/**
 * Created by jianxingqiao on 14-6-6.
 */
@Table(name = "word",comment = "单词表")
public class WordTable {
    @Column(length = 32,notNull = true,number = 1,primaryKey = true)
    public String id;
    @Column(length = 55,notNull = true,number = 2)
    public String word;
    @Column(length = 32,notNull = true,number = 3)
    public String classId;
    @Column(length = 255,notNull = true,comment = "音标",number = 4)
    public String phonic;
    @Column(length = 255,notNull = true,comment = "语音路径",number = 5)
    public String pron;
    @Column(length = 512,notNull = true,comment = "释义",number = 6)
    public String para;
    @Column(length = 512,notNull = true,comment = "构词法",number = 7)
    public String build;
    @Column(length = 1024,notNull = true,comment = "JSON格式例句",number = 8)
    public String example;
}

redpajama_set_name: RedPajamaGithub


text:
name: TensorFlow Lite Converter Issue
about: Use this template for reporting issues during model conversion to TFLite
labels: 'TFLiteConverter'

---

### 1. System information

- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- TensorFlow installation (pip package or built from source):
- TensorFlow library (version, if pip package or github SHA, if built from source):

### 2. Code

Provide code to help us reproduce your issues using one of the following options:

#### Option A: Reference colab notebooks

1)  Reference [TensorFlow Model Colab](https://colab.research.google.com/gist/ymodak/e96a4270b953201d5362c61c1e8b78aa/tensorflow-datasets.ipynb?authuser=1): Demonstrate how to build your TF model.
2)  Reference [TensorFlow Lite Model Colab](https://colab.research.google.com/gist/ymodak/0dfeb28255e189c5c48d9093f296e9a8/tensorflow-lite-debugger-colab.ipynb): Demonstrate how to convert your TF model to a TF Lite model (with quantization, if used) and run TFLite Inference (if possible).

```
(You can paste links or attach files by dragging & dropping them below)
- Provide links to your updated versions of the above two colab notebooks.
- Provide links to your TensorFlow model and (optionally) TensorFlow Lite Model.
```

#### Option B: Paste your code here or provide a link to a custom end-to-end colab

```
(You can paste links or attach files by dragging & dropping them below)
- Include code to invoke the TFLite Converter Python API and the errors.
- Provide links to your TensorFlow model and (optionally) TensorFlow Lite Model.
```

### 3. Failure after conversion
If the conversion is successful, but the generated model is wrong, then state what is wrong:

- Model produces wrong results and/or has lesser accuracy.
- Model produces correct results, but it is slower than expected.

### 4. (optional) RNN conversion support
If converting TF RNN to TFLite fused RNN ops, please prefix [RNN] in the title.

### 5. (optional) Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Messaging.ServiceBus.Amqp;
using Azure.Messaging.ServiceBus.Core;
using Azure.Messaging.ServiceBus.Diagnostics;
using Microsoft.Azure.Amqp;
using Microsoft.Azure.Amqp.Framing;
using Moq;
using NUnit.Framework;

namespace Azure.Messaging.ServiceBus.Tests.Amqp
{
    /// <summary>
    ///   The suite of tests for the <see cref="AmqpReceiver" />
    ///   class.
    /// </summary>
    ///
    [TestFixture]
    public class AmqpReceiverTests
    {
        /// <summary>
        ///   The set of test cases for respecting basic retry configuration.
        /// </summary>
        ///
        private static IEnumerable<object[]> RetryOptionTestCases()
        {
            yield return new object[] { new ServiceBusRetryOptions { MaxRetries = 3, Delay = TimeSpan.FromMilliseconds(1), MaxDelay = TimeSpan.FromMilliseconds(10), Mode = ServiceBusRetryMode.Fixed } };
            yield return new object[] { new ServiceBusRetryOptions { MaxRetries = 0, Delay = TimeSpan.FromMilliseconds(1), MaxDelay = TimeSpan.FromMilliseconds(10), Mode = ServiceBusRetryMode.Fixed } };
        }

        /// <summary>
        ///   Verifies functionality of the constructor.
        /// </summary>
        ///
        [Test]
        [TestCase(null)]
        [TestCase("")]
        public void ConstructorRequiresEntityName(string entityName)
        {
            Assert.That(() => new AmqpReceiver(
                entityPath: entityName,
                receiveMode: ServiceBusReceiveMode.PeekLock,
                prefetchCount: 0,
                connectionScope: Mock.Of<AmqpConnectionScope>(),
                retryPolicy: Mock.Of<ServiceBusRetryPolicy>(),
                identifier: "someIdentifier",
                sessionId: default,
                isSessionReceiver: default,
                isProcessor: false,
                messageConverter: Mock.Of<AmqpMessageConverter>(),
                cancellationToken: CancellationToken.None),
                Throws.InstanceOf<ArgumentException>());
        }

        /// <summary>
        ///   Verifies functionality of the constructor.
        /// </summary>
        ///
        [Test]
        public void ConstructorRequiresConnectionScope()
        {
            Assert.That(() => new AmqpReceiver(
                entityPath: "someQueue",
                receiveMode: ServiceBusReceiveMode.PeekLock,
                prefetchCount: 0,
                connectionScope: null,
                retryPolicy: Mock.Of<ServiceBusRetryPolicy>(),
                identifier: "someIdentifier",
                sessionId: default,
                isSessionReceiver: default,
                isProcessor: false,
                messageConverter: Mock.Of<AmqpMessageConverter>(),
                cancellationToken: CancellationToken.None),
            Throws.InstanceOf<ArgumentNullException>());
        }

        /// <summary>
        ///   Verifies functionality of the constructor.
        /// </summary>
        ///
        [Test]
        public void ConstructorRequiresTheRetryPolicy()
        {
            Assert.That(() => new AmqpReceiver(
                entityPath: "someQueue",
                receiveMode: ServiceBusReceiveMode.PeekLock,
                prefetchCount: 0,
                connectionScope: Mock.Of<AmqpConnectionScope>(),
                retryPolicy: null,
                identifier: "someIdentifier",
                sessionId: default,
                isSessionReceiver: default,
                isProcessor: false,
                messageConverter: Mock.Of<AmqpMessageConverter>(),
                cancellationToken: CancellationToken.None),
            Throws.InstanceOf<ArgumentNullException>());
        }

        /// <summary>
        ///   Verifies functionality of the <see cref="AmqpReceiver.CloseAsync"/>
        ///   method.
        /// </summary>
        ///
        [Test]
        public async Task CloseMarksTheReceiverAsClosed()
        {
            var receiver = CreateReceiver();

            Assert.That(receiver.IsClosed, Is.False, "The receiver should not be closed on creation");

            await receiver.CloseAsync(CancellationToken.None);
            Assert.That(receiver.IsClosed, Is.True, "The receiver should be marked as closed after closing");
        }

        /// <summary>
        ///   Verifies functionality of the <see cref="AmqpReceiver.ReceiveAsync" />
        ///   method.
        /// </summary>
        ///
        [Test]
        public void ReceiveAsyncRespectsTheCancellationTokenIfSetWhenCalled()
        {
            using var cancellationSource = new CancellationTokenSource();
            cancellationSource.Cancel();

            AmqpReceiver receiver = CreateReceiver();

            Assert.That(async () => await receiver.ReceiveMessagesAsync(
                100,
                default,
                cancellationSource.Token), Throws.InstanceOf<TaskCanceledException>());
        }

        /// <summary>
        /// <summary>
        ///   Verifies functionality of the <see cref="AmqpReceiver.ReceiveAsync" />
        ///   method.
        /// </summary>
        ///
        [Test]
        [TestCaseSource(nameof(RetryOptionTestCases))]
        public void ReceiveAsyncAppliesTheRetryPolicy(ServiceBusRetryOptions retryOptions)
        {
            var entityName = "entityName";
            var tokenValue = "123ABC";
            var retryPolicy = new BasicRetryPolicy(retryOptions);
            var retriableException = new ServiceBusException(isTransient: true, "Test");
            var mockCredential = new Mock<TokenCredential>();
            var mockScope = new Mock<AmqpConnectionScope>();
            uint prefetchCount = 0;
            var sessionId = "sessionId";
            bool isSession = true;

            using var cancellationSource = new CancellationTokenSource();

            mockCredential
                .Setup(credential => credential.GetTokenAsync(It.IsAny<TokenRequestContext>(), It.Is<CancellationToken>(value => value == cancellationSource.Token)))
                .Returns(new ValueTask<AccessToken>(new AccessToken(tokenValue, DateTimeOffset.MaxValue)));

            mockScope
               .Setup(scope => scope.OpenReceiverLinkAsync(
                   It.IsAny<string>(),
                   It.IsAny<string>(),
                   It.IsAny<TimeSpan>(),
                   It.IsAny<uint>(),
                   It.IsAny<ServiceBusReceiveMode>(),
                   It.IsAny<string>(),
                   It.IsAny<bool>(),
                   It.IsAny<CancellationToken>()))
               .Throws(retriableException);

            var receiver = new AmqpReceiver(entityName, ServiceBusReceiveMode.PeekLock, prefetchCount, mockScope.Object, retryPolicy, "someIdentifier", sessionId, isSession, false, Mock.Of<AmqpMessageConverter>(), CancellationToken.None);
            Assert.That(async () => await receiver.ReceiveMessagesAsync(
                100,
                default,
                cancellationSource.Token), Throws.InstanceOf<ServiceBusException>().And.Property(nameof(ServiceBusException.Reason)).EqualTo(ServiceBusFailureReason.GeneralError));

            mockScope
                .Verify(scope => scope.OpenReceiverLinkAsync(
                   It.IsAny<string>(),
                   It.IsAny<string>(),
                   It.IsAny<TimeSpan>(),
                   It.IsAny<uint>(),
                   It.IsAny<ServiceBusReceiveMode>(),
                   It.IsAny<string>(),
                   It.IsAny<bool>(),
                   It.IsAny<CancellationToken>()),
                Times.Exactly(1 + retryOptions.MaxRetries));
        }

        /// <summary>
        ///   Verifies functionality of the <see cref="AmqpReceiver.ReceiveAsync" />
        ///   method.
        /// </summary>
        ///
        [Test]
        [TestCaseSource(nameof(RetryOptionTestCases))]
        public void ReceiveAsyncConsidersOperationCanceledExceptionAsRetriable(ServiceBusRetryOptions retryOptions)
        {
            var entityName = "entityName";
            var tokenValue = "123ABC";
            var retryPolicy = new BasicRetryPolicy(retryOptions);
            var retriableException = new OperationCanceledException();
            var mockCredential = new Mock<TokenCredential>();
            var mockScope = new Mock<AmqpConnectionScope>();
            uint prefetchCount = 0;
            var sessionId = "sessionId";
            bool isSession = true;

            using var cancellationSource = new CancellationTokenSource();

            mockCredential
                .Setup(credential => credential.GetTokenAsync(It.IsAny<TokenRequestContext>(), It.Is<CancellationToken>(value => value == cancellationSource.Token)))
                .Returns(new ValueTask<AccessToken>(new AccessToken(tokenValue, DateTimeOffset.MaxValue)));

            mockScope
               .Setup(scope => scope.OpenReceiverLinkAsync(
                   It.IsAny<string>(),
                   It.IsAny<string>(),
                   It.IsAny<TimeSpan>(),
                   It.IsAny<uint>(),
                   It.IsAny<ServiceBusReceiveMode>(),
                   It.IsAny<string>(),
                   It.IsAny<bool>(),
                   It.IsAny<CancellationToken>()))
               .Throws(retriableException);

            var receiver = new AmqpReceiver(entityName, ServiceBusReceiveMode.PeekLock, prefetchCount, mockScope.Object, retryPolicy, "someIdentifier", sessionId, isSession, false, Mock.Of<AmqpMessageConverter>(), CancellationToken.None);
            Assert.That(async () => await receiver.ReceiveMessagesAsync(
                100,
                default,
                cancellationSource.Token), Throws.InstanceOf<ServiceBusException>().And.Property(nameof(ServiceBusException.Reason)).EqualTo(ServiceBusFailureReason.ServiceTimeout));

            mockScope
                .Verify(scope => scope.OpenReceiverLinkAsync(
                   It.IsAny<string>(),
                   It.IsAny<string>(),
                   It.IsAny<TimeSpan>(),
                   It.IsAny<uint>(),
                   It.IsAny<ServiceBusReceiveMode>(),
                   It.IsAny<string>(),
                   It.IsAny<bool>(),
                   It.IsAny<CancellationToken>()),
                Times.Exactly(1 + retryOptions.MaxRetries));
        }

        /// <summary>
        ///   Verifies functionality of the <see cref="AmqpReceiver.ReceiveAsync" />
        ///   method.
        /// </summary>
        ///
        [Test]
        [TestCaseSource(nameof(RetryOptionTestCases))]
        public void ReceiveAsyncAppliesTheRetryPolicyForAmqpErrors(ServiceBusRetryOptions retryOptions)
        {
            var entityName = "entityName";
            var tokenValue = "123ABC";
            var mockLogger = new Mock<ServiceBusEventSource>();
            var retryPolicy = new BasicRetryPolicy(retryOptions)
            {
                Logger = mockLogger.Object
            };
            var retriableException = new Error
            {
                Condition = AmqpClientConstants.ServerBusyError.ToString()
            }.ToMessagingContractException();
            var mockCredential = new Mock<TokenCredential>();
            var mockScope = new Mock<AmqpConnectionScope>();
            uint prefetchCount = 0;
            var sessionId = "sessionId";
            bool isSession = true;

            using var cancellationSource = new CancellationTokenSource();

            mockCredential
                .Setup(credential => credential.GetTokenAsync(It.IsAny<TokenRequestContext>(), It.Is<CancellationToken>(value => value == cancellationSource.Token)))
                .Returns(new ValueTask<AccessToken>(new AccessToken(tokenValue, DateTimeOffset.MaxValue)));

            mockScope
               .Setup(scope => scope.OpenReceiverLinkAsync(
                   It.IsAny<string>(),
                   It.IsAny<string>(),
                   It.IsAny<TimeSpan>(),
                   It.IsAny<uint>(),
                   It.IsAny<ServiceBusReceiveMode>(),
                   It.IsAny<string>(),
                   It.IsAny<bool>(),
                   It.IsAny<CancellationToken>()))
               .Throws(retriableException);

            var receiver = new AmqpReceiver(entityName, ServiceBusReceiveMode.PeekLock, prefetchCount, mockScope.Object, retryPolicy, "someIdentifier", sessionId, isSession, false, Mock.Of<AmqpMessageConverter>(), CancellationToken.None);
            Assert.That(async () => await receiver.ReceiveMessagesAsync(
                100,
                default,
                cancellationSource.Token), Throws.InstanceOf<ServiceBusException>().And.Property(nameof(ServiceBusException.Reason)).EqualTo(ServiceBusFailureReason.ServiceBusy));
            mockScope
                .Verify(scope => scope.OpenReceiverLinkAsync(
                   It.IsAny<string>(),
                   It.IsAny<string>(),
                   It.IsAny<TimeSpan>(),
                   It.IsAny<uint>(),
                   It.IsAny<ServiceBusReceiveMode>(),
                   It.IsAny<string>(),
                   It.IsAny<bool>(),
                   It.IsAny<CancellationToken>()),
                Times.Exactly(1 + retryOptions.MaxRetries));

            mockLogger
                .Verify(
                    log => log.RunOperationExceptionEncountered(It.IsAny<string>()),
                Times.Exactly(retryOptions.MaxRetries));
        }

        /// <summary>
        ///   Verifies functionality of the <see cref="AmqpReceiver.ReceiveAsync" />
        ///   method.
        /// </summary>
        ///
        [Test]
        public void ReceiveAsyncDetectsAnEmbeddedErrorForOperationCanceled()
        {
            var entityName = "entityName";
            var tokenValue = "123ABC";
            var retryPolicy = new BasicRetryPolicy(new ServiceBusRetryOptions());
            var exception = new OperationCanceledException("", new ArgumentNullException());
            var mockCredential = new Mock<TokenCredential>();
            var mockScope = new Mock<AmqpConnectionScope>();
            uint prefetchCount = 0;
            var sessionId = "sessionId";
            bool isSession = true;

            using var cancellationSource = new CancellationTokenSource();

            mockCredential
                .Setup(credential => credential.GetTokenAsync(It.IsAny<TokenRequestContext>(), It.Is<CancellationToken>(value => value == cancellationSource.Token)))
                .Returns(new ValueTask<AccessToken>(new AccessToken(tokenValue, DateTimeOffset.MaxValue)));

            mockScope
               .Setup(scope => scope.OpenReceiverLinkAsync(
                   It.IsAny<string>(),
                   It.IsAny<string>(),
                   It.IsAny<TimeSpan>(),
                   It.IsAny<uint>(),
                   It.IsAny<ServiceBusReceiveMode>(),
                   It.IsAny<string>(),
                   It.IsAny<bool>(),
                   It.IsAny<CancellationToken>()))
               .Throws(exception);

            var receiver = new AmqpReceiver(entityName, ServiceBusReceiveMode.PeekLock, prefetchCount, mockScope.Object, retryPolicy, "someIdentifier", sessionId, isSession, false, Mock.Of<AmqpMessageConverter>(), CancellationToken.None);
            Assert.That(async () => await receiver.ReceiveMessagesAsync(
                100,
                default,
                cancellationSource.Token), Throws.InstanceOf<ArgumentNullException>());

            mockScope
                .Verify(scope => scope.OpenReceiverLinkAsync(
                   It.IsAny<string>(),
                   It.IsAny<string>(),
                   It.IsAny<TimeSpan>(),
                   It.IsAny<uint>(),
                   It.IsAny<ServiceBusReceiveMode>(),
                   It.IsAny<string>(),
                   It.IsAny<bool>(),
                   It.IsAny<CancellationToken>()),
                Times.Once());
        }

        /// <summary>
        ///   Verifies functionality of the <see cref="AmqpReceiver.ReceiveAsync" />
        ///   method.
        /// </summary>
        ///
        [Test]
        public void ReceiveAsyncDetectsAnEmbeddedAmqpErrorForOperationCanceled()
        {
            var exception = new OperationCanceledException("", new AmqpException(new Error { Condition = AmqpClientConstants.ArgumentError }));
            var entityName = "entityName";
            var tokenValue = "123ABC";
            var retryPolicy = new BasicRetryPolicy(new ServiceBusRetryOptions());
            var mockCredential = new Mock<TokenCredential>();
            var mockScope = new Mock<AmqpConnectionScope>();
            uint prefetchCount = 0;
            var sessionId = "sessionId";
            bool isSession = true;

            using var cancellationSource = new CancellationTokenSource();

            mockCredential
                .Setup(credential => credential.GetTokenAsync(It.IsAny<TokenRequestContext>(), It.Is<CancellationToken>(value => value == cancellationSource.Token)))
                .Returns(new ValueTask<AccessToken>(new AccessToken(tokenValue, DateTimeOffset.MaxValue)));

            mockScope
               .Setup(scope => scope.OpenReceiverLinkAsync(
                   It.IsAny<string>(),
                   It.IsAny<string>(),
                   It.IsAny<TimeSpan>(),
                   It.IsAny<uint>(),
                   It.IsAny<ServiceBusReceiveMode>(),
                   It.IsAny<string>(),
                   It.IsAny<bool>(),
                   It.IsAny<CancellationToken>()))
               .Throws(exception);

            var receiver = new AmqpReceiver(entityName, ServiceBusReceiveMode.PeekLock, prefetchCount, mockScope.Object, retryPolicy, "someIdentifier", sessionId, isSession, false, Mock.Of<AmqpMessageConverter>(), CancellationToken.None);
            Assert.That(async () => await receiver.ReceiveMessagesAsync(
                100,
                default,
                cancellationSource.Token), Throws.InstanceOf<ArgumentException>());

            mockScope
                .Verify(scope => scope.OpenReceiverLinkAsync(
                    It.IsAny<string>(),
                    It.IsAny<string>(),
                    It.IsAny<TimeSpan>(),
                    It.IsAny<uint>(),
                    It.IsAny<ServiceBusReceiveMode>(),
                    It.IsAny<string>(),
                    It.IsAny<bool>(),
                    It.IsAny<CancellationToken>()),
                Times.Once());
        }

        /// <summary>
        ///   Verifies functionality of the <see cref="AmqpReceiver.ReceiveAsync" />
        ///   method.
        /// </summary>
        ///
        [Test]
        public void ReceiveAsyncDoesntRetryOnTaskCanceled()
        {
            var exception = new TaskCanceledException();
            var entityName = "entityName";
            var tokenValue = "123ABC";
            var retryPolicy = new BasicRetryPolicy(new ServiceBusRetryOptions());
            var mockCredential = new Mock<TokenCredential>();
            var mockScope = new Mock<AmqpConnectionScope>();
            uint prefetchCount = 0;
            var sessionId = "sessionId";
            bool isSession = true;

            using var cancellationSource = new CancellationTokenSource();

            mockCredential
                .Setup(credential => credential.GetTokenAsync(It.IsAny<TokenRequestContext>(), It.Is<CancellationToken>(value => value == cancellationSource.Token)))
                .Returns(new ValueTask<AccessToken>(new AccessToken(tokenValue, DateTimeOffset.MaxValue)));

            mockScope
               .Setup(scope => scope.OpenReceiverLinkAsync(
                   It.IsAny<string>(),
                   It.IsAny<string>(),
                   It.IsAny<TimeSpan>(),
                   It.IsAny<uint>(),
                   It.IsAny<ServiceBusReceiveMode>(),
                   It.IsAny<string>(),
                   It.IsAny<bool>(),
                   It.IsAny<CancellationToken>()))
               .Throws(exception);

            var receiver = new AmqpReceiver(entityName, ServiceBusReceiveMode.PeekLock, prefetchCount, mockScope.Object, retryPolicy, "someIdentifier", sessionId, isSession, false, Mock.Of<AmqpMessageConverter>(), CancellationToken.None);
            Assert.That(async () => await receiver.ReceiveMessagesAsync(
                100,
                default,
                cancellationSource.Token), Throws.InstanceOf<TaskCanceledException>());

            mockScope
                .Verify(scope => scope.OpenReceiverLinkAsync(
                    It.IsAny<string>(),
                    It.IsAny<string>(),
                    It.IsAny<TimeSpan>(),
                    It.IsAny<uint>(),
                    It.IsAny<ServiceBusReceiveMode>(),
                    It.IsAny<string>(),
                    It.IsAny<bool>(),
                    It.IsAny<CancellationToken>()),
                Times.Once());
        }

        private AmqpReceiver CreateReceiver() =>
            new AmqpReceiver(
                "someQueue",
                ServiceBusReceiveMode.PeekLock,
                0,
                Mock.Of<AmqpConnectionScope>(),
                Mock.Of<ServiceBusRetryPolicy>(),
                "someIdentifier",
                default,
                default,
                false,
                Mock.Of<AmqpMessageConverter>(),
                default);
    }
}


text:
"""
This file was automatically generated.
"""

import six

class forcedUser(object):

    def __init__(self, zap):
        self.zap = zap

    @property
    def is_forced_user_mode_enabled(self):
        """
        Returns 'true' if 'forced user' mode is enabled, 'false' otherwise
        """
        return six.next(six.itervalues(self.zap._request(self.zap.base + 'forcedUser/view/isForcedUserModeEnabled/')))

    def get_forced_user(self, contextid):
        """
        Gets the user (ID) set as 'forced user' for the given context (ID)
        """
        return six.next(six.itervalues(self.zap._request(self.zap.base + 'forcedUser/view/getForcedUser/', {'contextId': contextid})))

    def set_forced_user(self, contextid, userid, apikey=''):
        """
        Sets the user (ID) that should be used in 'forced user' mode for the given context (ID)
        """
        return six.next(six.itervalues(self.zap._request(self.zap.base + 'forcedUser/action/setForcedUser/', {'contextId': contextid, 'userId': userid, 'apikey': apikey})))

    def set_forced_user_mode_enabled(self, boolean, apikey=''):
        """
        Sets if 'forced user' mode should be enabled or not
        """
        return six.next(six.itervalues(self.zap._request(self.zap.base + 'forcedUser/action/setForcedUserModeEnabled/', {'boolean': boolean, 'apikey': apikey})))


text:
newshack [![Build Status](https://travis-ci.org/jrcryer/newshack.svg?branch=master)](https://travis-ci.org/jrcryer/newshack)
========


text:
from msrest.serialization import Model

class DetectedLanguage(Model):
    """Detect language result.

    :param detected_language: The detected language.
    :type detected_language: str
    :param status: The detect language status
    :type status:
     ~azure.cognitiveservices.vision.contentmoderator.models.Status
    :param tracking_id: The tracking id.
    :type tracking_id: str
    """

    _attribute_map = {
        'detected_language': {'key': 'DetectedLanguage', 'type': 'str'},
        'status': {'key': 'Status', 'type': 'Status'},
        'tracking_id': {'key': 'TrackingId', 'type': 'str'},
    }

    def __init__(self, detected_language=None, status=None, tracking_id=None):
        super(DetectedLanguage, self).__init__()
        self.detected_language = detected_language
        self.status = status
        self.tracking_id = tracking_id


text:
#pragma once

#include "DexClass.h"
#include "IRCode.h"
#include "LiveRange.h"
#include "ScopedCFG.h"
#include <cstdint>
#include <functional>
#include <queue>
#include <unordered_map>

namespace fastregalloc {

using vreg_t = uint16_t;

/*
 * Record the live interval (first def/use, last def/use) of a vreg. Also
 * include the vreg that owns each live interval, and the reg allocated to the
 * vreg (std::nullopt if not yet allocated).
 */
struct VRegLiveInterval {
  uint32_t start_point;
  uint32_t end_point;
  vreg_t vreg;
  std::optional<reg_t> reg{std::nullopt};
  bool operator<(const VRegLiveInterval& vreg_live_interval) const {
    if (end_point != vreg_live_interval.end_point) {
      return end_point < vreg_live_interval.end_point;
    }
    if (start_point != vreg_live_interval.start_point) {
      return start_point < vreg_live_interval.start_point;
    }
    // We might have live-interval with the same start- and end-points, due to
    // auxiliary live-intervals created to represent the check-cast quirk. We
    // disambiguate those last.
    return vreg < vreg_live_interval.vreg;
  }
};
/*
 * All virtual registers' live interval ordered by ascending first def insn idx
 * and ascending last use insn idx.
 */
using LiveIntervals = std::vector<VRegLiveInterval>;

/*
 * Group all defs and uses of a vreg.
 */
using Def = live_range::Def;
using Use = live_range::Use;
using VRegDefsUses =
    std::unordered_map<vreg_t, std::pair<std::vector<Def>, std::vector<Use>>>;

using WideVReg = std::unordered_set<vreg_t>;

/*
 * ActiveInterval, ordered first by start_point, and then by live_interval_idx.
 */
struct ActiveInterval {
  int32_t live_interval_idx;
  uint32_t start_point;
  bool operator<(const ActiveInterval& other) const {
    if (start_point != other.start_point) {
      return start_point < other.start_point;
    }
    return live_interval_idx < other.live_interval_idx;
  }
};

/*
 * Order active intervals by their first use insn idx, asc.
 */
using ActiveIntervals =
    std::priority_queue<ActiveInterval, std::vector<ActiveInterval>>;

struct LiveIntervalPoint {
  enum class Kind : uint8_t {
    MISSING,
    INSTRUCTION,
    BLOCK_END,
  };
  Kind kind = Kind::MISSING;
  union {
    IRInstruction* insn;
    cfg::BlockId block_id;
  };
  bool is_missing() const { return kind == Kind::MISSING; }
  static LiveIntervalPoint get() { return LiveIntervalPoint(); }
  static LiveIntervalPoint get(IRInstruction* insn) {
    LiveIntervalPoint lip;
    lip.kind = Kind::INSTRUCTION;
    lip.insn = insn;
    return lip;
  }
  static LiveIntervalPoint get_block_begin(cfg::Block* block) {
    auto first_insn_it = block->get_first_insn();
    return first_insn_it == block->end() ? get_block_end(block)
                                         : get(first_insn_it->insn);
  }
  static LiveIntervalPoint get_block_end(cfg::Block* block) {
    LiveIntervalPoint lip;
    lip.kind = Kind::BLOCK_END;
    lip.block_id = block->id();
    return lip;
  }
  bool operator==(const LiveIntervalPoint& other) const {
    switch (kind) {
    case Kind::MISSING:
      return other.kind == Kind::MISSING;
    case Kind::INSTRUCTION:
      return other.kind == Kind::INSTRUCTION && insn == other.insn;
    case Kind::BLOCK_END:
      return other.kind == Kind::BLOCK_END && block_id == other.block_id;
    }
  }
  struct Hasher {
    size_t operator()(const LiveIntervalPoint& lip) const {
      switch (lip.kind) {
      case Kind::MISSING:
        return 0;
      case Kind::INSTRUCTION:
        return (size_t)lip.insn;
      case Kind::BLOCK_END:
        return lip.block_id;
      }
    }
  };
};

using FreeRegPool = std::set<reg_t>;

/*
 * The shape of an instruction is defined by its opcode and possibly other fixed
 * argument. When re-using registers, we try to match end-point shapes to
 * increase the chances of creating suffices that can be deduped.
 */
struct IRInstructionShape {
  IROpcode opcode;
  union {
    // Zero-initialize this union with the uint64_t member instead of a
    // pointer-type member so that it works properly even on 32-bit machines
    uint64_t literal{0};
    const DexString* string;
    const DexType* type;
    const DexFieldRef* field;
    const DexMethodRef* method;
    const DexOpcodeData* data;
  };
  static IRInstructionShape get(const LiveIntervalPoint& lip) {
    IRInstructionShape shape;
    switch (lip.kind) {
    case LiveIntervalPoint::Kind::MISSING:
      not_reached();
    case LiveIntervalPoint::Kind::BLOCK_END:
      shape.opcode = OPCODE_NOP;
      return shape;
    case LiveIntervalPoint::Kind::INSTRUCTION: {
      auto* insn = lip.insn;
      shape.opcode = insn->opcode();
      if (insn->has_literal()) {
        shape.literal = insn->get_literal();
      } else if (insn->has_type()) {
        shape.type = insn->get_type();
      } else if (insn->has_field()) {
        shape.field = insn->get_field();
      } else if (insn->has_method()) {
        shape.method = insn->get_method();
      } else if (insn->has_string()) {
        shape.string = insn->get_string();
      } else if (insn->has_data()) {
        shape.data = insn->get_data();
      }
      return shape;
    }
    }
  }

  bool operator==(const IRInstructionShape& other) const {
    return opcode == other.opcode && literal == other.literal;
  }
};

struct IRInstructionShapeHasher {
  size_t operator()(const IRInstructionShape& shape) const {
    return shape.opcode * 27 + (size_t)shape.literal;
  }
};

/*
 * This implementation follows the pseudo algorithm proposed in paper Linear
 * Scan Register Allocation by M.Polleto and V. Sarkar
 * [https://dl.acm.org/doi/10.1145/330249.330250]
 * Except that we process the live intervals in reverse.
 */
class LinearScanAllocator final {
 public:
  explicit LinearScanAllocator(DexMethod* method);
  LinearScanAllocator(IRCode* code,
                      bool is_static,
                      const std::function<std::string()>& method_describer);

  /*
   * For each live interval in ascending order of first def:
   * expire_old_intervals; check if anything in free queue, if so, allocate a
   * free reg to the vreg in current live interval; otherwise, allocate a new
   * reg, increase cur_max_reg.
   */
  void allocate();

 private:
  // Ensure that we have an editable CFG for the duration of the optimization
  cfg::ScopedCFG m_cfg;
  bool m_is_static;

  /*
   * interval -> vreg, reg
   */
  LiveIntervals m_live_intervals;

  /*
   * vreg -> all defs 7 uses
   * Group all defs and uses of the same vreg.
   */
  VRegDefsUses m_vreg_defs_uses;

  /*
   * Record all wide vregs for allocation reference.
   */
  WideVReg m_wide_vregs;

  /*
   * We index free-regs by their last-use instruction shape, to make it more
   * likely that dedup-blocks will find matching suffixes.
   */
  std::unordered_map<IRInstructionShape, FreeRegPool, IRInstructionShapeHasher>
      m_free_regs;

  /*
   * List of live interval points indexed by live-interval start-/end-points.
   */
  std::vector<LiveIntervalPoint> m_live_interval_points;

  /*
   * We keep track of the vreg in which the "this" argument is stored. We will
   * assign it a unique register to appease the Mutator's "drop_this" function.
   */
  std::optional<reg_t> m_this_vreg;

  /*
   * { pair(interval_idx, last_use_idx) }
   * Current live intervals that has not reached their end point. i.e., live
   * intervals of active vregs.
   *
   * The reason we use "active intervals" instead of "active regs" is that
   * sorting intervals by last use idx can save work when checking for interval
   * expiration.
   */
  ActiveIntervals m_active_intervals;

  /*
   * Record the #reg allocated.
   */
  uint32_t m_reg_count = 0;

  /*
   * Find all defs and uses of each vreg by traversing the irlist.
   */
  void init_vreg_occurences();

  /*
   * Update free_regs and active_intervals: Check last use of each active
   * interval. If completed (last use < cur def), put the corresponding reg into
   * free queue; otherwise, do nothing.
   */
  void expire_old_intervals(uint32_t cur_def_idx);

  /*
   * Allocate a register for a vreg for a live-interval with the given
   * end-point. We might hand out a reused but since expired register.
   */
  reg_t allocate_register(reg_t for_vreg, uint32_t end_point);
};

} // namespace fastregalloc


text:
<?php
session_start();
include "connect.php";
$_SESSION['user_status']='User';
$page=$_GET['p'];?>
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> <?=$_SESSION['user_status']?> Dashboad </title>

    <link href="assets/plugins/bootstrap/bootstrap.css" rel="stylesheet" />
    <link href="assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href="assets/plugins/pace/pace-theme-big-counter.css" rel="stylesheet" />
  <link href="assets/css/style.css" rel="stylesheet" />
      <link href="assets/css/main-style.css" rel="stylesheet" />
    <link href="assets/css/form.css" rel="stylesheet" />
     <link href="assets/form-helpers/css/bootstrap-formhelpers.css" rel="stylesheet" />

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    Toggle navigation

                </button>

Management Transportation

Please Sign In

                        <form role="form">
                            <fieldset>

                                    <input class="form-control" placeholder="Username" name="username"  autofocus>

                                    <input class="form-control" placeholder="Password" name="password" type="password" value="">

                                        <input name="remember" type="checkbox" value="Remember Me">Remember Me

                                Login
                            </fieldset>
                        </form>


text:
<?php
$this->load->view('template/head');
$this->load->view('template/topbar');
$this->load->view('template/sidebar');
?>

		UPDATE DATA OPERASIONAL

				Home

Transaksi

<!DOCTYPE>

<?php
	foreach($financial as $transaksi){ ?>
		<form action="<?php echo base_url();?>C_operasional/do_edit" method="post">

                Tanggal Operasional

					<input type="hidden" name="id_transaksi" value="<?php echo $transaksi->id_transaksi ?>"

                    <input type="text" name="tanggal" class="form-control" id="datepicker" value="<?php echo $transaksi->tanggal ?>"

            Kategori
            <input type="text" name="id_kategori" class="form-control" placeholder="Operasional" disabled />

            	Member
            		<select name="id_member" class="form-control" >
		                   	<?php
                   			foreach ($member as $row) {
                        		echo "<option value='".$row->id_member."'";
                        		echo ($transaksi->id_member == $row->id_member) ? "selected" : "";
                        		echo ">".$row->nama."</option>";
                    		}
                    		?>
                	</select>

            Tipe Operasional

            <select name="tipe" class="form-control" value="<?php echo $data['tipe'] ?>"
                    <option value="Outcome">Outcome</option>
                    <option value="Income">Income</option>
                </select>

            Jumlah Transaksi
            <input type="number" name="jml_transaksi" class="form-control" value="<?php echo $transaksi->jml_transaksi ?>"

            Keterangan
            <input type="text" name="keterangan" class="form-control" value="<?php echo $transaksi->keterangan?>">

		<input type="submit" name="submit" value="submit" class="btn btn-success">

		</form>
	<?php }
?>

<?php
$this->load->view('template/js');
?>

<?php
$this->load->view('template/foot');
?>


text:
package com.vladsch.flexmark.util.ast;

import org.jetbrains.annotations.NotNull;

public interface BlockTracker {
    void blockAdded(@NotNull Block node);
    void blockAddedWithChildren(@NotNull Block node);
    void blockAddedWithDescendants(@NotNull Block node);

    void blockRemoved(@NotNull Block node);
    void blockRemovedWithChildren(@NotNull Block node);
    void blockRemovedWithDescendants(@NotNull Block node);
}