Science topic

C# - Science topic

Explore the latest questions and answers in C#, and find C# experts.
Questions related to C#
  • asked a question related to C#
Question
4 answers
A computer program begins its life cycle as text that follows the rules of a selected programming language, such as C#, Java, Python, etc. To decrease costs and improve the performance of the development process, the program text is often organized into autonomous fragments addressing specific responsibilities. There are many design patterns applicable to implementing typical algorithms, but the layered architecture is well-suited to be applied to the program as a whole. The main challenge is understanding the outcomes of applying the layered design pattern to programs, namely to a text compliant with a selected programming language. System architecture and application architecture topics are out of this discussion scope.
Assuming that a program is just text how to implement layered architecture?
Relevant answer
Answer
Define Layers
  • Identify Core Functionality: Determine the essential functions of your system. These will likely form the core layers. Example: In a web application:Presentation Layer: Handles user interface (UI) and user interaction (e.g., HTML, CSS, JavaScript). Application Layer: Contains business logic, coordinates interactions between other layers, and manages application flow (e.g., controllers, services). Domain Layer: Represents core business objects and rules (e.g., entities, value objects, repositories). Infrastructure Layer: Provides supporting services like database access, messaging, and external integrations (e.g., database connectors, message queues).
2. Establish Clear Dependencies
  • Unidirectional Flow: Layers should depend only on layers below them. This creates a clear hierarchy and reduces tight coupling. Example:Presentation Layer depends on Application Layer. Application Layer depends on Domain Layer. Domain Layer depends on Infrastructure Layer.
3. Define Interfaces and Contracts
  • Abstract Interactions: Define interfaces between layers to specify how they interact with each other.
  • Contract Enforcement: Ensure that all interactions adhere to the defined contracts. This improves maintainability and testability.
4. Implement and Test Layers Independently
  • Modular Development: Develop and test each layer in isolation as much as possible.
  • Mock Dependencies: Use mock objects to simulate the behavior of lower-level layers during testing.
5. Example with Python and Flask
Python
# app/__init__.py from flask import Flask from .controllers import main_bp app = Flask(__name__) app.register_blueprint(main_bp) # app/controllers/__init__.py from flask import Blueprint from .main import main_views main_bp = Blueprint('main', __name__) main_bp.add_url_rule('/', view_func=main_views.index, methods=['GET']) # app/controllers/main.py from flask import render_template from app.services import get_user_data def index(): user_data = get_user_data() return render_template('index.html', user_data=user_data) # app/services/__init__.py from app.repositories import UserRepository def get_user_data(): user_repo = UserRepository() user = user_repo.get_user_by_id(1) return user.to_dict() # app/repositories/__init__.py from app.models import User class UserRepository: def get_user_by_id(self, user_id): # Logic to fetch user data from database user = User(id=1, name="John Doe") return user # app/models/__init__.py class User: def __init__(self, id, name): self.id = id self.name = name def to_dict(self): return {'id': self.id, 'name': self.name}
Key Considerations:
  • Trade-offs: Layered architecture can increase complexity. Carefully evaluate the benefits against the potential drawbacks for your specific project.
  • Flexibility: Design your layers to be flexible and adaptable to future changes.
  • Maintainability: Prioritize clear separation of concerns and well-defined interfaces to improve long-term maintainability.
Benefits of Layered Architecture
  • Improved Maintainability: Changes in one layer have minimal impact on other layers.
  • Increased Reusability: Components within a layer can be more easily reused in other parts of the system or even in other projects.
  • Enhanced Testability: Layers can be tested independently, making it easier to identify and isolate bugs.
  • Better Scalability: Layers can be scaled independently to meet changing performance requirements.
  • asked a question related to C#
