text:
Q: How I can hide a user from the login screen? I have Kubuntu 9.04 and I want to hide a user from appearing in the Login Screen, I shouldn't remove it permanently of course, but I need to make it visible again when needed.

A: System Settings > Advanced > System > Login Manager > Users

Select the check-boxes of the users you want to hide.

A: In Debian-based systems (which includes Ubuntu and Kubuntu, both versions new and old), any user with a UID less than 1000 will not show up as a user you can log in with, but you can still use the user from the command line with things such as ssh and ftp.
So to make the user bob disappear from the login screen, run the following command (800 can be any value less than 1000, but I like starting in that range):
$ sudo usermod -u 800 bob

A: Posting for those reading this in the future.
Using Ubuntu 22.04, I have used the following guide:
https://askubuntu.com/questions/92349/how-do-i-hide-a-particular-user-from-the-login-screen
TL:DR:
If your system uses AccountsService, you can not hide a user from the greeter screen by reconfiguring lightdm (and potentially other dms) because it defers to AccountsService. That is stated very clearly in the comments in /etc/lightdm/users.conf.

*

*vim /var/lib/AccountsService/users/XXX where XXX is the username.

*add this line or change SystemAccount= from false to true, if it already exists.
[User]
SystemAccount=true

*sudo systemctl restart accounts-daemon.service


text:
Q: Directed graph implementation I need to implement a digraph(Directed graph) in c++ as part of a homework and I'm having some issues with how to represent the vertices and edges data types.
Can anybody please point me to a example or a simple c++ class that implements this so I can study it and extend from there?
I've googled for a bit but I only found results about using Boost or other libraries, I just need something simple that doesn't rely on any library.
Thank you.

A: There are two major ways of representing digraphs with data structures:
Node centric. This method represents each node as an object within your program, and each node contains information about other nodes it links to. The other nodes can be as simple as a list of nodes where there exists a directed edge between the current node and the target node.
Edge centric. This method represents each edge as an object within your program, and each edge contains information about which nodes it connects. In a digraph, each edge will have exactly one "source" and "destination" node (which may be the same node if you're considering self-loops). This method is essentially a list of ordered pairs.
Depending on the problem you're solving, one of these two basic forms will end up being most appropriate. More specific algorithms might need to add more information to the above basic structures, such as for example a list of all nodes reachable from the current node.

A: Loosely, there are 2 straightforward ways of representing graphs:

*

*Connection Matrix

*List of Lists.

Each has advantages/disadvantages, depending on the application.
#2 will involve a lot of pointer fiddling.
#1 is often easier to use when doing graph transformationss.
In either one, you're going to have something like this:
template<typename T>
class node
{
   public:
   T data;
};

And the matrix and list of list classes will be pointing to dynamically allocated node's.
The implication is that you will have a graph class and a node class.

A: Try a vector< NodeType > with a multimap< NodeType *, EdgeType>.
multimap doesn't support subscripting [ x ] so you'll need to use edges.lower_bound() instead.
Alternatively, a map< pair< NodeType *, NodeType * >, EdgeType > can help look for an edge given two nodes. I used exactly that in one pretty heavy-duty program.
Here's an example for the first suggestion:
struct NodeType {
    int distance;
    NodeType( int d ) { distance = d; }
};
struct EdgeType  {
    int weight;
    NodeType *link;
    EdgeType( int w, NodeType *l ) { weight = w; link = l }
};

vector< NodeType > nodes;
nodes.reserve( 3 );
nodes.push_back( NodeType( 0 ) );
nodes.push_back( NodeType( 0 ) );
nodes.push_back( NodeType( 0 ) );

multimap< NodeType *, EdgeType > edges;
edges.insert( make_pair( &nodes[0], EdgeType( 4, &nodes[2] ) ) );
edges.insert( make_pair( &nodes[0], EdgeType( 1, &nodes[1] ) ) );
edges.insert( make_pair( &nodes[2], EdgeType( 2, &nodes[0] ) ) );

for ( multimap< NodeType *, EdgeType >::iterator iter = edges.lower_bound( &nodes[1] ),
  end = edges.upper_bound( &nodes[1] ); iter != end; ++ iter ) {
    cerr << "1 connects to " << iter->second.link - nodes.begin() << endl;
}

A: This university paper might help you.
It's not the most complete, but it gives you an idea perhaps. I found it rather useful, it's also for a lecture so there is no risk of copying anything one shouldn't.

A: template<class T>
class node
{
public:
    T data;
    vector<node<T>*> edges;
}

You will most likely also want to store a list<node<dataType>*> of all the nodes.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Очистка содержимого элементов с подходящим ID Как сделать так, чтобы при нажатии на кнопку 'Очистить 13 марта' очищалось содержимое span'a, у которых ID заканчивается на '2015-03-13'?

  function ZZZ() {
    document.getElementById("1.2015-03-13").textContent = ""; /* Там где 1 - любое число */
  }
5
5
5
5
5
5
<input type="button" onclick="ZZZ();" value="Очистить 13 марта">

A: Можно  вот так http://jsfiddle.net/7z5gfn81/


text:
Q: Flutter || build failed so im cloning some project from git and i already run flutter pub cache repair flutter pub get in administrator
i already search for this error but didn't find any answer
jdk version i use jdk-17.0.1 and jdk-11.0.14 both result the same.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve com.google.zxing:core:{strictly 3.3.0}.
     Required by:
         project :app
      > Cannot find a version of 'com.google.zxing:core' that satisfies the version constraints:
           Dependency path 'android:app:unspecified' --> 'com.facebook.android:facebook-android-sdk:8.2.0' --> 'com.facebook.android:facebook-common:8.2.0' --> 'com.google.zxing:core:3.3.3'
           Constraint path 'android:app:unspecified' --> 'com.google.zxing:core:{strictly 3.3.0}' because of the following reason: debugRuntimeClasspath uses version 3.3.0

> Could not resolve com.google.zxing:core:3.3.3.
     Required by:
         project :app > com.facebook.android:facebook-android-sdk:8.2.0 > com.facebook.android:facebook-common:8.2.0
      > Cannot find a version of 'com.google.zxing:core' that satisfies the version constraints:
           Dependency path 'android:app:unspecified' --> 'com.facebook.android:facebook-android-sdk:8.2.0' --> 'com.facebook.android:facebook-common:8.2.0' --> 'com.google.zxing:core:3.3.3'
           Constraint path 'android:app:unspecified' --> 'com.google.zxing:core:{strictly 3.3.0}' because of the following reason: debugRuntimeClasspath uses version 3.3.0

and if i switch to jdk-17.0.1 and add this line in gradle.properties
this line =
org.gradle.java.home=C:/Program Files/Java/jdk-17.0.1

it result this
What went wrong:

Could not initialize class org.codehaus.groovy.runtime.InvokerHelper


text:
Q: How to change/set/manage borders between sections in uicollectionview? I'm trying to build application with typical DataGrid inside. I have already built customCollectionViewLayout which displays data in DataGrid as you can see in attached picture (application screen). Every row is a section in CollectionView. I've added border (1.0f) to every cell, but I can't manage border size between sections - it also needs to be 1.0f, but now the border width is duplicated, because items are in different sections.
Could you please help me and advice how to set border between sections also equal to 1.0f?

A: Just Use the predefined delegate methods definitely it willIf work.
Still if you are facing problem in adjusting the border between the cell, design the custom cell like bellow picture.

It will creates the space between the cells automatically then you can design the cell border as per your requirement.


text:
Q: Cross domain from SignalR2 to phantomjs this project work right on SignalR v1.1.4, client is phantomjs with cors:
webpage = require "webpage"
websocket = webpage.create()
serverUrl = "http://www.domain.com"
websocket.injectJs './jquery-2.1.0.min.js'
websocket.injectJs './jquery.signalR-1.1.4.min.js'
websocket.includeJs serverUrl + '/signalr/hubs', ->
    websocket.evaluate (serverUrl)->
        $.support.cors = false
        $.connection.hub.url = serverUrl + '/signalr'
        taskHub = $.connection.taskHub
        $.connection.hub.start().done ->
            taskHub.server.registerAgent "xxx"
            #……
        taskHub.client.castTesk = (task) ->
            #……
    , serverUrl

until upgrade SignalR to v2.0.2.
i remove RouteTable.Routes.MapHubs(new HubConfiguration() { EnableCrossDomain = true }) on Application_Start() and add Startup.cs:
[assembly: OwinStartup(typeof(SpiderMan.Startup))]
namespace ProjectNamespace {
    public partial class Startup {
        public void Configuration(IAppBuilder app) {
            app.Map("/signalr", map => {
                map.UseCors(CorsOptions.AllowAll);
                var hubConfiguration = new HubConfiguration {
                    EnableJSONP = true
                };
                map.RunSignalR(hubConfiguration);
            });
        }
    }
}

then $.connection.hub.start() work right always, but taskHub.client.castTesk() could not be triggered, without any error message.
update:
v1.2.1 is work fail also like v2.0.2.
And, Microsoft.AspNet.SignalR Package with any version on server could not affect this issus. client work right with jquery.signalR-1.1.4.min.js, fail with jquery.signalR-1.2.1.min.js always, for any server signalR version.

A: You should define your castTesk method before you start your connection. This issue is discussed in the "Connection started before subscriptions are added" section of the SignalR Troubleshooting Guide.
#……
taskHub.client.castTesk = (task) ->
    #……
$.connection.hub.start().done ->
    taskHub.server.registerAgent "xxx"
    #……

The problem is that if you call $.connection.hub.start() before you define taskHub.client.castTesk, SignalR will not subscribe the client to the TaskHub.
You will still be able to invoke server-side methods belonging to the TaskHub such as RegisterAgent, but the server will be unable to invoke client methods such as castTesk.
I would also suggest removing the $.support.cors = false line. This will cause SignalR to always use JSONP instead of CORS even if the browser supports CORS.


text:
Q: Automatically change JavaScript function value Here is my problem.. I have some JavaScript that I want to run, however I need it to be unique each time it gets inserted. I tried adding a variable to it that would change it, however it only changes it on the first call/display. Here is the script:

The actual form code is:
                    echo "
                <form method=\"POST\"action=\"$actual_link\" id=\"fill\" onsubmit=\"return validate_f( );\">
                <input type=\"hidden\" value=\"{$data['id']}\" name=\"id\">
                <input type=\"text\" size=\"20\" class=\"BUTTON_INPUT\" name=\"url\" value=\"\" id=\"textfield\">

                <input type=\"Submit\" class=\"BUTTON_FILL\" name=\"fill\" value=\"\">
                </form>

The problem is that form gets echoed multiple times with different links, but the script will only work the first time. So my only solution I could think of was to have the JavaScript echoed along with the form and have the function name changed on both the script & the form.
I hope what I'm trying to do makes sense, so basically I need "function validate_f( )" & "onsubmit=\"return validate_f( );\"" to change with each repeat/echo ..

A: if your text field is in every form you can use only one generic function like this that will work for all forms no matter their id
  function validate_f() {
      var x = this['textfield']
      if (!x || !x.value) {
          alert("field cannot be empty")
          return false
      }
      return true;
  }

A: I came up with a solution for this, and thought I would share it in case someone comes across this. But basically the form that is being echoed/repeated did get unique data on each time it repeated.. So basically I took that unique value and put it as the function & the form id.. It is pretty simple now that I look back at it, I just had to think really hard about how to get something unique that changed. Hope this helps someone..


text:
Q: Failed to Load Plugin Vue in eslintrc.js When Building Dockerfile runs RUN npm run build which runs vue-cli-service build. After some time, I get an error from .eslintrc.js:
Failed to load plugin 'vue' declared in '.eslintrc.js': createRequire is not a function. Build does not get completed because of this issue.
This issue does not occur if I run npm run build manually. Why do I get this issue and How can I resolve it?
.eslintrc.js:
module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: ['plugin:vue/essential', '@vue/airbnb', '@vue/prettier'],
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'consistent-return': 0,
    'import/extensions': 0,
    'import/no-extraneous-dependencies': 0,
    'no-param-reassign': 0,
    'no-alert': 0,
    'no-unused-expressions': 0,
    'no-shadow': 0,
    'no-return-assign': 0
  },
  plugins: ['prettier'],
  parserOptions: {
    parser: 'babel-eslint'
  }
};

