text:
Q: Cannot cast from View to Chronometer I did everything right, I guess? I saved the xml file, but have no idea how to solve this. I'm a newbie, pls help.
Here's my xml code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  >
<Chronometer
 android:id="@+id/my_chronometer"
 android:layout_gravity="center_horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
 />
<Button
 android:id="@+id/buttonstart"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="Start"
 />
<Button
 android:id="@+id/buttonstop"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="Stop"
 />
<Button
 android:id="@+id/buttonreset"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:text="Reset"
 />
</LinearLayout>

chronometer.java:

A: The problem is with your class name I think. It has the same name as "Chronometer". This might be the cause for it. Try to replace the Activity name to something else. Maybe "chronometer" with small letter "c".

A: I think there is no mistake in your code, but I think you are missing the import the the Chronometer.
Please add this import in your class,
  import android.widget.Chronometer;

Good luck.


text:
Q: Use of unassigned local variable error C# This is with regard to previous question posted a while ago
 Remove -1 entry from integer array
I know there are blazing fast solutions , one line answers as posted in answer section  to previous posted question , but being a newbie I tried doing by for loops.
  int[] arr = new int[]{ 1, -1, -1, 1 };
            int[] new_arr;
            int index = 0;
            for (int i = 0; i < arr.Length; i++)
            {
               // Console.WriteLine(arr[i]);
                if (arr[i] == -1)
                    continue;
                else
                    new_arr[index++] = arr[i];
            }

I am getting error

Use of unassigned local variable 'new_arr'

what am I doing wrong.
EDIT
        int[] arr = new int[]{ 1, -1, -1, 1 };
        int[] new_arr = new[arr.Length]; //Error being shown at this line
        int index = 0;
        for (int i = 0; i < arr.Length; i++)
        {

            if (arr[i] == -1)
                continue;
            else
                new_arr[index++] = arr[i];
        }

        for(int j=0;j<new_arr.Length;j++)
            Console.WriteLine(new_arr[j]);

A: The compiler is warning that you haven't initialized the new_arr variable and you cannot use it later:
int[] new_arr = new int[arr.Length];

In this case I am initializing the new_arr array to the same size as the arr array.

A: You haven't initialized your array new_arry. You need to specify its size.
int[] new_arr = new int[10];

Inside your code you are doing:
new_arr[index++] = arr[i];

Here since the array has not been initialized and you are trying to use it, that is why you are getting this error.
You may use List<int> instead of the array, because it seems you are not sure about the Size of the array in your code.
So your code would be:
int[] arr = new int[]{ 1, -1, -1, 1 };
List<int> tempList = new List<int>();
int[] new_arr;
int index = 0;
for (int i = 0; i < arr.Length; i++)
      {
       // Console.WriteLine(arr[i]);
         if (arr[i] == -1)
              continue;
         else
            tempList.Add(arr[i]);
      }
new_arr = tmepList.ToArray();

Or the complete code can be shorten to:
int new_arr = arr.Where(r=> r!= -1).ToArray();

A: you haven't assigned your variable new_arr. Therefore it is showing error. Your code can be like this-
int[] arr = new int[] { 1, -1, -1, 1 };
        int[] new_arr = new int[4];
        int index = 0;
        for (int i = 0; i < arr.Length; i++)
        {
            // Console.WriteLine(arr[i]);
            if (arr[i] == -1)
                continue;
            else
                new_arr[index++] = arr[i];
        }
        for (int i = 0; i < new_arr.Length; i++)
        {
            Console.WriteLine(new_arr[i]);

        }

You can't use any un-assigned or dangling variable in c#. Do not assign new_arr to null. It will throw null reference exception.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to activate iAd Network in iTunes Connect? I want to activate iAd Network in iTunes Connect but with no success, iAd network is still in "Contracts In Process".
I've entered contact informations, Bank Info is alreday entered for paid apps and Tax Info I don't have since I'm from Croatia.
Here is ss of "Contracts":

And when I go to setup "Bank Info" I see next:

.. so this means that I don't need to do anything here.
And when I go to "Tax Info" I see next:

.. so that also means that I don't have do anything here because I'm from Croatia and that step applys to Canada and US.
What do I need to activate the iAd Network?

A: You need to fill out the US tax forms -- take a look at your screenshot: Note that U.S. tax forms are required for everyone.


text:
Q: Vue Media Manager for image upload I have a problem with vue media manager, it's a div with drag drop
<div
            class="modal-content"
            id="dragdropzone"
            :class="{ 'has-active-dropzone': dragging }"
            :data-dropzone-text="__('Drop your files here')"
            @dragstart.prevent
            @dragend.prevent="dragging = false"
            @dragover.prevent="dragging = true"
            @dragleave.prevent="dragging = false"
            @drop.prevent="handleFiles($event.dataTransfer.files)"
        >

The problem is i don't have button to upload browse the files
It's only drag and drop, i tried to put on vue this input with type="file" but got vue crash
<input type="button" ref="media2" id="btn-add-file" value="Upload" multiple accept="image/*" name="fileupload" :disabled="$parent.busy" class="btn btn-secondary" @change="handleFiles($event.dataTransfer.files)">

This is the console error and page blank:


text:
Q: How to copy row in table with key column How to copy a row while in her auto-increment key column
INSERT [Table] SELECT * FROM [Table] where [Table].[id]=7

not work

A: Imagine that your AUTO_INCREMENT (in SQL-Server It's IDENTITY) column's name is col1 so you can try (not include It in select list):
INSERT INTO [Table1] (col2, col3, col4) -- specify all columns except col1
SELECT col2, col3, col4 -- specify all columns except col1
FROM [Table2]
WHERE [Table2].[id]=7

Following example working fine:
CREATE TABLE #Temp1
(
    ID INT NOT NULL IDENTITY (1,1),
    Name NVARCHAR(40)
)
GO
CREATE TABLE #Temp2
(
    ID INT NOT NULL IDENTITY (1,1),
    Name NVARCHAR(40)
)
GO
INSERT INTO #Temp1 (Name) VALUES ('Lisa'), ('Jesicca'), ('John')
GO
INSERT INTO #Temp2 (Name)
SELECT Name
FROM #Temp1
GO
SELECT * FROM #Temp1
GO
DROP TABLE #Temp1
DROP TABLE #Temp2


text:
Q: What response status code is returned when a YouTube playlist is full? To save me having to fill a playlist with 200 videos, could someone tell me if a specific response status code is returned when trying to add a video to a playlist already containing 200 videos?
I want to avoid checking the size of a playlist each time before adding a video.
Thanks.

A: After creating a playlist with 200 videos and attempting to add another, the response status was '400 Bad request', along with a body of XML with an internal reason "Playlist too big".

A: I'm fairly sure you'll get back a 403 Forbidden in that scenario, with the response body containing an XML document detailing the reason for the error.
If you happen to be using the Java GData client library, it will be deserialized as a ServiceForbiddenException, as you can see from this code.


text:
Q: Add actionPerformed with array I am coding a Tic-Tac-Toe game.
I created the buttons via an array but now I tried to add an ActionListener and an actionPerformed to every Button via a for-loop. When I try to do that an error occurs :

Local variable i defined in an enclosing scope must be final or effectively final

I don't know how to fix that. (At line 35: System.out.println("You clicked the Button" + i + ", " + k);)
import java.awt.FlowLayout;
import java.util.Random;
import java.awt.event.*;
import javax.swing.*;

public class TicTacToearray {

    static String players;
    static JLabel gametext;
    static int round;
    static int maxWidth = 3;
    static int maxHeight = 3;
    static JButton[][] buttonfields = new JButton[maxWidth][maxHeight];

    public static void main(String[] args) {
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (UnsupportedLookAndFeelException e) {
            e.printStackTrace();
        }
        JFrame mainFrame = new JFrame("Tic-Tac-Toe");
        mainFrame.getContentPane().setLayout(new FlowLayout());
        for (int i = 0; i < maxWidth; i++) {
            for (int k = 0; k < maxHeight; k++) {
                buttonfields [i][k] = new JButton("  ");
                mainFrame.add(buttonfields[i][k], maxWidth * i + k);
                buttonfields[i][k].addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        System.out.println("You clicked the Button" + i + ", " + k);
                        System.out.println("Does that work:" + buttonfields[i][k]);
                    }
                });
            }
        }
        mainFrame.pack();
        mainFrame.setVisible(true);
        mainFrame.setResizable(true);
        mainFrame.setSize(180,150);
        mainFrame.setResizable(false);
        JLabel gametext = new JLabel();
        mainFrame.add(gametext);
        mainFrame.setLocationRelativeTo(null);
        Random rand = new Random();
        int beginnernr = rand.nextInt(2);
        if (beginnernr == 1) {
            players = "O";
            gametext.setText("It's " + players + " turn!");
        } if (beginnernr == 0) {
            players = "X";
            gametext.setText("It's " + players + " turn!");
        }
        if (round == 9) {
            gametext.setText("Game Over");
        }
    }
}

A: The 'Anonymous' new ActionListener() {...} (it can be replaced with a lambda) you are trying to create is something it will be executed after the action on the button will be done. To be able to compile the values used inside that anonymous/lambda they need to be final to guarantee they are accessible on runtime.
A quick fix can be something like:
final int finalI = i;
final int finalK = k;
buttonfields[i][k].addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
        System.out.println("You clicked the Button" + finalI + ", " + finalK);
        System.out.println("Does that work:" + buttonfields[finalI][finalK]);
    }
});

In addition, using lambdas the code can look like:
final int finalI = i;
final int finalK = k;
buttonfields[i][k].addActionListener(e -> {
    System.out.println("You clicked the Button" + finalI + ", " + finalK);
    System.out.println("Does that work:" + buttonfields[finalI][finalK]);
});

A bit more compact.


