text:
Q: Antenna and Base Receiver Set Operations Problem Statement
We have a set of antennas and base receiver stations, as given in the problem statement. What I've reasoned so far -:

*

*A union of sets of base receiver stations allotted to a number of antennas will give me the number of base stations in range of either or all those antennas.

*An intersection of sets of base receiver stations of a number of antennas will give me a set of stations common to these antennas.

*The difference between union and intersection of these sets will give me a set of receivers unique to the antennas, thus removing the problem of interference. I need to obtain a set with maximum such elements.

A powerset approach (selecting the best set from the powerset of such difference sets) would be quite exhaustive if the number of inputs is substantial. How should I be going about this problem? For a Java implementation, I was thinking of either using a set of sets or a list of sets.


text:
Q: how to get permalink
Can anyone please help me?
please see the screenshot. it is a JS file. here I want to get permalink of my custom posts. But I don't understand how get permalink into a JS fils.
So, please help to out this solution.

A: To get a permalink you need to use get_permalink(). Just pass the ID of the post or leave it blank to get the current page in the Loop.
wp_localize_script () will render PHP variables on the page that are consumable by JS through a global object that you define.
PHP
// Register the script
wp_register_script( 'some_handle', 'path/to/myscript.js' );

// Localize the script with new data
$translation_array = array(
    'some_string' => __( 'Some string to translate', 'plugin-domain' ),
    'a_value' => '10'
);
wp_localize_script( 'some_handle', 'object_name', $translation_array );

// Enqueued script with localized data.
wp_enqueue_script( 'some_handle' );

JS
<script>
// alerts 'Some string to translate'
alert( object_name.some_string);
</script>

The REST-API is also always available for you to extend how you see fit: http://v2.wp-api.org/extending/adding/

redpajama_set_name: RedPajamaStackExchange


text:
Q: Mathcal in fouriernc package I like to use fouriernc package. But unfortunately the mathcal font in this package doesn't look nice to me and I would like to ask if it is possible to use this package while changing the mathcal font, say in mathpazo package.
Thanks

A: In mathpazo.sty we find
 \DeclareSymbolFontAlphabet{\mathcal}   {symbols}

which sends us to
\DeclareSymbolFont{symbols}       {OMS}{zplm}{m}{n}

You can then do
\DeclareMathAlphabet{\mathcal}{OMS}{Zplm}{m}{n}
\SetMathAlphabet{\mathcal}{bold}{OMS}{zplm}{b}{n}

See texdoc fntguide for more information. The second line is for the \boldmath version.
Full example:
\documentclass{article}
\usepackage{fouriernc}

\DeclareMathAlphabet{\mathcal}{OMS}{zplm}{m}{n}

\begin{document}

This is math: $a+b\in\mathcal{F}(Z)$.

\end{document}

Without the suggested declaration, we'd get

A: I have never used mathpazo before, but here's a possible solution
\documentclass[]{article}
\usepackage{fouriernc}

\usepackage{lipsum}

\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}

\begin{document}
\lipsum[2]

\begin{equation}
\sin(x) = x + \mathcal{O}(x^3)
\end{equation}

\end{document}


text:
Q: Android 2.1 Emulator doesn't load, even after waiting a long time I'm trying to get into Android app developing. My first problem is actually getting the emulator to run. I am using the official Hello World tutorial to get me started, and it works fine with my 4.0.3 AVD, but when I try it with a new 2.1 AVD (also created the project from start using 2.1), the emulator doesent load up.
Although it tries to load, the "Android" letters from the start are not with the usual font, they just apear as a "Typewriter" type font with a underscore after, and when they disapear, nothing shows up. I have waited up to 1 hour for it to boot, to no avail.
I already searched stackoverflow for answers, but since I dont have a significant error showing up, I can't find the answer.
My log is the following:
[2012-02-07 11:23:09 - Hello World 21] Android Launch!
[2012-02-07 11:23:09 - Hello World 21] adb is running normally.
[2012-02-07 11:23:09 - Hello World 21] Performing com.hello.world.HelloWorld21Activity activity launch
[2012-02-07 11:23:09 - Hello World 21] Automatic Target Mode: launching new emulator with compatible AVD '2.1'
[2012-02-07 11:23:09 - Hello World 21] Launching a new emulator with Virtual Device '2.1'
[2012-02-07 11:23:14 - Emulator] emulator: WARNING: Unable to create sensors port: Unknown error
[2012-02-07 11:23:14 - Hello World 21] New emulator found: emulator-5554
[2012-02-07 11:23:14 - Hello World 21] Waiting for HOME ('android.process.acore') to be launched...

Running Eclipse Classic with the ADT plugin, and the normal Android SDK, following every instruction on http://developer.android.com/resources/tutorials/hello-world.html .
Thank you!

A: Android Emulator is rather slow software. It's start up speed depends directly on your hardware. Also appearing of "Typewriter" Android label is typical for Android 2.x versions.
Try to reboot the emulator.

A: I have encountered a similar problem with the emulator startup when using the 64bit version of Windows 7. I couldn't get it to start with a 2.1 or 2.2 AVD (I experienced a similar behavior as the one you describe), however I did not try an AVD for newer OS versions than 2.3. So if you are running on a 64 bit OS, I would suggest you to try a 32-bit version - it helped in my case.

A: Took my time but I fixed the problem.
Just use your integrated graphic card as default graphic processor.
If you are using a CUDA capable (or similar) graphic card disable it. Just don´t run your software (eclipse, AVD...) with your CUDA graphic processor. Eclipse produces assert errors with CUDA and AVD stops working. Flash player doesn't work either with CUDA enabled.
That worked for me, lucky I'm using a laptop.


text:
Q: laravel 4.2 artisan command:name with arguments I have created an artisan command called sendUnreadNotifications this triggers the system to send users emails if they have unread notifications. Eventually this will be run via a cron job, and a user can either have hourly updates or daily updates.
For this reason I am wanting to send an argument with my command, something like this,
php artisan command:name sendUnreadNotifications H --env=local

However running this, I get the following error,

[RuntimeException]
    Too many arguments.

My code, looks like this,
<?php

use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

class sendUnreadNotifications extends Command {

/**
 * The console command name.
 *
 * @var string
 */
protected $name = 'command:name';

/**
 * The console command description.
 *
 * @var string
 */
protected $description = 'Command description.';

/**
 * Create a new command instance.
 *
 * @return void
 */
public function __construct()
{
    parent::__construct();
}

/**
 * Execute the console command.
 *
 * @return mixed
 */
public function fire()
{
    $request = Request::create('api/notifications/send/unread', 'GET', array($this->getArguments()));
    Route::dispatch($request)->getContent();
}

/**
 * Get the console command arguments.
 *
 * @return array
 */
protected function getArguments()
{
    return array(
        array('frequency', InputArgument::OPTIONAL, 'How often should the email be sent', 'H'),
    );
}

/**
 * Get the console command options.
 *
 * @return array
 */
protected function getOptions()
{
    return array(
        array('example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null),
    );
}

}
I cannot see why I would be getting the too many arguments exception?

A: You do only have one argument set, for frequency
protected function getArguments()

{
    return array(
        array('frequency', InputArgument::OPTIONAL, 'How often should the email be sent', 'H'),
    );
}

so the
php artisan command:name sendUnreadNotifications H --env=local

here the H is the argument that is too much. You should change your command's name to what you want to do, the command names need to be unique btw...
Change this:
protected $name = 'command:name';

to
protected $name = 'send:unreadNotifications';

and run your job with
php artisan send:UnreadNotifications H

and it will work.


text:
Q: Getting access to array inside an object property I have an object that I need to iterate through and it is built like this:
points[m] = {
   coordinate1: 34,
   coordinate2: 23,
   code: ["LEM"],
   location: '123 fake street'
}

If the current point(point[m]) matches another point I want to add the points[m].code to the point that it matched to build a unique array of objects like this:
pointsUnique[l].code.push(point[m].code[0]);

This works fine, except that when I try and iterate through (pointsUnique[l].code) like this:
 for(var n=0;n<pointsUnique[l].code.length;n++){
    var codeList = pointsUnique[l].code[n];
    console.log(codeList);
 }

I only get the 1 result in the code array because (pointsUnique[l].code.length) is apparently 1. Although it has 15 items in it when I view it in the console.
Any assistance on how I could access to all of the values of (pointsUnique[l].code) would be greatly appreciated.

A: Your logic looks good to me, so something else is probably going on. Are you copy/pasting your real code? For one, you've got a typo here:
pointsUnique[l].code.push(point[m].code[0]);
It should be points[m] not point[m].
Also, what is this mysterious l variable? It could be a problem with that, too, though there's no way of knowing from the code you've posted.


text:
Q: How to set onclick listener for a button in a fragment in android My app contains a form as shown in the following image:

When I click on menu options button, the drawer opens as shown in the following image:

I want the drawer to open when the button select location is pressed.
My codes are
RegisterBlood.java
 ...
public class RegisterBlood extends Activity implements OnItemClickListener {
    DrawerLayout dLayout, dLayout2;
    ListView dList, dList2;
    ArrayAdapter<String> adapter, adapter2;
    String[] state_data2;
    String city = "", state = "";
    Button location;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.selectlocation);
        Bundle args = new Bundle();

        Fragment detail = new RegisterBloodFragment();
        detail.setArguments(args);
        FragmentManager fragmentManager = getFragmentManager();
        fragmentManager.beginTransaction().replace(R.id.content_frame, detail)
                .commit();

