sql – get unregistered users

I have a problem with my project, it turns out that I have two tables USERINFO and CHECKINOUT, the first is the information of the users and the second is the information of the register, each time that a user registers a new entry is added, but I want to get users who have not registered on a specific date

The code is the following, which gives me users who have not registered on that date but who has been throwing away all users since they all signed up on other dates. I want to start determined.

That's the code:

select u.USERID, ch.CHECKTIME
from CHECKINOUT ch
inner join USERINFO u
on ch.USERID = u.USERID
where CONVERT(date,CHECKTIME,103) not in ('2019-09-19')

help me please thank you

Programming – What are the common pitfalls that await new users?

Mathematica's own programming model: functions and expressions

There are many books on Mathematica programming, we still see a lot of people falling to understand MathematicaThe programming model of and generally understand it badly as functional programming.

It's because we can pass a a function as an argument, as

plotZeroPi(f_) := Plot(f(x), {x,0,Pi});
plotZeroPi(Sin) (* produces Plot(Sin(x),{x,0,Pi}) *)

and so people tend to think that Mathematica follows a functional programming model (FP). There is even a section in the functional programming documentation. Yes, it looks like, but it's different – and you'll see why soon.

Expressions are what the assessment is about

All in Mathematica is an expression. An expression can be an atom, such as numbers, symbol variables and other embedded atoms, or a compound expression. The compound expressions (our subject here) have a head followed by arguments in brackets, such as Sin(x).

Thus, the assessment in Mathematica is the transformation going from one expression to another based on some rules, defined by the user and integrated, until no rule is applicable. This last expression is returned as an answer.

Mathematica Its strength derives from this simple concept, to which many syntactic sugars are added to write expressions in a more concise manner … and we will see further below. We do not intend to explain all the details here, as there are other sections in this guide to help you.

In fact, what happened above is the definition of a new head, plotZeroPi via the infix operator :=. Moreover, the first argument is a pattern expression plotZeroPi(f_), with head (as a motif) plotZeroPi and a reason argument. The notation f_ simply introduce a all pattern and give him a name, f, which we use in the right side as the head of another expression.

That's why a common way to express this f Is plotZeroPi has a function argument – although it's not very accurate, and we also say that plotZeroPi is a a function (or a high-level function in FP jargon), although it is now clear that there is a little abuse of terminology here.

Bottom line: Mathematica looks like functional programming because we are able to define and circumvent heads.

Put the assessment on hold

But, note that Plot do not expect a function, but an expression! Thus, although in a functional programming paradigm, one would write Plot with a a function parameter, in Mathematica the plot is waiting for an expression. It was a design choice in Mathematica and the one I say makes it quite readable.

It works because Plot is reported to hold the evaluation of its arguments (see nonstandard). Once Plot defines its environment internally, it triggers the evaluation of the expression with specific values ​​assigned to x. When reading the documentation, beware of this subtlety: it says a function although a better term would have been expression.

Dynamically create a head

So what happens if we have to perform a complex operation and once it's done, a function is clearly defined? Say you want to calculate Sin($ alpha $ x), where $ alpha $ is the result of a complex operation. A naive approach is

func(p_, x_) := Sin(costlyfunction(p) x)

If you try then

Plot(func(1.,x), {x,0,Pi})

you can wait a long time to get this plot. Even that does not work

func(p_)(x_) := Sin(costlyfunction(p) x)

because the entire expression is not evaluated by entering Plot anyway. In fact, if you try func (1.) In the front-end, you will see that Mathematica knows no rules about it and can not do much either.

What you need is something that allows you to return a head of an expression. This thing will have costlyfunction calculated once before Plot take your head (the expression, not yours) and give him a x.

Mathematica has an integrated, Function it gives you that.

func(p_) := With({a = costlyfunction(p)}, Function(x, Sin(a x)) );

With introduces a new context where this costly function is evaluated and attributed to a. This value is recalled by Function as it appears as a local symbol in its definition. Function nothing is more than one head that you can use when needed. For those who are familiar with functional programming in other languages, a is part of the closing where the Function is defined; and Function is the way we enter a lambda build in Mathematica.

Another way to do it, more imperative if you like, use Module and what you already know about setting rules (which are more familiar with procedural programming):

func(p_) := Module({f, a},
    a = costlyfunction(p);
    f(x_) := Sin(a x);
    f
    );

In this document, a new context is introduced with two symbols, f and a; and what he does is simple: he calculates a, then defines f like a head as we want, and finally returns this symbol f as answer, a newly created head that you can use in the caller.

