2020. 4. 16. 10:34

VisualStudio 오류를 확인하던 중 ASCII 값에 대한 내용을 기록으로 남깁니다. ^^

 

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.CodeAnalysis.FindUsages.DefinitionItem.Create(ImmutableArray`1 tags, ImmutableArray`1 displayParts, ImmutableArray`1 sourceSpans, ImmutableArray`1 nameDisplayParts, ImmutableDictionary`2 properties, Boolean displayIfNoReferences)
   at Microsoft.CodeAnalysis.FindUsages.DefinitionItem.Create(ImmutableArray`1 tags, ImmutableArray`1 displayParts, ImmutableArray`1 sourceSpans, ImmutableArray`1 nameDisplayParts, Boolean displayIfNoReferences)
   at Microsoft.CodeAnalysis.Editor.TypeScript.Features.GoToDefinition.NamedDefinitionItemExtensions.TryGetNavigableDefinitionItem(NamedDefinitionItem namedDefinition, Project currentProject, IFilePathDefinitionItemProvider filePathDefinitionItemProvider, JoinableTaskContext joinableTaskContext, DefinitionItem& definitionItem)
   at Microsoft.CodeAnalysis.Editor.TypeScript.Features.GoToDefinition.TypeScriptGoToSymbolService.<GetSymbolsAsync>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.CodeAnalysis.Editor.NavigableSymbols.NavigableSymbolService.NavigableSymbolSource.<GetNavigableSymbolAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<QueryNavigableSymbolAsync>d__35.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanHelperAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanHelperAsync>d__33.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<>c__DisplayClass32_0.<<SetMouseCursorAndNavigableSpanAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__78.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Threading.JoinableTask`1.<JoinAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.<CallExtensionPointAsync>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
더보기
System.NullReferenceException: Object reference not set to an instance of an object.    at Microsoft.CodeAnalysis.FindUsages.DefinitionItem.Create(ImmutableArray`1 tags, ImmutableArray`1 displayParts, ImmutableArray`1 sourceSpans, ImmutableArray`1 nameDisplayParts, ImmutableDictionary`2 properties, Boolean displayIfNoReferences)    at Microsoft.CodeAnalysis.FindUsages.DefinitionItem.Create(ImmutableArray`1 tags, ImmutableArray`1 displayParts, ImmutableArray`1 sourceSpans, ImmutableArray`1 nameDisplayParts, Boolean displayIfNoReferences)    at Microsoft.CodeAnalysis.Editor.TypeScript.Features.GoToDefinition.NamedDefinitionItemExtensions.TryGetNavigableDefinitionItem(NamedDefinitionItem namedDefinition, Project currentProject, IFilePathDefinitionItemProvider filePathDefinitionItemProvider, JoinableTaskContext joinableTaskContext, DefinitionItem& definitionItem)    at Microsoft.CodeAnalysis.Editor.TypeScript.Features.GoToDefinition.TypeScriptGoToSymbolService.<GetSymbolsAsync>d__4.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.CodeAnalysis.Editor.NavigableSymbols.NavigableSymbolService.NavigableSymbolSource.<GetNavigableSymbolAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<QueryNavigableSymbolAsync>d__35.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanHelperAsync>d__33.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanHelperAsync>d__33.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<>c__DisplayClass32_0.<<SetMouseCursorAndNavigableSpanAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.VisualStudio.Threading.JoinableTask.<JoinAsync>d__78.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.VisualStudio.Threading.JoinableTask`1.<JoinAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.VisualStudio.Language.Intellisense.Implementation.GoToDefMouseHandler.<SetMouseCursorAndNavigableSpanAsync>d__32.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)    at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.<CallExtensionPointAsync>d__32.MoveNext() --- End of stack trace from previous location where exception was thrown ---    at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)

 

 

 

https://www.facebook.com/groups/MHVB.Net/permalink/1679882212162998/

 

보안 확인 필요

메뉴를 열려면 alt + / 키 조합을 누르세요

www.facebook.com

 

행복한 고수되셔요.

 

woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\




Posted by woojja

댓글을 달아 주세요

ls -l 명령어는 사용가능하지만 ll 명령어는 찾을 수 없다는 메세지를 뱉을 때는...

 

sudo nano ~/.bashrc 를 입력하여 

주석처리되어 있는 아래 구문의 주석을 제거해준다.

#alias ll='ls -l' 

#alias la='ls -A'

#alias l='ls -CF'

 

이보다 먼저

sudo nano .bash_profile

를 열어

export PATH=%PATH:/bin:/usr/local/bin:/usr/bin

가 추가되어 있는지 확인해 보는 것도 좋다.

 

 

행복한 고수되셔요.

woojja ))*

\\\\\\\\\\\\\\\\\\\\\




'ETC > Raspberry Pi' 카테고리의 다른 글

[Raspberry Pi] ll, la 명령어 활성하는 방법  (0) 2020.03.12
[Raspberry Pi] WiFi 설정  (0) 2020.03.11
[Raspberry Pi] Raspberry pi SSH 연결  (0) 2020.03.11
Posted by woojja

댓글을 달아 주세요

windows command 창에서 ipconfig 명령어와 같은 명령어로

ifconfig 와  iwconfig 가 있다.

 

raspberry pi 의 기본 wifi 는 wlan0 으로 설정되어 있다.

 

sudo raspi-config 를 통해 wifi 설정이 가능하며

wifi 설정 이전에 국가 코드를 입력하는 화면이 나타나며

오류가 발생할 수 있으므로 기본 GB (영국) 을 수정하지 않았다.

SSID 명과 비밀번호를 입력하면 설정이 끝난다.

 

아래 명령을 통해 주변의 AccessPoint 를 검색하는 것도 가능하다.

sudo iwlist wlan0 scan

 

SSID 를 알고 있는 경우 아래와 같이 입력하여 지정가능하다.

sudo wpa_passphrase ssid password

==> sudo wpa_passphrase WoojjaAccessPoint WoojjaPassword

 

iwconfig 나 ifconfig 명령을 통해서 wlan0 이 설정되어 있는지 확인한다.

하지만 AccessPoint 가 숨김처리 되어 있다면 위 그림과 같이 연결되지 않을 수 있다.

 

이런 경우 아래 명령을 통해 해당 파일을 열어 

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

 

다음과 같이 추가할 구문이 있다.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
        ssid="WoojjaAccessPoint_SSID"
        #psk="WoojjaPassword"
        psk=98698b6c797140f3bWoojjaPassword53c04c5ed47948796e4920
}


==> 

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
        ssid="WoojjaAccessPoint_SSID"
        scan_ssid=1
        mode=0
        proto=WPA2
        pairwise=TKIP
        group=TKIP
        key_mgmt=WPA-PSK
        #psk="WoojjaPassword"
        psk=98698b6c797140f3bWoojjaPassword53c04c5ed47948796e4920
}

sudo reboot 명령을 실행하여  Reboot 한다.

 

잘 안되는 경우 해당 wlan0 내렸다가 올리는 명령어도 존재한다.

sudo ifconfig wlan0 down

sudo ifconfig wlan0 up

 

 

 

아래 글을 참고했습니다. 고맙습니다.

https://webnautes.tistory.com/903

 

Raspberry Pi 3 에서 무선랜(WiFi) 설정하는 방법

Raspberry Pi 3에 내장된 무선랜(WiFi)를 사용하기 위해 필요한 설정 방법에 대해서 다룹니다. 1. raspi-config를 사용시 문제점 2. 커맨드 명령으로 WiFi 연결 설정 및 테스트 3. 두 장소 이상에서 무선랜(WIFI)..

webnautes.tistory.com

 

행복한 고수되셔요.

 

woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\




'ETC > Raspberry Pi' 카테고리의 다른 글

[Raspberry Pi] ll, la 명령어 활성하는 방법  (0) 2020.03.12
[Raspberry Pi] WiFi 설정  (0) 2020.03.11
[Raspberry Pi] Raspberry pi SSH 연결  (0) 2020.03.11
Posted by woojja

