text:
Q: How to create an uncompressed AVI from a series of 1000's of PNG images using FFMPEG How can I create an uncompressed AVI from a series of 1000's of PNG images using FFMPEG?
I used this command to convert an input.avi file to a series of PNG frames:
ffmpeg -y -i input.avi  -an -vcodec png  -s 1024x768 pic%d.png`

Now I need to know how to make an uncompressed AVI video from all those PNG frames. I tried this:
ffmpeg -i pic%d.png -y -f avi -b 1150 -s 1024x768 -r 29.97 -g 12 -qmin 3 -qmax 13 -ab 224 -ar 44100 -ac 2 test.avi

But the resulting video loses a lot of quality relative to the original AVI.

A: There are several ways to get an "uncompressed" AVI out of ffmpeg, but I suspect you actually mean "lossless." Both terms have a fair bit of wiggle room in their definitions, as you will see.
I'm going to anchor this discussion with the 720p HD version of Big Buck Bunny, since it's a freely-available video we can all test with and get results we can compare. The raw data rate of 1280×720p video at 24 fps is very nearly equal to that of  your stated 1024×768 at 29.97 fps goal, so my results should be a pretty good guide to the data rates you can expect on your footage.
Automatic Listing of Available Options
The following POSIX command¹ gives you a list that mostly² matches what we discuss below:
$ ffmpeg -codecs 2> /dev/null | grep '^..EV..S ' | grep -vE 'bitmap|image'

You might want to run that command on your own machine to see what your build of FFmpeg will support. FFmpeg is rarely built with every possible encoder enabled.
Now let's discuss those options.
Fully Uncompressed
If your definition of "uncompressed" is the form the video is in right before it's turned to photons by a digital display, the closest I see in the ffmpeg -codecs list are -c:v r210, r10k, v410, v308, ayuv and v408. These are all substantially the same thing, differing only in color depth, color space, and alpha channel support.

*

*R210 and R10K are 4:4:4 RGB at 10 bits per component (bpc), so they both require about 708 Mbit/s for 720p in my testing. (That's about ⅓ TB per hour, friends!)
These codecs both pack the 3×10 bit color components per pixel into a 32-bit value for ease of manipulation by computers, which like power-of-2 sizes. The only difference between these codecs is which end of the 32-bit word the two unused bits are on. This trivial difference is doubtless because they come from competing companies, Blackmagic Design and AJA Video Systems, respectively.
Although these are trivial codecs, you will probably have to download the Blackmagic and/or AJA codecs to play files using them on your computer. Both companies will let you download their codecs without having bought their hardware first, since they know you may be dealing with files produced by customers who do have some of their hardware.

*V410 is essentially just the YUV version of R210/R10K; their data rates are identical. This codec may nevertheless encode faster, because ffmpeg is more likely to have an accelerated color space conversion path between your input frames' color space and this color space.
I cannot recommend this codec, however, since I was unable to get the resulting file to play in any software I tried, even with the AJA and Blackmagic codecs installed.

*V308 is the 8 bpc variant of V410, so it comes to 518 Mbit/s in my testing. As with V410, I was unable to get these files to play back in normal video player software.

*AYUV and V408 are essentially the same thing as V308, except that they include an alpha channel, whether it is needed or not! If your video doesn't use transparency, this means you pay the size penalty of the 10 bpc R210/R10K codecs above without getting the benefit of the deeper color space.
AYUV does have one virtue: it is a "native" codec in Windows Media, so it doesn't require special software to play.
V408 is supposed to be native to QuickTime in the same way, but the V408 file wouldn't play in either QuickTime 7 or 10 on my Mac.
So, putting all this together, if your PNGs are named frame0001.png and so forth:
$ ffmpeg -i frame%04d.png -c:v r10k output.mov
  ...or...                -c:v r210 output.mov
  ...or...                -c:v v410 output.mov
  ...or...                -c:v v408 output.mov
  ...or...                -c:v v308 output.mov
  ...or...                -c:v ayuv output.avi

Notice that I have specified AVI in the case of AYUV, since it's pretty much a Windows-only codec. The others may work in either QuickTime or AVI, depending on which codecs are on your machine. If one container format doesn't work, try the other.
The above commands — and those below, too — assume your input frames are already the same size as you want for your output video. If not, add something like -s 1280x720 to the command, before the output file name.
Compressed RGB, But Also Lossless
If, as I suspect, you actually mean "lossless" instead of "uncompressed," a much better choice than any of the above is Apple QuickTime Animation, via -c:v qtrle
I know you said you wanted an AVI, but the fact is that you're probably going to have to install a codec on a Windows machine to read any of the AVI-based file formats mentioned here, whereas with QuickTime there's a chance the video app of your choice already knows how to open a QuickTime Animation file. (The AYUV codec above is the lone exception I'm aware of, but its data rate is awfully high, just to get the benefit of AVI.)
ffmpeg will stuff qtrle into an AVI container for you, but the result may not be very widely compatible. In my testing, QuickTime Player will gripe a bit about such a file, but it does then play it. Oddly, though, VLC won't play it, even though it's based in part on ffmpeg. I'd stick to QT containers for this codec.
The QuickTime Animation codec uses a trivial RLE scheme, so for simple animations, it should do about as well as Huffyuv below. The more colors in each frame, the more it will approach the bit rate of the fully uncompressed options above. In my testing with Big Buck Bunny, I was able to get ffmpeg to give me a 165 Mbit/s file in RGB 4:4:4 mode, via -pix_fmt rgb24.
Although this format is compressed, it will give identical output pixel values to your PNG input files, for the same reason that PNG's lossless compression doesn't affect pixel values.
The ffmpeg QuickTime Animation implementation also supports -pix_fmt argb, which gets you 4:4:4:4 RGB, meaning it has an alpha channel. In a very rough sort of way, it is the QuickTime equivalent to -c:v ayuv, mentioned above. Because of the lossless compression, though, it comes to only 214 Mbit/s, less than ⅓ the data rate of AYUV with zero loss in quality or features.
There are variants of QuickTime Animation with fewer than 24 bits per pixel, but they're best used for progressively simpler animation styles. ffmpeg appears to support only one of the other formats defined by the spec, -pix_fmt rgb555be, meaning 15 bpp big-endian RGB. It's tolerable for some video, and is fine for most screencast captures and simple animations. If you can accept the color space decimation, you may find its 122 Mbit/s data rate appealing.
Putting all this together:
$ ffmpeg -i frame%04d.png -c:v qtrle -pix_fmt rgb24    output.mov
  ...or...                           -pix_fmt argb     output.mov
  ...or...                           -pix_fmt rgb555be output.mov

Effectively Lossless: The YUV Trick
Now, the thing about RGB and 4:4:4 YUV is that these encodings are very easy for computers to process, but they ignore a fact about human vision, which is that our eyes are more sensitive to black and white differences than color differences.
Video storage and delivery systems therefore almost always use fewer bits per pixel for color information than for luminance information. This is called chroma subsampling. The most common schemes are 4:2:0 and 4:2:2.
The data rate of 4:2:0 YUV is just 50% higher than for black and white (Y only) uncompressed video and ½ the data rate of 4:4:4 RGB or YUV.
4:2:2 is a kind of halfway point between 4:2:0 and 4:4:4. It is twice the data rate of Y-only video and ⅔ the data rate of 4:4:4.
You also sometimes see 4:1:1, as in the old DV camera standard. 4:1:1 has the same uncompressed data rate as 4:2:0, but the color information is arranged differently.
The point of all this is that if you're starting with a 4:2:0 H.264 file, re-encoding it to 4:4:4 uncompressed RGB buys you absolutely nothing over 4:2:0 losslessly compressed YUV. This is true even if you know your workflow is otherwise 4:4:4 RGB, since it's a trivial conversion; video hardware and software do such conversions on the fly routinely.
You really only need 4:4:4 when you're pixel peeping or you're doing pixel-level color changes on the video, and you need to preserve exact pixel values. Visual effects (VFX) work is easier to do with a 4:4:4 pixel format, for example, so high-end VFX houses are often willing to tolerate the higher data rates it requires.
Effectively Lossless: Codec Choices
Once you open yourself up to YUV codecs with color decimation, your options open up, too. ffmpeg has many effectively lossless codecs.
Huffyuv
The most widely compatible option is Huffyuv. You get this via -c:v huffyuv.
The original Windows Huffyuv codec only supports two pixel formats: RGB24 and YUV 4:2:2. (Actually, it supports two flavors of YUV 4:2:2, differing only in the order of the bytes on disk.)
Older versions of the FFmpeg Huffyuv codec did not include RGB24 support, so if you try it and FFmpeg tells you it is going to use the yuv422p pixel format, you need to upgrade.
FFmpeg also has a Huffyuv variant codec called FFVHuff, which supports YUV 4:2:0. This variant isn't compatible with the Windows DirectShow Huffyuv codec, but it should open in any software based on libavcodec, such as VLC.

*

*RGB24 — RGB 4:4:4 is essentially the same thing as QuickTime Animation's RGB24 color space option. The two codecs will differ somewhat in compression for a given file, but they will usually be close.
It is also essentially the same thing as the YUV 4:4:4 mode used by the V308 option above. The color space difference makes no practical difference, since the color space conversion is easy to do in real time.
Due to Huffyuv's lossless compression, I was able to get a test video to compress to about 251 Mbit/s in RGB24 mode, with identical visual quality to what you'd get from V308 or AYUV. If AVI is an absolute must for you, installing the Huffyuv codec is probably less painful than paying the 3× data rate cost of AYUV.

*YUV 4:2:2 — This mode is far more practical for video than RGB24, which is doubtless why the ffmpeg developers chose to implement it first. As you'd expect from the theoretical ⅔ reduction discussed above, my test file encoded to 173 Mbit/s. That's pretty much exactly ⅔, if you take into account the fact that the audio track was unchanged between these two tests.

*YUV 4:2:0 — This option decimates the color information more than 4:2:2 does, dropping the data rate to 133 Mbit/s in my testing.
Putting all this together:
$ ffmpeg -i frame%04d.png -c:v huffyuv -pix_fmt rgb24   output.avi
  ...or...                             -pix_fmt yuv422p output.avi
  ...or...                -c:v ffvhuff -pix_fmt yuv420p output.avi

Although the ffvhuff codec defaults to 4:2:0 as I write this, and indeed only supports that pixel format in the release version I'm using, this is changing, so you should include the flag in case this default changes.
Ut Video
A more recent option in the same spirit as Huffyuv and FFVHuff is Ut Video. Like Huffyuv, there is a Windows video codec which means any Windows program that can play a movie can play videos using this codec with the codec installed. Unlike Huffyuv, there is also a Mac video codec as well, so you aren't restricted to software based on FFmpeg or libavcodec to read these files on Macs.
This codec is very flexible in terms of color spaces, so I will just give a few examples of common color spaces:

*

*4:4:4 RGB via -f avi -c:v utvideo -pix_fmt rgb24 gives 178 Mbit/sec output

*4:4:4 YUV via -f avi -c:v utvideo -pix_fmt yuv444p gives 153 Mbit/sec output

*4:2:2 YUV via -f avi -c:v utvideo -pix_fmt yuv422p gives 123 Mbit/sec output

*4:2:0 YUV via -f avi -c:v utvideo -pix_fmt yuv420p gives 100 Mbit/sec output
I suspect 4:4:4 YUV does better than 4:4:4 RGB in this test despite these two being technically equivalent because the source video is 4:2:0 YUV, so arranging the data in YUV format allows for better lossless compression by grouping the partially-redundant U and V channels together in the file.
FFV1
Another interesting option in this space is FFmpeg's own FFV1 codec. This is mostly used as an archival codec rather than a playback or editing codec, but since so much software is either based on the libavcodec library underpinning FFmpeg or can be lashed to libavcodec via tools like ffdshow, it may be useful to you anyway.
By default, ffmpeg will preserve your input files' color space when using a flexible codec like FFV1, so that if you feed it one of the official Big Buck Bunny MP4 files, which use 4:2:0 YUV, that's what you'll get out unless you give a -pix_fmt flag to ffmpeg. This results in a 63 Mbit/s output file.
If you force FFV1 to use a 4:4:4 YUV color space with -pix_fmt yuv444p, the file size only goes up to 86 Mbit/sec, but it's buying us nothing in this case since we're encoding from a 4:2:0 original. However, if you feed in a set of PNGs instead, as in the original question, the output file is likely to use the bgra or bgr0 color space, which are just rearrangements of the argb and rgb24 color spaces brought up above.
Lossless H.264
Another interesting alternative is Lossless H.264. This is pretty much an x264-only thing as of this writing, but those using FFmpeg on the encoding side are likely to be using other software that includes libx264 on the decoding side, too, such as VLC.
The simplest way to get such a file is:
$ ffmpeg -i frame%04d.png -c:v libx264 -qp 0 -f mp4 output.mp4

The -qp 0 flag is the key: higher values give lossy compression. (You can also give -crf 0 to get the same effect.)
As with FFV1, ffmpeg will try to guess the best output color space given the input color space, so for comparison to the results above, I ran multiple encode passes on the Big Buck Bunny source file with different color spaces:

*

*yuv444p: This is what ffmpeg chooses when you give it an RGB PNG stream, as in the original question, and results in a 44 Mbit/sec file with our test file

*yuv422p: This is similar to the default color space for Huffyuv, but we get a 34 Mbit/sec file in this case, quite a savings!

*yuv420p: This is the default for the Big Buck Bunny official MP4s  I'm testing with, and results in a 29 Mbit/sec file.
Beware that you're trading a lot of compatibility to get such small file sizes. That's why I didn't even bother trying to stuff this into an AVI or MOV container. It's so closely tied to x264 that you might as well use its standard container type (MP4) instead. You could also use something like Matroska for this.
You can trade off some of that bit rate for a faster encoding time by adding -preset ultrafast. That increased my test file's bit rate to 44 Mbit/s in YUV 4:2:2 mode, but encoded much faster, as promised. The docs claim that -preset veryslow is also worthwhile, but it resulted in a much longer encode time while only saving a tiny bit of space; I can't recommend it.
Others
ffmpeg also supports decode-only mode for Lagarith and encode-only mode for Lossless JPEG. These two codecs are actually somewhat similar, and should give files a bit smaller than Huffyuv with the same quality. If the ffmpeg developers ever add Lagarith encoding, it would be a strong alternative to Huffyuv. I cannot recommend Lossless JPEG, though, since it doesn't enjoy wide decoding support.
Perceptually Lossless: Or, You Can Probably Get Away With Some Loss
Then there are the codecs that are perceptually lossless. Unless you're pixel peeping, you almost certainly cannot tell that these give different visual results than the previous two groups. By giving up on the idea of absolutely zero change between the video capture sensor and the display device, you buy considerable savings:

*

*Apple ProRes: -c:v prores or -c:v prores_ks — ProRes is a profile-based codec, meaning that there are several variants, each with a different quality vs. space tradeoff:

*

*ProRes 4444 encodes our test video using only 114 Mbit/s, yet is VFX quality. There are currently three different prores* codecs in FFmpeg, but only prores_ks supports ProRes 4444, as I write this, via the -profile:v 4444 option.
If you're wondering why you'd bother going with ProRes 4444 over Lossless H.264, it comes down to compatibility, decoding speed, predictability, and the alpha channel.

*ProRes 422 saves even more space, needing only 84 Mbit/s to give a result you can tell from ProRes 4444 only by pixel-peeping. Unless you need the alpha channel offered by ProRes 4444, there's probably no reason to insist on ProRes 4444.
ProRes 422 is a closer competitor to the Lossless H.264 option above, since neither supports an alpha channel. You'll want to tolerate the higher bit rate of ProRes if you need compatibility with Apple pro video apps, a lower CPU overhead for encoding and decoding, or predictable bit rates. The latter is important with hardware encoders, for example. On the other hand, if you can cope with the compatibility problems of Lossless H.264, you get the option of using the 4:2:0 color space, which isn't an option from any ProRes profile.
All three of the ProRes encoders in FFmpeg support the ProRes 422 profile, so the simplest option is to use -c:v prores, rather than -c:v prores_ks -profile hq, or depend on the auto-profile feature of prores_ks to do the right thing.
There are even more parsimonious ProRes profiles, but they're meant for either SD video or as proxies for full-res files.
The main problem with ProRes is that it doesn't yet have wide support outside the Apple and pro video worlds.

*Avid's DNxHD is a similar codec to ProRes, but isn't tied to the Apple pro video world. Avid offers freely-downloadable codecs for both Windows and Macintosh, and FFmpeg now supports it via -c:v dnxhd.
Because DNxHD is a profile-based codec like ProRes, you choose the profile from the predefined set, and that tells the codec which frame size, frame rate, and bit rate to use. For the Big Buck Bunny test file, the -b:v 60M profile is most appropriate. Unsurprisingly, the resulting file is about 59 Mbit/s.

*Low-loss MJPEG: -vcodec mjpeg -qscale:v 1 — This is far more common than lossless JPEG. In fact, this was once a quite common video editing codec, and it's still frequently used by things like networked streaming video cameras. All that history means it is easy to find software that supports it.
Expect pretty wide variability in data rates from this codec. A test I just made here gave me 25 Mbit/s for 720p video. That's high enough compression to make me nervous about lossiness, but it looked pretty good to me. Based on data rate alone, I'd say it's probably on par quality-wise to 12 Mbit/s MPEG-2 or 6 Mbit/s H.264.
Putting all this together:
$ ffmpeg -i frame%04d.png -c:v prores_ks -profile:v 4444 output.mov
  ...or...                -c:v prores_ks -profile:v hq   output.mov
  ...or...                -c:v prores                    output.mov
  ...or...                -c:v dnxhd -b:v 60M            output.mov
  ...or...                -c:v mjpeg -qscale:v 1         output.avi

Bottom line on these methods is that unless you're doing something very demanding, "good enough" really is good enough.

Footnotes and Digressions

*

*The command should work as-given on Linux, macOS, the BSDs, and Unix. If you're on Windows, you can get a POSIX command line via Cygwin or WSL.

*There are several reasons why the list produced by that command doesn't perfectly match the set of codecs I've chosen to discuss above:

*

*The second grep is meant to filter out inappropriate encoders like bmp which are not "video" codecs, despite being tagged V in this list. While technically you could probably stuff many of these into a container like AVI, MP4, or MKV to get a single-file video, that file won't likely be readable by anything but a program based on ffmpeg or libavcodec.
There are a few exceptions to this, such as that -f avi -c:v ljpeg gives something you could call "Lossless MJPEG," but as a rule, we're not interested in stuffing many still-image files into an A/V container here to make a movie. We want widely-recognized video codecs here, not semantic trickery.

*The command currently fails to filter out some inappropriate encoders such as GIF because they are not currently described in the ffmpeg -codecs output as bitmap or image file formats.
GIF is an interesting case: it supports multiple image frames in a single GIF file with timing information for motion playback, but for several reasons, it is entirely inappropriate to our discussion here.

*A few of the options that are shown are obsolete or never really got much traction, such as flashsv, dirac, and snow, so it's not worth discussing them above.

*Some of the options in that list are meant only for use in pipelines between ffmpeg instances or between ffmpeg and another program, such as rawvideo and wrapped_avframe, and so are inappropriate for our purposes here.

*Near the end of the discussion above, I judiciously expand the scope of the question a bit to include a few carefully chosen lossy options, so they don't pass the first grep filter in the above command.

A: So I ended up making my own answer too long.
TL;DR summary: For losslessly storing a sequence of images, use libx264 or libx264rgb with -preset ultrafast -qp 0.  It's nearly as fast as ffvhuff, with much lower bitrate, and decodes faster.  huffyuv is much more widely supported outside of ffmpeg, but doesn't support as many pixel formats as ffvhuff.  So that's another reason to use h.264, assuming your other tools can handle the h.264 High 4:4:4 Predictive profile that x264 uses in lossless mode.  x264 can do intra-only if fast random access to arbitrary frames is needed.
Beware of a ffmpeg bug affecting libx264rgb when reading from a directory of images.  (and who knows what other cases.)  Test for losslessness in your setup before using.  (easy with ffmpeg -i in -pix_fmt rgb24 -f framemd5 on source and lossless-compressed))
edit: utvideo encodes and decodes fairly fast, and is a much simpler codec than h.264.  It's basically a modern huffyuv, with support for more useful colorspaces.  If you ever have a problem with h.264, try utvideo next for temporary files.
edit2: PNG as a RGB codec appears to do well, at least on the Sintel trailer.
See also my similar answer to a similar question:
https://superuser.com/a/860335/20798
There's a lot of info in the Warren Young's answer about various raw formats and codecs.  I think the answer would be more useful if it was shorter, so I'm making a new answer.  If you're working with software that doesn't support lossless x264 or ffvhuff, then some of that info is probably still useful.
The most useful definition of "lossless" in this context is that you can recover the input bit-for-bit.  Zero worry about quality degradation from video encoding, regardless of what you do.
http://en.wikipedia.org/wiki/Chroma_subsampling
Ideally, avoid multiple colorspace conversions.  The rounding errors can potentially build up.   If you're going to operate on your video with filters that work in the RGB colorspace, then keeping it RGB makes sense, as long as the higher bitrates aren't an issue.  You're probably going to ultimately produce a yuv 4:2:0 video, but keeping the extra chroma resolution is potentially useful, depending on what filters you're going to apply.
Either way, lossless x264 and ffvhuff both support RGB and yuv 4:4:4, 4:2:2, and 4:2:0.  I'd suggest x264, as it's fast to decode.  If you're trying to play back RGB HD video in realtime, try opengl instead of xv, since xv on my system only accepts yuv input.  mplayer was taking extra CPU time to do a color-space conversion.
Source for the following encoder tests: https://media.xiph.org/.  https://media.xiph.org/sintel/sintel_trailer-1080-png.tar.gz  They forgot to gzip the y4m files for the sintel trailer, so the png tarball is actually a lot smaller.
ffmpeg -i 1080/sintel_trailer_2k_%4d.png -i sintel_trailer-audio.flac \
-c:a copy -c:v libx264rgb -preset ultrafast -qp 0 \
frompng.sintel.264rgb.mkv

e.g.
peter@tesla:/mnt/GP1TB/p/encoder-sample/sintel$ time ffmpeg -i 1080/sintel_trailer_2k_%4d.png -i sintel_trailer-audio.flac -c:a copy -c:v libx264rgb -preset ultrafast -qp 0 frompng.sintel.264rgb.mkv
ffmpeg version N-67983-g2b358b4 Copyright (c) 2000-2015 the FFmpeg developers
  built on Jan 10 2015 05:32:37 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --enable-gpl --enable-version3 --enable-nonfree --disable-doc --disable-ffserver --enable-libx264 --enable-libx265 --enable-libmp3lame --enable-libopus --enable-libwebp --enable-libvpx --disable-outdev=oss --disable-indev=oss --disable-encoder=vorbis --enable-libvorbis --enable-libfdk-aac --disable-encoder=aac --disable-decoder=jpeg2000
  libavutil      54. 16.100 / 54. 16.100
  libavcodec     56. 20.100 / 56. 20.100
  libavformat    56. 18.100 / 56. 18.100
  libavdevice    56.  3.100 / 56.  3.100
  libavfilter     5.  7.100 /  5.  7.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, image2, from '1080/sintel_trailer_2k_%4d.png':
  Duration: 00:00:50.12, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: png, rgb24, 1920x1080 [SAR 72:72 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #1, flac, from 'sintel_trailer-audio.flac':
  Duration: 00:00:52.00, start: 0.000000, bitrate: 721 kb/s
    Stream #1:0: Audio: flac, 48000 Hz, stereo, s16
File 'frompng.sintel.264rgb.mkv' already exists. Overwrite ? [y/N] y
No pixel format specified, rgb24 for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264rgb @ 0x2770760] using SAR=1/1
[libx264rgb @ 0x2770760] using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
[libx264rgb @ 0x2770760] profile High 4:4:4 Predictive, level 4.0, 4:4:4 8-bit
[libx264rgb @ 0x2770760] 264 - core 144 r2525+2 6a4fca8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=0 chroma_qp_offset=0 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=cqp mbtree=0 qp=0
Output #0, matroska, to 'frompng.sintel.264rgb.mkv':
  Metadata:
    encoder         : Lavf56.18.100
    Stream #0:0: Video: h264 (libx264rgb) (H264 / 0x34363248), rgb24, 1920x1080 [SAR 72:72 DAR 16:9], q=-1--1, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.20.100 libx264rgb
    Stream #0:1: Audio: flac ([172][241][0][0] / 0xF1AC), 48000 Hz, stereo (16 bit)
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> h264 (libx264rgb))
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 1253 fps= 18 q=-1.0 Lsize=  834790kB time=00:00:51.96 bitrate=131592.5kbits/s
video:830198kB audio:4575kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.002025%
[libx264rgb @ 0x2770760] frame I:6     Avg QP: 0.00  size:612470
[libx264rgb @ 0x2770760] frame P:1247  Avg QP: 0.00  size:678787
[libx264rgb @ 0x2770760] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264rgb @ 0x2770760] mb P  I16..4: 50.3%  0.0%  0.0%  P16..4: 12.0%  0.0%  0.0%  0.0%  0.0%    skip:37.6%
[libx264rgb @ 0x2770760] coded y,u,v intra: 71.1% 68.2% 70.0% inter: 22.8% 22.8% 23.2%
[libx264rgb @ 0x2770760] i16 v,h,dc,p: 50% 48%  1%  1%
[libx264rgb @ 0x2770760] kb/s:135693.94

Note that I forgot to specify -r 24 fps, so it won't keep av sync with the audio.  (and the bitrate (but not file size) numbers will be off, too.  ffmpeg defaults to 25fps).  CPU in this machine is a 1st-gen (conroe) core2duo 2.4GHz (E6600).
results:
4.5M    sintel_trailer-audio.flac  # this is muxed in to every mkv
948M    1080  # the directory of PNGs
940M    /var/tmp/dl/sintel_trailer-1080-png.tar.gz
7434M   sintel.y4m  # yuv444, uncompressed.  mplayer gets the colors wrong?
2342M   qtrle.mkv   # encode went at 16fps, so qtrle is slower and worse filesize
2105M   sintel.huff.mkv  # ffvhuff with default options, rgb pix fmt
1228M    sintel.utvideo.mkv  # muxed without audio, I should update the others this way
946M    png-copy.mkv  # -codec copy makes a MPNG stream.  Use -codec png for non-png sources, but it won't make PNGs as small.  Decodes very fast
824M    lossy.prores_ks.mov # yuv444p10le extremely slow to encode (2.3fps), and worse bitrate.
816M    frompng.sintel.264rgb.mkv
735M    sintel.x264rgb.medium.nocabac.mkv  # encode went at 3.3 fps instead of 18.  Better gain than for live-action, though
626M    sintel_trailer.rgb.lossless.veryslow.mkv # 1.1fps.  With CABAC, 16 ref frames, etc. etc.
512M    lossy.prores.mov # yuv422p10le, 12fps
341M    sintel.yuv420.x264.lossless.mkv
21M     lossy.rgb.crf26.preset=medium.mkv
13M     lossy.yuv420.crf26.preset=medium.mkv  # remember this is WITH 4.5MB audio

Note that mediainfo doesn't know about RGB h.264, it still says that the files are YUV.
Check that it really was lossless:
ffmpeg -i 1080/sintel_trailer_2k_%4d.png -f framemd5 png.framemd5
ffmpeg -i fromhuff.sintel.264rgb.mkv -an -sn -pix_fmt rgb24  -f framemd5 x264rgb.framemd5
diff -s *.framemd5
Files png.framemd5 and x264rgb.framemd5 are identical

So you can recover the original PNG input that way, i.e. you could make PNGs with identical image data in them.
Note the -pix_fmt rgb24 for the x264 test.  ffmpeg's h.264 decoder outputs gbrp (planar, not packed) output, so the bits are the same, but in a different order.  The framemd5 "container" doesn't impose any sort of format restrictions, but you'll only get the same md5 if the bits are arranged the same way.  I just looked at what ffmpeg said it was using for a pix fmt when I fed it PNGs, then used that as the arg to -pix_fmt for decode.  Incidentally, this is the reason vlc won't play RGB h.264 files (until next release, or current nightly builds): It doesn't support the gbrp pixel format.
For yuv use libx264, not libx264rgb.  You don't need to install an RGB version of x264, the actual library supports both.  It's just ffmpeg that implemented it as two differently named encoders.  I think if they hadn't done that, the default behaviour would be to leave rgb input as rgb, and run really slowly while producing much higher bitrate output for the same quality.  (you still sometimes have to use -pix_fmt yuv420p if you want 420 instead of 444 h.264 output.
Unless you are making files for long-term storage, always use -preset ultrafast for lossless x264.  More reference frames and motion search barely makes any difference for lossless, for non-animated material with any noise.  CABAC takes a huge amount of CPU at lossless bitrates, even to decode.  Only use for archival purposes, not scratch files.  (ultrafast disables CABAC).  CABAC gives 10 to 15% bitrate savings.
If you need every frame to be a keyframe, set -keyint 1.  Then video editing software that only wants to cut on keyframes or w/e will not limit you.
To answer the original question:  This is what you should do for throwing around temporary files while trying things in stages (e.g. a slow deinterlace, saving lossless output before trying other things):
ffmpeg -i dv-video-source.ts -vf yadif=2:1,mcdeint=3:1:10 -c:a copy -c:v libx264 -preset ultrafast -qp 0 deinterlaced.mkv
If you really need your output in image files that you can modify with still-image tools, then sure, decode to png.  You're not going to lose anything more than maybe the least significant of the 8 bits of for each of the Y, Cb, and Cr values for each pixel.
x264 comes out REALLY well in this because there are a lot of black frames with a bit of text, a fade-in and fade-out, and perfect similarity between big areas of many frames, which it manages to take advantage of even with -preset ultrafast.  On live-action, I still see x264 at half the filesize of ffvhuff (yuv420).
For anyone curious: The high-cpu-time lossless rgb encode had (x264 core 144 r2525):
[libx264rgb @ 0x35b97a0] frame I:27    Avg QP: 0.00  size:604367
[libx264rgb @ 0x35b97a0] frame P:1226  Avg QP: 0.00  size:517512
[libx264rgb @ 0x35b97a0] mb I  I16..4..PCM: 46.3% 38.1% 15.7%  0.0%
[libx264rgb @ 0x35b97a0] mb P  I16..4..PCM: 24.3%  5.4%  4.5%  0.0%  P16..4: 10.5%  3.3%  5.7%  0.0%  0.0%    skip:46.3%
[libx264rgb @ 0x35b97a0] 8x8 transform intra:17.3% inter:46.1%
[libx264rgb @ 0x35b97a0] coded y,u,v intra: 81.6% 77.5% 80.0% inter: 28.0% 27.7% 28.1%
[libx264rgb @ 0x35b97a0] i16 v,h,dc,p: 35% 64%  1%  0%
[libx264rgb @ 0x35b97a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 49% 13%  2%  1%  1%  1%  1%  1%
[libx264rgb @ 0x35b97a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 31% 37%  5%  5%  6%  5%  5%  4%  3%
[libx264rgb @ 0x35b97a0] Weighted P-Frames: Y:41.1% UV:40.7%
[libx264rgb @ 0x35b97a0] ref P L0: 74.5%  4.2%  9.1%  4.1%  2.1%  1.7%  1.2%  0.8%  0.6%  0.5%  0.3%  0.2%  0.2%  0.2%  0.2%  0.1%
[libx264rgb @ 0x35b97a0] kb/s:99721.66

Note the really high fraction of weighted p frames, and also the really high fraction of skip macroblocks.  Every scene transition is a fade, not a cut, and x264 takes advantage if you give it the CPU time to figure out how.
further notes (lossy codecs for editting):
For scrubbing forwards/backwards through clips, intra-only codecs are usually favoured (utvideo, ffvhuff, mjpeg, jpeg2000, pro-res, AVC-Intra).  I'd imagine regular AVC with short GOPs (1/2 to 1 sec) would scrub pretty well, too, as long as the software knew what it was doing (decode nearest I frame when scrubbing fast, decode within the GOP to get to an inter frame if you're zoomed in enough on a timeline for that to be needed).
I've posted some negative things on this and https://video.stackexchange.com/ about pro-res, like "what's the point if it's slower and worse compression than a lossless codec", but it does have some interesting features.  Apple says that it can decode at half-resolution using as little as 1/3 the CPU time of decoding full rez.
ffmpeg's prores implementation is probably not as optimized for speed as Apple's either, which is why my testing with ffmpeg has made it look slow.  It's probably not worth using if you have a Free software workflow with tools based on ffmpeg, but it might be worth trying if you're using commercial software.
I don't do a lot of video editting, mostly just encoding, so I don't have a good sense of what tests would be appropriate for codecs like prores.  I'd guess that maybe mjpeg would be a good fast alternative, if short-GOP x264 doesn't work well.  There are asm-accelerated implementations of jpeg in Linux distros, and it's a pretty simple codec.  You can turn the quality up or down as needed to trade off quality vs. filesize + encode/decode speed.  It's ancient, but if you want an intra-only codec that's really fast, it might beat x264.
For x264, I'd try something like x264 --crf 10 --keyint=1 --preset superfast --tune fastdecode  (Intra-only, without any of the other stuff that --avcintra-class sets.)  Note superfast (without CABAC), or faster, not ultrafast is probably best for lossy operation.  I think ultrafast loses a lot of quality without being that much faster.  The lower quality (higher crf) you use, the more it's worth spending a bit more CPU time finding a better encode.  A lot of this probably isn't relevant with GOP size = 1, though.
With GOP size > 1, if you're throwing so many bits at the encode that better inter-prediction won't save many bits when encoding the residuals (because noise / grain / subtle changes between frames are getting preserved very accurately), then just superfast is probably fine.  Otherwise, with --keyint=30 or something, probably --preset veryfast --crf 12 would be interesting.
In theory, quality at a given CRF setting should be constant across presets.  If you're looking for smaller files (faster decodes), trading off some quality and some encode time makes sense.

A: I think ffmpeg actually does support converting to uncompressed video.

I used ffmpeg -i input.mp4 -vcodec rawvideo out.avi
and the resulting .avi was roughly the right filesize. Windows media player didn't seem to be able to play it correctly but it could be read by VirtualDub and I did not see any loss in picture quality.


text:
Q: Gigantic error for Rust hello world I'm very new to Rust. It seems to be a very interesting language, but when I compile a simple hello world program, I get a gigantic error. This is the error I'm getting:
note: "cc" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "hello.0.o" "-o" "hello" "-Wl,-force_load,/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a" "-Wl,-dead_strip" "-nodefaultlibs" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libstd-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcollections-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librustc_unicode-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librand-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liballoc-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liblibc-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcore-198068b3.rlib" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-L" "/Users/<removed>/Documents/cringe/.rust/lib/x86_64-apple-darwin" "-L" "/Users/<removed>/Documents/cringe/lib/x86_64-apple-darwin" "-l" "System" "-l" "pthread" "-l" "c" "-l" "m" "-l" "compiler-rt"
note: couldn't understand kern.osversion `14.5.0'
ld: warning: directory not found for option '-L/Users/<removed>/Documents/cringe/.rust/lib/x86_64-apple-darwin'
ld: warning: directory not found for option '-L/Users/<removed>/Documents/cringe/lib/x86_64-apple-darwin'
Undefined symbols for architecture x86_64:
  "__Unwind_GetLanguageSpecificData", referenced from:
      ___gcc_personality_v0 in libcompiler-rt.a(gcc_personality_v0.o)
  "__Unwind_GetIP", referenced from:
      ___gcc_personality_v0 in libcompiler-rt.a(gcc_personality_v0.o)
  "__Unwind_SetIP", referenced from:
      ___gcc_personality_v0 in libcompiler-rt.a(gcc_personality_v0.o)
  "__Unwind_DeleteException", referenced from:
      rt::lang_start::hd654f015947477d622w       in libstd-198068b3.rlib(std-198068b3.0.o)
  "__Unwind_RaiseException", referenced from:
      rt::unwind::imp::panic::h3a53abf3818f0dd1jqw    in libstd-198068b3.rlib(std-198068b3.0.o)
  "__Unwind_SetGR", referenced from:
      ___gcc_personality_v0 in libcompiler-rt.a(gcc_personality_v0.o)
  "__Unwind_GetIPInfo", referenced from:
      sys::backtrace::write::trace_fn::h510f8e821e33fb3fMus    in libstd-198068b3.rlib(std-198068b3.0.o)
  "__Unwind_Backtrace", referenced from:
      sys::backtrace::write::h71ee98355e9ff89fUss     in libstd-198068b3.rlib(std-198068b3.0.o)
  "__Unwind_GetRegionStart", referenced from:
      ___gcc_personality_v0 in libcompiler-rt.a(gcc_personality_v0.o)
  "__Unwind_Resume", referenced from:
      error::Box$LT$Error$u2b$$u20$Send$u20$$u2b$$u20$Sync$u20$$u2b$$u20$$u27$a$GT$.From$LT$$RF$$u27$b$u20$str$GT$::from::haef03d11abb0506f6da       in libstd-198068b3.rlib(std-198068b3.0.o)
      thread..Inner::drop.33811::h2d4ce2ad919a880a        in libstd-198068b3.rlib(std-198068b3.0.o)
      sys_common::thread_info::current_thread::h002e72f07e6510beVwr        in libstd-198068b3.rlib(std-198068b3.0.o)
      thread::Thread::new::h823fd9fbff518de4EBb     in libstd-198068b3.rlib(std-198068b3.0.o)
      rt::unwind::begin_unwind_inner::h1a353d5ea12e1abeVBw      in libstd-198068b3.rlib(std-198068b3.0.o)
      rt::unwind::begin_unwind_fmt::h523af64a13dd33d21Aw      in libstd-198068b3.rlib(std-198068b3.0.o)
      sys::os::getenv::hdf9b4093693c98ceLLu     in libstd-198068b3.rlib(std-198068b3.0.o)
      ...
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

