반응형

인생의 의미는 끊임없이 다른 존재로 되어가기의 과정에서 발견되는 것이다.

반응형
반응형

동문시장 청양수산 회포장

늘 전화주문하고 받으러갑니다~ 좋아요~  제주특별자치도 제주시 오현길 90 

064-753-1510

 

반응형
반응형

12 Extremely Useful Hacks for JavaScript

https://github.com/maketroli/js-hacks/blob/master/README.md

 

maketroli/js-hacks

12 Extremely Useful Hacks for JavaScript. Contribute to maketroli/js-hacks development by creating an account on GitHub.

github.com

1) Converting to boolean using !! operator

function Account(cash) {
    this.cash = cash;
    this.hasMoney = !!cash;
}

var account = new Account(100.50);
console.log(account.cash); // 100.50
console.log(account.hasMoney); // true

var emptyAccount = new Account(0);
console.log(emptyAccount.cash); // 0
console.log(emptyAccount.hasMoney); // false

2) Converting to number using + operator

function toNumber(strNumber) {
    return +strNumber;
}

console.log(toNumber("1234")); // 1234
console.log(toNumber("ACB")); // NaN
This magic will work with Date too and, in this case, it will return the timestamp number:

console.log(+new Date()) // 1461288164385

3) Short-circuits conditionals

if (conected) {
    login();
}

conected && login();

user && user.login();

4) Default values using || operator

function User(name, age) {
    this.name = name || "Oliver Queen";
    this.age = age || 27;
}

var user1 = new User();
console.log(user1.name); // Oliver Queen
console.log(user1.age); // 27

var user2 = new User("Barry Allen", 25);
console.log(user2.name); // Barry Allen
console.log(user2.age); // 25

5) Caching the array.length in the loop

/*
This tip is very simple and causes a huge impact on the performance when 
processing large arrays during a loop. Basically, 
almost everybody writes this synchronous for to iterate an array:
*/
for(var i = 0; i < array.length; i++) {
    console.log(array[i]);
}

/*
If you work with smaller arrays – it’s fine, but if you process large arrays, 
this code will recalculate the size of array in every iteration of this loop and 
this will cause a bit of delays. 
To avoid it, you can cache the array.length in a variable to use it instead of invoking 
the array.length every time during the loop:
*/
var length = array.length;
for(var i = 0; i < length; i++) {
    console.log(array[i]);
}

//-- To make it smaller, just write this code:
for(var i = 0, length = array.length; i < length; i++) {
    console.log(array[i]);
}

; }

6) Detecting properties in an object

This trick is very useful when you need to check if some attribute exists and it avoids running undefined functions or attributes. If you are planning to write cross-browser code, probably you will use this technique too. For example, let’s imagine that you need to write code that is compatible with the old Internet Explorer 6 and you want to use the document.querySelector(), to get some elements by their ids. However, in this browser this function doesn’t exist, so to check the existence of this function you can use the in operator, see this example:

if ('querySelector' in document) {
    document.querySelector("#id");
} else {
    document.getElementById("id");
}

7) Getting the last item in the array

The Array.prototype.slice(begin, end) has the power to cut arrays when you set the begin and end arguments. But if you don’t set the end argument, this function will automatically set the max value for the array. I think that few people know that this function can accept negative values, and if you set a negative number as begin argument you will get the last elements from the array:

var array = [1,2,3,4,5,6];
console.log(array.slice(-1)); // [6]
console.log(array.slice(-2)); // [5,6]
console.log(array.slice(-3)); // [4,5,6]

8) Array truncation

var array = [1,2,3,4,5,6];
console.log(array.length); // 6
array.length = 3;
console.log(array.length); // 3
console.log(array); // [1,2,3]

9) Replace all

The String.replace() function allows using String and Regex to replace strings, natively this function only replaces the first occurrence. But you can simulate a replaceAll() function by using the /g at the end of a ​Regex:

var string = "john john";
console.log(string.replace(/hn/, "ana")); // "joana john"
console.log(string.replace(/hn/g, "ana")); // "joana joana"

10) Merging arrays

var array1 = [1,2,3];
var array2 = [4,5,6];
console.log(array1.concat(array2)); // [1,2,3,4,5,6];

