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
I have a calculator with models Casio Fx-9860.I want to create my own lesson formulas as separate menus,For example, I would like to create a menu for the fluid mechanics course and a separate menu for the thermodynamics course.
For example, the user selects the fluid mechanics lesson menu. Choose one of the fluid mechanics lessons formulas from the formulas in the menu
When we select the formula, the calculator takes input from the user and solves the calculator.
Applications are installed on the calculator that have format ( .g1a)
I guess the programming and formula for this calculator has been done with common languages like C or Python because it is designed for this calculator, lots of games (available on YouTube)
Someone can help me to develop a program that has a separate menu?
Does anyone know in what language the formulas were written and how the code was converted to format?
Thanks
Relevant answer
Answer
Perhaps you can check this blog: http://gfxcprograms.weebly.com/index.html
  • asked a question related to C
Question
6 answers
I want to know more about their papers through the program, can someone write them in C or JAVA or Python?
Relevant answer
  • asked a question related to C
Question
3 answers
I have Pandas DataFrame and Numpy.ndArray
I want to select DataFrame elements based on values contained in Numpy.ndArray
Eg:
L is Numpy.ndArray values
`L=array([2,2,2,1,1,1])`
P is Pandas dataFrame which has many columns of type Numpy.ndArray
P's 1st columns is
`array(['A','B','C','D','E','F'])`
Result expected
two different columns
`['A','B','C']` which is corresponding to 2 value
`['D','E','F']` which is corresponding to 1 value
Relevant answer
Answer
col = df.loc[df['A'] == 1, 'B']
  • asked a question related to C
Question
4 answers
can anyone suggest the best way to find the accurate execution time of math.h library functions such as sqrt(), log(), log10(), sin(), cos() e.t.c?
Relevant answer
Answer
The execution time of a function, a particular code segment, or a process is calculated using the clock() function. This function is available time.h. The following example may help you to understand the fact clearly.
#include <stdio.h>
#include <time.h>
#include <math.h>
int main()
{
double a, b, c;
printf("Enter the loating point base value \n");
scanf("%lf",&a);
printf("Enter the loating point power value \n");
scanf("%lf",&b);
printf("%lf, %lf",a,b);
// Calculate the time taken by fun()
clock_t t;
t = clock();
c=pow(a,b);
printf(" Value = %lf",c);
t = clock() - t;
double time_taken = ((double)t)/CLOCKS_PER_SEC;
printf("pow() took %.8lf seconds to execute \n", time_taken);
return 0;
}
  • asked a question related to C
Question
7 answers
A colleague just does not understand how come I can be sure about c-global retrieved (which is traditionally thought to have been disproved in 1907).
My best pertinent paper (http://www.ptep-online.com/2015/PP-43-09.PDF) does not convince him.
Who has any advice to offer?
March 21, 2020
Relevant answer
Answer
Dear Otto,
Hope you are well and in good health.
If you are very convinced and firmly believe in your instruct then you can convince the other because you will find a simple method to enter his mind.
On the other side if one closes his mind and heart to your instructs he will never believe in it. Such persons you need not to convince them because you will loose you time.
The last thing is that every construct may be right or false.
Remain safe!
Best wishes
Abdelhalim Zekry
  • asked a question related to C
Question
3 answers
Example : Variable B & C together form A. To measure B we have reflective scale but C can be measured only with formative scale. 
Please provide any reference, if you have
For the model refer to the attachment 
Relevant answer
Answer
Hi, could you please let me know how have you done the calculations for this model? is it possible to use the "repeated indicators approach" for it? Thanks in advance.
  • asked a question related to C
Question
7 answers
If table is like can we draw venn diagram by this input?
variable          value r1               value r2
a                        20                         45
b                         10
c                          39                        1
d                                                      37
e                            98                     27
Relevant answer
Answer
you can use this online tool DiVenn which will generate a nice graph https://divenn.noble.org
  • asked a question related to C
Question
12 answers
Hello everyone,
which ways could I use for obtaining data about colour of every pixel in image which has .jpg or .png formats? In the end I want to get .txt file with numerical values of colours in the RGB palette to download it to FPGA by UART. If you know better methods to do this, I will be glad to learn them.
Thank you in advance.
Relevant answer
Answer
If you are using VHDL then you need to transform the image into text file and then binary. please, if you are using Verilog then use the package textio package. You might use C or matlab code to transfer the image into binary format then insert its location in the VerIilog code I attached a web site reading binary file using VHDL. However, you can also use C .
also, you need to use VHDL transmitter/ receiver file to transfer your data to FPGA. I have my own but I believe it is available as package.
in matlab
[x,map]= imread(‘location of your image ‘, ‘jpg’);
imwrite(x, ‘new file name’, ‘bmp’);
Hope it helps brother
  • asked a question related to C
Question
6 answers
Sometimes in order to gain better performance in terms of execution time, inline assembly within source code is used. For example, it is possible to write assembly code inside C code to manipulating values stored in registers. Is there a way to avoid using inline assembly inside source code? or an alternative way in this context?
Relevant answer
Answer
I don't write in C but I do write in C++, so this answer may still be relevant.
I would recommend the use of intrinsic functions, which translate directly to assembly instructions. But in the last 10 years or so optimizing compilers have gotten good enough that this is almost never needed except for very specific requirements such as requesting a prefetch of a memory location you are going to need to access a short time later.
If you need a specific algorithm sped up, I'm very good at that and might be able to help you.
  • asked a question related to C
Question
3 answers
While working on matlab to C conversion, I have encountered a problem which involves result mismatch. The function I've been trying to validate is an SVD function with its corresponding matlab built-in function. The result that is obtained from the vector of singular values (the last n by n matrix) in C implementation produces a result with column mismatch as compared to its corresponding matlab built-in function. In some of the cases the obtained result  produces opposite signed values as well.
I have attached the c implementation, I kindly ask for your cooperation in pinpointing the problem which could help me find a solution.
Relevant answer
Answer
Pion A, U;
Kw V;
Wektor S;
are not defined.
Missing additional header / source file?
  • asked a question related to C
Question
18 answers
Dear all,
This forum has been created to provide a scientific environment in Researchgate for all of those who are interested in doing research on the context of RPL in Internet of Things (IoT) networks. Through this forum, the members could discuss about their previous RPL related studies and introduce them to others, and also to share their latest discoveries, papers, and probable ideas and more importantly to provide their experience to the newly students who want to spend time on studying the existing challenges in RPL. The students who have decided to work on this topic can join this forum and ask their questions and also to get others' opinion on their current work. There exist different types of challenges for publishing a paper from getting the raw idea, and its implementation via off-the-shelf simulation tools, to submitting the final manuscript. Here in this forum, the members will try to solve these challenges as much as possible and also try to answer the questions and help each other to enhance the observability of the existing studies. Further more, members can inform others about the up coming conferences, events, and journal special issues to further provide a comfort zone for those who are attracted to this field of study.
I hope this forum will make the research on this field more interesting and easily.
Relevant answer
Answer
Dear Sadeer,
We usually use Cooja simulator as part of the Contiki operating system, which has been specifically created for resource constrained IoT plarforms, and of course, its free to use.
  • asked a question related to C
Question
2 answers
I am attempting to implement an atmospheric boundary layer in a 3D fluent simulation using a UDF. The UDF is proven to work in a 2D simulation, however approximately 10 hours into a transient 3D solution using 16 cores, fluent crashes with the only log give being a segmentation fault. I am suspicious that something is going wrong with the parallel nature of the solver, however I can't see any issues with my code - nor can I see any issues that would result in a crash 10 hours in, where the code is not time dependent.
Relevant answer
Answer
Just transient k-omega SST fluid flow
  • 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
5 answers
I read that Tiny OS uses nesC language to build an application whereas Contiki OS uses C-language.
I am just starting to make a project utilizing IRIS motes and my application require multiple arithmetic operations and looping statements. I am familiar with C-language but nesC would be completely new for me (I guess) as its an extension to C-language.
So which platform will be more suitable for such application.
Relevant answer
Answer
Since you asked this question in the year 2019... IRIS Motes are too old as Tiny OS. They can support only Tiny OS Per se....
Contiki OS needs more memory (RAM and ROM), IRIS motes do not provide that,, so you have to stick to Tiny OS Itself, nesC is easier compared to Contiki OS.
  • asked a question related to C
Question
3 answers
Hi,
For compiling a C code, I am using MinGW64 compiler(c) and made following code in command line.
mex asamin.c asa.c -DUSER_ACCEPTANCE_TEST -DUSER_ASA_OUT -DDBL_MIN=2.2250738585072014e-308
The error is presented in attached picture.
Can anyone help me for understanding the problem?
Any suggestion will be very appreciated.
The Best,
Azade
Relevant answer
Answer
I can only hazard an answer: in the old days, the compilers would not check compatibility between pointer type and variable read at that memory location pointed to. That would allow nice tricks if you knew what you were doing and also nasty mistakes if you didn't. Newer compilers do not allow this anymore; i.e. when you decalre a pointer to point to say an integer variable, you cannot read from that location lets say a floatin point variable. Your error is of that kind; the problem usually arises when you use somebody elses code/libraries, as they may have been compiled in the old(er) days when the compiler would not do such checks...
  • asked a question related to C
Question
3 answers
I am looking for different questionnaires based on Bloom Taxonomy (Affective, Cognitive and Social domains) to assess the learning of computer science student in CS1 courses(such as intro to programming class with java or c or python).
Relevant answer
Answer
Can you recommend some VALID questionnaires for Affective, Cognitive and Social domain?
  • asked a question related to C
Question
7 answers
Hello,
I have a strange bug in my code involving the use of FFTW3. I already wrote the qeustion on Stackoverflow: https://stackoverflow.com/questions/53518451/why-is-fft-of-ab-different-from-ffta-fftb
Please, if anybody have some time to spare, could you have a look?
Thank you very much!
Relevant answer
Answer
Finally I solved the problem! If anybody is still interested, you can have a look on Stackoverflow, I posted an answer.
PS: Hussein M. H. Al-Rikabi Fatima Faydhe al-Azzawi I insist, the Discrete Fourier Transform is a linear operation.
  • asked a question related to C
Question
9 answers
I am a researcher of materials science and metallurgical engineering. I am interested to work with atomic level and electronic modeling of the structure and properties of materials,materials informatics and simulation in future. Currently i am learning Python. I have basics of C and MATLAB . What will be the useful programming languages to learn for me?
Relevant answer
Answer
Hi Sajib,
it depends on your needs. Are you planning to use some commercial softwares? For example, for Ansys you need to use the ANSYS Mechanical APDL language. In Abacus you are can program your own material model in Fortran. In COMSOL Multiphysics you can connect to Matlab via LiveLink and so long :). So find out, if you are gonna use some special commercial software and try to focus on the language needed therefor.
Best regards,
Antoni Artinov
  • asked a question related to C
Question
3 answers
As we know, the ptrace system call is the most powerful system call in all unix-like systems. All debugging software use ptrace for monitoring and manipulating another process, i.e. tracee. Using ptrace, we can track read/write system call in the tracee process. I ask, can we use ptrace in order to monitor the tracee and notify the tracer only when the tracee executes a branch instruction? Is this possible? if not, can we notify the tracer when a specific instruction at a specific address is executed?
Advance thanks
Relevant answer
Answer
Thanks Mr. Jack Son,
Thanks Mr. Peter Breuer,
In fact, I cannot use PTRACE_SINGLESTEP, because the performance will be disastrously damaged because of transferring the control frequently from "tracee" to "tracer" and vice versa. So this idea is excluded. What I want in particular is to alert the "tracer" only and only when the "tracee" is doing a jump instructions. Maybe I can modify the code in order to rewrite a special instruction that moves control to the "tracer" (Of course, I should save the original branch instruction). The alternative instruction should arise a trap.
  • asked a question related to C
Question
4 answers
The possibility of sequencing of short primers
Relevant answer
Answer
there is no general problem using short sequencing primers ( pyrosequencing works well with them) so long as they only anneal at the right position and have no looping self complementarity and can anneal at the extension temperature of the sequencing kit but how short are you thinking. If the problem is getting as much sequence as possible from a short template then clone it and use vector primers to sequence and get the whole template sequence
  • asked a question related to C
Question
10 answers
temperature is affecting on the mechanical properties such as strength 
Relevant answer
Answer
Dear Michael Rethmeier ,
can you give more information about what do you mean
  • asked a question related to C
