text:
Q: iphone 5 retina 4 inch mapview I'm trying to adapt my app to retina 4 screen for iPhone 5, and adding the png archive and everything resizes but the map view, that moves to the top and leaves a white square on the bottom. I'd like to know how to fix it.
Thanks in advance.

Maybe this has to do with it?
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    // We need to manually handle rotation on iPads running iOS 5 and higher to support the new UINavigationBar customization. This is automatic on the iPhone & iPod Touch.
    if ([self.navigationController.navigationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)] ) {
        if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
            toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
            [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"UINavBarLandscape@iPad.png"] forBarMetrics:UIBarMetricsDefault];
        }
        else {
            [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"UINavBar@iPad.png"] forBarMetrics:UIBarMetricsDefault];
        }
    }
}
else {
    if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
        toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
        [mapView setFrame:CGRectMake(0, 0, 480, 236)];
        [toolbar setFrame:CGRectMake(0, 236, 480, 32)];
    }
    else {
        [mapView setFrame:CGRectMake(0, 0, 320, 372)];
        [toolbar setFrame:CGRectMake(0, 372, 320, 44)];
    }

A: For the to top bar should be anchored to the top. the bottom bars anchored  to the bottom of the controller's view.  The map view should be anchored to the top and the bottom but should also have a vertical spring.
Now everything should expand correctly when you have a iphone 4 or 5.
Also if you are targeting iOS 6, take the time to use AutoLayout.  That way when the iPhoneN has a different resolution you don't have to worry about the layout so much.

A: You have to check iPhone device version in your code programmatically and resize the controls accordingly.


