Quantcast
Channel: User Chris Krycho - Stack Overflow
Browsing latest articles
Browse All 39 View Live

Comment by Chris Krycho on Angular: How to handle two-part directive

@Cerbrus, that was my thought as well, I'm just still thinking through the best way to do that—and, perhaps unhelpfully, the <p> elements in the notes are pre-rendered (though I could change...

View Article


Comment by Chris Krycho on Angular: How to handle two-part directive

It's a step in the right direction, and it may well work for the notes themselves. However, I need to insert links into the rendered content in the first body/content div. (I'll update the question to...

View Article


Comment by Chris Krycho on C/C++ Determine Drive a program is running on

Note that this is not guaranteed to work properly. GetModuleFileName may return a short or long file name, and therefore may start with `\\?` preceding the volume letter (or UNC reference). In that...

View Article

Comment by Chris Krycho on Mercurial: roll back an "hg commit --amend".

Generally speaking, you'll either just amend the newly unbundled tip commit itself, so that you can give it a meaningful error message, or you'll do as @oblalex suggested and merge. In many cases,...

View Article

Comment by Chris Krycho on Sublime Text no longer launches from terminal

If you get this far, see this other answer, which resolves the issue with tmux (though the tmux issue itself remains unresolved).

View Article


Comment by Chris Krycho on Ember ember-views.render-double-modify deprecation

Did you ever get this sorted? I'm seeing it in exactly the same kind of circumstance.

View Article

Comment by Chris Krycho on ember-cli is hanging on ember server command

Note: per the other answer, you do not need to uninstall and reinstall watchman. That will work, but it's a lot of unnecessary time. :)

View Article

Comment by Chris Krycho on What is the proper way to write a computed...

I have not confirmed on 2.16, but would expect it to work correctly there. I have confirmed on 2.17.2 as well as the 3.1 beta series. Also, confirm that you have a get function, as the error seems to...

View Article


Comment by Chris Krycho on Emberjs and Typescript SetUp

Note that I've added an up-to-date answer below, including a bunch of work we've done over the last year to make for much more complete type definitions and good support within Ember's build tooling.

View Article


Comment by Chris Krycho on Intellisense for Ember injected services

That is indeed the case – though those posts are also in need of another round of updates!

View Article

Comment by Chris Krycho on emberjs glimmer object set() with variable...

A few notes: 1. You shouldn’t use either setorsetPropertyChanged for these. Instead, you should restructure how you model your data. If you need those properties to be updated when changed, either...

View Article

Comment by Chris Krycho on Disable macOS Sonoma Text Insertion Point (Cursor)...

Along the same lines, Ulysses does not display a cursor at all in this mode. Apparently the custom shenanigans they had to do to make their text editor play nicely with the new cursor… don't play...

View Article

Cast from float to double produces different results—same code, same...

Edit: See the end of the question for an update on the answer.I have spent several weeks tracking down a very odd bug in a piece of software Imaintain. Long story short, there is an old piece of...

View Article


Answer by Chris Krycho for Is there any way to fix fonts.com @font-face...

Update 2014/01/16:Fonts.com now supports standard font face embeds. The following still works as it should, but is largely obviated by first-party support.First, note that Fonts.com now asserts that...

View Article

Answer by Chris Krycho for SQLAlchemy: successful insertion but then raises...

As I might have expected, especially once I discovered that the issue was that the row was being inserted as expected but then called with an UPDATE function shortly after, the problem was some related...

View Article


SQLAlchemy: successful insertion but then raises an exception

I am running SQLAlchemy against FirebirdSQL, and when I execute an insert command in my project, SQLAlchemy is raising an exception on returning from executing against the connection. However, the...

View Article

Answer by Chris Krycho for pydoc supported python metadata such as...

Any top-level private globals following a particular naming convention will be included under the Data section generated by Pydoc:All normal global variables are displayed there – you can see this...

View Article


Answer by Chris Krycho for Python - How to find an EXACT extension?

(Edited. See below for original answer.)The real problem here appears to be something to do with the algorithm and/or something else on the system (per comments about restarting changing things), since...

View Article

Mocking Python iterables for use with Sphinx

I'm using Sphinx to document a project that depends on wxPython, using the autodocs extension so that it will automatically generate pages from our docstrings. The autodocs extension automatically...

View Article

Answer by Chris Krycho for Python OrderedDict iteration

From the docs:The OrderedDict constructor and update() method both accept keyword arguments, but their order is lost because Python’s function call semantics pass-in keyword arguments using a regular...

View Article

Answer by Chris Krycho for Elegant command line argument parsing for PyQt

