text:
Q: JQuery validation allow Spanish characters but no special characters How to validate special characters (like @ # $ %), but allow  international (European) language characters?
I'm using jQuery validation.
My current code is:
$('#my_form').validate({
  rules: {
    'model[field]': {
      required: true,
      noSpecialCaracters: true
    }
  }
});

This show errors message on typing special characters like: ö ä å ø æ

A: You can add a custom validation method which uses Regex to validate the input allowing alphabetical letters and the special characters you defined.
$.validator.addMethod('customValidation',
  function(value, element) {
  return this.optional(element) ||
  /^[A-Za-z\u00C0-\u017F]+$/.test(value); },
  'Bad validation message here.');

A: $('#my_form').validate({
    rules: {
        'model[field]': {
        required: true,
        noSpecialCaracters:function() { return /^[0-9a-zñáéíóúü]+$/i.test(string); }
    }
});


text:
Q: Excel formula to find lowest value above a given number and return the column name I'm trying to write an Excel formula that will look at 5 columns of data (for example, labeled SEL1, SEL2, SEL3, SEL4, and SEL5) and return the column name of the lowest column with a value above a 0.80.
For example,

| SEL1 | SEL2 | SEL3 | SEL4 | SEL5 |
|------+------+------+------+------|
| 0.68 | 0.81 | 0.84 | 0.92 | 0.95 |

In this case, I'd want it to identify SEL2.
So far I have =INDEX(A$1:E$1,MATCH(MIN(A2:E2),A2:E2,0)) - it's returning SEL 1 because it's only looking at the minimum, not the minimum above a 0.80

A: Use the array formula:
=INDEX(A1:E1,MATCH(MIN(IF(A2:E2>0.8,A2:E2)),A2:E2))

Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Yii2 querybuilder correct syntax for table names with raw sql Can anyone tell me what is it that I am doing wrong in this statement
$connection =   Yii::$app->db;
$result=$connection->createCommand("SHOW TABLE STATUS LIKE
                                   {{%promo_deliveries}}")->execute();

I am getting this error

Exception 'yii\db\Exception' with message 'SQLSTATE[42000]: Syntax
  error or access violation: 1064 You have an error in your SQL syntax;
  check the manual that corresponds to your MariaDB server version for
  the right syntax to use near 'sms_promo_deliveries' at line 1 The
  SQL being executed was: `SHOW TABLE STATUS LIKE sms_promo_deliveries'
in
  F:\xampp\htdocs\Nxb\sms_protected\vendor\yiisoft\yii2\db\Schema.php:631
Error Info: Array (
      [0] => 42000
      [1] => 1064
      [2] => You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
  near 'sms_promo_deliveries' at line 1 )

A: This had nothing to do with the table naming convention when using query builder in fact it was a syntax error as specified, had to add quotes around the table name as i was using the LIKE keyword to match the table name.
$result=$connection->createCommand("SHOW TABLE STATUS LIKE
                                   '{{%promo_deliveries}}'")->execute();


text:
Q: Published NuGet packages not showing in remote NuGet Feed? I am setting up a NuGet server to host our packages internally. I followed the steps listed below:
https://docs.nuget.org/create/hosting-your-own-nuget-feeds
but having issues.
I have a site setup in IIS on the TFS server and can navigate to the URL successfully. I see the "You are running NuGet Server 2.8.5 but the link to view your packages doesn't show any packages. However, I can publish packages successfully from the visual studio project to the remote package path which is the normal inetpub\wwwroot etc. The packages show up in the path correctly and also show up in visual studio in manage packages menu. Anyone have an idea why they aren't showing up in the package feed URL?
I would greatly appreciate any help I could get.
Thanks,

A: I was having similar issues. I was able to get it working by using the full file path in packagesPath key of the web.config. I could not use a relative path.


text:
Q: why my wsdl don't show elements I have a web service written in Java by netbeans named "test".
One of the methods gets a class called "BodyCollection" That includes several elements.
the xsd File created in netbeans shows all the elements, but the WSDL file does not show the elements at all.
What could be the reason?
Here is the xsd File:
<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.3 (tags/2.3-7528; 2013-04-29T19:34:10+0000) JAXWS-RI/2.2.8 JAXWS/2.2 svn-revision#unknown. --><xs:schema xmlns:tns="http://test.TelZar.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://test.TelZar.com/">

<xs:element name="Check_Response" type="tns:Check_Response"/>

<xs:element name="Check_ResponseResponse" type="tns:Check_ResponseResponse"/>

<xs:element name="InterruptedException" type="tns:InterruptedException"/>

<xs:element name="execute" type="tns:execute"/>

<xs:element name="executeResponse" type="tns:executeResponse"/>

<xs:element name="getting_started" type="tns:getting_started"/>

<xs:element name="getting_startedResponse" type="tns:getting_startedResponse"/>

<xs:complexType name="Check_Response">
<xs:sequence>
<xs:element name="bd" type="tns:bodyCollection" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="bodyCollection">
<xs:sequence>
<xs:element name="ACK_CODE" type="xs:string" minOccurs="0"/>
<xs:element name="ACK_DATE" type="xs:string" minOccurs="0"/>
<xs:element name="approvalInd" type="xs:string" minOccurs="0"/>
<xs:element name="essentialInfo1" type="xs:string" minOccurs="0"/>
<xs:element name="fromNumber" type="xs:string" minOccurs="0"/>
<xs:element name="identification_value" type="xs:string" minOccurs="0"/>
<xs:element name="networkType" type="xs:string" minOccurs="0"/>
<xs:element name="number" type="xs:string" minOccurs="0"/>
<xs:element name="numberType" type="xs:string" minOccurs="0"/>
<xs:element name="rejectReasonCode" type="xs:string" minOccurs="0"/>
<xs:element name="requestRetryDate" type="xs:string" minOccurs="0"/>
<xs:element name="requestTrxNo" type="xs:string" minOccurs="0"/>
<xs:element name="toNumber" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="Check_ResponseResponse">
<xs:sequence>
<xs:element name="return" type="tns:response" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="response">
<xs:sequence>
<xs:element name="ack" type="xs:string" minOccurs="0"/>
<xs:element name="date" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="InterruptedException">
<xs:sequence>
<xs:element name="message" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="getting_started">
<xs:sequence>
<xs:element name="Process_type" type="xs:string" minOccurs="0"/>
<xs:element name="To" type="xs:string" minOccurs="0"/>
<xs:element name="Network_type" type="xs:string" minOccurs="0"/>
<xs:element name="Number_type" type="xs:string" minOccurs="0"/>
<xs:element name="Number" type="xs:string" minOccurs="0"/>
<xs:element name="From_number" type="xs:string" minOccurs="0"/>
<xs:element name="To_number" type="xs:string" minOccurs="0"/>
<xs:element name="Identification_value" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="getting_startedResponse">
<xs:sequence>
<xs:element name="return" type="xs:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="execute">
<xs:sequence>
<xs:element name="Anser" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="executeResponse">
<xs:sequence>
<xs:element name="return" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>

And here is the WSDL file:
<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.3 (tags/2.3-7528; 2013-04-29T19:34:10+0000) JAXWS-RI/2.2.8 JAXWS/2.2 svn-revision#unknown. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.3 (tags/2.3-7528; 2013-04-29T19:34:10+0000) JAXWS-RI/2.2.8 JAXWS/2.2 svn-revision#unknown. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://test.TelZar.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://test.TelZar.com/" name="test">
<types>
<xsd:schema>
<xsd:import namespace="http://test.TelZar.com/" schemaLocation="http://localhost:8080/WebApplication1/test?xsd=1"/>
</xsd:schema>
</types>
<message name="execute">
<part name="parameters" element="tns:execute"/>
</message>
<message name="executeResponse">
<part name="parameters" element="tns:executeResponse"/>
</message>
<message name="InterruptedException">
<part name="fault" element="tns:InterruptedException"/>
</message>
<message name="Check_Response">
<part name="parameters" element="tns:Check_Response"/>
</message>
<message name="Check_ResponseResponse">
<part name="parameters" element="tns:Check_ResponseResponse"/>
</message>
<message name="getting_started">
<part name="parameters" element="tns:getting_started"/>
</message>
<message name="getting_startedResponse">
<part name="parameters" element="tns:getting_startedResponse"/>
</message>
<portType name="test">
<operation name="execute">
<input wsam:Action="http://test.TelZar.com/test/executeRequest" message="tns:execute"/>
<output wsam:Action="http://test.TelZar.com/test/executeResponse" message="tns:executeResponse"/>
<fault message="tns:InterruptedException" name="InterruptedException" wsam:Action="http://test.TelZar.com/test/execute/Fault/InterruptedException"/>
</operation>
<operation name="Check_Response">
<input wsam:Action="http://test.TelZar.com/test/Check_ResponseRequest" message="tns:Check_Response"/>
<output wsam:Action="http://test.TelZar.com/test/Check_ResponseResponse" message="tns:Check_ResponseResponse"/>
<fault message="tns:InterruptedException" name="InterruptedException" wsam:Action="http://test.TelZar.com/test/Check_Response/Fault/InterruptedException"/>
</operation>
<operation name="getting_started">
<input wsam:Action="http://test.TelZar.com/test/getting_startedRequest" message="tns:getting_started"/>
<output wsam:Action="http://test.TelZar.com/test/getting_startedResponse" message="tns:getting_startedResponse"/>
<fault message="tns:InterruptedException" name="InterruptedException" wsam:Action="http://test.TelZar.com/test/getting_started/Fault/InterruptedException"/>
</operation>
</portType>
<binding name="testPortBinding" type="tns:test">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="execute">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="InterruptedException">
<soap:fault name="InterruptedException" use="literal"/>
</fault>
</operation>
<operation name="Check_Response">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="InterruptedException">
<soap:fault name="InterruptedException" use="literal"/>
</fault>
</operation>
<operation name="getting_started">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="InterruptedException">
<soap:fault name="InterruptedException" use="literal"/>
</fault>
</operation>
</binding>
<service name="test">
<port name="testPort" binding="tns:testPortBinding">
<soap:address location="http://localhost:8080/WebApplication1/test"/>
</port>
</service>
</definitions>

All the WSDL files examples I saw are with elements, and for some reason they do not appear in my file.
I must emphasize that the web service works properly, but I want to understand what is the problem in my file.
Can someone help me with this?

A: In your wsdl you are importing xsd file(which is having all the elements) in to your wsdl you can find this code
 <types>
    <xsd:schema>
    <xsd:import namespace="http://test.TelZar.com/"
         schemaLocation="http://localhost:8080/WebApplication1/test?xsd=1"/>
    </xsd:schema>
    </types>

So thats why the reason you are unable to see all the elements.


text:
Q: encode specific part of url in Java Here is my url:
https:/app.mycompany.com/app/login?pagereq=dogs?dogId=123&size=small&color=white

Specifically, I would like to encode only the part after the word "dogs":
https:/app.mycompany.com/app/login?pagereq=dogs%3FdogId=123%26size=small%26color=white

If I use UriComponentsBuilder, it only replaces the first "?" symbol, which I want to retain. it also does not replace the "&" symbols.


text:
Q: Replace word with contents of paste buffer? I need to do a bunch of word replacements in a file and want to do it with a vi command, not an EX command such as :%s///g.
I know that this is the typical way one replaces the word at the current cursor position: cw<text><esc> but is there a way to do this with the contents of the unnamed register as the replacement text and without overwriting the register?

A: If you make use of a named register (ie. use "ay or "ad, etc., to fill your paste register), you can do something like
cw<CTRL-R>a<esc>
Which will replace the word with the contents of register a. As far as I can tell, you can't use the default register because when you cw it'll be filled with the word that was cut by that command.

A: Using the information in this post, I have formed this useful mapping. I chose 'cp' because it signifies "change paste"
nmap <silent> cp "_cw<C-R>"<Esc>
EDIT:
Also I took this a step further and supported any motion.
To get the equivalent of command above it would be cpw for "change paste word"
"This allows for change paste motion cp{motion}
nmap <silent> cp :set opfunc=ChangePaste<CR>g@
function! ChangePaste(type, ...)
    silent exe "normal! `[v`]\"_c"
    silent exe "normal! p"
endfunction

A: You can use the visual mode of vim for this. e.g. copy a word: ye and then overwrite another one with the copied word: vep

A: If your cursor is on the word you want to replace with the contents of the unnamed register, you can use viwp. v switches to visual mode, iw selects the inner word, and p puts the contents of the register in its place.
In practice, when I need to replace one word (function name, etc.) with another, I'll move to the one to use as a replacement, yiw to yank the inner word to the unnamed register, then move to the word I'm replacing, and viwp to replace it. Pretty quick way of substituting one word for another. If you searched (/) for the word you're replacing to get to it, you can then just hit n to get to the next occurrence you need to replace. Obviously no substitute for using :%s/find/replace/g, but for a couple of quick substitutions it can be handy, especially if you already have the new word in a register.

A: Do you mean the system paste buffer or the vi register?
If you want to use the system paste buffer then you are fine and could do dw"+P - " chooses a register, and "+ is the system paste buffer.
Otherwise copy into the non-default register with say "ay to copy into register a and then to replace something do dw"aP

A: You can use yw to yank the word, then you can change the word with yanked word by vipw to yank word and paste previously yanked word.

A: I'm thinking by "paste" you mean the unnamed (yank/put/change/delete/substitute) register, right? (Since that's the one that'd get overwritten by the change command.)
Registers are generally specified by typing " then the name (single character) of the register, like "ay then "ap to yank into register a, then put the contents of register a. Same goes for a change command. In this case, if you don't want the text you remove with the change command to go anywhere, you can use the black hole register "_:  "_cw. Then once in insert mode, you can hit ctrl-R followed by the register you want (probably ") to put in the contents of that register.

*

*"* - selection register (middle-button paste)

*"+ - clipboard register (probably also accessible with ctrl-shift-v via the terminal)

*"" - vim's default (unnamed) yank/put/change/delete/substitute register.

Short answer: "_cw^R"
Edit: as others are suggesting, you can of course use a different register for the yank (or whatever) that got your text into the default register. You don't always think of that first, though, so it's nice to do a single change command without blowing it away. Though it's not totally blown away. There are the numbered registers "0 through "9:

Vim fills these registers with text from yank and delete commands.
Numbered register 0 contains the text from the most recent yank command, unless the command specified another register with ["x].
Numbered register 1 contains the text deleted by the most recent delete or change  command, unless the command specified another register or the text is less than one line  (the small delete register is used then).  An exception is made for the delete operator  with these movement commands: %, (, ), `, /, ?, n, N, { and }. Register "1 is always used then (this is Vi compatible).  The "- register is used as well if the delete is within a line.
With each successive deletion or change, Vim shifts the previous contents of register 1 into register 2, 2 into 3, and so forth, losing the previous
contents of register 9.

A: You can use registers for that:
first place replacement text in register
<mark some text>"ay
where a is register name
then you can use that register in replacement
ve"ap

A: Or you could do Shift+v-p (select the whole line and paste in its' place)


text:
Q: setting which controller to handle a certain action I'm using the structure of the Ember version of the TodoMVC app for an Ember app by which I mean that, after setting the application route to products
export default Ember.Route.extend({
    redirect: function(){
        this.transitionTo('products');
    }
});

I then use the ul structure of the todo app, with each product occupying a new list position (as each todo does in the TodoMVC). I also (as with the Todo app) bind some attributes that allow me to set css styles depending on state

            {{#each product in arrangedContent }}

Depending on state, an input box will be visible for a product once a user clicks a button. The problem is that once the user clicks the button, isEditing is set to true for all the products, so all the input boxes are visible i.e. the class for each list element is set to editing
. The action (which makes the input box visible) is handled on the products controller
showInput: function(item){
    this.set('isEditing', true);
},

I only want the input box made visible for the particular product (or list element) where the click event was triggered. In the Todo MVC app, the action to make the input field visible is handled on a (singular) Todo controller, not the TodosController, so in my app, I created a (singular) product controller and put the action there but when the user clicks the button on an individual product in the list, the action on the (single) product controller is not triggered.  How can I get the product controller to handle the action, or alternatively, ensure that only one input field is made visible.
You can see how the functionality is supposed to work on the live demo the TodoMVC app by creating a few todo items and then clicking on one of them. Only one input field becomes visible.
Update
In the showInput function of the products controller, I tried to call the corresponding function in the product controller (after specifying the products needs the product controller)  needs: ['product'],
showInput: function(){
this.get('controllers.product').send('showInput');
}

this call the function on the product controller but setting it to true does nothing, i.e the input field isn't made visible and none of the list element classes are set to editing

    showInput: function(item){
      this.set('isEditing', true);
    },

For what it's worth, the product controller isn't showing in the Ember inspector, although I am able to send the actions to it, just not able to call this.set('isEditing',true) on it.

A: Change
 {{#each product in arrangedContent }}

To
 {{#each arrangedContent as |product|}}
   {{to-do product=product}}

Generate a to-do component via ember g component to-do, and modify it (see below).  Set it's template to be whatever went in the li before, accessing the appropriate property via product.<prop> in the template.
export default Ember.Component.extend({
  tagName: 'li',
  classNameBindings: ['isEditing'],
  isEditing: false,
  product: null,
  actions: {
    showInput: function() {
      this.setProperty('isEditing', true);
    }
  }
})


text:
Q: C# Compiled lambda expressions instance creation and/or garbage collection? Consider the following code sample:
using System;
using System.Linq.Expressions;

public class Class1<T, Y>
{
    public Class1(Expression<Func<T, Y>> mapExpression)
    {
        GetValue = mapExpression.Compile();
    }

    public Func<T, Y> GetValue { get; protected set; }
}

public class DataClass
{
    public long Data { get; set; }
}

Now suppose that I make in different places new instances of Class1, e.g.
var instance1 = new Class1<DataClass, long>(x => x.Data);
var instance2 = new Class1<DataClass, long>(x => x.Data);

When I do this, what happens:

*

*Do I get two different compiled functions?

*If so, do the two compiled functions get garbage collected when the instances of Class1 get garbage collected?

*If not, how can I avoid a memory leak (assuming that I can't realistically control the creation of Class1 instances)?

A: *

*Yes. Make this static if 'singleton' is required.

*Before .NET 4, no, with .NET 4 dynamic created assemblies/code can be garbage collect under certain conditions.

*If the 'singleton' pattern does not work, try using a static caching mechanism.


text:
Q: pd.Print() prints the image but its cut off so I'm trying to print an image I make with python and then call a c# exe to have it print silently. Thing is, it always gets cut off and I frankly have no idea why, I've printed like 20 different pages now with changed args and nothing seems to work. For reference, the image is an A4 2480x3508 (standard A4 I believe). The bottom right side gets cut off and the image is enlarged. My code:
internal class Program
    {
        public static string inputImgPath = "";
        static void Main(string[] args)
        {
            inputImgPath = args[0];
            //inputImgPath = "C:\\Users\\danie\\OneDrive\\asciiV2\\final.png";
            Console.WriteLine(inputImgPath);

            try
            {
                PrintDocument pd = new PrintDocument();

                Margins margins = new Margins(0, 0, 0, 0);
                pd.PrinterSettings.DefaultPageSettings.Margins = margins;
                pd.DefaultPageSettings.Margins = margins;
                pd.PrintPage += new PrintPageEventHandler
                   (pd_PrintPage);

                Console.WriteLine(pd.PrinterSettings.DefaultPageSettings);

                pd.Print();
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred while printing" + ex.ToString());
            }
        }
        private static void pd_PrintPage(object sender, PrintPageEventArgs ev)
        {
            // Draw a picture.
            ev.Graphics.DrawImage(Image.FromFile(inputImgPath), ev.Graphics.VisibleClipBounds);
            // Indicate that this is the last page to print.
            ev.HasMorePages = false;
        }
    }```


text:
Q: Javascript split not recognizing middle dot I'm trying to split a string based upon the middle dot. For some reason, it's not recognizing it. I can use a "pipe" character so I know everything else is working, but not the middle dot. Do I need to escape the middle dot? If so, how?
Javascript
    var sTags = $(this).text();
    // alert(sTags);
    sSplitTags = sTags.split(' | ');
    // Split isn't recognizing the middot
    // var sSplitTags = sTags.split(' · ');
    // var sSplitTags = sTags.split(' · ');
    // var sSplitTags = sTags.split(' · ');
    alert(sSplitTags[0]);

HTML

Upscale · Gadget

Expensive · Widget

Expensive · Widget

Thanks in advance!

A: ' \267 ' Should be what you're looking for. Javascript uses an octal encoding for special characters that differs from the html/css encoding syntax.
Here's a site with a nice lookup table: http://www.evotech.net/blog/2007/04/named-html-entities-in-numeric-order/
-EDIT-
ruakh brought up this version of ' \u00B7 ' which is also just as valid. You'll notice on the page that there is a column for hex codes and for middle dot it is B7. In css you would write \00B7 but in javascript we need to qualify that this is not an octal by appending the little 'u' to the front and you'd end up with \u00B7'.

A: The code works OK when the character encoding of the document containing the JavaScript code has been properly declared. For example, it works when the code appears, as UTF-8 encoded, inside an HTML document which is UTF-8 encoded as a whole and this encoding is adequately declared. For an external JavaScript file, the HTTP headers should be used to declare the encoding. See the W3C document on character encodings: http://www.w3.org/International/O-charset.en.php


text:
Q: Access Log in troubles Lately there has been a problem running some of our reports in access. Last week(the beginning of the week) we tried to run a reports lets call it A and it kept giving us the log in prompt. Even when the correct user-name and password were entered the log in box would just keep reappearing until cancel was pressed.
I clicked the debug and checked the query. I then logged into the database it is pulling the data from with the same user-name and password and received no trouble. Around Wednesday A was working again, even though nothing was changed. This week A is working but another report B is doing the same thing..
Anyone have any idea what this could be? I'm thinking maybe someone else has the report open? Any help is appreciated.
EDIT: I have narrowed down the error to one linked table that is causing the login prompt. It seems it has the DSN setup but no database specified. So i just need to relink the table..Is there anyway to do this at the GUI level? Also should I leave this question up for future users or just delete it?

A: Was the login prompt from Access or from Windows? If from Windows, then I'd say that there was some sort of file permission or network access issue at hand. If from Access, then I would say that something in the SYSTEM.MDW that you are using is corrupt or has been reconfigured.
If the login prompt is from ODBC it probably means that the credentials that are being used to access the backend database (per your comments you mentioned it was SQL Server) are either invalid or disabled. (Or it could be as simple as the backend database is/was temporarily unavailable).
If you are using linked tables in Access to a SQL Server it means that an ODBC connection was created and you might try verifying that the ODBC connection is working ( Control Panel, Administrative Tools, Data Sources(ODBC) ). In that dialog there is a place to test the connection.


text:
Q: Having Trouble with my Jquery if and else-if statements and conditions. Also my click method won't work, Console shows no error "use strict"

//DO NOT MODIFY THE CODE BELOW
//wait for everything to load before executing this here code
`$(document).ready(()=> {
    // create a new constant to hold a date reference for the current moment
    const dt = new Date();
    //Get the current year from the date reference, and put it
    //in the yield field in the footer.
    $('#year').text(dt.getFullYear());
});`

//ADD YOUR CODE BELOW

$(document).ready( ()=> {
    let listItemTrim = $("#listItemInput").val().trim();
    const a = [];

    $("#addItemToList").click( () => {
    if (listItemTrim = ""){
            alert("Error! Franz Liszt's list item cannot be empty. This is unacceptable. Franz Liszst demands you correct his list!");

    }else if(a.some((element) => element.toLowerCase() == listItemTrim.toLowerCase())){
        alert("Error! You are attempting to input A duplicate value.");

    }else if(a.length > 6) {
        alert("Error! Franz Listzt's list can only hold 6 Items!");

    }else{

    }
    })
})

/*this is what im trying to do. I have been switching things up for 3 hours and cannot figure it out.

*

*Define an array, map, or set to hold the list items. (5 points)

*Define a click event listener for addItemToList (2 points), which accomplishes the following:
a. Trim the contents of the text field. (2 points).
b. Replace the contents of the text field with the trimmed value. (2 points).
c. If the text field is empty, display an error such as the one shown in Figure 2. (2 points).
d. If the text field is not empty,

i. Check to see if the array, map, or set already contains the input item. If the item already exists,
display an error such as the one shown in Figure 3. The duplicate check should be case
insensitive, meaning Apple and apple should be seen as duplicates. (2 points).
ii. If the array, map, or set does not contain the input item add the input item to the array, map, or
set. Then, use jQuery methods to append the item to the existing unordered list with the ID value
list items holder – an example of this is shown in Figure 4, on the next page. (2 points). */


text:
Q: Ant and JUnit: test not performed With Ant, you need to run JUnit-test. To use this code:
<target name="tempTest">
        <mkdir dir="<folder in which to create the class-file>" />
        <javac destdir="<folder in which to create the class-file>"
               srcdir="<folder in which the java-file with junit-test>"
               debug="on"
               memorymaximumsize="128m"
               fork="true"
               encoding="utf-8">
            <classpath>
                <fileset dir="<folder, which is located in junit.jar>" includes="junit.jar"/>
            </classpath>
        </javac>
        <junit printsummary="on" haltonfailure="no">
            <classpath>
                <fileset dir="<folder, which is located in junit.jar>" includes="junit.jar"/>
                <pathelement location="<folder in which to create the class-file (in this step, class-file has been created in this folder)>"/>
            </classpath>
            <formatter type="plain"/>
            <batchtest todir="<folder in which the file will be created for output to a test error>">
                <fileset dir="<folder in which the java-file with junit-test>"/>
            </batchtest>
        </junit>
</target>

Code class take the test:
package ForTests;

import org.junit.Test;

public class TempTest {

    @Test
    public void testTemp() {

        System.err.print("ERROR FOR TESTS");

    }

}

However, when you run the ant-script file displays the error:
Testsuite: TempTest
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

    Caused an ERROR
TempTest
java.lang.ClassNotFoundException: TempTest
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:30)

Tell me, please, how to solve the problem?

UPD:
Issue has been resolved.
In order to run junit-test line must
<batchtest todir="<folder in which the file will be created for output to a test error>">
    <fileset dir="<folder in which the java-file with junit-test>"/>
</batchtest>

replaced
<batchtest todir="<folder in which the file will be created for output to a test error>">
    <fileset dir="<folder in which to create the class-file (in this step, class-file has been created in this folder)>"/>
</batchtest>


text:
Q: Workflow: Pause for Duration SPD WF Action hangs Currently, I'm developing a SPOnline workflow trying to automatically assign a task monthly, quarterly, or yearly based on a drop down box value.  From what I've been testing, the pause for duration, set at 5 minutes, seems to hang and does not resume the workflow after pausing.  I have tried removing the pause for duration action and have had a successful task assignment.  Heres how it flows currently with the problem:
Step / Action
1 / Workflow Initialized
2 / Determine Month/Qtr/Year based on drop down list
3 / Pause based DDL value (This is where it hangs)
4 / Set document approval status to Pending
5 / Assign a task
6 / Set document approval status to Completed
No matter what time interval I set it to, it seems to hang and not complete the workflow or go to the next task.  I've tried the following steps:
•   Debugging the workflow by removing pause for duration step
•   Changed regional settings to match server
•   Broken up workflow actions into multiple steps and vice versa (seeing if pause needs to be seperated out)
•   tried 5,10,15,30 min and 1 hour pauses
Any suggestions on what to look at or if Pause for Duration is not working properly?  Thanks!!

A: There was a hotfix to address a problem with the "pause for duration" actions not firing.  However, I think this was rolled into SP1, so you should have that applied already:
Hot fix blog entry

A: http://www.microsoft.com/downloads/details.aspx?FamilyId=256CE3C3-6A42-4953-8E1B-E0BF27FD465B&displaylang=en

A: FWIW, I'm getting the same behavior with SP2 installed. Several "Pause for Duration" WFAs which should have paused for 3 minutes each have now been waiting for more than 4 days with no error in the workflow, and all timer jobs reporting healthy in central admin.
There's a post about this on MSDN which suggests that the hotfix only fixed part of the problem: http://social.msdn.microsoft.com/Forums/en-US/sharepointworkflow/thread/1965d387-8436-4868-98dc-7a76cbda75d3/ (that discussion has been locked, thanks MSDN)


text:
Q: UIScrollView behaves unexpectedly when scrolling inside UIPickerView I have two textfiled in my view. An UIPickerView or normal keyboard(depending on which type of textfiled) is shown from bottom when a textfield is pressed. A UIScrollView wrappers everything in my view.
The ViewController.h file looks like this:
@interface MyViewController : UIViewController<UIPickerViewDataSource, UIPickerViewDelegate>

@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
@property (weak, nonatomic) IBOutlet UITextField *textNormal;
@property (weak, nonatomic) IBOutlet UITextField *textScroll;
@property UIPickerView * picker;

@end

I mixed some code to do some scrolling to the scrollview in order to make textfield visible when a keyboard or a pickerview is shown.
The ViewController.m file:
@interface MyViewController ()

@property BOOL keyboardVisable;
@property CGPoint offset;
@property CGRect frame;
@property UIPickerView * picker;
@end

@implementation MyViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.keyboardVisable = NO;
    [[NSNotificationCenter defaultCenter]
     addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
    [[NSNotificationCenter defaultCenter]
     addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];

    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard)];
    tapGesture.cancelsTouchesInView = NO;
    [self.scrollView addGestureRecognizer:tapGesture];

    self.picker = [[UIPickerView alloc] init];
    self.textScroll.inputView = self.picker;
    self.picker.delegate = self;
    self.picker.dataSource = self;
    self.picker.showsSelectionIndicator = YES;

}
-(void)hideKeyboard
{
    NSLog(@"hide now");
    [self.scrollView endEditing:YES];
}

- (void)keyboardDidShow:(NSNotification *)notif{
    if(self.keyboardVisable)
        return;

    NSLog(@"keyboard did show");

    NSDictionary* info = [notif userInfo];
    NSValue* aValue = [info objectForKey:UIKeyboardFrameBeginUserInfoKey];
    CGSize keyboardSize = [aValue CGRectValue].size;

    // Save the current location so we can restore
    // when keyboard is dismissed
    self.offset = self.scrollView.contentOffset;
    self.frame = self.scrollView.frame;

    // Resize the scroll view to make room for the keyboard
    CGRect viewFrame = self.scrollView.frame;
    viewFrame.size.height -= keyboardSize.height;
    self.scrollView.frame = viewFrame;

    CGRect textFieldRect = [self.textScroll frame];
    textFieldRect.origin.y += 10;

    [self.scrollView scrollRectToVisible:textFieldRect animated:YES];

    // Keyboard is now visible
    self.keyboardVisable = YES;

}

- (void)keyboardDidHide:(NSNotification *)notif{
    if(!self.keyboardVisable)
        return;

    NSLog(@"keyboard did hide");

    //self.scrollView.contentOffset = self.offset;
    self.scrollView.frame = self.frame;
    [self.scrollView setContentOffset:self.offset animated:YES];

    self.keyboardVisable = NO;

}

These codes work normally when a normal textfield is pressed.
(The scrollview would change it's frame size and offset in order to make textfield viewable, and it will be back to normal when anywhere but the keyboard is pressed)
However, they don't work on textfield with inputView == pickerview.
The scrollview would change it's frame size as expected. Once the pickerview is scrolled by an user, the background(scrollview) will suddenly scroll to top and become unscrollable unexpectedly.
Thanks!


text:
Q: Multiplying Elements in a List Containing Pairs I'm trying to write a code (function) using Scheme that:

*

*Takes a list of any size as a parameter

*Multiplies every number of the list together

*Symbols should be skipped over

*Values inside pairs should be included in multiplication

In other words, results should be as follows:
> (mult '(1 2 3))
6
> (mult '(1 2 x 3 4))
24
> (mult '(1 2 z (3 y 4)))
24 (mine gives me 2)

My code allows me to skip over the symbols and multiply everything.  However, once I include a pair inside the list, it acts as though it isn't a number, therefore acting like it doesn't exist.  Here's my code:
(define mult
       (lambda (x)
               (if (null? x)
                      1
                      (if(number? (car x))
                         (* (car x) (mult (cdr x)))
                         (mult(cdr x))))))

I've tried to use append when it finds a pair, but clearly I did it wrong... Any help on how I could get it to include the values inside a pair would be much appreciated.
i.e. '(1 2 y (3 z 4) = 1 * 2 * 3 * 4

A: You are nearly there, just missing the list? test:
(define (mult lst)
  (if (null? lst)
      1
      (let ((ca (car lst)))
        (cond
          ((number? ca) (* ca (mult (cdr lst))))
          ((list? ca)   (* (mult ca) (mult (cdr lst))))
          (else         (mult (cdr lst)))))))

EDIT
He're an equivalent version without let:
(define (mult lst)
  (cond
    ((null? lst)         1)
    ((number? (car lst)) (* (car lst) (mult (cdr lst))))
    ((cons? (car lst))   (* (mult (car lst)) (mult (cdr lst))))
    (else                (mult (cdr lst)))))

As you see, (car lst) is likely to be evaluated more than once, so I used let in the first version to avoid this.

A: It is a slightly advanced technique but this problem can easily be formulated as a tail recursive algorithm.
(define (mult lst)
  (let multiplying ((lst lst) (r 1))   ; r is the multiplicative identity...
    (if (null? lst)
        r
        (let ((next (car lst))
              (rest (cdr lst)))
          (multiplying rest (cond ((number? next) (* next r))
                                  ((list?   next) (* (mult next) r))
                                  (else           r)))))))
> (mult '(1 2 3 a b (((((10)))))))
60

Using tail recursion has performance implications but, admittedly, it is not the first thing to learn - recursion is.  However, in this case, because lists are often very long, avoiding a stack frame for each list element can be a dramatic savings; using tail calls avoids the stack frame.


text:
Q: More efficient way other than setTimeout() The time delay given in setTimeout() works differently for Windows and Ubuntu?
Why is that?
Is there a better way?

A: The time given in setTimeout() is not guaranteed.
There are several reasons for that:

*

*The eventQueue system of JavaScript

*Timer accuracy depending on the OS and/or browser (is between 1ms and 20ms)

I wrote a blog post about time in JavaScript at
http://www.codebullets.com/is-time-relative-in-javascript-1365
about this topic
Better way for what?
It depends what you want to do. Also take a look at RequestAnimationFrame (http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/), maybe this is for you.

A: requestAnimationFrame will trigger for each monitor VBLANK gap if requested before the next VBLANK.
That way it is a very accurate timer. However, it triggers up to 60 times per seconds and it won't be very accurate if you spend more than the 16.7ms time-budget you get before you need to call it again.
If your functions operates within this time-budget, requestAnimationFrame will be most accurate you can get access to from Javascript.
It's triggered almost the same way as setTimeout:
function myLoop() {

    //... < 16.7ms to finish work...

    requestAnimationFrame(myLoop);
}

Note: you will need to use prefixes in some browsers or a polyfill (see chris' answer for link).


text:
Q: New-AzResourceGroupDeployment fails due to indexing in IP adress value when creating New-AzResourceGroupDeployment fails when deploying a virtual network via ARM template. It seems like the ARM template is iterating through one single IP adress by seeing it's dots ('.') as delimiter:
Errormessage:
New-AzResourceGroupDeployment : 16:00:26 - The deployment 'vm2' failed with error(s). Showing 1 out of 1 error(s).
Status Message: Cannot parse the request. (Code: InvalidRequestFormat)
 - Unexpected character encountered while parsing value: {. Path 'properties.addressSpace.addressPrefixes', line 1, position 133. (Code:InvalidJson)
 - After parsing a value an unexpected character was encountered: :. Path 'properties.addressSpace.addressPrefixes[0]', line 1, position 145. (Code:InvalidJson)
 - After parsing a value an unexpected character was encountered: :. Path 'properties.addressSpace.addressPrefixes[0]', line 1, position 145. (Code:InvalidJson)
 - After parsing a value an unexpected character was encountered: :. Path 'properties.addressSpace.addressPrefixes[0]', line 1, position 145. (Code:InvalidJson)
 - After parsing a value an unexpected character was encountered: :. Path 'properties.addressSpace.addressPrefixes[0]', line 1, position 145. (Code:InvalidJson)
CorrelationId: 5cf0698f-1f96-4adf-a242-312ded6bc9fe
At line:1 char:1
+ New-AzResourceGroupDeployment -ResourceGroupName "clientname-rg-vm-01 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet

The part of the template file looks like this:
   ..."parameters": {
        "addressPrefixes": {
          "type": "array"
         },
        "subnets": {
          "type": "array"
        }
      },...

        ..."properties": {
               "addressSpace": {
                   "addressPrefixes": "[parameters('addressPrefixes')]"
               },
               "subnets": "[parameters('subnets')]"
           },...

The full template file looks like this:
{
    "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "environment": {
            "type": "string",
            "metadata": {
                "description": "Omgeving Dev, Tst, Acc, Prd"
            }
        },
        "companyName": {
            "type": "string"
        },
        "resourceType": {
            "type": "string"
        },
        "sequenceNumber": {
            "type": "string"
        },
        "location": {
            "type": "string"
        },
        "networkInterfaceName": {
            "type": "string"
        },
        "enableAcceleratedNetworking": {
            "type": "bool"
        },
        "networkSecurityGroupName": {
            "type": "string"
        },
        "networkSecurityGroupRules": {
            "type": "array"
        },
        "subnetName": {
            "type": "string"
        },
        "virtualNetworkName": {
            "type": "string"
        },
        "addressPrefixes": {
            "type": "array"
        },
        "subnets": {
            "type": "array"
        },
        "publicIpAddressName": {
            "type": "string"
        },
        "publicIpAddressType": {
            "type": "string"
        },
        "publicIpAddressSku": {
            "type": "string"
        },
        "pipDeleteOption": {
            "type": "string"
        },
        "virtualMachineRG": {
            "type": "string"
        },
        "osDiskType": {
            "type": "string"
        },
        "osDiskDeleteOption": {
            "type": "string"
        },
        "virtualMachineSize": {
            "type": "string"
        },
        "nicDeleteOption": {
            "type": "string"
        },
        "adminUsername": {
            "type": "string"
        },
        "adminPassword": {
            "type": "secureString"
        },
        "patchMode": {
            "type": "string"
        },
        "enableHotpatching": {
            "type": "bool"
        },
        "tags": {
            "type": "object"
        }
    },
    "variables": {
        "vmName": "[concat(parameters('companyName'), parameters('resourceType'), parameters('sequenceNumber'), parameters('environment'))]",
        "nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]",
        "vnetName": "[parameters('virtualNetworkName')]",
        "vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
        "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]"
    },
    "resources": [
        {
            "name": "[parameters('networkInterfaceName')]",
            "type": "Microsoft.Network/networkInterfaces",
            "apiVersion": "2021-03-01",
            "location": "[parameters('location')]",
            "dependsOn": [
                "[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]",
                "[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
                "[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]"
            ],
            "properties": {
                "ipConfigurations": [
                    {
                        "name": "ipconfig1",
                        "properties": {
                            "subnet": {
                                "id": "[variables('subnetRef')]"
                            },
                            "privateIPAllocationMethod": "Dynamic",
                            "publicIpAddress": {
                                "id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]",
                                "properties": {
                                    "deleteOption": "[parameters('pipDeleteOption')]"
                                }
                            }
                        }
                    }
                ],
                "enableAcceleratedNetworking": "[parameters('enableAcceleratedNetworking')]",
                "networkSecurityGroup": {
                    "id": "[variables('nsgId')]"
                }
            },
            "tags": "[parameters('tags')]"
        },
        {
            "name": "[parameters('networkSecurityGroupName')]",
            "type": "Microsoft.Network/networkSecurityGroups",
            "apiVersion": "2019-02-01",
            "location": "[parameters('location')]",
            "properties": {
                "securityRules": "[parameters('networkSecurityGroupRules')]"
            },
            "tags": "[parameters('tags')]"
        },
        {
            "name": "[parameters('virtualNetworkName')]",
            "type": "Microsoft.Network/virtualNetworks",
            "apiVersion": "2020-11-01",
            "location": "[parameters('location')]",
            "properties": {
                "addressSpace": {
                    "addressPrefixes": "[parameters('addressPrefixes')]"
                },
                "subnets": "[parameters('subnets')]"
            },
            "tags": "[parameters('tags')]"
        },
        {
            "name": "[parameters('publicIpAddressName')]",
            "type": "Microsoft.Network/publicIpAddresses",
            "apiVersion": "2019-02-01",
            "location": "[parameters('location')]",
            "properties": {
                "publicIpAllocationMethod": "[parameters('publicIpAddressType')]"
            },
            "sku": {
                "name": "[parameters('publicIpAddressSku')]"
            },
            "tags": "[parameters('tags')]"
        },
        {
            "name": "[variables('vmName')]",
            "type": "Microsoft.Compute/virtualMachines",
            "apiVersion": "2021-07-01",
            "location": "[parameters('location')]",
            "dependsOn": [
                "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]"
            ],
            "properties": {
                "hardwareProfile": {
                    "vmSize": "[parameters('virtualMachineSize')]"
                },
                "storageProfile": {
                    "osDisk": {
                        "createOption": "fromImage",
                        "managedDisk": {
                            "storageAccountType": "[parameters('osDiskType')]"
                        },
                        "deleteOption": "[parameters('osDiskDeleteOption')]"
                    },
                    "imageReference": {
                        "publisher": "MicrosoftWindowsServer",
                        "offer": "WindowsServer",
                        "sku": "2019-datacenter-gensecond",
                        "version": "latest"
                    }
                },
                "networkProfile": {
                    "networkInterfaces": [
                        {
                            "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]",
                            "properties": {
                                "deleteOption": "[parameters('nicDeleteOption')]"
                            }
                        }
                    ]
                },
                "osProfile": {
                    "computerName": "[variables('vmName')]",
                    "adminUsername": "[parameters('adminUsername')]",
                    "adminPassword": "[parameters('adminPassword')]",
                    "windowsConfiguration": {
                        "enableAutomaticUpdates": true,
                        "provisionVmAgent": true,
                        "patchSettings": {
                            "enableHotpatching": "[parameters('enableHotpatching')]",
                            "patchMode": "[parameters('patchMode')]"
                        }
                    }
                },
                "licenseType": "Windows_Server"
            },
            "tags": "[parameters('tags')]"
        }
    ],
    "outputs": {
        "adminUsername": {
            "type": "string",
            "value": "[parameters('adminUsername')]"
        }
    }
}

The part of the ARM parameter file looks like this:
   ..."addressPrefixes": {
           "value": [
               "172.50.28.0/22"
           ]
       },
       "subnets": {
           "value": [
               {
                   "name": "default_VM01",
                   "properties": {
                       "addressPrefix": "172.50.28.0/26"
                   }
               }
           ]
       },...

Modules versions
Does anyone know how to solve this problem?

A: We have tried the same to create virtual machine along with virtual network as mentioned above and it works fine.
Please make sure that the address prefix section you provided is in correct format and you have updated az cli/ powershell versions in your environment.
You can use the below template by providng your creadentials to do the same operation ;
Template.json
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string"
},
"networkInterfaceName": {
"type": "string"
},
"enableAcceleratedNetworking": {
"type": "bool"
},
"networkSecurityGroupName": {
"type": "string"
},
"networkSecurityGroupRules": {
"type": "array"
},
"subnetName": {
"type": "string"
},
"virtualNetworkName": {
"type": "string"
},
"addressPrefixes": {
"type": "array"
},
"subnets": {
"type": "array"
},
"publicIpAddressName": {
"type": "string"
},
"publicIpAddressType": {
"type": "string"
},
"publicIpAddressSku": {
"type": "string"
},
"pipDeleteOption": {
"type": "string"
},
"virtualMachineName": {
"type": "string"
},

"virtualMachineComputerName": {
"type": "string"
},
"virtualMachineRG": {
"type": "string"
},
"osDiskType": {
"type": "string"
},
"osDiskDeleteOption": {
"type": "string"
},
"virtualMachineSize": {
"type": "string"
},
"nicDeleteOption": {
"type": "string"
},
"adminUsername": {
"type": "string"
},
"adminPassword": {
"type": "secureString"
},
"patchMode": {
"type": "string"
},
"enableHotpatching": {
"type": "bool"
},
"tags": {
 "type": "object"
 }
 },
"variables": {
                              "nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]",
                              "vnetName": "[parameters('virtualNetworkName')]",
                              "vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
                              "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]"

},
                              "resources": [
                                  {
                                      "name": "[parameters('networkInterfaceName')]",
                                      "type": "Microsoft.Network/networkInterfaces",
                                      "apiVersion": "2021-03-01",
                                      "location": "[parameters('location')]",
                                      "dependsOn": [
                                          "[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]",
                                          "[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
                                          "[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]"
                                      ],
                                      "properties": {
                                          "ipConfigurations": [
                                              {
                                                  "name": "ipconfig1",
                                                  "properties": {
                                                      "subnet": {
                                                          "id": "[variables('subnetRef')]"
                                                      },
                                                      "privateIPAllocationMethod": "Dynamic",
                                                      "publicIpAddress": {
                                                          "id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]",
                                                          "properties": {
                                                              "deleteOption": "[parameters('pipDeleteOption')]"
                                                          }
                                                      }
                                                  }
                                              }
                                          ],
                                          "enableAcceleratedNetworking": "[parameters('enableAcceleratedNetworking')]",
                                          "networkSecurityGroup": {
                                              "id": "[variables('nsgId')]"
                                          }
                                      },
                                      "tags": "[parameters('tags')]"
                                  },
                                  {
                                      "name": "[parameters('networkSecurityGroupName')]",
                                      "type": "Microsoft.Network/networkSecurityGroups",
                                      "apiVersion": "2019-02-01",
                                      "location": "[parameters('location')]",
                                      "properties": {
                                          "securityRules": "[parameters('networkSecurityGroupRules')]"
                                      },
                                      "tags": "[parameters('tags')]"
                                  },
                                  {
                                      "name": "[parameters('virtualNetworkName')]",
                                      "type": "Microsoft.Network/virtualNetworks",
                                      "apiVersion": "2020-11-01",
                                      "location": "[parameters('location')]",
                                      "properties": {
                                          "addressSpace": {
                                              "addressPrefixes": "[parameters('addressPrefixes')]"
                                          },
                                          "subnets": "[parameters('subnets')]"
                                      },
                                      "tags": "[parameters('tags')]"
                                  },
                                  {
                                      "name": "[parameters('publicIpAddressName')]",
                                      "type": "Microsoft.Network/publicIpAddresses",
                                      "apiVersion": "2019-02-01",
                                      "location": "[parameters('location')]",
                                      "properties": {
                                          "publicIpAllocationMethod": "[parameters('publicIpAddressType')]"
                                      },
                                      "sku": {
                                          "name": "[parameters('publicIpAddressSku')]"
                                      },
                                      "tags": "[parameters('tags')]"
                                  },
                                  {
                                      "name": "[parameters('virtualMachineName')]",
                                      "type": "Microsoft.Compute/virtualMachines",
                                      "apiVersion": "2021-07-01",
                                      "location": "[parameters('location')]",
                                      "dependsOn": [
                                          "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]"
                                      ],
                                      "properties": {
                                          "hardwareProfile": {
                                              "vmSize": "[parameters('virtualMachineSize')]"
                                          },
                                          "storageProfile": {
                                              "osDisk": {
                                                  "createOption": "fromImage",
                                                  "managedDisk": {
                                                      "storageAccountType": "[parameters('osDiskType')]"
                                                  },
                                                  "deleteOption": "[parameters('osDiskDeleteOption')]"
                                              },
                                              "imageReference": {
                                                  "publisher": "MicrosoftWindowsServer",
                                                  "offer": "WindowsServer",
                                                  "sku": "2019-datacenter-gensecond",
                                                  "version": "latest"
                                              }
                                          },
                                          "networkProfile": {
                                              "networkInterfaces": [
                                                  {
                                                      "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]",
                                                      "properties": {
                                                          "deleteOption": "[parameters('nicDeleteOption')]"
                                                      }
                                                  }
                                              ]
                                          },
                                          "osProfile": {
                                              "computerName": "[parameters('virtualMachineComputerName')]",
                                              "adminUsername": "[parameters('adminUsername')]",
                                              "adminPassword": "[parameters('adminPassword')]",
                                              "windowsConfiguration": {
                                                  "enableAutomaticUpdates": true,
                                                  "provisionVmAgent": true,
                                                  "patchSettings": {
                                                      "enableHotpatching": "[parameters('enableHotpatching')]",
                                                      "patchMode": "[parameters('patchMode')]"
                                                  }
                                              }
                                          },
                                          "licenseType": "Windows_Server"
                                      },
                                      "tags": "[parameters('tags')]"
                                  }
                              ],
                              "outputs": {
                                  "adminUsername": {
                                      "type": "string",
                                      "value": "[parameters('adminUsername')]"
                                  }
                              }
                          }

deploy.parameter.json
{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "location": {
            "value": "westus2"
        },
        "networkInterfaceName": {
            "value": "ajayxxxxx_z1"
        },
        "enableAcceleratedNetworking": {
            "value": true
        },
        "networkSecurityGroupName": {
            "value": "ajaytxxxx-nsg"
        },
        "networkSecurityGroupRules": {
            "value": []
        },
        "subnetName": {
            "value": "default"
        },
        "virtualNetworkName": {
            "value": "ajxxxx"
        },
        "addressPrefixes": {
            "value": [
                "10.0.0.0/16",
                "172.50.28.0/22"
            ]
        },
        "subnets": {
            "value": [
                {
                    "name": "default",
                    "properties": {
                        "addressPrefix": "10.0.0.0/24"
                    }
                }
            ]
        },
        "publicIpAddressName": {
            "value": "ajayxxxx-ip"
        },
        "publicIpAddressType": {
            "value": "Static"
        },
        "publicIpAddressSku": {
            "value": "Standard"
        },
        "pipDeleteOption": {
            "value": "Detach"
        },
        "virtualMachineName": {
            "value": "ajayxxxx"
        },

        "virtualMachineComputerName": {
            "value": "ajayxxx"
        },
        "virtualMachineRG": {
            "value": "v-xxxxxxxx"
        },
        "osDiskType": {
            "value": "Premium_LRS"
        },
        "osDiskDeleteOption": {
            "value": "Delete"
        },
        "virtualMachineSize": {
            "value": "Standard_D2s_v3"
        },
        "nicDeleteOption": {
            "value": "Detach"
        },
        "adminUsername": {
            "value": "Admini"
        },
        "adminPassword": {
            "value": "passyours"
        },
        "patchMode": {
            "value": "AutomaticByOS"
        },
        "enableHotpatching": {
            "value": false
        },
        "tags":{
            "value":{
                "ajtest": "testdev",
                "owning": "ajtest"
            }
        }

    }
}

We have used below command in our environment and it works as well ,also you can use New-AzResourceGroupDeployment as mentioned in doc. with Connect-AzAccount in PowerShell.
deployment command:-
az deployment group create -n TestDeployment -g rgName --template-file "C:\Users\source\repos\virtualmachinearm\vmvn.json" --parameters "C:\User\source\repos\azuredeploy.parameters.json"

OUTPUT SCREENSHOT FOR REFERENCE:-

Deployed using New-AzResourceGroupDeployment as well :-

PowerShell version:-

NOTE:- When using az deployment group create need to use cli(az login) and when using New-new-Azresourcegroupdeployment(Connect-AzAccount)
For more information please refer this MICROSOFT DOCUMENTATION| Create Virtual Machine using Template.


text:
Q: Fast and dynamic autosuggest using JQuery and flat files in JSON format I've been busting my head on this one so i finally decided to put it on Stackoverflow hoping someone could help me with this.
Let me sketch the problem:

*

*The most basic usage of an autosuggest feature would be to query the database on each keystroke.

The advantage of this method is that you always get the most recent results.
The disadvantages are that it can be slow and that basically it is overkill to address your database on each keystroke. Suppose you want to autosuggest a country table, searching for something like 'america' would generate 7 SELECT query's on the database !
This method is therefor not an option.

*

*The second option (the one i am currently using) is to collect all the possible results and save it into a flat file in JSON format.
So basically what you would have is a single file e.g. countries.json which contains all the countries. Instead of querying the database i just point to the countries json file and each keystroke will just search within the loaded json file.

This method is fast and leverages the database. In the example of the countries this would be a good solution since the content is not very dynamic and it does not contain that much data so the json flat file will be quite small so it will download fast.
But the problem arises when the json file contains dynamic data and has a large dataset.
What if you want to build an autosuggest search containing all the movies and actors?
Putting all the results inside one json file would be ridiculous since the file would probably be too large to download.
Let's take IMDB (www.imdb.com) as an example. They have an autosuggest feature on their website. Searching on a movie title or actor is lightning fast and it searches within hundreds of thousands of records. Looking deeper into their method i notice the following:
If you use the Google Chrome debug window (or Filezilla Firefox Firebug) :
Look inside the network tab for scripts. As you type say for example for "star wars" you notice that by typing each letter a separate json file is loaded.
first it's s.json, then st.json, sta.json, etc...
It stops at star_w.json
Apparently it always stops at the 6th letter.
Each json file it loads contains 8 results matching the letters. There seem to be 36 folders matching each letter of the alphabet including numbers.
E.g the link for star_w.json is http://sg.media-imdb.com/suggests/s/star_w.json
My question is how would you build a similar intelligent system? Do they have every possible combination of 6 letters as a json file? How would you generate the files?
Also notice it does not only look at start of the title to make a match.
So if you would search for "wars" you will also find "star wars" inside the search results.
Any help in figuring out building a similar system would be much appreciated.
I think the system is very neat and fast and it can be used for many purposes!
EDIT
Ok, worked it out.
My solution is a combination of querying the DB and caching the results in flat json files.
Basically when the user types e.g. "star wars", with each keystroke i will first check if there is a json file for the searchstring. If it exists i'll just display the contents of the json file. If the file does not exist or if the file is older than a certain timelimit you set (e.g older than 12hrs) you query the database and echo the output in json.
At the same time you write the output to a json file. The next time you make the search it will just get it's content from the flat files and not from the DB (until ofcourse the TTL is reached).
I've limited the length of letters to 6 letters so if the search string is larger than 6 letters nothing happens, you just continue to look within the search results of the last found results, in the example of "star wars" that would be star_w
With this method the collection of cached json results is automatically populated based on the user input.
You could also write a script that loops your table and generates the json files...
I know it's not the perfect solution but this way at least you can take some load of the DB by caching results in flat files.

A: I would use some search engine software that creates indexes, better suited for these scenarios than what the RDMS can provide.
Take a look at Boolware from Softbool: http://www.softbool.se/ (click the In English) link...
Horrible web page, great product.


text:
Q: How to add time and time intervals in SQL queries I want to check the late comers and early goers for a particular attendance table. My attendance table looks like this:
╔═════════════╦═════════════╦══════════╗
║ date_record ║ checkinTime ║ Emp_code ║
╠═════════════╬═════════════╬══════════╣
║ 2019-02-01  ║ 09:00:00    ║ p-01     ║
╠═════════════╬═════════════╬══════════╣
║ 2019-02-01  ║ 09:30:00    ║ p-02     ║
╠═════════════╬═════════════╬══════════╣
║ 2019-02-01  ║ 10:00:00    ║ p-03     ║
╠═════════════╬═════════════╬══════════╣
║ 2019-02-01  ║ 09:30:00    ║ p-04     ║
╚═════════════╩═════════════╩══════════╝

suppose the actual time is 09:00:00 and i want to show the employee code (Emp_code) who got late by 30 minutes. if i want to check the above like this:
select Emp_code from attendanceTable where checkinTime = ('09:00:00' + '00:30:00');

How can i do this in PostgreSQL?

A: Asssuming checkintime is properly declared as a time column, just add an interval:
select *
from attendancetable
where checkintime = time '09:00:00' + interval '30 minutes';

But you probably want to use >= instead of = to also include employees that arrived e.g. 34 minutes late.

A: I suppose better query would be :
select * from attendancetable WHERE checkintime>=DATE_TRUNC('DAY',checkintime)+interval '9 hours' +interval '30 minutes'
So by using this you can get expected result for all dates.


text:
Q: Disable SharePoint 2007 Installation I have an old SharePoint installation that is no longer in use (SP has been upgraded and moved to another server). I'd like to turn off this SharePoint 2007 install for a while so that it's not writing log files to the SQL server. Can I simply turn off some of the services to do this rather than uninstall SharePoint?

A: There are a few ways to do this, depending on what kind of user experience you need.
If the users still need to be able to access content, you can simply mark all of the SharePoint related databases to Read-only in SQL. (assuming your installation is at least Service Pack 1)
If your users no longer need to see the data at all, you have a few options.

*

*Disable all SharePoint related services (especially the Timer) and
IIS.

*If the SharePoint installation is on a virtual machine, simply turn
that Virtual Machine off

*Disable or stop the Sql Server instance that SharePoint 2007 is using (if possible)

*Detach all SharePoint-related databases from SQL Server

The largest source of data being written to SQL usually comes from Search Indexing, so if all of these options seem too drastic, you can peel back the frequent activities.

*

*Go into Central Administration and click on your Shared Service
Provider

*Click on Search Administration - Content Sources

*Set the full and incremental crawl frequency For each content source
to "None"

*Go to Control Panel - Administrative tools - Services and disable
the SharePoint Timer job.

*If your primary Site Collection has Auditing enabled, you can turn
that off as well by going to Site Collection Settings - Audit
Settings and unchecking all options


text:
Q: Sorting table of items which load individually and asynchronously from backend I have a design problem I've been thinking about for close to a year. I have a solution currently, but it's not very satisfactory so wanted to ask for help. Disclaimer: I asked this question over a year ago (Pattern for sorting a table on values of its child components when the values are loaded asynchronously after the table has been rendered) , and received no answers so trying again with more context.
What I'm trying to do
Premise is this. I have an app which renders a table of items. So far so good, but each item is an "expensive" operation on the backend and the API calls (async) can take a few seconds. Each of these items share common fields and therefore I'd like to render them in a sort and filterable table.
Individual requests might take different amount of times and I'd like to show data as soon as available instead of waiting for everything to be available.
How this has been modelled
The way I've modelled this is that I have a custom component "StockLoaderTable" which holds a list of "StockItem".
<StockLoaderTable>
 <StockItem ticker="abc" dispatcher={dispatchDataUpdate}/>
 <StockItem ticker="bcd" dispatcher={dispatchDataUpdate}/>
 ...
</StockLoaderTable>

** The approach that sort of works **
I have created a custom hook for my backend API to call and evaluate a given stock and each StockItem uses this hook to go and fetch a bunch of details.
So far so good all works nicely. However, I would now like to be able to sort/query/filter the overall table, and unfortunately all the data is now stored in the item components themselves and the parent has little way to get to them. In addition, individual evaluations may fail (for a bunch of reasons), so "error" is a valid state for the child to end up in.
So the way I solved this for now is that I provide a useReducer hook to the child items which they can use to inform the parent whenever their data updates. The parent then keeps a "copy" of the data for each child in itself and applies filter/sort based on this. This means I effectively have the data stored twice and this doesn't seem very elegant to me.
Alternative considered that didn't work
I considered just doing data fetching in a list/loop in the parent, but the rules of hooks don't like me doing that.
Alternative I'm currently considering
Storing data once in a central context/db of some sort. The child items would still be responsible for updating and rendering themselves, but at least I only store the data once in the app.
About to refactor this part of the frontend and would appreciate some suggestions.

A: using useQueries of RQ could result in something like this right?
 const results = useQueries([
   { queryKey: ['post', 1], queryFn: fetchPost },
   { queryKey: ['post', 2], queryFn: fetchPost },
 ])
and sort it with

const sortedResult = React.useMemo(() => [...results].sort((a,b) => a.data.title.localeCompare(b.data.title)), [results])


text:
Q: What is difference between group and user I am totally new to Ubuntu.
I just start to learn about Ubuntu.
So please help me to learn about Ubuntu.

A: Users can be either people, meaning accounts tied to physical users, or accounts which exist for specific applications to use.
Groups are logical expressions of organization, tying users together for a common purpose. Users within a group can read, write, or execute files owned by that group.
Each user and group has a unique numerical identification number called a userid (UID) and agroupid (GID) respectively.
A user who creates a file is also the owner and group owner of that file. The file is assigned separate read, write, and execute permissions for the owner, the group, and everyone else. The file owner can be changed only by the root user as well as access permissions can be changed by both the root user and the owner of the file.
Source : http://www.bayt.com/en/specialties/q/110533/what-is-the-difference-between-a-user-group-and-others-in-red-hat-linux-what-is-the-use-of-group-ownership-amp-user-ownership-of-a-file-or-folder/

A: User is an account, either for real person or a daemon software. You can log in with your user account, or others using su.
Groups can be thought of as levels of privilege. A person who is part of a group can view or modify files belonging to that group, depending on the permissions of that file. User belonging to a group has privilleges of that group, for example - sudo groups lets you run software as super user.

A: Multiple users can use privileges of a group. For example if a group has permission to read, write or execute one particular file or folder, or change one specific setting, all the users within that group will inherit this privilege.
You can find different kinds of privileges that a user or a group may have or not here

A: If you are new to Linux/Unix, then the concept of permissions may be confusing. This Link will provide you with an explanation of what permissions are, how they work, and how to manage them. A number of examples will be provided to illustrate how to set and change permissions for both users and
groups.
https://www.linode.com/docs/tools-reference/linux-users-and-groups


text: Q: 9 million rows in my table that needs Address Scrubbed Is a CLR UDFSclar Function be better Than a SQL Server UDF? I have a performance question.  I need an Address Scrubbing routine.  My table has Almost 9,000,000 rows. Would a UDF in SQL Server with 80 Replace Commands VS a CLR Scalar Function VS a CLR Table Call VS a Web service Call to the POST office be more efficient?


text:
Q: Filter rows with incorrect date Based on the dataset below, how can I find/filter the rows with incorrect and no (NA) date values in the Request Date column?
Basically the correct dates will be something like, for example, 1/01/2022 or 11/01/2022.
Actual data
Data:
structure(list(Year = c("2022", "2022", "2022", "2022", "2022",
"2022", "2022", "2022", "2022", "2022"), `Reference Number` = c("14784",
"14784", "14785", "14785", "14786", "14786", "14787", "14787",
"14788", "14788"), `Request Date` = c("1/6/2022", "1/6/2022",
"11/19/2022", "Happy New Year", "1899-12-31 02:40:00", "Ongoing", "1//12/05",
"01/14/205", "1/25/20`22", NA)), row.names = c(NA, -10L
), class = c("tbl_df", "tbl", "data.frame"))

Code:
library(tidyverse)

df = df %>% filter() #.... stuck

A: use anytime::anytime fucntion:
df %>% filter(is.na(anytime::anytime(`Request Date`)))

# A tibble: 5 × 3
  Year  `Reference Number` `Request Date`
  <chr> <chr>              <chr>
1 2022  14785              Happy New Year
2 2022  14787              1//12/05
3 2022  14787              01/14/205
4 2022  14788              1/25/20`22
5 2022  14788              NA


text:
Q: Need right to flow UNDER left on small screens (Fixed width right, Variable width Left) I need a fixed right column, and the left column to take up the remaining space. Then on mobile both columns will be full width, and the right column should float UNDER the left.
I followed this Stack question on how to make the right column fixed, and the left column a variable width: make a div fill up the remaining width
This involved me moving the right column div above the left column div in the HTML. So now in smaller browsers when I make both columns 100% width, the right side floats above the left, but I would like the right column to float under the left.
Any ideas on what to change?

    left div
left div
left div
left div
left div
left div

    middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div
bit taller

#main {
  width: 100%;
}
#primary {
  width: 100px;
  float: right;
  background-color: #fcc;
}
#container {
  background-color: #cfc;
  overflow: auto;
}

@media screen and (max-width: 500px) {
    #primary, #container{
         width: 100%;
    }
    #primary{
        float:none;
    }
}
}

https://jsfiddle.net/8pk4K/2157/

A: Perhaps try this:
HTML

    middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div
bit taller

    left div
left div
left div
left div
left div
left div

Note that the reason the "container" div close tag is extended out is because there can't be any whitespace between the container and primary divs, or else extra space will be put between them.
CSS
#main {
  width: 100%;
}
#primary {
  width: 100px;
  right: 0px;
  background-color: #fcc;
  display: inline-block;
}
#container {
  vertical-align: top;
  display: inline-block;
  background-color: #cfc;
  overflow: auto;
  top: 0px;
  left: 0px;
  width: calc(100% - 100px);
}

@media screen and (max-width: 500px) {
    #primary, #container{
         width: 100%;
    }
}
}

A: 1; Place the container first in the HTML mark-up followed by the fixed width div.
2; Set the elements to display:table-cell; on wide screens and display:block; on narrow screens
#main {
  width: 100%;
}
#primary {
  width: 100px;
  display:table-cell;
  background-color: #fcc;
}
#container {
    display:table-cell;
    background-color: #cfc;
    overflow: auto;
}

@media screen and (max-width: 500px) {
    #primary, #container{
         width: 100%;
    }
    #container{
        display:block;
    }
    #primary{
        display:block;
        width:100%;
    }
}

https://jsfiddle.net/Nillervision/hpsnqs60/

A: What you posted floats "primary" to the right & gives it a fixed width, even though you're calling it "left div left div left div." This is the reverse of what your explained above. On small screens it should put "primary" first and then "container" in the order they appear in the HTML, which is exactly what happens.
Give both a width (percentage works) and float accordingly. Easiest fix is to swap the HTML order...
https://jsfiddle.net/8pk4K/2159/
#main {
  width: 100%;
}
#primary {
  width: 10%;
  float: right;
  background-color: #fcc;
}
#container {
  background-color: #cfc;
    width: 90%;
  overflow: auto;
  float:left;
}

@media screen and (max-width: 500px) {
    #primary, #container{
         width: 100%;
    }
    #primary{
        float:none;
    }
}
}

        middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div
bit taller

        left div
left div
left div
left div
left div
left div

A: You most certainly want to put the right column second in the HTML.  After that, there are numerous ways to accomplish what you want with the CSS.
One way to do it is to use absolute positioning on the right column, adding padding-right on the parent element:

#main {
  position: relative;
  padding-right: 100px;
}
#primary {
  width: 100px;
  position: absolute;
  top: 0;
  right: 0;
  background-color: #fcc;
}
#container {
  background-color: #cfc;
}

@media screen and (max-width: 500px) {
  #main {
    padding-right: 0;
  }
  #primary, #container{
    width: auto;
  }
  #primary{
    position: static;
  }
}

    middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div middle div
bit taller

    left div
left div
left div
left div
left div
left div

jsfiddle.net/8pk4K/2160

A: I have updated the fiddle with a few lines of javascript also.
placed the promary div as absolute.
Here is the fiddle - https://jsfiddle.net/8pk4K/2162/


text:
Q: Why can't I install email for Python How can I fix this error:
>pip install email
Collecting email
  Using cached https://files.pythonhosted.org/packages/71/e7/816030d3b0426c130040bd068be62b9213357ed02896f5d9badcf46d1b5f/email-4.0.2.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "H:\PycharmProjects\WinScripts\venv\lib\site-packages\setuptools\__init__.py", line 16, in <module>
        import setuptools.version
      File "H:\PycharmProjects\WinScripts\venv\lib\site-packages\setuptools\version.py", line 1, in <module>
        import pkg_resources
      File "H:\PycharmProjects\WinScripts\venv\lib\site-packages\pkg_resources\__init__.py", line 33, in <module>
        import email.parser
      File "C:\Users\lawrence\AppData\Local\Temp\pip-install-fu_huz8v\email\email\parser.py", line 10, in <module>
        from cStringIO import StringIO
    ModuleNotFoundError: No module named 'cStringIO'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\lawrence\AppData\Local\Temp\pip-install-fu_huz8v\email\

EDIT 1:
If email is a standard package why does it fail:
H:\PycharmProjects\WinScripts\venv\Scripts\python.exe H:/PycharmProjects/WinScripts/email.py
Traceback (most recent call last):
  File "H:/PycharmProjects/WinScripts/email.py", line 1, in <module>
    import smtplib
  File "C:\Users\lawrence\AppData\Local\Programs\Python\Python36-32\lib\smtplib.py", line 47, in <module>
    import email.utils
  File "H:\PycharmProjects\WinScripts\email.py", line 2, in <module>
    from email.mime.text import MIMEText
ModuleNotFoundError: No module named 'email.mime'; 'email' is not a package

Process finished with exit code 1


text:
Q: Janus GridEX: how to expand rows I've been using Janus GridEX control in hierarchical mode and I want all rows to be expanded.
As I said before I'm using hierarchy, no groups so expandGroups() does not work.
Any suggestions?

A: grid.ExpandRecords();

A: I just had the issue myself.
grid.ExpandRecords() is the correct method. But it will only work if the grid is visible and actually displayed.
In my case I'm using a TabControl. I had to use the grid.ExpandRecords() method in the SelectedTabChanged event


text:
Q: Usage of registers in x86 assembly language under Linux Below is a hello world program in x86 assembly language. I know what every register is doing, but why can't I use different register instead of these specified?
For example, if I use rbx instead of rax the code doesn't work.
section .data
    text db "Hello World",10
section .text
    global _start
_start:
    mov rax, 1
    mov rdi, 1
    mov rsi, text
    mov rdx, 14
    syscall

    mov rax, 60
    mov rdi, 0
    syscall

A: When you call into the operating system, the operating system needs to know what you want it do. On Linux, the operating system looks into the general-purpose registers rax, rdi, rsi, rdx, r10, r8, and r9. In these registers, the kernel finds a bunch of values:
rax: 0x00000001
rdi: 0x00000001
rsi: 0x00400123
rdx: 0x0000000e
r10: 0x00000042
r8:  0xdeadbeef
r9:  0x00000023

How does the kernel know which values represent what? They all look the same! The solution is that there is a convention. First, the kernel looks into rax to check what function you want. Function 1 is SYS_write. For SYS_write, it expects rdi to contain the file descriptor to write to (1, stdout), in rsi it expects a pointer to the data to write (0x00400123, a pointer to your string "Hello World") and in rdx it expects the number of bytes to write.
The only way for the kernel to tell which data has which meaning is to use the convention that you use certain registers for certain pieces of data.


text:
Q: Numpy - easier way to change the value of one column of an array only? I'd like to make a 2-D array, with one column staying the same, and the other varying with linspace.
This works, but seems a little bulky:
np.hstack((np.tile(45,(21,1)), np.array([np.linspace(55,65,21)]).T))

[[ 45.   55. ]
 [ 45.   55.5]
 [ 45.   56. ]
 [ 45.   56.5]
 [ 45.   57. ]
 [ 45.   57.5]
 [ 45.   58. ]
 [ 45.   58.5]
 [ 45.   59. ]
 [ 45.   59.5]
 [ 45.   60. ]
 [ 45.   60.5]
 [ 45.   61. ]
 [ 45.   61.5]
 [ 45.   62. ]
 [ 45.   62.5]
 [ 45.   63. ]
 [ 45.   63.5]
 [ 45.   64. ]
 [ 45.   64.5]
 [ 45.   65. ]]

Is there a better way to do this?

A: This seems cleaner, but else i don't see much advantage:
x = np.empty((21, 2))
x[:, 0] = 45
x[:, 1] = np.linspace(55, 65, x.shape[0])

A: Not a great deal better, but I would do
>>> a = np.full((21, 2), 45.0)
>>> a[..., 1] = np.linspace(55, 65, a.shape[0])
>>> a
array([[ 45. ,  55. ],
       [ 45. ,  55.5],
       [ 45. ,  56. ],
       [ 45. ,  56.5],
       [ 45. ,  57. ],
       [ 45. ,  57.5],
       [ 45. ,  58. ],
       [ 45. ,  58.5],
       [ 45. ,  59. ],
       [ 45. ,  59.5],
       [ 45. ,  60. ],
       [ 45. ,  60.5],
       [ 45. ,  61. ],
       [ 45. ,  61.5],
       [ 45. ,  62. ],
       [ 45. ,  62.5],
       [ 45. ,  63. ],
       [ 45. ,  63.5],
       [ 45. ,  64. ],
       [ 45. ,  64.5],
       [ 45. ,  65. ]])
>>>


text:
Q: How to move blocks to another theme region I have on my Drupal 7 site a MySQL data base. One of the core module (Block), when enabled, creates three tables (block, block_custom, block_role.) All the blocks an admin creates go into the block_custom table.
For a while now, although I can save a new block when I create it, I can no longer update the block list page (admin/structure/block.) This means I can no longer move a block to another region of my theme or change its weight. To do this, I need to go inside the block and select the new theme region although I do not have the option to change its weight there.
Similarly I cannot save or update a block for the Dashboard.
I have tried to find existing blocks that could be the cause of this. One by one, out of some 100 blocks I was able to get the block page to save after deleting 22 blocks.
However, since I need those deleted block, I went ahead and recreated them thinking the old blocks were somehow corrupt and needed fresh replacements. I expected the new blocks to be appended to the end of the table.
I do not know if this has some relevance but some of the new blocks were indeed appended (no sorting) while others went to fill in the empty spaces left by the deleted blocks (the block IDs (bid) did not follow in sequence.)
Be that as it may, after having re-created the 22 blocks, I am back to square one and I still can't move blocks or update the block list page!
Can anyone tell me what's going on and what I should do to fix this? I am not a data base expert and any help would be greatly appreciated. :)

A: Finally got it to work by making a dump of the table data (not the structure) then deleting the data inside the table and then re-importing the data into the table. Didn't even optimize the table before this last operation.
Although I am not sure what this did, it was an easy procedure. Not that obvious to figure out though. Also, it cleared a couple of other issues with Organic Groups that were giving me a WSD with the message: "The website has encountered an unexpected error, please try again later"
Looks like the website is running seamlessly now.
:)


text:
Q: I am using Microsoft translator local sdk in my app for offline text to text translation, its not working in android kitkat int result = Translator.start(mContext, new Translator.ServiceListener() {
.....
}

it return  ERROR_APP_MISSING_SIGNATURE = 51;
in kitkat, but its work fine in marshmallow and later android api versions

A: Looks like KitKat is returning multiple signatures, and the local sdk is only expecting one signature. you can fix by changing the check in checkAppSignature() method of TranslatorImpl.java to:
if (packageInfo == null || packageInfo.signatures == null || packageInfo.signatures.length == 0) {
I will look into updating GitHub with the fix.


text:
Q: What is the difference bewteen for loop and multily operation(*) in list? (Python) I have just got a question from a collegue, but I couldn't exlpain it well to him.
the problem is that the result of two operation was different.
example code is like this
n,m = 10,10
d = [[0]* m for _ in range(n)]
f = [[ 0 ] * m] * n

and the situation that I'm in a pickle is as follows.
d[0][1] = 1-> it sets only [0][1] to 1

f[0][1] = 1-> it sets all the elements in the column of index to 1

the results
d = [[0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
f = [[0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0]]

I tried bool(d==f), but the result was True.
I'm so confused of this difference.
please help me, please let me know why it is!
thank you for reading my question.