error: aborting due to previous error

This is the program:
fn main() {
    println!("Hello, World!");
}

I'm on OS X 10.10.5 (14F27). My Rust version is rustc 1.3.0 (9a92aaf19 2015-09-15)

A: Try to install libpq-dev, libpq-devel, gcc-multilib, postgresql-devel
(Install them by your own package manager, Sometimes package names differ depending on your platform, so do a quick google search "if doesn't work")
If none of these solutions work:
Try:
rustup self uninstall and reinstall it by: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

redpajama_set_name: RedPajamaStackExchange


text:
Q: Please check if there is anything wrong with this proof. Please check the following proof.
Consider the function $f[a,b] \to \mathbb{R}$
Theorem :
$f[a,b] \to \mathbb{R}$ is continuous
$\implies$
$\forall \epsilon > 0$, $\exists \ \text{partition of}\ [a,b]$ $\ni (\forall\ \text{subinterval}) \ (\text{span } f < \epsilon)$
Proof:
$f[a,b] \to \mathbb{R}$ is continuous
$\implies$ $f$ is continuous at $a$
$\implies$ $\forall\ \epsilon>0$, $\left(\exists\ \delta \right) \left(-\delta < a-x < \delta\ \Rightarrow \dfrac{\epsilon}{2} < f(a)-f(x) < \dfrac{\epsilon}{2}\right)$
$\implies \left(\exists\ \delta_1\right) \left(-\delta_1 < a-x < \delta_1\ \Rightarrow -\dfrac{\epsilon_0}{2} < f(a)-f(x) < \dfrac{\epsilon_0}{2}\right)$
$\implies \left(\exists\ \delta_1\right) \left(x \in (a-\delta_1,a+\delta_1) \Rightarrow -\dfrac{\epsilon_0}{2} < f(a)-f(x) < \dfrac{\epsilon_0}{2}\right)$
$\implies$ $\left( -\dfrac{\epsilon_0}{2} < f(a)-f(x_{S1}) < \dfrac{\epsilon_0}{2} \right)   \land    \left(  -\dfrac{\epsilon_0}{2} < f(x_{B1})-f(a) < \dfrac{\epsilon_0}{2}  \right)$
$\implies$ $\left( 0 < f(a)-f(x_{S1}) < \dfrac{\epsilon_0}{2} \right)   \land    \left(  0 < f(x_{B1})-f(a) < \dfrac{\epsilon_0}{2}  \right)$
$\implies$ $0 < f(x_{B1})-f(x_{S1}) < \epsilon_0$
$\implies$ span $f$ in $ (a-\delta_1,a+\delta 1 < \epsilon_0$
$\implies$ span $f$ in $ (a,a+\delta_1)=$ span $f$ in $ (a,a_1) < \epsilon_0$
Similarly:
span $f$ in $ (a_0,a_1) < \epsilon_0$
span $f$ in $ (a_1,a_2) < \epsilon_0$
span $f$ in $ (a_2,a_3) < \epsilon_0$
.....
span $f$ in $ (a_{(i-1)} ,a_i) < \epsilon_0$
span $f$ in $ (a_i,a_{(i+1)} ) < \epsilon_0$
where:
$a_i \in [a,b]$
$a_{(i+1)} \notin [a,b]$
Thus we see for partition $P_{[a,b]}=\{a=a_0, a_1, a_2,...,a_i, b \}$
$(\forall\ \text{subinterval}) \ (\text{span } f < \epsilon_0)$
Analogously $\forall\ \epsilon > 0$, we can make a partition of $[a,b] \ni (\forall\ \text{subinterval}) \ (\text{span } f < \epsilon)$
Please tell whether there are any mistakes in the above proof.

A: There is an issue with your proof. Why can you state that $b$ will be reached in a finite number of steps? "The $\delta_i$ may become smaller and smaller".
For example the map
$$\begin{array}{l|rcl}
f : & [0,1) & \longrightarrow & \mathbb R \\
    & x & \longmapsto & \frac{1}{1-x}
\end{array}$$
is continuous but you won't be able to reach $1$ in a finite number of steps.
The compactness of $[a,b]$ has to come into play somewhere in proof of your theorem.


text:
Q: How can i access to a property of class before its value sets first time i know the "IFirePropertyChanged" interface.
But i dont know something like "IFirePropertyBeforeChange".
is there exists?

A: INotifyPropertyChanging.  Note this was introduced only in .NET 3.5, and may not be widely supported by frameworks.


text:
Q: need to extract zip files having spaces in filename i need to use windows command prompt to unzip files. I have files with spaces in the file name which is not supported.
i am using command ::
v: 7za.exe xyz ac.zip for zip file "xyz ac.zip"
v: unrar.exe abc y.rar for rar file "abc y.rar"

A: You've almost answered yourself - put the filename in quotes!
Look at the end of your line:
7za.exe xyz ac.zip for zip file "xyz ac.zip"

Also the paths should be given - you have three options:
1. cd to the directory where 7za.exe file is and alter the command to have full path to "xyz ac.zip".
2. cd to the directory where "xyz ac.zip" file is and alter the command to have full path to 7za.exe.
3. Add 7za.exe folder to system path, cd to the directory where "xyz ac.zip" file is and execute your command unmodified.


text:
Q: Theta vs. Omega I'm trying to understand time complexity.
If you have an algorithm with a running time of θ(n^2), is it possible to have a best case running time of Ω(n)? Or is the fastest running time only some constant factor c * n^2?

A: Theta is a tight bound, meaning that it represents the worst case and the best case. So in your case, the fastest running time will be a constant of the tight bound.


text:
Q: Angular controller on DOm that changes First of all, I'm using jQuery-Smart-Wizard.
When I put it into my code:
$('#wizard_verticle').smartWizard({
    transitionEffect: 'slide'
});

this is supposed to change the DOM, but it's wrapped inside angular controller and it doesn't seems to work for some reason.
Here's a jsfiddle to reproduce this.
Errors:


text:
Q: Print value on console in spring JSP I am having spring application. Client side is jsp and to read value I use
<c:out value="${school.id}"></c:out>

But I want to print it on console. I don't know how to do that ?
I want to print this school object on console so I can read all the value inside this school object.
Please help me.


text:
Q: Increase timeout for Invoke-SshCommand Powershell Errors: "Session operation has timed out" At C:\SpDrive\Moodle\Provision-MoodleLMS.ps1:108 char:2
+     Invoke-SSHCommand -ComputerName $serName -Command "$temp" -q
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Invoke-SSHCommand], MethodInvocationException
+ FullyQualifiedErrorId : SshOperationTimeoutException,Invoke-SSHCommand

