text:
Q: Multi Line Text Area In Editor ExtJs I have a comment text area in an editor in the grid, but if i write some text and then i push the enter it just complete edit and not create new line. What i want is if i hit enter key, its create new line like this:
Example :
" Wrong list:

*

*asdasdasd

*asdasdasdas"
Now i just write in comment like this : "Wrong list: 1.asdasd 2.asdasdasd"
What i must to do with my js?
This is the grid i have:

This is the code :
var chat_grid = Ext.create('Ext.grid.Panel', {
    id: 'chatGrid',
    store: SuratPesananChatDetailStore,
    height: 350,
    title: 'Comment Grid',
    viewConfig: {
        emptyText: '
 Tidak ada data
',
        getRowClass: function (record, rowIndex, rp, store) {
            return 'rowgridspdetailnonstd-height';
        }
    },
    plugins: Ext.create('Ext.grid.plugin.RowEditing', { clicksToEdit: 2, pluginId: 'rowEditingID' }),
    frame: true,
    loadMask: true,
    stripeRows: true,
    autoScroll: true,
    selModel: GridChatSelectionModel,
    cls: 'rowgridspdetailnonstd-height',
    tbar:
        [
            {
                id: "IdAddCommentLookUp",
                text: "Add Comment",
                iconCls: "icon-grid-add",
                listeners:
                {
                    'click': function () {
                        AddCommentListener();
                    }
                }

            },
            {
                id: "IdDeleteChat",
                text: "Delete Comment",
                iconCls: "icon-cancel",
                disabled: true,
                listeners:
                {
                    'click': function () {
                        DeleteChatListener();
                    }
                }

            },
            {
                id: "IdInviteUser",
                text: "Invite User",
                iconCls: "icon-grid-add",
                hidden: true,
                listeners:
                {
                    'click': function () {
                        InviteUserLookUp();
                    }
                }
            }
        ],
    columns:
        [

            {
                header: 'Date',
                dataIndex: 'CreatedOn',
                width: 120,
                hidden: false,
                sortable: false,
                sortableColumn: false
            },
            {
                header: 'Comment',
                dataIndex: 'Comment',
                editor: { xtype: 'textareafield', allowblank: false, maxLength: 165, enforceMaxLength: true, height: 100, grow: true, completeOnEnter: false },
                hidden: false,
                width: 370,
                sortable: false,
                sortableColumn: false
            },
            {
                header: 'Created By',
                dataIndex: 'CreatedBy',
                width: 120,
                hidden: false,
                sortable: false,
                sortableColumn: false
            },
            {
                header: 'Department',
                dataIndex: 'Department',
                width: 120,
                hidden: false,
                sortable: false,
                sortableColumn: false
            },
            {
                header: 'Document Name',
                dataIndex: 'FileName',
                width: 150,
                hidden: false,
                sortable: false,
                sortableColumn: false
            },
            {
                header: 'Upload Document',
                dataIndex: 'Panel',
                width: 120,
                hidden: false,
                sortable: false,
                sortableColumn: false,
                renderer: function (v, m, r, row) {

                    if (r.data.Panel == 'Download') {
                        var fileName = r.data.FilePath;
                        return "" + v + "";
                    }
                    else if (r.data.Panel == 'Upload') {
                        return "" + v + "";
                    }
                    else {
                        return v;
                    }

                }
            }
        ]
});

I have try all the way in google but i can't solve this case.

A: Enable keyevents of your comment editor, and stopEvent() in Enter key
Sample config:
         editor: {
            xtype: 'textareafield',
            allowblank: false,
            maxLength: 165,
            enforceMaxLength: true,
            height: 100,
            grow: true,
            completeOnEnter: false,
            enableKeyEvents: true, //Listen to keyevents
            listeners: {
                keydown: function(field, e) {
                    if (e.getKey() == e.ENTER) {
                        e.stopEvent(); // Stop event propagation
                    }
                }
            }
        }

Ref: https://www.sencha.com/forum/showthread.php?293592-Stop-RowEditing-plugin-from-completing-the-edit-on-keypress-enter


text:
Q: Sign Driver on Win2003 32-bit I signed a driver on Win2003 32-bit, and it can't run on Win2007 x64. I checked the properties, and there is right digit signature information.
I tried to sign on Win2008 x64, and it worked!
Does any one know the reason?

A: Because a 32-bit driver can't run on 64-bit Windows.

A: I found that it effected by certificated file. It's only normal on vista+. I'm finding the root cause.

redpajama_set_name: RedPajamaStackExchange


text:
Q: how to implement a progress bar in react?
I want to make this component, both the start and end point should move continuously, when the end point reaches the end, it should start from beginning. I am currently using antD  progress bar.
Was thinking to use requestAnimationtionFrame , but the value isn't getting updated
My Ques are these:

*

*How to move the start point ?

*How to make this continuous?

useEffect(() => {
    if (loading == true && loadingPercent != 100) {
        if (loadingPercent > 90) {
            setPercent(0);
        }
        const percentage = setTimeout(() => {
            setPercent(loadingPercent + 40);
        }, 1);
        return () => {
            clearTimeout(percentage);
        };
    }
}, [loadingPercent]);

<Progress showInfo={false} percent={loadingPercent} size="small" />

I was trying with this but didn't work
const changePercent = () => {
    console.log(loadingPercent);
    if (loading === false) {
        console.log(loadingPercent);
        return;
    } else {
        if (loadingPercent < 99.9) {
            const rotation = loadingPercent + 50;
            setPercent(rotation);
            console.log(loadingPercent);
        } else {
            setPercent(0);
        }
        if (loading == true) requestAnimationFrame(() => changePercent());
    }
};

Note: I wan't to start this loading whenever loading == true

A: You can try on this way
in Progressbar component
return (

    <div className={`progress-bar`} style={{ width: percent + "%" }}>

  {isLoading == false && showInfo ? (
    {percent}%
  ) : (
    ""
  )}

);
in your component from call progressbar like this
<ProgressBar
    isLoading={true}
    percent={50}
    size={"medium"}
    showInfo={false}
 />

you change status depend on your data/api response.
also, find out more this link: Live demo codesandbox
Thanks

A: use mui design system with react
https://mui.com/
this api: https://mui.com/components/progress/#linear
example:
<LinearProgress />


text:
Q: Converting MySQL result array to JSON I want to convert my database query's result array to JSON format in PHP. Here is my code:
$row = mysql_fetch_array($result)

I want to convert $row to JSON format and pass the JSON data to a jQuery plugin.

A: json_encode is available in php > 5.2.0:
echojson_encode($row);

A: $result = mysql_query($query) or die("Data not found.");
$rows=array();
while($r=mysql_fetch_assoc($result))
{
$rows[]=$r;
}
header("Content-type:application/json");
echo json_encode($rows);


text:
Q: Typescript type boolean is not assignable to void myContact = [
 {
  name: 'John',
  lastName: 'Doe',
  phone: 123456789
 },
 {
  name: 'Mark',
  lastName: 'Doe',
  phone: 98765432
 }
]

On click event, add a condition to check the array length, if the length > 2.
onClick() {

 if(myContact.length > 2)
     redirect page...
    return false; // don't want the code to continue executing
 }

error: Typescript type boolean is not assignable to void
I try something similar using some(), the below my conditions works as required
let checkValue = myContact.some(s => s.name === 'John')
if(checkValue)return false

But if I try similar with my contact, E.G
let checkLength = myContact.filter(obj => obj.name).length
if(checkValue)return false   // error: error: Typescript type boolean is not assignable to void

How can I fix this issue,

A: A void type means that the function does something but doesn't return a value. That means that a function with the type void can't return a boolean either. As TypeScript expects it to return nothing.
You most likely have a function declared something like this:
const functionName = (): void => {
  ...
}

Besides that, this doesn't seem to be the core of the issue here. If you want your function to "return early" and stop executing the rest of its logic. You can explicitly tell it to return nothing like this:
const functionName = (): void => {
  if (someCondition) {
    return;
  }

  // This code won't run if `someCondition` is true.
  someOtherLogic()
}


text:
Q: Mongo non directional graph database I need to create a graph database based on MongoDB and its $graphlookup func to answer the following problem:
Lets assume I have a list of transaction between people. here is an example of a transaction:
{
  from: "A",
  to: "B",
  value: 1
}

I need to create a non directional graph that describes this connections. every node should be a person and every edge should have a volume: the number of transactions these 2 people made between them.
for example if i am given the following list:
[
{
  from: "A",
  to: "B",
  value: 1
},
{
  from: "B",
  to: "A",
  value: 3
}
]

Both of these transaction should represented by one edge with a volume of 2.
My problem is I don't see how mongo $graphlookup can create a non-directional relationships.
Should the data be preprocessed before uploading it to the mongodb database?
How should I query it to achieve a non-directional graph like results?
I need to achive the following results.
given the input:
[
  {
    from: "A",
    to: "B",
    value: 1
  },
  {
    from: "B",
    to: "A",
    value: 3
  },
  {
    from: "C",
    to: "A",
    value: 6
  },
  {
    from: "C",
    to: "A",
    value: 10
  },
  {
    from: "A",
    to: "C",
    value: 20
  }
]

I want to create a graphlookup that will return something of this sort:
{
   "startedAddress": "A",
   "neighboors": [
      {"address": "C", "volume": 3, "depth": 1},
      {"address": "B", "volume": 2, "depth": 1}
   ]
}

A: Use $setUnion to create an array to store the 2 ends of the edges and use the result as id to perform $group to sum the volume.
db.collection.aggregate([
  {
    "$group": {
      "_id": {
        "$setUnion": [
          [
            "$from"
          ],
          [
            "$to"
          ]
        ]
      },
      "volume": {
        "$sum": 1
      }
    }
  }
])

Mongo Playground


