text:
Q: Https to Http rule rewrite Azure I am trying to redirect all https traffic to http after removing an SSL certificate but the rule doesn't appear to be working. I have lifted the following rule from previous examples, but in every case it is still pointing to the https version. Any ideas what is going wrong?
<rule name="Force HTTPS to HTTP" enabled="true">
      <match url="(.*)" ignoreCase="true" />
      <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
      </conditions>
      <action type="Redirect" url="http://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
    </rule>

If I enter https://www.example.com it doesn't redirect. It tries to hit that actual site.
Many thanks

A: @DavidG in comments was right. Also your rule has small mistake in condition. Instead
<add input="{HTTPS}" pattern="off" ignoreCase="true" />

You should have
<add input="{HTTPS}" pattern="on" ignoreCase="true" />


text:
Q: How often is the rank of J_0(p)^- zero As mentioned in this answer there is a conjecture by
Kimball Martin that, formulated slightly informally, has the following special case.
Conjecture:
On average $J_0(p)$ has 2 simple components when  $p$ varies over all primes.
This conjecture then also leads us to expect that $J_0(p)^-$ is simple most of the time. Additionally we know that $J_0(p)^-$ always has a positive dimensional rank 0 quotient when $p >> 0$, which leads to the conclusion that under this conjecture we should expect to have a lot of values of $p$ for which $J_0(p)^-$ has rank 0.
So my question is what do we know without assuming any conjectures in a possibly weaker form:

Are there infinitely many primes $p$ for which $J_0(p)^-$ is simple.

and:

Are there infinitely many primes $p$ for which $J_0(p)^-$ has rank 0.

redpajama_set_name: RedPajamaStackExchange


text:
Q: SensorKit - Fetching data don't call results delegate function Recently we got approved by Apple to use SensorKit. Here are all prerequisites I checked:

*

*I'm pretty sure the project is configured properly. Entitlements file contains list of all sensors, Info.plist contains NSSensorKitUsageDescription, NSSensorKitUsageDetail and NSSensorKitPrivacyPolicyURL.

*When I request authorization for a sensor (e.g. accelerometer) the system dialog is presented, I approve it and it's clearly allowed in phone Settings -> Privacy -> Research Sensor & Usage Data section

*I started recording for a sensor

*I waited more than 24h (6 days actually)

*I created SRFetchRequest (see the code below) with correct time interval

let now = Date()
let from = Date(timeInterval: -3 * 24 * 60 * 60, since: now) as NSDate
let to = Date(timeInterval: -2 * 24 * 60 * 60, since: now) as NSDate

let request = SRFetchRequest()
request.device = SRDevice.current
request.from = from.srAbsoluteTime
request.to = to.srAbsoluteTime
reader.fetch(request)

What's interesting, no error is triggered. Actually the func sensorReader(_ reader: SRSensorReader, didCompleteFetch fetchRequest: SRFetchRequest) delegate method is invoked but func sensorReader(_ reader: SRSensorReader, fetching fetchRequest: SRFetchRequest, didFetchResult result: SRFetchResult<AnyObject>) -> Bool method never gets called.
Did anyone make it working? Any ideas why it's not working?

A: For those interested I found an issue. I tried to collect them from my Apple Watch series 3 that are probably not supported. With series 6 (or from iPhone) it works correctly. Interestingly devices support isn't documented anywhere...


text:
Q: Android FirebaseListAdapter not working even after adding listeners So i am building a chat app using firebase. I got it to add the messages to the Firebase database. So the messages are being pushed but i wasn't able to display the message history or the newly sent messages on a RecyclerView. I searched around and most answers was to add the onStart() with adapter.startListening() and the onStop() with adapter.stopListening(). This hasn't worked for me. Any Advice is appreciated :)
Build.Gradle(app)
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    //firebase
    implementation 'com.google.firebase:firebase-messaging:12.0.1'
    compile 'com.google.firebase:firebase-core:12.0.1'
    compile 'com.google.firebase:firebase-auth:12.0.1'
    compile 'com.google.firebase:firebase-database:12.0.1'
    compile 'com.firebaseui:firebase-ui-database:3.1.0'
}
apply plugin: 'com.google.gms.google-services'

XML for Chat Activity
<android.support.v7.widget.RecyclerView
    android:id="@+id/recyclerViewMessages"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentTop="true"
    android:layout_above="@+id/editTextMessage"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"/>

<EditText
    android:id="@+id/editTextMessage"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_toLeftOf="@+id/buttonSend"
    android:layout_toStartOf="@+id/buttonSend"
    android:ems="10"
    android:inputType="textPersonName"
    android:hint="Type Message"
    tools:layout_editor_absoluteX="0dp"
    tools:layout_editor_absoluteY="467dp" />

<Button
    android:id="@+id/buttonSend"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/editTextMessage"
    android:layout_alignParentEnd="true"
    android:layout_alignParentRight="true"
    android:layout_marginEnd="84dp"
    android:layout_marginRight="84dp"
    android:text="Send"
    tools:layout_editor_absoluteX="297dp"
    tools:layout_editor_absoluteY="465dp" />

The Chat Activity
public class UserChat extends AppCompatActivity {

private RecyclerView recyclerView;
private EditText editTextMessageTyped;
private Button buttonSend;
private FirebaseAuth firebaseAuth;
private FirebaseRecyclerAdapter<Message, ChatHolder> adapter;

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

    buttonSend = (Button) findViewById(R.id.buttonSend);

    buttonSend.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            sendMessage();
        }
    });

    Query query = FirebaseDatabase.getInstance().getReference("Chat").child("messageUser");

    FirebaseRecyclerOptions<Message> options = new FirebaseRecyclerOptions.Builder<Message>()
            .setQuery(query, Message.class)
            .setLifecycleOwner(this)
            .build();

    adapter = new FirebaseRecyclerAdapter<Message, ChatHolder>(options) {
        @Override
        public ChatHolder onCreateViewHolder(ViewGroup parent, int viewType) {
            View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_message, parent, false);
            return new ChatHolder(view);
        }

        @Override
        protected void onBindViewHolder(ChatHolder holder, int position, Message model) {

        }
    };

    adapter.notifyDataSetChanged();
    recyclerView = (RecyclerView) findViewById(R.id.recyclerViewMessages);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
    linearLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.setAdapter(adapter);
}

@Override
protected void onStart() {
    super.onStart();
    adapter.startListening();
}

@Override
protected void onStop() {
    super.onStop();
    adapter.stopListening();
}

private void sendMessage() {
    editTextMessageTyped = (EditText) findViewById(R.id.editTextMessage);

    // Read the input field and push a new instance of ChatMessage to the Firebase database
    FirebaseDatabase.getInstance().getReference("Chat").push()
            .setValue(new Message(FirebaseAuth.getInstance().getCurrentUser().getEmail(),
                    editTextMessageTyped.getText().toString().trim()));

    // Clear the input editText
    editTextMessageTyped.setText(" ");
}
}

Message Model Class
public class Message {

private String MessageUser, MessageBody;
private long timestamp;

public Message(String messageUser, String messageBody) {
    this.MessageUser = messageUser;
    this.MessageBody = messageBody;
    // Initialize to current time
    this.timestamp = new Date().getTime();
}

public Message() {
}

public String getMessageUser() {
    return MessageUser;
}

public String getMessageBody() {
    return MessageBody;
}

public Long getTimestamp() {
    return timestamp;
}
}

Chat Holder Class
public class ChatHolder extends RecyclerView.ViewHolder {
private TextView textViewMessageBody, textViewMessageTime;

public ChatHolder(View itemView) {
    super(itemView);
    textViewMessageBody = (TextView) itemView.findViewById(R.id.textViewMessageBody);
    textViewMessageTime = (TextView) itemView.findViewById(R.id.textViewMessageTime);
}

public void blind(Message message) {
    setTextViewMessageBody(message.getMessageBody());
    setTextViewMessageTime("9:40");
}

public void setTextViewMessageBody(String messageBody) {
    textViewMessageBody.setText(messageBody);
}

public void setTextViewMessageTime(String messageTime) {
    textViewMessageTime.setText(messageTime);
}
}

XML item_Message
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
    android:id="@+id/textViewMessageBody"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="MessageBody" />

<TextView
    android:id="@+id/textViewMessageTime"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentEnd="true"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/textViewMessageBody"
    android:text="Time" />
</RelativeLayout>

Firebase JSON
{
  "Chat" : {
    "-LDba09F6-kJeQXC9XIq" : {
      "messageBody" : "cc",
      "messageUser" : "abc2@abc.com",
      "timestamp" : 1527525151377
    },
    "-LDbaS2uc6M8tp4Lbcar" : {
      "messageBody" : "nn",
      "messageUser" : "abc2@abc.com",
      "timestamp" : 1527525265659
    },
    "-LDbaSmSLVF_g3UWLlNh" : {
      "messageBody" : "ee",
      "messageUser" : "abc1@abc.com",
      "timestamp" : 1527525268637
    },
    "-LDbb1xtj7w8ohPfeTgr" : {
      "messageBody" : "oo",
      "messageUser" : "abc2@abc.com",
      "timestamp" : 1527525420926
    },
    "-LDbkI7--YXP_VPpg3fG" : {
      "messageBody" : "jj",
      "messageUser" : "abc2@abc.com",
      "timestamp" : 1527527846402
    }
  }
}

Screenshots of what happens
This is before i click on send
After i click on send


text:
Q: yii2 attribute display a value in a view I have an attribute house_id,  I want to get the address from the house_id and display it in a view.
My view
<?= DetailView::widget([
    'model' => $model,
    'attributes' => [
        'id',
        'house_id',
    ],
]) ?>

Thanks
Edit:
Here is the solution  Thanks to Raditz for the help.
Model:
public static function getHouseAddressPayroll($house_id)
{
    if ($house_id) { $house = House::findOne($house_id);
        $address = $house->address_line_1.', '.$house->city.', '.$house->state.' '.$house->zipcode;
        return $address;
    } else {
       $data = "N/A";
        return $data;
    }
}