Question
4 answers
Let's collect the best places /platforms /tools that offer affordable solutions to teaching coding to kids starting at age 5. Coding with fun and coding with gamification are becoming increasingly essential approaches. Let's have a list with your thoughts and a continuously updated list to inspire parents, teachers, mentors, and siblings to share knowledge and become effective tech ambassadors. Thanks to Maya Maceka for inspiration.
Block-based coding
  1. Blockly Games (https://blockly.games), Age: 5, Stack: block-based coding, Javascript
  2. Code for Life (https://www.codeforlife.education), Age: 5+, Stack: Blockly, Python
  3. CodeMonkey (https://www.codemonkey.com), Age: 5-14, Stack: block- and text-based coding, CoffeeScript, Python
  4. Tynker (https://www.tynker.com), Age: 5-18, Stack: Block-based coding, Javascript, Python
  5. Gamefroot (https://make.gamefroot.com), Age: 7+, Stack: block-based coding
  6. Code Galaxy (https://www.thecodegalaxy.com), Age: 7-18, Stack: Block-based coding, Lua, Scratch, Python
  7. Kodu Game Lab (https://www.kodugamelab.com), Age: 8+, Stack: block-based coding
  8. Kodeclik (https://www.kodeclik.com), Age: 8-18, Stack: block-based coding, Scratch, Lua, Python, Javascript
Programming languages
  1. Kodable (https://www.kodable.com), Age: 4-11, Stack: JavaScript
  2. Code.org (https://code.org), Age: 5+, Stack: Javascript, HTML, CSS
  3. Bitsbox (https://bitsbox.com), Age: 6-12, Stack: JavaScript
  4. Codemoji (https://codemoji.com), Age: 5-14, Stack: HTML, CSS, JavaScript
  5. Codeyoung (https://www.codeyoung.com), Age: 5-17, Stack: Scratch, HTML, CSS, Java, and Python
  6. Create & Learn (https://www.create-learn.us), Age: 5-17, Stack: Python, Scratch, Java
  7. Code Avengers (https://www.codeavengers.com), Age: 5-17, Stack: JavaScript, Python, HTML5, CSS3
  8. Coding with Kids (https://www.codingwithkids.com), Age: 5-18, Stack: Scratch, Python, Java
  9. Codevidhya (https://codevidhya.com), Age: 6-16, Stack: Scratch, Python, JavaScript
  10. CodaKid (https://codakid.com), Age: 6-18, Stack: Python, JavaScript, C#
  11. Real Programming 4 Kids (https://realprogramming.com), Age: 7+, Stack: Python, Java, C#, and C++
  12. Code4Fun (https://www.code4fun.com.au), Age: 7+, Stack: Scratch, Python, Java, C# with Unity, C++ with Unreal Engine
  13. Crunchzilla (https://www.crunchzilla.com), Age: 8+, Stack: JavaScript
  14. Girls Who Code (https://girlswhocode.com), Age: 8+, Stack: Python, JavaScript, HTML, CSS
  15. Juni Learning (https://junilearning.com/coding), Age: 8+, Stack: Scratch, Python, C++, JavaScript
  16. Scratch (https://scratch.mit.edu), Age: 8-16, Stack: Scratch
  17. CodeWizardsHQ (https://www.codewizardshq.com), Age: 8-18, Stack: Scratch, Python, HTML/CSS, and JavaScript
  18. CodeCombat (https://codecombat.com), Age: 9+, Stack: Python, JavaScript, C++, Java, Lua
  19. Vidcode (https://www.vidcode.com), Age: 9+, Stack: JavaScript
  20. EduCode Academy (https://educode.org), Age: 9+, Stack: JavaScript, HTML, CSS, Python
  21. CodeGuppy (https://codeguppy.com), Age: 13-18, Stack: JavaScript
  22. Roblox (https://create.roblox.com), Age: 13-18, Stack: Lua
Relevant answer
Answer
Coding is the new literacy! Introducing kids to the world of programming at an early age can spark creativity, problem-solving skills, and a strong foundation for future STEM careers. Here are some fantastic coding tools tailored for young learners:
Visual Block-Based Coding:
  • Scratch: A classic choice for kids aged 8-16, Scratch uses colorful blocks that can be snapped together to create interactive stories,games, and animations.📷 Opens in a new window 📷en.scratch-wiki.infoScratch coding interface
  • Scratch Jr: A simplified version of Scratch designed for younger kids (ages 5-7), Scratch Jr. introduces basic coding concepts through a user-friendly interface.📷 Opens in a new window 📷www.researchgate.netScratch Jr coding interface
  • Blockly: Another visual coding platform that offers a variety of languages and challenges, suitable for different age groups.📷 Opens in a new window 📷opensource.comBlockly coding interface
  • Code.org: This website offers a range of coding activities and games, including the popular "Hour of Code" challenges.📷 Opens in a new window 📷forum.code.orgCode.org website
Game-Based Learning:
  • CodeMonkey: Kids learn to code in CoffeeScript and Python while guiding a monkey through a jungle adventure.📷 Opens in a new window 📷www.codemonkey.comCodeMonkey game interface
  • Tynker: Offers a variety of coding courses and games, from block-based coding to Python and JavaScript.📷 Opens in a new window 📷www.tynker.comTynker game interface
  • Kodable: Focuses on teaching JavaScript through a fun and engaging puzzle-based approach.📷 Opens in a new window 📷www.kodable.comKodable game interface
Text-Based Coding:
  • Python: A versatile language that's easy to learn and widely used in various fields. Tools like Trinket and Replit offer interactive environments for Python coding.
  • JavaScript: The language behind web development, JavaScript can be explored through platforms like Codecademy and Khan Academy.
Additional Resources:
  • RoboCode: Kids can learn programming by creating robot battle programs.
  • Minecraft Education Edition: Offers opportunities to learn coding while building and exploring in the Minecraft world.
  • App Inventor: Create your own Android apps using a visual block-based interface.
Factors to Consider When Choosing a Tool:
  • Child's age and interests: Select tools that align with their age and what they enjoy doing.
  • Learning goals: Determine if you want to focus on specific programming concepts or general problem-solving skills.
  • Accessibility: Consider the cost, platform compatibility, and ease of use of the tool.
  • asked a question related to C#
Question
4 answers
Hi…is there another Library other than system.encryptographyprovider which includes IDEA encryption provider in C# and C ++…?
  • asked a question related to C#
Question
4 answers
How to get data from OPC server in C# with which code?
  • asked a question related to C#
Question
106 answers
Please come in and lower your bucket in this discussion thread:
  1. Which is better Java, Python, or C?
  2. Which is better for students as a good and easy start?
  3. Which is better for developers and professionals?
  4. Which is your preferable choice?
  5. Do you believe that Java is a 100% object-oriented programming (OOP)?
Relevant answer
✅ I recommend the following comparison:
Python vs Java: What’s The Difference?
at the following link:
  • asked a question related to C#
Question
3 answers
ASP.NET provided an in-memory cache implementation in the System.Web.Caching namespace.
Relevant answer
Answer
It seems to be more accurate to refer to Microsoft's technical documentation or to inquire Microsoft about this part rather than asking me. I don't know this. I am so sorry.
  • asked a question related to C#
Question
6 answers
Hello everyone,
I'm trying to model the motion of a cylinder in both CF and IL directions, but the UDF code that I have only can move the cylinder in the CF direction. Sadly I have never had the chance to learn to code UDF. Can someone please help me?
I will share the code below.
I really appreciate any help you can provide or at least promote this question to find the best answer to my issue.
FYI, this code is for Vortex-Induced Vibration of cylinders
####################################################
#include "udf.h"
#include "dynamesh_tools.h"
#include "unsteady.h"
FILE *fout;
static real v_prev;
DEFINE_SDOF_PROPERTIES(stage,prop,dt,time,dtime)
{
Thread *t;
Domain *d=Get_Domain(1);
real x_cg[3],force[2],moment[3];
real cg; /*Center of gravity position*/
real vel; /*Cylinder velocity*/
real Fy; /*Lift Force*/
real mass=8.88; /*Cylinder mass*/
real fn=1.06; /*System frequancy*/
real wn=2*M_PI*fn; /*System angular velocity*/
real z=0.002; /*Damping coefficeint*/
real k=mass*wn*wn; /*System stiffness*/
real c=2*mass*wn*z; /*System damping*/
/*Get the thread pointer for this which motion is define*/
t=DT_THREAD(dt);
prop[SDOF_MASS]=8.88; /*System mass of the 6DFOF*/
prop[SDOF_ZERO_TRANS_X]=TRUE;
prop[SDOF_ZERO_TRANS_Z]=TRUE;
prop[SDOF_ZERO_ROT_X]=TRUE;
prop[SDOF_ZERO_ROT_Y]=TRUE;
prop[SDOF_ZERO_ROT_Z]=TRUE;
cg=DT_CG(dt)[1];
vel=DT_VEL_CG(dt)[1];
prop[SDOF_LOAD_F_Y]=-k*cg-vel*c;
fout=fopen("results.txt", "a"); /*Open file*/
/*Wrtie data into file*/
fprintf(fout, "%g %g %g\n",time,DT_CG(dt)[1],DT_VEL_CG(dt)[1]);
fclose(fout);
}
Relevant answer
  • asked a question related to C#
Question
12 answers
I ask for your recommendations to quickly learn C#? And where can I find sources for the application of C# in petroleum engineering?
Relevant answer
Answer
Having in mind the links and suggestions provide by other RG friends, day to day practices on some exercises (problems) is important.
Thanks!
  • asked a question related to C#
Question
8 answers
Dear all,
I am currently studying MPC in a temperature controller. I've got the concepts of MPC such as model, control horizon, prediction horizon, constraint, ..etc. With these fundamental understanding, I can easily do simulations test on Matlab Simulink toolbox.
However, I need to implement this MPC algorithm on C# WinForm Application, since I created UI on C# with temperature controllers basing on Modbus ASCII protocol. The hardware configuration is as the figure.
I've found someone who has done with CASADI toolbox on Python, but it seems quite hard to follow.
I am looking for suggestions on which library on Python to implement it. Besides, are there any problems with the hardware configuration?
Thank you!
Relevant answer
Answer
Have you tried Apmonitor examples? http://apmonitor.com/wiki/index.php/Main/Control
I have their unit but been busy and haven gotten through to the MPC example, but they provide excellent documentation for Matlab and Python examples. Here is also a video https://www.youtube.com/watch?v=nqv6jFeVUYA&list=PLLBUgWXdTBDhrs5FuoJXni-cIeNYEyxw1&index=23&ab_channel=APMonitor.com
  • asked a question related to C#
Question
5 answers
I want have a function that returns inverse normal distribution, something like norm.inv function in excel
Relevant answer
Answer
Thank you very much
  • asked a question related to C#
Question
4 answers
How we can store different countries latitudes and longitudes, and how we can
calculate the present time of different countries
Relevant answer
Answer
this is a window application program hope it will give you some idea.
  • asked a question related to C#
Question
12 answers
I need MATLAB, C# or R code of above mentioned models. How could I find those?
Relevant answer
  • asked a question related to C#
Question
4 answers
C sharp tutorial material for digital image processing.
Relevant answer
Answer
There is OpenCVSharp, a wrapper for OpenCV. Another possibility is to do the image processing in C++ using OpenCV, build a DLL, and access it from C#. I've used the latter method in a project. The entry into the art of image processing should be a concrete use case so that encounter an aha moment rapidly.
Regards,
Joachim
  • asked a question related to C#
Question
1 answer
I am coding a coupled stress/PWP model with GeoStudio Add-in.
Does anyone know how to call the volumetric water content function and hydraulic conductivity function in the material function?
I ready coded Add-in VWC and Hydraulic conductivity functions. They work fine in SEEP/W. I want to integrate these functions into my Add-in constitutive model just as built-in coupled stress/PWP models.
it will be very appreciated for suggestions of any C# function that can solve my problem.
Relevant answer
Answer
  • asked a question related to C#
Question
8 answers
I want to publish my articles in scientific journals that are indexed to Research Gate. My current scientific work is "Solar cells modeling by C# programming language". But I am basic at writing articles. Please, give me advice to publish my articles. If you have any suggestion, write me.
Relevant answer
Answer
You can try to google for potential journals in Elsevier.
  • asked a question related to C#
Question
7 answers
Dear all,
I have some questions in C++ which I could not get clear answers through internet. It would be very helpful if you could help with it.
1. How to instantiate a non-pure abstract class ( only one of the data members is made pure virtual) in the main(). In internet it is mentioned that, it is possible to create my own constructor to initialize the property members and to use the non-virtual methods. is it possible?. or should the non-pure virtual members can be made static?
2. Some say, that it is even possible to create a non-pure abstract class just my making the destructor as pure virtual, it is possible?
3. What is the actual useof pure virtual destructor in the program actually?
4. Is it possible to use the auto type as return value in case of abstract function? Is it possible to know the type of data carried by auto variable?
5. why sometimes the constructor is made protected, is it liberately done to prevent direct instantiation? what are all the use cases of such practice?
6.If I call a virtual function in the derived class, it takes the default value of that function from base class always, how to override it? why it happens?
7. In multiple inheritance, why I make a class virtual to avoid multiple copies of a same base class, it does not work?
8. Interestingly, if I call the grandchildren class (in multiple inheritance)
class A(contains virtual members) : class B ( non virtual members)
class B : class C ( non virtual members)
class C: class D ( non virtual members)
9. If there is a non-pure abstract class( only one of the members is pure virutal), can I again define it as pure virtual if there is no body/definition literally available in one of the derived class, instead of defining it just for the sake of abstract class instantiation?
if I access the class D object, using the class B/C type pointer, provided that the base class A member function made virtual, the members of the class D is accessed instead of class B. Can I understand that any base class member irrespective of what you use becomes virtual even if one of the base class instance of that member is made virtual?
Hope my questions were clear. Would be glad to provide an example code if required.
Thank you and I look forward to hearing from you.
Relevant answer
Answer
I recommend to ask this Q at: https://stackoverflow.com/
  • asked a question related to C#
Question
11 answers
During literature review, I have noticed that many papers under the umbrella of software engineering use Java when code examples or small demonstrations are appropriate. I understand that Java is pretty ubiquitous, but is it the de facto programming language for SWE academia? Can I demonstrate something in a language whose syntax I believe illustrates my point better?
The quicker version of this question: Will my paper lose credibility if it shows examples in C# rather than Java?
Relevant answer
Answer
I agree with Asiri Hewage, pseudo-code in a paper(s) is very much acceptable and common...
  • asked a question related to C#
Question
4 answers
I need to learn more about parallel executives in multicore laptops by using c sharp language in easier manners
Relevant answer
Answer
Thank you very much Mr Muhammad Rizwan ..if you have a simple program as an example of the parallelism in c sharp using parallel for..it will nice from you..
  • asked a question related to C#
Question
2 answers
Hi, I am a programmer, I was tasked by my boss to write some barcode reading software from cell phone photos. I found a paper by Orazio Gallo and Roberto Manduchi titled:
"Reading 1-D Barcodes with Mobile Phones Using Deformable Templates".
IEEE Trans Pattern Anal Mach Intell. 2011 September ; 33(9): 1834-1843.
I graduated long time ago in 1994 and my math is kinda weak.
In section B:Barcode decoding, I could understand everything except the part about "the list of cells" on page 9, where it states:
"The list of cells {V sub k to the t}, as well as the integral of p(o,w) within each cell, can be computed offline and stored for online use."
I did not understand the math about this and the cost function, I was wondering if anyone knows of any online tutorial or free source code about this ??
I uploaded some free C# code on my GitHub to try to code this algorithm and the code is at this url:
I also uploaded the paper itself, it is attached to this.
Thanks for any help out there in cyberspace.
Relevant answer
Answer
Hi Martin, sorry this was a year ago and i tried to read the paper but got stuck trying to understand some of the calculus and math and i could not implement it. I am sorry i wish i could have implemented it and understood the math then i would give you code and explanation and written up some hopefully easy to understand documentation on understanding the algorithm. Sorry , i hope you find better people than me that can help you.
  • asked a question related to C#
Question
19 answers
For somebody who already knows some programming skills and languages, what are the best and fastest strategies to master other programming languages?
Relevant answer
Answer
Apply it. Do mockup examples, try toy models, whatever floats your boat, just get your hands dirty writing code from the beginning to end. Progressively you can add complexity and structure (e.g. integrated applications, OOP) to your examples to explore the language further. Oh, and after reaching an intermediate theory, try to balance theory (books & tutorials) with examples from your domain.
  • asked a question related to C#
Question
1 answer
Hi,
I have been using Microsoft Volume rendering (MSVR) framework for 3D volume rendering using volume ray casting method in my medical image processing application which is developed using WPF of C#.NET (VS 2012 premium). . This framework (MSVR) runs only on NVidia GPU. Now I need a similar framework which should run on AMD Radeon (model 530) GPU. I explored all the possibilities from AMD site, but there is no concrete and straightforward solution. I am very much confused with the AMD's URLs, their SDK and other library support.
Could you please suggest a solution for my requirement? I need a solution wherein I can call the volume rendering APIs directly from my C# code by passing the processed 3D volume of CT/MRI images
- Manjunath
Relevant answer
Answer
You'd better implement volume rendering using opengl through opengl .net wrapper (e.g. OpenTK, SharpGL,etc).
  • asked a question related to C#
Question
5 answers
I know there are great reliable libraries on Fortran for Computational PDE/ODE, Computational Statistics and Numerical Linear Algebra.
Also almost all the legacy software packages of Civil Engineering, Mechanical and Aerospace Engineering, and Chemical Engineering are developed on Fortran. Newer versions of Fortran compilers are object oriented and incorporated many new features needed for Finite Element Mesh and Unstructured Mesh of Finite Volume, However, they still do not have some features of new languages as they have to be backward compatible.
I ask this question having to main point in mind:
1) Education and training of numerical methods.
2) Developing from the scratch or modifying the exciting in-house codes?
What are the Fortran limits? and what scientific and practical cons and pros you imagine for abandoning or sticking to Fortran?
Relevant answer
Answer
Interesting
  • asked a question related to C#
Question
5 answers
Hi all,
I am trying to find the best tool for performing genetic programming regression on a data set of about 1000 X 1000 data.
I tried to use Karoo_gp, it works fine for a while with small data set, but then it drops most of the time when I add the whole data or increase operators.
Any suggestion of tools that can perform this task, preferably in Python, C++, or C#, will be greatly appreciated.
Thanks
Relevant answer
Answer
Dear Ibrahim you can use the Heuristiclab software that is free of charge, or Eureqa software from Nutonian. Both can handle big data sets.
  • asked a question related to C#
Question
4 answers
Homework in Computer Vision and Image Processing course
Relevant answer
Answer
@Nuku: It was a Homework, but I have solve it. Thanks
  • asked a question related to C#
Question
3 answers
I am working with various ABB robots (IRC5 controller). I am trying to communicate PC with ABB robots with TCP/IP socket communication. I need to create C# (Visual Studio) interface as client to send/receive information from IRC5 controller (RAPID server). There are two ways to do that. Fist one is based in SDK from ABB, where DLL files are including in C# code. Second one doesn't depend of DLL files, this way is a normal message communication between client and server, where server is a RAPID code installed in IRC5 controller and client is a C# interface. I need detailed information about how to create socket to share information between robot controller and client PC. ABB provide manual to create that was mentioned, but information is limited. From now I appreciate any helpful.
Relevant answer
Answer
Yes i think it's possible to do that either with socket TCP/IP.
I don't know is it better or no.
Regards
  • asked a question related to C#
Question
7 answers
What are the best deep learning toolkits and labraries for c# programming language?
Relevant answer
Answer
Microsoft's CNTK allows you to run trained models on C# and another programming languages (https://docs.microsoft.com/en-us/cognitive-toolkit/CNTK-usage-overview).
Full train on C#:
It seems like the contributors on github are working on it, check these threads:
There seem to be an early effort, haven't tried though: https://github.com/Lokad/cntksharp
As microsoft has a very important support to C# due to its .NET framework, I would expect to have C# bindings on CNTK soon.
  • asked a question related to C#
Question
2 answers
We saw this code on github which records the position of the body coordinates with the use of Kinect v2 and C# programming language. In this code, we would also like to add on output the time stamp for each frame it acquires.
Can someone help me to edit this code in order to get the time stamp of each frame captured. Thank you very much. Any help would be appreciated.
Relevant answer
Answer
Hi Christian
Thank you so much. I will try your suggestion
  • asked a question related to C#
Question
4 answers
The naturally occurring polyphosphates activate the contact system: factor XII and F XI. The platelets that are involved in the blood clot, secrete PolyP. Can cells in the state of apoptosis or microparticles bearing and other cells: leukocytes, amniotic cells also release such polyphosphates?
Relevant answer
Answer
Thank you for your attention
TF and PS, substance of procoagulant activity, on the surface of amniotic cells provide a platform for mounting binding other factors and produced thrombin and consequently the formation of foci of blood clots.
The results of current research concerning the level of TF are consistent with our earlier observations which showed that TF level in amniotic fluid are higher than in maternal plasma. The present measurements show that the concentration of contact activation phase factors ie. FXII, FXI and PK were significantly higher in amniotic fluid than in maternal plasma.
Researchers suggest that FXI does not play a role hemostasis via the contact pathway, but that FXI can initiate coagulation via the extrinsic pathway in the presence of TF and platelets.
This claim is supported by studies showing that patients deficient in the contact activation initiators FXII, prekallikrein and high-molecular-weight kininogen (HMWK) do not exhibit bleeding symptoms as do FXI-deficient patients.
Therefore, the role of FXI in hemostasis is likely due to its involvement in the extrinsic, TF-mediated pathway rather than the contact pathway.
Finally, the recent observations in literature suggest this thrombotic potential of FXI can be explained by both the ability of FXIa to promote the extrinsic pathway of thrombin generation via inactivation of TFPI and by the feedback activation of FXI by thrombin to further amplify the extrinsic pathway.
In vitro factor XII activates p.e glass, kaolin.
Is polyP able to activate factor XII or XI in vivo? Maybe polyP is secreted by fetal cells in pregnancy, which then undergo apoptosis? This would make it clear that clotting in blood of parturients not only on the extrinsic pathway of coagulation but also on the intrinsic!?
  • asked a question related to C#
Question
2 answers
RSA Cryptography
  • asked a question related to C#
Question
6 answers
I am working on a neural network project in which the data has non linear behavior which is implemented in C# and Encog.
My main objective is to predict the values.
I have some data(which is limited ) say like some 300 data sets. In these data set i have split the data for training and validation. The input of the network is 26 neurons and the output is 25. I had normalized the data and done the training.
My training method is ResilientPropagation and tried with various number of hidden layers.
network.AddLayer(new BasicLayer(null, true, 26));
network.AddLayer(new BasicLayer(new ActivationLOG(), true, 50));
network.AddLayer(new BasicLayer(new ActivationTANH(), true, 50));
network.AddLayer(new BasicLayer(new ActivationLOG(), true, 50));
network.AddLayer(new BasicLayer(new ActivationTANH(), true, 50));
network.AddLayer(new BasicLayer(new ActivationLOG(), true, 50));
network.AddLayer(new BasicLayer(new ActivationTANH(), true, 50));
network.AddLayer(new BasicLayer(new ActivationLOG(), true, 50));
network.AddLayer(new BasicLayer(new ActivationTANH(), true, 50));
network.AddLayer(new BasicLayer(new ActivationLinear(), false, 25));
var train = new ResilientPropagation(network, foldedTrainingSet, 0.02, 10);
The problem now is that the training error is 200 and the validation error is way too high like 2000 or more.
I had tried with different number of layers and activation functions such as Log, tanH with various number of hidden neurons but there was no improvement to the error.
As of now my judgement is that, this error is due to the limitation of the data set(which is of non linear behaviour).
My question is, Can I improve my network for this non linear behavior with the current data set limit by using some different tactics or activation functions or training method.
Relevant answer
Answer
Hi Vishnu,
seems like all youre layers are same:
network.AddLayer(new BasicLayer(new ActivationLOG(), true, 50));
network.AddLayer(new BasicLayer(new ActivationTANH(), true, 50));
I dont see problem in definition, but so many layers in one MF, maybe thats problem. I think you dont have so huge error in validation of output data, but many MFs in one input with same definition could be problem. If you know MatLab there you can compare and check youre C# system.
Hope I helped.
  • asked a question related to C#
Question
3 answers
techniques and libraries for lexical analysis, syntactic (parsing) analysis, semantic analysis, discourse integration and pragmatic analysis. C# supported libraries for programming.
Relevant answer
Answer
LibPalaso is a .NET based NLP library by the field linguistics organization SIL in collaboration with Payap University in Chang Mai, Thailand. 
I'm just about to become an HLT consultant for SIL.
  • asked a question related to C#
Question
1 answer
I am using EmguCV's (Ver 3.1) SurfFeature example and trying to count the amount of matched pairs of points between both images.
It seems that "mask" variable stores the match information, but I don't know how the information is stored.
For example, can you tell me how many matched pair of points are found? Which point matches which point?
Relevant answer
Answer
Hi Hersh,
Did you want to match pair of points on the images as similar pixels on the images?
If so, you can try by creating the matrix of both the images, and check on pixel by pixel, by a 2-D array formation, whether the pixels at a similar place have the same DN value or pixel value.
Regards,
Sayan
  • asked a question related to C#
Question
5 answers
I am developing a project where users feedback is one of the panel. So, my point is to find out depending on keywords or strings the system will know whether the feedback is negative or positive.
Thanks
Relevant answer
Answer
One way to implement is, use dictionary. Make a list of words and categorize based on their negativity and positivity. For example, 1 is lease negative and 5 is highly negative. Mcategorize all words in dictionary and give them mentioned weightage. Based on number of string or word use entered in site ,we can take average of weightage and see if users sentiment falls under positive or negative area. 
  • asked a question related to C#
Question
5 answers
I am using C# with asp.net for re-ranking images based on Content retrieval. 
The concept of my work as:
1. Extracting visual features for all images.
2. Find the similarity between a query image and rest images.
3. Finally, re-ranking the images based on their similarity to the query image.
Now, I chosen (FCTH & SURF) for extracting visual feature of the images. But, I need another method to extract visual features.
What method is the best for this purpose?
Relevant answer
Answer
Mustafa,
As said by Khan Muhammad, the current trend in classification and detection on images is motivated by Deep Learning, precisely, Convolutional Deep Neural Networks. In case you have an abundance of data to train, then go ahead with models like Alexnet but in case, you do not have sufficient data, then learn about already trained caffenet and retrain it with your data so that it adjusts itself to your problem domain. 
You can train models on Caffe/Theano frameworks and use their wrappers in your C# application for inference(testing) phase.
Hope this helps.
kind regards,
Ankit Tripathi
  • asked a question related to C#
Question
3 answers
Already my senior scholar developed SODAR software using vc++, but i want design a software using C# 
Is there any possibilities to design a software to find wind direction(vertical,horizontal), facsimile record,received signal in time domain,frequency domain in SODAR signal using C# or Java
Relevant answer
Answer
Yes, you can do it. There are number of inbuilt functions in VC++. For these, you write your own programs. It all depends on your expertise in C++  / java. Best of luck
  • asked a question related to C#
Question
3 answers
I am using C# to retrieve all rows in a postgresql database. This postgres database includes a field that a column number saved in each cell.
How can I retrieve those columns and store in a list?
Relevant answer
Answer
  • asked a question related to C#
Question
3 answers
I used C# to feature extraction of multiple images. After that, I want path of images with their features that include (1 by 144 array) insert into postgresql?
How can I do?
Relevant answer
Answer
To address the problem please check namespace and includes of your codes. Please also see the attached link which describes a more complete example.
  • asked a question related to C#
Question
1 answer
i am using smssync (android app) as an sms gateway . how could i connect this to asp.net C#
Relevant answer
Answer
Hi
From the link you posted, it seems fairly easy. You can use a POST and extract the parameters as you will usually do in ASP.NET.  
By auto-send, I assume you mean automatically sending messages from the server to a phone.
See this, then, from the link:
"
TaskSMSsync supports execution of tasks defined on the server. Currently it supports sending of messages sent from the Sync URL as SMS. This feature is targeted towards developers. The app can be configured to poll the server for new tasks at a given frequency. The server then needs to respond to HTTP GET requests with ?task=send (for example http://callback_url/smssync?task=send). The format of this response is shown below.
"
For auto-reply, see this:
"
Response from serverSMSsync allows either an auto-response message to be configured on the app itself, or to be retrieved from the server. When the app makes an HTTP Post request to sync the incoming SMS to the configured URL, the server can respond with JSON-encoded messages alongside the success message. The app then sends these messages by SMS to the specified users phone.
This makes it possible to have an instant response via SMS when an HTTP Post request is made. To leverage this feature, a JSON formatted string like the one below needs to be returned by the configured URL in response to the app's HTTP Post request.
"
In the app itself, ensure *Get Reply from Server* is checked to enable this feature.
Is it clear?
  • asked a question related to C#
Question
4 answers
Hi everyone,
I'm recently doing research on the control field with the aim to develop a low cost 3 and 4 axis cartesian industrial multi-purpose robot using an off the shelf MCU.  I'm not discarding even the possibility of attaching a cheap computer with enough DIMM slots to attach I/O and control cards. My current approach is as follows:
Type of motors: DC, brushless (simpler electronics) and stepper type (bi-polar, H-Bridge control type)
MCU: What brand/model is best recommended for motor control?. What specific characteristics can be obtained in a specific control card (multi-positioning, signal processing for path determination, PID capability?)
Programming: C++, C# or BASIC, assembly code embbeding could help too, however, I'm still not submerged in the detail of control programming. I understand that it would require advanced programming such as PWM and PID tuning; any insight or papers describing the basics that can be provided will be quite useful. I'm a profane to the mistery of synchronized axis movement for positioning, so programming examples would be appreciated. 
Operation Mode: Basically running a manual mode and auto mode, and using a low cost XBOX type of controller as a teach pendant, as well as a small HMI to provide the menu is being considered.
Not attempting to re invent the wheel, I also understand there are CNC programs such as Mach 3 that could make it easier on the concept, however the HMI does not look user friendly for generic purposes, such as attaching a glue valve to the robot to follow 3D contoured parts and complex paths. Also I'm not sure if G code embedded in the control can be a possible approach. Are the chinese cards/motor/drivers/software bundle control kits a suitable option? Any specific direction that you can point me out in terms of cost effective motor control for this purpose is welcome.
Thanks in advance
-EZ
Relevant answer
Answer
Bruno,
Sounds like very good options you are putting on the table. I will analyze if an all out Arduino solution is viable or if possibly a hybrid configuration using MCU from STM or Freescale as masters and Arduinos for teach pendant and HMI as slaves could help my case.
Again thanks much for the info
-EZ
  • asked a question related to C#
Question
4 answers
I am unable to code for Neural Networks as there is no support for coding. I want to code for vehicles travel time prediction with Neural Networks. A simple example in c, c++ or c# about coding will help to understand how to build our own network, how to train & test.
Relevant answer
Answer
  • asked a question related to C#
Question
3 answers
A git repository or any other codebase please.
Relevant answer
Answer
Check these two (the second one although not in C# could be used as a good reference):
as well as:
  • asked a question related to C#
Question
3 answers
Respected Sir/Madam,
Can you suggest me :--How to do interlink two diffrent things and correlate to each other?
  1. Firstly ,We examined 22 different UML Class Diagram and Find out Maintainability through these Size metrics and Structure Complexity Metrics .Size metrics contains Response for a class ,Number of Method, Total Number of methods, Weight methods per class. Structure Complexity metrics contains Number of Children, Number of classes ,Number of Relation ,NGen, MaxDIT, NAggH, NGenH.
  2. Secondly ,Maintainability Index (MI) is a composite metric that incorporates a number of traditional source codes metrics into a single number that indicates the relative maintainability. This Second is that , assess the Maintainability Index, Cyclomatic Complexity, Lines of Code (LOC), Depth of Inheritance,Class coupling and result found the enhance maintainability through Visual Studio C Sharp 2013 and analyze the Code Metrics of different diffetrent small program.
Can you guide me how to interlink these two things to correlate each other because program of Visual studio c# and UML Class diagrams are diffterent to each other . They are no simililarty criteria and coordination to each other ,only both are same object oriented programming and their characteristics are OOPs nature.
So,What I should do?How to conclude these things.
Relevant answer
Answer
please helf me
  • asked a question related to C#
Question
1 answer
I found bouncy castle, is that preferable?
Relevant answer
Answer
This is an old questions, but I will bite anyway.
"Best" is always a subjective judgement, and in my answer I am not going to take a position and to declare a "winner". Let's just say that "best" is what gives you the results you regard as superior, and you need to find this out by trying all the alternatives and comparing the results. So if you were hoping to start a flame war, or to get a canned reply, tough luck.
I would, first of all, consider the cryptography library already available in .NET (in System.Security.Cryptography). Now that Microsoft has released most of the .NET source code, only paranoid programmers should object to trusting .NET on the basis of hypothetical backdoors and weaknesses planted into the source code by secret services. Unless you need functionality that is not part of the .NET library, I see no real need to look for a third-party product, and there are many reasons why you should not develop your own crypto API. Also, before wasting time with the internal workings of the Microsoft Crypto API 1.0, google "Cryptography API: Next Generation".
A good part of the .NET System.Security.Cryptography namespace is already available in Mono, but not all. Depending on what you need, you might be able to use Mono instead of .NET.
Bouncy Castle has been criticized by some as being a museum of old algorithms, several of them of dubious practical usefulness today. Nonetheless, it seems to be popular among some programmers, especially those who don't know .NET well enough to be aware of what it offers.
SecurityDriven.NET/inferno is another possibility. I know very little about it, however, it is so small that it is likely a simplified wrapper of a selected part of the .NET crypto functionality. If you like it, use it. If you don't, use the .NET functionality directly.
  • asked a question related to C#
Question
3 answers
I am building a C#  (WCF) application and it uses a dll  Since I am working with CUDA programming., I have written a small program in CUDA C++ which returns a string and generated Dll of it. String Contains Information about Nvidia GPU card (mostly one page Information) . 
.I am using PInvoke - (Dllexport and DllImport). C# application is importing this Dll . After running the application I am getting the following exception
-> System.AccessViolationException : Attempting to read or write the protected memory . 
As I searched through internet ,many opinions suggests, it is problem of marshalling the data from unmanaged code to managed code. 
Is there effective way to return a string from Dll to c# application. I have struck with this from many days. Any possible help is highly appreciable.! Thank You!!!
Relevant answer
Answer
Based on your problem description, it is entirely possible that the issue has nothing to do with CUDA, and relates to a more basic programming error related to interfacing managed and unmanaged code.
Having said that, you should also be aware of the fact (at least it was a fact the last time I wrote CUDA code not too long ago; I am boldly assuming that things have not changed and I am not making a fool of myself here) that CUDA code on Windows requires desktop access in order to be able to access the GPU. In other words, any CUDA code must run in the context of the interactive desktop session. Depending on how your WCF service application is implemented, this could be a problem (e.g., if it is actually running as a Windows service, the CUDA code will not work.)
  • asked a question related to C#
Question
4 answers
I have installed visual studio 2013......but i have ms word 2010........................I add the reference (microsoft.office.interope.word)....... .......and also how can i read the exact size and underline of a character from a .doc file.......
Relevant answer
Answer
Hi Mala. For C#.NET checkout this library http://sourceforge.net/projects/word-reader/. With that you don't need word installed on your client machine, and it also works with .docx files. Also it's performance optimised, so after you extract/load you document, you can get the position of any character using the IndexOf method, see http://www.dotnetperls.com/indexof. Remember to check for recurring characters. Happy Coding :)
  • asked a question related to C#
Question
4 answers
I'm looking for the efficient matrix manipulation free (open source/GPL/etc.) library for the .NET framework (v.4.5 would be the best).
Relevant answer
Answer
  • asked a question related to C#
Question
1 answer
Blood Cells, Matlab, C#, Detection,Segementation
Relevant answer
Answer
Have you tried Math.NET Numerics - MATLAB Data I/O Extensions? It's a NuGet package from Math.NET. Math.NET is a set of math libraries for Microsoft.NET that can be installed from NuGet. I have no experience with this I/O Extensions library, but the other packages I have worked with are very useful.
You might also consider reading this (if you haven't already): http://blogs.mathworks.com/loren/2011/07/28/using-matlab-structures-in-c-with-builder-ne/
I don't know how up to date this information is. Just a thing I stumbled upon.
  • asked a question related to C#
Question
4 answers
For Virtual Screen splitter 
Relevant answer
Answer
Hi Mary,
Another way is using the menus of visual studio: "Project"->"Add Reference". The "Add Reference" dialog will be shown. From the dialog, choose the .dll file you need.
For using the methods in the .dll file, the namespace should be included first. Using the menus, "View"->"Object Browser", a list of objects can be seen. And the .dll file can also be found, if it was added successfully. When double click the .dll file related name in the list, you can find the available methods, namespace and the other objects in the .dll file.
Best regards
  • asked a question related to C#
Question
3 answers
i want to reduces shockes in sequence of video images, did any one have a example code for doing this?
i use OpenCV in C# and i estimate moving velocity of each images related to last image. in fact i use optical flow to extract movement between images.
however, how can i stabilize this images for decline shocked and unwanted fast move in realtime by changing the orientation and shift on the images?
Relevant answer
Answer
Dear Prof. Karimi,
                    Thanks for your question. I have attached two references for your kind concern. I think these files will help you for your concern.
Regards,
A.Kar
  • asked a question related to C#
Question
4 answers
Is there any domain ontologies (in owl format) which capture the educational concepts in the JAVA programming course or c++ ?
Relevant answer
Answer
Hi Mona,
Linked Open Vocabularies (LOV) is great initiative when you are looking for existing ontologies that describe certain concept. You could simply search for a certain class or property and get links to the matched ontologies as a result .
The links usually contain descriptions of the classes and properties of an ontology as well as file in OWL, RDF or other Semantic Web/LOD standard format of the ontology that you could easily convert to OWL (if necessary) using online converters for instance.
Hope you'll find this useful,
Bojan
  • asked a question related to C#
Question
15 answers
We tried to implement an Extreme Learning Machine (artificial neural network) algorithm in C# within the .NET framework.To avoid any mistakes: I am referring to a particular neural network architecture, similar to a multilayer perceptron, in which the connection weights from the input to the hidden layer are randomly assigned by initialisation and only the weights to the output layer are trained.
We ran into a problem, as during the computation of a large dataset of many input vectors (i.e. training examples, in our case a very long electricity load time series) the implementation throws an exception stating that one of the arrays just exceeded the maximum number of elements a .NET array can hold. This is happening during the Singular Value Decomposition for the Moore-Penrose pseudoinverse.
Is there another computationally feasible way to calculate the pseudoinverse without using SVD (and without producing matrices with the size of the squared input sample count)? Or is there some way to split the H-matrix of the ELM algorithm, than calculate the pseudoinverse for these smaller parts and reassemble them afterwards before computing the output weights? Or how do you tackle solving this for long time series?
Your help would be much appreciated!
Relevant answer
Answer
Thanks for citing my recent publication. :-) Allow me a few comments:
1) Suppose you have N examples, each of dimensionality D. If you expand them in B hidden basis, then you have an hidden matrix of dimensionality NxB. From your question, I assume you are computing the optimal weight as (using MATLAB notation):
Weights --> H*(H*H' + lambda*I)\y
However, for a positive lambda, you can rewrite the previous equation as:
Weights --> (H'*H + lambda*I)\H'*y
In this case, the matrix to be inverted is BxB, which might simplify your computation.
2) If you still have troubles computing this in batch, you can compute it recursively starting from many subsets of your training data, using the recursive least-square (RLS) algorithm. I wrote very briefly its description in the attached PDF.
3) After publishing the paper cited by Fabrice Clerot, I came to agree to the conclusion stated in a previous comment by Prof. Wang, i.e., ELM is in good part equivalent to much previous work, such as the Random Vector Functional-Link by Prof. Pao and his associates. For that reason, I now try to use these original denominations. For example, the algorithm described in point (2) is known as "OS-ELM" (actually, its non-regularized version), although its origins as RLS goes as far back as Gauss.
I hope this can be of help.
  • asked a question related to C#
Question
3 answers
Currently implementing a fuzzy min/max neural network in C#, so need some sample code regarding the same topic.
  • asked a question related to C#
Question
6 answers
I want to dvelop a web application usign google maps apli, asp.net with c# and sql database, it a s point of interest application , people can draw routes on google maps and can contact people on the same route using mobile email or sms.
Relevant answer
Answer
Hi Mansoor,
there is a project available in the following link.
This will help you to kick-start your project.
For more details on the controls used refer:
Thanks,
Bishwajit
  • asked a question related to C#
Question
5 answers
Hi, I am trying to determine the 6DoF of a known object, between sequential images (with the first image as reference frame). 
I am making use of a 3D Pose algorithm (POSIT algorithm) by A. Kirillov and his GUI written in C sharp (the link attached for reference).
Two sequential images are opened, after which I provide:
  • Image coordinates of some points for the known object in the sequential images.
  • The object coordinates are also provided for the points(size and shape of the object is known).
  • Focal length of the camera used, is also provided (the intrinsic and extrinsic parameters of the camera where obtained using the Matlab calibration toolbox beforehand).
The pose of the object is then estimated in each of the sequential images, which provides a Rotation matrix and Translation vector.
Using: Xcam= XobjR + T, I hoped in obtaining the object coordinates, knowing the camera image coordinate as well as the pose (This did however not work because the Rotation matrix and Translation vector is from the camera perspective). 
I know, that the Rotation from the camera perspective will be the same as from the object perspective and thus for the rotation portion, I can make use of the output provided.
For the Translation, I am however struggling and believe the solution my by simpler as I think.
Any help on this would be greatly appreciated.     
Relevant answer
Answer
There are 2 ways to solve this:
1) Use Tomasi-Kanade algorithm. It uses a sequence of images or arbitrary camera (smooth) motion and known correspondences between selected points between all images. It then gives you the 3D structure of points (not the real world I think)
2) If your object is in a known XY plane (horizontal/vertical), you know the intrinsic and extrinsic parameters of the camera for a given camera pose, you can simply intersect the ray formed by two points - the pixel and the camera frame origin with the xy plane using geometric equations and get the real world point in the xy plane. This the back-projection method, given that R and t remain the same. I have coded this, but the points are strictly in an xy plane; so this approach my or may not work for you.
Let me know if you need more explanation.
  • asked a question related to C#
Question
6 answers
I am looking into optimizing Triple-DES and I have already implemented it using C# and the inbuilt security.cryptography libraries. However, I now intend to go low level by implementing Triple-DES encryption in C# without using the libraries. Can someone please help me with such an implementation?
Relevant answer
Answer
I don't why you want but i suggest you to take a look ANSI C implementations of Triple DES algorithm below:
  1. http://easy-triple-des.sourceforge.net/
  2. http://bradconte.com/3des_c
  3. http://www.cis.syr.edu/~wedu/minix/code.html
 Then you have two options for code optimization:
  1. Convert C to C# and directly use it in your project. Then optimize it.
  2. Make your code optimization in C source code then write wrapper classes for .NET environment and use it in your project. 
  • asked a question related to C#
Question
4 answers
I had byte array which was derived from an image , then this array text was encrypted to be saved in database, I want to retrieve this text decrept it then transfer it to byte array again to retrieve the image , how can this be done?
  • asked a question related to C#
Question
5 answers
Give a mathematical equation "a + b c " normal parser can parse and tell it is syntactically right or wrong , if there is any error it will throw proper error message and terminate.  But I want a parser that can handle the condition if any error occurs then do some kind of insertion or deletion of symbol in a given expression and do further processing and give proper message to user like "You have inserted extra symbol  S" or "Your expression is missing S symbol" . In this case parsing would not be terminated as an when some syntax error occurs because it will be handle by parser. This kind of parser is known as an Error Correcting Parser.
Relevant answer
Answer
Yes using bottom-up parsing, it is possible to design a error correcting parser. The only problem is that if more than one choices of production rules to be used for derivation are available then parser must be given extra information to select the right choice. If there is only one choice then it can correct there itself.
  • asked a question related to C#
Question
40 answers
Which are the advantages and the disadvantages of the most common languages?
Do we have to work only with "low level" languages like C/C++?
Relevant answer
Answer
There are really two kinds of languages:
- languages that are designed to minimize the time programmers spend programming
- languages that are designed to minimize the time computers spend computing
The first category are languages that are easy to program in. It is composed of interpreted languages: Python, Julia, R, MATLAB... The most popular free alternative is likely Python. In some domains, like biology or statistics, it might be R. If you feel the visceral need to cough up some cash, then you could buy a MATLAB license. They all offer easy ways to plot graphs, do complex mathematics (eigenvalues, inverse matrices, conjugate gradient, Monte-Carlo), query databases, the web...
The second category is composed of C/C++ and - God forbid - clunky old Fortran. They are harder to program but should be more computationally efficient. If the programs are well written.
The default option should be to minimize the time you spend programming and go with the first category. Your time is valuable, the computer's is cheap. So minimize the time you spend programming and maximize the time doing actual physics. As Google puts it (and they do a fair amount of compute): Python where we can, C++ where we must.
There is a tired argument that to do high performance computing it is absolutely necessary to use low level languages such as C and C++. However, most high-performance physics software will devolve the heavy lifting to external libraries, such as BLAS, LAPACK, FFTW, and others. In that case, whether there libraries are called from a language of the first or second category has little implication on the speed code.
Furthermore, most languages of the first category offer some easy way to interface with languages of the second category. Most physics software is such that the computer spends most of its time in 5% of the code, eg in the kernel. So it is always possible to move that kernel to C/C++ later on and interface with it in the interpreted language. The best of both worlds! Google Cython for the python way of doing this.
  • asked a question related to C#
Question
7 answers
I want to draw some 2D patterns. It should work with VC++ or C++. I try GDI and GDI plus, but it does not work well when I want to color the new shapes. I want to draw some new shapes and color them as an independent unit.
I appreciate anyone who can give me some advice.
Relevant answer
Answer
Even though the best choice in C/C++ is probably OpenVG, also OpenGL libraries allow you to draw arbitrary polygons in a 2D fashion: all you have to do is to set a Orthographic instead of Perspective Projection matrix.
Nevertheless, my advice is to use a different (and simpler) language + library for this kind of tasks. For my 2D patterns drawing I rely on Python + pyGame library: excellent results with a few lines of code.
  • asked a question related to C#
Question
9 answers
I am trying to make an app in c# that will detect/classify 3 poses of the human body: standing, sitting, and lying. I can correctly detect/classify 2 of them (sitting and standing) with skeleton tracking. When it comes to lying on the floor, Kinect seems to not be able to track the skeleton of a human body.
Does anyone have any experiences with skeleton tracking in a lying position? As soon as I lie down, I lose joint positions. Is this task impossible? Thank you.
Relevant answer
Answer
Hi Andrea, we had a similar problem when we wanted to mount the Kinect to track workers from above. To our knowledge both the Kinect SDK and the OpenNI / NITE middleware can only track horicontally. However in your case I suppose you only need to rotate the image by 90 degrees before it reaches the middleware. OpenCV can do that.
  • asked a question related to C#
Question
28 answers
I want to learn a new programming language. Actually I have basic level knowledge in programming and I've been using C++ and MATLAB for my purposes. I want to learn another language for the easy accomplishment of my project work. I have used MATLAB for analysis purposes and now I would like to convert my MATLAB application into a software. Sometimes it is difficult to handle C++, that is why I would like to go with an easier one.
Relevant answer
Answer
The answer, of course, depends on the goal you want to achieve.
My opinion is that C# is excellent for writing GUI applications for the Windows platform. On the other hand, Python is excellent for computational tasks (under any platform). C# lacks good and tested free and Open Source libraries for most computational tasks. Python code is quick to write and requires no compilation. Python does have GTK and Qt bindings and Matplotlib plots can be embedded into Python GUI applications.
In my opinion, if you want applications with robust GUIs for the Windows platform and don't need much computation or high quality scientific plotting, C# is a good choice. But, if you need to perform scientific computation and want to produce high-quality scientific plots, Python is a good choice. They're both easy to learn for anyone with prior knowledge on some programming language. However, all GUI programming requires learning the event-driven programming paradigm, which may be confusing at first.
There's an Open Source IDE for quickly getting into C# programming:
A good choice for Python development is Python(x,y), which includes Qt for GUI development:
  • asked a question related to C#
Question
7 answers
I need to save the distances from depth image to txt file (just one column for depth for each image pixel from x-axis and y-axis), I can't do that by myself, after that I need to define objects appear in this depth image, my idea is to search for same object appear in same distance from the camera then by approximate I want to define the object and display new image contain only this object.
This is the code I already used it:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Kinect;
namespace HelloKinectWorldWPF
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
KinectSensor sensor;
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
sensor = KinectSensor.KinectSensors[0];
sensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
sensor.ColorFrameReady += FrameReady;
sensor.Start();
}
void FrameReady(object sender, ColorImageFrameReadyEventArgs e)
{
ColorImageFrame imageFrame = e.OpenColorImageFrame();
if (imageFrame != null)
{
BitmapSource bmap = ImageToBitmap(imageFrame);
image1.Source = bmap;
BitmapSource source = e.imageFrame.ToBitmap.Source();
}
}
private byte[] GenerateColoredBytes(ImageFrame imageFrame)
{
int height = imageFrame.Image.Height;
int width = imageFrame.Image.Width;
//Depth data for each pixel
Byte[] depthData = imageFrame.Image.Bits;
Byte[] colorFrame = new byte[imageFrame.Image.Height * imageFrame.Image.Width * 4];
var depthIndex = 0;
TextWriter tw = new StreamWriter("sameobjects_test" + ".txt");
for (var y = 0; y < height; y++)
{
var heightOffset = y * width;
for (var x = 0; x < width; x++)
{
var index = ((width - x - 1) + heightOffset) * 4;
// save distance to text file
var distance = GetDistanceWithPlayerIndex(depthData[depthIndex], depthData[depthIndex + 1]);
tw.WriteLine("x: " + x + ", y: " + y + ", distance: " + distance + " ");
}
}
}
BitmapSource ImageToBitmap(ColorImageFrame Image)
{
byte[] pixeldata = new byte[Image.PixelDataLength];
Image.CopyPixelDataTo(pixeldata);
BitmapSource bmap = BitmapSource.Create(
Image.Width,
Image.Height,
96, 96,
PixelFormats.Bgr32,
null,
pixeldata,
Image.Width * Image.BytesPerPixel);
return bmap;
}
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
sensor.Stop();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
sensor.ElevationAngle += 4;
}
private void button2_Click(object sender, RoutedEventArgs e)
{
sensor.ElevationAngle -= 4;
}
}
}
Relevant answer
Answer
Dear Mr. Afzal Khan,
Which part of my code need to be edited to get the joints X Y Z axis in columns like shown as your result?
  • asked a question related to C#
Question
3 answers
.
Relevant answer
Answer
If you mean performance qualification please visit this page:
and look for HPLC guideline
  • asked a question related to C#
Question
2 answers
I want to convert my c# code into matlab. Can anyone help me?
Relevant answer
Answer
go through this link, may be you will get some information
  • asked a question related to C#
Question
2 answers
I got some EEG (electroencephalography) data from my epileptic mice, I want to know how to calculate the amount and lasting time of sharp wave during a period of time. Is there any software I can use to achieve the aim?
Relevant answer
Answer
Contact Prof Dr Michel (MJAM) van Putten at Medisch Spectrum Twente (MST) , Enschede, The Netherlands, dept Neurofysiology. see e.g. J Clin Neurophysiol 25; 77-82,2008
  • asked a question related to C#
Question
1 answer
Why do some client terminal link to server, but IP refuse to change to that of server providing?
Relevant answer
Answer
Easy enough: StrongSwan
  • asked a question related to C#
Question
1 answer
I want to compress each image uploaded by the user before storing it in the database with the datatype varbinary(max).
Relevant answer
Answer
There is a msdn topic which i found it's working correctly.
  • asked a question related to C#
Question
1 answer
Touch screen with c# winform application.
Relevant answer
Answer
The input is managed by the OS and forwarded to the C# application. The source is transparent to the C# application because it receives only the event notification and the target control.
For example, if you have a button on the interface, at application level is raised the same Click event as for clicking with the mouse or with the touch screen.
Only if you use a special input touching device that comes with a proprietary API, then you may use another library to interact with that device.
  • asked a question related to C#
Question
1 answer
I want to add a payment form in my application for users when they want to buy stuff and to send cash to the company as donations and for license buying. Can anyone help me to do this in a secure way?
Relevant answer
Answer
I wouldn't suggest integrating this in your application.
You might want to use a web service for that (there are APIs you can get from your bank, PayPal or from Google). You can then customize styling of that SSL secured web page and call it from within your application form through the Web browser component by navigating it to the service URL.
From there on the user will interact with the web service to complete donation (payment) on the web, but instead of this being done through his/her default Web browser, it will all happen through your application form in its own browser.
However, this can be problematic, because the user cannot be sure that the web service via which he/she is making the payment is really PayPal, Google or your bank's API page, because there is no URL visible, no SSL certificate verification message, so if someone ware to high jack the communication package, redirect the inner web browser of your app form to another lookalike form, things could get very problematic.
This is a very sensitive problem and there are many ways for someone to "hack", sniff, ssl-strip the communication and leave the line vulnerable and hence steel credit card and personal information.
Be very careful with these things regardless of which approach you chose in the end.