Is there any way to increase the session timeout for Invoke-SSHCommand ?

A: According to this GitHub issue, the developer has added a -Timeout parameter to address this in version 1.7.
Unfortunately, I cannot find this in the release notes, and all I manage to install on my own computer is version 1.6, which does not have that parameter :-/.

A: you can use "New-SSHSession" Like the following, and you can modify "ConnectionTimeout" as you want.

New-SSHSession -ComputerName $ComputerName -Credential $Credentials -ConnectionTimeout 5000


text:
Q: Cannot run GWT Arquillian Test When running this test:
@RunWith(Arquillian.class)
public class CodeTest extends ArquillianGwtTestCase {

    @Deployment
    public static WebArchive createDeployment() {
        return ShrinkWrap.create(WebArchive.class, "test.war")
                .addAsWebInfResource(new File("src/main/webapp/WEB-INF/web.xml"));
    }

    @Test
    @RunAsGwtClient(moduleName = "com.mycompany.code.Code")
    public void testAdd(){
    }
}

This error is thrown:
java.lang.NoSuchMethodError: com.google.gwt.junit.PropertyDefiningStrategy.<init>(Ljunit/framework/TestCase;Ljava/lang/Class;)V
    at org.jboss.arquillian.gwt.ArquillianGwtTestCaseWrapper.getStrategy(ArquillianGwtTestCaseWrapper.java:57)
    at com.google.gwt.junit.client.GWTTestCase.getSyntheticModuleName(GWTTestCase.java:226)
    at org.jboss.arquillian.gwt.ArquillianGwtTestCaseWrapper.<init>(ArquillianGwtTestCaseWrapper.java:40)
    at org.jboss.arquillian.gwt.GwtTestExecutor.onGenerateDeployment(GwtTestExecutor.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
    at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
    at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
    at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
    at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:84)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
    at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:65)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:145)
    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:116)
    at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
    at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:190)
    at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:345)
    at org.jboss.arquillian.junit.Arquillian.access$200(Arquillian.java:49)
    at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:207)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:155)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

