Using Stackdriver debug for non-Java JVM languages - google-app-engine

The Stackdriver debug interface complains when you have a non-java file in your source (such as a Groovy file).
The way a debugger normally works is that it matches a filename and line number to the sourcefile and linenumber attributes included in the class file, so I'm not sure why support for non-java source files was disabled.
Did anyone have any luck "tricking" the interface into accepting non-java files (e.g. by renaming them), or have any information about whether Google is planning to add support?

This limitation is hardcoded in the Stackdriver Debugger Java agent. See
https://github.com/GoogleCloudPlatform/cloud-debug-java/blob/master/src/agent/internals/src/main/java/com/google/devtools/cdbg/debuglets/java/ClassPathLookup.java#L186
The reason for the limitation is that the agent was built for java. It understands Java conditions and expressions (and doesn't understand other languages expressions). The agent can be modified to handle other JVM languages with relatively few changes. However, the file:lines much match the info in the class files and the expressions parser modified to match the target lanuage.

Related

Sending zip files and keeping file paths consistent

I have created a GUI and Database for my company. I am trying to alpha test the program. I made the program so that everyone would place it on their C drive so that the file paths would stay consistent. When I email the zip folder to everyone it adds an extra folder that is causing errors to the file path (I believe the error occurs during extraction?). Does anyone know a good way to prevent this from happening? Thanks!
Although "xcopy deployment" is a valid method to deploy programs, it can come with complications, as you have discovered. Instead, you can create an actual installer program which is much more versatile.
For a lead-in on making an installer you can read Create MSI installer in Visual Studio 2017.
Make sure that the program uses locations as given in the Environment.SpecialFolder Enumeration so that it is automatically adapted for any (properly-configured) Windows installation.
Other installers are available, e.g. Inno Setup, which may offer simpler or more detailed configuration of some options like replacing or keeping older files, or installing prerequisites like a required framework version.

Code formatting tool with netbeans integration and continuous integration

I am working with MPLAB X which for those who don't know an IDE based on Netbeans. We are also using Git with continuous integration. I have now started to work in several different tests for our projects.
For example, MPLAB lets you choose which encoding you want to use in your projects and UTF-8 is not the default option so from time to time we would find problems opening the projects in different platforms. Now I test that every source code file is properly encoded.
We would also like to check code formatting and style. From what I've seen Netbeans comes with a tool to format code for you, but I don't see how to run this tool to print formatting mistakes as a test in our server. I have also seen that there are many tools like uncrustify that should be able to run in our server but they are not integrated with our IDE.
I would prefer not to maintain two different configuration files for this task, for this reason I am asking if anybody knows if there is a tool that can be run both in a Linux based server and that can be integrated with Netbeans for this task.

How to use shp2pgsql

My question should be very simple to answer for anyone not being a self-taught newbie like me...
On this page is a cheatsheet concerning a function to be used in GIS/DB environnement : http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg
I would like to create a script allowing users to just have to click on it to launch the process, given the proper datas. But I don't understand how to use this. It obviously doesn't work in a Python console, nor directly in the windows console. How is it supposed to work ? What language is this ?
Thanks
shp2pgsql is indeed a command line tool. It comes with your PostgreSQL/PostGIS installation (usually) and, if not accessible via PATH-variable, can (usually) be run from within the /bin-folder in your PostgreSQL-Installation. You can also always 'make' the programm from source in any location yourself, if needed.
EDIT:
One way to set up a script (independent of whether you use it within qgis own python environment or not) would be to use Pythons subprocess (or os.system) module (check related question here) to write to shell and execute shp2pgsql.
A slightly more sophisitcated solution to (batch) insert (multiple) shapefiles via script could be to implement ogr2ogr via gdal/ogr module within python (check this blog). That, however, would require a working installation of the gdal core library, and the respective Python bindings (at least to use outside of QGIS Python environment, where it is pre-installed AFAIK), which can be tiresome at times. Once installed correctly, it offers a powerful (I dare say almighty) toolset for geodata management and manipulation via Python, though.
Apart from that, the blog link I provided also states the implementation of a batch insert script/tool (which operates ogr2ogr) in qgis 2.8 toolbox...maybe that can help you, either with your work directly or (via sourcecode) to point you in the direction of creating your own tool.

Perl Script not locating File via its set path

I am working on a reporting tool called MARS (Multi Access Reporting Service). This is a tool which reads reports via a SQL server. We have a local machine test environment setup which has everything running fine but when we upload onto the Windows Server 2008 it seems to not want to locate a "required" file. We are running Perl(v5.14.2) on the server and an older version on the desktop/local.
the error i am receieving is:
*HTTP Error 502.2 - Bad Gateway
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are "Can't locate jsdb.pl in #INC (#INC contains: /Inetpub/Scripts /Inetpub/Scripts/Security c:/Perl/site/lib c:/Perl/lib .) at \gl-0185-nas07p\MCL_Dev_MPN_GL\Green_App\MARS\Scripts\Security\security.pl line 7. ".*
Here is the header on the Security.pl file which clearly has the set path and file in it:
use CGI qw/:standard *table start_ul/;
use Date::Calc;
use Win32::ODBC;
use POSIX qw(floor);
###
use lib "/Inetpub/Scripts/Security";
require "jsdb.pl";
###
require "javascript.pl";
require "SecurityUtils.pl";
use lib "/Inetpub/Scripts";
require "webpageutils.pl";
Within the JSDB file is the code for the "Profiles" tab which is used to setup and modify users of the system.
Any help is really appreciated as we cannot seem to get our heads around it.
You seem to be insensitive to case sensitivity, i.e. in the file it is listed as jsdb.pl and in your question you identify it as JSDB. Also, the error message identifies the offending file as security.pl, but your question calls it Security.pl. Perl is case sensitive. Is it possible this could be a factor, e.g. the jsdb.pl file is actually named JSDB.pl?
Where is jsdb.pl? From your source file I would guess it's in /Inetpub/Scripts/Security which doesn't look like a Windows path to me.
At a guess, only C:/Perl/site/lib and C:/Perl/lib exist on your Windows Server machine, and the other paths are either different on that machine or you simply have no access to jsdb.pl from there
Also, you don't seem to be using use strict and use warnings at the top of your code, and your method of using libraries by require 'library.pl' could be very much better

Configuration Management for FPGA Designs

Which configuration management tool is the best for FPGA designs, specifically Xilinx FPGA's programmed with VHDL and C for the embedded (microblaze) software?
There isn't a "best", but configuration control solutions that work for software will be OK for FPGAs - the flow is very similar. I use Subversion at work and git at home, and wrote a little on 'why' at my blog.
In other answers, binary files keep getting mentioned - the only binary files I deal with are compilation products (equivalent to software object and executables), so I don't keep them in the version control repository, I keep a zipfile for each release/tag that I create with all the important (and irritatingly slow to reproduce) ones in.
I don't think it much matters what revision control tool you use -- anything that you would consider good in general will probably be OK here. I personally use Git for a sizable Verilog + software project, and I'm quite happy with it.
What will bite you in the ass -- no matter what version control you use -- is this: The Xilinx tools don't generally respect a clean division between "input" and "output" or between (human edited) "source" and (opaque) "binary." Many of the tools like to store some state information, like a last-run time or a hash value, in their "input" files meaning that you'll get lots of false changes. Coregen does this to its .xco files, and project navigator (the main GUI) does this to its .xise files. Also, both tools have a habit of inserting or removing lines for default-valued parameters, seemingly at random.
The biggest issue I've encountered is the work-flow with Coregen: In many cases, at least one of the following is true:
You have to manually edit the HDL files produced by Coregen.
The parameters that went into Coregen are stored somewhere other than the .xco file (usually in what looks like an output file).
You have to copy-and-paste the output from Coregen into your top-level design.
This means that there is no single logical source/master location for your input to the core-generating process. So even if you have the .xco file under version control, there's no expectation that the design you're running corresponds to it. If you re-generate "the same" core from its nominal inputs, you probably won't get the right outputs. And don't even think about merging.
I suggest CM tools that support version labeling and binary files. Most Software CM applications are fine with ASCII text files. They may just store a "difference" file rather than the entire file for updates.
My recommendations: PVCS, ClearCase and Subversion. DO NOT USE Microsoft SourceSafe. I don't like it because it only supports one label per revision.
I've seen Perforce and Subversion used in a couple of FPGA-intensive companies.
We use Perforce, and its great. You can have your code that lives in Linux-land checked in side-by-side with your Specs and Docs that live in Windows-land. And you get branching, labels, etc.
I've seen everything from Clearcase to RCS used, and it is really all okay for this kind of thing. The important thing is to get a good set of check-in policies established for your group, and make sure they stick to it.
And have automated nightly regressions. That way, when someone breaks the rules, they can be identified and publicly shamed.
I have personally used Perforce, Subverion, git and ClearCase for FPGA projects. Since VHDL and C are just text files, any works fine. However be sure to capture the other project and contraint files and any libraries you use.
Also think about what to do with the outputs, e.g. log file and bitstreams. Both tend to be big and the bitstreams are binaries.
Previously I used Subversion but have switched to git two years ago. Git handles FPGA design files just as well as it handles every other text and binary file. Git is all you need for version controlling your files and artifacts.
For building the designs, I recommend just using a single ISE project called "ise" (living in a subdirectory called "ise/"). You can take a look at my (very modest) FPGA open-source project on github for the file layout. I don't bother storing the ISE files at all since they are easy to regenerate. The only things I save are the Verilog files and some ISIM waveform config files. In other projects that use coregen I save the coregen.cgp project file and all of the *.xco scripts for regenerating cores. Then I use a Makefile for actually running coregen on the *.xco files. There are a few other Xilinx-specific files you should version control too: *.ucf, *.coe, *.xcf, etc.
I experimented with using Makefiles and the Xilinx command-line tools but found that ISE did a much better job tracking dependencies and calling the tools with the right arguments. Just don't make the mistake of trying to version control your ise/ project files or you will go mad. Xilinx has something like 300 different file types which change every release. If you want to save a file, you can try the ISE project file itself with a .xise extension. Anything that is hard to recreate, like the golden bitfile that you know works and took 6 hours to build, you might want to copy that and configuration manage it explicitly.

Resources