The best solution here is using the argparse module's parse_known_args() method (docs) to process the non-Qt command line options first. It's no more work in configuring the ArgumentParser—it just...

View Article


CSS fallback for OpenType small caps

I'm working on a site where small caps are important: setting the text of the Bible. In the Old Testament the name of God is transliterated as Lord but in small caps—not LORD. However, the state of...

View Article


Answer by Chris Krycho for CSS fallback for OpenType small caps

Last updated 2016/02/28.I spent a considerable amount of time researching this and wrestling with it.After digging around as best I could, the top solutions for now are:@supportsTake advantage of the...

View Article

Answer by Chris Krycho for Constrain wxPython MultiSplitterWindow panes

Depending on what one needs this for, one possible option to use instead of a custom-managed MultiSplitterWindow (or SashLayoutWindow combinations, etc.) is the Advanced User Interface kit's AuiManager...

View Article

Constrain wxPython MultiSplitterWindow panes

Edit: I'm leaving the question open as is, as it's still a good question and the answer may be useful to others. However, I'll note that I found an actual solution to my issue by using a completely...

View Article


Answer by Chris Krycho for ember-cli is hanging on ember server command

There's a bug in the upgrade process from watchman 4.6 to 4.7. The solution, from the watchman team (which doesn't require you to uninstall and reinstall watchman) is to reload the watchman launch...

View Article

Answer by Chris Krycho for tsc is trying to resolve relative path modules in...

You can resolve this by using the "paths" key in the "compilerOptions" in your tsconfig.json. Something like this:{"compilerOptions": {"paths": {"myLib/*": "node_modules/myLib/dist/*" } }}Sadly, this...

View Article

Answer by Chris Krycho for Handling Mixins with Ember CLI Typescript

You have the right basic tack going. Classic Ember Mixin instances have to be bound to the prototype. Note that everything that follows is equally applicable to ES6 classes; TypeScript classes are...

View Article

Answer by Chris Krycho for I have an enum in my Typescript / Ember 3.1 app...

This is because the types module is not included for compilation by ember-cli-typescript. Pure type declarations will work fine, because they're erased at compile-time. However, enums have runtime...

View Article



Answer by Chris Krycho for Emberjs and Typescript SetUp

Full and mostly-accurate type definitions for Ember.js are now available to install from npm at @types/ember, @types/ember-data, and so on, currently all via the Definitely Typed project.Ember CLI...

View Article

Answer by Chris Krycho for How to fix type checking when using...

To understand what's happening I recommend reading this section of the ember-cli-typescript docs. The gist is that the types supplied for Ember do some extra work to make it so that when you type...

View Article

Answer by Chris Krycho for emberjs glimmer object set() with variable...

There are two basic issues with the situation you have described—one of them related to TypeScript, one of them not.The TypeScript issue is that TS is aware of the names of properties in general, and...

View Article

Answer by Chris Krycho for Inset border-radius with CSS3

The best way I've found to achieve this with all CSS and HTML (no images, etc.) is by using CSS3 gradients, per Lea Verou. From her solution:div.round { background: -moz-radial-gradient(0 100%, circle,...

View Article


Answer by Chris Krycho for component unit testing in Glimmer

These are indeed an anti-pattern! Indeed, unit testing components is an anti-pattern in general: you're not actually testing the interface of the component that way. Here's what I mean by that: all...

View Article

Answer by Chris Krycho for What is the Ember Octane replacement for...

Your instinct that did-insert isn't the right solution here is, I think, correct. In general, modifiers should only be used when the element they're going to be attached to is used in some way—that is,...

View Article

Answer by Chris Krycho for Glimmer.js how to reset tracked property to...

There are two parts to this answer, but the common theme between them is that they emphasize switching from an imperative style (explicitly setting values in a lifecycle hook) to a declarative style...

View Article


Answer by Chris Krycho for Best approach to caching in Ember Octane

There are two categories of things here:The two @cached decorators.The caching primitives introduced via RFC 0566.In the vast majority of Ember or Glimmer app or normal library code, you’ll just be...

View Article


Answer by Chris Krycho for How to update nested state in Ember Octane

Any time you have a bunch of nested state like that which needs to be tracked, just tracking the top-level object won't cause updates to the internals of that object to propagate out. You need to track...

View Article

Answer by Chris Krycho for Ember.JS Tutorial "Super-Rentals" and API Paths

Per the Ember CLI docs:public/– This directory will be copied verbatim into the root of the built application. Use this for assets that don’t have a build step, such as images or fontsNormally in an...

View Article
Browsing latest articles
Browse All 39 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>