|
JawKnee posted:what technology uses an '@' prefix to signify embedded code? If by "embedded code" you mean "code embedded within this file" rather than "code running on embedded platforms", powershell uses @ for heredocs.
|
# ? Apr 27, 2018 05:46 |
|
|
# ? May 31, 2024 10:04 |
|
sorry I'm probably using the wrong terms - I mean code that is going to be running on a server rather than locally
|
# ? Apr 27, 2018 05:47 |
|
C# uses an @ prefix on strings to turn off backslash-escaping, which is useful if you're writing SQL or the like in strings. If that's not it, and you have an example of what you're trying to find out about, could you just post it? It'd be way easier than us trying to divine just wtf you're talking about.
|
# ? Apr 27, 2018 06:19 |
|
The code is at my work and I'm at home, so I don't have anything I can copy-paste for you, my apologies. It's a new job and I'm not terribly familiar with most of the technologies being used - C#, SQL, LINQ, typescript, JQuery, and others that I'm forgetting. I'm familiar with verbatim strings though, and this isn't it. I've mainly seen it being used in front of using directives, if-blocks, for-loops, and other statements that are otherwise C# code - but not used as a prefix for html or javascript. e: I think I've found it - it's part of the Razor syntax for ASP.NET JawKnee fucked around with this message at 07:14 on Apr 27, 2018 |
# ? Apr 27, 2018 07:07 |
|
JawKnee posted:The code is at my work and I'm at home, so I don't have anything I can copy-paste for you, my apologies. It's a new job and I'm not terribly familiar with most of the technologies being used - C#, SQL, LINQ, typescript, JQuery, and others that I'm forgetting. That looks like old asp and jsp pages.
|
# ? Apr 27, 2018 12:17 |
|
Volguus posted:That looks like old asp and jsp pages. ASP only uses @s in the directives you'd see at the top of the file, so I understand why you'd get that impression: you open the file, recognize it's ASP and close it immediately without looking at the rest because that's the rational thing to do. It uses <% and %> for open/close tags (and I think maybe optionally <? and ?> because they were competing mainly with PHP when they made the spec). Source: I maintain ASP at current job
|
# ? Apr 27, 2018 13:36 |
|
Munkeymon posted:ASP only uses @s in the directives you'd see at the top of the file, so I understand why you'd get that impression: you open the file, recognize it's ASP and close it immediately without looking at the rest because that's the rational thing to do. It uses <% and %> for open/close tags (and I think maybe optionally <? and ?> because they were competing mainly with PHP when they made the spec). Source: I maintain ASP at current job Right, but there doesn't seem to be a difference between this @{} and <% %> (in either asp or jsp). Is the same hat just a different color.
|
# ? Apr 27, 2018 13:39 |
|
Volguus posted:Right, but there doesn't seem to be a difference between this @{} and <% %> (in either asp or jsp). Is the same hat just a different color. Sure, it's a templating language that lets you embed code, so it's going to be pretty similar. The Razor syntax is odd, at least among templating languages that I'm familiar with, in that it just makes you mark the beginning of code with the @ character and only makes you explicitly mark the end with a } if it's ambiguous where you intend it to end. Control flow is the main case for that, but you can still write stuff like code:
e: I guess JSX comes close, but you still need to enclose code in braces once you've gone into a template block Munkeymon fucked around with this message at 14:44 on Apr 27, 2018 |
# ? Apr 27, 2018 14:40 |
|
The functional programming thread seems to be closed, so I thought i'd ask here. Is there a mooc/any kind of resource that's as good at explaining it as Functional programming in Scala but in another language? I don't want to deal with installing Eclipse/the JVM and all that crap, just learn the fundamental principles.
|
# ? Apr 27, 2018 18:48 |
|
tekz posted:The functional programming thread seems to be closed, so I thought i'd ask here. Is there a mooc/any kind of resource that's as good at explaining it as Functional programming in Scala but in another language? I don't want to deal with installing Eclipse/the JVM and all that crap, just learn the fundamental principles. You just want a non-scala "how to functional" thing? F# for fun and profit has a lot of material, that section's about thinking functionally but there's a lot more, like stuff about design and patterns. He avoids talking about whether a monad is like tacos but still gets into that stuff if you want to go deeper (If you actually want to use F# you can just use the Ionide extension with VS Code or Atom) Or if you don't want to install anything, apparently the Elm tutorials are good and work in yr browser?
|
# ? Apr 27, 2018 20:33 |
|
tekz posted:The functional programming thread seems to be closed, so I thought i'd ask here. Is there a mooc/any kind of resource that's as good at explaining it as Functional programming in Scala but in another language? I don't want to deal with installing Eclipse/the JVM and all that crap, just learn the fundamental principles. There was a very good OCaml mooc that would be worth taking if it's ever offered again.
|
# ? Apr 28, 2018 00:25 |
|
baka kaba posted:You just want a non-scala "how to functional" thing? Don't forget Racket! http://racket-lang.org/
|
# ? Apr 28, 2018 07:11 |
|
I am trying to use TortiseHG..... I think? I had this installed for a long time to track projects on my own PC (no remote server). Back then I found--or was told of--a website that had plain-English instructions for setting it up to work on your own PC< with no remote servers. And it worked perfectly, for a long time. I got a new PC and installed the current version, and it has a couple things that it won't do right, and I can't find any useful instructions online. The version I have says version 2.8.1 with Mercurial-2.6.2, Python-2.7.3, PyQt-4.9.6, Qt-4.8.4 There should be an image immediately below: 1) This new version keeps leaving the previous commit messages here. Where is the setting to not do that? Or what is it called, so I can Google it myself? I have not been able to find it. 2) This dialog pops up on every commit, that seems to indicate an error? How do I get rid of that? (considering that I have no remote servers at all?) I can't find any instructions for what to do if you aren't using any remote server? None of the sites I've found that say how to use it, say how to do that. It still does the commits, and all the file changes and commit messages are there. It's just these two problems I can't find out how to fix. Lastly, not pictured: 3) Did TortiseHG change its name to TortiseGIT? Because in the past there was tons of instructions online for TortiseHG (most of which seemed to be just copies of each other, but anyway). Now when I search Google for TortiseHG, mostly what it finds is lots and lots of pages about something named TortiseGIT....
|
# ? Apr 29, 2018 21:32 |
The screenshot says you have an option selected "--pushafter=default", it seems to try to push to a remote, but since you don't have a remote but are only working locally, that fails. So change your commit options to not try to push. Most people now prefer the Git version control system over Mercurial, so it's sort of natural that you'll see more references to that.
|
|
# ? Apr 29, 2018 21:53 |
|
edit: I'll ask elsewhere
Paul MaudDib fucked around with this message at 00:10 on May 1, 2018 |
# ? Apr 30, 2018 23:59 |
|
Don't really know of a better place to ask this... How well does the PDF format handle minor corruption? Say you copy a PDF to a flash drive that unbeknownst to you is a little dodgy and the PDF ends up with a few bit flips or something.
|
# ? May 1, 2018 20:49 |
|
Thermopyle posted:Don't really know of a better place to ask this... Depending on where the errors are, the results can range from trivial to unrecoverable. Really no way to know, but there are a number of damaged pdf repair tools (including part of just Acrobat itself).
|
# ? May 1, 2018 21:33 |
|
prolly incorrect place but whatever I want to highlight text - | in win || on iphone ||| in firefox, edge or chrome and be able to choose "Search Spotify" or "Search Tidal" as I don't care about YouTube or Apple Music Doable ?
|
# ? May 3, 2018 20:04 |
|
I’m not sure I understand, but assuming I do: On iOS your best bet may be something like Workflow. You’d make a workflow that takes text as input, urlescapes it, splices it into a URL, then opens that URL. Could be an http URL for searching the services you want, or if you’re lucky the apps might have implemented a custom URL scheme and/or Universal Links. To use, just select some text, choose Share from the menu, pick Run Workflow, and choose the workflow. Not exactly one-click but it should work. For browsers your best bet is probably a bookmarklet and/or extension. Maybe you write the extension or maybe you write a script that runs in some user script extension thinger. Not sure about Windows, will leave that to someone else.
|
# ? May 4, 2018 00:14 |
|
Hey dudes. Not sure if this is the right place. I'm trying to create a basic 3d rendering engine. My intent is to create a 4d projection onto 2d space, but starting with 3d; hence wheel reinvention. I'm using Rust. I set up a system to create simple 3d (or 4d...) shapes, placed where I'd like in 3d (...) space. By simply using the matrices defined in this Wikipedia article under 'Perspective Projection', I got a basic 3d projection. I can move around this little world, but rotating seems to rotate the scene around the origin, rather than like a FPS camera, which is what I'm going for. (Confusing, since Wikipedia defines the θ I'm adjusting to be camera orientation.) I did some more digging; found this article, which seems to stop right where it should show the transform I'm looking for. Simply subbing the 'FPS camera' matrix defined there instead of the Wiki art's Camera Transform matrix produces weird results when I rotate. This article talks mostly about moving your 3d models into a single coord system, which the Rust funcs I made do automatically, AFAIK; ie they accept a position as an input arg. It then handwaves the real transformation by saying the GPU does it. I have a feeling the answer is to review my lin alg and figure it out... I'll likely have to do that anyway when it comes to the 4d -> 2d projection I'm ultimately shooting for. Any resources that would help? Code that produces the rotate-around-origin projection: Rust code:
Dominoes fucked around with this message at 20:35 on May 5, 2018 |
# ? May 5, 2018 20:26 |
|
First rule of computer graphics: you are at the origin. Think of the camera not as an object that moves around the world and pivots, but as a force that slides objects to and from the origin, and rotates objects around the origin. They are mathematically equivalent, of course, but in your head they "feel" quite different. And in that mental image, what, mind you, gives you the desired effect? You have two options: I can, first, rotate the objects around the origin first, and then slide them into place, or I can slide them into place and then rotate around the origin. Think carefully about which transformation needs to happen first, and which needs to happen second. This should help resolve your issue.
|
# ? May 5, 2018 20:51 |
|
You're spot on that I was visualizing the system as moving and rotating the camera around a static coord system. Looks like with that outlook changed, the Wikipedia transform might work after all... Maybe causing the translations to shift every node's coordinates prior to the cam transform rather than moving the cam location (&cam.c in the function I defined above).' edit... May have to offset for what Wiki defines as e... a variable that's related to FOV and the perspective. By doing what I described (you implied) above, the rotation center now translates with the camera, but is always a fixed dist behind the view. I think if I can rotate e by the camera angle, and subtract that from the rotation transform I posted above, I can cause the view to be coincident with the rotation point, without breaking the perspective... Dominoes fucked around with this message at 21:57 on May 5, 2018 |
# ? May 5, 2018 21:15 |
|
Dominoes posted:Hey dudes. Not sure if this is the right place. Cool project. Just remember rotations if 4D are vastly more complicated than in 3D. There's no axis of rotation for example. There's a decent intro at SO(4) but expect to brush up on your linear algebra. I'm excited to see how this turns out though.
|
# ? May 6, 2018 17:44 |
|
KernelSlanders posted:Cool project. Just remember rotations if 4D are vastly more complicated than in 3D. There's no axis of rotation for example. There's a decent intro at SO(4) but expect to brush up on your linear algebra. Dominoes fucked around with this message at 17:59 on May 6, 2018 |
# ? May 6, 2018 17:56 |
|
Dominoes posted:You're spot on that I was visualizing the system as moving and rotating the camera around a static coord system. Looks like with that outlook changed, the Wikipedia transform might work after all... Maybe causing the translations to shift every node's coordinates prior to the cam transform rather than moving the cam location (&cam.c in the function I defined above).' There are two parts here: the perspective and FOV part is known as the "projection" matrix, and that's a non-linear transformation that involves that pesky divide-by-W bit. The rest of it is affine transformations (linear + translation) and can rotate, scale, and translate. Traditionally, this part of the camera transformation is known as the "eye" or "view" part, which translates from world-space to eye-space (sometimes called view-space). Ignore this part for now. Objects themselves can also do things like rotating in place and this is known as the "model" matrix, which translates from object-space to world-space. If you have a rotating cube that you want to stare at, then you have 1. the cube rotating, 2. the cube translated to be somewhere in world-space, 3. a translation that puts the camera's location at the origin, 4. a rotation about the origin that points the camera where you want it. This set of transformations is often known as the "model-view" transformation (no relation to the "model" and "view" of "model view controller", waddya know, programmers are terrible at naming things), and can be expressed in one 4x3 matrix as a single transformation from object space to view space. After the view-space transformation comes the projective transformation, which (traditionally) turns you from a linear space where parallel lines never intersect to a projective space where parallel lines intersect at infinity. If you have an orthographic view, you don't need it (though a projection matrix is used for other features in a "real" 3d scenario like depth remap)
|
# ? May 6, 2018 18:05 |
|
As for FPS controls, WASD is pretty clear (just multiply your camera matrix by a translation matrix to move in space). For rotation like mouselook, the easiest way to do that is to rotate X around your camera's up vector, and then rotate Y around your world-space right axis. This is not correct if you have any bank rotation, but I don't know if there is a convention for what mouselook does when you have bank rotation applied -- it's kind of just a hosed concept.JavaScript code:
|
# ? May 6, 2018 18:11 |
|
I'm trying to parse an XML file created by a program I don't have access to. The first line iscode:
code:
Is it likely this file has bee intentionally obfuscated or is there another explanation I'm missing? Any ideas on how to parse it?
|
# ? May 7, 2018 01:04 |
|
SurgicalOntologist posted:I'm trying to parse an XML file created by a program I don't have access to. The first line is Some people put binary data in xml streams (also JSON). It’s generally for data compression or ease of decoding into whatever custom serializer someone wrote, not obfuscation (same thing re: mixed character sets). If you know what information is necessary, reverse engineering it is a bit easier. Assuming it’s not encrypted.
|
# ? May 7, 2018 02:01 |
|
That’s a pretty low confidence and the win-125X code pages define (almost?) every byte so I’m on board with the “probably encoded binary data” theory. Maybe split that portion out and run file on it?
|
# ? May 7, 2018 02:12 |
|
SurgicalOntologist posted:Any ideas on how to parse it? "Dear $vendor, your "xml" isn't. Please provide me with a version that can be understood by an actual XML parser"
|
# ? May 7, 2018 08:15 |
|
redleader posted:"Dear $vendor, your "xml" isn't. Please provide me with a version that can be understood by an actual XML parser" “Dear $client; our internal file formats are for our use only and we do not allow reverse engineering our client or services. We are happy to provide assistance integrating into your applications at a daily rate of $xxxx”
|
# ? May 7, 2018 12:23 |
|
Suspicious Dish posted:As for FPS controls, WASD is pretty clear (just multiply your camera matrix by a translation matrix to move in space). For rotation like mouselook, the easiest way to do that is to rotate X around your camera's up vector, and then rotate Y around your world-space right axis. This is not correct if you have any bank rotation, but I don't know if there is a convention for what mouselook does when you have bank rotation applied -- it's kind of just a hosed concept. Rust code:
Dominoes fucked around with this message at 00:36 on May 9, 2018 |
# ? May 9, 2018 00:30 |
|
Why is this returning an empty string?If you print the values its getting them correctly.code:
underage at the vape shop fucked around with this message at 08:07 on May 9, 2018 |
# ? May 9, 2018 08:04 |
|
underage at the vape shop posted:Why is this returning an empty string?If you print the values its getting them correctly. Check out concat's return value.
|
# ? May 9, 2018 10:40 |
|
underage at the vape shop posted:Why is this returning an empty string?If you print the values its getting them correctly. Java Strings are immutable. Nothing ever changes a string in place. Using code:
|
# ? May 9, 2018 13:11 |
|
I'm trying to put together a team roster thing for a page at work, but I am not a coder. I can (sometimes) figure out how to tweak existing code to make something do what I want. I'm working with this Collapsible Accordion code from w3schools, but I can't figure out if the problem I'm running into is a Javascript thing or a CSS thing -- or a mixture of the two. When I open up the main accordion all of the sub accordions show up. But if I try to open up any sub accordions, text gets cut off because the main accordion has already determined how tall the column is going to be. If I close the main accordion and then reopen it, the column length has now adjusted to accommodate the extended text from the sub-accordion. I need the main accordion to readjust the height as submenus are opened. If I change the overflow to show from hidden, the main menu adjusts height accordingly, but everything in the submenus is visible in the layer behind the menus. The one big hitch is that I'm working with this proprietary collaboration software. It allows for HTML widgets (that will support CSS and Javascript) but it does not play nice with super complicated coding. This is the w3schools code I'm working with. Any suggestions or help would be awesome. code:
|
# ? May 9, 2018 19:07 |
|
How dumb/insecure is this. You have a cloud based file storage service like dropbox or google drive. As an optimization, you store a huge dictionary of post encryption file size and payload hashes. So if 2 or more people have nickelback_song.mp3 but with different file names, the payload hash and file size should match and they can both just point to the same encrypted file even though their accounts have nothing to do with each other. Would that work in practice? Would it be bad for security even if its done post encryption? My gut tells me there's a huge percentage of redundant 'public' data in cloud storage services. Maybe they've figured a better way to optimize the storage of redundant data across different user accounts.
|
# ? May 11, 2018 19:05 |
|
Shaocaholica posted:How dumb/insecure is this. Even better, you deduplicate at the block level of the file system by hashing the contents of individual blocks. And yes, this is something that is done and is explicitly a part of file systems like ZFS.
|
# ? May 11, 2018 19:27 |
|
If you're using one encryption key for everybody then it doesn't really count as "encrypted" from the user's perspective, since the storage provider can just look up the key and use it to decrypt the data. If each user has their own keys (which the service doesn't know), then those encrypted blocks won't match.
|
# ? May 11, 2018 19:36 |
|
|
# ? May 31, 2024 10:04 |
|
Oh yeah, I totally glossed over the part where most providers only do de-duplication on the users own data.
|
# ? May 11, 2018 19:38 |