text:
Q: Making SQL entries appear only after current date - for a 'local events' page I've been making an events page for a community website I'm creating. It allows them to create new SQL entries for new events.
What I want is to only display dates ahead of the current date
Currently I have:
SELECT * FROM eventsDB ORDER BY eventdate ASC LIMIT 30";

But I suppose I have to add something like:
WHERE eventdate > NOW()

For the record the above doesnt work ↑
note: ($eventdate = date of event)
CRONTAB:
    <?php
class simpleCMS {

  var $host;
  var $username;
  var $password;
  var $table;

  public function display_public() {
    $q = "SELECT *
          FROM eventsDB
          WHERE eventdate > UNIX_TIMESTAMP()
          ORDER BY eventdate ASC
          LIMIT 30";
    $r = mysql_query($q);

    if ( $r !== false && mysql_num_rows($r) > 0 ) {
      while ( $a = mysql_fetch_assoc($r) ) {
        $title = stripslashes($a['title']);
        $author = stripslashes($a['author']);
        $bodytext = stripslashes($a['bodytext']);
        $eventdate = stripslashes($a['eventdate']);
        $created = stripslashes($a['created']);

        $entry_display .= <<<ENTRY_DISPLAY

      $title
    $eventdate

    $bodytext by $author

ENTRY_DISPLAY;
      }
    } else {
      $entry_display = <<<ENTRY_DISPLAY

 Your brand new Events Page!

      No entries have been made yet.
      Follow my instructions to make a new event!

ENTRY_DISPLAY;
    }
    $entry_display .= <<<ADMIN_OPTION

ADMIN_OPTION;

    return $entry_display;
  }

  public function display_admin() {
    return <<<ADMIN_FORM

    <form action="{$_SERVER['PHP_SELF']}" method="post">

      Title:

      <input name="title" id="title" type="text" maxlength="150" />

      Body Text:

      <textarea name="bodytext" id="bodytext"></textarea>

      Author:

      <input name="author" id="author" type="text" maxlength="100" />

      Date (DD/MM/YY):

      <input name="eventdate" id="eventdate" type="text" maxlength="100" />

      <input type="submit" value="Create This Event!" />
    </form>

    Back to Events

ADMIN_FORM;
  }

  public function write($p) {
    if ( $_POST['title'] )
      $title = mysql_real_escape_string($_POST['title']);
    if ( $_POST['bodytext'])
      $bodytext = mysql_real_escape_string($_POST['bodytext']);
    if ( $_POST['author'])
      $author = mysql_real_escape_string($_POST['author']);
    if ( $_POST['eventdate'])
      $eventdate = mysql_real_escape_string($_POST['eventdate']);
    if ( $title && $bodytext && $author ) {
      $created = time();
      $sql = "INSERT INTO eventsDB VALUES('$title','$bodytext','$created','$author','$eventdate')";
      return mysql_query($sql);
    } else {
      return false;
    }
  }

  public function connect() {
    mysql_connect($this->host,$this->username,$this->password) or die("Could not connect. " . mysql_error());
    mysql_select_db($this->table) or die("Could not select database. " . mysql_error());

    return $this->buildDB();
  }

  private function buildDB() {
    $sql = <<<MySQL_QUERY
CREATE TABLE IF NOT EXISTS eventsDB (
title       VARCHAR(150),
bodytext    TEXT,
created     VARCHAR(100),
author      VARCHAR(100),
eventdate   VARCHAR(100),
)
MySQL_QUERY;

    return mysql_query($sql);
  }
}
?>

A: The database is used or storing data.
PHP (or whatever you chose to use) is used for interacting with the user.
If you want to store a date, you should use a date datatype.
How you want to display the date, is up to your PHP code.
Probably you want to show the date in different formats depending on the visitor, or possible in ISO format so all of the world can read it: YYYY-MM-DD
So, your query is pretty much correct:
SELECT *
FROM eventsDB
WHERE  eventdate > NOW()
ORDER BY eventdate ASC
LIMIT 30

Note that using 'SELECT *' is not recommended for production code. Only select the columns you need - it can mean better use of indices and less data transferred between your database and application server.

A: You can store eventdate field as UNIX timestamp and then compare it easily in your queries.
SELECT ... WHERE `eventdate` > NOW() ...

and you can format it with php date function :
date('DD/MM/YY', $eventdate);

here is the manual : PHP Date Function

A: Based on our little discussion above, it seems like the easiest thing to do is make your eventdate field an INT data type.  That way, when you take the user input as a string ("15/03/2011" for example), you can run that input through the PHP function strtotime() and get a UNIX timestamp from that.
<?php

$eventts = strtotime($_POST["eventdate"]);
$q = "UPDATE eventsDB SET eventdate = ".$eventts." WHERE keyfield = whatever";
$r = mysql_query($q);

?>

Note that strtotime() returns an INT (or boolean FALSE) so we're not setting you up for a SQL injection attack above.  To query the database, you could then do this:
<?php

$q = "SELECT *
      FROM eventsDB
      WHERE eventdate > UNIX_TIMESTAMP()
      ORDER BY eventdate ASC
      LIMIT 30";
$r = mysql_query($q);

?>

To answer your question in the comments to this answer:
if ( $_POST['eventdate'])
  $eventdate = mysql_real_escape_string($_POST['eventdate']);

Would be replaced with
if ( $_POST['eventdate'])
  $eventdate = strtotime($_POST['eventdate']);

Note that for a production system, I really wouldn't recommend putting the admin code in the same page as the display code, and you should use the isset() function to check whether a $_POST array variable has been set (lest you cause all sorts of warnings or notices in your web server logs).

To display the date, you'd use the PHP date() function, specifically:
$entry_display = date("d/m/Y", $eventdate);

Where $eventdate is the UNIX timestamp you retrieved from the database.


text:
Q: Uncaught (in promise) Error at o (shallowEqual.js:18) I am getting problem in web smooch widget.
Here is complete question posted in git repo.
https://github.com/alavers/smooch-bot-example/issues/40

A: The version of Web Messenger you are using was deprecated in Summer 2017 is no longer supported. You'll need to update to a version > 4.0.0 in order to keep using your integration. Installation instructions can be found in the documentation. See the v4.0.0 release notes for notable changes when switching from the 3.x version series.
Note also that the GitHub repository you linked is not an official Smooch repository and is not actively monitored for support requests.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How do I loop through an Excel Pivot Slicer for each member of the slicer while saving the results of a sheet on another sheet? I am trying to loop through 1 slicer for all the items I want to capture a value from one cell and paste it on another sheet (while also capturing the slicer item name). Please help, I know I need a loop but can't get anything to work
Sub CtryFilter2()
Dim sC As slicerCache
Dim sI As slicerItem
Dim sIDummy As slicerItem
Dim i As Long
Dim l As Long

'application.ScreenUpdating=false

'Assign slicer to variable
Set sC = ActiveWorkbook.SlicerCaches("Slicer_CTRY_DESC")

'Initiate loop through each country in the slicer
sC.PivotTables(1).ManualUpdate = True
'sC.ClearManualFilter

With sC
For i = 1 To sC.SlicerCacheLevels.Count

    For Each sI In sC.SlicerCacheLevels(i).SlicerItems

    If i = 1 Then Sheets.Add.Name = sC.Name Else

        Sheets("Graph").Range("C2:R2").Copy
        Sheets(sC.Name).Range("b" & i).PasteSpecial xlPasteValues

    End
        'sC.ClearManualFilter

        'Create new tab and rename based on current selection
        'Sheets.Add.Name = sI.Value
        'Copy paste values from POS_DETAIL tab to the new tab
        Sheets("Graph").Range("C2:R2").Copy
        Sheets(sC.Name).Range("b" & i).PasteSpecial xlPasteValues
    Next sI

Next i
    End With
    'Garbage Collection
    Set sC = Nothing
End Sub


text:
Q: System Architecture using Amazon SQS I am modeling a system (A) that notifies system (B) when something changes on system (C).
So my my system (A) just make pooling on system (C), using an API and when something changes then notifies system (B).
The system (C) stores status about an order. This status can be X, Y, Z.
It can take minutes to hours for the order to transition from state X to Y. And it can take days for the order to transition from Y to Z.
If I model my system just using one queue, I think I going to have some problems.
I could have a moment that I will have much more message from state Y-->Z than state X-->Y because the Y-->Z has a update time greater than X-->Y.
So it is going to take a long time to process X-->Y. To prevent this I think I have to clone the message and re-enqueue it, to put it back to end of the queue.
Instead of one queue, I can have two queues, one for each status.
I simplify the problem. In the original problem I can have multiple status. (I think it is 5 status).
Do you guys have a suggestion?

A: Keeping the queue separate for each status is best option for your use case as you don't have to worry or tune one queue for handling both the status.

A: Queue system are not fail-safe. Queue parser must be able to handle application crash.

*

*If required, implement process to make sure queue are not processes twice. (program might read but failed to consumed the message after processing )

*Implement a failed safe house keeping process that republish works IF queue server went down and wipe all the message with it.

*Amazon SQS maximum message retention period are 14 days. Even for own MQ server, it is high risk to store "long term" message.

*Whether your X-->Y , or Y-->Z process that take different processing timeframe , it doesn't matter. If you publish message to queue ASAP when change is trigger(say Y--> Z changes happens after 24 days), then there should be no waiting issues. IMHO, I see no reason you raise question about "re-enqueue".


text:
Q: AWS EC2: Secure configuration via IP access list My company have a network with a fixed IP address/IP address range. Is it save when I configure my Security group that all traffic from this IP address will be accepted and everything else will be blocked?
Especially, is it possible that someone fake my IP address and gets access to all the open ports on my system?
Regards, Johannes.

A: No one will fake your IP range to get pass a firewall. The only way to do this is easily if your app is all UDP.
That said just allowing your office's IP in is the first start. You might want to expand on that as the company grows. Like does everyone in the office need access to the whole AWS VPC? If not then you are looking at site to site VPN connection from your office to the VPC. This allows you to not even expose anything. Its like the VPC is in a room in the office. You can setup VLANs in the office to only allow certain vlans access to certain parts of the VPC.