text:
Q: How can i get requestId from facebook api when i invite someone I want to use facebook unity sdk to achieve the function that can invite new player from my facebook friends.I can't find how to get requestid if the friend click the notify then he go to appstore and download the game.
I already know i can get all requests from facebook by using me/appresquest function,but it is not my wonder.I just want get a definite requestid so I can only get one invter to give him reward when a friend click the notify who send to.the facebook just say "When a recipient accepts a request on a mobile platform, this will deep-link to the app. An additional parameter will be present in the loading of the app, the request ID."
I coundn't find any ways to get the purpose.From the docs,I guess the requestId will be sent to ios or Android when the new user click the notify,then the player download the game.the os will give the requestId if the player first open the app,the facebook Unity SDK could get the requestId,so the developer could get it from SDK.but is that right?i don't know,and i want to know how to get it.
Please help me (some question is so far from now,i think it's out of time,please give me the lateset advices)


text:
Q: How to improve the perfomance of a MySQL query on Python My query is quite simple but it takes too much time to end. I have a database in which there are several tables, I need to check the name and also a variable that contains a datetime information. But for each table i spend more than 100 seconds.
query = "show tables"
cursor.execute(query)
tables_info = cursor.fetchall()

tables_info = [x[0] for x in tables_info]

time_month_year = []

for index in tqdm(range(len(tables_info))):
    monthyearquery = "select tempo from {}".format(tables_info[index])
    cursor.execute(monthyearquery)
    tables_time_info = cursor.fetchall()
    r = tables_time_info[0][0].strftime('%b %Y')
    time_month_year.append(r)

Is there any way for me to improve this query? I couldn't find anything helpful.

A: You are fetching the whole table fetchall() just to get the first column of the first row tables_time_info[0][0], use limit 1 in the select to have it returning just a single row.
time_month_year = []

for table_name in tables_info:
    query = "select tempo from {} limit 1".format(tables_info)
    cursor.execute(query)
    tables_time_info = cursor.fetchall()
    r = tables_time_info[0][0].strftime('%b %Y')
    time_month_year.append(r)

Note that you can also use fetchone but it won't bring a performance boost since you've only fetched 1 row anyway, its just more elegant
tables_time_info = cursor.fetchone()
r = tables_time_info[0].strftime('%b %Y')


text:
Q: Where is the Cygwin config.log file located I have installed cygwin recently and have installed all the required packages. I was trying to install libevent-2.1.8-stable. When I did ./configure it shows C compiler cannot create executables. See config.log for more details. But where can I find the config.log file? I have searched the cygwin installation directory but found nothing.

A: the config.log is produced by configure and it is in the directory where you run ./configure
C compiler cannot create executables could mean:
you have missed to install something or likely an antivirus is interfering with the compiler.


text:
Q: Why isn't it working for "not xy balanced"? We'll say that a String is xy-balanced if for all the 'x' chars in the string, there exists a 'y' char somewhere later in the string. So "xxy" is balanced, but "xyx" is not. One 'y' can balance multiple 'x's. Given a string str, Print "xy balanced"if the given string is xy-balanced otherwise print "not xy balanced".
public static void main(String[] args)
{
    Scanner scan = new Scanner(System.in);

    String str = scan.next();
    int x = str.length();
    boolean xyBalanced = false;

    for(int i = x - 1; i >= 0; i--)
    {
        char y = str.charAt(i);

        if(y == 'y')
            xyBalanced = true;

        else if(y == 'x')
            xyBalanced = false;

        else
            xyBalanced = true;
    }

    if(xyBalanced = true)
        System.out.print("xy balanced");

    else if(xyBalanced = false)
        System.out.print("not xy balanced");
}

It's giving me "xy balanced" when I input aabbx when in fact it should give "not xy balanced". What is wrong with this code?

A: Why do you check from the end of the string to the start? It is very difficult to understand.
Apart from the if/else issue you have at the end of your program, which you can change to below, your program still doesn't work after I corrected it.
System.out.print(xyBalanced ? "xy balanced" : "not xy balanced");

To check if there is always a 'y' on the right of an 'x', you can use the following loop - basically, an 'x' always set the xyBalanced flag to false and a 'y' always set it to be true.
public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);

    String str = scan.next();
    int length = str.length();
    boolean xyBalanced = true;

    for (int i = 0; i < length; ++i) {
        if (str.charAt(i) == 'x') {
            xyBalanced = false;
        } else if (str.charAt(i) == 'y') {
            xyBalanced = true;
        }
    }

    System.out.print(xyBalanced ? "xy balanced" : "not xy balanced");
}

A: The statement:
if(xyBalanced = true)

Is an assignment operator, it should be using the == operator:
if(xyBalanced == true){
    System.out.print("xy balanced");
} else {
    System.out.print("not xy balanced");
}

Since it's a boolean you can also say:
System.out.print( (!xyBalanced? "not" : "") + "xy balanced");

However, from your logic, it seems like you can also say
boolean xyBalanced = str.lastIndexOf('x') < (str.length()-1);

Because you are considering non-x/non-y characters.
So really you can simplify all the code into two lines.
Also there is an issue with your loop.  You're actually going from the right to left. Is that intentional?
for(int i = x - 1; i >= 0; i--)

would seem like it should be:
for (int i=0;i<x;i++)

A: you can do following for identifying balanced string
boolean xyBalanced = inputString.lastIndexOf('x') < inputString.indexOf('y');

indexOf function always returns first occurrence of string. We can check if last index of x is less than first index of y, and variable 'xyBalanced' will be accordingly get true or false.

A: public boolean xyBalance(String str) {
if(str.endsWith("x")){
System.out.println("false");
return false;
}
if(str.endsWith("y")){
System.out.println("true");
return true;
}
if(str.lastIndexOf("x")>str.lastIndexOf("y")) {
System.out.println("false");
return false;
}
System.out.println("true");
return true;
}


text:
Q: ads.stackoverflow.com is slowing down the site Dont know where to ask or report this but stackoverflow 'hangs' a minute on loading the ads.

A: We have migrated to a new ad provider - you caught us in the middle of deployment.


text:
Q: How can I exclude a package from the clover coverage report (running from Maven)? I'm generating clover coverage reports (using Clover's maven plugin), and I'd like to exclude a certain package from the coverage reports (specifically, because it's UI code that intentionally isn't covered by my unit tests, but the reason doesn't really matter.)
I can see how to exclude that package from being instrumented (using  in the plugin configuration), but I can't see how to exclude it from the report.  The intended solution appears to be to use a Context; however, there is no package-level context available (only block, method, and statement.)

A: As far as I know, excluding classes from instrumentation should exclude them from the report as well. Answers to the question #9 of this thread seem to confirm this:

9) Are their independent options for filtering at both the instrumentation level and at the reporting level?
Yes. The clover-setup takes a fileset of files to instrument. All clover-report tasks also take a fileset of sources to report coverage on. The clover-maven2-plugin provides includes/excludes at instrumentation time and full Ant fileset support for filtering at report time. Ant filesets give you all the power of fileset selectors to determine which files to include/exclude.

Could you try to do a full clean build (delete all previously compiled classes and all files in the Clover DB) to ensure that previously instrumented versions of your UI classes are removed and check again.
If this doesn't work, please run you build with the debug option (mvn -X  > output.txt) and attach the output and your pom.xml to this question.


text:
Q: Save/Load Form Input Values in Web App I'm developing an app which is practically a glorified calculator. I need this app to be able to save values to a client-side db (located on users device) on user request and then be able to load a saved calculation and input any specific set of saved values back into the form.
I've looked for answers but have really only found tutorials/walkthroughs pertaining to submitting forms in apps and passing the input values but nothing about how to do so and store/recover multiple entries. These are a couple sites I've used to get a basic understanding.:
http://mobile.tutsplus.com/tutorials/mobile-web-apps/jquery-mobile-forms/
and
http://ofps.oreilly.com/titles/9780596805784/ch05_id35816678.html
Any help would be greatly appreciated.
I'm currently using jquery mobile, developing/testing as a web app, and compiling into android and ios native apps using phonegap.

A: Since the Chrome has a 4kb limit on the size of a cookie, I'd go with HTML 5's localStorage.  However, if the size of the cookie will be less than 4kb, then I'd go with cookies since they are more likely to be supported.  I'll list a few options you can use:
Option 1: Cookies
If you want to use cookies with jQuery, you'll need this plugin: http://plugins.jquery.com/project/Cookie.
Then you can set cookies like so:
$.cookie("key", "value");

Then, if we want to get the cookie, we simply type:
$.cookie("key");

For more info on how to get and set cookies, check this blog post (I wrote the blog post to be fair).
Option 2: HTML5 Local Storage
If the mobile browser supports local storage, then you can use it to store more than 5kb of data.
In order to use local storage, you simply use it like any other object in Javascript:
if(localstorage.data) {
  // Do something with localstorage.data
} else {
  // Set localstorage.data
}

Option 3: Cookies and Server Side Data
Option 3 is the safest bet.  Create a session cookie on the client side and associate the data with the session cookie on the server side.
While this isn't what you want (since you wanted the data on the client side), it would give you the most flexibility.


text:
Q: Complex Update Query on SQL Server I have three tables:

*

*School: SchoolID, SchoolName, City, State,...

*Student: StudentID, SchoolID (fk), FirstName, LastName, Birthdate,...

*StudentTest: StudentTestID, StudentID (fk), TestDate, Grade,...

Sometimes I know that students transfer to different schools, in which case I simply change Student.SchoolID to the new SchoolID.
Often I do not find out a student has transferred, in which case I end up with two students with identical FirstName, LastName, Birthdate but different SchoolID. I'll call these duplicate students (an index prevents all four fields from being identical). When this occurs, I have to go to the StudentTest table and change StudentTest.StudentID to match the new StudentID. After all the tests are transferred to the "new" student I can delete the old student record.
In cleaning up a SQL Server database with 35,000 students, I have 1600 students duplicated, with varying numbers of tests connected with the duplicate students.
I can select the tests of duplicate students so that they are grouped together, taken from a view (vwTestList, that combines some student information with test information):
SELECT
    a.SchoolID as SchID, a.StudentID as StudID, a.StudentTestID as TestID,
    a.LastName as LName, a.FirstName as FName,
    a.Birthdate as BDate, a.Testdate as Tdate, a.Grade
FROM
    dbo.vwTestList a
JOIN
    (SELECT
         firstname, lastname, BirthDate, SchoolID
     FROM
         dbo.vwTestList
     GROUP BY
         firstname, lastname, BirthDate, SchoolID
     HAVING
         COUNT(*) > 1) b ON a.firstname = b.firstname
                         AND a.lastname = b.lastname
                         AND a.BirthDate = b.BirthDate
                         AND a.SchoolID <> b.SchoolID
ORDER BY
    a.LastName, a.FirstName, a.BirthDate, a.Testdate DESC

Sample Results:
SchID   StudID  TestID LName    FName   Bdate       TDate      Grade
----------------------------------------------------------------------
461     16172   142773  Auk     Jay     2000-06-29  2010-04-13  4.7
461     16172   136350  Auk     Jay     2000-06-29  2009-04-14  3.7
146     5234    128517  Auk     Jay     2000-06-29  2008-04-01  2.7
146     5234    123560  Auk     Jay     2000-06-29  2007-04-10  1.7

However, I cannot figure out an update query that will change all the tests for each set of duplicate students to the StudentID of the most recent test in the set. In the example, all of Jay Auk's tests should end up with a StudentID of 16172. Any help would be appreciated!

A: Check out the following example and see if this helps you get started. This example can be run in SSMS.
-- replicate environment --

DECLARE @TestView TABLE (
    SchID INT, StudID INT, TestID INT, LName VARCHAR(30), FName VARCHAR(30), BDate DATETIME, TDate DATETIME, Grade DECIMAL(10,1)
)

INSERT INTO @TestView (
    SchID, StudID, TestID, LName, FName, BDate, TDate, Grade
)
VALUES
  ( 461, 16172, 142773, 'Auk', 'Jay', '2000-06-29', '2010-04-13', 4.7 )
, ( 461, 16172, 136350, 'Auk', 'Jay', '2000-06-29', '2009-04-14', 3.7 )
, ( 146, 5234, 128517, 'Auk', 'Jay', '2000-06-29', '2008-04-01', 2.7 )
, ( 146, 5234, 123560, 'Auk', 'Jay', '2000-06-29', '2007-04-10', 1.7 )
, ( 152, 17899, 123561, 'Gates', 'Bill', '1955-10-28', '2007-04-15', 4.7 )
, ( 152, 17899, 123562, 'Gates', 'Bill', '1955-10-28', '2007-04-14', 3.7 )
, ( 157, 5235, 123563, 'Gates', 'Bill', '1955-10-28', '2007-04-01', 2.7 )
, ( 157, 5235, 123564, 'Gates', 'Bill', '1955-10-28', '2007-04-10', 1.7 );

-- starting data --

SELECT * FROM @TestView;

Returns:
+-------+--------+--------+-------+-------+-------------------------+-------------------------+-------+
| SchID | StudID | TestID | LName | FName |          BDate          |          TDate          | Grade |
+-------+--------+--------+-------+-------+-------------------------+-------------------------+-------+
|   461 |  16172 | 142773 | Auk   | Jay   | 2000-06-29 00:00:00.000 | 2010-04-13 00:00:00.000 | 4.7   |
|   461 |  16172 | 136350 | Auk   | Jay   | 2000-06-29 00:00:00.000 | 2009-04-14 00:00:00.000 | 3.7   |
|   146 |   5234 | 128517 | Auk   | Jay   | 2000-06-29 00:00:00.000 | 2008-04-01 00:00:00.000 | 2.7   |
|   146 |   5234 | 123560 | Auk   | Jay   | 2000-06-29 00:00:00.000 | 2007-04-10 00:00:00.000 | 1.7   |
|   152 |  17899 | 123561 | Gates | Bill  | 1955-10-28 00:00:00.000 | 2007-04-15 00:00:00.000 | 4.7   |
|   152 |  17899 | 123562 | Gates | Bill  | 1955-10-28 00:00:00.000 | 2007-04-14 00:00:00.000 | 3.7   |
|   157 |   5235 | 123563 | Gates | Bill  | 1955-10-28 00:00:00.000 | 2007-04-01 00:00:00.000 | 2.7   |
|   157 |   5235 | 123564 | Gates | Bill  | 1955-10-28 00:00:00.000 | 2007-04-10 00:00:00.000 | 1.7   |
+-------+--------+--------+-------+-------+-------------------------+-------------------------+-------+