text:
Q: Is Node Interface in Javascript an object? I am a new beginner in web developing. I have some trouble to understand the relationship between DOM Interfaces and Objects (Object-oriented programming concept). Could someone please help me to get a definitive answer for the questions bellow?
1) Does the Node Interface in Javascript represent a Class with properties and methods as described in https://developer.mozilla.org/en-US/docs/Web/API/Node ?
2) If I am not mistaken, all DOM Interfaces such as Document and Elements are also Nodes ---> Document Nodes, Element Nodes, Text Nodes....Would that means all of those DOM Interfaces are children Classes of the Node Class? and all of the HTML elements and attributes such as (p, div, a, img,...) are both Node Objects and DOM Interface Objects - which they belong to?
Update #1:
I am trying to learn web programing from site like Codecademy, W3Schools and many other online sources. However, even with some understanding about Javascript and Object-oriented Programing, I have problem understanding and connecting the dots on how DOM Interfaces components work with each other in terms of Object-oriented Programing such as Classes, Objects, Properties and Methods... I could not find a source to actually bridge the gap between learning the Javascript Programing Language and actually using the language and its Object-oriented methodology in real life (through DOM Interfaces ofcourse).

A: For 1, yes, but get your terminology right. Classes are objects in javascript, they're just called classes, not "object classes".
For 2, yes as well, but they don't implement the NODE interface directly. All the different types of nodes inherit HTMLElement, which from mdn, inherits the NODE interface. You can just look up the inheritence chain:
document.createElement('p').__proto__.__proto__ == HTMLElement.prototype
HTMLElement.prototype.__proto__ == Element.prototype
Element.prototype.__proto__ == Node.prototype


text:
Q: nwb build-react-app creates root path rather than relative path I am testing out nwb to streamline building react apps using this example project. While the app is built, the path of css and js files referenced in index.html are in root rather than relative. Is there any way to change the referencing?
For example:
In the html, the reference are the following,
<script type="text/javascript" src="/vendor.b3f34f12.js"></script>
<script type="text/javascript" src="/app.9b5c57d3.js"></script>

Instead of,
<script type="text/javascript" src="./vendor.b3f34f12.js"></script>
<script type="text/javascript" src="./app.9b5c57d3.js"></script>

A: You can use webpack.publicPath in your nwb.config.js file for this:

If you want to create a path-independent build, set publicPath to blank:
module.exports = {
  webpack: {
    publicPath: ''
  }
}

Source: https://github.com/insin/nwb/blob/master/docs/Configuration.md#publicpath-string


text:
Q: Equivalent of if let and guard let of Swift in Dart Just started Flutter with native iOS background, so I just have a quick question about Dart beta null safety.
So in Swift, because they have the idea of null safety from the beginning just like Kotlin, there are 2 features that I really like about the language is if let and guard let. These 2 make working with optional values so much easier. I'm not sure if the beta version of Dart has anything like that.
Thanks

A: I'm going to jump in on this, since I'm coming from Swift too and love to use guard a lot. Adding to what @jamesdlin said, the opposite is also true.
So you can functionally do a Swift guard statement:
String? x = possiblyReturnsNull();
if (x == null) return whatever; // This works like Swift's guard
// All code outside the block now treats `x` as NON-nullable.

A: I'm not an expert on Swift, but Dart will use null checks to automatically promote types, and I think that mostly does the job of if let and guard let.
For example:
String? x = possiblyReturnsNull();
if (x != null) {
  // All code within this block treats `x` as non-nullable.
}
// All code outside the block continues to treat `x` as nullable.

Note that promotion won't be performed on non-local variables, so for those you would need to explicitly introduce a local reference. (There is a language proposal to provide a mechanism to allow a nicer mechanism to add a local reference without polluting the outer scope.)

A: A small extension to the accepted answer is that Flutter also allows force-unwrapping an Optional. So in the case you are accessing a non-nil value that is not saved inside a variable, like in a dictionary, you need to unwrap it inside the if-statement:
if (someDict[someKey] != null) {
  print(someDict[someKey]!)
}
//

A: To check null safety in Dart:
value ?? 0


text:
Q: Android Layout: How to align with respect to rightmost view but keep all elements left aligned [short text][image1][image2]____________________________________

[this is a reallyyyyyyy.............y long text][image1][image2]

I have 3 views: one TextView of variable size and two small images (16dp x 16dp) and want to achieve a layout such that images are always shown as 16dp x 16dp and text should be shown in leftover space and ellipsized if too long. The group of 3 views should be all left aligned and be next to each other.
Approaches tried:

*

*LinearLayout with no weights
Drawback: When TextView is large, ImageViews are not shown.

*LinearLayout with weights
Drawback: ImageViews are no longer adjacent to each other but take up space in ratio of weights.

*RelativeLayout - image2: alignParentBottom, image1: toLeftOf="image2", text: toLeftOf="image1"
Drawback: All the elements now are right aligned.
____________________[short text][image1][image2]
How can such a layout be achieved? Preferably without nesting?
Thanks in advance!

A: You should use your third aproach but set the textview gravity to left.
Something like this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:gravity="right"
        android:layout_toLeftOf="@+id/imageView1"
        android:text="TextView" />

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="16dp"
        android:layout_height="16dp"
        android:layout_toLeftOf="@+id/imageView2"
        android:src="@drawable/ic_launcher" />

    <ImageView
        android:id="@+id/imageView2"
        android:layout_width="16dp"
        android:layout_height="16dp"
        android:layout_alignParentRight="true"
        android:src="@drawable/ic_launcher" />

</RelativeLayout>

If you want to keep the textview in only one line use android:singleLine="true"

A: This trick worked for me. Try this if this can help you.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:paddingRight="32dp"
    android:singleLine="true"
    android:text="This is a very large text just to test the alignment of the images with the textview" />

<ImageView
    android:id="@+id/imageView2"
    android:layout_width="16dp"
    android:layout_height="16dp"
    android:layout_alignRight="@+id/textView1"
    android:src="@drawable/ic_launcher" />

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="16dp"
    android:layout_height="16dp"
    android:layout_toLeftOf="@+id/imageView2"
    android:src="@drawable/ic_launcher" />
</RelativeLayout>


text:
Q: AWS Canary Selenium User Agent String I am looking to set a custom user agent in AWS Selenium Canary, but somehow what I am trying to do is not working
According to this documentation I should be able to change/append a string to the browser's user agent header...
add_user_agent(user_agent_str)
Appends the value of user_agent_str to the browser's user agent header. You must assign user_agent_str before creating the browser instance.

Example:

synthetics_webdriver.add_user_agent('MyApp-1.0')

https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_Library_Python.html
This is my sample code
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import selenium.common.exceptions
from aws_synthetics.selenium import synthetics_webdriver
from aws_synthetics.common import synthetics_logger as logger
from aws_synthetics.common import synthetics_configuration

async def main():
    synthetics_configuration.set_config(
        {
            "screenshot_on_step_start": False,
            "screenshot_on_step_success": True,
            "screenshot_on_step_failure": True
        }
    )

    synthetics_webdriver.add_user_agent('My User Agent String')
    driver = synthetics_webdriver.Chrome()

    driver.get('myurl.com')
    user_agent = driver.execute_script('return navigator.userAgent')
    # should be/contain 'My User Agent String' but instead looks like 'CloudWatchSynthetics-arn'
    logger.info('This is the user agent string: {}'.format(user_agent))

    # selenium python tests

async def handler(event, context):
   return await main()

I've done a lot of debugging, making sure the method exists, moving the method to the top of a file, but I haven't had any luck getting it to work
Any help would be greatly appreciated, Thanks in advance.

A: From what I see, you need to create an object first to execute the add_user_agent method and save that state.
I don't have the environment so please try this and let me know the result in the comment.
    syn_wdriver = synthetics_webdriver
    # syn_wdriver = synthetics_webdriver() # try this one if above does not work, i'm not sure about the syn_webdriver object
    syn_wdriver.add_user_agent('My User Agent String')
    driver = syn_wdriver.Chrome()

Or:
    driver = synthetics_webdriver.add_user_agent('My User Agent String').Chrome()

A: I just dove into my own code again and realize I was making a simple mistake
this was my structure
def myfunction():
    # my selenium test

myfunction()

However, when I did this, the add_user_agent function for some reason does not inject the browser user agent header with the string
when i changed the code to this
def myfunction():
    # selenium tests
webdriver.execute_step('StepName', myfunction)

it worked just fine...


text:
Q: Sum of all possible $k$-fold products for a set of $n$ integers Here is something I stumbled upon and I am wondering if there is a closed formula for the expression considered or whether this quantity has a name and been studied in the literature somewhere.
Assume given integers $1\leq k\leq n$. Consider
$$G(k,n)=\sum_{1\leq i_1<i_2<\dots<i_k\leq n}i_1i_2\dots i_k.$$
For $k=1$ one gets the very well known formula
$$G(1,n)=\frac{n(n+1)}{2}.$$
For $k=2$, I get the formula
$$G(2,n)=\sum_{i=1}^n{i\frac{(n-i)(n+i+1)}{2}}.$$

Do these numbers have a name? What about formulas for other values of
  $k$?

A: Unsigned stirling numbers of the first kind.
$G(1,n) = -s(n+1,n), G(2,n) = s(n+1,n-1)$ and so on.
For properties see Wikipedia and OEIS.

A: Here  is some  of the  algebra that  is involved.  We have  from first
principles that
$$H(n, k) = [z^k] \prod_{q=1}^n (1+qz).$$
This is
$$[z^k] z^n \prod_{q=1}^n (1/z+q)
= [z^{k-n}] \prod_{q=1}^n (1/z+q)
\\ = [z^{n-k}] \prod_{q=1}^n (z+q)
= [z^{n-k+1}] \prod_{q=0}^n (z+q)$$
which is equal to
$${n+1\brack n-k+1}$$
by inspection.


text:
Q: SavedState module Android Kotlin with View Model - value does not seem to save I have followed the instructions in Google Codelab about the Saved state module.
My gradle dependency is:
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:1.0.0-rc03"

My View Model factory is:
class MyViewModelFactory(val repository: AppRepository, owner: SavedStateRegistryOwner,
                              defaultArgs: Bundle? = null) : AbstractSavedStateViewModelFactory(owner, defaultArgs) {

    override fun <T : ViewModel?> create(
            key: String,
            modelClass: Class<T>,
            handle: SavedStateHandle): T {
        return MyViewModel(repository, handle) as T
    }
}

My View model:
 class MyViewModel constructor(val repository: AppRepository, private val savedStateHandle: SavedStateHandle): ViewModel() {
       fun getMyParameter(): LiveData<Int?> {
            return savedStateHandle.getLiveData(MY_FIELD)
        }

        fun setMyParameter(val: Int) {
            savedStateHandle.set(MY_FIELD, val)
        }
    }

