Why es3 features are polyfilled by babel-polyfill? - babeljs

I use #babel/preset-env + babel-polyfill + corejs3 with "useBuiltIns": "usage" in .babelrc config.
I use browserlist to target the following browsers:
ie >= 9
edge >= 12
firefox >= 36
chrome >= 49
safari >= 10
I found that some ES3 features are polyfilled even they are considered available to all target browsers (according to CanIUse):
[/app/src/myscript.js] Added following core-js polyfills:
es.array.concat { "chrome":"49", "edge":"12", "firefox":"36", "ie":"9" }
es.array.slice { "chrome":"49", "edge":"12", "firefox":"36", "ie":"9" }
My goal is to minimize the file size and remove unnecessary polyfills.
My questions is: Why babel-polyfill decided to add those polyfills for es3 features ?

Related

How to fix refreshPreferences Message in Xcode 9 [duplicate]

This question already has answers here:
refreshPreferences HangTracerEnabled / HangTracerDuration messages in iOS 11 + Xcode 9
(3 answers)
Closed 5 years ago.
add this line code to my class
let myLayer = CALayer()
myLayer.contents = self.makeTrySwiftLogoImage().CGImage
var transform = CATransform3DIdentity
transform.m34 = 1.0 / -500
transform = CATransform3DRotate(transform, 45.0f * M_PI / 180.0, 0, 1, 0)
myLayer.transform = transform
and get this message to my console
2017-09-22 18:00:53.354890+0330 SibDiet[973:944502] refreshPreferences: HangTracerEnabled: 0
2017-09-22 18:00:53.355974+0330 SibDiet[973:944502] refreshPreferences: HangTracerDuration: 500
2017-09-22 18:00:53.356014+0330 SibDiet[973:944502] refreshPreferences: ActivationLoggingEnabled: 0 ActivationLoggingTaskedOffByDA:0
and don't run my application, remove this 6 line and run again but receive this message again, remove Xcode and install again but no fix
I managed to fix it on High Sierra(10.13.1) XCode 9.1 and with iOS 11.0.3 by defining OS_ACTIVITY_MODE as disable by going in XCode via
Product > Scheme > Edit Scheme > Arguments > Environment Variables
add OS_ACTIVITY_MODE disable
schema editor (fragment)
Note: NSLog may not work after doing this.
Similar issue is reported in the question:
refreshPreferences HangTracerEnabled / HangTracerDuration messages in iOS 11 + Xcode 9

TYPO3 version 6 to version 8 compatibility issues

While upgrading typo3 version 6 to 8.7.3 getting this database error...
An exception occurred while executing 'SELECT `pid` FROM `sys_template` WHERE (root = 1 AND deleted = 0 AND hidden = 0 AND starttime <= :starttime AND (endtime = 0 OR endtime > :endtime)) AND ((`sys_template`.`deleted` = 0) AND (`sys_template`.`hidden` = 0) AND (`sys_template`.`starttime` <= 1500543000) AND ((`sys_template`.`endtime` = 0) OR (`sys_template`.`endtime` > 1500543000)))': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':starttime AND (endtime = 0 OR endtime > :endtime)) AND ((`sys_template`.`delete' at line 1
Please review the screen shot.
DB Configuration variables have changed from TYPO3 v7 to v8 ^^
It is not
$GLOBALS['TYPO3_CONF_VARS']['DB']['database']
$GLOBALS['TYPO3_CONF_VARS']['DB']['host']
$GLOBALS['TYPO3_CONF_VARS']['DB']['username']
$GLOBALS['TYPO3_CONF_VARS']['DB']['password']
anymore, but
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host']
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname']
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['user']
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['password']
This is especially the case, when configuring additional Environments via AdditionalConfiguration.php

Gstreamer1.0 missing plugin: decodebin2 in Python code

