from https://acrobatusers.com/tutorials/javascript_console


Using the Console to run code

JavaScript code can be executed directly from the Console Window. This ability is a huge time saver since it provides a fast and easy way to test out code before it's placed into a scripting location where it will be more difficult to debug.

Let's try out some simple examples. Enter the following line of code into the Console Window. 

3 + 4 

To run the code, make sure the cursor is on the same line as the text. You can place it anywhere on the line as long as nothing is selected. Either of the two following actions will cause Acrobat to run the code. 

  • Press Ctrl+Enter on Windows, or Command+Enter on Macintosh. 
  • If your keyboard has a number pad, you can use the Enter key on the number pad without pressing the Control (Command on Mac) key. Macintosh's have the additional issue of keyboard configuration mentioned earlier.

Acrobat displays the result of the execution on the next available line, also shown in Figure 4.


위의 url 을 따라가도되고..


1. cmd+j 를 눌러서 자바스크립트 디버거를 띄운다. 이때 자바스크립트 기능을 켤래? 라고 물어오는데 켠다. 혹은 메뉴에가서 직접 켠다

2. 테스트를 위해 1+2 입력후 cmd+enter 하면 3이 나온다.

3. 자..이제 본격적으로 revse .. 뒤집자. 


for (i=this.numPages-1;i>=0;i--)

this.movePage(i);


입력후 cmd+enter 로 실행. 하면 뒤집힌다. 끝 




요상하게도.. 이 키보드의 홈페이지에 제품설명란의 설명...  자체가 잘못되어있는것 같다. 그대로 하면 안된다;; 키보드 자체는 괜찮은듯 하나 

키보드 모드변경이 괴랄하고 펑션키의 기본적인 동작형태가 일반 키보드와 굉장히 매우 아주아주 다르므로 쓰기가 어려운 키보드이다.

이를 고치는 가장 간단한 방법이 펑션키의 일반화(다른 키보드처럼 펑션키 누르고 바로 원하는 키를 눌러서 동작시키는... ) 를 펌웨어 업데이트로 해결하면되는데

그럴 마음이 없어보인다. 이 키보드는 펑션키로 모드를 변경한 다음에야 원하는 키를 입력할 수 있다; 즉 매번 모드 변경을 해야한다;;; 모드 변경은 간단히 말하면

키보드 맵핑 변경이라고 보면된다. 즉 원하는 키를 넣으려면 매번 키보드 모드 변경을 해야한다는 의미이고 이게 기본적으로 3,5 초 걸린다;; 


한미마이크로닉스도 생각은 있는지 이를 즉시 바꾸는 펌웨어(정식도 아닌것으로 보이는)를 자료실에 배포했다. 


다만 펑션키로 바로 입력을 처리하는 기능을 하지 않는건 둘중하나일거다. 애초에 물건이 그게 불가능하게 하드웨어 설계가 되어있다던지 혹은 외부 제조사가 안해주던지(돈?)

홈페이지 게시판을 보면 여러사람들이 이를 개선해달라고 요청했으나.. 하나같이 답변이 복붙 이거나 .. 없다; 


암튼.. .이 키보드를 구입은 했으니 사용법을 적어둔다. 




우선 이 키보드는 모드가 구별되어있다.


즉 지금이 유선 모든인지, 블투 모드인지가 중요하다.

변경방법은 FN+MODE(tab 키) 키를 눌러서 블투모드로 변경한뒤에 (꾸욱... 누루고 있어야 하던가 암튼 불비치 들어온다)


바뀌었는지 확인하는 방법은 usb 선을 피씨에 연결했을때 입력이 안되면 블투모드고 입력되면 usb 모드라고 보면된다. 


FN + E,R,T 를 통해 어느 패어링을 설정할건지 정하고 다음 FN + Q 를 눌러서 패어링 모드로 바꾼다. 그러면 파란 불빛이 반짝이는데