/*
However, this function is not the most suitable to merge large arrays 
because it will consume a lot of memory by creating a new array. 
In this case, you can use Array.push.apply(arr1, arr2) which 
instead creates a new array – it will merge the second array in 
the first one reducing the memory usage:
*/
var array1 = [1,2,3];
var array2 = [4,5,6];
console.log(array1.push.apply(array1, array2)); // [1,2,3,4,5,6];

11) Converting NodeList to Arrays

If you run the document.querySelectorAll("p") function, it will probably return an array of DOM elements, the NodeList object. But this object doesn’t have all array’s functions, like: sort(), reduce(), map(), filter(). In order to enable these and many other native array’s functions you need to convert NodeList into Arrays. To run this technique just use this function: [].slice.call(elements):

var elements = document.querySelectorAll("p"); // NodeList
var arrayElements = [].slice.call(elements); // Now the NodeList is an array
var arrayElements = Array.from(elements); // This is another way of converting NodeList to Array

12) Shuffling array’s elements

var list = [1,2,3];
console.log(list.sort(function() { Math.random() - 0.5 })); // [2,1,3]

 

​#javascript

#!! #operator #+ #number

#Short-circuit

#array.length #loop

#detecting #properties #object

#item #array

#array_truncation

#replaceAll #replace

#merging #array #merging_array

#NodeList to #Array

#Shuffling #elements

반응형
반응형

미소를 짓는 행동만으로도 기분이 좋아지고 면역력이 증가하며,
스트레스가 줄어들고 혈압이 낮아진다.
또한 심장마비의 위험성이 적어진다. 1번 웃으면
초콜릿바 2000개를 섭취하는 것에 필적하는 수준으로 뇌를 자극할 수 있다.
웃는 얼굴은 수명과도 관련이 있다.
- 크리스틴 포래스, ‘무례함의 비용’ 

활짝 웃는 메이저리그 선수들의 평균 수명은 79세,
별로 웃지 않는 선수들의 평균 수명은 72세였습니다.
웃는 얼굴 덕분에 7년을 더 살았습니다.
“미소나 다정한 말 한마디, 경청하는 자세, 마음을 담은 칭찬,
아주 사소한 배려는 우리 삶의 방향을 바꿀 수 있는데,
사람들은 이런 행동의 잠재력을 너무 과소평가한다.”(레오 버스카글리아)

반응형
반응형

나는 아직도
존재가 무엇인지 잘 모른다.
의식이 무엇인지 잘 모른다. 하지만
희열이 어떤 것인지는 알고 있다. 그것은
온전하게 현재에 존재하는 느낌, 진정한
나 자신이 되기 위해 해야 하는
어떤 것을 하고 있을 때의
느낌이다.

- 조셉 캠벨의《블리스 내 인생의 신화를 찾아서》중에서 -


* 2019년 한해를 마감하는 마지막날입니다.
올 한 해도 무고들 하셨는지요. 기쁨과 희열을 맛본
순간들은 얼마나 있으셨나요? 풍요와 안락의 시간도
기쁨을 안겨주었지만, 한 번 돌이켜 보십시오. 궁핍과
고통의 시간도 돌아보니 의미가 있었지 않습니까?
그 힘든 시간을 오직 현재에 존재하는 마음으로
잘 견디어낸 자기 자신이 희열이지 않습니까?
내가 나를 이겨낸 기쁨. 그보다
더 큰 희열은 없습니다.

반응형

'생활의 발견 > 아침편지' 카테고리의 다른 글

긍정적 목표가 먼저다  (0) 2020.01.02
새해 복 많이 지으세요!  (0) 2020.01.02
낯선 풍경이 말을 걸어왔다  (0) 2019.12.30
상대를 바꾸려는 마음  (0) 2019.12.28
간디의 길  (0) 2019.12.27
반응형

자요우(加油)는 글자 그대로 기름을 더한다는 뜻으로 중국사람들은 격려하거나 응원할 때 이 말을 자주 사용한다. 그런데 최근 중국 네티즌 사이에 이 자요우(加油)를 영어로 어떻게 번역할 것인가를 놓고 토론이 벌어지고 있다. 정확한 의미를 전달할 영어 단어를 찾아내지 못했기 때문이다.