text:
Q: undefined method `rescue_responses' for ActionDispatch::ShowExceptions:Class (NoMethodError) In my ruby 2.3.1, I get this error:
 => Booting WEBrick
=> Rails 4.2.6 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
/root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/will_paginate-3.0.pre2/lib/will_paginate/railtie.rb:15:in `block in <class:Railtie>': uninitialized constant WillPaginate::Railtie::Forbidden (NameError)
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `instance_exec'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:30:in `run'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /root/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
        from /root/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /root/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /root/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /root/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each'
        from /root/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `call'
        from /root/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
        from /root/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
        from /root/.rbenv/versions/2.3.1/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/initializable.rb:54:in `run_initializers'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/application.rb:352:in `initialize!'
        from /home/bistipweb/config/environment.rb:5:in `<top (required)>'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/polyglot-0.3.1/lib/polyglot.rb:64:in `require'
        from /home/bistipweb/config.ru:3:in `block in <main>'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `instance_eval'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `initialize'
        from /home/bistipweb/config.ru:in `new'
        from /home/bistipweb/config.ru:in `<main>'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.0/lib/rack/builder.rb:49:in `eval'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.0/lib/rack/builder.rb:49:in `new_from_string'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.0/lib/rack/builder.rb:40:in `parse_file'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.0/lib/rack/server.rb:299:in `build_app_and_options_from_config'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.0/lib/rack/server.rb:208:in `app'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:61:in `app'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rack-1.6.0/lib/rack/server.rb:336:in `wrapped_app'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:139:in `log_to_stdout'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/server.rb:78:in `start'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:in `block in server'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from /root/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

My railtie.rb is:
require 'will_paginate'
require 'will_paginate/collection'

module WillPaginate
        class Railtie < Rails::Railtie
                initializer "will_paginate.active_record" do |app|
                        if defined? ::ActiveRecord
                                require 'will_paginate/finders/active_record'
                                WillPaginate::Finders::ActiveRecord.enable!
                        end
                end

                initializer "will_paginate.action_dispatch" do |app|
                        if defined?(ActionController::Base)
                                config.action_dispatch.rescue_responses.update('ActionController::Forbidden'=>Forbidden)
                        end
                 end

                initializer "will_paginate.action_view" do |app|
                        require 'will_paginate/view_helpers/action_view'
                        ActionView::Base.send(:include, WillPaginate::ViewHelpers::ActionView)
                end
         end
end

How can I fix it?

A: You don't have to add any initializer codes for hooking will_paginate into Rails project, if you are using recent will_paginate versions.
I see you are using 3.0.pre2 version, update it to 3.0.7 in your Gemfile, bundle update will_paginate and remove all the codes you added in railtie.rb, I think everything would be ok.

A: Try:
initializer "will_paginate.action_dispatch" do |app|
  if defined?(ActionController::Base)
    config.action_dispatch.rescue_responses.update('ActionController::Forbidden'=>Forbidden)
  end
end

A: I do not find any reason for you to add railtie.rb file. I believe just adding the gem and using it in your view should work.


text:
Q: Clistview clicked item pass to other activity I want to pass my Listview clicked item ID to other activity using intent. HoW could I do this?

A: You get the id and add it to the Intent as an Extra using the respective (long) putExtra, with a suitable key (first parameter).
In the other Activity you get the Intent and then get the value from the Extra using the getLongExtra using the same key (first parameter) noting that the default value should be a value (e.g. -1) that will not be an id.
Working Example
The following is a working example :-
The Database Helper DBOpenHelper.java
public class DBOpenHelper extends SQLiteOpenHelper {

    public static final String DBNAME = "notes.db";
    public static final int DBVERSION = 1;
    public static final String TBL_NOTE = "note_table";
    public static final String COL_NOTE_ID = BaseColumns._ID;
    public static final String COL_NOTE_TEXT = "note_text";

    private final String create_table = "CREATE TABLE IF NOT EXISTS " + TBL_NOTE + "(" +
            COL_NOTE_ID + " INTEGER PRIMARY KEY, " +
            COL_NOTE_TEXT + " TEXT " +
            ")";
    private static final String drop_table = "DROP TABLE IF EXISTS " + TBL_NOTE;

    public DBOpenHelper(Context context) {
        super(context, DBNAME, null, DBVERSION);
    }

    public void onCreate(SQLiteDatabase db) {
        db.execSQL(create_table);
    }

    public void onUpgrade(SQLiteDatabase db, int version_old, int version_new) { }

    public long addNote(String note) {
        SQLiteDatabase db = this.getWritableDatabase();
        ContentValues cv = new ContentValues();
        cv.put("NOTE_TEXT",note);
        return db.insert("note_table",null,cv);
    }

    public Cursor getAllNotes() {
        SQLiteDatabase db = this.getWritableDatabase();
        return db.query(TBL_NOTE,null,null,null,null,null,null);
    }
}

*

*An instantiated instance of this is used to :

*

*open the database (in the example it is named notes.db), it will create the database if it doesn't exist.

*add data via the addNote method.

*return a Cursor containing all the Notes via the getAllNotes method.

The initial activity MainActivity.java :-
public class MainActivity extends AppCompatActivity {

    private ListView mListView;
    private SimpleCursorAdapter MSCA;
    private Cursor mCsr;
    private DBOpenHelper mDBHelper;

    public static final String INTENTEXTRAKEY_NOTE_ID = "iek_noteid";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mDBHelper = new DBOpenHelper(this);
        mListView = findViewById(R.id.listView);
        addSomeTestData(); //Adds a row every time the App is run (for testing)
        ViewData();
    }

    private void ViewData(){

        mCsr = mDBHelper.getAllNotes();
        if (MSCA == null) {
            MSCA = new SimpleCursorAdapter(
                    this,
                    android.R.layout.simple_list_item_1,
                    mCsr,
                    new String[]{DBOpenHelper.COL_NOTE_TEXT},
                    new int[]{android.R.id.text1},
                    0);
            mListView.setAdapter(MSCA);
            mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                    Intent i = new Intent(MainActivity.this,OtherActivity.class);
                    i.putExtra(INTENTEXTRAKEY_NOTE_ID,id);
                    startActivity(i);
                }
            });
        } else {
            MSCA.swapCursor(mCsr);
        }
    }

    private void addSomeTestData() {
        if(DatabaseUtils.queryNumEntries(mDBHelper.getWritableDatabase(),DBOpenHelper.TBL_NOTE) < 1) {
            mDBHelper.addNote("My Note");
            mDBHelper.addNote("Another Note");
            mDBHelper.addNote("Yet Another Note");
            mDBHelper.addNote("And so on.");
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mCsr.close();
    }

    @Override
    public void onResume()
    {
        super.onResume();
        ViewData();
    }
}

*

*This activity :-

*

*Adds some notes to the database (if none already exist)

*Lists all of the notes in the database

*sets a onItemClickListener to call the activity OtherActivity passing the id via an IntenExtra.

*Notes

*

*A CursorAdpater (SimpleCursorAdapter) in this case is ideally suited as the id is passed to the onItemClick method by the listener. NOTE this requires a column, named specifically _id (as per BaseColumns._ID) and that the column is an alias of the rowid column.

*The onDestroy method has been overridden to close the Cursor when done with it (i.e. when the Activity is detsroyed). This isn't so important in the initial actiivty as it's lifetime would typically be for the entire App (closing the Cursor in hierarchically lower Activities is more important).

*The ViewData method manages a single instance of the adapter (i.e. creating it only when it hasn't been instantiated) and also refreshing of the ListView. Hence why it is called in the overridden onResume method. i.e. another activity may add. delete or update the database so the ListView will updated upon return.
The activity called from the initial activity OtherActivity.java
public class OtherActivity extends AppCompatActivity {

    TextView mNoteId;
    Button mDone;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_other);
        mNoteId = this.findViewById(R.id.noteid);
        mDone = this.findViewById(R.id.done);
        mDone.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        Intent i = this.getIntent();
        long id = i.getLongExtra(MainActivity.INTENTEXTRAKEY_NOTE_ID,-1);
        mNoteId.setText(String.valueOf(id));
    }
}

*

*This activity :-

*

*sets the onClickListener of the button to return to the calling/invoking activity.

*extracts the id from the Intent Extras passed to the activity from the calling activity and sets the noteid TextView with the extracted value (the passed id).

Result
Initially :-

Clicking Yet Another Note :-

*

*As Yet Another Note was the third note added it's id is 3.


text:
Q: How do I remove border around a focused textbox When we click on the textbox a border is appearing in Chrome.

A: Use $outline:none; in this manner:
textarea:focus, input:focus{
    outline: none;
}

That way, it only applies when it's being used.

A: CSS:
textbox:focus {
    outline: none;
}

UPDATE
I used texbox just for illustration, in your code you should use element based on your html like input, button, textarea etc.

A: Use outline: none; like:
input, textarea {
   outline: none;
}


text:
Q: Submission issue internal server error I am trying to submit data through form as below which gives error:
echo 'The # here does not begin a comment.'
echo The \# here does not begin a comment.

But it wont give error, if we submit like below:
echo The # here does not begin a comment.
echo The # here does not begin a comment.

That is ,without single quotes and slash ,i am unable to submit data.
Code as below:
 function AjaxCallOnClick(userName, email, commentText, blogID, commentHtml, onCommentEmailID) {

        var parameters = "{'commentUserName':'" + userName + "','email':'" + email + "','commentText':'" + commentText + "','blogID':'" + blogID + "','commentHtml':'" + commentHtml + "','onCommentEmailID':'" + onCommentEmailID + "'}";
        $.ajax({
            type: "POST",
            url: "<%= ResolveUrl("~/BlogService.asmx/GetShareStoryData")%>",
            data: parameters,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
            alert("Your Comment was Saved");
                var getCommentList = response.d;
                var allComments = '';
                $('#dvMainAndReplyCommentSection').html('');
                $.each(getCommentList, function (index, comments) {
                    var comment = comments.HtmlComment;
                    allComments += comment;
                });
                if (allComments) {
                    $('#dvMainAndReplyCommentSection').html(allComments);
                }

            },
            error: function (jqXHR, textStatus, errorThrown) {

                alert(errorThrown);
            },
            failure: function (response) {
                alert(response.responseText);
            }
        });

    }

What is the work around for this?

A: I tried like this format var parameters = JSON.stringify({ commentUserName: userName, email: email, commentText: commentText, blogID: blogID, commentHtml: commentHtml, onCommentEmailID: onCommentEmailID }); and it's working fine for me.