You can see the starting values above.
Continuing on...
-- update the StudID to the most recent test StudID for student --

UPDATE @TestView
SET
    StudID = Tests.MostRecentID
FROM @TestView vwTestList
CROSS APPLY (

    SELECT TOP 1 StudID AS MostRecentID FROM @TestView vw
    WHERE
        vw.LName = vwTestList.LName
        AND vw.FName = vwTestList.FName
    ORDER BY vw.TDate DESC

) AS Tests;

-- view results --

SELECT * FROM @TestView;

Returns:
+-------+--------+--------+-------+-------+-------------------------+-------------------------+-------+
| SchID | StudID | TestID | LName | FName |          BDate          |          TDate          | Grade |
+-------+--------+--------+-------+-------+-------------------------+-------------------------+-------+
|   461 |  16172 | 142773 | Auk   | Jay   | 2000-06-29 00:00:00.000 | 2010-04-13 00:00:00.000 | 4.7   |
|   461 |  16172 | 136350 | Auk   | Jay   | 2000-06-29 00:00:00.000 | 2009-04-14 00:00:00.000 | 3.7   |
|   146 |  16172 | 128517 | Auk   | Jay   | 2000-06-29 00:00:00.000 | 2008-04-01 00:00:00.000 | 2.7   |
|   146 |  16172 | 123560 | Auk   | Jay   | 2000-06-29 00:00:00.000 | 2007-04-10 00:00:00.000 | 1.7   |
|   152 |  17899 | 123561 | Gates | Bill  | 1955-10-28 00:00:00.000 | 2007-04-15 00:00:00.000 | 4.7   |
|   152 |  17899 | 123562 | Gates | Bill  | 1955-10-28 00:00:00.000 | 2007-04-14 00:00:00.000 | 3.7   |
|   157 |  17899 | 123563 | Gates | Bill  | 1955-10-28 00:00:00.000 | 2007-04-01 00:00:00.000 | 2.7   |
|   157 |  17899 | 123564 | Gates | Bill  | 1955-10-28 00:00:00.000 | 2007-04-10 00:00:00.000 | 1.7   |
+-------+--------+--------+-------+-------+-------------------------+-------------------------+-------+

The StudID has been updated to the most recent Test StudID for each row. Joining on the name makes me nervous, but if you don't have another unique way to guarantee a student match ( e.g. two students have the same name ) then there may not be a lot of other options.
As always verify your data before actually running your update, but this should help you get started.


text:
Q: Makeinfo package not found in 12.04 Please can anybody give me an answer for this? I have already tried:
sudo apt-get install makeinfo textinfo texi2html

But, I still get the error:
Unable to find the pacakge.

A: You need to type "texinfo" not "textinfo".

A: There is two way to install texinfo, Download (http://www.gnu.org/software/texinfo/) and build using configure option, but you might get Exception like, Makefile:18283: *** missing separator stop
and the easiest way is by running the below command in your terminal
sudo apt-get install texinfo

A: If you would have executed makeinfo directly, it would have suggested you the right package name:
$ makeinfo
The program 'makeinfo' is currently not installed.  You can install it by typing:
sudo apt-get install texinfo

After installing the apt-file package, you could also locate it with apt-file:
$ apt-file search makeinfo
...
texinfo: /usr/bin/makeinfo
...

Searching for "makeinfo" on packages.ubuntu.com would give the same information as apt-file.

A: Open a terminal and enter
sudo apt-get install makeinfo texinfo texi2html

Note that makeinfo has been removed.


text:
Q: Get a GET request using Python, Selenium and Scapy on an HTTPS site This is my first time around. I'm trying to create a tool to validate the implementation of a tagging solution in Python.
Right now I'm using Selenium + webdriver to interact with the web and scapy to sniff the traffic. On HTTP sites I'm able to see the information on the packet payload using this:
 str(bytes(packet[TCP].payload)))
Output:
b'GET /b/ss/xxdeprod/1/JS-2.2.0-D7QN/s5173447115256?AQB=1&ndh=1&pf=1&t=2%2F6%2F2018%2011%3A14%3A41%201%20-120&sdid=699ADD6A6B7CA749-5E0105ECF41B83A5&D=D%3D&mid=16848006205106756570809327525945601030&aamlh=6&ce=UTF-8&ns=xx&pageName=home.html&g=http%3A%2F%2Fwww.xx.de%2F&cc=EUR&ch=home&server=www.xx.de&events=event61%2Cevent4%2Cevent89%3D3%2Cevent233&products=Cars%3BPage%20not%20identified%20with%20any%20car%3B1%3B%3B%3BeVar73%3DPage%20not%20identified%20with%20any%20car%7CeVar56%3DSpecial&aamb=RKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y&h1=home&v11=home.html&v12=home&c13=New&c21=Page%20not%20identified%20with%20any%20car&c22=Page%20not%20identified%20with%20any%20car&c26=No%20informed&v26=No%20informed&c31=horitzontal&v31=D%3Dv0&c34=N%2FA%20or%20Landing%7CN%2FA%20or%20Landing%7CN%2FA%20or%20Landing&v34=11%3A14%3A41%7CMonday%7C2%2F7%2F2018%7CWeekday&c38=Entire%20Site&c39=Direct&c49=3&c50=http%3A%2F%2Fwww.xx.de%2F&v61=D%3Dmid&v63=Direct&s=1920x1080&c=24&j=1.6&v=N&k=Y&bw=1920&bh=925&mcorgid=F050097853468AB40A490D4C%40AdobeOrg&AQE=1 HTTP/1.1\r\nHost: xx.d3.sc.omtrdc.net\r\nConnection: keep-alive\r\nUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36\r\nDNT: 1\r\nAccept: image/webp,image/apng,image/*,*/*;q=0.8\r\nReferer: http://www.xx.xx/\r\nAccept-Encoding: gzip, deflate\r\nAccept-Language: es,en-US;q=0.9,en;q=0.8\r\n\r\n'

But on HTTPS sites all I see is bytes, eg:
str(bytes(packet[TCP].payload)))
Output:
b'\x16\x03\x01\x02\x08\x01\x00\x02\x04\x03\x03%\xe5H\xcb\xe1:\x92\x8a%W\xe7\xc7\x9a\x8f\xa1\x19\x98>\xa5m\xe0\xf7/\x9a\xfd\xad\xd2P(\xa4\x84V \x02\xa6\xf0\n\x8b\xa5\x03\x00C\x7fb\xd3\xac\xcf\xe7t\xa3\te\xb5\xc0\xb6\x15^\xf83|\x85\xc3>\xcbg\x00"\x9a\x9a\x13\x01\x13\x02\x13\x03\xc0+\xc0/\xc0,\xc00\xcc\xa9\xcc\xa8\xc0\x13\xc0\x14\x00\x9c\x00\x9d\x00/\x005\x00\n\x01\x00\x01\x99ZZ\x00\x00\xff\x01\x00\x01\x00\x00\x00\x00\x1c\x00\x1a\x00\x00\x17endesa.d3.sc.omtrdc.net\x00\x17\x00\x00\x00#\x00\xd0ec1d1752-2540-4\x00\x06S\x14\x8a(\xd3\xeb\xab\xcc:\xac\xd0+\xa5\x86[N\x0e\x82\x89\xde\x05\xe4\x98\\/\x0e6\xfd\xc9m_b\x8b*\xdf\xdc\xaf\x83,\xd3\xc1\xf3\xa4@y-\xb9H\x9a\xa2\'7\xfc\x15\x9d4\xd7\xc3|\x15Te\x0bZ\x1c\xd2\x82\x05\xc1\xfc\xc8\xa8\xe5\xf0K\xe7\x91\x92*\xcd\x04\xacG\x97n\x8aT\xf0\xf8\x97gk\xee\x86aQ&\t\xc5Sr\x8eg\x8c\xe3{\xaa\x84\xbe\x82\n\xbdG\xb8d=\xeeN\x94\x87 2\xc1(:0\xa3\xccU:\xec9\x11\xf9r\x87+\xed\xf0z!\xea\x17K`\x98\x1a:\xa6t.^l;^gE\x82\xef&\xe6\xfe\x057\xae\x9ca\x0c&h\xa8\xc7<x\x87z\x80\x06\xea\x1cDw1\x9f6\xd5\xf0S\xeeM\xf9\x00\r\x00\x14\x00\x12\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x02\x01\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00\x12\x00\x00\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1uP\x00\x00\x00\x0b\x00\x02\x01\x00\x003\x00+\x00)jj\x00\x01\x00\x00\x1d\x00 f\x8a\x90\x8f0\x9d\xa0\xa4\x06\xb9\xba\x8a\x85<\xff\xa8\xeab6Du\x0bf\x01\xde|hB\x9ct\x80>\x00-\x00\x02\x01\x01\x00+\x00\x0b\n\x1a\x1a\x7f\x17\x03\x03\x03\x02\x03\x01\x00\n\x00\n\x00\x08jj\x00\x1d\x00\x17\x00\x18\xaa\xaa\x00\x01\x00'

I've tried the binascii library, with the method
binascii.b2a_uu(data)
But without a successfull result. Is there a way to decode this payload from HTTPS sites? maybe I'm going in the wrong direction? Is there a way to get this request without the encoding? What I'm trying to achive is to get the info the way it is shown in the developer tool in the browser.

A: You won't be able to decode the https payload, due to its encryption, without having the private keys. That's the whole point of HTTPS: making the content not seeable by others
Apart from that, if you want to see the HTTPS TLS exchange, you can import the tls module in scapy using
load_layer("tls")
You can't get any more data that that, as everything else is encrypted. If you have the server private keys (it's your own server) then you will be able to decode its content using any RSA/ECDSA API, but otherwise you won't.


text:
Q: How to Execute SQLite Queries on Firefox Mobile Profile Data Thanks for your time.
I am on Firefox Mobile.
I plan to use a restartless approach using the add-on node.js tools.
I need to pull profile data in my app, some of which requires direct SQL due to spotty mobile support according to: https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/Mobile_development
I plan to use indexed-db, thinking that this will give me the ability to run SQLite queries against existing user profile data (mostly needed for reading).
Am I on the right track? I have also seen simple-storage.  Is that a better tool?


text:
Q: Amount of homomorphisms $S_5$ to $C_6$ I think I understand the amount  of homomorphisms $C_6$ to  $S_5$:
Because $C_6$ is cyclic, we only have to look where we can send $\langle a\rangle$, because $f(\langle a\rangle)$ must have order $1, 2, 3$, or $6$ we have:
-for $1$: trivial homomorphism.
-for $2$: the ten $(xy)$ cycles in $S_5$, the fifteen $(xy)(ab)$  cycles in $S_5$
-for $3$: the twenty  $(xyz)$ cycles in $S_5$
-for $6$: the twenty $(xyz)(ab)$ cycles in  $S_5$
so total $= 66$
the other way around I find more difficult.
Can anyone help?
Bonus question: is the size of the conjugacy class of an element in the group always the amount of elements of the same shape? so in $S_5$, $(12)$ has conjugacy class size 10, so there are ten $(xy)$ in $S_5$?