My Fragment:
      class MyFragment : androidx.fragment.app.Fragment() {
           override fun onCreate(savedInstanceState: Bundle?) {
                arguments?.let {
                   var myField = it.getInt(MY_FIELD)
 activitiesViewModel.setMySavedValue(myField ?: 0)
                }

        }
        }

When the app is being used, the live data for the saved state field updates correctly. But as soon as I put the app in background (and I set "don't keep activities" in developer options), and then re open app, the live data shows a value as if it was never set. In other words, the saved state handle seems to forget the field I am trying to save.
Any thoughts?

A: I had the same problem. It was solved by the fact that I stopped requesting saved values from SavedStateHandle in the onRestoreInstanceState method. This call is correctly used in the onCreate method.


text:
Q: How to keep a Form always on top without stealing focus from the active Window? My question: how I can keep my Form always on top (I can do it setting TopMost = true) without stealing the focus from the Window currently active when my Form is interacted with.
Take a look at the images to better understand my question: the Form is on top and when I focus on any other Input control outside my Form, I can send the selected Emoji to it.
1 : An Image what I want to happen in an input box in FireFox when I click an Emoji Button in my Form.

2 : An Image of my Form: as soon as I click a Button in my Form, the focus moves back to that Form.

A: *

*Make a standard Form, set its FormBorderStyle = none. Make it TopMost (this setting is another topic per se, I'm no going to discuss it here).

*Override CreateParams to set the WS_EX_NOACTIVATE and WS_EX_TOOLWINDOW extended styles. This prevents the Form from being activated when mouse events are generated inside its surface (see the docs about these styles).

*Add some non-selectable Button Controls to it (the ButtonNoSel Control shown below) and set their Tag property to the Unicode char corresponding to the Emoji image these buttons show.

*Add the same Click handler to all the Buttons.

These Buttons, when clicked, simply use SendKeys::Send() (a.k.a. SendInput()) to send the selected Unicode char to the foreground Window, casting to string the Tag property value.
This is how it works (setting the Emoji to a Web Page shown by FireFox):

using namespace System;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Drawing;

public ref class frmKeyBoard : public System::Windows::Forms::Form
{
public:
    frmKeyBoard(void) { InitializeComponent(); }

// [...] Initialization...

protected:
    property System::Windows::Forms::CreateParams^ CreateParams {
        virtual System::Windows::Forms::CreateParams^ get() override {
            auto cp = Form::CreateParams;
            cp->ExStyle |= (WS_EX_NOACTIVATE | WS_EX_TOOLWINDOW);
            return cp;
        }
    }

// Event handler for all the Buttons
private:
    System::Void buttonNoSelAll_Click(System::Object^  sender, System::EventArgs^  e) {
        Control^ ctl = safe_cast<Control^>(sender);
        SendKeys::Send(ctl->Tag->ToString());
    }
};

Add this simple Custom Control to the Project.
This Control simply uses Control.SetStyle, setting ControlStyles::Selectable = false to prevent the child Control to become the ActiveControl when interacted with, since it doesn't receive the focus.
using namespace System;
using namespace System::Windows::Forms;
using namespace System::ComponentModel;

namespace CustomControls {
    [ToolboxItem(true)]
    public ref class ButtonNoSel : public System::Windows::Forms::Button
    {
    public:
        ButtonNoSel(void) {
            this->InitializeComponent();
            this->SetStyle(ControlStyles::Selectable, false);
        }

    private:
        void InitializeComponent(void) {
            this->UseVisualStyleBackColor = true;
        }

    protected:
        ~ButtonNoSel() { }
    };
}

Note that this Form must run on its own thread.
If you need to show this Form from another one, use Task.Run() to show it as a Dialog Window, calling ShowDialog(). This will start the Message Loop.
For example, from a Button.Click handler of another Form (here, named MainForm).
private:
    void ShowKeyboard() {
        frmKeyBoard^ fk = gcnew frmKeyBoard();
        fk->ShowDialog();
        delete fk;
    }

private:
    System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
        Task::Run(gcnew Action(this, &MainForm::ShowKeyboard));
    }


text:
Q: Query managed package components (including dependencies) from releasing org In an org that releases a managed package, the package detail page lists the components in the package (recently added components, previously released components, indirectly added components).
Is it possible to query this list through an API?
I had hoped I would get this by extracting the package through the MDAPI (i.e. sfdx force:mdapi:retrieve --packagenames MYPACKAGE --singlepackage) but that seem to only return components added directly and ignore indirectly added components.
Thanks

A: A bulk retrieve operation in the Metadata API using the packageNames argument will retrieve all the metadata that's included in the package itself.  That's the mechanism sdfx is using to fetch the packaged metadata.
The package.xml you get from the retrieve will list all metadata components in the package individually.
As for dependencies on other managed package versions, you could parse the *-meta.xml files from the retrieve and look for elements like this which contain the dependencies:
<packageVersions>
    <majorNumber>3</majorNumber>
    <minorNumber>11</minorNumber>
    <namespace>npe01</namespace>
</packageVersions>

You can parse that this particular Apex Class depends on the managed package with namespace npe01 being installed at version 3.11

A: we had a somewhat similar requirement to retrieve metadata components from any specific managed package in a Salesforce org. Please follow the steps given in the below link. It uses the listMetadata task of Force.com migration tool to retrieve the list of names of all the components of any metadata type from the org followed by filtering out the components name using the managed package namespace and then using Force.com migration tool again to retrieve the filtered out components. Hope it helps.
Retrieve list of components of any metadata type from a managed package


text:
Q: Reusing scanner input for multiple conditions in while loop I would like to use a single scanner input as multiple conditions in while loop where are can check if the input is correct or not and if its not correct to re-enter the input value.
Something like this:
while(scannerInput is a int AND scannerInput is > than 0 AND scannerInput is < 10)
{
    //CODE
}

but if I use scanner.hasNextInt() and scanner.nextInt() it prompt me for input instead of using the same one
while (scaner.hasNextInt() && scaner.nextInt() > 0 && scaner.nextInt() < 10)  {

}

Is there a way to store the first input and to re-use it again and again or is there a better solution to my problem ?

A: The call of scanner.nextInt() advances the position at which the scanner reads its input, so the second read may produce a different number, or throw an exception when there is only one int available. To work around this situation you could introduce a variable to hold the value for the second check:
int tmp;
while (scaner.hasNextInt() && (tmp = scaner.nextInt()) > 0 && tmp < 10)  {
    ...
}

The second subexpression (tmp = scaner.nextInt()) reads the next integer value from the scanner, and stores it in a temporary variable tmp. After that, the value is compared with zero, and finally the same value is compared to 10.
The assignment is performed before the check of tmp < 10 because parts of && expressions are processed in left to right order.
This solution is not ideal, because tmp remains visible after the loop, and because it is not so easy to read. You would be better off moving the check inside the loop, like this:
while (scaner.hasNextInt()) {
    int val = scaner.nextInt();
    if (val < 0 || val >= 10) {
        break;
    }
    ...
}

My idea was the code to keep prompting you for new input until its correct

A common way to achieve this is with a do/while loop:
int val = -1;
do {
    System.out.print("Enter an int: ");
    if (scanner.hasNextInt()) {
        val = scanner.nextInt();
    } else {
        scanner.nextLine();
    }
} while (val < 0 || val >= 10);

A: try this code:
int s;
while (scanner.hasNext() && (s = scanner.nextInt()) >0 && s <0){
 #code
}

A: You have some options here.

*

*You could put an if condition inside the while and give while a true as condition.. let the if statement break the while loop

*you could write a method which does the checks and give scanner.nextInt() as parameter


text:
Q: Error connecting to local db server I have the following code:
try {
      $db_conn = new PDO('mysql:host='.$host.';dbname=stats;port='.$port, $un, $pw);
    } catch (PDOException $e) {
      WriteLog("Could not connect to database!\nError: ".$e->getMessage());
      exit;
    }

    try {
      $db_conn2 = new PDO('mysql:host=localhost;dbname=log', $un2, $pw2);
    } catch (PDOException $e) {
      WriteLog("Could not connect to database[2]!\nError: ".$e->getMessage());
      exit;
    }

It connects without errors to the first server (not local), but then it fails to connect to the local server. I get this error message:

Error: SQLSTATE[HY000] [2002] No such file or directory (||)

I'm running PHP v5.4.27

A: Solved it. Changing from localhost to 127.0.0.1 seems to fix it. I'm not sure why


text:
Q: Prove that $\mathrm{Ind}_{\mathbb{I}}^G \cong \mathbb{C}[G]$
Prove that $\mathrm{Ind}_{\mathbb{I}}^G \cong \mathbb{C}[G]$.

Apparently: $$\langle \mathrm{Ind}_{\mathbb{I}}^G \mathbb{I}, \chi  \rangle_G \overset{Frob.Rep.}= \langle \mathbb{I}, \mathrm{Res}_{\{I\}}\chi  \rangle_I= \dim \chi \tag1$$
but I cannot see how the second inequality works?
So then apparently this means that $\displaystyle \mathbb{C}[G]=\bigoplus_{V_i \ irreducible}V_i^{\dim V_i}\tag2$
equally I cannot see how this is a consequence of $(1)$.
My inner product of characters is $\displaystyle \langle \chi, \psi \rangle=\frac{1}{|G|}\sum_{g \in G}\chi(g)\overline{\psi(g)}$

A: The sum is just over a single element:
$$\langle\mathbb I, \mathrm{Res}_{\{I\}}\chi\rangle_{\{I\}} = \frac{1}{1}\sum_{g \in \{I\}}\chi(g)\overline{\mathbb I(g)} = \chi(I)\overline{\mathbb I(I)} = \dim\chi\cdot\dim\mathbb I = \dim\chi$$
Now observe that characters form an inner product space with an orthogonal basis.  Consequently, characters are defined by their inner product with other characters.  You've shown that the inner product of $\mathrm{Ind}_{\mathbb I}^G$ with $\chi$ equals the inner product of $\mathbb C[G]$ with $\chi$ for all $\chi$, hence the characters of $\mathrm{Ind}_{\mathbb I}^G$ and $\mathbb C[G]$ are equal.  Hence $\mathrm{Ind}_{\mathbb I}^G$ and $\mathbb C[G]$ are isomorphic.