Update (trying with a supposedly working version):
Running mvn test on the arquilian-extension-gwt project gives this error:
Tests in error:
  org.jboss.arquillian.gwt.client.test.GreeterRpcTest: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor
  org.jboss.arquillian.gwt.client.test.GreeterTest: Could not create new instance of class org.jboss.arquillian.test.impl.EventTestRunnerAdaptor


text:
Q: Printing multiple barcodes in windows form application .NET C#
below is my code
Draw method is below:
Now when I generate the code it replaces the existing barcode and does not place a new barcode on picture box.
System.Drawing.Graphics g = this.pictureBox1.CreateGraphics();
g.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.SystemColors.Control), new Rectangle(x, y, 50, 50));
ean13.Scale = 1.0F;
ean13.DrawEan13Barcode(g, new System.Drawing.Point(a, a));
public void DrawEan13Barcode( System.Drawing.Graphics g, System.Drawing.Point pt )
{
    float width = this.Width * this.Scale;
    float height = this.Height * this.Scale;

    //  EAN13 Barcode should be a total of 113 modules wide.
    float lineWidth = width / 113f;

    // Save the GraphicsState.
    System.Drawing.Drawing2D.GraphicsState gs = g.Save( );

    // Set the PageUnit to Inch because all of our measurements are in inches.
    g.PageUnit = System.Drawing.GraphicsUnit.Millimeter;

    // Set the PageScale to 1, so a millimeter will represent a true millimeter.
    g.PageScale = 1;

    System.Drawing.SolidBrush brush = new System.Drawing.SolidBrush( System.Drawing.Color.Black );

    float xPosition = 0;

    System.Text.StringBuilder strbEAN13 = new System.Text.StringBuilder( );
    System.Text.StringBuilder sbTemp = new System.Text.StringBuilder( );

    float xStart = pt.X;
    float yStart = pt.Y;
    float xEnd = 0;

    System.Drawing.Font font = new System.Drawing.Font( "Arial", this._fFontSize * this.Scale );

    // Calculate the Check Digit.
    this.CalculateChecksumDigit( );

    sbTemp.AppendFormat( "{0}{1}{2}{3}",
        this.CountryCode,
        this.ManufacturerCode,
        this.ProductCode,
        this.ChecksumDigit );

    string sTemp = sbTemp.ToString( );

    string sLeftPattern = "";

    // Convert the left hand numbers.
    sLeftPattern = ConvertLeftPattern( sTemp.Substring( 0, 7 ) );

    // Build the UPC Code.
    strbEAN13.AppendFormat( "{0}{1}{2}{3}{4}{1}{0}",
        this._sQuiteZone, this._sLeadTail,
        sLeftPattern,
        this._sSeparator,
        ConvertToDigitPatterns( sTemp.Substring( 7 ), this._aRight ) );

    string sTempUPC = strbEAN13.ToString( );

    float fTextHeight = g.MeasureString( sTempUPC, font ).Height;

    // Draw the barcode lines.
    for( int i = 0; i < strbEAN13.Length; i++ )
    {
        if( sTempUPC.Substring( i, 1 ) == "1" )
        {
            if( xStart == pt.X )
                xStart = xPosition;

            // Save room for the UPC number below the bar code.
            if( ( i > 12 && i < 55 ) || ( i > 57 && i < 101 ) )
                // Draw space for the number
                g.FillRectangle( brush, xPosition, yStart, lineWidth, height - fTextHeight );
            else
                // Draw a full line.
                g.FillRectangle( brush, xPosition, yStart, lineWidth, height );
        }

        xPosition += lineWidth;
        xEnd = xPosition;
    }

    // Draw the upc numbers below the line.
    xPosition = xStart - g.MeasureString( this.CountryCode.Substring( 0, 1 ), font ).Width;
    float yPosition = yStart + ( height - fTextHeight );

    // Draw 1st digit of the country code.
    g.DrawString( sTemp.Substring( 0, 1 ), font, brush, new System.Drawing.PointF( xPosition, yPosition ) );

    xPosition += ( g.MeasureString( sTemp.Substring( 0, 1 ), font ).Width + 43 * lineWidth ) -
        ( g.MeasureString( sTemp.Substring( 1, 6 ), font ).Width );

    // Draw MFG Number.
    g.DrawString( sTemp.Substring( 1, 6 ), font, brush, new System.Drawing.PointF( xPosition, yPosition ) );

    xPosition += g.MeasureString( sTemp.Substring( 1, 6 ), font ).Width + ( 11 * lineWidth );

    // Draw Product ID.
    g.DrawString( sTemp.Substring( 7 ), font, brush, new System.Drawing.PointF( xPosition, yPosition ) );

    // Restore the GraphicsState.
    g.Restore( gs );
}