Question
7 answers
Hi
Please, how can we make a new operating system ?
Is the method to bring some developers with strong background in theoretical operating system operations and then they should learn from the source codes from another operating systems such as Linux various versions. Then, you can write your operating system and then testing it with ethical hackers to fix the security issues. Then, you can deploy it for some users as testing version. Then, it is validated to be used.
Please, any help for developers to do this than talking alot in useless things.
Thanks
Osman
Relevant answer
Answer
Obviously you are new to this. The first step to anything is coming up with a name. A name that can rally developers to your cause. Act fast, all the good names are taken. Without a name, you can't even market or sell or profiteer from your OS - and what good is that. ( Read Dilbert for details. )
The problem you have is pretty much it has all been done. Who wants to spend their time on re-creation rather than innovation. So you need a hook, something that is a minimally viable kernel.
So what is the thing that this new OS is to do better?
Back to Dilbert, you need a project you can market to developers as something worth working on. THAT is how you get other people to code your operating system. It also helps to have done some of the heavy lifting. That minimally viable kernel, that shows you are more than a dilettante or a provocateur.
So what is your pitch? Why do we need a new operating system, why do we need to code it for you? Go....
  • asked a question related to C
Question
6 answers
Is there a A* implementation for nvidia gpus? Or a Library for HPC stuff on GPGPUs at-least? Some real life parallel algorithms implemented on them would be good too.
Relevant answer
Answer
I think, if you are interested in GPU computing applications, the best way to go for fully implemented CUDA codes are the CUDA samples from NVIDIA. These samples are available online and they cover many diverse applications.
  • asked a question related to C
Question
3 answers
I was asked to supervise my junior in a small project about Chick hematology, because I am new to the topic I have several questions to ask :
1. My juniors are planning to see the garlic oil effect on the chick's white blood cell counts, is it possible to apply oral gavage on chick as the enteral administration method?
2. Is there any suggestion on substance that affect overall blood cell count that doesn't need oral gavage administration like syringe usage ? we are prohibited from using heavy metal
3. If you have any reference about chick hematology-related research please let me know
Thank you
Relevant answer
Answer
Dear Grace,
I think the following recent papers will help you:
Owosibo AO, Odetola OM, Odunsi OO, et al. Growth, haematology and serum biochemistry of broilers fed probiotics based diets. African Journal of Agricultural Research 2013; 8(41):5076-5081. http://www.academicjournals.org/journal/AJAR/article-full-text-pdf/3A5206141348
Akinola LAF, Etuk MO. .Haematological and Serum Biochemical Responses of Broilers Fed Varying Levels of Indomie Waste-Based Diets. IOSR Journal of Agriculture and Veterinary Science 2015;8(3):66-70. https://pdfs.semanticscholar.org/995e/f4f36bb59e9f1db0e48ae27a924a2cb8dda8.pdf
Abdulazeez H, Adamu SB, Igwebuike JU, Gwayo GJ, Muhammad AI. Haematology and Serum Biochemistry of Broiler Chickens Fed Graded Levels of Baobab (Adansonia digitata L.) Seed Meal. IOSR Journal of Agriculture and Veterinary Science 2016; 9(10):48-53. http://www.iosrjournals.org/iosr-javs/papers/Vol9-Issue10/Version-2/I0910024853.pdf
Ogunwole OA, Abu OA, Adedeji BS, et al. Haematology and Serum Indices of Finisher Broiler Chickens Fed Acidified Blood Meal-based Diets. Journal of Advances in Biology & Biotechnology 2017;11(2):1-7. https://www.researchgate.net/profile/Olugbenga_Ogunwole4/publication/312476729_Haematology_and_Serum_Indices_of_Finisher_Broiler_Chickens_Fed_Acidified_Blood_Meal-based_Diets/links/587f12e908aed3826af46bb9.pdf
Best wishes from Germany,
Martin
  • asked a question related to C
Question
6 answers
I used 27F and 1492R primers to amplify bacterial 16S rDNA from intestinal digesta, cycling conditions include 1) 94 C for 3 mins; 2) 40 cycles of 94 C for 30s, 55 C for 30s, and 72 C for 1 min; 3) 72 C for 10 mins 
After the PCR, the Nanodrop concentration of those PCR products were around 750 ng/ul. But after purification using the Invitrogen PCR purification kit, the product concentration was down to only 50 ng/ul. Is this normal?  When I used the Qubit to quantify dsDNA, the concentration became around 15 ng/ul. Was this concentration too low? 
I want to use the purified PCR product as my standard to build standard curves to quantify other bacteria (eg, Lactobacillus) concentration from gut content. 
Thanks for sharing your thoughts or suggestions in advance!
Relevant answer
Answer
Some DNA remain in the column's filter and if you use too much elution buffer it will be diluted. So, In the last step of DNA purification (DNA Elution), warm the buffer to 60 ºC and use as minimum as possible, like 15µl on the center of the filter (Don't touch the filter), then let to stand for 1 min. and spin at 9000xg for 1 min. repeat it with another 15 µl. 
  • asked a question related to C
Question
2 answers
If we take C*C on same time iteration we have penta-diagonal matrix where each and every element of matrix is penta-diagonal matrix ? and If we consider C(j)*C(j-1).it's become linear ? 
Relevant answer
The following book can help you
  • asked a question related to C
Question
6 answers
If we have two inputs x1 increases linearly from 0 to 10 and x2 from 0 to 1, and we need the output x3=x2 for x1<5, and for x1> 5 we need x3 to keep the last value at x1=5. All this in C-block.
If I put a counter and a matrix to keep the values of x3, C-block starts counting every time step. 
If you could help, I appreciate your time and effort, 
Relevant answer
Answer
int x[]={0,1,2,3,4,5,6,7,8,9,10}// value for x1
int y[]={0,1} // values for x2
for(int i=0<i<10;i++){
if(x[i]<5)
x[3]=y[2];
}
else
x[3]=x[1] }
/**** other codes *////
 }
  • asked a question related to C
Question
13 answers
Is there any source code in C/C++ to evaluate strings like eval() in Matlab and Python?
Relevant answer
Answer
Have a look at the Boost libraries, especially the Proto part: http://www.boost.org/doc/libs/1_64_0/doc/html/proto.html. It has an expression evaluator function eval().
  • asked a question related to C
Question
2 answers
I have introduced a Triangular slot on patch... i have got the eq. ckt of triangular patch ( R L C in parallel)..but not getting of triangular slot. can anyone suggest the equivalent (in terms of RLC) for slot.
Thanks
Nitin
Relevant answer
Answer
Thanks!! i have seen the web..but clueless about how to find RLC values and eq. ckt for triangular slot.. pls elaborate on this.. if possible can you email me at nmuchhal@gmail.com by screenshot of steps so that i can understandhow to do so for my specifications
Thanks Regard
Nitin
  • asked a question related to C
Question
3 answers
Hi there,
  Is there any scientists who are doing some researches on exosomes and know a good way to store the isolated exosomes? Basically, we store the exosomes with PBS in -80°C, but we are afraid that the exosomes will be distroyed if stored in  -80°C. Therefore, I am wondering if there are some good ways for the storage of exosomes, such as a specific buffer or something like that?
Many thanks!
Relevant answer
Answer
Hi, Igor, thank you so much!
  • asked a question related to C
Question
2 answers
Hi,
I have the Thermo Scientific HAAKE viscotester C, L-Version spindles, Type 399-0301, Serial No. 1110301006. I used it to measure the viscosity of different liquids using different spindles but at the same rpm. What is the conversion factor to calculate the viscosity of the  different fluids since I used different spindle for different liquids. Kindly assist me with the conversion factors to calculate the viscosity depending on the spindle used.
Thank you for your anticipated assistance.
Relevant answer
Answer
Thank you Alan for you response. I already contacted them and got feedback. Researchgate was just an alternative.
  • asked a question related to C
Question
4 answers
I have an instrument for which I colect data for the scales A and B. My final score it will be the scale C, which is a difference between A and B.
For the validation process, shoud I include the scales A and B, or only scale C?
If you have any examples for this, please let me know.
Thank you!
Relevant answer
Answer
In support of what Julia B. Smith has said Sabina for you to establish the validity of the instruments make sure you give the instruments to experts in that field, Psychometrians and Expert in English Language for their comments in relation to diction and sentence  construction. Finally trial - tested among selected subjects to determine its reliability and correlation co-efficent.
  • asked a question related to C
Question
3 answers
What is the funtion of C/N ratio or organic matter conent in determing the presence of a plant?
Relevant answer
Answer
First of all, Organic matter and C/N ratio are different
Organic matter is all volatile solid going to burn at high temperature (550)
C/ N ratio  is Carbon/ total Nitrogen
Generally OM/1.724 is equal to Carbon.
C/N ration is function of soil fertility.
Please revised your question.
  • asked a question related to C
Question
3 answers
I am looking for a library to be integrated in LabWINDOWS CVI.
Relevant answer
  • asked a question related to C
Question
5 answers
I need to assign a structure that has a Cl but my 1D and 2D aren't helping much.
Question
4 answers
I have tried PGMEA at 100°C for an hour while stirring but nothing happened, my product didn't get dissolved at all. However the same method with PMMA 996000 and PS 280000 worked just fine.
Relevant answer
Answer
You could also use CF or CB knowing  more or less the right concentration. Too concentrated solution gives you wavy morphology of the films. So, the right concentration and heating should be enough. I hope this helps.
  • asked a question related to C
  • asked a question related to C
Question
2 answers
Hi all
During hot press I am facing major problems in EPDM composites fabrication. Mixing temperature: 190 degree C for 15 minutes and hot press 200 degree C,. After the hot press, the EPDM cross composite material is sticking with the PI sheets placed up and down of the mould. How to get rid of this problem?. Does anybody have any suggestion?. I haven't added DCP. Is it because of absence of DCP in the cross composites? if yes, Can let me know what is right time to add DCP during mixing and at what temperature?
Regards
Relevant answer
Answer
Both the films: Underlay and overlay - should be made of Polyimide covered--laminated  by Teflon -then there will be no adhesion of cured EPDM to the hot press die - it's a common practice. THUS, you need to use a one-side-laminated by Teflon PI film. There are hundreds of manufacturers of such a films. 
Note that such a film withstands about 10 cycles of hot pressing
And then requires replacement.
It also seems to me that the difference between mixing temperatures (190C) and hot pressing (200C) is not enough.
It is more reliable to work if the temperature differs by 20-25 ° C
  • asked a question related to C
Question
4 answers
I have already tried alternatives with meat and gave us marvelous results as the meat stayed intact for 15 days at 4 C.
Relevant answer
Answer
Thank you so much
  • asked a question related to C