A: The kernel of a homomorphism $f: S_5 \rightarrow C_6$ must be a normal subgroup of $S_5$. There are only three such: $S_5, A_5$ and $\{1\}$. Since $|S_5| > |C_6|$ we cannot have $\ker f = \{1\}$. If $\ker f = S_5$ then $f$ just sends everything to the identity. If $\ker f = A_5$ then by first isomorphism theorem im$f \cong C_2$, which there is only one copy of inside $C_6$, so we have $f(a) = g^3$ if $a \notin A_5$, $f(a) = 1$ if $a \in A_5$.

A: Suppose $h:S_5\to C_6$ is a homomorphism.  $S_5$ has elements of order $5$ (namely cycles), which get mapped by $h$ to the identity, since that's the only element of $C_6$ whose order divides $5$.   But the elements of order $5$ in $S_5$ generate the whole alternating subgroup $A_5$, so all of $A_5$ is sent by $h$ to the identity.  So $h$ factors as the projection $S_5\to S_5/A_5$ followed by a homomorphism from the $2$-element cyclic group $S_5/A_5$ into $C_6$.  Since $C_6$ has only two elements whose order divides $2$, there are just $2$ such homomorphisms.


text:
Q: How does one make a floating point number stop rounding to an integer? I'm trying to write a basic programme, which gets a user's input, divides by seven, and then returns the result.
#include <cs50.h>
#include <stdio.h>

int main(void)
{
    int s = get_int("Input:  ");
    float f = (s / 7);
    printf("%f\n", f);
}

Eg. if I input "8", I would expect 1.142857. But I instead simply get "1.000000". Why is this?

A: #include <stdio.h>
int main()
{
    int s=4;
    float f = ((float)s / 7);
    printf("%f\n", f);
    getch();
}

You just have to typecast the int to float.  int/float division give you the floor of given integer whereas float/float division gives you float


text: Q: Angulr6 application not running in IE and Edge I have one SPA devel0ped in Angular6, it works fine in chrome and Firefox but i get blank screen in IE and Edge.I have un-commented all the imports in polyfill.js for IE and Edge still i can't see my application running in IE n Chrome both.


text:
Q: how can I find $x,y$ in the following equation and showing linear independence of the result? Here is the equation I want to solve rigorously:
$2r + (1 + \sqrt{-5})s = 0$
A trial:
1-I know that the solutions intuitively are $(-1 - \sqrt{-5}, 2)$ and $(-3, 1 - \sqrt{-5})$ but I do not know the rigorous way of finding the solution. So, can anyone help me in that direction ?
2- Also, I want to show that $(-1 - \sqrt{-5}, 2),(-3, 1 - \sqrt{-5})$ are linearly independent, could someone show me the details of this please?

A: $$\begin{split}2r+(1+\sqrt 5i)s&=0\\
2r&=-(1+\sqrt 5i)s\end{split}$$
Set $r=-(1+\sqrt 5i),s=2$ is a solution because you sort of take the thing that's on the other side and set it to be the variable on the side.
But to find all the solutions,
$$r=-\frac 1 2(1+\sqrt 5i)s$$
Then
$$\left(\begin{matrix}-\frac 1 2(1+\sqrt5i)s\\s\end{matrix}\right)=\left(\begin{matrix}-\frac 1 2(1+\sqrt5i)\\1\end{matrix}\right)s$$
is the set of solutions.
There's more unknowns than equations, so the solution isn't unique. You can only have a unique solution if there are at least as many equations as unknowns.
Linear independence
You wanted to show that the two of your vectors are linearly independent, this means they are not scalar multiples of one another.
$$\begin{split}(-1-\sqrt 5 i, 2)&=c(-3,1-\sqrt 5 i)\\
-1-\sqrt 5 i+3c&=0\text { the first component}\\
c&=\frac 1 3(1+\sqrt 5 i)\\
2&=(1-\sqrt 5 i)c\text { the second component}\\
&=(1-\sqrt 5 i)\frac 1 3(1+\sqrt 5 i)\\
&=\frac 1 3(1+5)=2\end{split}$$
Therefore, the first vector is $c=\frac 1 3 (1+\sqrt 5 i)$ times the second vector. This means they are linearly dependent. This makes sense because both of them are solutions to the system, but the solution space has only dimension 1, so any two solutions will line on the same "line".
If you wanted to show that two vectors $v_1, v_2$ were linearly independent, you would show that $v_1\ne cv_2$ for all choices of c.


