text:
Q: Android AsyncATask #3 error My app is still crashing but now it is giving me FATAL EXCEPTION: AsyncTask #3. I have been looking at my code for hours and I cannot find out what would be the reason for it to be crashing. So I was just hoping if somebody can tell me why and what I can to fix it.
07-28 14:50:19.728: E/AndroidRuntime(776): FATAL EXCEPTION: AsyncTask #3
07-28 14:50:19.728: E/AndroidRuntime(776): java.lang.RuntimeException: An error occured while executing doInBackground()
07-28 14:50:19.728: E/AndroidRuntime(776):  at android.os.AsyncTask$3.done(AsyncTask.java:299)
07-28 14:50:19.728: E/AndroidRuntime(776):  at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
07-28 14:50:19.728: E/AndroidRuntime(776):  at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
07-28 14:50:19.728: E/AndroidRuntime(776):  at java.util.concurrent.FutureTask.run(FutureTask.java:239)
07-28 14:50:19.728: E/AndroidRuntime(776):  at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
07-28 14:50:19.728: E/AndroidRuntime(776):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
07-28 14:50:19.728: E/AndroidRuntime(776):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
07-28 14:50:19.728: E/AndroidRuntime(776):  at java.lang.Thread.run(Thread.java:856)
07-28 14:50:19.728: E/AndroidRuntime(776): Caused by: java.lang.NullPointerException
07-28 14:50:19.728: E/AndroidRuntime(776):  at com.theproblemsolver.ListView$LoadAllData.doInBackground(ListView.java:92)
07-28 14:50:19.728: E/AndroidRuntime(776):  at com.theproblemsolver.ListView$LoadAllData.doInBackground(ListView.java:1)
07-28 14:50:19.728: E/AndroidRuntime(776):  at android.os.AsyncTask$2.call(AsyncTask.java:287)
07-28 14:50:19.728: E/AndroidRuntime(776):  ... 4 more

MainActivity
public class MainActivity extends Activity {

    EditText et;
    Button getanswer;

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

        Button getanswer = (Button) findViewById(R.id.button1);
        getanswer.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent i = new Intent(MainActivity.this, ListView.class);
            startActivity(i);
        }

        });
    }
}

ListView Activity
public class ListView extends ListActivity {

    private ProgressDialog pDialog;

    JSONParsser jParser = new JSONParsser();
    ArrayList<HashMap<String, String>> questionList;

    private static String URI = "http://example.com/json";;

    //JSONObject json = jParser.getJSONFromURI(URI);

     final String TAG_RESULTS = "ResultsSet";
     final String TAG_SUBJECT = "Subject";
     final String TAG_NUMANSWERS = "NumAnswers";
     final String TAG_QUESTION = "Question";
     final String TAG_QUESTION_CONTENT = "Content";
     final String TAG_QUESTION_CHOSENANSWER = "ChosenAnswer";
     final String TAG_QUESTION_ANSWERS = "Answers";

            JSONArray ResultsSet = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.listview);

    questionList = new ArrayList<HashMap<String, String>>();

    android.widget.ListView lv = getListView();

    new LoadAllData().execute();

    lv.setOnItemClickListener(new OnItemClickListener() {

    @Override
        public void onItemClick(AdapterView<?> parent, View view,int position, long id) {

        }
    });

}

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        if (resultCode == 100) {
            Intent intent = getIntent();
            startActivity(intent);
            finish();
        }
    }

    class LoadAllData extends AsyncTask<String, String, String> {

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            pDialog = new ProgressDialog(ListView.this);
            pDialog.setMessage("Loading Data. Please wait...");
            pDialog.setIndeterminate(false);
            pDialog.setCancelable(false);
            pDialog.show();
        }

        protected String doInBackground(String... args) {

            try {
                    JSONObject json = jParser.getJSONFromURI(URI);
                    ResultsSet = json.getJSONArray(TAG_RESULTS);

                   for(int i = 0; i < ResultsSet.length(); i++) {
                       JSONObject r = ResultsSet.getJSONObject(i);
                       String Subject = r.getString(TAG_SUBJECT);
                       String NumAnswers = r.getString(TAG_NUMANSWERS);

                       JSONObject Question = r.getJSONObject(TAG_QUESTION);
                       String Content = Question.getString(TAG_QUESTION_CONTENT);
                       String ChosenAnswer = Question.getString(TAG_QUESTION_CHOSENANSWER);
                       String Answers = Question.getString(TAG_QUESTION_ANSWERS);

                       HashMap<String, String> map = new HashMap<String, String>();

                       map.put(TAG_SUBJECT, Subject);
                       map.put(TAG_NUMANSWERS, NumAnswers);

                       questionList.add(map);
                   }

            } catch (JSONException e) {
                e.printStackTrace();
            }
            return null;

        }

        protected void onPostExecute(String file_URI) {

            pDialog.closeOptionsMenu();
            runOnUiThread(new Runnable() {
            public void run() {
                ListAdapter adapter = new SimpleAdapter(getBaseContext(), questionList,
                        R.layout.row,
                        new String[] { TAG_SUBJECT, TAG_NUMANSWERS }, new int[] {
                        R.id.Subject, R.id.NumAnswers });

                setListAdapter(adapter);

                }
            });

        }
}}

JSONParsser class
public class JSONParsser {

    static InputStream is = null;
    static JSONObject jObj = null;
    static String json = "";
    EditText et;

    public JSONParsser () {
    }