A: Try it...Removes double quotes when saving object.
function AjaxCallOnClick(userName, email, commentText, blogID, commentHtml, onCommentEmailID) {

var parameters = JSON.stringify({'commentUserName': userName,'email': email,'commentText': commentText,'blogID': blogID,'commentHtml': commentHtml,'onCommentEmailID': onCommentEmailID});

    $.ajax({
        type: "POST",
        url: "<%= ResolveUrl("~/BlogService.asmx/GetShareStoryData")%>",
        data: parameters,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (response) {
        alert("Your Comment was Saved");
           var res=JSON.parse(response);
            var getCommentList = res.d;
            var allComments = '';
            $('#dvMainAndReplyCommentSection').html('');
            $.each(getCommentList, function (index, comments) {
                var comment = comments.HtmlComment;
                allComments += comment;
            });
            if (allComments) {
                $('#dvMainAndReplyCommentSection').html(allComments);
            }

        },
        error: function (jqXHR, textStatus, errorThrown) {

            alert(errorThrown);
        },
        failure: function (response) {
            var res=JSON.parse(response);
            alert(res.responseText);
        }
    });

}


text:
Q: How can I prevent units from wandering after enemies? My army tends to get destroyed because the units go on long treks after individual enemies, even villagers (25 hit points, the weakest of all units). For example, the army may split to several (non-organized) groups, all of which get quickly killed leaving vulnerably units exposed.

A: You should change the stance of your units. There are 4 stances:

*

*Aggressive:  units will wander without limitation as to range until they've killed all targets in range.

*Defensive: units will attack any unit in range, and will follow for a certain no. of tiles before returning to their original position.

*Stand Ground: units won't move to attack but will attack any enemy in range.

*No attack: units do not automatically attack unless ordered to.

Units' stance is aggressive by default and changing stance to defensive will ensure that your entire army doesn't run away. You can change the default stance of your units in advanced settings.
Further, if you select a unit say a bowman and press alt while changing stance to defensive, then all bowmen will have their stance changed to defensive including new bowmen that you may create.


text:
Q: Stucked with Reverse Polish Notation I'm having a homework: When we input the math expression like -(2 + 3) * 1/5 , the output should be -1. After doing some research, I found that RPN algorithm is the way to solve this problem. So what I did is convert the expression from infix to postfix. But the problem is I can't determine the operands in some situations, like this:
Input: 11+((10-2)*6)+7
Infix-to-Postfix-----------
Output: 11102-6*+7+

There is no white space between "11" and "10", and between "10" and "2" so I can't determine every single operand correctly .
Because my output (postfix) is a string, I'm totally don't know how to solve this problem. Is there any idea for this?

A: You described the problem -- and obvious solution -- in your posting: the postfix output you chose destroys critical information from the original expression.  The obvious solution is that you have to change your postfix routine to preserve that information.
The particular problem is that you can no longer parse a string of digits into the original integers.  The obvious solution is to retain or insert a unique separator.  When you emit (output) an integer, add some sort of punctuation.  Since RPN uses only numbers and a handful of operators, choose something easy for you to detect and to read yourself: a space, comma, or anything else that would work for you.
For instance, if you use a simple space, then you'd have RPN format as
11 10 2 -6 *+7 +

When you read this in your RPN evaluator, use the separator as a "push integer" signal (or operator).
Note that I have used this separator as a terminal character on every integer, not merely a separator between consecutive integers.  Making it a terminal simplifies both output processing and input parsing.  Deciding whether or not to add that symbol depends on only one token (the integer), rather than making it conditional upon two adjacent tokens (requiring a small amount of context status).


text:
Q: Establishment not shown in google map autocomplete form I refer to following web page to extract establishment from place autocomplete.
Place Autocomplete Address Form
I replace the component form with following and add input field with same id. However, the problem i faced is that the establishment is not returned for many of the case. This value for establishment does exist when i check the address with following url. However, it seems that it is not able to extract the information. https://maps.googleapis.com/maps/api/geocode/json?address=XXX
var componentForm = {
  establishment: 'establishment',
  street_number: 'short_name',
  route: 'long_name',
  locality: 'long_name',
  administrative_area_level_1: 'short_name',
  country: 'long_name',
  postal_code: 'short_name'
};


text:
Q: Title on a multi-panel plot The following code works perfectly, except for the last line, which appears to be ignored. The code creates a dataframe consisting of three columns and then proceeds to plot the columns on a 2x2 grid. The last line is supposed to give a title to the entire multi-panel plot. However, it has no effect on the outcome. What is wrong? How can I correct it?
p <- c(3, 5, 10, 20, 50, 100)
n <- c(100, 5000, 100000)
f <- function(x, y){ return ((1 - 2^(-1/y))^(1/x))}

d <- as.data.frame(outer(p, n, FUN = f))
dimnames(d) <- list(p, n)

par(mfrow = c(2,2))
lapply(colnames(d),
       function(x) plot(p, d[,x], type = "b",
                        main = paste("#points = ", x),
                        xlab = "Dim",
                        ylab = "Med Dist"))
mtext("Densities", outer = TRUE, cex = 1.5)

A: Try
par(oma = c(0, 0, 2, 0))
par(mfrow = c(2,2))
lapply(colnames(d),
      function(x) plot(p, d[,x], type = "b",
                    main = paste("#points = ", x),
                    xlab = "Dim",
                    ylab = "Med Dist"))
title("Densities", outer=TRUE)


text:
Q: Variable is an array but not countable? I am upgrading our Codeigniter (v. 3.1.11) site from php 5.6 to php 7.2 (currently running on localhost on my Mac). Slowly I am finding all the instances of count() usage and correcting them. It is my understanding that an array is countable, but I seem to not be able to count arrays returned by Codeigniter's result_array() function after a database call....
the following section of my controller
    $reviews = $this->reviews_model->review_details($productname);
    echo "Variable is type: ".gettype($reviews);
    if (count($reviews >=1)) {
        $myreview=$reviews[0];
    } else {
        $myreview=0;
    }
    return $myreview;

calls this function in my model (note that I am echoing out the variable type just to be sure!)
    function review_details($pagename) {
    $r = false;
    $sql = "select Reviews.*, ReviewItemLink.Item as Product, ReviewItemLink.* from Reviews LEFT JOIN ReviewItemLink ON Reviews.ReviewItemID=ReviewItemLink.ReviewItemID where pagename=? AND ReviewActive = 1 ORDER BY Date DESC";
    $query = $this->db->query($sql, $pagename);
    if ($query->num_rows() > 0):
        $r = $query->result_array();
    endif;
    return $r;
}

And even though the variable is an array
Variable is type: array

I still get the by now, oh-so-familiar warning message:
Severity: Warning
Message: count(): Parameter must be an array or an object that implements Countable
Filename: controllers/Software.php
Line Number: 1005

Backtrace:

File: /Users/juner/Sites/html/application/controllers/Software.php
Line: 1005
Function: _error_handler
File: /Users/juner/Sites/html/application/controllers/Software.php
Line: 75
Function: _get_my_review

File: /Users/juner/Sites/html/index.php
Line: 324
Function: require_once

Are there types of arrays that are NOT countable? Any suggestions/ideas would be most helpful!

A: This part is incorrect (typo?):
if (count($reviews >=1)) {
    $myreview=$reviews[0];
} else {
    $myreview=0;
}

