text:
Q: App engine flex java: java.lang.UnsupportedClassVersionError: javax/tools/DiagnosticListener : Unsupported major.minor version 52.0 when I tried to deploy app in app engine flex from iCloud shell, I am getting below error
failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile: java.lang.UnsupportedClassVersionError:
javax/tools/DiagnosticListener : Unsupported major.minor version 52.0
java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-1~bpo8+1-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
but javac version is still pointing to 1.7.0_131... How to resolve this?

A: do same alternative update command will solve the issue


text:
Q: how to programmatically (c#) find and replace in doc and docx file in share point library My job is to do a find and replace in .doc and .docx files which are saved in sharepoint document library. i have to alter all the documents in the document library by doing find and replace. please help me in this...
Open XML formats are only for word 2007 (.docx).
I need single solution that would do find and replace in both .doc and .docx files.
The library also contains .ppt,.pptx and excel sheets also..

A: I would recommend you to take a look at a third party tool from Aspose:
http://www.aspose.com/categories/.net-components/aspose.words-for-.net/default.aspx
This supports both .doc and .docx, and they also have a similar product for PowerPoint. My experience with Aspose is that they are of high quality and easy to implement.

A: The best route to try is to look at "SharePoint Word Automation Services"
http://msdn.microsoft.com/en-us/library/ff742315.aspx
Below is an example from that link that should give you a good idea how to do this.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.Office.Word.Server.Conversions;

class Program
{
    static void Main(string[] args)
    {
        string siteUrl = "http://localhost";
        // If you manually installed Word automation services, then replace the name
        // in the following line with the name that you assigned to the service when
        // you installed it.
        string wordAutomationServiceName = "Word Automation Services";
        using (SPSite spSite = new SPSite(siteUrl))
        {
            ConversionJob job = new ConversionJob(wordAutomationServiceName);
            job.UserToken = spSite.UserToken;
            job.Settings.UpdateFields = true;
            job.Settings.OutputFormat = SaveFormat.PDF;
            job.AddFile(siteUrl + "/Shared%20Documents/Test.docx",
                siteUrl + "/Shared%20Documents/Test.pdf");
            job.Start();
        }
    }
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Cross Domain Messaging between different 'windows' in IE 11 On my parent window, I have:
if (window.addEventListener){
    addEventListener("message", listener, false);
} else {
    attachEvent("onmessage", listener);
}

On the popup, I have:
<script type="text/javascript">
    window.opener.postMessage("complete", "*");
    window.close();
</script>

This works for all the browsers except... yes you guessed it correct. IE-11!
Has anyone faced a similar problem before and can help me with fixing the existing code or giving an alternate solution? I have tried googling hard!

A: So I had a similar problem a few months ago while developing a framework designed for this sort of thing. Essentially, I gave up and instead had my parent window send a message to my child window (right after it was created), and that message contains the event source as part of the message (which is essentially a reference to the parent window). I then reply back to the window by doing postMessage on that object.


text:
Q: pgfplotstable: string replace when formatting with 'postproc cell content' does not work It seems, that string replace={XXX}{replaced} does not work, if I use  postproc cell content/.style={...}.
What can I do?

\documentclass[a4paper]{article}
\usepackage{colortbl}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\pgfplotstableread[col sep = semicolon, header=true]{
A;     B
111; aaa
222; XXX
333; ccc
444; ddd
555; XXX
}{\mytable}

\begin{document}

\section{With postproc cell content -- works not}
\pgfplotstabletypeset[string type,
columns/B/.style={
string replace={XXX}{replaced},
postproc cell content/.style={
  @cell content={\cellcolor{pink}\textcolor{blue}{##1}}   },
},
]{\mytable}

\section{Without postproc cell content -- works}
\pgfplotstabletypeset[string type,
columns/B/.style={
string replace={XXX}{replaced},
},
]{\mytable}
\end{document}

A: Just replace the string as part of postproc cell content:
\documentclass[a4paper]{article}
\usepackage{colortbl}
\usepackage{pgfplotstable}
\pgfplotsset{compat=newest}
\pgfplotstableread[col sep = semicolon, header=true]{
A;     B
111; aaa
222; XXX
333; ccc
444; ddd
555; XXX
}{\mytable}

\ExplSyntaxOn
\cs_new_eq:NN \strifeq \str_if_eq:nnTF
\ExplSyntaxOff

\begin{document}

\section{With postproc cell content -- works not}
\pgfplotstabletypeset[string type,
columns/B/.style={
string replace={XXX}{replaced},
postproc cell content/.style={
  @cell content={\cellcolor{pink}\textcolor{blue}{##1}}   },
},
]{\mytable}

\section{Without postproc cell content -- works}
\pgfplotstabletypeset[string type,
columns/B/.style={
string replace={XXX}{replaced},
},
]{\mytable}

\section{With postproc cell content -- works}
\pgfplotstabletypeset[string type,
columns/B/.style={
postproc cell content/.style={
  @cell
  content={\cellcolor{pink}\textcolor{blue}{\strifeq{##1}{XXX}{replaced}{##1}}}},
},
]{\mytable}
\end{document}


text:
Q: Design in bootstrap I am new in bootstrap can anyone help me with a responsive design like this image using bootstrap CSS.

My HTML code

Lorem ipsum dolor sit amet

                     Bipin Fultariya
                     4 min read

css
.recommended-story {
    padding-bottom: 20px;
}

.recommended-story .img-block img {
    height: 120px;
    width: 80px;
    border-radius: 4px;
}

.recommended-story .card-lst {
    padding-left: 0;
    background: #fff;
}

.recommended-story .card-descriptions {
    padding: 5px 14px;
}

.recommended-story {
    padding-bottom: 20px;
}

.recommended-story .img-block img {
    height: 120px;
    width: 80px;
    border-radius: 4px;
}

.recommended-story .card-lst {
    padding-left: 0;
    background: #fff;
}

.recommended-story .card-descriptions {
    padding: 5px 14px;
}

Hello World

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed hendrerit adipiscing blandit. Aliquam placerat, velit a fermentum fermentum, mi felis vehicula justo, a dapibus quam augue non massa.

A: You can use media object which is available in Bootstrap 3.3. Read more about it over here
I've replicated it with media object.

.p-5{
  padding-top: 3rem;
}
.media{
  border: 1px solid #444;
  padding: 3rem;
}

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet Lorem r sit amet Lorem ipsum dolor sit amet Lorem r sit amet Lorem ipsum dolor sit amet Lorem r sit amet Lorem

    Jason Hunk
    4 min read

A:

Hello World

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed hendrerit adipiscing blandit. Aliquam placerat, velit a fermentum fermentum, mi felis vehicula justo, a dapibus quam augue non massa.


text:
Q: Resid vs Fitted plot for similar data on lme4 model looks vastly different on similar data. Error: "boundary (singular) fit: see help('isSingular')" Forgive me if I am missing important information this is my first time posting here. I am trying to build a mixed model to see effects of a management treatment (gridtype) on body condition of certain species of birds (JAWE & KAEL for this example). I am using the same code to build the model for two different species but getting very different looking residual vs fitted plots and I am wondering why. The plot for the JAWE species is clustered into two groups where KAEL is not.
JAWE.mixed.lmer <- lmer(bc ~ gridtype + (1|bandingstation), data = JAWE_bd)
KAEL.mixed.lmer <- lmer(bc ~ gridtype + (1|bandingstation), data = KAEL_bd)
This is how the JAWE plot comes out
plot(JAWE.mixed.lmer)

This is how the KAEL plot comes out
plot(KAEL.mixed.lmer)

I think it has something to do with this error I am getting on the JAWE model but I can't figure out what it is.

boundary (singular) fit: see help('isSingular')

I've tried setting gridtype and banding station as factors because they upload as characters, I've looked for missing data in the raw data but everything looks fine, I've checked the code over and over to see if there are any differences in the input but I can't find anything.
Here is the str() of the JAWE data

and here is the str() of the KAEL data

If anyone would be able to help me solve this mystery I would greatly appreciate it.


text:
Q: Capture changes for the last 30 minutes from tables I need only to capture the changes for last 30 minutes only in for the below query:
  SELECT
  P.COL1, P.COL2, P.COL3, C.COL1, C.COL2, T.COL1, T.COL2, P.COL4+T.COL4 AS "COL4"
  FROM
  TABLE1 P,
  TABLE2 C,
  TABLE3 T
  WHERE
  PM.COL1(+)  = C.COL1
  AND T.COL2(+) = C.COL2

TABLE 1, TABLE 2 AND TABLE3 each has a modification date column, but I think adding the following to the query logically won't be right and it might degrade the query execution performance
 SELECT
 P.COL1, P.COL2, P.COL3, C.COL1, C.COL2, T.COL1, T.COL2, P.COL4+T.COL4 AS "COL4"
 FROM
 TABLE1 P,
 TABLE2 C,
 TABLE3 T
 WHERE
 PM.COL1(+)  = C.COL1
 AND T.COL2(+) = C.COL2
 AND P.MODIFICATION_DATE > SYSDATE - 30
 AND C.MODIFICATION_DATE > SYSDATE - 30
 AND T.MODIFICATION_DATE > SYSDATE - 30;

Also not all the 3 tables are updated at the same time, TABLE2 as an example last modification_date was yesterday at 11:00 am while TABLE3 modification_date is today at 2:00 pm.
How can I capture the latest 30 minutes changes between the tables?

A: Your query is incorrect in multiple different ways.  First, sysdate - 30 subtracts 30 days not 30 minutes from the value.
From what you describe, the following may be what you want:
SELECT . . .
FROM (SELECT P.*
      FROM TABLE1 P
      WHERE P.MODIFICATION_DATE > SYSDATE - 30 / (24 * 60)
     ) P FULL JOIN
     (SELECT C.*
      FROM TABLE2 C
      WHERE C.MODIFICATION_DATE > SYSDATE - 30 / (24 * 60)
     ) C
     ON P.COL1 = C.COL1 FULL JOIN
     (SELECT T.*
      FROM TABLE3 T
      WHERE T.MODIFICATION_DATE > SYSDATE - 30 / (24 * 60)
     )
     ON T.COL2 = C.COL2;

A:
How can I capture the latest 30 minutes changes between the tables?

You can find the last 30 minutes activity for each COL1 and COL2 from one table using:
SELECT *
FROM   (
  SELECT C.*,
         MAX( MODIFICATION_DATE ) OVER ( PARTITION BY COL1, COL2 ) AS last_mod_date
  FROM   TABLE2 C
)
WHERE  MODIFICATION_DATE >= LAST_MOD_DATE - INTERVAL '30' MINUTE

If you just want the last 30 minutes for the entire table (rather than for each combination of COL1 and COL2) then remove the PARTITION BY COL1, COL2 clause to just leave it as OVER ().
So to get the last 30 minutes of each table you can do:
WITH C AS (
  SELECT *
  FROM   (
    SELECT C.*,
           MAX( MODIFICATION_DATE ) OVER ( PARTITION BY COL1, COL2 ) AS last_mod_date
    FROM   TABLE2 C
  )
  WHERE  MODIFICATION_DATE >= LAST_MOD_DATE - INTERVAL '30' MINUTE
),
P AS (
  SELECT *
  FROM   (
    SELECT P.*,
           MAX( MODIFICATION_DATE ) OVER ( PARTITION BY COL1 ) AS last_mod_date
    FROM   TABLE1 P
  )
  WHERE  MODIFICATION_DATE >= LAST_MOD_DATE - INTERVAL '30' MINUTE
),
T AS (
  SELECT *
  FROM   (
    SELECT T.*,
           MAX( MODIFICATION_DATE ) OVER ( PARTITION BY COL2 ) AS last_mod_date
    FROM   TABLE2 T
  )
  WHERE  MODIFICATION_DATE >= LAST_MOD_DATE - INTERVAL '30' MINUTE
)
SELECT P.COL1, P.COL2, P.COL3, C.COL1, C.COL2, T.COL1, T.COL2, P.COL4+T.COL4 AS "COL4"
FROM   C
       LEFT OUTER JOIN P
       ON (    P.COL1  = C.COL1 )
       LEFT OUTER JOIN T
       ON (    T.COL2 = C.COL2 );

Without some sample data and seeing what your expected results are it is difficult to know if you need/want the PARTITION BY clauses.


text:
Q: Unable to boot Ubuntu 14.04 after upgrading I successfully upgraded from Ubuntu 12.04 to 14.04 with sudo do-release-upgrade, and after that with lsb_release -a I received this message:
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:        14.04
Codename:       trusty

but after I powered off, I could not boot my system.


text:
Q: Symmetry and singularities The function $f(x) = x$ is point symmetric. But what's with $g(x) = (x^2 - x)/(x - 1)$?
$\mathbb{D}_g = \mathbb{R} \backslash \{1\}$
$g(x) = -g(-x)$ is true for every $x \in \mathbb{R} \backslash \{-1;1\}$ but not for $x = -1$ or $x = 1$ because $g(1)$ is not defined.
Is this a reason to say that $g$ is not point symmetric or is the singularity ignored?

A: What you call "point symmetric" is commonly referred to as "odd", e.g. $f$ is an odd function.
And yes, $g$ is not odd because $g(x)=-g(-x)$ is not true for all $x$ in the domain of $g$ even though $f$ is odd and agrees with $g$ on its domain.
And though we can extend $g$ continuously to all of, say, $\mathbb R$ such that it equals $f$, and we have that $f=g$ as fractions of polynomials, this still doesn't make $g$ an odd function.


text:
Q: first time I have to create an extension for linq2sql, how to do this one? I have this one line property
Public ReadOnly Property DateToUniversal(ByVal dt As Nullable(Of Date)) As String
    Get
        Return If(dt.HasValue, dt.Value.ToString("u").Substring(0, 10), "")
    End Get
End Property

if i'm trying to use that into a
from n in mydatacontext
select new myObj {n.field1,n.field2, DateToUniversal(n.field3)}

it doesn't work all the time because LINQ2SQL cannot convert that into a sql query.
is there a way to do this?

A: You'll have to turn it into two queries:
var query = (from n in mydatacontext select new {n.field1,n.field2, n.field3}).AsEnumerable();

query = from n in query select new {n.field1, n.field2, DateToUniversal(n.field3)};

It's important that query be IEnumerable instead of var (or IQueryable)It's important that you call AsEnumerable() so that you get back an IEnumerable<T>, as we want to force the second query to use LINQ to Objects on the results of the first (LINQ to SQL) query.
I'm not in front of VS at this time, but this should do the trick.

Thanks to  itowlson for pointing out that it has to be IEnumerable<T>, not just IEnumerable!


text:
Q: CSS header positioning to match with background texture I have background image which looks like texture, so the background image have to precisely continue one after another. That is fine, but main content of web page is centered. However, the header (with fixed width) overlaps the top part of background. Therefore, the header image don't continue smoothly with background image. I need some kind of grid, or another solution.
There is the link, you could check out my simple webpage with that issue:
example web page
PS: To see the issue, you need to have wide-screen (min 1183px)
Thanks.

A: Why don't you just pull out that diagonal repeating background off of your background image, create it to be another image, put that into a div, and make its zindex higher than the background and the header so it overlays?

A: *

*Your header image should just use transparency instead of trying to replicate the lines exactly, and avoid the problem altogether.

*If you insist, use background-position: 50% 0; on the body background to make it fixed to the center. Then no matter what size the screen, the backgrounds will stay aligned at the same place. Make a few adjustments to the image, and it will work fine.


text:
Q: iOS 6 : compatibility issue with AddSubView I am trying to make my iPhone app compatible with iOS 6, the problem is that when I use addSubview method, the height of view added is 460 by default.
but I dont want to set the frame manually for all of my application views.
what do you suggest ?

A: I am having the same issue using ios6/XCode 4.5.
I have a addSubview in landscape and even though  the .xib is set to autoResize, it shows with the width for 3.5" displays.  The main view fills the 4" screen fine.


text:
Q: How anonymous functions are passing arguments I've been playing around with javascript functions and I stuck understang the flow of a piece of code:
Let's take this example
Test = (function(arg) {
    function Test(str) {
        console.log(arg + ' ' + str);
    }

    console.log('toto');

    return Test;
})()

So, if I run this I'll get 'toto', fine !
Now If do this:
Test = (function(arg) {
        function Test(str) {
            console.log(arg + ' ' + str);
        }

        console.log('toto');

        return Test;
    })('titi')
Test('tata');

I'll get:
toto
titi tata

How is this happening, when I wrote Test('tata'), did I call the first Test, I mean:
Test = (function(arg) ...
Or I ran the function Test(str) ?
And If I'm actually running the first Test, How it passed Tata to the function Test inside of it?

And finally, Why it didn't log toto another time when I called Test('tata')?

A: Your anonymous function returns the inner function "Test".  The console.log("toto") call is not inside that function.
Calling the returned function does not call the anonymous function again. Your inner function however retains it's "memory" of the "arg" value passed in, and that explains why it logs "titi tata".
So, what happens step-by-step is:

*

*The variable "Test" is declared;

*The anonymous function is called.

*The inner function "Test" is defined in the local context of the anonymous function.

*The "toto" log statement is executed.

*The return statement is executed, and the function exits with a reference to the inner function "Test".

*The return value is assigned to the variable "Test' in the outer context.

*The returned function is called via the reference in the outer "Test" variable, with the argument being the string "tata".

*The console.log() statement in the returned function is run, using a string constructed by concatenating the value of "arg" as it stood when the function was created ("titi") with the argument passed in ("tata").

So the function returned in step 5 "remembers" the "titi" argument, so any call to that function will result in the string "titi" being prepended.

A: The inner Test is a new function, unrelated to the initial Test. Further, you've returned it, however it's maintained the arg with it's value of titi within its closure.
When you assign Test, it outputs the "toto", but never runs the inner Test function, so you do not see "titi" until you call your Test('tata') which then calls the inner returned function which has saved "arg" as "titi" initially.
If you want to think about how it's run, you would actually end up with this (where Test is assigned the inner function, and has saved 'titi' as arg):
Test = function(str) {
  console.log('titi' + ' ' + str);
}
console.log('toto');

Test('tata');

A: Let's analyze your code a bit:
Full code (slightly edited):
TestO = (function(arg) {
    function TestI(str) {
        console.log(arg + ' ' + str);
    }

    console.log('toto');

    return TestI;
})()

The outer part:
TestO = function(arg) { ... } (/* 0 parameters */)

Test is initialized to the return value of that anonymous function called with 0 parameters.
The inner function:
function TestI(str) {
    console.log(arg + ' ' + str); outer function
}

arg is the value of the argument passed to the outer function. It is available because of closures.
Outer function body
console.log('toto');
return TestI; // this value will be passed to TestO

This code is executed when you call the anonymous outer function, not TestO, not TestI. The outer function is called when TestO is initialized.
Conclusion
The anonymous outer function is called when TestO is initialized, logs 'toto' and initializes TestO with the TestI function (which is also a closure over the arg parameter of the anonymous outer function).
TestO('tata') // calls TestI with the closured value of `arg` as `arg` and 'tata' as `str`


text:
Q: Splitting runtime permission in multiple files I've the below code to grant the run time permission in Android, here I'm trying to do it for Camera.
I added the required into the manifiest:
<uses-permission android:name="android.permission.CAMERA"/>

And the below MainActivity.Kt worked perfectly with me:
package com.example.hasan.runtime.feature

import android.Manifest
import android.os.Bundle
import android.support.design.widget.Snackbar
import android.support.v7.app.AppCompatActivity
import android.widget.Toast
import feature.utilis.isPermissionGranted
import feature.utilis.requestPermission
import feature.utilis.shouldShowPermissionRationale
import feature.utilis.showSnackbar
import kotlinx.android.synthetic.main.activity_main.*

const val PERMISSION_REQUEST_CAMERA = 0

class MainActivity : AppCompatActivity() {

  //  private lateinit var layout: View

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        btn_cam.setOnClickListener { showCamera() }
    }

    fun showCamera() {
        if (isPermissionGranted(Manifest.permission.CAMERA)) {
            main_layout.showSnackbar(R.string.camera_permission_available,
                    Snackbar.LENGTH_INDEFINITE, R.string.ok){
                startCamera()
            }
        } else {
            requestCameraPermission()
        }
    }

    fun startCamera() {
        // val intent = Intent(this, CameraPreviewActivity::class.java)
        // startActivity(intent)

        Toast.makeText(this, "Done correctly", Toast.LENGTH_LONG).show()

    }

    private fun requestCameraPermission() {
        // Permission has not been granted and must be requested.
       if (shouldShowPermissionRationale(Manifest.permission.CAMERA)) {
            main_layout.showSnackbar(R.string.camera_access_required,
                    Snackbar.LENGTH_INDEFINITE, R.string.ok) {
                requestPermission(Manifest.permission.CAMERA,
                        PERMISSION_REQUEST_CAMERA)
            }
        } else {
            main_layout.showSnackbar(R.string.camera_permission_not_available,
                    Snackbar.LENGTH_INDEFINITE, R.string.ok){}
       }
    }

    override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>,
                                            grantResults: IntArray) {
        if (requestCode == REQUEST_CAMERA) {
            if (isPermissionGranted(Manifest.permission.CAMERA)) {
                main_layout.showSnackbar(R.string.camera_permission_available,
                        Snackbar.LENGTH_INDEFINITE, R.string.ok){}
            } else {
                main_layout.showSnackbar(R.string.camera_permission_not_available,
                        Snackbar.LENGTH_INDEFINITE, R.string.ok){}

            }
        } else if (requestCode == REQUEST_CONTACTS) {

        } else {
            super.onRequestPermissionsResult(requestCode, permissions, grantResults)
        }
    }

    companion object {
        const val REQUEST_CAMERA = 0
        const val REQUEST_CONTACTS = 1
        val PERMISSIONS_CONTACT = arrayOf(Manifest.permission.READ_CONTACTS,
                Manifest.permission.WRITE_CONTACTS)
    }
}

I made the below Extensions writing them just to make the above code very clear to who read it:
ActivityExt.Kt:
package feature.utilis

import android.content.pm.PackageManager
import android.support.v4.app.ActivityCompat
import android.support.v7.app.AppCompatActivity

fun AppCompatActivity.isPermissionGranted(permission: String) =
        ActivityCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_GRANTED

fun AppCompatActivity.shouldShowPermissionRationale(permission: String) =
        ActivityCompat.shouldShowRequestPermissionRationale(this, permission)

fun AppCompatActivity.requestPermission(permission: String, requestId: Int) =
        ActivityCompat.requestPermissions(this, arrayOf(permission), requestId)

fun AppCompatActivity.batchRequestPermissions(permissions: Array<String>, requestId: Int) =
        ActivityCompat.requestPermissions(this, permissions, requestId)

ViewExt.Kt:
package feature.utilis

import android.support.design.widget.Snackbar
import android.view.View

fun View.showSnackbar(msgId: Int, length: Int) {
    showSnackbar(context.getString(msgId), length)
}

fun View.showSnackbar(msg: String, length: Int) {
    showSnackbar(msg, length, null, {})
}

fun View.showSnackbar(
        msgId: Int,
        length: Int,
        actionMessageId: Int,
        action: (View) -> Unit
) {
    showSnackbar(context.getString(msgId), length, context.getString(actionMessageId), action)
}

fun View.showSnackbar(
        msg: String,
        length: Int,
        actionMessage: CharSequence?,
        action: (View) -> Unit
) {
    val snackbar = Snackbar.make(this, msg, length)
    if (actionMessage != null) {
        snackbar.setAction(actionMessage) {
            action(this)
        }.show()
    }
}

My question here, is I feel the MainActivity.Kt file will be extremely long when I add all the permissions I need, as it is recommended to ask for them one by one, how can I split it into multiple files, so that each file do the required for that operation permission, like SMS, Contact,...

A: I solved it by the following:
Create ActivityExt.tk:
package feature.extensions

import android.app.Activity
import android.content.pm.PackageManager
import android.support.v4.app.ActivityCompat
import android.widget.Toast

fun Activity.isPermissionGranted(permission: String) =
        ActivityCompat.checkSelfPermission(this, permission) == PackageManager.PERMISSION_GRANTED

fun Activity.arePermissionsGranted(permissions: Array<String>): Boolean {
    permissions.forEach { it ->
        if(ActivityCompat.checkSelfPermission(this, it) != PackageManager.PERMISSION_GRANTED)
            return false
    }
    return true
}

fun Activity.shouldShowPermissionRationale(permission: String) =
        ActivityCompat.shouldShowRequestPermissionRationale(this, permission)

fun Activity.requestPermission(permission: String, requestId: Int) =
        ActivityCompat.requestPermissions(this, arrayOf(permission), requestId)

fun Activity.batchRequestPermissions(permissions: Array<String>, requestId: Int) =
        ActivityCompat.requestPermissions(this, permissions, requestId)

fun Activity.toast(message: CharSequence) =
        Toast.makeText(this, message, Toast.LENGTH_SHORT).show()

Create PermissionsResult.Kt:
package feature.utilities

import android.Manifest
import android.Manifest.permission.*
import android.app.Activity
import android.support.design.widget.Snackbar
import android.view.View
import com.example.hasan.runtime.feature.PERMISSION_REQUEST_CAMERA
import com.example.hasan.runtime.feature.R
import feature.extensions.requestPermission
import feature.extensions.toast
import feature.extentions.showSnackbar

object UtilPermissionsResult {
    fun getPermissionsResult(activity: Activity?, layout: View?,
                             permissions: Array<String>, grantResults: IntArray) {

        val permissionsMap = HashMap<String, Int>()
        for ((index, permission) in permissions.withIndex()) {
            permissionsMap[permission] = grantResults[index]
        }

        if(permissionsMap[CAMERA] != 0) {
            layout!!.showSnackbar(R.string.camera_permission_not_available,
                    Snackbar.LENGTH_INDEFINITE, R.string.ok){
                activity!!.toast("Camera permission NOT granted")
                activity!!.requestPermission(Manifest.permission.CAMERA,
                        PERMISSION_REQUEST_CAMERA)
            }
        }
        else {
            layout!!.showSnackbar(R.string.camera_permission_available,
                    Snackbar.LENGTH_INDEFINITE, R.string.ok){
                activity!!.toast("Camera permission granted")
            }
        }

        if(permissionsMap[ACCESS_FINE_LOCATION] != 0
                || permissionsMap[READ_SMS] != 0) {
                activity!!.toast("Location and permissions are a must")
            } else {
                activity!!.toast("Thanks, all permissions had been granted")
        }
    }
}

Create Permissions.Kt:
package feature.utilities

import android.Manifest.permission.*
import android.app.Activity
import android.support.design.widget.Snackbar
import android.view.View
import com.example.hasan.runtime.feature.PERMISSION_REQUEST_ALL
import com.example.hasan.runtime.feature.PERMISSION_REQUEST_CAMERA
import com.example.hasan.runtime.feature.R
import feature.extensions.*
import feature.extentions.showSnackbar

val PERMISSIONS =
        arrayOf(ACCESS_FINE_LOCATION,
                ACCESS_COARSE_LOCATION,
                READ_SMS, READ_CONTACTS,
                ACCESS_NETWORK_STATE)

object UtilPermissions {
    fun showCamera(activity: Activity?, layout: View?) {
     //   using context
        if (activity!!.isPermissionGranted(CAMERA)) {
                startCamera(activity)
        } else {
            requestCameraPermission(activity, layout)
        }
    }

    private fun requestCameraPermission(activity: Activity?, layout: View?) {
        if (activity!!.shouldShowPermissionRationale(CAMERA)) {
            layout!!.showSnackbar(R.string.camera_access_required,
                    Snackbar.LENGTH_INDEFINITE, R.string.ok) {
                // activity!!.requestPermission(CAMERA, PERMISSION_REQUEST_CAMERA)
                 activity!!.batchRequestPermissions(PERMISSIONS, PERMISSION_REQUEST_ALL)
            }
        }
        else {  // useful in case camera not available
            layout!!.showSnackbar(R.string.camera_permission_not_available,
                    Snackbar.LENGTH_INDEFINITE, R.string.ok){
                activity!!.requestPermission(CAMERA,
                        PERMISSION_REQUEST_CAMERA)
            }
        }
    }

private fun startCamera(activity: Activity?) {
        // val intent = Intent(this, CameraPreviewActivity::class.java)
        // startActivity(intent)

        activity!!.toast("Done smoothly")

    }
}

Then the MainActivity.Kt became as simple and small as the below:
package com.example.hasan.runtime.feature

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.View
import feature.utilities.UtilPermissions.showCamera
import feature.utilities.UtilPermissionsResult.getPermissionsResult
import kotlinx.android.synthetic.main.activity_main.*

const val PERMISSION_REQUEST_CAMERA = 0
const val PERMISSION_REQUEST_ALL = 0

private lateinit var layout: View

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        layout = main_layout
        btn_cam.setOnClickListener { showCamera(this, main_layout) }

    }

    override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>,
                                            grantResults: IntArray) {
        getPermissionsResult(
                this,
                layout,
                permissions,
                grantResults
        )
    }
}

The AndroidManifest.xml included the below:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.hasan.runtime.feature">

    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.READ_CONTACTS"/>

    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.READ_SMS"/>
    <uses-permission android:name="android.permission.RECEIVE_SMS" />

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

    <application>
        <activity android:name=".MainActivity">
            <intent-filter android:order="1">
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.BROWSABLE" />
                <category android:name="android.intent.category.DEFAULT" />

                <data
                    android:host="example.com"
                    android:pathPattern="/.*"
                    android:scheme="https" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

And my ViewWxt.Kt remains with no changes:
package feature.extentions

import android.support.design.widget.Snackbar
import android.view.View

fun View.showSnackbar(msgId: Int, length: Int) {
    showSnackbar(context.getString(msgId), length)
}

fun View.showSnackbar(msg: String, length: Int) {
    showSnackbar(msg, length, null, {})
}

fun View.showSnackbar(
        msgId: Int,
        length: Int,
        actionMessageId: Int,
        action: (View) -> Unit
) {
    showSnackbar(context.getString(msgId), length, context.getString(actionMessageId), action)
}

fun View.showSnackbar(
        msg: String,
        length: Int,
        actionMessage: CharSequence?,
        action: (View) -> Unit
) {
    val snackbar = Snackbar.make(this, msg, length)
    if (actionMessage != null) {
        snackbar.setAction(actionMessage) {
            action(this)
        }.show()
    }
}

I made another file for 'getLocation.Kt' and it is functioning fine with the below code:
package feature.utilities

import android.Manifest
import android.annotation.SuppressLint
import android.app.Activity
import android.location.Location
import android.support.design.widget.Snackbar
import android.view.View
import android.widget.TextView
import com.example.hasan.runtime.feature.PERMISSION_REQUEST_ALL
import com.example.hasan.runtime.feature.R
import com.google.android.gms.location.FusedLocationProviderClient
import com.google.android.gms.location.LocationServices
import feature.extensions.arePermissionsGranted
import feature.extensions.batchRequestPermissions
import feature.extensions.toast
import feature.extentions.showSnackbar

val PERMISSIONS =
        arrayOf(Manifest.permission.ACCESS_FINE_LOCATION,
                Manifest.permission.ACCESS_COARSE_LOCATION)

private lateinit var fusedLocationClient: FusedLocationProviderClient

object UtilLocation {
    fun getLocation(activity: Activity?, layout: View?, latitudeTxt: TextView?, longitudeTxt: TextView?) {
        fusedLocationClient = LocationServices.getFusedLocationProviderClient(activity!!)

        if (activity!!.arePermissionsGranted(PERMISSIONS)) {
                startLocation(activity, layout, latitudeTxt, longitudeTxt)
        } else {
                requestCameraPermission(activity, layout)
        }
    }

    private fun requestCameraPermission(activity: Activity?, layout: View?) {
            layout!!.showSnackbar(R.string.location_access_required,
                    Snackbar.LENGTH_INDEFINITE, R.string.ok) {
                activity!!.batchRequestPermissions(PERMISSIONS, PERMISSION_REQUEST_ALL)
            }
    }

    @SuppressLint("MissingPermission")
    private fun startLocation(activity: Activity?, layout: View?, latitudeTxt: TextView?, longitudeTxt: TextView?) {

        fusedLocationClient.lastLocation
                .addOnSuccessListener { location : Location? ->
                    latitudeTxt!!.text = location!!.latitude.toString()
                    longitudeTxt!!.text = location!!.longitude.toString()
                    // Got last known location. In some rare situations this can be null.
                    activity!!.toast("lat: "+location!!.latitude.toString()+", long: "+location!!.longitude.toString())
                }
    }
}


text:
Q: SQL option to display the results on evaluating the column values I have a table as shown below

SourceCustomerId
HasTaxBenifit
HasCollateral
HasLoan

100021
No
No
No

100022
No
No
Yes

100023
No
Yes
No

100024
No
Yes
Yes

100025
Yes
No
No

100026
Yes
No
Yes

100027
Yes
Yes
No

100028
YEs
Yes
Yes

On Using a select statement, the expected output.

SourceCustomerId
BinaryTaxBenifit
BinaryCollateral
BinaryLoan

100021
0
0
0

100022
0
0
1

100023
0
1
0

100024
0
1
1

100025
1
0
0

100026
1
0
1

100027
1
1
0

100028
1
1
1

The logic is every column has  a binary equivalent and they will be having a value of 0 if the columns are having a value 'No'. else 'Yes'. How do I implement this?

A: You can use a case expression:
select t.*,
       (case when HasTaxBenifit = 'Y' then 1 else 0 end) as BinaryTaxBenefit,
       . . .
from t;


text:
Q: Getting an error while linking a .so file with the NDK Why am I getting this error while linking a shared object file?
$ gcc calcicall.c -o dynamically_linked -L. libcalcimethods.so.1.0.1
/usr/lib/gcc/i686-pc-cygwin/4.3.4/../../../libcygwin.a(libcmain.o):(.text+0xa9)
 undefined reference to `_WinMain@16'

collect2: ld returned 1 exit status

Can someone help me?
Thanks

A:
undefined reference to `_WinMain@16'

You are compiling and linking it as an executable.
Use -shared to compile and link it as Shared object or otherwise define main function in your program.


text:
Q: Dotnet core automapper orderItems Now I am creating a website where you can place orders.
There we have Order, OrderItem and Item.
public class Order
{
    public int Id { get; set; }
    public User User { get; set; }
    public int? UserId { get; set; }
    public ICollection<OrderItem> OrderItems { get; set; }
    public int TotalPrice { get; set; }
    public string Status { get; set; }
     public DateTime CreatedAt { get; set; }
}

public class OrderItem
{
    public int Id { get; set; }
    public int ItemId { get; set; }
    public virtual Item Item { get; set; }
    public int Count { get; set; }
    public int OrderId { get; set; }
    public Order Order { get; set; }
    public double TotalPrice { get; set; }
}

public class OrderItem
{
    public int Id { get; set; }
    public int ItemId { get; set; }
    public Item Item { get; set; }
    public int Count { get; set; }
    public int OrderId { get; set; }
    public Order Order { get; set; }
    public double TotalPrice { get; set; }
}

Upon creation of the order I will receive:
{
    "orderItems": [
        {
            "itemId": 1,
            "count": 4
        }
    ]
}

and I have added in controller:
 var userFromRepo = await _repo.GetUser (userId);
 OrderForCreationDto.UserId = userId;
 var order = _mapper.Map<Order> (OrderForCreationDto);
     // userFromRepo.Orders.Add(order);
     _repo.Add (order);

     if (await _repo.SaveAll ())
     {
         var OrderToReturn = _mapper.Map<OrderForCreationDto> (order);
        return Ok (OrderToReturn);
     }

and in automapper:
        CreateMap<Order, OrderForCreationDto> ();
        CreateMap<OrderItemForCreationDto, OrderItem> ()
            .ForMember (dest => dest.TotalPrice, opt => {
                opt.MapFrom (d => d.Item);
                opt.ResolveUsing (d => d.Item.Price * d.Count);
            });

but always the mapping for OrderItem => item is null and so its giving error inside automapper.
I know its a long question but its killing me, I would appreciate if you could help. Thank you in advance

A: You are using older version of Automapper. In the version 8.0 ResolveUsing was consolidated with MapFrom.
Looks like you have source and destination switched. Try code below or adding .Reversemap()
CreateMap<OrderItem, OrderItemForCreationDto> ()
    .ForMember (dest => dest.TotalPrice, opt =>
    {
        opt.MapFrom (d => d.Item);
        opt.ResolveUsing (d => d.Item.Price * d.Count);
    });


text:
Q: What are the differences between Channel-to-Ground & Channel-to-Channel isolation? I have the following questions regarding different types of isolation techniques:

*

*What are the major differences between Channel-to-Ground & Channel-to-Channel isolation techniques?

*Are all Ch-to-Ch isolated devices also Ch-to-Gnd isolated?

*Is there ever a scenario where you would chose Ch-to-Gnd over Ch-to-Ch isolation given all else equal?

*Do either of the two techniques reduce the effects of crosstalk? If so, how and which one is better?

A: It sounds like you're talking about an oscilloscope or something similar. In that case, the channel-to-channel isolation describes the isolation between each channel and every other channel. The channel-to-ground isolation describes the isolation between each channel and ground. These are different, but related, concerns.
Channel-to-channel isolation describes how much voltage differential there can be between two inputs to the scope.
Channel-to-ground isolation describes how much voltage there can be between any input and the ground input to the scope, usually through the power connector.
The "techniques" involved aren't different at all. When two things are to be isolated, make sure there aren't any conductive paths between them, and make sure that all barriers between them (optocouplers, transformers, air distance, creepage distance, insulation, etc.) are rated for the isolation voltage you want.
Now, if all channels are isolated from each other, they must also all be isolated from ground; if they were all referenced to ground, they would all also be referenced to each other! It is, however, possible to have all channels isolated from ground while still being referenced to some other common node. This scenario can be useful, depending entirely on what it is you want to measure. If all the signals being measured are referenced to the same voltage, which is not earth, then your scope also having isolation to ground but not channel-to-channel would be fine.
As for crosstalk, that would require more details about what you're doing. I don't think there's a general answer there.


text:
Q: Python Error: Unable to find 'endstream' marker after stream at byte I am trying to run this Python code to open an existing pf -> Add bookmarks -> write to the existing pdf. However it is throwing the below error and I have never seen this one before?

in readFromStream raise utils.PdfReadError("Unable to find 'endstream' marker after stream at byte %s." % utils.hexStr(stream.tell())) PyPDF2.utils.PdfReadError: Unable to find 'endstream' marker after stream at byte 0x4005.

Here is my code for your reference:
import os
import urllib.parse
import PyPDF2 as pf
from datetime import date, timedelta, datetime
from module.executables.query import EasyQuery
from module.warp_object import WarpObject
from bin.scripts.fetch_pdf import TableauPDFFetcher
from PyPDF2 import PdfFileWriter, PdfFileReader

# Fetch PDF and PNG
today_date = date.today()

pdf_flash = r'\\C:\SamplePDF_{}.pdf'.format(today_date)

pdf_object = open(pdf_flash,"rb") #rb stands for read binary
output = PdfFileWriter()
input = PdfFileReader(pdf_object)

input_numpages = input.getNumPages()

for i in range(input_numpages):
    output.addPage(input.getPage(i)) #insert page in the output file

parent_1 = output.addBookmark('Page 1', 2) # add parent bookmark

parent_2 = output.addBookmark('Page 2', 3)
output.addBookmark('Traffic', 3, parent_2)
output.addBookmark('Gross Revenue (Stable)', 5, parent_2)
output.addBookmark('Conversion Rate', 7, parent_2)
output.addBookmark('Average Order Value', 9, parent_2)
output.addBookmark('Gross Revenue Per Visit', 11, parent_2)

pdf_flash1 = r'\\C:\SamplePDF_{}.pdf'.format(today_date)

result_pdf = open(pdf_flash, "wb")
output.write(pdf_flash1)

output.close()

It is throwing the error at the second last line output.write(pdf_flash1).
Thanks for your help!

A: Following worked for me.
Instead of
pdf_flash = r'\\C:\SamplePDF_{}.pdf'.format(today_date)
pdf_object = open(pdf_flash,"rb") #rb stands for read binary
input = PdfFileReader(pdf_object)

use:
pdf_path = 'sample_PDF.pdf'
input = PdfFileReader(pdf_path, strict = False)


text:
Q: Upgrading iMac G3 memory I got an iMac g3 450 mhz (summer 2000 i think) and i want to upgrade its memory. I know i need PC 100/133 168 pin . I already got one 512mb from amazon with those specs although it didn't work. For some reason all the memories that say they are compatible with mac are x3/4 the price of the rest of same technology. Any suggestions as to where I should look for memory or any spec I should be looking for in order for it to be compatible ?

A: Do not worry about getting one that is specifically "for iMacs." Any 168-pin PC 100/133 chip should fit just fine.
I have been working with several iMacs over the last few weeks. From my experience with them, a slot-loader seems to max out at around 1GB (two 512mb chips.)
If your RAM is not working, you likely got a bad chip. See if you can exchange it for another one.


text:
Q: Get MavenProject from just the POM.xml - pom parser? Is it possible to get an instance of org.apache.maven.project.MavenProject or some other object form of the POM from just the pom.xml file?
Thanks in advance.

A: yes  you can . This is the code. You need maven-model-3.0.4.jar and plexus-utils-2.0.6.jar and maven-core-3.0.4.jar
Model model = null;
FileReader reader = null;
MavenXpp3Reader mavenreader = new MavenXpp3Reader();
try {
    reader = new FileReader(pomfile);
    model = mavenreader.read(reader);
    model.setPomFile(pomfile);
}catch(Exception ex){}
MavenProject project = new MavenProject(model);

A: If you want to get the MavenProject based on groupid, artifactId and version you have to run inside of a maven plugin. And this code will do the job:
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
configuration.setProcessPlugins( false );
configuration.setRepositorySession( session );
org.apache.maven.artifact.Artifact artifact = new org.apache.maven.artifact.DefaultArtifact(groupId, artifactId, version, "compile", "", "", new DefaultArtifactHandler());
MavenProject project = projectBuilder.build(artifact, configuration).getProject();

The missing properties can be injected into the maven plugin.


text:
Q: Not getting a gratuitous ARP after sending a offer with the same Ip as my container So I'm making some testes in Linux 20.04 and monitoring theme. I have a container with an ip-address and his mac-address running, sending me offers, and i can see them in wireshark.
The test that I'm doing is sending a offer with the same ip-address as the container and waiting for a gratuitous ARP reply.
I used ipwatchd to monitor ARP conflicts and did the trick i received a gratuitous ARP, but sending an offer doesn't do  the trick.
Example:
Container : Ip-Address- 10.2.10.10 MAC : 01:01:01:01:01:01
Eth0: Ip-Address- 10.2.10.12 MAC : 02:02:02:02:02:02
The offer that I'm sending relies on IPV4 layer. I'm sending this offer hopping that the container answers that the Ip-Address I'm using its his cause I'm making myself the source:
Ip-Address- 10.2.10.10 MAC : 02:02:02:02:02:02
Any suggestions why I'm not getting the gratuitous ARP reply?


text:
Q: MATLAB <---> Image editor with support for layers I was wondering if anybody knows of an API, toolbox, or library that extracts layers from an image format that is supported by a free editor such as Paint.NET (native format: .pdn)
Motivation: An interface to an image with layers that can be edited in a free image editor   would be of interest for those of us who do computer vision and machine learning in MATLAB. For example, it could facilitate the automatic collection of manual pixel annotations for supervised learning.

A: I suggest using the .PSD Photoshop file format, which has layers support and is also implemented by many non-Adobe applications.
The PSD plugin for Paint.NET allows you to open and save PSD images: http://www.psdplugin.com/
You can then use Imagemagick to extract the layers to a format that MATLAB can read:
convert filename.psd filename-%d.png

A: Almost nothing can read a .pdn file.  http://extension.nirsoft.net/pdn
So, you are left with the following options.

*

*Use GIMP to read in the file, and export it into something matlab supports:  http://www.mathworks.com/help/techdoc/ref/imread.html.

*Use GIMP to read in the file, and export it into something ImageMagick supports:http://www.imagemagick.org/script/formats.php and then convert it into something matlab supports.

*Export the data from Paint.NET into a matlab friendly format.

Note, the Matlab links are for the image processing toolbox, if you don't have that, the options are more limited.


text:
Q: Meteor app deployed to Heroku fails with CloudFlare Flexible SSL Just deployed my meteor app to heroku using heroku-18 and meteor-buildpack-horse. This is deploy v116. On previous deployments I was able to use Cloudflare flexible SSL configuration on my app, but after deployment v116 the page keeps redirecting to the login route. As I can see from logs, I think it may be related to log entries with status 101 (Switching Protocols).
If I access my app through http://app.domain.com it works, but accessing with https://app.domain.com it doesn't.
Heroku app logs
2018-10-17T23:52:16.299384+00:00 heroku[router]: at=info method=GET path="/sockjs/048/yk_lctvs/websocket" host=app.domain.com request_id=8d322763-1141-4217-94e1-5b390e1e9739 fwd="181.95.179.168,162.158.123.96" dyno=web.1 connect=1ms service=765ms status=101 bytes=175 protocol=http

2018-10-17T23:52:16.336802+00:00 heroku[router]: at=info method=GET path="/login" host=app.domain.com request_id=9d1fe273-3abb-4ecf-996f-ced82b07117e fwd="181.95.179.168,162.158.123.114" dyno=web.1 connect=1ms service=9ms status=200 bytes=4442 protocol=http

2018-10-17T23:52:16.512511+00:00 heroku[router]: at=info method=GET path="/sockjs/info?cb=5g7x6pmg9k" host=app.domain.com request_id=dfd71b44-5b95-42b3-b02f-bd118e91804a fwd="181.95.179.168,162.158.123.114" dyno=web.1 connect=1ms service=3ms status=200 bytes=363 protocol=http

2018-10-17T23:52:17.119755+00:00 heroku[router]: at=info method=GET path="/sockjs/info?cb=jadymh88hj" host=app.domain.com request_id=0febb4b3-107a-41ad-b427-6f187a32c3b2 fwd="181.95.179.168,162.158.123.114" dyno=web.1 connect=0ms service=4ms status=200 bytes=363 protocol=http

2018-10-17T23:52:18.401775+00:00 heroku[router]: at=info method=GET path="/sockjs/559/3by4bm5x/websocket" host=app.domain.com request_id=85b5cf5b-7c75-4472-9a0e-46c76c8cd534 fwd="181.95.179.168,162.158.123.95" dyno=web.1 connect=0ms service=664ms status=101 bytes=175 protocol=http

2018-10-17T23:52:18.410152+00:00 heroku[router]: at=info method=GET path="/login" host=app.domain.com request_id=ebd62bbc-a041-40aa-9c21-e15414655a59 fwd="181.95.179.168,162.158.123.114" dyno=web.1 connect=1ms service=7ms status=200 bytes=4442 protocol=http

2018-10-17T23:52:18.616711+00:00 heroku[router]: at=info method=GET path="/sockjs/info?cb=7k081p4ay5" host=app.domain.com request_id=a780d8d5-a149-4a55-a43d-b9be9dbfd1bc fwd="181.95.179.168,162.158.123.114" dyno=web.1 connect=0ms service=1ms status=200 bytes=363 protocol=http

2018-10-17T23:52:19.144127+00:00 heroku[router]: at=info method=GET path="/sockjs/info?cb=3zq5040dzp" host=app.domain.com request_id=a86deb0d-8ee1-4ed6-9c60-88ea639afb7e fwd="181.95.179.168,162.158.123.114" dyno=web.1 connect=1ms service=2ms status=200 bytes=363 protocol=http

2018-10-17T23:52:20.417289+00:00 heroku[router]: at=info method=GET path="/login" host=app.domain.com request_id=1f7bf690-22a2-44c6-bfc2-76de3bef3558 fwd="181.95.179.168,162.158.123.114" dyno=web.1 connect=1ms service=7ms status=200 bytes=4442 protocol=http

2018-10-17T23:52:20.405086+00:00 heroku[router]: at=info method=GET path="/sockjs/802/r48516e0/websocket" host=app.domain.com request_id=2f733dc7-2d60-4770-b83d-52f53b5bc58a fwd="181.95.179.168,162.158.123.96" dyno=web.1 connect=0ms service=662ms status=101 bytes=175 protocol=http

UPDATE
This issue seems to be related to meteor package browser-policy. After disabling it in meteor packages file and removing the startup code the site stopped redirecting.
The startup code for browser-policy is as follows:
import _ from 'lodash';
import { BrowserPolicy } from 'meteor/browser-policy-common';

BrowserPolicy.framing.disallow();
BrowserPolicy.content.disallowInlineScripts();
BrowserPolicy.content.allowInlineStyles();
BrowserPolicy.content.disallowEval();

const trusted = [
  'maps.googleapis.com',
  'maps.gstatic.com',
  'csi.gstatic.com',
  'dinamo-server-meteor.herokuapp.com',
  'dinamoapp.playtime.com.ar',
  'fonts.googleapis.com',
  'fonts.gstatic.com',
  'cdnjs.cloudflare.com',
  'unpkg.com',
  'a.tile.openstreetmap.org',
  'b.tile.openstreetmap.org',
  'c.tile.openstreetmap.org',
  'blob:',
];

_.map(trusted, origin => BrowserPolicy.content.allowOriginForAll(origin));


text:
Q: Add md5 hash to Perl sub How can a md5sum of a file be appended to the list of the output below. So the last entry would be MD5=" . $md5.
106         sub generate_file_hash(){
107            my $filename = shift;
108
109            $MASTERCOUNT++;
110
111            my ($devs, $ino, $mode, $nlink, $uid, $gid, $rdev,
112                 $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat($filename);
113
114            open(FILE, $filename) or die "Can't open '$filename': $!";
115            binmode(FILE);
116            $md5 = Digest::MD5->new->addfile(*FILE)->hexdigest();
117
118            return($filename . ",PERMISSIONS=" . $devs  . ",INODE=" . $ino  .
119                           ",MODE=" . $mode  . ",HARD LINKS=" .
120                           $nlink . ",UID=" . $uid  . ",GID=" . $gid  .
121                           ",DEVICE=" . $rdev  . ",SIZE=" .
122                           $size . ",LAST MODIFIED=" .  $mtime  .
123                           ",INODE CREATED=" . $ctime  . ",BLOCK SIZE=" .
124                           $blksize . ",BLOCKS=" . $blocks . ",MD5=" . $md5);
125         }

Errors:
    Global symbol "$md5" requires explicit package name at integritychk line 116.
    Global symbol "$md5" requires explicit package name at integritychk line 124.
Currently the output is:
/etc/group,PERMISSIONS=51712,INODE=565260,MODE=33188,HARD LINKS=1,UID=0,GID=0,DEVICE=0,SIZE=595,LAST MODIFIED=1273887035,INODE CREATED=1273887035,BLOCK SIZE=4096,BLOCKS=8

So the MD5 value of the file would be appended.

A: use Digest::MD5;

open(FILE, $filename) or die "Can't open '$filename': $!";
binmode(FILE);
my $md5 = Digest::MD5->new->addfile(*FILE)->hexdigest();

Read the Digest::MD5 manpage for more info on various ways to use the module.


text:
Q: python twitter api returns inconsistent number of tweets each second I'm trying to write my own twitter-fetch api, based on the python-twitter library. The goal is to fetch the last 5 tweets of Donald Trump. I'm getting a different number of tweets every other second or so. Sometimes it's 5 tweets, sometimes it's only 1.
import twitter

api = twitter.Api(consumer_key=config["credentials"]["key"],
                  consumer_secret=config["credentials"]["secret"],
                  application_only_auth=True,
                  tweet_mode='extended')

tweets = api.GetUserTimeline(
            screen_name="realDonaldTrump",
            count=5)

print("number of tweets: {}".format(len(tweets)))

Has anyone noticed this before with the twitter REST api using another language/package?
Has anyone noticed this before with the python-twitter package that I'm using?

A: This is normal behavior. See count in this doc: https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-user_timeline.html
count specifies a max limit rather than a promise to deliver a specified number of tweets. From the 5 tweets that you request, Twitter may cull some for lack of relevance, etc.
For your scenario, simply request many more tweets than 5 (ex. 100) and use only the first 5.


text:
Q: Why do we take a derivative? I don't have a fundamental  understanding of what taking a derivative means and I don't understand why would we do it. I just know how to mechanically do it.

A: I don't know what kind of explanation you have gotten before, if any, so I think that I will start with one of the usuals. Let me first introduce to you the difference quotient:
$$\frac{f(x+h)-f(x)}{h}$$
It has a very nice geometrical interpretation.

In this picture, the curve is the graph of a function. I hope that you can understand from my picture that the length of the horizontal red line is $h$, while $f(x+h)-f(x)$ is the length of the vertical red line. So $f(t)$ increases by an amount of $f(x+h)-f(x)$ when $t$ increases by an amount of $h$ from $x$. This means that the average increase on the vertical axis per unit of the horizontal axis is given by the difference quotient
$$\frac{f(x+h)-f(x)}{h}.$$
So the difference quotient is the average increase of a $f(t)$ on the interval $[x,x+h]$. Another way to put it is that the difference is the slope of the line passing through the points $(x,f(x))$ and $(x+h,f(x+h))$, like this:

So the green line $g(t)$ can be written as
$$g(t) = \frac{f(x+h)-f(x)}{h} t + b$$
where $b=g(0)$ (the point where $g$ crosses the vertical axis).
When we take the derivative of $f$ at $x$ we find the limit of the difference quotient as $h$ goes to $0$, or
$$f'(x) = \lim_{h\to 0} \frac{f(x+h)-f(x)}{h}.$$
This is the definition of the derivative. Imagine that $h$ gets smaller and smaller. Then the point $(x+h,f(x+h)-f(x))$ will get closer and closer to the point $(x, f(x))$, and the green line will get closer and closer to the tangent line of $f$ at $x$.
So when $h \to 0$, the difference quotient becomes the slope of the tangentline, and now we have an interpretation of the derivative:

The derivative $f'(x)$ is the is the slope of the tangent line of $f$ at $x$.

Let's finish off by trying to find the derivative of the function $f(x)=x^2$ at the point $x=1$ only with the help of the limit stated above.
$$f'(x) = \lim_{h\to 0} \frac{f(x+h)-f(x)}{h} = \lim_{h\to 0} \frac{(x+h)^2-x^2}{h}$$
$$= \lim_{h\to 0} \frac{x^2+2xh+h^2-x^2}{h} = \lim_{h\to 0} \frac{2xh+h^2}{h}$$
$$= \lim_{h\to 0} 2x+h = \underline{2x}$$
When we plug in $x=1$ we get that $f'(1) = 2$. Hope this helps!

A: I would recommend reading this: https://web.archive.org/web/20200218154616/http://www.ugrad.math.ubc.ca/coursedoc/math100/notes/derivs/deriv5.html
It's a pretty good, non technical explanation of the derivative and why one might care about it.

A: The derivative can be interpreted a number of ways, depending on context. For a simple physical perspective, you can think of it as a rate of change. If you want to know the rate of change at some given point (say, velocity 3 seconds into the movement of a thrown ball), taking the derivative will give you your answer. From a geometric perspective, taking the derivative tells you the slope of the tangent line at a given point.
From a historical perspective, this is sort of a workaround for Zeno's paradoxes of motion.

A: If $f(x)$ is a (real) function (of a real variable), then its derivative $f'(a)$ at a point $a$ measures the sensitivity of $f$ to small changes in $x$ around $a$. For example, suppose $x$ is "the height of the sun in the sky" and $f(x)$ is "the length of the shadow cast by this tree." Then $f'(a)$ is a measure of how sensitive the length of the shadow is to a small change in the height of the sun if the height is around $a$. Experimentally, $f'(a)$ will be small if the sun is high in the sky ($a$ is large) while $f'(a)$ will get larger as the sun gets lower in the sky ($a$ is small). The derivative gives us a way to quantify this observation.
I decided not to use the term "rate of change" because I think some students have heard this term so many times that they have become immune to it, so perhaps the above will make more sense.

A: A derivative can be interpreted as the slope of a tangent line or a rate of change (in particular, a velocity).  You might e.g. look at these notes

A: Derivatives are useful for optimization; finding the extrema (maximum or minimum) of functions. This is a very common task in applied mathematics.

A: if you given a function and you asked to find the behave of the given function then you may take the derivative to the given function, but if you given a behave of any function you need to take the integral of the behave function, to find the function of the given behave.


text:
Q: "Error opening terminal: unknown." when trying to run a program inside Eclipse I've recently installed Eclipse 3.8 on my Linux Mint PC (I've used it on Ubuntu before without problems) and every time I try to run a C++-program, It just sais "Error opening terminal: unknown." in the Console of Eclipse. Compiling works fine and it also shows the output of gcc correctly.
Does anyone know what this means?

A: I face the same problem in Lubuntu 13.04 (no problem in Bodhi 2.3.0) I solved this installing "xterm" and doing this in Eclipse IDE:
Run -> Run configurations -> "C/C++ Application" -> YourProyect -> Environment -> New... -> TERM=xterm
But then other problem appears, my application uses the console to show some messages, but I also use some SDL "Windows", Eclipse runs fine, but the Windows don't appear. Instead, if I run manually from the terminal, all runs perfect.

A: You can also do:
Run -> Run configurations -> "C/C++ Application" -> YourProyect -> Environment -> New... -> DISPLAY=:0.0


text:
Q: Find a set that spans the set of all 3 by 3 semimagic matrices and prove it Call a 3 × 3 matrix a semi-magic square if all its rows and columns (but not necessarily its diagonals) have the same sum.
The questions asks me to find a set that spans the set of all 3 by 3 semimagic matrices and prove it

A: Hint 1
If $S$ is semimagic, with row and column sum $N$, and
$$
S
=
\begin{bmatrix}
a & b & ?\\
c & d & ?\\
? & ? & ?\\
\end{bmatrix},
$$
what can you say of the missing entries?

Hint 2
$$
S
=
\begin{bmatrix}
a & b & N-a-b\\
c & d & ?\\
? & ? & ?\\
\end{bmatrix}.
$$
Can you continue from here?

A: In   order    to answer the question we have to cope with two issues

*

*Semimagic matrices: We need a proper characterisation of these specific matrices.

*Linear span: Once we have a candidate for the set of all semimagic matrices, we have to show this set is a linear span, which means a subspace in the vector space of all $\mathcal{M}_{(3\times 3)}$ matrices with the usual addition and scalar multiplication over a field $\mathbb{F}=\mathbb{R}$ (resp. $\mathbb{C}$).

Semimagic matrices:
Let's assume a semimagic $3\times 3$ matrix $A$ has a column-sum, resp. row-sum equal to $n_A$. Whenever we consider two elements $x,y$ in a column or row  of $A$ the third element is determined by
  \begin{align*}
n_A-x-y\tag{1}
\end{align*}
  It follows the shape of a semimagic matrix $A$ is necessarily
  \begin{align*}
A=\begin{pmatrix}
a&b&n_A-a-b\\
c&d&n_A-c-d\\
n_A-a-c&n_A-b-d&a+b+c+d-n_A
\end{pmatrix}
\end{align*}
  with $a,b,c,d\in\mathbb{F}$ arbitrarily, fixed. Note, the element $a_{3,3}$ of $A$ is according to (1)
  \begin{align*}
a_{3,3}=n_A-(n_A-a-b)-(n_A-c-d)=a+b+c+d-n_A
\end{align*}

We conclude, the set of all semimagic $3\times 3$ matrices $\mathcal{S}$ is
\begin{align*}
\mathcal{S}=\left\{\left.\begin{pmatrix}
a&b&n_A-a-b\\
c&d&n_A-c-d\\
n_A-a-c&n_A-b-d&a+b+c+d-n_A
\end{pmatrix}
\right|a,b,c,d,n_A\in\mathbb{F}
\right\}
\end{align*}
Note that we have five degrees of freedom: $a,b,c,d$ and $n_A$.

Linear span:
The set $\mathcal{S}$ is a perfect candidate for the linear span we are looking for. We see the zero matrix
  \begin{align*}
\begin{pmatrix}
0&0&0\\
0&0&0\\
0&0&0\\
\end{pmatrix}\in \mathcal{S}
\end{align*}
  which is the zero vector of the vector space $\mathcal{M}_{(3\times 3)}$ is an element of $\mathcal{S}$.
Let $\lambda,\mu\in \mathbb{F}$ and $A,B\in \mathcal{S}$ arbitrarily, fixed. We obtain
  \begin{align*}
\lambda A + \mu B &=\lambda
\begin{pmatrix}
a_{1,1}&a_{1,2}&n_A-a_{1,1}-a_{1,2}\\
a_{2,1}&a_{2,2}&n_A-a_{2,1}-a_{2,2}\\
n_A-a_{1,1}-a_{2,1}&n_A-a_{1,2}-a_{2,2}&a_{1,1}+a_{1,2}+a_{2,1}+a_{2,2}-n_A\\
\end{pmatrix}\\
&\qquad\quad+\mu
\begin{pmatrix}
b_{1,1}&b_{1,2}&n_B-b_{1,1}-b_{1,2}\\
b_{2,1}&b_{2,2}&n_B-b_{2,1}-b_{2,2}\\
n_B-b_{1,1}-b_{2,1}&n_B-b_{1,2}-b_{2,2}&b_{1,1}+b_{1,2}+b_{2,1}+b_{2,2}-n_B\\
\end{pmatrix}\\
&=\begin{pmatrix}
c_{1,1}&c_{1,2}&n_C-c_{1,1}-c_{1,2}\\
c_{2,1}&c_{2,2}&n_C-c_{2,1}-c_{2,2}\\
n_C-c_{1,1}-c_{2,1}&n_C-c_{1,2}-c_{2,2}&c_{1,1}+c_{1,2}+c_{2,1}+c_{2,2}-n_C\\
\end{pmatrix}\in\mathcal{S}\\
\end{align*}
  with $n_C=\lambda n_A+\mu n_B$ and the claim follows.


text:
Q: From RichTextBox to text files, line after line I have trouble with saving file from Richtextbox to text file.
My richtextbox looks like this;
ABC    ...
 SDE   ...
KLO    ...

After i saved it looks like this:
ABC ... SDE ... KLO ...

But i want the same like richtextbox line after lines. What did i do wrong?
 if (saveFileDialog2.ShowDialog() == DialogResult.OK)
        {
            StreamWriter sw = File.CreateText(saveFileDialog2.FileName);
            sw.WriteLine(richTextBox1.Text);
            sw.Flush();
            sw.Close();

            //File.WriteAllText(saveFileDialog2.FileName, str);
        }

A: You are probably getting this because you are trying to save richTextBox1.Text (the whole text) in one line only using the following code
StreamWriter sw = File.CreateText(saveFileDialog2.FileName);
sw.WriteLine(richTextBox1.Text);
sw.Flush();
sw.Close();

It's recommended to use sw.WriteLine() on a specific line number in richTextBox1 then move to another line.
Example
for (int i = 0; i < richTextBox1.Lines.Length; i++)
{
    sw.WriteLine(richTextBox1.Lines[i]);
}
sw.Flush();
sw.Close();

Another Solution

There's already a built-in function for RichTextBox to save a file with a specific encoding. You may use RichTextBox.SaveFile() for this purpose.
Example
RichTextBox.SaveFile(string path, RichTextBoxStreamType);

Where path represents saveFileDialog2.FileName in your code. For RichTextBoxStreamType, it's best to set it as RichTextBoxStreamType.PlainText as long as you do not use RTF such as Color/Font/Protection/Indent/etc...
Then, you may read the file again using the following method
RichTextBox.LoadFile(string path, RichTextBoxStreamType);

NOTICE: If the file is not in RTF and you try to read it in RTF (RichTextBox.LoadFile(string path, RichTextBoxStreamType.RichText);)
 you may encounter formatting errors. In this case, you'll need to catch the exception and read the file in a Plain or Unicode encoding.
Example
RichTextBox _RichTextBox = new RichTextBox();
try
{
     _RichTextBox.LoadFile(@"D:\Resources\text.txt", RichTextBoxStreamType.RichText);
}
catch (Exception EX)
{
     if (EX.Message.ToLower().Contains("format is not valid"))
     {
          _RichTextBox.LoadFile(@"D:\Resources\text.txt", RichTextBoxStreamType.PlainText);
     }
}

Thanks,
I hope you find this helpful :)

A: I know this question is pretty old but here is an alternate code for people who might run into this problem in the future
File.WriteAllLines(saveFileDialog1.FileName, richTextBox1.Lines);

A: if (saveFileDialog2.ShowDialog() == DialogResult.OK)
{
    StreamWriter sw = File.CreateText(saveFileDialog2.FileName);
    foreach(String s in richTextBox1.Lines)
    {
        sw.WriteLine(s);
    }
    sw.Flush();
    sw.Close();
}


text:
Q: Entity Framework 4.1 Performance in Cloud based SQL Server I developed the Windows Application using Entity Framework 4.0  with SQL Server. In  development the SQL Server has been installed in local machine it self. While moving production my client wants to deploy the SQL Server in remote location, the insert/update operation is taking bit more time in Remote Server but it executes very fast if it is local server.
Please guide me how to improve the performance?

A: The problem may be caused by network problems or something with the SQL Server, to rule out either the SQL Server, you can use the Profiler and look at the times and others.
Regards


text:
Q: Python - is a method considered private if it is only called from within 'if __name__ == '__main__'? I have a method (update_database) within a MainApp class that is called when the app is closed using the event listener 'atexit'. This method is only called by this atexit listener.
How would you categorise the visibility of this method?
import atexit
from kivymd.app import MDApp
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen, ScreenManager
from order_management.constants import HELP_TEXT
from order_management.presentation.order_management.order_management_view import OrderManagementScreen
from order_management.presentation.components.dialog import Dialog
from order_management.data.query import Query

class MainApp(MDApp):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self._screen = Builder.load_file(
            "order_management/presentation/main.kv")
        self.__query = Query()
        self.__dialog = Dialog()

    def __build(self):
        self.theme_cls.primary_palette = "Green"
        sm = ScreenManager()
        # Instantiates OrderManagementScreen.py
        sm.add_widget(OrderManagementScreen(name='order_management'))
        return self._screen

    def handle_menu_click(self):
        self.__dialog.render_dialog("Usage Guide:", HELP_TEXT, None, None)

    def __update_database(self):
        self.__query.update_database()

if __name__ == "__main__":
    MainApp().run()
    main_app = MainApp()
    atexit.register(main_app.__update_database)  # Calls update_database on exit.

A: Python does not have a mechanism to enforce access specifier rules such as Java or C++.
This convention of identifying __function() as protected is just a guideline, it won't stop other programs from using those functions or variables.


text:
Q: Kernel Mode Driver BSOD PAGE_FAULT_IN_NONPAGED_AREA using a global UNICODE_STRING in Callback I get a BSOD issue (PAGE_FAULT_IN_NONPAGED_AREA) it only started happening when I added my UNICODE_STRING
The system crash happens after the UNICODE_STRING is set and working after like 10 minutes or so system crashes out of nowhere. Maybe because I overwrite the UNICODE_STRING many times?
The WinDBG says I need to use a probe() so this error doesn't happen.
do I need to use something like? in the callback before the if statement?
ProbeForRead(ProcessName.Buffer, ProcessName.MaximumLength, sizeof(UCHAR));
Here is my MEMORY.DMP
Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.

Loading Dump File [C:\Windows\MEMORY.DMP]
Kernel Summary Dump File: Only kernel address space is available

Symbol search path is: *** Invalid ***
****************************************************************************
* Symbol loading may be unreliable without a symbol search path.           *
* Use .symfix to have the debugger choose a symbol path.                   *
* After setting your symbol path, use .reload to refresh symbol locations. *
****************************************************************************
Executable search path is:
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntkrnlmp.exe -
Windows 7 Kernel Version 7601 (Service Pack 1) MP (12 procs) Free x64
Product: WinNt, suite: TerminalServer SingleUserTS
Built by: 7601.24545.amd64fre.win7sp1_ldr_escrow.200102-1707
Machine Name:
Kernel base = 0xfffff800`0340a000 PsLoadedModuleList = 0xfffff800`03643c90
Debug session time: Fri Mar 27 07:18:32.627 2020 (UTC - 4:00)
System Uptime: 0 days 1:14:27.811
*********************************************************************
* Symbols can not be loaded because symbol path is not initialized. *
*                                                                   *
* The Symbol Path can be set by:                                    *
*   using the _NT_SYMBOL_PATH environment variable.                 *
*   using the -y <symbol_path> argument when starting the debugger. *
*   using .sympath and .sympath+                                    *
*********************************************************************
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for ntkrnlmp.exe -
Loading Kernel Symbols
...............................................................
................................................................
................................................
Loading User Symbols
PEB is paged out (Peb.Ldr = 00000000`fffdf018).  Type ".hh dbgerr001" for details
Loading unloaded module list
...........................
ERROR: FindPlugIns 8007007b
*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************

Use !analyze -v to get detailed debugging information.

BugCheck 50, {fffff8a037f2d000, 0, fffff8000348e46a, 0}

***** Kernel symbols are WRONG. Please fix symbols to do analysis.

Probably caused by : Driver.sys ( Driver!ImageLoadCallback+38 )

Followup: MachineOwner
---------

10: kd> !analyze -v
ERROR: FindPlugIns 8007007b
*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************

PAGE_FAULT_IN_NONPAGED_AREA (50)
Invalid system memory was referenced.  This cannot be protected by try-except,
it must be protected by a Probe.  Typically the address is just plain bad or it
is pointing at freed memory.
Arguments:
Arg1: fffff8a037f2d000, memory referenced.
Arg2: 0000000000000000, value 0 = read operation, 1 = write operation.
Arg3: fffff8000348e46a, If non-zero, the instruction address which referenced the bad memory
    address.
Arg4: 0000000000000000, (reserved)

Debugging Details:
------------------

***** Kernel symbols are WRONG. Please fix symbols to do analysis.

ADDITIONAL_DEBUG_TEXT:
Use '!findthebuild' command to search for the target build information.
If the build information is available, run '!findthebuild -s ; .reload' to set symbol path and load symbols.

MODULE_NAME: Driver

FAULTING_MODULE: fffff8000340a000 nt

DEBUG_FLR_IMAGE_TIMESTAMP:  5e7ddfd8

READ_ADDRESS: unable to get nt!MmSpecialPoolStart
unable to get nt!MmSpecialPoolEnd
unable to get nt!MmPoolCodeStart
unable to get nt!MmPoolCodeEnd
 fffff8a037f2d000

FAULTING_IP:
nt!wcsstr+56
fffff800`0348e46a 66418b00        mov     ax,word ptr [r8]

MM_INTERNAL_CODE:  0

DEFAULT_BUCKET_ID:  VISTA_DRIVER_FAULT

BUGCHECK_STR:  0x50

CURRENT_IRQL:  0

LAST_CONTROL_TRANSFER:  from fffff800035779b2 to fffff8000349dea0

STACK_TEXT:
fffff880`0a6abf38 fffff800`035779b2 : 00000000`00000050 fffff8a0`37f2d000 00000000`00000000 fffff880`0a6ac090 : nt!KeBugCheckEx
fffff880`0a6abf40 fffff800`034a9fdc : 00000000`00000000 fffff8a0`37f2d000 fffff880`0a6ac000 fffffa80`232cfe28 : nt!PoCallDriver+0x4f52
fffff880`0a6ac090 fffff800`0348e46a : fffff880`0aeaf498 00000000`00000001 00000000`00001810 00000000`0000003d : nt!longjmp+0x3c7c
fffff880`0a6ac228 fffff880`0aeaf498 : 00000000`00000001 00000000`00001810 00000000`0000003d fffff8a0`0e903c00 : nt!wcsstr+0x56
fffff880`0a6ac230 fffff800`0370f3e4 : 00000000`00000001 fffff800`036250d8 fffff800`036250d8 00000000`00000000 : Driver!ImageLoadCallback+0x38 [c:\users\igor\desktop\driver memory editor\driver\driver.c @ 499]
fffff880`0a6ac260 fffff800`03839c92 : fffffa80`232cfdd0 fffffa80`1a26b278 fffffa80`20cc59c0 00000000`00000000 : nt!ObDereferenceSecurityDescriptor+0x204
fffff880`0a6ac2c0 fffff800`036fe317 : fffffa80`20cc5980 fffffa80`1a26b060 fffff880`0a6ac570 fffff880`0a6ac568 : nt!IoCreateController+0x2af2
fffff880`0a6ac410 fffff800`036f5aed : ffff845f`00000018 fffffa80`1a26b060 fffff880`0a6ac570 00000000`00000020 : nt!NtOpenThreadTokenEx+0x14b7
fffff880`0a6ac500 fffff800`034abf53 : 00000000`00002760 fffffa80`1efbfb50 00000000`0021ace8 00000000`00000001 : nt!NtMapViewOfSection+0x2bd
fffff880`0a6ac5d0 00000000`779a9a2a : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : nt!longjmp+0x5bf3
00000000`0021acc8 fffff800`034a0cc0 : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : 0x779a9a2a
fffff880`0a6ac820 00000000`00000000 : 00000000`01190b90 fffff880`0a6acd18 fffff900`c085eee0 00000000`0043e0a0 : nt!KiCpuId+0xa10

STACK_COMMAND:  kb

FOLLOWUP_IP:
Driver!ImageLoadCallback+38 [c:\users\igor\desktop\driver memory editor\driver\driver.c @ 499]
fffff880`0aeaf498 4885c0          test    rax,rax

FAULTING_SOURCE_CODE:
   495:     //DbgPrintEx(0, 0, "Loaded Name: %ls \n", FullImageName->Buffer);
   496:     //DbgPrintEx(0, 0, "Loaded To Process: %d \n", ProcessId);
   497:
   498:     // Compare our string to input
>  499:     if (ProcessName.Length != 0 && wcsstr(FullImageName->Buffer, ProcessName.Buffer)) {
   500:         // if it matches
   501:         DbgPrintEx(0, 0, "Loaded Name: %ls \n", FullImageName->Buffer);
   502:         DbgPrintEx(0, 0, "Loaded To Process: %d \n", ProcessId);
   503:
   504:         GameBaseAddress = ImageInfo->ImageBase;

SYMBOL_STACK_INDEX:  4

SYMBOL_NAME:  Driver!ImageLoadCallback+38

FOLLOWUP_NAME:  MachineOwner

IMAGE_NAME:  Driver.sys

BUCKET_ID:  WRONG_SYMBOLS

Followup: MachineOwner
---------

Source code:
// Request to retrieve the process id of game process, from kernel space
#define IO_SET_PROCESS_NAME_REQUEST CTL_CODE(FILE_DEVICE_UNKNOWN, 0x0703 /* Our Custom Code */, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)

ULONG GameProcessId, GameBaseAddress;
UNICODE_STRING  ProcessName;

// set a callback for every PE image loaded to user memory
// then find the base address & game.exe process id using the callback
PLOAD_IMAGE_NOTIFY_ROUTINE ImageLoadCallback(PUNICODE_STRING FullImageName,
    HANDLE ProcessId, PIMAGE_INFO ImageInfo)
{
    //DbgPrintEx(0, 0, "Loaded Name: %ls \n", FullImageName->Buffer);
    //DbgPrintEx(0, 0, "Loaded To Process: %d \n", ProcessId);

    // Compare our string to input
    if (ProcessName.Length != 0 && wcsstr(FullImageName->Buffer, ProcessName.Buffer)) {
        // if it matches
        DbgPrintEx(0, 0, "Loaded Name: %ls \n", FullImageName->Buffer);
        DbgPrintEx(0, 0, "Loaded To Process: %d \n", ProcessId);

        GameBaseAddress = ImageInfo->ImageBase;
        GameProcessId = ProcessId;
    }
}

//Here is my IOCTL Call Handler
// IOCTL Call Handler function
NTSTATUS IoControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
    NTSTATUS Status;
    ULONG BytesIO = 0;

    PIO_STACK_LOCATION stack = IoGetCurrentIrpStackLocation(Irp);

    // Code received from user space
    ULONG ControlCode = stack->Parameters.DeviceIoControl.IoControlCode;

    if (ControlCode == IO_SET_PROCESS_NAME_REQUEST)
    {
        ULONG inBufLength = stack->Parameters.DeviceIoControl.InputBufferLength; // Input buffer length
        ULONG outBufLength = stack->Parameters.DeviceIoControl.OutputBufferLength; // Output buffer length

        if (inBufLength == 0) {
            DbgPrint("Invalid Process name size detected\n");
            Status = STATUS_INVALID_PARAMETER;
            BytesIO = 0;
            goto finish;
        }

        PWSTR processBuffer;

        // Allocate the buffer that will contain the string
        processBuffer = ExAllocatePoolWithTag(NonPagedPool, stack->Parameters.DeviceIoControl.InputBufferLength+2, '5PWA');
        if(processBuffer == NULL){
            DbgPrint("Unable to allocate the Process Buffer: not enough memory.\n");
            Status = STATUS_INSUFFICIENT_RESOURCES;
            BytesIO = 0;
            goto finish;
        }

        // Copy the buffer
        RtlCopyBytes((PVOID)processBuffer, Irp->AssociatedIrp.SystemBuffer, stack->Parameters.DeviceIoControl.InputBufferLength);
        //RtlMoveMemory((PVOID)processBuffer, Irp->AssociatedIrp.SystemBuffer, stack->Parameters.DeviceIoControl.InputBufferLength);

        // Force a \0 at the end of the filename to avoid that malformed strings cause RtlInitUnicodeString to crash the system
        ((PSHORT)processBuffer)[(stack->Parameters.DeviceIoControl.InputBufferLength+2)/2-1]=0;

        // Create the Unicode string
        BOOLEAN success = RtlCreateUnicodeString(&ProcessName, processBuffer);

        ExFreePool(processBuffer);

        if (success) {
            DbgPrint("Set New Process to %ws, len=%d\n", ProcessName.Buffer, stack->Parameters.DeviceIoControl.InputBufferLength);
            Status = STATUS_SUCCESS;
            BytesIO = 0;
        } else {
            DbgPrint("Failed to allocate Unicode String for Process\n");
            Status = STATUS_INSUFFICIENT_RESOURCES;
            BytesIO = 0;
        }
    }
    else
    {
         // if the code is unknown
        Status = STATUS_INVALID_PARAMETER;
        BytesIO = 0;
    }
finish:
    // Complete the request
    Irp->IoStatus.Status = Status;
    Irp->IoStatus.Information = BytesIO;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);

    return Status;
}

// Driver Entrypoint
NTSTATUS DriverEntry(PDRIVER_OBJECT pDriverObject,
    PUNICODE_STRING pRegistryPath)
{
    DbgPrintEx(0, 0, "Driver Loaded\n");

    PsSetLoadImageNotifyRoutine(ImageLoadCallback);

    RtlInitUnicodeString(&dev, deviceNameBuffer);
    RtlInitUnicodeString(&dos, deviceSymLinkBuffer);

    IoCreateDevice(pDriverObject, 0, &dev, FILE_DEVICE_UNKNOWN, FILE_DEVICE_SECURE_OPEN, FALSE, &pDeviceObject);
    IoCreateSymbolicLink(&dos, &dev);

    pDriverObject->MajorFunction[IRP_MJ_CREATE] = CreateCall;
    pDriverObject->MajorFunction[IRP_MJ_CLOSE] = CloseCall;
    pDriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = IoControl;
    pDriverObject->DriverUnload = UnloadDriver;

    pDeviceObject->Flags |= DO_DIRECT_IO;
    pDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;

    return STATUS_SUCCESS;
}

NTSTATUS UnloadDriver(PDRIVER_OBJECT pDriverObject)
{
    DbgPrintEx(0, 0, "Unload routine called.\n");

    PsRemoveLoadImageNotifyRoutine(ImageLoadCallback);
    IoDeleteSymbolicLink(&dos);
    IoDeleteDevice(pDriverObject->DeviceObject);
}

NTSTATUS CreateCall(PDEVICE_OBJECT DeviceObject, PIRP irp)
{
    irp->IoStatus.Status = STATUS_SUCCESS;
    irp->IoStatus.Information = 0;

    IoCompleteRequest(irp, IO_NO_INCREMENT);
    return STATUS_SUCCESS;
}

NTSTATUS CloseCall(PDEVICE_OBJECT DeviceObject, PIRP irp)
{
    irp->IoStatus.Status = STATUS_SUCCESS;
    irp->IoStatus.Information = 0;

    IoCompleteRequest(irp, IO_NO_INCREMENT);
    return STATUS_SUCCESS;
}


text:
Q: What is the refresh frequency of the Stack Exchange API? I'm using the Stack Exchange API and noticed that a comment that I added just now was not being reflected in the API.
Is there a refresh frequency for the API? If so, what is it?
I was not able to find it in the docs.

A: According to one of the developers back then:

Every response from the API can be cached for up to a minute, so making the same request multiple times in that time-frame typically won't return different results.

From my experience, there is no refresh frequency, so if you add a comment and only read the post details or the list of comments afterwards, you should see it immediately.


text:
Q: AttributeError - Django, GAE This is my code for views.py
def addCategory(request):
    user = users.get_current_user()
    if users.is_current_user_admin():
        if request.method == 'POST':
            form = CategoryForm(request.POST)
            if form.is_valid():
                cd = form.cleaned_data
                Category.objects.create_category(cd['name'])
                return HttpResponseRedirect('/admin/dashboard/')
        else:
            form = CategoryForm()
            temdict = {'form': form, 'title': 'New Category'}
            return render_to_response('new_category.html', temdict)
    else:
        return render_to_response('not_admin.html', {'admin': 'no'})

and this is my model models.py
class Category(db.Model):
    catid = db.IntegerProperty(required=True)
    name = db.StringProperty(required=True)

    def get_absolute_url(self):
        return "/tag/%s/" % str(self.catid)

    class Meta:
        verbose_name = 'Category'

When I'm running the code it shows:
Exception Type: AttributeError
Exception Value:
type object 'Category' has no attribute '_meta'
Exception Location: D:\shwetanka\projects\shwetanka\django\forms\models.py in fields_for_model, line 166
Python Executable:  C:\Python26\pythonw.exe

Please help me out.I'm using django with gae.
This is forms.py
class CategoryForm(forms.ModelForm):
    name = forms.CharField(label='Category', widget=forms.TextInput(attrs={'size':50}))

    class Meta:
        model = Category
        fields = ['name']

Here is the complete stack trace. http://dpaste.com/251985/

A: Django does not support GAE currently. You have to use patched Django, for example, http://www.allbuttonspressed.com/projects/djangoappengine and then rewrite your model using standard django db model (currently you are using GAE one). However djangoappengine does not provide 100% compatibility.


text:
Q: Build python project as package without internet access I have a python project I want to package. I can package the project with python -m build just fine when connected to the internet.
When I disconnect and try the same command, I get an error about pip being unable to find the package wheel:
(my-venv) [me@my-host my-project]$ python -m build
* Creating venv isolated environment...
* Installing packages in isolated environment... (setuptools>=42, wheel)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f5935bb4f10>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/wheel/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f5935b5a160>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/wheel/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f5935b5a310>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/wheel/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f5935b5a4c0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/wheel/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f5935b5a670>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/wheel/
ERROR: Could not find a version that satisfies the requirement wheel
ERROR: No matching distribution found for wheel

This happens even if I install setuptools and wheel first.
How can I build my project without needing internet access at the time of building? Can I somehow make the isolated environment use my python cache?


text:
Q: Grails Dependency not resolving in version 2.2.5 After removing ivy cache under .grails folder now any of my application is working(Even newly created) because of unable to resolve dependency issue in Grails 2.2.5 version.
i am getting below logs in compilation
        ::::::::::::::::::::::::::::::::::::::::::::::
        ::          UNRESOLVED DEPENDENCIES         ::
        ::::::::::::::::::::::::::::::::::::::::::::::
        :: org.grails.plugins#cache;1.0.1: not found
        :: org.grails.plugins#rendering;0.4.4: not found
        :: org.grails.plugins#ckeditor;3.6.6.1.0: not found
        :: org.grails.plugins#rest-client-builder;1.0.2: not found
        :: org.grails.plugins#spring-security-core;1.2.7.3: not found
        ::::::::::::::::::::::::::::::::::::::::::::::

| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):

- org.grails.plugins:cache:1.0.1
- org.grails.plugins:rendering:0.4.4
- org.grails.plugins:ckeditor:3.6.6.1.0
- org.grails.plugins:rest-client-builder:1.0.2
- org.grails.plugins:spring-security-core:1.2.7.3

A: There are some problems with older Grails versions, you have to update your repository path.
See my answer at: Grails Url shortener plugin not getting installed :

Please use
mavenRepo "https://repo.grails.org/grails/plugins"

As a repository definition.

http://grails.1312388.n4.nabble.com/Grails-central-repo-seemingly-missing-plugin-versions-td4658720.html


text:
Q: Partitioning for  is not found the table might be not partitioned I'm working on a project for creating a zabbix server with a database so I want to partition the database tables for the zabbix server with an external script from the zabbix website but I'm facing this problem:
Oct 24 09:27:01 itit_mdbsrv01 mysql_zbx_part[31702]: Partitioning for "history_str" is not found! The table might be not partitioned.

and this is the script I'm running on the database server
 #!/usr/bin/perl

use strict;
use Data::Dumper;
use DBI;
use Sys::Syslog qw(:standard :macros);
use DateTime;
use POSIX qw(strftime);

openlog("mysql_zbx_part", "ndelay,pid", LOG_LOCAL0);

my $db_schema = 'yousif';
my $dsn = 'DBI:mysql:'.$db_schema.':mysql_socket=/var/lib/mysql/mysql.sock';
my $db_user_name = 'yousif';
my $db_password = 'LiL132LiL';
my $tables = {  'history' => { 'period' => 'day', 'keep_history' => '30'},
        'history_log' => { 'period' => 'day', 'keep_history' => '30'},
        'history_str' => { 'period' => 'day', 'keep_history' => '30'},
        'history_text' => { 'period' => 'day', 'keep_history' => '30'},
        'history_uint' => { 'period' => 'day', 'keep_history' => '30'},
        'trends' => { 'period' => 'month', 'keep_history' => '2'},
        'trends_uint' => { 'period' => 'month', 'keep_history' => '2'},

# comment next 5 lines if you partition zabbix database starting from 2.2
# they usually used for zabbix database before 2.2

        'acknowledges' => { 'period' => 'month', 'keep_history' => '23'},
        'alerts' => { 'period' => 'month', 'keep_history' => '6'},
        'auditlog' => { 'period' => 'month', 'keep_history' => '24'},
        'events' => { 'period' => 'month', 'keep_history' => '12'},
        'service_alarms' => { 'period' => 'month', 'keep_history' => '6'},
        };
my $amount_partitions = 10;

my $curr_tz = 'Europe/London';

my $part_tables;

my $dbh = DBI->connect($dsn, $db_user_name, $db_password);

unless ( check_have_partition() ) {
    print "Your installation of MySQL does not support table partitioning.\n";
    syslog(LOG_CRIT, 'Your installation of MySQL does not support table partitioning.');
    exit 1;
}

my $sth = $dbh->prepare(qq{SELECT table_name, partition_name, lower(partition_method) as partition_method,
                    rtrim(ltrim(partition_expression)) as partition_expression,
                    partition_description, table_rows
                FROM information_schema.partitions
                WHERE partition_name IS NOT NULL AND table_schema = ?});
$sth->execute($db_schema);

while (my $row =  $sth->fetchrow_hashref()) {
    $part_tables->{$row->{'table_name'}}->{$row->{'partition_name'}} = $row;
}

$sth->finish();

foreach my $key (sort keys %{$tables}) {
    unless (defined($part_tables->{$key})) {
        syslog(LOG_ERR, 'Partitioning for "'.$key.'" is not found! The table might be not partitioned.');
        next;
    }

    create_next_partition($key, $part_tables->{$key}, $tables->{$key}->{'period'});
    remove_old_partitions($key, $part_tables->{$key}, $tables->{$key}->{'period'}, $tables->{$key}->{'keep_history'})
}

delete_old_data();

$dbh->disconnect();

sub check_have_partition {
    my $result = 0;
# MySQL 5.5
    my $sth = $dbh->prepare(qq{SELECT variable_value FROM information_schema.global_variables WHERE variable_name = 'have_partitioning'});
# MySQL 5.6
    #my $sth = $dbh->prepare(qq{SELECT plugin_status FROM information_schema.plugins WHERE plugin_name = 'partition'});

    $sth->execute();

    my $row = $sth->fetchrow_array();

    $sth->finish();

# MySQL 5.5
    return 1 if $row eq 'YES';
# MySQL 5.6
    #return 1 if $row eq 'ACTIVE';
}

sub create_next_partition {
    my $table_name = shift;
    my $table_part = shift;
    my $period = shift;

    for (my $curr_part = 0; $curr_part < $amount_partitions; $curr_part++) {
        my $next_name = name_next_part($tables->{$table_name}->{'period'}, $curr_part);
        my $found = 0;

        foreach my $partition (sort keys %{$table_part}) {
            if ($next_name eq $partition) {
                syslog(LOG_INFO, "Next partition for $table_name table has already been created. It is $next_name");
                $found = 1;
            }
        }

        if ( $found == 0 ) {
            syslog(LOG_INFO, "Creating a partition for $table_name table ($next_name)");
            my $query = 'ALTER TABLE '."$db_schema.$table_name".' ADD PARTITION (PARTITION '.$next_name.
                        ' VALUES less than (UNIX_TIMESTAMP("'.date_next_part($tables->{$table_name}->{'period'}, $curr_part).'") div 1))';
            syslog(LOG_DEBUG, $query);
            $dbh->do($query);
        }
    }
}

sub remove_old_partitions {
    my $table_name = shift;
    my $table_part = shift;
    my $period = shift;
    my $keep_history = shift;

    my $curr_date = DateTime->now;
    $curr_date->set_time_zone( $curr_tz );

    if ( $period eq 'day' ) {
        $curr_date->add(days => -$keep_history);
        $curr_date->add(hours => -$curr_date->strftime('%H'));
        $curr_date->add(minutes => -$curr_date->strftime('%M'));
        $curr_date->add(seconds => -$curr_date->strftime('%S'));
    }
    elsif ( $period eq 'week' ) {
    }
    elsif ( $period eq 'month' ) {
        $curr_date->add(months => -$keep_history);

        $curr_date->add(days => -$curr_date->strftime('%d')+1);
        $curr_date->add(hours => -$curr_date->strftime('%H'));
        $curr_date->add(minutes => -$curr_date->strftime('%M'));
        $curr_date->add(seconds => -$curr_date->strftime('%S'));
    }

    foreach my $partition (sort keys %{$table_part}) {
        if ($table_part->{$partition}->{'partition_description'} <= $curr_date->epoch) {
            syslog(LOG_INFO, "Removing old $partition partition from $table_name table");

            my $query = "ALTER TABLE $db_schema.$table_name DROP PARTITION $partition";

            syslog(LOG_DEBUG, $query);
            $dbh->do($query);
        }
    }
}

sub name_next_part {
    my $period = shift;
    my $curr_part = shift;

    my $name_template;

    my $curr_date = DateTime->now;
    $curr_date->set_time_zone( $curr_tz );

    if ( $period eq 'day' ) {
        my $curr_date = $curr_date->truncate( to => 'day' );
        $curr_date->add(days => 1 + $curr_part);

        $name_template = $curr_date->strftime('p%Y_%m_%d');
    }
    elsif ($period eq 'week') {
        my $curr_date = $curr_date->truncate( to => 'week' );
        $curr_date->add(days => 7 * $curr_part);

        $name_template = $curr_date->strftime('p%Y_%m_w%W');
    }
    elsif ($period eq 'month') {
        my $curr_date = $curr_date->truncate( to => 'month' );
        $curr_date->add(months => 1 + $curr_part);

        $name_template = $curr_date->strftime('p%Y_%m');
    }

    return $name_template;
}

sub date_next_part {
    my $period = shift;
    my $curr_part = shift;

    my $period_date;

    my $curr_date = DateTime->now;
    $curr_date->set_time_zone( $curr_tz );

    if ( $period eq 'day' ) {
        my $curr_date = $curr_date->truncate( to => 'day' );
        $curr_date->add(days => 2 + $curr_part);
        $period_date = $curr_date->strftime('%Y-%m-%d');
    }
    elsif ($period eq 'week') {
        my $curr_date = $curr_date->truncate( to => 'week' );
        $curr_date->add(days => 7 * $curr_part + 1);
        $period_date = $curr_date->strftime('%Y-%m-%d');
    }
    elsif ($period eq 'month') {
        my $curr_date = $curr_date->truncate( to => 'month' );
        $curr_date->add(months => 2 + $curr_part);

        $period_date = $curr_date->strftime('%Y-%m-%d');
    }

    return $period_date;
}

sub delete_old_data {
    $dbh->do("DELETE FROM sessions WHERE lastaccess < UNIX_TIMESTAMP(NOW() - INTERVAL 1 MONTH)");
    $dbh->do("TRUNCATE housekeeper");
    $dbh->do("DELETE FROM auditlog_details WHERE NOT EXISTS (SELECT NULL FROM auditlog WHERE auditlog.auditid = auditlog_details.auditid)");
}

and i did add some tunes to my.cnf file
[mysqld]
innodb_buffer_pool_size = 256M # take ~75% of total available memory, for example if you have 8GB of RAM then set it to 6G
innodb_buffer_pool_instances = 4
innodb_flush_log_at_trx_commit = 0
innodb_flush_method = O_DIRECT
innodb_log_file_size = 256M
query_cache_type = 0
innodb_io_capacity = 2000 #or 3000 in SSD scenario

i did install all the necessary packages fro the script like the syslog and DateTime and it's connection and accessing the database but the problem is when it tried to make partitions
ps : partitioning for mariadb is enabled and i did it with and internal script and it worked fine