Home
Archive for
2018
AD 連線工具:Active Directory Explorer
RojerChen.2018.11.14
最近在弄專案有需要透過 AD 做帳號的驗證,在寫程式之前需要使用連線工具來測試一下連線是否正確,以前雖然用過類似的工具,但是沒有記錄下來,太久沒用也會忘記以前用的工具是哪套了,所以這次還是紀錄一下好了。
這次我使用的工具是 Active Directory Explorer,對我來說只要輸入相關的資訊之後可以取得資訊我就當作驗證成功,驗證成功後就可以開始寫程式做測試了。
Active Directory Explorer v1.44
$.ajax is not a function
RojerChen.2018.10.17
今天發現先前改的程式 AJAX 功能失效,出現了這樣的錯誤 Uncaught TypeError: $.ajax is not a function ,查了一下,主因好像是先前更新了 bootstrap 之後,把 jquery 改成了 jquery-3.3.1.slim.min.js 這個了。
今天發現先前改的程式 AJAX 功能失效,出現了這樣的錯誤 Uncaught TypeError: $.ajax is not a function ,查了一下,主因好像是先前更新了 bootstrap 之後,把 jquery 改成了 jquery-3.3.1.slim.min.js 這個了。
DB2 on Docker
RojerChen.2018.10.11
去年處理了一個跟 DB2 有關的案子,那個時候我跟同事分工,同事處理 DB2 的環境,我來處理 ASP.NET MVC 的開發環境,由於我不想在筆電上安裝 DB2,所以每次都只能等回到公司的時候在進行開發,雖然那個時候我知道可以安裝在 Docker 的環境上,但是因為太忙而遲遲沒有研究。
沒想到,脫離這個專案一年多的時間了,最近又回來處理這個專案。既然該躲的躲不過,還是來研究一下 DB2 要如何安裝在 Docker 環境,並且有哪些設定需要處理。
TDD LeetCode:832. Flipping an Image
RojerChen.2018.10.08
Given a binary matrix
Given a binary matrix
A
, we want to flip the image horizontally, then invert it, and return the resulting image.
To flip an image horizontally means that each row of the image is reversed. For example, flipping
[1, 1, 0]
horizontally results in [0, 1, 1]
.
To invert an image means that each
0
is replaced by 1
, and each 1
is replaced by 0
. For example, inverting [0, 1, 1]
results in [1, 0, 0]
.
Example 1:
Input: [[1,1,0],[1,0,1],[0,0,0]] Output: [[1,0,0],[0,1,0],[1,1,1]] Explanation: First reverse each row: [[0,1,1],[1,0,1],[0,0,0]]. Then, invert the image: [[1,0,0],[0,1,0],[1,1,1]]
Example 2:
Input: [[1,1,0,0],[1,0,0,1],[0,1,1,1],[1,0,1,0]] Output: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]] Explanation: First reverse each row: [[0,0,1,1],[1,0,0,1],[1,1,1,0],[0,1,0,1]]. Then invert the image: [[1,1,0,0],[0,1,1,0],[0,0,0,1],[1,0,1,0]]
Notes:
1 <= A.length = A[0].length <= 20
0 <= A[i][j] <= 1
TDD LeetCode:905. Sort Array By Parity
RojerChen.2018.10.01
Given an array
A
of non-negative integers, return an array consisting of all the even elements of A
, followed by all the odd elements of A
.
You may return any answer array that satisfies this condition.
Example 1:
Input: [3,1,2,4] Output: [2,4,3,1] The outputs [4,2,3,1], [2,4,1,3], and [4,2,1,3] would also be accepted.
Note:
1 <= A.length <= 5000
0 <= A[i] <= 5000
TDD LeetCode:461. Hamming Distance
The Hamming distance between two integers is the number of positions at which the corresponding bits are different.
Given two integers
x
and y
, calculate the Hamming distance.
Note:
0 ≤
0 ≤
x
, y
< 231.
Example:
Input: x = 1, y = 4 Output: 2 Explanation: 1 (0 0 0 1) 4 (0 1 0 0) ↑ ↑ The above arrows point to positions where the corresponding bits are different.
TDD LeetCode:804. Unique Morse Code Words
RojerChen.2018.09.17
International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows:
"a"
maps to ".-"
, "b"
maps to "-..."
, "c"
maps to "-.-."
, and so on.
For convenience, the full table for the 26 letters of the English alphabet is given below:
[".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."]
Now, given a list of words, each word can be written as a concatenation of the Morse code of each letter. For example, "cab" can be written as "-.-.-....-", (which is the concatenation "-.-." + "-..." + ".-"). We'll call such a concatenation, the transformation of a word.
Return the number of different transformations among all words we have.
Example: Input: words = ["gin", "zen", "gig", "msg"] Output: 2 Explanation: The transformation of each word is: "gin" -> "--...-." "zen" -> "--...-." "gig" -> "--...--." "msg" -> "--...--." There are 2 different transformations, "--...-." and "--...--.".
Note:
- The length of
words
will be at most100
. - Each
words[i]
will have length in range[1, 12]
. words[i]
will only consist of lowercase letters.
TDD LeetCode:771. Jewels and Stones
RojerChen.2018.09.12
You're given strings
You're given strings
J
representing the types of stones that are jewels, and S
representing the stones you have. Each character in S
is a type of stone you have. You want to know how many of the stones you have are also jewels.
The letters in
J
are guaranteed distinct, and all characters in J
and S
are letters. Letters are case sensitive, so "a"
is considered a different type of stone from "A"
.
Example 1:
Input: J = "aA", S = "aAAbbbb" Output: 3
Example 2:
Input: J = "z", S = "ZZ" Output: 0
Note:
S
andJ
will consist of letters and have length at most 50.- The characters in
J
are distinct.
LeetCode:196. Delete Duplicate Emails
RojerChen.2018.08.31
今天在解 LeetCode 196. Delete Duplicate Emails 這題,剛好遇到了問題紀錄一下,以下是這題的題目。
Write a SQL query to delete all duplicate email entries in a table named
Person
, keeping only unique emails based on its smallest Id.+----+------------------+ | Id | Email | +----+------------------+ | 1 | john@example.com | | 2 | bob@example.com | | 3 | john@example.com | +----+------------------+ Id is the primary key column for this table.
For example, after running your query, the above
Person
table should have the following rows:+----+------------------+ | Id | Email | +----+------------------+ | 1 | john@example.com | | 2 | bob@example.com | +----+------------------+
Note:
Your output is the whole
Person
table after executing your sql. Use delete
statement.Jasper Report : Subreport overflowed on a band that does not support overflow.
RojerChen.2018.07.19
最近在處理 Jasper Report 遇到了這樣的問題
net.sf.jasperreports.engine.JRRuntimeException: Subreport overflowed on a band that does not support overflow.
at net.sf.jasperreports.engine.fill.FillerSubreportParent.addPage(FillerSubreportParent.java:114)
at net.sf.jasperreports.engine.fill.JRBaseFiller.addPageToParent(JRBaseFiller.java:1272)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.addPage(JRVerticalFiller.java:1834)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageBreak(JRVerticalFiller.java:1921)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBreak(JRVerticalFiller.java:1950)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:728)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:259)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:119)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:558)
at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:414)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:746)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:58)
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:216)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
java.lang.RuntimeException
最近在處理 Jasper Report 遇到了這樣的問題
net.sf.jasperreports.engine.JRRuntimeException: Subreport overflowed on a band that does not support overflow.
at net.sf.jasperreports.engine.fill.FillerSubreportParent.addPage(FillerSubreportParent.java:114)
at net.sf.jasperreports.engine.fill.JRBaseFiller.addPageToParent(JRBaseFiller.java:1272)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.addPage(JRVerticalFiller.java:1834)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillPageBreak(JRVerticalFiller.java:1921)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBreak(JRVerticalFiller.java:1950)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:728)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:259)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:119)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:558)
at net.sf.jasperreports.engine.fill.BaseReportFiller.fill(BaseReportFiller.java:414)
at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:746)
at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:58)
at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:216)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
java.lang.RuntimeException
SQL Server on Container 初體驗
RojerChen.2018.04.05
過往在使用 SQL Server 的時候,都是在 Windows 的環境下執行,隨著 Microsoft 愛上了 Linux,現在 SQL Server 可以運行在 Linux 上了,更可以運行在 Container 的環境下,這樣 Windows 環境又可以更乾淨一些了。
先前都沒有甚麼時間測試,近期剛好有空就直接在 Windows 10 的環境上面讓 SQL Server 運行在 Docker 上看看。
過往在使用 SQL Server 的時候,都是在 Windows 的環境下執行,隨著 Microsoft 愛上了 Linux,現在 SQL Server 可以運行在 Linux 上了,更可以運行在 Container 的環境下,這樣 Windows 環境又可以更乾淨一些了。
先前都沒有甚麼時間測試,近期剛好有空就直接在 Windows 10 的環境上面讓 SQL Server 運行在 Docker 上看看。
訂閱:
文章
(
Atom
)