text:
Q: Prove 4 points cyclic in an acute scalene triangle $ABC$ is an acute angled scalene triangle. $L,M,N$ are midpoints of the sides $BC,CA,AB$.
The perpendicular bisectors of $\overline{AB}$ and $\overline{CA}$ meet $\overline{AL}$ at point $D$ and point $E$. The rays $\overrightarrow{BD}$ and $\overrightarrow{CE}$ cut each other at point $F$ inside the triangle.

Prove that $A,M,F,N$ are cyclic.

Tried by taking a point on symmedian and also tried by applying Menelaus theorem.

A:
Let $O=ME \cap ND$. By construction $O$ is the center of
circumscribed circle of $\triangle ABC$
with circumradius $R=|AO|$.
Right triangles $ANO$ and $AOM$ share
common hypotenuse $AO$,
which serves as the diameter
of the circumscribed circle
with the center $O_c$ in the middle of $AO$
for both of them,
and the radius of the circle is $\tfrac12|AO|=\tfrac12R$.
So, to prove that $A,M,F,N$ are cyclic,
suffice it to show that
$|O_cF|=|O_cA|$
or $|O_cF|^2=|O_cA|^2$.
Considering the points as complex numbers, let
\begin{align}
P&=0,\quad
A=-4w,\quad
B=12w
,\\
C&=A+4(u+v\cdot i)=4(u-w+v\cdot i)
,\\
L&=\tfrac12\,(B+C)=2u+4w+2v\cdot i
,\\
M&=\tfrac12\,(A+C)=2u-4w+2v\cdot i
,\\
N&=\tfrac12\,(A+B)=4w
,\\
Q&=\tfrac12\,(A+M)=u-4w+v\cdot i
\end{align}
for some real numbers $u,v,w$.
The lines through points $z_1,z_2$
and $z_3,z_4$ intersect at a point
\begin{align}
z&=
f_{\times}(z_1,z_2,z_3,z_4)=
\frac{
(z_1-z_2)\,(\overline{z_3}\,z_4-\overline{z_4}\,z_3)
-(z_3-z_4)\,(\overline{z_1}\,z_2-\overline{z_2}\,z_1)
}{
(z_1-z_2)\,(\overline{z_3}-\overline{z_4})
-(z_3-z_4)\,(\overline{z_1}-\overline{z_2})
}
,
\end{align}
where $\overline{z}$ is the complex conjugate of $z$.
The center $O_c$ can be found as the point
of intersection of
perpendicular bisectors of $AM$ and $AN$.
The perpendicular bisector of $AN$
is defined by points $P$ and $P+i$,
the perpendicular bisector of $AM$
is defined by points $Q$ and $Q+(C-A)i$.
Given that,
\begin{align}
Q_c&=f_{\times}(P,P+i,Q,Q+(C-A)\cdot i)
=\frac1v\,(v^2-4uw+u^2)\cdot i
.
\end{align}
The other points can be found similarly,
\begin{align}
D&=f_{\times}(N,N+i,A,L)
=4w+\frac{8vw}{u+4w}\cdot i
,\\
E&=
f_{\times}(M,M+O_c-Q,A,L)
\\
&=2\cdot\frac{u(u+4w)(u-2w)+v^2(u+2w)}{u^2+4uw+v^2}
+2\cdot\frac{v(u^2+v^2)}{u^2+4uw+v^2}\cdot i
,\\
F&=
f_{\times}(C,E,B,D)
\\
&=
4\cdot\frac{(8uw+3u^2+3v^2-16w^2)\,w}{(u+4w)^2+v^2}
+64\cdot\frac{v w^2}{(u+4w)^2+v^2}\cdot i
.
\end{align}
Now it can be verifies that
\begin{align}
|O_cF|^2&=|O_cA|^2
=\frac1{v^2}(v^2+u^2)(v^2+(u-4w)^2)
.
\end{align}
The following maxima code can be used to verify the result:
_(z):=conjugate(z)$
xpoint(z1,z2,z3,z4):=
((z1-z2)*(_(z3)*z4-_(z4)*z3)-(z3-z4)*(_(z1)*z2-_(z2)*z1))
/((z1-z2)*(_(z3)-_(z4))-(z3-z4)*(_(z1)-_(z2)))$
declare([P,A,B,C,L,M,N,Q,Oc,D,E,F],complex)$
declare([u,v,w],real)$
P:0;
A:-4*w;
B:12*w;
C:A+4*(u+%i*v);
L:(B+C)/2;
M:(A+C)/2;
N:(A+B)/2;
Q:(A+M)/2;
Oc:factor(xpoint(P,P+%i,Q,Q+(C-A)*%i));
t:factor(xpoint(N,N+%i,A,L));
D:factor(realpart(t))+%i*imagpart(t);
t:factor(xpoint(M,M+Oc-Q,A,L));
E:realpart(t)+%i*imagpart(t);
t:factor(xpoint(C,E,B,D));
F:realpart(t)+%i*imagpart(t);
OcF2:factor(cabs(F-Oc)^2);
OcA2:factor(cabs(A-Oc)^2);
OcA2-OcF2;


text:
Q: Кодировка xmlhttprequest Подскажите, пожалуйста, как установить в xmlhttprequest кодировку UTF-8 для отправки запроса кирилицей?  В логах сервера такие кракозяблы:
"name":"?????????»?°??"
        var xhr = new XMLHttpRequest();
        xhr.open("POST", "/registration",false);
        xhr.send(formData);

A: убедитесь, что :
1) ваши файлы и скрипты созданы в UTF-8,
2) ваш сервер отдает эти файлы в UTF-8
3) вы просматриваете логи веб-сервера в терминале, который поддерживает UTF-8
4) на вашем сервере установлена поддержка UTF-8
можете скачать логи веб-сервера, открыть их в текстовом редакторе и посмотреть в какой кодировке он их распознал. Если все читаемо и  редактор показывает кодировку UTF-8, значит у вас проблема с терминалом.
современные браузеры по умолчанию работают в UTF-8, поэтому, сначала проверьте это, а если у вас какой-то специфический случай, когда вы отправляете запросы со страницы в кодировке cp1251, вам, наверное нужно воспользоваться ответом @Alex Krass
вот тут https://tomcat.apache.org/tomcat-8.0-doc/logging.html, например, говорится, что по умолчанию tomcat сохраняет логи в системной кодировке. там приведена инструкция по переключению логирования на log4j c utf8

A: Через функцию setRequestHeader послать нужный заголовок HTTP
   var client = new XMLHttpRequest();
   client.open("POST", "/registration",false);
   client.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
   client.send(formData);

redpajama_set_name: RedPajamaStackExchange


text:
Q: iPhone screen turning black after launch image So everything were going great and my app was almost done, until this happened. Did not make any changes exept trying to run it in iOS Simulater. When I was going to try it on my iPhone again the screen turns black after the launch image!! And I don't get any errors in xcode.
I've tried to clean my project, resetting iOS Simulator (just for kicks), restarting my Macbook, restarting iPhone, delete the app from homescreen and install it again.
Building for iOS 6 on my iPhone 5.
AppDelegate.h
//
//  AppDelegate.h
//
//
//  Created by Øyvind Larsen Runestad on 13.01.13.
//  Copyright (c) 2013 Øyvind Larsen Runestad. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate> {

IBOutlet UITabBarController *tabBarController;
}
@property (strong, nonatomic) UIWindow *window;

@property(nonatomic, readonly) UITabBarController *moreNavigationController;

@end

AppDelegate.m
//
//  AppDelegate.m
//
//
//  Created by Øyvind Larsen Runestad on 13.01.13.
//  Copyright (c) 2013 Øyvind Larsen Runestad. All rights reserved.
//

#import "AppDelegate.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end

Anyone have any solutions to this problem?
Best regards,
Øyvind Larsen Runestad.
EDIT: SOLVED!

Okay, i sorted it out. The Main Storyboard in the project was set to blank. All I had to do was to change this to MainStoryboard.
Seems like my AppDelegate is okay after all @H2CO3 ;)

A: If this really is your actual code, then the problem is the following: you don't create the key window when the app launches.


text:
Q: how to edit a textfield values in reactjs Here i add my sample code.i have a static values getting from state now i want to change this values
render() {
    console.log(this.props.selectedVal);
    var name,
        gender,
        city = "";

    this.props.data.map((row, index) => {
        // console.log(index);
        if (this.props.selectedVal === index) {
            gender = row[0];
            name = row[1];
            city = row[2];
        }
        return [];
    });

    return (
        <Dialog
            open={this.props.open}
            onClose={this.handleClose}
            aria-labelledby="alert-dialog-title"
            aria-describedby="alert-dialog-description"
        >

Edit User

            <DialogContent>
                <DialogContentText id="alert-dialog-description" />
                <Formik
                    initialValues={{ name: "", gender: "", city: "" }}
                    onSubmit={values => console.log(values)}
                >
                    {props => (
                        <form>
                            <TextField margin="dense" id="name" label="Name" value={name} />

                            <TextField
                                margin="dense"
                                id="gender"
                                label="Gender"
                                value={gender}
                            />

                            <TextField margin="dense" label="City" value={city} />
                        </form>
                    )}
                </Formik>
            </DialogContent>
            <DialogActions>
                <Button onClick={this.handleClose} color="primary">
                    RESET
                </Button>
                <Button onClick={this.handleClose} color="primary" autoFocus>
                    SUBMIT
                </Button>
            </DialogActions>
        </Dialog>
    );
}

I am getting the values from the table row.Now i want to change these values using formik. How can I edit these values

A: Add a onChange listener in your textfield and map the value to a state variable:
textChange(e) {
  const value = e.target.value
  this.setState({ value })
}

render() {
  return (
    <TextField value={this.state.value} onChange={this.textChange} .. />
  )
}

If you want to handle more values from different textfields using one method try something like this:
textChange(e) {
  const id = e.target.id
  const value = e.target.value
  this.setState({ [id]: value })
}