    ...
        dLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
        dList = (ListView) findViewById(R.id.left_drawer);
        adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, state_data);
        dList.setAdapter(adapter);
        dList.setSelector(android.R.color.holo_blue_dark);
        // dLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
        dList.setOnItemClickListener(this);

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent e) {
        if (keyCode == KeyEvent.KEYCODE_MENU) {
            // your action...
            if (!dLayout.isDrawerOpen(dList)) {
                dLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
                dList = (ListView) findViewById(R.id.left_drawer);
                adapter = new ArrayAdapter<String>(this,
                        android.R.layout.simple_list_item_1, state_data2);
                dList.setAdapter(adapter);
                dLayout.openDrawer(dList);
                dList.setOnItemClickListener(this);

            }

            return true;
        }
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            // your action...
            if (dLayout.isDrawerOpen(dList)) {
                dLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
            }

            return true;
        }

        return super.onKeyDown(keyCode, e);
    }

    @Override
    public void onItemClick(AdapterView<?> arg0, View v, final int position,
            long id) {
        // TODO Auto-generated method stub

        ...

        dLayout2 = (DrawerLayout) findViewById(R.id.drawer_layout);
        dList2 = (ListView) findViewById(R.id.left_drawer);
        adapter2 = new ArrayAdapter<String>(RegisterBlood.this,
                android.R.layout.simple_list_item_1, city_data);
        dList2.setAdapter(adapter2);
        dList2.setSelector(android.R.color.holo_blue_dark);
        dLayout2.openDrawer(dList2);
        dLayout2.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_OPEN);
        dList2.setOnItemClickListener(new OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> arg0, View v, int position2,
                    long id) {
                dLayout2.closeDrawers();
                state = state_data2[position];
                city = city_data[position2];

                Bundle args = new Bundle();
                args.putString("Menu", city_data[position2] + " ("
                        + state_data2[position] + ")");
                Fragment detail = new RegisterBloodFragment();
                detail.setArguments(args);
                FragmentManager fragmentManager = getFragmentManager();
                fragmentManager.beginTransaction()
                        .replace(R.id.content_frame, detail).commit();

            }
        });

    }}

RegisterBloodFragment.java
...

public class RegisterBloodFragment extends Fragment implements OnClickListener {
    Button location;
    @Override
    public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle args) {
        View view = inflater.inflate(R.layout.registerblood, container, false);
        String menu = getArguments().getString("Menu");
        location= (Button) view.findViewById(R.id.etlocation);
        location.setText(menu);
        //Context c=getActivity();
        //location.setOnClickListener(c.getApplicationContext().set);
        return view;
    }
    @Override
    public void onClick(View v) {
        // TODO Auto-generated method stub
        Toast.makeText(getActivity(),
                "Yes",
                Toast.LENGTH_SHORT).show();

    }

}

registerblood.xml
<?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:background="@color/silver"
    android:gravity="center"
    android:orientation="vertical"
    android:paddingBottom="10dp"
    android:paddingLeft="40dp"
    android:paddingRight="40dp"
    android:paddingTop="10dp" >

    <EditText
        android:id="@+id/bregetName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="18dp"
        android:ems="10"
        android:hint="Name" />

    <EditText
        android:id="@+id/bregetBloodGroup"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="18dp"
        android:ems="10"
        android:hint="Blood Group" />

        <Button
            android:id="@+id/etlocation"
            style="@android:style/Widget.EditText"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="14dp"
            android:ems="10"
            android:hint="select location" >
        </Button>

    <Button
        android:id="@+id/bregbtnSignUp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginBottom="10sp"
        android:layout_marginTop="10sp"
        android:background="@drawable/button"
        android:shadowColor="#A8A8A8"
        android:shadowDx="0"
        android:shadowDy="0"
        android:shadowRadius="5"
        android:text="Submit"
        android:textColor="#FFFFFF"
        android:textSize="24sp" />

</LinearLayout>

selectlocation.xml
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
     >

</FrameLayout>

 <ListView android:id="@+id/left_drawer"
    android:layout_width="240dp"
    android:layout_height="match_parent"
    android:layout_gravity="end"
    android:choiceMode="singleChoice"
    android:divider="@android:color/transparent"
    android:dividerHeight="0dp"
    android:background="#fff"/>

My question is:
How to add onclicklistener for select location button in RegisterBlood.java or call onClickListener which is in RegisterBlood.java from RegisterBloodFragment.java ?
Please help me out.

A: Since the button is a part of the fragment's layout, set the listener there:
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle args) {
    View view = inflater.inflate(R.layout.registerblood, container, false);
    String menu = getArguments().getString("Menu");
    location = (Button) view.findViewById(R.id.etlocation);
    location.setText(menu);
    location.setOnClickListener(this);

    return view;
}

@Override
public void onClick(View v) {
    RegisterBlood activity = (RegisterBlood) getActivity();
    // Now you can contact your activity through activity e.g.:
    activity.onKeyDown(KeyEvent.KEYCODE_MENU, null);
}

A: First of all remember to implements the OnClickListener interface:
public class YourClassName extends Fragment implements View.OnClickListener

public Button button;

Then, inside the method OnCreateView, inflate the button and set the listener to it, like this:
@Override
public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle args) {

    button = (Button) inflater.inflate(R.layout.registerblood, container, false).findViewById(R.id.your_button_id);
    button.setOnClickListener(this);

}

Then @Override the function onClick and do whatever you gotta do:
@Override
public void onClick(View v) {
    //YOUR CODE HERE
}

