implementation

SQL Firebird implementation in java/ IBSQL

五迷三道 提交于 2019-12-12 20:46:58
问题 so tried to put that SQL code into my java-aplication: SELECT DISTINCT StRzImRo.Rohstoff, StRo.Bezeichnung, CAST (SUM(BwLsImAt.Lieferungen * StRzImRo.Menge * StAt.PROD__REZEPTURGEWICHT / Coalesce(StRz.PARM__BEZUGSGROESSE,1)) AS NUMERIC (9,3)) Rohstoffverbrauch_Gesamt FROM BwLsImAt JOIN StAt ON (StAt.IntRowId = BwLsImAt.Artikel) JOIN StRz ON (StRz.IntRowId = StAt.PROD__REZEPTUR) JOIN StRzImRo ON (StRzImRo.Master = StRz.IntRowId) JOIN StRo ON (StRzImRo.Rohstoff = StRo.IntRowId) WHERE StAt

How does one implement a function from a namespace?

白昼怎懂夜的黑 提交于 2019-12-12 15:43:40
问题 Essentially, this is my source code. namespace name { int func (void); } int main (void) { name::int func (void) { //body } return 0; } Now, I want to write that function, declared int the namespace, in a different place. 回答1: You can't define the function inside another function like that. There are two options: Reopen the namespace, and define the function inside it: namespace name { int func() { // body } } Outside the namespace (and also outside any function or class definition), define

Graphs implementation in java

 ̄綄美尐妖づ 提交于 2019-12-12 13:33:17
问题 I am trying to create a Graph class that uses another class, the Vertex class to represent all the vertices of the graph. I am not sure if I need an Edge class that will represent the possible connections between two vertices, because every vertex can keep track of the other nodes it is connected to. But I am not sure if this is correct. What do you think? Thank you. 回答1: You don't have to use an Edge class. You can use adjacency lists and still represent an unweighted graph correctly. For a

DDD: Should a Dto Assembler be a part of Domain Layer?

倖福魔咒の 提交于 2019-12-12 10:55:55
问题 Thanks in advance. I have some Aggregates in the Domain Layer library. Also, some DTO s in a separate library, which is shared between Server and Client side. An Aggregate of an entity is more informative than its DTO . So, in order to convert from DTO to Aggregate , a repository should be accessed by a Dto Assembler . Interfaces of repositories are in Domain Layer . That's why i come to conclusion that DtoAssembler should be a part of DomainLayer . Is this right? 回答1: No, this would be plain

VB.NET Forced Inheritance through multiple generations

自古美人都是妖i 提交于 2019-12-12 09:02:01
问题 I'm trying to wrap my head around inheritance/interfaces/implementation a bit better in .NET. I have a class that's defined as follows (sort of): Public Class Sheet Property Name As String Property Steps As List(Of [Step]) End Class The thing is, [Step] is just a virtual, base class. There are 5 different concrete implementations of [Step]. To make matters a bit more complex, there are 3 DIRECT implementations of [Step], 2 of which are virtual. Each of those 2 has 2 subclasses that would

How to implement IDisposable in Entity Framework?

牧云@^-^@ 提交于 2019-12-12 09:01:25
问题 I am having my entity framework context in a separate EL Layer, which stands for Entity Layer and then I move to DAL, then BL and my user inteface aspx.cs code page. I am confused as such how to use IDisposable in the same. What I am doing till now, supopose in my DAL I have context of my entities. namespace abc { public class Action: IDisposable { Entities context = new Entities(); // all the methods public void Dispose() { context.Dispose(); } } } Is it the correct way of doing so? I am

Simple Battleships game implementation in Python

别说谁变了你拦得住时间么 提交于 2019-12-12 06:54:59
问题 Okay I'm not sure how to develop another board with hidden spaces for the computers ships per-se, and have it test for hits. Again I'm not even sure how I'm going to test for hits on the board I have now. Make note: The player turn function will be migrated to the computer board since you wouldn't be attacking your own ships. Here is the code. It may not be the best formatting (as in with Methods and objects and such) but I can polish it up a little later. Also would there be another way to

How to save type information of template vector

北城以北 提交于 2019-12-12 06:25:46
问题 I am trying to implement a class for serialization (XML for now). The idea is that any derived class can registers its members with the base class and base can write the members in form of XML. The code looks something like this class IXMLINF { protected: struct INFObj { union MemPtr { int* piMem; char* pstrMem; IXMLINF* pINFMem; } MemPtr memObj; }; vec<INFObj*> m_INFObjVec; void addMemToINF(int* piMem) { INFObj* pObj = new INFObj; pObj->memObj.piMem = piMem; m_INFObjVec.append(pObj); } void

Implementing error message for code in Python

喜你入骨 提交于 2019-12-12 01:29:50
问题 def parse(expression): operators= set("*/+-") numbers= set("0123456789")#not used anywhere as of now opExtrapolate= [] numExtrapolate= [] buff=[] for i in expression: if i in operators: if len(buff) >0: #prevents buff if multiple operators numExtrapolate.append(''.join(buff)) buff= [] opExtrapolate.append(i) opExtrapolation=opExtrapolate else: buff.append(i) numExtrapolate.append(''.join(buff)) numExtrapolation=numExtrapolate print(numExtrapolation) print("z:", len(opExtrapolation)) return

Implementing JScrollPane/JTextArea in SwingWorker

﹥>﹥吖頭↗ 提交于 2019-12-12 01:05:22
问题 I am having some trouble with my JScrollPane/JTextArea when using a SwingWorker. Here is what I currently have: JTextArea txtDirs; Task task; //EDT public void createGUI(){ txtDirs = new JTextArea(); txtDirs.setBounds(10, 56, 414, 125); txtDirs.setEditable(false); contentPane.add(new JScrollPane(txtDirs)); task = new Task(); task.execute(); } class Task extends SwingWorker<Void, Void>{ @Override public void doInBackground(){ for(file : files){ txtDirs.append(file.getAbsolutePath); } }