render() {
  return (
    <TextField id="gender" value={this.state.gender} onChange={this.textChange} .. />
    <TextField id="dense" value={this.state.dense} onChange={this.textChange} .. />
  )
}

A: It seems like you get data with props from parent component. And, if I get it wright, question is how to change state of parent component? You need to add to props function binded to parent`s context and use setState there.


text:
Q: Wix-downgrade option is not working even when i set "yes" in Major upgrade tag Please see below bundle file

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
 <Bundle Name="Boot_Demo" Version="2.0.0" Manufacturer="Demo-Product" UpgradeCode="{8B19CAE6-59BD-4001-958B-9D2E9F9A1B4D}">

  <Chain>
   <!-- TODO: Define the list of chained packages. -->
   <!-- <MsiPackage SourceFile="path\to\your.msi" /> -->

      <MsiPackage SourceFile="D:\Jayesh\TestProjects\Demo-Product\Demo-Product\bin\Debug\Demo-Product.msi"
                  DisplayInternalUI="yes"
                  Visible="yes"
                  ForcePerMachine="yes"
                  Permanent="no"
                  Vital="yes"
                  EnableFeatureSelection="yes"
       >
      </MsiPackage>
  </Chain>
 </Bundle>
</Wix>

am getting same error while downgrading with different versions .
am used first 2.0.0 in bundle file and product.wxs file. Then I have given 1.0.0.


text:
Q: I want to show fourier series by using matlab. help me. I want to show basic fourier series by using matlab.
I don't know where did I wrong please fix my code...
this code keeps making error in matlab.
function fv = f(x, N)

fv = 0;
for n=1:N
    fv = fv + (1/(2*n-1) *sin((2*n-1)*x);
end

x = 0:0.1:100;

N = 10;

plot(x, f(x, N))

I mean I wanna show
$f(x)= sin(x)+\frac{1}{3}sin(3x)+\frac{1}{5}sin(5x)+.....\frac{1}{2n-1}sin(2n-1)$ when n=10 into matlab code. help me.

A: to simplify
I modified
t=0:0.001:10

k=0
for n=1:10

k=k+ (1/(2*n-1))*sin((2*n-1)*t)
end
plot(t,k)


text:
Q: How to add plus minus symbol to a bootstrap accordion I using a bootstrap accordion, where the first panel is always open and the panel which is open gets a class in . I'm checking from my jquery code to see if the class contains class in it highlights that anchor . But currently all the anchor are highlighted.
I just want the first anchor to get highlighted that is open and rest closed panel should have some different style.
here is the fiddle : Fiddle
As you can see all the anchor tags are highlighted. I want first anchor to get some different styling. The whole idea is to add plus / minus symbol to the accordion.

A: Made a slight modification to the @Arun P Johny answer from above
First: Changed the  to a  tag, per Bootstrap 3 documantation
Second: added a second event check for users closing an open tab, removing the class and changing the minus icon to a plus icon
Fiddle
var $active = $('#accordion .panel-collapse.in').prev().addClass('active');
$active.find('a').append('');
$('#accordion .panel-heading').not($active).find('a').prepend('');
$('#accordion').on('show.bs.collapse', function (e)
{
    $('#accordion .panel-heading.active').removeClass('active').find('.glyphicon').toggleClass('glyphicon-plus glyphicon-minus');
    $(e.target).prev().addClass('active').find('.glyphicon').toggleClass('glyphicon-plus glyphicon-minus');
});
$('#accordion').on('hide.bs.collapse', function (e)
{
    $(e.target).prev().removeClass('active').find('.glyphicon').removeClass('glyphicon-minus').addClass('glyphicon-plus');
});

A: Try the show event of collapse - bootstrap 3+
jQuery(function ($) {
    var $active = $('#accordion .panel-collapse.in').prev().addClass('active');
    $active.find('a').prepend('');
    $('#accordion .panel-heading').not($active).find('a').prepend('');
    $('#accordion').on('show.bs.collapse', function (e) {
        $('#accordion .panel-heading.active').removeClass('active').find('.glyphicon').toggleClass('glyphicon-plus glyphicon-minus');
        $(e.target).prev().addClass('active').find('.glyphicon').toggleClass('glyphicon-plus glyphicon-minus');
    })
});

then
.panel-heading.active {
    background-color: green;
}

Demo: Fiddle

In your code
$(document).ready(function () {
    if ($('div').filter(':not(in)')) {
        $('.panel-title a').addClass('active');
    }
});

The filter() method returns a jQuery object so it sill always be truthy, also you are adding the class to all anchor elements in the title irrespective of whether it is active or not, also you are not changing it when the accordion is changed

A: If you want to change plus/minus class on collapsing same panel than you can use javascript in this way(Also work on multiple panel)

It is working for this html block

                Panel 1

            Contents panel 1

                 Panel 2

                Contents panel 2

                Panel 3

                Contents panel 3

check this jsFiddle example http://jsfiddle.net/navjottomer/8u57u/4/

A: Working example!
You can add the standard class collapsed to all tabs and then just use CSS like this:
.subnav-button .glyphicon-plus:before {
    content: "\2212";
}
.collapsed .glyphicon-plus:before {
    content:  "\2b";
}

Where .subnav-button is your desired button class and using standard bootstrap icons. Content of plus will then be replaced by the content of minus whenever the class collapsed does not lie on your button (which is exactly whenever the tab is not collapsed).
This is the HTML code at the beginning:
<button data-toggle="collapse" class="subnav-button collapsed" data-target="#subnav-110">

    Sitemap

</button>

The only downside to this is that you can not use the plus icon in a collapsed tab again without it changing to a minus, too. If you want that you could of course copy the class to a new one like this:
.glyphicon-accordion-plus-minus < .glyphicon-plus

And changing the CSS at the start of my post to the new class instead and then using the new class in the HTML code of your accordion instead of just glyphicon-plus.

A: This is my css
.my-button.collapse-nav-button:before {
    content: "\2212";
}
.collapsed .my-button.collapse-nav-button:before {
    content:  "\2b";
}

This is my button

And this is my the whole accordion html with the above button

        Open/Close

Somebody Answered it the same way but neither people voted him nor he ended well with the quote that it has downside. I don't know what downside he was talking about. But I thought instead of editing that one lets add a neat answer though I up voted him.
I suggest there should not be need for javascript coding for this. Because it can easily be done with css and html so why to litter your page.?

A: demo https://www.tutorialrepublic.com/codelab.php?topic=bootstrap&file=accordion-with-plus-minus-icon

 $(document).ready(function(){
        // Add minus icon for collapse element which is open by default
        $(".collapse.show").each(function(){
            $(this).prev(".card-header").find(".fa").addClass("fa-minus").removeClass("fa-plus");
        });

        // Toggle plus minus icon on show hide of collapse element
        $(".collapse").on('show.bs.collapse', function(){
            $(this).prev(".card-header").find(".fa").removeClass("fa-plus").addClass("fa-minus");
        }).on('hide.bs.collapse', function(){
            $(this).prev(".card-header").find(".fa").removeClass("fa-minus").addClass("fa-plus");
        });
    });
    .bs-example{
        margin: 20px;
    }
    .accordion .fa{
        margin-right: 0.5rem;
    }
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

                    <button type="button" class="btn btn-link" data-toggle="collapse" data-target="#collapseOne"> What is HTML?</button>

HTML stands for HyperText Markup Language. HTML is the standard markup language for describing the structure of web pages. Learn more.

                    <button type="button" class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseTwo"> What is Bootstrap?</button>

Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development. It is a collection of CSS and HTML conventions. Learn more.

                    <button type="button" class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapseThree"> What is CSS?</button>

CSS stands for Cascading Style Sheet. CSS allows you to specify various style properties for a given HTML element such as colors, backgrounds, fonts etc. Learn more.

A: I was able to accomplish this with a couple lines of html and css.

a.collapsed > span.expandedIndicator, a:not(.collapsed) > span.collpasedIndicator {
  display: none;
}
+
-

Simply put the span tags into your HTML where you want the plus or minus to be, and then add the css rule to your stylesheet. If using bootstrap 3 or earlier, you can use glyphicons instead of the plain text plus and minus I used. This seems like the simplest solution.

A: Adding a background color to the :active list will give you a differentiation you are looking for but if you really want a button, bootstrap uses glyphicons. This is what I did to mine and it looks good
<button type="button" class="btn btn-green"> Add Close Day</button>

A: Yes, just another answer but in my case it will work if you have or not have data-parent which help to archive just one open and all lefts is close.

                        Collapsible Group Item #1

                    Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

                        Collapsible Group Item #2

                    Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

                        Collapsible Group Item #3

                    Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

A: Ok this need new answer because Twitter Bootstrap and jQuery change many things and you need automatization:
(function($) {
    $(document).ready(function(){
        if($(".collapse.in").length)
        {
            $(".collapse.in").prev().find(".panel-title a").append(' ');
        }
        else
        {
            $(".collapse").prev().find(".panel-title a").append(' ');
        }
        $('.panel-collapse').on({
            'hidden.bs.collapse' : function (e) {
                var active = $(this).prev().find(".panel-title a .glyphicon");
                active.removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-right");
            },
            'show.bs.collapse' : function (e) {
                var active = $(this).prev().find(".panel-title a .glyphicon");
                active.removeClass("glyphicon-chevron-right").addClass("glyphicon-chevron-down");
            }
        });
    });
})(jQuery);

This nicely work with Twitter Bootstrap version 3.x and jQuery 1.10.3 and all rest above.


text:
Q: java application distribution with extension api I am planning to write some java application & planning to distribute in free & commercial versions.Basically my idea is to get some money from out of it from corporate users.
I would like provide extension API which other user can write some jar & include in the product.
Please help me with the following questions.
1) If I distribute as JAR anyone can see my code even if I do obfuscation.I think there are some paid de-obfuscators..making exe or JNI an option but it's not an effective solution.
Microsoft products don't have this problem. Any advice?
2)If I make open source, I won't get much gain because,business don't usually go for support until unless its huge product like IBM websphere or RAD.  Any inputs to avoid this?

A: Perhaps you should consider a dual license scheme: release your source code under the GPL, and the companies that don't want to comply with the therms of the GPL would need to purchase a commercial license.


text:
Q: How to assign random colors to shapes in vb6 form I am developing a game using VB6.0, I want to generate randomly moving shapes (circles, squares, rectangles, ovals, etc.) with different colors in the background of form. I am using timers and shapes to achieve this.my contribution is furnished below.
Private Sub Timer1_Timer()
    For i = 0 To 20
        s_left = Round(Rnd * 20050)
        s_top = Round(Rnd * 860)
        shape(i).Left = s_left
        shape(i).Top = s_top
        shape(i).Visible = True
    Next i
End Sub

Now the problem is that, I can use only one shape and one color, is there any possibility to select a random color and shape within this Timer1_Timer()?

A: ' the function that generate random colors
Public Function RandomRGBColor() As Long
    RandomRGBColor = RGB( _
        Int(Rnd() * 256), _
        Int(Rnd() * 256), _
        Int(Rnd() * 256))
End Function

your code should be changed as follows to get the requested result
dim shape_style as integer
Private Sub Timer1_Timer()
For i = 0 To 20
shape_style= Round(Rnd * 5)
s_left = Round(Rnd * 20050)
s_top = Round(Rnd * 860)
shape(i).Left = s_left
shape(i).Top = s_top
shape(i).Visible = True
shape(i).fillcolor=RandomRGBColor()
shape(i).shape=shape_style
Next i
End Sub


text:
Q: Place element at the bottom of the wrapper with height 100% This is my code:

body,
html {
  height: 100%;
  color: white;
}

.wrapper {
  height: 100%;
}

.wrap-content1 {
  background-image: url(https://source.unsplash.com/random/600x600);
  min-height: 100%;
}

.wrap-content2 {
  min-height: 100px;
  background-color: green;
}

.footer {
  background-color: blue;
  text-align: right;
}

    Wrapper Content 1

    Wrapper Content 2

  This is a footer

I want to display the footer div at the bottom of the wrapper div which has a height of 100%.
I know this can be achieved by placing the footer div inside of the wrapper div, but it doesn't meet my requirements.

A: I suppose you want the wrap-content1 to be full height so use vh unit and you will avoid all the height:100% and thus no more overflow issue:

body,
html {
  color: white;
  margin: 0;
}

.wrap-content1 {
  background-image: url(https://source.unsplash.com/random/600x600);
  min-height: 100vh;
}

.wrap-content2 {
  min-height: 100px;
  background-color: green;
}

.footer {
  background-color: blue;
  text-align: right;
}

    Wrapper Content 1

    Wrapper Content 2

  This is a footer

A: I think your calculation is not right for .wrap-content1 and it makes the footer does not place at the bottom of .wrapper. You set height of .wrapper = 100%, but .wrap-content1 and .wrap-content2 are more than 100% of parent, this makes the .wrapper cannot wrap 2 children. When I set
.wrap-content1 {
    background-image: url(https://source.unsplash.com/random/600x600);
    min-height: 87%;
}

I can put the footer at the bottom of wrapper.


text:
Q: Get multiple url Firebase storage for single ID Someone has some idea of how to get the urls of the files I'm uploading to Firebase Storage for a single ID in Realtime Database. In other words, I have a form and I generate an object with different fields, inside of them everything is fine but I would like it to have a field of images and within it are the urls of the images that I have uploaded.
Something like that:
ID {
descripcion: "Descripción 1",
destacado: "Destacado 1",
images: {
  imageID1: "imageUrl1",
  imageID2: "imageUrl2",
  imageID3: "imageUrl3"
},
titulo: "Titulo 1"
}

So far I have managed to upload multiple images but I generate the IDs separately:

Another minor problem is that it does not generate the other fields, but I hope to solve it later. If you have any better idea of how to raise this, any help is welcome.
addProyecto(proyecto: Proyecto) {
let key = this.db.list('proyectos').push(proyecto).key;
const storageRef = firebase.storage().ref();
storageRef.child(`${this.basePath}/${proyecto.file.name}`).put(proyecto.file)

  .then(
  snapshot => {
    let titulo = proyecto.titulo
    proyecto.images = [
      snapshot.downloadURL,
    ]
    this.db.object('proyectos/' + key).set(proyecto);
  }

);
}


text:
Q: select and sum 3 highest values from id sqlite I would like to ask how to select 3 highest values and sum it in sqlite.
My table looks like this:
   ID           SKU         Price
   -----        -----       -----
   John         Product1    100
   John         Product2    10
   Steven       Product3    20
   Rachel       Product4    100
   Jack         Product5    10
   John         Product6    10
   John         Product7    10

Easy solution would be to:  select Id, group_concat(SKU), sum(price) from my_table group by id;
This would give me overall picture, but what if I want to include only three highest values from each id and of course sum those three values? So the end result would look something like this:
       ID           SKU                              Price
       -----        -----                            -----
       John         Product1,Product2,Product6       120
       Steven       Product3                         20
       Rachel       Product4                         100
       Jack         Product5                         10

A: You can use this code (see example at sqlfiddle):
select  ID, GROUP_CONCAT(SKU), SUM(PRICE)
from    test t
where   ID || '-' || SKU || '-' || Price in
    (
        select  ID || '-' || SKU || '-' || Price
        from    test t2
        where   ID = t.ID
        order by
                Price desc
        limit   3
    ) GROUP BY t.ID


text:
Q: Convert array of array indices to value in multidimensional array of dynamic size i have an array as below :
test[
0 => 0,
1 => 2 ,
2 => 0,
3 => 2
]

the above array values are a representation on index of a larger array , so i need to covert the values to index of another array which will map the larger array as to achive below :
test2[0][2][0][2]

i tried :
$test3= array_flip ( $test )

works ok but is not convinient as to collisions as i dont have controll of the array , any help ?

A: function arrayToIndex($array,$index) {
        $element = $array;
            for ($i = 0; $i < count($index); $i++) {
                    $element = $element[$index[$i]];
            }
            return $element;
    }
$test = [[[[1],[2]],[[3],[4]]],[[[5],[6]],[[7],[8]]]];
$index = [0,1,0,0];
echo arrayToIndex($test,$index);

Here's a function that implements the behaviour you asked for. $array is the array to search into, and $index is the array of indexes. I suggest you play around with this example and see how each value is retrieved.
Live example: http://ideone.com/fork/BzCjcK

A: so after head  i came up with below function which served my purpose :
$mainarray = [

0 => [
   0 =>[
      0 => [
         0 => 'one' ,
         1 => 'two' ,
         2 => 'three' ,
         3 => 'four'
      ],

      1 => [
         0 => 'one' ,
         1 => 'two' ,
         2 => 'three' ,
         3 => 'four'
      ]

   ]
]

]

Then this array below has the values as the index of the $mainarray above of what i want to get lets say one as above ,
$arraywithseacrhindex = [
0 => 0 ,
1 => 0 ,
2 => 0 ,
3 => 0 ,
]

Solution :
$array = $mainarray ;
$arr = $arraywithseacrhindex ;
$counter= count($arr)-1 ;
$result = array() ;
for($i=0; $i< $counter; $i++) {

    if(empty( $result ) )
    {
        // first loop to put $result at per with $array
        $result[$arr[$i]] = $array[$arr[$i]]  ;
    }else{
            // this is the trick of the solution
            $cResult = current($result);
            unset($result);
            $result = array() ;
            $result[$arr[$i]] = $cResult[$arr[$i]]  ;

    }

}

var_dump($result);

Hope it helps someone in future .


text:
Q: SOAP Webservice keepalive of single request? I have a @WebService class. If I make a connection from clients, sometimes there will be tasks that may last a few minutes. And first if this task is finished, the soap should return the response.
This means the connection for a single request between client and webserver should not time out during this longer request.
How can I configure the timeout for this procedure? And if it is configurable, has this to be done on client or server side?
Thanks

A: Server Side
I would configure it as you would any other request. To the server it doesn't matter if it's a web page or an XML SOAP message (web service). In apache tomcat you can configure the server session timeout duration in the Web.xml file of the application. It should be the same for JBoss and other application servers. The sample below would set the session timeout to 30 minutes.
   <session-config>
      <session-timeout>30</session-timeout>
    </session-config>

Client Side
Most SOAP clients use
Connection: Keep-Alive

in the HTTP header of the request, so this shouldn't be an issue.


text:
Q: Advice on how to transfer space in a BTRFS setup I have had problems with my 40GB root partition and want to transfer space from a second 400GB partition. I have BTRFS installed on top of LVM. For some reason, OpenSUSE decided this for me an installation time and I considered it made sense:
# lsblk
NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0 464.5G  0 disk
`-sda1            8:1    0 464.5G  0 part
  |-system-swap 254:0    0     2G  0 lvm  [SWAP]
  |-system-root 254:1    0    40G  0 lvm  /
  `-system-opt  254:2    0 422.5G  0 lvm  /optLVM
sr0              11:0    1  1024M  0 rom

# btrfs filesystem show
Label: none  uuid: 681e689d-1ac2-48ac-9fba-f6a6e234e9f5
    Total devices 1 FS bytes used 28.40GiB
    devid    1 size 40.00GiB used 35.53GiB path /dev/mapper/system-root

Label: none  uuid: 90b22bed-5924-425d-ac30-03279f970fa0
    Total devices 1 FS bytes used 159.43GiB
    devid    1 size 300.00GiB used 299.04GiB path /dev/mapper/system-opt

As you see, /dev/mapper/system-opt only has 300GB, so I have 100 GB free there as I did a btrfs resize to free 100 GB.
My problem is that I don't know how to add those 100GB into / directory (/dev/mapper/system-root). I have tried:
# btrfs device add /dev/mapper/system-opt /
/dev/mapper/system-opt appears to contain an existing filesystem (btrfs).
Use the -f option to force overwrite.

It seems OpenSUSE formats btrfs on top of dm-1 and dm-2 which probably map to LVM volumes.
# btrfs device usage /
/dev/dm-1, ID: 1
   Device size:            40.00GiB
   Data,single:            33.00GiB
   Metadata,single:         2.50GiB
   System,single:          32.00MiB
   Unallocated:             4.47GiB
# btrfs device usage /optLVM
/dev/dm-2, ID: 1
   Device size:           422.50GiB
   Data,single:           297.01GiB
   Metadata,single:         8.00MiB
   Metadata,DUP:            2.00GiB
   System,single:           4.00MiB
   System,DUP:             16.00MiB
   Unallocated:           988.00MiB

Can I do?
 btrfs device add /dev/dm-2 /

To make / (root btrfs "partition") get the Unallocated 100GB in the dm-2 partition?

A: dm-# is device multipath, so basically btrfs partitions are being treated as LUNs.
The resize option works to expand partitions as well as reduce them.
 btrfs filesystem resize +100G /

You may need to do something similar at the device level first to move the free space to the logical drive that holds the root partition.
btrfs reference at kernel.org seems to show that the command I listed may do the trick.

A: It looks like your BTRFS filesystems are stored on LVM logical volumes. In LVM, logical volumes are made up of chucks (extents) which come from physical volumes (disk partitions) which are grouped together as a single unit known as a volume group. For example, in your case it looks like the OpenSUSE installer did the following:

*

*Created an LVM physical volume on /dev/sda1 (ex. pvcreate /dev/sda1)

*Created an LVM volume group named system (ex. vgcreate system /dev/sda1)

*Created the LVM logical volumes swap, root, and opt.

You can confirm this with the commands pvdisplay, vgdisplay, and lvdisplay.
Your system volume group has 464.5G of storage it can divide up into logical volumes. So reallocating 100G from opt to root is a matter of:

*

*Shrinking the /optLVM filesystem (which you've done).

*Shrinking the opt logical volume with lvreduce. Be careful with this. If you shrink it too much you'll ruin /optLVM

*Resizing the root logical volume with lvresize to give it the additional 100G.

*Resizing the / filesystem to inhabit the additional space.


text:
Q: PDF rendered as text I'm using PHP to generate a PDF via browser for my web-application. Recently, the client changed the webserver to Apache and now this feature is no longer working. Instead of generating the PDF, the browser is showing the PDF as text, just as it was ignoring Content-Type (that is set to "application/pdf"). In fact, I successfully simulated the problem by commenting the line setting the Content-Type in the source code.
I need ideas about where and what to look for, any help will be very welcome :)

A: Since you generate PDF files through PHP, you can try to add these headers:
$file_default = 'default filename you want to appear when the user downloads.pdf';
$file_location = '/path/to/file.pdf';
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$file_default);
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file_location));
ob_clean();
flush();
readfile($file_location);

A: I guess you'd have to force apache to download PDF content rather than showing:
check this: http://www.thingy-ma-jig.co.uk/blog/06-08-2007/force-a-pdf-to-download


text:
Q: Which model to use when data comes from a questionaire? 0 I have a categorical dependent variable and several nominal and ordinal independent variables. These independent variables are questions from a questionaire. But some of the questions are only answered by some respondents depending on their responses to previous questions. Also, some questions allow you to select more than one answer. So, because of the complexity of this questionaire (and as a result the independent variables), I was wondering whether you knew which model I should use?

A: There is no perfect model one can recommend at this moment nor any particular moment unless you try several models on your data. R has great Logistic Regression models that you may try.
When you try several models based on some metric you will find the best model. Usually the cross validation is the way to detect which model is the best for your data.
Cross validation is not great just to detect if your model has good predictive capacity for the dependent feature, but also it can help you determine the relation in between independent features.


text:
Q: racket how to define function as another function in procedure I am trying to make a helper function that will take input of switched syntax.
Helper function needs to be able to do:
> (num sqr) ; where num=6, and sqr is the math function square.
36

Originally, the built-in syntax would be:
>(sqr num) ; where num=6
36

Since I cannot declare 'num' as a function and a variable at the same time, I will need to nest another procedure into it. Below is what I have so far:
(define (num func)
  (display func + 6))

Now, I know that 'display' won't easily do what I'd like it to do unlike other programming languages. Is there another method in place of 'display' that I can use? I think this is the easiest way to do it, but I am new so I'm not sure which is an appropriate method. 'func' will need to be able to take math functions like 'sqr' 'sqrt' 'add1'...etc.

A: Do you mean something like this?
#lang racket
(define ((partial func) arg)
  (func arg))

((partial sqr) 6)

The output is 36.

A: If you just want (num sqr) to work like in your code you can do this:
(define (num fun)
  (fun 6))

(num sqr) ; ==> 36
(num add1) ; ==> 7

But num won't be 6.
A solution might be to make yourself a module language, perhaps called #!lefthanded-racket where the parser for code just reverses all lists. Thus you can supply it code like:
#!lefthanded-racket

(6 num define)
(num sqr)  ; ==> 36
(num add1) ; ==> 7

((((((1 y -) x ack) (1 x -) ack) (y x))
                              (2 (1 _))
                        ((y 2 *) (y 0))
                              (0 (0 _))
                             (y x) match*)
                           (y x ack) define)
(4 2 ack) ; ==> 65536

For the simple solution, where you just override the default reader and deep reverse the lists you'll have problems with dotted lists. In order to get that right you need to write a parser.
The code that is run won't be in reverse, only the code you write. There is some documentation on how to create your own language. Also this practical example might be helpful too.


text:
Q: How to solve this challenging integral? How do you integrate $\int_0^1 \frac{(1-x)^{a+2}x^{b+1}}{a+2}dx$, where $a,b$ are constants? I've tried integration by parts, u-sub, and I have had no luck so far. The answer is supposed to be $\frac{(a+1)!(b+1)!}{(a+b+4)!}$.

A: By using the Euler Beta integral, defined as
$$\mathcal{B}(A, B) = \int_0^1 x^{A-1} (1-x)^{B-1}\ dt$$
Setting $A-1 = a+2\ $ and $\ B-1 = b+1\ $, you can easily get the result which is:
$$\frac{1}{a+2}\frac{\Gamma (a+3) \Gamma (b+2)}{\Gamma (a+b+5)}$$
The result in terms of Euler Gamma function is obtained by making use of the general relation:
$$\mathcal{B}(A, B) = \frac{\Gamma(A)\Gamma(A)}{\Gamma(A+A)}$$
To get your final result, remember that Euler Gamma is such that for $A, B \in \mathbb{N}$:
$$\Gamma(A) = (A-1)!$$
Indeed you have
$$\Gamma(A)\Gamma(B) = (A-1)!(B-1)!$$
$$\Gamma(A + B) = (A + B - 1)!$$
In your case then, expanding the whole:
$$\frac{1}{a-2}\frac{(a-2)!(b-1)!}{(a + b + 5 - 1)!} = \frac{(a-1)!(b-1)!}{(a + b + 4)!}$$

A: Binomial Method:
Call $a+2 = N$, $b+1 = M$ then:
$$\frac{1}{a+2}\int_0^1 (1+x)^N x^M\ dx$$
Expand the first term in the binomial way:
$$\frac{1}{a+2}\int_0^1 \sum_{k =0}^N \binom{N}{k} x^{N-k} x^M\ dx$$
$$\frac{1}{a+2}\sum_{k =0}^N \binom{N}{k}\int_0^1 x^{N-k+M}\ dx$$
$$\frac{1}{a+2}\sum_{k =0}^N \binom{N}{k}\frac{1}{N-k+M+1}$$
The sum is well known even if it expressed in terms of the Hypergeometric function, and the result is
$$\frac{1}{a+2}\frac{\, _2F_1(-M-n-1,-n;-M-n;-1)}{M+n+1}$$
Where $M = b+1$ and $N = a+2$. Now substitute back.
The above series can be rewritten in terms of the Beta function here below
In any case, we end up with that.


text:
Q: switch recognized item in grxml file I have created a grammar (in grxml format) to recognize the OMV literal (with hu-hu language settings)
This is the problematic part:
<item>oemfau</item>

nuance recognize it, and print 'oemfau', but i want that nuance say, the word is not oemfau, but OMV. How can i switch the word?

A: If your grammar uses tag-format="swi-semantics/1.0, you can use ECMAScript in a <tag> element like this:
<item>
   oemfau
   <tag>out.slot = "OMV"</tag>
</item>

Simply replace "slot" with whatever NL slot you'd like to use in your application.


text:
Q: How to change the size of the legend text in grid_legend command in R? I am using the following command to draw legend on my plot. Since I have more than 30 labels, some of my labels are outside of my plot. I need to know how to decrease the size of my plot.
grid_legend(0.9, 0.6, pch, col, labels, title="Bacterial Phyla")

I tried using cex=1 command and text.width=0.5 comment. But it didn't work. I get an error stating:
"Error in grid_legend(0.9, 0.5, pch, col, labels, text.width = 0.5, title = "Bacterial Class") :
  unused argument (text.width = 0.5)"

A: Not the most reproducible example. But, try setting the cex and other parameters you want to change outside the legend function with par, for example par(cex=2).


text:
Q: How to write Cyrillic text when using the debugging format? While using println! works as expected:
println!("Привет!"); // Привет!

With debugging format however:
println!("{:?}", "Привет!"); // "\u{41f}\u{440}\u{438}\u{432}\u{435}\u{442}!"

Using assert!:
assert!("Привет!" != "Привет!") // 'assertion failed: "\u{41f}\u{440}\u{438}\u{432}\u{435}\u{442}!" != "\u{41f}\u{440}\u{438}\u{432}\u{435}\u{442}!"

Is there any way to have assert! print correctly in debug format?

A: So far as Rust is concerned, it is correct.  The implementation of Debug for str restricts itself to printable ASCII characters so that the output is readable irrespective of codepage or output mechanism.
I don't believe there's anything you can do to change this for strings in general; on a case-by-case basis, you can use Display instead, or create a wrapper around &str that forwards to Display instead of Debug.


text:
Q: std::stringstream.str() outputs garbage I need to save a bunch of image files with numbered indices. I am trying to construct these filenames using a stringstream. However, stringstream.str() does not seem to return the filename, but rather returns some garbage.
Here is the code:
std::stringstream filename;
filename << filepath << fileindex << ".png";
bool ret = imwrite(filename.str(),frame, compression_params);
fileindex++;
printf("Wrote %s\n", filename.str());

Here is the output from one execution:
Wrote ╠±0
Wrote ╠±0
Wrote ╠±0
Wrote ╠±0

Here is the output from another execution:
Wrote ░‗V
Wrote ░‗V
Wrote ░‗V
Wrote ░‗V

Any suggestions? Is imwrite is an opencv function, and I have [code]using namespace cv;[/code] at the top of the file - is there some interference between opencv and std?

A: filename.str() returns a std::string object. You can't printf it directly. Format %s requires C-style string. This should work
printf("Wrote %s\n", filename.str().c_str());

In any case, using C-style functions with C++ objects is not always the best idea.

A: You can't pass a non-POD type like std::string to a C-style variadic function like printf.
You could use C++ output:
std::cout << "Wrote " << filename.str() << '\n';

or, if you like old-school weirdness, extract the C-style string for C-style output:
printf("Write %s\n", filename.str().c_str());


text:
Q: Advice needed from experts about ASP.NET UserControl usage I need some advice here. I have a bunch of 10 products and every product has atleast 200 different pages  associated with it, with varying details about the product. That makes around 2000 pages.
The structure of each page is as follows:
**Product Name
Details About the product ( 500 words or more)
ProductImage | PurchaseDetails**
When a product page loads, I have to read the productname and display a box at the end of the page. This box should pick up an Productimage and PurchaseDetails that corresponds to the productname. For eg: if there is a product called 'AceShampoo', there is an image associated with it called 'aceshampoo.jpg'. Now I cannot read either the image or the description from the database, since it is not stored there. Only the ProductName and Details come from the DB.
My question to experts:
How and where do I store the ProductImage and the PurchaseDetails for fastest and best performance. Also since there are around 200 pages associated with each product, I would want a way where I can cache this and depending on the parameter i.e productname, change the values.
Update: Some products do not have an image or purchase details. So I want to display no details or rather not show it to the users.
How do I go about it. A sample code with explanation would help this novice understand it better.
Thank you for reading this post.

A:
Now I cannot read either the image or the description from the database, since it is not stored there.

No wonder you have 2000 pages to manage. Is there a reason you can't store the images in the database as BLOBs or the product descriptions? This sort of dynamic content is why you would use a database on the back end.


text:
Q: Optimize .ssh/config My .ssh/config:
Host *.gnu.org
  Compression yes

Host bixeon
  User root
  ProxyCommand ssh newton nc -w 1 %h 22

Host freebsd.polarhome.com freebsd
  Port 715
  Protocol 2,1
  Hostname gate.polarhome.com

Host solaris.polarhome.com solaris
  Port 725
  Protocol 2,1
  Hostname gate.polarhome.com

Host openbsd.polarhome.com openbsd
  Port 735
  Protocol 2,1
  Hostname gate.polarhome.com

Host netbsd.polarhome.com netbsd
  Port 745
  Protocol 2,1
  Hostname gate.polarhome.com

Host debian.polarhome.com debian
  Port 755
  Protocol 2,1
  Hostname gate.polarhome.com

Host alpha.polarhome.com alpha
  Port 765
  Protocol 2,1
  Hostname gate.polarhome.com

Host aix.polarhome.com aix
  Port 775
  Protocol 2,1
  Hostname gate.polarhome.com

Host hpux.polarhome.com hpux
  Port 785
  Protocol 2,1
  Hostname gate.polarhome.com

Host redhat.polarhome.com redhat
  Port 795
  Protocol 2,1
  Hostname gate.polarhome.com

Host ultrix.polarhome.com ultrix
  Port 805
  Protocol 2,1
  Hostname gate.polarhome.com

Host qnx.polarhome.com qnx
  Port 815
  Protocol 2,1
  Hostname gate.polarhome.com

Host irix.polarhome.com irix
  Port 825
  Protocol 2,1
  Hostname gate.polarhome.com

Host tru64.polarhome.com tru64
  Port 835
  Protocol 2,1
  Hostname gate.polarhome.com

Host openindiana.polarhome.com openindiana
  Port 845
  Protocol 2,1
  Hostname gate.polarhome.com

Host suse.polarhome.com suse
  Port 855
  Protocol 2,1
  Hostname gate.polarhome.com

Host openstep.polarhome.com openstep
  Port 865
  Protocol 2,1
  Hostname gate.polarhome.com

Host mandriva.polarhome.com mandriva
  Port 875
  Protocol 2,1
  Hostname gate.polarhome.com

Host ubuntu.polarhome.com ubuntu
  Port 885
  Protocol 2,1
  Hostname gate.polarhome.com

Host scosysv.polarhome.com scosysv
  Port 895
  Protocol 2,1
  Hostname gate.polarhome.com

Host unixware.polarhome.com unixware
  Port 905
  Protocol 2,1
  Hostname gate.polarhome.com

Host unknown1.polarhome.com unknown1
  Port 915
  Protocol 2,1
  Hostname gate.polarhome.com

Host centos.polarhome.com centos
  Port 925
  Protocol 2,1
  Hostname gate.polarhome.com

Host miros.polarhome.com miros
  Port 935
  Protocol 2,1
  Hostname gate.polarhome.com

Host hurd.polarhome.com hurd
  Port 945
  # Hurd fails with compression
  Compression no
  Protocol 2,1
  Hostname gate.polarhome.com

I have a feeling it can be written much shorter. How?

A: While I like the shorthand hostname approach, I found it worthwhile to use a shorthand "domain" to better control what things apply where.  Also, as the man page suggests, put the host-specific stuff upfront to override the more general default value you want at the end.  I added a dummy entry to show what I mean (e.g. dummy must go through a different hostname or use a different user or identity than the default).
Host freebsd.polarhome.com freebsd.ph
  Port 715

Host solaris.polarhome.com solaris.ph
  Port 725

...

Host dummy.polarhome.com dummy.ph
  Hostname dummy.polarhome.com
...

Host *.polarhome.com *.ph
  Protocol 2,1
  Hostname gate.polarhome.com


text:
Q: Laravel keeps using hello@example.com with changed conf In mail.php I have changed from fields but I still get mails with demo values. There is no reference to hello@example.com in project, yet I still get this in mail.
'from' => [
        'address' => 'do-not-reply@mysite.net',
        'name' => 'MySite.net',
    ],

Does anyone have an idea what might be wrong?

A: Clear the config cache by running the following Artisan command:
php artisan config:clear

A: If you are using supervisor, ensure you set the right user in the conf file, otherwise you will see the emails are being sent as hello@example.com.
In my case the user is www-data - I set it up as root before and was getting this issue.


text:
Q: How to invoke a variable of another class. I have a problem at calling a variable of another class.Lets say we have class1 and class2    and class2 has a method like :
public Class2{

public void method2 (Element ele, Grammar utterance, String user) {

String speech =................

         }
   }

And my purpose is getting this "speech" variable and passing it to class1. Any ideas about how to do this?

A: You could change void method2(...) to public String method2(...) and return speech. Then in your first class you have an instance of class2 and calling class2.method2(...) will give the class 1 the speech variable

A: You just have to have an instance of Class2 in your other Class1 so example would be:
Class1 mySpeech = new Class1();

Now the object that has access to mySpeech can access the string variable contained as speech is a public variable.
mySpeech.speech

But it is good practice to create getter/setter methods for this which can be created using the eclipse shortcut:
Sources->Generate Getters and Setters

Also when naming a class use capital for the first letter and invoke the camel casing convention.So when your naming a class call it Class1 or ClassOne.

A: You will have to have some kind of public visibility in the object giving the string. Then either pass the string from the first object into the second, or pass the object by reference into the second object (less recommended).
public FirstClass {
    private String speech = "I am the first object!";

    public String getSpeech() {
        return speech;
    }
}

public SecondClass {
    private string speechCopy;

    public void takeSpeech(string speechCopy) {
        this.speechCopy = speechCopy + " (not really, I'm a copy!)";
    }
}

From here, you just have to call the methods to invoke the behavior you want. You can leave the code as it is, but add the get/set methods to each object so that they can be passed variables and references.

A: -Declare before method: public static String speech
-Initialize in method or out: speech="hi"
-Call from the other class (static scope): Class1.speech


text:
Q: Linux environment variable Is there any command to get only the exported variables in RHEL.
For ex: If I exporting multiple variable line by line like below,
export AIR_HOME=value1
export PATH=value2

Is there any command to see only the exported variables. I tried printenv and env and it didn't worked for me it is printing the entire environment variables. Also echo $AIR_HOME will not work in my case since the exported variable name will change in different situation.

A: Your question doesn't make any sense. The printenv and env commands do exactly what you asked for: they print only the exported vars. There is no way to distinguish the vars you added to the environment via the export builtin from those already in the environment.

A: Just:

echo "$VARIABLENAME"

For example for the environment variable $AIR_HOME, use:

echo "$AIR_HOME"


text:
Q: Rownames to column in table not working, converts to list or as.data.frame introduces extra rows My data is a count table of categorical variables from a larger data frame.  My goal is to plot the number of instances of alive/dead for each treatment in that data frame.
The dataframe looks like this:
  Treatment Plate Sex                 Days Status
1          1     1   U                  NA   Dead
2          1     1   U                  NA   Dead
3          1     1   U                  NA   Dead
4          1     1   U                  NA   Alive
5          1     1   U                  NA   Dead
6          1     1   U                  NA   Dead

The data table looks like this:

table(Subset$Treatment, Subset$Status)

           Dead Still_kicking
  1         144             0
  3         141             3
  7         144             0
  10        105            39
  13         69             3
  Control    12            60
  Control2    2            70

I want the row names to column (prefer a one-liner).  When I try to add the column I get this:
> Status$names <- rownames(Status)
Warning message:
In Status$names <- rownames(Status) : Coercing LHS to a list
> Status
[[1]]
[1] 144

[[2]]
[1] 141

[[3]]
[1] 144

If I convert to a data frame I get extra rows:
> Status <- data.frame(Status)
> Status
       Var1          Var2 Freq
1         1          Dead  144
2         3          Dead  141
3         7          Dead  144
4        10          Dead  105
5        13          Dead   69
6   Control          Dead   12
7  Control2          Dead    2
8         1 Still_kicking    0
9         3 Still_kicking    3
10        7 Still_kicking    0
11       10 Still_kicking   39
12       13 Still_kicking    3
13  Control Still_kicking   60
14 Control2 Still_kicking   70

A: You seem to be looking for unclass.
In below example I have used mtcars dataset to convert table(mtcars$cyl, mtcars$am)
     0  1
  4  3  8
  6  4  3
  8 12  2

into dataframe format.
tibble::rownames_to_column can be used to add rownames as the first column.
library(tibble)
rownames_to_column(data.frame(unclass(table(mtcars$cyl, mtcars$am))),
                   "rownames_col")

Output is:
  rownames_col X0 X1
1            4  3  8
2            6  4  3
3            8 12  2


text:
Q: SignalR MessagePack Polymorphism I am implementing a system based on SignalR that will be pushing client events, for message serialization I would want to use MessagePack. When trying to implement the messaging I have run into a problem where SignalR fails to deserialize the messages on the client.
The messages are polymorphic and described with Union attributes, the standard MessagePack Serializer have no problem serializing and deserializing the messages BUT in case of Signal R it fails with error.
The error reported is  System.InvalidOperationException: Invalid Union data was detected.
On the client serialization only works when using the actual class, if I try to use the interface or base class then the error appears.
Classes
[DataContract()]
[MessagePackObject()]
[Union(0,typeof(EntityChangeEventMessage))]
public abstract class EntityEventMessage : IEntityEventMessage
{
}

[DataContract()]
[MessagePackObject()]
public class EntityChangeEventMessage : EntityEventMessage
{
    #region PROPERTIES

    /// <summary>
    /// Gets entity id.
    /// </summary>
    [DataMember(Order = 1)]
    [Key(1)]
    public int EntityId
    {
        get; set;
    }

    /// <summary>
    /// Gets event type.
    /// </summary>
    /// <remarks>
    /// This value identifies database operation such as create,delete,update etc.
    /// </remarks>
    [DataMember(Order = 2)]
    [Key(2)]
    public int EventType
    {
        get; set;
    }

    /// <summary>
    /// Gets entity type name.
    /// </summary>
    [DataMember(Order = 3)]
    [Key(3)]
    public string EntityType
    {
        get; set;
    }

    #endregion
}

[Union(0,typeof(EntityChangeEventMessage))]
public interface IEntityEventMessage
{

}

So this works
connection.On("EntityEvent", (EntityChangeEventMessage d)
This dont work
connection.On("EntityEvent", (IEntityEventMessaged)
So in general it looks like the problem should be in the Microsoft.AspNetCore.SignalR.Protocols.MessagePack library ?
Anyone have implemented such functionality with success ?

A: Currently SignalR does not support polymorphism with MessagePack, more info here.


text:
Q: Handsontable(6.2.2) manualColumnMove not work I want to change column display position by array(DB saved).
//data ex.        def. pos
hot = new Handsontable(container, {
 /*...*/
 columns:[
    {data: 'A'}, //0
    {data: 'B'}, //1
    {data: 'C'}, //2
    {data: 'D'}, //3
    {data: 'E'}  //4
]);

Save Array example.
    arrPos = [2,4,1,3,0]; // want to show col line is, C, E, B, D, A

I wrote hot setting is,
hot = new Handsontable(container, {
 /*...*/
 manualColumnMove: arrPos
/*...*/
});

But, display is A, B, C, D, E(not change). Please help.

A: Everything seems as expected in v6.2.2 (tested on CE, but PRO works the same) https://jsfiddle.net/v6zj9mru/1/
When colHeaders are set to true they do not move, but once you change them to any given array they stick to the moved column.


text:
Q: Can I run IOS app built by ionic2 for a simulation on Windows? Are there any ways to simulate ionic hybrid apps on Windows 7 without using MacOS or virtual machine such as VMware/virtual box?.
Specifically, I read ionic documents and references and tried to apply sim-ios & sim-deploy on Windows 7. However, on Windows, sim-deploy seems not supported.
and the information I am looking for related to this is pretty much out-dated.

A: NO..., To simulate a app you need Xcode installed which you cannot on windows, You can get away with browser testing using Chrome built in browsers but that's about it.
I had the same issue when I wanted to Deploy a IOS app on windows


text:
Q: Make a widget in front of an overlay I'm trying to reproduce the same contextual menu of Pinterest, in Flutter. So I have an overlay, which displays my contextual menu with a background, and I'd like to keep also the current element in front of the overlay.
Here are 2 videos: the Pinterest menu vs My Flutter menu.
To make an overlay I'm using flutter_portal package.
Here is the code of the blue card widget, with the overlay stuff:
import 'package:flutter/material.dart';
import 'package:flutter_portal/flutter_portal.dart';
import 'package:vector_math/vector_math.dart' show radians;

class CardWidget extends StatefulWidget {
  @override
  _CardWidgetState createState() => _CardWidgetState();
}

class _CardWidgetState extends State<CardWidget> with SingleTickerProviderStateMixin {
  late AnimationController controller;
  late Animation<double> degreeAnimation;
  late Animation<double> opacityAnimation;
  bool isMenuOpen = false;
  double menuPosX = 0;
  double menuPosY = 0;

  @override
  void initState() {
    controller = AnimationController(vsync: this, duration: Duration(milliseconds: 200))
      ..addListener(() {
        setState(() {});
      })
      ..addStatusListener((status) {
        if (status == AnimationStatus.forward) {
          isMenuOpen = true;
        } else if (status == AnimationStatus.dismissed) {
          isMenuOpen = false;
        }
      });
    degreeAnimation =
        Tween(begin: 0.0, end: 1.0).animate(CurvedAnimation(parent: controller, curve: Curves.easeOutBack));
    opacityAnimation =
        Tween(begin: 0.0, end: 1.0).animate(CurvedAnimation(parent: controller, curve: Curves.easeOutExpo));

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return AspectRatio(
      aspectRatio: 63.5 / 88.9,
      child: PortalEntry(
        visible: isMenuOpen,
        portal: Container(
          color: Colors.black.withOpacity(opacityAnimation.value / 2),
          child: GestureDetector(
            behavior: HitTestBehavior.opaque,
            onTap: () {
              controller.reverse();
            },
          ),
        ),
        child: PortalEntry(
          visible: isMenuOpen,
          child: GestureDetector(
            onTapDown: (details) {

              if (controller.isCompleted) {
                controller.reverse();
              } else {
                menuPosX = details.globalPosition.dx;
                menuPosY = details.globalPosition.dy;

                controller.forward();
              }
            },
            // Blue card content
            child: Container(
              decoration: BoxDecoration(
                color: Colors.blue,
                borderRadius: BorderRadius.all(
                  Radius.circular(8),
                ),
              ),
              child: Center(
                child: Text(
                  'Card Widget',
                  style: TextStyle(color: Colors.white),
                ),
              ),
            ),
          ),
          // Current contextual Menu
          portal: ContextualMenuWidget(),
        ),
      ),
    );
  }
}

Thank you for your help!

A: Maybe instead of an trying to add an overlay, you can change the color of all the other cards to the same as the background. By that you would achieve the same effect.
You can check if  isMenuOpen is true and save the index of the card on which it was clicked, and in your grid builder function you can change the color of all the cards to the same as the background.

A: Thanks to orotype, instead of making a black overlay, I finally wrapped my cards with an AnimatedOpacity, and passed a callback when the contextual menu is opened/closed to trig the animation.
Result here!
I don't know if this is the best solution, but I like the result.


text:
Q: State-of-the-art methods for forecasting time series array Suppose I have a set of measurements taken at regular intervals, and I want to predict future values of one of those measurements. There are relationships between the variables being measured. For example, some variables may tend to rise together, or one variable might tend to fall when another rises. What are the state-of-the-art methods for this type of forecasting?

A: You could use both Markov chains/hidden Markov models and recurrent neural networks to predict future values in such time series.
As you explicitly ask for state of the art models: some newer and more advanced forms of recurrent neural nets, like a long-short-term-memory net might be interesting to you. Be aware that a) those tend to need huge computation power and b) (though this is undergoing a strong change at the moment) there are still no/very few ready-to-use-out-of-the-box implementations of such models. Most evolved from research prototypes that have been made available to the public. Take a look at e.g. Keras, or http://lstm.iupr.com/ or http://deeplearning4j.org/lstm.html for hints on other open source implementations.


text:
Q: appropriate term for a predicate that has state A predicate (an object that is a boolean-valued function which tests its input for a condition) is generally assumed to be stateless.
What's the most appropriate name for an object which has a testing function with state?
e.g. in Java, the CountTrigger class below returns true only on the Nth time it is tested against a value that matches a desired value, and false otherwise.
 interface QuasiPredicate<T>  // what should this be renamed to?
 {
      public boolean test(T value);
 }

 class CountTrigger<T> implements QuasiPredicate<T>
 {
      // for simplicity, ignore synchronization + null-value issues
      private int remainingTriggers = 0;
      final private T testValue;

      public CountTrigger(T testValue, int count)
      {
          this.remainingTriggers = count;
          this.testValue = testValue;
      }
      @Override public boolean test(T value)
      {
          if (!this.testValue.equals(value))
              return false;
          if (this.remainingTriggers == 0)
              return false;
          if (--this.remainingTriggers == 0)
              return true;
      }
 }

A: Considering it's an interface and interfaces are implemented and not extended then I don't see the problem in your object implementing a predicate.
If you're going to put public CountTrigger(T testValue, int count) in the interface as well then maybe you need a different name. Perhaps IFiniteRule or another suitable synonym. Maybe ask at https://english.stackexchange.com/ ;-)


text:
Q: Efficient way to query database from a program processing big list of items I have a spring batch program with itemReader, itemProcessor and itemWriter.
Say I have 10,000 records to process. For each item I want to fetch data from several database table for deciding some conditions and adding some data.
I believe this will be done during processing.
Question: What is the best design to do this ? I am bit skeptic about running several Select queries for each item injecting SimpleJdbcTemplate in itemProcessor. Is there any other efficient way to do this ??
Thanks in advance!!
Nik

A: Perhaps you should insert the 10,000 "POJOs" into a table in the datanbase, and then run a query that joins that to the other tables?


text:
Q: Is there any way to access C source code in an R package binary? I would like to share my R package but keep the source code until after an article is published. If I compile a package using R CMD INSTALL --build, is there any way for an end user to read the C source code?
According to p 44 of R News 2006-4,

In order to access the sources of compiled code
  (i.e., C, C++, or Fortran), it is not sufficient to have
  the binary version of R or a contributed package
  installed.

I would be satisfied with this knowledge (indeed, I would prefer to release the source), but I need to assuage the fears of my collaborators.
My primary question is to confirm: if I distribute a binary created by R CMD INSTALL --build, will the C source be inaccessible?

Update: it is not very clear to me why this question has received so many down votes (4 at this point). A downvote indicates "This question has not shown any research effort; it is unclear or not useful". I am only asking about native R functionality, not trying to promote any nefarious intent.

A: If the .c source files aren't in the distributed archive file (a .tar.gz for Linux, maybe a .zip for Windows) then no, you can't get the source. I just did a quick test with a skeletal package and a single foo.c file and its not there for me, just a compiled foo.so file.
Unless you've used Rcpp and put the C code into inline R functions, of course.

A: If you have only binary file output it is inaccessible for source code. Only way to get in to some idea is to disassembly. Of course all of your header files should be also compiled.


text:
Q: Always getting 401 Unauthorized with new install of Rails + Devise I have a new install of Rails and am trying to set up authentication with Devise. As far as I can tell I have a very basic set up that should work, but whenever I try to log in with the default Devise sign in form I get an Unauthorized error. I am sure my credentials are correct as I created a User to test with in the console like so:
User.new({:email=>'mark@markdavies.com.au', :priv_level => 'admin', :password=>'mypassword', :password_confirmation=>'mypassword'}).save

My User model:
class User < ActiveRecord::Base

  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable,
  # :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :confirmable

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me, :priv_level, :unconfirmed_email
  # attr_accessible :title, :body

  has_one :supplier

end

My log:
Started POST "/admin/user/sign_in" for 127.0.0.1 at 2012-12-22 13:10:56 -0500
Processing by Admin::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"wYLsalxN9rTv8P8bvYuT0wZcvlFbu6b1SvoCyKtTCII=", "admin_user"=>{"email"=>"mark@markdavies.com.au", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."email" = 'mark@markdavies.com.au' LIMIT 1
(0.1ms)  begin transaction
(0.0ms)  commit transaction
Completed 401 Unauthorized in 69ms

Is there any way I can get more information about what is failing from Devise? When I create the user in the console is the encryption used different than through the forms?

A: Well this little exercise in frustration turned out to be a good lesson in RTFM. I had set up Devise with confirmable, and when I created my layouts I neglected to insert the following lines:

<%= notice %>

<%= alert %>

... as it clearly states to do in the getting started guide. When I inserted these I got the error message "You need to confirm your email address before logging in."
In the console I set confirmed_at = Time.now for the User, and voilà, I can now log in.

A: In my situation it causes by this
before(fails with 401)

resources :users
devise_for :users

after(success)

devise_for :users
resources :users

so, try to make right order in routes.rb


text:
Q: Making change in Base Activity to reflect changes in All derived Activities? I have a
public abstract class BaseActivity extends Activity {

protected void setCustomHeader(String title,String subText){
   }
}

and two other Classes Extending the BaseActivity class.
public class ListActivity extends BaseActivity {
           setCustomHeader("List","Child1");
}

&
public class DetailsActivity extends BaseActivity {
         setCustomHeader("Details","Child2");
}

The BaseActivity generally reduces the code here of creating Custom Action Bar in all child activities, which works just fine.
I wish to change the Custom Header in the BaseActivity on some Event (say BroadcastReciever) such that all the other ChildActivity(here ListActivity n DetailsActivity) Extending the BaseActivity also get updated.
Is it possible to change BaseActivity only and without making changes to ChildActivity I enforce all childrenActivities to update its Custom Header based on the event recieved from Broadcast reciever?
EDIT: I don't want to write a receiver for each and every activity so I am trying this approach, please suggest if any better approaches are there.

A: You could probably achieve this in several ways, but all of which will require a check in the BaseActivity's onResume() to reset the theme appropriately when they're actually being displayed...
First (and I'm probably going to get chewed out for suggesting this) and quickest would be to use a static variable containing the appropriate values of whatever you're trying to accomplish.
private static WhateverData o;

All you'd have to do is call:
public static void set(WhateverData o){
    BaseActivity.o = o;
}

And in your Activity's onResume() method you would recreate whatever Views you want, based on the currently set static object.
Why is this approach not the best? There are a couple reasons. Using non-final static variables runs a bigger risk of NPE's (you definitely need to handle a default case where the value is null) and the data may not always be available when needed (due to the OS killing it, etc.).
Now, a better approach could be to use the SharedPreferences in the same way you'd use the static variable. This will ensure that the data persists and is always available (but, again, you should still handle the default null case).
public static WhateverData getWhateverData(Context context){
    return context.getSharedPreferences(BaseActivity.class.getName(), 0).getWhateverData("data_key", default);
}

public static void setWhateverData(Context context, WhateverData o){
    context.getSharedPreferences(BaseActivity.class.getName(), 0).edit().putWhateverData("data_key", o).commit();
}

And then for actually using it, you can just override onResume() once in your BaseActivity:
@Override
protected void onResume(){
    super.onResume();
    WhateverData data = BaseActivity.getWhateverData(this);
    // Now do something cool with that data
}

Clearly you have to implement those methods to handle whatever type of data WhateverData is, but I'm just trying to point you in the right direction...

A: When I modified the Method of the baseActivity on the Broadcast event and tested I realized that all the children automatically were updated, and hence got what i was looking for.
That was is purpose of Inheritance of classes.
Actually I was confronted by someone that the children won't get updated from the Base and hence posted without testing.
PS: whenever you are confronted by anyone, just never give up, you need to test the working of your implementation.
Lesson learnt.

A: In this BaseActivity
public abstract class BaseActivity {
  protected abstract void refresh();
}

And your child Activity:
public class YourActivity extends BaseActivity {
   protected void refresh(){
    // This your code
    }
}


text:
Q: Import related errors- express js I am trying to use "module" type javascript with express-js first time. I am trying to create a book tracking application, but I am getting some error when I try to import routes in the main js file, it says cannot find module.
Directory structure:

app.js:
import dotenv from "dotenv";
dotenv.config();

import express from "express";
import bodyParser from "body-parser";
import cors from "cors";
import mongoose from "mongoose";

// import routes
import authRoutes from "./routes/auth";

// db config
mongoose
  .connect(process.env.DB_URI, {
    useNewUrlParser: true,
    useUnifiedTopology: true,
  })
  .then(() => console.log("DB Connected"))
  .catch((err) => console.log(err));
// constants
const app = express();
const port = process.env.PORT || 5001;

// middlewares
app.use(bodyParser.json());
app.use(cors());

// using routes
app.use("/api", authRoutes);

app.listen(port, () =>
  console.log(`Server is running on http://localhost:${port}/`)
);