EDIT
If you're simply looking for a FocusListener (in that case your question needs an update) set the listener on your onCreateView method:
your_edittext.setOnFocusChangeListener(new OnFocusChangeListener() {

@Override
public void onFocusChange(View v, boolean hasFocus) {
    if (hasFocus) {
        Toast.makeText(getApplicationContext(), "got the focus", Toast.LENGTH_LONG).show();
        // OPEN THE DRAWER HERE
    } else {
         Toast.makeText(getApplicationContext(), "lost the focus", Toast.LENGTH_LONG).show();
    }
}

or you can implement that listener to your class.

A: u need to inflate fragment like this for button click
  View view = inflater.inflate(R.layout.fragment_blank3,
            container, false);
   Button bt1=(Button)view.findViewbyId(R.id.buttton);
   bt1.setOnclick...
   //then return in on create view.
    return view;

// this works good, thankyou


text:
Q: Cakephp - SQL not being generated for all records being inserted I have the following code in my controller to insert records.
//Perform Inserts
            $success = true;

            foreach($toinsertrecords as $toinsertrecord) {

                $this->BillingCenterDetail->create();
                if (!$this->BillingCenterDetail->save($toinsertrecord)) {
                    $success = false;
                    echo "insert fail";
                }                    else {echo "insert success";}
            }

            if ($troubleshoot) {
                $log = $this->BillingCenterDetail->getDataSource()->getLog(false, false);
                echo "
Output from Datasource Log";
                var_dump($log);
                echo "
";
            }

The array being looped at, has the following contents (Note that the last record has the field order slightly switched, but as this is an associative array, i thought it should not matter)
array (size=3)
  0 =>
    array (size=1)
      'BillingCenterDetail' =>
        array (size=12)
          'startdate' => string '2014-03-10' (length=10)
          'enddate' => string '2014-03-10' (length=10)
          'billing_center_id' => string '50' (length=2)
          'isactive' => boolean false
          'addr1' => string 'melbourne' (length=9)
          'addr2' => string 'melbourne' (length=9)
          'addr3' => string 'melbourne' (length=9)
          'city' => string 'melbourne' (length=9)
          'postcode' => string '777' (length=3)
          'country' => string 'aus' (length=3)
          'email' => string 'a@a.com' (length=7)
          'phone' => string '1234' (length=4)
  1 =>
    array (size=1)
      'BillingCenterDetail' =>
        array (size=12)
          'startdate' => string '2014-03-12' (length=10)
          'enddate' => string '2028-12-10' (length=10)
          'billing_center_id' => string '50' (length=2)
          'isactive' => boolean false
          'addr1' => string 'melbourne' (length=9)
          'addr2' => string 'melbourne' (length=9)
          'addr3' => string 'melbourne' (length=9)
          'city' => string 'melbourne' (length=9)
          'postcode' => string '777' (length=3)
          'country' => string 'aus' (length=3)
          'email' => string 'a@a.com' (length=7)
          'phone' => string '1234' (length=4)
  2 =>
    array (size=1)
      'BillingCenterDetail' =>
        array (size=12)
          'billing_center_id' => string '50' (length=2)
          'startdate' => string '2014-03-11' (length=10)
          'enddate' => string '2014-03-11' (length=10)
          'isactive' => string '1' (length=1)
          'addr1' => string 'test' (length=4)
          'addr2' => string 'test' (length=4)
          'addr3' => string 'test' (length=4)
          'city' => string 'test' (length=4)
          'postcode' => string 'test' (length=4)
          'country' => string 'test' (length=4)
          'email' => string 'test@test' (length=9)
          'phone' => string 'test' (length=4)

This is the output from my getDataSource()->getLog statement
Output from Datasource Log

array (size=3)
  'log' =>
    array (size=4)
      0 =>
        array (size=5)
          'query' => string 'SELECT `BillingCenterDetail`.`id`, `BillingCenterDetail`.`startdate`, `BillingCenterDetail`.`enddate`, `BillingCenterDetail`.`billing_center_id`, `BillingCenterDetail`.`isactive`, `BillingCenterDetail`.`addr1`, `BillingCenterDetail`.`addr2`, `BillingCenterDetail`.`addr3`, `BillingCenterDetail`.`city`, `BillingCenterDetail`.`postcode`, `BillingCenterDetail`.`country`, `BillingCenterDetail`.`email`, `BillingCenterDetail`.`phone`, `BillingCenterDetail`.`created`, `BillingCenterDetail`.`modified` FROM `bm`.`bil'... (length=718)
          'params' =>
            array (size=0)
              ...
          'affected' => int 1
          'numRows' => int 1
          'took' => float 0
      1 =>
        array (size=5)
          'query' => string 'BEGIN' (length=5)
          'params' =>
            array (size=0)
              ...
          'affected' => int 1
          'numRows' => int 1
          'took' => float 0
      2 =>
        array (size=5)
          'query' => string 'INSERT INTO `bm`.`billing_center_details` (`startdate`, `enddate`, `billing_center_id`, `isactive`, `addr1`, `addr2`, `addr3`, `city`, `postcode`, `country`, `email`, `phone`, `modified`, `created`) VALUES ('2014-03-10', '2014-03-11', 50, '0', 'melbourne', 'melbourne', 'melbourne', 'melbourne', '777', 'aus', 'a@a.com', '1234', '2014-03-11 15:47:15', '2014-03-11 15:47:15')' (length=374)
          'params' =>
            array (size=0)
              ...
          'affected' => int 1
          'numRows' => int 1
          'took' => float 0
      3 =>
        array (size=5)
          'query' => string 'INSERT INTO `bm`.`billing_center_details` (`startdate`, `enddate`, `billing_center_id`, `isactive`, `addr1`, `addr2`, `addr3`, `city`, `postcode`, `country`, `email`, `phone`, `modified`, `created`) VALUES ('2014-03-13', '2028-12-10', 50, '0', 'melbourne', 'melbourne', 'melbourne', 'melbourne', '777', 'aus', 'a@a.com', '1234', '2014-03-11 15:47:15', '2014-03-11 15:47:15')' (length=374)
          'params' =>
            array (size=0)
              ...
          'affected' => int 1
          'numRows' => int 1
          'took' => float 0
  'count' => int 4
  'time' => float 0

You can clearly see that it has only tried to insert the first 2 records, but for some reason it hasn't inserted the 3rd record. Based on the log, it also didn't generate the 3rd Insert SQL statement?
By the time it hits the 3rd loop, the "Save" function fails, this causes $success = false in the end.
Can anyone guess why this is happening?

A: My guess is the data in the third entry isn't passing validation.
Possibly your model has the postcode field as numeric only?  In that case this data will fail:
 'postcode' => string 'test' (length=4)

To debug this, I'd add this line inside your existing failure routine:
var_dump($this->BillingCenterDetail->invalidFields());


text:
Q: PHP/CSS particular function where a page on top of a page? I've been trying hard to try and to search any tutorial on how to do this but i can't just seem to describe it in google search without putting in too many words that confuses even google to what i am searching.

*

*www.runescape.com

When you click the sign in / join button on the navigation bar, it doesnt redirect you to a new webpage. Instead it is put on top of the current page.
I am currently reading more about bootstrap modals. It is indeed the same function. But i am not sure if it is the right one or are there specific ones that i should read about.
Its my first time to ever use bootstrap so i am little confused with all the bootstrap plug-ins and all that.

A: What you're talking about is a term called a modal window. It's used to sweeten the user interface & experience for users and supply information.
Since you mentioned twitter's bootstrap, take a look here: http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/bootstrap-modals.php
This should get you going on how to incorporate a basic modal window on your site.
Hope this helps.
Edit: For the bootstrap plugin, check: http://getbootstrap.com/javascript/#modals


text:
Q: WCF service behaves differently at different server for Authentication standpoint We have an ESB service which our web application is consuming via WCF.
We tried to deploy web application at two different servers and the same service behave correctly at one server whereas not working in another server and getting following error. Here the service is wsHttpBinding.
The caller was not authenticated by the service
Config
  <endpoint address="http:/server/service.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITwoWayAsync" contract="contractDetails" name="WSHttpBinding_ITwoWayAsync">
    <identity>
      <userPrincipalName value="Domain\Userid@domain.subdomain"/>
    </identity>
  </endpoint>

    <binding name="WSHttpBinding_ITwoWayAsync" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
      <readerQuotas maxDepth="500" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
      <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
      <security mode="Message">
        <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
        <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/>
      </security>
    </binding>


text:
Q: Vue.js, Как получить доступ к тегу на котором вызывается директива? Нужно получить доступ к элементу (тегу) для которого вызывается метод frameShow, который вызывается директивой v-if. Это позволит получать атрибуты, родителей и потомков элемента.

...
methods: {
    frameShow: function () {
        //id = a1 или a2
        return (id === "a1") ? true : false;
    },
}

Как, например, получить в методе frameShow id тега для которого вызывается этот метод, через директиву Vue.js

A: Если отвечать на поставленный вопрос

Как получить доступ к тегу, на котором вызывается директива v-if?

то ответ — никак.
Дело в том, что в момент вызова функции в директиве v-if, а правильнее сказать,
в момент проверки логического выражения в директиве v-if, элемента еще не существует.
В результате проверки выражения будет решено, создать и добавить элемент или нет.
Ниже приведен пример, который показывает,
первое, что проверка выражения в директиве v-if происходит раньше, чем построение элемента,
и второе, что это каждый раз новый элемент.

new Vue({
  el: '#demo',
  data: function() {
    return { isShown: false }
  },
  methods: {
    show: function () {
      console.log('show')
      return this.isShown
    },
    random: function () {
      console.log('random')
      return Math.random()
    }
  }
})

  <button @click="isShown=!isShown">Show/Hide</button>

{{ random() }}

A: *

*Либо передавать в функцию значение:

2222

33333

frameShow: function (item) {
    return (item === 1) ? true : false;
},

*Если собираетесь манипулировать отображаемыми данными в зависимости от класса или id , почему просто не использовать css ?


text:
Q: Understanding if-else statements in ArcGIS field calculator when coded value domain used? I am attempting to set a newly created field based on the strings in another field 'TNMFRC'.  I am pretty sure that I have the code write, and yet everything is set to a value of '6'.  Here's my code:
 def myCalc(road):
  if road == "Local Road":
    return 1
  elif road == "Controlled-access Highway":
    return 2
  elif road == "Secondary Highway or Major Connecting Road":
    return 3
  elif road == "Ramp":
    return 4
  elif road == "4WD":
    return 5
  else:
    return 6

and in the other box:
myCalc(!TNMFRC!)

Here are screenshots of the fields and the field calculator:

Can anyone see what I might be doing wrong?  I can't figure it out.
EDIT:  So even though the field appears to be as string based field, it seems in the properties to be listed as a long integer numeric field?

A: It looks like you are using a coded value domain.
So that you can see what is stored rather than what is displayed:

*

*Open your attribute table

*Use Table Options to access Appearance

*Untick the checkbox for Display coded value domain and subtype descriptions

*click OK

What your field calculator code is doing is evaluations like:
if 1 == "Local Road":
    return 1

finding that the two values are not equal and falling through to the else statement that returns 6.

A: If you want to avoid that lengthy if-elif-else block, you can try dictionary method as below-
def coder(val):
    cod_val = {'Divisional Boundary':'DIV','District Boundary':'DIST','Thana Boundary':'THAN','Upazilla Boundary':'UPAZ','International Boundary':'INTL','Union Boundary':'UN','Ward Boundary':'WRD'}
    return cod_val.get(val,"Not Found")

for tables like-

Description of functions: This function takes a text parameter and get the corresponding text value from the dictionary as defined inside the function. If the input parameter value is not found in that dictionary then default value ("Not Found") is returned.


text:
Q: Não sei o que fazer, estou fazendo uma tabela de resultados para um exercicio e fala que está dando erro na linha 4 a = input ('Primeiro número: ')
b = input ('Segundo número: ')
c = a+b
d = a-b
e = a*b
f = a**b
g = a//b
h = a%b

print('a = ' , a , '\nb = ' , b , '\na + b = ', c , '\na - b = ', d , '\na * b = ', e , '\na ** b = ', f , '\na // b = ', g , '\na % b = ' , h)

Quando eu executo e coloco os dois números, aparece a isso:

Traceback (most recent call last):
File "C:/Users/SONY/Desktop/Python/lição 1.py", line 4, in

d = a-b
TypeError: unsupported operand type(s) for -: 'str' and 'str'

A: Você precisa converter a entrada para algum tipo numérico. Pois o padrão é retornar string
# a função float abaixo faz a conversão de tipos
a = float(input ('Primeiro número: '))
b = float(input ('Segundo número: '))
c = a+b
d = a-b
e = a*b
f = a**b
g = a//b
h = a%b

print('a = ' , a , '\nb = ' , b , '\na + b = ', c , '\na - b = ', d , '\na * b = ', e , '\na ** b = ', f , '\na // b = ', g , '\na % b = ' , h)

A: Oque está errado é que está retornando para o programa abaixo em forma de string é necessário retornar em int ou float.
#Função int() serve para converter números de string(str) para inteiros (int).

a = int(input('Primeiro número: ')) #Convertendo oque o usuario digitou de str para int
b = int(input('Segundo número: ')) #Mesmo processo de cima.
c = a+b
d = a-b
e = a*b
f = a**b
g = a//b
h = a%b

print(f'A = {a} B = {b} \nA + B = {c}; \nA - B = {d}; \nA.B = {e}; \nA^B = {f}; \nA // B = {g}; \nA / B = {h}')


text:
Q: How do I continually display the current time on an iOS app? I am making a single view application in Xcode that simply updates the time every second in a label. I know how to get the current time (using NSDate) but where is the method that I would have it refresh in? All that I see in ViewController is the following methods:
- (void)viewDidLoad
- (void)didReceiveMemoryWarning

And all that I see in AppDelegate is the following methods:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
- (void)applicationWillResignActive:(UIApplication *)application
- (void)applicationDidEnterBackground:(UIApplication *)application
- (void)applicationWillEnterForeground:(UIApplication *)application
- (void)applicationDidBecomeActive:(UIApplication *)application
- (void)applicationWillTerminate:(UIApplication *)application

To my knowledge, none of these methods look like they are capable of updating the time constantly. I want it to display the time sort of like a clock (it continually updates). How would I do this? I was expecting there to be some kind of loop method to do this in but it doesn't look like there is one.

A: Try this one :)
 - (void)viewDidLoad
 {
    NSDateFormatter *timeformatter = [[NSDateFormatter alloc] init];
    [timeformatter setTimeStyle: NSDateFormatterShortStyle];
    [timeformatter setDateFormat:@"hh:mm:ss a"];

   [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(UpdateTime:) userInfo:nil repeats:YES];

 }

-(void)UpdateTime:(id)sender
{
   NSString *Time  = [timeformatter stringFromDate:[NSDate date]];
   NSLog(@"Time == %@",Time);
}


text:
Q: How to unit test return value of function - Angular (Jasmine/Karma) I am wondering if there is a way to correctly test the return value of a function in Angular. I want to essentially test the return value to be true for one test and write another to test the opposite scenario.
Ts component:
    get() {
        if (this.object == undefined) {
            return true;
        } else {
            return false;
        }
    }

The only way I can see fit right now to test the return value is to set a variable to hold the return value. Below is my attempt, I'm just stuck on asserting what is to be expected.
Test:
it('should call get function and return true', () => {
        //Arrange
        component.object = undefined;

        //Act
        component.get();

        //Assert
        expect(component.get). <-- *stuck here*

    });

A: Get the value in the act and then check it to be true in the assert.
it('should call get function and return true', () => {
        // Arrange
        component.object = undefined;

        // Act
        var result = component.get();

        // Assert
        expect(result).toBe(true);
    });

On a side note the body of the method get could be simplified to just
return this.object === undefined;


text:
Q: How do I assign a new value to a pointer parameter in a void function in C? I have the following code:
void function(int *c1, int *c2){

    int val1 = 1, val2 = 2;

    c1 = &val1;
    c2 = &val2;
}

void main(){
    int *c1, *c2;

    function(c1, c2);

    printf("*c1=%d, *c2=%d\n", *c1, *c2);
}

I need to assign c1 and c2 new values in a function and use them later in main. The function must be 'void'.
I have tried solving this through allocated memory but to no avail. Any help would be appreciated.

A: You don't want to assign to c1 and c2.
c1 = &val1;  // Wrong.
c2 = &val2;

You want to assign to the objects to which c1 and c2 point.
*c1 = val1;  // Fixed.
*c2 = val2;

But there's a second problem. You don't have anywhere to store the int values! The variables in main shouldn't be pointers at all.
int *c1, *c2;

should be
int c1, c2;

and that means that
function(c1, c2);
printf("*c1=%d, *c2=%d\n", *c1, *c2);

should be
function(&c1, &c2);
printf("c1=%d, c2=%d\n", c1, c2);


text:
Q: NoSuchMethodError: org.openqa.selenium.os.CommandLine.waitFor(J)V with webdriver v2.45.0 and FF v33 I  have encountered the following error with WebDriver v2.45.0 and Firefox v33.
java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.waitFor(J)V
    at org.openqa.selenium.firefox.FirefoxBinary.waitFor(FirefoxBinary.java:222)
    at org.openqa.selenium.firefox.FirefoxBinary.clean(FirefoxBinary.java:242)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:91)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:191)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:99)