public System.Drawing.Bitmap CreateBitmap( )
{
    float tempWidth = ( this.Width * this.Scale ) * 100 ;
    float tempHeight = ( this.Height * this.Scale ) * 100;

    System.Drawing.Bitmap bmp = new System.Drawing.Bitmap( (int)tempWidth, (int)tempHeight );

    System.Drawing.Graphics g = System.Drawing.Graphics.FromImage( bmp );
    this.DrawEan13Barcode( g, new System.Drawing.Point( 0, 0 ) );
    g.Dispose( );
    return bmp;
}

if there is an alternative way of doing this, requirement is clear
draw and print N number of barcodes using windows forms

A: you can generate barcode and save its image in database sql server.
then create crystal report and get that field on crystal report detail section. you will get what you need.


text:
Q: Vue mouseup and mousedown event doesn't work as expected I have a following code which basically disables the button on mousedown event and enables it back again on mouseup event. However, the mouseup event doesn't enable the button for some reason.
Here's a code snippet:

new Vue({
  el: "#app",
  data: {
    clicked: false
  },
  methods: {
    toggle(type) {
      if (type === "down") {
          this.clicked = true
      } else {
          this.clicked = false // Mouseup event doesn't reach here
      }
    }
  }
})

  <button
      @mouseup="toggle('up')"
      @mousedown="toggle('down')"
      :disabled="clicked"
  >Button</button>

A: When a button is disabled it does not fire the event on mousedown.

A disabled button is unusable and un-clickable.

To avoid this problem, you can simulate the "disabled" state of the button by using css and your custom logic inside toggle()

A: Please check my example.
When button will have disabled mouseover will be disabled. You can add class disabled and add additional method on button click.

new Vue({
  el: "#app",
  data: {
    clicked: false
  },
  computed: {
    getDisabledClass() {
      return {
        'disabled': this.clicked
      }
    }
  },
  methods: {
    toggle(type) {
      if (type === "down") {
          this.clicked = true
      } else {
          this.clicked = false // Mouseup event doesn't reach here
      }
    },
    onClick() {
      //your logic here
    }
  }
})
.disabled {
opacity: .5;
}

  <button
      @mouseover="toggle('up')"
      @mouseleave="toggle('down')"
      @click.prevent="onClick()"
      :class="getDisabledClass"
  >Button</button>


text:
Q: VBA Access Compile Error - Data Member Not Found - How to ignore? I have the code below in a button in my forms in MS Access. The problem is that sometimes not all "strCTRL"s exist. In some forms they do, in some they don't. The whole code is 900+ lines long so I won't post all of it. It's a SQL query which references controls and extracts their value.
The problem comes when not all controls are present, then I get the error: Compile error: Method or data Member not found.
Is there a way to bypass the compile error or tell VBA to compile it only if it exists? I tried If...Nothing and On Error Resume Next, but they don't seem to work. There's also other objects that will not exist on each page, not just the ones below. So...any ideas? =/
Dim strCTRL1 As String
Dim strCTRL2 As String
Dim strCTRL3 As String
Dim strCTRL4 As String
Dim strCTRL5 As String
Dim strCTRL6 As String
Dim strCTRL7 As String
Dim strCTRL8 As String
Dim strCTRL9 As String
Dim strCTRL10 As String
DoCmd.SetWarnings False
On Error Resume Next
strCTRL1 = "[Control Number] = " & Me.Text684.DefaultValue & " "
strCTRL2 = "[Control Number] = " & Me.Label2210.DefaultValue & " "
strCTRL3 = "[Control Number] = " & Me.Label2295.DefaultValue & " "
strCTRL4 = "[Control Number] = " & Me.Label73.DefaultValue & " "
strCTRL5 = "[Control Number] = " & Me.Label160.DefaultValue & " "
strCTRL6 = "[Control Number] = " & Me.Label246.DefaultValue & " "
strCTRL7 = "[Control Number] = " & Me.Label332.DefaultValue & " "
strCTRL8 = "[Control Number] = " & Me.Label417.DefaultValue & " "
strCTRL9 = "[Control Number] = " & Me.Label506.DefaultValue & " "
strCTRL10 = "[Control Number] = " & Me.Text2285.DefaultValue & " "

A: You can create an array or list of the label names, then:
Dim LabelName As String
Dim LabelNames As Variant

LabelNames = Array("Text684", "Label2210", ...etc.)
' ...
LabelName = LabelNames(1)
strCTRL1 = "[Control Number] = " & Me(LabelName).DefaultValue & " "

That will compile, though - of course - fail at runtime for non-existing labels.

A: OK, thanks to @Gustav, you got your code to compile, and his suggestions, combined with On Error Resume Next will get your code to run without errors under any circumstance.
But there is no way to tell if your code is correct, because now, the compiler won't tell you which controls are misnamed or missing.
So instead, I would suggest an array-based approach like this:
    Dim Ctl As Access.Control
    Dim CtlValues() As String
    Dim i as Long

    i = 0
    ReDim CtlValues 1 To Me.Controls.Count

    For Each Ctl In Me.Controls
        If Ctl.ControlType = acTextBox Then
            i = i + 1
            CtlValues(i) = "[Control Number] = " & CStr(Nz(Ctl.DefaultValue, "Null"))
        End If
    Next

    ReDim Preserve CtlValues 1 To i