package.json:
{
  "name": "web",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "start": "vue-cli-service serve"
  },
  "dependencies": {
    "axios": "^0.19.2",
    "core-js": "^3.6.5",
    "date-fns": "^2.14.0",
    "humps": "^2.0.1",
    "izitoast": "^1.4.0",
    "lamejs": "^1.2.0",
    "pug-plain-loader": "^1.0.0",
    "register-service-worker": "^1.7.1",
    "sass": "^1.26.5",
    "sass-loader": "^8.0.2",
    "vue": "^2.6.11",
    "vue-resource": "^1.5.1",
    "vue-router": "^3.2.0",
    "vuex": "^3.4.0",
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^4.3.1",
    "@vue/cli-plugin-eslint": "^4.3.1",
    "@vue/cli-plugin-pwa": "^4.3.1",
    "@vue/cli-service": "^4.3.1",
    "@vue/eslint-config-airbnb": "^5.0.2",
    "@vue/eslint-config-prettier": "^6.0.0",
    "babel-eslint": "^10.1.0",
    "compression-webpack-plugin": "^4.0.0",
    "eslint": "^7.0.0",
    "eslint-plugin-prettier": "^3.1.3",
    "eslint-plugin-vue": "^6.2.2",
    "expose-loader": "^0.7.5",
    "material-design-icons-iconfont": "^5.0.1",
    "node-sass": "^4.14.1",
    "vue-cli-plugin-vuetify": "^2.0.5",
    "vue-template-compiler": "^2.6.11",
    "vuetify-loader": "^1.4.3",
    "webpack-bundle-analyzer": "^3.8.0"
  }
}

A: Have you run npm run install to install all the dependencies before running npm run build?
If yes, maybe you need to add some code into your .eslintrc file:
 "parser": "vue-eslint-parser",
Finally, you may also need to add the npm package named 'prettier' to make it works.


text:
Q: Hard drive allocation Can I change the amount of hard drive space i have allocated to Ubuntu later after I have installed it? I'm not sure how much I should allocate as I wont be putting many big files on it... How much would you recommend if I have 2TB/Windos7

A: Yes you can.  Easiest tool to do so I find is gparted, so if you think you need to add more space or you need more space in windows you can do so on the fly.
Just search for 'gparted' in the software center.
If for whatever reason you like using terminal,
sudo apt-get update
sudo apt-get install gparted


text:
Q: the meaning of "do damage" in baseball context What does do damage mean in the baseball context as in the following excerpt from the Japan Times?

[Tanaka and Kikuchi] are a formidable combination at the top of the order, each able to do damage with their bats and their legs. As if that wasn't enough, they're all very good fielders as well.

A: It's pretty common to hear "damage" used nonliterally like this in sports (at least it is in the US), but unfortunately I can't find the relevant definition in any of the dictionaries I checked.
It's essentially a metaphor. The offense attacks, meaning:

to move forward and try to score goals or win points
Brazil began to attack more in the second half of the match.
Longman

When their attack is successful, they do damage, or score.

A:
The objectives of the offensive team (batting team) are to hit the ball into the field of play, and to run the bases
  - wikipedia, on Baseball

Their bats help by hitting such that it's hard for the other team to catch the ball quickly, and their legs help by running towards home base. The quote communicates that they are good at both, implying that by doing so, they help their own team win ('do damage' to the other team).


text:
Q: Grauert's semicontinuity theorem over the real field I need to know the following: let $f:\rightarrow {\mathbb R}$ be a real-analytic function defined in a neighbourhood of a point in an analytic manifold. If the fiber $f^{-1}(0)$ is simply connected, is that so for any fiber $f^{-1}(\epsilon)$ for small $\epsilon$?
In the complex case I gather this is a trivial consequence of Grauert's semicontinuity theorem but what about the real case?

A: Try $f(x,y)=x^2+y^2$, $f \colon \mathbb{R}^2 \to \mathbb{R}$.
If you want connected constant dimensional fibers, try $f(x,y,z)=z$ on the cylinder with one point deleted $X=\{(x,y,z)|x^2+y^2=1\}-\{(1,0,0)\}$.
For a more natural example, take the map $f(x,y)=y^3-p-qx-rx^2-x^3$ for suitable constants $p, q, r$, so that you get a family of cubic curves, and arrange that the curve $f^{-1}(0)$ is a cusp, while $f^{-1}(\varepsilon)$ has two components for $\varepsilon > 0$. Then you really see jumping of fundamental group. But I still don't have a nice example with all fibers compact.


text:
Q: Why does this code does not work on Pie and later? I tried this code, it works fine on Android 8, but when I try to run applications on Android 9 it does not work and shows:

java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $

Here is the code:
@Override
 protected void onPostExecute(String massage) {

     Type type = new TypeToken < ArrayList < HashMap < String, String >>> () {}.getType();

     Gson gson = new Gson();

     ArrayList < HashMap < String, String >> arr = gson.fromJson(massage, type);

     for (int i = 0; i < arr.size(); i++) {
         if (!Objects.equals(arr.get(i).get("region"), city)) {
             arr.get(i).clear();
         }
     }
 }


text:
Q: How can I bind to dependency properties of a custom control from a resource dictionary defined in Generic.xaml? EDIT: I rephrased the entire question.
Hello everybody,
I have a custom control with dependency properties.  In the Generic.xaml file I have a resource dictionary. It's a resource dictionary within the outer dictionary, defined like so:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MyNamespace">

   <!-- This is the dictionary-->
   <ResourceDictionary x:Name="TheDictionaryImTalkingAbout" . . . >
   .
   .
   .
   </ResourceDictionary>
   .
   .
   .

</ResourceDictionary>

In this resource dictionary, TheDictionaryImTalkingAbout, I want to bind to a dependency property of my control.  I tried the following XAML :
<Object x:Key="MyObject" SomeProperty="{Binding MyDependencyProperty, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type MyNamespace:MyControl}}}"/>

The binding returns no errors, however, it doesn't work.  Can anyone tell me how I'm supposed to bind to my parent control from within a resource dictionary that's within Generic.xaml?
EDIT: This binding DOES work, but only for certain properties.  I am unable to bind GradientStop Color to a dependency property of type color.  It USED to work when this was a UserControl, but it doesn't work anymore now that I created a custom control.  I don't know why, but if you're interested, I asked this question here:
Why can I no longer bind GradientStop Color to a Dependency Property of my control?

A: Location in a ResourceDictionary has nothing to do with resolution of a RelativeSource FindAncestor Binding. The Source is resolved at runtime after it becomes part of a Visual Tree. There is nothing in the XAML you have posted that could be used to diagnose the problem you are having.
Unrelated: What led you choose to declare a ResourceDictionary inside another ResourceDictionary?

A: You can't databind to a GradientStop, see How to bind GradientStop Colours or GradientStops Property in Silverlight?

A: I have seen the answer from Wallstreet Programmer. Therefore, I don't know if in the end, the binding will work. But the problem that you see with your binding is, that you must declare the namespace where your UserControl is and then use this in the binding.
Add a namespace-declaration on top of your xaml. If the namespace is "WindowsApplication" then this will look like follows:
xmlns:local="clr-namespace:WindowsApplication"

Then in the binding, write
<GradientStop Color="{Binding Scheme, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MyControl}}}" Offset="0"/>

A: If anyone is interested, this is how I bind to my dependency property from inside my Generic.xaml for a custom control:
A part from Generic.xaml:

    <ContentControl x:Key="MyFooDepProp"
                Content="{TemplateBinding local:MyControl.MyFoo}">
    <!-- ... -->
    </ContentControl>

    <!-- ... -->
    <Style TargetType="ContentControl">
        <Setter Property="Content" Value="{TemplateBinding local:MyControl.MyFoo}" />

    <!-- ... -->

If you receive this message:

'MyFoo' member is not valid because it does not have a qualifying type name

The key is to use TemplateBinding and prefix your property with the type name (like I did: 'local:MyControl.MyFoo')


text:
Q: Mobile Safari iOS failing to load multiple small files (such as images or JavaScript) on first page visit only I've been fighting a problem on the iPhone and iPad where it fails to load multiple assets at the same time. Two scenarios:
a) Loading approx 20+ external JavaScript files - this is not a problem on my live sites because I combine my JavaScript into one file before deploying, but causes issues on my test server.
b) Loading approx. 20+ small thumbnail images on the same page (each one is roughly 30kb).
In both scenarios Safari (usually) gets stuck on a handful of files and never finishes loading them. The loading indicator on the iOS top menu is stuck loading until a refresh.
The second time you visit (when the assets are cached) all will be fine. I have to clear Safari's cache to reproduce the issue.
I can get round the issue by delaying load of the assets in JavaScript, but this is quite bodgy and I'd like to better understand what's going wrong and see if I can find a neater solution.
An example can be seen here (visit on an iOS device): http://www.jamesgretton.co.uk/expem/so_ios_multi/
Also, in case it's useful, I've got round the problem here by delaying the load of the thumbnails: http://www.interior-id.com/work/ but it would break otherwise.
Any thoughts would be greatly appreciated!
James