For Managing classpath I am using Maven. Any ideas?

A: Jon Skeet's comments were on the money for me. I looked at the pom's dependency hierarchy in eclipse. PhantomJS was pulling in selenium-remote-driver and selenium-api 2.41.0. After poking it a bit, seems like, phantomjsdriver 1.2.0 conflicts with the firefox driver included in selenium 2.45.0.


text:
Q: Facebook Login Authentication Error With PHP I created a Facebook application to login and post to wall using my PHP application.
when I click on login link I am getting error "Logging in will not add this app's activity to Facebook" and not prompt the permission request step.
EDIT:
I just created a application and when I going to following url it's not prompt "Request for Permission".
it's prompt "Logging in will not add this app's activity to Facebook" error.
https://www.Facebook.com/dialog/oauth/?
  scope=publish_stream,publish_actions,read_stream&
  client_id=xxxxxxxxxxxxx&
  redirect_uri=http://xxxxxx.xxx/post_to_wall.php&
  response_type=token

A: I think Issue is with your URL. refer below URL with is I'm Using and Working absolutely fine.
$facebook_link   = "https://graph.facebook.com/oauth/authorize?type=user_agent&client_id=".$app_id;
$facebook_link  .= "&redirect_uri=".$url."/settings";
$facebook_link  .= "&scope=publish_stream,offline_access,manage_pages";

Try it. may Help you. good luck.
Thanks.


text:
Q: Fire a Google DoubleClick tag when a user submits the form I have a custom web form on my page, I'm trying to fire a Google DoubleClick tag when a user submits the form successfully (next page is a payment gateway so I can't drop a tag on this page unfortunately)
The form has the validation:
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}

I am wondering if anyone has experience of firing a submit rule on this kind of form?
Thanks

A: Since the validation returns true, a standard GTM Form Submit Trigger should work fine as after the JS is done it still submits the form "normally" as opposed to a JS submit like this.submit.
Alternatively, if you have easy access to that JS, just add this to it before the return true:
window.dataLayer = window.dataLayer || [];
dataLayer.push({'event':'form_submit'});

and then make a Custom Event Trigger that looks for the form_submit event as a firing trigger to your DoubleClick Tag.


text:
Q: How Is This A subordinate Clause? The instructor said that the sentence below contains a subordinate clause ("... if only for financial reasons."), but I feel that what is being called a 'subordinate clause,' is just a phrase, as there is no verb. Can the verb be assumed and unstated? Or is the instructor wrong?

Money is better than poverty, if only for financial reasons.

A: You can interpolate the verb:

Money is better than poverty, [even] if [it is so] only for financial reasons.

I think it's a subordinate clause with those words elided, because "if" is a conjunction.
If it said

Money is better than poverty for financial reasons.

then "for financial reasons" would be only a preposition phrase acting as an adverb.


text:
Q: Disappeared drive from Windows I have an SSD with Windows 10 installed on it, and 2 HDDs - drive D and F.
Yesterday I installed Ubuntu 18.04 on drive D.
After the installation, I booted into Windows and was surprised that drive D has disappeared from This PC.
How do I display it again?
Thanks!

A: Windows is (without additional software) unable to display a typical Linux-formatted partition (extX, xfs) - this limitation does not apply the other way round.
You can try installing an ext4 IFS driver into WIndows, but YMMV.

A: Windows can not recognize the Linux ext3 and ext4 partitions.


text:
Q: Pick non-repeating random number from progressive list Here is my example - pick random number from 1-20, then from 2-21, 3-22 and so on, while
excluding previous picks. I am new to Java, and doing something wrong.
import java.util.Random;
import java.util.ArrayList;
import java.util.List;

public class RandomGenerator {

      static int temp;
    public static void main(String[] args) {

        List<Integer> randomNumberArray = new ArrayList<Integer>();

        Random RandomNumber = new Random();

    for (int i = 0; i<=20; i++)
    {
        temp = RandomNumber.nextInt(i+20) +1+i;
        if (!randomNumberArray.contains(temp))
        {
            {
                randomNumberArray.add(temp);
            }

        }

        System.out.println(randomNumberArray);
    }

A: You aren't excluding previous picks. Something like this will print twenty random numbers (e.g. all random numbers from 1-20).
public static void main(String[] args) {
  java.util.Set<Integer> picked = new TreeSet<Integer>();
  Random rand = new Random();
  while (picked.size() < 20) {
    int temp = 1+rand.nextInt(20);
    if (picked.contains(temp)) {
      continue;
    }
    picked.add(temp);
    System.out.println(temp);
  }
}

I'm not sure I understand your "stepping" idea, but add this for temp and it will do that too -
int temp = 1+picked.size()+rand.nextInt(20+picked.size());

A: There are a couple of things to go over.
1) If your number sees that there is a duplicate then it will skip it and continue with the next number, for example if you run it 5 times and it finds a duplicate once, then the resulting list of numbers will have only 4 numbers not 5! since it skipped one. (Not sure if this is what you wanted or not)
2) Your randomly generated number doesn't grow the way you expect it to grow.
For example: At the sixth iteration over the loop your random number will generate as:
RandomNumber.nextInt(25) +6;

That means that the number range there isn't 6-26 but 6-30!
Because: nextInt will return an int between 0 and 24 and then that int is added another 6 to it.
EDIT :
To tackle your first problem you can continue to generate numbers until you generate one that is not a duplicate for that single cycle of the for loop.
For this you can utilize the do-while loop so that it executes the number generation at least once before checking whether the number is a duplicate within the for loop.
So you can adjust your for loop from:
for (int i = 0; i<=20; i++)
{
    temp = RandomNumber.nextInt(20) +1+i;
    if (!randomNumberArray.contains(temp))
    {
        {
            randomNumberArray.add(temp);
        }

    }

    System.out.println(randomNumberArray);
}

into:
for (int i = 0; i<=20; i++)
{
    do {
        temp = RandomNumber.nextInt(20) +1+i;
    } while (randomNumberArray.contains(temp));

    randomNumberArray.add(temp);

    System.out.println(randomNumberArray);
}