댓글을 달아 주세요

ping raspberrypi.local

ping -4 raspberrypi.local

 

ssh pi@192.168.0.106 (IP Address)

 

행복한 고수되셔요.

 

woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\




'ETC > Raspberry Pi' 카테고리의 다른 글

[Raspberry Pi] ll, la 명령어 활성하는 방법  (0) 2020.03.12
[Raspberry Pi] WiFi 설정  (0) 2020.03.11
[Raspberry Pi] Raspberry pi SSH 연결  (0) 2020.03.11
Posted by woojja

댓글을 달아 주세요

2019. 1. 13. 17:07


Machine Learning, Deep Learning 을 배우는 과정에서 Anaconda 가 필요합니다.


https://www.anaconda.com/download/


에서 Anaconda 를 Download 받아 설치합니다.




다음은 Jupyter note 의 간단한 사용 방법입니다.



Cell 실행 : Shift + Enter

Edit mode : Enter

Command  mode : ESC


Command mode 에서  a 혹은 b : Cell 추가


a=4

print(a) 


함수 위에서 Shift + Tab : 함수 설명  

. (Comma) 다음에 Tab : 자동완성




행복한 고수되셔요.~~ 


^^*

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\




Posted by woojja

댓글을 달아 주세요

재미있네요. 


Python 을 좀 보고 있는데요.

글 제목 처럼 Python 에서는 Global Scope 에 있는 변수의 값을 Local Scope 의 코드에서 변경할 수 없대요. 



n = 1

print('Return value of n : ' + str(n))

def func1(g):
return g + n

print('Return value of func1 : ' + str(func1(1)))


def func2(h):
n = 2
return h + n

print('Return value of func2 : ' + str(func2(1)))

print('Return value of n : ' + str(n))



이 녀석들의 결과 값은...



Return value of n : 1

Return value of func1 : 2

Return value of func2 : 3

Return value of n : 1



이렇습니다. ^^;

다른 언어와는 좀 다르네요.




Global Scope 변수의 값을 변경 하려면 이렇게 해야겠네요.



n = 1


print('Return value of n : ' + str(n))


def func3(h):
n = 2
return h + n , n

return_value = func3(5)
print('Return value of func3 : ' + str(return_value[0]))

n = return_value[1]
print('Return value of n : ' + str(n))




이렇게 하면...


Return value of n : 1

Return value of func3 : 7

Return value of n : 2



요렇게 나옵니다. ^^


재밌다고 해야할까요? 여튼 새로운 사실을 하나 알았네요...



행복한 고수되셔요... ^^


woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\







Posted by woojja

댓글을 달아 주세요

  1. 2018.01.16 09:15

    그래서 global 이라는 예약어가 있습니다.

    https://www.quora.com/How-can-I-globally-change-a-variable-from-a-function-in-Python

    (실은 저도 이 글보고 찾아봤어요. ^^ 저도 python 뉴비입니다.)

2017. 10. 12. 10:50


File Header 정보를 확인해 볼 수 있는 페이지 입니다.


참고삼아 올려봅니다.



http://www.garykessler.net/library/file_sigs.html



행복한 고수되셔요 ^^


woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\




Posted by woojja

댓글을 달아 주세요

 

Diagram Database importer 를 이용하면 Database 의 전체 Hirearchy를 import 하는 것이 가능하며, Database Entity 관계 다이어그램을 쉽게 생성할 수 있다.

 

Nevron Diagram 은 Table 형태의 데이터 Source 로부터 트리형태와 그래프 데이터 구조로 자동으로 가져오기 기능을 제공한다. 

Data import 기능은 DataTable, DataView, OleDbDataAdapter, SqlDataAdapter, OdbcDataAdapter, OleDbCommand, SqlCommand, OdbcCommand 등, 각 data Source 별로 지원한다.

data 가져오기 기능은 저장된 데이터 정보를 제어할 수 있도록 도와준다.

 

