R shiny- Do all source files & data that we're going to load go outside of server function? - shiny

So, I'm trying to build an app which has a lot of source files, many sources are within source files. It's kind of a mess tbh. Plus I'm also trying to load some data from my machine. But the app just won't work. Functions in source files can't be even read neither the data. Can source files and data be loaded inside server function or it has to be declared & loaded outside it? Thanks!
App just doesn't work.

Related

How can I compile c++ to multiple files?

I have a program (cpp) with many classes. Every class is in separate source file (.h + .cpp).
How can I split the compiled program into multiple files (instead of one big executable file)?
Let's say, one file for every class (same as the code structure).
So that every time there is change in a specific class, I compile only that class, and replace the specific compiled file related to that class.
(Something similar to .DLL files in Windows.)
Example from real life:
I am making TUI interface for managing mysql.
I would like to create mysql text editor (TUI) with ncurses.
the code (class) for creating and managing single window object is in
'textWin.cpp' + 'textWin.h'
the code (class) for managing multiple windows, by creating windows objects from previous class is in winMan.cpp winMan.h
the code (class) for managing mysql database is in :
mysql.cpp mysql.h
and so on...
so, I have the following files:
MyProgram.cpp
- winMan.cpp + winMan.h
- textWin.cpp + textWin.h
- mysql.cpp + mysql.h
- ..
- ..
After g++ compilation, I get one executable file, './MyProgram' (size about 15Mb.) which I deliver to all my customers (1000's of them).
I Just found a typo in textWin.cpp, I fixed it, and I told to all customers that there is an update... all of them need to download one big 15Mb file, this consumes allot of bandwidth and server resources, for just a small update.
Is there a way to send to all my customers smaller file, that contains only the compiled code for textWin class ?
I use g++ on Centos7
The gcc compiler will happily take a list of cpp files to compile together to make one executable. You don't need to write a "containing" cpp file. However, you still have the issue that each time it rebuilds them all.
The alternative is to build each sourcefile separately to an object file, then link those all together. Hopefully each of those invocations of the compiler will add up to less time than the single command-line. But how to keep track of which cpp files actually need to be rebuilt?
The usual approach is to use a makefile and a make utility which will check the dates of all the mentioned files. There are a variety of flavours of makefile, and helper makefile engines. Download a simple package like gzip and you can quickly get an idea of how the Makefile is structured. Then there is lots of help online, or you may decide that this is just too much trouble for a project with 5 files in it.
As suggested in the comments by #RSahu
Shared Libraries (.so files) is the way to split your compiled code.
here is a small example:
https://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html
Of course, you could put your texts into separate text-files and only deploy those in the an error is there. For your special use case, where binary differences must be deployed, this question might be helpful: How do I create binary patches?
Another option, do proper versioning. That way, your customers might be able to decide for themselves. That is, if they need this update.

JUCE image buttons without embedding files

Is there anyway to just include a file from a relative path using JUCE? Between graphics, up and down button states, I have about 40 images and trying to create them through the ProJucer causes thousands of lines (over 20,00 in this particular situation) to be generated and embedded in my GUI component. This is causing huge performance issues in Xcode for me. Is it possible to just include the files via relative path and save all that embedded code? The .cpp is so large even GitHub says they are too large to display. Any help is greatly appreciated.
To use embedded images in your project, but not have them taking up space inside each component's .cpp file as generated by the Projucer, do this instead:
Add the image files to the Projucer project itself.
When you save the Projucer project, the image data will be added to your project's BinaryData.h/cpp file that's located in the JuceLibraryCode directory.
When you want to create the ImageButton, instead of selecting 'create a new image resource' (which would put the binary data into your component's source directly), select the BinaryData resource that you created above:

Can I serve .obj files as Django static files?

I'm looking to do a bit of 3D modeling on my site and I'm trying to serve the requisite object (.obj) and material (.mtl) files via Django. When I put them into my static directory and run collectstatic, the .mtl files are found and collected just fine, but the .obj files are completely ignored.
Is there any way around this? Is there somewhere Django bans certain file types for static collection, and can that be overwritten? Thanks so much in advance!
Sorry, all - figured this out. Was a Git issue - I think I had some global .gitignore file that was ignoring .obj files, so I just created a new blank one. Closing issue.

Method to store a configuration file inside executable in C++

I need to store a configuration file that can be changed once the executable has been compiled inside of an executable using C++. I assume the configuration file would need to be stored as a resource for it to be editable once the executable has been compiled.
I have no idea how I can go about storing it as a resource and how to then include it in the main section of my project while still leaving it in the resource section.
Any help will be much appreciated.
Windows "*.ini" files is one way.
But, I suggest use XML files for configuration. Most compilers have 2 or 3 libraries to load & store data from XML files.
Besides, they allow to store information in a hierarchical way, and easy to add or remove configuration options.
EDIT:
Another way are JSON files.

application crashes in mini2440

I am running a Qtopia 2.2.0 application inside mini2440(FriendlyARM Board). So far the application size is 128kb and will grow more. There are all together 45-50 (source+header) files.
Now, the application crashes if i add some code segment to one specific file. I tried moving the code to other file & included that file, it still didn't workout. First i thought this could be a issue with the application size, but if i add few more .cpp & .h files, the app size increases but it runs fine.
The main file(class) that interacts with the UI is written in Qt/C++ & all other files are C & C++(normal .h & .cpp).
I am not able to debug out what the problem is. Any clues will be appreciated.