text:
Q: same encryption between flutter and python [ AES ] i want some example for encryption between python and flutter to encrypt request and response body between client and server
i found some example code for AES CRT encryption , but i cant see same result in flutter and python
can anybody help me ?
UPDATE :
Flutter crypt package not have counter parameter but python Crypto.Cipher package have counter parameter
this is sample code for python:

    plaintext = '123'.encode('utf-8')
    key = '12345678911234567891123456789123'.encode("utf-8")
    iv = '12345'.encode('utf')
    iv_int = int(binascii.hexlify(iv), 16)
    ctr = Counter.new(AES.block_size * 8, initial_value=iv_int)
    aes = AES.new(key, AES.MODE_CTR, counter=ctr)
    ciphertext = aes.encrypt(plaintext)

    print('ctr = ' + str(ctr))
    print('iv = ' + str(base64.b64encode(iv)))
    print('iv_int = ' + str(iv_int))
    print('plaintext = ' + str(plaintext))
    print('key = ' + str(base64.b64encode(key)))
    print('ciphertext = ' + str(base64.b64encode(ciphertext)))

this is sample code for flutter :
  final plainText = '123';
  final key = encrypt.Key.fromUtf8('12345678911234567891123456789123');
  final iv = encrypt.IV.fromUtf8('12345');
  final encrypter = encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.ctr));

  final encrypted = encrypter.encrypt(plainText, iv: iv);
  final decrypted = encrypter.decrypt(encrypted, iv: iv);

  print('key = ' + key.base64);
  print('iv =' + iv.base64);
  print('encrypted = ' + encrypted.base64);

A: I had the same issue and posted a very similar question. Fortunately, I found the error by myself.
Here is the link: Python AES CTR Mode only encrypts first two bytes
To summarize, the problem: Dart automatically uses the PKCS7 Padding when using AES Encryption, but Python does not anything like that.
So either you set the padding in your Dart code to null e.g.:
aes = AES.new(key, AES.MODE_CTR, counter=ctr, padding: null)

or you add a PKCS7 padding to your python code with like the following:
# The message has to in bytes format
def pkcs7padding(message):
  pl = 16 - (len(message) % 16)
  return message + bytearray([pl for i in range(pl)])

ciphertext = aes.encrypt(pkcs7padding(plaintext))


text:
Q: how to see previous value of a field in salesforce edited by mistake I edited by mistake the value of a field. The track history of the custom object isn't enable.
Can i do something to see the the old value? Maybe with a query.

A: Nope, if you don't have history tracking enabled and are specifically tracking that field, then that value is lost.
Your only other potential saving graces here would be:

*

*You have a backup (an export) of the relevant data

*You have a full copy or partial copy sandbox (the data for your record may exist and have your desired data. Depends on if the target record had the target data at the time of the last sandbox refresh)

redpajama_set_name: RedPajamaStackExchange


text:
Q: h2-console does not show up In my spring boot application, I have added the below dependencies:
       <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.196</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>

and then in my application.properties i set:
spring.h2.console.enabled=true
management.security.enabled=false

But when i navigate to the uri:
http://localhost:8080/h2-console/login.do?jsessionid=cfc3b5595b531203d92134205e16127e

It complains with:
Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

    Wed Sep 27 03:37:52 GMT-12:00 2017
    There was an unexpected error (type=Not Found, status=404).
    No message available

Why don't i have access to h2-console?

A: There is one possible reason why h2-console show that error. That is your files may not be organized in right way. I've also fetched this problem when I keep my Controller, Service, Repository and Model files all together in one package.
I've solved this problem by organizing them separately in their own packages like below
com.example.demo.controller
com.example.demo.service
com.example.demo.repository
com.example.demo.model
My application.properties file contains
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.H2Dialect

A: Add following configuration class in your project and try again.
import org.h2.server.web.WebServlet;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.ShallowEtagHeaderFilter;

import javax.servlet.DispatcherType;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import java.util.EnumSet;

@Configuration
public class WebConfiguration {

    private static final String mapping = "/console/*";

    @Bean
    public ServletRegistrationBean h2servletRegistration(){
        ServletRegistrationBean registrationBean = new ServletRegistrationBean( new WebServlet());
        registrationBean.addUrlMappings(mapping);
        return registrationBean;
    }

    @Bean
    public FilterRegistrationBean shallowEtagHeaderFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new ShallowEtagHeaderFilter());
        registration.setDispatcherTypes(EnumSet.allOf(DispatcherType.class));
        registration.addUrlPatterns(mapping);
        return registration;
    }

    @Bean
    public ServletContextInitializer initializer() {
        return new ServletContextInitializer() {

            @Override
            public void onStartup(ServletContext servletContext) throws ServletException {
                servletContext.setInitParameter("p-name", "-value");
            }
        };
    }
}

A: in my case commenting out spring security from application.properties allowed me to see h2 console again(restart to see the effect)-->
ex. #spring.security.user.name=kk
    #spring.security.user.password=password


text:
Q: laravel centOS 8 "log file could not be opened in append mode: failed to open stream: Permission denied" Generally in ubuntu changing ownership to www-data and 775 permission solve this problem. But in centos 8 this seems not enough. What I did is-

*

*Set SELinux in permissive mode

*Allow to write in the laravel storage folder - chcon -R -t httpd_sys_rw_content_t storage

*sudo chown -R nginx:nginx /path/to/your/laravel/root/directory

*chmod -R 775 storage/

*Reboot the system

Nothing is working. What to do solve this problem?

A: From the projects root folder try:
    sudo chmod -R gu+w storage/
    sudo chmod -R guo+w storage/
    sudo chmod -R gu+w bootstrap/cache/
    sudo chmod -R guo+w bootstrap/cache/

A: Turns out the issue is with selinux
This worked for me
sudo chcon -R -t httpd_sys_rw_content_t /path/to/log/directory

A: In CentOS I just solved with this:
chcon -R -t httpd_sys_rw_content_t storage/
Credits: https://laravelquestions.com/2020/10/27/laravel-the-stream-or-file-storage-laravel-log-could-not-be-opened-in-append-mode-failed-to-open-stream-permission-denied-in-rhel8/#google_vignette


text:
Q: Python call to JIRA Rest Api search not returning Created (Date) or Resolution fields Testing out using python to make a rest api call to pull defects/bugs from my jira instance. Using the code provided in the api_docs, I put together this query:
payload = json.dumps( {

  "jql": "issuetype in (Bug,Defect) AND CreatedDate >= 2021\\u002f01\\u002f01",
  "maxResults": 1,
  #"fieldsByKeys": false,
  "fields": [
   "summary",
   "assignee",
   "reporter",
   "status",
   "resolution"
   "created",
   "updated"
  ],
  "startAt": 0
} )

The call is successful, except it returns every field but created and resolution. I used /rest/api/3/field to ensure that the field was spelled correctly and it was. Also tried capitalizing Created.
{
    "id": "created",
    "name": "Created",
    "custom": false,
    "orderable": false,
    "navigable": true,
    "searchable": true,
    "clauseNames": ["created",
    "createdDate"],
    "schema": {
        "type": "datetime",
        "system": "created"
    }
}

API output example:
{
    "expand": "names,schema",
    "issues": [
        {
            "expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
            "fields": {
                "assignee": null,
                "reporter": example,
                "status": example,
                "summary": "DEFECT: Test 1",
                "updated": "2021-03-07T11:14:31.000-0500"
            },
            "id": "123456",
            "key": "Example-4",
            "self": "example_link"
        }
    ],
    "maxResults": 1,
    "startAt": 0,
    "total": 100
}

Alternatively, when I leave fields blank I do get all the fields including created and resolution. However, I don't want to do that as we have hundreds of custom fields that get pulled in as well.

A: I can see a typo in your code sample. You are missing the comma after the resolution field. You code should be:
payload = json.dumps( {

  "jql": "issuetype in (Bug,Defect) AND CreatedDate >= 2021\\u002f01\\u002f01",
  "maxResults": 1,
  "fields": [
   "summary",
   "assignee",
   "reporter",
   "status",
   "resolution", # Note the comma here
   "created",
   "updated"
  ],
  "startAt": 0
} )


text:
Q: mkdir not setting permissions correctly I am trying to make a directory that has the "set group ID on execution" set
in Python
In the shell:
$ mkdir --mode 2775 mail
$ ls -ld mail
drwxrwsr-x 1 john john 0 May  3 08:34 mail
      ^

In Python I am using pathlib.Path.mkdir, and it seems there some bits for mode are not taken into account,
even when the umask is cleared:
from pathlib import Path
import os

os.umask(0)
md = Path('mail')
md.mkdir(mode=0o2775)

drwxrwxr-x 1 john john 0 May  3 08:35 mail
       ^

Is there some cut-off at nine bits that is not documented

A: Ultimately, on non-Windows systems, Path.mkdir calls os.mkdir which in turn invokes the C system call mkdirat. That call's behavior is defined in terms of mkdir, which, on Linux, documents the mode with:

The argument mode specifies the permissions to use. It is modified by the process's umask in the usual way: the permissions of the created directory are (mode & ~umask & 0777)

Note that the permissions explicitly mask off all bits above 0777; this is just how mkdir system calls behave on some OSes. You'll just have to chmod it after the fact.

A: pathlib's mkdir essentially just calls os.mkdir(). The documentation there includes the section:

On some systems, mode is ignored. Where it is used, the current umask value is first masked out. If bits other than the last 9 (i.e. the last 3 digits of the octal representation of the mode) are set, their meaning is platform-dependent. On some platforms, they are ignored and you should call chmod() explicitly to set them.

So only the last 9 bits are guaranteed to be used.
You'll have to do (no need to set umask):
md.mkdir()
md.chmod(0o2775)

It would be better if pathlib would not silently ignore extra bits, but actually threw a ValueError.


text:
Q: Change style and binding in Angular 2 i am a newbie in Angular 2, so i am studing it and make some prove.
I am trying to create a simple component and make some dynamic issues.
So this is my component:
import {Directive, Component, Input, ElementRef} from '@angular/core';

@Component({
    selector: 'textboxcomponent',

    template: require('./textboxparameter.component.html'),
})

export class TextBoxComponent
{
    @Input() labeltext: string;
    @Input() placeholdertext: string;
    @Input() enabletext: boolean;

    //constructor() {
    //    this.enabletext= false;
    //}
}

and the associate template:

     {{labeltext}}
    <input class="form-control" id="surname" type="text" required autofocus
           placeholder={{placeholdertext}}
           [style.background-color]="enabletext ? 'green': 'red'"/>