routes/auth.js:
import express from "express";

const router = express.Router();

router.get("/auth", (req, res) => {
  res.send("Hello from auth");
});

export default router;

package.json:
{
  "name": "server",
  "version": "1.0.0",
  "main": "app.js",
  "license": "MIT",
  "type": "module",
  "dependencies": {
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "dotenv": "^10.0.0",
    "express": "^4.17.1",
    "mongoose": "^6.0.5"
  }
}

error:

Note: Other imports related to database models are all working fine!

A: Add js extension Node ESM does not work without it
import authRoutes from "./routes/auth.js";


text:
Q: Multiline class name to single line in PhpStorm/VSCode/Sublime Not sure if this relevant question or not
Here is an example HTML block

Is there any easy way that I can change all those class names to a single line?
Expected output:

A: In PhpStorm or any other JetBrains IDE:

*

*Select the lines

*Invoke "Code | Join Lines" (Ctrl + Shift + J here on a Windows keymap)

Final result:

Notes:

*

*first line indent will remain

*may have an extra space in some places (in this case before the first class name: <div class=" ltr:ml-auto)


text:
Q: Javascript: Concat an array while maintaining objects I have two arrays:
ArrayOne = new Array(Array1, Array2);
ArrayTwo = new Array(Array3, Array4);
ArrayThree = new Array();

I want to do:
ArrayThree = ArrayOne.concat(ArrayTwo);

With the result:
ArrayThree = {ArrayOne, ArrayTwo}

However this operation results in:
ArrayThree = {ArrayOne[0], ArrayOne[1]... ArrayOne[n], ArrayTwo[0], ArrayTwo[1]... ArrayTwo[n]};

Any advice on how to get {ArrayOne, ArrayTwo} so the original array object is maintained?
Thanks

A: var ArrayThree = [ ArrayOne, ArrayTwo ];

A: If you can't use concat function...
var ArrayThree = [ArrayOne, ArrayTwo];

or even,
var ArrayThree = new Array(ArrayOne, ArrayTwo);

not a problem if you have ArrayThree previously initialized


text:
Q: Error while installing mysqlclient on Fedora25 I am trying to install mysqlclient in my virtual environment which runs on python3.5.2 but it always throws error as:
(venv) [kevran@localhost mysite]$ pip install mysqlclient
  Collecting mysqlclient
  Using cached mysqlclient-1.3.10.tar.gz
    Complete output from command python setup.py egg_info:
    /bin/sh: mysql_config: command not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-m92fr1vk/mysqlclient/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "/tmp/pip-build-m92fr1vk/mysqlclient/setup_posix.py", line 44, in get_config     libs = mysql_config("libs_r")
      File "/tmp/pip-build-m92fr1vk/mysqlclient/setup_posix.py", line 26, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    OSError: mysql_config not found

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-m92fr1vk/mysqlclient/

A: Yu need to install mysql-devel package in OS.
yum install mysql-devel

or something like that.


text:
Q: Why are there black lines between my sprites? I have a single pixel sprite. To this sprite I add four sprites, each a quarter of a square. To offset the sprites, all i do is change their anchor points.
For example:
top right square is at anchor: (0,0);
bottom right : (0,1);
bottom left : (1,1);
top left : (1,0);
I expected the sprite edges to meet perfectly so that it looks like one big square. Instead there are black lines between the edges of each square so it looks like I have placed four squares close together.
I use texture packer to create a sprite sheet, containing the various squares.
Is there some setting in cocos2d-x or some code I must change to get the sprites to align perfectly ?
Edit: This is for cocos2d-x 3.1.1 and higher. Changing the anchor point is necessary and unavoidable.
EDIT: I use sprite frames from a sprite sheet created using TexturePacker. This was the problem. See my answer below.

A: The problem has something to do with using a sprite sheet (created using TexturePacker) to hold the pieces together. When you place the frames from the sprite sheet together to form a complete image the lines appear.
You can make the black lines disappear by setting the "Extrude" option in Texturepacker to at least 1.
EDIT: For those of you updating sprite positions based on a physics simulation, black lines can be caused by "sub pixel" positions. Try to either move your objects by complete pixels. Or search for answers with "sub pixel" for other solutions.

A: casting positions calculations to int type didn't help ?
Generally after certain float calculations like multiplying and divide and then complier auto demoting to to int may result in variation of 1px.
for example 26.500123 can be treated as pixel 26 or 27, depending to your casting methodology.
Test Case:
Are you saying you did this ?
auto testNode = Node::create();
auto s1 = Sprite::create("Images/1.png");
s1->cocos2d::Node::setAnchorPoint(Point(1,0));
auto s2 = Sprite::create("Images/2.png");
s2->cocos2d::Node::setAnchorPoint(Point(0,0));
auto s3 = Sprite::create("Images/3.png");
s3->cocos2d::Node::setAnchorPoint(Point(1,1));
auto s4 = Sprite::create("Images/4.png");
s4->cocos2d::Node::setAnchorPoint(Point(0,1));
testNode->addChild(s1);
testNode->addChild(s2);
testNode->addChild(s3);
testNode->addChild(s4);
testNode->setPosition(Point(screenSize.width/2,screenSize.height/2));
this->addChild(testNode);

and you got 1px gap ? i did that same with cocos2dx 3.1
i got this fine lady

A: *

*Don't change anchorPoint, you'll regret it later. Calculate the correct position for each sprite.

*Make sure the position x/y are on pixel boundaries. Casting to int will do the trick though Retina devices allow for 0.5 positions as well due to pixel density being 2x the point resolution.
Point #2 is also why you shouldn't use anchorPoint because you can't cast the position to integers when offsetting the texture with the anchorPoint.


text:
Q: Make custom listview dialog look like standard dialog listview I have a dialog with a listview, the first dialog is for selecting an item and the second one is when you edit the dialog. The first one uses a standard dialog box with no custom layout but for the second one I had to use a custom layout to get the picture in place (if anyone knows how I can populate a standard multiple choice dialog with an typed arrayadapter and item template let me know :)). The first dialog looks like standard dialog should look like but how can I get the second one to look the same with white background, lines between the items etc and be sure it always looks like the standard one even when that one is changed.
Standard