View:
<?= DetailView::widget([
    'model' => $model,
    'attributes' => [
        'id',
        [
        'attribute' => 'first_house',
            'value' =>  House::getHouseAddressPayroll($model->first_house)
        ],
        [
        'attribute' => 'second_house',
            'value' =>  House::getHouseAddressPayroll($model->second_house)
        ],
        [
        'attribute' => 'third_house',
            'value' =>  House::getHouseAddressPayroll($model->third_house)
        ],
        [
        'attribute' => 'fourth_house',
            'value' =>  House::getHouseAddressPayroll($model->fourth_house)
        ],

    ],
]) ?>

A: Your question is very generic. It would be more helpful if you share more info. But I will take a  guess at what you trying to achieve.
I assume the address is stored in another table called "house" with a model House. Assuming your current model is called Profile. In Profile model, you would need to have a 1-to-1 or 1-to-many relation function with the House model.
Assuming the relation is 1-to-1. Your relation function would looks something like below:
public function getHouse()
{
    return $this->hasOne(House::className(), ['id' => 'house_id']);
}

Now that you have set the relation for both table, in your DetailView widget, you could do something like this:
<?= DetailView::widget([
    'model' => $model,
    'attributes' => [
      'id',
      'house.address'
    ]
]) ?>

address is the column name in your house table. If you have more than 1 columns that you want to use, you could use a function like below:
<?= DetailView::widget([
    'model' => $model,
    'attributes' => [
       'id',
       [
         'attribute' => 'house_id',
         'value' => function ($model, $widget){
            return $model->house->address1.'<br/>'.$model->house->address2;
         }
       ],
    ]
]) ?>


text:
Q: Can EWS be configured to prevent email bodies from be returned? Is it possible to allow access to EWS such that a service account user, setup with the ApplicationImpersonation role, is able to retrieve metadata for emails but not the actual email body?
I know you can set up the API request such that email body is not included in the property set, but wondered if there is a way to explicitly restrict access to email bodies, either through configurations of EWS or access controls for the impersonating user.

A: No, there is no per message property security in Exchange server.


text:
Q: "aiming to" vs "aimed to be" I'm trying to define a goal for my scientific journal paper. What is the proper use of English language and grammar here? Does it make sense in its current form?

We are running a study towards design of an adaptive framework for energy-efficient streaming of video segments to mobile devices over wireless networks, which is aimed to be integrated [or aiming to integrate] into DASH.

A: This sentence is correct, but could be written better.  "We are" is present tense and "is aimed" is also present tense, even though "aimed" is a past particle.  The sentence would be simplified (and clearer) if "aims", which is present tense, were used instead, as in "which aims to".
BTW, "is aiming to" is present progressive (continuous) and "aiming", in this context, is a present participle.  This tense would also work, but not as well as simple present tense.  The reasons why are rather complicated, so I'll not go into here.
For more information on these tenses see englishpage.com


text:
Q: Level spacing as system size increases Why does the eigenenergies of a certain system come closer to each other as the system size increases? Is this general for all systems?

A: It is more of a rule of thumb.
Let us consider two separate systems with $N_1$ and $N_2$ energy levels.
Let further $\Delta E_1$ be the difference between the highest and the lowest energy level of system 1, and $\Delta E_2$ defined analogously.
We can thus estimate the average level spacings of the two separate systems to be $\Delta E_1 / N_1$ and $\Delta E_2 / N_2$.
If the systems are brought together, they will have $N_1 N_2$ energy levels, and the energy difference between the highest and lowest level will be $\Delta E_1 + \Delta E_2$.
We estimate the average spacing to be
$$ \frac{\Delta E_1 + \Delta E_2}{N_1 N_2} , $$
which is typically much smaller than the average spacings of the individual systems.
This estimation does not account for degeneracies, though.
For example, if all spacings in system 1 are $\hbar\omega$, and all spacings in system 2 are also $\hbar\omega$, then all spacings in the combined system will also be $\hbar\omega$, but most levels will be degenerate.

A: It could also be of rephrasing Bohr's correspondence principle: as the system goes from microscopic to macroscopic, it should behave more and more as a classical system. But because classical systems do not show energy quantification, it must be that the mean spacing $\Delta E$ divided by the typical energy $E$ goes to $0$ as the size of the system increases.
At the same time, there are certain systems, such as the 1D harmonic oscillator, for which Bohr's correspondence principle is verified (at least in the form $\Delta E / E \to 0$), but the absolute spacing $\Delta E$ does not decrease (here it remains constants).
There are also systems that follow an opposite trend. For free particles in a 1D box, the energy spacing is actually $\propto \sqrt{E}$. Still we have $\Delta E / E \to 0$ but the spacing actually goes up for higher energies. I guess it also depends what you mean by "increasing the size of the system". For a fixed number of particles, if you increase the size of the box $L$, the splitting between levels is reduced everywhere (as $E \propto \frac{1}{L^2}$). However, if you take $N$ fermions in a box of fixed size $L$ and you increase N, you will probe higher and higher energy levels for which the spacing increases as $\sqrt{E}$.


text:
Q: Can paypal recurring payment trial period have 0 amount? I have implemented paypal recurring payment without any trial period.
Now I need to be able have 1 month full free subscription, is that possible with trial period.
Can a trial amount for recurring payment be zero ?

A: Use the PROFILESTARTDATE to start the recurring payments after the trial period.


text:
Q: Where is the main() method in the PHP interpreter source? When I read the PHP source code written in C, I can't find the main() method; could somebody help me?

A: The main() functions in PHP are defined within the SAPI, as they are specific to the mode that PHP is being run in. For instance, for the command-line SAPI, it is defined in sapi/cli/php_cli.c; for the CGI/FastCGI SAPI, it is defined in sapi/cgi/cgi_main.c.
Some other SAPIs, such as the apache2 SAPI, do not define a main() function at all, because they are only loaded as a module by a separate executable.

A: PHP has no main method like C does.
PHP is executed top-to-bottom or can be called from HTML by using methods.
<?php
echo "echo"
echo "echo 2"
?>

The PHP will be run from the opening tag down to the closing tag.
Echoing echo and echo 2 in order.


text:
Q: Is work done by sound wave on air particles? Is it possible for sound wave to do net work on air particles?
As in can a sound wave make the air move in one direction so that it can for example move a sail boat ?
I think since molecules gyrate about a mean position even though they are in the direction of wave propagation no net work is done but I want to confirm this idea.

A:
actually i wanted to ask whether sound wave does work on the medium, air, itself. like raise its temperature or something ?

Yes.  The main reason sound decreases in amplitude with distance is not due to absorption; it's because sound sources emit roughly spherical radiation and are subject to the inverse square law.  So an ideal plane wave in an ideal atmosphere would not attenuate with distance, because it's not subject to inverse square law.
But sound is also absorbed by the air, so even a plane wave will slowly decrease in amplitude with distance.  This means the sound energy is being turned into heat energy, and increasing the temperature of the air slightly.  The amount of energy absorbed varies with humidity and affects high frequencies first:
Absorption of Sound in Air versus Humidity and Temperature
Damping of Air of High Frequencies
Damping of Air of High Frequencies (Dissipation)

A: Well, I guess it depends on what you mean by a sound wave. There are wave pulses that can be created in air that can absolutely do work on something else. There are Smoke Ring Launchers, which can create waves of air that could definitely, I don't know, knock over a playing card or something. But as for sound waves, like you said, you're dealing with air molecules being jostled around from an equilibrium position. As soon as the pressure waves cause the air particles to clumb together in some localized region, there are going to be areas of low pressure in the surrounding area that the air will rush back in to fill. So, the air is not going to have a lot of space through which to act on another body, or a lot of time to do so either for that matter.
Of course, sound waves CAN do work. You can break glass with sound. But it's usually not much.


text:
Q: Android - Google Analytics V4 event sent but not shown I want to integrate Google Analytics SDK V4 in my app but I have a problem sending events.
I integrated the SDK and generated the configuration file as indicated on the offical documentation. I integrated the conf file on my project, set my build.gradle file, added the AnalyticsService to my Manifest and initialized Google Analytics in my application class:
synchronized public Tracker getDefaultTracker() {
    if (mTracker == null) {
        GoogleAnalytics analytics = GoogleAnalytics.getInstance(this);
        mTracker = analytics.newTracker(R.xml.global_tracker);
    }
    return mTracker;
}

The R.xml.global_tracker is generated at build and only contains the string ga_trackingId.
When I try to sent events, I can see on the logcat they are sent:
09-19 11:04:29.167 com.myapp.mypackage.debug I/GAv4: Google Analytics 9.0.80 is starting up. To enable debug logging on a device run:
                                                          adb shell setprop log.tag.GAv4 DEBUG
                                                          adb logcat -s GAv4
09-19 11:04:29.207 com.myapp.mypackage.debug W/GAv4: AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See url for instructions.
09-19 11:04:29.227 com.myapp.mypackage.debug W/GAv4: CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See url for instructions.
09-19 11:04:29.737 com.myapp.mypackage.debug D/GAv4: Sending first hit to property: UA-XXXXXXXX-2
09-19 11:04:29.737 com.myapp.mypackage.debug D/GAv4: Hit delivery requested: ht=1474275869721, _s=0, _v=ma9.0.80, a=1185092937, aid=com.myapp.mypackage.debug, an=MyApp, av=1.7-DEBUG, cd=Search, cid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, sr=800x1280, t=screenview, tid=UA-XXXXXXXX-2, ul=fr-fr, v=1
09-19 11:04:30.148 com.myapp.mypackage.debug D/GAv4: Hit sent to the device AnalyticsService for delivery
09-19 11:05:49.235 com.myapp.mypackage.debug D/GAv4: Hit delivery requested: ht=1474275949229, _s=1, _v=ma9.0.80, a=1185092938, aid=com.myapp.mypackage.debug, an=MyApp, av=1.7-DEBUG, cd=Search, cid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, ea=CustomerAccount, ec=Search, sr=800x1280, t=event, tid=UA-XXXXXXXX-2, ul=fr-fr, v=1
09-19 11:05:49.425 com.myapp.mypackage.debug D/GAv4: Hit sent to the device AnalyticsService for delivery
09-19 11:05:49.435 com.myapp.mypackage.debug D/GAv4: Hit delivery requested: ht=1474275949372, _s=2, _v=ma9.0.80, a=1185092938, aid=com.myapp.mypackage.debug, an=MyApp, av=1.7-DEBUG, cd=UserAccount.LoggedOut, cid=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, sr=800x1280, t=screenview, tid=UA-XXXXXXXX-2, ul=fr-fr, v=1
09-19 11:05:49.455 com.myapp.mypackage.debug D/GAv4: Hit sent to the device AnalyticsService for delivery