So, if I make a value of "enabletext" in the constructor all works fine. Good.
Now i am trying to make a step forward and use the component outside, so created this:
import { Component } from '@angular/core';

@Component({
    selector: 'home',
    template: require('./home.component.html')
})
export class HomeComponent {
}

and in its template i am using the previus component:
<textboxcomponent labeltext="Surname"  enabletext="false" placeholdertext="placeholder example"></textboxcomponent>

So the "placeholder" and "labeltext" works fine, ma not the enabletext, the component is not changing its style whatever value of boolean variable.
What i am missing?
Next step is to create a boolean variable in the homecomponent so i will change the style of textcomponent as i wish in this manner
<textboxcomponent labeltext="Surname"  enabletext="homeEnabled"
placeholdertext="placeholder example"></textboxcomponent>

How will i do it?
Thanks to all

A:

     {{labeltext}}
    <input class="form-control" id="surname" type="text" required autofocus
           placeholder={{placeholdertext}}
           [style.background]="enabletext ? 'green': 'red'"/>


text:
Q: visual studio cant see new project from existing code I cant see this command in file menu. File->New->Project from existing files ...
there isnt it.
how can i customise visual studio to see it ?
thanks for help

A: I presume you have Visual Studio 2010 professionnal and above...
I see two options to bring back that menu!

*

*Reset your settings