(source: filedump.net)
Custom

(source: filedump.net)
/Viktor

A: For the same, you need to use setMultiChoiceItems while creating dialog. I hope this example helps you: Android Multi selection dialogs
And also check this example: Android: Spinner-Like UI for Selecting Multiple Options


text:
Q: CSS Spacing Issue and Lag When Scrolling Down Into New Background Images I am currently building a Homepage using the CSS background-attachment property to create a scrolling background effect.
I have multiple backgrounds with a content section in between each one. After the first content section, there is a long small white space before the next background image and I am not sure how to get rid of that space.

Another issue I am having is with the actual performance of the page.
When I scroll to a new image, there is about a one second or two second delay before it will actually show the image. In other words, the screen actually freezes for a few seconds when attempting to scroll to a new background.
I don't think this matters at all but I am building this as an ASP.NET MVC web application.
Here is my HTML:

                        Lorem ipsum dolor sit amet, consectetur adipisicing  elit. Dolore incidunt suscipit similique, dolor corrupti cumque qui consectetur

Lorem ipsum dolor sit amet.

                        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore incidunt suscipit similique, dolor corrupti cumque qui consectetur autem laborum fuga quas ipsam doloribus sequi, mollitia, repellendus sapiente

Here is my CSS:
    body, html, main {
    /* important */
    height: 100%;
}