But I never see them on the Developer console. When I go on Analytics API on my console, I see "There is no data for this API in this time span". I did my tests friday and event after more than 48h, they don't appear.
Also, I see this warning on the Analytics API console:

This API is enabled, but you can't use it in your project until you
  create credentials.  Click "Go to Credentials" to do this now
  (strongly recommended). Go to Credentials Overview Quotas

If I go to the Credentials Overview, I can see the key "Android key (auto created by Google Service)" which correspond to the key in my google-services.json, so I don't understand why the warning is here.
Can you see where the problem comes from? I searched a lot but was enable to find a response to it.
Thanks!

A: So apparently, I wasn't looking at the good place. I thought the analytics reports could be seen on the dev console, in Analytics API, but thanks to ZShock, I know they are on analytics.google.com. It isn't written anywhere on the official documentation, so it's pretty disturbing for new users...


text:
Q: Insert Image to a MVC Project using jQuery I want to insert an imege to a MVC Project, i used following code to do that,
but i want to pass that image using jquery instead of pass data using Html.BeginForm.
how can i do it,
    <% using (Html.BeginForm("uploadImage", "ItemMaster", FormMethod.Post, new { enctype = "multipart/form-data" }))
      {
    %>

<input type="file" id="fileUpload" name="fileUpload" size="23"/>

<input type="submit" value="Upload file" />

        <%= Html.Hidden("hdnItemCode", null, new { style = "width:100px" })%>
    <%
       }
    %>

A: If you're looking for a method to upload a file via jQuery, I suggest this question and answers.


text:
Q: How do I deny an app Accessibility Access forever? I recently installed an app on my system (Mac OS X Mojave) and it showed an permissions dialog:
"[appname]" would like to control this computer using accessibility features. …
I got two buttons:

*

*Open System Preferences

*Deny

I know the app wants me to go to system prefs and allow it access. I know how to do that. But I don't want to grant it the permissions it asks for. Therefore I click Deny.
The dialog closes, but on the next system start it askes again. Every time.
Is my only choice as a user to grant it the permission it wants to get rid of it or deny it every time the system starts?
How do I deny the permission forever?
(I know I should grant it or uninstall, but then why am I offered an option to deny if I should not do that?)
Example: the app always ask me like this, very annoying.


text:
Q: MAX 10 ADC with VHDL / Quartus Prime Lite Code Optimisation First of all I have to say that I am a complette beginner in VHDL so if its a really stupid question I want to apologize in advance.
Im trying to get the ADC soft IP to work. I want to use just the ADC so no FIFO or anything else.
Therefore I generated the IP core with the qsys file and included it into my project. I also activated channel 8 with prescaler.
Im trying to read the value from a variable resistor that is connnected to channel 8 and print out the 5 most significant bits with the led.
The case statement should create the pattern that is needed to activate the adc, as it is given in MAX 10 ADC guide.
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity main is
    port ( CLK_50   : in  std_logic;
          LEDR  : out std_logic_vector(4 downto 0));
end;

architecture behave of main is

    signal Cnt : integer := 0;
    signal pCnt : integer := 0;

    signal lock : std_logic;
    signal CLK_10 : std_logic;
    signal CLK_1 : std_logic;
    signal set : std_logic ;

    signal RESET : std_logic ;

    signal CMDVal : std_logic;
    signal CMDCH : std_logic_vector (4 downto 0);
    signal CMDSOP : std_logic;
    signal CMDEOP : std_logic;
    signal CMDRDY : std_logic;
    signal RESVal : std_logic;
    signal RESCH : std_logic_vector (4 downto 0);
    signal RESData : std_logic_vector (11 downto 0);
    signal RESSOP : std_logic;
    signal RESEOP : std_logic;

    component myadc is
        port (
            clock_clk              : in  std_logic                     := 'X';             -- clk
            reset_sink_reset_n     : in  std_logic                     := 'X';             -- reset_n
            adc_pll_clock_clk      : in  std_logic                     := 'X';             -- clk
            adc_pll_locked_export  : in  std_logic                     := 'X';             -- export
            command_valid          : in  std_logic                     := 'X';             -- valid
            command_channel        : in  std_logic_vector(4 downto 0)  := (others => 'X'); -- channel
            command_startofpacket  : in  std_logic                     := 'X';             -- startofpacket
            command_endofpacket    : in  std_logic                     := 'X';             -- endofpacket
            command_ready          : out std_logic;                                        -- ready
            response_valid         : out std_logic;                                        -- valid
            response_channel       : out std_logic_vector(4 downto 0);                     -- channel
            response_data          : out std_logic_vector(11 downto 0);                    -- data
            response_startofpacket : out std_logic;                                        -- startofpacket
            response_endofpacket   : out std_logic                                         -- endofpacket
        );
    end component myadc;

begin

    CMDCH <= "01000";
    RESET <= '0';
    set <= '1';

    mPLL : entity work.pll
        port map(
        areset => set,
        inclk0 => CLK_50,
        c0 => CLK_10,
        c1 => CLK_1,
        locked => lock
    );

    mADC : component myadc
        port map (
            clock_clk              => CLK_50,                  --          clock.clk
            reset_sink_reset_n     => RESET,                     --     reset_sink.reset_n
            adc_pll_clock_clk      => CLK_10,                   --  adc_pll_clock.clk
            adc_pll_locked_export  => lock,                          -- adc_pll_locked.export
            command_valid          => CMDVal,                    --        command.valid
            command_channel        => CMDCH,                    --               .channel
            command_startofpacket  => CMDSOP,                    --               .startofpacket
            command_endofpacket    => CMDEOP,                   --               .endofpacket
            command_ready          => CMDRDY,                  --               .ready
            response_valid         => RESVal,                   --       response.valid
            response_channel       => RESCH,                     --               .channel
            response_data          => RESData,             --               .data
            response_startofpacket => RESSOP,                    --               .startofpacket
            response_endofpacket   => RESEOP                    --               .endofpacket
        );

process
begin

    wait until rising_edge(CLK_50);

    pCnt <= pCnt + 1;

    case pCnt is
        when 1 => CMDSOP <= '1';
                     CMDVal <= '1';
        when 114 => CMDRDY <= '1';
        when 115 => CMDSOP <= '0';
                        CMDRDY <= '0';
                        LEDR <= RESData(11 downto 7);
        when 214 => CMDRDY <= '1';
        when 215 => CMDRDY <= '0';
                        LEDR <= RESData(11 downto 7);
        when 314 => CMDRDY <= '1';
        when 315 => CMDRDY <= '0';
                        LEDR <= RESData(11 downto 7);
        when 414 => CMDRDY <= '1';
        when 415 => CMDRDY <= '0';
                        LEDR <= RESData(11 downto 7);
        when 514 => CMDRDY <= '1';
        when 515 => CMDRDY <= '0';
                        LEDR <= RESData(11 downto 7);
        when 614 => CMDRDY <= '1';
        when 615 => CMDRDY <= '0';
                        LEDR <= RESData(11 downto 7);
        when 714 => CMDRDY <= '1';
        when 715 => CMDRDY <= '0';
                        LEDR <= RESData(11 downto 7);
        when 814 => CMDRDY <= '1';
        when 815 => CMDRDY <= '0';
                        LEDR <= RESData(11 downto 7);
        when 914 => CMDRDY <= '1';
        when 915 => CMDRDY <= '0';
                        LEDR <= RESData(11 downto 7);
        when 1014 => CMDRDY <= '1';
        when 1015 => CMDRDY <= '0';
                         LEDR <= RESData(11 downto 7);
        when 1114 => CMDRDY <= '1';
        when 1115 => CMDRDY <= '0';
                         CMDEOP <= '1';
        when 1116 => CMDEOP <= '0';
                         CMDVal <= '0';

        when 2000 => pCnt <= 0;
        when others => Cnt <= pCnt ;
    end case;
end process;

end;

However while compiling Quartus always removes all of my code. So in the end it pulls the LED's to GND and neither uses the ADC or the PLL.
If anyone has an idea I would be really thankfull if you could tell me what exaclty im doing wrong.
Best regards.
Edit:
I wasnt clear enough with describing the problem I have. It does synthetzise correctly however it thinks that the pll is not necessary and so removes it, leaving the adc ip core without the clock and so removeing it as well.
The errors are:
Warning (14284): Synthesized away the following node(s):
    Warning (14285): Synthesized away the following RAM node(s):
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[0]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[1]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[2]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[3]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[4]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[5]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[6]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[7]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[8]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[9]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[10]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[11]"
Warning (14284): Synthesized away the following node(s):
    Warning (14285): Synthesized away the following RAM node(s):
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[0]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[1]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[2]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[3]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[4]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[5]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[6]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[7]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[8]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[9]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[10]"
        Warning (14320): Synthesized away node "madc:myadc|madc_modular_adc_0:modular_adc_0|altera_modular_adc_control:control_internal|altera_modular_adc_control_fsm:u_control_fsm|altera_modular_adc_control_avrg_fifo:ts_avrg_fifo|scfifo:scfifo_component|scfifo_ds61:auto_generated|a_dpfifo_3o41:dpfifo|altsyncram_rqn1:FIFOram|q_b[11]"
Warning (14284): Synthesized away the following node(s):
    Warning (14285): Synthesized away the following PLL node(s):
        Warning (14320): Synthesized away node "mpll:myPLL|altpll:altpll_component|mpll_altpll:auto_generated|wire_pll1_clk[0]"