Notice that the check in the while expression is the opposite (does not have the exclamation mark) of what was in the if expression in the for loop before, since we do want to continue generating new random numbers while our numbers are duplicates.
And since we are still looping within that one cycle of the for loop, it will always generate the number with the appropriate value of i which was set for that for cycle.

A: The trick here is to use Collections.shuffle(List list):
    List<Integer> list = Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20);
    Collections.shuffle(list);
    System.out.println(list);

The progressive version goes something like this:
    // Wrap it in an ArrayList so I can modify it.
    List<Integer> list = new ArrayList(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20));
    for (int i = 21; i < 25; i++) {
        System.out.println(list);
        // Shuffle it.
        Collections.shuffle(list);
        // Grab one.
        Integer take = list.get(0);
        list.remove(take);
        System.out.println("Took " + take);
        // Add my new candidate.
        list.add(i);
    }

Or you could go the whole hog and make it an Iterable:
public static class CreepingRandom implements Iterable<Integer> {

    // The starting list.
    private final List<Integer> start;
    // How many steps to add.
    private final int steps;
    // What int to start adding.
    private final int from;

    public CreepingRandom(int initialSize, int from, int steps) {
        // Make my start list.
        start = new ArrayList<Integer>(initialSize);
        // Fill it.
        for (int i = 1; i <= initialSize; i++) {
            start.add(i);
        }
        // Remember where to start from.
        this.from = from;
        // Remember how many steps.
        this.steps = steps;
    }

    @Override
    public Iterator<Integer> iterator() {
        return new CreepingIterator();
    }

    private class CreepingIterator implements Iterator<Integer> {

        // Track how many I've delivered.
        int delivered = 0;
        // The next number to add.
        int add = from;
        // My current list.
        final ArrayList<Integer> list = new ArrayList(start);

        @Override
        public boolean hasNext() {
            return delivered < steps;
        }

        @Override
        public Integer next() {
            // Shuffle it.
            Collections.shuffle(list);
            // Pull one out.
            Integer next = list.get(0);
            // Add my new one in.
            list.set(0, add++);
            // Count them.
            delivered += 1;
            return next;
        }

    }

}

public void test() {
    for (Integer i : new CreepingRandom(20, 21, 100)) {
        System.out.println(i);
    }
}

    private class CreepingIterator implements Iterator<Integer> {

        // Track how many I've delivered.
        int delivered = 0;
        // The next number to add.
        int add = from;
        // My current list.
        final ArrayList<Integer> list;

        CreepingIterator() {
            // Copy the start list - Use LinkedList for efficiency of add and removeFirst.
            list = new ArrayList(start);
        }

        @Override
        public boolean hasNext() {
            return delivered < steps;
        }

        @Override
        public Integer next() {
            // Shuffle it.
            Collections.shuffle(list);
            // Pull one out.
            Integer next = list.get(0);
            // Add my new one in.
            list.set(0, add++);
            // Count them.
            delivered += 1;
            return next;
        }

    }

}

public void test() {
    for (Integer i : new CreepingRandom(20, 21, 100)) {
        System.out.println(i);
    }
}

A: Since the range of allowed elements isn't too big, you can also hold the pool of all possible numbers and pick one of them. You can use e.g. RandomSet from this answer.
import java.util.*;
import java.lang.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    static class RandomSet<E> extends AbstractSet<E> {

        List<E> dta = new ArrayList<E>();
        Map<E, Integer> idx = new HashMap<E, Integer>();

        public RandomSet() {
        }

        public RandomSet(Collection<E> items) {
            for (E item : items) {
                idx.put(item, dta.size());
                dta.add(item);
            }
        }

        @Override
        public boolean add(E item) {
            if (idx.containsKey(item)) {
                return false;
            }
            idx.put(item, dta.size());
            dta.add(item);
            return true;
        }

        /**
         * Override element at position id with last element.
         * @param id
         */
        public E removeAt(int id) {
            if (id >= dta.size()) {
                return null;
            }
            E res = dta.get(id);
            idx.remove(res);
            E last = dta.remove(dta.size() - 1);
            // skip filling the hole if last is removed
            if (id < dta.size()) {
                idx.put(last, id);
                dta.set(id, last);
            }
            return res;
        }

        @Override
        public boolean remove(Object item) {
            @SuppressWarnings(value = "element-type-mismatch")
            Integer id = idx.get(item);
            if (id == null) {
                return false;
            }
            removeAt(id);
            return true;
        }

        public E get(int i) {
            return dta.get(i);
        }

        public E pollRandom(Random rnd) {
            if (dta.isEmpty()) {
                return null;
            }
            int id = rnd.nextInt(dta.size());
            return removeAt(id);
        }

        @Override
        public int size() {
            return dta.size();
        }

        @Override
        public Iterator<E> iterator() {
            return dta.iterator();
        }
    }
    public static void main (String[] args) throws java.lang.Exception
    {
        RandomSet<Integer> rs = new RandomSet<Integer>();
        for (int i = 0; i < 20; ++i) {
            rs.add(i);
        }

        int count = 50;

        Random r = new Random();

        for (int i = 0; i < count; i++) {
            System.out.println(rs.pollRandom(r));
            rs.remove(i);
            rs.add(i + 20);
        }
    }
}

Using the smart structure the overall time complexity is O(N + K), where N is the number of requested polls and K is the size of the pool.
Running Ideone example : http://ideone.com/Sfltr7


text:
Q: No Feasible Entries for Subprogram "rising_edge" It's my first time coding in VHDL and I ran to some problem I have absolutely no idea how to solve. When I try to compile my code in modelsim it gives me "No Feasible Entries for Subprogram rising_edge". Here's my code.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.MATH_REAL.ALL;
use IEEE.std_logic_unsigned.all;
use IEEE.std_logic_arith.all;

ENTITY cnt IS
    PORT(
        clk, res_cnt, cnt_en : IN BIT;
        dataOut: OUT INTEGER
    );
END cnt;

ARCHITECTURE base OF cnt IS
    SIGNAL data: INTEGER;
BEGIN
    PROCESS (clk)
    BEGIN
        IF rising_edge(clk) THEN
            data <= 1 WHEN res_cnt = '1' ELSE (data + 1);
        END IF;
    END PROCESS;

    dataOut <= data;
END base;

A: Don't use BIT type, use STD_LOGIC instead. That's probably why you have your error. There is no rising_edge routine for BIT in libraries you are using, but there surely is for std_logic.
Besides, why did you include IEEE.MATH_REAL, IEEE.std_logic_unsigned, and IEEE.std_logic_arith? You are not using it, and actually you should never include the latter two (this packages are not in IEEE standard). Use IEEE.numeric_std instead.


text:
Q: Indent wrongly after /* */ in CSS with Vim I have the followings in .vimrc.
" tab setting
set noeb vb t_vb=
set expandtab
set shiftwidth=2
set softtabstop=2

When I use =G to indent properly in Vim, lines after /*  */ will be commented further.
Before:
/*********
#header
*******************/
#header{
    width: 272px;
    height: 82px;
    margin: 0 auto 18px;
}

/************
footer
*****************/
#footer{
    height: 50px;
    text-align: center;
}

After:
  /*********
  #header
  *******************/
  #header{
    width: 272px;
    height: 82px;
    margin: 0 auto 18px;
  }

  /************
  footer
  *****************/
  #footer{
    height: 50px;
    text-align: center;
  }

What I am looking for is no 2 spaces after /*  */.
/*********
#header
*******************/
#header{
  width: 272px;
  height: 82px;
  margin: 0 auto 18px;
}

/************
footer
*****************/
#footer{
  height: 50px;
  text-align: center;
}

Is there any fix for this?


text:
Q: How do I get my VM to run in a Window? I am currently using Seamless mode but my VM is not really integrated into my main OS. How do I get it back into a Window?

A:
I forget the name of the feature

the name of the feature is Seamless Mode,

How can I get in back in a window
  again?

Press Host + L, the Host key is the right Ctrl key by default.

A: Press Host+F, where HOST is your host key, ctrl right by default.


text:
Q: node.js not starting by default in Lubuntu guest running in Oracle VM VirtualBox I'm using Lubuntu 14.10 in Oracle VM VirtualBox. I installed node.js using nvm. After installation, I could run node --version in the same terminal and the version installed showed up. However, I could not run node --version or npm --version in the another terminal.
sithu@Lubuntu1410:~$ node --version
The program 'node' can be found in the following packages:
 * node
 * nodejs-legacy
 Try: sudo apt-get install <selected package>

sithu@Lubuntu1410:~$ npm --version
The program 'npm' is currently not installed. You can install it by typing:
sudo apt-get install npm

When I executed nvm use stable, it seems working.
sithu@Lubuntu1410:~$ nvm list
    v0.10.33
stable -> 0.10 (-> v0.10.33) (default)
sithu@Lubuntu1410:~$ nvm use stable
Now using node v0.10.33
sithu@Lubuntu1410:~$ node --version
v0.10.33
sithu@Lubuntu1410:~$ npm --version
1.4.28

So, my questions are:

*

*can node be started automatically without calling nvm use upon every reboot and how?

*how can I make node available in all terminals?

A: Run following command:
$ nvm alias default stable


text:
Q: Xalan 2.7.1 firing CastClassException when comparing union of node-sets with boolean I'm using Xalan-J 2.7.1 (Interpretive processor) and I'm having the following problem (simplified version):
Having this xml:
<?xml version="1.0" encoding="UTF-8"?>
<Elements>
  <A>
     <oneThing>1</oneThing>
  </A>
  <B>
     <otherThing>2</otherThing>
  </B>
</Elements>