A: I had issues of the same kind on my test server, and it was related to the Basic Auth password configuration. As soon as we removed the Authentication headers, Mobile Safari was loading all files as expected.

A: I had a similar problem with IOS Safari and for some reason it didn't like  "use strict"; at the top of one of my javascript files.  Very annoying to work this out but removing it seems to have fixed the issue!


text:
Q: Rockettheme: Kinetic - making banner full width I dont know what kind of success i'll have from this post but struggling at the moment to get a reply on the rockettheme forums.
I have downloaded this template (Kinetic) from Rockettheme.com (demo below;)
http://demo.rockettheme.com/?template=kinetic
I have changed it to come out looking like the link below;
http://evolve.gen.nz/
However im really struggling to differentiate the footer from the rest of the website. Im looking at changing it to a light grey however I cannot make it stretch right across the website as the footer is located in the container and stops at either edge of the container.
is there anyway to make a footer colour go right across the page?
(the same as the following website, if you go down to the bottom of the page and you will see a dark grey, charcoal colour)
http://www.colmanweb.co.nz/websites/refuge/
Any ideas on how I could get this achieved?
Thanks

A: You just need to edit the index.php file of the template, should be at templates/kinetic/index.php roughly. If you head to the bottom, you will find a div with rt-footer. You will want to pull this entire div statement out and paste it outside of the div with an id rt-surround. Your best bet is to find rt-debug and paste it just above.
I run a lot of sites off the base gantry template from Rocket Theme and do this type of thing often, so it should work.
Two issues you may run into. If you don't get the right closing div tag, you can get some weird output if the divs aren't closed properly. So be careful and use the indentation to help you.
Second, there may be some css styling that is specific to the old heirarchy. I doubt it in this case, but it can happen. You may have to fix some of the css styling.


text:
Q: Docker volume on external hard drive I'm using a postgres image to run a container locally.
I need to process a significant amount of data and I want to use an external hard drive for this. Is it possible to mount a volume on an external hard drive? Can I accomplish what I want with Flocker?
I'm using native docker for mac.

A: In Docker-for-mac, open up the preferences pane. Click on "File Sharing".
You can add the path to your external hard drive there, probably something like /Volumes/Drive.
You'll then be able to use that location as a host volume.
docker run -v /Volumes/Drive/mypostgresdata:/var/lib/postgresql/data \
    --name some-postgres \
    -e POSTGRES_PASSWORD=mysecretpassword \
    -d postgres

A: Mount the external drive on your mac, and then go to the Docker icon -> preferences -> file sharing. Add your drive path to that list. Then when you do a docker run -v /path/to/drive:/target myimage it will mount your drive into your container (at /target in that example).


text:
Q: Recyclerview displaying only the last json data? I am trying to display data in a recycler view in android. i but it keeps displaying only the last datas and i dont know why.i seem to be doing everything right. And the recycler view has a view pager.
this is my
Myadapter class
public class MyAdapter extends RecyclerView.Adapter<MyHolder> {
    Context c;
    List<Getter> getter;

    public MyAdapter(List<Getter> getter, Context c) {
        super();
        this.c = c;
        this.getter = getter;
    }

    //INITIALIZE VIEWHODER
    @Override
    public MyHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        //VIEW OBJ
        View v= LayoutInflater.from(parent.getContext()).inflate(R.layout.model,null);

        //HOLDER
        MyHolder holder=new MyHolder(v);

        return holder;
    }

    //BIND VIEW TO DATA
    @Override
    public void onBindViewHolder(MyHolder holder, int position) {

        String images[] = {getter.get(position).getUrl1(), getter.get(position).getUrl2()};
        holder.gamename.setText(getter.get(position).getGame_name());
        holder.cost.setText(getter.get(position).getCost());
        holder.usname.setText(getter.get(position).getFull_name());
        Picasso.with(c)
                .load(getter.get(position).getPicture())
                .placeholder(R.drawable.placeholder)
                .error(R.drawable.error)
                .transform(new CircleTransform())
                .fit()
                .into(holder.usimage);

        CustomPagerAdapter mCustomPagerAdapter = new CustomPagerAdapter(c,images);
        holder.mViewPager.setAdapter(mCustomPagerAdapter);

        holder.indicator.setViewPager(holder.mViewPager);

        holder.setItemClickListener(new ItemClickListener() {
            @Override
            public void onItemClick(View v, int pos) {
                Snackbar.make(v,getter.get(pos).getGame_name(),Snackbar.LENGTH_SHORT).show();
            }
        });

    }

    @Override
    public int getItemCount() {
        return getter.size();
    }
}

This is my mainactivty class
 public class All_timeline extends Fragment {
        SqlHandler sqlHandler;
        RecyclerView rv;
        MyAdapter adapter;
        private List<Getter> getter;

        public All_timeline() {
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            View x = inflater.inflate(R.layout.all_timeline, container, false);
            sqlHandler = new SqlHandler(getActivity());
            //recycler
            rv = (RecyclerView) x.findViewById(R.id.mRecycler);
            getter= new ArrayList<>();
            rv.setLayoutManager(new LinearLayoutManager(getActivity()));

            rv.setItemAnimator(new DefaultItemAnimator());
           rv.addItemDecoration(new SimpleDividerItemDecoration(getResources()));

            registerUser("arinzeaco@gmail.com");

            adapter=new MyAdapter(getter,getActivity());
            rv.setAdapter(adapter);
            return x;
        }

        public void registerUser(final String email) {

            OkHttpClient client = new OkHttpClient();
            RequestBody body = new FormBody.Builder()
                    .add("username", email)
                    .build();
            Request request = new Request.Builder().url("http://www.thethinker.com.ng/gamer/allpost.php").post(body).build();
            Call call = client.newCall(request);
            call.enqueue(new Callback() {

                @Override
                public void onFailure(Call call, IOException e) {
                    Toast.makeText(getActivity(), "Registration failed",
                            Toast.LENGTH_SHORT).show();
                }

                @Override
                public void onResponse(Call call, Response response) throws IOException {
                    final String myResponse = response.body().string();
                    getActivity().runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            JSONObject jso;
                            Getter contactListItems = new Getter();
                            try {
                                jso = new JSONObject(myResponse);
                                JSONArray categories = jso.getJSONArray("posts");

                                for (int i = 0; i < categories.length(); i++) {
                                    String image1 = categories.getJSONObject(i).getString("image_1");
                                    String image2 = categories.getJSONObject(i).getString("image_2");
                                    String username = categories.getJSONObject(i).getString("username");
                                    String video_url = categories.getJSONObject(i).getString("video_url");
                                    String liked = categories.getJSONObject(i).getString("liked");
                                    String cost = categories.getJSONObject(i).getString("cost");
                                    String following = categories.getJSONObject(i).getString("following");
                                    String game_name = categories.getJSONObject(i).getString("game_name");
                                    String full_name = categories.getJSONObject(i).getString("full_name");
                                    String userimage = categories.getJSONObject(i).getString("userimage");

                                    contactListItems.setUsername(username);
                                    contactListItems.setGame_name(game_name);
                                    contactListItems.setCost(cost);
                                    contactListItems.setFollowing(following);
                                    contactListItems.setLiked(liked);
                                    contactListItems.setFull_name(full_name);
                                    contactListItems.setVideo(video_url);
                                    contactListItems.setUrl1(image1);
                                    contactListItems.setUrl2(image2);
                                    contactListItems.setPicture(userimage);

                                    getter.add(contactListItems);

                                }

                            } catch (JSONException e) {
                                e.printStackTrace();
                            }
                        }});

                        }
                    });

        }
    }

I have also check other stackoverflow questions like RecyclerView displaying the last item in the adapter several times. Need all adapter items to show in RecyclerView. but i just don't get what i am doing wrong.

A: I think it related to concurrency issue, please try to call http method after you set adapter, and don't forget to call notifyDataSetChanged() after all data inserted. One more think, make sure you insert different Getter instance for every item
for example in onCreateView

     adapter=new MyAdapter(getter,getActivity());
     rv.setAdapter(adapter);
     registerUser("arinzeaco@gmail.com");

in onResponse:
 @Override
 public void onResponse(Call call, Response response) throws IOException {
 final String myResponse = response.body().string();
 getActivity().runOnUiThread(new Runnable() {
    @Override
    public void run() {
        JSONObject jso;
        try {
            jso = new JSONObject(myResponse);
            JSONArray categories = jso.getJSONArray("posts");

            for (int i = 0; i < categories.length(); i++) {
                Getter contactListItems = new Getter();
                String image1 = categories.getJSONObject(i).getString("image_1");
                String image2 = categories.getJSONObject(i).getString("image_2");
                String username = categories.getJSONObject(i).getString("username");
                String video_url = categories.getJSONObject(i).getString("video_url");
                String liked = categories.getJSONObject(i).getString("liked");
                String cost = categories.getJSONObject(i).getString("cost");
                String following = categories.getJSONObject(i).getString("following");
                String game_name = categories.getJSONObject(i).getString("game_name");
                String full_name = categories.getJSONObject(i).getString("full_name");
                String userimage = categories.getJSONObject(i).getString("userimage");

                contactListItems.setUsername(username);
                contactListItems.setGame_name(game_name);
                contactListItems.setCost(cost);
                contactListItems.setFollowing(following);
                contactListItems.setLiked(liked);
                contactListItems.setFull_name(full_name);
                contactListItems.setVideo(video_url);
                contactListItems.setUrl1(image1);
                contactListItems.setUrl2(image2);
                contactListItems.setPicture(userimage);

                getter.add(contactListItems);
            }
            adapter.notifyDataSetChanged();

        } catch (JSONException e) {
            e.printStackTrace();
        }
    }});

    }
});


text:
Q: remove all duplicate and orginal elements from array if duplicate is present in javascript var techologylist=[1,2,2,3,4,4,5]
var newtechologylist=[];
$.each(techologylist, function (i, el) {
   if ($.inArray(el, newtechologylist) === -1) newtechologylist.push(el);
});
console.log(newtechologylist)

I want to remove values from techologylist ,if same 2 value comes .In my example 2 and 4 comes twice ,therefore i want to remove both 2 and 4 from array
Am expecting result as [1,3,5]
But result for my code of course give result as [1,2,3,4,5]
How to change my script to remove both values if duplicate occurs