text:
Q: Import specific data for Yahoo finance into Google sheets I want to import specific data from a table from Yahoo finance to Google sheets.
So far, I have managed to import the table from Yahoo but the specific row e.g. float data
I have used this: =IMPORTHTML("http://finance.yahoo.com/q/ks?s="& $B$1&"+Key+Statistics","table", 2)
This line select the stock symbol in my spreadsheet, then draws the table from Yahoo,

A: You can accomplish it by accessing that index, try:

*

*=index(IMPORTHTML("http://finance.yahoo.com/q/ks?s="& $B$1&"+Key+Statistics","table", 2), 4, 2)
the index function will basically get a single item when the output is a table.


text:
Q: Nodemon restarts, but saved changes to index.js not reflected in output Here's my code for an express server:
const express=require('express');
express();

const app=express();

app.get('/',(req,res)=>{
    res.send('Welcome to API xyz!');
});

app.listen(3000,()=>{
    console.log('Listening on port 3000...');

});

Running the server from a git bash terminal, in the app's directory, using:
nodemon index.js

initially gives the message:
[nodemon] starting `node index.js`
Listening on port 3000...

Whenever I save a change to the output of res.send() as follows:
res.send('Welcome to API abc!');

and save the index.js file, I get this message:
[nodemon] restarting due to changes...

but I do not get the console.log() text, and when I reload localhost:3000 in Chrome, I still get the output:
Welcome to API xyz!

How can I get the server to update in response to saved changes without having to stop nodemon and restart it (which is the whole point of running nodemon in the first place)?
EDIT: I noticed that when nodemon restarts, I get:
restarting due to changes...

but I don't get
starting `node index.js`

after that.  I only get
starting `node index.js`

when I first run nodemon.
EDIT 2: thinking that maybe this is related to the same issue that other nodemon users have experienced, as noted here in its Github issues log?

A: Maybe try removing the 2nd line that says express();
const express = require("express");

const app = express();

app.get("/", (req, res) => {
  res.send("Welcome to API xyz!");
});

app.listen(3000, () => {
  console.log("Listening on port 3000...");
});

A: I was facing the same issue and I usually start the server from VS code terminal. Before I could try the solutions given in a related question I tried running the server from the command prompt (Run as administrator) and it worked.
I use the command npm run start to start the server.
Hope it helps someone!


text:
Q: Prove a Recursive Formula by Induction? So I have a bonus question on a homework assignment I am working on that literally just asks "How would you prove a recursive formula by induction?" There are no numbers, or sequences given.
I understand how to prove something using induction, but am very confused on how to go about doing it for a recursive formula.
Any ideas?

A: Your mission, if you choose to accept it, is to outline the steps involved in proving by induction that $\forall k\geq 0:a_k = g(k)$ when given that $a_0=c$ and $\forall k\geq 0:a_{k+1} = f(a_{k})$.
That is how do you prove $a_k=g(k)$ is the closed form of the recursion formula.

As you understand what proof by induction involves, what is the first thing you would do?

So if I was looking at a regular non recursive formula, I would test the base case, which would be 0, and see that it works.

That's the exactly right thing to do.   So, do that then.
Okay, what is the base case here?

Then assume that its true for k, and try to prove that its true for k+1.

Yes, and what are you assuming is true for any $k$ here?
Likewise what do you need to prove for $k+1$.

It is very easy for me with a regular problem, there is just something about a recursive formula that makes it seem much more confusing

It should not be that confusing.   It is just a matter of identifying how to use the recursion formula to move from the assumption to the required conclusion.

*

*"First I would test the base case, which is:" ...

*"Then I would assume that for some $k$: the premise holds, which is:" ...

*"Using this assumption I would demonstrate that for $k+1$ we have: " ...

*"The recursion formula would be used to show this since:" ...

A: An example. The Fibonacci numbers. $F(0)=0.\;$ $\;F(1)=1.$ Recursively, $F(n+2)=F(n+1)+F(n).$ Prove, by induction, the formula $$F(n)=(a^n-b^n)/\sqrt 5,$$ where $a=(1+\sqrt 5)/2\;$ and $\;b=(1-\sqrt 5)/2.$
Note that $a$ and $b$ are the solutions to $x^2=x+1.$ So $a^2=a+1 $ and $b^2=b+1.$
So if the formula is valid for $n$ and for $n+1$ then $$(a^{n+2}-b^{n+2})/\sqrt 5=[a^n(a^2)-b^n(b^2)]/\sqrt 5=$$ $$=[a^n(a+1)-b^n(b+1)]/\sqrt 5=$$ $$=[a^{n+1}-b^{n+1}]/\sqrt 5\; +\; [a^n-b^n]/\sqrt 5=$$ $$=F(n+1)+F(n)=F(n+2).$$ Then confirm that the formula is valid for $n=0$ and for $n=1.$


text:
Q: Code not running - C++ - exam training tests I have this very exercise which requires me to use a function named shift, which gets two parameters, one named n, number of items, and an array x, maximum 100 elements, therefor this function moves the array's items one by one. Then I need to inverse the array calling this function. I don't get why my code doesn't work. What should I do?
#include <fstream>
using namespace std;

void shift(int n, int x[]) {
    int aux1 = x[1], aux = x[n - 1];
    x[n - 1] = x[n];
    for (int i = n - 1; i >= 2; i--) {
        int t = x[i - 1];
        x[i - 1] = aux;
        aux = t;
    }
    x[n] = aux1;
}

int main(){
    int n, x[100], v[100], rez[100]; cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> x[i];
        v[i] = x[i];
    }
    int t = n, k = 1, j = 0, pos = 0;
    while (t !=  0) {
        k = 1, pos = 0;
        while (k != 0) {
            while (v[1] != x[t]&&pos==t) {
                shift(n, v);
                pos++;
            }
            k = 1;
        }
        j++;
        rez[j] = x[t];
        t--;
    }
    for (int i = 1; i <= n; i++)
        cout << rez[i] << " ";
    return 0;
}

A: Shift sounds like a primitive rotate, so let's implement that
void shift (int arr[], int elements){
    int holder = arr[0];
    for(int i = 0; i != elements-1; i++){
        arr[i] = arr[i+1];
    }
    arr[elements - 1] = holder;
}

If you take the numbers {1,2,3} and run them through, you should have either {3,1,2} or {2,3,1}, it doesn't really matter in the end, because now you have one number in the correct place. So let's keep going!
void reverse(int arr[], int elements){
    for(auto i = elements;i>0;i--){
        shift(arr, i);
    };
}

Since you only need to get the remaining numbers in place, you may as well create a separate function for that

int main(){
    int num[] = {1,2,3};
    for (auto i: num){
        std::cout << i << ' ';
    }
    std::cout << '\n';
    reverse(num, 3);
    for (auto i: num){
        std::cout << i << ' ';
    }
}

Finally put it all together


text:
Q: Google Maps API v2 for Android "Unfortunately, [app] has stopped." I just begin to learn Android. Full of my day I try to use Google Map on Android but everytime I run it on Emulator, it gives the notification of "Unfortunately,  has stopped."
Here's my code:
1. Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.mapmapmap"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="17"
        android:targetSdkVersion="17" />

    <permission
        android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <!--
     The following two permissions are not required to use
     Google Maps Android API v2, but are recommended.
    -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.mapmapmap.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyCSOXImKxtdCbhph6WAW6QammSm7rDa9lA" />
    </application>
</manifest>

activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />

MainActivity.java:
package com.example.mapmapmap;
import android.os.Bundle;
import android.app.Activity;

public class MainActivity extends Activity {

@Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    }
}

LogCat:
04-26 09:32:54.001: E/Trace(2210): error opening trace file: No such file or directory (2)
04-26 09:32:55.111: D/AndroidRuntime(2210): Shutting down VM
04-26 09:32:55.111: W/dalvikvm(2210): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
04-26 09:32:55.141: E/AndroidRuntime(2210): FATAL EXCEPTION: main
04-26 09:32:55.141: E/AndroidRuntime(2210): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mapmapmap/com.example.mapmapmap.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.os.Looper.loop(Looper.java:137)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.ActivityThread.main(ActivityThread.java:5041)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at java.lang.reflect.Method.invokeNative(Native Method)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at java.lang.reflect.Method.invoke(Method.java:511)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at dalvik.system.NativeStart.main(Native Method)
04-26 09:32:55.141: E/AndroidRuntime(2210): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.Activity.setContentView(Activity.java:1881)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at com.example.mapmapmap.MainActivity.onCreate(MainActivity.java:11)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.Activity.performCreate(Activity.java:5104)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
04-26 09:32:55.141: E/AndroidRuntime(2210):     ... 11 more
04-26 09:32:55.141: E/AndroidRuntime(2210): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.MapFragment: make sure class name exists, is public, and has an empty constructor that is public
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.Fragment.instantiate(Fragment.java:592)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.Fragment.instantiate(Fragment.java:560)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.Activity.onCreateView(Activity.java:4709)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
04-26 09:32:55.141: E/AndroidRuntime(2210):     ... 20 more
04-26 09:32:55.141: E/AndroidRuntime(2210): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.maps.MapFragment" on path: /data/app/com.example.mapmapmap-1.apk
04-26 09:32:55.141: E/AndroidRuntime(2210):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
04-26 09:32:55.141: E/AndroidRuntime(2210):     at android.app.Fragment.instantiate(Fragment.java:582)
04-26 09:32:55.141: E/AndroidRuntime(2210):     ... 23 more

I greatly appreciate any attempts to help !

A: Try This code will work succesfully

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<fragment
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.SupportMapFragment" />

</LinearLayout>
package com.towntour.android;

import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.TextView;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.InfoWindowAdapter;
import com.google.android.gms.maps.GoogleMap.OnInfoWindowClickListener;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