I want to apply the following stylesheet:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/Elements">
<Result>
    <xsl:variable name="A" select="A"></xsl:variable>
    <xsl:variable name="B" select="B"></xsl:variable>
    <xsl:if test="($A|$B) and true()">
        <xsl:value-of select="string('worked')"></xsl:value-of>
    </xsl:if>
</Result>
</xsl:template>

And Xalan is firing: org.apache.xpath.objects.XBooleanStatic cannot be cast to org.apache.xpath.objects.XNodeSet
As far as I know the union of the two node-set should be casted to boolean and then evaluated with the following condition. In this case it's trying to convert to node-set the result of "true()".
Everything works ok if I wrap ($A|$B) with a boolean() function, but it should do it Xalan itself.
Does anyone know why it is firing that exception or why it isn't casting the union as it should?


text:
Q: when i am installing ckeditor through composer i got error.how can i solve it? C:\xampp\htdocs\tutorial>composer require unisharp/laravel-ckeditor
Using version ^4.7 for unisharp/laravel-ckeditor
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
    - Installation request for unisharp/laravel-ckeditor ^4.7 -> satisfiable by unisharp/laravel-ckeditor[4.7.2].
    - Conclusion: remove laravel/framework v6.0.3
    - Conclusion: don't install laravel/framework v6.0.3
    - unisharp/laravel-ckeditor 4.7.2 requires illuminate/support ~5.0 -> satisfiable by illuminate/support[5.0.x-dev, 5.1.x-dev, 5.2.x-dev, 5.3.x-dev, 5.4.x-dev, 5.5.x-dev, 5.6.x-dev, 5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, 5.8.x-dev, v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5.0.33, v5.0.4, v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.4, v5.8.8, v5.8.9].
    - don't install illuminate/support 5.5.x-dev|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.0|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.16|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.17|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.2|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.28|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.33|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.34|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.35|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.36|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.37|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.39|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.40|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.41|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.43|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.5.44|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.6.x-dev|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.0|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.1|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.10|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.11|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.12|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.13|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.14|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.15|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.16|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.17|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.19|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.2|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.20|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.21|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.22|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.23|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.24|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.25|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.26|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.27|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.28|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.29|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.3|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.30|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.31|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.32|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.33|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.34|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.35|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.36|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.37|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.38|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.39|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.4|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.5|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.6|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.7|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.8|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.6.9|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.7.17|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.7.18|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.7.19|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.7.x-dev|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.0|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.1|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.10|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.11|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.15|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.2|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.20|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.21|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.22|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.23|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.26|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.27|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.28|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.3|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.4|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.5|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.6|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.7|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.8|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.7.9|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.8.x-dev|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.0|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.11|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.12|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.14|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.15|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.17|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.18|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.19|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.2|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.20|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.22|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.24|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.27|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.28|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.29|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.3|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.30|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.31|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.32|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.33|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.34|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.35|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.4|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.8|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.8.9|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.1.x-dev|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.2.x-dev|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.3.x-dev|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.4.x-dev|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.1|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.13|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.16|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.2|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.20|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.22|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.25|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.28|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.30|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.31|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.41|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.6|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.1.8|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.0|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.19|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.21|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.24|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.25|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.26|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.27|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.28|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.31|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.32|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.37|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.43|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.45|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.6|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.2.7|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.3.0|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.3.16|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.3.23|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.3.4|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.4.0|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.4.13|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.4.17|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.4.19|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.4.27|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.4.36|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.4.9|don't install laravel/framework v6.0.3
    - don't install illuminate/support 5.0.x-dev|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.0.0|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.0.22|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.0.25|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.0.26|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.0.28|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.0.33|don't install laravel/framework v6.0.3
    - don't install illuminate/support v5.0.4|don't install laravel/framework v6.0.3
    - Installation request for laravel/framework (locked at v6.0.3, required as ^6.0) -> satisfiable by laravel/framework[v6.0.3].

Installation failed, reverting ./composer.json to its original content.

A: For laravel 7, this works:
composer require ckeditor/ckeditor
Credits to: https://github.com/UniSharp/laravel-ckeditor/issues/48#issuecomment-623553760

A: Your laravel version is 6.* but unisharp/laravel-ckeditor support for laravel v5.*
Use laravel v5.* or install ckeditor without this package. You can install ckeditor manually. Copy all ckeditor files to public/ckeditor directory and copy/paste this code to end of your blade template where you want to use ckeditor. But this may not always work efficiently.
<script src="{{ asset('ckeditor/ckeditor.js') }}"></script>


text:
Q: Why is req.body empty {} (GET REQUEST) This is my Frontend code
  const fetchData = () => {
    const options = {
        method: 'GET',
        url: 'http://localhost:1337/user/chart',
        headers: {'x-access-token': sessionStorage.getItem('token')},
        body: [chartData.datasets]
      }
      axios.request(options).then((response) => {
        console.log(response)
        }).catch((error) => {
        console.error(error)})
}

This is backend
app.get('/user/chart', async (req, res) => {
    const token = req.headers['x-access-token']
    if (!token){
        return res.status(404).json({ success: false, msg: "Token not found" });
       }

    try {
        const decoded = jwt.verify(token, process.env.access_secret)
        const email = decoded.email
        await User.updateOne(
            { email: email },
            { $set: {} },

        )
        console.log(req.body)
        return res.status(200).json({message: 'ok', label:[]})
    } catch (error) {
        console.log(error)
        res.json({ status: 'error', error: 'invalid token' })
    }

})

When I console.log(req.body) it is an empty {}.
Why is it empty?
I am using a GET request to retrieve the chart data

A: Axios API does not accept body on get get request you can send parameters with params example
const url = '/user/chart';

const config = {
  headers: {'x-access-token': sessionStorage.getItem('token')},
  params:{someKey:chartData.datasets}
};

axios.get(url, config)

A: Axios doesn't support setting a body for a get request, see the docs or this related question.
Though, I'd also recommend to reconsider your design. Typically the body isn't used in a GET request. If you're sending data to the server, you likely want to use POST or PUT instead. If you just want to pass a parameter, then you likely want to use request parameters.
If you absolutely need to send a body in your GET request, then you'll need to use a different tool.

A: frondend //
const fetchData = () => {
const options = {
    method: 'POST',
    url: 'http://localhost:1337/user/chart',
    headers: {'x-access-token': sessionStorage.getItem('token')},
    body: {name : "xx",mail:"xx@"}
  }
  axios.request(options).then((response) => {
    console.log(response)
    }).catch((error) => {
    console.error(error)})
 }

backend //
app.post('/user/chart', async (req, res) => {
const {name , mail} = req.body
const token = req.headers['x-access-token']
if (!token){
    return res.status(404).json({ success: false, msg: "Token not found" });
   }

try {
    const decoded = jwt.verify(token, process.env.access_secret)
    const email = decoded.email
    await User.updateOne(
        { email: email },
        { $set: {} },

    )
    console.log(req.body)
    return res.status(200).json({message: 'ok', label:[]})
} catch (error) {
    console.log(error)
    res.json({ status: 'error', error: 'invalid token' })
}

})Ï


text:
Q: Invalid outside procedure This is driving me up a wall. I have this very simple code to fill in another field on the update of Customer field.
Private Sub Customer_AfterUpdate()

Me.File_path = Me.Last_Name & " " & Me.First_Name

End Sub

And it returns invalid outside procedure for the line private sub customer afterupdate()
What ever could I be doing wrong?

A: This error is a compile error rather than a runtime error.
It usually occurs when there is unrecognised text out side of a procedure. Likely causes are stray/accidental/extra sub or end sub lines.
This can also be caused where public variables are given an incorrect or unacceptable data type. This is just another example of text that is unrecognised and outside the bounds of a procedure.


text:
Q: Marking the end of a definition I'm using the amsthm package to define a definition environment as follows:
\theoremstyle{definition}
\newtheorem{definition}{Definition}