이때 외부 기기에서 패어링 연결되면(그냥 키보드라고 나옴; 그리고 연결되면 블루투스 키보드... 라고 나온다; 이름좀 설정하지 --;) 반짝이던게 멈춘다.





frpm https://docs.spring.io/spring-boot/docs/2.0.3.RELEASE/reference/htmlsingle/#boot-features-cors


27.1.13 CORS Support

Cross-origin resource sharing (CORS) is a W3C specification implemented by most browsers that lets you specify in a flexible way what kind of cross-domain requests are authorized, instead of using some less secure and less powerful approaches such as IFRAME or JSONP.

As of version 4.2, Spring MVC supports CORS. Using controller method CORS configuration with @CrossOrigin annotations in your Spring Boot application does not require any specific configuration. Global CORS configuration can be defined by registering a WebMvcConfigurer bean with a customizedaddCorsMappings(CorsRegistry) method, as shown in the following example:

@Configuration
public class MyConfiguration {

	@Bean
	public WebMvcConfigurer corsConfigurer() {
		return new WebMvcConfigurer() {
			@Override
			public void addCorsMappings(CorsRegistry registry) {
				registry.addMapping("/api/**");
			}
		};
	}
}


from http://www.dofactory.com/sql/full-outer-join



SQL FULL JOIN Statement

  • FULL JOIN returns all matching records from both tables whether the other table matches or not.
  • FULL JOIN can potentially return very large datasets.
  • FULL JOIN and FULL OUTER JOIN are the same.



The SQL FULL JOIN syntax


The general syntax is: 

  1. SELECT column-names
  2. FROM table-name1 FULL JOIN table-name2
  3. ON column-name1 = column-name2
  4. WHERE condition


The general FULL OUTER JOIN syntax is: 

  1. SELECT column-names
  2. FROM table-name1 FULL OUTER JOIN table-name2
  3. ON column-name1 = column-name2
  4. WHERE condition





SQL FULL JOIN Examples



Problem: Match all customers and suppliers by country 


  1. SELECT C.FirstName, C.LastName, C.Country AS CustomerCountry,
  2. S.Country AS SupplierCountry, S.CompanyName
  3. FROM Customer C FULL JOIN Supplier S
  4. ON C.Country = S.Country
  5. ORDER BY C.Country, S.Country


This returns suppliers that have no customers in their country, 
and customers that have no suppliers in their country, 
and customers and suppliers that are from the same country. 

Results: 195 records 

FirstNameLastNameCustomerCountrySupplierCountryCompanyName
NULLNULLNULLAustraliaPavlova, Ltd.
NULLNULLNULLAustraliaG'day, Mate
NULLNULLNULLJapanTokyo Traders
NULLNULLNULLJapanMayumi's
NULLNULLNULLNetherlandsZaanse Snoepfabriek
NULLNULLNULLSingaporeLeka Trading
PatricioSimpsonArgentinaNULLNULL
YvonneMoncadaArgentinaNULLNULL
SergioGutiérrezArgentinaNULLNULL
GeorgPippsAustriaNULLNULL
RolandMendelAustriaNULLNULL
PascaleCartrainBelgiumNULLNULL
CatherineDeweyBelgiumNULLNULL
BernardoBatistaBrazilBrazilRefrescos Americanas LTDA
LúciaCarvalhoBrazilBrazilRefrescos Americanas LTDA
JaneteLimeiraBrazilBrazilRefrescos Americanas LTDA
AriaCruzBrazilBrazilRefrescos Americanas LTDA
AndréFonsecaBrazilBrazilRefrescos Americanas LTDA
MarioPontesBrazilBrazilRefrescos Americanas LTDA
PedroAfonsoBrazilBrazilRefrescos Americanas LTDA
PaulaParenteBrazilBrazilRefrescos Americanas LTDA
AnabelaDominguesBrazilBrazilRefrescos Americanas LTDA
ElizabethLincolnCanadaCanadaMa Maison
ElizabethLincolnCanadaCanadaForêts d'érables
YoshiTannamuriCanadaCanadaMa Maison
YoshiTannamuriCanadaCanadaForêts d'érables
JeanFresnièreCanadaCanadaMa Maison