    public JSONObject getJSONFromURI(String URI) {

        try{
        HttpClient client = new DefaultHttpClient();
        try {
            URI website = new URI("http://example.com/json");
            HttpGet request = new HttpGet();
            request.setURI(website);
            try {
                HttpResponse response = client.execute(request);
            HttpEntity httpEntity = response.getEntity();
            is = httpEntity.getContent();

            } catch (ClientProtocolException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        } catch (URISyntaxException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        return jObj;

        }finally{}

    }{

    }

}

If you have any idea about why my code is crashing and other possible errors please let me know.

A: In JSONParsser you return jObj which is null and not changed in method getJSONFromURI.
The result of this method is used in LoadAllData and produces NPE.


text:
Q: Scribite overwrite path for CKEditor template I want to have for admin the full toolbar but for the users the zikula configured one.
I figured out already which template to change:
modules/zikula/ScribiteModule/Editor/CKEditor/Resources/views/editorheader.html.twig

Of course I can just change it there. But I want to be safe in case of Scribite update. So I know I have to place my changed copy into
app/resources/ZikulaScribiteModule/...

What is the ...?
Same question for the toolbar configuration file
modules/zikula/ScribiteModule/Editor/CKEditor/vendor/ckeditor/custconfig.js

Where is this file going?
I asked that question already some months ago: How can I manage to have two different toolbars in CKEditor for two different groups?
But now the ScribiteModule is transfered to the new symfony stile and not Zikula legacy anymore.

A: I'm quite sure you cannot override these templates as they are in non-standard locations from a traditional Symfony model (intentionally).
You may be able to assign a different editor using a textarea override, if the textareas have different DOM ids

redpajama_set_name: RedPajamaStackExchange


text:
Q: Show image with jquery in modal using Codeigniter How to show image in modal (#photoss), using jquery which id is called from :

     <a data-toggle="modal" href="#" data-target="#tallModal" class="mask tt" ... photoss="<?php echo $rec->ss;?>" >

This my script :

This my modal

     ....

 Nama Aplikasi

            ...

A: You can show image in modal like this.
Use anchor as:
Remove data target attribute and use it as normal anchor as.
 <a href="javascript:;"  class="mask tt"  photoss="<?php echo $rec->ss;?>" >

Make the script like below:


text:
Q: Mostrar json en html Tengo este codigo el cual me devuelve un html
const convertToData = (data,select) => {

    params = {
        selectData: data,
        select: select,
    };

    getConvertedData(params).then(response => {
        data = response;

    }).catch(error => {
        if (error.code == 500){
            return console.log(error.message);
        }
        console.log(error);
    });

    return data;
}

asi : "
D\u00eda de llamada Martes<\/span><\/h5>
D\u00eda de llamada Jueves<\/span><\/h5>"
Al mostrarlo por consola me funciona, pero cuando quiero retornalo a este codigo:
${zone_id ? convertToData(zone_id.callDays,"callDays") : ''}

me aparece undefined.

A: getConvertedData es función asincrónica, que significa que no puede devolver un resultado "immediamente". Funciónes asincrónicos exigen .then or .catch para utilizarlas: ellos "piensan" durante algún tiempo y pasan un resultado a functión de then or un error a función de catch, mientras el codigo abajo de llama de getConvertedData continúa siendo ejecutado. Cuando se ejecuta return data, data aún no está llegado.
Solución es estudiar como trabajar con funciónes asincrónicos https://www.adictosaltrabajo.com/2017/02/09/asyncawait-en-javascript/ Es conocimiento muy importante de javascript moderno. Suerte!


text:
Q: generalize maybe and either functions in haskell Is there a function in haskell that generalizes the maybe and either functions?
For instance, I am imagining a function like this:
generalizedFunc :: SOMETHING m => b -> (a -> b) -> m a -> b
generalizedFunc valForError f value = ...

Working with it in ghci would look like this:
> generalizedFunc "bye" (\_ -> "hello") (Just 3)
"hello"
> generalizedFunc "bye" (\_ -> "hello") Nothing
"bye"
> generalizedFunc "bye" (\_ -> "hello") (Right 3)
"hello"
> generalizedFunc "bye" (\_ -> "hello") (Left "error")
"bye"

note: Tom Ellis makes a good point that this is not a generalization of Either, but rather a specialization.

A: Yes. What you're looking for is Data.Foldable. It generalizes foldr (for lists) to any algebraic data type:
Data.List.foldr     :: (a -> b -> b) -> b     ->   []       a -> b
maybe               :: b -> (a -> b)          ->   Maybe    a -> b
either              :: (a -> c) -> (b -> c)   ->   Either a b -> c
---
Data.Foldable.foldr :: Foldable t
                    => (a -> b -> b) -> b     ->   t        a -> b

Your code would change from generalizedFunc "bye" (\_ -> "hello") to foldr (\_ _ -> "hello") "bye". Make sure you tell the compiler that you mean the foldr from Data.Foldable; see the documentation of the module.
Unfortunately, the Foldable (Either a) instance might be missing for your version of GHC, but writing one yourself should be relatively easy.

A: I guess this is a little bit of self promotion but I'll post it because it's very relevant.
I wrote a small library a while back called generic-church. This exports a single type class with two functions. To use it, simply do something like
{-# LANGUAGE DeriveGeneric #-}
import GHC.Generics
import Data.Church

data Nat = Z | S Nat

instance ChurchRep Nat

Notice that Nat need not be a functor as with Foldable.
We can then fire up GHCi and do something like
*> (toChurch Z) 'a' (const 'b')
  'a'
*> (toChurch $ S Z) 'a' (const 'b')
  'b'

And unlike foldr you can automagically turn a church representation back into a concrete data type
*> fromChurch (\a b -> a) :: Nat
  Z
*> fromChurch (a b -> b Z) :: Nat
  S Z

Now one obvious downside as compared to catamorphisms/folds is that generic-church currently handles recursive data types in a slightly naive way (though I'm looking to fix this Real Soon Now). Namely, it treats any recursive type as though it where unfolded one level in it's church representation, so the church representation of Nat is
type Nat' = forall c. c -> (Nat -> c) -> c

Edit, your generalFunc
Here's the code to write your generalFunc in a manner which actually generalizes maybe. I need a function toChurchP which is in generic-church-0.2 uploaded about 5 minutes prior to me typing this. If you want to run this code be sure to use cabal update :)
{-# LANGUAGE DeriveGeneric, MultiParamTypeClasses, FlexibleInstances, TypeFamilies, ScopedTypeVariables #-}
module So where
import Data.Church
import GHC.Generics
import Data.Proxy

-- Generalize of const. Allows us to use more than just Either
-- for gmaybe
class GConst a r where
  gconst :: r -> a
instance GConst r' r => GConst (a -> r') r where
  gconst r = const (gconst r)
instance GConst r r where
  gconst = id

gfail :: forall a e s e' r.
          (ChurchRep a, GConst e' e, Church a r ~ (e' -> s -> r)) =>
           e -> s -> a -> r
gfail e s a = toChurchP (Proxy :: Proxy r) a (gconst e :: e') s

This depends on the that gconst to swallow all arguments given to the failure result, e. A clever definition should allow something like
> gfail id (const 'a') $ Left 'b'
  'b'

But my current formulation would require -XIncoherentInstances (eek!). I'll hopefully update with a version that would actually generalize both either and maybe.
As it is this is still kinda nifty.
*So> gfail True id (Just False)
False
*So> gfail True (id :: Bool -> Bool) Nothing
True
*So> gfail 'a' (const 'b') (Left ())
'a'
*So> gfail 'a' (const 'b') (Right ())
'b'
*So> :set -XDeriveGeneric
*So> data MyMaybe = Fail | Yay Int deriving (Show, Generic)
*So> instance ChurchRep MyMaybe
*So> gfail 'a' (const 'b') (Yay 1)
'b'


text:
Q: How to insert Empty Text Box value into SQL 2008 database, through stored procedure? I am trying to insert empty text box value into  database by stored procedure.But i do
not know how to pass null values through stored procedure please help me.   My Class is
public Void empqualadd(string id, string name, string qual1)
  {
SqlCommand cmd = new SqlCommand("InsertQual");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@MachID", SqlDbType.Int).Value = id;
cmd.Parameters.Add("@EmpCode", SqlDbType.VarChar).Value = name;
cmd.Parameters.Add("@Qualification1", SqlDbType.VarChar).Value = qual1;
conn.nonquery(cmd);
  }

My Button Click is,
protected void Button1_Click(object sender, EventArgs e)
  {
 mas.empqualadd(ddis.SelectedItem.Text,
 txtfname.Text,ddqual.SelectedItem.Text);
  }

I have a connection clas     too,
public Connection()
   {
        conn = new SqlConnection(@"server=SIGNET- SOFTWARE\SA;database=manjilas;Integrated security=true");
        cmd = null;
   }
public void nonquery(SqlCommand cmd)//for insert,delete,update
   {
if (conn.State == ConnectionState.Open)
   {
conn.Close();
   }
conn.Open();
cmd.Connection = conn;
cmd.ExecuteNonQuery();
conn.Close();
   }

It  works fine for insert data if text box is not empty.What changes I should made in class to pass null values?
Please Help me.Thanks in advance....

A: Try this
cmd.Parameters.Add("@MachID", SqlDbType.Int).Value = string.IsNullOrEmpty(id) ? (object)DbNull.Value : id;

Also why are you passing string value when column data type is int?

A: This also works fine.
if(!string.IsNullOrWhiteSpace(qual2)&!string.IsNullOrWhiteSpace(clg2)&!string.IsNullOrWhiteSpace(mark2)&!string.IsNullOrWhiteSpace(year2))
          {
            cmd.Parameters.Add("@Qualification2", SqlDbType.VarChar).Value = qual2.Length > 0 ? qual2 : (object)DBNull.Value;
            cmd.Parameters.Add("@College2", SqlDbType.VarChar).Value = clg2.Length > 0 ? clg2 : (object)DBNull.Value;
            cmd.Parameters.Add("@Mark2", SqlDbType.Int).Value = mark2.Length > 0 ? mark2 : (object)DBNull.Value;
            cmd.Parameters.Add("@Year2", SqlDbType.VarChar).Value =year2.Length > 0 ? year2 : (object)DBNull.Value;
            conn.nonquery(cmd);
          }


text:
Q: How to run Gulp watch as a background task? I have a gulp file using gulp-git that  I wrote to assist our content writers in pushing their updates without having to use git command line. So basically it watches for changes in the given directories and then adds, commits, and pushes the changes.
The gulp file is this:
var gulp = require('gulp');
var git = require('gulp-git');
var runSequence = require('run-sequence');

gulp.task('add', function() {
    return gulp.src('./*')
    .pipe(git.add({args: '-A'}))
})

gulp.task('add-blog', function() {
    return gulp.src([
    './post',
    './properties',
    './files',
    './files'
  ])
    .pipe(git.add())
})

gulp.task('commit-blog', function() {
    return gulp.src([
    './post',
    './properties',
    './files'
  ])
    .pipe(git.commit('blog commit'))
})

gulp.task('push', function() {
    git.push('origin', function(err) {
        if (err) throw err;
    });
})

gulp.task('deploy', function(done) {
    runSequence('add-blog', 'commit-blog', 'push');
});

gulp.task('watch', function () {
    gulp.watch([
    './post/*',
    './properties/*',
    './files/*'
  ], ['deploy'])
});

then I run:
$nohup gulp watch &

it seems to run, but when I look at nohup out i see:
[16:12:37] Using gulpfile /var/www/html/respond/app/sites/ohio-cashflow/gulpfile.js
[16:12:37] Starting 'watch'...
[16:12:38] Finished 'watch' after 1.09 s

and it never runs the git commands when files are added or changed in the appropriate directories?
What am I missing here?


text:
Q: Conditions to get 2 real negative roots for a 3rd order polynomial What is the conditions required to make the 2 roots of the 3rd prder polynomial
$ax^3+bx^2+cx+d$ real and negative, if  $a<0$ and $d>0$.
Thanks

A: This problem is motivated by getting a condition for the intersection of 2 ellipses.
The conditions are :
$b < 0 $ and
$\Delta > 0 $
 where  $\Delta=18 a b c d-4 b^3 d+b^2 c^2-4 a c^3-27 a^2 d^2; $ is the discriminant.
First condition is obtained via routh-criteria and guarantee that we have 2 negative roots, and the second guarantee that all the roots are real.


text:
Q: Sensu check-log regex falsely passing I am trying to set up a sensu check-log check. Logs look similar to the following:
2015-09-22 06:05:44,710 DEBUG log output here
2015-09-22 06:05:44,712 ERROR more log output here
2015-09-22 06:05:44,713 ERROR even more log output here
2015-09-22 06:05:44,714 WARN so much log output

I am running the check manually to test as follows:
sudo -u sensu /path/to/ruby /path/to/sensu/plugins/check-log.rb -f /path/to/log.log -q '/.*ERROR.*/' -r

which when I run the regex here:
http://rubular.com/r/j1NO8RFY2p
it captures the two lines I want. However the manual check returns this:
CheckLog OK: 0 warnings, 0 criticals for pattern /.*ERROR.*/.

So I keep getting falsely passing checks. Failing to see what I am doing wrong here and documentation is fairly lacking with this particular plugin. And yes, there are errors in the log to capture. Any and all help would be greatly appreciated. Thank you in advance.
EDIT
Working code:
rm -rf /var/cache/check-log
sudo -u sensu /path/to/ruby /path/to/sensu/plugins/check-log.rb -f /path/to/log.log -q '.*ERROR.*' -r

A: The script generates cache in /var/cache/log, it stores the number of bytes read, and seeks to that position, so every time to do the test, you need clean the folder first.
rm -rf /var/cache/check-log

then run the fix code
sudo -u sensu /path/to/ruby /path/to/sensu/plugins/check-log.rb -f /path/to/log.log -q '.*ERROR.*' -r

CheckLog CRITICAL: 0 warnings, 2 criticals for pattern .*ERROR.*.
2015-09-22 06:05:44,712 ERROR more log output here

2015-09-22 06:05:44,713 ERROR even more log output here

Refer: check-log.rb


text:
Q: Understanding `NestList` with multiple functions General question
For a function f[n, a], where a is a list and n is a whole number, what is the correct syntax for
f[n - 5, f[n - 4, f[n - 3, f[n - 2, f[n - 1, f[n, a]]]]]]

?
Update
All I want to do is
fg[n_, w_] := f1@ff[n, w]
fg[n - 2, fg[n - 1, fg[n, list]]]

as shown above, which works, but I am having to manually write out n-3,n-2,n-1,...
Have tried
fg[n_][w_] := f1@ff[n, w]
NestList[fg[n], list, 3]

but doesn't quite work. I think it needs a #-1 in there somewhere, that is applied to the n, but not sure on syntax.

A: Could it be that you're looking for the function Fold rather than Nest?
Fold[f[n - #2, #1] &, a, Range[5]]

f[-5 + n, f[-4 + n, f[-3 + n, f[-2 + n, f[-1 + n, a]]]]]

A: Last @ Nest[{ #[[1]] - 1,  f1[ ff[ #[[1]], #[[2]] ] ] } &,
            {n, list},
            3]

f1[ff[-2 + n, f1[ff[-1 + n, f1[ff[n, list]]]]]]


text:
Q: Memory leak in Mallet Alphabet? I'm using Mallet 2.0.8 for topic modelling. The application loops over a set of documents and calculates a topic model for each of the documents (no information is to be shared among the passes or to be aggregated afterwards). Each pass constructs a fresh alphabet with new cc.mallet.types.Alphabet() for the current document.
However, it looks like the memory consumed by an alphabet cannot be garbage collected after each pass because it is referenced in cc.mallet.types.Alphabet.deserializedEntries. There seems to be a question on the mailing list regarding this issue, too.
As a workaround I'm using reflection and set the field cc.mallet.types.Alphabet.deserializedEntries to a subclass of java.util.concurrent.ConcurrentHashMap<K, V> just doing nothing when putIfAbsent(K, V) is called.
My questions are now:

*

*Is this workaround safe for the described usecase?

*Is it intended to construct an alphabet in each pass or is there a better approach that would not result in a memory leak?


text:
Q: Programmatically Check an Item in Checkboxlist where text is equal to what I want In C#, I am trying to Check an item in a CheckBoxList where the text equals what I require.
I would modify the code to check items that exist in the database.
If you would like an example, I need to select the checklistbox item that equals to abc.

A: All Credit to @Jim Scott -- just added one touch. (ASP.NET 4.5 & C#)
Refractoring this a little more... if you pass the CheckBoxList as an object to the method, you can reuse it for any CheckBoxList. Also you can use either the Text or the Value.
private void SelectCheckBoxList(string valueToSelect, CheckBoxList lst)
{
    ListItem listItem = lst.Items.FindByValue(valueToSelect);
    //ListItem listItem = lst.Items.FindByText(valueToSelect);
    if (listItem != null) listItem.Selected = true;
}

//How to call it -- in this case from a SQLDataReader and "chkRP" is my CheckBoxList`

SelectCheckBoxList(dr["kRPId"].ToString(), chkRP);`

A: Assuming that the items in your CheckedListBox are strings:
  for (int i = 0; i < checkedListBox1.Items.Count; i++)
  {
    if ((string)checkedListBox1.Items[i] == value)
    {
      checkedListBox1.SetItemChecked(i, true);
    }
  }

Or
  int index = checkedListBox1.Items.IndexOf(value);

  if (index >= 0)
  {
    checkedListBox1.SetItemChecked(index, true);
  }

A: Example based on ASP.NET CheckBoxList
<asp:CheckBoxList ID="checkBoxList1" runat="server">
    <asp:ListItem>abc</asp:ListItem>
    <asp:ListItem>def</asp:ListItem>
</asp:CheckBoxList>

private void SelectCheckBoxList(string valueToSelect)
{
    ListItem listItem = this.checkBoxList1.Items.FindByText(valueToSelect);

    if(listItem != null) listItem.Selected = true;
}

protected void Page_Load(object sender, EventArgs e)
{
    SelectCheckBoxList("abc");
}

A: //Multiple selection:
          private void clbsec(CheckedListBox clb, string text)
          {
              for (int i = 0; i < clb.Items.Count; i++)
              {
                  if(text == clb.Items[i].ToString())
                  {
                      clb.SetItemChecked(i, true);
                  }
              }
          }

using ==>
clbsec(checkedListBox1,"michael");

or

clbsec(checkedListBox1,textBox1.Text);

or

clbsec(checkedListBox1,dataGridView1.CurrentCell.Value.toString());

A: I tried adding dynamically created ListItem and assigning the selected value.
foreach(var item in yourListFromDB)
{
 ListItem listItem = new ListItem();
 listItem.Text = item.name;
 listItem.Value = Convert.ToString(item.value);
 listItem.Selected=item.isSelected;
  checkedListBox1.Items.Add(listItem);
}
checkedListBox1.DataBind();

avoid using binding the DataSource as it will not bind the checked/unchecked from DB.


text:
Q: Powershell remote exchange session missing types I'd like to collect and process some data from Exchange on remote server using powershell script. Script will be executed on host A, it will create session to host B, inside this session it will create another session - to exchange endpoint.
I'm doing it this way for security reasons, Exchange session needs to be created locally. The issue is that my first session doesn't have exchange data types, type of my $data object
is PSObject, but it should be MailboxDatabase. Is there a way to somehow import data types needed?
$sessWsman = GetOrCreateSession $ip $login $uri $password $configurationName $retryConnectUsingFdqn $uriTemplate $macroMissingWindowsCredentials $macroUnableConnect $macroSessionsDepleted $macroSessionClosed $null

Invoke-Command -Session $sessWsman -Args @("ENG-AUS-SAM-11") -ScriptBlock {

    $sessExchange = GetOrCreateSession $ip $login $uri $password $configurationName $retryConnectUsingFdqn $uriTemplate $macroMissingWindowsCredentials $macroUnableConnect $macroSessionsDepleted $macroSessionClosed $sessWsman

    if ( -Not ([bool](Get-Command -Name 'Get-MailboxDatabase' -ErrorAction SilentlyContinue)))
    {
        Import-PSSession $sessExchange -FormatTypeName * -CommandName Get-MailboxDatabase | Out-null
    }

    $data = Get-MailboxDatabase -Server $HostName -Status

    $data.GetType()
}

I tried adding this Add-PSSnapin Microsoft.Exchange* after importing Get-MailboxDatabase, but it didn't helped.


text:
Q: Calculating pi network impedance I am practising for my radio license exam. One of the questions from an old exam:

This filter belongs to a 3.7MHz transmitter. Approximate the impedance Z for a load of 50Ω.

Answers: 1kΩ; 50Ω; 10kΩ; or 10Ω.

I thought I could calculate the reactances of the inductors and capacitors (left is C1; assuming full values for the caps and 2.5uH for the inductor):

*

*\$X_L = 2\cdot\pi\cdot3700000\cdot0.0000025 = 58.12\Omega\$

*\$X_{C_1} = \frac1{2\cdot\pi\cdot3700000\cdot0.000000000463} = 92.90\Omega\$

*\$X_{C_2} = \frac1{2\cdot\pi\cdot3700000\cdot0.000000001852} = 23.23\Omega\$
And then proceed to compute the substitution resistance of C2 with Rload (parallel), then combine with L (series) and finally with C1 (parallel). I do that with Pythagoras and get:

*

*With C2 and Rload: \$Z_1 = \sqrt{50^2 + 23.23^2} = 55.13\Omega\$

*With L: \$Z_2 = \sqrt{58.12^2 + 55.13^2} = 80.11\Omega\$

*With C1: \$Z = \sqrt{92.90^2 + 80.11^2} = 122.67\Omega\$
This is not one of the answers. The correction model says it should be 1kΩ, but how should I calculate that?

A: The Fast Analytical Circuits Techniques or FACTs will get you there without writing a single line of algebra, just draw little sketches that you can revisit in case you identify a mistake. First, we start with the network observed at \$s=0\$: open the caps and short the inductor. What remains seen from the input is the the 50-\$\Omega\$ resistance. We have \$R_0=50\;\Omega\$. Then, temporarily remove the energy-storing elements and determine the resistance "seen" from their connecting terminals. Here, for the natural time constants of the denominator, you reduce the excitation to 0 A or open-circuit the test generator used to determine the input impedance. You repeat the exercise as shown in the below figure:

You then assemble the time constants the following way:
\$D(s)=1+s(\tau_1+\tau_2+\tau_3)+s^2(\tau_1\tau_{12}+\tau_1\tau_{13}+\tau_2\tau_{23})+s^3\tau_1\tau_{12}\tau_{123}\$
The zeros are found by nulling the response. Nulling means that the voltage across the current test generator to determine the input impedance is 0 V. 0 V across a current source is a degenerate case and you can replace the source by a short circuit. Again, "look" at the resistance offered in this mode by the energy-storing elements:

Once this is done, you can assemble the time constants to form the numerator \$N(s)\$:
\$N(s)=1+s(\tau_{2N}+\tau_{3N})+s^2(\tau_{3N}\tau_{32N})\$
The final expression for this input impedance appears in a low-entropy form and follows:
\$Z(s)=R_0\frac{N(s)}{D(s)}=R_0\frac{1+s\frac{L_3}{R_1}+s^2L_3C_2}{1+sR_1(C_1+C_2)+s^2L_3C_1+s^3(C_1C_2L_3R_1)}\$
You can further rearrange this expression in a nice canonical form as
\$Z(s)=R_0\frac{1+\frac{s}{\omega_{0N}Q_N}+(\frac{s}{\omega_{0N}})^2}{(1+\frac{s}{\omega_p})(1+\frac{s}{\omega_{0D}Q_D}+(\frac{s}{\omega_{0D}})^2)}\$
The below Mathcad sheet gathers all these equations for you and define all the terms needed in the above equation.

Finally, I plotted the raw expression (the simple paralleling of all the elements) and the two other expressions, the complete one and the canonical form. Not too bad! : )

You may be surprised by the approach here, with these FACTs. You have seen that I did not write a single line of algebra, just small sketches that I individually solved. The neat thing is that if I see a deviation between the raw transfer function and the one I derived, I can go back to the small sketches and solve the one which is wong. Try to do that with the brute-force expression : ) If you want to know more about the FACTs, you can check out this tutorial from APEC 2016 and also the list of transfer functions I derived in the book:
http://cbasso.pagesperso-orange.fr/Downloads/PPTs/Chris%20Basso%20APEC%20seminar%202016.pdf
http://cbasso.pagesperso-orange.fr/Downloads/Book/List%20of%20FACTs%20examples.pdf

A: One of the comments to your question mentioned performing the analysis using complex mathematics.  Here is an outline:
The impedance of a resistor is R
$$$$
The complex impedance of a capacitor is
$$\frac{-j}{\omega   \cdot C}$$
The complex impedance of an inductor is
$$j \cdot \omega  \cdot L$$
The definition of j is:
$$j=\sqrt{-1}$$
Therefore:
$$j\cdot j=-1$$
and:
$$-j\cdot j=1$$
What you need, is to work out the impedance using your understanding of series and parallel connected components, substituting these impedance expressions.  If you call the cap on the left C1 and the cap on the right C2, you will end up with the j terms which are complex numbers.  It'll end up looking like:
$$\frac{\left( \frac{R \cdot \frac{-j}{\omega  \cdot C_2}}{R+\frac{-j}{\omega   \cdot C_2}} +( j \cdot \omega  \cdot L)\right) \cdot \frac{-j}{\omega   \cdot C_1}}{\frac{R \cdot \frac{-j}{\omega  \cdot C_2}}{R+\frac{-j}{\omega   \cdot C_2}} +( j \cdot \omega  \cdot L)+\frac{-j}{\omega  \cdot C_1}}$$
Expand the mathematic equation, multiply by the complex conjugate and take the square root.
The complex expression z
$$\frac{a+b\cdot j}{c - d\cdot j }$$
Has the conjugate z^*
$$\frac{a-b\cdot j}{c + d\cdot j }$$
You flip the polarity of the j expressions from positive to negative or vice versa
Multiplying the two
$$  Z \cdot Z^*=\frac{a+b\cdot j}{c - d\cdot j }\cdot \frac{a-b\cdot j}{c + d\cdot j }=\frac{a^2+b^2}{c^2+d^2}$$
Yeilds a real expression (not complex), but it is the square of the real magnitude, so you square root the answer
$$Z_j=\frac{\left( \frac{R \cdot \frac{-j}{\omega  \cdot C_2}+( j \cdot \omega  \cdot L)(R+\frac{-j}{\omega   \cdot C_2})}{R+\frac{-j}{\omega   \cdot C_2}}\right) \cdot \frac{-j}{\omega   \cdot C_1}}
{\left( \frac{R \cdot \frac{-j}{\omega  \cdot C_2}+( j \cdot \omega  \cdot L)(R+\frac{-j}{\omega   \cdot C_2})}{R+\frac{-j}{\omega   \cdot C_2}}\right) +\frac{-j}{\omega   \cdot C_1}}$$
Multiply top and bottom of numerators and denominators by \$j\cdot \omega \cdot C_2\$
$$Z_j=\frac{\left( \frac{R  +( j \cdot \omega  \cdot L)(j \cdot R\cdot \omega  \cdot C_2+1)}{j\cdot R \omega  \cdot C_2 +1}\right) \cdot \frac{-j}{\omega   \cdot C_1}}
{\left( \frac{R  +( j \cdot \omega  \cdot L)(j \cdot R\cdot \omega  \cdot C_2+1)}{j\cdot R \cdot \omega  \cdot C_2 +1}\right) +\frac{-j}{\omega   \cdot C_1}}
=\frac{\left( \frac{R  +( j \cdot \omega  \cdot L)(j \cdot R\cdot \omega  \cdot C_2+1)}{j\cdot R \omega  \cdot C_2 +1}\right) \cdot \frac{-j}{\omega   \cdot C_1}}
{\left( \frac{R  +( j \cdot \omega  \cdot L)(j \cdot R\cdot \omega  \cdot C_2+1)}{j\cdot R \cdot \omega  \cdot C_2 +1}\right) +\frac{-j}{\omega   \cdot C_1}}$$
$$Z_j=\frac{
\left(
R \cdot (1 - \omega^2  \cdot C_2 \cdot L) + ( j \cdot \omega  \cdot L)
\right) \cdot
-j
}
{
\left(
R\cdot (1 - \omega^2  \cdot C_2 \cdot L) + ( j \cdot \omega  \cdot L)
\right)(\omega   \cdot C_1) + -j\cdot(j\cdot R \omega  \cdot C_2 + 1)}$$
$$Z_j=\frac{
( \omega  \cdot L) -j \cdot R \cdot (1 - \omega^2  \cdot C_2 \cdot L)
}
{
R\cdot (\omega   \cdot C_1) \cdot (1 - \omega^2  \cdot C_2 \cdot L) + ( j \cdot \omega  \cdot L)
(\omega   \cdot C_1) + \ R \cdot \omega  \cdot C_2 + -j}$$
$$Z_j=\frac{
( \omega  \cdot L) -j \cdot R \cdot (1 - \omega^2  \cdot C_2 \cdot L)
}
{
\left(R\cdot (\omega   \cdot C_1) \cdot (1 - \omega^2  \cdot C_2 \cdot L) + R \cdot \omega  \cdot C_2 \right)+ j\cdot \left((\omega  \cdot L)
(\omega   \cdot C_1) -1\right)}$$
If my algebra works out...
$$\vert Z \vert =\sqrt{\frac{
( \omega  \cdot L)^2 +\left(R \cdot (1 - \omega^2  \cdot C_2 \cdot L)
\right)^2}
{
\left(R \cdot (\omega   \cdot C_1) \cdot (1 - \omega^2  \cdot C_2 \cdot L) + R \cdot \omega  \cdot C_2 \right)^2+ \left((\omega^2  \cdot L \cdot C_1) -1\right)^2}}$$


text:
Q: How do I get my headset microphone working? I am running Xubuntu 20.10 and have a pair of Beats Solo 3, but Linux doesn't seem to recognize my headphones.
Here's the output of various commands:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: HDMI [HDA Intel HDMI], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: CS4208 Analog [CS4208 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

$ amixer -c1
Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 127
  Mono: Playback 28 [22%] [-49.50dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 127 [100%] [0.00dB] [on]
  Front Right: Playback 127 [100%] [0.00dB] [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 127
  Mono:
  Front Left: Playback 0 [0%] [-63.50dB] [off]
  Front Right: Playback 0 [0%] [-63.50dB] [off]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 2
  Front Left: 2 [100%] [0.00dB]
  Front Right: 2 [100%] [0.00dB]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 63
  Front Left: Capture 61 [97%] [10.00dB] [on]
  Front Right: Capture 61 [97%] [10.00dB] [on]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Enabled'

$ inxi -Fxz
System:    Kernel: 5.8.0-30-generic x86_64 bits: 64 compiler: gcc v: 10.2.0 Desktop: Xfce 4.14.2
           Distro: Ubuntu 20.10 (Groovy Gorilla)
Machine:   Type: Laptop System: Apple product: MacBookAir6,2 v: 1.0 serial: <filter>
           Mobo: Apple model: Mac-7DF21CB3ED6977E5 v: MacBookAir6,2 serial: <filter> UEFI: Apple v: 121.0.0.0.0
           date: 04/12/2020
Battery:   ID-1: BAT0 charge: 49.3 Wh condition: 50.6/54.3 Wh (93%) model: SMP bq20z451 status: Full
CPU:       Info: Dual Core model: Intel Core i7-4650U bits: 64 type: MT MCP arch: Haswell rev: 1 L2 cache: 4096 KiB
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 18400
           Speed: 1842 MHz min/max: 800/3300 MHz Core speeds (MHz): 1: 1966 2: 1908 3: 1890 4: 1887
Graphics:  Device-1: Intel Haswell-ULT Integrated Graphics vendor: Apple driver: i915 v: kernel bus ID: 00:02.0
           Display: x11 server: X.Org 1.20.9 driver: modesetting unloaded: fbdev,vesa resolution: 1: 1440x900~60Hz
           2: 1920x1080~60Hz
           OpenGL: renderer: Mesa DRI Intel HD Graphics 5000 (HSW GT3) v: 4.5 Mesa 20.2.6 direct render: Yes
Audio:     Device-1: Intel Haswell-ULT HD Audio vendor: Apple driver: snd_hda_intel v: kernel bus ID: 00:03.0
           Device-2: Intel 8 Series HD Audio driver: snd_hda_intel v: kernel bus ID: 00:1b.0
           Device-3: Broadcom and subsidiaries 720p FaceTime HD Camera driver: facetimehd v: kernel bus ID: 02:00.0
           Sound Server: ALSA v: k5.8.0-30-generic
Network:   Device-1: Broadcom and subsidiaries BCM4360 802.11ac Wireless Network Adapter vendor: Apple driver: wl v: kernel
           port: efa0 bus ID: 03:00.0
           IF: wlp3s0 state: up mac: <filter>
           IF-ID-1: lxcbr0 state: down mac: <filter>
Drives:    Local Storage: total: 465.92 GiB used: 344.20 GiB (73.9%)
           ID-1: /dev/sda vendor: Apple model: SSD SM0512F size: 465.92 GiB
Partition: ID-1: / size: 442.00 GiB used: 340.11 GiB (76.9%) fs: ext4 dev: /dev/sda4
Swap:      ID-1: swap-1 type: partition size: 14.90 GiB used: 4.08 GiB (27.4%) dev: /dev/sda3
Sensors:   System Temperatures: cpu: 88.0 C mobo: N/A
           Fan Speeds (RPM): N/A
Info:      Processes: 361 Uptime: 2d 53m Memory: 3.78 GiB used: 2.02 GiB (53.5%) Init: systemd runlevel: 5 Compilers:
           gcc: 10.2.0 clang: 11.0.0-2 Packages: 6072 Shell: fish v: 3.1.2 inxi: 3.1.07

I need my mic for Zoom, but I can't seem to find anything on how to fix it. Any help would be greatly appreciated. Thanks!


text:
Q: ANTD: Form.Item with Select - How can I added object value for one Option I know than tag option can carry multiple values:
<option value={key1:value1, key2:value2}></option>

but in ANTD I tried to do the same but got an error.
Is there another way to send multiple value from select option?
My code looks like this
<Form.Item name={something}>
     {list.map(option =>
          <Option value{{key1:option.one}, {key2:option.two}/>
      )}
</Form.Item>


text:
Q: Function that returns an array in Fortran I would like to merge into one. For that, I think about a function that returns a vector of two components (sum/count and count) and then direct indexing of function
My first function is this
INTEGER FUNCTION poor(x,m,n)
REAL, DIMENSION (m,n) :: x
INTEGER m, n, count, i, j
REAL cell_mean   ! This is a function that returns a real number
count = 0
DO i = 1, m
  DO j = 1, n
    IF (x(i,j) < cell_mean(x,m,n,i,j)) THEN
       count = count + 1
    ELSE
      count = count
    END IF
  END DO
END DO
poor = count

END FUNCTION

My second function is this:
REAL FUNCTION middle_value(x,m,n)
REAL, DIMENSION (m,n) :: x
INTEGER m, n, i, j count
REAL cell_mean, sum

sum = 0
count = 0
DO i = 1, m
  DO j = 1, n
    IF (x(i,j) < cell_mean(x,m,n,i,j)) THEN
       sum = sum + x(i,j)
       count = count + 1
    ELSE
      sum = sum
      count = count
    END IF
  END DO
END DO
IF (count == 0) THEN
   middle_value = 0
ELSE
   middle_value = sum / count
END IF
END FUNCTION


text:
Q: Django: How to read question mark (?) in the django URL I am developing a Django app that stores the user input in the database. Now the problem is that when the user writes the ? in the input field, Django treats it as the part of querystring so it doesn't save it.
I am using the following JavaScript code:
$("#submit").on("click",function(){
    text = $("#input").val();
    $.get('/add/'+text);
}

And here is my urls.py file:
urlpatterns = [
     path('add/<str:text>',views.add, name='add'),
     ..............
]

And in views.py, I have:
def add(request,text):
    field = Text(text=text)
    field.save()
    return HttpResponse('')

A: That is because you did not encode it properly. You need to use percentage encoding [wiki] to encode data in a URL.
In JavaScript, you can use the encodeURIComponent function for that:
$("#submit").on("click",function(){
    text = $("#input").val();
    $.get('/add/'+encodeURIComponent(text));
}
The question mark will thus be encoded to %3F, since this is the character that maps on codepoint 63 (or 0x3f as hexadecimal number).
Note that a str will not match a slash. You thus might want to use a path instead:
urlpatterns = [
     path('add/<path:text>',views.add, name='add'),
     # …
]
If you however create, delete, update, etc. records, then you should use a POST, PUT, PATCH or DELETE request, since GET requests are supposed to have no side-effects. In that case it might be better to pass the data as request payload.

A: Use POST request instead of urls


text:
Q: .xcodeproj doesn't open in Xcode Until this evening everything was fine. But now Xcode doesn't open .xcodeproj files.
When I start Xcode then click File->Open and then click on .xcodeproj file, the open dialog is showing me .xcodeproj file's contents instead of opening the project. I found on the web that it may be due to an old version of Xcode but I am using 3.2.4.

A: What format is the volume on which the projects reside ? An Xcode project is actually a bundle, that is a directory containing a project.pbxproj file (this is the only important file) and some user-specific settings files (which are not important). Make sure the project.pbxproj file is present and has appropriate permissions. Also if this is a non HFS+ volumes then that may be part of the problem.

A: I got same error in my project finally i founded my answer. there total two option for  solve this issue.

*

*There is need one backup of your project. you can replace your .xcodeproj  with old file.

*you have to create new project and than  have to add  All old  project file   in new project.


text:
Q: Is my understanding of the concept on time dilation accurate? Warning, I have no background in Physics. I'm trying to understand time dilation in special relativity.
I have found quite similar questions here and here but I would like to elaborate more and frame it on how I understood the concept and rephrase my thoughts in multiple ways to be better understood.
When something travels at the speed of light in one direction it can no longer have velocity in any other direction, otherwise it would exceed the speed of light. Say if something travels north at the speed of light, it cannot have any velocity towards east or west without exceeding the speed of light.
Let's assume I'm traveling at the speed of light (and still human and alive) towards the direction I'm facing. That means I can no longer move left or right. The same goes for all the atoms that I am made of including subatomic particles. All of my atoms cannot move in any other direction rendering everything effectively "frozen". My metabolic processes would stop and so is my wrist watch. This would effectively stop my time as time is measure of change (locally) and there can't be any changes since all of my atoms have stopped moving in any other direction.
This is how I understood why time seemingly stops when you travel at the speed of light.
And if I am not travelling at the speed of light but close to it, I can move in other directions but would be very slow because there's only few "remaining" velocity left before exceeding speed of light. My biological processes and other changes would be slow therefore my time is also slow. Although my time has slowed down, I'll not be able to notice it because my perception has also slowed down along with my biological processes. But outside observers will be able to notice it.
Or to put it in another way, because subatomic particles already move close to speed of light, if I travel close to speed of light, that would leave almost no "remaining" velocity to subatomic particles that made my atoms that made me, again, rendering my biological processes to slow down. I presume this also affects any time measuring devices with me such as my wrist watch rendering it to slow down. If time is rate of change then we can safely say the local time has slowed down.
To rephrase it concisely, speed seems to cause "drag" against time because any speed reduces the rate of change in subatomic level locally including any time measuring devices.
That is how I understood time dilation in special relativity. Did I get the concept properly?
I refer to time as the rate of change locally and not universal.
UPDATE
To clarify further, is my understanding of the cause of time dilation correct? My question is not about measuring time dilation but how or why time runs slow relative to outsider as velocity increases.

A: You have not grasped the concept properly.
Here are some points you should try to build in to your thinking...
All speed is relative. That means you do not have a single absolute speed- you have any number of speeds. Relative to the chair you are sitting in, your speed is zero. Relative to a passing satellite your speed is a few kilometres per second. Relative to a certain high energy muon passing through the atmosphere, your speed is 0.9999c.
Since your speed is arbitrary, depending upon which frame of reference you decide to use to quantify it, the passage of time for you cannot be dependent on your speed. Your watch ticks and your heart beats at certain rates regardless of whether you consider yourself stationary in your chair or moving at 0.9999c creative to the muon.
You should not think of time dilation as meaning that time slows down.
Time dilation is an unfortunate term that is often misinterpreted. It refers to the fact that the temporal distance between two events is frame dependent. In your rest frame the gap between two successive beats of your heart might be one second. In the frame of the muon passing at 0.9999c, your heart beats about once per minute.
The effect has many analogies. Suppose you walk along your street at one pace per second, each of your paces being a metre long. In the frame of a person crossing your street at a metre per second (ie at right angles to the street) your speed is circa 1.41 metres per second, and each of your paces carries you 1.41 metres in that frame. By analogy we could call that 'pace dilation'- clearly it does not mean that your paces have changed, but just that their length depends upon the choice of reference frame in which they are measured.
If you want to understand time dilation properly, you should familiarise yourself with its cause, which is the relativity of simultaneity. That refers to the fact that a plane of constant time in one frame of reference is a sloping slice through time in any other frame moving relative to the first. The result is that clocks spread along a line in the first frame all show the same time at a given instant, but clocks in the other frame all show different times, the discrepancies increasing with distance from whatever point you pick as your origin. To see how this causes time dilation, imagine the following scenario...
You walk down a corridor at 1m/s. Every ten metres along the corridor is a person holding a clock. All the clocks tick at the same rate as your watch, but they are synchronised in such a way that every clock is set one second ahead of the previous one. If you start down the corridor at t=0 on the first clock, you will reach the next clock when your watch shows 10s, but the clock will show 11s as it has been set a second ahead. Likewise when you reach the next clock, your watch will show 20s while it will show 22s because it was set a second ahead of the previous clock. The next clock will show 33s while your watch will show 30s, and so on. It will seem, as you compare your watch with each passing clock, that your watch is running slowly when in fact  your watch and the clocks are all running at exactly the same rate. The effect of time dilation arises not because your watch is running slow but because you are moving through a frame in which a plane of constant time is tilted relative to your frame of constant time.
The effect is entirely symmetrical. Suppose in your walk down the corridor you were followed at ten metre intervals by friends whose watches were each set one second ahead of the friend passing before them. From the point of view of the person holding the first clock in the corridor, you pass them at t=0. Ten seconds later your first friend passes them with a watch showing 11s. Ten seconds after that your next friend follows with a watch showing 22s. Your third friend passes when their watch shows 33s but the person holding the clock sees on 30s reading on it. So, the person holding the clock thinks their time is dilated compared with your friends watches, while you think your time is dilated compared with the clocks, even though all the clocks and watches are ticking at exactly the same rate.

A: Well your understanding is not accurate at all, but kind of good. So let me edit your story so that it is more accurate:
When something travels at high speed in one direction it can no longer have almost any velocity in any other direction, otherwise it would exceed the speed of light.
Let's assume Bob is traveling at high speed (and still human and alive) towards the direction Bob is facing. That means Bob can no longer move left or right, except very slowly. The same goes for all the atoms that Bob is made of including subatomic particles. All of Bob's atoms cannot move in any other direction, except slowly, rendering everything effectively "frozen". Bob's metabolic processes would slow down and so would Bob's wrist watch.
Same story from Bob's point of view:
Stars are traveling at high speed (and still not broken) towards the opposite direction that Bob is facing. That means stars can no longer move left or right, except very slowly. The same goes for all the atoms that stars are made of including subatomic particles. All of stars' atoms cannot move in any other direction, except slowly, rendering everything effectively "frozen". Stars' fusion processes would slow down and so would stars' atomic clocks.
To rephrase it concisely, moving clocks tick slowly. Fast moving things do everything slowly, except for the fast motion.
(Somewhat interesting problem: Bob, who sees stars moving very fast to the opposite direction to which Bob is facing, fires a side rocket which pushes Bob to the sideways direction. Will Bob see stars gaining lot of sideways speed? Correct answer: Yes. )

A: Congratulations. You have managed to understand something. Now maybe that something is not the "time-dilation". Maybe it's "Einstein Light Clock". Or maybe it's "how things move" or "kinematics".
Now maybe "time dilation" and "how things move" are somehow related. They could be related by mechanical clocks, like for example the "Einstein light clock".
So maybe this is the solution to the problems that you are having with the "time dilation"?


text:
Q: oauthCard login opens empty window I have the following code:
import { ActivityTypes, CardFactory, TurnContext } from "botbuilder";

export class MyBot {
    /**
     * Handles incoming activity, received from a user, processes it, and replies as needed
     * @param {TurnContext} context on turn context object.
     */
    public onTurn = async (turnContext: TurnContext) => {
        const oauthCard = CardFactory.oauthCard("ms-graph", "Login", "Please sign in so I know who you are");
        return await turnContext.sendActivity({ attachments: [oauthCard] });
    }
}

When I run the bot in bot emulator framework, I see the login button. When I click on it however, it just opens an empty signin window that's all white.
I've also configured authentication in Azure:

Edit: I've also configured the app id and password in my .bot file.

A: There is an option to use Azure Service Bus in place of ngrok which may work for you. It functions much the same but gives you control over where your data is traveling when "tunneling", among other benefits. As it's an Azure service, it can live in the same subscription you already access.
In short, you'll create a local client application that connects your bot via a relay to the Azure Service Bus service. The service bus namespace/relay replaces the messaging endpoint in the bot settings in Azure (for testing). In this way your bot running on localhost can connect to external services. Just be sure to use the same endpoint in Emulator that you use in the Azure bot settings, including the "/api/messages".
The instructions found here can guide you thru the process of setting up and running. The steps are a little long looking but the process itself is fairly simple. There are two options to build: a .NET Framework and a .NET Core. I would recommend the "Framework" version unless you need to run this on a Mac. This isn't an official MS blog (yet) but expect it to show up there.
Hope of help!


text:
Q: Drop DB but don't delete *.mdf / *.ldf I am trying to automate a process of detaching and dropping a database (via a VBS objshell.run) If I manually use SSMS to detach and drop I can then copy to database files to another location... however if I use:
sqlcmd -U sa -P MyPassword -S (local) -Q "ALTER DATABASE MyDB set single_user With rollback IMMEDIATE"

then
sqlcmd -U sa -P MyPassword -S (local) -Q "DROP DATABASE MyDB"

It detaches/drops and then deletes the files. How do I get the detach and drop without the delete?

A: The MSDN Documentation on DROP DATABASE has this to say about dropping the database without deleting the files (under General Remarks):

Dropping a database deletes the database from an instance of SQL Server and deletes the physical disk files used by the database. If the database or any one of its files is offline when it is dropped, the disk files are not deleted. These files can be deleted manually by using Windows Explorer. To remove a database from the current server without deleting the files from the file system, use sp_detach_db.

So in order for you to drop the database without having the files get deleted with sqlcmd you can change it to do this:
sqlcmd -U sa -P MyPassword -S (local) -Q "EXEC sp_detach_db 'MyDB', 'true'"

DISCLAIMER: I have honestly never used sqlcmd before but assuming from the syntax of how it's used I believe this should help you with your problem.

A: Use SET OFFLINE instead of SET SINGLE_USER
ALTER DATABASE [DonaldTrump] SET OFFLINE WITH ROLLBACK IMMEDIATE; DROP DATABASE [DonaldTrump];

A: Might it be best to detach the database rather than drop it?
If you drop the database, that implies delete
Note, however, that this will leave your hard disk cluttered with database files you no longer want - in a couple of years time your successor will be running out of space and wondering why the disk is full of MDF files he doesn't recognise


text:
Q: Save adds return linebreaks to XML when elements are blank I'm loading a XML Document that has some tags that have no innertext.
If I populate the innertext with some data then it works as needed (you get opening tag, innertext and closing tag all on one line) like the following...
<element>value</element>

The problem arises with tags with no values. These SHOULD be displayed in the same way as above with the exception of no value of course, like the following:
<element></element>

However, when the innertext has an empty string it adds a carriage return & line feed which is not what is expected! It ends up looking like the following:
<element>
</element>

My code:
$input_dir  = "F:\uma\zz"
$output_dir = "F:\uma\zz"
[xml]$xdoc  = Get-Content "$input_dir\Subnet_Network_41.xml"
$inprange   = 5
foreach ($i in $inprange) {
    $xdoc.Subnet.Id   = "Network_$i"
    $xdoc.Subnet.Name = "Network_$i"
    $xdoc.Save("$output_dir\Subnet_Network_$i.xml")
}

A: I have fixed the issue myself.  I have used Select-xml  to read the xml file and it worked. It didnt add the return linebreaks while saving the xml document. below is the working code.
$input_dir  = "F:\uma\zz"
$output_dir = "F:\uma\zz"
$xdoc = ( Select-Xml -Path $input_dir\Subnet_Network_41.xml -XPath / ).Node
$inprange   = 5
foreach ($i in $inprange) {
    $xdoc.Subnet.Id   = "Network_$i"
    $xdoc.Subnet.Name = "Network_$i"
    $xdoc.Save("$output_dir\Subnet_Network_$i.xml")
}

To know more about Select-xml refer the below blog:     https://blog.stangroome.com/2014/02/10/powershell-select-xml-versus-get-content/


text:
Q: php http_referer I have this part of a program:
$refferer  = ( isset($_SERVER['HTTP_REFERER'])
&& ($_SERVER['HTTP_REFERER'] != ""))
? $_SERVER['HTTP_REFERER'] : "Unknown";

to get info on people visiting my site. But I would like to know if I can extract more information from the referer? For example if someone is connecting to my website through a facebook link I get the referer as http://www.facebook.com/l.php?u=http%3A%2F%2Fmypage.net%2Ftest.php&h=PAQHD6FDUAQGrvZ32aZTbU9b...
Is there a possibility to get the facebook user name as well ?

A: No, it isn't possible. If you want to access information from Facebook, you need to register your application on Facebook and use their OAuth 2.0 API.

A: No, you cannot extract user information from the referring URL. You may wish to consider using Facebook's Open Graph to collect user information.
With Open Graph, you can add social plugins to your site, create Facebook applications, and interact with your users via the Facebook API.

A: The referrer of l.php is specifically there to prevent sites from scraping private user data via analysis of the referrer headers. There should be no way around this.


text:
Q: How do I resolve the "no jacob-1.xx-x86" Unsatisfiable Link Error in Apache Tomcat? Tomcat keeps throwing an Unsatisfiable Link Error for Jacob, despite the fact that I have copied the Jacob jar into the libs directory for Tomcat. What am I missing?

A: The solution for this comes from this troubleshooting article and this related question:

*

*Navigate to the SourceForge project's files. Find the version of Jacob you're using. Download the zip file.

*Once downloaded, extract the *-x86.dll and *-x64.dll files into the bin directory for Tomcat.

*Restart Tomcat

*Navigate to the webapp/page that is throwing the error. It should now be resolved.


text:
Q: How can i install openssh on iOS siumlator? I've made some tweaks for iOS.
There are a lot of manuals on "how to install openssh to iphone, ipad". But, there is no one for ios siumulator.
I need to execute some executable files on command line.
So I have to connect to iOS simulator.
How can I install openssh on iOS siumlator?

A: You can't. What are you trying to do, and why can't it be done in Terminal?


text:
Q: Erro de lógica em Lista Ordenada (C++) Na disciplina de estrutura de dados, o professor nos deu um código cpp com uma lista ordenada e nos pediu para implementar os métodos de busca binária, busca sequencial e inserção, mas não estou conseguindo identificar porque o programa executa mas a saída não é a esperada (termina retornando 1).
Já tentei debugar, mas ainda não sou muito experiente nisso.
O código:
#include <iostream>

using namespace std;

class ListaOrdenada {
private:
    int * items;
    int tamanho, capacidade;
public:
    ListaOrdenada(int cap) {
        this->capacidade = cap;
        this->tamanho = 0;
        items = new int[cap];
    }

    ~ListaOrdenada() {
        delete [] items;
    }

    void insere(int key) {
        if (tamanho < capacidade) {
            int i = 0;
            while (key < items[i] and i <= tamanho) {
                i++;
            }
            int j = capacidade-1;
            for (; j > i; j--) {
                items[j] = items[j+1];
            }
            items[i] = key;
        }

    }

    int buscaSequencial(int key) {
        int i = 0;
        while (i <= tamanho) {
            if (items[i] == key) {
                return i;
            }
            i++;
        }
        return -1;
    }

    int buscaBinaria(int item) {
        return buscaBinaria(0, tamanho - 1, item);
    }

    int valida() {
        for (int i = 0; i < tamanho - 1; i++) {
            if (items[i] > items[i + 1]) return 0;
        }
        return 1;
    }

    void exibe() {
        for (int i = 0; i < tamanho; i++) {
            cout << i << ": " << items[i] << "; ";
        }
        cout << endl;
    }

private:

    int buscaBinaria(int inicio, int final, int item) {
        int meio = (inicio + final)/2;
        if (items[meio] == item) {
            return meio;
        }
        else if (items[meio] > item) {
            return buscaBinaria(inicio, meio, item);
        }
        else {
            return buscaBinaria(meio, final, item);
        }
    }

};

int main () {

    ListaOrdenada lista(10);

    int elementos [] = {10, 5, 25, 1, 5, 13, 50, 99, 33, 12};

    for (int i = 0; i < 10; i++) {
        lista.insere(elementos[i]);
    }

    cout << "Lista valida: " << (lista.valida()?"sim":"nao") << endl;
    lista.exibe();

    int teste [] = {5, 7, 16, 99, 45, 12, 33, 1, 60, 6};

    for (int i = 0; i < 10; i++) {
        cout << "Buscando " << teste[i] << ": sequencial = " << lista.buscaSequencial(teste[i]) << " binaria = " << lista.buscaBinaria(teste[i]) << endl;

    }

}

A: Tem vários erros no seu código. Arrumei a função insere e coloquei alguns comentários.
    void insere(int key) {
        if (tamanho < capacidade) {
            int i = 0;
            // primeiro tem que garantir que a posição é válida (i < tamanho)
            // se quiser a lista ordenada de forma crescente,
            //você deve inserir quando (key > items[i]) for falso
            while (i < tamanho and key > items[i]) {
                i++;
            } // i está na posição em que será feita a inserção ou no final da lista (i == tamanho)
            int j = tamanho; // j é o tamanho da lista
            for (; j >= i; j--) {
                items[j + 1] = items[j]; // desloca os elementos
            }
            items[i] = key;
            tamanho += 1; // Aumenta o tamanho da lista após inserir
        }

    }

Para debugar você pode colocar alguns prints no meio do código para verificar se o valor de uma variável está no valor que você espera que esteja. Por exemplo:
for (int i = 0; i < 10; i++) {
    lista.insere(elementos[i]);
    // Imprime a lista para ver se está inserindo corretamente
    lista.exibe();
}


text:
Q: Cannot install Carla on Ubuntu 18.04 This might appear as a really stupid question, but I can't figure it out myself.
I cannot install Carla on Ubuntu 18.04 LTS (64 bit). They offer 3 ways to install Carla, and none is working yet for me.

*

*Pressing Debian/Ubuntu on their downloadpage reports:

could not find carla-git.

BTW: kxstudio repo is installed.

*Precompiled binary reports an error after chmod +x Carla && chmod +x CarlaConfig :
$ ./Carla
Carla: loadlocale.c:130: _nl_intern_locale_data:
  Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)

*Building from source is installable. But when I try to open it, nothing appears.
I should maybe stick to one solution, but I'm really confused right now which path to take.
Edit 2:
I just did a new clean installation of the kxstudio repo. Here is my output of (extracted the relevant part)
sudo apt update

Hit:1 http://ppa.launchpad.net/kxstudio-debian/ubuntus/ubuntu bionic InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

then trying to install carla:
sudo apt install carla-git
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package carla-git

A: Try first:
sudo apt update

and then
sudo apt install carla-git

A: I have successfully installed Carla on Ubuntu 18.04.  Here's how to do it:

*

*go to http://kxstudio.linuxaudio.org/Repositories and install the kxstudio-repos.deb package.  You need KXStudio repository for Carla.

*NOW you can go to http://kxstudio.linuxaudio.org/Applications:Carla and click on the  Debian/Ubuntu (via KXStudio repositories) link to install Carla.

If you are trying to get Windows VST files to work in Ubuntu, I found this video helpful: https://www.youtube.com/watch?v=PiaWozQ69eE

A: I have run into issues with the kxstudio repository in the past, especially with the bundled version of Carla. Therefore I now download the latest version of the actual release files from their Github repository here:
https://github.com/falkTX/Carla/releases
I find that the latest release at the time I am writing this (Carla_2.0-RC2-linux64.tar.xz) is working very well on both standard Ubuntu 18.04, as well as Ubuntu Studio 18.04. Furthermore, I use it successfully to load Windows-based VST files with the standard version of Wine that comes with 18.04 (wine-3.0).
To prove my version of Ubuntu:
 $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"

And here is the output of "./Carla" if I start it on the commandline:
$ ./Carla
Carla self-contained executable 1.9.11 (2.0-RC1), based on UnZipSFX.
Launching: '/tmp/carla/carla'
LRDF Support disabled for static build (LADSPA-RDF will be disabled)
Carla 1.9.12 (2.0-RC2) started, status:
  Python version: 3.2.3
  Qt version:     4.8.7
  PyQt version:   4.9.1
  Binary dir:     /tmp/carla
  Resources dir:  /tmp/carla/resources
libjack.so.0 loaded sucessfully!
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jackdmp 1.9.12
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2017 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
no message buffer overruns
no message buffer overruns
no message buffer overruns
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:PCH|hw:PCH|512|2|44100|0|0|nomon|swmeter|-|32bit
configuring for 44100Hz, period = 512 frames (11.6 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback

I hope that this helps!


text:
Q: URL relative to server I have an ASP.NET button in my application, which I want to open another website on my server in a new window. Currently I do a Response.Redirect in my server side on click event (to "..\OtherWebsite") which works. But as it needs to be in a new window I need to do it in JavaScript.
Would '..\OtherWebsite' path work in the window.open JavaScript command? If not, what .NET methods/properties can I use to get the full path?
I can't hard code the website URL as some users will be accessing through a LAN (server name\application) and some through the website (www.website.com/application)

A: You can use self.location.href to get the currect url of the page, next form your new url relative to that and then pass it to window.open() method.
Here is the definition of window.open method.
Hope this helps...

A: You can do this by executing the javascript from the codebehind.
public void OpenNewWindow(string url)
{

   ClientScript.RegisterStartupScript(this.GetType(), "newWindow", String.Format("<script>window.open('{0}');</script>", url));
}

http://forums.asp.net/t/1001747.aspx/1
First result from searching for "open new window from codebehind c# .net"
Then just pass the relative url like so.
String url = "~/page.aspx";
url = Page.ResolveClientUrl(url);
OpenNewWindow(url);

also a reference here: Response.Redirect to new window
Hope this helps.


text:
Q: jQuery Accordion Menu - Keep menu open when sub item is selected I would like to keep my menu open when I am on a page in the sub navigation. This way it will allow the user to tell much more easily where they are on the site. How can I accomplish this with the code I have? Thanks for any feedback.
jQuery:
$('#cssmenu > ul > li > a').click(function() {

  var checkElement = $(this).next();

  $('#cssmenu li').removeClass('active');
  $(this).closest('li').addClass('active');

  if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
    $(this).closest('li').removeClass('active');
    checkElement.slideUp('normal', function() {
        menuHeight();
    });
  }
  if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
    $('#cssmenu ul ul:visible').slideUp('normal', function() {
        menuHeight();
    });
    checkElement.slideDown('normal', function() {
        menuHeight();
    });
  }

  if($(this).closest('li').find('ul').children().length == 0) {
    return true;
  } else {
    return false;
  }

});

HTML (sample):

Home

Landscaping

Planters

Walls

Stone Work

Walkways

Stairways

Steps

Water Falls

Ponds

Creek Beds

Pondless Water Features

Enhancement Lighting

Patios

Fireplaces


text:
Q: IPv6 routing between Host and Guest I am currently facing an issue about my current setup.
I basically have a dedicated server to which a /64 IPv6 subnet have been assigned (2a01:4f8:221:1e81::/64). Connectivity on the host is working fine, as I can ping from there ipv6.google.com.
Also, this is the configuration:
root@void ~ # ifconfig vmbr0
vmbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.250.0.1  netmask 255.255.0.0  broadcast 10.250.255.255
        inet6 2a01:4f8:221:1e81:1:ffff:ffff:ffff  prefixlen 80  scopeid 0x0<global>
        inet6 2a01:4f8:221:1e81:212:ffff:ffff:ffff  prefixlen 80  scopeid 0x0<global>
        inet6 2a01:4f8:221:1e81:253:ffff:ffff:ffff  prefixlen 80  scopeid 0x0<global>
        inet6 2a01:4f8:221:1e81:251:ffff:ffff:ffff  prefixlen 80  scopeid 0x0<global>
        inet6 fe80::70a5:a1ff:fed6:8c0  prefixlen 64  scopeid 0x20<link>
        ether 4a:5a:df:ab:a8:bc  txqueuelen 1000  (Ethernet)
        RX packets 949686094  bytes 162428268530 (151.2 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 285868499  bytes 143826674082 (133.9 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@void ~ #

Routing table:
root@void ~ # ip -6 route show
2a01:4f8:221:1e81:1::/80 dev vmbr0 proto kernel metric 256 pref medium
2a01:4f8:221:1e81:212::/80 dev vmbr0 proto kernel metric 256 pref medium
2a01:4f8:221:1e81:251::/80 dev vmbr0 proto kernel metric 256 pref medium
2a01:4f8:221:1e81:253::/80 dev vmbr0 proto kernel metric 256 pref medium
2a01:4f8:221:1e81::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev vmbr0 proto kernel metric 256 pref medium
default via fe80::1 dev eth0 metric 1024 pref medium
root@void ~ #

Problem comes once I ssh into a virtual machine and configure the network.
In this example, I have the following configuration:
hypnotize@irc:~$ cat /etc/network/interfaces | tail -n4
iface eth0 inet6 static
    address 2a01:4f8:101:3172:251::3
    netmask 80
    gateway 2a01:4f8:101.3172:251:ffff:ffff:ffff
hypnotize@irc:~$

So, ifconfig looks like:
hypnotize@irc:~$ sudo ifconfig
[sudo] password for hypnotize:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.250.3.6  netmask 255.255.0.0  broadcast 10.250.255.255
        inet6 fe80::9474:f1ff:fe6f:4bc3  prefixlen 64  scopeid 0x20<link>
        inet6 2a01:4f8:101:3172:251::3  prefixlen 80  scopeid 0x0<global>
        ether 96:74:f1:6f:4b:c3  txqueuelen 1000  (Ethernet)
        RX packets 177  bytes 16270 (15.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 161  bytes 18477 (18.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

hypnotize@irc:~$

While routing table appears:
hypnotize@irc:~$ ip -6 route show
2a01:4f8:101:3172:251::/80 dev eth0 proto kernel metric 256
fe80::/64 dev eth0 proto kernel metric 256
hypnotize@irc:~$

Unfortunately, when I try to ping6 it says "connect: Network is unreachable".
I have net.ipv6.conf.all.forwarding enabled.
Do you see any error in my configuration?
Thanks in advance

I have corrected the typo, and now it says:
root@irc:/home/hypnotize# ping6 ipv6.google.com
PING ipv6.google.com(fra16s20-in-x0e.1e100.net (2a00:1450:4001:821::200e)) 56 data bytes
From 2a01:4f8:101:3172:251::3 (2a01:4f8:101:3172:251::3) icmp_seq=1 Destination unreachable: Address unreachable
From 2a01:4f8:101:3172:251::3 (2a01:4f8:101:3172:251::3) icmp_seq=2 Destination unreachable: Address unreachable
From 2a01:4f8:101:3172:251::3 (2a01:4f8:101:3172:251::3) icmp_seq=3 Destination unreachable: Address unreachable
^C
--- ipv6.google.com ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4032ms

root@irc:/home/hypnotize#

Also, the routing table, now looks better, at least it has a default entry:
root@irc:/home/hypnotize# ip -6 route show
2a01:4f8:101:3172:251::/80 dev eth0 proto kernel metric 256
fe80::/64 dev eth0 proto kernel metric 256
default via 2a01:4f8:101:3172:251:ffff:ffff:ffff dev eth0 metric 1024
root@irc:/home/hypnotize#

A: Like many enterprises, Hetzner runs switch port security on its network switches, meaning that only authorized MAC addresses can talk to the network. This means that the hardware address of the NIC in your server can speak, but the virtual MAC addresses of your virtual machines cannot. Thus it does not work to bridge your VMs directly to the outside world. (If you have ordered extra IPv4 addresses, then Hetzner will allow you to generate virtual MAC addresses for each of them that you can assign to your VMs, which will let this setup work, but if you haven't got extra IPv4 addresses or don't want to buy them, then you cannot do.)
I have a KVM virtual machine host on Hetzner, where the VMs are mostly reachable only by IPv6, and this is how I set it up.
Instead of bridging directly to the host NIC, I create virtual networks for each /80, and assign VMs to those virtual networks. The host will then route between the host NIC and the virtual networks, which are not bridged (layer 2) but routed (layer 3).
So the host is configured as:
IPV6ADDR="2a01:4f8:150:43ea::2/64"
IPV6_DEFAULTGW="fe80::1"

The libvirt virtual networks are configured as /80 networks. Virt-manager cannot handle creating /80 networks, so you will need to write the XML yourself. Here is an example:
<network>
  <name>v6net1</name>
  <forward mode='route'/>
  <bridge name='v6net1' stp='on' delay='0'/>
  <domain name='v6net1'/>
  <ip address='192.168.101.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.101.128' end='192.168.101.254'/>
    </dhcp>
  </ip>
  <ip family='ipv6' address='2a01:4f8:150:43ea:1::1' prefix='80'>
    <dhcp>
      <range start='2a01:4f8:150:43ea:1::1000' end='2a01:4f8:150:43ea:1::ffff'/>
    </dhcp>
  </ip>
</network>

Now, all virtual machines' NICs are added to the v6net1 network, and get an address in this /80 from DHCPv6. You could assign them manually if you wanted though. This creates a bridge v6net1, but the host NIC is not part of the bridge. Thus traffic is routed between the VMs and the outside world, and when leaving the host the traffic has the host's MAC address.
This doesn't cover global IPv4 connectivity, e.g. masquerading or port forwarding. I handle this separately in firewalld, outside of libvirt, and do not use libvirt's NAT functionality. If you just want a simple NAT so VMs can connect out to IPv4 hosts, and don't need incoming traffic, use <forward mode='nat'> instead. You could also omit IPv4 setup entirely, for pure IPv6-only VMs.


text:
Q: Need a advise regarding why to use SMTP? I made a contact form on my website and need to submit it to my proton mail using Node.JS and express.
Do I need an SMTP server? Can I do it without SMTP or not? Because it'll be very focused and not that big. It'll only send forms to my email.

A:
The Simple Mail Transfer Protocol (SMTP) is an internet standard
communication protocol for electronic mail transmission. Mail servers
and other message transfer agents use SMTP to send and receive mail
messages.

SMTP is a mail transport system and yes, is required to send email.
You can either set up a send-only mail server (e.g Postfix Mailserver), or use the general purpose sendmail if you are just sending email to yourself.
You can also use your own email/password with nodejs, if you use gmail/yahoo etc, as long as you get your settings right.


text:
Q: PMS Integration with Oracle Hospitality Cruise OHC Universal v20.2.1 from a PBX system I am looking to integrate a PBX Systems (FortiVoice) with Oracle Hospitality Cruise Shipboard Property Management System (PMS) Release 20.2 - https://docs.oracle.com/cd/F44421_01/index.htm
via its proprietary Fidelio Cruise Universal Interface (FCUI), however, I have been unable to find the lasted documentation or even tools to develop and test this integration.
Questions /  The Request

*

*Does anyone have experience with this type of system and communication in the past or with other systems (does not have to be PBX)

*if so we are looking to accomplish the following

A. What/How is required to Inquire from Oracle Hospitality Cruise Shipboard PMS Guest Names based on an extension/room number?
B. What/How can the PBX charge for phone calls. Oracle Hospitality Cruise Shipboard PMS based on an extension/room number
References
Oracle Hospitality Cruise Shipboard Property Management System
Release 20.2 - https://docs.oracle.com/cd/F44421_01/index.htm
Thanks in advance for the help and guidance.


text:
Q: Making a list from equations I want to make a list (efficiently) which is the set of lattice solutions of the following equations (depends on $k$):
$x_0\geq 0$ and $x_i\in [0,4k]$ for $i=1,\ldots,4$ satisfies
$x_0+x_3\leq k+3$, $x_0+x_2+x_3\leq 2k+7$, $x_0+x_1+x_2+x_3\leq 3k+11$, $x_0\leq 15$, $x_1+x_2+x_3+x_4=4k$.
How can I do that?
EDIT: For example, by doing the following I can make a list of (easy) lattice equations:
$x,y\in[1,5]$, $x+y\leq 5$.
Flatten[Table[{i, j}, {i, 1, 5}, {j, 1, 5 - i}], 1]

But I want to make this using if sentence.

A: Maybe something like :
eqs = {x0 + x3 <= k + 3, x0 + x2 + x3 <= 2 k + 7, x0 + x1 + x2 + x3 <= 3 k + 11,
       x0 <= 15, x1 + x2 + x3 + x4 == 4 k};
vars = {x0, x1, x2, x3, x4, x5};
const = 1 <= # <= 5 & /@ vars;

sol=Solve[Join[eqs /. k -> 1, const], vars, Integers];

As suggested by @amr, the values can be obtained with sol[[All,All,2]].


text:
Q: ¿Como puedo capturar mi IP con javascript? Tengo una aplicación de manera local y ya que no tengo dominio necesito saber la IP del servidor desde javascript, mi aplicación comparte archivos por link y el link empieza por https://192..../link.php
Necesitaria saber la ip local del servidor mediante javascript

A: Echa un vistazo a esta pagina

$.getJSON('//freegeoip.net/json/?callback=?', function(info) {
  console.log(info);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

Desde esta pagina puedes consultar direcciones

A: Ignoro lo que estás haciendo, pero no suena muy buena idea querer capturar la IP para ir a rescatar algo desde el servidor. Deberías seguir usando el nombre de dominio que pretendes usar. En caso de que no tengas un dominio todavía, podrías forzar a que tu sistema operativo resuelva el dominio que necesites.
Para eso tienes que editar el archivo hosts. Ahí debes agregar el nombre del dominio y la IP que resuelve:

192.168.0.1 midominio.com

En linux está en /etc/hosts y en windows C:\Windows\System32\drivers\etc\
Para ambos casos necesitas permiso de roott/administrador respectivamente.
Ten en cuenta que esta solución solo funcionará en TU computador. Si quieres compartir el cambio con alguien más en tu red, debes indicarle que haga la misma configuración que tu.


text:
Q: Sharing settings between a few virtual hosts in Apache There are many virtual hosts in my apache configuration, each having quite a big amount of settings. The problem is that most of the virtual servers have the same settings. So config file is huge, full of identical virtual hosts, that differ only by ServerName directive. To change or add setting, I need to go through all of these vhosts.
Is it possible to somehow share settings between virtual hosts, but still having few of them with their own ones?
I hoped dynamic vhosts would be a good solution, but as I understand, it doesn't fit my problem, because there is no way to set specific settings for some of the vhosts. Furthermore I don't want my vhosts to be dynamic, because I have a fixed number of them.
ServerAlias directive is also not a solution, because I need to know what url the user came from.

A: I have a similar situation to you and my solution was to write a (Perl) script that generates the vhost configs for me.
I have a configuration file which lists the few settings that are different per server (like ServerName, SSL certificate, etc) and then the Perl script combines the unique settings with generic ones and writes out many conf files in /etc/httpd/conf.d.
Then I include them all with something like this in the main config:
Include conf.d/*.conf

Every time I add a new vhost, I just add the data to the Perl script config file, run the script, then reload Apache.


text:
Q: SSL Tomcat Configuration I am using tomcat 5.5 and configured keystore and added this connector inside server.xml file
<Connector port="443" minProcessors="5" maxProcessors="75"
       enableLookups="true" disableUploadTimeout="true"
       acceptCount="100" debug="0" scheme="https" secure="true";
       clientAuth="false" sslProtocol="TLS"/>

But I am not sure why when I type in https://locahost the browser tells me "This program cannot display the webpage".

A: Did you check Tomcat's logs?

*

*Perhaps the connector could not start up.

*Perhaps Tomcat could not read or find the .keystore you configured.

*Perhaps the .keystore has a password which Tomcat does not know about.

*Perhaps another process is already bound to that port.

The logs will probably tell you exactly which of these is going on.

A: Possibly you have your browser configured to use a web proxy. In this case, make sure that localhost and 127.0.0.1 are exceptions to using this proxy under the browser's preferences or options. ALSO make sure that localhost is mapped to 127.0.0.1 in your /etc/hosts file. Which in windows is under \WINDOWS\system32\drivers\etc\hosts.

A: Try to add the port
localhost :443


text:
Q: Relating two definitions of the measure of a solid angle In a computer graphics text I am reading, they give the following definitions:
A solid angle $\Omega$ at a point $p \in \mathbb{R}^3$ is a measurable subset of the unit sphere about $P$, and the measure of $\Omega$ is the area of  $\Omega$.
If $T$ is a shape in $\mathbb{R}^3$, and $p$ is a point not in $T$, then the solid angle subtended by $T$ at $p$ is the area of the radial projection of $T$ onto a unit sphere centered at $p$. The author then states if $U$ is a subset of a sphere of radius $r$ about $P$ of area $A$, then according to this definition one can show that the solid angle represented by $U$ is $\frac {A}{r^2}$.
Suppose we have such a $U$ of area $A$, then if I project this set onto the unit sphere centered at $p$, as opposed to the sphere of radius $r$, how do you get that the area scales in $\frac {1} {r^2}$? This scaling is given as the definition in some cases of a solid angle (i.e. the definition of the solid angle is not put in terms strictly of measurable sets on a unit sphere, but rather a sphere of arbitrary radius).
For instance, if we project a sphere of radius $R$ onto the unit sphere, we will get an area of $\frac{4 \pi R^2} { R^2} = 4 \pi$ , but I'm not sure why this is true for a general measurable subset of the sphere of radius $R$.


text:
Q: Swift local vs global scope arrays That the Swift beta isn't a winner in the area of array performance has been pointed out over and over again in this forum.
But did anyone notice that Swift is completely lost when it comes to handling global declared arrays?
Take a look at the code snippet underneath. The repsonse times I measured are downright desastrous. I can't possible think of a scenario that causes this ridiculous results and makes my Macbook 2014 processor run at full speed.
Am I missing something or is there some explanation? Please reasure me.
let maxElements = 1000000;
.
.
.
func printElapsedTime(startTime: NSDate, message: String) {
  let endTime = NSDate();
  println(message + ": " + NSString(format:"%.6f", endTime.timeIntervalSinceDate(startTime)) + " sec");
}

func benchMark1() {
  var localArray = Array(count:maxElements, repeatedValue:String());

  let someString = "Percy Jackson - The Titan's Curse";
  var anotherString: String;

  var startTime = NSDate();
  for i in 0..<maxElements {
    localArray[i] = someString;
  }
  printElapsedTime(startTime, message: "Elapsed time for creating and altering a local array");

  startTime = NSDate();
  for i in 10..<20 {
    anotherString = localArray[i];
  }
  printElapsedTime(startTime, message: "Elapsed time accessing 10 elements of the local array");
}
// Elapsed time for creating and altering a local array: 2.637573 sec
// Elapsed time for read accessing 10 elements of the local array: 0.000039 sec

func benchMark2() {

  var localArray = Array(count:maxElements, repeatedValue:String());
  let someString = "Percy Jackson - The Titan's Curse";
  var anotherString: String;

  var startTime = NSDate();
  for i in 0..<maxElements {
    localArray[i] = someString;
  }
  self.globalArray = localArray;
  printElapsedTime(startTime, message: "Elapsed time for creating/altering a local array and copy it into a global array");

  startTime = NSDate();
  for i in 10..<20 {
    anotherString = globalArray[i];
  }
  printElapsedTime(startTime, message: "Elapsed time accessing 10 elements of the global array");
}
// Elapsed time for creating/altering a local array and copy it into a global array: 9.570817 sec
// Elapsed time read accessing 10 elements of the global array: 143.937524 sec !!!!


text:
Q: The import retrofit2.converter cannot be resolved I am unable to resolve error - The import retrofit2.converter cannot be resolved
I am using Eclipse Mars and added following JAR files as External JAR's
retrofit-2.1.0.jar
moshi-1.2.0.jar
it resolves "import retrofit2.Retrofit;" .. but unable to resolve "import retrofit2.converter.moshi.MoshiConverterFactory;"
I am not using Maven .. but just adding JAR files .. any idea?
Thank you,
Jagdish

A: Added following dependency to pom.xml .. helped to resolved the issue.
<dependency>
    <groupId>com.squareup.retrofit2</groupId>
    <artifactId>retrofit</artifactId>
    <version>2.1.0</version>
</dependency>


text: Q: How does staging a file modify the index file internally? git index(.git/index) stores the state of tracked files (last committed state) and it can be shown via git ls-files --stage and git diff looks at the difference between index and working directory.  How does the use of git add to stage files modify index file internally?


text:
Q: Overlapping Images from Array - Javascript I am trying to make a planner that allows you to select a wallpaper by season. Currently I'm working on fall and if you click on fall, you can see all of the alerts are different (each url from my array is shown). But, when those alerts go away, I see only one wallpaper. I want all of the wallpapers to show up when fall is clicked on not just one (so user can see all options). I want them to be in a grid view (similar to a photo gallery on iPhones but have the images a little spread out). I'm confused on what I'm doing wrong because the alerts show all url's so I'm not sure if they images are over top of each other. I tried adding margin but that didn't work either.
Here is my code:

  <link href="https://fonts.googleapis.com/css2?family=Marvel&display=swap" rel="stylesheet">

  PLANNER

    <button id="fall" onclick="seasonFall()">FALL</button>
    <button id="spring" onclick="seasonSpring()">SPRING</button>
    <button id="summer" onclick="seasonSummer()">SUMMER</button>
    <button id="winter" onclick="seasonWinter()">WINTER</button>
    <button id="lock" onclick="defaultButton()">DEFAULT WALLPAPER</button>

I found similar questions but they used other languages:

*

*Load images in grid view from Url (Java)

*get image url from array (Php)

A: The problem is that you are overwriting the background image of the document body in every iteration in the method seasonFall.
Please, try something like this:

  <link href="https://fonts.googleapis.com/css2?family=Marvel&display=swap" rel="stylesheet">

  PLANNER

    <button id="fall" onclick="seasonFall()">FALL</button>
    <button id="spring" onclick="seasonSpring()">SPRING</button>
    <button id="summer" onclick="seasonSummer()">SUMMER</button>
    <button id="winter" onclick="seasonWinter()">WINTER</button>
    <button id="lock" onclick="defaultButton()">DEFAULT WALLPAPER</button>

The idea is create a series of div elements and set the background properties of them.
You can organize these divs in a grid with the number of columns and rows that you consider appropriate, for instance, just including further loops in the seasonFall method and adjusting the margin and position of them.


text:
Q: Look up value in linked table beforeinserting corresponding value I am over simplifying what can only really be called an annoyance, that I am wondering if there is an answer for.
The following is just an example
Say I have tbl_user with field day that is in a relationship with another table called tbl_dayOfWeek.
tbl_user.day takes a number that corresponds to the ID of tbl_dayOfWeek, where every tbl_dayOfWeek.ID is connected to a day of the week like tbl_dayOfWeek.weekday.
Now every time I want to insert a record into tbl_user, the data that I have is the day of the week as a String - for instance "Monday". So before I can enter the record I must first make a select query every time to find the ID number that corresponds to the string day value that I have, in the tbl_dayOfWeek table.
My question is, is there a way to write the insert query where it looks up the corresponding day number when you give it the day string value, instead of me having to make two database calls to get the number of the string first, so that I can enter the number?
Something like: "INSERT INTO tbl_user (day) VALUES (tbl.dayOfWeek.ID) WHERE 'dayStringName' = tbl.dayOfWeek.weekday

A: Something like this:
INSERT INTO tbl_user(day) VALUES((SELECT ID FROM tbl_dayOfWeek WHERE weekday = 'dayStringName'))


text:
Q: Whitespaces in ios PWA title I have a PWA with 2 word title like "super app".
my manifest:
{
  "name": "super app",
  "short_name": "super app",
...

my index.html:
<meta name="apple-mobile-web-app-title" content="super app" />

But when i install it on iphone, app icon on the home screen has title "superapp", without whitespace.

A: I think the problem is probably happening because:

*

*The name is being cached. Are you running on the localhost or this
is your built version of the app? Consider cleaning Safari's cache
on your iPhone from settings -> Safari -> Clear History and Website Data and try again. It's funny how Safari keeps a cached
version of your app even in incognito mode as I was bothered with
this for some hours!

*Try removing npm cache using npm cache clean --force and then run npm install (or npm update if you want your
packages to their latest version) again.

Finally, I recommend running your app on the localhost then launching your app from your iPhone on the same network. Then you can test it faster using hot reload. I am currently developing a PWA with React and I've just tested mine and it appears fine as "super app". Also this could really help.


text:
Q: setup actionbar sherlock in android studio 0.4.2 I am developing an android project by using actionbrsherlock library. after adding the actionbarsherlock library in android studio , my directory structure is
MYAPPLICATION
    - app
    - gradle
    - libraries
           - actionbarsherlock  (library project)
      build.gradle
      setting.gradle
build.gradle
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
        compile project(":libraries:actionbarsherlock")
        }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

setting.build

include ':app'
  include ':libraries:actionbarsherlock'

after running following error occured,

A problem occurred evaluating root project 'MyApplication'. > No
  signature of method:
  org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.compile()
  is applicable for argument types:
  (org.gradle.api.internal.project.DefaultProject_Decorated) values:
  [project ':libraries:actionbarsherlock']   Possible solutions:
  module(java.lang.Object)

UPDATE:
I upgraded my android studio to 0.4.4. and change the build.gradle file. one can find the whole setup on github https://github.com/manishpathak99/AndroidStudio.

A: First I will strongly recommend you to upgrade your studio to version 0.4.3 because there were some dependencies related issues in 0.4.2 release .
Answer :
You are adding module dependencies at wrong place in build.gradle file . Your module's build.gradle file should look like this :
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.7.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.0"

    defaultConfig {
        minSdkVersion 10
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }

        debug {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    // Your all module dependencies should be defined here
    compile project(":libraries:actionbarsherlock")

}

Recommended Solution :
ActionbarSherlock library has its maven dependency, In such cases no need to download the whole library and add it as as module in your project, instead add the maven gradle dependency in your module's build.gradle file like
dependencies {
       compile 'com.actionbarsherlock:actionbarsherlock-i18n:4.4.0@aar'
}

That's it.


text:
Q: how to pass a filename as function parameter in python? I've got a problem to solve that says . Write a function in python that will take a file name fname and a string s as input. It will return whether s occurs inside the file. It's possible that the file is extremely large so it cannot be read into memory in one shot
and I've done a solution for that like this
import fileinput
def FileAndString(s,filename):

    inname =input(filename)
    s =s
    fname= open(fileinput.input(files ='inname'))
    flag = 0
    index = 0
    for line in fname:
        index += 1
        if s in line:
            flag = 1
            break
    if flag == 0:
        print("string", s, "not found")
    else:
        print('String', s, 'Found In Line', index)
FileAndString('goal','fname.txt')

and I'm getting an error like this
  traceback (most recent call last):
  File "c:/Users/hp/Desktop/test/repo/file.py", line 19, in <module>
  File "c:/Users/hp/Desktop/test/repo/file.py", line 10, in FileAndString
    index += 1
  File "C:\Users\hp\AppData\Local\Programs\Python\Python38\lib\fileinput.py", line 248, in __next__
    line = self._readline()
  File "C:\Users\hp\AppData\Local\Programs\Python\Python38\lib\fileinput.py", line 366, in _readline
    self._file = open(self._filename, self._mode)
FileNotFoundError: [Errno 2] No such file or directory: 'inname'

and my question is:
is this the right way to do it?
how to pass that fname.txt or any file as a parameter

A: As others has already answered, the problem you're having with your code is that you're not opening the file you're giving the function. You're trying to open a string-representation of the variable, not the actual variable.
Here is the solution you're after:
def string_in_file(fname, s):
    # Use a context-manager to automatically
    # handle closing of files after you're done.
    with open(fname, "r") as F:
        # Read one line at a time, keeping only
        # that one line in memory.
        for line in F.readlines():
            if s in line:
                return True
        # If none of the lines in the for-loop
        # are True, then the string is not in the file.
        return False

Or if you want a single-line solution (which doesn't work the same way, but gives similar results):
string_in_file = lambda fname, s: any(s in line for line in open(fname))

A: In this line:
fname= open(fileinput.input(files ='inname'))

You've specified 'inname' as a string and not as a variable. Remove the quotes and it will resolve your current error.

A: Change this line:
fname= open(fileinput.input(files ='inname'))
To:
fname= open(fileinput.input(files = inname))
You are passing inname as a string. That is why the system can't find any directory. Simply unquote your variable and that should do it.