You are passing a boolean to the count function. count($reviews >=1) turns to count(true); which is why you got your warning.
if (count($reviews >=1)) { should be if (count($reviews) >=1 ) {


text:
Q: Should you commit environment.pickle when working with Sphinx? I'm using Sphinx to generate some documentation, and I publish this built documentation in a git repository. One of the files in the build directory is called environment.pickle and seems to be in binary format, i.e. not plaintext. What is this file, and should I include it when committing?

A: Pickle files are a type of binary serialization format used by Python.  They can be used for serializing Python objects into a binary form and then unserializing them later.  You should never distribute pickle files because untrusted pickle files can execute arbitrary code during deserialization, according to the Python documentation:

It is possible to construct malicious pickle data which will execute arbitrary code during unpickling. Never unpickle data that could have come from an untrusted source, or that could have been tampered with.

In general, any object format which has the ability to serialize and deserialize arbitrary objects cannot be used on untrusted data, since the constructors and destructors of those objects could be leveraged to execute arbitrary code.  Since nobody can securely use these pickle files, there's no reason to distribute them.
In general, you should not use Git for build artifacts, such as built documentation, either.  Build artifacts are often binary and large, and these types of objects are unwieldy to work with in Git.  Additionally, you probably are not interested in keeping the entire history of every build artifact, since you can just regenerate them from the source.  A Git repository of such objects will quickly become bloated.
Using a different deployment format, such as tarballs, would be better.  You haven't told us about where you're deploying these changes, so we can't provide you better advice on how to deploy this built documentation.


text:
Q: Group Comma Delimited String into Range Groups 2 Dimentional Array I have a comma delimited string that I need to break into array ranges that can be passed into SQL server's BETWEEN statement.
For instance, say I have the following string below, I need the corresponding returnVal returned;
string delimited = "1,2,5,6,7,8,11,12,13,15,16,17,18,19";
returnVal = int[,] ranges = new int[4, 2] { { 1, 2 }, { 5, 8 }, { 11, 13 }, { 15, 19 } };

My SQL Between Statement would then look like
WHERE (ID BETWEEN 1 AND 2) OR (ID BETWEEN 5 AND 8)  OR (ID BETWEEN 11 AND 13)  OR (ID BETWEEN 15 AND 19)

Rather than
WHERE ID IN(1,2,5,6,7,8,11,12,13,15,16,17,18,19)
My actual delimited string is over 5000 IDs so I need to use BETWEEN statements rather than IN statements for efficiency.
What would be the most efficient way to do this using C#?

A: The following will solve your problem:
If your ints are a delimited string you can use split to convert it into an int array.
var intArray = **array of integers**
var ranges = new List<List<int>>();

int? topRange = intArray[0];
int? lastId = null;
int bottomRange;
foreach(int id in intArray)
{
    if(topRange == null)
    {
        topRange = id;
    }
    if (lastId != null && id != (lastId + 1))
    {
        bottomRange = lastId.Value;
        ranges.Add(new List<int>() { topRange.Value, bottomRange });
        topRange = id;
    }
    lastId = id;
}


text:
Q: Is there the equivalent of to_markdown to read data? With pandas 1.0.0 the use of .to_markdown() to show the content of a dataframe in this forum in markdown is going to proliferate. Is there a convenient way to load the data back into a dataframe? Maybe an option to .from_clipboard(markdown=True)?

A: You can read markdown tables (or any structured text table) with the pandas read_table function:
Let's create a sample markdown table:
pd.DataFrame({"a": [0, 1], "b":[2, 3]}).to_markdown()

|    |   a |   b |
|---:|----:|----:|
|  0 |   0 |   2 |
|  1 |   1 |   3 |

As you can see, this is just a structured text table where the delimiters are pipes, there's a lot of whitespace, there are null columns on the left-most and right-most, and there's a header underline that must be dropped.
pd
  # Read a markdown file, getting the header from the first row and inex from the second column
  .read_table('df.md', sep="|", header=0, index_col=1, skipinitialspace=True)
  # Drop the left-most and right-most null columns
  .dropna(axis=1, how='all')
  # Drop the header underline row
  .iloc[1:]

   a  b
0  0  2
1  1  3

A: This takes care of removing all whitespaces from the values and column names (so be careful if you have whitesapce that you want to keep in your values):
from io import StringIO
import pandas as pd

md_table = pd.DataFrame({"a": [3, 10000], "b":[2222, 3]}).to_markdown()
print(md_table)

# The white space on both columns and values need to be removed
|    |     a |    b |
|---:|------:|-----:|
|  0 |     3 | 2222 |
|  1 | 10000 |    3 |

# Paste in your table and assign it to a variable
md_table_string = """
|    |     a |    b |
|---:|------:|-----:|
|  0 |     3 | 2222 |
|  1 | 10000 |    3 |
"""

pd.read_csv(
    StringIO(md_table_string.replace(' ', '')),  # Get rid of whitespaces
    sep='|',
    index_col=1
).dropna(
    axis=1,
    how='all'
).iloc[1:]

       a     b
0      3  2222
1  10000     3

A: None of the answers so far read the data from the clipboard. They all require the data to be in a string. This led me to look into the source code of pandas.read_clipboard(), and lo and behold, the method internally uses pandas.read_csv(), and passes all arguments to it. This automatically leads to the following solution:
t = pd.DataFrame({"a": [0, 1], "b":[2, 3]}).to_markdown()
print(t)

|    |   a |   b |
|---:|----:|----:|
|  0 |   0 |   2 |
|  1 |   1 |   3 |

Mark the table and copy it to the clipboard (Ctrl-C on Windows). Building on the above answers:
pd.read_clipboard(sep="|", header=0, index_col=1, skipinitialspace=True).dropna(
    axis=1, how="all"
).iloc[1:]

The next step would be to integrate this into https://pyjanitor-devs.github.io/pyjanitor/ so it can be easily called with a markdown=True parameter.


text:
Q: Java Method Overloading with Vararg I've two versions of addValues, one with vararg parameters.
double addValues(double ... values) {
    double result = 0d;
    for (double value : values)
        result += value;
    return result;
}

double addValues(double v1, double v2) {
    return v1 + v2;
}

When I call addValues(2, 3) which looks ambiguous to me, why Java selects the addValues(double v1, double v2) version to run the code? How does Java determine which version is 'closer' to the invocation?
Thanks.

A: This answer gives the relevant section of the Java Language Specification. However it is so complicated that it requires a few examples to explain.
The compiler will always choose a method not needing "variable arity invocation" or auto boxing or auto unboxing if possible. Variable arity invocation is when you invoke a varargs method by passing a parameter list for the last argument (rather than an array).
For example, suppose you have a method with signature
void foo(int... arr)

This is a variable arity invocation...
foo(1, 2, 3);

...but this is not.
foo(new int[] {1, 2, 3});

So in your case, addValues(2, 3) uses the second version as this is not a variable arity invocation.
It is not true to say that the compiler will always favour a method not involving varargs over one that does involve varargs, as this example shows:
public static void bar(int... a) {
    System.out.println("Varargs");
}

public static void bar(Object a) {
    System.out.println("Object");
}

public static void main(String[] args) {
    bar(new int[] {1, 2, 3});    // Prints Varargs
}

In this example, neither choice is a variable arity invocation, but the first version is invoked as it is more specific.
These rules made it possible to change a non-varargs signature
baz(int[] arr)

to a varargs one
baz(int... arr)

without changing the behaviour of any existing program.

A: The compiler will usually favor a non-varargs overload over a varargs overload.  When varargs was added in Java 5, they wanted to add varargs overloads while still remaining backwards compatible, meaning that prior code that was necessarily calling a non-varargs overload would still call that overload and not the varargs overload.
This is explained in the JLS, Section 15.12.2:

The remainder of the process is split into three phases, to ensure compatibility with versions of the Java programming language prior to Java SE 5.0. The phases are:

*

*The first phase (§15.12.2.2) performs overload resolution without permitting boxing or unboxing conversion, or the use of variable arity method invocation. If no applicable method is found during this phase then processing continues to the second phase.

This guarantees that any calls that were valid in the Java programming language before Java SE 5.0 are not considered ambiguous as the result of the introduction of variable arity methods, implicit boxing and/or unboxing. However, the declaration of a variable arity method (§8.4.1) can change the method chosen for a given method method invocation expression, because a variable arity method is treated as a fixed arity method in the first phase. For example, declaring m(Object...) in a class which already declares m(Object) causes m(Object) to no longer be chosen for some invocation expressions (such as m(null)), as m(Object[]) is more specific.

*The second phase (§15.12.2.3) performs overload resolution while allowing boxing and unboxing, but still precludes the use of variable arity method invocation. If no applicable method is found during this phase then processing continues to the third phase.

This ensures that a method is never chosen through variable arity method invocation if it is applicable through fixed arity method invocation.

*The third phase (§15.12.2.4) allows overloading to be combined with variable arity methods, boxing, and unboxing.

(bold emphasis mine)


text:
Q: limit the height of a drawer to the max viewheight I have the following layout and css:

.layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.appbar {
  background-color: blue;
  color: white;
}

.sidebar {
  flex-grow: 1;
  max-height: 94.6vh;
}

.drawer-container {
   height: 100%;
   display: flex;
}

.drawer {
    position: relative;
    background-color: #272b34;
    color: lightgray;
    border-style: none;
    align-self: stretch;
    overflow-y: auto;
}

.list {
  list-style: none;
  padding: 1rem;
}

.drawer-content {
    padding: 1rem 1rem 1rem 1rem;
    margin-top: 1px;
    align-self: stretch;
    background-color: #eef5f9;
    overflow: auto;
    flex: 1 1 auto;
}

.component {
    background-color: white;
    height: 100%;
    box-shadow: 0px 0px 3px 1px rgb(0 0 0 / 10%);
    overflow: auto;
    border-radius: 4px;
}

    APPBAR

item 1

item 2

item 3

item 4

item 5

item 6

item 7

item 8

item 9

item 10

item 11

item 12

item 13

item 14

item 15

item 16

item 17

item 18

item 19

item 20

item 21

item 22

item 23

item 24

item 25

          COMPONENT

As you see, I have a top level container (layout) with a height of 100vh. The sidebar is a list with expandable items, so, it can be, that the height of this will be greater, than 100vh. This is simulated with the 25 items. In order to keep the drawer content constant height, I have to limit the height of the sidebar (max-height: 94.6vh) and a scrollbar appears. The question is, how can I achieve the same result without fixing this max-height to 94.6vh?
Thanks.

A: Try using overflow-y property instead of max-height
.sidebar {
  flex-grow: 1;
  overflow-y: scroll;
}

.layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.appbar {
  background-color: blue;
  color: white;
}

.sidebar {
  flex-grow: 1;
  overflow-y: scroll;
}

.drawer-container {
   height: 100%;
   display: flex;
}

.drawer {
    position: relative;
    background-color: #272b34;
    color: lightgray;
    border-style: none;
    align-self: stretch;
    overflow-y: auto;
}

.list {
  list-style: none;
  padding: 1rem;
}

.drawer-content {
    padding: 1rem 1rem 1rem 1rem;
    margin-top: 1px;
    align-self: stretch;
    background-color: #eef5f9;
    overflow: auto;
    flex: 1 1 auto;
}

.component {
    background-color: white;
    height: 100%;
    box-shadow: 0px 0px 3px 1px rgb(0 0 0 / 10%);
    overflow: auto;
    border-radius: 4px;
}

    APPBAR

item 1

item 2

item 3

item 4

item 5

item 6

item 7

item 8

item 9

item 10

item 11

item 12

item 13

item 14

item 15

item 16

item 17

item 18

item 19

item 20

item 21

item 22

item 23

item 24

item 25

          COMPONENT

A: You can do that using overflow: scroll instead of max-height.


text:
Q: Q: [Anylogic] How to calculate the sum of variables of all agents that is waiting in the queue of seize block? I am still new to Anylogic. I need a suggestion to solve the problem.
For example, right now there are 3 agents waiting in the queue of the seize block.
 first agent contains variable 6
 Second agent contains variable 5
 Third agent contains variable 6
Thus, sum of variable from 3 agents is 17.
NOTE: these three variables are the same type(integer).
Question : I would like to know is there any way to calculate this value?
Explanation of the model.

There is a single product which will be processed by two workers.
  Basically, a product has to be processed by 3 tasks, which are task A, task B and task C. The task A and C are called "Fixed-task". Task A will be done by worker 1 at work station 1. In the same way, Task C will be done by worker 2 at station 2. However, the task B, which is the "Shared-task", can be done by either worker 1 or 2 at their own station.
  Every time the worker 1 finished doing task A, he has to decide whether he will place the product at the buffer for worker 2 to do the shared task or he will be doing the shared task by himself.
First of all, the product flows from the source block, then it will be processed by the first worker at the first workstation, after worker 1 finished his fixed task, he will be making a decision whether he will do or pass the shared task to worker2. The decision based on the total number of subtasks that are in the buffer in front of station 2 (Let's assign this value = T). Value T will be compared to value R, which obtained by calculation. If T is more than R , then the worker 1 will do the shared task, otherwise he will let worker 2 do it.
My idea is, I have created a variable in the agent (product) that is the number of remaining subtasks to be done. This value will be embedded when the agent exited the selectoutput block true or false.
  The problem is, at the buffer, I do not know how to calculate the T value which is the value of all remaining subtasks that worker 2 has to do.
Regarding to my question, how to obtain the total number of subtasks (T) in the buffer?

Thank you in advance.

A: AnyLogic allows to collect such statistics with Stream API in the following manner:
seize.queue.waitingEntities.stream().mapToInt( a -> a.variable ).sum();'
Usually, such manner is more readable than for loop.

A: This is how I understand your question:

*

*You have a number of agents in the seize queue

*All agents are the same, meaning that they all contain a variable, called "variable" that can take any integer value

*You want to know what is the sum of the variable of all the agents that are in the seize queue block

If I understand your question correctly, you do it like this:
int var=0;
for(int i=0;i<seize.size();i++){
    var+=seize.get(i).variable;
}

"var" gives you the number you want to calculate


text:
Q: Big $\mathcal{O}$ Notation $f(N)=\mathcal{O}\left(\frac{1}{\sqrt{N}}\right)$ If $f(N)=\mathcal{O}\left(\frac{1}{\sqrt{N}}\right)$ (the big-oh) means that $\frac{1}{\sqrt{N}}$ grows faster than $f(N)$ as $N \to \infty$. So it is possible to take $f(N)=\frac{1}{N}$ or  $f(N)=\frac{1}{N^2}$.
Am I correct ?

A: When you say $f(N) = \mathcal{O} \left( g(N) \right)$ this means that $f(N)$ is equal to some function that has the property
$$
f(N) \leq c g(N)
$$
for all $N \geq N_0$, and $c$ some constant. In your case this means that there's an $N_0$ and constant $c$ for which
$$f(N) \leq \frac{c}{\sqrt{N}}.$$
Therefore your choices are both valid as candidates for $f(N)$, but trivially even $f(N) = 0$ is a suitable candidate.

A: By definition

$$f(x) = \mathcal{O}(g(x)) \iff f(x) \leq cg(x)$$

In your case let $f(N)=\dfrac{1}{N^a}$ with $a \in \mathbb{N} $  and $\,g(N)=\dfrac{1}{\sqrt{N}}$, then
$$\lim_{N\to\infty}\frac{f(N)}{cg(N)} = \frac{\frac{1}{N^a}}{\frac{c}{\sqrt{N}}} = \frac{\sqrt{N}}{cN^a} = \sqrt{\frac{N}{(cN^a)^2}}= \frac{1}{cN^{\frac{a2-1}{2}}} =0 $$
Therefore
$$f(N) \leq \dfrac{c}{\sqrt{N}}\implies f(N) = \mathcal{O}\left(g(N)\right) $$
$\tag*{$\Box$}$
So you're right.


text:
Q: Color notation in gradle html dependency report What is the color notation in gradle html report. I referred api docs of gradle but did not get any answer.
For suppose, below is my html report, what is the difference between orange and black.

A: This orange color, along with the arrow pointing to a different version, means that there was a conflict between two versions, that has been resolved by choosing the version on the right.
There is another color being used, but if you see it, it means the dependency was unresolvable (so it shouldn't happen often).


text:
Q: gwt-plugin compile-error with JDK-17: Unable to make private final sun.util.calendar.BaseCalendar$Date java.util.Date.getCalendarDate() accessible I try to upgrade my large java-application from jdk-11 to jdk-17. On jdk-11 all is ok.
We use the following gwt-plugin (version 1.0.1) to compile:
     <plugin>
       <groupId>net.ltgt.gwt.maven</groupId>
       <artifactId>gwt-maven-plugin</artifactId>
       <configuration>
         <moduleName>xxxxxxxxxxxxx</moduleName>
         <jvmArgs>
           <jvmArg>-showversion</jvmArg>
           <jvmArg>-Xmx2048M</jvmArg>
         </jvmArgs>
       </configuration>
       <executions>
         <execution>
           <goals>
             <goal>compile</goal>
           </goals>
         </execution>
       </executions>
     </plugin>

but the compile complains with:
[INFO] --- gwt-maven-plugin:1.0.1:compile (default-cli) @ xxxxxxx ---
[WARNING] openjdk version "17.0.2" 2022-01-18 LTS
[WARNING] OpenJDK Runtime Environment Zulu17.32+13-CA (build 17.0.2+8-LTS)
[WARNING] OpenJDK 64-Bit Server VM Zulu17.32+13-CA (build 17.0.2+8-LTS, mixed mode, sharing)
[INFO] Compiling module xxxxxxxx
...
[INFO] java.lang.reflect.InaccessibleObjectException: Unable to make private final sun.util.calendar.BaseCalendar$Date java.util.Date.getCalendarDate() accessible: module java.base does not "opens java.util" to unnamed module @145f66e3
[INFO]  at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
[INFO]  at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
[INFO]  at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
[INFO]  at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
[INFO]  at org.hibernate.validator.util.privilegedactions.SetAccessibility.run(SetAccessibility.java:39)
[INFO]  at org.hibernate.validator.util.ReflectionHelper.setAccessibility(ReflectionHelper.java:354)
[INFO]  at org.hibernate.validator.metadata.BeanMetaDataImpl.addMethodMetaConstraint(BeanMetaDataImpl.java:474)
[INFO]  at org.hibernate.validator.metadata.BeanMetaDataImpl.initMethodConstraints(BeanMetaDataImpl.java:654)
[INFO]  at org.hibernate.validator.metadata.BeanMetaDataImpl.initClass(BeanMetaDataImpl.java:546)
[INFO]  at org.hibernate.validator.metadata.BeanMetaDataImpl.createMetaData(BeanMetaDataImpl.java:540)
[INFO]  at org.hibernate.validator.metadata.BeanMetaDataImpl.<init>(BeanMetaDataImpl.java:209)
[INFO]  at org.hibernate.validator.metadata.BeanMetaDataImpl.<init>(BeanMetaDataImpl.java:163)
[INFO]  at org.hibernate.validator.engine.ValidatorImpl.getBeanMetaData(ValidatorImpl.java:1211)
[INFO]  at org.hibernate.validator.engine.ValidatorImpl.getConstraintsForClass(ValidatorImpl.java:251)
[INFO]  at com.google.gwt.validation.rebind.BeanHelperCache.doCreateHelper(BeanHelperCache.java:113)

If I add the add-opens parameter like this:
     <plugin>
       <groupId>net.ltgt.gwt.maven</groupId>
       <artifactId>gwt-maven-plugin</artifactId>
       <configuration>
         <moduleName>xxxxxxxxxxxxx</moduleName>
         <jvmArgs>
           <jvmArg>-showversion</jvmArg>
           <jvmArg>-Xmx2048M</jvmArg>
           <jvmArg>--add-opens java.base/java.util=ALL-UNNAMED</jvmArg>
         </jvmArgs>
       </configuration>
       <executions>
         <execution>
           <goals>
             <goal>compile</goal>
           </goals>
         </execution>
       </executions>
     </plugin>

then, I get the following error:
[INFO] --- gwt-maven-plugin:1.0.1:compile (default-cli) @ xxxxxx ---
[WARNING] Unrecognized option: --add-opens java.base/java.util=ALL-UNNAMED
[WARNING] Error: Could not create the Java Virtual Machine.
[WARNING] Error: A fatal exception has occurred. Program will exit.

Above the log stated, that I use a jdk-17.
How do I need to set the add-opens parameter ?
Do you see any other workaround?

A: The comment from Stuart solved my issue. Thanks a lot.
The following configuration worked for me:
  <plugin>
    <groupId>net.ltgt.gwt.maven</groupId>
    <artifactId>gwt-maven-plugin</artifactId>
    <configuration>
      <moduleName>xxxxxxxx</moduleName>
      <jvmArgs>
        <jvmArg>-showversion</jvmArg>
        <jvmArg>-Xmx2048M</jvmArg>
        <jvmArg>--add-opens</jvmArg>
        <jvmArg>java.base/java.util=ALL-UNNAMED</jvmArg>
      </jvmArgs>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>compile</goal>
        </goals>
      </execution>
    </executions>
  </plugin>


text:
Q: The study of the theorem of Tong on the error term of the partial sum of the $\tau$ function I want to study the following fact by Tong which I don't want the exact form like this. I just want something like $\gg X^{3/2}$ or $\ll X^{3/2}$ for the left-hand side. Now, I don't want to read the paper by him but try myself.
It is shown that, for $R(y)=\sum_{n\le y}\tau(n)-y(\log y+2\gamma-1)+O(1)$,
$$\int_0^X R(y)^2dy=\dfrac{\zeta(3/2)^4}{6\pi^2\zeta(3)}X^{3/2}+o(X^{3/2}).$$
Here are what I tried and failed, but I want to know where since I approximate few times (and even equality does not seem true too). At the first moment I just want to grasp an approximation to the problem using Van der Corput's method and ideas in the book. Thank you in advance for any help and clarification. For example, where I shouldn't be using the approximation (as it is not valid or it may have a hidden large error and holes)
Here we look at the book (link), and denote $\lVert x\rVert$ be the nearest distant to integer, so $\lVert 1.2 \rVert=0.2$, $\lVert 0.7\rVert=0.3$. Also, we let $\left\langle\, x\right\rangle$ be the fractional part of $x$, and $e(\alpha)=\exp(2\pi i\alpha)$. Let $B_1(t)=\left\langle\, t\right\rangle -\frac{1}{2}$ and $B(t)=\frac{1}{2J}\int_{-1/J}^{1/J} B_1(t+u) du.$
$$\int_0^X R(y)^2dy=\int_0^X \left(\sum_{q\le \sqrt{y}}B_1\left(\dfrac{y}{q}\right)\right)^2 dy\approx \int_0^X \left(\sum_{q\le \sqrt{y}}B\left(\dfrac{y}{q}\right)\right)^2 dy.$$
$$\therefore \int_0^X R(y)^2dy\approx \sum_{y\le X}\left(\sum_{q\le \sqrt{y}}B\left(\dfrac{y}{q}\right)\right)^2=\sum_{q,q_1\le \sqrt{X}}\sum_{\max(q^2,q_1^2)\le y\le X}B\left(\dfrac{y}{q}\right)B\left(\dfrac{y}{q_1}\right).$$
Thus, we have an ineqaulity which is taken by letting $q\ge q_1$ (and $q<q_1$ will be almost the same)
$$\sum_{q,q_1\le \sqrt{X}}\sum_{\max(q^2,q_1^2)\le y\le X}B\left(\dfrac{y}{q}\right)B\left(\dfrac{y}{q_1}\right)\ll\left|\sum_{q\le \sqrt{X}}\left\{\sum_{q^2\le y\le X}B\left(\dfrac{y}{q}\right)\sum_{q_1\le \sqrt{X}}B\left(\dfrac{y}{q_1}\right)\right\}\right|$$
By the proof used in Voronoi's theorem $$\left|\sum_{q_1\le \sqrt{X}}B\left(\dfrac{y}{q_1}\right)\right|\ll X^{1/3}\log X.$$

Edited: This should be
$$\left|\sum_{q_1\le \sqrt{X}}B\left(\dfrac{y}{q_1}\right)\right|\ll\sqrt{X}$$
and the last inequality below is $\ll X^{3/2}\log X$ not contradicting anymore but not strong enough.

We also have, by mimicking the proof, but use instead Theorem 6.7, which states that if $I$ be a bounded interval in $\mathbb R$, and $f\in\mathcal C^1(I,\mathbb R)$ be a real function such that $f'$ is monotonic on $I$ and satisfies $\min_{x\in I}\lVert f'(x)\rVert\ge \lambda>0.$
$$\left|\sum_{n\in I}e\Big(f(n)\Big)\right|\le\dfrac{2}{\pi\lambda},$$
to obtain (by setting the absolute convergent Fourier series of $B(t)$) $$\left|\sum_{y\le X} B\left(\dfrac{y}{q}\right)\right|=\left|\sum_{y\le X} \sum_{j\ge 1}a_j\sin\left(2\pi j\cdot\dfrac{y}{q}\right)\right|\approx\left|\sum_{r\le \frac{\log X}{\log 2}}\sum_{j\ge 1}a_j\sum_{2^r<y \le 2^{r+1}}\sin\left(2\pi j\cdot\dfrac{y}{q}\right)\right|:=R,$$
where $a_j=-\dfrac{J}{2\pi^2j^2}\sin\left(\dfrac{2\pi j}{J}\right)$, and as in the book we have $|a_j|\ll\min(j,J)/j^2$.
$$R\ll \sum_{r\le \log X}\sum_{j\ge 1} |a_j|\left|\sum_{2^r<y\le 2^{r+1}}\sin\left(2\pi j\cdot\dfrac{y}{q}\right)\right|\ll\sum_{r\le \log X}\sum_{j\ge 1} |a_j|\left|\sum_{2^r<y\le 2^{r+1}}e\left( j\cdot\dfrac{y}{q}\right)\right|.$$
Thus, by theorem 6.7 above and $f(n)=jn/q$ with $I=(2^r,2^{r+1}]$ so $f'(t)=j/q$ be a constant, therby giving $\lambda = \lVert j/q\rVert$,
$$\sum_{j\ge 1}|a_j|\left|\sum_{2^r<y\le2^{r+1}}\sin\left(2\pi j\cdot\dfrac{y}{q}\right)\right|\ll\sum_{j\le J}'\dfrac{1}{j\lVert j/q\rVert}+\sum_{j>J}' J\cdot\dfrac{1}{j^2\lVert j/q\rVert},$$
where the $\sum'$ denotes the sum over which $q\nmid j.$
Therefore,
$$\sum_{j\ge 1}|a_j|\left|\sum_{2^r<y\le2^{r+1}}\sin\left(2\pi j\cdot\dfrac{y}{q}\right)\right|\ll\sum_{j\le J}\sum_{k\le q-1}\dfrac{1}{j(k/q)}+\sum_{j>J}\sum_{k\le q-1} J\cdot\dfrac{1}{j^2(k/q)},$$
which is $\ll q\log J\log q+Jq\log q$ and we can choose $J>1$ to be $O(1)$. Now, we plug in and obtain
$$\left|\sum_{q^2\le y\le X} B\left(\dfrac{y}{q}\right)\right|\ll q\log q\log q^2+q\log q\log X\ll q\log q\log X.$$
$$\sum_{q,q_1\le \sqrt{X}}\sum_{\max(q^2,q_1^2)\le y\le X}B\left(\dfrac{y}{q}\right)B\left(\dfrac{y}{q_1}\right)\ll \sum_{q\le \sqrt{X}}\left|\sum_{q^2\le y\le X}B\left(\dfrac{y}{q}\right)\right| \left|\sum_{q_1\le \sqrt{X}}B\left(\dfrac{y}{q_1}\right)\right|$$
$$\ll \sum_{q\le \sqrt{X}} q\log q\log X\cdot X^{1/3}\log X\ll X^{4/3}\log^3 X=o(X^{3/2}),$$
which is impossible since we will have $\int_0^X R(y)^2 dy\approx o(X^{3/2})$, but contradict the above fact.

A: It seems to me that using the same setting is possible, but I need to change some of them.
In the Voronoi's section I mentioned, it should be
$$\left|\sum_{q_1\le \sqrt{X}}B\left(\dfrac{y}{q_1}\right)\right|\ll\sqrt{X}.$$
We also have, by mimicking the proof, but use instead Theorem 6.7, which states that if $I$ be a bounded interval in $\mathbb R$, and $f\in\mathcal C^1(I,\mathbb R)$ be a real function such that $f'$ is monotonic on $I$ and satisfies $\min_{x\in I}\lVert f'(x)\rVert\ge \lambda>0,$
$$\left|\sum_{n\in I}e\Big(f(n)\Big)\right|\le\dfrac{2}{\pi\lambda},$$
to obtain (by setting the absolute convergent Fourier series of $B(t)$, and I need no seperation as $r$) $$\left|\sum_{y\le X} B\left(\dfrac{y}{q}\right)\right|=\left|\sum_{y\le X} \sum_{j\ge 1}a_j\sin\left(2\pi j\cdot\dfrac{y}{q}\right)\right|=\left|\sum_{j\ge 1}a_j\sum_{y\le X}\sin\left(2\pi j\cdot\dfrac{y}{q}\right)\right|:=R,$$
where $a_j=-\dfrac{J}{2\pi^2j^2}\sin\left(\dfrac{2\pi j}{J}\right)$, and as in the book we have $|a_j|\ll\min(j,J)/j^2$.
$$R\ll \sum_{j\ge 1} |a_j|\left|\sum_{y\le X}\sin\left(2\pi j\cdot\dfrac{y}{q}\right)\right|\ll\sum_{j\ge 1} |a_j|\left|\sum_{y\le X}e\left( j\cdot\dfrac{y}{q}\right)\right|.$$
Thus, by theorem 6.7 above and $f(n)=jn/q$ with $I=(0,X]$ (as $f'(t)$ is a constant in the range) so $f'(t)=j/q$ be a constant, therby giving $\lambda = \lVert j/q\rVert$,
$$\sum_{j\ge 1}|a_j|\left|\sum_{0<y\le X}\sin\left(2\pi j\cdot\dfrac{y}{q}\right)\right|\ll\sum_{j\le J}'\dfrac{1}{j\lVert j/q\rVert}+\sum_{j>J}' J\cdot\dfrac{1}{j^2\lVert j/q\rVert},$$
where the $\sum'$ denotes the sum over which $q\nmid j.$
Therefore,
$$\sum_{j\ge 1}|a_j|\left|\sum_{y\le X}\sin\left(2\pi j\cdot\dfrac{y}{q}\right)\right|\ll\sum_{j\le J}\dfrac{1}{j(1/q)}+\sum_{j>J} J\cdot\dfrac{1}{j^2(1/q)},$$
which is $\ll q\log J+Jq$ and we can now choose $J>1$ to be $O(1)$ so that it is $\ll q$. Then, we plug in and obtain that
$$\left|\sum_{q^2\le y\le X} B\left(\dfrac{y}{q}\right)\right|\ll q.$$
Furthermore,
$$\sum_{q,q_1\le \sqrt{X}}\sum_{\max(q^2,q_1^2)\le y\le X}B\left(\dfrac{y}{q}\right)B\left(\dfrac{y}{q_1}\right)\ll \sum_{q\le \sqrt{X}}\left|\sum_{q^2\le y\le X}B\left(\dfrac{y}{q}\right)\right| \left|\sum_{q_1\le \sqrt{X}}B\left(\dfrac{y}{q_1}\right)\right|$$
Thus, it should be as desired that
$$\int_{0}^X R(y)^2 dy\ll \sum_{q\le \sqrt{X}} q\cdot \sqrt{X}\ll X^{3/2}.$$


text:
Q: Запуск скрипта python с флагом "-i" по умолчанию Имеется скрипт test.py, при нажатии на который открывается CMD, выполняется скрипт и окно закрывается.
Хотелось бы, чтобы после выполнения консоль оставалась в режиме интерпретатора.
Можно конечно создать bat файл с:
python -i test.py

Но хочется, чтобы всё было просто по открытию. Так будет удобней.

A: Для этого в windows есть Doskey.
Инструкция тут: https://dataart.ru/news/windows-aliasy-komandnoj-stroki/


text:
Q: how to display data(from database) in datagrid using silverlight? hi i am new to silver light. i want to display data from database in data grid. since ado.net cannot be used to retrieve data i am confused.
I have tried ado.net concepts. but its not working. i found that i have to use wcf to fetch data. so can anybody give me a step by step example to do that? that too using mvvm model.
i have created a model, view model folder. in view model i want to acces data.
model has one class i.e below
namespace emp.Models
{
    public class Employee
       {
          public int EmpId { get; set; }
           public String EmpFName { get; set; }
          public String EmpLName { get; set; }
        }
}

Thanks in advance.


text:
Q: Automatic closing ul of toggle menu In a toggle menu bar, I am trying to achieve an automatic closing of a menu when the user toggles between menus.
i.e., clicking on a new menu area should hide/close the ones that are already opened (being displayed). I tried some ways to hide this on clicking but couldn't succeed.
How to achieve this? The code is included below.
The code:

function toggle(element) {
  const nodes = getChildNodes(element.parentElement);
  if(nodes[1].style.display === 'block') {
    nodes[1].style.display = 'none';
  } else {
    nodes[1].style.display = 'block';
  }
}

function getChildNodes(node) {
  let children = new Array();
  for(const child in node.childNodes) {
    if(node.childNodes[child].nodeType == 1) {
      children.push(node.childNodes[child]);
    }
  }
  return children;
}
#ABT-Container  {
  font-family: 'Roboto', sans-serif;
  background: transparent;
  width:100%; float:right;
}

a {
  text-align: center;
  font-family: 'Roboto', sans-serif;
  color: #333;
}

#nav {
  float: right;
  font-family: 'Roboto', sans-serif;
  padding: 2px 6px 0;
  line-height: 100%;
  border-radius: 1em;
  background: white; /* for non-css3 browsers */
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#FFFFFF'); /* for IE */
  background: -webkit-gradient(linear, right top, right bottom, from(#FFFFFF), to(#FFFFFF)); /* for webkit browsers */
  background: -moz-linear-gradient(top,  #FFFFFF,  #FFFFFF); /* for firefox 3.6+ */
  border: solid 1px white;
}

#nav .current a, #nav li:hover > a {
 font-family: 'Roboto', sans-serif;
    background: white; /* for non-css3 browsers */
    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#FFFFFF'); /* for IE */
    background: -webkit-gradient(linear, right top, right bottom, from(#FFFFFF), to(#FFFFFF)); /* for webkit browsers */
    background: -moz-linear-gradient(top,  #FFFFFF,  #FFFFFF); /* for firefox 3.6+ */

    color: #444;
    border-top: solid 1px #FFFFFF;
    /*-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
    -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
    box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .8);*/
}
/* sub levels link hover */
#nav ul li:hover a, #nav li:hover li a {
 font-family: 'Roboto', sans-serif;
    background: none;
    border: none;
    color: #666;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
}
#nav ul a:hover {
 font-family: 'Roboto', sans-serif;
    background: #ff4718 !important; /* for non-css3 browsers */
    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff4718', endColorstr='#FF0000'); /* for IE */
    background: -webkit-gradient(linear, right top, right bottom, from(#ff4718), to(#FF0000)) !important; /* for webkit browsers */
    background: -moz-linear-gradient(top,  #ff4718,  #FF0000) !important; /* for firefox 3.6+ */

    color: #fff !important;
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}

#nav li {
  font-family: 'Roboto', sans-serif;
  margin: 0 5px;
  padding: 0 0 8px;
  float: right;
  position: relative;
  list-style: none;
}

/* main level link */
#nav a {
  font-family: 'Roboto', sans-serif;
  color: #353535;
  text-decoration: none;
  display: block;
  padding:  8px 20px;
  margin: 0;
  -webkit-border-radius: 0em;
  -moz-border-radius: 0em;
  text-shadow: 0 0px 0px rgba(0, 0, 0, .3);
}

/* level 2 list */
#nav ul {
  font-family: 'Roboto', sans-serif;
  background: #FFFFFF; /* for non-css3 browsers */
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#FFFFFF'); /* for IE */
  background: -webkit-gradient(linear, right top, right bottom, from(#fff), to(#FFFFFF)); /* for webkit browsers */
  background: -moz-linear-gradient(top,  #fff,  #FFFFFF); /* for firefox 3.6+ */
  display: none;
  margin: 0;
  padding: 0;
  width: 185px;
  position: absolute;
  top: 35px;
  right: 0;
  -webkit-border-radius: 1px;
  -moz-border-radius: 1px;
  border-radius: 1px;
  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .8);
  -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .8);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .8);
}

/* dropdown */
#nav ul li {
  font-family: 'Roboto', sans-serif;
  float: none;
  margin: 0;
  padding: 0;
}

#nav ul a {
  font-family: 'Roboto', sans-serif;
  font-weight: normal;
  text-shadow: 0 1px 1px rgba(255, 255, 255, .9);
}

/* level 3+ list */
#nav ul ul {
  font-family: 'Roboto', sans-serif;
  right: 181px;
  top: -3px;
}

/* rounded corners for first and last child */
#nav ul li:first-child > a {
  -webkit-border-top-right-radius: 1px;
  -moz-border-radius-topleft: 1px;
  -webkit-border-top-left-radius: 1px;
  -moz-border-radius-topright: 1px;
}

#nav ul li:last-child > a {
  -webkit-border-bottom-right-radius: 1px;
  -moz-border-radius-bottomleft: 1px;
  -webkit-border-bottom-left-radius: 1px;
  -moz-border-radius-bottomright: 1px;
}

/* clearfix */
#nav:after {
  font-family: 'Roboto', sans-serif;
  content: ".";
  display: block;
  clear: both;
  visibility: hidden;
  line-height: 0;
  height: 0;
}