from https://www.tutorialspoint.com/sql/sql-full-joins.htm


The SQL FULL JOIN combines the results of both left and right outer joins.

The joined table will contain all records from both the tables and fill in NULLs for missing matches on either side.

Syntax

The basic syntax of a FULL JOIN is as follows −

SELECT table1.column1, table2.column2...
FROM table1
FULL JOIN table2
ON table1.common_field = table2.common_field;

Here, the given condition could be any given expression based on your requirement.

Example

Consider the following two tables.

Table 1 − CUSTOMERS Table is as follows.

+----+----------+-----+-----------+----------+
| ID | NAME     | AGE | ADDRESS   | SALARY   |
+----+----------+-----+-----------+----------+
|  1 | Ramesh   |  32 | Ahmedabad |  2000.00 |
|  2 | Khilan   |  25 | Delhi     |  1500.00 |
|  3 | kaushik  |  23 | Kota      |  2000.00 |
|  4 | Chaitali |  25 | Mumbai    |  6500.00 |
|  5 | Hardik   |  27 | Bhopal    |  8500.00 |
|  6 | Komal    |  22 | MP        |  4500.00 |
|  7 | Muffy    |  24 | Indore    | 10000.00 |
+----+----------+-----+-----------+----------+

Table 2 − ORDERS Table is as follows.

+-----+---------------------+-------------+--------+
|OID  | DATE                | CUSTOMER_ID | AMOUNT |
+-----+---------------------+-------------+--------+
| 102 | 2009-10-08 00:00:00 |           3 |   3000 |
| 100 | 2009-10-08 00:00:00 |           3 |   1500 |
| 101 | 2009-11-20 00:00:00 |           2 |   1560 |
| 103 | 2008-05-20 00:00:00 |           4 |   2060 |
+-----+---------------------+-------------+--------+

Now, let us join these two tables using FULL JOIN as follows.

SQL> SELECT  ID, NAME, AMOUNT, DATE
   FROM CUSTOMERS
   FULL JOIN ORDERS
   ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID;

This would produce the following result −

+------+----------+--------+---------------------+
| ID   | NAME     | AMOUNT | DATE                |
+------+----------+--------+---------------------+
|    1 | Ramesh   |   NULL | NULL                |
|    2 | Khilan   |   1560 | 2009-11-20 00:00:00 |
|    3 | kaushik  |   3000 | 2009-10-08 00:00:00 |
|    3 | kaushik  |   1500 | 2009-10-08 00:00:00 |
|    4 | Chaitali |   2060 | 2008-05-20 00:00:00 |
|    5 | Hardik   |   NULL | NULL                |
|    6 | Komal    |   NULL | NULL                |
|    7 | Muffy    |   NULL | NULL                |
|    3 | kaushik  |   3000 | 2009-10-08 00:00:00 |
|    3 | kaushik  |   1500 | 2009-10-08 00:00:00 |
|    2 | Khilan   |   1560 | 2009-11-20 00:00:00 |
|    4 | Chaitali |   2060 | 2008-05-20 00:00:00 |
+------+----------+--------+---------------------+

If your Database does not support FULL JOIN (MySQL does not support FULL JOIN), then you can use UNION ALL clause to combine these two JOINS as shown below.

SQL> SELECT  ID, NAME, AMOUNT, DATE
   FROM CUSTOMERS
   LEFT JOIN ORDERS
   ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID
UNION ALL
   SELECT  ID, NAME, AMOUNT, DATE
   FROM CUSTOMERS
   RIGHT JOIN ORDERS
   ON CUSTOMERS.ID = ORDERS.CUSTOMER_ID





패키지 설치할 수 있도록 스크립트실행도 했는데 패키지 컨트롤의 패키지 설치를 하려고 하면 패키지가 없다고 나온다.