다음 예제는 NGraphDatasourceImporter 를 사용하는 방법을 보여주는데, 단순 Access 데이터베이스에서 데이터를 import 하여 자동으로 Graph 데이터구조로 자동 배열한다.

 

pages 테이블의 컬럼내용

 

Link 테이블의 컬럼 내용

 

자동으로 생성된 Diagram

 

C#

using Nevron.GraphicsCore;
using Nevron.Diagram;
using Nevron.Diagram.Shapes;
using Nevron.Diagram.WinForm;
using Nevron.Diagram.Layout;
using Nevron.Diagram.DataImport;
private void Form1_Load(object sender, System.EventArgs e)
{
    // View 초기화 시작 
    DrawingView.BeginInit();
  
    // View 에서 document 표시
    DrawingView.Document = DrawingDocument;
  
    // view 설정 
    DrawingView.ViewLayout = ViewLayout.Fit;
    DrawingView.Grid.Visible = false;
    DrawingView.GlobalVisibility.ShowPorts = false;
    DrawingView.HorizontalRuler.Visible = false;
    DrawingView.VerticalRuler.Visible = false;
      
    // stylesheets 생성 - one for the vertices and one for the edges
    NStyleSheet vertexStyleSheet = new NStyleSheet();
    vertexStyleSheet.Name = "Vertices";
    DrawingDocument.StyleSheets.AddChild(vertexStyleSheet);
  
    NStyleSheet edgeStyleSheet = new NStyleSheet();
    edgeStyleSheet.Name = "Edges";
    edgeStyleSheet.Style.StartArrowheadStyle = new NArrowheadStyle(ArrowheadShape.Circle, "", new NSizeL(5, 5), new NColorFillStyle(Color.Gray), new NStrokeStyle(1, Color.Black));
    edgeStyleSheet.Style.EndArrowheadStyle = new NArrowheadStyle(ArrowheadShape.Arrow, "", new NSizeL(5, 5), new NColorFillStyle(Color.Gray), new NStrokeStyle(1, Color.Black));
    DrawingDocument.StyleSheets.AddChild(edgeStyleSheet);
  
    // graph data source importer 설정 
    NGraphDataSourceImporter GraphImporter = new NGraphDataSourceImporter();
  
    // set the document in the active layer of which the shapes will be imported
    GraphImporter.Document = DrawingDocument;
  
    // set the connection string, data sources and DataAdapters
    // in this example we have created two OleDbDataAdapters: 
    // the PagesDataAdapter selects all records and columns from the Pages table of the SiteMap.mdb
    // the LinksDataAdapter selects all records and columns from the Links table of the SiteMap.mdb
    string connString = @"Data Source=""" + Application.StartupPath +
@"\SiteMap.mdb"";Provider=""Microsoft.Jet.OLEDB.4.0"";";
    OleDbDataAdapter PagesDataAdapter = new OleDbDataAdapter("SELECT * FROM Pages", connString);
    OleDbDataAdapter LinksDataAdapter = new OleDbDataAdapter("SELECT * FROM Links", connString);
  
    GraphImporter.VertexDataSource = PagesDataAdapter;
    GraphImporter.EdgeDataSource = LinksDataAdapter;
  
    // vertex records are uniquely identified by their Id (in the Pages table)
    // edges link the vertices with the FromPageId and ToPageId (in the Links table)
    GraphImporter.VertexIdColumnName = "Id";
    GraphImporter.FromVertexIdColumnName = "FromPageId";
    GraphImporter.ToVertexIdColumnName = "ToPageId";
      
    // create vertices as rectangles shapes, with default size (60, 30)
    NBasicShapesFactory shapesFactory = new NBasicShapesFactory();
    shapesFactory.DefaultSize = new NSizeF(60, 30);
    GraphImporter.VertexShapesFactory = shapesFactory;
    GraphImporter.VertexShapesName = BasicShapes.Rectangle.ToString();
  
    // set stylesheets to be applied to imported vertices and edges
    GraphImporter.VertexStyleSheetName = "Vertices";
    GraphImporter.EdgeStyleSheetName = "Edges";
  
    // layered graph layout 사용
    NLayeredGraphLayout layout = new NLayeredGraphLayout();
    layout.Direction = LayoutDirection.TopToBottom;
    layout.LayerAlignment = RelativeAlignment.Near;
    GraphImporter.Layout = layout;
  
    // subscribe for the vertex imported event,
    // which is raised when a shape was created for a data source record
    GraphImporter.VertexImported += new ShapeImportedDelegate(OnVertexImported);
  
    // 가져오기
    GraphImporter.Import();
  
    // view 초기화 끝
    DrawingView.EndInit();
  
}
  