To my surprise, this provides barely any typographic indication of where the definition ends and the following text begins (there's a new paragraph, but this is clearly not enough, especially when the definition ends with an equation).
What can I do to make this more clear? I don't want the definition text to be in a different font than normal text. Maybe a definition, like a proof, should end with a \qedsymbol - how can I add this?

A: I really can't see the need for it. But since you're asking,
\documentclass{article}
\usepackage{amsthm}

\usepackage{lipsum}

\theoremstyle{definition}
\newtheorem{defi/}{Definition}

\newenvironment{defi}
  {\renewcommand{\qedsymbol}{$\heartsuit$}%
   \pushQED{\qed}\begin{defi/}}
  {\popQED\end{defi/}}

\begin{document}

\lipsum[2]

\begin{defi}
This is the definition of \emph{definition}.
\end{defi}

\lipsum[3]

\begin{defi}
This is the definition of recursion,
\[
x\gets x+1 \qedhere
\]
\end{defi}

\lipsum[2]

\end{document}

I just assume you don't have proofs in the middle of definitions.

A: The thmbox package provides a nice way to display theorem-like environments.
For instance, using the three pre-defined styles, you can have:
\documentclass{article}
\usepackage{mathtools}
\usepackage{thmbox} % Overrides \newtheorem command! See [nothm] to disable this feature.
\usepackage{lipsum} % Useless, just for the demo.

\newtheorem[S, bodystyle=\normalfont\noindent]{defiS}{Definition}[section]
\newtheorem[M]{defiM}{Definition}[section]
\newtheorem[L]{defiL}{Definition}[section]

\begin{document}

\section{My nice demo}

\begin{defiS}[Inverse of a relation]
  Let \(R\) be a relation, \emph{the inverse of \(R\)} is
  \[R^{-1} = \{(x,y) \mid (y, x) \in R\}\]
\end{defiS}

\lipsum[2] % Just for the demo

\begin{defiM}[Union]
  Let \(R\) and \(S\) be relations, the \emph{union of \(R\) and \(S\)} is defined as
  \[
  R \cup S = \{(x, y) \mid (x,y) \in R \text{ or } (x,y) \in S\}
  \]
\end{defiM}

\lipsum[1] % Just for the demo

\begin{defiL}[Graph of a function]
  Let \(f\) be a fuction, the \emph{graph of \(f\)}  is
  \[
  \langle f \rangle = \{(x, y) \mid f x = y\}
  \]
\end{defiL}

\end{document}

Please remark that:

*

*I set the font to normalfont (i.e., not slanted) only for the first example (environment defiS),

*The numbering is 1.1 in the three cases because I used three different environments (i.e. defiS, defiM and defiL), but if you stick to one environment, the numbers will be correct (i.e. 1.1, 1.2, 1.3, etc.).

*I just used the pre-defined style, but you can customize them a lot.

A: You can define another environment (eg. myproof) to use another QED symbol. In the example below, the new QED symbol \myqed is a vertical bar.
\documentclass{report}
\usepackage{amsthm}
\usepackage{lipsum}

\newcommand{\myqed}{\rule{2pt}{1em}}
\newenvironment{myproof}{\begin{proof}}{\let\qedsymbol\myqed\end{proof}}

\begin{document}
\begin{proof}
\lipsum*[1]
\end{proof}

\begin{myproof}
\lipsum*[2]
\end{myproof}

\begin{proof}
\lipsum*[3]
\end{proof}

\end{document}

A: One solution is to indent (by a given amount) the whole proof and play a little bit with the fontsize. You can consider the following redefinition of the proof environment:
\makeatletter
\renewenvironment{proof}[1][\proofname]{\par
\pushQED{\qed}%
\normalfont\small\topsep6\p@\@plus6\p@\relax
%\trivlist %%%% old
\list{}{\leftmargin=\parindent
   \rightmargin=0pt
   \settowidth{\itemindent}{\itshape#1}%
   \labelwidth=\itemindent}
\item[\hskip\labelsep\itshape#1\@addpunct{.}]\ignorespaces
}{%
 \popQED
 %\endtrivlist %%OLD
 \endlist %%NEW
 \@endpefalse
}
\makeatother

A: The amsthm isn't the best on its own; however, thmtools provides a really neat 'front-end' for amsthm and other theorem packages.
In particular, thmtools includes a prefoothook and postfoothook which can be used for your need.  Below is a small use case of thmtools in conjunction with amsthm which finishes examples with a simple horizontal line.  You can easily adapt this to your need.  For example, you could combine this with the tcolorbox for really fancy boxes, or you could flush right the text "End of Example".
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}

\declaretheoremstyle[
  headfont=\normalfont\scshape,
  numbered=unless unique,
  bodyfont=\normalfont,
  spaceabove=1em plus 0.75em minus 0.25em,
  prefoothook=\newline\rule{\linewidth}{1pt},
  spacebelow=1em plus 0.75em minus 0.25em,
]{exmpstyle}

\declaretheorem[
  style=exmpstyle,
  title=Example,
  refname={example,examples},
  Refname={Example,Examples}
]{exmp}

\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pustibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum uris. Nam arcu libero,
nonummy eget, consectetuer id, vulputate a, nec vehicula augue eu
neque. Pellentesque habitant morbi tristique t netus et malesuada fames ac
turpis egestas. Mauris ut leo.
\begin{exmp}
  \lipsum*[1]
\end{exmp}
\lipsum[2-3]
\begin{exmp}
  \lipsum*[4]
\end{exmp}
\end{document}

and the output:

Addendum
As mentioned by Caramdir and requested by Barbara Beeton in the comments, here is an example that works with equations and uses the qed option:
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}

\declaretheoremstyle[
  headfont=\normalfont\bfseries\itshape,
  numbered=unless unique,
  bodyfont=\normalfont,
  spaceabove=1em plus 0.75em minus 0.25em,
  spacebelow=1em plus 0.75em minus 0.25em,
  qed={\itshape That's All Folks!},
]{exmpstyle2}

\declaretheorem[
  style=exmpstyle2,
  title=Example,
  refname={example,examples},
  Refname={Example,Examples}
]{exmp2}

\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pustibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum uris. Nam arcu libero,
nonummy eget, consectetuer id, vulputate a, nec vehicula augue eu
neque. Pellentesque habitant morbi tristique t netus et malesuada fames ac
turpis egestas. Mauris ut leo.
\begin{exmp2}
  \lipsum*[1]
\end{exmp2}
\lipsum[2-3]
\begin{exmp2}
  \lipsum*[4]
  \begin{equation*}
    \mathcal{L} = \overline \psi (i \gamma \cdot \partial - m) \psi
    \qedhere
  \end{equation*}
\end{exmp2}
\end{document}

which produces:


text:
Q: Updating a ComboBox SelectedItem from code behind im having a View with a ComboBox bound to my viewModel property.
Everything works fine but i actually want to reuse my View and need to
update the controls with a given value. Setting the property wont update the visual UI
even to event is fired and everyting looks good.
Everything works accept the ComboBox visual UI.
Tips?!
XAML control
<telerik:RadComboBox
            ItemTemplate="{StaticResource SelectUserComboBoxTemplate}"
            SelectedItem="{Binding Path=SelectedUser, Mode=TwoWay,
            UpdateSourceTrigger=PropertyChanged}"
            ItemsSource="{Binding Path=C_users}"
            telerik:TextSearch.TextPath="displayName"
            Name="radComboBox1"
            Margin="14,12,0,0"
            Height="31"
            VerticalAlignment="Top"
            HorizontalAlignment="Left"
            Width="253"
            TextSearchMode="Contains"
            IsEditable="True"
            OpenDropDownOnFocus="True"
            IsFilteringEnabled="True"
            >
    </telerik:RadComboBox>

The overloaded constructor that sets the values
    public TicketControlTabViewModel(ticket t)
    {
        activeTicket = t;
        SelectedUser = customerServiceClient.getUser(t.customer_users.id);
        MetaString = t.meta;
        Description = t.description;
        ActiveId = t.id.ToString();
        Selected_priority = t.priority;
        SelectedStatus = t.status;
        this.RefreshC_users();
        this.RefreshSupportDepartments();
        this.RefreshSupportUsers();
    }

The property in my ViewModel
    private customer_users selectedUser { get; set; }
    public customer_users SelectedUser
    {

        get {
            return this.selectedUser;
            }
        set {
              if (value != null){
              this.selectedUser = value;
              this.UpdateCustomerDepartment(value);
              this.OnPropertyChanged("SelectedUser");
              SaveTicket();
              }

            }
    }

A: By default, WPF compares the SelectedItem by reference, not by value. That means if the SelectedItem isn't the exact same object in memory as the item in your ItemsSource, then the comparisom will return false and the item will not get selected.
For example, this will probably not work
MyCollection = new ObservableCollection<User>(DAL.GetUsers());
SelectedUser = DAL.GetUser(1);

however this would:
MyCollection = new ObservableCollection<User>(DAL.GetUsers());
SelectedUser = MyCollection.FirstOrDefault(p => p.Id == 1);

That's because the 2nd example sets the SelectedUser to an item that actually exists in MyCollection, while the 1st example might not. Even if the data is the same, they reference different objects in memory.
If your selected item doesn't reference the same item in memory as your ItemsSource item, then either use SelectedValue and SelectedValuePath to bind your ComboBox's default selection, or overwrite the .Equals() method of your class to return true if the data in the objects being compared is the same.
public override bool Equals(object obj)
{
    if (obj == null || !(obj == MyClass))
        return false;

    return ((MyClass)obj).Id == this.Id);
}

A: It may happen if you do not Items collection doesn't contain an item equal to SelectedItem. Check whether you have such an item (it may be that you just forgot to overload Equals in your class and it uses references comparison)


text:
Q: Using strtok_s, the second item is always NULL, even though the first works right. How can I get both values? I am working in C and the strtok_s function isnt working as expected. I want to separate 2 halves of user input, delimited by a space character between them. Ive been reading the manual but i cannot figure it out. Below is the function I wrote. Its goal is to separate the first and second half of user input delimited by a space and return the value to 2 pointers. The print statement has only been used for my debugging.
void argGetter(char* commandDesired, char** firstArg, char** secondArg) {
    // this char holds the first part of the command before the " "
    char* commandCleanDesired;
    // this char array holds the part after the " "
    char *nextToken;
    char *argument;
    commandCleanDesired = strtok_s(commandDesired, " ", &nextToken);
    argument = strtok_s(NULL, " ", &nextToken);
    printf("\n\nCMD 1 is %s\n\nCMD 2 is %s\n\n\n", commandCleanDesired, argument);
    *firstArg = commandCleanDesired;
    *secondArg = argument;

}

//this shows how argGetter is called.

void main() {
// these hold the return values from argGetter()
    char* secondArg = NULL;
    char* firstArg = NULL;
//This holds user input
    char commandDesired[255];

    //This line prints the prompt
    printf("\n\tSanity$hell> ");
    //Then we get user input
    scanf_s("%s", commandDesired, 255);

    //split the command from args using argGetter
    argGetter(commandDesired, &firstArg, &secondArg);
    printf("\n First Arg is %s\n", firstArg);
    printf("\nYour second arg is %s\n\n", secondArg);

}