#nav {
  font-family: 'Roboto', sans-serif;
  display: inline-block;
}

html[xmlns] #nav {
  font-family: 'Roboto', sans-serif;
  display: block;
}

* html #nav {
  height: 1%;
}

.menu_line{
  width: 25px;
  height: 2px;
  background-color: black;
  color: black;
  margin: 4px 0;
}

.expand{font-size:24px;float: left;margin: 0px -5px;}

.menu_line{
 width: 25px;
    height: 2px;
    background-color: black;
 color: black;
    margin: 4px 0;
}
#ABT-Container  {
  font-family: 'Roboto', sans-serif;
  background: transparent;
  width:100%; float:right;
}

a {
  text-align: center;
  font-family: 'Roboto', sans-serif;
  color: #333;
}

#nav {
  float: right;
  font-family: 'Roboto', sans-serif;
  padding: 2px 6px 0;
  line-height: 100%;
  border-radius: 1em;
  background: white; /* for non-css3 browsers */
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#FFFFFF'); /* for IE */
  background: -webkit-gradient(linear, right top, right bottom, from(#FFFFFF), to(#FFFFFF)); /* for webkit browsers */
  background: -moz-linear-gradient(top,  #FFFFFF,  #FFFFFF); /* for firefox 3.6+ */
  border: solid 1px white;
}

#nav .current a, #nav li:hover > a {
 font-family: 'Roboto', sans-serif;
    background: white; /* for non-css3 browsers */
    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#FFFFFF'); /* for IE */
    background: -webkit-gradient(linear, right top, right bottom, from(#FFFFFF), to(#FFFFFF)); /* for webkit browsers */
    background: -moz-linear-gradient(top,  #FFFFFF,  #FFFFFF); /* for firefox 3.6+ */

    color: #444;
    border-top: solid 1px #FFFFFF;
    /*-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
    -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
    box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
    text-shadow: 0 1px 0 rgba(255, 255, 255, .8);*/
}
/* sub levels link hover */
#nav ul li:hover a, #nav li:hover li a {
 font-family: 'Roboto', sans-serif;
    background: none;
    border: none;
    color: #666;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
}
#nav ul a:hover {
 font-family: 'Roboto', sans-serif;
    background: #ff4718 !important; /* for non-css3 browsers */
    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff4718', endColorstr='#FF0000'); /* for IE */
    background: -webkit-gradient(linear, right top, right bottom, from(#ff4718), to(#FF0000)) !important; /* for webkit browsers */
    background: -moz-linear-gradient(top,  #ff4718,  #FF0000) !important; /* for firefox 3.6+ */

    color: #fff !important;
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}

#nav li {
  font-family: 'Roboto', sans-serif;
  margin: 0 5px;
  padding: 0 0 8px;
  float: right;
  position: relative;
  list-style: none;
}

/* main level link */
#nav a {
  font-family: 'Roboto', sans-serif;
  color: #353535;
  text-decoration: none;
  display: block;
  padding:  8px 20px;
  margin: 0;
  -webkit-border-radius: 0em;
  -moz-border-radius: 0em;
  text-shadow: 0 0px 0px rgba(0, 0, 0, .3);
}

/* level 2 list */
#nav ul {
  font-family: 'Roboto', sans-serif;
  background: #FFFFFF; /* for non-css3 browsers */
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#FFFFFF'); /* for IE */
  background: -webkit-gradient(linear, right top, right bottom, from(#fff), to(#FFFFFF)); /* for webkit browsers */
  background: -moz-linear-gradient(top,  #fff,  #FFFFFF); /* for firefox 3.6+ */
  display: none;
  margin: 0;
  padding: 0;
  width: 185px;
  position: absolute;
  top: 35px;
  right: 0;
  -webkit-border-radius: 1px;
  -moz-border-radius: 1px;
  border-radius: 1px;
  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .8);
  -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .8);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .8);
}

/* dropdown */
#nav ul li {
  font-family: 'Roboto', sans-serif;
  float: none;
  margin: 0;
  padding: 0;
}

#nav ul a {
  font-family: 'Roboto', sans-serif;
  font-weight: normal;
  text-shadow: 0 1px 1px rgba(255, 255, 255, .9);
}