public class PlacesMapActivity extends android.support.v4.app.FragmentActivity
    implements OnClickListener, LocationListener {
/**
 * Note that this may be null if the Google Play services APK is not
 * available.
 */
ImageButton btn_home;
private GoogleMap mMap;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_map);

    SupportMapFragment fragment = (SupportMapFragment)getSupportFragmentManager()
            .findFragmentById(R.id.map);
    mMap = fragment.getMap();
    mMap.setMyLocationEnabled(true);

    // mMap = ((SupportMapFragment) getSupportFragmentManager()
    // .findFragmentById(R.id.map)).getMap();

    MarkerOptions markerOptions = new MarkerOptions();
    markerOptions.title("First Location");
    markerOptions.snippet("This Is Test Location");

    LatLng latlng = new LatLng(23.0333, 72.6167);

    markerOptions.position(latlng);
    // markerOptions.title("Ahmedabad Cordinat Found here");

    // Marker m = mMap.addMarker(markerOptions);

    mMap.setInfoWindowAdapter(new InfoWindowAdapter() {

        @Override
        public View getInfoWindow(Marker arg0) {

            return null;
        }

        @Override
        public View getInfoContents(Marker marker) {

            View myContentView = getLayoutInflater().inflate(
                    R.layout.custommarker, null);
            TextView tvTitle = ((TextView) myContentView
                    .findViewById(R.id.title));
            tvTitle.setText(marker.getTitle());
            TextView tvSnippet = ((TextView) myContentView
                    .findViewById(R.id.snippet));
            tvSnippet.setText(marker.getSnippet());
            return myContentView;

        }
    });

    mMap.addMarker(new MarkerOptions()
            .position(latlng)
            .title("This is Sabarmati Ashram")
            .snippet("Ahmedabad")
            .icon(BitmapDescriptorFactory
                .defaultMarker(BitmapDescriptorFactory.HUE_RED)));

    mMap.setOnInfoWindowClickListener(new OnInfoWindowClickListener() {

        @Override
        public void onInfoWindowClick(Marker arg0) {
            // TODO Auto-generated method stub
            Intent intent = new Intent(getBaseContext(),
                    DetailsOfPlacesActivity.class);
            startActivity(intent);
        }
    });

    btn_home = (ImageButton) findViewById(R.id.activity_map_ibtn_home);
    btn_home.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            finish();
        }
    });
}

@Override
public void onBackPressed() {
    // TODO Auto-generated method stub
    finish();
    super.onBackPressed();
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    finish();
    super.onPause();
}

@Override
public void onClick(View v) {
    // TODO Auto-generated method stub

}

@Override
public void onLocationChanged(Location location) {
    // TODO Auto-generated method stub

}

@Override
public void onProviderDisabled(String provider) {
    // TODO Auto-generated method stub

}

@Override
public void onProviderEnabled(String provider) {
    // TODO Auto-generated method stub

}

@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
    // TODO Auto-generated method stub

}
}

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.towntour.android"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="com.example.towntour.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<permission
    android:name="com.towntour.android.maps.googlev2.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-permission android:name="com.towntour.android.maps.googlev2.permission.MAPS_RECEIVE"

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Black.NoTitleBar" >
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSyDp6PHK3NYNwS74cKGmX-xc4LuH_uM1mIo" />

    <activity
        android:name="com.towntour.android.PlaceActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

</manifest>

A: Your error suggests that you manually modified the build path of your project to reference a JAR. That would represent two mistakes:

*

*Never manually modify the build path of a standard Android app project

*The Play Services SDK is an Android library project, not merely a JAR
The instructions for attaching the Play Services SDK to your project can be found in the Play Services SDK documentation.


text:
Q: Controlling foundation 4 accordion speed I've come across Foundation4 3 days ago. My knowledge about javascript and  Jquery are so-so. That's why I'm having a hard time figuring out how to solve my problem.

Staff Favourites

Morbi vitae eleifend

Praesent suscipit

Cras et justo non

Fusce vel leo

Vestibulum ante

It work's fine but I want the dropdown animation to look smoother, the thing is I tried looking for solutions on the internet but couldn't find anything related to foundation 4.
can anyone please help me?


text:
Q: OS X Yosemite 10.10.3 Mail keep quitting unexpectedly. This started happening after the last update I'm just wondering that why Mail keeps quitting after the 10.10.3 update.
The mail app worked fine and I never had to quit it, but now it happens occasionally.
Sorry I didn't provide those informations.
Here is the User Diagnostic Reports:
Crashed Thread:        18  Dispatch queue: NSOperationQueue 0x7fbff45644a0 :: NSOperation 0x7fbff7e23ee0 (QOS: UTILITY)
Exception Type:        EXC_CRASH (SIGABRT)
Thread 18 Crashed:: Dispatch queue: NSOperationQueue 0x7fbff45644a0 :: NSOperation 0x7fbff7e23ee0 (QOS: UTILITY)
Thread 18 crashed with X86 Thread State (64-bit):
    0x7fff8d4d9000 -     0x7fff8d4e4ff7  com.apple.CrashReporterSupport (10.10 - 631) <D87A64FA-64B1-3B23-BB43-ADE173C108C6> /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport

Let me know if I can provide more info to solve my question.
What I actually want to do is to make the mail app stable instead of crashing 2 or 3 times a day.

A: I found the source of those repetitive crashes : a rule that tried moving email in a directory that does not exist anymore. Under 10.10.2 Mail would simply not do anything. Under 10.10.3 Mail 8.2 crashed and corrupt the mail index. Simply fixing the rules did solve my problem.

A: another setting can bring relief:
Mail->Preferences->Accounts choose accounts one by one and in the "advanced" button uncheck "automatically detect and maintain account settings". Do the same for that account in the smtp settings.
Save.
Restart Mail.


text:
Q: Primefaces p:fileUpload doesnt work in IE 10 Update attribute and onComplete in p:fileUpload  doesnt work in IE10. In IE 9 sizeLimit attribute is ignored. Has anyone came across this situation.
I have tried calling p:remotecommand by using onComplete attribute on p:fileUoload but it looks like even onComplete doesn't work in IE 10
<h:form id="file" enctype="multipart/form-data">

    </h:form>

A: Finally realized that its a bug in primefaces.
http://forum.primefaces.org/viewtopic.php?f=3&t=28860#p94845
http://code.google.com/p/primefaces/issues/detail?id=5355
Fixed in:

TargetVersion-4.0
  TargetVersion-3.5.9

A: Use this CSS workaround. I derived this from the jQuery FileUpload component commit the fixed this issue.
.fileinput-button input {
    -moz-transform : none !important;
    border : none !important;
    border-width : 0 !important;
    transform : translate(-300px, 0) scale(4) !important;
    font-size : 23px !important;
}
* + html .fileinput-button {
    line-height : none !important;
    padding : 2px 15px !important;
}

A: I've got also problems with p:fileUpload after upgrading to IE10. The JavaScript errors began to occur ('syntax error in XML document').
It helped to change the X-UA-Compatible header to IE=EmulateIE9:
<h:head>
    <f:facet name="first">
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9,chrome=1" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    </f:facet>
<h:head>

A: It seems to be a problem with position absolute. Change it to fixed. It works on my side:
.fileupload-buttonbar .ui-button input {
    ...
    position                          : fixed;
    ...
}

A: This is fixed in the new 4.0 Primefaces release, however if you are still on an older version of Primefaces you might still need a workaround.
I was able to update after a file upload by using the onstart attribute which does still work in IE 10.
Create a hidden field that contains a value that gets updated as part of the method called from the fileUploadListener. Then set the onstart attribute of the p:fileUpload to something like the following:
function checkUpload() {

    //this should call a p:remoteCommand that refreshes your hidden value
    refreshHiddenValue();

    var hiddenFieldValue = $('#hiddenFieldId').val();
    if(hiddenFieldValue) {
        //this should call a p:remoteCommand that refreshes the
        //sections you want refreshed after the upload has finished
        refreshSections();
    }
    else {
        setTimeout(checkUpload, 1000);
    }
}

A: I had to face this problem with PF 5.1 migrated from PF 3 and thanks to this post i resolved:
this is the html code generated:

        upload
        <input name="upload" type="file">

and this the CSS which resolved this problem:
.ui-fileupload-buttonbar .ui-fileupload-choose input
{
    position:absolute;
    top:0;
    right:0;
    margin:0;
    border:solid transparent;
    border-width:0 0 1px 1px;
    opacity:0;
    filter:alpha(opacity=0);
    -o-transform:translate(250px,  -50px) scale(1);
    direction:ltr;
    cursor:pointer;
    z-index:5000;
    width:100%;
    height: 20px;
}

.ui-button {
    position: relative;
    overflow: hidden;
}
.ui-button input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    font-size: 100px;
    text-align: right;
    filter: alpha(opacity=0);
    opacity: 0;
    outline: none;
    background: white;
    cursor: inherit;
    display: block;
}


text:
Q: Get Response Value in Java(Coffee)script With firebug, I got a response of this when upload is complete:
{"message":"News \"test\" successfully stored!"}

I want to get the value of the message of the response, so I tried this:
UploadService.news.save(fd).then (response) ->
                    alert response.message.message

returns a.message is undefined, so I changed to alert response.message, returns undefined, then I change to alert response, it returns Object object. How can I get the value in the response?

A: I think it is response.data.message, if the UploadService is using $http. In any case and if you are using Firefox with Firebug or Chrome you can do console.log(response) instead of alert(response). The console will show you the structure of the logged object so you can be sure.


text:
Q: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space при сканировании большого количества папок Пытаюсь выполнить сканирование проекта, на предмет поиска в нем файлов содержащих слово заглушка. Файлы в кодировке UTF-16. Но когда парсер доходит до 1017 файла, все падает с сообщением

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space.

Подскажите, как этого избежать этого
import java.io.*;
import java.util.Scanner;

public class FolderScanerV2 {

public static void FolderScaner(File file) throws Exception {
    if (file.isDirectory()) {
        File[] directory = file.listFiles();
        for (File enter : directory) {
            if ((enter.isFile() & enter.getCanonicalPath().contains("txt"))) {
                FileScaner(enter);
            } else {
                FolderScaner(enter);
            }
        }
    }
}

public static void FileScaner(File file) throws Exception {
    BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file.getAbsolutePath()), "UTF-16"));
    Scanner text = new Scanner(in);
    while (text.hasNext()) {
        if(text.next().contains("Заглушка")) {
            System.out.println("Заглушка" + " " + file.getCanonicalPath());
        }
    }
}