The following Python code that adds three files to a GES timeline throws up the following error that others have also had:
(GError('Your GStreamer installation is missing a plug-in.',), 'gstdecodebin2.c(3928): gst_decode_bin_expose (): /GESPipeline:gespipeline0/GESTimeline:gestimeline0/GESVideoTrack:gesvideotrack0/GnlComposition:gnlcomposition1/GnlSource:gnlsource0/GstBin:videosrcbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin4:\nno suitable plugins found')
from gi.repository import GES
from gi.repository import GstPbutils
from gi.repository import Gtk
from gi.repository import Gst
from gi.repository import GObject
import sys
import signal
VIDEOPATH = "file:///path/to/my/video/folder/"
class Timeline:
def __init__(self, files):
print Gst._version # prints 1
self.pipeline = GES.Pipeline()
container_caps = Gst.Caps.new_empty_simple("video/quicktime")
video_caps = Gst.Caps.new_empty_simple("video/x-h264")
audio_caps = Gst.Caps.new_empty_simple("audio/mpeg")
self.container_profile = GstPbutils.EncodingContainerProfile.new("jane_profile", "mp4 concatation", container_caps, None )#Gst.Caps("video/mp4", None))
self.video_profile = GstPbutils.EncodingVideoProfile.new(video_caps, None, None, 0)
self.audio_profile = GstPbutils.EncodingAudioProfile.new(audio_caps, None, None, 0)
self.container_profile.add_profile(self.video_profile)
self.container_profile.add_profile(self.audio_profile)
self.bus = self.pipeline.get_bus()
self.bus.add_signal_watch()
self.bus.connect("message", self.busMessageCb)
self.timeline = GES.Timeline.new_audio_video()
self.layer = self.timeline.append_layer()
signal.signal(signal.SIGINT, self.handle_sigint)
self.start_on_timeline = 0
for file in files:
asset = GES.UriClipAsset.request_sync(VIDEOPATH + file)
print asset.get_duration()
duration = asset.get_duration()
clip = self.layer.add_asset(asset, self.start_on_timeline, 0, duration, GES.TrackType.UNKNOWN)
self.start_on_timeline += duration
print 'start:' + str(self.start_on_timeline)
self.timeline.commit()
self.pipeline.set_timeline(self.timeline)
def handle_sigint(self, sig, frame):
Gtk.main_quit()
def busMessageCb(self, unused_bus, message):
print message
print message.type
if message.type == Gst.MessageType.EOS:
print "eos"
Gtk.main_quit()
elif message.type == Gst.MessageType.ERROR:
error = message.parse_error()
print (error)
Gtk.main_quit()
if __name__=="__main__":
GObject.threads_init()
Gst.init(None)
GES.init()
gv = GES.version() # prints 1.2
timeline = Timeline(['one.mp4', 'two.mp4', 'two.mp4'])
done = timeline.pipeline.set_render_settings('file:///home/directory/output.mp4', timeline.container_profile)
print 'done: {0}'.format(done)
timeline.pipeline.set_mode(GES.PipelineFlags.RENDER)
timeline.pipeline.set_state(Gst.State.PAUSED)
Gtk.main()
I have set the GST_PLUGIN_PATH_1_0 environment variable to "/usr/local/lib:/usr/local/lib/gstreamer-1.0:/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu/gstreamer-1.0"
I compiled and installed gstreamer1.0-1.2.4, together with the base, good, bad and ugly packages for that version. GES is installed with version 1.2.1 as this was the nearest to the gstreamer version I found. I also installed the libav-1.2.4.
The decodebin2 should be in base according to the make install log for plugin-base and is linked into libgstplayback, which is part of my GST_PLUGIN_PATH_1_0:
/usr/local/lib/gstreamer-1.0 libgstplayback_la-gstdecodebin2.lo
I do have gstreamer0.10 and the decodebin2 is there as a blacklisted version when I do 'gst-inspect-1.0 -b' as it sits in the gstreamer0.10 library path rather than on that for 1.0.
I tried clearing the ~/.cache/gstreamer files and running gst-inspect-1.0 again to regenerate the plugin registry but I still keep getting the error in the Python code. This sample code might be wrong as it is my first stab at writing a timeline using Gstreamer editing services. I am on Ubuntu Trusty or 14.04.
The file is an mp4 file which is why I installed gst-libav for the required libraries.
The output of MP4Box -info on the file is:
Movie Info *
Timescale 90000 - Duration 00:00:08.405
Fragmented File no - 2 track(s)
File suitable for progressive download (moov before mdat)
File Brand mp42 - version 0
Created: GMT Mon Aug 17 17:02:26 2015
File has no MPEG4 IOD/OD
Track # 1 Info - TrackID 1 - TimeScale 50000 - Duration 00:00:08.360
Media Info: Language "English" - Type "vide:avc1" - 209 samples
Visual Track layout: x=0 y=0 width=1920 height=1080
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 1920 x 1080
AVC Info: 1 SPS - 1 PPS - Profile Main # Level 4.2
NAL Unit length bits: 32
Pixel Aspect Ratio 1:1 - Indicated track size 1920 x 1080
Self-synchronized
Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 00:00:08.405
Media Info: Language "English" - Type "soun:mp4a" - 394 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 48000 Synchronized on stream 1
log # pastebin.com/BjJ8Z5Bd for when I run 'GST_DEBUG=3,gnl*:5 python ./timeline1.py > timeline1.log 2>&1'
There is no "decodebin2" in GStreamer 1.x, which you're using here. It's just called "decodebin" now and is equivalent to "decodebin2" in 0.10.
Your problem here however is not that decodebin is not found. Your problem is that you're missing a plugin to play this specific media file. What kind of media file is it?

