Skip to content

Instantly share code, notes, and snippets.

@springcome
springcome / main.dart
Last active April 14, 2023 18:44
challenge - 12 of 14
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
@springcome
springcome / main.dart
Last active April 13, 2023 16:28
Nomad - Challengs - nine
import 'dart:async';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@springcome
springcome / main.dart
Created April 11, 2023 07:05
nomadcoders - flutter - challenge - senven
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@springcome
springcome / HowToUseFindViewByIDExceptAppCompatActivit.java
Created September 12, 2018 03:21
AppCompatActivit를 상속하지 않은 class에서 findViewByID를 사용하고자 할때
public class A {
public static void fillView(Activity activity) {
TextView view = activity.findViewByID(R.id.view);
view.setText('A');
}
}
public class B extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
select().from(o).where(
o.stringStartDate.concat(o.stringStartTime).loe(strDate.concat(strTime))
, o.stringEndDate.concat(o.stringEndTime).goe(strDate.concat(strTime))
).list(o);
public class TestInput extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test_input);
Button btn1 = (Button) findViewById(R.id.btn_1);
btn1.setOnClickListener(new View.OnClickListener() {
@Override
@springcome
springcome / activity_test_input.xml
Created December 20, 2016 11:12
입력컨트롤러(Button), Android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<!-- 텍스트만 나오는 버튼 -->
<Button android:id="@+id/btn_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@springcome
springcome / SmartGWTAddDataArrivedHandlerExample.java
Last active November 15, 2016 05:02
SmartGWT, addDataArrivedHandler example
ComboBoxItem item = new ComboBoxItem("cd", "name");
item.addDataArrivedHandler(new DataArrivedHandler() {
@Overrid
public void onDataArrived(DataArrivedEvent event) {
ResultSet result = event.getData();
if (result != null) {
// Get fetch data.
Record [] records = result.getRange(0, result.getResultSize());
}
@springcome
springcome / CaseBuilder.java
Last active September 1, 2016 07:32
The use of 'CaseBuilder()' example
// String compare, Result Long
// query().from(cat).list(cat.name.when("Bob").then(1).otherwise(2));
// java.lang.ClassCastException: org.hibernate.hql.ast.tree.ParameterNode cannot be cast to org.hibernate.hql.ast.tree.SelectExpression
// https://github.com/querydsl/querydsl/issues/185
query().from(cat).list(cat.name.when("Bob").then(Expressions.numberTemplate(Long, "1")).otherwise(Expressions.numberTemplate(Long, "2")));
// String hour compare, Result String
StringExpression amPm = new CaseBuilder().when(o.hour.lt("1200")).then("AM").otherwise("PM");
@springcome
springcome / ComboBoxItemSelectRecord.java
Created April 27, 2016 11:35
SmartGWT, ComboBoxItem, getSelectRecord()
// DynamicForm name => form
ComboBoxItem ti01 = new ComboBoxItem("item");
ti01.addChangedHandler(new ChangedHandler() {
@Override
public void onChanged(ChangedEvent event) {
Record record = form.getItem("item").getSelectedRecord();
form.editRecord(record);
}
});