A:

var techologylist = [1, 2, 2, 3, 4, 4, 5]
var newtechologylist = [];

$.each(techologylist , function (i, el) {

    if ($.inArray(el, newtechologylist ) === -1) {
        newtechologylist.push(el);
    }

    else {
        var index = newtechologylist.indexOf(el);
        if(index > -1){
           newtechologylist.splice(index, 1);
        }
    }
});

document.write(newtechologylist);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>


text:
Q: Android app force stop on modelBatch.render I'm trying to render a model in libgdx - everything runs perfectly on the desktop, but on android force stop on modelBatch.render(poleInstance, environment);
Log:
03-30 16:37:40.317    5249-5249/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
03-30 16:37:42.621    5269-5269/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
03-30 16:37:46.181    5283-5283/com.badlogic.gdx.tests E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from GradienCache
03-30 16:37:46.209    5283-5283/com.badlogic.gdx.tests E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
03-30 16:37:46.533    5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ [getAttribValue] Bad attribute idx
03-30 16:37:46.533    5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ tid 5297: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
03-30 16:37:46.533    5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ [getAttribValue] Bad attribute idx
03-30 16:37:46.533    5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ tid 5297: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
03-30 16:37:46.825    5283-5297/com.badlogic.gdx.tests E/AndroidRuntime﹕ FATAL EXCEPTION: GLThread 168
    com.badlogic.gdx.utils.GdxRuntimeException: File not found: com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl (Classpath)
            at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:134)
            at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:78)
            at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:548)
            at com.badlogic.gdx.backends.android.AndroidFileHandle.length(AndroidFileHandle.java:167)
            at com.badlogic.gdx.files.FileHandle.estimateLength(FileHandle.java:229)
            at com.badlogic.gdx.files.FileHandle.readString(FileHandle.java:194)
            at com.badlogic.gdx.files.FileHandle.readString(FileHandle.java:187)
            at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.getDefaultVertexShader(DefaultShader.java:409)
            at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.<init>(DefaultShader.java:504)
            at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.<init>(DefaultShader.java:500)
            at com.badlogic.gdx.graphics.g3d.utils.DefaultShaderProvider.createShader(DefaultShaderProvider.java:46)
            at com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider.getShader(BaseShaderProvider.java:34)
            at com.badlogic.gdx.graphics.g3d.ModelBatch.render(ModelBatch.java:269)
            at com.badlogic.gdx.tests.PathTest.render(PathTest.java:221)
            at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:391)
            at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
            at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
03-30 16:37:51.401    5283-5283/com.badlogic.gdx.tests E/AndroidGraphics﹕ waiting for pause synchronization took too long; assuming deadlock and killing
03-30 16:37:51.521      475-517/system_process E/InputDispatcher﹕ channel '528ce2b4 com.badlogic.gdx.tests/com.badlogic.gdx.tests.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

Yes, my question is similar to this, but updating the library didn't helped
And yes, file com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl in place
My code place here

A: The error is File not found, so apparently it cannot find the file. If you are sure the file is included, this might be caused by duplicate references (although it doesn't have to). For example if you include (and export) the gdx library in both your core and android project. You could check this by right clicking each project, click on Java Build Path and then the Order and Export tab. Make sure that the gdx project (or jar, depending if you work from source or nightly/stable) is only included (and exported by clicking the checkbox) in the core project.
However, having assets (which the shader files are) on the classpath is merely to support out-of-box rendering for libgdx. In your case would advise to copy the shader files to (a subfolder of) your assets folder and use those instead. That makes managing your assets a lot cleaner. You can load the shaders using the constructor of ModelBatch, e.g.:
modelbatch = new ModelBatch(Gdx.files.internal("data/default.vertex.glsl"), Gdx.files.internal("data/default.fragment.glsl"));

Of course, you still might want to double check your project configuration.

A: Please install Arm Transition on your Genymotion Emulator
Here is a detailed guide on How to install this transition :
How to install Google Play Services in a Genymotion VM (with no drag and drop support)?
I hope this helps.


text:
Q: How change log severity ? When I use dotnet core with GCP Logger I have a dotnet core 6.0 API project,
and it's run at GKE
My purpose is to write logs to Google Cloud
and expected got different severity with different LogLevel
What should I do ??
there is what I did,
first,  I add Google.Cloud.Diagnostics.AspNetCore3 NuGet package
second, I AddGoogleDiagnosticsForAspNetCore like this
var builder = WebApplication.CreateBuilder(args);
builder.Services
        .AddGoogleDiagnosticsForAspNetCore(loggingOptions: new LoggingServiceOptions
        {
            Options = LoggingOptions.Create()
        });

third, I add some logs in the app
_logger.LogDebug(msg);
_logger.LogError(msg);
_logger.LogCritical(msg);

but anyway I got the logs from Google Logs Explorer
like below, the severity is "INFO" which is come from a Log whose LogLevel is "Erorr"
{
  "insertId": "skip",
  "jsonPayload": {
    "State": {
      "{OriginalFormat}": "Test logs of Error ",
      "Message": "Test logs of Error "
    },
    "EventId": 0,
    "Category": "Deposit.Controllers.InfoController",
    "LogLevel": "Error",
    "Message": "Test logs of Error "
  },
  "resource": {},
  "timestamp": "2022-06-10T08:52:23.672316263Z",
  "severity": "INFO",
  "labels": {},
  "logName": "projects/myproject/logs/stdout",
  "receiveTimestamp": "2022-06-10T08:52:25.967313013Z"
}

Is it possible to map the LogLevel to severity?

A: The logs you are pasting here are not the logs captured by Google.Cloud.Diagnostics.AspNetCore3 instead they seem to be the ones captured by the GKE Logging Agent. I would advise you to follow their Support Channels to report this as a possible bug.
I'm fairly certain these are the logs captured by the agent because of "logName": "projects/myproject/logs/stdout" as described in Viewing your GKE logs.
The log name for Google.Cloud.Diagnostics.AspNetCore3 (by default) will look like "logName": "projects/myproject/logs/aspnetcore" instead. If you are not able to find these logs, do please create an issue in https://github.com/googleapis/google-cloud-dotnet and we'll be able to look into it further.
Note that you can also remove all default logging providers before adding Google.Cloud.Diagnostics.AspNetCore3. The console logger is configured by default in ASP.NET Core, and the GKE logging agent captures all console output, which means that by removing default logging providers you make sure you only capture logs with Google.Cloud.Diagnostics.AspNetCore3. Your code would look like this:
var builder = WebApplication.CreateBuilder(args);
builder.Logging.ClearProviders();
builder.Services
    .AddGoogleDiagnosticsForAspNetCore(loggingOptions: new LoggingServiceOptions
    {
        Options = LoggingOptions.Create()
    });


text:
Q: Where can I download com.sun.security.* package? Download com.sun libraries
new com.sun.security.auth.module.NTSystem()

This is what I am using code and it's required necessary libraries and where can I download them ? I did search on google but couldn't find.

A: the source code?
 $JAVA_HOME\src.zip

and about the com.sun* package
http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html


text:
Q: Present participle Future Is this sentence correct?
"I have all the documents and I should be filing it this week."
I know (I will be filing...) would work, but I was just wondering if the above sentence is acceptable.

A: "I have all the documents and I should be filing it this week" is grammatically acceptable.
Compared to "I will be filing," the use of "should" implies that the activity will likely get done, but it is possible that it will not get done or that it will be delayed. Therefore, the decision of which sentence to use will likely depend on how certain you are that the action will be done.


text:
Q: What is the proper syntax/usage of Script when getting data from Table to Modal I am making and trying out a web system crude with modals, I'm having trouble with getting data from my datatables to modal because of the table structure and script, i know it has to do something with the structure of the table and the script, I need help in figuring the best way to maintain the table structure and correct the script syntax since I don't have any idea on how to adjust or change the script syntax to match the table
any suggestions or solutions will be much appreciated, Thank you in advance
here's an example image of the output I want to accomplish when i press Update button:

here's my code snippet for data table:

                              ID No.
                              Profile Info
                              Contact Info
                              Address
                              Monthly Pension
                              Status
                              Action

                    <?php
                        $count=1;
                        $sel_query="Select * from senior";
                        $result = mysqli_query($db,$sel_query);
                        while($row = mysqli_fetch_assoc($result)) { ?>

                              <?php echo $row['SeniorID']; ?>

Name:<?php echo $row['fname'];?> <?php echo $row['mname'];?> <?php echo $row['lname']; ?>

Gender:<?php echo $row['gender']; ?>

Age: <?php echo $row['age']; ?>

Contact Person: <?php echo $row['econtactpers'];?>

Contact Number: <?php echo $row['econtactnum'];?>

Contact Address: <?php echo $row['econtactadd'];?>

                              <?php echo $row['address'];?>
                               <?php echo $row['mopension'];?>
                              Active

                                 Update

                                       Delete

                              <?php $count++; } ?>

and the problem here is the data im getting are in the wrong text area and it just copies the data from the table

modal code snippet here:

            <form action="updatesenior.php" method="POST">
            <input type="hidden" name="update_senid" id="update_senid">

                               Profile Information

                                    Senior ID
                                    <input type="text" name="SeniorID" id="SeniorID" class="form-control" placeholder="SNR-123">

                                    First Name
                                    <input type="text" name="fname" id="fname" class="form-control" placeholder="first name">

                                    Middle Name
                                    <input type="text" name="mname" id="mname" class="form-control" placeholder="middle name">

                                    Last Name
                                    <input type="text" name="lname" id="lname" class="form-control" placeholder="last name">

                                    Gender
                                    <select class="form-control" name="gender" id="gender">
                                       <option>Male</option>
                                       <option>Female</option>
                                    </select>

                                    Birthday
                                    <input type="date" name="bday" id="bday" class="form-control">

                                    Age
                                    <input type="number" name="age" id="age" class="form-control" placeholder="Age">

                                    Birth Place
                                    <input type="text" name="birthplace" id="birthplace" class="form-control" placeholder="Birth Place">

                                    Address
                                    <textarea class="form-control" name="address" id="address"></textarea>

                                     Contact Information

                                    Contact Number
                                    <input type="text" name="contactnum" id="contactnum" class="form-control" placeholder="Contact Number">

                                    With Pension
                                    <input type="text" name="wpension" id="wpension" class="form-control" placeholder="With Pension">

                                    Monthly Pension
                                    <input type="text" name="mopension" id="mopension" class="form-control" placeholder="Monthly Pension">

                                    Status
                                    <select class="form-control" name="status" id="status" placeholder="Active">
                                             <option>Active</option>
                                             <option>Inactive</option>
                                          </select>

                                    Emergency Contact Person
                                    <input type="text" class="form-control" name="econtactpers" id="econtactpers"
                                       placeholder="Emergency Contact Person">

                                    Emergency Contact Number
                                    <input type="text" class="form-control" name="econtactnum" id="econtactnum"
                                       placeholder="Emergency Contact Number">

                                    Emergency Contact Address
                                    <input type="text" class="form-control" name="econtactadd" id="econtactadd"
                                       placeholder="Emergency Contact Address">

                     Cancel
                     <button type="submit" name="updatedata" class="btn btn-primary">Save Changes</button>

               </form>

script code snippet here:

i tried searching for solutions from several websites like w3schools for the table structure and script but still didn't get the output i want to happen

A: The issue is that for some of the various  elements, contain other sub-element(s) such as , ,
 and not only text like the senior id and address columns, so the .text() fetch is getting ALL related texts, including what is used to label the fields within each .
So, it is possible to extract the expected data, but in the example below, I had to wrap the data within  tags in some sub-elements to help extract only that portion of the data.
Because the Senior ID and Address columns do not have any sub-elements, the data from these can be extracted as-is without needing to add a  tag.
Try the example below:
(it's a rough example, I don't have all the UI modal elements available)

*

*When Update is clicked, the personal information area will get populated.
(Know that I only covered the first row from the first image to use
in the example, so not all fields are covered)

*I added function getChildTexts to get an array of texts when  sub-element(s) are found.

*The code changes applied are within the map function that you have
and the added function mentioned with item 2. Plus in the HTML where the  tags were added to surround the data within the sub-elements.

*The console.log will show the fetched array items. (it is possible
to scroll above the console output to see the personal information fields populated, though it will be a small area)

$(document).ready(function() {
   $('.editbtn').on('click', function() {
      //$('#editmodal').modal('show');

      $tr = $(this).closest('tr');

      var data = $tr.children("td").map(function(){
         // Look for  tag(s)
         var spanElements = $(this).find('span');

         if (spanElements.length) {
           // Get a text array from the span(s)
           return getChildTexts(spanElements);
         } else if ($(this).find('a').length) {
           // ignore the td with links
         } else {
           // no sub-element(s), get the text
           return $(this).text();
         }
      }).get();
      console.log(data);
      $('#SeniorID').val(data[0]);
      $('#fname').val(data[1]);
      $('#mname').val(data[2]);
      $('#lname').val(data[3]);
      $('#gender').val(data[4]);
//      $('#bday').val(data[5]);
      $('#age').val(data[5]);
//      $('#birthplace').val(data[7]);
      $('#address').val(data[9]);
      $('#contactnum').val(data[8]);
//      $('#wpension').val(data[10]);
      $('#mopension').val(data[10]);
      $('#status').val(data[11]);
//      $('#econtactpers').val(data[13]);
//      $('#econtactnum').val(data[14]);
//      $('#econtactadd').val(data[15]);

   });
});

function getChildTexts(elements) {
  var childTexts = [];

  elements.each(function(i, e) {
      childTexts.push($(e).text());
  });

  return childTexts;
}

  SNR-123

Name:This is Atest

Gender:Female

Age: 65

Contact Person: PaulT

Contact Number: 555-1212

Contact Address: 1313 somewhere

  549 Heehaw street
  500
  Active

    Update

    Delete

       Profile Information

            Senior ID
            <input type="text" name="SeniorID" id="SeniorID" class="form-control" placeholder="SNR-123">

            First Name
            <input type="text" name="fname" id="fname" class="form-control" placeholder="first name">

            Middle Name
            <input type="text" name="mname" id="mname" class="form-control" placeholder="middle name">

            Last Name
            <input type="text" name="lname" id="lname" class="form-control" placeholder="last name">

            Gender
            <select class="form-control" name="gender" id="gender">
               <option>Male</option>
               <option>Female</option>
            </select>

            Birthday
            <input type="date" name="bday" id="bday" class="form-control">

            Age
            <input type="number" name="age" id="age" class="form-control" placeholder="Age">

            Birth Place
            <input type="text" name="birthplace" id="birthplace" class="form-control" placeholder="Birth Place">

            Address
            <textarea class="form-control" name="address" id="address"></textarea>

             Contact Information

            Contact Number
            <input type="text" name="contactnum" id="contactnum" class="form-control" placeholder="Contact Number">

            With Pension
            <input type="text" name="wpension" id="wpension" class="form-control" placeholder="With Pension">

            Monthly Pension
            <input type="text" name="mopension" id="mopension" class="form-control" placeholder="Monthly Pension">

            Status
            <select class="form-control" name="status" id="status" placeholder="Active">
                     <option>Active</option>
                     <option>Inactive</option>
                  </select>

            Emergency Contact Person
            <input type="text" class="form-control" name="econtactpers" id="econtactpers"
               placeholder="Emergency Contact Person">

            Emergency Contact Number
            <input type="text" class="form-control" name="econtactnum" id="econtactnum"
               placeholder="Emergency Contact Number">

            Emergency Contact Address
            <input type="text" class="form-control" name="econtactadd" id="econtactadd"
               placeholder="Emergency Contact Address">

Hope that helps, feel free to ask any questions about the handling.
Side note:
I noted at the loop that creates the rows, that the closing row's
 is outside the loop's closing }, and there is a stray closing 	 tag after that. The browser apparently handles that gracefully, but worth a little clean-up.


text:
Q: Changing the dimensions of Childbrowswer plugin for Phonegap in iOS I am using the Childbrowser plugin with Phonegap on iOS to do facebook connect with in my app.  It all works but when the Childbrowser window opens it takes the full screen.  How can I get it to just pop up in a small window in a corner, do the work then quit?

A: I needed the same thing...
Since I couldn't find ready-to-use solution here, I decided to do it myself... I see this is very old post so I guess you already found a solution, but just in case you haven't and someone else might find it useful and save a couple of minutes :)
NOTE: my target is iPad only, so I opted for UIPopoverViewController, for an iPhone there were other ViewControllers that could be used, but the idea would be the same...
What I did is edited ChildBrowserCommand.h and added:
#define POPOVER_WIDTH 400
#define POPOVER_HEIGHT 300