text:
Q: Array StringLog unit testing smallest method I'm a new programmer and I am trying to pass this code through a unit test using the smallest method.
// returns the first string in a lexicographic ordering of the log
public String smallest(){
    String smallest = log[0];

        for(int i= 0;i <= lastIndex; i++){

            if(log[i].compareTo(smallest)< 0){ //compare to smallest
                                               //known not log[i+1]

                smallest = log[i];

            } else {

                lastIndex++;
        }
        return smallest;

Here are my unit tests:
public class Test_smallest {

 ArrayStringLog strLog;

@Before
public void setUp() throws Exception {
    strLog = new ArrayStringLog("My StringLog",5);
}
/*
LinkedStringLog strLog;

@Before
public void setUp() throws Exception {
    strLog = new LinkedStringLog("My StringLog");
}
*/
@Test
public void test_1Element() {
    strLog.insert("string 1");
    assertEquals(strLog.smallest(), "string 1");
}

@Test
public void test_3Elements_smallest_at_beginning() {
    strLog.insert("string 1"); strLog.insert("string 2");
    strLog.insert("string 3");

    assertEquals(strLog.smallest(), "string 1");
}

@Test
public void test_3Elements_smallest_in_middle() {
    strLog.insert("string 2"); strLog.insert("string 1");
    strLog.insert("string 3");

    assertEquals(strLog.smallest(), "string 1");
}

@Test
public void test_3Elements_smallest_at_end() {
    strLog.insert("string 3"); strLog.insert("string 2");
    strLog.insert("string 1");

    assertEquals(strLog.smallest(), "string 1");
}

@After
public void tearDown() throws Exception {
}

My problem is this, it passes the 1 element, and elements at beginning tests, but fails the other two and I cannot figure out why. It should be stepping through the array comparing the current index the loop is on with the one next to it.
It throws the error expected:string 2, but was string 1, and the other for expected:string 3 but was string 1. I'm trying to find the smallest string in the array no matter the location. I don't understand why its expected to see string 2 or 3, when the assertEquals is looking for string 1.

A: In the loop in the method smallest(), not sure why you need to add else condition lastIndex++. This variable shouldn't be change. Can you remove the condition and try again? Here's a sample of code:
public String smallest(){
    String smallest = log[0];
    for(int i= 0;i <= lastIndex; i++){
            if(log[i].compareTo(smallest)< 0){ //compare to smallest
                                               //known not log[i+1]
                smallest = log[i];
    }
    return smallest;
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to ensure uploaded SVG has width and height Attributes My users can upload image files, which could be SVGs.
I need to make sure that all SVGs have a width and height attribute for something that's occurring later on.
If I have the SVG as a file (via an input type="file") how can I add a width and height to it if it is missing?

A: I ended up doing the following, though Im sure it could be improved/done in a much better way
 let svgReader = new FileReader();

        svgReader.onload = function (e) {
            let svg = $(e.target.result);

            for(let i =0;i<svg.length;i++) {
                if (svg[i] instanceof SVGElement) {
                    svg = $(svg[i]);
                    break;
                }
            }

            let width = svg.attr("width");
            let height = svg.attr("height");
            if (height == null || height == undefined) {
                svg.attr("height", 300);
            }

            if (width == null || width == undefined) {
                svg.attr("height", 300);
            }

            let svgFile = new XMLSerializer().serializeToString(svg[0]);
            let new file = new File([svgFile], files[index].name, {type: "image/svg+xml"});
        };
svgReader.readAsText(files[0]);

I had to go through the SVG to find an instance of SVG element, as some of the SVGs I tested with had additional tags or comments that messed it up otherwise. Also, the 300 value for width and height was just made up, but seems to be ok, probably could have used the view box dimensions instead, but it works for me


text:
Q: Joomla- BlogLayout: Show title and image of sub category I have a menu item that shows articles from a category and two sub-categories on a website as blog layout.
Now I want to achieve that I just want to display the title and image of all sub categories, but not of the parent category.
I guess I have to override the standard views in components\com_content\views\category\tmpl but I don't know how I could do that.
Any help is very appreciated.
Thanks,
enne


text:
Q: Uploading Image to Azure Blob using File Uploader in ASP.NET? I need to allow a user to specify an image that needs to be uploaded to the Azure DB instead of hard coding the Image Path like all the tutorials out there. This is what I have so far:
<asp:FileUpload ID="imageUploader" runat="server" />
<asp:Button ID="uploadBtn" runat="server" Text="Upload Image" class="btn btn-success btn-sm" OnClick="uploadBtn_Click" />

Code:
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

 // Retrieve a reference to a container.
CloudBlobContainer container = blobClient.GetContainerReference("pictures");

// Create the container if it doesn't already exist.
container.CreateIfNotExists();
container.SetPermissions(new BlobContainerPermissions
{
        PublicAccess = BlobContainerPublicAccessType.Blob
});

CloudBlockBlob blockBlob = container.GetBlockBlobReference("myblob");

blockBlob.UploadFromFile(imageUploader.PostedFile.FileName, FileMode.Open);

However this doesn't seem to work. How can I upload an image to azure using a File Uploader in ASP.NET?

A: Your UploadFromFile is using the wrong parameter. See Microsoft CloudBlockBlob.UploadFromFile. The first parameter should be a file path i.e. C:\Users\etc... not just the name of the file that you are parsing imageUploader.PostedFile.FileName.
You most likely want to be using UploadFromStream like this:
blockBlob.UploadFromStream(imageUploader.PostedFile.InputStream);

You should check the documentation for CloudBlockBlob as there are a number of different upload methods.


text:
Q: Which programming language do I need in order to allow users to create content like Wattpad does with it's user? For example, Wattpad allows it's users to create"chapter" for their content, each user can create unlimited "chapter's" and it performs similar to reading a book online when published.

A: Check out their tech stack on their Stack Overflow Company Page.
It lists JavaScript, PHP, and SQL as languages they use.
You could build a site like Wattpad using only JavaScript. The important piece to how users can publish content, and can publish content as a number of chapters, is how their data is structured and stored in the database.


text:
Q: Discord Bot send message from udp connection to specific channel I have a node.js discord bot running on my server. The bot runs a simple udp server and receives text messages from a program running a udp client. I am able to see the message in the console, but I want my bot to post the text to a channel and I can't figure out how to get the bot to post text without it being a response to user input. Any help would be greatly appreciated.
const Discord = require('discord.js');
const bot = new Discord.Client();
const { prefix, token } = require('./config.json');

    var dgram = require('dgram');
    var server = dgram.createSocket('udp4');

    server.on('listening', function() {
      var address = server.address();
     console.log('UDP Server listening on ' + address.address + ':' + address.port);
    });

    server.on('message', function(msg, remote) {
     console.log(`${msg}`);
    });

    server.bind(PORT, HOST);
    //END UDP Server

A: I am assuming you want to log all messages to a specific channel, in a specific guild, you can do so by finding the guild in the client's (server in your case) guilds collection and then finding the channel from the channels collection of that guild.
You'd need to use server.guilds.cache.get(guild_ID).channels.cache.get(channel_ID).send(msg) Make sure to replace guild_ID and channel_ID with the appropriate IDs.


text:
Q: Save Azure Functions invocation Traces in files I would Like to save the content of all of my invocation Traces of specific Azure Functions in différent files with an automatic purge.
For exemple keep all the calls on the last 3 days.
I need the invocation details on each file generated :

Currently I only have acces to the last 20 operations :

Is it something possible to do ?

A:
Currently I only have acces to the last 20 operations.

If you see from the Azure Portal Function App > Function > Monitor, only 20 invocations will be visible:

From the Same page, click on "Run query in Application Insights" > Remove the code take 20 from the query:

and then run the query in the logs where you'll get all the invocation traces:

Note: take n here n is the number of traces/rows.

I would Like to save the content of all of my invocation Traces of specific Azure Functions in different files with an automatic purge. For example, keep all the calls on the last 3 days. I need the invocation details on each file generated:

You can save the invocation traces for every execution in CSV or Excel or export to PowerBI Reports also where you can keep the time range in query from which duration, the logs are required.
Note: All the Functions Invocation traces can be saved automatically in the associated storage account file shares.
These invocation logs are stored in Storage Account File Shares that are sent to Log Analytics Workspace linked with the Application Insights created during Azure Function App. You can purge the logs using Portal, PowerShell and REST API. Refer to Azure Monitor logs delete workspace MS Doc.


text:
Q: Ошибка 404 при запуске Spring MVC (самое простое приложение) Eclipse error: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Помогите разобраться.. использую Tomcat 9.0.65 IDE Eclipse
структура:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.company.springcourse</groupId>
   <artifactId>spring-mvc-app1</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <packaging>war</packaging>
   <name>spring-mvc-app1 Maven Webapp</name>

<url>http://www.example.com</url>
 <properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <maven.compiler.source>1.7</maven.compiler.source>
   <maven.compiler.target>1.7</maven.compiler.target>
   <spring.version>5.3.22</spring.version>
 </properties>
 <dependencies>
  <dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>4.11</version>
   <scope>test</scope>
 </dependency>

 <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>${spring.version}</version>
 </dependency>

 <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>${spring.version}</version>
 </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>${spring.version}</version>
 </dependency>

 <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>${spring.version}</version>
 </dependency>

 <dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf-spring5</artifactId>
    <version>3.1.0.M2</version>
 </dependency>
</dependencies>
  <build>
    <finalName>spring-mvc-app1</finalName>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-war-plugin</artifactId>
          <version>3.2.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>

web.xml
 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     id="WebApp_ID" version="3.1">

  <display-name>spring-mvc-app1</display-name>

  <absolute-ordering/>

    <servlet>
        <servlet-name>dispatcher</servlet-name>
     <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/applicationContextMVC.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

</web-app>

applicationContextMVC.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:mvc="http://www.springframework.org/schema/mvc"
   xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc.xsd">

    <context:component-scan base-package="com.company.springcourse"/>

    <mvc:annotation-driven/>

    <bean id="templateResolver"
class="org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver">
        <property name="prefix" value="/WEB-INF/views/"/>
        <property name="suffix" value=".html"/>
        <property name="characterEncoding" value="UTF-8"/>
    </bean>

    <bean id="templateEngine" class="org.thymeleaf.spring5.SpringTemplateEngine">
        <property name="templateResolver" ref="templateResolver"/>
        <property name="enableSpringELCompiler" value="true"/>
        <property name="characterEncoding" value="UTF-8"/>
    </bean>

    <bean class="org.thymeleaf.spring5.view.ThymeleafViewResolver">
        <property name="templateEngine" ref="templateEngine"/>
        <property name="order" value="1"/>
        <property name="viewNames" value="*"/>
        <property name="characterEncoding" value="UTF-8"/>
    </bean>
</beans>

HelloController.java
    package com.company.springcourse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class HelloController {
    @GetMapping("/hello-world")
    public String sayHello() {
        return "hello_world";
    }
}

hello_wprld.html
    <!DOCTYPE html>

    <meta charset="ISO-8859-1">
    <title>My app</title>

Hello world!

A: Обычно причина либо в том, что приложение по какой-то причине не запустилось, либо приложение находится по другому URL (например, "localhost:8080/my-app/", а не "localhost:8080/".
Возможно, контекст Spring не смог подняться из-за исключения (в логах можно найти warning)

A: Возможно кому то пригодится.
Для того чтобы изменить localhost:8080/app_name на localhost:8080/ в eclipse нужно

*

*Project > Properties > Web Project Settings > и указать Conrext root: /.

2.В вкладке servers 2 раза нажать на tomkat > Modules > и изменяете Path вашего модуля на / , а если там ничего нет(например после очистки сервера, как было у меня) ,то нужно выбирать Add Web Mudule > выбрать ваше приложение и потом уже указать Path на /
P.S. если во вкладке Modules (из второго пункта) ничего не будет ваше приложение не будет работать и выдаст error 404. обязательно проверьте.Из-за этого много часов потратил


text:
Q: "Have been to" and past events I'm always having trouble to construct sentences with Present Perfect which ask about events in the past.
I want to ask "During the time that you lived in Siberia did you ever pay a visit to the North?"
How can this be done with "have been to" ?

*

*Have you ever been to the North while living in Siberia?

*Have you ever been to the North during your life in Siberia?

I know that I can't use "when" because it implies the Simple Past which doesn't line up with Present Perfect.

A: A journalist is interviewing someone IN Siberia:
Have you ever been to the North while living in Siberia?
Have you ever been to the North during your life in Siberia?
Both those mean the same thing. They both imply the person is still in Siberia. Both are fine, both are grammatical.
Contrast that to:
Did ever go to the North while living in Siberia?
Did you go to the North during your life in Siberia?
That means the person is not longer in Siberia.
while living in Siberia means the same thing as during your life in Siberia.
The present perfect implies a connection to the present time and that the speaker is in Siberia.
If I ask you:
SP 1- Have you ever spoken English in public? [that implies a connection to the present time. To the time (NOW) that I am asking you.]
SP 2- Yes, I have.
SP 1 - When did you do that?
SP 2 - A couple of weeks ago.
All this applies to AmE and BrE.

A: There is a good reason for having trouble constructing present perfect sentences about events in the past.  The present perfect simply is not about events in the past.  It's about states in the present.  A state in the present can imply an event or an action in the past, of course, but so do many other things.
If I understand your context correctly, you know someone who used to live in Siberia but now lives somewhere else.  His living in Siberia is a past-tense state.  His having been to the North during that time is also and necessarily a past-tense state.  The tense appropriate to this context is the past perfect:

Had you ever been to the North while living in Siberia?

If you want to know about his present-tense state, then the present perfect construction makes sense:

Have you ever been to the North since living in Siberia?

The phrasing "since living in Siberia" might be interpreted as starting when he arrived there, or as starting when he left.  In either case, it represents a period of time that extends to the current moment.  It is a present-tense state.  It works with the present tense construction of the main clause.

Have you ever been to the North while living in Siberia?

This version of the question implies that he still lives in Siberia, or perhaps that living in Siberia is an established habit and you expect him to live there again.  The phrasing "while living in Siberia" has no tense of its own, but it exists within the tense of its main clause.

If you really want to ask about past events or actions, you don't want the perfect aspect at all.  A past indefinite construction is appropriate:

Did you go to the North while living in Siberia?

The past tense event of going to the North is made explicit with the past indefinite construction, and implied by either the past perfect or the present perfect.  Given your context, you shouldn't use "have been to".

A: Have you ever been to the North while living in Siberia?
Have you ever been to the North during your life in Siberia?

These are both intelligible.   The second implies that the speaker has knowledge that the listener actually lived in Siberia, the first does not necessarily.
The first sounds a little bit stilted / awkward, so prefer the second - it is more natural.
(With the "ever", it can imply a sense of either expecting a yes, or emphasizing that you are asking about /any/ time the listener was living in Siberia.  But it only changes the feel, not the meaning.)


text:
Q: Declare typescript interface Props in Vuejs class Component I'm looking for to declare a typescript interface Props in Vuejs class Component like we can do with React Component.
It's look like this :
import {Component, Prop, Vue} from 'vue-property-decorator'

export class Props extends Vue
{
  classElement :string
}

@Component
export default class Menu extends Vue<Props>
{
    public props :Props;

    constructor(props)
    {
        super(props);
        console.log(props); // return undefined
    }

    mounted()
    {
      console.log(this.props.classElement); // return undefined
    }
}

Is there a way to achieve this?

A: Additionally it is now possible using the Typescript type PropType.
import Vue, { PropType } from 'vue'
import { Component, Prop } from 'vue-property-decorator'

import User from './models/user';

@Component()
export default class Menu extends Vue {

    @Prop({type: Object as PropType<User>})
    public user!: User // notice the bang saying to compiler not to warn about no initial value

    mounted(){
      console.log(this.user);
    }

}

A: Now you can use {type: Object as () => User} inside a  Prop() decorator like this:
import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'

import User from './models/user';

@Component()
export default class Menu extends Vue
{

    @Prop({type: Object as () => User})
    public user!: User // notice the bang saying to compiler not to warn about no initial value

    mounted(){
      console.log(this.user);
    }

}

A: Yes, all functionality of the basic javascript vue library can be used when using typescript. I suggest you use the offical class decorator.
Defining a prop can be done by simply adding it as a parameter to your class decorator like so:
@Component({
  props: {
    classElement: String
  }
})
export default class Menu extends Vue
{
    mounted()
    {
      console.log(this.classElement);
    }
}

Because component accepts an object you can define an interface for this object and pass this in instead as well.
Alternatively you can use the vue-property-decorator for a more angular-like syntax.

A: You can extend class with props like so:
import {Component, Vue} from 'vue-property-decorator'

const props = Vue.extend({
   classElement: {
      type: String
   }
})

@Component
export default class Menu extends props
{
    mounted() {
      console.log(this.classElement);
    }
}


text:
Q: return array(a, dtype, copy=False, order=order) ValueError: could not convert string to float: 'STRING' when building machine leaning model I'm getting the following error: return array(a, dtype, copy=False, order=order)
ValueError: could not convert string to float: 'BOX72'(BOX72 is a value under column5).
The error seems to come at the line with code impute_knn.fit_transform(X)
Here is the code so far:
import pandas as pd
from sklearn.preprocessing import LabelEncoder
import numpy as np

dataframe = pd.read_csv('file.csv', delimiter=',')

le = LabelEncoder()
dfle = dataframe

dfle2 = dfle.apply(lambda col: le.fit_transform(col.astype(str)), axis=0, result_type='expand')

newdf = dfle2[['column1', 'column2', 'column3', 'column4', 'column5', 'column6', 'column7']]

X = dataframe[['column1', 'column2', 'column4', 'column5', 'column6', 'column7']].values

y = dfle.column3

from sklearn.preprocessing import OneHotEncoder
from sklearn.compose import ColumnTransformer
ohe = OneHotEncoder()

impute_knn = KNNImputer(n_neighbors=2)
impute_knn.fit_transform(X)

ColumnTransformer([('encoder', OneHotEncoder(), [0])], remainder='passthrough')
X = ohe.fit_transform(X).toarray()

I know I can probably use something like strip(), but I can't seem to figure out how I use it to remove any space before or after a string for all cells (in case there are other similar value entries). I also, don't know if this is actually the solution. Any pointers or help would be appreciated. Thank you.


text:
Q: json convert to class and deserialize I am trying to deserialize a complex json that i am getting via an api call. I have 2 questions.

*

*This is the  json that i tried to convert to class on site https://json2csharp.com/json-to-csharp
{
    "info": {
        "total_count": 2,
        "current_page_total_count": 2,
        "max_each_page": 500,
        "current_page_number": 1,
        "total_pages": 1
    },
    "entity_data": {
        "entity_name": "\u05de\u05d0\u05d9\u05e8",
        "entity_data_name": "e_130",
        "permissions": {
            "type": "full",
            "code": "1"
        },
        "view": "data table"
    },
    "data": [
        {
            "instance_data": {
                "_id": "60a3a82a956ecd3228739ced",
                "insertTimestamp": "2021-05-18T14:42:34+0300",
                "field_groups": [
                    {
                        "field_group_data": {
                            "group_name": "\u05e1\u05e4\u05e8 \u05d8\u05dc\u05e4\u05d5\u05e0\u05d9\u05dd",
                            "group_data_name": "g_353",
                            "group_id": "353",
                            "repeatable_group": "0",
                            "permissions": {
                                "type": "full",
                                "code": "1"
                            }
                        },
                        "fields_data": [
                            [
                                {
                                    "field_name": "\u05e9\u05dd \u05e4\u05e8\u05d8\u05d9",
                                    "field_type_name": "input-text",
                                    "field_data_name": "fld_2372",
                                    "placeholder": null,
                                    "default_value": "",
                                    "act_as_assign": "",
                                    "custom_validation": {
                                        "unable_to_edit": "0",
                                        "data_type": "0"
                                    },
                                    "value": "\u05de\u05d0\u05d9\u05e8",
                                    "group_index": 0
                                },
                                {
                                    "field_name": "\u05e9\u05dd \u05de\u05e9\u05e4\u05d7\u05d4",
                                    "field_type_name": "input-text",
                                    "field_data_name": "fld_2373",
                                    "placeholder": null,
                                    "default_value": "",
                                    "act_as_assign": "",
                                    "custom_validation": {
                                        "unable_to_edit": "0",
                                        "data_type": "0"
                                    },
                                    "value": "\u05e8\u05d5\u05d8\u05e4\u05dc\u05d9\u05d9\u05e9",
                                    "group_index": 0
                                },
                                {
                                    "field_name": "\u05d9\u05d9\u05e9\u05d5\u05d1 \u05de\u05d2\u05d5\u05e8\u05d9\u05dd",
                                    "field_type_name": "select-list",
                                    "field_data_name": "fld_2374",
                                    "placeholder": null,
                                    "default_value": "",
                                    "possible_values": "[\"\\u05db\\u05e4\\u05e8 \\u05e1\\u05d1\\u05d0\",\"\\u05ea\\u05dc \\u05d0\\u05d1\\u05d9\\u05d1\",\"\\u05e2\\u05d6\\u05d4\",\"\\u05d9\\u05e8\\u05d5\\u05e9\\u05dc\\u05d9\\u05dd\"]",
                                    "act_as_assign": "",
                                    "custom_validation": {
                                        "unable_to_edit": "0",
                                        "alphabetical_order": "0"
                                    },
                                    "value": "\u05db\u05e4\u05e8 \u05e1\u05d1\u05d0",
                                    "group_index": 0
                                },
                                {
                                    "field_name": "\u05d8\u05dc\u05e4\u05d5\u05df",
                                    "field_type_name": "input-text",
                                    "field_data_name": "fld_2375",
                                    "placeholder": null,
                                    "default_value": "",
                                    "act_as_assign": "",
                                    "custom_validation": {
                                        "unable_to_edit": "0",
                                        "data_type": "0"
                                    },
                                    "value": "055098393",
                                    "group_index": 0
                                },
                                {
                                    "field_name": "\u05de\u05d9\u05d9\u05dc",
                                    "field_type_name": "input-email",
                                    "field_data_name": "fld_2376",
                                    "placeholder": null,
                                    "default_value": "",
                                    "act_as_assign": "",
                                    "custom_validation": {
                                        "unable_to_edit": "0"
                                    },
                                    "value": "meir@arma.co.il",
                                    "group_index": 0
                                }
                            ]
                        ]
                    }
                ]
            },
            "single_permission": null
        },
        {
            "instance_data": {
                "_id": "60a3a7e6788c2124f12b5370",
                "insertTimestamp": "2021-05-18T14:41:26+0300",
                "field_groups": [
                    {
                        "field_group_data": {
                            "group_name": "\u05e1\u05e4\u05e8 \u05d8\u05dc\u05e4\u05d5\u05e0\u05d9\u05dd",
                            "group_data_name": "g_353",
                            "group_id": "353",
                            "repeatable_group": "0",
                            "permissions": {
                                "type": "full",
                                "code": "1"
                            }
                        },
                        "fields_data": [
                            [
                                {
                                    "field_name": "\u05e9\u05dd \u05e4\u05e8\u05d8\u05d9",
                                    "field_type_name": "input-text",
                                    "field_data_name": "fld_2372",
                                    "placeholder": null,
                                    "default_value": "",
                                    "act_as_assign": "",
                                    "custom_validation": {
                                        "unable_to_edit": "0",
                                        "data_type": "0"
                                    },
                                    "value": "\u05d0\u05e8\u05d9\u05d4",
                                    "group_index": 0
                                },
                                {
                                    "field_name": "\u05e9\u05dd \u05de\u05e9\u05e4\u05d7\u05d4",
                                    "field_type_name": "input-text",
                                    "field_data_name": "fld_2373",
                                    "placeholder": null,
                                    "default_value": "",
                                    "act_as_assign": "",
                                    "custom_validation": {
                                        "unable_to_edit": "0",
                                        "data_type": "0"
                                    },
                                    "value": "\u05de\u05e6\u05dc\u05d9\u05d7",
                                    "group_index": 0
                                },
                                {
                                    "field_name": "\u05d9\u05d9\u05e9\u05d5\u05d1 \u05de\u05d2\u05d5\u05e8\u05d9\u05dd",
                                    "field_type_name": "select-list",
                                    "field_data_name": "fld_2374",
                                    "placeholder": null,
                                    "default_value": "",
                                    "possible_values": "[\"\\u05db\\u05e4\\u05e8 \\u05e1\\u05d1\\u05d0\",\"\\u05ea\\u05dc \\u05d0\\u05d1\\u05d9\\u05d1\",\"\\u05e2\\u05d6\\u05d4\",\"\\u05d9\\u05e8\\u05d5\\u05e9\\u05dc\\u05d9\\u05dd\"]",
                                    "act_as_assign": "",
                                    "custom_validation": {
                                        "unable_to_edit": "0",
                                        "alphabetical_order": "0"
                                    },
                                    "value": "\u05e2\u05d6\u05d4",
                                    "group_index": 0
                                },
                                {
                                    "field_name": "\u05d8\u05dc\u05e4\u05d5\u05df",
                                    "field_type_name": "input-text",
                                    "field_data_name": "fld_2375",
                                    "placeholder": null,
                                    "default_value": "",
                                    "act_as_assign": "",
                                    "custom_validation": {
                                        "unable_to_edit": "0",
                                        "data_type": "0"
                                    },
                                    "value": "055098393",
                                    "group_index": 0
                                },
                                {
                                    "field_name": "\u05de\u05d9\u05d9\u05dc",
                                    "field_type_name": "input-email",
                                    "field_data_name": "fld_2376",
                                    "placeholder": null,
                                    "default_value": "",
                                    "act_as_assign": "",
                                    "custom_validation": {
                                        "unable_to_edit": "0"
                                    },
                                    "value": "arie@arma.co.il",
                                    "group_index": 0
                                }
                            ]
                        ]
                    }
                ]
            },
            "single_permission": null
        }
    ]
}

when I put the class into VS i get an error on the following
public class FieldGroup
{
    public FieldGroupData field_group_data { get; set; }
    public List<List<>> fields_data { get; set; }
}

on List<List<>

Unexpected use of an unbound generic name

*I am at present saving the json to a file how do i deserialize it with the classes generated?

A: In your particular example, the converter seems to have fallen over the list of lists:
...
"fields_data": [
    [
        {
            "field_name": "\u05e9\u05dd \u05e4\u05e8\u05d8\u05d9",
            "field_type_name": "input-text",
            "field_data_name": "fld_2372",
            "placeholder": null,
            "default_value": "",
            "act_as_assign": "",
            "custom_validation": {
                "unable_to_edit": "0",
                "data_type": "0"
            },
            "value": "\u05de\u05d0\u05d9\u05e8",
            "group_index": 0
        }
        ...

To work around this problem, you can then perform a second conversion by grabbing one of the items from the list, i.e.:
{
    "field_name": "\u05e9\u05dd \u05e4\u05e8\u05d8\u05d9",
    "field_type_name": "input-text",
    "field_data_name": "fld_2372",
    "placeholder": null,
    "default_value": "",
    "act_as_assign": "",
    "custom_validation": {
        "unable_to_edit": "0",
        "data_type": "0"
    },
    "value": "\u05de\u05d0\u05d9\u05e8",
    "group_index": 0
}

And repeating the conversion process. Simply rename the Root class to something useful, such as Field and add this in the List<List<>> definition, i.e. List<List<Field>>. The resulting classes may look as follows:
// These are the new classes from the second conversion
public class CustomValidation
{
    public string unable_to_edit { get; set; }
    public string data_type { get; set; }
}

// Renamed this from Root to Field
public class Field
{
    public string field_name { get; set; }
    public string field_type_name { get; set; }
    public string field_data_name { get; set; }
    public object placeholder { get; set; }
    public string default_value { get; set; }
    public string act_as_assign { get; set; }
    public CustomValidation custom_validation { get; set; }
    public string value { get; set; }
    public int group_index { get; set; }
}

// These are the original classes from the first conversion attempt
public class Info
{
    public int total_count { get; set; }
    public int current_page_total_count { get; set; }
    public int max_each_page { get; set; }
    public int current_page_number { get; set; }
    public int total_pages { get; set; }
}

public class Permissions
{
    public string type { get; set; }
    public string code { get; set; }
}

public class EntityData
{
    public string entity_name { get; set; }
    public string entity_data_name { get; set; }
    public Permissions permissions { get; set; }
    public string view { get; set; }
}

public class FieldGroupData
{
    public string group_name { get; set; }
    public string group_data_name { get; set; }
    public string group_id { get; set; }
    public string repeatable_group { get; set; }
    public Permissions permissions { get; set; }
}

public class FieldGroup
{
    public FieldGroupData field_group_data { get; set; }

    // Updated this field type to include the Field class
    public List<List<Field>> fields_data { get; set; }
}

public class InstanceData
{
    public string _id { get; set; }
    public DateTime insertTimestamp { get; set; }
    public List<FieldGroup> field_groups { get; set; }
}

public class Datum
{
    public InstanceData instance_data { get; set; }
    public object single_permission { get; set; }
}

public class Root
{
    public Info info { get; set; }
    public EntityData entity_data { get; set; }
    public List<Datum> data { get; set; }
}

This is merely a starting point, so make sure to rename the classes to make sense to your application (for example Root might not be that descriptive) and remove any fields that you are not using (as the deserializer will then happily ignore them.)
To deserialize you can use the JsonSerializer in System.Text.Json if you are on later versions of .NET Core: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-overview...
Root root = JsonSerializer.Deserialize<Root>(json);

Note that you may have issues with the date time format being used. If you do not use this field you can simply remove it from your classes it otherwise you will need to specify the date time converter:
JsonSerializerOptions options = new JsonSerializerOptions();
options.Converters.Add(new DateTimeConverterUsingDateTimeParse());
Root root = JsonSerializer.Deserialize<Root>(json, options);

A: I was able to convert the json to class with no problems.
EDIT
Oh! I understand now. The json-to-csharp parser didn't convert a part of the json to c-sharp. has pointed out above, just get the part of the json that was not parse and try converting that alone so the below json becomes...
    {
        "field_name": "\u05e9\u05dd \u05e4\u05e8\u05d8\u05d9",
        "field_type_name": "input-text",
        "field_data_name": "fld_2372",
        "placeholder": null,
        "default_value": "",
        "act_as_assign": "",
        "custom_validation": {
            "unable_to_edit": "0",
            "data_type": "0"
        },
        "value": "\u05de\u05d0\u05d9\u05e8",
        "group_index": 0
    }

//The charp object for the json above

public class CustomValidation
{
    public string unable_to_edit { get; set; }
    public string data_type { get; set; }
}

public class Field
{
    public string field_name { get; set; }
    public string field_type_name { get; set; }
    public string field_data_name { get; set; }
    public object placeholder { get; set; }
    public string default_value { get; set; }
    public string act_as_assign { get; set; }
    public CustomValidation custom_validation { get; set; }
    public string value { get; set; }
    public int group_index { get; set; }
}

//then correct "fields_data" type (List<List<>>) to "List<List<Field>>"

// Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
public class Info
{
    public int total_count { get; set; }
    public int current_page_total_count { get; set; }
    public int max_each_page { get; set; }
    public int current_page_number { get; set; }
    public int total_pages { get; set; }
}

public class Permissions
{
    public string type { get; set; }
    public string code { get; set; }
}

public class EntityData
{
    public string entity_name { get; set; }
    public string entity_data_name { get; set; }
    public Permissions permissions { get; set; }
    public string view { get; set; }
}

public class FieldGroupData
{
    public string group_name { get; set; }
    public string group_data_name { get; set; }
    public string group_id { get; set; }
    public string repeatable_group { get; set; }
    public Permissions permissions { get; set; }
}

public class FieldGroup
{
    public FieldGroupData field_group_data { get; set; }
    //correct "fields_data" type (List<List<>>) to "List<List<Field>>"
    //public List<List<>> fields_data { get; set; }
    public List<List<Field>> fields_data { get; set; }//List<List<Field>>
}

public class InstanceData
{
    public string _id { get; set; }
    public DateTime insertTimestamp { get; set; }
    public List<FieldGroup> field_groups { get; set; }
}

public class Datum
{
    public InstanceData instance_data { get; set; }
    public object single_permission { get; set; }
}

public class Root
{
    public Info info { get; set; }
    public EntityData entity_data { get; set; }
    public List<Datum> data { get; set; }
}


text:
Q: Failed to update user in Active Directory (using Boomi mapping) I can create user using Boomi without any SSL(means using port389) and password(for new user to login)  but I want to change user's phone number, and I got this error:
javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 00000057: LdapErr: DSID-0C042612, comment: Error in attribute conversion operation, data 0, v4563?]; remaining name ''???at java.naming/com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3332)???at java.naming/com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:3205)???at java.naming/com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2996)???at java.naming/com.sun.jndi.ldap.LdapCtx.c_modifyAttributes(LdapCtx.java:1504)???at java.naming/com.sun.jndi.toolkit.ctx.ComponentDirContext.p_modifyAttributes(ComponentDirContext.java:277)???at java.naming/com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(PartialCompositeDirContext.java:192)???at java.naming/com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(PartialCompositeDirContext.java:181)???at java.naming/javax.naming.directory.InitialDirContext.modifyAttributes(InitialDirContext.java:167)???at com.boomi.connector.LDAP.LDAPConnection.updateObject(LDAPConnection.java:190)???at com.boomi.connector.LDAP.LDAPUpdateOperation.executeUpdate(LDAPUpdateOperation.java:227)???at com.boomi.connector.util.BaseUpdateOperation.execute(BaseUpdateOperation.java:30)???at com.boomi.connector.generic.GenericConnectorAction.invoke(GenericConnectorAction.java:189)???at com.boomi.connector.generic.GenericConnectorAction.invoke(GenericConnectorAction.java:172)???at com.boomi.connector.base.BaseConnectorAction.invokeBase(BaseConnectorAction.java:368)???at com.boomi.connector.base.BaseConnectorAction.invokeWithReadStore(BaseConnectorAction.java:304)???at com.boomi.connector.base.BaseConnectorAction.invoke(BaseConnectorAction.java:276)???at jdk.internal.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)???

and I googled this error means:
Indicates that the LDAP server cannot process the request because of server-defined restrictions. This error is returned for the following reasons:
1. The add entry request violates the server's structure rules
2. The modify attribute request specifies attributes that users cannot modify -> I just want to change phone number.
3. Password restrictions prevent the action
4. Connection restrictions prevent the action. -> I think I can create user, so the connection is fine!

If LDAP error Code 53 means I need to do everything with "SSL", why I can create a user? How can I sort this problem out?

A: It's possible the user actually hasn't been properly provisioned. Maybe it's been created, but the account is not enabled because the password is invalid. Run an LDAP client and try and logon as the new user with the credentials that you supplied. Does it work?
Two suggestions:

*

*Please use LDAPS if you're creating users/setting passwords, or basically anything in AD LDAP. There's no excuse not to these days, and Microsoft is in the process of deprecating plain LDAP from non-Windows clients, so you might as well do it now. All you need is to install/trust the issuing CA certificate chain (root and intermediate certs) for whatever CA is signing the DC's LDAPS certificate. You do not need to install any client LDAP cert.

*Check the password policy of the target domain and ensure the passwords you are trying to set meet the requirements in terms of complexity, length and so on.


text:
Q: breaking the lxml.etree.HTML.xpath max parsing depth limit The HTML xpath parser from lxml.etree seems to have max depth limit. It won't traverse further to parse the text if the depth exceeds 254. Here's a python code snippet demonstrating this:
import lxml.etree as etree

# Setup HTML tabs
x = ""
x_ = ""

# Set recursion depth to 255
depth = 255

# Construct and parse using lxml.etree.HTML
# This gives an empty list []
print(etree.HTML(x * depth + "
text to be extracted
" + x_* depth).xpath("//p//text()"))

# Set the recursion depth to 254
depth = 254

# This gives the correct result ['text to be extracted']
print(etree.HTML(x * depth + "
text to be extracted
" + x_* depth).xpath("//p//text()"))

In some use cases, we will encounter large text files which recursion depth is larger than 254, then the lxml parser will fail to provide the desired text. How could we break the limit to let it parse beyond 254 recursions?
XSLT document provides a static method called set_global_max_depth which enables the user to customize the max depth it could traverse, is there any similar method provided in lxml.etree.HTML?
This mail post discusses the traversing depth of XSLT and might be helpful.

A: Try to parse with a custom HTMLParser instance where huge_tree is set to True. Also see this question for the XML case. (This has nothing to do with XPath by the way.)


text:
Q: How to keep samba connection with TOSMBClient Library I'm following TOSMBClient library link:TOSMBClient to share file from pc to my iPhone,This library is working to connect and copy file to my iPhone. But it takes very long time to connect to host and every time when copy file is done samba will disconnect. I want to keep samba connection.
Have anyone have idea or used to work with TOSMBClient library please help or suggest idea.

A: I'm the original developer of TOSMBClient. :)
The library is a thin Objective-C wrapper around another library called libdsm. The process of connecting to a host is at libdsm's level, so if your particular connection is slow, there's not a lot that can be done on the TOSMBClient level. It might be worth reporting an issue on libdsm's Github repo describing your hardware setup.
The connection dropping after a file copy operation is complete is curious. I can't be sure where that issue might be happening. Again, more information would be required. A complete set of steps to reproduce would be great. If you get the chance, feel free to file another issue on the GitHub!


text:
Q: How to allow user www-data use sudo commands without password I want to allow run specify command on my website, through PHP exec() function, so i found the way, to add www-data in sudoers.d files to allow run specify commands without asking password.
I tried next things:

*

*check where is program catalogue
whereis hashcat -> hashcat: /usr/bin/hashcat

*Add a new file to sudo visudo /etc/sudoers.d/www-data and add next line www-data ALL=(www-data:www-data)NOPASSWD: /user/bin/hashcat

*Try to run it through www-data: sudo -u www-data sudo hashcat
And then i get this: [sudo] password for www-data:, that means it doesn't seems to work

What can i do wrong, and what i should do then? And is my decision to do so correct? Is there a better and safer solution?

A: That problem is solved, by removing the (www-data:www-data) so my "www-data: file in sudoers.d looks like: www-data ALL=NOPASSWD: /usr/bin/hashcat
Thanks all for answering and give me a hint to solve this! Especially thanks to @cyberbrain for my carelessness!


text:
Q: Can I declare a variable name like this $(variable name) in PHP? I want to get the resulting string(field name) of the mysql function, mysql_field_name() and declare that as a variable,so that I can use it later in my program.
For example, like this:
$(mysql_field_name($result,2)) = 2;

Here, can I use this statement like this : $(mysql_field_name($result,2));
Is it a correct variable declaration?
Will it work and will it declare a variable with field name as the variable name?

A: ${mysql_field_name($result,2)} = 2

http://codepad.org/NRok2Cha

A: This is how you can do what you want in PHP:
$varname = mysql_field_name($result, 2);
$$varname = 2;

More info in the PHP manual: Variable variables


text:
Q: How to load a csv file to hbase from local directory? I tried to load a csv from my local directory to hbase using similar command we have for hdfs but it failed.
I dont want to put my file into hdfs and load to hbase. Is there a way to load the data into hbase from local.
The below did not help
     hbase(main):010:0> hbase org.apache.hadoop.hbase.mapreduce.ImportTsv -Dimporttsv.separator="," \
-Dimporttsv.columns="HBASE_ROW_KEY,events:driverId,events:driverName,events:eventTime,events:eventType,events:latitudeColumn,events:longitudeColumn,events:routeId,events:routeName,events:truckId" \
irfan_ns:driver_dangerous_event \
file:///home/aziz/driver

Error

SyntaxError: (hbase):10: syntax error, unexpected tIDENTIFIER


text:
Q: Axios always runs .then with invalid url I am using axios to make a HTTP get a call, if I specify an invalid URL axios runs the .then() as if it was successful. How to I get it to error if it can't find the url
import React, { Component } from "react";
import axios from "axios";

export default class AxiosRequest extends Component {
  render() {
    axios
      .get("invalidurl")

      .then(response => {
        console.log("Axios request successful...or was it, No it wasnt");
      })
      .catch(err => {
        console.log("Axios request error", err);
      });

    return
Axios Request
;
  }
}

Running sandbox to show the issue.
https://codesandbox.io/s/9lmn7316kp

A: The reason for this is if you open the "Network" console in you web browser, you will see the request being made is to the webpage you are currently on (the sandbox), thus returning a 200. If you put in a real url such as http://google.com/ you will see the correct return.


text:
Q: vuejs FormData doesn't send json I'm not quite sure what's causing it, but I'm using nuxtjs and attempting to send username and password to my Go server in json form. This is my vue code:
<template>

Login

    Username
    <input class="input-block" type="text" v-model="username">

    Password
    <input class="input-block" type="password" v-model="password">

    <button v-on:click="login">Login</button>

</template>

I have also tried to remove {emulateJSON: true} but the result is the same.
The server Go code looks like this:
func LoginPOST(w http.ResponseWriter, r *http.Request) {
  var loginForm struct {
    Username string `json:"username"`
    Password string `json:"password"`
  }
  body, err := ioutil.ReadAll(r.Body)
  if err != nil {
    // return 422
    return
  }
  fmt.Println("body string:", string(body))
  err = json.Unmarshal(body, &loginForm)
  if err != nil {
    fmt.Println(err)
    // return 422
    return
  }
  ...
}

The json.Unmarshal error will print: invalid character '-' in numeric literal, and that's because the r.Body is:
body string: -----------------------------10632500131211292840295750524
Content-Disposition: form-data; name="username"

MYUSERNAME
-----------------------------10632500131211292840295750524
Content-Disposition: form-data; name="password"

MYPASSWORD
-----------------------------10632500131211292840295750524--

I'm quite sure the Go code is correct, but I can't figure out why vue-resource sends the FormData in that way. I'd appreciate if someone could show how to send json and nothing else in the request

A: NProgress.start()
      var formData = {
        username: this.username,
        password: this.password
      }
      this.$http.post(loginURL, formData).then(response => {
        console.log(response)
      }, response => {
        console.log(response)
      })

A regualr formdata object from the browser is never json encoded as far as i know. So just define a json object and everything should be fine.


text:
Q: How to avoid compiler warnings when treating UITextField the same as UITextView Scenario:
I have two UITableViewCells containing a UITextField property and UITextView property respectively. Obviously both of these properties have properties in common, such as 'text' and 'textColor'
Objective:
Indiscriminately assign a string to the UITextField/UITextView's text property without raising compiler warnings. Can it be done?
Here's an example of what I'm doing:
Currently I do this to avoid compiler warnings:
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
UITextField *textField;
UITextView *textView;
switch (indexPath.section) {
    case SectionDescription:
        textField = (UITextField *)[(TextFieldCell *)cell contents];
        textField.text = self.plan.description;
        break;

    case SectionNotes:
        textView = (UITextView *)[(TextViewCell *)cell contents];
        textView.text = self.plan.notes;
        break;
}

But I'd like to do something closer to this without the compiler warnings:
NSString *contents = [self getContents];

UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
UIView *textView = (?? *)[(?? *)cell contents];
textView.text = contents;

Is there a standard way to do this? I know if both objects conformed to a common protocol I could do something like "UIView  *textView = [cell contents];" Is there an answer to this question?

A: Try using [(id)textView setText:contents].


text:
Q: What does this sentence mean? "I want to do me. I'm going to do me." What does this sentence mean? "I want to do me. I'm going to do me."

A: While it's user based, Urban Dictionary has your answer. The phrase "doing me" refers to the speaker focusing on their own well-being.

"The act of taking care of yourself first. Making yourself happy. Not
  trying to please others."

I'd note that if you read the entries on the Urban Dictionary page I linked, only the first two are relevant.

A: The context need not be specified. This is from a dialect of English used mostly in television screenplays. A young person is preparing for some kind of social situation (a date or an interview, for example), and their friend is telling them the different faces they can wear. Can you do serious? Can you do committed? Can you do heroic? After some soul searching, the hero realizes that they will be out of face if they try too hard to put on airs, and decides they will just behave normally.

A: I want to be myself.  I am going to be myself.


text:
Q: Open a popup window on Magento home page once when user open a site I want to open a popup in homepage once every time when a user visits a site.
The problem is now popup appears every time when reload the homepage. I just want to show this popup once.
 <?php $currentUrl = Mage::helper('core/url')->getCurrentUrl();
 if($currentUrl=='http://website.com/')
 {
 ?>
<form action="<?php echo $this->getUrl('subscribe/index/subscriptionsave/'); ?>" id="subscribeForm" method="post">

  close

Stay in the loop!!

Be the first one to know about new arrivals,
fresh offers &  fashion updates.

        <?php /*?> Email Address*<?php */?>
         <input type="text" class="input-text required-entry validate-email" placeholder="Email Address *"  name="emailid" id="emailid">

           <input type="submit" name="sub" value="Submit" class="btn">

Get flat 20% Off on your First purchase. Use coupon "INDULGE20".

</form>
 <?php } ?>

    <?php */?>

A: Save in cookies value for example OPENED = 1  then during next page open at php side check if such cookie present already then do not add your popup code or make that check at javascript side and do not display popup
JS implementation example
1) add set and get cookies functions to your js - see manual here about setCookie and getCookie - http://www.w3schools.com/js/js_cookies.asp

2) simply enclose with if contion code which show your popup, as i understood from your messy code it was jQuery(id).fadeIn(2000);
if( getCookie('popup_opened') == "" ){
     jQuery(id).fadeIn(2000);

     // creates popup_opened cookie and will keep it till browser close
     setCookie('popup_opened', '1', 0)
}

NOTE: by this solution your visitor at lease once should see that popup on his each used browser as cookies are stored in each browser separatly


text:
Q: Gitlab project : 500 Whoops, something went wrong on our end Hi every one i migrated gitlab-ce into a new instance with new domain name
Migration :

*

*Gitlab Backup --> Restore

Gitlab Version:

*

*13.6.2

Problem :
when Clicking a Project it returns :
"500  Whoops, something went wrong on our end "
Gitlab status
run: alertmanager: (pid 1766) 3439s; run: log: (pid 1764) 3439s
run: crond: (pid 1775) 3439s; run: log: (pid 1770) 3439s
run: gitaly: (pid 1724) 3439s; run: log: (pid 1723) 3439s
run: gitlab-exporter: (pid 1750) 3439s; run: log: (pid 1749) 3439s
run: gitlab-workhorse: (pid 1761) 3439s; run: log: (pid 1748) 3439s
run: grafana: (pid 1767) 3439s; run: log: (pid 1765) 3439s
run: logrotate: (pid 1752) 3439s; run: log: (pid 1751) 3439s
run: nginx: (pid 1746) 3439s; run: log: (pid 1745) 3439s
run: node-exporter: (pid 1742) 3439s; run: log: (pid 1740) 3439s
run: postgres-exporter: (pid 1769) 3439s; run: log: (pid 1768) 3439s
run: postgresql: (pid 1726) 3439s; run: log: (pid 1720) 3439s
run: prometheus: (pid 1774) 3439s; run: log: (pid 1773) 3439s
run: puma: (pid 1747) 3439s; run: log: (pid 1734) 3439s
run: redis: (pid 1718) 3439s; run: log: (pid 1716) 3439s
run: redis-exporter: (pid 1757) 3439s; run: log: (pid 1756) 3439s
run: registry: (pid 1760) 3439s; run: log: (pid 1759) 3439s
run: sidekiq: (pid 1741) 3439s; run: log: (pid 1731) 3439s

Application Check
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.13.0 ? ... OK (13.13.0)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Internal API available: OK
Redis available via internal API: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... Server: ldapmain
Exception: getaddrinfo: Name or service not known

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... skipped (no tmp uploads folder yet)
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Projects have namespace: ...
Mahdi Hannoun / test ... yes
octopeek-xenonstack / bdaas-application / frontend ... yes
octopeek-xenonstack / bdaas-application / backend ... yes
Julien Hay / ProxyBench ... yes
flowbird-bi / data-management ... yes
flowbird-bi / reports-management ... yes
smart-data / abbakan ... yes
Hamid Zemirline / deployment-automation ... yes
rbc / ged-ratios ... yes
Oumar Fall / bytel ... yes
bouygues_dataviz / frontend ... yes
bouygues_dataviz / backend ... yes
E-TIPI / etipi-react-native-application ... yes
Julien Hay / VilleFR ... yes
flowbird-bi / report-sources ... yes
flowbird-bi / report-queries ... yes
octopeek-io / front-end ... yes
octopeek-io / old-back-end ... yes
showroomprive / archive / frontend-lot1 ... yes
Laure Normand / FormationDB ... yes
librestamp / librestamp ... yes
flowbird-bi / deployment-automation ... yes
showroomprive / archive / parse-prepare-process ... yes
showroomprive / scraping-vente-privee ... yes
octopeek-io / site ... yes
Julien Hay / TwitterCrawler ... yes
showroomprive / front-end ... yes
Sedki Boubakri / srp ... yes
showroomprive / back-end ... yes
showroomprive / extract-image-srp ... yes
showroomprive / archive / application-libs-broken ... yes
Guillaume Ambrois / my-test-project ... yes
flowbird-bi / data-processing ... yes
Hamid Zemirline / src_flb_bi ... yes
Julien Hay / thang-matching ... yes
Pierre Gauthier / scraping_linkedin ... yes
smaps / back-end ... yes
flowbird-uk / poc ... yes
matching-rh / archive / front-end ... yes
matching-rh / archive / back-end ... yes
matching-rh / archive / application-libs ... yes
showroomprive / functional-tests ... yes
Guillaume Ambrois / application-libs ... yes
E-TIPI / application-libs ... yes
showroomprive / data-ingestion ... yes
Guillaume Ambrois / back-end ... yes
librestamp / application-libs ... yes
Guillaume Ambrois / application-libs-DO_NOT_TOUCH ... yes
showroomprive / application-libs ... yes
Pierre Gauthier / Matching_linkedin_page_jaune ... yes
matching-rh / archive / front-end-demo ... yes
infra / ansible-hortonworks ... yes
misc / requests ... yes
Krystian Luczyszyn / scrapping ... yes
Pierre Gauthier / MAJ_Index_Linkedin ... yes
Guillaume Ambrois / private ... yes
test-gitlab / test ... yes
Djamal KESSOUM / Infra_freeipa-ansible ... yes
Guillaume Ambrois / front-end ... yes
showroomprive / scraping-privalia ... yes
side-effects-detection / application_libs ... yes
side-effects-detection / backend ... yes
side-effects-detection / frontend ... yes
octopeek-io / old-front-end ... yes
Besma Khalfi / data-ingestion ... yes
showroomprive / scheduled-scripts ... yes
Moncef Mouffok / emailing ... yes
infra / octopeek-dev-sandbox ... yes
infra / devices-conf ... yes
corp-agency / data-acquisition ... yes
Guillaume Ambrois / gsuite-to-sheets ... yes
infra / ansible-octopeek-infra ... yes
corp-agency / data-normalization ... yes
infra / tools ... yes
showroomprive / data-restitution ... yes
Julien Hay / LinkedInCrawler ... yes
Oumar Fall / octopeek-commons ... yes
corp-agency / misc-scripts ... yes
octopeek-commons / front-octopeek-menu ... yes
octopeek-commons / front-octopeek-multi-language ... yes
octopeek-commons / front-file-drop-upload ... yes
octopeek-templates / octopeek-workspace ... yes
octopeek-io / deep-end ... yes
Oumar Fall / node-backend ... yes
corp-agency / data-processing ... yes
octopeek-io / back-end ... yes
Bertrand Laporte / cicd-test ... yes
Besma Khalfi / BesmaProject ... yes
Besma Khalfi / CI-CD testing  ... yes
these_mmouffok / memoire ... yes
data-acquisition / sirene ... yes
data-acquisition / pages-jaunes ... yes
Mahdi MENACER / workshop-git ... yes
matching-rh / archive / deep-end ... yes
these_mmouffok / deep_domain_adaptation_code ... yes
data-acquisition-tools / email-creation ... yes
RH-Matching-demo / front-end ... yes
these_mmouffok / sketch_based_3D_shape_code ... yes
RH-Matching-demo / back-end ... yes
RH-Matching-demo / Deep-end-demo ... yes
data-ingestion / company ... yes
academai / jupyter ... yes
matching-rh / deep-end-emploi-collectivites ... yes
Carole Lambert / deep-end-emploi-collectivites ... yes
Julien Hay / Twirona ... yes
matching-rh / back-end-demo-emploi-collectivites ... yes
matching-rh / front-end-demo-emploi-collectivites ... yes
RH-Matching-demo / front-end-demo-emploi-collectivites ... yes
octopeek-io / catalogue-services ... yes
data-performance / AVY-Salon Aveyron ... yes
octopeek-io / Mongodb_catalogue ... yes
octopeek-io / catalogue-services-front-admin ... yes
octopeek-io / api_catalogue_services ... yes
Oumar Fall / demo-cicd ... yes
octopeek-web / apache-configuration ... yes
infra / octopeek-template ... yes
infra / octopeek-provisioning ... yes
Oumar Fall / api_ioss ... yes
octopeek-xenonstack / bdaas-infra-deploy / ambari-deploy ... yes
octopeek-xenonstack / bdaas-infra-deploy / kubespray ... yes
octopeek-xenonstack / bdaas-infra-deploy / helm-charts ... yes
octopeek-xenonstack / bdaas-infra-deploy / k8s-storage ... yes
octopeek-xenonstack / bdaas-app-deploy / frontend-helm ... yes
octopeek-xenonstack / bdaas-app-deploy / backend-helm ... yes
Samy Tafasca / AutoEDA ... yes
Oumar Fall / demo-ansible-gitlab-ci ... yes
octopeek-xenonstack / bdaas-infra-deploy / ci-experiment ... yes
Hamid Zemirline / aaa-service ... yes
IOSS / ioss-ui-socle ... yes
IOSS / ioss-user-mgt-service ... yes
IOSS / ioss-authentication ... yes
Erwan Benkara / AutoEDA ... yes
octopeek-xenonstack / bdaas-application / component-deploy-backend ... yes
octopeek-xenonstack / bdaas-app-deploy / component-deploy-backend-helm ... yes
Hamid Zemirline / helm-repo ... yes
IOSS / ioss-user-mgt-api ... yes
IOSS / ioss-deploy ... yes
IOSS / ioss-user-log-service ... yes
IOSS / ioss-dev-stack ... yes
IOSS / helm-charts ... yes
SedkiBoubakri / EdaPerformanceTest ... yes
weather-data-acquisition / Web scraping ... yes
SedkiBoubakri / Profiling ... yes
IOSS / cdap-tests ... yes
Thomas Levy / explainability ... yes
IOSS / cdap-operator ... yes
IOSS / cdap-build ... yes
IOSS / cdap ... yes
IOSS / cdap-plugins ... yes
CDAP-plugins / product-auto-extract ... yes
CDAP-plugins / elasticsearch-source-plugin ... yes
CDAP-plugins / diffbotcrawl-action ... yes
CDAP-plugins / octopeek-http-plugins ... yes
CDAP-plugins / explainability-poc ... yes
IOSS / pipelines ... yes
CDAP-plugins / webdataextractor ... yes
Julien Hay / POCImmo ... yes
Samy Tafasca / autoeda_spark ... yes
Stephane Durfort / Python Plugins POC ... yes
CDAP-plugins / python-plugins ... yes
IOSS / cdap-plugin-test ... yes
CDAP-plugins / interpreted-Python-for-matching ... yes
IOSS / hub-templates ... yes
misc / ohb-cluster-archives ... yes
CDAP-plugins / diffbot-tools ... yes
IOSS / devops-scripts ... yes
IOSS / mvn-depgraph ... yes
CDAP-plugins / product-classification ... yes
Ahmed Zouari / Product_Classification ... yes
CDAP-plugins / scraping-confidence ... yes
CDAP-plugins / text-normalization-directive ... yes
CDAP-plugins / random-hash ... yes
IOSS / cdap_cookbook ... yes
CDAP-plugins / text-normalization-directive_with_parameter ... yes
CDAP-plugins / sentiment-analysis ... yes
CDAP-plugins / oit-commons ... yes
IOSS / french-product-classification ... yes
CDAP-plugins / TextNormalizationPlugin ... yes
CDAP-plugins / ai-enrich-plugin ... yes
CDAP-plugins / aienrich ... yes
IOSS / automapping ... yes
Stephane Durfort / Mvn Build Number Test ... yes
CDAP-plugins / widgets-demo ... yes
CDAP-plugins / data-generator ... yes
Lorenzo Faccioli / hubspot_migration ... yes
CDAP-plugins / java-basics ... yes
cdapio_old / cdap-build ... yes
IOSS / cdap-mirroring ... yes
cdapio_old / hydrator-plugins ... yes
cdapio_old / cdap-security-extn ... yes
cdapio_old / wrangler ... yes
cdapio_old / bigquery-delta-plugins ... yes
cdapio_old / delta ... yes
cdapio_old / database-delta-plugins ... yes
cdapio_old / amazon-s3-plugins ... yes
cdapio_old / azure ... yes
cdapio_old / condition-plugins ... yes
cdapio_old / google-cloud ... yes
cdapio_old / kafka-plugins ... yes
cdapio_old / mmds ... yes
Lorenzo Faccioli / Get refresh token ... yes
cdapio_old / cdap ... yes
cdapio_old / cdap-ui ... yes
CDAP-plugins / Get Refresh Token ... yes
CDAP-plugins / Google Drive refresh token ... yes
Lorenzo Faccioli / test ... yes
test-group / Repotest ... yes
cdapio_old / mirroring-test ... yes
cdapio / cdap-build ... yes
cdapio / cdap ... yes
cdapio / cdap-ui ... yes
cdapio / hydrator-plugins ... yes
cdapio / cdap-security-extn ... yes
cdapio / wrangler ... yes
cdapio / bigquery-delta-plugins ... yes
cdapio / delta ... yes
cdapio / database-delta-plugins ... yes
cdapio / amazon-s3-plugins ... yes
cdapio / azure ... yes
cdapio / condition-plugins ... yes
cdapio / google-cloud ... yes
cdapio / kafka-plugins ... yes
cdapio / mmds ... yes
Ossama Assaghir / mirroring-test ... yes
CDAP-plugins / elasticsearch-plugins-release-1.10 ... yes
CDAP-plugins / test_besma ... yes
CDAP-plugins / elasticsearch-plugins-release-1.10.0 ... yes
cdapio / elasticsearch-plugins ... yes
IOSS / SpecializedScraperPOC ... yes
Redis version >= 4.0.0? ... yes
Ruby version >= 2.5.3 ? ... yes (2.7.2)
Git version >= 2.29.0 ? ... yes (2.29.0)
Git user has default SSH configuration? ... yes
Active users: ... 40
Is authorized keys file accessible? ... yes
GitLab configured to store new projects in hashed storage? ... yes
All projects are in hashed storage? ... yes

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

For ldap error it's just because ldap server is shut down at the moment
here is gitlab-reails/production.log when i click a project
==> /var/log/gitlab/gitlab-rails/production.log <==
ActionView::Template::Error ():
    128:           = render_if_exists 'layouts/nav/sidebar/project_jira_issues_link', issue_tracker: issue_tracker
    129:         - else
    130:           = nav_link do
    131:             = link_to issue_tracker.issue_tracker_path, target: '_blank', rel: 'noopener noreferrer', class: 'shortcuts-external_tracker' do
    132:               .nav-icon-container
    133:                 = sprite_icon('external-link')
    134:               %span.nav-item-name

app/models/project_services/data_fields.rb:14:in `url'
app/models/project_services/issue_tracker_service.rb:63:in `issue_tracker_path'
app/views/layouts/nav/sidebar/_project.html.haml:131
app/helpers/tab_helper.rb:78:in `nav_link'
app/views/layouts/nav/sidebar/_project.html.haml:130
app/views/layouts/_page.html.haml:3
app/views/layouts/application.html.haml:13
app/views/layouts/project.html.haml:16
app/controllers/application_controller.rb:134:in `render'
app/controllers/application_controller.rb:554:in `block in allow_gitaly_ref_name_caching'
lib/gitlab/gitaly_client.rb:318:in `allow_ref_name_caching'
app/controllers/application_controller.rb:553:in `allow_gitaly_ref_name_caching'
app/controllers/application_controller.rb:499:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:490:in `set_session_storage'
lib/gitlab/i18n.rb:73:in `with_locale'
lib/gitlab/i18n.rb:79:in `with_user_locale'
app/controllers/application_controller.rb:484:in `set_locale'
lib/gitlab/error_tracking.rb:52:in `with_context'
app/controllers/application_controller.rb:549:in `sentry_context'
app/controllers/application_controller.rb:477:in `block in set_current_context'
lib/gitlab/application_context.rb:54:in `block in use'
lib/gitlab/application_context.rb:54:in `use'
lib/gitlab/application_context.rb:21:in `with_context'
app/controllers/application_controller.rb:469:in `set_current_context'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:21:in `call'
lib/gitlab/middleware/multipart.rb:234:in `call'
lib/gitlab/middleware/read_only/controller.rb:50:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
lib/gitlab/middleware/request_context.rb:23:in `call'
config/initializers/fix_local_cache_middleware.rb:9:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:76:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'

thank you in advance !

A: To fix this problem I had to migrate gitlab-secrets.json from /etc/gitlab too, because this file contains the database encryption key, CI/CD variables, and variables used for two-factor authentication.
If you fail to restore this encryption key file along with the application data backup, users with two-factor authentication enabled and GitLab Runner lose access to your GitLab server.

A:
To restore a backup, you must restore /etc/gitlab/gitlab-secrets.json (for Omnibus packages) or /home/git/gitlab/.secret (for installations from source). This file contains the database encryption key, CI/CD variables, and variables used for two-factor authentication. If you fail to restore this encryption key file along with the application data backup, users with two-factor authentication enabled and GitLab Runner loses access to your GitLab server.


text:
Q: How to check value of Datatable? I have a Datatable. I want to check corresponding value with it. It has two columns User and password. I want to check what password is correspond to User.
if (dt.Rows[cbxuserid.SelectedIndex]["Password"] == txtpass.Text && dt.Rows[cbxuserid.SelectedIndex]["Uname"] == txtid.Text)
            {
                ub.deleteuser(cbxuserid.SelectedText, txtpass.Text);

            }


text:
Q: How to store a pointer to "pick up where you left off" while iterating in a spark scala dataframe? Say I have some dataframe that I'm reading in, and each time I want to display the top 2 rows as per a sorted column. The next time I read in that dataframe, I don't want to start at the beginning, but rather display the next 2 rows from where I left off the previous time. I'm thinking I'll need to create some binary pointer column that tells it where to start/stop, and when it reaches the end it should go back to the beginning. Here is an example:
  var df = Seq(("Mike",1),("Kevin",2),("Bob",3),("Steve",4),("Dave",5),("Dustin",6),("Melvin",7),("Henry",8)).toDF("name","score")

on the first run through, the output should be the first two rows Mike and Kevin:

on the second run through, the output should be the next two rows,

and so on and so forth.
How would I do this dynamically so that when I read in the CSV it can automatically figure out what to display? Thinking I'd have to initialize a "pointer" column and then somehow loop through it and overwrite the existing file each time with the new pointer location. How would you go about that?
I started it off with this code but ideally I need to have a 1 in the first row when I initialize instead of all zeros
df.withColumn("pointer",lit(0)).show

A: If you are saving the dataframe as CSV after every read and emitting top 2 rows then you can add a discriminator column in there ( I believe you used pointer in that sense) and save it in the dataframe ( ultimately in CSV as well).
When you read the CSV back into dataframe, you can filter the rows that have this flag set. This will help you get rid of those rows which you already have outputted.


text:
Q: Ability to pass through custom data on Omniauth-powered Facebook auth requests Omniauth branch 0-3-stable of git://github.com/intridea/omniauth.git
Rails 3.0.7
When Omniauth redirects a user to the Facebook auth dialog by making a GET call to "/auth/facebook", if that user clicks "Cancel" from the auth dialog, then we can the callback request
GET "/auth/facebook/callback?error_reason=user_denied&error=access_denied&error_description=The+user+denied+your+request."

which Omniauth immediately appears to redirect to:
GET "/auth/failure?message=invalid_credentials"

Unfortunately, when this is a response to an app. invitation generated by the FB request dialog, there is no identifying information on which user has "Canceled" out of the auth dialog. If we could send along some identifying information with the Omniauth request, we could allow ourselves to "remember" which user did the "Canceling" which would help us track explicit denials on the back end.
Is there any way to send along data with the call to "/auth/facebook" that would simply get repeated back to us in the resulting call to "/auth/facebook/callback"? This would be similar to the "data" parameter in the requests dialog documentation.
Thanks,
Wes

A: You can pass through a 'state' param which will be passed along to the callback url.
eg. you'd make a call to '/auth/facebook?state=SOME_INFO'
Then in the controller action that you route '/auth/facebook/callback' to, you retrieve just as you would a normal param:
info = params[:state]
The param must be named 'state'. This is mentioned in the omniauth-facebook documentation under the section 'Per-Request Options'.
https://github.com/mkdynamic/omniauth-facebook


text:
Q: How to convert List to objects in response with other format I have respone like
"preferentialManufacturingRegionCode":
[
"Brest",
"Vitebsk",
"Gomel",
"Minsk",
]
How to convert List of strings to objects that in respone will be like

"preferentialManufacturingRegionCode": [

                            {
                                "value": "Brest",
                            },
                            {
                                "value": "Vitebsk",
                            },
                            {
                                "value": "Gomel",
                            },
                            {
                                "value": "Minsk",
                            },
]
I will be grateful for your answer

A: Define a class Value:
public class Value<T> {
    private final T value;

    public Value(T value) {
        this.value = value;
    }

    public T getValue() {
        return value;
    }
}

You can now convert your List<String> as follows:
    List<Value<String>> values = list.stream()
            .map(Value::new)
            .collect(Collectors.toList());

UPDATE:
Use a JSON generator to produce JSON. For example, with Jackson:
        ObjectMapper mapper = new ObjectMapper();
        mapper.writeValue(System.out, values);

Output:
[{"value":"Brest"},{"value":"Vitebsk"},{"value":"Gomel"},{"value":"Minsk"}]


text:
Q: Using React Context API alongside React Router - Issues with consumers re-rendering unnecessarily I am playing with React's new Context api in v16.3. I am trying to set up my own Context within a React app that is also using React Router. I am seeing some strange behavior and am unclear as to what I'm witnessing and how to avoid it.
It's my understanding that with the new Context API, you can create a context that will give you access to a Provider and Consumer component. The Consumer component should take a render prop that executes whenever the Provider's value changes.
When I use a ContextProvider inside of a Router, this behavior works as expected. In this sandbox (https://codesandbox.io/s/lp5qj93l5z), MyContext.Consumer's render prop logs to the console every time it executes. It only logs out once, even as you change routes. This is what I would expect since MyContext.Provider's value isn't changing.
However, if I change my code structure and try to put MyContext.Provider around my Router, MyContext.Consumer's render prop function executes every time the route changes, even though the provider value is not changing. See the example here: https://codesandbox.io/s/km2w2qlxl5
Can anyone explain what is going on here? Is this behavior expected, and why does it work this way?


text:
Q: How to add a caption to a video when sharing a video via WhatsApp using Intent I tried to add a text (caption) to a video, which I wanted to share:
public void shareVideoWhatsApp()
{
    Intent videoshare = new Intent(Intent.ACTION_SEND);
    videoshare.setType("*/*");

    String downloadurl = "Here comes the url";
    videoshare.putExtra(Intent.EXTRA_TEXT, downloadurl);

    videoshare.putExtra(Intent.EXTRA_STREAM, Uri.parse(StorageHandlerSDcard.getPath('v') + "/" + "video.mp4"));

    if(isPackageInstalled("com.whatsapp",this))
    {
        videoshare.setPackage("com.whatsapp");
        startActivity(Intent.createChooser(videoshare, "Share video and caption"));
    }
    else
    {
       Toast.makeText(getApplicationContext(), "Whatsapp is not installed!", Toast.LENGTH_LONG).show();
    }
}

The video is shared without the caption. Do you have any idea to share video and caption/text simultaneously via WhatsApp and Intent?


text:
Q: Deleting an entire row from a Parse class How can I delete an entire row from my Parse User class in android? I want users to be able to delete their accounts from my application and if they delete their account I want to be able to delete their entire User row.

A: Call one of the delete methods on the user object: delete(), deleteEventually(),deleteInBackground(), etc.
Example:
ParseUser user = ParseUser.getCurrentUser();
user.deleteInBackground();

The ParseUser class is a subclass of ParseObject so it has all of the same delete methods. You can look at the API reference here for more information.

A: I thought I would provide additional feedback for a slightly different situation where you need to delete the user. I used the answer Eric Amorde gave as a starting point, but I had to delete the user when I was running a test. The basic goal was to delete a user from the parse database after the user was registered. This would keep me from having to go in and delete the user every time I ran the test. I initially used the above code Eric Amorde posted within a static method, but was not getting any results. Since I was creating the user during the register process in the background, I had to also delete the user in the background. Someone else may know a better way that I should have used, but below is the code snippet which includes all of what I did while the thread was working in the background.
    user.signUpInBackground(new SignUpCallback() {
                @Override
                public void done(ParseException e) {
                    dlog.dismiss();
                    if (e != null) {
                        /**
                         * Show the error message
                         */
                        Toast.makeText(RegisterActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
                    } else {
                        /**
                         * Start a new intent for the dispatch activity
                         */
                        Intent intent = new Intent(RegisterActivity.this, DispatchActivity.class);
                        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
                        RegisterActivity.this.startActivity(intent);

                        /**
                         * Check to see if the username is ParseUser and immediately deletes from
                         * Parse database to allow repeated runs of the RegisterActivityEspressoTest
                         */
                        if(etUsername.getText().toString().equals("ParseUser")){
                            ParseUser registerTestUser = new ParseUser();
                            registerTestUser.getCurrentUser().deleteInBackground();
                        }
                    }
                }
            });

A: The accepted answer can create bugs due to a failure to logout/clear the local datastore subsequent to the delete method.
1) According to Parse's documentation, delete() is not always sufficient to delete AND logout the user.  Sometimes, the user remains logged in via the local datastore even after the delete() call, leading to bugs the next time the user opens the application (or simply the next time the app checks for a current user with the getCurrentUser() method.  Instead, logout must be called in the callback of the delete function like this:
ParseUser currentUser = ParseUser.getCurrentUser();
currentUser.deleteInBackground(new DeleteCallback() {
                public void done(ParseException e) {
                    if (e == null) {
                        currentUser.logOutInBackground();
                    } else {
                        //handle the error
                    }
                }
            });

It's counterintuitive, because you would think you shouldn't have to logout if the account has already been deleted, but you do.
2) Also worth noting, delete can only be called when the user is authenticated (using either login(), signup(), or getCurrentUser() API calls).  From the Parse documentation:
Specifically, you are not able to invoke any of the save or delete type methods unless the ParseUser was obtained using an authenticated method, like logIn or signUp. This ensures that only the user can alter their own data.


text: Q: explicit conformal map of sinus-shaped region I wonder weather an explicit conformal map of a sinus-shaped region given by  $\Re(z) \in [0, 1+\delta \sin(\Im(z)) ]$ onto say a strip or a ball is known (of course $0<\delta < 1$). Thank you.


text:
Q: Javascript webservice call run not existing code? Today i'm trying to create some call to a webservice from javascript with asp.net and vb.net.
After a lot of trying i've done the job with this WebService code:
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class WebService1
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function HelloWorld(ToSomeone as String) As String
       Return "Hello World " + ToSomeone
    End Function

End Class

and this javascript call triggered from a button
function WebServiceCall() {
         Methodo_app.WebService1.HelloWorld("someone",onSuccess);
         return false;
}

function onSuccess(result) {
         alert(result);
}

After this, i've cancelled this i've modified the function HelloWorld with a simply
Public Function HelloWorld() As String
           Return "Hello World"
End Function

But in the function WebServiceCall() i still see the old HelloWorld with "ToSomeone" parameters, but this function doesn't exist in my project O.o
I can't explain this O.o
SOme Help?


text:
Q: Do IC step-down/buck converters generally boost voltage when the input falls below the desired output? I'm trying to select a buck convertor to regulate the output of a LiPo battery so I can use it to replace two AA batteries. Ideally I want the regulation to happen only when the battery is above 3 V. When it drops below that I want the voltage to flow as normal and not be boosted up to 3 V. (My aim is to reduce the voltage of the LiPo battery before the buck convertor so that as the battery discharges it is able to trigger a low battery warning that kicks in at 2.4V).
I've found an TI IC that seems to fit the bill, the TPS62698: http://www.ti.com/product/TPS62698 . The max input and output voltages are perfect (4.8 V and 3 V), but I'm a bit confused by the minimum voltages. The minimum input specified is 2.3V, and the minimum output is 3 V. Does this mean that this is actually a buck-boost? Or is this just some sort of technicality and there is no regulation below 3 V? All of the TI step-down ICs seem to be like this from what I can see...

A: The parametrics on that page are incorrect and were pulled from a datasheet PDF in an automated manner. You can tell because the text mentions the TPS62693, but the page is for the TPS62698, and the parameterics listed are also listed for TPS62698 but contain values from parts of the datasheet that describe different devices.
If you open up the datasheet you'll find that, for the most part, it describes four different parts in the same series: the TPS62692, TPS62693, TPS62694, and TPS62698. The first page only describes the TPS62693, but all subsequent pages provide specifications for all four parts in the series.
They've taken these parametrics from the "Recommended Operating Conditions" table, which is a bit confusing because this table covers the complete range of parts as if they are the same part, rather than separately.
Pulling details from other tables, the TPS62692 has a fixed output voltage of 2.2V, and the TPS62698 has a fixed output voltage of 3.0V. The input voltage ranges where they guarantee a particular level of voltage regulation (ripple) is 2.65V to 5.5V on the TPS62692, and 3.3V to 5.5V on the TPS62698. You may be able to operate these devices outside of these ranges, but there is no guarantee that they will work reliably.
If you provide an input voltage equal to or less than the fixed output voltage, the device will likely not regulate correctly. The result in this case is undefined, but it will most likely result in a lower-than-expected output voltage and an inability to sink anywhere near the rated current.
The reason they say you can go down to 2.3V in the operating conditions is that you can most likely power the device on in standby mode at a lower voltage than is necessary to actually make it regulate an output voltage. With a Vin of 2.3V you'll be able to keep the device operating correctly in shutdown mode (EN pulled low).


text:
Q: select() Alternative for Windows for both console input and sockets? For Linux, select() works for both sockets and console input.  But on windows, it only works for sockets.
This is problematic because I am looking to write a client in perl console where I can connect to a server, print and parse messages, and be informed when the user inputs commands into the console.  Something like a chatroom, when I can both print messages to the console and read user input to send messages.
Is there any alternative to do this on Windows? Or am I forced to use Window Applications instead of the console?

A: Unfortunately not. In fact, this is one of the core problems facing porting asynchronous software onto Windows.
About the closest thing you could get is WaitForMultipleObjectsEx, which has all sorts of interesting and well-known issues with it (such as its 64 handle limit, and how it copes with than one handle being ready at once). But if you want to multiple console and network socket IO, it's about the only option on Windows.


text:
Q: The maps $f_+$ and $f_-$ are well-defined.
We define the maps $f_+$ and $f_-$ from $\mathbb{Q}[X]/(X^2 -2) \mathbb{Q}[X]$ to $\mathbb{Q} + \mathbb{Q} \cdot \sqrt2$ in the following manner: For any residue class $g+ (X^2-2) \mathbb{Q}[X]$, we write:

$$ f_+(g+ (X^2-2) \mathbb{Q}[X]) = g \left( \sqrt2 \right)$$
$$ f_-(g+ (X^2-2) \mathbb{Q}[X]) = g \left(- (\sqrt2) \right)$$
I want to show that these maps are well-defined.
Because the degree of our polynomial $X^2-1$ is two, every representative in the residue class will have a degree less than this, upon division. We thus expect polynomials  in the domain of the form $aX+b$ with $a,b \in \mathbb{Q}$; the elements in the image will have the form $p+ q \sqrt2$, with $p,q \in \mathbb{Q}$.
I have a hard time figuring out what this map precisely does to elements in the domain. If I would understand this, it might be easier to prove it is well-defined ( it does not matter which representative we pick).

A: The tip in the comments answered my question.  The function is well-defined because any equivalent elements $g$ and $g'$ have images $g(\pm \sqrt{2})$ and $ g'(\pm \sqrt{2})$.