A: In VHDL (and basically in all hardware description languages), you have to keep in mind that your code must be synthetizable: it has to describe hardware components available in your programmable component. This is not the case in your process.
The following line :  wait until rising_edge(CLK_50); can't be synthesized because of the wait statement.
To create a sequential process you need this :
my_seq_proc : process (clk, rst)
begin
     if (rst = '1') then
        ... -- reset your signals
     elsif (rising_edge(clk)) then
        ... -- what you need to do
     end if;
end process;

Note that you are not obliged to use a reset signal.
Also, note that you need a sensitivity list in the process declaration (clk, rst) with your clock (clk_50) and your possible reset signal.
I haven't checked if there is another mistake. You should try to do this first.


text:
Q: How do I clone an Ubuntu system to a new machine? I have an Ubuntu system with a large project, many small projects, and (of course) loads of packages and libraries.
If I buy a new computer and want to replicate all of this, how do I do it?  I presume installing Ubuntu on the new machine and then copying the file tree from some point down will fail since the new machine will have it's own way of viewing things, understanding of how things are tied together, etc., and just replacing the new file tree starting with root with a copy from the old machine is an idiotic idea.

A: Clonezilla is your friend. Download its ISO from https://clonezilla.org/downloads/download.php?branch=alternative then make a LiveUSB from the ISO file. Reboot your PC after attaching the destination drive to the original PC and boot from the Clonezilla USB. Choose disk to disk and clone away!
Then, for your sanity's sake, once the disk-to-disk cloning completes, image the system with Clonezilla, saving the partitions (which will be compressed) to the target drive's root or /home partition. Once completed, boot from that drive, be it HDD or SSD. Obtain the size of the compressed image, and burn that to DVDR. Make a second copy to a USB flash drive. Verify the contents match the source, then the DVDR goes offsite, and the copy on USB is attached to the Clonezilla flash drive so you can reconstitute your system as of (today) if you ever need.

A: When using Linux copying or migrating your existing system to an other harware is much easier than you might think with your Windows experience. You need a copy of your HDD or put your existing one in your new computer and you have pretty good chances that you boot in your new hardware without any problem.
If you want to copy your existing system to a new HDD:

*

*Make sure your new location is as big or bigger than your existing one.

*Boot a live CD (any one will fit you that offers a terminal).

*Make sure your existing system (the drive you want to move) and your new drive are connected to your machine but they are not mounted. (cat /proc/partitions will show your available drives.)

*Now this will do the trick for you:
sudo dd bs=4M conv=sync,noerror status=progress if=/dev/hda of=/dev/hdb

where /dev/hda is your existing system and /dev/hdb is the new drive you want to copy your existing system to. Take care not to use partition numbers because you want to copy everything (eg. MBR, partitions and all contents) to your new location.
Be sure not to exchange the drive names in if=your_existing_drive and of=your_new_drive or you will destroy your existing system by overwriting it with the contents of your new drive (e.g. a bunch of pretty zeroes if that is a brand new formatted drive).
If you could boot from /dev/hda in your old system chances are that your new cloned drive /dev/hdb will fit in any computer hardware and you will boot from it. After you started your new system you may finish adjusting settings that your new hardware offers or requires, and check for gparted to adjust your partition sizes if your new drive is bigger than the old one.


text:
Q: install package from tar.gz in Anaconda I got *.tar.gz file and how to install that package in conda virtual environment ?
I've tried the following:
$ source activate env01
(env01)$ conda install /installers/anaconda/cassandra-driver-3.11.0.tar.gz
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - cassandra-driver-3.11.0.tar.gz

Current channels:
...

If I use pip install, it wasn't stored in environment directory. See below:
(env01)$ pip install /installers/anaconda/cassandra-driver-3.11.0.tar.gz
Processing /installers/anaconda/cassandra-driver-3.11.0.tar.gz
Requirement already satisfied: six>=1.9 in /dataplatform/software/anaconda/lib/python3.6/site-packages (from cassandra-driver==3.11.0)
Building wheels for collected packages: cassandra-driver
  Running setup.py bdist_wheel for cassandra-driver ... done
  Stored in directory: /home/linknet/.cache/pip/wheels/e9/ff/17/ebfd2f04dfac5206db48c1520c6f669ec225ddc2c192aada17
Successfully built cassandra-driver
Installing collected packages: cassandra-driver
Successfully installed cassandra-driver-3.11.0

My conda env01 directory is: /dataplatform/software/anaconda/envs/env01

A: I managed it by cloning conda env from base and install the package.
$ conda create -n env01 --clone base
Source:      /dataplatform/software/anaconda
Destination: /dataplatform/software/anaconda/envs/env01
The following packages cannot be cloned out of the root environment:
 - conda-4.4.10-py36_0
 - conda-build-3.4.1-py36_0
 - conda-env-2.6.0-h36134e3_1
Packages: 238
Files: 1
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(env01)$ conda install /installers/anaconda/cassandra-driver-3.11.0py36_1.tar.bz2
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

Now I'm able to install the package without connecting to the internet.