Question
1 answer
I call on  the assistant of all researcher in the site to help out with the article of "Jones, M. C. (2000). on A skew t distribution."
Relevant answer
Answer
Hello Samson, do you mean Jones, M. C. (2000). A skew t distribution. In: Charalambides, Ch. A.; Koutras, M. V. and Balakrishnan, N. eds. Probability and Statistical Models with Applications. London: Chapman & Hall/CRC, pp. 269–278? If so it is available on google books [https://books.google.de/books?id=gu3LBQAAQBAJ&lpg=PA269&ots=MpMJ-_XVVs&dq=Jones%2C%20M.%20C.%20(2000).%20A%20skew%20t%20distributio&lr&hl=de&pg=PA274#v=onepage&q=Jones,%20M.%20C.%20(2000).%20A%20skew%20t%20distributio&f=false]. What is your question?
Regards
 Felix
  • asked a question related to C
Question
5 answers
I have a complex metallic Alloy (Al-Cu-Fe) sample that is amorphous (solid and liquid) at 800'C which crystallization happens during the cooling process at 650'C. Can anyone help me to explain what is the reason behind this phenomena?
Relevant answer
Answer
Dear Hadi Parsamehr,
I agree with the remarks made by Hannes Engelhardt. Studying the relevant phase diagrams is of course the first thing to do in your case. However, varying the cooling rate implies that the kinetics of the (metastable) intermediate  phase formation will enter into the discussion. Besides, one has to invoke the possibility of crystal segregation yielding solidification routes that on principle deviate from the relevant equilibrium phase diagram. So good luck with your experimental study!
  • asked a question related to C
Question
3 answers
How can i calculate the thermal limit capacity of transmission line (data known with me (R, L, C ) and voltage rate in my work?
Relevant answer
Answer
I agree with the aforementioned answer by  Srete Nikolovski. Also, I would like to add that it is not only overhead lines. There is also a standard for insulated conductors and according to the installation method and ambien temperature then there are the corresponding de-rating factors. These are also included in British Standards for Wiring Regulations (BS 7671).
  • asked a question related to C
Question
4 answers
Since it's the end of the semester just want to know. Some of my colleagues won't round the final average up (79.8 is a C). Others, like myself, will round up to a B.  What do you do?
Relevant answer
Answer
That's true too and I have should have said that in my first answer.  If the student already rounded up to a "9", then I take a look at the effort the student has put in, that's where my "documentation" comes into play.  If they round up from a 78.7 to a 79 and have missing assignments, never contacted me, etc., they have a 79.  If they have contacted me, come to see me, and I can tell they've worked hard, they get the 80.
  • asked a question related to C
Question
2 answers
Unfortunately, I had to stope expression process for about 5 months and after this delay time I had to again to do some change in expression conditions I mean against before I used 25◦C to participate bacterial suspension. But after purification step, there was no band in SDS PAGE. I don’t know what is the wrong? Is this possible that this change in centrifugation temperature caused I lost my protein? My protein is HIV-1 Tat and Expression temperature is 37◦C for 4 hours and I use BL21DE3 and PET28(a).
  • asked a question related to C
Question
4 answers
Hello,
Did anyone ever asses adipogenesis using the adiponectin ELISA kit from thermo fisher?How does it work?
Is it ok to store the cell supernatant inside eppendorf at -80°C until use?
Thanks
Benedetta
Relevant answer
Answer
Hello
i suggest use this kit ( Human Total Adiponectin/Acrp30 Quantikine ELISA Kit ) from R&D systems
kindly look at the links here
Good Luck
  • asked a question related to C
Question
4 answers
Unfortunately, I had to stope expression process for about 5 months and after this delay time I had to again to do some change in expression conditions I mean against before I used 25◦C to participate bacterial suspension. But after purification step, there was no band in SDS PAGE. I don’t know what is the wrong? Is this possible that this change in centrifugation temperature caused I lost my protein? My protein is HIV-1 Tat and Expression temperature is 37◦C for 4 hours and I use BL21DE3 and PET28(a).
do you have any idea? Please?
Relevant answer
Answer
Dear Zahra
Considering that bacteria are grown at temperature as 37/30/25°C  (in your case 37(i in generally there is no main differences if you centrifuge the bacterial pellet at 25°C or 4°C. (The important is that you do not reach higher temperatures that can lyse the bacteria)
Generally what is more critical is the temperature of the centrifugation that you use after cell lysis, because in this case the protein is released from cells, can become in contact with proteases and is it better that in the time that occours beetween lysis and purification (that need to be the shorter possible) the sample need to stay at low temperature. 
Did you can supply me more details? Do you monitored the protein expression and solubility in SDS-page before purification to see where it is lost? 
ciao
Manuele
  • asked a question related to C
Question
4 answers
I'm looking for this article, THOM, E. C. The discomfort index, Weatherwise, v.12, v.2, p.57-61, 1959, however I didn't find it.
Does anyone can help me?
Thanks
Relevant answer
Answer
Obrigado, Profa.Mara.
  • asked a question related to C
Question
5 answers
Separation of epoxides using a B-bex column with acetonitrile as solvent and deterctor FID. The conditions are: oven temperature-max 70 ° C, injector 280 ° C, detector 220 ° C, pressure 38 psi. I used the method around 30 injections, all normal, when finishing one of them, the baseline jumps and generates a lot of noise, from there, in all the chromatograms the baseline shows the temperature ramp that I use. What happened to the column?
Blue line - normal chromatogram. Green line - first time it appears.
Purple line and aquamarine - chromatograms after the jump
Relevant answer
Answer
First off, do you mean a b-DEX column? That is a chiral phase, and has to be handled with great care. 
You claim to be running an analysis in acetonitrile but you show that your maximum temperature is well below the boiling point of the acetonitrile. As is obvious to anyone with any experience in chromatography this would simply not be possible. If this is the actual case then you need to completely change your analysis. If you truly are using ACN as your solvent (a very poor choice for GC, by the way) then you are building up solvent all through your system and you are probably flooding your detector. This is consistent with the chromatographic traces that you have shown.
Secondly, 220C for a FID is WAY too low. You will get all kinds of crazy things happen. Raise your detector temperature up to no less than your injection temperature. 280 C as an injection temperature for a maximum oven temperature of 70 C is WAY, WAY too high!!! Lower your injection temperature.
You are in a university environment. You clearly are in need of some very basic GC training. Surely your university has someone who actually knows something about GC? You should consult them.
  • asked a question related to C
Question
1 answer
So i have values of L and C here. And I need to length and width. Expressions are there in the file. But i am not able to understand how they calculated. So can someone please explain me how they got length and width of L and C using that root-searching program developed in this paper?
Relevant answer
Answer
for a generic lossless transmission line the characteristic impedance Zc=sqrt(L/C) and the phase velocity Vp=1/sqrt(LC). 
L and C are per unit length,so C=1/(Zc.Vp) which is (5) in the paper
and L=Zc/Vp which -for microstrip line- lead to that equation in the link 
or (6) ,(7) in the paper , all are approximations .
it's not easy to calculate the dimensions using these equations so the program solves it numerically 
  • asked a question related to C
Question
4 answers
By default if we use command graycomatrix the resultant we get is 8*8 matrix, But depending upon the problem this matrix should be changed
Relevant answer
Answer
you may use the following function
good luck
function joint_hist=find_joint_hist(image1,image2)
%% images should be gray-scale and with the same size
joint_hist=zeros(256,256);
for i=1:size(image1,1)
for j=1:size(imag1,2)
a=image1(i,j)+1;
b=image2(i,j)+1;
joint_hist(a,b)=joint_hist(a,b)+1;
end
end
end
  • asked a question related to C
Question
14 answers
I would like to know how to implement the basic concept of LBP operator with uniform patterns. I have implemented the basic concept of LBP operator in MATLAB. Now I am using the concept of uniform pattern.
The problem is that I am not able to understand the basic concept of LBP with uniform patterns. How exactly should it be done? Is there any documentation available which can help me?
Relevant answer
Answer
If you consider the standard LBP operator LBP_8_1, you can have 2^8 distinct values that a LBP can have. Should you create a histogram of these, you would have a 256 bin histogram. Now, should you consider their binary representation and consider only the ones with at most two jumps 0→1 or 1→0, you would have a total of 58 distinct ones (see the attached figure). If you create a histogram of these and place all others into a separate bin, you have a 59 bin histogram. Check out this paper and this figure for the details.
  • asked a question related to C
Question
5 answers
One of the most challenging aspects of developing the previous version of ForTrilinos was devising a reference-counting scheme to ensure safe type finalization in Fortran and corresponding object destruction in C++.  It's interesting to see that the SWIG-generated file forepetra.f90 on the new develop branch contains an Epetra_Object derived type with a type(c_ptr) component.  Will that component become associated with the C++ object that the Fortran object shadows?   Given that there's no final subroutine on the type, is there a strategy to avoid memory leaks and dangling pointers?  How will the C++ code get notified when the Fortran object goes out of scope so that C++ knows its safe to destroy the object?  How will the Fortran code get notified if C++ destroys the object?  
What will happen with an expression such as
type(Epetra_Object) :: a,b,c
a = f(b) + g(c)
where f and g are functions that have Epetra_Object results containing c_ptr components that presumably are associated with C++ objects that were instantiated at the direction of Fortran inside each function.  After the above assignment completes, the Fortran code no longer has a name associated with the two function results so the Fortran program has no way to direct C++ to destroy the corresponding C++ objects.
Damian
Relevant answer
Answer
Regarding 1, it's probably best to read the papers we wrote on the subject:
Email me if you have trouble accessing these and I'll reply with PDF's.  We were also awarded a related patent, which the Sandia intellectual property staff assured me posed no problems with using the algorithm in ForTrilinos:
Regarding 2, I'll be very curious to see the details of what you're describing.  When you write "a referenced counter pointer to C++ class," I assume assume you mean "a reference-counted pointer..."  The SWIG-generated forepetra.f90 file contains a Epetra_Object derived type with a type(c_ptr) component named "ptr".   Is this the reference-counted pointer to which you're referring?  If so, are you referring to a reference-counting scheme in Fortran or to the reference-counting scheme that already exists in C++?  If the reference counting scheme happens in Fortran, then it will be interesting to see how one can be generated with SWIG.  I don't see anything in the current SWIG output that suggests there's reference-counting happening.  If the only reference counting happens in C++, then I'm not aware of schemes to avoid dangling pointers and memory leaks other than the scheme we developed.  
It would probably be worthwhile to try compiling code like what is written in the clarification that I posted just after posting my initial question. Run the resulting executable through valfgrind and check for memory leaks. And also consider whether there are scenarios that could lead to dangling pointers. If C++ destroys an object, I don't think that automatically nullifies any type(c_ptr) pointers holding the C address of the C++ object.
Damian
  • asked a question related to C
Question
4 answers
Shaft speed is 3000 rpm and should carry 400 hp.
Relevant answer
Answer
In the field of steels I can suggest:
DIN W.Nr.1.5633 or 1.5637 : low alloyed steels with Nickel or a stainless steel like SAE 316.
You can find tables with the mechanical properties and the impact test data at low temperatures 
Regards
  • asked a question related to C
Question
17 answers
Every integer can be expressed as a sum of three triangular numbers.
Given two integers N=a+b+c and M=x+y+z , how to express the product N*M as a sum of three triangular numbers. Example:
11=0+1+10 and 13=0+3+10 ; the product 11*13=143=10+28+105
How to write the product N*M=F(a,b,c,x,y,z) +G(a,b,c,x,y,z) +H(a,b,c,x,y,z) as three triangular numbers?
Relevant answer
Answer
Dear Mohamed,
In x= x(x+1)/2 - x(x-1)/2 +0 you have a substraction, not an addition! Integer problems are very different if you change coefficients and their signs.
Regards,
Jose
  • asked a question related to C
Question
3 answers
Hello everyone,
I want to measure the total nitric oxide in a serum sample using Total Nitric Oxide Assay Kit (enzo life sciences) and my question is about the proper storage procedure for the samples; do I have first to dilute and deproteinize the samples before storing them at -80 C ? or can I store serum samples at -80 C and perform the dilution and deproteinization step directly before the assay ? 
Thanks in advance!
Relevant answer
Answer
You can store the samples at -80 C but add DTE (as an antioxidant) and protease inhibitor cocktail to the samples.
You can pass the samples through 10KDa filters before analysis (This step gives better results). Good luck.
  • asked a question related to C
Question
7 answers
In POSIX multithreading, how can I provide high priority to my c program executable among other system processes? I have assigned priority to the threads using "pthread_attr_setschedparam()" by FIFO & RR, but I have failed to reduce scheduling delays while executing the algorithm. When the execution(performance) of the program is analyzed using perf tool the CPU idle time is high compared to its non-threaded counterpart of the algorithm. I am using Ubuntu on Intel i5 processor based system. Is there any other solution to overcome this problem? Whether using an RTOS will help? Is there an RTOS suitable for multicore system and what kind of development environment is required? 
Relevant answer
Answer
Anishchandran,
I just noticed your private message!  Sorry.   So I think I see the problem.
You have 3 overlapping loops which process arrays.   Processors use a hierarchical arrangement of caches to cache memory for more rapid access.   So if you have algorithms which force the CPU to pull in large swaths of memory, this can lead to inefficiencies depending on the arrangement of the data structures in memory.
So in a single threaded operation, in most operating systems, you will have cache affinity - the thread will be scheduled on the same core / CPU when possible in the hopes that come cached data from its prior time slice is still present.   This increases the lower level cache efficiency.   So  On accessing X[i] there is a better chance of X[i+1] being satisfied by the cache.
Now imagine a multi-threaded approach.
You have more demand placed on the cache - as the working set of data between all threads is increases - also you have several CPU hungry threads preempting each other.  So this can result in less cache hits in the lower level caches.
Now there is a huge degree of speculation in the above analysis.
You can prove this easily by artificially increasing the size of your arrays or data structures ( say you DOUBLE the number of array elements and use every other one. ) what this does is double the amount of memory pages to be accessed, while keeping the same number and size of data elements processed.   If caching is the issue, you will note progressively worse performance as the used are elements are sparser.
One way to test this is to create a debug fork of your code which multiplies the array indices on all of the arrays, so instead of X[i] = Y[i] * Z[j] you have X[i*n] = Y[i*n] * Z[j*n] all throughout your code.  Where n is your sparseness factor, 1,2,3, ... 
IF you see large performance differences for different values on n, you are seeing a cache dependent or performance issue.
So to  this:
Create data structures and computing patterns that exploit the CPU cache.  This is to say, making sure multiple threads are not accessing different portions of the data set, but instead work in lock step on the same areas of the data based on the data structures.  
Some times with large data sets where you rarely re-access the same data elements, like a summation operation, a single threaded approach is OK, or an approach where you split up the data into multiple subsets - based on the number of cores you have or the architecture of the cache.
-- Bob
  • asked a question related to C
Question
3 answers
Hello,
I am using TriLink's Mutagenesis dNTP mix to perform EPR on a 1.3 kb fragment. I have been unable to observe a PCR product when following their recommended cycling parameters. I am able to successfully amplify my product using Phusion so my template and primers seem to be fine. 
Cycling Conditions:
95 C - 3 min - Initial denaturation
92C- 1 min/53 C - 1.5 min/72 C - 5 min x 30
72 C - 10 min - Final extension
Components: 10x PCR buffer, 500 nM Forward/Reverse Primer, 10 fmol template, Mutagenesis dNTP mix, 2 mM MgCl2, Taq (5U/uL), water up to 25 uL
Any troubleshooting tips?
Relevant answer
  • Generally speaking phusion is a highly processive enzyme so will always amplify larger fragments - that is fragments > 1kb - with higher efficiency than nearly all other polymerases
  • In terms of your alternative method with validated template and primers I would do the following
  1. Drop your annealing temp by 1-2C: Phusion is highly processive and highly efficient and thus will amplify efficiently @ the Tm itself. This is NOT true of most other polymerases which operate with optimal efficiency and specificity @ ~ Tm-2C. If you havn't already done so incidentally check your primer Tms with the IDT primer design tool to ascertain what Tm-2C actually is:
  2. https://www.idtdna.com/calc/analyzer
  3. Add 5% DMSO to your PCR reaction: This will assist with any secondary structure resident in your template
  4. 92C for 1 min is not a good denaturing step: Change to 96C for 30 sec: 96C is much more denaturing than 92C (even with extra time) so will render most of your amplicons single stranded increasing the efficiency of your PCR
  5. A 5 min extension for a 1.3kb fragment is too long and unnecessary heating of DNSA can damage (depurination/deamination) which 'poisons' your PCR and results in failed amplification
  6. Thus, try extending @ 72C for 2 min
  7. Finally, try 35 cycles instead of 30
  • asked a question related to C
Question
1 answer
Let $M$ be a totally real submanifolds of product Kaehler manifold
$\overline{M}(c_{1}, c_{2}) = \overline{M}^{n}(c_{1}) \times \overline{M}^{p}(c_{2})$
with $c_{1}$, c_{2} > 0 and tr(P - Q) = 0, where $P$ and $Q$ are the projection operators of the tangent space of $\overline{M}(c_{1}, c_{2})$ to the tangent spaces of $\overline{M}^{n}(c_{1})$ and $\overline{M}^{p}(c_{2})$ respectively. Can $M$ be a totally geodesic in $\overline{M}(c_{1}, c_{2})$ ?
                                      OR
Can $M$ be a totally geodesic submanifold of $\overline{M}(c_{1}, c_{2})$ under certain other conditions ?
Relevant answer
Answer
we did it for cosymplectis.
1. Siraj Uddin, V.A. Khan and Cenap Ozel, A classification of totally umbilical ξ^⊥ CR-submanifolds of cosymplectic manifolds, Rocky Mountain Journal of Mathematics (accepted) (ISI-Cited Publication) - http://projecteuclid.org/euclid.rmjm/1374758609
2. Siraj Uddin and Cenap Ozel, A classification theorem on totally umbilical submanifolds in a cosymplectic manifold, Hacettepe Journal of Mathematics and Statistics, (Accepted) IF=0.354 Q4-ISI (ISI-Cited Publication
  • asked a question related to C
Question
4 answers
I wanna to find the modulus from ultrasonic pulse velocity or (ASTM C 597) 
Relevant answer
Answer
dear, oskar baggen
thank you so much 
  • asked a question related to C
Question
3 answers
I am working on Processor-Pool model for a project. Here are some assumptions:
1. Users have a low-end system.
2. They want to use an application which requires high-end workstations.
3. They need real-time graphic(visual) updates.
I was wondering if it is possible to do this without screen capture or TeamViewer, or RealVNC, or Red5 like software. I came across an idea to develop a network display model through the following method:
a. The user has a small software installed on their system which is connected via sockets to the server. Each user input is sent to the server(This is where Processor Pool model come into play).
b. Like cloud gaming services, the input is processed and the display is generated. But instead of sending video output we generate a file which is sent to the user.
c. The user receives this file and the small software installed on his system generates the final display output.
Now my question is what might be the extension of file highlighted above. Conventionally we have the file with extensions like JPG/ AAC/ H.265 codec/ etc.
Is it possible to generate a JSON for the file and which when received by the software at the user end generates the desired display output?
Please post your queries, if you have any. I am looking forward to discussing with all the great people out there.
Note: I am not looking for Screen Capture solutions. And a big TIA
Relevant answer
Answer
I believe that you are trying to reinvent something that already exists, which is fine! But, in this particular instance, VNC as a server-client method is pretty much what you ought to find sufficient for your explained use-case scenario.
The server can run a virtual screen which renders the application that demands a a lot of processing power to run (which the serve supplies one way or another) and the client is just a dumb terminal capable of performing minimal data decoding at some phase and showing it on the physical screen.
The method you've proposed (using JSON and JPEG) suggests that you want to send frame-by-frame data, which can be troublesome in terms of bandwidth, required down-link speed and inability to perform multi-frame compression (between key-frames).
VNC allows all of this. It is efficient, optimised, has different modes for different targeted frame-rates and display content change dynamics.
Your proposed method would have to be designed and developed from scratch, which is, in this particular instance, probably a waste of your time and resources.
Of course, VNC is not the only possible solutions. There are others, but they are all probably much better suited than an own (new) solution, unless the application itself (that will be ran on the server) can directly create a stream of video data and push it to the client, completely skipping the need for a virtual display. This, however, requires a specialised application made specifically to function that way.
  • asked a question related to C
Question
3 answers
in the link of github sha transform has two arguments ctx and byte data[], what is data[] meant for and in the next line wat is i and j and why shifts are done of 24,16,8 and why j added with 3
next step what states mean here and according to what i know that first 16 rounds would be copying the m[16] and next 48 that computations of sigma and all would be done but in this program why direct 64 rounds that are done  and iteration starting from 0 to 64
what are bitlen and bitdata referring too...whybilen added with 512 in if part
and atlast final is completely a  grrek for me i could understand is somewhere padding is done but why if and else part are done with 56 and 64 i donno
and why memset has been used . at last step appending to padding tha message in bits and transform and last steps are completely out of my head now....sorry to ask the question mant times but need some guidance to understand and to work on because im not so strong in c
Relevant answer
Answer
24, 16, 8 these are used to represent the number of bits used in Hash function. Data[] is used for initialized the string used for encryption.
Data[] is used for initialized the string used for encryption.
ctx is a pointer used for naming conversion.
  • asked a question related to C
Question
9 answers
i have gone through all this links..but im not understanding the link which i have uploaded..i have to make changes in opencl code thta is implemented in sha256.for that proper undestanding of sha256 is needed..in the link which i uploaded can anyone help in explaing me wat happens in the program.
Relevant answer
Answer
Dear Thiruman,
I am not an expert on hashing algorithms, but as I told you before, you should not start studying a subject by reading a code, if it is too complex. I would advise you reading a book or something like that. From the Wikipedia page I linked earlier, I found a good description (see below).
Hope it helps!
  • asked a question related to C
Question
3 answers
Do x,y,z values defined in UDF take the same x,y,z values of the main geometry in Fluent or does it depend on some flow like x is always for fluid flow etc?
Also, how to know if the UDF follows the origin of the required boundary surface ?
Attached is the UDF I have tried to code.
#include "udf.h"
DEFINE_PROFILE(inlet_temp,thread,position)
{ float x[ND_ND]; /*hold position vector*/
float y;
float r;
float x2;
float y2;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);
y=x[1];
x2=pow(x[0],2);
y2=pow(x[1],2);
r=pow(x2+y2,0.5);
F_PROFILE(f,thread,position)=/*..r*/;
}
end_f_loop(f, thread)
}
Relevant answer
Answer
Dear Gargi,
yes, x,y and z coordinates defined in the UDF are the same of Fluent since you are referring to the imported geometry.
Anyway, you can double check the x, y and z values of your UDF including a "printf" instruction to have a visual confirmation in the Fluent TUI.
Best regards,
Simone
  • asked a question related to C
Question
24 answers
I want to know if there is any IDE for C/C++ which could help in easy debugging of a large C/C++ project in Mac.
I have tried Netbeans but it doesn't help although there is debugging process there but as it encounters any error it stops all of a sudden without giving any details about the line number where error is occurring.
Relevant answer
Answer
I think Xcode is pretty good IDE for C/C++/Java.. code development. And it has good debugging tools.
  • asked a question related to C
Question
1 answer
I would like to emulate various n-bit binary floating-point formats, each with a specified e_max and e_min, with p bits of precision. I would like these formats to emulate subnormal numbers, faithful to the IEEE-754 standard.
Naturally, my search has lead me to the MPFR library, being IEEE-754 compliant and able to support subnormals with the mpfr_subnormalize() function. However, I've ran into some confusion using mpfr_set_emin() and mpfr_set_emax() to correctly set up a subnormal-enabled environment. I will use IEEE double-precision as an example format, since this is the example used in the MPFR manual:
mpfr_set_default_prec (53);
mpfr_set_emin (-1073); mpfr_set_emax (1024);
The above code is from the MPFR manual in the above link - note that neither *e_max* nor *e_min* are equal to the expected values for `double`. Here, p is set to 53, as expected of the double type, but e_max is set to 1024, rather than the correct value of 1023, and e_min is set to -1073; well below the correct value of -1022. I understand that setting the exponent bounds too tightly results in overflow/underflow in intermediate computations in MPFR, but I have found that setting e_min exactly is critical for ensuring correct subnormal numbers; too high or too low causes a subnormal MPFR result (updated with mprf_subnormalize()) to differ from the corresponding double result.
My question is how should one decide which values to pass to mpfr_set_emax() and (especially) mpfr_set_emin(), in order to guarantee correct subnormal behaviour for a floating-point format with exponent bounds e_max and e_min? There doesn't seem to be any detailed documentation or discussion on the matter.
Here is a small program which demonstrates the choice of e_max and e_min for single-precision numbers.
#include <iostream>
#include <cmath>
#include <float.h>
#include <mpfr.h>
using namespace std;
int main (int argc, char *argv[]) {
     cout.precision(120);
    // Actual float emin and emax values don't work at all
    //mpfr_set_emin (-126);
    //mpfr_set_emin (127);
    // Not quite
    //mpfr_set_emin (-147);
    //mpfr_set_emax (127);
    // Not quite
    //mpfr_set_emin (-149);
    //mpfr_set_emax (127);
    // These float emin and emax values work in subnormal range
    mpfr_set_emin (-148);
    mpfr_set_emax (127);
    cout << "emin: " << mpfr_get_emin() << " emax: " << mpfr_get_emax() << endl;
    float f = FLT_MIN;
    for (int i = 0; i < 3; i++) f = nextafterf(f, INFINITY);
    mpfr_t m;
    mpfr_init2 (m, 24);
    mpfr_set_flt (m, f, MPFR_RNDN);
    for (int i = 0; i < 6; i++) {
        f = nextafterf(f, 0);
        mpfr_nextbelow(m);
        cout << i << ": float: " << f << endl;
        //cout << i << ": mpfr: " << mpfr_get_flt (m, MPFR_RNDN) << endl;
        mpfr_subnormalize (m, 1, MPFR_RNDN);
        cout << i << ": mpfr: " << mpfr_get_flt (m, MPFR_RNDN) << endl;
    }
    mpfr_clear (m);
    return 0;
}
With thanks,
James
Relevant answer
Answer
There are different conventions to express significands and the associated exponents. IEEE 754 chooses to consider significands between 1 and 2, while MPFR (like the C language, see DBL_MAX_EXP for instance) chooses to consider significands between 1/2 and 1 (for practical reasons related to multiple precision). For instance, the number 17 is represented as 1.0001·24 in IEEE 754 and as 0.10001·25 in MPFR. As you can see, this means that exponents are increased by 1 in MPFR compared to IEEE 754, hence emax = 1024 instead of 1023 for double precision.
Concerning the choice of emin for double precision, one needs to be able to represent 2−1074 = 0.1·2−1073, so that emin needs to be at most −1073 (as in MPFR, all numbers are normalized).
As documented, the mpfr_subnormalize function considers that the subnormal exponent range is from emin to emin+PREC(x)−1, so that for instance, you need to set emin = −1073 to emulate IEEE double precision.
  • asked a question related to C
Question
1 answer
Hi
I have a problem in my transformation part of project
after preparation of competent cells and transformation nothing growth in plates
protocol of competent cell is this
5ml of renewed bacteria in LB broth in certain OD
centrifuge 3000rpm 3min - remove liquid part
add 1ml of CaCl2 and re suspend  .incubate 30 mins on ice
centrifuge 3000rpm 3min - remove liquid part
add 670 MicL CaCl2 and re suspend . incubate 30 mins on ice
centrifuge 3000rpm 3min - remove liquid part
add 300 MicL of CaCl2
incubate on ice 30mins
heat shock 45sec in 42`C
immediately transfer tube on ice 2mins
add 900 MicL LB medium
incubate 4 hours in falcon tube in 37`C shaking  190 rpm
then culture in this medium :
LB Agar + Kana(50Micg/Ml) + tetra (10Micg/Ml)+ 100micg/ML X-Gal)+7micg/Ml gentamycin + 40 micg/ml IPTG
but nothing growth after 48hour in 37`C
what is your advise or where is the problem  
Relevant answer
Answer
Hi Amir,
Firstly, for making competent cells, one of most critical parameter is the right O.D at 600 nm., It is generally recommended to be between 0.2 and 0.5. Ideally the mid log phase cells OD 0.5 works just best.. I would like to tell you that there is a competency buffer (CCMB80) for preparing DH10Bac and as a good practice I would advice you to stick to that buffer. You may find the details online.
But, why did you heat shock the cells without adding any DNA, I hope your intention was to transform these prepared competent cells to test their Transposition efficiency!! For transformation with donor construct, use 100ng DNA..
Secondly, It is important that you confirm the selection marker (Gentamicin or Ampicillin) on your transfer vector., and supplement the drug along with the culture medium when you prepare plate.
Hope this Helps!
Good Luck :)
  • asked a question related to C
Question
4 answers
I have been looking at the "convolutionSeparable" code sample provided with CUDA 7.5, for the implementation of a 2-D FIR filter for image processing. 
The rationale behind the design is discussed in the link.
Has anybody else looked closely at this code and found possible improvements or have any other comments/thoughts? 
Relevant answer
Answer
OK. This is what I have found so far ...
The attached design doc all makes sense (but I would disagree that "convolution measures the amount of overlap between two functions"). However, I found the sample code difficult to follow. So I wrote my own ...
I used the sample code as a performance benchmark and eventually I was able to match it. I found the profiler to be more reliable than timer calls for quantifying execution speed.
Yes, using shared memory improves performance, despite the extra code and (wasted) threads required to populate it. 
My code was much more compact than the sample code. Why are loops used to populate the shared memory tile in the sample code? I just used a single thread to populate each element, before proceeding to the convolution (after syncing threads in the block).
My code runs at around 100% GPU occupancy compared with 50% for the sample code, yet the execution time is roughly the same (?). 
My row and col calls have approximately equal run times, whereas the sample code run times are very different in each dimension so the total run time will depend on the image aspect ratio!
In my code, I zero out the edge effects around the perimeter of the image.
I'll post my code later, if there is any interest.
  • asked a question related to C
Question
4 answers
Let f be an involutive (f(f(x)) = x) function from R>0  to R>0 such that f(1) = c, (then f(c) = 1).
I have obtained the following f(f(x)f(y))/xy = f(xy)/f(x)f(y), by setting f(y) = 1, we get f(xy) = f(x)/y. How to prove that this is valid for all y>0?
I have used the injectivity of f. Note that f is a bijection, and f(y) = 1 for y = c.
The function in the question is f(x) = c/x.
Relevant answer
Answer
Dear Mr Stoica,
I thank you for your reply. The functional equation I considered is not of a logarithmic type. It is a Babbage type.
  • asked a question related to C
Question
6 answers
Hello Everyone,
I want to scale down a 16 bit unsigned data into a range of 0 to 255 in C.
Can any body guide me how i can achieve this?
Looking forward for reply!
Best Regards
Awais
Relevant answer
Answer
In order to divide by 256, shift
the number right 8 bits.
Use >> 8.
Regards,
Joachim
  • asked a question related to C
Question
13 answers
I need to import residual stress field into my model using the Predefined filed option and output database file. Everythin is ok until I need to start the calculation when it says; The following file(s) could not be located: "C:/....." . But file is there of course. Do you know maybe where is the poblem?
Best,
Darko
Relevant answer
Answer
In the meantime I found the solution. File is needed to be in the ORIGINAL Abaqus temp folder. In my Abaqus I change the location of the temp folder, but for the predefined field input the file is needed to be in the original one which is in C:\Users\name\AppData\Local\Temp
 Thank you on all your help and whish you all the best.
Darko
  • asked a question related to C
Question
5 answers
I have designed a testing approach to test integration fault of embedded system. I have already created the test criteria. But now i need to go for experimentation but i do have any sample code. I need some real C code which i can execute with test cases. I tried to search in many sites but did not get suitable code.
What should i do now? Because without execution i cannot collect the test result. Please share your idea.
Thank you.
Relevant answer
Answer
Hi Muhammad, 
  You can have a look at open source C projects in gitHub. 
  • asked a question related to C
Question
5 answers
In many articles, the transmitter sends data with a rate (R)<the outage capacity(C), and then the receiver can correctly decode the codewords.
If there is only 5 bits, and these bits are all destroyed by the noise. So, how the receiver recovers them? Because the noise is randomly.
Relevant answer
Answer
Dear @Jie Shi, 
Shannon's theory is formulated under the assumption of there is something transmitted over the channel, of course, if everything is corrupted, you will have any data on the receiver to draw any conclusion. Under Shannon's formulation, you can make a communication scheme (coding, symbols, etc) to make the probability of error arbitrarily small. Of course, if all is lost, this is over. Eventhough, it is remarkable Shannon's work, it states that even over a really noisy channel, Perror = 99/100, you can come up with a communication scheme to make the probability of error really small.
The key point is, Shannon's doesn't talk about 100% correct decoding of a message, it is said as close as you want to 100%, which is slightly different.
  • asked a question related to C
Question
1 answer
Hello Everyone,
I want to implement elliptical low pass filter in C.
But i am finding difficulty in it.
Can any one please guide me how i can implement it?
Looking forward for your reply.
Best regards
Awais
Relevant answer
Answer
Dear Researcher
in addition to the above answer ,m sending you a link where you can find some more filters implementation in c.hope it will help you.
Regards
  • asked a question related to C
Question
4 answers
I want to extract data directly from LIRT/HRIT data received from GOES Satellites and be able to process the fields in it. Maybe a reference of the standard data codification in LRIT/HRIT files will be also helpful for me.
Relevant answer
Answer
I've heard of pytroll:
Take a look at this page:
They're listing some processing tools for meteorological data.
I'm aware of zyGrib which is an open source grib viewer, maybe it has some plugins for xRIT format you could easily use.
  • 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.
Question
3 answers
The prototype of scanf is int scanf(const char *ptr , ...) ,Now I have following  confusions regarding  scanf :
1. How does it matches the fact that whatever is specified in the format string , in the similar pattern we must have the input 
for instance , format string is "%d ,%d" , so the input too should only be given as 2,3 
2. We say that scanf skips any white-space characters , but it is only due to white-space characters that we come to know about the next input .
Now if I write "%d  %d" ,Now I have given only 2 space characters between the format specifiers but then I can give any white-spaces between the inputs , so then is this skipping related to input or spaces between the format specifiers , How does it matter whether I give 2 spaces or 3 spaces between the format specifiers %d and %d .
3.And in the variable argument part we write &a ,&b for scanning the values but where do we have a pointer to hold the address of variable a and b and store the values in those locations , since in the prototype of scanf we only have 
int scanf(const char *ptr , ...) ; and *ptr is a pointer to input buffer so then where do we have pointers for accepting the address of variables passed to scanf function 
And similar confusions arise for printf as well except for the fact that there I have printf("%d %d",a,b) ; so now here in the prototype of printf is
int printf(const char *ptr , ...) , Now here *ptr is again a pointer to output buffer so then how come we are able to read from memory locations pertaining to variables a and b ?
Relevant answer
Answer
1°)scanf/printf are variadic functions: they use "va_list" and call vscanf/vprintf on every elements of this list. How it is done is very platform dependant, the "..." parameters are deciphered by va_start / va_arg / va_end macros.
Theorycaly, here's no way for the compiler to check type of the parameters when you're calling a variadic function at compile time. This is not true (at least with GCC) if you provide a format string known at compile time, compiler know for printf/scanf how to analyse the format string and check for coherence with the parameters type you provide, but it works because the compiler is awre of the convention used by the format string. For your variadic functions, you can not check at compàile time, that why some coding standard avoid them (iirc misra discourage their usage).
2°)"We say that scanf skips any white-space characters , but it is only due to white-space characters that we come to know about the next input ."
I'm not sure there, but I guess is more related to the subfunction atoi/strtol that ignore heading/trailing space(s) duing the conversion.
3°)1st parameter of scanf is _NOT_ a pointer to an input buffer, it is the format string: the description on how the scanf function must interpret the input (stdin for scanf), for scanf, all subsequent parameters are outputs, thus you must pass them by address, the type they point to is described by the format string, if the address content is not of the same type strange things can occure. As for printf, the 1st given parameter is _NOT_ an output buffer, it is the format string (again), every characters of it are copied to the output buffer (stdout for printf) until a "%" is encounterred, then the convertion mechanism is called to replace the %xyz by the parameter string representation, but the format string descriptor is used to interpret the parameter, not its type, for exemple printf("%s %p", "foo", "foo") will display the string "foo" then its address
I hope it helps
  • asked a question related to C
Question
7 answers
I m trying to find video read & write library in C/C++, not OpenCV .
(Open source which is verified or made by research group.)
is there anyone can help me
Relevant answer
Answer
May I suggest that you take a look at libVLC at http://www.videolan.org/vlc/libvlc.html. This is an OpenSource SDK that will allow a C/C++ application to do video processing using the VLC framework and features.
  • asked a question related to C
Question
4 answers
My main purpose is developing the SPI (Serial Peripheral Interface) with Chip ADS1299 Texas Instrument. I has been built the C-source code program ARM'multicore-based but limited perform to Acquiring signal with loss data.
Many papers were suggested to develop with SPI DMA standard.
Can you advice for me about Daisy-Chain SPI to connecting 4 devices ADS1299 Texas Instrument with simultaneous process. Really thanks
Relevant answer
Answer
I do not see any hardware related problem. And there is no need to go for even a simple ARM device, then forget about a multicore-ARM one. I suspect the problem in your software (mostly written in C) routines. Loss of data indicates inappropriate timings of both the clock pulses and the data reading activities.
I am quite sure that even a simple 8-bit micro should be capable of reading data from ADS1299.
I even checked the ADS1299 datasheet. The timing diagram and the timing values are confusing. The Master clock timing value is given for example to 444ns to 666ns - This gives a master clock frequency of 2.225MHz (higher) to 1.5MHz (lower). However, the SPI Clock SCLK timings are shown wider (lower frequency in the diagram) but values shows fewer ns (higher frequency than the master clock). By looking at the sampling speed of the device, these value should have been in microsecond (uS) rather than in ns.
Keeping that aside, can I suggest you to make some observations of your SCLK and Data pin on a digital storage oscilloscope (DSO)? Also, verify that in daisy-chain configurations, even though you are reading data continuously, there is additional time between successive device read as stated in datasheet as daisy chain setup and hold time. Send the image of the waveform if possible so that we can discuss it further.
  • asked a question related to C
Question
15 answers
Vibation analyzer in Measurement, Diagnosis and Speech Recognition use a state machine for event-driven control. Which programming language is the best for a software-state-machine in event-driven audiosignalprocessor?
Relevant answer
Answer
Sir,
Everyone is best with the language they know the best. You mentioned a state machine, I would suggest LabVIEW using a Queue Driven State Machine (QDSM) approach. In this approach, you dedicate a Queue to each major function (GUI Input, GUI Output, File input, File Output, Data Acquisition, Preprocessing data, processing data, report generation, etc). Each of these Queues will be able to communicate with each other queue through queue commands or events. The entire project could have a script queue that would allow it to be scripted from a text file (something I often do to allow reusability of the code).
I find that I can handle projects with over a thousand subroutines / SubVIs  by myself using this method. So little outside help is needed once you get some experience with it.
Good Luck!!!
  • asked a question related to C
Question
2 answers
I work on CORDIC-based DCT Structures and I want to know the main difference between Unfolded CORDIC and Lookahead CORDIC structures. Is there any difference between these structures?. These structures have been described in the following references.
[1]  M.-W. Lee, J.-H. Yoon, and J. Park, "Reconfigurable CORDICbased low-power DCT architecture based on data priority," VeryLarge Scale Integration (VLSI) Systems, IEEE Transactions on, vol. 22, pp. 1060-1068, 2014.
[2] C.-C. Sun, S.-J. Ruan, B. Heyne, and J. Goetze, "Low-power and high-quality Cordic-based Loeffler DCT for signal processing,"Circuits, Devices & Systems, IET, vol. 1, pp. 453-461, 2007.
Relevant answer
Answer
Dear Sir,
- The cordic algorithm is typically used to
  (a.) given (z, alfa) calculate x = z cos(alfa) and y = z sin(alfa)
  (b) given x = z cos(alfa) and y = z sin(alfa), calculate z and alfa
- During the cordic algorithm, there are 3 variables maintained:
  x1, y1, alfa1, and then there are transforms done that leave atan(y/x) + alfa constant, and result is a fixed amplitude growth during the transform. - The transformations done are rotations over a certain angle:
  x1 = x1*cos(angle1) - y1*sin(angle1)
  y1 = y1*cos(angle1) + x1*sin(angle1)
  alfa1 = alfa1 - angle1
- this is then modified into:
  x1 = cos(angle1) * (x1 -y1 *tan(angle1))
  y1 = cos(angle1) * (y1 + x1 * tan(angle1))
  alfa1 = alfa1 - angle1
- There are two forms in which this algorithms is used.
  (a) start with x1 = z, y1 = 0, alfa1 = alfa, and then iterate until alfa1 = zero
  (b) start with x1 = x , y1 = y, alfa1 = 0 and iterate until y1 = zero
- The iterations will use different angles, wherefor tan(angle1) are powers of 2.
   - 1. + or - 90 degree
     2. + or - 45 degree
     3. + or - atan(0.5)
     4. + or - atan(0.25)
- The sign is selected so that either y or alfa go to zero (convergence). The angles are selected such that the multiplication with the tangent is trivial.
- As the +/- sign has no effect on the value of the cos, and the cos only results in a fixed growth of the magnitude of the vector (which is independent of the rotation angle), it is omitted, and the algorithm is simplified to:
x1 = x1 - y1 * tan(angle1)
y1 = y1 + x1 * tan(angle1)
alfa1 = alfa1 - angle1
Now, an 'unfolded cordic' has hardware for every iteration. It has three full adders (one for X, one for Y, one for alfa) for each step of the algorithm. It can execute the algorithm in one clock (when not pipelined.)
A 'folded cordic' maps more steps of the algorithm on the same full adders, and has registers and feedback for this, and also the atan value is selected by a multiplexer as one set of full adders need to represent multiple atan values.
The drawback of the 'unfolded' cordic is the cascade of full adders. If you have eg a 10 iteration cordic, there is a cascade of 10 full adders, and their carry is slow. A 'lookahead' cordic has means to speed up the carry. (I did not find details there.)
Please note, that while the cordic looks nice on paper, the multiple carry paths in the  'unfolded' cordic are a problem. To do the transform x = z cos(alfa) and y = z sin(alfa), you should also consider alternate methods using multipliers. Using multipliers means more logic, but less carry propagation, and this may be faster than the cordic.
Cheers ,
Henri
  • asked a question related to C
Question
1 answer
I am optimizing an organic molecule on a CdSe cluster with Gaussian. However, the organic molecule is completely dissociated to its atoms in the final geometry. I am not sure about the basis set of Se. I have also tried the 6-31G basis for Se but I have the same result.
here is the input file
1 1
Cd 0.44201800 3.32548000 -0.38103700
Se 1.77943700 5.41809200 0.42354100
Se 1.57838900 1.12282200 0.43872800
Se -2.04088600 3.44451900 0.41648100
Cd 4.26234600 5.29905600 -0.37396700
Cd 4.06129800 1.00378400 -0.35878100
Cd 0.24097100 -0.96978900 -0.36585100
Cd -3.17725700 5.64717800 -0.40328400
Cd -3.37830600 1.35190600 -0.38809900
Se 5.39873800 3.09639500 0.44576500
Cd 7.88157800 2.97736200 -0.35171600
Se 5.19767900 -1.19887200 0.46095700
Cd 7.68055000 -1.31791100 -0.33653900
Cd 3.86024800 -3.29148700 -0.34360200
Se 1.37734100 -3.17244900 0.45391100
Se -2.24193600 -0.85075400 0.43166700
Cd 0.03992200 -5.26506000 -0.35066500
Cd -3.57935300 -2.94336500 -0.37291300
Se -5.66016200 5.76621400 0.39423300
Cd -6.99758400 3.67360100 -0.41034400
Se -5.86120900 1.47094200 0.40942100
Cd -7.19863200 -0.62166800 -0.39516000
Se 9.21905900 5.06997500 0.45285000
Se 9.01801000 0.77469500 0.46803600
Se 8.81695100 -3.52057400 0.48322500
Cd 7.47951900 -5.61318300 -0.32135800
Se 4.99662400 -5.49414400 0.47615900
Se -2.44298400 -5.14602400 0.44685400
Se -6.06225900 -2.82432900 0.42460600
Cd -7.39968100 -4.91693900 -0.37997300
Se -9.48048900 3.79263900 0.38717400
Se -9.68153800 -0.50263100 0.40235900
Se -9.88258500 -4.79790300 0.41754500
H 10.53166000 4.79103000 -0.22125300
H 10.31229300 0.73905500 -0.27810300
H 10.17197100 -3.50791000 -0.15120800
H -10.44276800 -6.08635800 -0.11884900
H -10.18311300 -1.79294200 -0.18051200
H -9.79474600 2.33395800 0.20839800
C -4.54000088 -1.38915111 -2.57307321
C -3.27539888 -1.91048011 -2.57303221
C -2.10958788 -1.07805311 -2.57304621
C -2.32662788 0.34240089 -2.57308921
C -3.59697288 0.88197689 -2.57312421
C -4.74684188 0.03606289 -2.57313321
C 0.49572012 0.34240089 -2.57307621
C 0.27868012 -1.07805311 -2.57302921
C 1.44449012 -1.91048011 -2.57298921
H 1.27521112 -2.98067111 -2.57292121
C 2.70909212 -1.38915211 -2.57301421
C 2.91593412 0.03606189 -2.57309321
C 1.76606512 0.88197689 -2.57309721
H -5.38856388 -2.05818911 -2.57301021
H -3.10611888 -2.98067011 -2.57296921
H -3.71511288 1.95693089 -2.57318421
H 3.55765512 -2.05819011 -2.57293521
H 1.88420512 1.95692989 -2.57313321
S -0.91545388 1.48302789 -2.57310821
N -0.91545388 -1.69791411 -2.57301221
C -7.18936988 -0.31836711 -2.57341621
C -6.20880388 2.01966989 -2.57289821
H -7.21172088 -0.95315611 -1.68118021
H -8.08499788 0.30027589 -2.57407021
H -7.21088288 -0.95374111 -3.46524321
H -5.76981188 2.48001089 -1.68069621
H -5.77021388 2.48032089 -3.46514321
H -7.27720988 2.22744389 -2.57261121
C 5.35846212 -0.31836611 -2.57321721
C 4.37789512 2.01966989 -2.57294621
H 5.38006512 -0.95378711 -3.46500821
H 6.25409012 0.30027789 -2.57381321
H 5.38072612 -0.95310711 -1.68094521
H 3.93908312 2.48028989 -3.46509621
H 3.93912312 2.48004089 -1.68064921
H 5.44630112 2.22744489 -2.57294521
N -6.00221388 0.55965989 -2.57318121
N 4.17130612 0.55965989 -2.57314521
X 1 F
X 2 F
X 3 F
X 4 F
X 5 F
X 6 F
X 7 F
X 8 F
X 9 F
X 10 F
X 11 F
X 12 F
X 13 F
X 14 F
X 15 F
X 16 F
X 17 F
X 18 F
X 19 F
X 20 F
X 21 F
X 22 F
X 23 F
X 24 F
X 25 F
X 26 F
X 27 F
X 28 F
X 29 F
X 30 F
X 31 F
X 32 F
X 33 F
X 34 F
X 35 F
X 36 F
X 37 F
X 38 F
X 39 F
H N S 0
6-31+G*
****
Cd Se 0
LANL2DZ
****
Cd Se 0
LANL2DZ
Relevant answer
Answer
 Are you sure about  monolayer CdSe with terminating with (Pseudo)  hydrogens  ?
If you are really continue with above structure. I hope you should try different orientation. The above guess is may not be near to local minima.
I hope you should go for PW based codes with PBC (for. e.g. QE or VASP) with including multiple (optimized) slab). Then, you place proper orientation of organic molecule providing sufficient vacuum. You can go for pseudopotential method instead of localized bassis
Regards
Subrahmanyam
  • asked a question related to C
Question
3 answers
Hi, I am working on sliding mode controller in robotic manipulators. Does anybody know how to write the code in c language? Please help me.
Relevant answer
Answer
"Applied Non-linear Control" is a good reference for sliding mode controller design. The algorithm is completely described
  • asked a question related to C
Question
3 answers
Do you know any open source tool to migrate C to Java?
Relevant answer
Answer
It is possible to use your C program in Java by using java native interface JNI.
  • asked a question related to C
Question
1 answer
Hello
I have two matrices ones is the u-component velocity and the other is v-component velocity,I am trying to read the values of these two matrices and put them as an initial conditions in the domain of my model. I use the code below but I do not know how to read the values from the matrices and then write them into the model.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#include "udf.h"
#define pi 4.*atan(1.)
DEFINE_INIT(uv_intial,d)
{
cell_t c;
Thread *t;
real xc[ND_ND];
FILE *fp;
real r1;
real xo1 = 0.00;
real yo1 = 0.00;
/* loop over all cell threads in the domain */
thread_loop_c(t,d)
{
/* loop over all cells */
begin_c_loop_all(c,t)
{
C_CENTROID(xc,c,t);
r1=sqrt(ND_SUM(pow(xc[0] - xo1,2.),
pow(xc[1] - yo1,2.),
pow(xc[2] - 0,2.)));
/* Note xc[0] is x coordinate, xc[1] is y and xc[2] is z */
if ( r1 != 0.0)
{
fp=fopen("u.txt","r");
fscanf(fp,"lf% %lf",&r1,&u);
DEFINE_RW_FILE(uv_intial,fp)
C_U(c,t) =
C_V(c,t) =
}
else
{
C_U(c,t) = 0.0;
C_V(c,t) = 0.0;
}
}
end_c_loop_all(c,t)
fclose(fp);
}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
thanks in advance for your help
Relevant answer
Answer
hi can you please give little more details about how your matrix looks like?
example of u.txt file format
  • asked a question related to C
Question
9 answers
Please give an opinion for my question, thank you. 
Relevant answer
Answer
As already stated, it is perfectly possible to program the Arduino board w/o the IDE. But keep in mind, whenever you plan using high-level languages such as C/C++ in the domain of µController you might suffer performance penalties in contrast to low-level assembly programming.
Furthermore you will have to deal with the specific port names (as the link from Oussama Kaoui already states). But in fact "breaking free" from the Arduino IDE is a good idea.
Best wishes - Kenneth :)
  • asked a question related to C
Question
8 answers
How to implement abstraction mechanism in c++ , what are the different types of abstraction mechanisms? I need some examples to understand.
Relevant answer
Answer
Here is an example that my students have found helpful.  First, build an abstract superclass representing generic employees:
---
class Employee {
public:
  Employee(const string& name, unsigned id) { myName = name; myID = id;}
  string getName() const { return myName; }
  virtual double getPay() const = 0;
  void writePayCheckTo(ostream& out) const
  { out << myName << " (" << myID << ") " << getPay(); }
 
private:
  string myName;
  unsigned myID;
};
---
Then build a subclass for salaried employees:
---
class SalariedEmployee : public Employee {
public:
  SalariedEmployee(const string& name, unsigned id, double salary)
  : Employee(name, id), mySalary(salary) {} 
  double getSalary() const { return mySalary; }
  virtual double getPay() const { return mySalary; }
private:
  double mySalary;
};
---
and another subclass for hourly employees:
---
class HourlyEmployee : public Employee {
public:
  HourlyEmployee(const string& name, unsigned id, double hours, double wage)
   : Employee(name, id), myHours(hours), myWage(wage) {} 
  double getHours() const { return myHours; }
  double getWage() const { return myWage; }
  double getPay() const {
     double result = myHours * myWage;
     if (myHours > 40) {
        result += (myHours - 40) * myWage * 0.5;  // add in overtime
     }
     return result;
  }
private:
   double myHours, myWage;
};
---
Then a simple program that uses the classes:
---
#include <iostream>
using namespace std;
// ... class declarations go here
int main() {
   Employee* emp1 = new SalariedEmployee("Jane", 01, 500.00);
   Employee* emp2 = new HourlyEmployee("John", 02, 42, 10.00);
   cout << emp1->getPay() << '\n'
        << emp2->getPay() << '\n';
 
   emp1->writePayCheckTo(cout); cout << '\n';
   emp2->writePayCheckTo(cout); cout << '\n';
}
---
The output from the program is:
  500
  430
  Jane (1) 500
  John (2) 430
Employee is an abstract class because its getPay() method is a pure virtual method (i.e., abstract).
The calls to getPay() within main() are polymorphic, but require no cast because Employee contains an abstract declaration of getPay().
The writePayCheckTo() method is only defined in Employee, so it is inherited, but it calls the polymorphic getPay() method, which is bound at runtime to the definition in the subclass of the object on which writePayCheckTo() is invoked.  (This example assumes the U.S. practice of hours beyond 40 earning overtime pay at 1.5 the usual rate.)
  • asked a question related to C
Question
6 answers
Result: The number of compositions of 2n, say c_1+c_2+...c_k=2n, satisfy that Sum_(i=1..j) c_i <2j for all j=1..k is equal to C(2n-1, n), i.e., the number 2n-1 choose n.
E.g., when n=2, C(3, 2)=3 because we can write 4=1+1+1+1=1+1+2=1+2+1.
Is there an easy way to prove it directly?
Relevant answer
Answer
To Ricky,
Just to clarify... your example is for n=2, so 2n=4 and you found 3 compositions with the formula C(3,2). Looks like C(2n-1,n) instead of C(2n+1, n+1). Tried it too for n=3 and it gives C(5,3)=10 compositions. With no + signs to make it short : 111111, 11112, 11121, 1113, 11211, 1122, 1131, 12111, 1212 and 1221.
  • asked a question related to C
Question
5 answers
close all
clear all
clc
a= rand(1e6,1);
b= rand(1e6,1);
c= zeros(size(a));
tic
tstart=tic;
for i=1:length(a)
c(i)=a(i)+b(i);
d(i)=c(i)+b(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
e(i)=d(i)+c(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
c(i)=a(i)+b(i);
d(i)=c(i)+b(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
e(i)=d(i)+c(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
c(i)=a(i)+b(i);
d(i)=c(i)+b(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
e(i)=d(i)+c(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
end
t_normal_for=toc(tstart)
tstart=tic;
parfor i=1:length(a)
c(i)=a(i)+b(i);
d(i)=c(i)+b(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
e(i)=d(i)+c(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
c(i)=a(i)+b(i);
d(i)=c(i)+b(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
e(i)=d(i)+c(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
c(i)=a(i)+b(i);
d(i)=c(i)+b(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
e(i)=d(i)+c(i)*a(i)+b(i)/a(i)+b(i)*a(i)+b(i);
end
t_parfor=toc(tstart)
Relevant answer
Answer
As far as I can see your variables are co-depent, so, when you call say c(i)=a(i)+b(i); it will wait until the previous lines are executed, since you use the value of c(i) there.
I suggest you make your variables more indepent, otherwise, sequential processing is the best solution.
  • asked a question related to C
Question
5 answers
How can I locate and distinguish between the N and C terminal in a Xray crystallographic structure of a protein in pdb?
Relevant answer
Answer
If you're looking at a protein molecule in a graphics programme like pymol, then the amino acid with the lowest residue number is the "visible" N-terminus and the one with the highest residue number is the "visible" C-terminus.
If you're looking at a pdb file instead, you'll see lines that look like this:
ATOM   1  N   LYS A 122      48.634 -28.081  21.272  1.00 44.28       N 
ATOM   2  CA  LYS A 122      47.475 -28.583  20.498  1.00 49.73       C 
ATOM   3  C   LYS A 122      46.238 -27.671  20.520  1.00 38.88       C 
ATOM   4  O   LYS A 122      45.871 -27.078  21.534  1.00 42.39       O 
ATOM   5  CB  LYS A 122      47.118 -29.995  20.929  1.00 55.26       C 
ATOM   6  CG  LYS A 122      46.105 -30.107  22.042  1.00 57.09       C 
ATOM   7  CD  LYS A 122      45.791 -31.570  22.263  1.00 66.89       C 
ATOM   8  CE  LYS A 122      44.770 -32.043  21.242  1.00 69.87       C 
ATOM   9  NZ  LYS A 122      44.677 -33.516  21.162  1.00 74.29       N 
I have highlighted the important bits by making them bold. If we concentrate on the second line: this means you're looking at atom number 2 in this pdb file, which is a carbon atom and belongs to a lysine residue, which is residue number 122 of chain A.
CA: this is the name of the atom. The atom type is mentioned at the end of the line (in this case it is C). As an amino acid has several atoms of the same type, they are given different names to distinguish them. For example CA, C, CB, CG, CD and CE are all carbon atoms and all have the identifier C at the end of the line, but they have different names after the atom number.
LYS: this is the name of the amino acid in three letter code that the atom belongs to (in this case lysine).
A: this is the name of the chain. There might be more than one molecule of the same protein in a crystal structure and therefore each protein molecule in a pdb file is generally given its own chain letter to distinguish between them.
122: this is the residue number allocated to the amino acid. This is the number you need to check. The amino acid with the lowest number will have the N-terminus. Remember that other atoms such as water molecules or ligand molecules that interact with a protein molecule are also included in the chain of that protein molecule. So make sure you are looking at an amino acid residue and don't just try to find the highest number in a chain, as that might belong to something else .
The amino acid with the highest residue number inside a chain will contain the C-terminus.
If you want to find the exact atom that forms the terminus rather than the whole residue, then look for the atom of type N with atom name N (as opposed to NZ, for example) in the N-terminal residue and the atom of type C with atom name C (as opposed to CA, CG, etc...) in the C-terminal residue.
Remember that often the residues at either terminus are disordered and therefore not visible in the crystal structure even though they are actually there. Hence, you need to distinguish between the "visible" termini and the "real" termini.
Also, sometimes the numbering can be a bit confusing. For example, very few proteins in crystal structures have "true" N- or C-termini that are identical to the corresponding sequence of the native protein deposited in a data bank. Because you need a lot of protein to make a protein crystal, the protein is generally expressed as recombinant protein with an affinity tag at either the N- or C-terminus. Even if the tag is removed before crystallisation, one or two extra amino acid residues remain that are not present in the native protein sequence. Therefore, you might have a structure that starts at residue -12 (e.g a protein with an N-terminal 6His-tag) or -2 (e.g where an N-terminal tag has been removed but two extra residues remain that are part of the recognition site needed by the protease used to remove the tag).
I hope this wasn't too confusing.
  • asked a question related to C
Question
4 answers
Theses days, I am doing literature review about the new trends in control of nonlinear systems, but it looks like this is a very broad subject. What are the new research areas in the control of such systems?
Relevant answer
Answer
Wang, T., Zhang, Y., Qiu, J., & Gao, H. (2015). Adaptive fuzzy backstepping control for a class of nonlinear systems with sampled and delayed measurements. Fuzzy Systems, IEEE Transactions on, 23(2), 302-312.
Liu, T., & Jiang, Z. P. (2015). Event-based control of nonlinear systems with partial state and output feedback. Automatica, 53, 10-22.
Chen, W., Sun, J., Chen, C., & Chen, J. (2015). Adaptive control of a class of nonlinear systems using multiple models with smooth controller. International Journal of Robust and Nonlinear Control, 25(6), 865-877.
Aranovskiy, S., Ortega, R., & Cisneros, R. (2015). Robust PI Passivity-based Control of Nonlinear Systems: Application to Port-Hamiltonian Systems and Temperature Regulation. arXiv preprint arXiv:1503.02935.
  • asked a question related to C
Question
5 answers
SupposeIi have a server program which is written in java, and the client program in C. How can I establish a communication link between them using TCP connection?
Relevant answer
Answer
One other method - JNI. One advantage of this is that you can call the java methods from C and vice-versa, however, the downside is JNI is more prone to Segmentation faults, and can crash your JVM. 
See JNI Documentation for more details.
  • asked a question related to C
Question
6 answers
Here are my codes:
if i want to do this addition 11+22 upon clicking on = button it should give me 33 but it does not work. the calculator must be able to perform addition correctly please help?
ActivityMain <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
tools:context=".MainActivity" />
<Button
android:id="@+id/btn1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/editText1"
android:layout_marginTop="36dp"
android:text="1"
android:onClick="btn1Click"/>
<Button
android:id="@+id/btn2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/btn1"
android:layout_alignBottom="@+id/btn1"
android:layout_toRightOf="@+id/btn1"
android:text="2"
android:onClick="btn2Click" />
<Button
android:id="@+id/btn3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/btn2"
android:layout_alignBottom="@+id/btn2"
android:layout_toRightOf="@+id/btn2"
android:text="3"
android:onClick="btn3Click"/>
<Button
android:id="@+id/btn4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/btn1"
android:layout_marginTop="15dp"
android:text="4" />
<Button
android:id="@+id/btn5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/btn4"
android:layout_alignBottom="@+id/btn4"
android:layout_toRightOf="@+id/btn4"
android:text="5" />
<Button
android:id="@+id/btnAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/btn3"
android:layout_alignParentRight="true"
android:text="+"
android:onClick="btnAddClick"/>
<Button
android:id="@+id/btnSub"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/btn5"
android:layout_alignParentRight="true"
android:text="-"
android:onClick="btnSubClick"/>
<Button
android:id="@+id/btnDiv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/textView1"
android:layout_alignParentRight="true"
android:text="/" />
<Button
android:id="@+id/btnMul"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/btnDiv"
android:layout_marginTop="14dp"
android:text="*" />
<Button
android:id="@+id/btnEqual"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/btnMul"
android:layout_marginTop="15dp"
android:text="="
android:onClick="btnEq"/>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/editText1"
android:gravity="right"
android:textAppearance="?android:attr/textAppearanceLarge" />
public class MainActivity extends Activity {
Button btn1;
Button btn2;
Button btn3;
Button btnAdd;
Button btnSub;
String btn_val1;
String btn_val2;
String btn_val3;
String btn_valAdd;
String btn_valSub;
EditText edit_text;
TextView textview;
int res;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void btn1Click(View view)
{
btn1 = (Button) findViewById(R.id.btn1);
btn_val1 = btn1.getText().toString();
textview = (TextView) findViewById(R.id.textView2);
textview .append(btn_val1);
}
public void btn2Click(View view)
{
btn2 = (Button) findViewById(R.id.btn2);
btn_val2 = btn2.getText().toString();
textview = (TextView) findViewById(R.id.textView2);
textview .append(btn_val2);
}
public void btn3Click(View view)
{
btn3 = (Button) findViewById(R.id.btn3);
btn_val3 = btn3.getText().toString();
textview = (TextView) findViewById(R.id.textView2);
textview.append(btn_val3);
}
public void btnAddClick(View view)
{
btnAdd = (Button) findViewById(R.id.btnAdd);
//res = Integer.parseInt(btn_val1) + Integer.parseInt(btn_val2) + Integer.parseInt(btn_val3);
btn_valAdd = btnAdd.getText().toString();
textview = (TextView) findViewById(R.id.textView2);
textview.append(btn_valAdd);
}
public void btnSubClick(View view)
{
btnSub = (Button) findViewById(R.id.btnSub);
//res = Integer.parseInt(btn_val1) - Integer.parseInt(btn_val2) - Integer.parseInt(btn_val3);
btn_valSub = btnSub.getText().toString();
textview = (TextView) findViewById(R.id.textView2);
textview.append(btn_valSub);
}
public void btnEq(View view)
{
textview = (TextView) findViewById(R.id.textView2);
if(btnAdd != null)
{
if(btn_val1 != null && btn_val2 != null )
{
res = Integer.parseInt(btn_val1) + Integer.parseInt(btn_val2);
textview.setText(String.valueOf(res));
}
else if(btn_val1 != null && btn_val3 != null)
{
res = Integer.parseInt(btn_val1) + Integer.parseInt(btn_val3);
textview.setText(String.valueOf(res));
}
else if(btn_val2 != null && btn_val3 != null)
{
res = Integer.parseInt(btn_val2) + Integer.parseInt(btn_val3);
textview.setText(String.valueOf(res));
}
else if(btn_val1 != null && btn_val2 != null && btn_val3 != null)
{
res = Integer.parseInt(btn_val1) + Integer.parseInt(btn_val2) + Integer.parseInt(btn_val3);
textview.setText(String.valueOf(res));
}
}
else if(btnSub != null)
{
res = Integer.parseInt(btn_val1) - Integer.parseInt(btn_val2) - Integer.parseInt(btn_val3);
textview.setText(String.valueOf(res));
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
Relevant answer
Answer
Dear Nitish,
Here is a complete working code that I have written just for you I hope it helps you, and feel free to contact me if you need more help:
---------------------------------------------------------------------------------------------------
/** Author @Kelechi C Ofoleta*/
package com.kogonuso.calculator;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class Main extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button b = (Button)findViewById(R.id.button1);
b.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
EditText n1 = (EditText)findViewById(R.id.editText1);
EditText n2 = (EditText)findViewById(R.id.editText2);
TextView msg = (TextView)findViewById(R.id.msg);
try{
if((n1.getText().equals("")) || (n2.getText().equals(""))){
return;
}else{
double a = Double.valueOf(n1.getText().toString()).doubleValue();
double b = Double.parseDouble(n2.getText().toString());
double result = a+b;
msg.setText(result+"");
}
}catch(Exception e){
Toast bread = Toast.makeText(Main.this, "You must enter numbers to continue",Toast.LENGTH_LONG);
}
}
});
}
}
----------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Calculator</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="input1"></string>
<string name="input2"></string>
<string name="Number1">Number 1:</string>
<string name="Number2">Number 2:</string>
<string name="calc">Calc</string>
</resources>
------------------------------------------------------------------------------------------------------
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.kogonuso.calculator.Main" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Number1" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:text="@string/input1" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Number2" />
<EditText
android:id="@+id/editText2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="number"
android:text="@string/input2" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/calc" />
<TextView
android:id="@+id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
---------------------------------------------------------------------------------
  • asked a question related to C
Question
3 answers
HI, I would like to know if there is any possibility to capture a string or a URL from the UDP payload using regex using Libpcap in C.
Please follow the link for more detailed code on Stackoverflow.
Relevant answer
Answer
@Jan Heiducoff, thanks for your reply.. i finally got it solved but unfortunately YouTube uses HTTPS and this automatically makes packets unreadable. so I found another website like dailymotion to do the job. I'm in my final stages where i just need to create a plot for packet loss when applying network load using iperf.
  • asked a question related to C
Question
5 answers
How do I calculate 'c' factor values of USLE equation From NDVI values. pls. Suggest methods to calculate c?
Relevant answer
Answer
Hello. You can test the following formulas:
Van der Knijff et al. (2000): C = exp[-α NDVI/(β - NDVI)]
De Jong (1994), De Jong et al. (1998): C = 0.431− 0.805 NDVI
Here are the references:
Van der Knijff JM, Jones RJA, Montanarella L (2000) Soil Erosion Risk Assessment in Europe. European Soil Bureau, Joint Research Centre, Space Applications Institute
De Jong SM (1994) Applications of reflective remote sensing for land degradation studies in a mediterranean environment. Nederlandse geografische studies 177, 1994
De Jong SM, Brouwer LC, Riezebos HT (1998) Erosion hazard assessment in the Peyne catchment, France. Working paper DeMon-2 Project. Dept. Physical Geography, Utrecht University
Question
8 answers
Plz explain why the op of the following code is giving 0 for the value of a
‪#‎include‬<stdio.h>
#include<conio.h>
func(int);
int main()
{
float a=func(29);
printf("%d ",a);
getch();
return 0;
}
func(int x)
{
printf("%d",x);
return 6;
}
when the value returned is 6 so why when after type promotion to float the answer is 0.
Even when we print any floating point number with a %d format specifier then how does the execution occurs ,say I write float a=12.25 ;
printf("%d",a);So why the output is such a long digit number.
1073741824
Relevant answer
Answer
C automatically converts float variable to double. Now assuming sizeof(int) 4 bytes and sizeof(double) 8 bytes. 
If you specify %d inside printf, C looks for the 4 byte word onto the stack. but your actual variable is 8 bytes long. Thus it interprets the value wrongly, but as it is integer C tries to print whatever it reads in the form of integer. Due to this you are getting undefined behavior.
I highly recommend %f while printing float variables.
Hope it helps :)
  • asked a question related to C
Question
8 answers
Actually I will refer to a concrete set of recursive equations, which appealed to me as a possibly coming from an eigensystem.
Let us start with the Golden Ratio, which is the number $\varphi \approx 1.6180339887\cdots$, and it can be defined in several ways, one of them is through a recurrent process involving the Fibonacci numbers
$$\varphi=\lim_{n\rightarrow\infty} \frac{F_{n+1}}{F_{n}}
$$
where
$$
(1) F_{n} = F_{n-1}+F_{n-2}
$$
with initial values $F_0 =1,\,F_1 =1$. Actually, one can start with other initial values, say, $F_0 =1,\,F_1 =3$ and still converge to the same value of $\varphi$ when the proportion between predecessor and sucessor is taken as $n\rightarrow\infty$. The sequence of numbers is known as the *Lucas sequence*, and the component numbers as *Lucas numbers*. In fact, it shouldn't be hard to prove that the initial values imposed in (1) only shift individual members of the Lucas sequence, but again they will converge to $\varphi$.
So, how can one obtain a convergence to a value other than $\varphi$ ? It turns out that one could add more members to the recurrence in (1), for example
$$
(2) L_{n} = L_{n-1}+L_{n-2}+\cdots +L_{n-k},
k\in \mathbb{+Z}
$$
without lose of generality, the initial values to these Lucas sequences can be stated as
$$
(3) L_0 =1,\,L_1 =1\cdots L_{k-1} =1
$$
And let us define $\varphi^{k}$ the value to which our generalised $\varphi$ convergences as
$$
(4) \varphi^{k}=\lim_{n\rightarrow\infty} \frac{L^{k}_{n+1}}{L^{k}_{n}}
$$
Although it is, of course, possible to define a infinite number of recursions like those of (2), one could form a finite set of recurrent equations upon imposing the restriction that $\varphi^{k}-\varphi^{k+1}>0$, so it turns out that there are only 9 which are real, positive, and forming a totally-ordered set. Exceptions to this rule begin, of course, when $k>10$. So the list of those nine numbers is
$$
0.618034\cdots
$$
$$
0.543689\cdots
$$
$$
0.51879\cdots
$$
$$
0.508659\cdots
$$
$$
0.504145\cdots
$$
$$
0.502013\cdots
$$
$$
0.501017\cdots
$$
$$
0.50055\cdots
$$
$$
0.500108\cdots
$$
Each of those numbers is a solution of a recurrence relation. Now, let us imagine for a moment that the collection of those 9 numbers could be eigenvalues which might be obtained from an eigensystem, and that the recurrence relations are related with the eigenvectors of that system.
Let us imagine for a moment that the we already have the putative eigenvectors and eigenvalues, one way I imagined to approach the problem may be to start backwards: --apply Cayley-Hamilton's theorem, where the matrix of an eigensystem must satisfy its own characteristic polynomial. Let $\lambda$ and $v$ be any of the eigenvalues and eigenvectors of the system, so according to Cayley-Hamilton theorem (5)
$$
(5) p(A)\cdot v = A^n \cdot v+ c_{n-1}A^{n-1} \cdot v+\cdots+ c_{1}A^n \cdot v+c_{0}I_{n}\cdot v
= \lambda^n \cdot v+ c_{n-1}\lambda^{n-1} \cdot v+\cdots+ c_{1}\lambda^n \cdot v+c_{0}I_{n}\cdot v
$$
Since (5) is valid for any of the eigenvectors with its corresponding eigenvalue, in principle it would be possible to attempt to construct a system to solve the coefficientes of the characteristic polynomial from. Actuallly the correct thing doesn't seems to be to put the recurrence relations as the eigenvectors; rather it would be the function, which would be the solution to each one of them. Unfortunately a linear system is not obtained, that can be solved, but rather a collection of ten polynomials, each one of them (it seems) of degree 10 (6)
$$
(6)
\left[ (\varphi_0)^{10}+ (\varphi_0)^{9}c_9+(\varphi_0)^{8}c_8+\cdots+(\varphi_0)c_1 + c_0\right] v_0 = 0
$$
$$
\left[ (\varphi_1)^{10}+ (\varphi_1)^{9}c_9+(\varphi_1)^{8}c_8+\cdots+(\varphi_1)c_1 + c_0\right] v_1 = 0
$$
$$
\left[ (\varphi_2)^{10}+ (\varphi_2)^{9}c_9+(\varphi_2)^{8}c_8+\cdots+(\varphi_2)c_1 + c_0\right] v_2 = 0
$$
$$
\vdots = \vdots
$$
$$
\left[ (\varphi_9)^{10}+ (\varphi_9)^{9}c_9+(\varphi_9)^{8}c_8+\cdots+(\varphi_9)c_1 + c_0\right] v_9 = 0
$$
Where $\varphi_0 = 1$ is the eigenvalue corresponding to the trivial recurrence $L_n = L_n-1$.
Admitting the possibility of the existence of a matrix from which these eigenvectors and eigenvalues may be obtained, what would it be its form? what would it be its coefficients? what are the theorem(s) which justify the creation of an eigensystem either from those recurrence relations, or relating with them?
In summary: Given this finite set of linear recursions and their solutions (the set of nine numbers), how to construct a square matrix from them, which would be akin to creating an eigensystem, with the solution of the linear recursions as their eigenvalues (and possibly the linear recursions as their eigenvectors), if at all possible?
Relevant answer
Answer
It is clear that one gets real ratios at each step since, assuming the polynomial in question has real coefficients, the matrix is real and all steps involve only real numbers. However, this does not contradict my comment since either the largest root is real (so one can get the right real limit) or is complex (in which case it cannot be the unique maximizer of the absolute value: its conjugate is also a root).
  • asked a question related to C
Question
14 answers
Long ago I read about a form of ABC classification as an alternative to Pareto, wherein the items responsible for 50% of the output are called A, 50% of the slower moving items are called C and all the intermediate items are the Bs. I need to quote it in one report but I don't remember where I had read about this kind of classification and who was the author. Does anyone have some reference about it?
Relevant answer
Answer
ABC analysis has been known since 1950's. It is impossible that B. E. Flores and D. C. Whybark paper in 1987 was "the first paper."  
A page of Dr. Kraus and Partners website below cites
Dickie, H. F. (1951). ABC inventory analysis shoots for dollars not pennies. Factory Management and Maintenance, 109(7), 92-94.
as the first paper written on ABC analysis. This corresponds to my previous answer.