text:
Q: Shutdown problems My laptop Packard Bell ENTG71BM does not want to shutdown with ubuntu 14.04. With Windows all OK. I used a lot of different advices(edit Grub, update BIOS), but it still does not work correctly.
I`m almost sure, that trouble is in ACPI. I have logs:
[    0.000000] BIOS-e820: [mem 0x000000007867a000-0x0000000078779fff] ACPI NVS

[    0.000000] BIOS-e820: [mem 0x000000007877a000-0x00000000787b9fff] ACPI data

[    0.000000] BIOS-e820: [mem 0x00000000794d0000-0x0000000079dcffff] ACPI NVS

[    0.000000] ACPI: Early table checksum verification disabled

[    0.000000] ACPI: RSDP 0x00000000000FE020 000024 (v02 ACRSYS)

[    0.000000] ACPI: XSDT 0x00000000787B9120 00008C (v01 ACRSYS ACRPRDCT 00000003      01000013)

[    0.000000] ACPI: FACP 0x00000000787B6000 0000F4 (v04 ACRSYS ACRPRDCT 00000003 1025 00040000)

[    0.000000] ACPI: DSDT 0x00000000787A9000 0077FA (v02 ACRSYS ACRPRDCT 00000003 1025 00040000)

[    0.000000] ACPI: FACS 0x0000000078742000 000040

[    0.000000] ACPI: UEFI 0x00000000787B8000 000236 (v01 ACRSYS ACRPRDCT 00000001 1025 00040000)

[    0.000000] ACPI: HPET 0x00000000787B5000 000038 (v01 ACRSYS ACRPRDCT 00000003 1025 00040000)

[    0.000000] ACPI: LPIT 0x00000000787B4000 000104 (v01 ACRSYS ACRPRDCT 00000003 1025 00040000)

[    0.000000] ACPI: APIC 0x00000000787B3000 000084 (v03 ACRSYS ACRPRDCT 00000003 1025 00040000)

[    0.000000] ACPI: MCFG 0x00000000787B2000 00003C (v01 ACRSYS ACRPRDCT 00000003 1025 00040000)

[    0.000000] ACPI: SSDT 0x00000000787B1000 000763 (v01 ACRSYS ACRPRDCT 00003000 1025 00040000)

[    0.000000] ACPI: SSDT 0x00000000787A7000 000290 (v01 ACRSYS ACRPRDCT 00003000 1025 00040000)

[    0.000000] ACPI: SSDT 0x00000000787A6000 00017A (v01 ACRSYS ACRPRDCT 00003000 1025 00040000)

[    0.000000] ACPI: UEFI 0x00000000787A5000 000042 (v01 ACRSYS ACRPRDCT 00000000 1025 00040000)

[    0.000000] ACPI: SSDT 0x00000000787A2000 002F10 (v01 ACRSYS ACRPRDCT 00001000 1025 00040000)

[    0.000000] ACPI: SSDT 0x00000000787A1000 00013D (v01 ACRSYS ACRPRDCT 00001000 1025 00040000)

[    0.000000] ACPI: FPDT 0x00000000787A0000 000044 (v01 ACRSYS ACRPRDCT 00000002 1025 00040000)

[    0.000000] ACPI: Local APIC address 0xfee00000

[    0.000000] ACPI: PM-Timer IO Port: 0x408

[    0.000000] ACPI: Local APIC address 0xfee00000

[    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)

[    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)

[    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x04] disabled)

[    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x06] disabled)

[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] high level lint[0x1])

[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x02] high level lint[0x1])

[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x03] high level lint[0x1])

[    0.000000] ACPI: LAPIC_NMI (acpi_id[0x04] high level lint[0x1])

[    0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0])

[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl)

[    0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level)

[    0.000000] ACPI: IRQ0 used by override.

[    0.000000] ACPI: IRQ9 used by override.

[    0.000000] Using ACPI (MADT) for SMP configuration information

[    0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000

[    0.000053] ACPI: Core revision 20141107

[    0.014130] ACPI: All ACPI Tables successfully acquired

[    0.107621] PM: Registering ACPI NVS region [mem 0x7867a000-0x78779fff] (1048576 bytes)

[    0.107651] PM: Registering ACPI NVS region [mem 0x794d0000-0x79dcffff] (9437184 bytes)

[    0.116926] ACPI: bus type PCI registered

[    0.116930] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5

[    0.121631] ACPI: Added _OSI(Module Device)

[    0.121637] ACPI: Added _OSI(Processor Device)

[    0.121639] ACPI: Added _OSI(3.0 _SCP Extensions)

[    0.121642] ACPI: Added _OSI(Processor Aggregator Device)

[    0.131423] ACPI: Dynamic OEM Table Load:

[    0.131438] ACPI: SSDT 0xFFFF88017A5F0800 000440 (v01 PmRef  Cpu0Ist  00003000 INTL 20130117)

[    0.132260] ACPI: Dynamic OEM Table Load:

[    0.132271] ACPI: SSDT 0xFFFF88017A5F1000 000433 (v01 PmRef  Cpu0Cst  00003001 INTL 20130117)

[    0.133488] ACPI: Dynamic OEM Table Load:

[    0.133499] ACPI: SSDT 0xFFFF88017A5A5600 00015F (v01 PmRef  ApIst    00003000 INTL 20130117)

[    0.134289] ACPI: Dynamic OEM Table Load:

[    0.134299] ACPI: SSDT 0xFFFF88017A5AD900 00008D (v01 PmRef  ApCst    00003000 INTL 20130117)

[    0.136345] ACPI: Interpreter enabled

[    0.136359] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20141107/hwxface-580)

[    0.136368] ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20141107/hwxface-580)

[    0.136395] ACPI: (supports S0 S3 S4 S5)

[    0.136399] ACPI: Using IOAPIC for interrupt routing

[    0.136459] PCI: Ignoring host bridge windows from ACPI; if necessary, use "pci=use_crs" and report a bug

[    0.546523] ACPI: Power Resource [USBC] (on)

[    0.551193] ACPI: Power Resource [PLPE] (on)

[    0.551475] ACPI: Power Resource [PLPE] (on)

[    0.552379] ACPI: Power Resource [FN00] (off)

[    0.553399] ACPI: PCI Root Bridge [PCI0] (domain 0000 [bus 00-ff])

[    0.553410] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI]

[    0.554212] acpi PNP0A08:00: _OSC: platform does not support [PME]

[    0.554561] acpi PNP0A08:00: _OSC: OS now controls [PCIeHotplug AER PCIeCapability]

[    0.555004] acpi PNP0A08:00: host bridge window [io  0x0000-0x006f] (ignored)

[    0.555009] acpi PNP0A08:00: host bridge window [io  0x0078-0x0cf7] (ignored)

[    0.555013] acpi PNP0A08:00: host bridge window [io  0x0d00-0xffff] (ignored)

[    0.555017] acpi PNP0A08:00: host bridge window [mem 0x000a0000-0x000bffff] (ignored)

[    0.555021] acpi PNP0A08:00: host bridge window [mem 0x000c0000-0x000dffff] (ignored)

[    0.555024] acpi PNP0A08:00: host bridge window [mem 0x000e0000-0x000fffff] (ignored)

[    0.555028] acpi PNP0A08:00: host bridge window [mem 0x80000000-0x909ffffe] (ignored)

[    0.555037] acpi PNP0A08:00: [Firmware Info]: MMCONFIG for domain 0000 [bus 00-3f] only partially covers this bridge

[    0.556158] pci 0000:00:14.0: System wakeup disabled by ACPI

[    0.556912] pci 0000:00:1c.0: System wakeup disabled by ACPI

[    0.557120] pci 0000:00:1c.2: System wakeup disabled by ACPI

[    0.557333] pci 0000:00:1c.3: System wakeup disabled by ACPI

[    0.557670] pci 0000:00:1d.0: System wakeup disabled by ACPI

[    0.558772] pci 0000:02:00.0: System wakeup disabled by ACPI

[    0.565180] pci 0000:03:00.0: System wakeup disabled by ACPI

[    0.777263] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 10 11 12 14 15) *7

[    0.777382] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 10 *11 12 14 15)

[    0.777498] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 10 *11 12 14 15)

[    0.777623] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 *10 11 12 14 15)

[    0.777738] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 10 *11 12 14 15)

[    0.777853] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 10 11 12 14 15) *7

[    0.777970] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 *10 11 12 14 15)

[    0.778086] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 10 11 12 14 15) *7

[    0.778631] ACPI: Enabled 4 GPEs in block 00 to 3F

[    0.778822] ACPI : EC: GPE = 0x18, I/O: command/status = 0x66, data = 0x62

[    0.779650] ACPI: bus type USB registered

[    0.780028] PCI: Using ACPI for IRQ routing

[    0.792560] pnp: PnP ACPI init

[    0.792656] pnp 00:00: Plug and Play ACPI device, IDs PNP0b00 (active)

[    0.792829] system 00:01: Plug and Play ACPI device, IDs PNP0c02 (active)

[    0.793023] pnp 00:02: Plug and Play ACPI device, IDs PNP0303 (active)

[    0.793141] pnp 00:03: Plug and Play ACPI device, IDs ETD050a SYN1b00 SYN0002 PNP0f13 (active)

[    0.996895] system 00:04: Plug and Play ACPI device, IDs PNP0c02 (active)

[    0.997242] pnp: PnP ACPI: found 5 devices

[    1.005505] Switched to clocksource acpi_pm

[    3.314196] ACPI: AC Adapter [ADP1] (on-line)

[    3.314429] ACPI: Power Button [PWRB]

[    3.314512] ACPI: Sleep Button [SLPB]

[    3.314627] ACPI: Lid Switch [LID0]

[    3.314709] ACPI: Power Button [PWRF]

[    3.317776] ACPI: Thermal Zone [TZ01] (49 C)

[    3.318931] ACPI: Battery Slot [BAT0] (battery present)

[    3.379548] ACPI PCC probe failed.

[    3.657500] ACPI: Video Device [GFX0] (multi-head: yes  rom: no  post: no)

[   13.077676] acer_wmi: Acer Laptop ACPI-WMI Extras

[   13.100607] acer_wmi: Brightness must be controlled by acpi video driver

Can anyone say that everything was in order?
Do i really have problems with ACPI?


text:
Q: rational power transcendental A common example that rational power transcendental number is rational is $2^{\log_2 3}$.The irrationality of $2^{e}$ and $2^{\pi}$ is still unknown.  Gelfond-Schneider theorem gives the answers only for irrational power. Is there is any example, such that, rational number raised to transcendental number is transcendental or irrational.

A: "Rational to transcendental power is irrational" is easy given the transcendence of numbers like $\log_2 3$, e.g.
$2^{\frac12 \log _{\,2}\! 3} = \sqrt 3$.  For a transcendental example, once numbers like $3^{\sqrt 2}$ are known to be transcendental you can use
$2^{\sqrt 2 \log_{\,2} \!3}$.


text:
Q: Prove that there exist no element of order 18 in $S_9$ Prove that there exist no element of order 18 in $S_9$.
How do I prove this ? I think the idea is that elements of the form: $(123456)(789)$ have order 6 as $\text{lcm}(6,3)=6$. Elements of the form $(123456789)(10\,11)$ surely don't exist in $S_9$. And I don't see any other ways to get to order 18. How do I prove this rigoursly ?

A: It seems you already know that the order is the least common multiple of the cycle lengths. For the least common multiple of a set of numbers to be $2\cdot3^2$, at least one of the numbers must include a factor $3^2$ – but the only partition of $9$ with that property is the one with a single part $9$, and in this case the order is $9$, not $18$.

A: An element $\sigma$ of $\mathfrak{S}_9$ gives a partition of $9$, and $\text{ord}(\sigma)$ is the lcm of the elements of the partition. If $\text{ord}(\sigma)=18$, the partition contains a multiple of $2$ and of $3$; you can check that the lcm associated to such a partition is never $18$. (There are only five partitions satisfying this condition.)


text:
Q: What's the best way to change the size of a list in Dart?
*

*I have a list with oldLength items.

*I want it to have newLength items.

*If newLength < oldLength, I just want to cut the extra items.

*If newLength > oldLength, I want to fill it with nulls.

I wrote this:
List<T> cutList<T>(List<T> oldList, int newLength) {
    return new List.generate(newLength, (index) {
      if (index < oldList.length) return oldList[index];
      else return null;
   });
}

Is there a better way, in terms of simplicity? And in terms of efficiency?

A: If it's a growable list and you don't mind mutating it:
List<T?> cutList<T>(List<T?> oldList, int newLength) {
  oldList.length = newLength;
  return oldList;
}

Notice that after Dart introduced Null Safety, you can only grow a list like this if its element type is nullable (because otherwise it can't assign null to the new element positions). Since you ask to grow with null values, that should be the case.
The declaration of cutList here ensures that the list type is nullable.
If you want to create a new list, then you still need to know that T is nullable (otherwise you can't create a larger list):
List<T?> cutList<T>(List<T?> oldList, int newLength) {
  return List<T?>.filled(newLength, null)
    ..setRange(0, min(newLength, oldList.length), oldList);
}

(where min is imported from dart:math).
For a more modern-Dart approach, I'd probably go with:
List<T?> cutList<T>(List<T?> oldList, int newLength) {
    return <T?>[...oldList.take(newLength),
                for (var i = oldList.length; i < newLength; i++) null];

There are so many ways. Anything that only copies each element once is good.

A: Same as Above but It's an extension so you can use it on any List anytime you want
Without Math Library
extension CutList<T> on List<T?> {
  List<T?> cutList(List<T?> oldList, int newLength) {
    return <T?>[
      ...oldList.take(newLength),
      for (var i = oldList.length; i < newLength; i++) null
    ];
  }
}

With Math
import 'dart:math';

extension CutList<T> on List<T?> {
  List<T?> cutList(List<T?> oldList, int newLength) {
    return List<T?>.filled(newLength, null)
      ..setRange(0, min(newLength, oldList.length), oldList);
  }
}


text:
Q: Is it bad practice for a spring-based jar project to provide a bean configuration file? If you have a library containing Spring beans that need to be wired together before an application can use them, does it make sense to include any sort of bean configuration file in the JAR (such as the /META-INF directory)? The idea is to give the application the option of importing this into its master Spring context configuration.
There may be more than one way to wire these beans, so I could provide a bean configuration file for each of the standard ways in which you'd typically wire them together.
Or, do I force the application to wire these up explicitly?
If it helps, the specifics of my problem involve a library I created to encapsulate our product's persistence layer.  It contains Service, DAO and model beans.  The DAO implementations currently use Hibernate (this probably won't change).  Some of the DAO implementations need different kinds of Strategy beans injected into them (database encryption logic), depending on the type of database we are deploying on (MySQL vs SQL Server, etc).  So we have potentially a few different configuration scenarios.  I could also provide datasource bean configurations, relying on property substitution at the app level to inject all the particulars needed by the datasource.
Thanks for your input!

A: In this case, it's a good idea to provide some beans files, either as examples for documentation purposes, or as fully-fledged files ready for including into a wider context.
If your beans' wiring can get complex, then you shouldn't really leave it entirely up to the library client to figure it out.
This is more of a documentation and education task, really.


text:
Q: "I want you succeeding" vs. "I want your succeeding"
*

*I am happy seeing you succeed.

I am happy to see you succeed.

*I want you to succeed.

I want you succeeding.
I want your succeeding.

Could you please explain the differences between them, and the first and second examples independently of each other?

A:
I am happy seeing you succeed.

This means, effectively, I am happy while I'm seeing you succeed.  There is a slight implication of causality -- I am happy because I see you succeeding -- but not that strong.
For example, if I said, "I am happy waiting here", I would mean that waiting is acceptable, that it would not make me unhappy to wait while the other person went and did something.

I am happy to see you succeed.

This could mean exactly what you think -- I am happy because I see you succeeding -- but in other constructions it could mean I am volunteering for something, or saying I would stand by while it happened.  "I am happy to help you move" is me volunteering to help.  "I am happy to watch you kill yourself" is a way of saying I won't interfere.

I want you to succeed.

This can only be interpreted literally.

I want you succeeding.

This means "I want to maintain you in the state of being successful".  A doctor might say, "I want you exercising and eating right" -- he wants you to do that every day.

I want your succeeding.

This is grammatically correct but not idiomatic.  "Your succeeding" is a legitimate noun-phrase, but saying "I want it" usually means I want to possess something, not that I want that thing to occur.  So "I want a birthday party" sounds childish; says, "I want to have a birthday party."
"Your succeeding is important to me" is more idiomatic, but using the gerund "succeeding" as a noun sounds odd when there is an independent noun "success" that could be used instead.

A: English verb allows a limited set of possible forms in its complements:

I want you to + [verb]

*

*I want you to succeed.

*I want you to talk.

happy to +  [something}

*

*I am happy to see you succeed.

*They are happy to see me doing well.

I want your + [noun]

*

*I want your success.

*I want your love.

A: In some cases, the construct is a gerund - a verb's present participle being used in a phrase as a noun. e.g. "Seeing you succeed, I decided to work harder and apply myself".
So both option 1a) and 1b) are perfectly acceptable usage.
2a) - "I want you to succeed" - is fine.
2b) - "I want you succeeding" - is fine.
2c) - "I want your succeeding" is not fine.  It is a present participle, but it is not being made into a gerund (a noun-equivalent) because it is not being placed in a phrase. As there is nothing to possess, the possessive form - "your" - is inapplicable.


text:
Q: password-protecting Access tables I have a Microsoft Access Database with an interface for usability ... But now, all users have access to the tables of the database directly. I want to deny this except for those who are authorized i.e.: Password Protect the access to the tables not the GUI.

A: Unfortunately, there is no "simple" solution for this.

*

*Access has a security-mechanism built in. Note though, that this only works for the "old" mdb format, not for the new accdb format supported by Access 2007/2010. Thus, if you are going this way, you are using a deprecated technology which will might not be supported in future versions.
That said, here is a tutorial found on the Internet. The process is a bit complex; it definitely exceeds the space of a StackOverflow answer:
The Microsoft Access Security Apparatus

*If you need a more future-proof solution, I'm afraid your only choice it to move the back-end (= the tables) into another database system, such as SQL Server Express. There, you can restrict access to the tables and grant access to your application by using Application Roles.

*If you only want to prevent your users from accidentally messing up your data, it might suffice to install only the Access Runtime instead of the full product. Note, however, that this does not provide security, since a malicious user could simply install the full version of Access!

A: It's advisable to assign permissions to groups, not to users, because each user inherits the permissions assigned to the group. this might help you


text:
Q: Discord bot is running but not responding to commands after using VS Code So I was first running my code on replit.com and I decided to switch over to running it localy on my computer. I got it running on Python IDLE 3.10.1 and then I decided to run it on VS Code with the same interpreter and then I got an error:
TypeError: Client.__init__() missing 1 required keyword-only argument: 'intents'

On this line of code:
client = discord.Client()

And this line of code was working both on replit and on IDLE and after running it on VS code it stopped running on IDLE aswell. And after I fixed the error with this I found on stack overflow:
client = discord.Client(intents=discord.Intents.default())

The bot seems to be running in the console, but in reality it isn't running because it isn't responding to my commands.
I also get these weird messages before the bot "starts":
TLDR; Running discord bot on replit, switched to Python IDLE 3.10.1 kept working, switched to VS Code error appeared, fixed error, bot not working anymore on IDLE and VS Code.

A: Try this :)
from discord.ext import commands

botDescription="Bot"
intents = discord.Intents.all()
client = commands.Bot(command_prefix="?", help_command=None, description=botDescription, intents=intents)

The Bot it self need the right to handle intents. Go to discord.com/developers/applications > Bot > SERVER MEMBERS INTENT > True


text:
Q: Android App Development - Send email directly with no Intents Can anyone suggest how I can send an email without using intents or opening another android app. I want the email to be sent directly once I hit the send button. I must use a specific office365 email for sending message. Should I use some API or SMTP etc.?
Is there a simple way on how I can apply this feature on my android app?

A: Hell @APX,
Here is the tow class which help you to send email with single or multiple user without any library, I think this will help you,
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.mail.Message;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.Security;
import java.util.Properties;

public class MailSender extends javax.mail.Authenticator {
    private String mailhost = "smtp.gmail.com";
    private String user;
    private String password;
    private Session session;

    static {
        Security.addProvider(new JSSEProvider());
    }

    public MailSender(String user, String password) {
        this.user = user;
        this.password = password;

        Properties props = new Properties();
        props.setProperty("mail.transport.protocol", "smtp");
        props.setProperty("mail.host", mailhost);
        props.put("mail.smtp.auth", "true");
        props.put("mail.smtp.port", "465");
        props.put("mail.smtp.socketFactory.port", "465");
        props.put("mail.smtp.socketFactory.class",
                "javax.net.ssl.SSLSocketFactory");
        props.put("mail.smtp.socketFactory.fallback", "false");
        props.setProperty("mail.smtp.quitwait", "false");

        session = Session.getDefaultInstance(props, this);
    }

    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(user, password);
    }

    public synchronized void sendMail(String subject, String body, String sender, String from, String recipients) throws Exception {
        try {
            MimeMessage message = new MimeMessage(session);
            DataHandler handler = new DataHandler(new ByteArrayDataSource(body.getBytes(), "text/html"));
            /*message.setSender(new InternetAddress(sender, "Dhaval Solanki"));*/
            message.setFrom(new InternetAddress(sender, from));
            message.setSubject(subject);

            message.setDataHandler(handler);
            if (recipients.indexOf(',') > 0)
                message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients));
            else
                message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipients));
            Transport.send(message);
        } catch (Exception e) {

        }
    }

    public class ByteArrayDataSource implements DataSource {
        private byte[] data;
        private String type;

        public ByteArrayDataSource(byte[] data, String type) {
            super();
            this.data = data;
            this.type = type;
        }

        public ByteArrayDataSource(byte[] data) {
            super();
            this.data = data;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getContentType() {
            if (type == null)
                return "application/octet-stream";
            else
                return type;
        }

        public InputStream getInputStream() throws IOException {
            return new ByteArrayInputStream(data);
        }

        public String getName() {
            return "ByteArrayDataSource";
        }

        public OutputStream getOutputStream() throws IOException {
            throw new IOException("Not Supported");
        }
    }
}

*  Licensed to the Apache Software Foundation (ASF) under one or more
 *  contributor license agreements.  See the NOTICE file distributed with
 *  this work for additional information regarding copyright ownership.
 *  The ASF licenses this file to You under the Apache License, Version 2.0
 *  (the "License"); you may not use this file except in compliance with
 *  the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

/**
 * @author Alexander Y. Kleymenov
 * @version $Revision$
 */

import java.security.AccessController;
import java.security.Provider;

public final class JSSEProvider extends Provider {

    public JSSEProvider() {
        super("HarmonyJSSE", 1.0, "Harmony JSSE Provider");
        AccessController.doPrivileged(new java.security.PrivilegedAction<Void>() {
            public Void run() {
                put("SSLContext.TLS",
                        "org.apache.harmony.xnet.provider.jsse.SSLContextImpl");
                put("Alg.Alias.SSLContext.TLSv1", "TLS");
                put("KeyManagerFactory.X509",
                        "org.apache.harmony.xnet.provider.jsse.KeyManagerFactoryImpl");
                put("TrustManagerFactory.X509",
                        "org.apache.harmony.xnet.provider.jsse.TrustManagerFactoryImpl");
                return null;
            }
        });
    }
}

You can use like following
MailSender sender = new MailSender("" + authEmail, "" + authPwd);
                    sender.sendMail("" + subject,
                            "" + prepareMailText(name),
                            "" + authEmail, "WeMeal Team",
                            "" + emailList); //email list send comma separated string like ("a@gmail.com,b@dahs.com")

A: Go through this below link. This is the example what you exactly want
http://www.edumobile.org/android/send-email-on-button-click-without-email-chooser/


text:
Q: Orientation on ios 8 I have 6 tabs in my iPad application, all of the controllers have a single baseViewController. In my first tab there is a collection view and different layouts for landscape and portrait mode. When I launch the application and rotate for the first time, all tabs' controllers are loaded simultaneously. Every time I rotate the device it calls orientation methods for all controllers. Before iOS 8 everything was working fine but this issue occurs only in iOS 8.
Can anyone suggest a solution?


text:
Q: VBA: How to determine whether the number is Integer, even if it's received as a Double initially, let's say 3.0? My isInteger boolean should be able to resolve into the following boolean values:
2   --> True
3.0 --> True
2.3 --> False
2.9 --> False
4.0 --> True
5   --> True

I tried to use the following code:
Dim isInteger as Boolean
isInteger = (myNumber Mod 1 = 0)
Debug.Print (isInteger)

However the output is always True even when myNumber is 2.3, 3.4, etc.
How should I fix this?

A: You can use the VarType Function
Dim IntVar, DblVar, StrVar, DateVar, MyCheck

IntVar = 3
DblVar = 2.2
StrVar = "Hello World"
DateVar = #2/12/69#

MyCheck = VarType(IntVar)    ' Returns 2
MyCheck = VarType(DblVar)    ' Returns 5
MyCheck = VarType(DateVar)   ' Returns 7
MyCheck = VarType(StrVar)    ' Returns 8

Where the return values are:
Constant            Value   Description
vbEmpty             0       Empty (uninitialized)
vbNull              1       Null (no valid data)
vbInteger           2       Integer
vbLong              3       Long integer
vbSingle            4       Single-precision floating-point number
vbDouble            5       Double-precision floating-point number
vbCurrency          6       Currency value
vbDate              7       Date value
vbString            8       String
vbObject            9       Object
vbError             10      Error value
vbBoolean           11      Boolean value
vbVariant           12      Variant (used only with arrays of variants)
vbDataObject        13      A data access object
vbDecimal           14      Decimal value
vbByte              17      Byte value
vbLongLong          20      LongLong integer (Valid on 64-bit platforms only.)
vbUserDefinedType   36      Variants that contain user-defined types
vbArray             8192    Array

You can also use the TypeName Function
MyCheck = TypeName(IntVar)    ' Returns Integer
MyCheck = TypeName(DblVar)    ' Returns Double
MyCheck = TypeName(DateVar)   ' Returns Date
MyCheck = TypeName(StrVar)    ' Returns String

A: I was having a similar problem, that was not solved by @Random_Answer_Guy solution because the input was formated as text.
So what i did :

*

*Test if numeric

*If Yes, create an integer variable equals to the variable your testing

*Compare the 2. If they're equal it's an integer

It looks something like this :
Dim VariableTested as Double
If IsNumeric(VariableTested) Then
    Dim VariableToCompareTo as Integer
    VariableToCompareTo = VariableTested   'This will round up variableTested to the closest integer
    If VariableToCompareTo = VariableTested Then
        'Congrats, it's an integer
    End If
End If

This is probably the worst way of solving this problem. But at least it is one way of solving this problem. Which is better than nothing.
It will probably not help you since this question is 4 years old though ...

A: I recently discovered a pretty robust way to check if a number is an integer or not. Here it is:
Dim num, roundedNum As Double
Dim isNumAnInteger As Boolean

num = 3.3
roundedNum = Round(num)
isNumAnInteger = False

If num = roundedNum Then
    isNumAnInteger = True
End If

If the original is equal to the rounded number, then the original must have been and integer in the first place.


text:
Q: how output of print(print_board(board)) is printed like a matrix but not like a list or line from top to bottom? board = []
for i in range(5):
  board.append(['O'] * 5)

def print_board(board_in):
  for x in board_in:
    print (x)

print(board)
print(print_board(board))

A: print(board) will just print board in the standard "list of lists" format:
>>> print(board)
[['O', 'O', 'O', 'O', 'O'], ['O', 'O', 'O', 'O', 'O'], ['O', 'O', 'O', 'O', 'O'], ['O', 'O', 'O', 'O', 'O'], ['O', 'O', 'O', 'O', 'O']]

print_board(board) will execute the code in your print_board function, which prints each list (in the standard representation of a list) on its own line:
>>> print_board(board)
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']

The print_board function returns None, so if you call the function and print the result of it, then that will print None at the end:
>>> print(print_board(board))
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
['O', 'O', 'O', 'O', 'O']
None

If you don't want to use the normal list representation in your output, you could use join to generate your own strings from the list elements:
>>> print("\n".join(' '.join(c for c in row) for row in board))
O O O O O
O O O O O
O O O O O
O O O O O
O O O O O

A: From what I understood from your question, it is printed like a matrix because print adds new line by default.
def print_board(board_in):
  for x in board_in:
    print (x)

You are printing each member (i.e.['O'] * 5) and a newline (added py print by default)


text:
Q: QtQuick Gauge Needle rotation animation is not smooth I was trying to create a simple gauge using the QtQuick. The problem I am facing is that the needle rotation is not smooth. When the needle angle is changed for a higher value the needle not moving smoothly, there are some jerk in the motion and also feel like multiple needle moving. I tried to use most of the Animations Types and Easing types available but the result was negative.
main.qml
import QtQuick 2.0

Rectangle {
visible: true
width: 800
height: 800
color: "#00000000"

// My Needle
Rectangle{
    id: id_needle
    x: 350
    y: 350
    width: 300
    height: 5
    color: "red"
    antialiasing: true
    smooth: true
    transform: Rotation {
        id: rotation
        origin.x: 3
        origin.y: 3
        angle: 0

        Behavior on angle {

            NumberAnimation{
                duration: 1500
                easing.type: Easing.OutQuad
            }
        }
    }
}

// Sample Timer to update needle angle
Timer{
    id: tim
    repeat: true
    running: true
    interval: 2000
    onTriggered: {

        var data = Math.floor(Math.random() * 360) + 0
        rotation.angle = data

     }
  }
}

Video and Log

A: I think it is because your virtual machine does not have vsync,the tearing is caused by your display.


text:
Q: Can I add WMS layers to a MapGuide 6.5 map? A bit of a long shot, but I recall a few years ago seeing a WMS 'connector' for MapGuide 6.5 that allowed you to add WMS layers to a MapGuide 6.5 map.  I can't seem to find it anywhere now, and am pretty sure it's impossible given the technology, but thought I would ask.  Does such a thing exist?

A: I think using the liteview you can accomplish.
MG 6.5 forum question


text:
Q: What does it mean that "Annexation is estimated to be Unknown"? I'm playing as the Creek nation in North America with the Cherokee as a vassal. My mission is to absorb the Cherokee into my country. A few years ago, I integrated the Choctaw without issue, but the dialogue box for annexing the Cherokee says:

Annexation is estimated to be done Unknown due to 3 basetax.

This message continues for a few months, so I stopped trying the diplomatic annexation. I sent another diplomat to Improve Relation with them, but even after boosting it to the limit, there's no estimate of when the annexation will be done. Here's the tooltip:

Is this a bug or is there something I can do to annex the Cherokee peacefully?

A: Annexation time is unknown since you have negative rate of progress -- see your second screenshot. You have -3 diplomatic reputation, which is due to annexation of Choctaw within the last 10 years. A Statesman advisor will allow you to integrate Cherokee in the current circumstances, if one is available and you can afford him.
From EU4wiki page:

Annexing occupies a diplomat until complete. The base cost of annexing a vassal is 10 diplo points per base tax multiplied by hostile core creation modifiers, spent at a rate determined by

*

*+1 base

*+1 if same culture as suzerain

*+1 if same religion as suzerain

*+or - suzerain's diplomatic reputation (rounded down).

If the total is 0 or negative, annexing will pause, but not go backwards. When all the diplo points are spent, annexation finishes and the suzerain will see the following effects:

*

*-3 Diplomatic reputation for ten years. Doesn't stack.  [...]


text:
Q: What is the expectation of the largest eigenvalue of a Wishart distributed matrix? Let $\mathcal{S}_{++}^d$ denote the space of (symmetric) positive definite matrices of size $d \times d$, where $d\in \mathbb{N}$ is given.
The density function of the $\mathrm{Wishart}_d(\nu,\mathbb{M})$ distribution is defined by
\begin{equation}\label{eq:Wishart.density}
    f_{\nu,\mathbb{M}}(\mathbb{X}) = \frac{|\mathbb{X}|^{\nu/2 - (d + 1)/2} \exp\big(-\frac{1}{2}\mathrm{tr}(\mathbb{M}^{-1} \mathbb{X})\big)}{|2 \, \mathbb{M}|^{\nu/2} \pi^{d(d-1)/4} \prod_{i=1}^d \Gamma\Big(\frac{\nu}{2} - \frac{i - 1}{2}\Big)}, \quad \mathbb{X}\in \mathcal{S}_{++}^d,
\end{equation}
where $\nu > d - 1$ is the number of degrees of freedom, and $\mathbb{M}\in \mathcal{S}_{++}^d$ is the scale matrix.
If $\mathbb{S} \sim \mathrm{Wishart}_d(\nu,\mathbb{M})$ and $\lambda_{\mathrm{max}}(\mathbb{S})$ is the largest eigenvalue of $\mathbb{S}$, then what is $\mathbb{E}[\lambda_{\mathrm{max}}(\mathbb{S})]$ ?
I can't find any reference with a clear answer to this question.

A: This reference seems to have a pretty clear answer:
Chiani, Marco, Distribution of the largest eigenvalue for real Wishart and Gaussian random matrices and a simple approximation for the Tracy-Widom distribution, J. Multivariate Anal. 129, 69-81 (2014). ZBL1359.60013.


text:
Q: Angularjs : Apply bold style to a character inside ng-repeat I have a list :
$scope.list = ["test/test1/test2/test3","test3/test5/test6"];

I would like to apply bold style to / characters when displaying the list :

{{path}}

Do you have any ideas how can I achieve this ?
Fiddle

A: you can do it simply with str.replace  http://jsfiddle.net/k18vgtvw/

controller
  $scope.csc = function(path) {
    return path.replace(/\//g, "/");
  }

A: There are a number of ways to do this. First I'd add a function to your controller, let's say it's called boldSlashes.
function boldSlashes(path) {
     return path.replace("/","/")
}

Then change your html to be:

   boldSlashes({{path}})

The ng-bind-html tells angular to treat the contents as html and not escape it.
You also have to inject ngSanitize into you module in order to use ng-bind-html.
So wherever you create your module, add ngSanitize to the dependencies like:
angular.module('myApp',[ngSanitize])

A: I'm not sure if this is what you are trying to do but I separated out individual elements. Also the jsfiddle font the bold font looks exactly the same on the / character.
http://jsfiddle.net/3a2duqg4/
1. Updated the view to a list
2. Changed the array to have an individual item per section
3. Added styles to the "/" and realized the font bold property with the fiddle default font didn't look any different.

{{path}} /

Added the items to a list rather than a paragraph and added some styles. I updated your array to have one value per array item as well.
Let me know if this helps! :)

A:

var myApp = angular.module('myApp',[]);

function MyCtrl($scope) {
    $scope.list = ["test/test1/test2/test3","test3/test5/test6"];
    $scope.updateString = function(s) {
     return s.replace(/\//g, '/');
    };
}
.bold {
  font-weight: bold;
}


text:
Q: Tinker not debugging with Laravel Dusk I am using Laravel dusk and I read the following article
https://medium.com/@icheko/laravel-dusk-tinker-79a1bcff03cd
Explaining you can use
tinker() to Debug issue with Laravel Dusk
however when I run the following code:
public function testTinker()
{
    $this->browse(function (Browser $browser) {
        $browser->visit('https://www.google.com')
            ->pause(3000);

        $browser->tinker();
    });
}

It seems like Dusk dose not stop and allow me to debug.
I am using Laravel with Windows 10.
What am I doing wrong?

A: At the bottom of the article you linked, it says:

Update: Looks like this only works for Mac —
https://github.com/laravel/dusk/pull/266

I believe the relevant issue is actually https://github.com/laravel/dusk/issues/276, which says that:

Warning: TTY mode is not supported on Windows platform.


text:
Q: mountall: error while loading shared libraries: libudev.so.0 I don't know how to fix this. My system won't even get past the loading screen. When I press F1 on the Ubuntu splash screen it shows me log with this message.
mountall: error while loading shared libraries: libudev.so.0

I cannot find any answer for this problem. I am new user on Ubuntu so please tell me should I reinstall the whole system or do something else.


text:
Q: angular: 'maybe' number formatter Is it possible to decorate the angular number filter, to return the input unmodified if it is not a number?
<my-tag input-value="{{foo() | number: 2}}"></my-tag>

When foo() would return 1.2345, the value should show 1.23, but when it returns "abcd" it would return just that: "abcd".

A: If you want to stock with the number filter you can build a decorator as suggested by @Ankh link, i.e:
app.config(['$provide', function($provide) {
  $provide.decorator('numberFilter', ['$delegate', function($delegate) {
    var srcFilter = $delegate;

    var extendsFilter = function() {
      // Put the logic you want here:
      let val = arguments[0];
      if (angular.isNumber(val)) {
        return srcFilter.apply(this, arguments);
      }
      else if (angular.isString(val)) {
        return val;
      }
      else {
        // Or throw an error
        return JSON.stringify(val);
      }
    }

    return extendsFilter;
  }])
}]);

See this plunker.


text:
Q: How can I view the visual graph representation of the nodes created from a Neo4J Java Application? I'm working with NEO4J and Java to create a prototype for an application that integrates a graph database that holds patient information (with fake, made up data).
I've created a simple two class program, and created nodes (haven't assigned relationships yet). However, I want to be able to view the nodes that I've created in order to make sure that my application is working properly, and to be able to see the results in the NEO4J Browser / Community Server.
How can I get the nodes to appear visually? I know I could test the fact that they're being created by querying them, but I also want to know how to visually display them.
What I've tried to do is go into the Neo4j.conf file, and change the active database from the default "graph.db" to "Users/andrew/eclipse-workspace/patients-database/target/patient-db", since in the Java class I've created, I use this line of code to set my database:
private static final File Patient_DB = new File("target/patient-db");

However, whenever I open the NEO4J browser at localhost:7474, after running my code there are no nodes visible.
Below, I'll paste the code to my PatientGraph class (the other class is just a Patient class that creates the Patients and their attributes)
package com.andrewhe.neo4j.Patients_Database;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;

import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Path;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
import org.neo4j.graphdb.traversal.Evaluators;
import org.neo4j.graphdb.traversal.TraversalDescription;
import org.neo4j.graphdb.traversal.Traverser;
import org.neo4j.io.fs.FileUtils;

public class PatientGraph {
    private static final File Patient_DB = new File("target/patient-db");
    private ArrayList<Patient> patients = new ArrayList<Patient>();
    private long patientZero;
    private GraphDatabaseService graphDb;

    public ArrayList<Patient> getPatients() { return patients; }

    public void manualPatientSetUp() throws IOException {
        Patient homeNode = new Patient("");
        Patient jan = new Patient("Jan");
        patients.add(jan);
        Patient kim = new Patient("Kim");
        patients.add(kim);
        Patient ahmad = new Patient("Ahmad");
        patients.add(ahmad);
        Patient andrew = new Patient("Andrew");
        patients.add(andrew);
    }

    public void createPatientNodes() throws IOException {
        FileUtils.deleteRecursively(Patient_DB);
        graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(Patient_DB);
        registerShutdownHook();

        try (Transaction tx = graphDb.beginTx()) {
            for (Patient patient : patients) {
                Node patientNode = graphDb.createNode();
                System.out.println("Node created");
                setProperties(patientNode, patient);
            }
            tx.success();
        }
    }

    //Method to create and set properties for node instead of using 5 set properties each time.
    public void setProperties(Node node, Patient patient) {
        node.setProperty("name", patient.getName());
        node.setProperty("weight", patient.getWeight());
        node.setProperty("pat_id", new String(patient.getPatientID()));
        node.setProperty("age", patient.getAge());
        //Don't worry about diagnoses yet;
        //To get it to work, just turn the diagnoses ArrayList into a String separated by commas.
    }

    public void setUp() throws IOException {
        //reads in patients using a file
    }

    public void shutdown()
    {
        graphDb.shutdown();
    }

    private void registerShutdownHook()
    {
        // Registers a shutdown hook for the Neo4j instance so that it
        // shuts down nicely when the VM exits (even if you "Ctrl-C" the
        // running example before it's completed)
        Runtime.getRuntime().addShutdownHook(new Thread(() -> graphDb.shutdown()));
    }

    public static void main(String[] args) throws IOException {
        PatientGraph pg = new PatientGraph();

        pg.manualPatientSetUp();
        pg.createPatientNodes();
        for (int i = 0; i < pg.getPatients().size(); i++) {
            pg.getPatients().get(i).printAllData();
        }
        pg.shutdown();
    }
}

A: You did not provide sufficient information about how you are querying the nodes. You did not even elaborate as to what you are classes do in a brief detail before actually pasting the entire class contents. What is the relationship between these classes? Expecting someone to decode this for you from the code, is asking for too much.
You could use Neo4J Browser (comes built-in) or Neo4J Bloom (commercial tool) to visualize the graph nodes and their interconnections (relations).
To query a Neo4j database you can use Cypher, a pictorial graph query language, that represents patterns as Ascii Art.
A detailed Hands-On procedure for querying and visualizing the Graph Nodes is given in the article below.
https://medium.com/neo4j/hands-on-graph-data-visualization-bd1f055a492d


text:
Q: Brent-Pollard factorization: What are the correct tortoise & hare indices in Brent's cycle finding algorithm? Some time ago, I ported this Python implementation of the Pollard-Brent algorithm to Clojure. It works, and works fast, too; that's not the problem. And when given identical non-random seed values and stepping functions, it reproduces the hare and tortoise positions of the Python code exactly.
But while I was working on it, I couldn't help but notice that the tortoise and hare didn't move quite the same way as I would expect based on the description of the algorithm in Brent's paper (or Wikipedia, or any other reference of choice).
Specifically, after the tortoise teleports to the hare's position, the hare steps forward by distance number of steps, and then steps an additional distance number of steps. Also, in the Brent-Pollard algorithm, the intermediate values are important as well; however, this code saves only the steps of the second hare "path".
Here are lines 6-18 of the Python code, with my comments:
    while g==1:

        # Tortoise (x) moves to hare (y)
        x = y

        # Hare (y) moves ahead by r steps
        for i in range(r):
            y = ((y*y)%N+c)%N

        k = 0

        # Hare (y) moves ahead by another r steps,
        # with checkpoints at every m steps (the checkpoints are
        # for the factorization; not part of Brent's cycle-finding algo proper)
        while (k<r and g==1):
            ys = y
            for i in range(min(m,r-k)):
                y = ((y*y)%N+c)%N
                q = q*(abs(x-y))%N
            g = gcd(q,N)
            k = k + m

I was going back over my code today and decided to test it for sure by mocking up a simplified version to show the indices. These are the indices given by the current code:
Current version:
Distance: 1
Tortoise at: 1
Hare starts at: 2
Hare path: [3]
Distance: 2
Tortoise at: 3
Hare starts at: 5
Hare path: [6 7]
Distance: 4
Tortoise at: 7
Hare starts at: 11
Hare path: [12 13 14 15]
Distance: 8
Tortoise at: 15
Hare starts at: 23
Hare path: [24 25 26 27 28 29 30 31]
Distance: 16
Tortoise at: 31
Hare starts at: 47
Hare path: [48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63]
Distance: 32
Tortoise at: 63
Hare starts at: 95
Hare path: [96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127]

Meanwhile, this is what I would expect the algorithm to do:
Expected output:
Distance: 1
Tortoise at: 1
Hare path: [2]
Distance: 2
Tortoise at: 2
Hare path: [3 4]
Distance: 4
Tortoise at: 4
Hare path: [5 6 7 8]
Distance: 8
Tortoise at: 8
Hare path: [9 10 11 12 13 14 15 16]
Distance: 16
Tortoise at: 16
Hare path: [17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32]
Distance: 32
Tortoise at: 32
Hare path: [33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64]

Even though the "expected" version reads better in Clojure when incorporated into the algorithm, it takes twice as long on average (which makes sense, looking at the indices).
My questions:

*

*Is my expected output the "canonical" version of Brent's algorithm?

*Is the current version still a correct implementation of Brent's algorithm?

*Why does the current version work even though the hare path does not contain wholly consecutive indices?


text:
Q: S3 presigned URL fails when deployed to Elastic Beanstalk I'm trying to use a presigned URL to upload files to S3. It works fine in my testing enviroment, but when I try and use the same code in the live environment (on elastic beanstalk) it returns an "AccessDenied" error.
I notice that the live request has completely different parameters, though the code is the same.
On localhost I have:

X-Amz-Expires, X-Amz-Algorithm, X-Amz-Credential, X-Amz-Date, X-Amz-SignedHeaders, X-Amz-Signature

On live I have:

AWSAccessKeyId, Expires,x-amz-security-token, Signature

A: I determined the issue. I hadn't authenticated the live servers, but had done so on our own machines.


text:
Q: typescript IntelliSense not worked in my vscode MacBook Pro (Retina, 13-inch, Early 2015)
Version: 1.42.1
Commit: c47d83b293181d9be64f27ff093689e8e7aed054
Date: 2020-02-11T14:44:27.652Z
Electron: 6.1.6
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 17.7.0
Tried some method online but it's not worked.
There's no hover infomation on the ts Type, and no IntelliSense when I type object..
And my win10 works fine.
I ran vscode with code . --disable-extensions, not worked.
I ran npm i typescript -g and the console output Version 3.8.3 when I execute tsc --version.
I installed JavaScript and TypeScript Nightly extention, but I could not see the TypeScript: Select TypeScript version command in the vs code command palette.
I tried install vs code 1.40.2, it's not worked too.
no typescript version info in the vscode status bar:


text:
Q: How to wait for Network response and then move(execute code) further after getting response in jetpack compose I am trying to achieve a functionality where my Complete profile page will check all the use cases for each field.
Every other field works fine with view-model and uses-cases but I am facing a problem while trying to check if username all ready exists or not in Firebase.
Use-Case for User Name.
class ValidateUserName() {

private var userAlways by Delegates.notNull<Boolean>()

@OptIn(DelicateCoroutinesApi::class)
suspend fun execute(userName: String): ValidationResult {
    return ValidationResult(
        successful = false,
        errorMessage = "UserName Can't be empty"
    )
}

suspend fun query(userName: String): ValidationResult {
    val successful = getResult(userName)
    if (successful) {
        return ValidationResult(
            successful = false,
            errorMessage = "UserName already Exists \nPlease try another Username"
        )
    } else {
        return ValidationResult(
            successful = true
        )
    }
}

suspend fun getResult(userName: String): Boolean {
    var x = 0
    val readUserNameQuery = Firebase.firestore.collection("users")
    readUserNameQuery.whereEqualTo("username", userName).get().addOnSuccessListener {
        Log.e("RONALDO", "HERE I AM HERE :- " + it.toObjects<Any>().size)
        x = it.toObjects<Any>().size
    }.await()
    delay(2000L)
    return x > 0
}

}
ViewModel (Caller)
class CompleteProfileViewModel(
private val validateEmail : ValidateEmail = ValidateEmail(),
private val validateFirstName : ValidateFirstName = ValidateFirstName(),
private val validateLastName: ValidateLastName = ValidateLastName(),
private val validateUserName: ValidateUserName = ValidateUserName()

) : ViewModel() {
var state by mutableStateOf(CompleteProfileState())
private val validationEventChannel = Channel<ValidationEvent>()
val validationEvents = validationEventChannel.receiveAsFlow()

fun onEvent(event: CompleteProfileEvent ){
    when(event){
        is CompleteProfileEvent.EmailChanged -> {
            state = state.copy(email = event.email)
        // the way to change state is to create(copy) whole new object
        }
        is CompleteProfileEvent.FirstNameChanged -> {
            state = state.copy(firstName = event.firstName)
        }
        is CompleteProfileEvent.LastNameChanged -> {
            state = state.copy(lastName = event.lastName)
        }
        is CompleteProfileEvent.UserNameChanged -> {
            state = state.copy(userName = event.userName)
        }
        is CompleteProfileEvent.Submit -> {
            viewModelScope.launch {
                submitData()
            }
        }
    }
}

private suspend fun submitData() {

    val userNameResult = if (state.userName.isNotBlank()){
        validateUserName.query(state.userName)
    }else{
        validateUserName.execute(state.userName)
    }
    val emailResult = validateEmail.execute(state.email)
    val firstNameResult = validateFirstName.execute(state.firstName)
    val lastNameResult = validateLastName.execute(state.lastName)
    val hasError = listOf(
        userNameResult,
        emailResult,
        firstNameResult,
        lastNameResult
    ).any{
        !it.successful
    }
    if (hasError){
        state = state.copy(
            emailError = emailResult.errorMessage,
            firstNameError = firstNameResult.errorMessage,
            lastNameError = lastNameResult.errorMessage,
            userNameError = userNameResult.errorMessage
        )
        return
    }
    viewModelScope.launch {
        validationEventChannel.send(ValidationEvent.Success)
    }
}
sealed class ValidationEvent{
    object Success : ValidationEvent()
}

}
Sorry for this code is not formatted Correctly
I just want to wait for my Firebase response before moving further. await() is not working in my case.
suspend fun getResult(userName: String): Boolean() is returning false and then getting the response.
Can anyone help me with this?

A: The problem in your code lies in the following lines of code:
readUserNameQuery.whereEqualTo("username", userName).get().addOnSuccessListener {
    Log.e("RONALDO", "HERE I AM HERE :- " + it.toObjects<Any>().size)
    x = it.toObjects<Any>().size
}.await()

Firebase API is asynchronous. Any code that needs data from the database needs to be inside the onSuccess() method, or be called from there. That being said, returning a value from an asynchronous operation as a result of a method doesn't provide the expected result.

await() is not working in my case.

It's because you're calling await() after attaching the listener. If you want to wait for the operation to complete, then you should call await() right after calling get(). It's one or the other:
val size = readUserNameQuery.whereEqualTo("username", userName).get().await().toObjects<Any>().size
Log.e("RONALDO", "HERE I AM HERE :- " + size)


text:
Q: Create downloadable csv file in app engine I'm trying to do the exact same thing as this SO question- how to create a downloadable csv file in appengine, but in Java. Right now I have CSVWriter writer = new CSVWriter(response.getWriter(), '\t'); but am not sure how to proceed since I have a java.util.List of queries, not an array.

A: Depending on the class of your "values" you might have to:

*

*Loop the entire list and convert to a String accordingly, for instance,
String[] array = new String[values.size()];
for (i = 0 ; i < values.size() ; i ++) {
array[i] = String.valueOf(values.get(i));
}
(Be careful with NPEs), or

*If the values are String already, convert the List to an array using:
List values = ...;
String[] array = values.toArray(new String[values.size]);


text:
Q: Include d3d11 to code block I'm still new to c++ and directX , what I'm trying to do is to include d3d11 to my project , after some research I ended up finding that I need to download windowsSDK 8.1 and then I go to Settings -> Compiler -> Search directories , and Add directories to the compiler and the linker
but when I installed the sdk I couldn't find :
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\include
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\lib
or :
C:\Program Files (x86)\Microsoft SDKs\Windows Kits\8.1\include
C:\Program Files (x86)\Microsoft SDKs\Windows Kits\8.1\lib
C:\Program Files (x86)\Microsoft SDKs\Windows Kits\8.1\bin
in the :
C:\Program Files (x86)\Microsoft SDKs\Windows Kits
there is only folder ( 10 )
and in the :
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\
there is only folder call ( bin )
I dont know if I'm doing something wrong or Microsoft change the directories or something .

A: Generally you select which Windows SDK to use by editing the Visual C++ project properties and setting the General -> "Windows SDK Version" property.
If you are using some makefile-based build solution, the paths you want to use are actually:
C:\Program Files (x86)\Windows Kits\8.1\Include\shared
C:\Program Files (x86)\Windows Kits\8.1\Include\um
C:\Program Files (x86)\Windows Kits\8.1\Include\winrt

C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86
-or-
C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x64

Or if using the Windows 10 SDK (which does in fact support Win32 desktop applications targeting Windows Vista SP2 or later) and assuming you have the latest Windows 10 Fall Creators Update (16299) installed:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\shared
C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\um
C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\winrt

C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\x86
-or-
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\x64

As you are new to Direct3D, I'd recommend using the directx-vs-templates with VS 2013, VS 2015, or VS 2017. Also see DirectX Tool Kit for DX11.


text:
Q: Solving a problem involving primitive and partially recursive functions. We have that for a partial function $f : \mathbb{N}^{k+1} \to \mathbb{N}$, the $\mu-$ operator is defined as the following:
$$\mu (f)(x_1, ..., x_k)=\begin{cases}
      n, & f(n,x_1,...,x_k)=0  \land f(n',x_1,...,x_k) \neq 0 \land \text{is defined for all} \ n' < n, \\
      \bot, & \text{else}
   \end{cases}$$
We are then given the following primitive recursive functions:
$$\text{modsub}: \mathbb{N}^2 \to \mathbb{N}, \text{modsub}(x,y) = \text{max}\{0,x-y\},$$
$$\text{exp}: \mathbb{N} \to \mathbb{N}, \text{exp}(x)=2^x$$
Finally, we have that $f: \mathbb{N}^2 \to \mathbb{N}$ is defined as $f(x,y):= \text{modsub}(y, \text{exp}(x))$.
How can I show that $\mu(f)(4) = 2$ and $\mu(f)(9) =4$?

A: $(\mu f)(4) =$ smallest $n$ such that $f(n,4) = \max\{0,4-2^n\}$ is zero, which is $n=2$.
$(\mu f)(9) =$ smallest $n$ such that $f(n,9) = \max\{0,9-2^n\}$ is zero, which is $n=4$. Here $n=3$ would lead to $\max\{0,9-2^3\}=1$.