It gets commandCleanDesired fine, but the second variable, (named 'argument') is ALWAYS null.
I have tried the things below to get the value after the space and store it in argument (unsuccessfully). These little code snippets show how I modified the above code during my attempts to solve the issue.
commandCleanDesired = strtok_s(commandDesired, " ", &commandDesired);
argument = strtok_s(commandDesired, " ", &commandDesired);
//the above resulted in NULL for the second value argument as well.
// Below is the next thing i tried.
char * nextToken;
commandCleanDesired = strtok_s(commandDesired, " ", &nextToken);
argument = strtok_s(NULL, " ", &nextToken);
//both result in argument being NULL.
//I tried the above after reading the manual more.

I have been reading the manual at https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/strtok-s-strtok-s-l-wcstok-s-wcstok-s-l-mbstok-s-mbstok-s-l?view=msvc-170.
I used NULL for the string argument the second time because the above manual led me to believe that was necessary for all subsequent calls after the first call. An example input of commandDesired would be "cd C://"
For the above input, i would like this function to have commandCleanDesired = 'cd' and argument = 'C://'
currently with the misbehavior of the above function for the above input, the function gives commandCleanDesired = 'cd' and argument = (NULL)
TLDR, How am I misusing the strtok_s function in C, how can I get the second value after the space to be stored in the "argument" pointer?
Thank you in advance.

A: The issue is that I used scanf_s or scanf to get the user input in main. This tokenizes the input, which is not what I want.
If you want to read a whole line, use fgets. When I use fgets instead, the issue is solved!

A: If you want to separate strings at the space characters, don't use scanf() (or friends) with the %s format specifier, as it stops reading at space characters themselves, so the string that finally reaches strtok (or friends) don't have spaces on it.  This is probably the most probable reason (I have not looked in detail at your code, sorry) that you get the first word in the first time, and NULL later.
A good alternative, is to use fgets(), in something like:
    char line[1024];
    /* the following call to fgets() reads a complete line (incl. the
     * \n char) into line. */
    while (fgets(line, sizeof line, stdin)) {  /* != NULL means not eof */
        for (   char *arg = strtok(line, " \t\n");
                arg != NULL;
                arg = strtok(NULL, " \t\n"))
        {
             /*process argument in arg here */
        }
    }

Or, if you want to first get out the last \n char, and then process
the whole line to tokenize the arguments...
    char line[1024];
    /* the following call to fgets() reads a complete line (incl. the
     * \n char) into line. */
    while (fgets(line, sizeof line, stdin)) {  /* != NULL means not eof */
         process_line(strtok(line, "\n"));  /* only one \n at end can be, at most */
    }

Then, inside the process_line() function you need to check the parameter for NULL (for the case the string only has a single \n on it, that will result in a null output from strtok())
IMPORTANT WARNING: strtok() is not reentrant, and also it cannot be nested.  It uses an internal, global iterator that is initialized each time you provide a first non-null parameter.  If you need to run several levels of scanning, you have two options:

*

*run the outer loop in full, appending work to do to a second level set of jobs (or similar) to be able to run strtok() on each separate level when the first loop is finished.

*run the reentrant version of strtok(), e.g. strtok_r().  This will allow reentrancy and nesting, you just need to provide a different state buffer (where strtok stores the iterator state) for each nesting level (or thread)


text:
Q: DirectX Device::CreateTexture2D() crashes when calling with all 3 params I am gonna try to render a 2D Texture from opencv::Mat to a Texture in DX11 and also to a shaderesource afterwars. The Problem is, the program crashes on Device::CreateTexture2D() and I can't figure out why. I researched the whole day, I just don't see whats wrong here.
Furthermore, the Problem seems not to be the cv::Mat as Resource, because I have tried also this example here: D3D11 CreateTexture2D in 32 bit format with the chess-example as resource for the texture... and the functions still crashes, when calling with the 3rd param.
I found others, who had Problems with that function, sometimes the Problem was because that SysMemPitch was not set for 2D Textures but that's not the case here unfortunately.

Error Output: First-chance exception at 0x692EF11E (igd10iumd32.dll) in ARift.exe: 0xC0000005: Access violation reading location 0x03438000.
Unhandled exception at 0x692EF11E (igd10iumd32.dll) in ARift.exe: 0xC0000005: Access violation reading location 0x03438000.
here is the relevant code:

        bool Texture::InitCameraStream(ID3D11Device* device, ARiftControl* arift_control)
    {
    D3D11_TEXTURE2D_DESC td;
    ZeroMemory(&td, sizeof(td));
    td.ArraySize = 1;
    td.BindFlags = D3D11_BIND_SHADER_RESOURCE;
    td.Usage = D3D11_USAGE_DYNAMIC;
    td.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
    td.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
    td.Height = arift_control->picture_1_.size().height;
    td.Width = arift_control->picture_1_.size().width;
    td.MipLevels = 1;
    td.MiscFlags = 0;
    td.SampleDesc.Count = 1;
    td.SampleDesc.Quality = 0;

    D3D11_SUBRESOURCE_DATA srInitData;
    srInitData.pSysMem = arift_control->picture_1_.ptr();
    srInitData.SysMemPitch = arift_control->picture_1_.size().width * 4;

    ID3D11Texture2D* tex = 0;
    if ((device->CreateTexture2D(&td, &srInitData, NULL) == S_FALSE));
    {
          std::cerr << "Texture Description: OK " << std::endl << "Subresource: OK" << std::endl;
    }

    if (FAILED(device->CreateTexture2D(&td, &srInitData, &tex)));
    {
        std::cerr << "Error: Texture could not be created! "<< std::endl;
        return false;
    }
    // Create the shader-resource view
    D3D10_SHADER_RESOURCE_VIEW_DESC srDesc;
    srDesc.Format = td.Format;
    srDesc.ViewDimension = D3D10_SRV_DIMENSION_TEXTURE2D;
    srDesc.Texture2D.MostDetailedMip = 0;
    srDesc.Texture2D.MipLevels = 1;

    if (FAILED(device->CreateShaderResourceView(tex, NULL, &texture_)));
    {
        std::cerr << "Can't create Shader Resource View" << std::endl;
        return false;
    }

    return true;
}

CreateTexture2D Returns S_FALSE when the first 2 Parameters are valid, and passing 0 as the 3rd param. So in my case, it also Returns S_FALSE the first time, so the Debug Output appears. When calling CreateTexture2D with the 3rd param (the TExture COM object), it crashed. I have absolutely no idea anymore.
Furthermore, I tried to Setup Debugging with DirectX and followed that tutorial: http://blog.rthand.com/post/2010/10/25/Capture-DirectX-1011-debug-output-to-Visual-Studio.aspx - but I can't see a "Debug" window in my Project Properties in Visual Studio 2013. So I still get to "igd10iumd32.pdb not loaded" window, after the program crashes.
Edit: at least I could fix the issue with the additional D3D debug Outputs for now. In my Visual Studio 2013 I had to set the following: Project Properties -> Debugging -> Debug Type -> Mixed for getting the Additional D3D logs :)
Can anyone help here? It's really frustrating, just getting stuck on that single function the whole day ..
Many thanks!

*

*Max

A: Your input texture data passed in D3D11_SUBRESOURCE_DATA is not sufficiently sized. In your comment, you said that the input image data is 900x1600, and the link is a JPEG. However, you are specifying to D3D that the data format is DXGI_FORMAT_B8G8R8A8_UNORM. JPEG is a compressed format, thus, the data stream will be smaller than it would be in BGRA format. When your drive (igd10iumd32.dll) attempts to read this input stream, it crashes because the buffer is not as large as you told D3D it was.
You can use D3DX11CreateTextureFromFile to load JPEG data. There are also some free image conversion libraries you can use to convert the JPEG into a D3D natively compatible format.


text:
Q: Timeline in iOS App I use ShareKit in most of my apps, but would like to add Timeline features into my app.  Like how spotify will automatically post songs you listen to on timeline.  Would this be something that could be added to my ShareKit implementation?

A: No. ShareKit has no timeline view. You have to do it on your own.


text:
Q: CakePHP move_uploaded_file returns false I'm new to CakePHP, trying file uploading and move_uploaded_file always returns false. Here is my code:
EDIT: the first line was what was wrong
// This line was wrong, should be done after uploading.
$this->request->data['Post']['image'] = $this->request->data['Post']['image']['name']

if($this->Post->save($this->request->data)) {
    $filename = basename($this->request->data['Post']['image']['name']);
    $filePath = WWW_ROOT . DS . 'files' . DS . $filename;

    if(move_uploaded_file(
        $this->request->data['Post']['image']['tmp_name'],
        $filePath
    ))
        $this->Session->setFlash(__('Your post has been saved'));

    else
        $this->Session->setFlash(__('Your post has been saved, but image failed'));
}

Why isn't it working?

A: Solved. I was setting the image name before uploading, seems like it should be done after uploading the file.
//move_uploaded_file() stuff...

$this->request->data['Post']['image'] = $filename;

if($this->Post->save($this->request->data)) { //...


text:
Q: What should I use for updating data from android in specific rate? I have android application. It need to download data from internet for example every 1 hour. It will run 6 asynctask that will download data from internet and save them to database. I'm just asking, what should I use? AlarmManager or Service? It will be very helpfull for me, if you will give me some links for example of downloading data in specific rate.
Thank you

A:
I'm just asking, what should I use? AlarmManager or Service?

Both, if you are going to do the HTTP work yourself. You may need to make that be a WakefulIntentService or otherwise use a WakeLock to keep the device awake.
If you would prefer to use DownloadManager for the HTTP work, that would save you having to deal with the service, the AsyncTasks, and the WakeLock. In this case, you could use AlarmManager and a BroadcastReceiver. However, DownloadManager is only for API Level 9 and higher.