private void OnVertexImported(NDataSourceImporter dataSourceImporter, NShape shape, INDataRecord record)
{
    // display the page title in the shape
    object text = record.GetColumnValue("Title");
    if (text == null)
    {
        shape.Text = "Title not specified";
    }
    else
    {
        shape.Text = text.ToString();
    }
  
    shape.SizeToText(new NMarginsF(10));
      
}

 

VB.NET

 

Imports Nevron.GraphicsCore
Imports Nevron.Diagram
Imports Nevron.Diagram.Shapes
Imports Nevron.Diagram.WinForm
Imports Nevron.Diagram.Layout
Imports Nevron.Diagram.DataImport
...
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    ' begin view init 
    DrawingView.BeginInit()
  
    ' display the document in the view 
    DrawingView.Document = DrawingDocument
  
    ' configure the view 
    DrawingView.ViewLayout = ViewLayout.Fit
    DrawingView.Grid.Visible = False
    DrawingView.GlobalVisibility.ShowPorts = False
    DrawingView.HorizontalRuler.Visible = False
    DrawingView.VerticalRuler.Visible = False
  
    ' create two stylesheets - one for the vertices and one for the edges 
    Dim vertexStyleSheet As New NStyleSheet()
    vertexStyleSheet.Name = "Vertices"
    DrawingDocument.StyleSheets.AddChild(vertexStyleSheet)
  
    Dim edgeStyleSheet As New NStyleSheet()
    edgeStyleSheet.Name = "Edges"
    edgeStyleSheet.Style.StartArrowheadStyle = New NArrowheadStyle(ArrowheadShape.Circle, "", New NSizeL(5, 5), New NColorFillStyle(Color.Gray), New NStrokeStyle(1, Color.Black))
    edgeStyleSheet.Style.EndArrowheadStyle = New NArrowheadStyle(ArrowheadShape.Arrow, "", New NSizeL(5, 5), New NColorFillStyle(Color.Gray), New NStrokeStyle(1, Color.Black))
    DrawingDocument.StyleSheets.AddChild(edgeStyleSheet)
  
    ' configure the graph data source importer 
    Dim GraphImporter As New NGraphDataSourceImporter()
  
    ' set the document in the active layer of which the shapes will be imported 
    GraphImporter.Document = DrawingDocument
  
    ' set the connection string, data sources and DataAdapters 
    ' in this example we have created two OleDbDataAdapters:  
    ' the PagesDataAdapter selects all records and columns from the Pages table of the SiteMap.mdb 
    ' the LinksDataAdapter selects all records and columns from the Links table of the SiteMap.mdb 
    Dim connString As String = "Data Source=""" + Application.StartupPath + "\SiteMap.mdb"";Provider=""Microsoft.Jet.OLEDB.4.0"";"
    Dim PagesDataAdapter As New OleDbDataAdapter("SELECT * FROM Pages", connString)
    Dim LinksDataAdapter As New OleDbDataAdapter("SELECT * FROM Links", connString)
  
    GraphImporter.VertexDataSource = PagesDataAdapter
    GraphImporter.EdgeDataSource = LinksDataAdapter
  
    ' vertex records are uniquely identified by their Id (in the Pages table) 
    ' edges link the vertices with the FromPageId and ToPageId (in the Links table) 
    GraphImporter.VertexIdColumnName = "Id"
    GraphImporter.FromVertexIdColumnName = "FromPageId"
    GraphImporter.ToVertexIdColumnName = "ToPageId"
  
    ' create vertices as rectangles shapes, with default size (60, 30) 
    Dim shapesFactory As New NBasicShapesFactory()
    shapesFactory.DefaultSize = New NSizeF(60, 30)
    GraphImporter.VertexShapesFactory = shapesFactory
    GraphImporter.VertexShapesName = BasicShapes.Rectangle.ToString()
  
    ' set stylesheets to be applied to imported vertices and edges 
    GraphImporter.VertexStyleSheetName = "Vertices"
    GraphImporter.EdgeStyleSheetName = "Edges"
  
    ' use layered graph layout 
    Dim layout As New NLayeredGraphLayout()
    layout.Direction = LayoutDirection.TopToBottom
    layout.LayerAlignment = RelativeAlignment.Near
    GraphImporter.Layout = layout
  
    ' subscribe for the vertex imported event, 
    ' which is raised when a shape was created for a data source record 
    AddHandler GraphImporter.VertexImported, AddressOf OnVertexImported
  
    ' import 
    GraphImporter.Import()
  
    ' end view init 
    DrawingView.EndInit()
  
