What's the reason that xlwings does not support referencing Range with a sheet reference? - xlwings

I appreciate the fact that xlwings makes it easier to reference Ranges by allowing putting in the Sheet name and sheet index in the Range constructor, but it seems weird to me that it doesn't support providing a sheet object/reference for the same purpose, which would seem a lot more "object-oriented" and would map to the VBA ''' sht.Range("A1")''' construct a lot better. Is there a reason why this is not supported in addition to using sheet name and sheet index? Of course you can do Range(sheet.name, "A1"), but that seems like an unnecessary extra step.

There's an open issue for that, see here. The reason why it's not there yet is that originally the API was heavily influenced by DataNitro and they're missing the Sheet object altogether. But it's a small change so it should make it in soon.

Related

How to change the value of wxDatePickerCtrl?

I have tried this, But I am not able to get date displayed on the datePickerCtrl.
Here SDOB is a wxDatePickerCtrl.
SDOB->SetValue(Rs.GetDate(3));
But I am able to get the date onto a label or text field by doing
wxStaticText11->SetLabel(Rs.GetDate(3).FormatDate());
But for my purpose I would like to get it onto the datePickerCtrl itself. Help!
Also where can I find good documentation with examples for wxWidgets? I am a beginner.
You're using the correct function for setting wxDatePickerCtrl value, so if you don't see what you expect, the date you pass to it must be invalid or otherwise different from what you think it is. Generally speaking, when asking about why something doesn't work you should explain both how do you expect it to work and what actually happens because otherwise nobody else can know what's really going on.
The documentation for this control is at https://docs.wxwidgets.org/3.1.4/classwx_date_picker_ctrl.html as could be expected and there are a hundred of examples distributed with wxWidgets, so if you want to see an example of this class in action, I recommend doing grep -lR wxDatePickerCtrl samples in the directory containing wxWidgets sources.
Good luck!

Sharepoint 2010 - How to get/export list XSL

On my workplace we are not allowed to used Sharepoint Designer, but I need to make a list with customized columns but still maintaining the original style and functionality.
My idea was to find a way to export the list XSL, edit it and use the option to use a custom XSL on the web part.
The thing is, I coudln't find a way to get the XSL, I only found ways to export the XML. I need a way to change how the list is displayed in a way someone else other than me can keep the list updated without needing a lot of programming knowledge
That's a tough one. The technical answer is that the .xsl files start at /_layouts/xsl/main.xsl and /_layouts/xsl/local.xsl, which call more files. However, customization of a list or library will be embedded within the aspx page you're using to view it, and the xsl is "by exception" for anything different than the default templates. SPD creates a whole lot of that exception code automatically. You can try to reverse engineer the main, local, and other xsl files, but that's a herculean task. If you have a specific list and a specific goal, you could post your WebPartPages:XsltListViewWebPart code here or in a new question and someone with SPD could make the changes for you.
One alternative, which you might prefer since it'll leave you in control, is to set up your page to be as close to your desired design as you can, then save the aspx file locally. Using a standalone (maybe even personal) computer, install SPD and (if it comes to it) a copy of SharePoint Foundation. Add your aspx file to that, use SPD to make the changes, and copy the file back. Be sure to keep an eye on the list and view guids, since those'll change between the two, but otherwise they should be the same.

How to Show C++ Results in Excel

I am trying to create C++ code that allows User Input in selecting a variety of fields, then it will calculate many different angles and show the users the results, as well as a graph.
However, it has been suggested to us by our lecturer that it may be a good idea to write the code to these calculations etc in C++, then input the results into Excel.
Does anyone have any idea how to do this? Literally looking for a way for the user to fill in the required values on C++ and then to be AUTOMATICALLY taken to the excel file to show the results in the table and graph format.
If this is not possible, is there a way to display the results in the table and graph format through C++?
Thanks very much in advance
Excel provides COM interface which you can use from your C++ application.
This can be done in the way described in this article:
http://support.microsoft.com/kb/216686
This link might also be useful:
http://www.codeproject.com/Articles/10886/How-to-use-Managed-C-to-Automate-Excel
I think the second link would be better for you as its more of a step by step guide which should help you to workout the answer.
Use COM Automation to automate excel.
The best way to do this is to use the vole library by Matthew Wilson at
http://vole.sourceforge.net/
Take a look at the examples. I do not think there is an example for excel, but there is one for microsoft word at http://www.codeproject.com/KB/COM/VOLE_word.aspx
I have used vole in the past, and it makes it a whole lot easier

Using TGlowEffect on a TLabel in Delphi/C++ Builder

This is a pretty easily explained problem, I'm using FireMonkey to design a form and when I add a TGlowEffect to a tag it ruins the way the Label looks.
If somebody knows how to do this correctly I would appreciate it.
After applying the TGlowEffect:
The text is significantly bolded, and the only affect applied was the blur.
The text only appears like this in the editor, but I would rather it look like it's going to look after I compile.
Maybe I'm just new to FireMonkey and I'm doing something wrong, if anybody has any good reference material on how to work with FireMonkey correctly I would appreciate a link to that also.
If you have not already done so, you should apply update 4 (be prepared for fuzzy fonts though) as I have attempted to reproduce this issue without success with my XE2 (updated to 4). Some more information on what you are actually doing would be useful :-)
As a general thought, rather than adding a glow effect to a label or to a text object, you should change the component style to add a glow effect - this way you can easily apply the same style to other text or labels.

How do I programmatically sanitize ColdFusion cfquery parameters?

I have inherited a large legacy ColdFusion app. There are hundreds of <cfquery>some sql here #variable#</cfquery> statements that need to be parameterized along the lines of: <cfquery> some sql here <cfqueryparam value="#variable#"/> </cfquery>
How can I go about adding parameterization programmatically?
I have thought about writing some regular expression or sed/awk'y sort of solution, but it seems like somebody somewhere has tackled such a problem. Bonus points awarded for inferring the sql type automatically.
There's a queryparam scanner that will find them for you on RIAForge: http://qpscanner.riaforge.org/
There is a script referenced here: http://www.webapper.net/index.cfm/2008/7/22/ColdFusion-SQL-Injection that will do the majority of the heavy lifting for you. All you have to do is check the queries and make sure the syntax will parse properly.
There is no excuse for not using CFQueryParam, apart from it being much more secure, it is a performance boost and the best way to handle quoted values in character based column types.
Keep in mind that you may not be able to solve everything with <cfqueryparam>.
I've seen a number of examples where the order by field name is being passed in the query string, which is a slightly trickier problem to solve as you need to validate that in a more "manual" way.
<cf_inputFilter
scopes = "FORM,COOKIE,URL"
chars = "<,>,!,&,|,%,=,(,),',{,}"
tags="script,embed,applet,object,HTML">
We used this to counteract a recent SQL injection attack. We added it to the Application.cfm file for our site.
I doubt that there is a solution that will fit your needs exactly. The only option I see is to write your own recursive search that builds a report for you or use one of the apps/scripts that people have listed above. Basically, you are going to have to edit each page or approve all of the automated changes.