/* level 3+ list */
#nav ul ul {
  font-family: 'Roboto', sans-serif;
  right: 181px;
  top: -3px;
}

/* rounded corners for first and last child */
#nav ul li:first-child > a {
  -webkit-border-top-right-radius: 1px;
  -moz-border-radius-topleft: 1px;
  -webkit-border-top-left-radius: 1px;
  -moz-border-radius-topright: 1px;
}

#nav ul li:last-child > a {
  -webkit-border-bottom-right-radius: 1px;
  -moz-border-radius-bottomleft: 1px;
  -webkit-border-bottom-left-radius: 1px;
  -moz-border-radius-bottomright: 1px;
}

/* clearfix */
#nav:after {
  font-family: 'Roboto', sans-serif;
  content: ".";
  display: block;
  clear: both;
  visibility: hidden;
  line-height: 0;
  height: 0;
}

#nav {
  font-family: 'Roboto', sans-serif;
  display: inline-block;
}

html[xmlns] #nav {
  font-family: 'Roboto', sans-serif;
  display: block;
}

* html #nav {
  height: 1%;
}

.menu_line{
  width: 25px;
  height: 2px;
  background-color: black;
  color: black;
  margin: 4px 0;
}

.expand{font-size:24px;float: left;margin: 0px -5px;}

