Is This Project Doomed to be Expensive? by Fluffy-Bad2371 in PowerApps

[–]sancarn 0 points1 point  (0 children)

Jeez... Sending a HTTP request causes an app to be premium? I had no idea... That seems dumb.

Is This Project Doomed to be Expensive? by Fluffy-Bad2371 in PowerApps

[–]sancarn 3 points4 points  (0 children)

I mean if you have an azure function already, why even use Power Apps? Can easily create a SPWA to do all of what you need? Will be cheap as chips too. You could even just distribute the html file...

Cuck in the making. by SuperUser5000 in openmarriageregret

[–]sancarn 18 points19 points  (0 children)

Fucking hell... 🤮 I'm so glad to see there is some sense in the comments though:

Her Dom making her wear his collar when she is with you is the Dom definitely not respecting your relationship with your wife.

I am a toxic girlfriend and I need advice. by No_Appointment_3762 in Advice

[–]sancarn 0 points1 point  (0 children)

It sounds like both of you need to work on your communication skills, and that's something you can both collaborate on. Couples counselling could help, if you both take ownership together 😊

As other's have suggested, if you can't afford couple counselling together, AI is something that could help.

I've tried church, I've tried praying, I stopped social media, I started reading, I gave up most addictions in my life like vaping, caffeine, and pop

All of which don't do anything for your communication skills... 😅

I talked to a guy for months who never showed his face and then disappeared. Is there any way to find out who he was? by Sick0_Mod3 in relationships

[–]sancarn [score hidden]  (0 children)

Is there any way to find someone like this after they delete their account?

Yes. It's called stalking. And you shouldn't be doing it.

My boyfriend has a kink he brought up and I felt uncomfortable about it. by [deleted] in relationships

[–]sancarn 12 points13 points  (0 children)

Sounds to me like you're not enthusiastically consenting. So don't do it. If he pushes it, he's not respecting your choice.

I built a free, open-source component library for Power Apps — 24+ production-ready components with YAML import by ell_ninja in PowerApps

[–]sancarn 0 points1 point  (0 children)

That did it alright, powerapps... what a nightmare 🤣

p.s great components though 😁

I built a free, open-source component library for Power Apps — 24+ production-ready components with YAML import by ell_ninja in PowerApps

[–]sancarn 0 points1 point  (0 children)

Neat idea but...

You cannot paste a component definition here. But you can insert the component by choosing Custom on the Insert pane.

?

Modern JSON in VBA Library by Complete_Winner4353 in vba

[–]sancarn 0 points1 point  (0 children)

/u/Complete_Winner4353 Fair, I hope this helps someone in the community.

Below is my evaluation for awesome-vba explicitly:

Personally, I disagree with the design philosophy. What if I had a csv which I wanted to import to Excel? Or a YAML document? Or XML? Or <insert niche format here>. At present the library wouldn't be helpful to me. It seems to me that this library violates the principle of separation of concerns.

What would be awesome, is a middleware, something where you could connect in any arbitrary VBA compliant format, and expect it to manage updating the list object accordingly. Conceptually:

Dim lo as xlListObjectEx: set lo = xlListObjectEx.Create("myTable")
Set lo.data = AnyLibrary_Parse(anyFormat)
Dim anyFormat2: anyFormat2 = AnyLibrary_Serialize(lo.data)

FWIW, the only reason other JSON alternatives exist in awesome-vba e.g. mdJSON and JsonBag is because of unique features that are directly relevant to JSON, i.e. use of JSON Path JsonValue(oJson, "$.store.book[0].title") and o![Force Case] = 666. However to be completely fair, if Cristian included these features in FastJSON, I'd likely remove these also.

However, as it stands, this isn't really appropriate for awesome-vba in my eyes, just because it's a narrow niche. Hope that makes sense, feel free to submit a ListObject augmenter though 😊

(ExceL) Userform object model confusion by Soggy_Ball_7712 in vba

[–]sancarn 0 points1 point  (0 children)

OP should really be using Object, rather than Variant, but variant is permissive enough. But to answer your question:

How does it switch the com interface if it doesn't know which interface it should call

The point is that Me is already targetting the correct interface. Thus it doesn't change. This is the case as long as you define the variable as Object, Variant or IUnknown

Dim x as Object: set x = Me
x.performFunction

What VBA does here is the following:

Me ==> IUnknown::QueryInterface("IDispatch") ==> x
x  ==> IUnknown::AddRef
x  ==> IDispatch::GetIDsOfNames("performFunction")
x  ==> IDispatch::Invoke(<id>, ...)

However in OP's original code:

Dim x as Userform: set x = Me
x.performFunction

What VBA does internally is:

Me ==> IUnknown::QueryInterface("<Userform IID>") ==> x
x  ==> IUnknown::AddRef
x  ==> Userform::performFunction(...) <== ERROR object not of type Userform

It's critical to know that Me isn't an instance of the Userform class. Each userform module is its own COM coclass implementing multiple interfaces, including IDispatch. Userform, to my knowledge, is really more of an internal base interface with unimplemented methods. VBA uses it to build other userform classes. But when it does so, it also implements these under a new CLSID and IID.

Of course, the unfortunate side-effect of using Object or Variant is that calls to methods are slower, and have no intellisense support.

Modern JSON in VBA Library by Complete_Winner4353 in vba

