Skip to content

Instantly share code, notes, and snippets.

diff --git a/SecHdmi/SecHdmi.cpp b/SecHdmi/SecHdmi.cpp
index 6b03db7..b0a5397 100755
--- a/SecHdmi/SecHdmi.cpp
+++ b/SecHdmi/SecHdmi.cpp
@@ -597,17 +597,17 @@ bool SecHdmi::connect(void)
mHdmiOutputMode = HDMI_OUTPUT_MODE_YCBCR;
if(resolution) { // 1080P default value
- mHdmiResolutionValue = 1080960;
- mHdmiPresetId = V4L2_DV_1080P60;
@dpolishuk
dpolishuk / README.md
Created October 9, 2019 10:24 — forked from sma/README.md
This is an ad-hoc Java-to-Dart translator written in three days. This is version 2 which some bug fixes.

Java to Dart

This is an ad-hoc Java-to-Dart translator originally written on two (admittedly long) evenings.

See http://sma.github.io/stuff/java2dartweb/java2dartweb.html for a demo.

Note: It doesn't support the complete Java grammar specification and cannot translate everything. It only translates syntax and does not attempt to translate Java library classes and methods to Dart equivalents (with the exception of String.charAt and StringBuffer.append). You will have to make changes to the resulting Dart code. It does not support anonymous inner classes.

However, I was able to successfully convert a 7000+ line command line application with only minimal fixes in 30 minutes.

@dpolishuk
dpolishuk / gist:ecd944f9cf84c62dfd5d
Created November 17, 2015 07:31
Broken kapt in latest Kotlin beta [1.0.0-beta-2422, 1.0.0-beta-2417]
Note: Generating a MembersInjector or Factory for io.dp.weather.app.activity.debug.DebugActivity. Prefer to run the dagger processor over that class instead.
warning: The following options were not recognized by any processor: '[kapt.kotlin.generated]'
/Users/deepol/work/weather-android-kotlin/app/build/generated/source/kapt/release/io/dp/weather/app/adapter/PlacesAdapter_MembersInjector.java:14: error: cannot access NonExistentClass
private final MembersInjector<OrmliteCursorRecyclerViewAdapter<Place, Holder>> supertypeInjector;
^
class file for error.NonExistentClass not found
Note: /Users/deepol/work/weather-android-kotlin/app/build/generated/source/kapt/release/io/dp/weather/app/activity/DaggerActivityComponent.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:app:compileReleaseJavaWithJavac FAILED
// Determine video dimensions from the sequence parameterset.
void FindAVCDimensions(
const sp<ABuffer> &seqParamSet, int32_t *width, int32_t *height) {
ABitReader br(seqParamSet->data() + 1, seqParamSet->size() - 1);
unsigned profile_idc = br.getBits(8);
br.skipBits(16);
parseUE(&br); // seq_parameter_set_id
unsigned chroma_format_idc = 1; // 4:2:0 chroma format
@dpolishuk
dpolishuk / gist:7640716
Created November 25, 2013 12:44
Very pretty git alias for git log Ж)
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
diff --git a/drivers/media/video/samsung/tvout/s5p_tvout_fb.c b/drivers/media/video/samsung/tvout/s5p_tvout_fb.c
index 7f289ee..dabfba1 100644
--- a/drivers/media/video/samsung/tvout/s5p_tvout_fb.c
+++ b/drivers/media/video/samsung/tvout/s5p_tvout_fb.c
@@ -96,7 +96,7 @@ static struct s5ptvfb_lcd lcd = {
.width = 1920,
.height = 1080,
.bpp = 32,
- .freq = 60,
+ .freq = 50,
static int win1_display(struct rk30_lcdc_device *lcdc_dev,struct layer_par *par )
{
u32 y_addr;
u32 uv_addr;
y_addr = par->smem_start + par->y_offset;
uv_addr = par->cbr_start + par->c_offset;
DBG(2,KERN_INFO "lcdc%d>>%s>>y_addr:0x%x>>uv_addr:0x%x\n",lcdc_dev->id,__func__,y_addr,uv_addr);
spin_lock(&lcdc_dev->reg_lock);
if(likely(lcdc_dev->clk_on))
@dpolishuk
dpolishuk / MyPreference.kt
Created November 19, 2015 08:52
MyPreference.kt
fun SharedPreferences.edit(func: SharedPreferences.Editor.() -> Array<Pair<String, Any>>) : SharedPreferences.Editor {
val editor = edit()
val pairs = editor.func()
for ((key, value) in pairs) {
when (value) {
is String -> editor.putString(key, value)
is Set<*> -> {
if (!value.all { it is String }) {
@dpolishuk
dpolishuk / WeatherFor5DaysView.kt
Last active November 18, 2015 09:14
kotlinx android does not work for view ;(
import kotlinx.android.synthetic.view_weather_for_week.view.*
public class WeatherFor5DaysView : LinearLayout {
val dayNameViews: List<TextView> = arrayListOf(day_name_1, day_name_2, day_name_3, day_name_4, day_name_5)
val dayViews: List<ImageView> = arrayListOf(day_1, day_2, day_3, day_4, day_5)
val tempViews: List<TextView> = arrayListOf(temp_1, temp_2, temp_3, temp_4, temp_5)
lateinit var transformation: Transformation
@dpolishuk
dpolishuk / LocationService.java
Created July 3, 2012 09:45
acquire and release wakelock in the server
private void acquireWakeLock() {
try {
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
if (pm == null) {
Ln.e("LocationService: Power manager not found!");
return;
}
if (wakeLock == null) {
wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, getPackageName());
if (wakeLock == null) {