text:
Q: Notice: Undefined index: page in I get this Notice on the back-end of my wordpress website
Notice: Undefined index: page in /customers/f/e/4/pointdevue-plus.be/httpd.www/wp-content/themes/SliderResponsiveTheme/settings.php on line 17
When I take a look at line 17 I see this code :
(from line 14 to 21)

);
function mytheme_add_admin() {
    global $themename, $shortname, $settings_list;
    if ( $_GET['page'] == basename(__FILE__) ) {

        if ( 'save' == $_REQUEST['action'] ) {
                  foreach($settings_list as $value) {
                    //echo '<script type="text/javascript">alert("' . $value . '");</script>';

Does somebody knows what's exactly wrong and how to fix this ?
Thanks !

A: Test existence of key with isset:
if (isset($_GET['page']) && $_GET['page'] == basename(__FILE__) ) {
    ^^


text:
Q: Annotation support in Struts 2 I'm currently evalutating Struts 2. The official documentation contains a HelloWorld example with the following Java and JSP code:
Java
import com.opensymphony.xwork2.ActionSupport;

public class HelloWorld extends ActionSupport {

    public static final String MESSAGE = "Struts is up and running ...";

    public String execute() throws Exception {
        setMessage(MESSAGE);
        return SUCCESS;
    }

    private String message;

    public void setMessage(String message){
        this.message = message;
    }

    public String getMessage() {
        return message;
    }
}

JSP
<%@ taglib prefix="s" uri="/struts-tags" %>

        <title>Hello World!</title>

<s:property value="message" />

The example uses the following XML file to specify a URL for this action, and to tie the action and view together
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
    <package name="tutorial" extends="struts-default">
        <action name="HelloWorld" class="tutorial.HelloWorld">
            <result>/HelloWorld.jsp</result>
        </action>
    </package>
</struts>

My question (finally) is: is this really the state-of-the-art for Struts2? I'd been lead to believe that the necessity for XML config and subclassing a particular base class (ActionSupport) has been deprecated. I thought that annotations could be used for configuration instead.
A couple of more specific questions:

*

*Is it necessary to have one Action class for each request type, or is it possible to define multiple methods in an eaction, each of which can handle a different request?

*Is it necessary to define a public getter and setter for the data members that you want to make available to the view ('message' in the example above)?

If this is the state-of-the-art in Struts2, then it doesn't seem like much of an improvement over Struts1, but I suspect this is just a bad example.
Thanks,
Don

A: Some answers (not all):

*

*You can add several methods to the same Action class. Each of those need to return a String.

*I think the public getter and setter are needed.

*The base class provided only defines certain useful values, such as the constant SUCCESS.

You can use annotations by means of the "Zero Configuration" feature (zero conf doc)

A: The example is old-style struts2. You can use annotations for just about everything, as @pgb says.
There are also 2 distinct styles of configuration available; one is called "convention" and the other is "annotation". Convention is influenced by rails, and creates default bindings between actions and results by path/naming. Using annotations you declare everything, like you did with xml, but only inside the controller class. I find both to be great simplifications and am currently running with only a tiny xml file for a large site.

A: Sorry for the missing resources, but I can not copy and paste those here.
But this should give you an idea about the 2.1.x features.
struts.xml:
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>

    <include file="struts-default.xml"/>

    <package name="default" extends="struts-default">
        <interceptors>
            <interceptor name="appLogin" class="us.pdinc.client.com.usgoldnetwork.support.struts.LoginInterceptor" />
            <interceptor-stack name="loginStack">
                <interceptor-ref name="appLogin"/>
                <interceptor-ref name="paramsPrepareParamsStack"/>
            </interceptor-stack>
        </interceptors>

        <default-interceptor-ref name="loginStack"/>
        <global-results>
            <result name="login">/WEB-INF/jsp/login-input.jsp</result>
        </global-results>
    </package>
</struts>

struts.properties:
struts.custom.i18n.resources=guest
struts.convention.result.path=/WEB-INF/jsp
struts.ognl.allowStaticMethodAccess=true

AddrAction.java
    package us.pdinc.client.com.usgoldnetwork.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.hibernate.Session;
import org.hibernate.Transaction;

import us.pdinc.client.com.usgoldnetwork.beans.model.hibernate.Addr;
import us.pdinc.client.com.usgoldnetwork.beans.model.hibernate.AddrType;
import us.pdinc.client.com.usgoldnetwork.beans.model.hibernate.Tx;
import us.pdinc.client.com.usgoldnetwork.servlet.support.RequestScopeHibernateSession;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

@Results({
      @Result(name="list", type="redirect", location="/addr", params={"transaction.id","${transaction.id}"})
    })
public class AddrAction extends ActionSupport implements Preparable , ServletRequestAware
{
    private static final long serialVersionUID = 1L;

    private List<Addr> addrs;
    private List<AddrType> addrTypes;
    private List<Tx> txs;
    private Addr addr;
    private AddrType addrtype;
    private HttpServletRequest httpServletRequest;
    private Tx transaction;
    long txId = 0;

    @Override
    public void prepare() throws Exception
    {
        if (addr!=null && addr.getId()!=null)
            {
                Session session = RequestScopeHibernateSession.getSession(httpServletRequest);
                addr=(Addr) session.get(Addr.class, addr.getId());
            }
    }

    public String index()
    {
        return list();
    }

    public String list()
    {
        System.out.println("LIST");
        if (transaction==null)throw new RuntimeException();
        if (transaction.getId()==null) throw new RuntimeException();
        if (transaction.getId()<=0) throw new RuntimeException();
        Session session = RequestScopeHibernateSession.getSession(httpServletRequest);
        transaction=(Tx)session.get(Tx.class, transaction.getId());
        addrs=transaction.getAddrs();

        return SUCCESS;
    }

    public String input()
    {
        Session session = RequestScopeHibernateSession.getSession(httpServletRequest);
        addrTypes=session.createCriteria(AddrType.class).list();
        //txs = session.createCriteria(Tx.class).list();
        return INPUT;
    }

    public String save()
    {
        System.out.println("SAVE");

        if(transaction != null && transaction.getId() != null){
            txId = transaction.getId();
        }
        if(addr != null && addr.getTx() != null && addr.getTx().getId() != null){
            txId = addr.getTx().getId();
        }
        /*if (transaction==null || addr == null)throw new RuntimeException();
        System.out.println("******************************************************************");
        System.out.println("Transaction value ==" + transaction);
        System.out.println("Addr value ==" + addr);
        if (addr.getTx() == null) throw new RuntimeException();
        System.out.println("Transaction ID value ==" + transaction.getId());
        System.out.println("Addr Transaction value ==" + addr.getTx());
        if ( addr.getTx().getId() == null ) throw new RuntimeException();
        System.out.println("********************************************************************");
        System.out.println("Addr Transaction ID value ==" + addr.getTx().getId());*/

        Session session = RequestScopeHibernateSession.getSession(httpServletRequest);
        transaction=(Tx)session.get(Tx.class, txId);
        //String addrTypeId = httpServletRequest.getParameter("addr.addrType.id");
        //Long Id = Long.valueOf(addrTypeId);
        addrtype=(AddrType) session.get(AddrType.class, addr.getAddrType().getId());
        if (addr.getId()==null)
        {
            System.out.println("Addr is null");
            addr.setTx(transaction);
            addr.setAddrType(addrtype);
            Transaction tx = session.getTransaction();
            tx.begin();
            session.save(transaction);
            session.persist(addr);
            tx.commit();
        }
        else
        {
            System.out.println("Addr is not null");
            Transaction tx = session.getTransaction();
            tx.begin();
            session.update(addr);
            tx.commit();
        }
        return "list";
    }

    public String delete()
    {
        Session session = RequestScopeHibernateSession.getSession(httpServletRequest);
        Transaction tx = session.getTransaction();
        tx.begin();
        session.delete(session.get(Addr.class, addr.getId()));
        tx.commit();
        return "list";
    }

    @Override
    public void setServletRequest(HttpServletRequest arg0)
    {
        httpServletRequest=arg0;
    }

    public Addr getAddr()
    {
        return addr;
    }

    public void setAddr(Addr addr)
    {
        this.addr = addr;
    }

    public List<Addr> getAddrs()
    {
        return addrs;
    }

    public List<AddrType> getAddrTypes()
    {
        return addrTypes;
    }

    public List<Tx> getTxs()
    {
        return txs;
    }

    public Tx getTransaction() {
        return transaction;
    }

    public void setTransaction(Tx transaction) {
        this.transaction = transaction;
    }

}

addr.jsp:
<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <link href="<s:url value='/css/main.css'/>" rel="stylesheet" type="text/css"/>
    <title>Addresses Screen</title>
       <jsp:include page = "barcodeextractor.jsp" />

USGN Core Process

Addresses

<s:url id="url" action="addr!input" >
<s:param name="transaction.id" value="transaction.id" />
</s:url>
<a href="<s:property value="#url"/>">Add New Address

        Customer
        Name
        Type
        Street 1
        Street 2
        Street 3
        Street 4
        Street 5
        Street 6
        City
        State
        Postal
        Country

    <s:iterator value="addrs" status="status">
        <tr class="<s:if test="#status.even">even</s:if><s:else>odd</s:else>">
            <s:property value="tx.id"/>
            <s:property value="name"/>
            <s:property value="addrType.addrType"/>
            <s:property value="street1"/>
            <s:property value="street2"/>
            <s:property value="street3"/>
            <s:property value="street4"/>
            <s:property value="street5"/>
            <s:property value="street6"/>
            <s:property value="city"/>
            <s:property value="state"/>
            <s:property value="postal"/>
            <s:property value="country"/>

                <s:url action="addr!input" id="url">
                    <s:param name="addr.id" value="id"/>
                </s:url>
                <a href="<s:property value="#url"/>">Edit

                <s:url action="addr!delete" id="url" >
                    <s:param name="addr.id" value="id"/>
                </s:url>
                <a href="<s:property value="#url"/>">Delete

    </s:iterator>

addr-input.jsp:
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<s:if test="addr==null || addr.id == null">
    <s:set name="title" value="%{'Add new contact type'}"/>
</s:if>
<s:else>
    <s:set name="title" value="%{'Update contact type'}"/>
</s:else>

    <link href="<s:url value='/css/main.css'/>" rel="stylesheet" type="text/css"/>

    <title><s:property value="#title"/></title>
     <jsp:include page = "barcodeextractor.jsp" />

USGN Core Process

<s:property value="#title"/>

<s:actionerror />
<s:actionmessage />
<s:form action="addr!save" method="post">
    <s:select name="addr.addrType.id" label="Address Type" list="addrTypes" listKey="id" listValue="addrType" value="%{addr.addrType.id}"/>
    <s:textfield name="addr.name" value="%{addr.name}" label="Name" size="40"/>
    <s:textfield name="addr.street1" value="%{addr.street1}" label="Street 1" size="40"/>
    <s:textfield name="addr.street2" value="%{addr.street2}" label="Street 2" size="40"/>
    <s:textfield name="addr.street3" value="%{addr.street3}" label="Street 3" size="40"/>
    <s:textfield name="addr.street4" value="%{addr.street4}" label="Street 4" size="40"/>
    <s:textfield name="addr.street5" value="%{addr.street5}" label="Street 5" size="40"/>
    <s:textfield name="addr.street6" value="%{addr.street6}" label="Street 6" size="40"/>
    <s:textfield name="addr.city" value="%{addr.city}" label="City" size="40"/>
    <s:textfield name="addr.state" value="%{addr.state}" label="State" size="40"/>
    <s:textfield name="addr.postal" value="%{addr.postal}" label="Postal" size="40"/>
    <s:textfield name="addr.country" value="%{addr.country}" label="Country" size="40"/>
    <s:hidden name="addr.id" value="%{addr.id}"/>
    <s:hidden name="transaction.id" value="%{transaction.id}"/>
    <s:submit value="Submit"/>
    <s:submit value="Cancel" name="redirectAction:addr!list"/>
</s:form>


text:
Q: Unity-how to divide/ slice one plane to 2by2 ..3by3..4by4.. and so one and make each tile an instance I want to make a chord playing box.

In a box (square) there will be one or more balls.
The square have normally 6 sides. On each side, I want to interactively divide it by 2by2 3by3 and so on..
For example, if i make one side by 2*2 plane, my 'tiles' will be total 24.
I call the divided rects, 'tile'. if the ball collides to a tile, then some music note plays off. Which means my tiles will be buttons to playing notes.
I used processing, and since I heard that Unity has good physics engine I tried doing my project with Unity. So I am new to Unity and C# but I do understand some programming languages.
My question is, How can I interactively divide planes in real time by putting in some input and make it as an instance, so that it can work as a independent button?

A: The easiest way is to use 6 planes (with colliders) for the six sides of your box.
Then you can use unity's Collider.OnCollisionEnter(Collision) method to detect the collision and get the ContactPoint where a ball touched the plane.
Unity documentation - OnCollisionEnter
This point can then be converted to the hit plane's local space using Transform.InverseTransformPoint. What you get is a kind of a normalized point (aka it is affected by the plane scale). Depending on the pivot of your plane you'll have to perform a translation for your x and y values to be between 0 and 1 (e.g. -0.5 on both axes, if you have a centered pivot).
Using these normalized coordinates you can "divide" your plane logically (e.g. a hit point between 0 and 0.5 on x and 0 and 0.5 on y wouldbe quadrant 0) . This saves you the pain of having to deal with multiple objects per box side which have to be seemlessly aligned etcpp.


text:
Q: MPI datatype for structure of arrays In an MPI application I have a distributed array of floats and two "parallel" arrays of integers: for each float value there are two associated integers that describe the corresponding value. For the sake of cache-efficiency I want to treat them as three different arrays, i.e. as a structure of arrays, rather than an array of structures.
Now, I have to gather all these values into the first node. I can do this in just one communication instruction, by defining an MPI type, corresponding to a structure, with one float and two integers. But this would force me to use the array of structures pattern instead of the structure of arrays one.
So, I can choose between:

*

*Performing three different communications, one for each array and keep the efficient structure of arrays arrangement

*Defining an MPI type, perform a single communication, and deal with the resulting array of structures by adjusting my algorithm or rearranging the data

Do you know a third option that would allow me do have the best of both worlds, i.e. having a single communication and keeping the cache-efficient configuration?

A: You take take a look at Packing and Unpacking.
http://www.mpi-forum.org/docs/mpi-11-html/node62.html
However, I think if you want to pass a same "structure" often you should define you own MPI derivate type.

A: E.g. by using the *array_of_blocklength* parameter of MPI_Type_create_struct
// @file mpi_compound.cpp
#include <iterator>
#include <cstdlib> // for rng
#include <ctime>   // for rng inits
#include <iostream>
#include <algorithm>

#include <mpi.h>

const std::size_t N = 10;

struct Asset {
    float f[N];
    int m[N], n[N];

    void randomize() {
        srand(time(NULL));
        srand48(time(NULL));
        std::generate(&f[0], &f[0] + N, drand48);
        std::generate(&n[0], &n[0] + N, rand);
        std::generate(&m[0], &m[0] + N, rand);
    }
};

int main(int argc, char* argv[]) {

    MPI_Init(&argc,&argv);
    int rank,comm_size;
    MPI_Status stat;

    MPI_Comm_rank(MPI_COMM_WORLD,&rank);
    MPI_Comm_size(MPI_COMM_WORLD,&comm_size);

    Asset a;

    MPI_Datatype types[3] = { MPI_FLOAT, MPI_INT, MPI_INT };
    int bls[3] = { N, N, N };
    MPI_Aint disps[3];
    disps[0] = 0;
    disps[1] = int(&(a.m[0]) - (int*)&a)*sizeof(int);
    disps[2] = int(&(a.n[0]) - (int*)&a)*sizeof(int);

    MPI_Datatype MPI_USER_ASSET;

    MPI_Type_create_struct(3, bls, disps, types, &MPI_USER_ASSET);
    MPI_Type_commit(&MPI_USER_ASSET);

    if(rank==0)  {
        a.randomize();
        std::copy(&a.f[0], &a.f[0] + N, std::ostream_iterator<float>(std::cout, " "));
        std::cout << std::endl;
        std::copy(&a.m[0], &a.m[0] + N, std::ostream_iterator<int>(std::cout, " "));
        std::cout << std::endl;
        std::copy(&a.n[0], &a.n[0] + N, std::ostream_iterator<int>(std::cout, " "));
        std::cout << std::endl;
        MPI_Send(&a.f[0],1,MPI_USER_ASSET,1,0,MPI_COMM_WORLD);
    } else {
        MPI_Recv(&a.f[0],1,MPI_USER_ASSET,0,0,MPI_COMM_WORLD, &stat);
        std::cout << "\t=> ";
        std::copy(&a.f[0], &a.f[0] + N, std::ostream_iterator<float>(std::cout, " "));
        std::cout << std::endl << "\t=> ";
        std::copy(&a.m[0], &a.m[0] + N, std::ostream_iterator<int>(std::cout, " "));
        std::cout << std::endl << "\t=> ";
        std::copy(&a.n[0], &a.n[0] + N, std::ostream_iterator<int>(std::cout, " "));
        std::cout << std::endl;
    }

    MPI_Type_free(&MPI_USER_ASSET);

    MPI_Finalize();
    return 0;
}

worked with
mpirun -n 2 ./mpi_compound

with mpich2 v1.5 (HYDRA) on x86_86 linux and g++ 4.4.5-8 - based mpic++


text:
Q: Date Format For Google Classroom API ScheduledTime I'm trying to set the scheduled time when creating an assignment using the Google Classroom API. However, I'm confused about which date format is needed. By the error messages, it seems to accept a string which holds a timestamp and a timezone or Z at the end. Among others, I've tried using System.currentTimeMillis() + "Z", as well as googleDate.getValue() + "Z", googleDate.getValue() since Google Date format seems to be the way to go based on this doc  but none of them seem to work.
Any ideas perhaps?
Thank you.
  String timezone = timestamp + offset + "";
                System.currentTimeMillis()
                com.google.api.client.util.DateTime googleDate =
   new com.google.api.client.util.DateTime(new java.util.Date());
//               Date javaDate = new Date(googleDate.getValue());

                CourseWork courseWork = new CourseWork()
                        .setCourseId(course.getId())
                        .setTitle("title PUBLISHED 2")
                        .setDescription("desc")
                        .setScheduledTime(googleDate.getValue() + "Z")
                        .setMaxPoints(100.0)
                        .setDueDate(date)
                        .setDueTime(timeOfDay)
                        .setWorkType("ASSIGNMENT")
                        .setState("PUBLISHED")
                        ;

This is what I get when I manually add a timestamp and turn it into a string.

And this using the Google date instead.

And this with the new Java 8 apis

A: java.time
I recommend that you use java.time, the modern Java date and time API, for your date and time work. The following code gives the same result as the code from your answer.
    LocalDate localDate = LocalDate.now().plusDays(7);
    String s = localDate.atStartOfDay(ZoneId.systemDefault())
            .format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
    System.out.println(s);

Output in my time zone today:

2021-10-20T00:00:00+02:00

Compared to your own answer you have fewer conversions, and you are freed from writing your own format pattern string since the formatter we need is built in.

A: This worked:
LocalDate localDate = LocalDate.now().plusDays(7);
                    java.util.Date date1 = java.util.Date.from(localDate.atStartOfDay()
                                    .atZone(ZoneId.systemDefault())
                                    .toInstant());

                    String s = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX").format(date1);

It seems the imports were using the Google Date class instead of java.util.date.


text:
Q: How to add conditionals inside shell expressions? I have the following JavaScript script:
exec('(echo "<!doctype html>") > '+file+'.html')

I want to translate it to ShellScript alone. How do I translate the ternary operators, though?

A: To translate ternary operators to shell script, you will need to use if statements.  I don't think shell scripting has anything like a ternary operator.
If you need to know the syntax for the if statement, look here.


text:
Q: Updating/Deleting User Profile with React on Express I'm working on a web app with React on Express with a Postgresql database, and am working on trying to allow users the ability to delete/update their profiles.  I've updated the controller, model, and routes for these changes, but I'm having an issue figuring out where to send the fetch request from the React component.  Anytime I try to run a delete or an update I get the following on my terminal:
PUT /api/auth/1 400 3.468 ms - 24
--- undefined /robots.txt

I checked other threads on here and wasn't able to find how I can determine what URL I should point to for these functions.  I think once I get that it should work as intended.  Below are my auth routes and the functions I have set up, if anybody could suggest how I'd determine what URL to point this to I'd really appreciate it.
// handle profile update/delete
authRouter.route('/dashboard')
    .get(usersController.show)
    .put(usersController.update)
    .delete(usersController.delete)

User Update/Delete functions:
  handleUpdateSubmit(e, data, id) {
    e.preventDefault()
    console.log('clicked')
    fetch(`/api/auth/${id}`, {
      method: 'PUT',
      credentials: 'include',
      headers: {
        'Content-Type': 'application/json',
      },
      body: JSON.stringify(data),
    }).then(res => res.json())
    .then(res => {
      this.setState({
        fireRedirect: true,
        redirectPath: '/dashboard'
      })
    }).catch(err => console.log(err))
  }

  userDelete(id) {
    fetch(`/api/auth/${id}`, {
      method: 'DELETE',
    }).then(res => res.json())
    .then(res => {
      this.setState({
        fireRedirect: true,
        redirectPath: '/'
      })
    }).catch(err => console.log(err))
  }

Please let me know if there's any information that'd be useful for figuring this out and I'll provide it immediately, thanks!

A: Forgot to follow up on this, the issue was with how my functions were ordered.  I moved my authrouter.Route code beneath the login/logout/register functions and it's working as expected.


text:
Q: How to disable VS Code Git yellow icons next to my files? I am using Git in Visual Studio Code, and there are icons next to my files - U (untracked) and M (modified). They are useful sometimes, but most of the time I just find it really distracting and annoying. Is there any way of turning it off so I don't see it?
Notice the yellow M next to my files.

A: The Git status tags in Explorer/file view can be toggled using the Decorations option for the Git extension.
If you want to disable it for every project, search decorations in Settings and uncheck Git > Decorations: Enabled.
If you just want to disable it in your current project, add the following rule to your project settings in .vscode/settings.json:
    "git.decorations.enabled": true


text:
Q: How to run an AWS EMR cluster on multiple subnets? Currently we are creating instances using a config.json file from EMR to configure the cluster. This file specifies a subnet ("Ec2SubnetId").
ALL of my EMR instances end up using this subnet...how do I let it use multiple subnets?
Here is the terraform template I am pushing to S3.
{
   "Applications": [
        {"Name": "Spark"},
        {"Name": "Hadoop"}
    ],
    "BootstrapActions": [
        {
            "Name": "Step1-stuff",
            "ScriptBootstrapAction": {
                "Path": "s3://${artifact_s3_bucket_name}/artifacts/${build_commit_id}/install-stuff.sh",
                "Args": ["${stuff_args}"]
            }
        },
        {
            "Name": "setup-cloudWatch-agent",
            "ScriptBootstrapAction": {
                "Path": "s3://${artifact_s3_bucket_name}/artifacts/${build_commit_id}/setup-cwagent-emr.sh",
                "Args": ["${build_commit_id}"]
            }
        }
    ],
    "Configurations": [
        {
            "Classification": "spark",
            "Properties": {
                "maximizeResourceAllocation": "true"
            }
    ],
    "Instances": {
        "AdditionalMasterSecurityGroups": [ "${additional_master_security_group}" ],
        "AdditionalSlaveSecurityGroups": [ "${additional_slave_security_group}" ],
        "Ec2KeyName": "privatekey-${env}",
        "Ec2SubnetId": "${data_subnet}",
        "InstanceGroups": [

A: You cannot currently achieve what you are trying to do. EMR clusters always end up with all of their nodes in the same subnet.
Using Instance Fleets, you are indeed able to configure a set of subnets.. but at launch time, AWS will choose the best one and put all your instances there.
From the EMR Documentation, under "Use the Console to Configure Instance Fleets":

*For Network, enter a value. If you choose a VPC for Network, choose a single EC2 Subnet or CTRL + click to choose multiple EC2 subnets. The subnets you select must be the same type (public or private). If you choose only one, your cluster launches in that subnet. If you choose a group, the subnet with the best fit is selected from the group when the cluster launches.


text:
Q: How to send json data to web api from $http service in angular js While making a Ajax Request with Json object to "Web Api" using Angular js $http service.It raise CORS Issue,There is no Resolution by adding the following header "Access-Control-Allow-Origin" also,Please suggest me the right solution
Example:
var testmodule = angular.module('testmod', []);

 testmodule.controller('testcontroller', function ($scope, $http)

{

$scope.Member ={'name':'andrew','age':12,'class':10}

$scope.savedata =function(){

$http({
            url: "**api url**",
            method: 'POST',
            data: $scope.Member
        }).success(function (data, status) { }).error(function (data, status, headers) { })
}
})

A: The "Access-Control-Allow-Origin" is a server side issue, you don't need to add any header in angularjs. add the following code to your server side:
("Access-Control-Allow-Origin", "*");
("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, X-Codingpedia");

you can refer to How to enable CORS in AngularJs


text:
Q: How to replace a specific node with XQuery I want to replace .
 with .
 or other tags. And I want to keep my text and other tags unchanged.  For example:

          adsdfasdf
sadasdsafg
kkot.

3

A: To solve the question in your title (finding it), find all text nodes which end with a dot, get the first following sibling (if looking for the next following node we would also return nodes like
foobar.

) and test if it is a
 node (in this case, only test the name, I'm not checking for emptiness here).
//text()[ends-with(., '.')]/following-sibling::node()[1]/self::br

Renaming the node - what you asked for in your question body - works like this:
rename node //text()[ends-with(., '.')]/following-sibling::node()[1]/self::br as 'p'

Renaming of course requires XQuery Update. Only finding that node also works with any XQuery 1.0 and even XPath 2.0 processors.


text:
Q: When to write the word "parenthetically" I understand that if you're speaking a phrase in which you would write parentheses, you can say the word parenthetically. But when should you write the word parenthetically?
I came across this sentence, starting off a paragraph in a scientific article:

Parenthetically, we note that subjects in all experimental conditions were unbiased …

This struck me as odd. If they're speaking parenthetically, shouldn't it be in parentheses? On the one hand, from a descriptive point of view, the usage of the word was not ambiguous – I know exactly what the author is trying to connote by using it. But from a prescriptive point of view, would this be considered proper grammar?

A: Don't confuse the punctuation marks routinely used to convey an idea with the idea itself, even when the punctuation marks have a same or similar name as the idea. It's quite reasonable to say, "Charles QUESTIONED the speaker's statement" without using a question mark (because I do not actually quote the question). "When I asked my children where they wanted to go for vacation, they EXCLAIMED that they wanted to go to Disney World." Etc.

A: In addition to its prescriptive purpose, parenthetically may also be used in a more abstract sense, by definition:

Set off within or as if within parentheses; qualifying or explanatory

It's worth noting that there is a difference between a parenthesis and parentheses, the former being a rhetoric device and the latter being punctuation. (Parentheses usually - but not always - enclose a parenthetical remark.)

A: It's a good word to use in speech, when you can't show actual parentheses. In the context you give, it's probably just a stylistic choice, if an ill-advised one. Parenthetically, I note that scientific papers are not always models of perfect grammar and word choice.

A: The use of parenthetically is not limited to the literal meaning of appearing between brackets.  It can, as in your example, mean simply 'as an aside'.

A: The word "parenthesis" is a Greek word, as every sophisticated word is... so, parenthesis (παρένθεσις) is exactly this: (  ). This is a parenthesis. When we say parenthetically, we mean that we add an idea to our text which it may seem unnecessary but we judge that it would enforce our point we wish to make.

A: I am mainly copying the entry because of the example below. Synonyms might help too

parenthetically
adverb
incidentally, by the way, in passing, by way of explanation, by the bye
This brings us, parenthetically, to another question.

Collins Thesaurus of the English Language – Complete and Unabridged 2nd Edition. 2002 © HarperCollins Publishers 1995, 2002

A: It seems to me that the use of the word parenthetically is used as a tangential idea separate from, but related, to the subject of the discourse.


text:
Q: Running Android Speech Recognition as Service: will not start I'm using the solution here: Android Speech Recognition as a service on Android 4.1 & 4.2 The code below gets to the onStartCommand() method, however the speech recogntion never seems to kick off, as evidenced by the fact that the onReadyForSpeech() method is never called.
UPDATE:
So I added  and that allowed the onReadyForSpeech() to be called , BUT onError() is called with error code: 6 after the onReadyForSpeech() method is complete (this goes into a continuous loop because the start listening code is started again after onError() is called). Like  Hoan Nguyen states below, error code 6 is ERROR_SPEECH_TIMEOUT BUT I never see a speech recognition dialog come up so I know to start speaking. I also tried to start speaking immediately after kicking off this code without that dialog coming and still get error code 6, what am I doing wrong here?
UPDATE (9-06-13):
Like Hoan stated, there is no dialog that comes up. You just start talking as soon as listening is called. But I ran into another issue where trying to restart the listener after every onResult() is called...That issue and the complete code for this can be found here: Android Speech Speech Recognition: Repeated Calling of SpeechRecognizer.startListening() fails on JB 4.1.2
My activity code that calls the service:
startService(new Intent(VoiceRecognition.this, VoiceRecogService.class));

My service:
public class VoiceRecogService extends Service
    {
        protected AudioManager mAudioManager;
        protected SpeechRecognizer mSpeechRecognizer;
        protected Intent mSpeechRecognizerIntent;
        protected final Messenger mServerMessenger = new Messenger(new IncomingHandler(this));

        protected boolean mIsListening;
        protected volatile boolean mIsCountDownOn;

        static final int MSG_RECOGNIZER_START_LISTENING = 1;
        static final int MSG_RECOGNIZER_CANCEL = 2;

        private int mBindFlag;
        private Messenger mServiceMessenger;

        @Override
        public void onCreate()
        {
            super.onCreate();
            mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
            mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(this);
            mSpeechRecognizer.setRecognitionListener(new SpeechRecognitionListener());
            mSpeechRecognizerIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
            mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
                                             RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
            mSpeechRecognizerIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
                                             this.getPackageName());

            //mSpeechRecognizer.startListening(mSpeechRecognizerIntent);
        }

        protected static class IncomingHandler extends Handler
        {
            private WeakReference<VoiceRecogService> mtarget;

            IncomingHandler(VoiceRecogService target)
            {
                mtarget = new WeakReference<VoiceRecogService>(target);
            }

            @Override
            public void handleMessage(Message msg)
            {
                final VoiceRecogService target = mtarget.get();

                switch (msg.what)
                {
                    case MSG_RECOGNIZER_START_LISTENING:

                        if (Build.VERSION.SDK_INT >= 16);//Build.VERSION_CODES.JELLY_BEAN)
                        {
                            // turn off beep sound
                            target.mAudioManager.setStreamMute(AudioManager.STREAM_SYSTEM, true);
                        }
                         if (!target.mIsListening)
                         {
                             target.mSpeechRecognizer.startListening(target.mSpeechRecognizerIntent);
                             target.mIsListening = true;
                            //Log.d(TAG, "message start listening"); //$NON-NLS-1$
                         }
                         break;

                     case MSG_RECOGNIZER_CANCEL:
                          target.mSpeechRecognizer.cancel();
                          target.mIsListening = false;
                          //Log.d(TAG, "message canceled recognizer"); //$NON-NLS-1$
                          break;
                 }
           }
        }

        // Count down timer for Jelly Bean work around
        protected CountDownTimer mNoSpeechCountDown = new CountDownTimer(5000, 5000)
        {

            @Override
            public void onTick(long millisUntilFinished)
            {
                // TODO Auto-generated method stub

            }

            @Override
            public void onFinish()
            {
                mIsCountDownOn = false;
                Message message = Message.obtain(null, MSG_RECOGNIZER_CANCEL);
                try
                {
                    mServerMessenger.send(message);
                    message = Message.obtain(null, MSG_RECOGNIZER_START_LISTENING);
                    mServerMessenger.send(message);
                }
                catch (RemoteException e)
                {

                }
            }
        };

        @Override
        public int onStartCommand (Intent intent, int flags, int startId)
        {
            //mSpeechRecognizer.startListening(mSpeechRecognizerIntent);
            try
            {
                Message msg = new Message();
                msg.what = MSG_RECOGNIZER_START_LISTENING;
                mServerMessenger.send(msg);
            }
            catch (RemoteException e)
            {

            }
            return  START_NOT_STICKY;
        }

        @Override
        public void onDestroy()
        {
            super.onDestroy();

            if (mIsCountDownOn)
            {
                mNoSpeechCountDown.cancel();
            }
            if (mSpeechRecognizer != null)
            {
                mSpeechRecognizer.destroy();
            }
        }

        protected class SpeechRecognitionListener implements RecognitionListener
        {

            @Override
            public void onBeginningOfSpeech()
            {
                // speech input will be processed, so there is no need for count down anymore
                if (mIsCountDownOn)
                {
                    mIsCountDownOn = false;
                    mNoSpeechCountDown.cancel();
                }
                //Log.d(TAG, "onBeginingOfSpeech"); //$NON-NLS-1$
            }

            @Override
            public void onBufferReceived(byte[] buffer)
            {
                String sTest = "";
            }

            @Override
            public void onEndOfSpeech()
            {
                Log.d("TESTING: SPEECH SERVICE", "onEndOfSpeech"); //$NON-NLS-1$
             }

            @Override
            public void onError(int error)
            {
                if (mIsCountDownOn)
                {
                    mIsCountDownOn = false;
                    mNoSpeechCountDown.cancel();
                }
                 mIsListening = false;
                 Message message = Message.obtain(null, MSG_RECOGNIZER_START_LISTENING);
                 try
                 {
                        mServerMessenger.send(message);
                 }
                 catch (RemoteException e)
                 {

                 }
                //Log.d(TAG, "error = " + error); //$NON-NLS-1$
            }

            @Override
            public void onEvent(int eventType, Bundle params)
            {

            }

            @Override
            public void onPartialResults(Bundle partialResults)
            {

            }

            @Override
            public void onReadyForSpeech(Bundle params)
            {
                if (Build.VERSION.SDK_INT >= 16);//Build.VERSION_CODES.JELLY_BEAN)
                {
                    mIsCountDownOn = true;
                    mNoSpeechCountDown.start();
                    mAudioManager.setStreamMute(AudioManager.STREAM_SYSTEM, false);
                }
                Log.d("TESTING: SPEECH SERVICE", "onReadyForSpeech"); //$NON-NLS-1$
            }

            @Override
            public void onResults(Bundle results)
            {
                //Log.d(TAG, "onResults"); //$NON-NLS-1$

            }

            @Override
            public void onRmsChanged(float rmsdB)
            {

            }

        }

        @Override
        public IBinder onBind(Intent arg0) {
            // TODO Auto-generated method stub
            return null;
        }
    }


text:
Q: How to mod_rewrite / RewriteRule in .htaccess to redirect all "_escaped_fragment_" url to static snpashot html folder to handle AngularJS SEO I searched, read and experimented for the whole day but could not make it work.
In my angularjs site I have
$locationProvider.html5Mode(false);
$locationProvider.hashPrefix('!');

So, my links are like,
http://example.com/#!/home
http://example.com/#!/folder1/folder2

According to AngularJS SEO docs, crawlers will see above links as,
http://example.com/?_escaped_fragment_=/home
http://example.com/?_escaped_fragment_=/folder1/folder2

Now, my goal is to write some rules in .htaccess to redirect crawlers to some snapshot folder and static html files. So, when the crawlers try to go to the above links, they should be redirected to,
http://example.com/snapshot/home
http://example.com/snapshot/folder1/folder2

I have almost no experience with .htaccess files and very little knowledge of Perl Regex.
Please do not give only links as answers since I have googled and tried lots of combinations.
I also referred to this stackoverflow link, and experimented with my .htaccess file, but could not make it redirect to the snapshot folder.
Can anyone please help me make it work?
*********************** UPDATE 1 ********************************
As per @Olaf Dietsche's answer, I wrote these 2 lines (and these 2 only) in my .htaccess file
RewriteCond %{QUERY_STRING} _escaped_fragment_=([^&]*)
RewriteRule ^$ /snapshot/%1 [R,L]

The result is, when I am hitting
http://example.com/?_escaped_fragment_=/home

in my browser, the url is becoming
https://example.com:80/snapshot//home?_escaped_fragment_=/home

expected is http://example.com/snapshot/home
So, current issues are,

*

*the 'http' becomes 'https', hence getting SSL connection error

*a port number :80 comes suddenly, which was not there

*2 forward slashes '//' after snapshot

*after 'home' the previously '?_escaped_fragment_=/home' also stays, which should not be there

Help please...

A: I am not familiar with Angular, but the reason why it is not redirecting, is because the rules in the quoted question only rewrite instead of redirect. See also Understanding difference between redirect and rewrite .htacess.
To redirect, you must either give an absolute URL to another domain as target or add the R|redirect flag, e.g.
RewriteCond %{QUERY_STRING} _escaped_fragment_=/([^&]*)
RewriteRule ^$ /snapshot/%1? [R,L]

The query string is appended to the target unaltered, unless you add your own query string. So, to remove the previous query string, you can just add a single question mark.


text:
Q: Manually execute workbox.expiration.Plugin.deleteCacheAndMetadata() for a route The method workbox.expiration.Plugin.deleteCacheAndMetadata() has recently been added to workbox.
How can I trigger this for a particular route I have setup to cache?
The use case here is that I need to delete a cache when certain actions on the client happen. I could just delete the cache right from the client, but that would leave the metadata (in indexedDB). So I'd rather want to send a message to the service worker and use the workbox method to do the cleanup.
How can I get a hand of the correct expiration plugin instance to call the method?

A: I think the main thing to keep in mind is that the workbox.expiration.Plugin instance is not associated with a route—it's passed in to a given strategy. It can live outside of a route definition, and you can reference it later on in your code.
Here's an example:
const expirationPlugin = new workbox.expiration.Plugin({
  maxEntries: 20,
}),

workbox.routing.registerRoute(
  new RegExp('/images/'),
  workbox.strategies.cacheFirst({
    cacheName: 'image-cache',
    plugins: [
      expirationPlugin,
    ],
  })
);

self.addEventListener('message', (event) => {
  if (event.data === 'clear-cache') {
    expirationPlugin.deleteCacheAndMetadata();
  }
});


text:
Q: Get groups of 4 elements from name value list using LINQ in C# I am wanting to loop through this list of name value pairs and grab them in groups of 4.
The data would be like:
value1 1
value2 1
value3 1
value4 1
value1 2
value2 2
value3 2
value4 2

and it would group it as 1 list that contains
value1 1
value2 1
value3 1
value4 1

and another list that contains
value1 2
value2 2
value3 2
value4 2

I know this can be done easily with a for loop, but I am wondering if there is a good way to do it with LINQ.

A: This will group by every 4 items (a, b, c, d), (e, f, g, h), (i, j)
var abc = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };

var xyz = abc.Select((e, i) => new { Item = e, Grouping = (i / 4) }).GroupBy(e => e.Grouping);

A: There's nothing built into the framework to do this easily, but MoreLINQ has the Batch method:
IEnumerable<IEnumerable<DataItem>> groups = source.Batch(4);

foreach (IEnumerable<DataItem> group in groups)
{
    foreach (DataItem item in group)
    {
        ...
    }
}

A: I think you're looking for GroupBy.


text:
Q: Jasmine spyOn javascript getter causing karma to hang I'm having some issues using Jasmine to write tests which spy on a Javascript getter. It causes my test suite to hang (using karma + phantomJS) and then ultimately the browser disconnects having never progressed further than the test in question.
A simple example is probably the easiest way to explain (using ES6 transpiled with webpack + babel-loader):
class ExampleClass {
    get name() {
        return "My Name";
    }
}

In order to change what this get method returns for my test, I am trying the following:
describe("example class getter"), function() {
    it("should return blue", function() {
        let exampleClass = new ExampleClass();
        spyOn(exampleClass, 'name').and.returnValue('blue');
        expect(exampleClass.name).toBe('blue');
    });
});

This results in the following (where the test in question is my 7th test):
PhantomJS 1.9.8 (Mac OS X 0.0.0): Executed 6 of 8 SUCCESS (0 secs / 0.02 secs)
WARN [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Disconnected (1 times), because no message in 10000 ms.
PhantomJS 1.9.8 (Mac OS X 0.0.0): Executed 6 of 8 DISCONNECTED (10.003 secs / 0.02 secs)
DEBUG [karma]: Run complete, exiting.

spyOn is working for other methods which aren't defined using the get syntax, so I am confident the build pipeline for transpilation is working fine.
Has anyone seen this before, or have any ideas about a fix?

A: I've got the same. Here's the way I've solved this:
class Foo {
  get status() {
    return 0;
  }
}

So mock this Foo for test:
class FooMock extends Foo {
  _fakeStatus() {
    return 1;
  }

  get status() {
    return this._fakeStatus();
  }
}

And then you use the FooMock instead the Foo! e.g:
it('check the status', () => {
  spyOn(fooInstance, '_fakeStatus').and.returnValue(3);
  expect(fooInstance.status).toBe(3);
}

Hope this works for you! :)

A: I think you neglected to invoke the name function in your expect call.  Like this:
describe("example class getter"), function() {
    it("should return blue", function() {
        let exampleClass = new ExampleClass();
        spyOn(exampleClass, 'name').and.returnValue('blue');
        expect(exampleClass.name()).toBe('blue');
    });
});


text:
Q: While undeleting deleted answer, the snippet seems missing Yesterday I made an answer to this question Why does width and height affect how a flex item is rendered?. I got some downvotes and so I decided to check am I missed something. I temporarily deleted it for reviewing and then undeleted it.
Then the snippet seems missing.
I set the snippet to hidden by default.

A: If the post is scored -3 or lower, all snippet functionality is completely disabled to prevent abuse cases and it will only ever show the code. Thus, if you have the snippet set to hide the code by default, the entire thing gets hidden because there's nothing left to show.
Note: This is not new behaviour. This functionality was added very shortly after Stack Snippets were implemented based on feedback from the original announcement.


text:
Q: 'this application will be able to post tweets for you' how to achieve this? I've created a twitter app (using PHP as the programming language) that requires the authorization from the users. This app has 'read and write' access. How do I tweet on my users behalf through this app. I've also searched a lot on the internet but to no avail. I'm a beginner and this is the first app that I've created. So I don't have much idea here.

A: First you use the OAuth 1.0A flow to obtain an access token representing the Twitter User's authorization of your application to work on their behalf.
Once you have this access token, you use it in OAuth 1.0A signed requests to Twitter's statuses/update API method, which is the API method that creates tweets. https://dev.twitter.com/docs/api/1.1/post/statuses/update
It's best to use a library to perform these actions, such as tmhOAuth for PHP: https://github.com/themattharris/tmhOAuth
There are examples for negotiating tokens and tweeting using tmhOAuth here: https://github.com/themattharris/tmhOAuthExamples
If you're new to OAuth, this guide is pretty helpful: http://oauthbible.com/


text:
Q: Nginx + uWSGI basic configuration I'm new to both, I got to run 2 Django skeleton apps (just shows the "It works!" page) using Emperor, but I want to try it without Emperor. (to better understand how it works)
My nginx.conf:
# snipped...
server {
  listen 92;
  server_name example.com;
  access_log /home/john/www/example.com/logs/access.log;
  error_log /home/john/www/example.com/logs/error.log;

  location / {
    include uwsgi_params;
    uwsgi_pass 127.0.0.1:8001;
  }
}
# snipped...

And I start uWSGI by:
$ uwsgi --ini /home/john/www/example.com/uwsgi.ini

With uwsgi.ini being:
[uwsgi]
http = :8001
chdir = /home/john/www/example.com/example
module = example.wsgi
master = True
home = /home/john/Envs/example.com

Once uwsgi and nginx are running, I can access localhost:8001, but not localhost:92.
What am I missing?
Thanks in advance.

A: You are telling the uwsgi process to serve applications using the http protocol.  This feature is meant mainly for developer convenience.  You should instead tell it to use the uwsgi protocol:
[uwsgi]
protocol = uwsgi
socket = 127.0.0.1:8001
chdir = /home/john/www/example.com/example
module = example.wsgi
master = True
home = /home/john/Envs/example.com