실제로 '자요우(加油)'는 다양한 상황에서 사용되고 그 때마다 뉘앙스가 조금씩 다르다.

 예를 들어, 올림픽 경기장에서 응원하며 외치는 "자요우"의 의미는 "이겨라!" 정도의 뜻이지만 원촨(汶川) 지진 당시의 '원촨자요우(汶川加油!)', '쓰촨자요우(四川加油!)'등에서는 의미가 다소 다르다.

많은 중국 네티즌들이 "Go, China!", "Come on, China!" 등의 다양한 의견을 제시했지만 아직까지 모두의 공감을 얻을만한 적절한 표현을 찾지 못하고 있는 실정이다.

반응형
반응형

25 Survival Items You Can Make At Home  https://urbansurvivalsite.com/survival-items-you-can-make-yourself/

25 #Survival #Items You Can #Make At #Home  

1. Soap

Soap is something every prepper should learn how to make. Hygiene will be even more important during a long-term disaster where sanitation is on the decline, diseases are on the rise, and doctors are unavailable.

2. Deodorant

While not a necessity for survival, deodorant can do wonders for your morale and humanity by keeping you smelling fresh.

3. Lotion

You’ll want to keep your skin in good and healthy condition so it doesn’t get itchy or cracked. Disasters are hard enough as it is, so anything that will minimize discomfort is worth doing.

4. Antibiotic Wound Cream

Being able to dress wounds properly is essential in any survival situation, and having an easy-to-make recipe on hand will keep you from having to scavenge for antibiotic ointment.

5. Poultice

You’ll want to have some sort of substance to ease your pain and bring inflammation down when you suffer wounds and injuries, and poultice is an herbal solution you can forage for and find in many different areas.

6. Candles

For anyone surviving without electricity (or with limited access to it), candles are quite beneficial as a source of light, heat, and as a bug repellent.

7. Oil Lamp

An oil lamp is even better than a candle since it provides a little more light can’t get knocked over as easily. All you need is a wick, a mason jar, and some olive oil.

8. Fuel

A sustainable life after SHTF may require some sort of fuel to power engines and generators for transportation and generating power. Fortunately, there is a DIY process for making your own ethanol.

9. Charcoal

If you learn to make your own charcoal, you can keep grilling out no matter how long it takes for grocery stores to get charcoal back in stock. It’s actually easier than you might think, it just takes a little time.

10. Char Cloth

Char cloth is a very useful material to help you in the fire-starting process, giving you excellent tinder that will light instantly in many different conditions.

11. Fire Starter

Having a tried and true fire starter can be the difference between life and death in a survival scenario. Having a good fire starter will make it far easier to get a fire going.

12. Waterproof Matches

Waterproof matches are exceedingly useful for anyone spending time outdoors and starting their own fires, as they can be used even in wet and cold weather.

13. Tin Can Stove

This is a simple stove that uses a few candles to heat up things like canned food and warm drinks, and even make flatbread.

14. Rocket Stove

A rocket stove is easy to make and can do wonders for your survival cooking, allowing you to bridge the gap between proper kitchen cooking and roughing it over a campfire without any cooking utensils.

15. Solar Oven

In a survival situation you will most likely not have access to a stove, but you can increase your odds of survival by learning how to create your own solar cooker, which uses the energy of the sun to heat up a chamber for cooking.

16. Water Filter

Having drinkable water is one of the basic essentials for human survival. Knowing how to make your own water filter can save your life in a survival situation.

17. Aquaponics Garden

For a more long-term sustainable food option, try your hand at balancing the ecosystems of a garden and an aquarium with an aquaponics garden.

18. PVC Bow

For hunting game small to large and even for protection, fewer DIY weapons are more useful and simpler to make than a bow reinforced with PVC.

19. Traps

Carrying enough food in a bug out bag to survive for months at a time is practically impossible. Instead, try carrying a few homemade traps or the materials to make one.

20. Paracord Belt

You never know when you’ll be in a situation where a few feet of rope could make all the difference. Wearing a paracord belt is a great way to carry a great length of rope at all times.

21. Hard Tack

This simple snack only has three ingredients (flour, salt, and water), and it’s very easy to make. Plus, it will last for years.

22. Beef Jerky

The great thing about beef jerky is that it’s very portable and lasts a long time. If you’re on the move or working hard all day, a delicious piece of beef jerky from your pocket can be a great pick-me-up.