방법은 다양할텐데 .. 우선 설정에 채널을 추가했다.

위치는


(맥은 상단의 Sublime Text > ) preference > package settings > package control > settings - user   를 클릭해서 설정을 열고



"channels":

[

"http://packagecontrol.io/channel_v3.json",

"http://web.archive.org/web/20150905194312/https://packagecontrol.io/channel_v3.json"

]



위의 내용을 적절한 , 를 붙여서 추가한다. 

잠깐.. 원래 여기서 위에는 2가지 url 이 http 로 되어있는데 이건 본인의 환경이 https 로 할때 인증서 등으로 막히게 된다면 http 로 넣으면된다. 본인은 http 로 넣어야 했다.


저장하고 sublime 종료하고 다시 시작한뒤 진행해보면 패키지 목록이 잘 나온다.


가끔 eclipse 에 svn 으로 부터 가져온 프로젝트의 svn 연결이 끊어지는 경우가 있다. (svn 설정파일은 멀쩡히 존재함)

이럴때 재연결하는 방법은 해당 저장소에서 다시 체크아웃해서 다 당겨와야하는데 이것도 은근히 시간 많이 걸린다. 이럴때는 재연결할 수 있다.


해당 프로젝트를 고르고 svn > share project (s 가 아니다... 하나만 할꺼라서) -> 선택하면 이제 아마... 남아있는 svn 정보를 이용해서 알맞은 저장소를 알려주는것 같다. 확인이던가를 누르면 다시 연결된다.





gradle 프로젝트를 가져와서  project import 중에 에러가 났다. 

이유를 보니... 


eclipse 에러창으로는 

Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.14.1-all.zip'.


sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

unable to find valid certification path to requested target

org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.14.1-all.zip'.

at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution.getToolingImplementationClasspath(DistributionFactory.java:129)




intellij 에서는 

Error:Cause: unable to find valid certification path to requested target


문제가 나왔다. 보통이러면.... 해당 주소의 자원이 없거나 https 라서 ssl 관련 오류이다.(방화벽)


실제로 저 url 은 문제가 없다. 회사였다...아... 방화벽


뭐 이런 형태의 오류가 여러 ... 툴이나 설정중에 간간히 있었고... 그럴때보통의 해결책은 https 로 호출되는 url 을 http 로 변경해보는거다.


gradle 설정 (gradle-wrapper.properties) 에 가서 https 라고 된 distributionUrl 프로토콜값을 https --> http 로 변경해서 다시 refresh 해보면 잘 가져온다.


근데 이건 권장하긴 좀 그렇다. 이 외에 설정을 통해 프록시설정을 해두면 https 로라도 문제 없이 가져온다. 구글신에게 물어봐라 



Arrays.stream(Cons.SIMPLE_KEY.values()).map(c -> {
System.
out.println("didn't come here");
map.put(c.name().toUpperCase(),"data");
return map;
});
Arrays.
stream(Cons.SIMPLE_KEY.values()).map(c ->
{
System.
out.println("come in");
map.put(c.name().toUpperCase(),"data");
return map;
}).
count();


두 예제의 차이점이 있다.


첫번째것은 맵에 값을 못넣고 두번째는 넣는다.

didn't come here 는 찍히지 못하고 come in 은 찍힌다.


즉 map 만 하면 람다는 그뒤에 행위가 없으므로 아예 수행조차 하지 않는다.  (일반적으로 map 은 뭔가 수행한뒤 그 스트림을 이어서 뭔가 하길 기대하기 때문이랄까? 그대로 끝나면 버려지는 결과물이라 할 이유가 없다고 판단하는듯 하다. 바로 lazy 수행임 )


count 가 됐든 뭐든 map 이후로 해야하는 행위가 있으면 처음부터 수행해 나간다.


그런데 괜히 할것 없는데 (즉 내부 맵만 변경한다던지) map 을 할 필요가 있느냐? 그런경우는  .map --> .forEach 를 쓰도록 한다.



+ Recent posts