@interface ChildBrowserCommand : PGPlugin <ChildBrowserDelegate, UIPopoverControllerDelegate>  {
    ChildBrowserViewController* childBrowser;
    UIPopoverController *popover;
}

@property (nonatomic, retain) ChildBrowserViewController *childBrowser;
@property (nonatomic, retain) UIPopoverController *popover;

Also, I edited ChildBrowserCommand.m, synthetized popover, and changed:
//[ cont presentModalViewController:childBrowser animated:YES ];

with:
if (popover == NULL)
{
    popover = [[UIPopoverController alloc] initWithContentViewController:childBrowser];
    [popover setPopoverContentSize:CGSizeMake(POPOVER_WIDTH, POPOVER_HEIGHT) animated:YES];
    popover.delegate = self;
}
[popover presentPopoverFromRect:cont.view.bounds inView:cont.view permittedArrowDirections:0 animated:YES];

and also added dismiss line:
-(void) onClose
{
    NSString* jsCallback = [NSString stringWithFormat:@"ChildBrowser._onClose();",@""];
    [self.webView stringByEvaluatingJavaScriptFromString:jsCallback];

    [popover dismissPopoverAnimated:YES];
}

Finally, I removed (commented out) dismissModal from ChildBrowserViewController.m (btw, kind of wrong place to have it there in the first place):
-(void)closeBrowser
{
    if(delegate != NULL)
    {
        [delegate onClose];
    }

    //[super dismissModalViewControllerAnimated:YES];
}

As a result, ChildBrowser opens in UIPopoverViewController with specified size (and no arrows in my case, if you want some, just specify UIPopoverArrowDirection), dismisses nicely when finished and/or when clicked outside of the popover window...
Best Regards,
Srdjan


text:
Q: Solve the equation $13x + 2(3x + 2)\sqrt{x + 3} + 42 = 0$.
Solve the equation $13x + 2(3x + 2)\sqrt{x + 3} + 42 = 0$.

Let $y = \sqrt{x + 3} \implies 3 = y^2 - x$.
$$\large \begin{align}
&13x + 2(3x + 2)\sqrt{x + 3} +42\\
= &14(x + 3) + (6x + 4)y - x\\
= &14y^2 + [6(x + 3) - 14]y - x\\
= &14y(y - 1) - (y^2 - x - 9)y^3 - x\\
= &14y(y - 1) + x(y^3 - y) - y^3(y^2 - 1) + 8y^3\\
= &14y(y - 1) + (xy^2 + xy + x)(y - 1) - (y^4 + y^3)(y - 1) + 8y^3\\
= &(-y^4 + y^3 + xy^2 + xy + x + 14y)(y - 1) + 8y^3\\
\end{align}$$
And I'm stuck here.

A: Part of the issue seems to be mixing up $x$ and $y$.  Usually once you identify a substitution it's easiest to bite the bullet and change the variable over completely.  Here, $y=\sqrt{x+3}$ implies $x=y^2-3$ and then
$13(y^2-3)+2(3y^2-7)y+42=0$
$6y^3+13y^2-14y+3=0$
Trying out rational root candidates with the Rational Root Theorem we identify $y=1/2$ as one of these roots.  Thereby
$(2y-1)(3y^2+8y-3)=0$
and solving the quadratic factor gives the additional roots $y=-3, y=1/3$.  The former is thrown out as the original substitution, by definition, requires a nonnegative square root.  Each of the other roots $y=1/2, y=1/3$ will give a valid solution for $x=y^2-3$ to the original equation.

A: I have no idea where you are trying to go with your approach, but I would suggest squaring both sides of
$$13x+42=-2(3x+2)\sqrt{x+3}.$$
This yields a cubic equation in $x$ which can be solved by standard methods; it turns out that all roots are rational so the rational root theorem yields them all. It remains to check whether these three roots are in fact solutions to the original equation.

A: Rearranging and squaring both sides of the original equation gives
$$4(3x+2)^2(x+3)=(13x+42)^2$$
$$36x^3+156x^2+160x+48=169x^2+1092x+1764$$
$$36x^3-13x^2-932x-1716=0$$
$$(x-6)(4x+11)(9x+26)=0$$
$$x=6, -\frac{11}{4}, -\frac{26}{9}$$
But $x=6$ is an extra solution created due to squaring both sides and will not work in the original equation.