.menu_line{
 width: 25px;
    height: 2px;
    background-color: black;
 color: black;
    margin: 4px 0;
}

◂Our Technology

◂Sub-Row

Sub Sub-Row 1

Sub Sub-Row 1

Sub Sub-Row 1

Sub Sub-Row 1

◂Sub-Row

Sub Sub-Row 2

Sub-Row

Sub-Row

◂Multi-Levels

Team

Sub-Level Item 1

Sub-Level Item 1

Sub-Level Item 11

Sub-Level Item 22

Sub-Level Item 33

Sub-Level Item 1

Sales

Another Link

◂Department

Sub-Level Item 2

Sub-Level Item 2

Sub-Level Item 2

Services

About US

Contact US

Our Links

A: @edit previous jsbin link wss wrong, this should be the correct bin example here:
https://jsbin.com/metavuq/edit?html,css,js,output
The document has to know you are clicking outside menu.  While there are several ways to accomplish this, this is the simplest in my opinion.
Add this id to your markup (inside your inner ul) so you can target it with js easier, like so :

Then create an event listener that will listen for a click anywhere that is not your nav element like so:
document.addEventListener('click', function(event) {
  if (event.target.closest('#nav')) {
    return;
  } else {
   document.querySelector('#dropdown').style.display = 'none';
  }
});

This event listener listens for clicks on the document and performs what you need when the click is outside your specified area.


text:
Q: How to use a PostgreSQL DB as XMLA datasource? Basis:

*

*PostgreSQL database with normal and reporting data

