suppose this i a "beginner's" question and the answer might be to really understand regex, BUT I don't :-) right now i have a problem with different versions of firefox (in version 6 and previous, file.filename is the filereader method to get the name of a file, from version 7 on it is file.name).
so i actually test the follwing:
1. ((/firefox/i).test(navigator.userAgent)&&!(/rv:7/i).test(navigator.userAgent)&&!(/rv:8/i).test(navigator.userAgent)) ? 'Moz' :
2. ((/firefox/i).test(navigator.userAgent)&&(/rv:7/i).test(navigator.userAgent))? 'Moz7' :
3. ((/firefox/i).test(navigator.userAgent)&&(/rv:8/i).test(navigator.userAgent))? 'Moz8' :
which is not very effektive :-) i'd rather ask for "versions up to 6" and "versions from 7 up". how could i change my way?
thanks for hints
Have a look at quirksmode - there is a long section on browser detection .... why re-invent the wheel ...
http://www.quirksmode.org/js/detect.html
You can then use the output of that to perform if (browser > versionx) type code ...
Related
I am working on a meteor-Angular project, where I am using #ngx-translate for translation.
Now when it comes to HTML files the translation works perfectly fine with a translation JSON file.
But when it comes to the ts file I do not know how to translate the words. Here is an example -
I have tried a lot how to translate .ts file but somehow I couldn't find a single solution to this problem. Does anyone know how to solve this problem?
you can use the instant method in the component.
https://github.com/ngx-translate/core#methods
this.column : [
{header : this.translate.instant('ACCOUNT_TYPE')},
{header : this.translate.instant('NAME')},
...
]
you can look my answer
for currect working after f5 u need to use appInitializerFactory (don't forgot add it to providers like in answer)
you should translate when sending to HTML whit the pipe.
If the column is a FOR, also for each word use the pipe. ( column[0] | translate)
I installed the Kite autocomplete for Python (Anaconda-Spyder is my main IDE , though I also use SublimeText)
And i get this pic:
Kite Pro ripping me off
(Even when I do not get any starred autocompletions of any sort ...)
Isn't it supposed to say 3 starred completions left today??
Even when i sign out and back in , uninstall Kite, clear my registry and remove temp and program files, i notice it somehow knows that I have used up some of its 30 completions and gives me only 30 per day
Even if I sign out of Kite (no way for it to know I have an account with a Pro free trial , right?? ),I still get only 30 completions per day, and after that kite is "locked" - null completions today ...
And i don't even get the Starred completions - the Pro completions
So is it a mistake on my installation ? Will adding Kite to my PATH help?? (I seriously doubt it )
Or is it a bug on the devs' side ??
Any help regarding this matter would be appreciated ...
I simply cannot stand the fact that my bro gets FREE autocompletions per day, and that too unlimited ones at that ( which I guess is the free tier of Kite , since he gets only 3 starred ones)
I think there might be a bug on Kite's side.
However, I do not face the problem mentioned above :
https://i.stack.imgur.com/259T8.png |
I receive unlimited free tier auto-completions and only 3 Pro completions.Hope this answer helps you!
There are a couple of answers for Perl 6 back in its Parrot days and they don't seem to work currently:
This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda
implementing Perl 6.c.
The answer to Does perl6 enable “autoflush” by default? says it's enabled by default (but that was 2011).
Here's a program I was playing with:
$*ERR.say: "1. This is an error";
$*OUT.say: "2. This is standard out";
And its output, which is an unfortunate order:
2. This is standard out
1. This is an error
So maybe I need to turn it on. There's How could I disable autoflush? which mentions an autoflush method:
$*ERR.autoflush = True;
$*ERR.say: "1. This is an error";
$*OUT.say: "2. This is standard out";
But that doesn't work:
No such method 'autoflush' for invocant of type 'IO::Handle'
I guess I could fake this myself by making my IO class that flushes after every output. For what it's worth, it's the lack of this feature that prevented me from using Perl 6 for a particular task today.
As a secondary question, why doesn't Perl 6 have this now, especially when it looks like it used to have it? How would you persaude a Perl 5 person this isn't an issue?
There was an output refactory very recently. With my local version of rakudo i can't get it to give the wrong order any more (2017.06-173-ga209082 built on MoarVM version 2017.06-48-g4bc916e)
There's now a :buffer argument to io handles that you can set to a number (or pass it as :!buffer) that will control this.
I assume the default if the output isatty is to not buffer.
This might not have worked yet when you asked the question, but:
$*ERR.out-buffer = False;
$*ERR.say: "1. This is an error";
$*OUT.say: "2. This is standard out";
It's a bit hard to find, but it's documented here.
Works for me in Rakudo Star 2017.10.
Rakudo doesn't support autoflush (yet). There's a note in 5to6-perlvar under the $OUTPUT_AUTOFLUSH entry.
raiph posted a comment elsewhere with a #perl6 IRC log search showing that people keep recommending autoflush and some other people keep saying it's not implemented. Since it's not a documented method (although flush is), I suppose we'll have to live without for a bit.
If you're primarily interested in STDOUT and STDERR, the following seems to reopen them without buffering (auto-flushed):
$*OUT = $*OUT.open(:!buffer);
$*ERR = $*ERR.open(:!buffer);
This isn't thoroughly tested yet, and I'm surprised this works. It's a funny API that lets you re-open an open stream.
My problem is taking mean of all features from different frames in one sample .wav file. I am trying cFunctionals in "chroma_fft.conf" file which belongs to latest OpenEar framework. For best explanation, i am writing these essential codes which i wrote in "chroma_fft.conf" and it is shown below;
[componentInstances:cComponentManager]
instance[functL1].type = cFunctionals
[functL1:cFunctional]
reader.dmLevel = chroma
writer.dmLevel = func
frameMode = full
frameSize=0
frameStep=0
functionalsEnabled = Means
Means.amean = 1
[csvSink:cCsvSink]
reader.dmLevel = func
..NOT-IMPORTANT......
..NOT-IMPORTANT......
However, when i run from command prompt in windows, i got error;
"(ERROR) [1] in configManager : base instance of field 'functL1.reader.dmInstance' not found in configmanager!"
Very similar code is running succesfully from "emo_large.conf" but this code got error. If any body knows how to use OpenSmile audio feature extractor, can give advice or answer why it has error and how to use "cFunctionals" properly to take mean, variance, moments etc. of large feature sets.
Thanks!
In this case you have a typo in
[functL1:cFunctional]
which should be
[functL1:cFunctionals]
I admit the error message
"(ERROR) [1] in configManager : base instance of field 'functL1.reader.dmInstance' not found in configmanager!"
is not intutive, but it refers to the fact that openSMILE expects a configuration section functL1 of type cFunctionals in the config to read the mandatory (sub-)field functL1.reader.dmInstance, which it then cannot find, because the section (due to the typo) is not defined.
Cheers,
Florian
I need my [[+idx]] tv to start at 0 instead of 1 so I tried this:
[[+idx:decr]] or [[+idx:substract=1]] but it gives me -1 (minus one).
Does anyone know another way to obtain 0?
Thank you
Using this in chunk for getImageList works (at least for me):
[[+idx:decr]]
It gives: 0,1,2,3 ....
P.S. using modx revo 2.3.1
set your template variable default to 0 when you create the variable.
What are you trying to do, your question is vague at best.
UPDATE
ok - what I think will work for you is to write a snippet to do the math... where ever you call the [[+idx]] instead write a snippet
[[!FixIDX? &itemindex=`[[+idx]]`]]
then in your FixIDX snippet just do the math with php and return the corrected index. Though perhaps a custom output modifier would be the better way to go: http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+(Output+Modifiers)
Though looking at the docs, your code should certainly work - I see no reason for it not to.