*Customize the File menu to add up the missing command (See To add a command to a menu or oolbar.

A: To make a project from existing source files: if you do not have a project for them yet you need to first make a new project. This will automatically make a ProjectName.CS file; you can simply delete this file in the Solution Explorer. Then right-click on the project folder, and choose "Add...." -> "Existing item", and choose the file or files you already have.

A: To add an existing project to your solution, right click on the solution in the solution explorer, select Add -> Existing Project....
If this isn't what you are asking, please clarify your question. What exactly are you trying to do?


text:
Q: Creating a composite Primary Key with a unique string and sequential, corresponding number I am new to Hibernate, and am struggling with a way to create a composite Primary Key that uses both a unique string an auto-incrementing (sequentially, according to the unique string) long. I have found some resources here and here, but am still having trouble.
I am using Java 8, Hibernate 5, Spring Boot 1.5, and Spring JDBC 5 and MySQL connector 6, with MySQL 5.7
Problem
I am trying to create an Primary Key for an entity that maps to a ticketing table. I want the Primary Key to be something like PROJ-1 which I have seen in a lot of places and I like the convention.
Ideally, I would like there to be two parts to the PK. I want a unique, project code like PROJ and a ticket number that increments with that project code, each ticket should be sequential: PROJ-1 PROJ-2 PROJ-3 but if I make another project code like TICK then it should start from one: TICK-1 TICK-2 and so on. Instead of having entries like PROJ-1 PROJ-2 PROJ-3 TICK-4 and TICK-5.
I am not sure how to accomplish this with hibernate.
The code I have so far is this.
Entity
UPDATE 2 Made the generated TicketIdentifier unique.
@Entity
@Table(name = "support_ticket")
public class SupportTicket implements Serializable {
    private TicketIdentifier id;
    ... other irrelevant properties

    @EmbeddedId
    @AttributeOverride(name = "id", column = @Column(unique = true, nullable = false))
    public TicketIdentifier getId() {
        return id;
    }

    public void setId(TicketIdentifier id) {
      this.id = id;
    }

    ... other irrelevant getters and setters
}

Embeddable Class
UPDATE Changed ticket number to a non-unique value, per the comments.
UPDATE 2 Made project non-unique, and did it from the ticket-side
@Embeddable
public class TicketIdentifier implements Serializable {
    String projectId;
    Long ticketNum;

    public TicketIdentifier() {}

    public TicketIdentifier(String projectId) {
        this.projectId = projectId;
    }

    @Column(name = "project", nullable = false, length = 10)
    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Column(name = "ticket", nullable = false)
    public Long getTicketNum() {
        return ticketNum;
    }

    public void setTicketNum(Long ticketNum) {
        this.ticketNum = ticketNum;
    }
    ... implementing of hashcode and equals
}

Table DDL
CREATE TABLE support_ticket
(
  project         VARCHAR(10)  NOT NULL,
  ticket          BIGINT       NOT NULL,
  ... irrelevant stuff
  PRIMARY KEY (project, ticket),
  CONSTRAINT UK_6qwbkx66syjgp0jcxn16vkqkd
)

But as you can see the ticket is merely a bigint instead of looking more like bigint auto_increment not sure what I am doing wrong here. This is very close to what I think I would like. Except the ticket should auto-increment (as detailed in the "problem" section), and I don't know how (or if this is the right place) to put a dash between the project and ticket column combination.
Additionally, in the below screenshot, I am also unable to do two things: automatically increment the value of ticket and, re-use the same project code. I can see in the DDL that the latter is because project has to be unique, but I want it to be a unique combination only.

UPDATE
I was able to get the combination unique (I think), but am still unable automatically increment the value of ticket the way I want.
Any suggestions on how to do this in Java and/or Hibernate combos would be much appreciated. Thank you ahead of time!

A: One way to achieve this is to use a custom generation strategy for your primary key. (Note that @GeneratedValue can only be used with @Id annotation)
To implement a custom generation strategy you need to create a class that implements the IdentifierGenerator interface or extends one of the existing generators, for example, SequenceStyleGenerator. Then you can define it using @GenericGenerator annotation:
@Id
@Column(name = "ticket", nullable = false, insertable = false, updatable = false)
@GenericGenerator(
    name = "custom-sequence",
    strategy = "your.package.CustomGenerator"
)
@GeneratedValue(generator = "custom-sequence")
public String getTicketNum() {
    return ticketNum;
}

To demonstrate by example, I've modified your SupportTicket entity in the following way:
@Entity
@Table(name = "support_ticket")
public class SupportTicket implements Serializable {

    private String projectId;
    private String ticketNum;

    public SupportTicket() {
    }

    public SupportTicket(String projectId) {
        this.projectId = projectId;
    }

    @Column(name = "project", unique = true, nullable = false, length = 10)
    public String getProjectId() {
        return projectId;
    }

    public void setProjectId(String projectId) {
        this.projectId = projectId;
    }

    @Id
    @Column(name = "ticket", nullable = false, insertable = false, updatable = false)
    @GenericGenerator(
            name = "custom-sequence",
            strategy = "your.package.CustomGenerator"
    )
    @GeneratedValue(generator = "custom-sequence")
    public String getTicketNum() {
        return ticketNum;
    }

    public void setTicketNum(String ticketNum) {
        this.ticketNum = ticketNum;
    }
}

The ticket column now is a primary key that will hold values like PROJ-1 and TICK-1 generated by the CustomGenerator. So I've changed the column type to VARCHAR.
The last step is to implement the CustomGenerator. As you are using MySQL, and it doesn't have sequences, you have to emulate them.
public class CustomGenerator implements IdentifierGenerator {

    @Override
    public synchronized Serializable generate(SessionImplementor session, Object obj) {
        if (obj instanceof SupportTicket) {
            String sequenceName = ((SupportTicket) obj).getProjectId();
            Serializable result = null;
            try {
                Connection c = session.connection();
                Statement s = c.createStatement();
                s.execute("CREATE TABLE IF NOT EXISTS sequences\n" +
                        "     (\n" +
                        "         name VARCHAR(70) NOT NULL UNIQUE,\n" +
                        "         next INT NOT NULL\n" +
                        "     );");
                s.execute("INSERT INTO sequences (name, next)\n" +
                        "VALUES ('" + sequenceName + "', @current := 1)\n" +
                        "ON DUPLICATE KEY UPDATE \n" +
                        "next = @current := next + 1");
                ResultSet resultSet = s.executeQuery("SELECT @current");
                if (resultSet.next()) {
                    int nextValue = resultSet.getInt(1);
                    result = sequenceName + "-" + nextValue;
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
            return result;
        } else {
            return null;
        }
    }
}

This custom generator will create a sequences table where each row corresponds to a specific projectId and use it to increment the ticketNum field.
UPDATE: It is also possible to create an entity for the sequences table and use the hibernate session to manage it:
@Override
public synchronized Serializable generate(SessionImplementor session, Object obj) {
    if (obj instanceof SupportTicket) {
        Session s = (Session) session;
        String sequenceName = ((SupportTicket) obj).getProjectId();
        Sequences sequences = (Sequences) s.get(Sequences.class, sequenceName);
        long next = 1;
        if (sequences == null) {
            sequences = new Sequences(sequenceName, next);
        } else {
            next = sequences.getNext() + 1;
            sequences.setNext(next);
        }
        s.saveOrUpdate(sequences);
        return sequenceName + "-" + next;
    } else {
        return null;
    }
}

Don't forget to add spring.jpa.properties.hibernate.hbm2ddl.auto=update to your properties to force hibernate to create a new table if it doesn't exist.


text:
Q: How to change jquery mobile a href button image? Basically jquery mobile button is a normal rectangular shape,I want to change to use my own image to replace it.Got any refer on this topic?Below code is wrong example but can take as refer what i want.
example will shown normal button:

i try demo to replace it:
(HTML)

(CSS)
/*button background and borders color */
a[data-theme="app-ios"] {
border: none;
width:80px;
}
a[data-theme="app-ios"] .ui-btn-corner-all {
border: none;
background:url('images/back.png') no-repeat 15px;
/*background:red;*/
border-radius:0;
overflow: visible;
padding-left: 8px !important;
padding-right: 8px !important;
}

/* shadows and label color */
a[data-theme="app-ios"].ui-shadow,
a[data-theme="app-ios"] {
box-shadow: none; -moz-box-shadow: none; -webkit-box-shadow: none;
background-clip: none; -webkit-background-clip: none; -moz-background-clip: none;
color: white;
font-weight: bold;
top: 5px;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(0,0,0, 0.4);
}

A: Try This-Change the class ui-btn-corner-all into
.ui-btn-corner-all {
    -moz-border-radius:    5px
    -webkit-border-radius: 5px
    border-radius:         5px
}

A: You can just add a class to it and style the class...
HTML:
Button

CSS:
.button { color: #f0f; }


text:
Q: Reasons for these two past perfect tenses
I had once vowed that I would never call her aunt again: I thought
  it no sin to forget and break that vow now.  My fingers had
  fastened on her hand which lay outside the sheet: had she pressed
  mine kindly, I should at that moment have experienced true pleasure.
  But unimpressionable natures are not so soon softened, nor are natural
  antipathies so readily eradicated.  Mrs. Reed took her hand away, and,
  turning her face rather from me, she remarked that the night was warm.
  (Jane Eyre)

Are the two past perfect because of the past tenses below, or because of some other reasons?
(Past tense)--------------------(the past of the Past tense)
I thought it no sin-------------I had once vowed
Mrs. Reed took her hand away----My fingers had fastened

A: I think you've got it. The Reference time (narrative time) here is the sequence of moments marked with the past tense. The past perfects mark their events as occurring before the corresponding past moments:

                      NARRATIVE TIME
  I had once vowed           before    I thought it no sin ... now
  My fingers had fastened      before   [her hand] lay outside the sheet✲
[a counterfactual and
  a general observation, and then]         Mrs. Reed took her hand away, and ... remarked

✲Actually, her hand may be presumed to have lain outside the sheet before Jane took it ... but in the sentence what is relevant is that it lies there in Reference time.


text:
Q: Get RTMP uri to Youtube LiveStream video Can I get RTMP uri of Youtube live-stream using live-stream ID with Youtube Data API v3? For example, for this channel: https://www.youtube.com/watch?v=4YKR-rEwOr8
When I try to do this using "try" page https://developers.google.com/youtube/v3/live/docs/liveStreams/list (part = "status,cdn", id = "4YKR-rEwOr8") I got empty list:
200 OK

- Hide headers -

Cache-Control:  private, max-age=0, must-revalidate, no-transform
Content-Encoding:  gzip
Content-Length:  183
Content-Type:  application/json; charset=UTF-8
Date:  Mon, 27 Oct 2014 11:10:54 GMT
Etag:  "PSjn-HSKiX6orvNhGZvglLI2lvk/HzQflIssFHeC_PS9MZIweemMYZg"
Expires:  Mon, 27 Oct 2014 11:10:54 GMT
Server:  GSE

{
"kind": "youtube#liveStreamListResponse",
"etag": "\"PSjn-HSKiX6orvNhGZvglLI2lvk/HzQflIssFHeC_PS9MZIweemMYZg\"",
"pageInfo": {
"totalResults": 0,
"resultsPerPage": 0
},
"items": [
]
}

What I do wrong? I really don't understand.


text:
Q: How to display images from S3 bucket using Xcode 7? I am using an Amazon S3 bucket to save images and it was working fine in Xcode 6 but after upgrading to Xcode 7 the app is not displaying the images. But when I enabled the NSAppTransportSecurity security and it is working fine.
How can I get it to work without app transport security?

A: You need to either add an exception for the server hosting your images, or allow all arbitrary loads to your app's plist file.  NSAppTransportSecurity is required for iOS 9 and above.
Exception:
<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>download.yourServer.com.s3.amazonaws.com</key>
    <dict>
      <!--Include to allow subdomains-->
      <key>NSIncludesSubdomains</key>
      <true/>
      <!--Include to allow HTTP requests-->
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
      <true/>
      <!--Include to specify minimum TLS version-->
      <key>NSTemporaryExceptionMinimumTLSVersion</key>
      <string>TLSv1.1</string>
    </dict>
  </dict>
</dict>

Allow all connections:
<key>NSAppTransportSecurity</key>
<dict>
  <!--Include to allow all connections (DANGER)-->
  <key>NSAllowsArbitraryLoads</key>
      <true/>
</dict>


text:
Q: MySQL order by multiple columns ignoring last order by directive When using the following query:
SELECT id, rater_id, product_id, is_valid
FROM `ratings`
WHERE (`ratings`.element_id = 3151)
ORDER BY id DESC, product_id DESC, is_valid ASC;

i would expect that the result set will first be sorted by id first, then by product_id and then by is_valid.
what actually happens is that the result set is indeed ordered, but the is_valid column in the results appears to be sorted by DESC, not by ASC. tried using both ASC and DESC but the result set stays the same.
+------------------+--------------+------+-----+---------+----------------+
| Field            | Type         | Null | Key | Default | Extra          |
+------------------+--------------+------+-----+---------+----------------+
| id               | int(11)      | NO   | PRI | NULL    | auto_increment |
| user_id          | int(11)      | NO   | MUL | NULL    |                |
| product_id       | int(11)      | YES  | MUL | NULL    |                |
| value            | tinyint(4)   | YES  | MUL | NULL    |                |
| rater_id         | int(11)      | YES  |     | NULL    |                |
| comment          | varchar(350) | YES  |     | NULL    |                |
| created_at       | datetime     | YES  |     | NULL    |                |
| updated_at       | datetime     | YES  |     | NULL    |                |
| element_id       | int(11)      | YES  | MUL | NULL    |                |
| is_valid         | tinyint(1)   | YES  | MUL | 0       |                |
+------------------+--------------+------+-----+---------+----------------+

A: The id field is an [unique auto incremental] primary key. This means that regardless of the values product_id and is_valid has, the order of id will render the other two ordering rules useless.
What I think is that you probably don't understand that the ORDER BY clause works as a nested ordering and not as an independent ordering of the values of the columns.


text:
Q: Segmentation fault ruby 1.8.7 on db migrate in rails On this command RAILS_ENV=production bundle exec rake db:migrate
I'm getting this error :
 [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

I thought of trying this but the command won't execute as it doesn't know what is rvm:
rvm gemset empty
rvm use 1.9.2@skateparks
gem install bundler
bundle install

A: Make sure that RVM really works, in your ~/.bash_profile should be line like this:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

If it's not there, install it, basically this command is enough:
$ \curl -L https://get.rvm.io | bash -s stable --ruby

You shouldn't install RVM under root account, unless you know what you're doing. See https://rvm.io/rvm/install/ for more info.
For deployment is good idea to use capistrano.


text:
Q: How to get %~dp0 in long name format On Windows 10, I have created the following folder:
C:\BigLongFolderName

If I run the following test.bat from Windows Explorer with "Run as Administrator" on the right-click context menu from within the above folder, I get a shortened 8.3 folder name.
test.bat
echo "%~dp0"
echo %~dp0

Output:
C:\windows\system32>echo "C:\BIGLON~1\"
"C:\BIGLON~1\"

C:\windows\system32>echo C:\BIGLON~1\
C:\BIGLON~1\

How do I get the long folder name in Windows 10 when using "Run as Administrator"?
The output I want to see is C:\BigLongFolderName\
I do literally have a folder called C:\BigLongFolderName on my machine.
If I run the same test.bat by double-clicking on it (instead of "Run as Administrator") then I am echoed the full C:\BigLongFolderName path as I would expect. Why does "Run as Administrator" not give me the long path?
I moved this question from Stackoverflow as "its not a programming question".
The following post suggests that I should be getting long name format by default and indeed my 2 of my collegues do:
https://stackoverflow.com/questions/15567809/batch-extract-path-and-filename-from-a-variable
Please note that I not want to convert 8.3 names into long names. I want the long names to be returned sames as other people are getting.

A: Disable 8.3 file names. You'll need to rename existing folders to clean up the existing 8.3 filename entries. There may be a tool to clean these up automatically, but I'm not sure. (fsutil file setshortname C:\BigFolderName "" may work.)


text:
Q: sequelize.js custom validator, check for unique username / password Imagine I have defined the following custom validator function:
isUnique: function () { // This works as expected
  throw new Error({error:[{message:'Email address already in use!'}]});
}

However, when I attempt to query the DB I run into problems:
isUnique: function (email) { // This doesn't work
  var User = seqeulize.import('/path/to/user/model');

  User.find({where:{email: email}})
    .success(function () { // This gets called
      throw new Error({error:[{message:'Email address already in use!'}]});  // But this isn't triggering a validation error.
    });
}

How can I query the ORM in a custom validator and trigger a validation error based on the response from the ORM?

A: Success callback is called even if no user is found. You have to check if the function passes a user as an argument:
isUnique: function (email) {
  var User = seqeulize.import('/path/to/user/model');

  User.find({where:{email: email}})
    .success(function (u) { // This gets called
      if(u){
        throw new Error({error:[{message:'Email address already in use!'}]});  // But this isn't triggering a validation error.
      }
    });
}

A: You can verify if the email already exists like that:
email: {
  type: Sequelize.STRING,
  allowNull: false,
  validate: {
    isEmail:true
  },
  unique: {
      args: true,
      msg: 'Email address already in use!'
  }
}

A: Here's a simplified sample of a functioning isUnique validation callback (works as of SequelizeJS v2.0.0). I added comments to explain the important bits:
var UserModel = sequelize.define('User', {

    id: {
        type: Sequelize.INTEGER(11).UNSIGNED,
        autoIncrement: true,
        primaryKey: true
    },
    email: {
        type: Sequelize.STRING,
        validate: {
            isUnique: function(value, next) {

                UserModel.find({
                    where: {email: value},
                    attributes: ['id']
                })
                    .done(function(error, user) {

                        if (error)
                            // Some unexpected error occured with the find method.
                            return next(error);

                        if (user)
                            // We found a user with this email address.
                            // Pass the error to the next method.
                            return next('Email address already in use!');

                        // If we got this far, the email address hasn't been used yet.
                        // Call next with no arguments when validation is successful.
                        next();

                    });

            }
        }
    }

});

module.exports = UserModel;

A: With Sequelize 2.0, you need to catch Validation Errors.
First, define the User Model with a custom validator:
var User = sequelize.define('User',
    {
        email: {
            type: Sequelize.STRING,
            allowNull: false,
            unique: true,
            validate: {
                isUnique: function (value, next) {
                    var self = this;
                    User.find({where: {email: value}})
                        .then(function (user) {
                            // reject if a different user wants to use the same email
                            if (user && self.id !== user.id) {
                                return next('Email already in use!');
                            }
                            return next();
                        })
                        .catch(function (err) {
                            return next(err);
                        });
                }
            }
        },
        other_field: Sequelize.STRING
    });

module.exports = User;

Then, in the controller, catch any Validation Errors:
var Sequelize = require('sequelize'),
    _ = require('lodash'),
    User = require('./path/to/User.model');

exports.create = function (req, res) {
    var allowedKeys = ['email', 'other_field'];
    var attributes = _.pick(req.body, allowedKeys);
    User.create(attributes)
        .then(function (user) {
            res.json(user);
        })
        .catch(Sequelize.ValidationError, function (err) {
            // respond with validation errors
            return res.status(422).send(err.errors);
        })
        .catch(function (err) {
            // every other error
            return res.status(400).send({
                message: err.message
            });
        });

A: Define the User Model with a custom validator:
const { DataTypes } = require('sequelize');
const sequelize = require('../config/db');

const UserModel = sequelize.define('user', {
  id: {
    type: DataTypes.INTEGER(11).UNSIGNED,
    autoIncrement: true,
    primaryKey: true,
  },
  name: {
    type: DataTypes.STRING,
    allowNull: false,
  },
  email: {
    type: DataTypes.STRING,
    allowNull: false,
    validate: {
      isUnique: (value, next) => {
        UserModel.findAll({
          where: { email: value },
          attributes: ['id'],
        })
          .then((user) => {
            if (user.length != 0)
              next(new Error('Email address already in use!'));
            next();
          })
          .catch((onError) => console.log(onError));
      },
    },
  },
  password: {
    type: DataTypes.STRING,
    allowNull: false,
  },
  createdAt: {
    type: DataTypes.DATE,
    allowNull: false,
  },
  updatedAt: {
    type: DataTypes.DATE,
    allowNull: false,
  },
});

module.exports = UserModel;


text:
Q: Standard errors for non-linear least squares in R I have a question on standard errors for non-linear least squares in R. With the built-in function NLS and a hand-made function I get different SE and I don't understand why. I will try to expose below a simpler and replicable example of my original problem.
I want to estimate the mean $\mu$ and the standard deviation $\sigma$ of a normal cumulative distribution function.
Let's simulate the data for this example in R:
set.seed(12)
mu <- 5
sigma <- 2
x <- runif(100, min = 0, max = 10)
y <- pnorm(x + rnorm(1), mu, sigma)
df <- data.frame(y,var1)

I assume a true value for $\mu$ of 5 and 2 for $\sigma$. I add a normal noise to y which is a cdf of x.
I first fit a non-linear least squares with the built-in function NLS:
res1 <- nls(y ~ pnorm(x, mean = mu, sd = sigma),
            data = df, start = c(mu = 1,sigma = 1), algorithm = "port")
summary(res1)

I get the following result that I was expected
Formula: y ~ pnorm(x, mean = mu, sd = sigma)

Parameters:
                    Estimate             Std. Error            t value
mu    5.04268491217399539295 0.00000000000000003347 150682292747528064
sigma 2.00000000000000000000 0.00000000000000004567  43795073347627272
                 Pr(>|t|)
mu    <0.0000000000000002 ***
sigma <0.0000000000000002 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.00000000000000003995 on 98 degrees of freedom

Algorithm "port", convergence message: X-convergence (3)

Secondly, I tried my own LS estimation
f <- function(par){
  mu = par[1]
  sigma = par[2]
  temp <- pnorm(df$x, mean = mu, sd = sigma)
  sum1 <- sum((df$y-temp)^2)
  return(sum1)
}

res2 <- optim(c(1,1),f,method = "L-BFGS-B",
              lower=c(0,0), upper = c(100,100), hessian = TRUE)
print(res2)

I get similar result for the coefficients:
$par
[1] 5.042685 1.999999

$value
[1] 0.000000000001761186

$counts
function gradient
      20       20

$convergence
[1] 0

$message
[1] "CONVERGENCE: REL_REDUCTION_OF_F <= FACTR*EPSMCH"

$hessian
           [,1]       [,2]
[1,]  2.8835336 -0.2273554
[2,] -0.2273554  1.5485147

But when I compute the Standard Errors, I don't get the same result with the NLS:
sqrt(diag(res2$hessian))
[1] 1.698097 1.244393

Does someone know why ?
Thank you !
Alexis

A: I am almost certain that you are running into the same problem as here.
The thing is that optim is agnostic of any kind of least squares modeling, so you just get the pure hessian out. The std error has been scaled in nls.


text:
Q: How to add custome/ java annotation in jdl JHipster Domain Language With this code
entity Person {
   id   String
   name String
   post String
}

It will give me like
@Id
private String id;

@Field("name")
private String name;
@Field("post")
private String post;

but i want like
@Id
private String id;

@Field("name")
@Indexed(name = "name",unique = true)
private String name;
@Field("post")
private String post;

And this thing i have to do automatically, while importing jdl it should created automatically.
How can i do that?
I read about custome annotation in jhipster but not getting how should i implement it.

A: You can do this with the validator of jdl, in your case unique.
like this:
entity Person {
   id   String,
   name String unique,
   post String
}


text:
Q: Book about a magical castle powered by a spinning crystal I read this book a long time ago. Only remember bits.

*

*Magical castle with a spinning crystal that powers it

*A fight happened that cause the spinning crystal to start a slight wobble

*Main character had a ring that he could detect any person within the castle and could also activate the magical drawbridge


text:
Q: How to generate language fragment bundles to localize Carbon products In the blog How to generate language fragment bundles to localize Carbon products by Tanya Madurapperuma, I am having the following problem. Once generated the language bundles with ant localize command, these bundles are generated in the CARBON_HOME/repository/components/dropins/ folder. The problem is that when I run the tool I'm not looking to change the language to Spanish. I would appreciate help to correct what I may be missing to do?
Note: All resources.properties files are translated into Spanish.

A: If you have the jars with translated resources.properties files in you dropins folder, you need to restart the server and set the Locale setting of your browser to Spanish.
Locale should be changed in the browser, and then the server will pick the matching resources files to use.
UPDATE:
There are some problems here.
First, there's a bug if you have multiple directories in /resources directory. For now, you can make sure that you have only one directory inside resources directory when you run localize task.
You should have the properties files inside a directory with the bundle name, without the tree structure. So your resources directory should look like this.
../resources/
└── org.wso2.carbon.i18n_4.2.0
    ├── JSResources_es.properties
    └── Resources_es.properties

You need to include the locale code as _es in your files as shown above.
Also the localize tool seems to append i18n at the end of the folder structure of the built jar. This works with ui bundles but in the case of org.wso2.carbon.i18n it looks as org/wso2/carbon/i18n/i18n. So open the built jar in dropins folder and remove the extra i18n folder so that the jar tree structure looks like following.
../repository/components/dropins/org.wso2.carbon.i18n.languageBundle_4.2.0.jar
├── META-INF
│   └── MANIFEST.MF
└── org
    └── wso2
        └── carbon
            └── i18n
                ├── JSResources_es.properties
                └── Resources_es.properties

A: Did you get this to work?
The place I doubt that you might have gone wrong is the folder structure in the resources folder. (You can place your resource files anywhere and execute command as ant localize -Dresources.directory=path_to_your_resources_directory)
Also note that a resource folder should have the proper naming conventions of the osgi bundle.
Ex: org.wso2.carbon.claim.mgt.ui_4.2.0 (This entire thing is name of the folder)
If you still couldn't get this to work mail me your resources folder to tanyamadurapperuma@gmail.com


text:
Q: Can I merge archived maildir "inbox" and "sent" folders to get a usable threaded folder with both? Apologies if this is a bit vague but I have two large files from an ancient email backup, that has a "email" file with all the emails as a giant text file, and then a "sent" file with all the outgoing emails I've sent.  By simply dragging and dropping them into a folder in my Thunderbird client, I've been able to (as if by magic!) see them all sort into nice individual emails that I can filter through by subject, sender, recipient, and so on, but to see my replies I have to switch to a different folder and hunt for the reply over there.
Is there a method to combine these two separate files such that an email thread's info will be present and I can see what was replied to and from?
Thank you for any thoughts.  I suspect that if I were to simply merge the two files I'd be able to have it sortable by date, but I'd love to have it even more linked if possible.
Again, thank you!
(I'm running Lubuntu 20.04LTS, if it matters, and Thunderbird 78.)

A:
I have two large files from an ancient email backup, that has a "email" file with all the emails as a giant text file, and then a "sent" file with all the outgoing emails I've sent. By simply dragging and dropping them into a folder in my Thunderbird client, I've been able to

This sounds like a mbox mail folder traditional in Unix mail systems. It was actually also the storage format used by Thunderbird until a few versions ago.

Is there a method to combine these two separate files such that an email thread's info will be present and I can see what was replied to and from?

Drag and drop all your messages into a single folder within Thunderbird. Thread information is stored as part of the message's internal metadata – most mail clients thread messages according to their Message-Id:, References:, and In-Reply-To: headers; those are preserved when moving the message around.
(In some cases, often with IMAP folders, Thunderbird might refuse to thread a conversation because it has bad information cached in its "summary" files (Inbox.msf, etc) – using "Repair" would fix that.)
It should also be possible to just concatenate the two mbox files together, as they're already just a series of messages (each prefixed with a From abc@def header as the delimiter).


text:
Q: PHPStorm less watcher - importing less files not sitting in a child directory I want to trigger main.less compilation when i change sub.less. 'Track only root files' is on.
main.less (imports samelevel.less and sub.less)
samelevel.less
subdir/sub.less
When i change sonething in sub.less, main.less won't be compiled. When i change something in samelevel.less, main.less will be compiled.
How do i set this up?
Edit:
above was simplified and misleading, here my actual dir structure:
root/less/main.less
root/less/samelevel.less
root/subdir1/subdir2/sub.less
In main.less i do: @import "..\subdir1\subdir2\sub.less";
Edit2:
My goal is to automatically compile all less files via main.less > main.css. Currently i only achieve this when i change a less file inside root/less/.


text:
Q: How to hide svchost.exe (dos prompt) when executing a scheduled task in Windows I created a java program that will pop up a dialog, and scheduled it as a task. Everything works fine except when the scheduled java program runs and the dialog pops up, there is another window (svchost.exe) hanging behind the dialog box and doesn't go anywhere until the java program finishes its execution. The program is running in Windows XP.
How can I avoid that dos prompt?
Thanks

A: One word of warning (posting as an answer so I can get fancy links and for length): Services which pop up UI are basically security holes waiting to be exploited (search for "shatter attack" for more information).  That's why in Windows Vista and beyond services cannot display UI on the desktop (services run in session 0, the interactive user runs in session 1).
More importantly, there are several scenarios in Windows XP where your application will fail to work:  If there are multiple users on the computer logged on at once (fast user switching) or if the machine is a server 2003 machine running with the terminal server role your UI won't pop up in the interactive user's session.
This article talks about the session 0 isolation issue and how to work around it.

A: If you want your Java program to have no console window, you need to launch Java using javaw, not java.

A: Create a shortcut for the thing you want to schedule.  In the shortcut's properties dialog, Select Run Minimized in the shortcut tab.  When scheduling this shortcut, make sure you refer to the shortcut, it ends in .lnk  Browsing for it may bypass the shortcut for what the shortcut points to.  Source: http://ask.metafilter.com/18994/Windows-Batch-File-Run-Minimized


text:
Q: Deploy Metadata with Apex Testing Using REST : No package.xml found I have explored below two options to deploy metadata into my salesforce account.
Option 1:
Bundle zip file is available here: bundle zip
I am able to upload the bundle zip using workbench Workbench with API version 54.0
This is working fine.
Option 2: This option is not working for me. Trying to upload the same using Rest API listed in Metadata API Developer Guide.
My zip file structure

I have generated base 64 encoded string using this online tool
Base 64 encoded string is here: base64 string.
Now my postman invocation is like this:
url: https://krishna52-dev-ed.my.salesforce.com/services/data/v54.0/metadata/deployRequest
headers:
Authorization:Bearer {{token}}
Content-Type:multipart/form-data; boundary=--------------------------BOUNDARY

Raw body:
----------------------------BOUNDARY
Content-Disposition: form-data; name="entity_content"
Content-Type: application/json

{
  "deployOptions": {
    "allowMissingFiles": true,
    "autoUpdatePackage": false,
    "checkOnly": false,
    "ignoreWarnings": true,
    "performRetrieve": false,
    "purgeOnDelete": false,
    "rollbackOnError": true,
    "singlePackage": true,
    "testLevel": "NoTestRun"
  }
}
----------------------------BOUNDARY
Content-Disposition: form-data; name="file";filename="simple2.zip"
Content-Type: application/zip

<Base 64 encoded string>

----------------------------BOUNDARY--

Response:

201 Created, Deployment Id also returned.

When I check the status of this deployment in salesforce application or from postman, I am always getting

component failure "No package.xml found".

"id": "0Af5g00000nAIO0",
.........
.........
"componentFailures": [
{
    "componentType": "",
    "fileName": "package.xml",
    "fullName": "package.xml",
    "id": null,
    "problem": "No package.xml found"
    .......
} ]

Do I have to enable any permissions for my account to perform this Rest operation ? If that is the case, I should get different error saying unauthorized.
But I am able hit API and track the deployment statuses from deployment pages of salesforce application.
In option 2, what else is missing? I have gone through existing Q&A links, but even after followed those steps, I am getting same problem.
With this new Q&A thread, I really wish to have sequence of steps to get my option 2 works.
Request you to verify the steps I am performing and help me in this regard.
I really appreciate yours' expertise here.


text:
Q: Consuming WCF service in android I've created this service (using WCF, Azure):
[ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)]
public class Service1 : IPMPService
{
    public int Dummy()
    {
        return 0;
    }
}

Where IPMPService is:
[ServiceContract]
public interface IPMPService
{
    [WebGet()]
    [OperationContract]
    int Dummy();
}

And attempted to consume it in my android app:
1st attempt:
String METHOD_NAME = "DummyRequest";
String NAMESPACE = "http://tempuri.org/";
String URL = "http://tyty.cloudapp.net/Service1.svc";
String SOAP_ACTION = "http://tyty.cloudapp.net/Service1.svc/Dummy";

String res = "";
try {
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
    androidHttpTransport.call(SOAP_ACTION, envelope);
    SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
    // to get the data
    String resultData = result.toString();
    res = resultData;
    // 0 is the first object of data
    } catch (Exception e) {
        res = e.getMessage();
    }

result: SoapFault - faultcode: 'a:ActionNotSupported' faultstring: 'The message with Action 'http://tyty.cloudapp.net/Service1.svc/Dummy' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).' faultactor: 'null' detail: null
2nd attempt (taken from here):
String SERVER_HOST = "http://tyty.cloudapp.net";
int SERVER_PORT = 8080;
String URL1 = "/Service1.svc/Dummy";
String keywords = null;
HttpEntity entity = null;
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(URL1);
try {
HttpResponse response = client.execute(target, get);
entity = response.getEntity();
keywords = EntityUtils.toString(entity);
} catch (Exception e) {
e.printStackTrace();
   } finally {
if (entity != null)
        try {
        entity.consumeContent();
    } catch (IOException e) {
  }
}

Result: java.net.UnknownHostException: Unable to resolve host "http://tyty.cloudapp.net": No address associated with hostname
I've also created a (working) client in c#, here is its App.config:
<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IPMPService" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
            maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
            messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
            useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://tyty.cloudapp.net/Service1.svc"
          binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IPMPService"
          contract="IPMPService" name="BasicHttpBinding_IPMPService" />
    </client>
  </system.serviceModel>
</configuration>

As mentioned, both attempts in Android failed. Can anyone please tell me what I'm doing wrong, and how to do it right?
Thanks.

A: Your first attempt is pretty close. There are just two fixes needed:
String METHOD_NAME = "Dummy";
String NAMESPACE = "http://tempuri.org/";
String URL = "http://tyty.cloudapp.net/Service1.svc";
String SOAP_ACTION = "http://tempuri.org/IPMPService/Dummy";

String res = "";
try {
    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
    androidHttpTransport.call(SOAP_ACTION, envelope);
    SoapPrimitive result = (SoapPrimitive) envelope.getResponse();
    // to get the data
    String resultData = result.toString();
    res = resultData;
    // 0 is the first object of data
} catch (Exception e) {
    res = e.getMessage();
}

The first one is the method name: it just Dummy (instead of DummyRequest). The second is the SOAP action: it's http://tempuri.org/IPMPService/Dummy.
Both can be derived from the WSDL. Your operation is defined as:
<wsdl:operation name="Dummy">
    <wsdl:input wsaw:Action="http://tempuri.org/IPMPService/Dummy" message="tns:IPMPService_Dummy_InputMessage"/>
    <wsdl:output wsaw:Action="http://tempuri.org/IPMPService/DummyResponse" message="tns:IPMPService_Dummy_OutputMessage"/>
</wsdl:operation>

If you then look at the IPMPService_Dummy_InputMessage message type, the element is called Dummy:
<wsdl:message name="IPMPService_Dummy_InputMessage">
    <wsdl:part name="parameters" element="tns:Dummy"/>
</wsdl:message>

And the SOAP action is found here:
<wsdl:operation name="Dummy">
    <soap:operation soapAction="http://tempuri.org/IPMPService/Dummy" style="document"/>
    ...

A: public class RESTConnection extends Global
{

    Global objglobal=Global.getInstance();

    private static String SERVICE_URI = "your service path";

    public JSONObject GetCashierLogin(String UserName, String Password)
    {
        new ArrayList<String>();

        JSONObject jObj = null;
        try
        {

            SERVICE_URI=objglobal.getConnectionString();
            DefaultHttpClient httpClient = new DefaultHttpClient();
            HttpGet request = new HttpGet(SERVICE_URI+ "/LoginByUserIdAndPassword?Username=" + UserName + "&password=" + Password + "");
            request.setHeader("Accept", "application/json");
            request.setHeader("Content-type", "application/json");
            HttpResponse response = httpClient.execute(request);
            HttpEntity responseEntity = response.getEntity();
            String bufferLogin = EntityUtils.toString(responseEntity, HTTP.UTF_8);
            JSONArray jsonArray = new JSONArray(bufferLogin);

            if (jsonArray != null)
            {
                for (int i = 0; i < jsonArray.length(); i++)
                {
                    jObj=(JSONObject) jsonArray.get(i);

                }
            }

        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return jObj;
    }


text:
Q: Classic analog of quantum mechanics when dealing with Hamiltonian operator I am reading The Principles of Quantum Mechanics by Dirac, in chapter 28 Heisenberg's form for the equations of motion, there is a statement about the classic analog about the Hamiltion form between classic mechanics of and quantum mechanics. My questions are:

*

*If classic analog means that the Hamiltonian operator is the function of $q$ and $p$ (position and mom), then what is the premise of this assumption?

*Is there any example of a Hamiltonian that couldn't be expressed as the function of $q$ and $p$?

*There is a footnote saying that under Curvilinear coordinates, this assumption is NOT right, so I guess that under Curvilinear coordinates, the classic Hamiltonian form and quantum Hamiltonian form are NOT the same, is there an example of this situation? And why would this happen?

A: Quantization/dequantization is a huge topic, so we will only try to address OP's specific questions:

*

*See e.g. this related Phys.SE post.

*The simplest example is perhaps spin/internal angular momentum operators $\hat{S}_x,\hat{S}_y,\hat{S}_z$.

*Dirac is referring to operator ordering ambiguities, see e.g. this, this & this related Phys.SE posts.


text:
Q: Sending S3 file as attachment to WhatsApp with JavaScript Currently we upload JPEG/PDF files to a S3 bucket.
These files are then whatsapped to others when a button is clicked (where fileURL represents the file location on the S3 bucket):

*

*When button is clicked from web:

https://web.whatsapp.com/send?phone=${contactInfo.contactNumber}&text=${fileURL}

*

*When button is clicked from mobile:

whatsapp://send?phone=${contactInfo.contactNumber}&text=${fileURL}
Result: fileURL is shown as text addressed to the contactNumber:

The item is clickable when 'send' is pressed:

My question is if it's possible to embed the fileURL as an attachment instead of an URL?
The app is developed with React. Thank you for reading


text:
Q: $ABCD$ is a trapezium where $AB$ $||$ $CD$. Suppose $[\Delta BOC] = \frac{25}{9}$, and let $AB = b$, $CD = a$ where $a < b$.
$ABCD$ is a trapezium where $AB$ $||$ $CD$. Suppose $[\Delta BOC] = \frac{25}{9}$, and let $AB = b$, $CD = a$ where $a < b$. Find the value of $\frac{b}{a}$.

What I Tried: Here is a picture :-

I really have no idea on how to start this. I might proceed by giving variables to the side lengths and use similarity and area, but I am sure this will be length and quite complicated. There is as little information as possible, and I got no idea how to solve it.
Can anyone help me? Thank You.

A: This is not an answer
As observed in the comments the trapezoid is not unique. See the picture below

$$
...
$$


text:
Q: unable to understand what `sh !` does inside a Jenkins pipeline code I have a Jenkins pipeline code having
stages {
    stage('Monitoring logs') {
       steps {
          script {
              sh '! grep "wow" output.log
                 }
              }
          }
      }

Can someone please explain what does this part of the code do -> sh '! grep "wow" output.log' and what impact will it have if any on the execution or the status of the pipeline execution incase "wow" string is found in output.log?
I understand that grep "wow" output.log will search for "wow" string in output.log but i dont know what would sh '! grep "wow" output.log' do?

A: *

*grep "wow" output.log succeeds (exits 0) if output.log contains wow, and fails (exits non-0) otherwise.

*! negates the exit code (0 becomes 1; non-0 becomes 0).

*Jenkins' sh function runs a shell script and throws an exception, which will make the pipeline fail, on a non-0 exit code.*
Ergo the pipeline will fail if output.log contains wow.
* Through the use of the -e option.


text:
Q: Why is the optional binding not working This is a question about why my code is not working, not about how to do something, that's why I didn't provide you with a data, but if you want, i can give you, but the data will be my relatively small ontology.
this is my code
OPTIONAL
      {

    VALUES ?user { rs:ania }
        ?userContext  rdf:type       rs:UserContext ;
                  rs:appliedOnItems  ?itemClass ;
                  rs:appliedOnUsers  ?userClass .

        ?item  rdf:type  ?itemClass .

        OPTIONAL
          { ?userContext  rs:hasWeightIfContextMatched  ?weightMatched }
        OPTIONAL
          { ?userContext  rs:hasWeightIfContextDoesNotMatch  ?weightNotMatched }
        OPTIONAL
          { ?userContext  rs:doNotRecommendInCaseNotMatch  true
            BIND(1 AS ?skip_)
          }
      bind(if (bound(?skip_) && (not EXISTS {?user a ?userClass}) , ?skip_, 0) as ?skip1)

    values (?defaultUserMatched ?defaultUserNotMatched) {(1 0.5)}
        BIND(if(EXISTS { ?user  rdf:type  ?userClass }, coalesce(?weightMatched, ?defaultUserMatched), coalesce(?weightNotMatched, ?defaultUserNotMatched)) AS ?weight)

      }
    values ?defaultNoUserContext {1}
    BIND(if(bound(?skip1), ?skip1, 0) as ?skip)
    BIND(if(bound(?weight), ?weight, ?defaultNoUserContext) AS ?userContextWeight)

  }

this code is just a block in my real query, there is another block that brings the ?item variable.
as you see, my code has ?item  rdf:type  ?itemClass , but one of the bindings for ?item is not from the type of ?itemClass so the whole optional will not execute (for that binding), so when we go out of the optional, there is this line
BIND(if(bound(?weight), ?weight, ?defaultNoUserContext) AS ?userContextWeight)

the if part will give false so the ?userContextWeight should be bound to ?defaultNoUserContext. However, my code doesn't produce anything (any value at all) to these items . do you know why please?
again if you need data, i am more than welcome to give you, thanks
Update
Now I see better, what i want is:
even if the item doesn't belong to the ?itemClass, i need to give a default value for the ?userContextWeight.
look at the update
 OPTIONAL
      {
     VALUES ?user { rs:ania }

        ?userContext  rdf:type       rs:UserContext ;
                  rs:appliedOnItems  ?itemClass ;
                  rs:appliedOnUsers  ?userClass .

    bind (if (  exists {?item  rdf:type  ?itemClass .}, true , false) as ?doesItemBelongToUserContextItemClass)

    OPTIONAL
          { ?userContext  rs:hasWeightIfContextMatched  ?weightMatched }
        OPTIONAL
          { ?userContext  rs:hasWeightIfContextDoesNotMatch  ?weightNotMatched }
        OPTIONAL
          { ?userContext  rs:doNotRecommendInCaseNotMatch  true
            BIND(1 AS ?skip_)
          }
      bind(if (bound(?skip_) && (not EXISTS {?user a ?userClass}) , ?skip_, 0) as ?skip1)

    values (?defaultUserMatched ?defaultUserNotMatched) {(1 0.5)}
        BIND(if(EXISTS { ?user  rdf:type  ?userClass }, coalesce(?weightMatched, ?defaultUserMatched), coalesce(?weightNotMatched, ?defaultUserNotMatched)) AS ?weight)
      }
    values ?defaultNoUserContext {1}
    BIND(if(bound(?skip1), ?skip1, 0) as ?skip)

  BIND( if ( !?doesItemBelongToUserContextItemClass , ?defaultNoUserContext ,if(bound(?weight), ?weight, ?defaultNoUserContext)) AS ?userContextWeight)

  }

in the update, i check if the item belongs to the class or not using this bind
 bind (if (  exists {?item  rdf:type  ?itemClass .}, true , false) as ?doesItemBelongToUserContextItemClass)

and then outside the optional i do this
BIND( if ( !?doesItemBelongToUserContextItemClass , ?defaultNoUserContext ,if(bound(?weight), ?weight, ?defaultNoUserContext)) AS ?userContextWeight)

my problem is the value of ?userContextWeight when the item doesn't belong to the class is ?weightNotMatched, but it should be ?defaultNoUserContext (look again at the last binding please)
any idea please?
Update 2
by !?doesItemBelongToUserContextItemClass I mean the normal boolean not that we study in algebra, maybe here it is not the same as there? this could be the problem?
Update 3
I see that this
 bind (if ( exists {?item  a  ?itemClass }, true , false) as ?doesItemBelongToUserContextItemClass)

always gives true to doesItemBelongToUserContextItemClass even though that is not correct, for a specific item, it is not from the itemClass.
now i am sure that the problem is here, because i printed the value of the doesItemBelongToUserContextItemClass and it is always true but that is not correct, we are close, so just solving this will solve the question

A: Your query is big enough that I'm having a very hard time making sense of it, but my best guess is that you're running into a situation where your exists expression doesn't have all the variables bound that you need to make it test what you want it to test.  Here's some very simple data:
@prefix : <urn:ex:>

:s a :D .
:t a :E .

Now, take a look at this query and the results:
prefix : <urn:ex:>

select * where {
  #-- Find an individual ?a and (one of)
  #-- the classes that it belongs to.
  ?a a ?aClass .

  optional {
    #-- Find an individual ?b and (one of)
    #-- the classes that it belongs to.
    ?b a ?bClass .

    #-- And bind ?isCommonClass to true or
    #-- false, to indicate whether ?b is
    #-- also an element of ?aClass.
    bind(exists{?b a ?aClass} as ?isCommonClass)
  }
}

---------------------------------------------
| a  | aClass | b  | bClass | isCommonClass |
=============================================
| :s | :D     | :s | :D     | true          |
| :s | :D     | :t | :E     | true          |
| :t | :E     | :s | :D     | true          |
| :t | :E     | :t | :E     | true          |
---------------------------------------------

?isCommonClass is always true, even though it seems like it should be true when ?a and ?b are the same, and false otherwise.  I think that what's happening here is that the bind gets evaluated in a context where either ?b or ?aClass isn't set yet, so the exists is actually checking for something more general.  We can test this by moving the bind outside of the optional:
select * where {
  ?a a ?aClass .

  optional {
    ?b a ?bClass .
  }

  bind(exists{?b a ?aClass} as ?isCommonClass)
}

---------------------------------------------
| a  | aClass | b  | bClass | isCommonClass |
=============================================
| :s | :D     | :s | :D     | true          |
| :s | :D     | :t | :E     | false         |
| :t | :E     | :s | :D     | false         |
| :t | :E     | :t | :E     | true          |
---------------------------------------------

Here, we get the results we'd expect, with ?isCommonClass being true exactly when ?a and ?b are the same.
The query snippet in the question doesn't provide enough to be sure that this is what's happening, and the query you provided in the comments is too big for anyone else to check, but this seems like a very good candidate for what's going on in your situation.


text:
Q: What tools other than jslint exist to validate and check Javascript syntax and style? In our current project we are using JSLint for verifying that Javacript is written correctly, and that it satisfies a few style checks. This is included as an Ant task in our build.xml.
However, I have found that the license of JSLint makes it incompatible with free and open-source software:

// The Software shall be used for Good, not Evil.

I also find JSLint a bit too overzealous in its checks, and makes JQuery-based development difficult. I understand that its intent is not to help one develop scripts, but to check that the script will work in most existing language implementations.
Finally, it's just not smart enough with its scoping: what's wrong with defining a variable in the head of a for loop? (i.e. for (var i = 0; ...) rather than var i; for (i = 0; ...)).
(EDIT: This is actually a problem with Javascript itself. JavaScript does not have block scope, unlike most C-like languages.)
What alternatives exist for verifying the syntax and style for Javascript scripts, intended to be executed within modern web browsers? Any implementation language is fine. I've even thought about using the Rhino library to load and execute the script within Java.

A: Use JSHint: http://www.jshint.com/

A: JSHint does not have the same license as JSLint. In a sense it does have an MIT license without the  'Do no evil' addition of JSLint. See the github link:
jsHint license on gitHub

A: Why not try TypeScript? its much better than any "checker" JS can provide and generates great code. Its also type-safe and a leaner-meaner language. Just an opinion.


text:
Q: Can someone tell me the purpose of the second capture group in the jQuery rts regular expression? In Jeff Roberson's jQuery Regular Expressions Review he proposes changing the rts regular expression in jQuery's ajax.js from /(\?|&)_=.*?(&|$)/ to /([?&])_=[^&\r\n]*(&?)/. In both versions, what is the purpose of the second capture group? The code does a replacement of the current random timestamp with a new random timestamp:
var ts = jQuery.now();
// try replacing _= if it is there
var ret = s.url.replace(rts, "$1_=" + ts + "$2");

Doesn't it only replace what it matches? I am thinking this does the same:
var ret = s.url.replace(/([?&])_=[^&\r\n]*/, "$1_=" + ts);

Can someone explain the purpose of the second capture group?

A: It's to pick up the next delimiter in the query string on the URL, so that it still works properly as a query string. Thus if the url is
http://foo.bar/what/ever?blah=blah&_=12345&zebra=banana

then the second group picks up the "&" before "zebra".
That's an awesome blog post by the way and everybody should read it.
edit — now that I think about it, I'm not sure why it's necessary to bother with replacing that second delimiter. In the "fixed" expression, that greedy * will pick up the whole parameter value and stop at the delimiter (or the end of the string) anyway.

A: I think you're right.  It was needed in the original because matching the ampersand or end-of-string was how the .*? knew when to stop.  In Jeff's version that's no longer necessary.

A: As the author of the article I can't tell you the reason for the second capture group. My intent with the article was to take existing regexes and simply make them more efficient - i.e. they should all match the same text - just do it faster. Unfortunately I did not have time to delve deeply into the code to see exactly how each and every one of them was being used. I assumed that the capture group for this one was there for a reason so I did not mess with it.


text:
Q: Spyware propagation over wireless network? How to trace? Recently at my company, we have been experiencing intermittent search redirects when connected to our wireless network.
I say intermittent because many times, simply disconnecting and reconnecting to the wireless network will resolve the problem. Sometimes it will disappear for a user and then reappear.
When hardwired in, there are no redirect issues. I have run many scans on the machines that are experiencing these redirects and they all come out clean.
My understanding is that there could be an infected machine somewhere on the wireless network that is spreading this issue. But whoever this user may be, they have not stepped forward and complained about redirects themselves.
Alternatively, could it be residing somewhere on one of our servers (if so, why no hardwired redirects)?
My question is this:
Is there any way that I could possibly track/trace where this thing is coming from? Scanning every single computer connected to the wireless network would not be an easy option for the 'higher ups' to accept at this point in time and Im stuck trying to play whack-a-mole in the meantime.
Any advice is appreciated, thank you!

A: Have you checked IP settings, done route traces or any other network discoveries while this is happening?
Perhaps you're intermittently connecting to a rogue or mis-configured wireless AP.

A: techie007 has a point about intermittently connecting to a rouge or misconfigured wireless AP, somewhat. When a computer connects to a wireless network you choose that, and can only choose one at a time. Your DNS servers are probable cause. I say this because if they have been changed or tampered with that could cause intermittent redirects, especially if your alternative DNS servers have been changed. Check those in both the DNS server (if you have any) and also the router in question.
Traceroute may be a possible solution. However, to be positive that your wireless network is to blame, try one of the computers that have been redirected in a known good wireless network.


text:
Q: angular 13 ng build library fails (ivy partial compilation mode) Recently I was having a problem installing an npm package (that used node-gyp). I tried upgrading the minor version of node from version 16.13.0 to 16.13.1 and upgrading my angular cli from 13.0.2 to 13.2.0. Once I got the package to install I generated a library with ng g library new-library. I don't know what what actually broke it, but now whenever I try to build alibrary it produces an error. I try ng build my-lib and get the below error.
✖ Compiling with Angular sources in Ivy partial compilation mode.
Transform failed with 1 error:
error: Invalid version: "15.2-15.3"

I tried reverting the version of node and angular cli but it didn't fix the problem. I even reverted the code to its original state and I get the error now. Is this a problem with my environment? How do I fix this issue?

A: Comment out Safari from the .browserslistrc File, if you use Angular. This is a better Solution until there is a fix.
# last 2 Safari major version

A: This was a bug in the Angular CLI that has been fixed. In your package.json, update @angular/cli to either 12.2.16 or 13.2.1.
Source: https://github.com/angular/angular-cli/issues/22606#issuecomment-1026097996

A: You can try this solution
open .browserslistrc and add
not ios_saf 15.2-15.3
not safari 15.2-15.3

Save the file and run again
ng build

A: Please follow this Github issue:
https://github.com/angular/angular-cli/issues/22606
As a workaround you can add the below to your browserslist configuration.
not safari 15.2-15.3 # TODO: remove once https://github.com/angular/angular-cli/issues/22606 is fixed.

A: This is a bug in Angular CLI 13.2.0.
Temporary solution:
Removing content configurating .browserslistrc file from root project.
more info

A: This is happening because the current version of your angular does not support the safari and ios version of 15.2-15.3.
This fix is available with angular version 13.2.1
But to fix this error in your version, what you have to do is to create a file in the root of your project named as .browserslistrc which will contain the following accepted browsers versions :
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
#   npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 9-10 # Angular support for IE 9-10 has been deprecated and will be removed as of Angular v11. To opt-in, remove the 'not' prefix on this line.
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
not ios_saf 15.2-15.3
not safari 15.2-15.3

For more information on accepted browsers versions by angular you can refer :
https://angular.io/guide/browser-support
For bug issue thread visit
https://github.com/angular/angular-cli/issues/22606
Hope it will help you or somebody else...
Thanks!


text:
Q: Mstest ParallelTestCount on Test classes not tests I am running my unit tests ona test agent. I have changed my testsettings to use ParallelTestCount = "0" so the tests are run in parallel. I then have failing tests as the tests are using the same instance of a Mock.
Is there anyway I can run each test classes in parallel and not the individual tests?
Is there a better alternative to MSTEST command line to test my binaries?
I am running Visual Studio 2012 and TestAgent and controller 2012.
Thanks in advance

A: There is no such option as far as I know.
These failing tests actually shows that you have a shared state between your unit tests - in this case a class field (mock).
Consider creating the shared objects in each test instead of using TestInitialize to create the mock object, if it's a completed setup then use a helper method.
I don't recommend splitting your tests between two methods and I think this minimal code duplication not only make sure that you do not have shared state but also creates more readable tests and makes sure that an accidental edit to your initialize method won't cause other tests to fail.
For more information on why I prefer not to use SetUp/TestInitialize check out James Newkirk blog, or my own thoughts on the subject.


text:
Q: Uniform Dominated Convergence Theorem I'm wondering if the classic dominated convergence theorem can be generalized to the following uniform version.
Let $\{\mu_n:n=1,2,...\}$ be a countable set of probability measures. Let $\{f_k: k=1,2,\cdots\}$ be a sequence of measurable functions. Suppose for each $n$, $f_k(x)\to 0$ holds $\mu_n$-almost surely. Suppose there is a measurable function $g$ such that (i) $\sup_k |f(x)|\le g(x)$ for all $x$; (ii) $\sup_n \int g(x) \text{d}\mu_n < \infty$. Then, do we have $\sup_n |\int f_k(x)\text{d}\mu_n| \to 0$ as $k\to\infty$?
Based on the classic dominated convergence theorem, we know $\int f_k(x)\text{d}\mu_n\to0$ for each $n$. The question is that does it convergences uniformly in $n$ as stated above? If not, what extra conditions do we need?

A: Unfortunately not. For a simple counterexample consider the measurable space $[0,1]$ with the Lebesgue $\sigma$-algebra, and define $f_k=\mathbb 1_{[0,1/k]}$, and $\mu_n=n\lambda|_{[0,1/n]}$, where $\lambda$ is the usual Lebesgue measure. We thus have, for any $k\in \mathbb N$, that
$$\sup_{n\in\mathbb N}|\int f_kd\mu_n|=\sup_{n\in\mathbb N}|n\int f_k\mathbb 1_{[0,1/n]}d\lambda|=1,$$
because for any $n>k$ we have $\int f_kd\mu_n=1$.


text:
Q: How to remove multiple redirection of homepage? my website homepage redirects multiple times. I want to remove these multiple redirections.
I hit the URL in browser http://example.com
First, It redirects to http://www.example.com
Finally, Redirected to https://www.example.com
But I want to redirect from http://example.com to https://www.example.com

A: You can use:
RewriteCond %{HTTP_HOST} !^www\. [OR,NC]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.exemple.com%{REQUEST_URI} [NE,R=301,L]

or without domain name:
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]


text:
Q: How to reduce big size database files (Data File ) SQL Server without SHRINK? I found a couple of 'question' regarding shrinking big datafiles but I think that is not very accurate to my situation. So here is my question
I have a big database with almost 8TB of Data File Size and almost 160 GB of log file
The database is in offline status
Shrink process due to the big size of the data file will take a long time so I'm not sure how to proceed in order to avoid any problem in the instance.
One option that I have in mind is to create a new data file and then, copy the tables to the new data files and finally shrink the old data file
Best regards

A: Is there actually 8 TB of data in the database? If so, then even shrinking can't help you, that's the legitimate size of the database. Though you could look into Data Compression for your largest tables to help minimize the space they consume on disk.


text:
Q: Maintaining multiple settings files Currently, I have a form that has various radio buttons, directory browsers, date pickers etc. The application uses the settings, and executes a file deletion task. I was wondering what is the best strategy to save these settings to an external file that can be loaded at a later date. So essentially each configuration can be loaded, executed, and then another configuration loaded. Also, the configuration can be passed across installations / users.
I dont believe I can use the internal .settings file because I will have multiple sets of settings that can be loaded.

A: There are many formats to choose from for storing settings such as:

*

*INI

*CSV

*YAML

*JSON

*XML

One of the best strategies would be to use XML. XML is one of the most popular formats for setting/configuration files because its easy to parse, the syntax is well specified and is powerful yet easy to read.
Using XML files allows configurations to be passed across installations and shared among users.
In addition if you have an XSD (schema file) that describes your XML configuration files, it is trivial for your application to validate different configuration files.


text:
Q: flexbox, не могу выровнить блоки В коде элементы никак не хотят стоять в 2 ряда по 4 колонки, никак не понимаю что делать, хочу добиться результата как на картинке.

.container_2 {
  width: 100%;
  max-width: 80%;
  margin-left: 100px;
}

.structure {
  background-color: #2c69a8;
  width: 100%;
  height: 30px;
  position: relative;
}

.structure p {
  text-align: center;
  color: #fff;
  padding-top: 5px;
  font-size: 18px;
  font-family: Franklin Gothic Demi;
}

.structure-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.structure-linear {
  width: 19%;
  margin-bottom: 20px;
}

.structure-text {
  padding: 20px;
  border: 2px solid #2c69a8;
}

.structure-text img {
  width: 220px;
  max-width: 100%;
  height: auto;
}

.structure-text p {
  line-height: 25px;
  font-size: 17px;
  font-family: Franklin Gothic Book;
}

.structure-linear:hover {
  color: #fff;
  background-color: #6995c1;
}

Структура

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

A: Для начала перенесите блоки с классом structure-flex в блок с одним классом, к примеру test которому установим стили:
  display: flex;
  flex-direction: row;
  width: 100%;
  flex-wrap: wrap;

После чего необходимо подобрать ширину карточки с классом structure-flex и добавить свойство с ограничением максимальной ширины, в данном случае   max-width: 150px;.
После чего карточки будут отображаться как на изображении в вопросе.

.container_2 {
  width: 100%;
  max-width: 80%;
  margin-left: 100px;
}

.structure {
  background-color: #2c69a8;
  width: 100%;
  height: 30px;
  position: relative;
}

.structure p {
  text-align: center;
  color: #fff;
  padding-top: 5px;
  font-size: 18px;
  font-family: Franklin Gothic Demi;
}

.structure-flex {
  display: flex;
  width: 100%;
  max-width: 150px;
  flex-wrap: wrap;
}

.structure-linear {
  margin-bottom: 20px;
}

.structure-text {
  padding: 20px;
  border: 2px solid #2c69a8;
}

.structure-text img {
  width: 220px;
  max-width: 100%;
  height: auto;
}

.structure-text p {
  line-height: 25px;
  font-size: 17px;
  font-family: Franklin Gothic Book;
}

.structure-linear:hover {
  color: #fff;
  background-color: #6995c1;
}

.test {
  display: flex;
  flex-direction: row;
  width: 100%;
  flex-wrap: wrap;
}

Структура

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.

Tempora incidunt r sit amet, cvbfbconsectetur adipisicing elit, sed do eiusmod tempor incididunt u cvbfbconsectetur adipisicing elit.


text:
Q: How to access data from navigateOptions of Navigation Drawer I have a trouble with getting data from props in my Sidebar, I coded it like this using Navigation Drawer.
How can I access for example that text ("xd") from navigationOptions or how can i pass an object there
and read it correctly?
contentComponent: props => <SideBar {...props } />, navigationOptions: {
      icon: 'xd'
  },

Rest of the code
export default Sidebar = props => (
{..Something not important in that question}
          <DrawerNavigatorItems {...props} style={{

          }}/>
      </View>

  </ScrollView>
);

A: I'm not sure what exactly your use case is, but it might be easier to just pass icon directly to the SideBar component as a prop:
contentComponent: (props) => <SideBar {...props} icon="xd" />

Then you can retrieve the icon value passed to your SideBar component like this:
export default Sidebar = (props) => (
  <ScrollView>
    <Text>{props.icon}</Text>
  </ScrollView>
);

I've used the Text component to give an example, but replace the Text component with the views you want.


text:
Q: image cutting in opencv I want to segment some Bangali scripts. While segmenting the lines I get my expected image for the 1st line. But from 2nd lines I'am getting a whole black image. Here is my code for cutting.
def linecut(line_start,line_end,name):
    print("called" , name)
    #imArray = np.asarray(im)
    print("Start=",line_start,"end=",line_end)
    # create mask
    plygn = line_start
    i=len(line_end)-1
    while i>=0:
        plygn.append(line_end[i])
        i-=1
    print(plygn)
    #print(imArray.shape)
    region = Polygon(plygn)

    for index, pixel in np.ndenumerate(pixels):
        # Unpack the index.
        row, col, channel = index
        # We only need to look at spatial pixel data for one of the four channels.
        if channel != 0:
            continue
        point = Point(row, col)
        if not region.contains(point):
            im_copy[(row, col, 0)] = 255
            im_copy[(row, col, 1)] = 255
            im_copy[(row, col, 2)] = 255
            im_copy[(row, col, 3)] = 0
    im_name = str(name)+".png"
    cut_image = Image.fromarray(im_copy)
    plygn.clear()
    cut_image.save('F:\\relax' +im_name)
    cut_image.__del__()][1]

images: https://drive.google.com/drive/folders/1kiHXPS9wA2rvUAygeuvI3Q7Wq0njkjuL


text:
Q: How to move future into lambda-expression I'm using Visual Studio 2013 and i want achieve this line of code
 f = p.get_future();
 auto task =[f = std::move(f)](){
   //use f
 };

I'm aware of the solution
here, but unfortunately this doesn't compile under VS2013 (error C2558 no copy-constructor available).

A: You can use a shared_future.  That is easiest.
However, that doesn't help you move.  If you really need to move, we can do it with the help of a move_helper function and class:
template<class T, class F=void>
struct move_helper_t {
  T t;
  F f;
  template<class...Args>
  auto operator()(Args&&...args)
  ->typename std::result_of< F&(T&, Args...) >::type
  {
    return f(t, std::forward<Args>(args)...);
  }

  // force right-associativity of `->*`, and
  // invert the stack to get the arguments in the "right" order:
  template<class F1,
    class R0=move_helper_t< T, typename std::decay<F1>::type >
  >
  auto operator->*(F1&& f1)
  -> decltype(
    std::declval<F>()->*
    std::declval<R0>()
  )
  {
    return
      std::move(f)->*
      R0{ std::forward<T>(t), std::forward<F1>(f1) };
  }
};
template<class T>
struct move_helper_t<T,void> {
  T t;
  template<class F>
  auto operator->*(F&& f)
  -> move_helper_t<T, typename std::decay<F>::type>
  {
    return {std::forward<T>(t), std::forward<F>(f)};
  }
};

template<class T>
move_helper_t<std::decay_t<T>>
move_helper( T&& t ) {
  return {std::forward<T>(t)};
}

In MSVC 2013 you may have to declare a constructor in move_helper_t.  I do not recall how well written their return {} code was.
f = p.get_future();
task =
  move_helper(std::move(f)) ->*
  [](std::future<int>& f){
    //use f
  };

->* binds the move_helper to the lambda.  It then returns a callable object which will be passed the std::future<int>& as the first argument when invoked.
Because of how it is written, you can even chain it:
auto f = p.get_future();
auto f2 = p2.get_future();
task =
  move_helper(std::move(f)) ->*
  move_helper(std::move(f2)) ->*
  [](std::future<int>& f, std::future<char>& f2){
    //use f
  };

to move more than one argument into the lambda.
In both cases, task can be invoked by task() -- the ->* operation binds the lambda up and passes the futures when invoked.
Live example.
Note that this solves the problem of moving the future into the lambda.  If you want to store the lambda in a std::function, this will not help you, as functions must be copyable.
template<class F>
struct shared_function {
  std::shared_ptr<F> pf;
  template<class ...Args>
  typename std::result_of<F&(Args...)>::type
  operator()(Args&&...args) const {
   return (*pf)(std::forward<Args>(args)...);
  }
};
template<class F,
  class dF=typename std::decay<F>::type
>
shared_function< dF >
make_shared_function( F&& f ) {
  return {std::make_shared<dF>(std::forward<F>(f))};
}

this takes a movable lambda and wraps it in a shared pointer and exposes operator() for you.  But first taking a future moving it into a lambda via the above technique, and then wrapping that lambda in a shared function to pass it to a std::function is ridiculous: just use a shared_future in the first place.
As an aside, in theory, a packaged_task only requires move, but I am uncertain if MSVC2013 supports that requirement.


text:
Q: How to align my world space with Vive Chaperone bounds? I am trying to create a room-scale 1:1 VR experience for HTC Vive using Unity and VRTK.
I have a 3m x 3m tracked space for testing, and in Unity I have created a 3x3 room. However, the walls in my virtual world do not run in parallel with the Play Area chaperone bounds – they are intersecting the chaperone. Have a look at this image:

How do I transform my world space so that it's always in sync with the chaperone bounds?

A: As far as I know the chaperone bounds should always be centered at world space zero coordinate and aligned with the world axis if the SteamVRController is in the root of the hierarchy. Are you sure that you are not making it as a child of another object?
You can also check that the dimensions of the tracked area are the one you are expecting by doing something:
CVRChaperone chaperoneSystem = OpenVR.Chaperone;
bool success = chaperoneSystem.GetPlayAreaSize(ref m_sizeX,ref m_sizeZ);


text:
Q: HTML/CSS link scroll not scrolling to correct position I'm having trouble figuring out why my links are not scrolling to the correct position. They are scrolling to the section below where they should. I've looked at all the examples I could find to no avail.

IDX Website Features

WeeboWeb real estate websites have all the tools you need to market yourself and grow your business online. Effective, professional designs that connect you with 32% more buyers and sellers.

Effective Designs

Quick Setup

Lead Capture

Map Search

Mobile Friendly

Social Media

Blogging

Branding

Effective Designs

sample content

Quick Setup

sample content

Lead Capture

sample content

Map Search

sample content

Mobile Friendly

sample content

Social Media

sample content

Blogging

sample content

Branding

sample content

Here's the CSS
.bottomarea {display:block; width:100%;}
.bottomareatitles {text-align:center; margin-top:50px; font-size:26px; color:#000000; font-weight:350;}
.bottomareasubtitle {text-align:center; padding-top:20px; color: dimgrey; width:75%; margin:auto;}
.bottomareaicons {width:130px; display:inline-block; margin:auto; text-align:center; margin-top:40px; color:#000000; font-size:16px; padding-bottom:10px; padding-top:10px;}
.bottomareaicons:hover {width:130px; display:inline-block; margin:auto; text-align:center; margin-top:40px; color:#000000; font-size:16px; background:#2584b8; padding-bottom:10px; padding-top:10px;}
.bottomareaicons i {font-size:3.0em; padding-bottom:20px; color:#2584b8;}
.bottomareaicons:hover > i {font-size:3.0em; padding-bottom:20px; color:#ffffff;}
.iconcontainer {margin:auto; text-align:center;}
.bottomsection {margin-top:50px;}
.bottomsection .section h1 {text-align:center;}
.bottomsection .section p {text-align:center;}

You can see a live example of whats happening here: https://www.weeboweb.com/idx-websites/
I'm attempting to just use css to make this work. Any help is greatly appreciated. This has had me a bit baffled.

A: It's not actually scrolling "below", it's scrolling to where it should. The problem is that area is being covered up by your top navigation which stays fixed to the top of the screen. You need to account for this with your spacing, or don't have a fixed top nav.

A: Its because you forgot to compensate for your header. The page is scrolling so that the element is at the top of the page... Behind the header.
There are several solutions here in a CSS Tricks article that can help you solve the problem.

A: Here is the solution: Need to correct the navbar implementation before looking at the bookmark issue
First, add padding-top equal to your header height (76px) to your body.
body {
    padding-top: 76px;
}

Next, remove the min-height: 76px, make it 0. from your header. Move the position: fixed from your #main-nav to your header element (if possible, else it is fine to be on #main-nav. Add top:0 to the #main-nav
#main-nav {
   top: 0;
}

This should solve your problem.
EDIT:
You are using bootstrap, but not using bootstrap navbar-fixed-to-top solution. please refer this - http://getbootstrap.com/components/#navbar-fixed-top
Also note this at the same place in the bootstrap documentation

Body padding required
  The fixed navbar will overlay your other content, unless you add padding to the top of the . Try out your own values or use our snippet below. Tip: By default, the navbar is 50px high.

body { padding-top: 70px; }
Make sure to include this after the core Bootstrap CSS.

A: I was able to fix this by simply adding padding-top:100px; inline to each section element. I did it inline to make sure that the section element doesn't interfere with anything else. I also don't mind the additional space as this particular page warrants it when I finish the design. I don't feel this is the best answer to solving this problem in the future, but in this case it fixed it for me. I also moved the a element outside of the h1 element. You can see ti working here now at https://weeboweb.com.