*Downloaded the Mondrian zip from here

*I have a client pivot grid component (DevExtreme Web)

As i understand it so far, i have to use a OLAP-server that functions as connector between MDX querys and a SQL database to provide XMLA as datasource. Therefor i want to use the Mondrian OLAP-server.
Question:
Now i need to start the Mondrian OLAP-server, connect it to the PostgreSQL database and provide a OLAP-schema.

*

*How to start the Mondrian OLAP-server?

*How to connect it to a PostgreSQL database?

*How to provide a schema to the mondrian server?

*And finaly, how to connect to the mondrian server?

I can't find any step by step guide or any usefull documentation of mondrian. It's all a big cloud to me.

A: The Problem
After many, many hours i found this thread: Github - Mondrian issue 202
The Mondrian developer, in this thread, clearly state that nearly the whole documentation is outdated and doesn't have much todo with the actual Mondrian 4 OLAP server.
They say that Mondrian 4 is no longer shiped with a deployable WAR file and the schema has big changes.

Start Mondrian OLAP Server
To get Mondrian running i downloaded this maven project that starts a mondrian server: mondrian-xmla-spike
I got everything running with the discribed derby Foodmart database.
You can either import the project as maven project in an IDE of your choice (what i did) or run mvn via. console.

Use Mondrian as XMLA provider
In the maven project you have to check all files (not many) for hardcoded paths and change them to your environment.
If you have done this, and startet the project as application, the Mondrian Server should be accessible via. a jetty server on the address http://localhost:8888/xmla
You can connect any component that can use a XMLA datasource and does support Mondrian OLAP server! The last part is very important. Mondrian doesn't comply with the MDX standard completely. Bad decision on the side of Penthao! Most OLAP-components or BI-tools only support MS SQL Server as XMLA datasource.

Connect Mondrian to PostgreSQL DB
To connect the existing maven project to a PostgreSQL DB i had to do some steps:

*

*Update the Mondrian Version in the pom (xmla-spike.xml) file to a 4.x Version (i used 4.3.1.5-191). You can choose one from here: Penthao Mondrian Versions

*Download the correct JDBC driver (for me it was JDBC42): PostgreSQL JDBC Driver and add the JDBC driver (.jar) to your project libraries
Or add the correct JDBC driver (i used 9.4.1209) from here: PostgreSQL JDBC Driver JDBC 4.1 to your maven pom (xmla-spike.xml).

*Change the <DataSourceInfo> in the datasource.xml to:
Provider=mondrian;Jdbc=jdbc:postgresql://localhost:5432/default?user=postgre;JdbcDrivers=org.postgresql.Driver;Catalog=/WEB-INF/Schema.xml;

*

*DB url: jdbc:postgresql://localhost:5432/default?user=postgre

*=> jdbc:postgresql://host:port/database

*Create the Schema.xml file and write a simple schema as descriped here: How to Design a Mondrian 4 Schema
You can look at the Foodmart example Schema with metamodel 4 here: Foodmart.xml metamodelVersion="4.0"

*The <Catalog name="*"> must mach the schema name of the Schema.xml

This does work for me. I hope i can help someone else with this. If i forgot some steps, pls comment and i will add the missing steps.


text:
Q: How to split an application so multiple developers can work on it together? Background
There are a lot of good resources on how to use MVVM/MVP to separate your layers so that the designer and coder can work separately. This isn't a PRISM question, but I have also checked several Prism tutorials ( including this  excellent 4+ hours series by Microsoft' Mike Taulty, and many more)
These tutorials/books/videos explain the internal workings, such as how to pass messages across view models, how to modularize the application, the best security practices and so on.
However, no one talks about how to actually *logically divide*an application (WPF or ASP.Net MVC) so that multiple people can work on it.
Question
How do you generally go about assigning responsibilities to your development team?
Assuming that you use a high level UML tool, once a high level diagram is ready but no code has been written, how do you ensure that
1- The developer(s) working on the UI will know and be able to access the class library functions that the class-library developers will write?
2- Two libraries that will be written for two different purposes by two different developers will inter operate?
I hope I am not being confusing here. The question is just for a few good rules of thumb. That as two people working on two projects ( WPF/Silverlight or ASP.Net MVC) in a solution will take two different ways , how do the methods/classes/functions written by one fit together with the others?
Thank you

A:
However, no one talks about how to actually *logically divide*an application (WPF or ASP.Net MVC) so that multiple people can work on it.

You don't really need to divide an application so that multiple people can work on it: you can also use a Team Foundation Server. There's also a free version available for 5 users or fewer.
Tutorial: Getting Started with TFS in VS2010

A: As I understand of your question(s), you want to have an infrastructure in your project that people with different skills can work separately. If I were right, "Domain Driven Design" would be the best infrastructure you can choose.
Domain-driven design (DDD) is an approach to develop software for complex needs by connecting the implementation to an evolving model. The premise of domain-driven design is the following:

*

*Placing the project's primary focus on the core domain and domain logic.

*Basing complex designs on a model of the domain.

*Initiating a creative collaboration between technical and domain experts to iteratively refine a conceptual model that addresses particular domain problems.
The term was coined by Eric Evans in his book of the same title.
There is a great project that can help you: Microsoft Spain - Domain Oriented N-Layered .NET 4.0 Sample App is based on simple scenarios easy to understand which is well documented.
Concepts like modularity, layering, etc. are discussed in the project very carefully which I believe can fulfill your expectation.
Obviously, you need a source control like Team Foundation Server or other alternatives that provide control over changes to source code among multiple developers.

A:
That as two people working on two projects ( WPF/Silverlight or
  ASP.Net MVC) in a solution will take two different ways , how do the
  methods/classes/functions written by one fit together with the others?

You need maintain some common library for public functions. And the two developers need to make code review every 2 or 3 weeks. So they could find their difference and learn from each others.


text:
Q: Bit by bit comparison between two variables in Verilog Currently, I am beginning to write the firmware by Verilog for one idea. It is comparing bit by bit between two variables and then using one binary counter to count the number of different bits.
For example:
I have two variables in verilog
A : 8'b00100001;
B : 8'b01000000;
Then I give the condition to compare bit by bit between two variables. If there is difference between 1 bit of A and 1 bit of B at same bit position, binary counter will count.
This is my verilog code:
module BERT_test(
  input CLK,
  input RST,
  input [7:0] SIG_IN,
  input [7:0] SIG_OUT,
  output [7:0] NUM_ERR
);
  integer i;
  reg[7:0] sign_in;
  reg[7:0] sign_out;

  always @(posedge CLK) begin
    sign_in[7:0] <= SIG_IN[7:0];
    sign_out[7:0] <= SIG_OUT[7:0];
  end

  reg [15:0] bit_err;

  // Combinational Logic
  always @* begin
    bit_err = 8'b0;
    for (i=0;i<8;i=i+1) begin
      if (sign_in[i] == sign_out[i]) begin
        bit_err = bit_err + 8'b0;
      end else begin
        bit_err = bit_err + 8'b1;
      end
    end
    assign NUM_ERR = bit_err;
  end
endmodule

Then I had a mistake

Reference to vector wire 'NUM_ERR' is not a legal reg or variable lvalue

I do not know how to solve this problem. Are there any solutions for this problem or how I need to modify my firmware, please suggest me.

A: You are driving NUM_ERR (a net) from an always block. It is not permitted to drive nets from always blocks (or initial blocks). You need to move this line:
assign NUM_ERR = bit_err;

outside the always block.
You should not use an assign statement inside an always block. This is legal but is deprecated and means something weird. If you have included this line inside the always block by mistake, then indenting you code properly would have shown it up.

A: You have an assign WITHIN an always block. Move it outside.
Adding zero to bit error if the bits are the same is superfluous.
if (sign_in[i] != sign_out[i])
  bit_err = bit_err + 8'b1;

Also bit error is 16 bits so it is not wrong to add 8'b1 but misleading.


text:
Q: What exactly is the difference between a frontend and a backend when it comes to websites? I'm fairly sure that the simplest explanation is that the frontend is what you can see on the website and the backend is everything that happens behind the scenes.
But I'm trying to make my own website and I'm not sure how this distinction applies to it.
The website is not supposed to allow for account creation or anything, its just really supposed to request my instagram posts and more or less display them. (Its an art gallery of sorts)
I'm confused as to whether the requesting is considered backend or frontend. I'm leaning towards frontend because it causes a visual change but then I'm wondering if that's the case, would a website like this even need a backend?

A: You can have pure front end websites too. For example, websites that have static information can be only front end. And You're right that your website sounds pure front end since you're requesting the Instagram service (which becomes your backend here).
The front end code runs completely on the client browser while the backend code runs on a server/cloud. This is the main distinction.
Why do we need backend code to run on the server? If you can have a website that is pure front end i.e. runs completely on the client side, will it be fast enough? That's where we split the heavy logic and place it on the server to give less work to the client browser. Hence the front end focuses on displaying/rendering the data while the backend focuses on fetching and processing the data.


text:
Q: c# ERROR : The modifier 'private ' is not valid for this item It doesn't matter what modifier I put on the front of the function(I've tried with public, private and even protected), I always receive an error, the same error. The code is clean only after I delete the modifier and I left the function "Array()" without one. Can someone look at my code and explain to me what is happening please, I am new to c#, and also new to asking help, so please excuse every mistake I've made so far.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {

            public void Array()//nu se pune in interiorul functiei void Main (), deoarece va forma nesting, si ne va da eroare la compilare.
            {
                int[] intArray;
                intArray = new int[3];//all values will be 3

                var doubleArray = new[] { 34.23, 10.2, 23.2 };

                //var arrayElement = doubleArray[0];
                //doubleArray[1] = 5.55;

                for (var i = 0; i < intArray.Length; i++)
                {
                    Console.WriteLine(intArray[i]);
                }
            }

        }

    }
}

I've posted the code and the image of it down below.
In this image you can see the code

A: You have a nested function, in C# these are called local functions and don't have scope. so you need to remove the access modifier, for example:
public static void PrintHelloWorld()
{
    string GetName()
    {
        return "world";
    }

    Console.WriteLine($"Hello {GetName()}");
}

A: You are creating a nested method (also called local function).
Nested methods may not have access modifiers. They are only accessible from within this method.
For reference: https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/local-functions

A: You are putting your private function inside a static function.  Remove the private.

A: Move the function out of the Main function. Also you should mark it as static and then use it as you intend. This in case you don't want a nested method as it is already answered.