23. Butter

Having homemade butter on hand will be extremely useful for cooking when the SHTF, particularly if you’re tied down to cooking outdoors without non-stick cookware.

24. Emergency Bread

This is a recipe for a simple flat bread that is surprisingly filling. You can make ordinary sandwiches with it, or you can use it as a tortilla to make wraps, burritos, or whatever you want.

25. Zeer Pot

Extend the life of your food and keep it fresh with a homemade Zeer pot. Zeer pots have been used in many rural locations in Africa and the Middle East as a way to naturally refrigerate food and keep it fresh longer.

Over time, I’m going to add a lot more to this list. What are some other survival items that are easy to make? Leave your comment below.

지금과 같은 평상시에는 언제든지 돈만 지불하면 필요한 물건을 사서 쟁여놓을 수 있다. 그러나 만약 재난이 발생하여 혼란한 세상이 되었을 때, 그리고 그 재난상황이 장기화된다면 결국 스스로 직접 만들어 사용하거나 그 물건을 가진 사람과 물물교환을 해서라도 얻어야 할 것이다. ( 재난상황에서 쇼핑몰이 정상적으로 운영되겠는가 ? ^^ )

1. 항생 연고 Antibiotic Wound Cream - 송진연고

Being able to dress wounds properly is essential in any survival situation, and having an easy-to-make recipe on hand will keep you from having to scavenge for antibiotic ointment.

2. 전천후 화덕 - 탄통스토브

최소의 땔감으로 ( 불에 타는 모든 것들을 땔감으로 활용) 필요한 모든 요리와 체온보호를 위한 가장

경제적인 화덕,난로

3. 깡통 스토브 Tin Can Stove

This is a simple stove that uses a few candles to heat up things like canned food and warm drinks, and even make flatbread.

4. 로켓 스토브 Rocket Stove

A rocket stove is easy to make and can do wonders for your survival cooking, allowing you to bridge the gap between proper kitchen cooking and roughing it over a campfire without any cooking utensils.

5. 비누 Soap

Soap is something every prepper should learn how to make. Hygiene will be even more important during a long-term disaster where sanitation is on the decline, diseases are on the rise, and doctors are unavailable.

6. 로션 Lotion - 송진연고

You’ll want to keep your skin in good and healthy condition so it doesn’t get itchy or cracked. Disasters are hard enough as it is, so anything that will minimize discomfort is worth doing.

7. 찜질습포 Poultice

You’ll want to have some sort of substance to ease your pain and bring inflammation down when you suffer wounds and injuries, and poultice is an herbal solution you can forage for and find in many different areas.

8. 양초 Candles

For anyone surviving without electricity (or with limited access to it), candles are quite beneficial as a source of light, heat, and as a bug repellent.

9. 오일램프 Oil Lamp

An oil lamp is even better than a candle since it provides a little more light can’t get knocked over as easily. All you need is a wick, a mason jar, and some olive oil.

10. 연료 Fuel -

A sustainable life after SHTF may require some sort of fuel to power engines and generators for transportation and generating power. Fortunately, there is a DIY process for making your own ethanol.

11. 숯 Charcoal

If you learn to make your own charcoal, you can keep grilling out no matter how long it takes for grocery stores to get charcoal back in stock. It’s actually easier than you might think, it just takes a little time.

12. 탄화면 Char Cloth

Char cloth is a very useful material to help you in the fire-starting process, giving you excellent tinder that will light instantly in many different conditions.

13. 파이어스타터 Fire Starter

Having a tried and true fire starter can be the difference between life and death in a survival scenario. Having a good fire starter will make it far easier to get a fire going.

14. 방수성냥 Waterproof Matches

Waterproof matches are exceedingly useful for anyone spending time outdoors and starting their own fires, as they can be used even in wet and cold weather.

15. 태양열 오븐 Solar Oven

In a survival situation you will most likely not have access to a stove, but you can increase your odds of survival by learning how to create your own solar cooker, which uses the energy of the sun to heat up a chamber for cooking.

16. 물 정수필터 Water Filter

Having drinkable water is one of the basic essentials for human survival. Knowing how to make your own water filter can save your life in a survival situation.