End Sub
  
Private Sub OnVertexImported(ByVal dataSourceImporter As NDataSourceImporter, ByVal shape As NShape, ByVal record As INDataRecord)
    ' display the page title in the shape 
    Dim text As Object = record.GetColumnValue("Title")
    If text Is Nothing Then
        shape.Text = "Title not specified"
    Else
        shape.Text = text.ToString()
    End If
  
    shape.SizeToText(New NMarginsF(10))
  
End Sub
  
Private Sub Form1_Load_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
  
End Sub

 

 

위 내용은 아래 페이지를 옮겼습니다.

How to automatically create a diagram from a database?

 

 

행복한 고수되십시요.

 

woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\




Posted by woojja

댓글을 달아 주세요

 

다이어그램에서 Shape 을 삭제할 때 확인을 하도록 하는 방법은 다음과 같다.

 

C#

 

// NDrawingDocument 의 OnNodeRemoving 이벤트를 구독:
nDrawingDocument1.EventSinkService.NodeRemoving += new ChildNodeCancelEventHandler(EventSinkService_NodeRemoving);
  
// 이벤트 핸들러 작성:
void EventSinkService_NodeRemoving(NChildNodeCancelEventArgs args)
{
    if(MessageBox.Show("Remove ?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) !=
        DialogResult.Yes)
    {
        args.Cancel = true;
    }
} 

 

VB.NET

' NDrawingDocument 의 OnNodeRemoving 이벤트를 구독:
AddHandler NDrawingDocument1.EventSinkService.NodeRemoving, AddressOf EventSinkService_NodeRemoving
   
' 이벤트 핸들러 작성:
Private Sub EventSinkService_NodeRemoving(args As NChildNodeCancelEventArgs)
    If MessageBox.Show("Remove ?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) <> DialogResult.Yes Then
        args.Cancel = True
    End If
End Sub 

 

 

위 내용은 아래 페이지를 옮겼습니다.

How to ask a user for confirmation when he or she deletes a diagram shape?

 

 

행복한 고수되십시요.

 

woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\




Posted by woojja

댓글을 달아 주세요

2016. 4. 6. 15:37

YouTube의 image size 를 알고 싶어졌습니다.


                               
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg (480x360 pixels)
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg (120x90 pixels)
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg (120x90 pixels)
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg (120x90 pixels)
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg (120x90 pixels)
http://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg (480x360 pixels)
http://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg (320x180 pixels)
http://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg (640x480 pixels)
http://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg (1920x1080 pixels)


이렇습니다.


http://i1.ytimg.com/vi/<insert-youtube-video-id-here>/2.jpg

링크는 이렇게도 되는군요.





행복한 고수되십시요.


woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\\\\




Posted by woojja

댓글을 달아 주세요