.cd-fixed-bg {
    min-height: 100%;
    background-size: cover;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-position: center center;
}

.cd-fixed-bg.cd-bg-1 {
  background-image: url('../Images/portfolio1.jpg');
}
.cd-fixed-bg.cd-bg-2 {
  background-image: url('../Images/portfolio2.jpg');
}
.cd-fixed-bg.cd-bg-3 {
  background-image: url('../Images/portfolio3.jpg');
}
.cd-scrolling-bg {
    position:relative;
    min-height: 70%;
    padding: 4em 0;
    line-height: 2.7;
    z-index: 2;
    top: 0%;
    bottom: 0%;
    left: 0%;
}
.cd-intro {
    position: absolute;
    left: 50%;
    top: 50%;
    background-color: inherit;
    z-index: 100;
    text-align:center;
    height: 400px;
    margin-top: -200px;
    color: white;
    width: 600px;
    margin-left: -300px;
    font-size: 45px;
    font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
.cd-container
{
    width: 90%;
    max-width: 768px;
    margin: 0px auto;
}
.cd-scrolling-bg.cd-color-3 {
    background-color: #b4d7a8;
    color: #3d3536;
}
.cd-scrolling-bg.cd-color-2 {
    background-color: #b4d7a8;
    color: #3d3536;
}
.cd-scrolling-bg.cd-color-3 {
    background-color: #b4d7a8;
    color: #3d3536;
}

A: The white-space is created by p and h2.
In HTML the paragraphs and headings have margin by default, so reset either all or just the one you need it.
I removed the left:50% from your first  cd-intro due to creating horizontal scrollbar.

*,
*::before,
*::after {
  box-sizing: border-box
}
body,
html,
main {
  /* important */
  height: 100%;
  margin: 0
}
.cd-fixed-bg {
  min-height: 100%;
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: center center;
}
.cd-fixed-bg.cd-bg-1 {
  background-image: url('//lorempixel.com/900/900/sports');
}
.cd-fixed-bg.cd-bg-2 {
  background-image: url('//lorempixel.com/900/900/animals');
}
.cd-fixed-bg.cd-bg-3 {
  background-image: url('//lorempixel.com/900/900/city');
}
.cd-scrolling-bg {
  position: relative;
  min-height: 70%;
  padding: 4em 0;
  line-height: 2.7;
  z-index: 2;
  top: 0%;
  bottom: 0%;
  left: 0%;
}
.cd-intro {
  position: absolute;
  top: 50%;
  background-color: inherit;
  z-index: 100;
  text-align: center;
  height: 400px;
  color: white;
  width: 600px;
  font-size: 45px;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
.cd-container {
  width: 90%;
  max-width: 768px;
  margin: 0px auto;
}
.cd-scrolling-bg.cd-color-3 {
  background-color: #b4d7a8;
  color: #3d3536;
}
.cd-scrolling-bg.cd-color-2 {
  background-color: #b4d7a8;
  color: #3d3536;
}
.cd-scrolling-bg.cd-color-3 {
  background-color: #b4d7a8;
  color: #3d3536;
}
h2, p {
  margin: 0
}

      some text

        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore incidunt suscipit similique, dolor corrupti cumque qui consectetur

Lorem ipsum dolor sit amet.

        Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore incidunt suscipit similique, dolor corrupti cumque qui consectetur autem laborum fuga quas ipsam doloribus sequi, mollitia, repellendus sapiente


text:
Q: Minimize term without Karnaugh map I have the following term, that should get minimized with Boolean algebra (no Karnaugh map!):
(a ∧ ¬b ∧ c) ∨ (a ∧ c ∧ d) ∨ (b ∧ d)
I already figured out, that the minimzed term is as follows (everything without the middle term) and it makes totally sense to me:
(a ∧ ¬b ∧ c) ∨ (b ∧ d)
However when I try to get same result with boolean algebra I am not able to reproduce it.
My first step is the following:
(a ∧ c) ∧ (¬b ∨ d) ∨ (b ∧ d)
When I apply distributivity-law I end up with the first (non-minimized) term.
Edit: Besides the question above, more general: Can every term that is minimizable by a Karnaugh map be minimized with boolean algebra?

A: \begin{align}
a\overline{b}c+acd+bd & = a\overline{b}c + acd(b+\overline{b}) + bd \\
& = a\overline{b}c + acdb+acd\overline{b} + bd \\
& = (a\overline{b}c + a\overline{b}cd) + (bd + bdac) \\
& = a\overline{b}c + bd \\
\end{align}