17. 아쿠아포닉스 정원 Aquaponics Garden

물고기 양식(Aquaculture)과 수경재배(Hydroponics)의 합성어로 물고기와 작물을 함께 길러 수확하는 방식을 말한다. 즉, 물고기를 키우면서 발생되는 유기물을 이용해 식물을 수경 재배하는 순환형 시스템이다.

[네이버 지식백과] 아쿠아포닉스 (시사상식사전, pmg 지식엔진연구소)

18. PVC 활 PVC Bow

For hunting game small to large and even for protection, fewer DIY weapons are more useful and simpler to make than a bow reinforced with PVC.

19. 덪 Traps

Carrying enough food in a bug out bag to survive for months at a time is practically impossible. Instead, try carrying a few homemade traps or the materials to make one.

20. 파라코드 벨트 Paracord Belt

You never know when you’ll be in a situation where a few feet of rope could make all the difference. Wearing a paracord belt is a great way to carry a great length of rope at all times.

21. 건빵,비스켓(Hard Tack)

This simple snack only has three ingredients (flour, salt, and water), and it’s very easy to make. Plus, it will last for years.

22. 육포 (Beef Jerky)

The great thing about beef jerky is that it’s very portable and lasts a long time. If you’re on the move or working hard all day, a delicious piece of beef jerky from your pocket can be a great pick-me-up.

23. 버터 (Butter)

Having homemade butter on hand will be extremely useful for cooking when the SHTF, particularly if you’re tied down to cooking outdoors without non-stick cookware.

24. 비상식량 Emergency Bread

This is a recipe for a simple flat bread that is surprisingly filling. You can make ordinary sandwiches with it, or you can use it as a tortilla to make wraps, burritos, or whatever you want.

25. 항아리 냉장고 Zeer Pot

Extend the life of your food and keep it fresh with a homemade Zeer pot. Zeer pots have been used in many rural locations in Africa and the Middle East as a way to naturally refrigerate food and keep it fresh longer.

[출처] 집에서 만드는 생존용품 (서바이벌 리스트) |작성자 메그

반응형
반응형

[POI] POI 엑셀 - Using newlines in cells ( 셀에서 줄바꿈 )
//////////////////////////////
cs.setWrapText( true );
//////////////////////////////////

 

// 엑셀 파일 로드
HSSFWorkbook wb = excelService.loadWorkbook(sb.toString());
 
HSSFSheet sheet = wb.createSheet("cell test sheet2");
sheet.setColumnWidth((short) 3, (short) 200);	// column Width
 
HSSFCellStyle cs = wb.createCellStyle();
HSSFFont font = wb.createFont();
font.setFontHeight((short) 16);
font.setBoldweight((short) 3);
font.setFontName("fixedsys");
 
cs.setFont(font);
cs.setAlignment(HSSFCellStyle.ALIGN_RIGHT);	// cell 정렬
cs.setWrapText( true );
 
for (int i = 0; i < 100; i++) {
	HSSFRow row = sheet.createRow(i);
	row.setHeight((short)300); // row의 height 설정
 
	for (int j = 0; j < 5; j++) {
		HSSFCell cell = row.createCell((short) j);
		cell.setCellValue(new HSSFRichTextString("row " + i + ", cell " + j));
		cell.setCellStyle( cs );
	}
}
 
// 엑셀 파일 저장
FileOutputStream out = new FileOutputStream(sb.toString());
wb.write(out);
out.close();

https://www.egovframe.go.kr/wiki/doku.php?id=egovframework:rte2:fdl:excel

 

egovframework:rte2:fdl:excel [eGovFrame]

Excel 파일 포맷을 다룰 수 있는 자바 라이브러리를 제공하여, 사용자들이 데이터를 Excel 파일 포맷으로 다운받거나, 대량의 Excel 데이터를 시스템에 올릴 수 있도록 지원하기 위한 서비스이다. Excel 서비스는 Apache POI 오픈소스를 사용하여 구현하였으며 주요 Excel접근 기능 외에 Excel 다운로드, Excel 파일 업로드 등의 기능이 있다. 엑셀 파일을 생성하여 지정된 위치에 저장하는 기능을 제공한다. HSSFWorkbook 인스

www.egovframe.go.kr

 

반응형

+ Recent posts