These 12 lines of code perform the same task that the 900 lines do (going by your example). This code will work in any form, regardless of how many controls there are, and what they are named. This code is way easier to understand and work with.
See if maybe an approach like this will work here.


text:
Q: How to set custom icon for file-type in mac osx I have a launcher application for some file-types in mac osx. I want to know is it possible to register custom Icon for file-types associated with my launcher application? and does anybody know exact behavior of OS, when does it show Icon and when does it show some empty icon?

A: Question 1:
It's easy.  In finder, right click on the filename with the extension you're interested in.
Find the "Open with:" section,

Click on the blue part and navigate to your launcher app and select it.
Then click on "Change All..."
Write down, or remember what it used to be before changing it, in case you want to go back to the old behavior. It affects all files with that extension.
Question 2:
Check this link for information on filling in the images in your assets folder: App Icons
If you include an icon in your app, and do the above steps, the icon will show. If you don't include one, it won't.


text:
Q: Monitoring incoming wifi p2p connection using wifi direct I'm looking for a way to monitor,on group owner side, any new incoming WiFi p2p connection using wifi direct, whenever a group already exists.
I mean, let suppose we have a group which consists of two devices, D1 (as group owner) and D2 (as client).
A third device D3 wants to join the existing group as client.
So, it (D3) calls connect() method "towards" D1.
Now D1 should add D3.
Which is the notification which tells me that everything has been correctly done (on group owner side)?
I know, for sure, that WIFI_P2P_CONNECTION_CHANGED_ACTION is used in order to notify that a new connection has been established for the first time .Is it valid for every client which wants to join the group after it has been created?
Note: I'm interested in knowing what happens on group owner side, not on client.
Thanks in advance for your time.

A: Yes. Everytime when a client connect to a GO, the GO will receive WIFI_P2P_CONNECTION_CHANGED_ACTION.
Actually, I register broadcastReceiver with filter like this, and monitor my D1 (as a Group Owner)
IntentFilter filter = new IntentFilter();
filter.addAction(WifiP2pManager.WIFI_P2P_STATE_CHANGED_ACTION);
filter.addAction(WifiP2pManager.WIFI_P2P_PEERS_CHANGED_ACTION);
filter.addAction(WifiP2pManager.WIFI_P2P_CONNECTION_CHANGED_ACTION);
filter.addAction(WifiP2pManager.WIFI_P2P_THIS_DEVICE_CHANGED_ACTION);

When the first client coming, the sequence of triggered ACTION the GO received is
WIFI_P2P_THIS_DEVICE_CHANGED_ACTION
WIFI_P2P_PEERS_CHANGED_ACTION
WIFI_P2P_CONNECTION_CHANGED_ACTION

When the second one coming, the sequence is
WIFI_P2P_PEERS_CHANGED_ACTION
WIFI_P2P_CONNECTION_CHANGED_ACTION


text:
Q: Extending linear function from a subspace to the whole (finite-dimensional) space Let $V$ be a finite-dimensional vector space over the field $F$ and let $W$ be a subspace of $V$. If $f$ is a linear functional on $W$, prove that there is a linear functional g on $V$ such that $g(\alpha)$ = $f(\alpha)$ for each $\alpha$ in the subspace $W$.

A: Choose a basis $w_1, w_2, \ldots, w_k$ for $W$, where $k = \dim W$.  Extend this to a basis of $V$ by adding linearly independent vectors $v_{k + 1}, v_{k + 2}, \ldots, v_n$, where $n = \dim V$ and $v_j \notin W$ for $k < j \le n$.  Set $g(w_j) = f(w_j)$ for $1 \le j \le k$ and set $g(v_j) = 0$ for $k < j \le n$.  This defines $g$ on the basis $\{w_1, w_2, \ldots, w_k, v_{k + 1}, v_{k + 2}, \ldots, v_n \}$.  Extend $g$ to all of $V$ by linearity:  if $x \in V$ is given (uniquely!) by $x = \sum \alpha_j w_j + \sum \beta_k v_k$ then we set $g(x) = \sum \alpha_j g(w_j) + \sum \beta_k g(v_k)$.  It is easy to see that $g$ so defined is a linear functional on $V$.  Furthermore since in fact $g(x) = \sum \alpha_j g(w_j) = \sum \alpha_j f(w_j$) for $x \in W$, we see that $g$ and $f$ agree on W.  QED.
Nota Bene: It is worth noting that the $g(v_k)$ may in fact be taken arbitrarily in the above construction; choosing $g(v_k) = 0$ is merely a convenience.  End of Note.
Hope this helps.  Cheerio,
and as always,
Fiat Lux!!!

A: Let $\;\{u_1,...,u_k\}\; $ be a basis of $\;W\;$, and complete it to a basis $\;\{u_1,...,u_k,u_{k+1},..,u_n\}\;$ of V. Now define
$$g(u_i):=\begin{cases}f(u_i)&,\;\;1\le i\le k\\{}\\0&,\;\;k+1\le i\le n\end{cases}$$
and extend the definition by linearity.

A: The linear functional on the subspace is defined by its values on the basis of the subspace. This basis can be constructed in a way that makes it subset of the basis of the whole space. Then how can you extend your functional to the whole space? Just define some values for your functional on the rest of the basis.
It is apparent that this choice of values on the whole basis is not unique. Thus the extension is not unique.


text:
Q: RotateFlip bug when using a 1Bpp image. C# What can I do? I'm trying to rotate a Bitmap with 1Bpp PixelIndex but I've found that it's bugged. When you try to do some of the rotations, a black line will appear on the left side of the image. Doing some research I found that is a bug but probably won't be fixed.
I've tried another way to rotate the Bitmap (I include the code):
Bitmap returnBitmap = new Bitmap(lBitmap.Width, lBitmap.Height);
                Graphics g = Graphics.FromImage(returnBitmap);
g.TranslateTransform((float)lBitmap.Width / 2, (float)lBitmap.Height / 2);
                        g.RotateTransform(180);
                        g.TranslateTransform(-(float)lBitmap.Width / 2, -(float)lBitmap.Height / 2);
                        g.DrawImage(lBitmap, new Point(0, 0));
                        mIsRotated = true;

But my problem here is that the image loses definition when rotated 180º.
Is there any other way to rotate?
I'm sorry if I wasn't clear enough.

A: If anyone ends here having the same problem, I found a solution. I couldn't use the Bitmap.RotateFlip because it generated a black line, so I tried with that code above. With 180º my images lost some definition, but using -180º solved the problem.

A: I faced this issue while extracting monochrome bitmaps from icons and cursors.
Flipping is not rotating. This would be better:
Bitmap returnBitmap = new Bitmap(lBitmap.Width, lBitmap.Height);
Graphics g = Graphics.FromImage(returnBitmap);
g.TranslateTransform((float)lBitmap.Width / 2, (float)lBitmap.Height / 2);
// Mirror instead of rotate
g.ScaleTransform(1,-1);
g.TranslateTransform(-(float)lBitmap.Width / 2, -(float)lBitmap.Height / 2);
g.DrawImage(lBitmap, new Point(0, 0));
mIsRotated = true;

However the resulting bitmap will not be 1bpp
This function flips a monochrome bitmap in-place taking advantage of the fact that rows are 32-bit aligned:
/// <summary>
/// Vertically flips a monochrome bitmap in-place
/// </summary>
/// <param name="bmp">Monochrome bitmap to flip</param>
public static void RotateNoneFlipYMono(Bitmap bmp)
{
    if (bmp == null || bmp.PixelFormat != PixelFormat.Format1bppIndexed)
        throw new InvalidValueException();

    var height = bmp.Height;
    var width = bmp.Width;
    // width in dwords
    var stride = (width + 31) >> 5;
    // total image size
    var size = stride * height;
    // alloc storage for pixels
    var bytes = new int[size];

    // get image pixels
    var rect = new Rectangle(Point.Empty, bmp.Size);
    var bd = bmp.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format1bppIndexed);
    Marshal.Copy(bd.Scan0, bytes, 0, size);

    // flip by swapping dwords
    int halfSize = size >> 1;
    for (int y1 = 0, y2 = size - stride; y1 < halfSize; y1 += stride, y2 -= stride)
    {
        int end = y1 + stride;
        for (int x1 = y1, x2 = y2; x1 < end; x1++, x2++)
        {
            bytes[x1] ^= bytes[x2];
            bytes[x2] ^= bytes[x1];
            bytes[x1] ^= bytes[x2];
        }
    }

    // copy pixels back
    Marshal.Copy(bytes, 0, bd.Scan0, size);
    bmp.UnlockBits(bd);
}


text:
Q: Python3 shell prints ^H on pressing backspace key on Linux On python3 shell launched on bash misbehaves on pressing arrows or backspace.
It prints ^H for backspace, and I can remove these characters using Ctrl+backspace or shift+backspace.
But I don't want to do this workaround for backspace (I can do, but I can't ask all my users to follow),
So how to address this issue?.
BTW, I don't see this issue in python2 shell.
OS: 5.4.40-OpenNetworkLinux
python3
Python 3.8.10 (main, Jul 13 2022, 06:53:48)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.systemm^H^H^H

A: Try  stty erase ^H. If you regret, just use stty erase ^?. If you don't want to do this every time, put stty erase ^H into .bash_profile.


text:
Q: sqlite select sum multiple with different where and same table you can make multiple queries in a single query. I have a same table, different where, and multiple select sum:
wrong code:
    public Cursor listado_resumen(String s_mes, String s_ano) {
    String s_actual = "-" + s_mes + "-" + s_ano;
    String s_actual_ano = "-" + s_ano;
    String lista_re = "SELECT *, (SELECT SUM (tr_euros) FROM bdt_registro WHERE tr_fecha LIKE '_%" + s_actual_ano + "' GROUP BY tr_codigo ORDER BY tr_codigo) AS total, (SELECT SUM (tr_euros) FROM bdt_registro WHERE tr_fecha LIKE '_%" + s_actual + "' GROUP BY tr_codigo ORDER BY tr_codigo) AS actual FROM bdt_registro GROUP BY tr_codigo ORDER BY tr_codigo";
    return db.rawQuery(lista_re, null);
}

return:
only the first value
cod.||descrip||total||actual(month)
a   ||house  || 100 ||    100                                                            b   ||car    || 100 ||    100                                                             c   ||food   || 100 ||    100
I like return:
cod.||descrip||total||actual (month)
a   ||house  || 100 ||    20
b   ||car    || 20  ||     5
c   ||food   ||  5  ||     0
Thanks for your interest

A: A scalar subquery must return only one value.
(SQLite ignores any additional values; other databases might report an error instead.)
You have to write the subqueries so that they return the correct value for the corresponding record in the outer table, i.e., they must be correlated subqueries (I assume that the tr_codigo value can be used for the correlation):
SELECT *,
       (SELECT SUM (tr_euros)
        FROM bdt_registro AS r1
        WHERE tr_fecha LIKE '_%...'
          AND r1.tr_codigo = bdt_registro.tr_codigo
       ) AS total,
       (SELECT SUM (tr_euros)
        FROM bdt_registro AS r2
        WHERE tr_fecha LIKE '_%...'
          AND r2.tr_codigo = bdt_registro.tr_codigo
       ) AS actual
