Mask RCNN training์ ์ค๋ฅ๊ฐ ๋ ๊ฒฝ์ฐ
model.py๋ฅผ ์๋์ฒ๋ผ ์์ ํด ์ค๋ค.
AttributeError: module 'keras.engine.topology' has no attribute 'load_weights_from_hdf5_group_by_name'
** topology --> saving์ผ๋ก ๋ณ๊ฒฝ
Mask RCNN training์ ์ค๋ฅ๊ฐ ๋ ๊ฒฝ์ฐ
model.py๋ฅผ ์๋์ฒ๋ผ ์์ ํด ์ค๋ค.
AttributeError: module 'keras.engine.topology' has no attribute 'load_weights_from_hdf5_group_by_name'
** topology --> saving์ผ๋ก ๋ณ๊ฒฝ
def get_query(model_name):
return {
'a': 'SELECT * FROM TB_MODEL WHERE MODEL=\'a\'',
'b': 'SELECT * FROM TB_MODEL WHERE MODEL=\'b\'',
'c': 'SELECT * FROM TB_MODEL WHERE MODEL=\'c\'',
'd': 'SELECT * FROM TB_MODEL WHERE MODEL=\'d\'',
'e': 'SELECT * FROM TB_MODEL WHERE MODEL=\'e\'',
'f': 'SELECT * FROM TB_MODEL WHERE MODEL=\'f\'',
'g': 'SELECT * FROM TB_MODEL WHERE MODEL=\'g\''
}[model_name]
strings = ["first", "", "second ", " "]
strings = [x.strip() for x in strings if x.strip()]
๊ฒฐ๊ณผ : ["first", "second"]
public abstract class HostApduService
extends Service
java.lang.Object | ||||
โณ | android.content.Context | |||
โณ | android.content.ContextWrapper | |||
โณ | android.app.Service | |||
โณ | android.nfc.cardemulation.HostApduService |
HostApduService is a convenience Service
class that can be extended to emulate an NFC card inside an Android service component.
Cards emulated by this class are based on the NFC-Forum ISO-DEP protocol (based on ISO/IEC 14443-4) and support processing command Application Protocol Data Units (APDUs) as defined in the ISO/IEC 7816-4 specification.
When a remote NFC device wants to talk to your service, it sends a so-called "SELECT AID" APDU as defined in the ISO/IEC 7816-4 specification. The AID is an application identifier defined in ISO/IEC 7816-4.
The registration procedure for AIDs is defined in the ISO/IEC 7816-5 specification. If you don't want to register an AID, you are free to use AIDs in the proprietary range: bits 8-5 of the first byte must each be set to '1'. For example, "0xF00102030405" is a proprietary AID. If you do use proprietary AIDs, it is recommended to choose an AID of at least 6 bytes, to reduce the risk of collisions with other applications that might be using proprietary AIDs as well.
In some cases, a service may need to register multiple AIDs to implement a certain application, and it needs to be sure that it is the default handler for all of these AIDs (as opposed to some AIDs in the group going to another service).
An AID group is a list of AIDs that should be considered as belonging together by the OS. For all AIDs in an AID group, the OS will guarantee one of the following:
In other words, there is no in-between state, where some AIDs in the group can be routed to this service, and some to another.
Each AID group can be associated with a category. This allows the Android OS to classify services, and it allows the user to set defaults at the category level instead of the AID level.
You can use isDefaultServiceForCategory(android.content.ComponentName, String)
to determine if your service is the default handler for a category.
In this version of the platform, the only known categories are CATEGORY_PAYMENT
and CATEGORY_OTHER
. AID groups without a category, or with a category that is not recognized by the current platform version, will automatically be grouped into the CATEGORY_OTHER
category.
To tell the platform which AIDs groups are requested by this service, a SERVICE_META_DATA
entry must be included in the declaration of the service. An example of a HostApduService manifest declaration is shown below:
<service android:name=".MyHostApduService" android:exported="true" android:permission="android.permission.BIND_NFC_SERVICE">
<intent-filter>
<action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE"/>
</intent-filter>
<meta-data android:name="android.nfc.cardemulation.host_apdu_ervice" android:resource="@xml/apduservice"/>
</service>
This meta-data tag points to an apduservice.xml file. An example of this file with a single AID group declaration is shown below:
<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
android:description="@string/servicedesc" android:requireDeviceUnlock="false">
<aid-group android:description="@string/aiddescription" android:category="other">
<aid-filter android:name="F0010203040506"/>
<aid-filter android:name="F0394148148100"/>
</aid-group>
</host-apdu-service>
The <host-apdu-service>
is required to contain a <android:description>
attribute that contains a user-friendly description of the service that may be shown in UI. The <requireDeviceUnlock>
attribute can be used to specify that the device must be unlocked before this service can be invoked to handle APDUs.
The <host-apdu-service>
must contain one or more <aid-group>
tags. Each <aid-group>
must contain one or more <aid-filter>
tags, each of which contains a single AID. The AID must be specified in hexadecimal format, and contain an even number of characters.
Multiple HostApduServices may be installed on a single device, and the same AID can be registered by more than one service. The Android platform resolves AID conflicts depending on which category an AID belongs to. Each category may have a different conflict resolution policy. For example, for some categories the user may be able to select a default service in the Android settings UI. For other categories, to policy may be to always ask the user which service is to be invoked in case of conflict. To query the conflict resolution policy for a certain category, see getSelectionModeForCategory(String)
.
Once the platform has resolved a "SELECT AID" command APDU to a specific service component, the "SELECT AID" command APDU and all subsequent command APDUs will be sent to that service through processCommandApdu(byte[], Bundle)
, until either:
These two scenarios are indicated by a call to onDeactivated(int)
.
Use of this class requires the FEATURE_NFC_HOST_CARD_EMULATION
to be present on the device.
Constants | |
---|---|
int | DEACTIVATION_DESELECTED Reason for |
int | DEACTIVATION_LINK_LOSS Reason for |
String | SERVICE_INTERFACE The |
String | SERVICE_META_DATA The name of the meta-data element that contains more information about this service. |
Inherited constants |
---|
![]() android.app.Service |
![]() android.content.Context |
![]() android.content.ComponentCallbacks2 |
Public constructors | |
---|---|
HostApduService() |
Public methods | |
---|---|
final void | notifyUnhandled() Calling this method allows the service to tell the OS that it won't be able to complete this transaction - for example, because it requires data connectivity that is not present at that moment. |
final IBinder | onBind(Intent intent) Return the communication channel to the service. |
abstract void | onDeactivated(int reason) This method will be called in two possible scenarios: |
abstract byte[] | processCommandApdu(byte[] commandApdu, Bundle extras) This method will be called when a command APDU has been received from a remote device. |
final void | sendResponseApdu(byte[] responseApdu) Sends a response APDU back to the remote device. |
Inherited methods | |
---|---|
![]() android.app.Service | |
![]() android.content.ContextWrapper | |
![]() android.content.Context | |
![]() java.lang.Object | |
![]() android.content.ComponentCallbacks2 | |
![]() android.content.ComponentCallbacks |
int DEACTIVATION_DESELECTED
Reason for onDeactivated(int)
.
Indicates deactivation was due to a different AID being selected (which implicitly deselects the AID currently active on the logical channel).
Note that this next AID may still be resolved to this service, in which case processCommandApdu(byte[], Bundle)
will be called again.
Constant Value: 1 (0x00000001)
int DEACTIVATION_LINK_LOSS
Reason for onDeactivated(int)
. Indicates deactivation was due to the NFC link being lost.
Constant Value: 0 (0x00000000)
String SERVICE_INTERFACE
The Intent
action that must be declared as handled by the service.
Constant Value: "android.nfc.cardemulation.action.HOST_APDU_SERVICE"
String SERVICE_META_DATA
The name of the meta-data element that contains more information about this service.
Constant Value: "android.nfc.cardemulation.host_apdu_service"
void notifyUnhandled ()
Calling this method allows the service to tell the OS that it won't be able to complete this transaction - for example, because it requires data connectivity that is not present at that moment. The OS may use this indication to give the user a list of alternative applications that can handle the last AID that was selected. If the user would select an application from the list, that action by itself will not cause the default to be changed; the selected application will be invoked for the next tap only. If there are no other applications that can handle this transaction, the OS will show an error dialog indicating your service could not complete the transaction.
Note: this method may be called anywhere between the first processCommandApdu(byte[], Bundle)
call and a onDeactivated(int)
call.
IBinder onBind (Intent intent)
Return the communication channel to the service. May return null if clients can not bind to the service. The returned IBinder
is usually for a complex interface that has been described using aidl.
Note that unlike other application components, calls on to the IBinder interface returned here may not happen on the main thread of the process. More information about the main thread can be found in Processes and Threads.
Parameters | |
---|---|
intent | Intent : The Intent that was used to bind to this service, as given to Context.bindService . Note that any extras that were included with the Intent at that point will not be seen here. |
Returns | |
---|---|
IBinder | Return an IBinder through which clients can call on to the service. |
void onDeactivated (int reason)
This method will be called in two possible scenarios:
Parameters | |
---|---|
reason | int : Either DEACTIVATION_LINK_LOSS or DEACTIVATION_DESELECTED |
byte[] processCommandApdu (byte[] commandApdu, Bundle extras)
This method will be called when a command APDU has been received from a remote device. A response APDU can be provided directly by returning a byte-array in this method. Note that in general response APDUs must be sent as quickly as possible, given the fact that the user is likely holding his device over an NFC reader when this method is called.
If there are multiple services that have registered for the same AIDs in their meta-data entry, you will only get called if the user has explicitly selected your service, either as a default or just for the next tap.
This method is running on the main thread of your application. If you cannot return a response APDU immediately, return null and use the sendResponseApdu(byte[])
method later.
Parameters | |
---|---|
commandApdu | byte : The APDU that was received from the remote device |
extras | Bundle : A bundle containing extra data. May be null. |
Returns | |
---|---|
byte[] | a byte-array containing the response APDU, or null if no response APDU can be sent at this point. |
void sendResponseApdu (byte[] responseApdu)
Sends a response APDU back to the remote device.
Note: this method may be called from any thread and will not block.
Parameters | |
---|---|
responseApdu | byte : A byte-array containing the reponse APDU. |
์ผ๋ฐ์ ์ผ๋ก javascript ๋๋ฒ๊น
์์๋ alert()๋ฅผ ์ฃผ๋ก ์ฌ์ฉํ๊ฒ ๋์ง๋ง, alert๋ฅผ ์คํ ํ๋ ์๊ฐ script๊ฐ ๋ฉ์ถ๊ธฐ
๋๋ฌธ์ ๋๋ฒ๊น
์ด ์ด๋ ค์ด ๊ฒฝ์ฐ๊ฐ ์๋ค.
์ด๋ฐ ๋จ์ ์ ๊ทน๋ณตํ ์ ์๋ ์ ์ฉํ Javascript ๋๋ฒ๊น
์์ง์ ์๊ฐ ํ๋ค.
์ด๋ฆํ์ฌ blackbird(http://www.gscottolson.com/blackbirdjs/).
์ฌ์ฉ๋ฐฉ๋ฒ์ ์์ถํ์ผ์ ํ์ด์ blackbird.css, blackbird.js, blackbird_panel.png, blackbird_icons.png ํ์ผ์ ์นํด๋์ ๋ณต์ฌํ ํ ์์ค์ฝ๋ ๊ฐ๊ฐ ์๋ ์ฒ๋ผ ์ถ๊ฐ ํ๊ณ (๋ฌผ๋ก href ๋ฐ src ๊ฒฝ๋ก๋ ๋ณธ์ธ์ ์นํด๋ ๊ฒฝ๋ก๋ก ์ค์ผ ํ๋ค),
<link type="text/css" rel="Stylesheet" href="/blackbird.css" />
< script type="text/javascript" src="/blackbird.js"></script>
javascript๋ก ๋ค์๊ณผ ๊ฐ์ด ๋๋ฒ๊น
์ ํ ์ ์๋ค.
log.debug( 'this is a debug message' );
log.info( 'this is an info message' );
log.warn( 'this is a warning message' );
log.error( 'this is an error message' );
* ์ฃผ์: ์ฌ๊ธฐ ๊น์ง๊ฐ ํํ์ด์ง์ ์๊ฐ๋ ๋ด์ฉ์ธ๋ฐ, ์ฌ์ค ์ด๋๋ก ํด๋ณด๋ฉด Javascript ์ค๋ฅ๊ฐ ๋๋ฉด์ ๋์์ ํ์ง ์๋๋ค.
๋ฐ๋์ ์๋์ ๊ฐ์ด DTD์ ์ธ์ ํด์ค์ผ ํ๋ค(์ด๊ฒ ์ฐพ๋๋ผ ์ ๋จน์์).
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
๋ํ ์ฒ์์ ๋๋ฒ๊น
ํ๋ฌ์ด ๋ํ๋์ง ์์ผ๋ฉด F2๋ฅผ ๋๋ฅด๋ฉด ๋๋ค.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 |
<script type= "text/javascript" > <!-- //๋ ์ง ์ ํจ์ฑ๊ฒ์ฌ if ( !isValidDate( '2014-11-31' ) ) { alert( '์๋ฌ' ); } else { alert( '์ ์' ); } function isValidDate(param) { try { param = param.replace(/-/g, '' ); // ์๋ฆฌ์๊ฐ ๋ง์ง์์๋ if ( isNaN(param) || param.length!=8 ) { return false ; } var year = Number(param.substring(0, 4)); var month = Number(param.substring(4, 6)); var day = Number(param.substring(6, 8)); var dd = day / 0; if ( month<1 || month>12 ) { return false ; } var maxDaysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; var maxDay = maxDaysInMonth[month-1]; // ์ค๋
์ฒดํฌ if ( month==2 && ( year%4==0 && year%100!=0 || year%400==0 ) ) { maxDay = 29; } if ( day<=0 || day>maxDay ) { return false ; } return true ; } catch (err) { return false ; } } //--> </script> |
1. The Swift Programming Language
https://developer.apple.com/swift/resources/
2. The Swift Programming Language(ํ๊ธ)
http://swift.leantra.kr/
3. Using Swift with Cocoa and Objective-C
https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/
4. OBJC(์ ๋ฃ)
http://www.objc.io/
5. NSHipster
http://nshipster.com/
6. (ํ๊ธ)OSXDEV ์ปค๋ฎค๋ํฐ
http://www.osxdev.org/forum/index.php
7. (ํ๊ธ)Swift Korea ํ์ด์ค๋ถ ๊ทธ๋ฃน
https://www.facebook.com/groups/swiftkor/
8. (ํ๊ธ)์ค์ํํธ ๋ฉ ์ปค๋ฎค๋ํฐ
http://swiftlab.kr/
9. (ํ๊ธ)๋งฅ๋ถ๊ธฐ
http://cafe.naver.com/mcbugi
10. ์คํ ํฌ๋ ๋ํ ๊ฐ์ Developing iOS 8 Apps with Swift
http://itunes.apple.com/kr/course/developing-ios-8-apps-swift/id961180099
11. Raywenderlich
http://www.raywenderlich.com/
12. (ํ๊ธ/iOS ๊ฐ๋ฐ์)์ผ๊ณฐ๋์ ๋ธ๋ก๊ทธ
http://blog.yagom.net/
13. (ํ๊ธ/iOS ๊ฐ๋ฐ์)๊น๊ทผ์ ๊ฐ๋ฐ์ ๋ธ๋ก๊ทธ
http://meetkei.com/
14. (ํ๊ธ)์ค์ํํธ ํ์ด์ค๋ถ ๊ทธ๋ฃน
https://www.facebook.com/groups/iOSandSwift/
์์ดํ , ์์ดํจ๋์์ ๊ฐ์๋ฅผ ๋ค์ ์ ์์ต๋๋ค.
Developing iOS8 Apps with Swift (์คํ ํฌ๋ ๋ํ ๊ฐ์)
์ด 40๊ฐ์ผ๋ก, ์ ๋๋ก๋ง ์์๋ค์ผ๋ฉด ๋ฌด์ฒ ์ข์ ๊ฐ์๋ผ ์๊ฐ ๋ฉ๋๋ค.
์์ดํฐ, ์์ดํจ๋์์ ๋ฌด๋ฃ๋ก ๋ค์ด ๋ฐ์ ์ ์๊ตฌ์...
๋จ, Itunes U๋ฅผ ์ค์น ํด์ผ ํฉ๋๋ค.
https://itunes.apple.com/kr/course/developing-ios-8-apps-swift/id961180099
Paul Solt์ ๊ณ ๊ธ ๊ฐ์
๊ฐ์ ์ฃผ์ ๊ฐ ์ข Advanced ํ๊ฒ ๊ฐ์ต๋๋ค.
Case by Case๋ก ์ฐพ์์ ๋ฃ๋๊ฒ ์ข์๊ฒ ๊ฐ์ต๋๋ค.
https://www.youtube.com/user/PaulSolt/playlists
How to make an App with swift, Xoce 6 and iOS 8 - Start Here
18๊ฐ์ ๊ฐ์๋ฅผ ๋ฐ๋ผํ๋ค ๋ณด๋ฉด ๊ฐ๋จํ ์นด๋๊ฒ์์ ๋ง๋ค ์ ์๋ค๊ณ ํฉ๋๋ค.
https://www.youtube.com/playlist?list=PLMRqhzcHGw1Z0S7hpE30r2lwnovSHMntI