public static void main(String[] args) {
    String path = new String();
    Scanner inpunt = new Scanner(System.in);
    System.out.println("Введи путь к файлу или папке");
    path = inpunt.nextLine(); // получаем путь к файлу(строку)

    File dir = new File(path);
    try {
        FolderScaner(dir);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
}

A: Ресурсы нужно освобождать.
У вас все файлы открываются и не закрываются, остаются висеть в памяти, она пухнет и в итоге ошибка происходит.
Scanner text = new Scanner(in);
//...
//...
text.close(); //Закроет переданный BufferedReader

A: дополнительно к ответу @iksuy рекомендую использовать
        try(Scanner text = new Scanner(in);) { // такая конструкция позволяет закрывать потоки в конце автоматически
            while (text.hasNext()) {
                if (text.next().contains("Заглушка")) {
                    System.out.println("Заглушка" + " " + file.getCanonicalPath());
                }
            }
        }

если использовать Java 8 Stream API, то можно легко распараллелить операции
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
import org.apache.commons.io.FileUtils;

public class Main {

    public static void main(java.lang.String[] args) {

        File searchDir = new File("C:\\New folder");
        Collection<File> files = FileUtils.listFiles(searchDir, new String[]{"txt"}, true); // позволяет сканировать директории и возвращает файлы по маске

        java.util.List<String> res = files // берем наш список
                .parallelStream()          // в параллель выполняем операции
                .filter(f -> isContains(f)) // по фильтру выбираем те файлы, которые содержат слово
                .map(File::getAbsolutePath) // для тех файлов, которые прошли условие,  берем полный путь
                .collect(Collectors.toList()); // сохраняем в массив

        System.out.println(res.toString()); // печатаем результат
    }

    public static boolean isContains(File f) {
        try (
                BufferedReader in =
                        new BufferedReader(new InputStreamReader(
                                new FileInputStream(f.getAbsolutePath()), "UTF-8"));
                Scanner text = new Scanner(in);) {
            while (text.hasNext()) {
                if (text.next().contains("Заглушка")) {
                    return true;
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        return false;
    }

}


text:
Q: MVC : Is there any situation where the model can interact with the user? I am currently learning how to use the MVC pattern by developing an Connect Four game with a graphic and console view ( JAVA ).
The app in console mode has two ways of asking for a move:

*

*Manually introducing the column where you want to put the chip

*Randomly generating a valid column.

So we have two modes (Manual & Random) to choose for Black and White players
I have implemented a Controller class which manage all the possible commands and handles the exceptions and a  class called "ConsoleHumanPLayer" which asks the user in what column he wants to put the chip in.
This class "ConsoleHUmanPlayer" uses the scanner and is currently inside my "Model" package along with the Board and Valid/Invalid Moves, so my question is: is this a good way to use the MVC pattern or should i keep all user interaction  limited to the view / controller sections?

A: Keep the userinteraction in the controllersection. You shouldn't break the pattern. Just transfer the interaction. It can still be triggered by the model.


text:
Q: How to Connect Crystal Reports to MySQL directly by C# code without DSN or a DataSet How can I connect a Crystal Report (VS 2008 basic) to a MySQL DB without using a DSN or a preload DataSet using C#?
I need install the program on several places, so I must change the connection parameters. I don't want to create a DSN on every place, nor do I want to preload a DataSet and pass it to the report engine. I use nhibernate to access the database, so to create and fill the additional DS would take twice the work and additional maintenance later. I think the best option would be to let the crystal reports engine to connect to MySQL server by itself using ODBC.
I managed to create the connection in the report designer (VS2008) using the Database Expert, creating an ODBC(RDO) connection and entering this connection string

"DRIVER={MySQL ODBC 5.1 Driver};SERVER=myserver.mydomain"

and in the "Next" page filling the "User ID", "Password" and "Database" parameters. I didn't fill the "Server" parameter. It worked. As a matter of fact, if you use the former connection string, it doesn't matter what you put on the "Server" parameter, it seems the parameter is unused. On the other hand, if you use "DRIVER={MySQL ODBC 5.1 Driver}" as a connection string and later fill the "Server" parameter with the FQDN of the server, the connection doesn't work.
How can I do that by code? All the examples I've seen till now, use a DSN or the DataSet method. I saw the same question posted but for PostgreSQL and tried to adapt it to mysql, but so far, no success. The first method:
Rp.Load();
Rp.DataSourceConnections[0].SetConnection("DRIVER={MySQL ODBC 5.1 Driver};SERVER=myserver.mydomain", "database", "user", "pass");
Rp.ExportToDisk(ExportFormatType.PortableDocFormat, "report.pdf");

raise an CrystalDecisions.CrystalReports.Engine.LogOnException during ExportToDisk

Message="Logon failed.\nDetails: IM002:[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.\rError in File temporal file path.rpt:\nUnable to connect: incorrect log on parameters.

the InnerException is an System.Runtime.InteropServices.COMException with the same message and no InnerException
The "no default driver specified" makes me wonder if the server parameter is unused here too (see above). In that case: How can I specify the connection string?
I haven't tried the second method because it doesn't apply.
Does anybody know the solution?

A: I think it'll likely be quicker to generate the Dataset via nHibernate, or do a direct ADO.NET query, then trying to solve the issue.


text:
Q: Include the value of each not empty cell to a message I'd like to include the value of each not empty cell in the message to send, but I don't know which is the good syntax to use?
Private Sub CommandButton6_Click()
    Dim MailAd As String
    Dim Msg As String
    Dim Subj As String
    Dim URLto As String
    Dim Nom As String
    Nom = "User name"
    Dim Pole As String
    Pole = " POLE"
    Dim Texte As String
    Texte = " Thanks for the informations you send to me  "

    'Sélectionne la cellule correspondant à l'adresse mail de la ligne :
    If ComboBox1.ListIndex <> -1 Then Cells(ComboBox1.ListIndex + 2, 8).Select
    'Le mail est adressé sur la base de la cellule active :
    MailAd = TextBox7

    Range("A2:J32").Select
    Selection.Copy
    Dim StrBody As String
    StrBody = Sheets("FICHIER ADRESSES").Range("A2").Value

    'Copie = TextBox.2  'bien mentionner le n° de la texbox
    Subj = "Message à l'attention de " 'Objet du message automatique mais on peut faire réféence à une TextBox
    Msg = Msg & "Bonjour " & TextBox2.Text & ",%0D%0A %0D%0A" 'Corps du message
    'Msg = Msg & "Bonjour " & Selection.Insert & ",%0D%0A %0D%0A"
    Msg = Msg & Texte & StrBody & ",%0D%0A %0D%0A" & Nom & Pole & "%0D%0A %0D%0A"   'Corps du message
    URLto = "mailto:" & MailAd & "?subject=" & Subj & "&body=" & Msg & "&Cc=" '& copie
    ActiveWorkbook.FollowHyperlink Address:=URLto
End Sub

A: Presuming you are talking about the range A2:J32 and want the values to show in your "msg" string: (this is untested)
    Private Sub CommandButton6_Click()
        Dim MailAd As String
        Dim Msg As String
        Dim Subj As String
        Dim URLto As String
        Dim Nom As String
        Nom = "User name"
        Dim Pole As String
        Pole = " POLE"
        Dim Texte As String
        Texte = " Thanks for the informations you send to me  "

        'Sélectionne la cellule correspondant à l'adresse mail de la ligne :
        If ComboBox1.ListIndex <> -1 Then Cells(ComboBox1.ListIndex + 2, 8).Select
        'Le mail est adressé sur la base de la cellule active :
        MailAd = TextBox7

        Range("A2:J32").Select

    Dim rngCell as Range, sNonEmpty as string

    For each rngCell in Range("A2:J32")
        if rngcell.value <> "" then snonempty = _
              iif(snonempty="",rngcell.value,snonempty & ", " & rngcell.value)
    Next

      Selection.Copy

        Dim StrBody As String
        StrBody = Sheets("FICHIER ADRESSES").Range("A2").Value

        'Copie = TextBox.2  'bien mentionner le n° de la texbox
        Subj = "Message à l'attention de " 'Objet du message automatique mais on peut faire réféence à une TextBox
        Msg = Msg & "Bonjour " & TextBox2.Text & ",%0D%0A %0D%0A" 'Corps du message
        'Msg = Msg & "Bonjour " & Selection.Insert & ",%0D%0A %0D%0A"
        Msg = Msg & Texte & StrBody & ",%0D%0A %0D%0A" & Nom & Pole & "%0D%0A %0D%0A" & VBNEWLINE & _
"YOUR VALUES: " & sNonEmpty    'Corps du message
        URLto = "mailto:" & MailAd & "?subject=" & Subj & "&body=" & Msg & "&Cc=" '& copie
    ActiveWorkbook.FollowHyperlink Address:=URLto
        End Sub


text:
Q: Featured images disappear after DB export/import? I'm upgrading my blog right now from 3.2.1 to 3.5.2. However, for one section the featured images have seem to disappeared. The database is identical since I just did a dump/restore a few minutes ago.
Other sections are fine, but for this one I am no longer receiving an array when I do wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'full'); even though all the parameters are correct. I checked my edit post page on wp-admin and there is no longer an image under Featured Images as there was before.
Is there a way to recover these images without having to upload them one by one? I'm pretty sure it's not a permalink issue, since I did the settings > permalink > save thing already.


text:
Q: unable to create app, invalid file type in Phonegap build I am learning Phone-gap for the first time. This is a simple app.  But whenever I am trying to build it is showing me

unable to create app, invalid file type.

I am showing code of index.html file and config file bellow.
index.html
      <!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="msapplication-tap-highlight" content="no" />
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />

    <meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *" />

    <link rel="stylesheet" type="text/css" href="css/index.css" />
    <title>hybrid app</title>

Home

Blog

Contact

About

Hybrid App

Hybrid Mobile Applications. Hybrid development combines the best (or worst) of both the native and HTML5 worlds. We define hybrid as a web app, primarily built using HTML5 and JavaScript, that is then wrapped inside a thin native container that provides access to native platform features.

config.xml
      <?xml version="1.0" encoding="UTF-8"?>

<widget xmlns     = "http://www.w3.org/ns/widgets"
        xmlns:gap = "http://phonegap.com/ns/1.0"
        id        = "com.phonegap.hybridapp"
        version   = "1.0.0">

    <name>Hybrid App</name>

    <description>
        Hello World sample application that responds to the deviceready event.
    </description>

    <author href="http://phonegap.com" email="nidhinjohny777@gmail.com">
        Nidhin johny
    </author>

    <www/res/icon/ios/ src="index.html" />

    <preference name="DisallowOverscroll"         value="true" />

    <preference name="android-minSdkVersion"      value="14" />

    <plugin name="cordova-plugin-battery-status"      source="npm" spec="~1.1.1" />
    <plugin name="cordova-plugin-camera"              source="npm" spec="~2.1.1" />
    <plugin name="cordova-plugin-media-capture"       source="npm" spec="~1.2.0" />
    <plugin name="cordova-plugin-console"             source="npm" spec="~1.0.2" />
    <plugin name="cordova-plugin-contacts"            source="npm" spec="~2.0.1" />
    <plugin name="cordova-plugin-device"              source="npm" spec="~1.1.1" />
    <plugin name="cordova-plugin-device-motion"       source="npm" spec="~1.2.0" />
    <plugin name="cordova-plugin-device-orientation"  source="npm" spec="~1.0.2" />
    <plugin name="cordova-plugin-dialogs"             source="npm" spec="~1.2.0" />
    <plugin name="cordova-plugin-file"                source="npm" spec="~4.1.1" />
    <plugin name="cordova-plugin-file-transfer"       source="npm" spec="~1.5.0" />
    <plugin name="cordova-plugin-geolocation"         source="npm" spec="~2.1.0" />
    <plugin name="cordova-plugin-globalization"       source="npm" spec="~1.0.3" />
    <plugin name="cordova-plugin-inappbrowser"        source="npm" spec="~1.3.0" />
    <plugin name="cordova-plugin-media"               source="npm" spec="~2.2.0" />
    <plugin name="cordova-plugin-network-information" source="npm" spec="~1.2.0" />
    <plugin name="cordova-plugin-splashscreen"        source="npm" spec="~3.2.1" />
    <plugin name="cordova-plugin-statusbar"           source="npm" spec="~2.1.2" />
    <plugin name="cordova-plugin-vibration"           source="npm" spec="~2.1.0" />
    <plugin name="cordova-plugin-whitelist"           source="npm" spec="~1.2.1" />

    <icon src="icon.png" />
    <platform name="android">
     <icon src = "www/res/icon/android/icon-36-ldpi.png"
      gap:platform = "android" gap:qualifier = "ldpi" />

   <icon src = "www/res/icon/android/icon-48-mdpi.png"
      gap:platform = "android" gap:qualifier = "mdpi" />

   <icon src = "www/res/icon/android/icon-72-hdpi.png"
      gap:platform = "android" gap:qualifier = "hdpi" />

   <icon src = "www/res/icon/android/icon-96-xhdpi.png"
      gap:platform = "android" gap:qualifier = "xhdpi" />

   <icon src = "www/res/icon/android/icon-144-xxhdpi.png"
      gap:platform = "android" gap:qualifier = "xxhdpi" />

  <icon src = "www/res/icon/android/icon-192-xxxhdpi.png"
      gap:platform = "android" gap:qualifier = "xxxhdpi" />

      <splash src="www/res/screens/android/screen-hdpi-portrait.png"    density="hdpi" />
        <splash src="www/res/screens/android/screen-ldpi-portrait.png"     density="ldpi"/>
        <splash src="www/res/screens/android/screen-mdpi-portrait.png"    density="mdpi" />
        <splash src="www/res/screens/android/screen-xhdpi-portrait.png"    density="xhdpi" />

   </platform>
    <platform name="ios">
   <icon src = "www/res/icon/ios/icon.png" gap:platform = "ios" gap:qualifier = ""/>
   <icon src = "www/res/icon/ios/icon.png" gap:platform = "ios" width = "57" height = "57" />
   <icon src = "www/res/icon/ios/icon-72.png" gap:platform = "ios" width = "72" height = "72" />
   <icon src = "www/res/icon/ios/icon-2x.png" gap:platform = "ios" width = "114" height = "114" />
   <icon src = "www/res/icon/ios/icon-72-2x.png" gap:platform = "ios" width = "144" height = "144" />
        <splash src="www/res/screen/ios/screen-ipad-portrait.png"     platform="ios" width="768"  height="1024" />
        <splash src="www/res/screen/ios/screen-ipad-portrait-2x.png"  platform="ios" width="1536"  height="2048" />
        <splash src="www/res/screen/ios/screen-iphone-portrait.png"               platform="ios" width="320" height="480" />
        <splash src="www/res/screen/ios/screen-iphone-portrait-2x.png"     platform="ios" width="640" height="960" />
        <splash src="www/res/screen/ios/screen-iphone-portrait-568h-2x.png"  platform="ios" width="640" height="1136" />
         <splash src="www/res/screen/ios/screen-iphone-portrait-667h.png"  platform="ios" width="750" height="1334" />
          <splash src="www/res/screen/ios/screen-iphone-portrait-736h.png"  platform="ios" width="1242" height="2208" />
   </platform>

    <access origin="*" />

    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>

</widget>

Folder of phone gap

I ALSO USE PHONEGAP CLI BUT IT IS NOT WORKING PROPERLY .also attaching screenshot below.

A:
unable to create app, invalid file type

The error indicates that the file type that you are trying to upload is not valid.
Phonegap Build requires a .zip file to be uploaded. Having a .rar file will not be accepted, please create a zip file of your project and then upload it.

A: The folder structure is incorrect.
See here: http://docs.phonegap.com/phonegap-build/start/
The relevant section (3) states:
"PhoneGap Build's only requirement for your application structure is that the config.xml and index.html is in the top level of your application. "
Please try that and let us know how you get on.

A: When I zipped my folder with 7Zip, it gave the above error. However, when I zipped with WinZip, the error was resolved and everything worked fine. So a workaround might be to change your zipping process.


text:
Q: how to check the response status in component.ts to call another service in Angular 5 I am catching the status code in my service from below code:
add(new: Add): Observable<Response> {
  return this.http
   .post(this.addURL, new , httpOptions)
     .map((response: Response) => {
      if (response) {
       if (response.status === 200) {
        return [{ status: response.status, response: <Response>response.json() }]
                }
            }
        })
        .catch(this.handleError);
}

Here is my component.ts code where I want to call the list after successful add
  addDetails(): void {
var new = this.form.value.array;
new = JSON.stringify(this.form.value.array);
this.addService.add(new)
  .subscribe(
  resultArray => this.Response = resultArray,
  error => console.log("Error :: " + error),
  )
  if(Response.status ===200){
    this.getList();
  }}

but I am getting the below error:
Property 'status' does not exist on type 'typeof Response'

A: Try to return Object instead of Array:
return { status: response.status, response: <Response>response.json() }

When you access Array item, you have to use index of the item.
So in your case, when you want to get the status code, you do this into subscribe method:
this.addService.add(_new)
  .subscribe(
  resultArray => {
    this.Response = resultArray
    if(resultArray[0].status ===200){
      this.getList();
    }
  },
  error => console.log("Error :: " + error))

Note: Don't forget that subscribe use asynchrone method. You can never access on the response it return outside.

A: You're trying to get your status from Response CLASS, not the instance of it. Watch for the uppercase and your typeof Response part of error.
I think if (resultArray[0].status === 200) should work, though I don't understand why you're returning an array, so it could be if (result.status === 200)


text:
Q: Can a variable in data be computed based on other data? I would like to have some of the data variables computed based on some other variables and follow their changes in the Vue instance. The natural solution

new Vue({
  el: '#root',
  data: {
    a: 1,
    b: a + 1
  }
})

  {{ a }} and {{ b }}

fails with Uncaught ReferenceError: a is not defined.
Is it possible to use previously defined variables to create new ones on the fly?

A: The solution is to use computed values, b will be accessible the same way as if it was declared in data:

new Vue({
  el: '#root',
  data: {
    a: 1
  },
  computed: {
    // a computed getter
    b: function() {
      // `this` points to the vm instance
      return this.a + 1
    }
  }
})

  {{ a }} and {{ b }}

A: try this
var x;
new Vue(x = {
   el: '#root',
   data: {
     a: 1,
     b: () =>  x.data.a + 1
   }
})


text:
Q: I'm not using the wildcard in Access-Control-Allow-Origin, but Chrome says that I am I'm running an ionic application using ionic serve on port 8080. I do understand the preflight process and I believe I'm getting the right response:

Still, I'm getting this error:
Failed to load https://bla.bla: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:8080' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
Then, the real request (GET) is not being sent.
What is even weirder is that just before this one request, I'm able to send a POST to the same server. The response headers are the same. The only difference in the request is that the Access-Control-Request-Headers is content-type instead of authentication
Any ideas?

A: Finally found the answer and it was my fault, not a chrome bug.
Thing is, some time ago I tried using this extension:
https://chrome.google.com/webstore/detail/cors-toggle/jioikioepegflmdnbocfhgmpmopmjkim?hl=en
And it didn't work for my needs, but I forgot to uinstall it. Turns out it was having some kind of conflict, since it seems to add an "Access-Control-Allow-Origin: *" header for every response. Thus it would conflict in a request with credentials (I'm guessing the Authentication header does that, not sure why tbh).
Anyway, after I uninstalled it, it's now working fine.


text:
Q: Selenium - Retrieve the element data- throwing error I want to get the span element which has OK as value.
I could not get it using the code:
List<WebElement> elements = driver.findElements(By.cssSelector(".pull-left.value.smaller.localtime"));
System.out.println(elements.size());
for (WebElement element : elements) {
    System.out.println(element.getText());
}

Could not find the element. Error is coming after execution. Can some one help me?
Below is my HTML code from which I am reading the value:

               aaaaaaaa

               bbbbbbbbbb

                     ccccccccccc

                     2015-04-10 12:09:26

                     sdfdfsdfsddfsd

                     2016-08-08 10:59:58

                     erwerwerwerew

                     2016-07-11 06:12:32

                     gjghjhgjghjfh

                     2016-10-09 06:12:32

                     ghuyikhjhgh

                     2018-04-30

                     sdfdsfdzfsd

                     OK

A: You can use relative xpath  as below for locating the element:
    //span[@class='pull-left value smaller localtime' AND text()='OK']

Hope it helps!


text:
Q: "fatal error: Python.h: No Such File or Directory" when compiling python file to a c executable file? I am trying to compile c from python.
There shows the following errors after I executing the following commands:
-Wall -I/usr/include/python3.5/config-3.5m-x86_64-linux-gnu/libpython3.5m.a -lpython35 -o prime_numbers_2 prime_numbers_2.c

prime_numbers_2.c:11:20: fatal error: Python.h: No Such File or
directory compilation terminated.

I also search in the directory /usr/lib with the following command:
find . -name Python.h

but there is no Python.h in that directory.
How can I fix these problems? Should I reinstall Python3.5.2?

A: You should install the development package of Python which contains header files and the library of Python.
sudo apt-get install python3-dev

Sources:

*

*http://www.cyberciti.biz/faq/debian-ubuntu-linux-python-h-file-not-found-error-solution/

*http://packages.ubuntu.com/xenial/python3-dev

A: For those people who came here and are using pypy, make sure to do:
sudo apt-get install pypy3-dev


text:
Q: Mutate DOM object without user interaction in AMP pages I am trying to make number of views component on page initial load with setInterval but AMP gives an error DOM mutation not possible without user interaction, do we have any workaround for this? i have a component that contains height more than 300px. thanks in advance
number of views component appears in middle of the page so is this possible to manipulate dom object on scroll event, whenever appear element then only show animation with number of views
playground


text:
Q: Webview - setTextSize not working on emulator API level 1-10? My XML is as follows with regards to SDK version:
android:minSdkVersion="3"
android:targetSdkVersion="8" />

Under properties it's setup with the same, as far as i can see in the documentation setTextSize should be working from API level 1?
When i test the app on API level 14 it works fine, however anything below that i've tried the textsize is unchanged.
Hope i've made enough sense, i think im missing something obvious..
final Dialog dialog = new Dialog(myapp.this);
dialog.setContentView(R.layout.my_dialog);
dialog.setTitle("Change font size...");
dialog.setCancelable(true);

//bar = (SeekBar)dialog.findViewById(R.id.dialog_seekbar);
// bar.setOnSeekBarChangeListener(myapp.this);

Button OK = (Button) dialog.findViewById(R.id.dialog_button);
OK.setOnClickListener(new OnClickListener() {

    @Override
    public void onClick(View v) {
      small = (RadioButton) dialog.findViewById(R.id.radio_small);
      medium = (RadioButton) dialog.findViewById(R.id.radio_medium);
      large = (RadioButton) dialog.findViewById(R.id.radio_large);
      if(small.isChecked()){
        webview = (WebView) findViewById(R.id.webView);
        WebSettings webSettings = webview.getSettings();
        webSettings.setTextSize(WebSettings.TextSize.SMALLER);
      }
      else if(medium.isChecked()){
        webview = (WebView) findViewById(R.id.webView);
        WebSettings webSettings = webview.getSettings();
        webSettings.setTextSize(WebSettings.TextSize.NORMAL);
      }
      else if(large.isChecked()){
        webview = (WebView) findViewById(R.id.webView);
        WebSettings webSettings = webview.getSettings();
        webSettings.setTextSize(WebSettings.TextSize.LARGER);
      }
      else {
      }
   }
}


text:
Q: How to convert multiple ranking scores into a probability distribution? I would like to create a topic distribution for a document.
The current model I am trying to implement is: for each sentence in the document, I am getting a topic assignment with a score, e.g. "1st sentence is about Microsoft with a relevance score of 0.4". I repeat this for each sentence, and at the end I have relevance scores with the topics like the following:

1st sentence: microsoft, score 0.4
2nd sentence: apple, score: 0.1
3rd sentence: android, score: 0.5
...

Now, I would like to convert these scores into 1 big probability distribution that will represent the whole document. Is there a known technique to do this? If so, what is the best way to do this?
Note: I know this is a very naive topic modelling, but I am currently interested in combining the scores into prob. distributions.

A: Are the original scores already probabilities? Then the obvious choice would be Bayes' Rule.
Otherwise, you might want to look at:

*

*Interpreting and Unifying Outlier Scores
H.-P. Kriegel, P. Kröger, E. Schubert, A. Zimek
Proceedings of the 11th SIAM International Conference on Data Mining (SDM11), Mesa, AZ
http://siam.omnibooksonline.com/2011datamining/data/papers/018.pdf
While they focus on outlier scores, it should work for other domains, too. They also do some ensemble work there, and that probably is another field of literature where you should look for references. Because essentially, you are doing an ensemble.


text:
Q: Passing config file to MSI as argument and need to use it by Custom action with Silent Installation I have created Basic MSI Project for creating installer for my project in Installshield 2014 and it is working fine. I have also created a custom action to execute my exe file while installing the application.
Then i create a Silent Installer using (/s) command line argument. I want to pass the Config file to my MSI setup and one of my Custom Action exe file need this Config file to setup basic project setup.
e.g
Installer.msi /s "c:\project\config.txt"
How to pass this config file parameter to my exe as command line argument?
I have searched in google and existing questions also. I didn't get way to do this.
Till now i didn't get any way to do this. Please anyone help me to do this.
Thanks in advance.

A: You can pass values to your MSI by command line. This is one way to pass values straight into your MSI, another way is using a transform to modify the MSI. See this answer: Using msiexec.exe custom command lines, or using transform files.
As far as I know there is no limit to how many values you can pass by command line:
msiexec.exe /I "C:\Install.msi" /QN /L*V "C:\msilog.log" STARTAPP=1 FIREWALLRULE="Long string here"
Quick explanation of command line above:
/L*V "C:\msilog.log"= verbose logging
/QN = run completely silently
STARTAPP="1" = Your property indicating the app should be started after install
FIREWALLRULE="Long string here" = Your firewall rule to apply via a custom action

A: Yes, Glytzhkof is right.
According to your question, you are free to "invent" an own property e.g. CONFIGFILE and pass on the commandline something like CONFIGFILE="C:\myconfig.ini" or something similar.
If the path is always the same (e.g. in SOURCEDIR), you can avoid the whole path and add it in your code, but don't rely on the source for a patch (.msp) for example.
I am not sure if I understand, what you mean exactly with "silent installer".
You can call every msi setup with the parameter "/qn" (or "/quiet") silently. The "/s" parameter does not belong to MSI, but is more common for setup.exe files (bootstrappers) or InstallShield script projects. Of course you can combine a bootstrapper with a MSI called.
For example, using the InstallShield built setup.exe could be something like:
setup.exe /s /v "/qn CONFIGFILE=myconfig.ini"


text:
Q: How to launch MS Edge from c# winforms? The executable MicrosoftEdge.exe cannot be launched directly like other EXEs in windows. I confirmed that from my own experience, and by reading this and that.
I also cannot launch it via Process.Start("MicrosoftEdge.exe") in my c# winforms app.
There must be some way to launch Edge from winforms without resorting to 3rd-party app and other clutter. I have already tried the following, with no success:

*

*Process.Start("MicrosoftEdge.exe") - unhandled exception

*Process.Start("microsoft-edge")   - unhandled exception

*Process.Start("%windir%\explorer.exe shell:Appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge") - unhandled exception

*Process.Start(@"c:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe") - no exception, but nothing happens

Note: I can easily launch Chrome and Firefox using method #1 above.
How can I launch MS Edge from my .net winforms app?

A: Process.Start can take 2 parameters
string url = "http://www.google.com";
System.Diagnostics.Process.Start("msedge.exe", url);

Browsers:

*

*msedge.exe

*chrome.exe

*firefox.exe

*iexplore.exe

A: The ":" at the end is inportant, otherwise won't work
To open in blank:
System.Diagnostics.Process.Start("microsoft-edge:");

or specifying an address:
System.Diagnostics.Process.Start("microsoft-edge:http://www.google.com");

A: You can use a small workaround to open Microsoft Edge from CMD with this code
string url = "https://www.google.com";

// Starts Microsoft Edge with the provided URL; NOTE: /C to terminate CMD after the command runs
System.Diagnostics.Process.Start("CMD.exe", $"/C start msedge {url}");

A: The other answers are both valid, but there's one small issue I ran into when trying to use the option listed by @user1845593. It didn't work unless I used the ProcessStartInfo class and set UseShellExecute to true.
I was executing this with .net 6 and the below sample works for me. If I attempt to pass the same thing straight to Process.Start it fails.
var processInfo = new ProcessStartInfo("microsoft-edge:");
processInfo.UseShellExecute = true;
Process.Start(processInfo);


text:
Q: Does 'hg add' ignore '.hgignore'? I am new to Mercurial, having used Git previously. I believe I am using Mercurial incorrectly.
To ignore, e.g. .DS_Store, with git, one would add .DS_Store to .gitignore. Then if one did git add -A, git still wouldn't track .DS_Store.
However, after adding .DS_Store to .hgignore, and then doing hg forget .DS_Store, hg add adds .DS_Store back, as can be confirmed via hg status. The same problem even happens after doing hg forget "set:hgignore()".
Question: What am I doing wrong?

A: This was a stupid question, since I just figured out the answer. Since I couldn't find the answer on Google or StackOverflow, I will post it here. If this question is a duplicate, please just delete it (without insulting me).
Anyway the answer is that I hadn't done hg commit yet. After doing hg forget .DS_Store and then a hg commit, hg add no longer re-adds .DS_Store, since it is located in .hgignore.


text:
Q: Connecting Android Studio to Google Cloud I am trying to find tutorials on how to connect the Android Studio on Google Cloud, unfortunately I cant find any. I import php for the database and tried to create backend on Android studio using google endpoints then I dont know what's next. Can someone help me or give some links that can help me?

A: this link may help you
http://www.androidhive.info/2016/02/android-push-notifications-using-gcm-php-mysql-realtime-chat-app-part-1/
u can download source code and learn something new..


text:
Q: Access Integer Value From Another Class in java how accesing a int in my public class to my class? dor example I declare a int with a value in public class and access it in my class in java.
so I want to access int jumlah in class node, precisely in void displayLink

A: To use variables of other classes without a reference you have to declare these variables as static. For example you have a public class called "Alien" and you want to get the size:
public class Alien {
     public static final int size = 82;
}

In order to now get the size you have to call Alien.size
You can also create a reference to the alien class:
Alien alien = new Alien();

Using this method the variables don't need to be static only public. You can get the size by calling: alien.size
EDIT: added final tag :)