FROM bdt_registro
GROUP BY tr_codigo
ORDER BY tr_codigo


text:
Q: Convert nested class to "raw" json I have the following class:
export class Son
{
    public Field8_1 : number;
    public Field8_2 : number;
}

export class Father
{
    constructor (){
        this.Field8 = new Son;
    }
    public Field1 : number;
    public Field2 : number;
    public Field3 : number;
    public Field4 : number;
    public Field5 : number;
    public Field6 : number;
    public Field7 : number;

    Field8 : Son;
}

I have to send it with Angular's HttpClient.
So I ran:
var body = JSON.stringify(this.Father);
    this.http.post (TGT_IP,body).subscribe (...)

The body I got is:
{"Field8":{"Field8_1":81,"Field8_2":82},"Field1":1,"Field2":2,"Field3":3,"Field4":4,"Field5":5,"Field6":6,"Field7":7}

How can I "customize" stringify to create a string according to my needs:
"Field1":1,"Field2":2,"Field3":3,"Field4":4,"Field5":5,"Field6":6,"Field7","Field8_1":81, "Field8_2":82

I want to send a "raw" string.

A: You could achieve that in a couple of ways. Option one is to map all the keys of a father using the spread operator and of the son, and then remove the field you don't need:
// First option
let mappedFather1 = {
  ...this.father,
  Field8_1: this.father.Field8.Field8_1,
  Field8_2: this.father.Field8.Field8_2
};
delete mappedFather1.Field8;

Another option is to essentially "cherry-pick" the object keys you need:
// Second option
let mappedFather2 = {
  Field1: this.father.Field1,
  Field2: this.father.Field2,
  Field3: this.father.Field3,
  Field4: this.father.Field4,
  Field5: this.father.Field5,
  Field6: this.father.Field6,
  Field7: this.father.Field7,
  Field8_1: this.father.Field8.Field8_1,
  Field8_2: this.father.Field8.Field8_2
}

If you don't need the opening and closing braces of the JSON, you can remove them like this:
let noBracesFather = JSON.stringify(mappedFather1).substr(1).slice(0, -1);

Here is a stackblitz that logs the output to console for both options, plus removing the braces: https://stackblitz.com/edit/angular-5wmz4c
This obviously assumes that the structure of Son and Father objects is known and that they are static.


text:
Q: How to achieve "first-parent" merge in git? I am curious about how merging is done to the git repository on GitHub. When I visit the commits page, I only see the "first-parent" commit as you would see using git log --first-parent.

Where as on my own repo, which I perform the merge with git merge --log --no-ff branch_name always show both the merge commit and the commit itself.

I can't seem to find any options on git merge that will allow that. Basically, I am looking for ways where when I call git merge it will only add the merge commit, instead of adding both the merge commit and the commit itself.

A: First, what GitHub shows is only an interface, and it is not Git's interface. So please try this: git fetch and now just say git log --oneline --graph --decorate and see what actually happened.
If now you see that there really is only one parent of this commit, that shows that this was never a merge commit to begin with: GitHub lets you merge pull requests using Squash or Rebase instead of a true merge, so there is indeed only one parent.


text:
Q: Nested Orderd List with combination of numbers, alphatets and roman numerals for numbering? I want to create an ordered list that looks like this:
1. Item_1
2. Item_2:
    a. Subitem_1
    b. Subitem_2:
        I. Sub-Subitem_1
        II. Sub-Subitem_2
    c. Subtiem_3
3. Item 3

i.e. sub-lists should use alphabets/Roman Numbers or other such notations for numbering.
I tried nesting
 tags but that plainly numbered the sub-lists.
Is there a way of doing this using only HTML?

A:

1   Default. Decimal numbers (1, 2, 3, 4)
a   Alphabetically ordered list, lowercase (a, b, c, d)
A   Alphabetically ordered list, uppercase (A, B, C, D)
i   Roman numbers, lowercase (i, ii, iii, iv)
I   Roman numbers, uppercase (I, II, III, IV)

http://www.w3schools.com/tags/att_ol_type.asp

A: This is certainly possible, given the following HTML:

Item_1

Item_2:

Subitem_1

Subitem_2:

Sub-Subitem_1

Sub-Subitem_2

Subitem_3

Item 3

And the CSS:
ol {
    list-style-type: decimal;
}

ol > li > ol {
    list-style-type: lower-alpha;
}

ol > li > ol > li > ol {
    list-style-type: upper-roman;
}

JS Fiddle demo.
Or, you can be less strict about the specificity of the CSS selectors:
ol {
    list-style-type: decimal;
}

ol ol {
    list-style-type: lower-alpha;
}

ol ol ol {
    list-style-type: upper-roman;
}

JS Fiddle demo.
References:

*

*list-style-type.


text:
Q: The meaning of a parameterization of the logarithmic distribution In calculus one learns that
$$
p + \frac{p^2} 2 + \frac{p^3} 3 + \frac{p^4} 4 + \cdots = -\log(1-p). \tag 1
$$
Thus a discrete probability distribution on the set $\{1,2,3,\ldots\}$ is given by
$$
\Pr(X=x) = \frac{-p^x}{ x\log(1-p)} \text{ for } x = 1,2,3,\ldots\, \tag 2
$$
with $0<p<1.$
I seem to recall that this probability distribution was written about by Ronald Fisher in the '30s, and called the $\text{"}$logarithmic distribution$\text{''}$ presumably because of line $(1)$ above. It is known (but I don't know where it first appeared) that if $X_1,X_2,X_3,\ldots$ are i.i.d. with this distribution, and $N\sim\operatorname{Poisson},$ then
$$
\sum_{n=1}^N X_n
$$
has a negative binomial distribution (on the set $\{0,1,2,3,\ldots\}$).
It is readily seen that, with $X$ as in line $(2)$ above,
$$
\operatorname E(X) = \frac{-p}{(1-p)\log(1-p)} =: \mu.
$$
As $p$ increases from $0$ to $1,$ then $\mu$ increases from $1$ to $+\infty.$
So my question is: How do we interpret this parameter $p\text?;$ i.e. is it perhaps the probability of some event related the random variable $X$ or the expected value of some function of $X$ or some sort of rate, or what?

$\big($And while we're at it, can anything further of interest be said about $\mu$ as a function of $p$ or about $p$ as a function of $\mu\text{?}\big)$

A: When you have a parameterised distribution, the best way to get an interpretation for a parameter is to try to derive an equation that equates that parameter value to some other properties of the distribution.  In the case of the logarithmic distribution, the simplest way to get an equation for $p$ is to look at the ratio of successive values of the probability mass function.  In particular, if $X \sim \text{logarithmic}(p)$ then we have:
$$\frac{p_X(x+1)}{p_X(x)} = \frac{p^{x+1}}{x+1} \bigg/ \frac{p^x}{x} = p \cdot \frac{x}{x+1}.$$
Re-arranging this gives us an explicit equation for the parameter:
$$p = \frac{x+1}{x} \cdot \frac{p_X(x+1)}{p_X(x)}.$$
This equation (or any other equation for $p$) can be used to give a valid interpretation of the meaning of the parameter.  Putting the interpretation into words is a little strained, but basically you just want to describe what is being stated in the equation.


text:
Q: replace spaces with commas with javascript I have a string with keywords and I need to check if this string contains spaces and if yes replace them with commas.
the string can be something like "keyword1   keyword2 ,keyword3  keyword4,keyword5"
or any other combination of spaces and commas.
the final result should be a string of keywords separated by commas without any spacing like in the following "keyword1,keyword2,keyword3,keyword4,keyword5".
for that I tried to do $("#strId").split('').join(',')
This done the job but I notice that if I have a string which contains more then one space between each keyword I got multiple commas like that:
original string=(keyword1    keyword2      keyword3)
result string =(keyword1,,,,,,keyword2,,,,,,keyword3)
and I need that it will be with single comma only between each word.
I will appreciate a help on this issue
Thanks

A: Split on any sequence of spaces and commas:
str.split(/[ ,]+/).join(',')

You might also want to use filter to remove empty strings:
str.split(/[ ,]+/).filter(function(v){return v!==''}).join(',')

Another solution would be to match any sequence that does not contain a space or comma:
str.match(/[^ ,]+/g).join(',')

A: alert("test test, test".replace(/[ ,]+/g, ","))

http://jsfiddle.net/yeefR/
Cheers!

A: Use the String.replace() method.
var newString = yourString.replace(/[ ,]+/g, ",");

This says to replace any sequence of one or more spaces or commas in a row with a single comma, so you're covered for strings where the commas have spaces around them like "test, test,test    test test   , test".
(Note: if you want to allow for other whitespace characters beyond just a space use \s in the regular expression: /[\s,]+/g)

A: This should work fine using regular expressions and handles any number of spaces:

keyword1 keyword2 ,keyword3 keyword4,keyword5

Also, just FYI: split() is a javascript function, and works fine without jquery too.

A: This is working fine without using filters
var input = $("#seperate").val();
var output = input.split(" ").join(';');

A: You could easily use the replace method form string. you don't have to use jQuery have a look at http://w3schools.com/jsref/jsref_replace.asp

A: try this code

var text = '           ,        x  ,x,   x,x abc,x,             x                    ,xxxxxx                  ,             ';

text = text.replace(/(\s+)?,(\s+)?/g, ',');
console.log(text);
// => ,x,x,x,x abc,x,x,xxxxxx,

var values = text.split(',').filter(value => value);
console.log(values);
// => ["x", "x", "x", "x abc", "x", "x", "xxxxxx"]


text:
Q: Event on an Image in iOS I am pretty new to iOS development, so this may seem to be a stupid question.. In my xib file, i have taken a UIImageView  that will show an image when the page is loaded. But when a user taps on an image, I want the next view to be loaded.. But I am not able to do that because we cannot have a delegate not a target-action mechanism for a UIImage view.. Many places, I found a workaround.. using a button and then placing an image on it, and then using it.. but I want the first way to work.. Please help..

A: use  UITapGestureRecognizer ,and Don't forget to set imageView.userInteractionEnabled = YES; because by default image not having UserInteraction.
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
[singleTap setNumberOfTapsRequired:1];

[imageView addGestureRecognizer:singleTap];

-(void)handleSingleTap:(id)sender {
// push you view here
}

(OR) If you want

take button with BackGround image.

UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];

button.frame = CGRectMake(270,10,30,30);

[button setBackgroundImage:[UIImage imageNamed:@"image.png"] forState:UIControlStateNormal];

[button addTarget:self action:@selector(action:) forControlEvents:UIControlEventTouchUpInside];

A: Instead of Using UIImageView, you can use UIButton.
  UIButton *myBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [myBtn setBackgroundImage:[UIImage imageNamed:@"your_image_Name"] forState:UIControlStateNormal];
    [myBtn setBackgroundImage:[UIImage @"your_image_Name"] forState:UIControlStateHighlighted];
    [myBtn addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside];

also write button action:
-(void)buttonAction:(id)sender {
// Do whatever you want
}

In Case of XIB, Just use UIButton instead of UIImageView and set Background Image for both state Normal & Highlighted as you want. Rest you can manage button's action from XIB.

A: You can also add a fully transparent UIButton on top of your UIImageView... It should be preferred as each element has a clean semantics.


