As far as I (and the docs) know, slurpies can only be used with array or hash parameters. However, I recently typo'ed the syntax and entered what looks like it would be the syntax for a scalar slurpy. Much to my surprise, this didn't result in a syntax error. After some experimentation, I determined that the following are all allowed:
sub f(*$a) {}
sub g(**$a) {}
sub h(+$a) {}
I couldn't, however see what (if anything) this syntax did. So what's going on? Is this an under-documented feature? A bug that's causing invalid syntax not to throw an error? Something else altogether?
So what's going on? Is this an under-documented feature? A bug that's causing invalid syntax not to throw an error? Something else altogether?
Its undocumented and broken behaviour. It was speculated it would have different behaviour. It's a filed bug. See Slurpy scalar parameters (and duplicate https://github.com/Raku/old-issue-tracker/issues/5656) for further discussion.
Related
raw_df.loc[:,'full_size'] = raw_df.loc[:,:].apply( full_size,axis="columns",).copy()
is throwing the warning:
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
I thought/recalled that normally I can fix this by making sure everything is .loc'd properly, or making the the right hand side a copy(). But this line has been stubbornly throwing the warning regardless. Maybe I'm misunderstanding the warning, but I cannot see what I'm doing here that is potentially-dodgy.
The warning is legit since you're calling pandas.Series.copy on a series where in the same line you assign this one to another series.
I can't tell what's your needs but you can try this approach instead:
raw_df['full_size']= raw_df.apply(full_size, axis='columns')
ser_fullsize= raw_df.loc[:,'full_size'].copy() # or raw_df['full_size'].copy()
I have the following two lines of code:
Debug.Print Forms!DocLoader!DL_RowBox!DLR_FileName.Name
Debug.Print Forms!DocLoader!DL_RowBox.Form!DLR_FileName.Name
The second one, which I have seen recommended in almost every VBA reference, including the answer being suggested from SO as I type this, follows this structure:
Debug.Print Forms![Form Name]![Subform Control Name].Form![Control Name].Name
These two lines of code should produce the same result. However, the second, recommended syntax throws error 40036, "Application-defined or object-defined error" unless I am in design view. I cannot use it at runtime, but I have never seen this limitation mentioned in any of the reference documentation or forum posts I have looked at. The first line, using only default parameters, seems to work no matter the context.
With the second line, I have tried just about every combination of bang and period I can, and I have also tried enclosing field names in brackets, but the common denominator is that as soon as I reference ".Form" the application throws an error. Even something simple like ".Form.Caption" has thrown an error. So what I would like to know is:
Are there any other correct ways of referring to a subform's form properties, since I need these as well as its controls
Why would the first line execute correctly while the second, recommended one does not seem to work?
Running the compiler appears to have fixed the issue.
I have seen a lot of questions about this but I couldn't find the correct answer for me which works.
The object which triggers the problem is like
test123.de.company.com.Database.dbo.Table
Test123.de.company.com
is the database Server.
Object name contains more than the maximum prefixes allowed
I have tried to write it like this [test123.de.company.com].Database.dbo.Table just like [test123.de.company.com].[Database].[dbo].[Table]
Can you tell me what's wrong with this?
Please try this:
["test123.de.company.com"].[Database].[dbo].[Table]
OP also encountered a new problem after implementing this solution above. OP said:
Thank you! This worked for me. To be more precise, the join is for a
view and if I save/close and then later get back to the design option
the quote marks are removed and there is [test123.de.company.com] left
over and the error returns. Is there a way to keep them fixed?
Otherwise if I change anything I always have to add the quote marks
again and again
Then with the help of DaleK that problem also was solved. DaleK:
Don't use the design option, script it as alter instead
What im trying to do is write a key to the registry but im stepping from one problem to another, first permissions problem, now this..
This is the line of code.
If PNGchk.Checked = True Then
My.Computer.Registry.Users.CreateSubKey(UserSID & "\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\UserChoice", True, Security.AccessControl.RegistryRights.FullControl).SetValue("Progid", "SIV.png", Microsoft.Win32.RegistryValueKind.String)
End If
You must have Option Strict Off for that code to even compile, so you might want to fix that to start with. Option Strict On would have flagged issues with that code right away. You should read the documentation or at least pay attention to Intellisense for that method because your second and third arguments make no sense. No overload that I can see has a Boolean parameter and if you want to use a RegistryRights value you do so within a RegistrySecurity object as far as I can see.
RegistryKeyPermissionCheck.ReadWriteSubTree worked for me.
Using clsid64 = view64.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\UserChoice", RegistryKeyPermissionCheck.ReadWriteSubTree)
clsid64.SetValue("StubPath", "SIV.png")
clsid64.Close()
End Using
I've getting the following warning Expression result unused
I've inherited the code from my predecessor and I've no idea how to fix this?
Obviously syntax has changed, any ideas ?
static float lowValue;
static float highValue;
- (void) calculateHighLow{
highValue; //here
lowValue; // and here
Simply delete those two lines, they have no purpose.
Obviously those two lines don't do anything so you can just remove them.
If they aren't being used anywhere you can just delete the lines, or you can simply just decide to deal with the warning (though not a good idea). You can also comment out the code, in case you figure out that might need them someday.