In this definition, when you try to say, func (1.), you'll see a fun symbol like f$3600 to be returned. That's the symbol that has the rule f(x_) := Sin(a x) attached to her. It was created by Module to isolate any potential use of f of the outside world. It works, but it's certainly not as idiomatic as function.

The approach with Function is more direct, and there is syntactic sugar for that too; you will see it regularly Mathematica programming

func(p_) := With({a = costlyfunction(p)}, Sin(a #)& );

Ok, let's continue.

Now that func really returns a a function, that is to say something that you can use as an expression head. You would use it with Plot as

With({f = func(1.)}, Plot(f(x),{x,0,Pi}))

and we bet that & # 39; at that time you will understand why Plot(func(1.)(x),{x,0,Pi}) is as bad as any of the previous examples.

Returning an expression

A final example is Piecewise (documentation)

Plot(Piecewise({{x^2, x < 0}, {x, x > 0}}), {x, -2, 2})

So what will happen if the limit condition is a parameter? Well, just apply the recipe above:

paramPieces(p_) := Piecewise({{#^2, # < p}, {#, # > p}}) &;

Do not do

paramPieces(p_) := Piecewise({{x^2, x < p}, {x, x > p}});

because Piecewise does not have the hold attribute and he will try to evaluate his argument. He does not expect an expression! Yes x is not defined, you can see a nice exit when you use it, but now you are forced to use the atom (variable name) x well

Plot(paramPieces(0), {x, -1, 1})

seems to work, you're getting ready to get into trouble. So, how to return something that you can use in Plot?

Well, in this case, the parameter is not a load for the calculation itself, so we see what kind of definitions are used

paramPieces(p_, x_) := Piecewise({{x^2, x < p}, {x, x > p}});
Plot(paramPieces(0, x), {x,-1,1})

And if x is not defined, paramPieces(0, x) is nicely displayed in the front-end as before. It works because, again, Mathematica is a language of expressionsand the parameter x makes as much sense as the number 1.23 in the definition of paramPieces. As told, Mathematica just stop the assessment of paramPieces(0, x) when no more rules are applied.

A note on the mission

We have said above several times that x is given a value on the inside Plot etc. Again, beware, this is not the same thing as variable assignment in functional programming and there are (still) misnomer for the sake of clarity.

What's in it? Mathematica is a new rule that allows the evaluation loop to replace all occurrences of x by a value. As an aperitif, the following works

Plot3D(Sin(x(1) + x(2)), {x(1), -Pi, Pi}, {x(2), -Pi, Pi})

There is no variable x(1), just an expression that incorporates one or more new rules Plot each time & # 39; obtains a value for tracing. You can find out more about this in this guide as well.

Note to readers: Although these guides are not intended to be exhaustive, do not hesitate to leave comments to improve them.

SQL Server 2012 – How to change concurrent users = 0?

First, I was having a network problem every time I tried to connect to my remote SQL server. Sometimes the error was not displayed nor properly connected, but sometimes it gave me that kind of error. To solve this problem, I searched on Google and found this video. I followed these instructions.

BUT I've also made a mistake, it's that in the properties of SQL Server, I changed the user concurrently in 1. I forgot the note above of this written field is 0=unlimited.

After the changes have been applied, my first problem has not been solved, but another problem arises: now it gives me an error like A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (Microsoft SQL Server, Error: 233)

Even the administrator is not allowed to connect to the server. And our work has stopped. So help me, please, to put competing users back to 0?

Thank you

oembed – How to configure a front-end editor for automatically embedded media for non-connected users?

I have a series of themes that allow site visitors to contribute content in the form of messages (they come in draft form) from a front-end editor. I use an invisible connection technique with them as an author user to access the multimedia content transfer utility, and to use a plug-in to prevent it from happening. access to the dashboard.

I'm trying to update without doing any kind of connection, and have a working version doing downloads in the media library with dropzone.js

My limit now is that I had found it in my previous versions by queuing up mce-views that the front-end editor would make the previews in the editor's content that WordPress can automatically integrate. But without being connected, I am no longer automatically integrated, but only once connected. I compared the loaded scripts and found only 3 that were loaded during the connectionless connection. Putting them in queue did not make any difference.

The publisher is placed in a form via:

'wText', 'editor_height' => '400' ); wp_editor( stripslashes( $wText ), 'wtext', $settings ); ?>

The value of $wText is loaded if the form has been submitted (for example, it has generated a validation error on the first pass).

My form is used on one page, so my function is connected to the action wp_enqueue_scripts loads these scripts only for this page:

if ( is_page( truwriter_get_write_page() ) ) { // use on just our form page

    // Build in tag auto complete script
    wp_enqueue_script( 'suggest' );

    //dropzone.js for file uploads
    wp_enqueue_script( 'dropzone', get_stylesheet_directory_uri() . '/js/dropzone.js', '', '5.5', true );
    wp_enqueue_style( 'dropzone-style', get_stylesheet_directory_uri() . '/js/css/dropzone.css' );

    // Autoembed functionality in rich text editor
    // needs dependency on tiny_mce
    // h/t https://wordpress.stackexchange.com/a/287623

    wp_enqueue_script( 'mce-view', '', array('tiny_mce'), '', true );   

    // custom jquery for the uploader on the form
    wp_register_script( 'jquery.writer' , get_stylesheet_directory_uri() . '/js/jquery.writer.js', array( 'suggest', 'dropzone') , '1.9', TRUE );

    // add a local variables for the site's home url, ajax address, and maximum upload size
    wp_localize_script(
      'jquery.writer',
      'writerObject',
      array(
        'siteUrl' => esc_url(home_url()),
        'ajaxUrl' => admin_url('admin-ajax.php'),
        'uploadMax' => round(wp_max_upload_size() / 1000000)
      )
    );

    wp_enqueue_script( 'jquery.writer' );
}

When viewing the sequence in the Chrome Inspector, once connected and the self-recording works, a call to admin_ajax.php – This will of course fail if you are not connected, and that's my best idea of ​​why it does not work.

The value for ajaxUrl passed to the script js is to enable the automatic completion feature tags, and no surprise, it also does not work when it is not connected.

jQuery('#wTags').suggest( writerObject.ajaxUrl + "?action=ajax-tag-search&tax=post_tag", {multiple:true, multipleSep: ","});

I know, through research, that to enable ajax calls, I need an action configured like wp_ajax_nopriv_{action} (In fact, I do it successfully for the dropzone.js integration since I wrote the functions that are recalled by ajax.

But I do not know what reminders to have. wp_ajax_nopriv_{action} it's not my functions but internal WordPress code to do oembed and auto tag suggest.

So (a) is it even possible to enable automatic media integration on a front-end editor with a login and / or (b) how to grant access to admin-ajax.php if there is no login?

nginx – Socket wait time, unable to connect to the server (more than 3,000 active users every 5 minutes)

We operate two large Amazon Web servers (ServerPilot: Apache + Nginx and PHP-FPM) with two DigitalOcean nodes as caches in front of Nginx cache configurations.

I have a problem where the main Nginx web server stops responding for some reason, but there is no error in Nginx, Apache or PHP-FPM, but, mysteriously, the server breaks down from time to time and restarts after 1 to 3 minutes. I have another server in charge of load balancing, so that it recovers when Nginx stops sending health checks.

I checked the IP addresses in the access logs, but I do not have anything strange about trying to overload or send too many connections. It seems to be a very specific condition, but sometimes it can happen twice in a row, or wait a week, and then it happens again.

What options would you recommend to me? Specific tools to check nginx, apache or something similar?

statistics – How many users has this forum?

I am interested in knowing information about this forum.

How many users use this forum?

What is the total number of posts on this forum?

What is the total number of topics covered on this forum?

Please provide links related to forum statistics.

How to cancel RDP access for many users using Powershell?

I'm trying to find a way to cancel bulk RDP access without having to click AD and cancel their RDP access.

exploit – How to activate simultaneous users, an RDP and a local, in post-exploitation in Windows without modification of the disk?

I want to do this by simply using memory and not using a disk modification or tool. After operating a remote system, I already know how to enable RDP, but the problem is when a user is logged in, I can not log in.

there is a method:

https://www.mysysadmintips.com/windows/clients/545-multiple-rdp-remote-desktop-sessions-in-windows-10

and I thought that I could do it in memory and correct this instruction in memory instead of disk, but I discovered that SVCHOST processes have a system integrity and so I can not inject it and modify them.

so how can this be done? any other way that i can do this without using any tool or disk modification?

Allow users to download files

I have a page template, where users can upload images.
I'm using this piece of code to open modal for media (js; only part of a code):

image_frame = wp.media({
  title: 'Select Media',
  multiple : 'add',
  button: {
    text: 'Use this media'
  },
});

I have the following custom role:

add_role( 'customer',  __( 'Customer' ),
        array(
          'read'         => true,
          'edit_files'   => true,
          'upload_files'   => true,
          'read_post'   => true,
          'edit_post'   => true,
          'edit_others_post'   => true,
        )
      );

The type of custom message also

'upload_files' => true,

With this, users with the "client" role can upload new files to the administration area. When they open the page template, a modal for the support appears and they can choose an already uploaded image. However, if clients try to download a new image from the page template, they receive the following message:

Sorry, you are not allowed to attach files to this post.

Any help or suggestion will be appreciated.

Thank you.