text:
Q: Route param as first element of the path Is there any possibility to have a route parameter as first element of the path?
For example, let's say we have portal with weather and city is our 'context' (there is no possibility to access any page without 'context'), so we want to have pages like:
/:city/dashboard
/:city/airhealth

How to add such paths in routes? I know there is possibility to have something like this:
/dashboard/:city
/airhealth/:city

but when all pages have to have city context first example is more suitable in this case.

A: i don't think there will be any problem in doing this. you just have to modify your routing file and your route link.
here is the code
app.routing.ts
import { Routes, RouterModule } from '@angular/router';
import ComponentOne from './component-one';
import ComponentTwo from './component-two';

export const routes: Routes = [
  { path: '', redirectTo: 'component-one', pathMatch: 'full' },
  { path: 'component-one', component: ComponentOne },
  { path: ':id/dashboard', component: ComponentTwo }
];

export const appRoutingProviders: any[] = [

];

export const routing = RouterModule.forRoot(routes);

app.component.ts
import {Component} from '@angular/core';

@Component({
  selector: 'app',
  template: `

      Component One
      Component Two (id: 123)  <-- replace 123 with city name

Outlet:

      <router-outlet></router-outlet>

  `
})
export class AppComponent {

}

component-two.ts
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

@Component({
  selector: 'component-two',
  template: 'Component Two with route param ID: {{ id }}'
})
export default class ComponentTwo {

  private id;

  constructor(private route: ActivatedRoute) {}

  private ngOnInit() {
    this.sub = this.route.params.subscribe(params => {
      this.id = +params['id']; // use (+) converts string 'id' to a number other wise use params['id'] directly
    });
  }

  private ngOnDestroy() {
    this.sub.unsubscribe();
  }

}

here is the working plnkr https://plnkr.co/edit/Purfk2msPE1XcZgjowvd?p=preview


text:
Q: Javascript Regex: Testing string for intelligent query I have a string that holds user input. This string can contain various types of data, like:

*

*a six digit id

*a zipcode that contains out of 4 digits and two alphanumeric characters

*a name (characters only)

As I am using this string to search through a database, the query type is determined on the type of search, which i want to handle serverside using JavaScript (yes, I am using JavaScript serverside). Searching on StackOverflow, brought me some interesting information, like the .test-method, which seems perfect for my needs. The test-method returns either true or false based on the evaluation on the string using a regex object.
I am using this page as a reference:
http://www.javascriptkit.com/jsref/regexp.shtml
So I am trying to determine the zipcode, by using the following very noobish regex.
var r = /[A-Za-z]{2,2}/
As far I can understand, this should limit the amount of occurrences of alphanumeric characters to a maximum of two. See beneath the output of my JavaScript console.
> var r = /[A-Za-z]{2,2}/
> var x = "2233AL"
> r.test(x)
true
> var x = "2233A"
> r.test(x)
false
> var x = "2233ALL"
> r.test(x)
true  /* i want this to be false */
>

A little help would be really appreciated!

A: /([^a-z]|^)[a-z]{2}([^a-z]|$)/i

part 1: ([^a-z]|^) ... no letter or start of the string
part 2: [a-z]{2} ... two letters
part 3: ([^a-z]|$) ... no letter or end of the string
/i ... case insensitive

A:
var r = /[A-Za-z]{2,2}/

As far I can understand, this should limit the amount of occurrences of alphanumeric characters to a maximum of two.

No, that says there should be at least two letters in A-Z or a-z and that they must be consecutive. There may also be more letters before or after the match. The syntax {2,2} is also redundant - you can use simply {2} which means the same thing.
This regular expression ensures a maximum of two letters in A-Z or a-z:
var r = /^[^A-Za-z]*([A-Za-z][^A-Za-z]*){0,2}$/;

This one says one or more digits followed by exactly two letters:
var r = /^\d+[A-Za-z]{2}$/;

Notice the use of anchors in both cases to ensure that there aren't any other characters before or after the match.


text:
Q: unknown notation |Z| I was reading a PDF about SHA-3 but on this page I was confronted to a notation that I don't undertand.
It's |Z| on step 9. I thought that was the length of the String Z but but in this case it would be written len(Z). Different notations were explained on this page but |Z| does not figure.
The line in question :

If d≤|Z|, then return Truncd(Z); else continue.
with d a nonnegative integer and Z a string

Thanks

A: Take a look here https://keccak.team/files/SpongeDuplex.pdf
On page 3, section Sequrity requirements, given such explanation:
"|x| is the bitlength of string x"
Think it should be this value.


text:
Q: from IPython.display import GeoJSON not working on google colab On Google Colab I'm getting an error when trying to import GeoJSON from IPython.display:

Any help on how to properly import it would be appreciated.

A: I found the issue to be caused by your Collab runtime having an older version of IPython installed.
pip freeze

Output
ipython==5.5.0
ipython-genutils==0.2.0
ipython-sql==0.3.9
ipywidgets==7.5.1

Since the collab was created sometime ago
Updating the module fixed the issue for me
pip install -U IPython

After which you can restart your runtime and the changes should be reflected
pip freeze

Output
ipython==7.16.1
ipython-genutils==0.2.0
ipython-sql==0.3.9

A: Exactly how to execute in Google Colab:

*

*import IPython

*Update IPython

*Now able to from IPython.display import GeoJson

A: Google Colaboratory has an older version of IPython installed (v5.5.0 as of the time I'm writing this). The best way to fix this is to include the following line in the Colab notebook before your import statements:
!pip3 install --upgrade IPython

This should fix it for you!


text:
Q: Ros2 Colcon build failed ,rclpy -error: 'PyErr_warnformat' was not decleared in the scope Trying to install Ros2 humble in ubuntu 20.04,
while executing command --> Colcon build --symlink-install
I'm getting the following error
--- stderr: rclpy
In file included from /home/kalyan/ros2_humble/src/ros2/rclpy/rclpy/src/rclpy/node.hpp:24,
                 from /home/kalyan/ros2_humble/src/ros2/rclpy/rclpy/src/rclpy/action_client.hpp:26,
                 from /home/kalyan/ros2_humble/src/ros2/rclpy/rclpy/src/rclpy/_rclpy_pybind11.cpp:24:
/home/kalyan/ros2_humble/src/ros2/rclpy/rclpy/src/rclpy/context.hpp: In destructor 'rclpy::InitOptions::~InitOptions()':
/home/kalyan/ros2_humble/src/ros2/rclpy/rclpy/src/rclpy/context.hpp:49:7: error: 'PyErr_WarnFormat' was not declared in this scope; did you mean 'PyErr_Format'?
   49 |       PyErr_WarnFormat(
      |       ^~~~~~
      |       PyErr_Format
make[2]: * [CMakeFiles/_rclpy_pybind11.dir/build.make:76: CMakeFiles/_rclpy_pybind11.dir/src/rclpy/_rclpy_pybind11.cpp.o] Error 1
make[1]: * [CMakeFiles/Makefile2:104: CMakeFiles/_rclpy_pybind11.dir/all] Error 2
make: * [Makefile:141: all] Error 2
---
Failed   <<< rclpy [16.2s, exited with code 2]
Aborted  <<< rclcpp [26.0s]
Aborted  <<< ros2cli_test_interfaces [1min 29s]
Aborted  <<< diagnostic_msgs [1min 32s]

Summary: 195 packages finished [4min 31s]
  1 package failed: rclpy
  3 packages aborted: diagnostic_msgs rclcpp ros2cli_test_interfaces
  1 package had stderr output: rclpy
  141 packages not processed

Help me to overcome this error.
pyhton3 version-->3.8.10
I have the python3.9 version too,

A: if python version < 3.2, it dose not have PyErr_WarnFormat().seehttps://docs.python.org/3/c-api/exceptions.html.
I delete /usr/include/python2.7/  and make the default python version is 3.8.10. It work for me.


text:
Q: dnn 7 custom module pass user info to module I am building a custom module that will display customer information from a MS SQL database on a page. I need to pass a custom profile field created in DNN(CustNumber) using c# to a custom module so I can pull information depending on who logs in to a SQL query. Please help. Thanks

A: You simply need to load the User Information for the logged in user. Assuming the Control of your module inherits from PortalModuleBase you have access to the UserID and UserInfo objects so you can get profile properties easily.
var uc = new UserController();
var ui = uc.GetUser(PortalId, UserId);

var propertyValue = ui.Profile.GetPropertyValue("PropertyName");


text:
Q: Uniform convergence of a series of functions I am reading Chung's book on probability and I've stumbled across this example:
Let $\{b_n\}_{n \in \mathbb N}$ be a set of positive ($\geq 0$) numbers such that $\sum_{n=1}^{\infty}b_n < \infty$ and  $\{a_n\}_{n \in \mathbb N}$ an enumeration of the rationals. For instance, we may take $b_n=2^{-n}$.
Consider now $$f(x)=\sum_{n=1}^{\infty}b_n\delta_{a_n}(x),$$where $$\delta_t(x)= \begin{cases} 0 &\text{if }x <t
\\ 1 &\text{if }x \geq t \\ \end{cases}$$
Then the series is absolutely and uniformly convergent.
Since for each $n \in \mathbb N$, $\delta_{a_n}(x) \leq 1$, then $\sum_{n=1}^{\infty}|b_n\delta_{a_n}(x)|<\sum_{n=1}^{\infty}b_n<\infty$, so from here it follows the absolute convergence but I am having difficulty understanding why it is uniform, I would appreciate if someone could explain this to me.

A: Hint   :   Weierstrass M-test.


text:
Q: Can I add primary key contrains in sql table after creation or during export of dataframe to sql table I would like to import my Excel data to a database in SQL using pd.read_sql function. Here I tried using flask sqlalchemy. I cannot create my table and only can Transfer data from Excel to SQL because my Excel file has more than 1000 columns. Based on the reaseach I did, now I thought of using Flask migrate Option to do the changes after creation using the functions like flask db migrate and flask db upgrade. But no success. I need key contraints to implement relationship between tables after creation or during the export of my dataframe to SQL function.
This code here, is for database and table creation :
import pandas as pd
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
#from sqlalchemy.ext.automap import automap_base
#from sqlalchemy.orm import Session
from sqlalchemy import create_engine

df= pd.read_excel(r'C:\Users\z103684\Desktop\new_data.xlsx',sep=';')

df1=df.loc[:, (df != 0).any(axis=0)]
X1 = df1.iloc[0:,0:]
dataset = X1.astype('float32')
dataset['date'] = pd.date_range(start='1/1/2020', periods=len(dataset), freq='D')
dataset=dataset.set_index('date')

dataset.columns = dataset.columns.str.strip().str.lower().str.replace('[', '').str.replace('.', '').str.replace(']','')

dff= pd.read_excel(r'C:\Users\z103684\Desktop\one_column.xlsx',sep=';')

engine = create_engine('sqlite:///Measurements.db')

app=Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI']='sqlite:///Measurements.db'
db=SQLAlchemy(app)

class table1(db.Model):
    __tablename__='table1'
    dataset.to_sql(con=engine, name='table1', if_exists='replace')
    table1.PrimaryKeyConstraint('id')

class table2(db.Model):
    __tablename__='table2'
    dff.to_sql(con=engine,name='table2',if_exists='replace')
    table2.PrimaryKeyConstraint('id1')

@app.route('/')
def index():
    return "Hello flask"

if __name__=="__main__":
    app.run()