Behavior of contradicting soft constraints

I have a testcase in which the behavior seems wrong. I see that in all generations the num_of_red_shoes is high, while I would expect a more even distribution. What is the cause of this behavior and how can it be fixed?
<'
struct closet {
kind:[SMALL,BIG];
num_of_shoes:uint;
num_of_red_shoes:uint;
num_of_black_shoes:uint;
num_of_yellow_shoes:uint;
keep soft num_of_red_shoes < 10;
keep soft num_of_black_shoes < 10;
keep soft num_of_yellow_shoes < 10;
keep num_of_yellow_shoes + num_of_black_shoes + num_of_red_shoes == num_of_shoes;
when BIG closet {
keep num_of_shoes in [50..100];
};
};
extend sys {
closets[100]:list of BIG closet;
};
'>
Generation results:
item type kind num_of_sh* num_of_re* num_of_bl* num_of_ye*
---------------------------------------------------------------------------
0. BIG closet BIG 78 73 1 4
1. BIG closet BIG 67 50 8 9
2. BIG closet BIG 73 68 0 5
3. BIG closet BIG 73 66 3 4
4. BIG closet BIG 51 50 0 1
5. BIG closet BIG 78 76 1 1
6. BIG closet BIG 55 43 7 5
7. BIG closet BIG 88 87 1 0
8. BIG closet BIG 99 84 6 9
9. BIG closet BIG 92 92 0 0
10. BIG closet BIG 63 55 3 5
11. BIG closet BIG 59 50 9 0
12. BIG closet BIG 51 44 2 5
13. BIG closet BIG 82 76 1 5
14. BIG closet BIG 81 74 2 5
15. BIG closet BIG 97 93 2 2
16. BIG closet BIG 54 41 8 5
17. BIG closet BIG 55 44 5 6
18. BIG closet BIG 70 55 9 6
19. BIG closet BIG 63 57 1 5
When there are contradicting soft constraints, Specman does not randomize the softs which are enforced, but rather gives priority to the constraints which were written last. Since the soft on red shoes was first in the test, it is the one which is always overridden.
If the softs are known to be mutually exclusive (which is not the case here) you could use a simple flag to randomly choose which soft should hold. e.g. the code would look like this:
flag:uint[0..2];
keep soft read_only(flag==0) => num_of_red_shoes < 10;
keep soft read_only(flag==1) => num_of_black_shoes < 10;
keep soft read_only(flag==2) => num_of_yellow_shoes < 10;
However, since here there is no knowledge in advance how many softs are expected to hold (and it's possible and two or all three will be satisfied) a more complex solution should be made. Here is a code which does this randomization:
struct closet {
kind:[SMALL,BIG];
num_of_shoes:uint;
num_of_red_shoes:uint;
num_of_black_shoes:uint;
num_of_yellow_shoes:uint;
//replaces the original soft constraints (if a flag is true the correlating
//right-side implication will be enforced
soft_flags[3]:list of bool;
keep for each in soft_flags {
soft it == TRUE;
};
//this list is used to shuffle the flags so their enforcement will be done
//with even distribution
soft_indices:list of uint;
keep soft_indices.is_a_permutation({0;1;2});
keep soft_flags[soft_indices[0]] => num_of_red_shoes < 10;
keep soft_flags[soft_indices[1]] => num_of_black_shoes < 10;
keep soft_flags[soft_indices[2]] => num_of_yellow_shoes < 10;
keep num_of_yellow_shoes + num_of_black_shoes + num_of_red_shoes == num_of_shoes;
};
I'm not with Cadence, so I can't give you a definite answer. I think the solver will try to break as few constraints as possible and it just chooses the first one if finds (in your case the one for red shoes). Try changing the order and see if this changes (if the black constraint is first, I'd think you'll always get more black shoes).
As a solution, you could just remove the soft constraints when you have a big closet:
when BIG closet {
keep num_of_red_shoes.reset_soft();
keep num_of_black_shoes.reset_soft();
keep num_of_yellow_shoes.reset_soft();
keep num_of_shoes in [50..100];
};
If you want to randomly choose which one of them to disable (sometimes more than 10 red shoes, sometimes more than 10 black shoes, etc.), then you'll need a helper field:
when BIG closet {
more_shoes : [ RED, BLACK, YELLOW ];
keep more_shoes == RED => num_of_red_shoes.reset_soft();
keep more_shoes == BLACK => num_of_black_shoes.reset_soft();
keep more_shoes == YELLOW => num_of_yellow_shoes.reset_soft();
keep num_of_shoes in [50..100];
};
It depends on what you mean by "a more even distribution".
There is no way to satisfy all of your hard and soft constraints for a BIG closet. Therefore Specman attempts to find a solution by ignoring some of your soft constraints. The IntelliGen constraint solver doesn't ignore all of the soft constraints, but attempts to find a solution while still using a subset. This is explained in the "Specman Generation User Guide" (sn_igenuser.pdf):
[S]oft constraints that are loaded later are considered to have a higher priority than soft constraints loaded previously."
In this case that means that Specman discards the soft constraint on red shoes and since it can find a solution still obeying the other soft constraints it does not discard them.
If you combine all of your soft constraints into one, then you will probably get the result you were hoping for:
keep soft ((num_of_red_shoes < 10) and (num_of_black_shoes < 10) and
(num_of_yellow_shoes < 10));
There are advantages to giving later constraints priority: This means that using AOP you can add new soft constraints and they will get the highest priority.
For more distributed values, I would suggest the following.
I'm sure you can follow the intended logic too.
var1, var2 : uint;
keep var1 in [0..30];
keep var2 in [0..30];
when BIG closet {
keep num_of_shoes in [50..100];
keep num_of_yellow_shoes == (num_of_shoes/3) - 15 + var1;
keep num_of_black_shoes == (num_of_shoes - num_of_yellow_shoes)/2 - 15 + var2;
keep num_of_red_shoes == num_of_shoes - (num_of_yellow_shoes - num_of_black_shoes);
keep gen (var1, var2) before (num_of_shoes);
keep gen (num_of_shoes) before (num_of_yellow_shoes, num_of_black_shoes, num_of_red_shoes);
keep gen (num_of_yellow_shoes) before (num_of_black_shoes, num_of_red_shoes);
keep gen (num_of_black_shoes) before (num_of_red_shoes);
};

How do I manually generate text files for entire project to diff in Visual FoxPro (e.g. .sca, .vca, etc.)

The challenge is that I'm checking my FoxPro code into source control (using Mercurial, but that's not the focus of this question) and would like a quick way to get the FoxPro SCCTEXT output alongside the binary output without using the Tools > Options > Projects > Active source control provider functionality.
For an example of the kind of output I'm looking to generate, the VFPX source contains many of these text .sca, .vca, etc. files. Is there any way to generate these files on demand?
Rather than setting a source control provider, you can hack scctext.prg (which ships with VFP) and use a project hook to generate the files - see http://paulmcnett.com/scX.php for an example implementation using Subversion.
Edit: Have you looked at the Alternate SCCText on Codeplex
Also see http://www.foxpert.com/docs/cvs.en.htm for another perspective.
Here is the code I use to genereate SCCText files for every file in my Project file. Just open your Project (to make sure it is the Active Project, then run this prg file).
(Updated 2011-06-10: Added a new feature that will only build new SCC text files if the DateTime of the original source file is newer than the existing SCC file. Essentially, this new version only generates a new SCC file if the VFP source file has been changed since the last time this was run.)
lnResponse = MessageBox('Run SSCText to generate ascii code files?', 3, 'Generate SCC files?')
If lnResponse <> 6
Return
EndIf
*Clear All
*Release All
Set ClassLib to && Must clear them out, cause we're about to generate ascii files of them
lnCount = DoSCCTextOnProject()
? Chr(10)+Chr(13)
? 'Done. ' + Str(lnCount) + ' files processed.'
*----------------------------------------------------------------------
Procedure DoSCCTextOnProject
Local loFile, loProject, lnCount
lcSCCText = Home(1) + 'SCCText.prg'
lnCount = 0
If !File(lcSCCText)
Messagebox('Unable to find file ' + lcSCCText, 16, 'Error')
Return 0
Endif
Try
loProject = _vfp.ActiveProject
Catch To loEx
Endtry
If Type('loEx') = 'O'
Messagebox('There are no active projects', 64, 'Error')
Return 0
Endif
lcSkipFiles = 'LIST-FILES-TO-SKIP-HERE'
For Each loFile In loProject.Files
If Inlist(loFile.Type, 'V', 'K', 'R') and ;
!InList(Upper(JustFname(loFile.name)), Upper(lcSkipFiles)) ;
and Fdate(loFile.name, 1) > SCCFileDateTime(loFile.name)
? 'Generating: ' + loFile.Name
Do (lcSCCText) With loFile.Name
lnCount = lnCount + 1
Endif
Endfor
Return lnCount
*------------------------------------------------------------------
Procedure SCCFileDateTime(tcFile)
lcSCCFilename = Upper(Strtran(Upper(tcFile), '.SCX', '.SCA'))
lcSCCFilename = Strtran(lcSCCFilename, '.VCX', '.VCA')
lcSCCFilename = Strtran(lcSCCFilename, '.FRX', '.FRA')
If File(lcSCCFilename)
Return Fdate(lcSCCFilename, 1)
Else
Return {^1900-01-01 00:00:00}
EndIf
EndProc