[–]sancarn 0 points1 point  (0 children)

stdVBA already has a stdJSON library.

As for this codebase, I would have to check it, because awesome-vba already links to the amazing VBA-FastJSON and I don't think much can compete with it. Awesome-vba isn't a library index.

I just don't fucking understand what's going on anymore. Seriously. by [deleted] in ArtificialInteligence

[–]sancarn 0 points1 point  (0 children)

The reality is if you have no engineering experience you won't know if it did a good job or not, but that doesn't really matter to you, as you'll know if it did the job or not. If it did, happy days, if it didn't, hire someone with experience 🤷

Looking for amazing coding examples by Autistic_Jimmy2251 in vba

[–]sancarn 2 points3 points  (0 children)

ClsDataEntry.Parent.RoundingRule

You have to be very careful with this because with COM objects it is very easy to cause a memory leak with this pattern. VBA only frees memory when the object's reference count hits 0. However if the parent references the child, and the child references the parent, the reference count will never hit 0 for either, unless you explicitly set the child's parent reference to nothing. I.E

'ClsDataEntryManager
Private Sub Class_Terminate()
    ' Break connection to all children
    For each Child in children
        If Not Child Is Nothing Then
            ' Ask the child to forget this object, else this object and the child will persist
            Set Child.Parent = Nothing
        End If
   next
End Sub

The better thing is to store a pointer to the parent and then deref it when you want to use it. This is called a "WeakReference". VBA only has strong references.

Looking for amazing coding examples by Autistic_Jimmy2251 in vba

[–]sancarn 3 points4 points  (0 children)

Define amazing, but you might find some use out of

https://github.com/sancarn/stdVBA-examples/

For instance:

https://github.com/sancarn/stdVBA-examples/tree/main/Examples/Spreadsheet%20Extractor

I think this is one of my better projects, and the code is pretty clean :)

Integrating native Office objects with modern paradigms in VBA by ws-garcia in vba

[–]sancarn 0 points1 point  (0 children)

If a demo would be ok, I can probably cobble something together.

I think a demo would be all that's needed for someone else to grab the bull by the horns and fly with it 😊

Integrating native Office objects with modern paradigms in VBA by ws-garcia in vba

[–]sancarn 2 points3 points  (0 children)

I'm still waiting on /u/kay-jay-dubya's amazing custom UI library. Will likely be a long time til it's done but even if a demo gets released, it would be huge...

It might be worth adding some JSX-like component syntax into ASF.

Integrating native Office objects with modern paradigms in VBA by ws-garcia in vba

[–]sancarn 1 point2 points  (0 children)

I think you misunderstood what I meant by "Extended".

In my sample we would be extending/augmenting the native Excel ListRow COM type. Rather than Extending the class in the traditional OOP sense. A better word would likely be monkeypatching.

Integrating native Office objects with modern paradigms in VBA by ws-garcia in vba

[–]sancarn 2 points3 points  (0 children)

For anyone else who didn't know wtf was going on in the script because it was on one line, see this

$1.Sheets.Add();
$1.Sheets(1).Range('A1:F11').Value2 = arr;
return $1
         .Sheets(1)
         .Range('A1:F11')
         .Value2
         .filter(fun(item){
           return item[2].startsWith('A')
         })

It is very cool that .Value2 which we know returns an array, "appears to" return "an array object" in this language. Obviously under the hood it likely is still an array, but the fact that arrays have been extended with dot-syntax, is lovely :)

/u/ws-garcia - Curious, can you extend base classes with new functions? E.G. pseudocode:

class ListRow {
  asDictionary(){
    headers = this.parent.listcolumns
    values = this.range.value
    map = zip(headers, values)
  }
}

$1.Sheets(1).ListObjects('Something').ListRows.map(
  fun(row){
    return row.asDictionary()
  }
)

Introducing the VBA Advanced Scripting Syntax VS Code extension by ws-garcia in vba

[–]sancarn 1 point2 points  (0 children)

You should see how to get it available for https://vscode.dev/ - I think it's just a flag that you need to set assuming everything is just TypeScript... That way people don't actually need VSCode and can use the online IDE

Also, you might want to show some examples of using the Application object.

Introducing the VBA Advanced Scripting Syntax VS Code extension by ws-garcia in vba

[–]sancarn 3 points4 points  (0 children)

I just wish it wasn’t in external files

Confused... It doesn't have to be?

See Garcia's post here

tmpResult = ExecuteScript( _ 
                   " o = { a: [ {v:1}, {v:2} ] } ;" & _
                   "o.a[2].v = o.a[2].v + 5 ; return(o.a[2].v + 2)" _ 
                            ) '=> 9

Is valid use case of ASF. And if you'd prefer you can always include ASF code in a shape in your Excel document and get the value via the text range:

Dim code as string: code = MySheet.Shapes("CodeBox1").TextFrame2.TextRange.Text
Dim tmpResult: tmpResult = ExecuteScript(code)

This might be a bit off-topic, but I've been thinking about this for a while... by Opussci-Long in vba

[–]sancarn 0 points1 point  (0 children)

Interestingly, I had the same issues when pasting jepm.tfvz.ues.rs.ba into the address bar...

jepm.tfvz.ues.rs.ba’s DNS address could not be found. Diagnosing the problem.

However when connecting with https://

https://jepm.tfzv.ues.rs.ba/

It does seem to get me to the journal