text:
Q: Getting Microsoft 10 Edge browser Mime Types php When checking the file mime types of files being uploaded in Microsoft 10's Edge browser, I get this Mime Type for .doc files:
application/octet-stream

Apparently this indicates "arbitrary binary data": Do I need Content-Type: application/octet-stream for file download?
On other browsers I get application/msword
Is there a new way mime types are handled for .doc files for the Edge browser, and maybe other mime types I need to be aware of?
Update:
I was grabbing the mime type using php's $_FILES['uploadName']['type']

A: I found that by using this instead, I get the correct mime type:
$finfo = new finfo(FILEINFO_MIME_TYPE);
$mimeType = $finfo->file($_FILES['uploadName']['tmp_name'][$key]);

And as Martin mentioned in a comment above:

You should not grab the MIME type from the data given in $_FILE as
  this is extremely flaky and up for interpretation, as you are
  experiencing. Instead, do a new analysis of the uploaded temporary
  file, Use finfo() or similar.


text:
Q: the page refreshing issue on submit form, using jquery I'm trying to implement submit this form using jquery in this way

<%= link_to('ОКЕЙ', 'javascript:;', id: "create_todo_form")%>

data is transferred to the table, but the page is not updated, to display the changes, so I'm trying to add a line location.reload(); to this code
application.js
$( document ).ready(function() {

    $("#hide").click(function(){
        $("#todo_form").hide("slow");
    });

    $("#create_todo_form").click(function(){
        $("#form_id").submit();
        location.reload();
    });
});

And after this change the page is updated, however, submit is not implemented.
The form is in this file
index.html.erb

    <%= form_with model: @todo, id: :form_id do |form| %>

        <% form.label :text %>

        <%= form.text_field :text, placeholder: "Название задачи" %>

        <%= form.select( :project_id, options_from_collection_for_select(Project.all, :id, :title)) %>

        <%= link_to('ОТМЕНА', 'javascript:;', id: "hide")%>
        <%= link_to('ОКЕЙ', 'javascript:;', id: "create_todo_form")%>

    <% end %>

How could I fix this so that the data is added and the page is updated?

A: You need to redirect using your controller.
class ExampleController < ApplicationController

  def example
    # Your Code here
    respond_to do |format|
      format.html {redirect_to :back}  #you may use a definite path like root_path instead of :back
    end
  end

end

Remove location.reload() after these changes.


text:
Q: When we need op amp? I am still confuse about op amp.
When we need to use op amp? And how to determine the gain value for our op amp?
For example:
I want to use LM35 and atmega16. If the wire length between LM35 and atmega16 is short, i don't need to use op amp. If the wire length is too long, i need to use op amp, because there is possible of drop voltage.
But, how length the minimum wire that cause the circuit for need to use op amp? and what the exactly gain value for my op amp?

A: Let's talk about the analog side of things for a minute, without worrying about the specific parts.
If you have a voltage signal that you want to send down a long wire, whether or not it arrives unaltered depends on a number of factors. DC signals don't particularly suffer from any of the effects of transmission lines, so you are left with three primary factors - output impedance, input impedance, and the resistance of the line itself.
In the event that input impedance is very high, and line resistance is very low, it is predictable that a voltage signal can travel quite a long ways before something needs to be done about it. At the end of a 50 meter line like yours, I'm not so sure we're in this situation.
So what, then do we do about that? We can't just arbitrarily amplify the signal, it has to be predictable. And it still may have to cross a long distance, which could cause even more voltage loss and signal error.
The best and most industry standard way to solve this problem is to convert the voltage signal into a current, near the original signal. DC current on the line will be exactly the same at all points regardless of voltage drop, provided the output can provide enough power to drive that current. Opamps are a convenient and easily designed method to build a voltage controlled current source, which can then be passed down the line to a receiver. This receiver can also be readily designed from opamps as a current controlled voltage source. By selecting matched parts on both ends, it is possible to transmit simple control signals very long distances with very little error.
If you decide to use these methods, the gain on either end is almost entirely up to you. You could even decide to use the standard 4-20 mA method, which has the added convenience of making the system able to detect a disconnect and report it to the user.

A: Actually, you don't need an op amp in this case. An LM35 has a nominal output of 0 to 1 volts for a 0 to 100 C range. If the ADC is set up for a Vref of 1.1 volts and a gain of 1, you'll get a nominal scale factor of approximately 0.107 degrees C per lsb. Since the LM35 is only rated for +/- 0.5 degrees accuracy, this is better resolution than you can reliably use.
Op amps are generally used in various situations: when you need a specific gain, when you need an offset, when you need to buffer a high impedance or when you need to provide a filter on signal, among others.
None of these uses is called for in your example.


text:
Q: Pelican theme for book I'm trying to convert a CMS-based page to Pelican. My page is about a technical topic in the form of a book (think for example of a tutorial / book about HTML). It seems all static site generators focus on blogs. Therefore, most themes I found just do some kind of blog layout.
Can anyone please point me to a theme more suitable for a book with chapters and sections? Ideally, I like to see a content structure in some kind of tree in a sidebar. Also, I'm interested how to link certain pages so that the reader can go from section to section.

A: I'd recommend the "Elegant" theme, it has the flexibility you're looking for (their homepage has a good example of the sidebar feature you're mentioning).
As far as how you'd structure your Pelican site, you'll probably want to ignore the blog functionality of Pelican entirely, and create your book content as a bunch of static pages. If all your pages are markdown content, you can do something like this in your pelican site directory:
pelicanconf.py
content/
    i_am_a_blog_post.md
    pages/
        book_index.md
        chapter1.md
        chapter2.md
        chapter3.md

Then (this is the key to being able to drop in links to various content in the book) you specify the output location of the files book_index.md, chapter1.md, etc., by using the save_as metatag. So for example, book_index.md would contain:
Title: Book Index
save_as: book_index/index.html

Here is the index for my book:

* [Chapter 1]({{ SITEURL }}/chapter1/)
* [Chapter 2]({{ SITEURL }}/chapter2/)
* [Chapter 3]({{ SITEURL }}/chapter3/)

and chapter1.md would contain save_as: chapter1/index.html, and so on and so on. Now, when you visit your Pelican site, you can add "book_index/" to the end of the URL, and it will automatically take you to your book index page - which, conveniently for you, can still be written in Markdown.


text:
Q: Setting serviceURI for ClientFormsAuthenticationMembershipProvider I'm searching a way to set the serviceURI for ClientFormsAuthenticationMembershipProvider in code behind. I wish not to have the app.config being changed. Is this possible ?
I'm accessing services from a windows service as well as from a windows program and configuration should be handled in a central place.
Thanks,
Sascha

A: It is possible to cast to ClientFormsAuthenticationMembershipProvider ClientFormsAuthenticationMembershipProvider  just before doing the authentication. If casted you have a property ServiceUri. Set it and it's done.


text:
Q: what does reducing losses in a GAN mean? I have built a GAN and I am training it manually according to the the concept of optimizing several functions at a time. The loss of the discriminator and the generator is reduced at the same time optimally according to the equation I have employed, Though I am successful to reduce the loses of the generator and the discriminator to a great extent(better values than the original GAN training), however, the images generated are not good as the original GAN training. What could be the reason or how should I verify that inspite of losses being lowered the images are not good? Is there any intrinsic property of GAN that I need to keep in mind?

A: Assuming you have the same network architecture and the same training data.

*

*GANs usually take a very long time to train: did you train for long enough?

*Initial latent variable may differ: did you use the same distribution? Or maybe the same seed?

*The number of types you train your discriminator and generator: from experience, usually, we don't train for an equal number of times; in a sense, we alternate between the loss reduction - I tried 3-1 ratio, and it gave the best results.


text:
Q: PyQT and Visual Studio 2010 I'm using PyQT v4.9 for Windows 7, and Visual Studio 2010 (extension PTVS 1.1 )
Autocomplete is good function in IDE. Example:
   object.method_of_class() #when I press the dot, see a list of possible methods.
But with pyqt class, this not works, exapmle:
    QtGui.QDesktopWidget()
How can I solve this problem?
P.S. Forgive me for my bad English

A: I had the same problem with PTVS version 1.1.1 . I did the following . Now auto completion works for PyQT libraries.
1. upgraded the  PTVS to 1.5
2. In visual studio , select tools-options- python tools-interpreter options. Click on "Generate completion" , then restart  the visual studio.


text:
Q: Hibernate Projections List I ned to get only a few column values from the table. So I have used Projections to achieve this. The code works, but I don't think it is effective.
My issue was when I used ProjectionsList & then set the criteria.list to an ArrayList - the Bulletin object is null. I'm not sure how to explain this better. So I will put the code and then please read below:
 List<Bulletin> list = new ArrayList<Bulletin>();
 BulletinList bulletinList = null;

 Criteria criteria = null;

 criteria = this.getSession().createCriteria(Bulletin.class)
            .setProjection(Projections.projectionList()
            .add(Projections.property(bulletinIdAttr))
            .add(Projections.property(docNameAttr))
            .add(Projections.property(docTypeCodeAttr))
            );
    criteria.addOrder(Order.desc(createdTimeAttr));

    List<Object> rows = criteria.list();
    for (Object r : rows) {
        Object[] row = (Object[]) r;
        Bulletin bull = new Bulletin();
        bull.setBulletinId((Long) row[0]);
        bull.setDocumentName((String) row[1]);
        bull.setDocumentTypeCode((String) row[2]);
        list.add(bull);
      }

    bulletinList = new BulletinList();
    bulletinList.setBulletins(list);

    return bulletinList;

I just need to set criteria.list to BulletinList (Class that holds a list of Bulletin objects). But when I use projections, Bulletin object is null.
I also was reading another thread to use
setResultTransformer(Transformers.aliasToBean

But that ain't working either. So can someone help in this on how to make the code better.
Thanks
Harish

A: You can use
 criteria = this.getSession().createCriteria(Bulletin.class)
            .setProjection(Projections.projectionList()
            .add(Projections.property(bulletinIdAttr),"bulletinIdAttr")
            .add(Projections.property(docNameAttr),"docNameAttr")
            .add(Projections.property(docTypeCodeAttr),"docTypeCodeAttr")
            );
criteria.addOrder(Order.desc(createdTimeAttr));
criteria.setResultTransformer(new AliasToBeanResultTransformer(Bulletin.class));
List<Bulletin> bulletinList = criteria.list();

Here criteria.setResultTransformer(new AliasToBeanResultTransformer(Bulletin.class)) will transform your result in the desired POJO class but make sure your POJO class( Bulletin.class in your case) should have appropriate setters to set the values of properties.
Now criteria.list() will return the List of Bulletin POJO class instead of Object.

A: *

*Projections.property() takes a String as an argument. In the code you provided the value of that String should be the name of a member of the Bulletin class. Presumably bulletinIdAttr, for example, is a String with such a value otherwise you would be getting runtime errors.

*When you call setProjection on a Criteria instance you are implicitly setting the ResultTransformer to PROJECTIONS and this is what you want. No need to call setResultTransformer yourself. I would simplify the routine a little like this
List<Object[]> rows = criteria.list();
for (Object[] row : rows) {
   Bulletin bull = new Bulletin();
   bull.setBulletinId((Long) row[0]);
   bull.setDocumentName((String) row[1]);
   bull.setDocumentTypeCode((String) row[2]);
   list.add(bull);
}

But that shouldn't make any difference to your results. Have you checked that rows is empty?

A: If you want to do a second search from the same criteria, you have to change or remove the Projection. For example, if you search for the count first:
criteria.setProjection(Projections.rowCount());
Integer count = criteria.list().get(0);

and then want to fetch all the objects:
criteria.setProjection(null);
List<Object> returnedObjects = criteria.list();


text:
Q: fetch row id and load data related to id from another table there is a action called vew boq.i want to load a grocery crud or another simple crud table when click the view boq. that crud should contain data from another new table called BOQ. and should fetch the data according to Project Id.
for an example when i click the "view boq" in first line it should load all data in boq which forign key have to equal to Project_id 1.Project id is a FK of the BOQ Table.can i do it and any one can help me.
controller
function show_boq() {
$id = $this->uri->segment(3);
$data['boq'] = $this->project_list_model->show_boq($id);
$this->load->view('boq_doc', $data);
}

model
function show_boq($data){
$this->db->select('*');
$this->db->from('boq');
$this->db->where('id',$data);
$this->db->join('project', 'project.id = boq.project.id');
$query = $this->db->get();
$result = $query->result();
return $result;
}

A: get the corresponding project id for that particular row, and use it in the select query to filter your result set.
for example,
(considering the project id value is passed as projectId or it can be another name, and there are so many other methods to do it.)

select * from BOQ where project_id=projectId;

This should get the results.And if you are having problem with getting the data still, then you have to check how your crud is being called in the webservice.


text:
Q: pass the value in the id="Rate<%=Cnt%>" into showEdit(typ) function to enable it updated in db

             <input type="button" name="upd_rate" value="Update Rate" onclick="showEdit(1)">

        <input type="button" name="upd_rate" value="Save" onclick=" updateRate(); showEdit(2)">

<div name="bEdit<%=Cnt%>" id="divRate<%=Cnt%>"><%=rscRate%>
<input type="text" id="Rate<%=Cnt%>" name="aEdit<%=Cnt%>" value="<%=rscRate %>" style="display:none">
<div name="bEdit<%=Cnt%>" id="divAm
    function showEdit(typ)
    {
        //alert("showEdit");
        var i=1;
        document.forms[0].reset();
        if(typ==1)
        {
            document.getElementById('show1').style.display='none';
            document.getElementById('show2').style.display='inline';
        }
        else
        {
            document.getElementById('show1').style.display='inline';
            document.getElementById('show2').style.display='none';
        }

        while(document.getElementById('rscRate')!=null)
        {

            if(typ==1)//show edit
            {
                //alert("showEdit:" + i);
                //document.getElementById('rscRate').style.display='none';
                //document.getElementById('rscCost').style.display='none';
                document.getElementById('divRate'+i).style.display='none';
                document.getElementById('divAmt'+i).style.display='none';
                document.getElementById('Rate'+ i).style.display='inline';
                document.getElementById('Amt'+ i).style.display='inline';
                document.getElementById('flag').value = 'Y';
                var a = document.getElementById('Rate'+ i).value;
            }
            else //no edit
            {
                //alert("showEdit2");
                //document.getElementById('rscRate').style.display='inline';
                //document.getElementById('rscCost').style.display='inline';
                document.getElementById('divRate'+i).style.display='inline';
                document.getElementById('divAmt'+i).style.display='inline';
                document.getElementById('Rate'+ i).style.display='none';
                document.getElementById('Amt'+ i).style.display='none';
                document.getElementById('flag').value ='N';
                var a = document.getElementById('Rate'+ i).value;
                //for ( int x = 0; x < i; x ) {

                //}
                //for(var i = 0; i < array.length; i++)
                //document.getElementById.Rate[i].value = array[i];

            }
            i++;
        }
    }

A: You should really consider doing this with jQuery.. On the div you can add a onclick event in the document.ready function and then use the value as input in the onclick function. That would solve your problem.


text:
Q: Push notification with pusher beam, unable to send data/payload I am using following php sdk for generating pusher beam push notification. but there is not information provided in the sdk docs on how to send data/payload along with it. the notification is bean sent correctly but I am unable to send data: please guide me how we can send the data: it is showing hasData as false in beam console, please check:

php sdk i am using : https://github.com/pusher/push-notifications-php
my code look like this:
$pushNotification = new PushNotifications([
                'instanceId' => env('BEAM_INSTANCE_ID'),
                'secretKey' => env('BEAM_PRIMARY_KEY')
            ]);
            $pushNotification->publishToInterests(
                ['message-notification'],
                [
                    "apns" => [
                        "aps" => [
                            "alert" => "Message Received",
                        ],
                    ],
                    "fcm" => [
                        "notification" => [
                            'title' => 'some title',
                            'body' => 'some body',
                            'data' => 'some data', //passing data here but not working
                         ],
                    ],
                ]
            );

A: I got it working, we can pass data in following way:
$publishResponse = $pushNotifications->publishToInterests(
  ["donuts"],
  [
    "apns" => [
      "aps" => [
        "alert" => "Hello!",
      ],
    ],
    "fcm" => [
      "notification" => [
        "title" => "Hello!",
        "body" => "Hello, world!",
      ],
      "data" => [                      // <==== pass data here
         "name" => "adam",
         "type" => "user",
      ],
    ],
  ]
);


text:
Q: prepend image to dynamic className jQuery I'm trying to prepend image to a div using its className in jquery
function someFn(obj)
{
    var dynaClass = $(obj).prop("className");

This is giving me classname dia_wrapper_0.
Now i am wrapping the string with single quotes and . to access the class name
    dynaClass = "'."+dynaClass+"'";

This is giving me '.dia_wrapper_0' . Now i'm prepending the image to this class name
    $(dynaClass).prepend('');
}

My console.log is showing
    Uncaught Error: Syntax error, unrecognized expression: '.dia_wrapper_0'

How do i prepend image to my dynamic className

A: The class selector should not be wrapped in '', it should be string like .myclass not like '.myclass'
dynaClass = "."+dynaClass;

A: you don't need to re-query the element, the element with the class you need is obj so you can do
$(obj).prepend('');

Getting class names like that is highly inefficient. If you need to do that please consider another approach because your code could easily break if obj has several classes. eg.   would result in dynaClass = '.class-1 class-2' which would also throw errors when pushed back into jquery


text:
Q: Consultar a la base de datos cuando WHERE sea lo que yo le mande desde el controlador de Angularjs Tengo un conection.php que conecta a la DB y  consultaTickets.php:
<?php
header('Access-Control-Allow-Origin: *');
date_default_timezone_set("Chile/Continental");

**// Including database connections**
require_once 'conection.php';

**// mysqli query to fetch all data from database**
$query = "SELECT rut, numero FROM Tickets WHERE servicio_id = $_POST['servicio_id']";
$result = mysqli_query($con, $query);
$arr = array();

if(mysqli_num_rows($result) != 0) {
while($row = mysqli_fetch_assoc($result)) {
$arr[] = $row;
}
}
**// Return json array containing data from the databasecon**
echo $json_info = json_encode($arr);
?>

El problema lo tengo en la Query en el WHERE porque deseo mandarle el parámetro desde el controlador de AngularJS porque so datos que obtengo de un login... (otro WS).
La pregunta es :¿como lo puedo hacer?
En angularJS debería ser de la siguiente manera:
$http({
    method: 'POST',
    url: 'http://localhost/Paneldetencion/app/php/consultaTickets.php',
    headers: {
        'Content-Type': 'application/json',
        'Accept': 'application/json'
    },
    data: {
        servicio_id: 38
    }
})

.then(function(data) {

var dat = data.data;
$scope.tickets = [];

      for (var i = 0; i < dat.length; i++) {
        dat[i]
        var ticket = {
            numero: dat[i].numero,
            rut: dat[i].rut,

        };
        $scope.tickets.push(ticket);
    }

}

es un entero el numero, como debe ir parseado?
error: Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in /Applications/XAMPP/xamppfiles/....php on line 7

A: No se ve que el problema sea AngularJS sino de como capturas los parámetros desde PHP.
Imagino que algo como:
$servicioId = $_POST["servicioId"];

debiera servirte suponiendo que el parámetro que envíes sea de nombre servicioId.
Pero eso no va a ser suficiente ya que además debes enlazar ese valor para que sea incluido en la consulta.
Este link te puede servir.

A: despues de probar llego a la siguiente solución :
<?php
    $db = mysqli_connect('localhost','root','','prueba')
    or die('Error connecting to MySQL server.');
    $postdata = file_get_contents("php://input");
    $request = json_decode($postdata);
    $id = $request->servicio_id;
    $query = "SELECT * FROM servicios WHERE id=".$id;
    mysqli_query($db, $query) or die('Error querying database.');
    $result = mysqli_query($db, $query);
    $array = array();
    while ($row = mysqli_fetch_array($result)) {
        $array[] = array(
            "id" => $row["id"],
            "sucursal_id" => $row["sucursal_id"],
            "nombre" => $row["nombre"],
            "nombre_completo" => $row["nombre_completo"]
        );
    }
    echo json_encode($array);
?>

Modifique el codigo de la conexión a la base de datos ya que probe en mi xampp con php 7.0 y las que ocupas tu estan obsoletas en esa versión.
Cambie la query por
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$id = $request->servicio_id;
$query = "SELECT * FROM servicios WHERE id=".$id;

Al enviar desde tu AngularJS tu estas haciendo un POST
headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json'
},

Con estos headers por lo tanto estas predimentando que la data que se envia es de tipo JSON y PHP no esta recibiendo un $_POST como corresponde.
Por eso cuando intentabamos imprimir $_POST['servicio_id'] siempre recibiamos un index undefined


text:
Q: Place imageview next to textview I'm trying to place an imageview next to a textview. However they keep ending up on different "lines".
    <ImageView
      android:layout_width="10dp"
      android:layout_height="wrap_content"
      android:id="@+id/medication_administration_time_row_fmk_icon" />

    <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_toLeftOf="@id/medication_administration_time_row_fmk_icon"
      android:id="@+id/medication_administration_time_row_drug" />

Placing the image as a compound drawable isn't an option as that is used for another image.
Any clues about how I can get the image on the same line as the text?

A: Use android:layout_toRightOf:
Positions the left edge of this view to the right of the given anchor view ID. Accommodates left margin of this view and right margin of anchor view.Property of RelativeLayout.So finally,
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal"
 >

<ImageView
 android:id="@+id/medication_administration_time_row_drug"
  android:layout_width="10dp"
  android:layout_height="wrap_content"
  android:id="@+id/medication_administration_time_row_fmk_icon" />

<TextView
    android:id="@+id/descriptioncomma"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text=""
    android:layout_toRightOf="@id/medication_administration_time_row_drug" />

A: I would like to give you some tips when you are trying to make UI of the app. The first thing you should do is to try to get the UI you want using design tool where you can place UI elements and what is more important you can also see which attributes you can set for specific layout. That will save you some time.
And answer to you question would be linear layout which is the most easier way to do it. Just try to avoid weights(here not necessary) because than it takes more time to create UI.
Here is great tutorial to understand layout bit better.
http://www.androidhive.info/2011/07/android-layouts-linear-layout-relative-layout-and-table-layout/
And of course answer to your question(did it just by using design tool):
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:gravity="center_vertical|center_horizontal">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/imageView2"
            android:background="@drawable/your_image" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="Small Text"
            android:id="@+id/textView2"
            android:gravity="right" />
    </LinearLayout>

</LinearLayout>

A: There are two ways to achieve this.

*

*Use a LinearLayout as container/parent with either vertical or horizontal orientation, what fits your needs.

*You can use an relative layout as container/parent and then use "toRightOf" or "above"/"below" property and use the ids of your child views.
The better approach is the first one, as relative layout measure twice.

A: Using Compound Drawable
<TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_toLeftOf="@id/medication_administration_time_row_fmk_icon"
  android:id="@+id/medication_administration_time_row_drug"
  android:drawableLeft="@drawable/your_image_name />

In this you setting the ImageView to the left of TextView
Else if you want this as separate components means try this (Another way of doing)
<LinearLayout
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:orientation="horizontal"
  android:gravity="center_vertical">

<ImageView
  android:layout_width="10dp"
  android:layout_height="wrap_content"
  android:id="@+id/medication_administration_time_row_fmk_icon" />

<TextView
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_toLeftOf="@id/medication_administration_time_row_fmk_icon"
  android:id="@+id/medication_administration_time_row_drug" />

</LinearLayout>

Change the android:orientation of LinearLayout in case if you want it vertical, accordingly change the android:gravity too

A: You can do it like this
        <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:orientation="horizontal">

                <ImageView
                    android:id="@+id/imageViewTipoProduto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="16dp"
                    android:layout_marginStart="16dp"
                    android:layout_marginTop="8dp"
                    app:srcCompat="@drawable/ic_kit_produtos_white_12dp" />

                <TextView
                    android:id="@+id/textViewTipoProduto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="22dp"
                    android:layout_marginLeft="8dp"
                    android:layout_marginStart="8dp"
                    android:layout_marginTop="4dp"
                    android:fontFamily="sans-serif-light"
                    android:letterSpacing="0.04"
                    android:text="@string/kit_de_produtos"
                    android:textColor="#ffffff"
                    android:textSize="14sp"
                    android:textStyle="normal" />

            </LinearLayout>


text:
Q: Perl regular expression for partially matching an ip or mac address I'm writing an optimization where you are performing a search for my application and if the string looks like an ip address, then don't bother searching MAC addresses.  And if the search looks like a MAC address, don't bother looking in the IP address db column.
I have seen expressions that match ips and mac addresses exactly, but its hard to come by one that matches partial strings and quite a fun brain teaser and I thought I'd get other people's opinions.  Right now I have a solution without regex.
use List::Util qw(first);

sub query_is_a_possible_mac_address {
  my ($class, $possible_mac) = @_;
  return 1 unless $possible_mac;

  my @octets = split /:/, $possible_mac, -1;
  return 0 if scalar @octets > 6; # fail long MACS
  return 0 if (first { $_ !~ m/[^[:xdigit:]]$/ } @octets; # fail any non-hex characters
  return not first { hex  $_ > 2 ** 8 }; # fail if the number is too big
}

# valid tests
'12:34:56:78:90:12'
'88:11:'
'88:88:F0:0A:2B:BF'
'88'
':81'
':'
'12:34'
'12:34:'
'a'
''

# invalid tests
'88:88:F0:0A:2B:BF:00'
'88z'
'8888F00A2BBF00'
':81a'
'881'
' 88:1B'
'Z'
'z'
'a12:34'
' '
'::88:'

A: Given the (new) tests, this works:
/^[0-9A-Fa-f]{0,2}(:[0-9A-Fa-f]{2}){0,5}:?$/

Here are the lines that match given the above tests (note that single hex characters like 'a' and 'A' are correctly matched:
12:34:56:78:90:12
88:11:
88:88:F0:0A:2B:BF
88
:81
:
12:34
12:34:
a
'' (<-- empty space)

A: The best way I found to do this was to try and make the possible match become what you are trying to match.  For example if you have a string: 1.2, try and make it look like an ip address: 1.2.1.1.  Then apply the regex
sub contains_ip {
    my ($possible_ip) = @_;

    my @splits = split /\./, $possible_ip;

    return 0 if @splits > 4;
    while (@splits < 4) {
        push @splits, '1';
    }

    $possible_ip = join '.', @splits;

    my ($match) = $possible_ip =~ m/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/;
    return defined $match ? 1 : 0;
}

warn contains_ip('1.2'); # 1
warn contains_ip('127.0.0.1'); # 1
warn contains_ip('1.2asd'); # 0
warn contains_ip('1.2.3.4.5'); # 0

The same thing applies to mac addresses:
If you had 11:22, try and make it look like a fully qualified mac address, 11:22:00:00:00:00, then apply the mac address regex to it.


text:
Q: since I studied at college
*

*This restaurant has been here since my grandparents were alive. But it's changed a lot since then.

*I've worked out regularly since I studied at college.
What does it mean to say "since my grandparents were alive" or "since I studied at college"?
Some people told me that they meant "since my grandparents died" and "since I left college". But other people seemed to imply that they meant "since a point during the period when my grandparents were alive" and "since a point during the period when I studied at college".
I've been confused for a while. Could you please tell me which explanation is correct?

A: If the condition (studied/grandparents were alive) covers a period of time then it means 'at some time during that period'.
If the condition is at a fixed point (I went to bed/I graduated), then it means 'since that point'.
Consider the sentence:
"I haven't eaten since yesterday evening" - Here it clearly refers to the whole evening. You would never take it to mean that he last ate at the stroke of midnight.


text:
Q: awk command not working with kubectl exec From outside container:
$ kubectl exec -it ui-gateway-0 -- bash -c "ps -ef | grep entities_api_svc | head -1"
root         14      9  0 10:34 ?        00:00:02 /svc/bin/entities_api_svc

$ kubectl exec -it ui-gateway-0 -- bash -c "ps -ef | grep entities_api_svc | head -1 | awk '{print $2}'"
root         14      9  0 10:34 ?        00:00:02 /svc/bin/entities_api_svc

From inside container:
[root@ui-gateway-0 /]# ps -ef | grep entities_api_svc | head -1 | awk '{print $2}'
14

A: I find it easier to use single quotes on the sh/bash command argument so it is closer to what you would type in the shell:
kubectl exec -it ui-gateway-0 -- \
  bash -c 'ps -ef | grep entities_api_svc | head -1 | awk "{print \$2}"'

This means the awk uses double quotes, which requires the shell variable marker $ to be escaped.
In the original command, the shell running kubectl was replacing $2 with a zero length string so awk would see only print, which prints the whole line
Multiple levels of nesting
Nested shell escaping gets very obscure very quickly and hard to debug:
$ printf '%q\n' 'echo "single nested $var" | awk "print $2"'
echo\ \"single\ nested\ \$var\"\ \|\ awk\ \"print\ \$2\"

$ printf '%q\n' "$(printf '%q\n' 'echo "double nested $var" | awk "print $2"')"
echo\\\ \\\"double\\\ nested\\\ \\\$var\\\"\\\ \\\|\\\ awk\\\ \\\"print\\\ \\\$2\\\"

If you add a file grep-entities.sh in container
#!/bin/bash
set -uex -o pipefail
ps -ef | grep entities_api_svc | head -1 | awk '{print $2}'

You then don't need to worry about escaping
pid=$(sshpass -p "password" ssh vm@10.10.0.1 kubectl exec ui-gateway-0 -- /grep-entities.sh)

Also pgrep does the scripts job for you
kubectl exec ui-gateway-0 -- pgrep entities_api_svc


text:
Q: Counting the number of used cells in a column next to a found String Here is a reference pic to help show what i'm talking about.
http://imgur.com/a/L2Jyb
In my For Next loop I have the following code.
Dim Counter As Long

For Counter = 0 To ActiveSheet.Rows(1).Cells.Find("QQQ").Offset(0, 1).End(xlUp).Row

This is suppose to look through Row 1 until it finds "QQQ" and count the number off used cells in the column to the immediate right.  I'm not sure how to tell excel how to Count the offset column.
The reason I use the Find is because each of the sheets has a different column that the criteria will be in.  For example: in the pic above The column happens to be Q.  It could be different based on the sheet.

A: Dim Counter As Long

With ActiveSheet
    For Counter = 0 To .Cells(.Rows.Count, .Rows(1).Cells.Find("QQQ").Offset(,1).Column).End(xlUp).Row
    ' rest of your counter loop code

End With


text:
Q: Html.Display extension not outputting value I use the following code to print user name.
@if (User.Identity.IsAuthenticated)
{
   @Html.Display("Welcome, " + User.Identity.Name);
}

But it doesn't  print it.
Why?

A: Html.Display is not meant to display strings, but properties from your model. Try something like this:
@if (User.Identity.IsAuthenticated)
{
   @: Welcome, @User.Identity.Name
}

A: I found another solution:
 @if (User.Identity.IsAuthenticated)
           {
               <label>Welcome, </label>  @Html.Label(User.Identity.Name);
           }