text:
Q: How to avoid wild card character and special character when searching from front end Suppose I have a search functionality in front end written in Java. I have a text box for example name. When I pass a name or a character it works fine, but when I pass any special character, it's not working because I am sending this parameter to the oracle procedure, which is using dynamic query.
Suppose the query in my procedure is  this:
create or replace procedure abc
(abc IN  table.name%type
,p_abc   abc_cur
)
is
v_var varchar2(2000);
begin
v_var:='select * from table where name LIKE '%'NVL(p_name,name)'%'';
open c1 for v_var;

end abc;

When I pass [%,_ ,.] it search on the basis of wild card characters as you see in the query.
Now when I pass ['] only then it gives an exception. Please tell me a solution how to handle this is backend, I don't want to consider any special character in the query and the use of dynamic query is compulsory.
NOTE: Please see parameters within braces[] are separated by comma.
I am using Oracle as RDBMS.

A: escape! Don't let the user use %. Also beware of sql injection. (Other chars to keep an aye on are _ and ?)
Btw in oracle you can user something like
SELECT * FROM TABLE_A WHERE FIELD LIKE '%sometext\%%' escape by '\'

Regards
EDIT: I prefer using cursor in for loops
for x in (select whatever from whenever) loop
   DBMS_OUTPUT.putLine(x.field);
end loop;

this saves me from managing closures in exception handlers and cursor syntax


text:
Q: Not able to make Redshift connection in AWS glue, where the redshift is located in different location (us-west-1) Redshift is located in Us-west - 1 region and aws glue is not supported in us-west-1 region. so i have created aws glue in different region and trying to access the redshift. When am adding the connection in AWS glue, not getting the redshift cluster detail in drop down. So i tried with jdbc connection, but is failing.What should i have to make for successful connection.

A: The Redshift connection will appear on the dropdown only if you are trying to make conection to redshift cluster in that account. for every other redshift cluster (which is in any region / any account), you need to use JDBC, it should work fine, unless you haven't provided the connection enough info.
Anyway if you can post the error, that would be helpful to resolve to the point.
some common things to check for:
1. check Reddhsift Security Group (if it is allowing only connections
    from particular ip cidr).
2. Check if your target RedshiftCluster is SSL
        enabled and if it is, make sure you are giving the ssl validation
        thing also at end of your host URL.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Colorbox image effects not showing I am new to drupal and just wanted to work on a image gallery. For this I downloaded colorbox module and installed it. Created a new content type Gallery with Field Type image and Format colorbox in Manage Display section. Basically I am following this tutorial :
Create gallery in D7
I added content to content type Gallery. But when I click on the images, it does not show any effects, instead a normal image view , ie image in a new window ! Whats wrong I am doing?

A: *

*Do you install module Libraries API?

*Download plugin and unpack to sites/all/libraries/colorbox


text:
Q: JQuery and Ajax: Is the  element important, or can I just use  I was wondering if I need to use the form element in my HTML when I make an Ajax call. Can I just get away with using, for instance, the input element, and then specifying the rest of the information (URL, etc.) in the JavaScript?
By "need," I mean to say is there some stylistic, security or reliability reason to continue using the <form> element?

A: If you're doing an AJAX request, you do not technically need the <form> tag.  However, there are some reasons why you might want to keep using it

*

*It may be more semantically correct for your situation (e.g. the user actually is submitting a "form").

*Imagine if a user does not have JavaScript enabled or are using a browser that does not support JavaScript.  Your site may be able to degrade more gracefully.  That is, the user can still submit the form even without JavaScript.

*There are some JQuery plugins that can parse a <form> and submit it with AJAX rather than requiring you to select each <input> element, extract its value, and construct the AJAX request yourself.

A: You don't need a form, no. If you have a lot of elements, it's obviously good to wrap them in a div to make selecting the inputs easier.
There is an advantage to using a form, however, which is graceful degradation. If you have a form with a normal submit button with the following jQuery:
$("form").submit(function(e) {
    e.preventDefault();

    // Ajax request
});

The e.preventDefault() will stop the form from submitting normally, and do the AJAX request you write below. If the user doesn't have JS enabled, the form will submit using the usual method without JS.

A: No you don't explicitly need it unless you need specific form method/action stuff. You can directly use input fields and have a button with a click event bound to it and call it via ajax/jquery.
I personally use the form-based technique if I want to show a totally different page/representation after the user 'submits' the form.
There is no stylistic, security or reliability reason to using (or not using) a form. You could specify the same parameters in the $.ajax() if you want.
It's how you want to design the application...

A: If you use ajax, you do not need to make a form. If you use normal form method, you need one


text:
Q: Swagger-ui doesn't provide how i pass MediaType.APPLICATION_OCTET_STREAM content Actually i am facing a problem that Swagger-ui can't show me input for MediaType.APPLICATION_OCTET_STREAM, so lets imagine this next service:

@PUT
@Path("/performAudioQuery")
@Consumes(MediaType.APPLICATION_OCTET_STREAM)
public Response performAudioQuery(InputStream audioInputStream){
      //Impl of the service
  }

and here are the dependencies
<dependency>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-jersey2-jaxrs</artifactId>
        <version>1.5.6</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.media</groupId>
        <artifactId>jersey-media-multipart</artifactId>
        <version>2.22.2</version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.3.1</version>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>

and i am using wildfly 9.x
So what should i do to make it possible for Swagger-ui working good with this previous service?

A: The current version of the Swagger/OpenAPI specification (2.0) doesn't deal kindly with file uploads as what's known as body parameter. We've formulated a workable solution that is covered at https://github.com/OAI/OpenAPI-Specification/issues/50 - however that solution is currently not fully supported by swagger-core and not supported at all in swagger-ui.


text:
Q: Django redirect URL into another URL with form I wouldlike to redirect in another URL when I submit my form.

After submit, I wouldike to have another page with something like "Hello (SummonerName) and Welcome" with URL like this : interface/main/SummonerName=(SummonerName)
Here my code :
forms.py
from django import forms

class SummonerForm(forms.Form):
summoner_name = form.CharField(label='SummonerName:', max_length=100)

views.py
from django.http import HttpresponseRedirect
from django.shortcuts import render
from .forms import NameForm

def get_name(request):
    # if this is a POST request we need to process the form data
    if request.method == 'POST':
        # create a form instance and populate it with data from the request:
        form = NameForm(request.POST)
        # check whether it's valid:
        if form.is_valid():
            # process the data in form.cleaned_data as required
            # ...
            # redirect to a new URL:
            return HttpResponseRedirect('/interface/name.html')

    # if a GET (or any other method) we'll create a blank form
    else:
        form = NameForm()

    return render(request, 'interface/main.html', {'form': form})

and my main.html
<form action="/SummonerName={{ current_name }}" method="post">
    <label for="summoner_name">SummonerName: </label>
    <input id="summoner_name" type="text" name="summoner_name" value="{{ current_name }}">
    <input type="submit" value="Rechercher">
</form>

EDIT :
urls.py
from django.urls import path
from . import views

urlpatterns = {
path('main', view.get_summoner_name)

}

Thank you !

A: That is what return HttpResponseRedirect does your views.py. You only need to pass your desired url as the first parameter instead of `'/interface/name.html'.
See:
https://docs.djangoproject.com/en/2.2/ref/request-response/#httpresponse-subclasses
For passing on the name, you have many options depending on what you want to do with the inputted data.
A simple solution:
Your example is rather simple and so if you only want to redirect to some url and show the name the user has inputed the easiest would be to pass the name (and any other parameters) via the url as a querystring:
import urllib.parse

# ... omitted code

def get_name(request):
    # if this is a POST request we need to process the form data
    if request.method == 'POST':
        # create a form instance and populate it with data from the request:
        form = NameForm(request.POST)
        # check whether it's valid:
        if form.is_valid():
            # process the data in form.cleaned_data as required
            # get parameters from the form
            params = {
                "summoner_name" : form.validated_data["summoner_name"],
                # multiple parameters can be passed in this dict e.g.
                # "some_other param" : param_value
            }
            # encode the dictionary into a querystring
            q_string = urllib.parse.urlencode(params)
            # construct the new URL:
            redirect_url = "/interface/success/?summoner_name={}".format(q_string)
            return HttpResponseRedirect(redirect_url)

    # if a GET (or any other method) we'll create a blank form
    else:
        form = NameForm()

    return render(request, 'interface/main.html', {'form': form})

You can then access these parameters in your views/templates by the request object.
Then, in your urls.py you should match this url pattern by adding to your patterns something like:
path('interface/success/', views.success_view),

and you should of course define that view:
# views.py
def success_view(request):
    return render(request, "success.html")

Finally you should add a template success.html. There you could do <h1> Hello {{ request.GET.summoner_name }}! </h1>
A more common usecase
The method above only shows data the user has inputted which is usually not very usefull... More commonly in a form we ask data that we need to save to the db, and thats why I proposed a ModelForm in my comment. It is off the scope of this answer to explain exactly how that would work but in a nutshell: you should define a model in your models.py (i.e. a db table) where you can store data (summoner_name would be a field in such a model).
class SimpleModel(models.Model):
    summoner_name=models.CharField(max_length=256)
    # other fields you may need

Then you can use a django's generic class based views e.g.
class SimpleFormView(CreateView):
    model = SimpleModel
    success_url = "interface/success"

urls.py will also need some editing and your tempaltes should comply with django naming conentions too. Do read this if you want to go down that way:
https://docs.djangoproject.com/en/2.2/topics/class-based-views/generic-editing/#form-handling-with-class-based-views


text:
Q: iPhone : How to get "Airplane and autolock" information in the app from iPhone setting? I want to display iPhone's settings Airplane feature and autolock feature's status in my app.
I got the two links : link1 and link2 but did not get the much details on that.
Can any one tell me how can I get those status?

A: basically, you can't. you can disable autolock while your application is running, but you can't change the system setting.. nor can you access it. rather than displaying the airplane mode status, maybe you can show general reachability? i.e. https://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html or ASIHTTP includes reachability functionality.


text:
Q: Instance in private AWS subnet with NAT gateway can't access AWS services We have an instance within a private subnet that has a managed NAT gateway.  On that instance, we are able to access the internet:
$ curl https://www.google.com/
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en"><head>...

However, we are not able to access the cloudwatch endpoint, e.g. the following times out: (EDIT: My mistake, not the cloudwatch endpoint, but rather the site storing the cloudwatch monitoring scripts.)
$ curl https://cloudwatch.s3.amazonaws.com

DNS is not the problem:
$ dig cloudwatch.s3.amazonaws.com
cloudwatch.s3.amazonaws.com. 2303 IN    CNAME   s3-1-w.amazonaws.com.
s3-1-w.amazonaws.com.   1   IN  A   54.231.72.59

Any ideas about what might be happening?

A: I actually Had the same issue and managed to resolve it in the same way that JustinHK did below. I've reached out to AWS to understand why it happened because I couldn't let it go, so this should help with explaining the behavior. Here's the breakdown:

*

*The issue is not with the traffic not being able to reach the destination, it's with the traffic not being able to return correctly to the origin.

*Since the public subnet (where the NAT gateway is sitting) has 2 options to reach the destination - either via the VPCE (VPC Endpoint) or via the IGW (Internet Gateway), it doesn't know which one to pick when the request is doing the trip back. Since it doesn't know which one to pick - it just times out.

*Routing chooses the path of least resistance, so adding the VPCE in the private subnet made the VPCE route the ideal route. Though it's worth mentioning here that the request isn't going through the public subnet at all, as it now has a VPCE in the private subnet.

Depending on the setup you're running and whether you actually need the IGW for anything else besides reaching out to S3, one might either drop the IGW from the public subnet or drop the NAT gateway linkage between the private and public subnet. Both of those options should clean up the routing tables a bit while not breaking the solution.

A: Adding an S3 endpoint in the private subnet resolved the issue.
It turns out that our problem was specific to accessing S3.  Our setup at the time was:

*

*NAT gateway running in public subnet

*S3 endpoint in public subnet (with higher routing priority than the internet gateway)

*A default rule for traffic in the private subnets to go through the NAT.

It appears that traffic was not getting routed through the NAT to S3 either through the public internet or through the S3 endpoint.  I still do not know why.

A: First, the obvious: cloudwatch.s3.amazonaws.com is not one of the Cloudwatch endpoints.
The Cloudwatch endpoints are in the form monitoring.[aws-region].amazonaws.com.
For example, in the us-west-2 region, the endpoint is https://monitoring.us-west-2.amazonaws.com.
http://docs.aws.amazon.com/general/latest/gr/rande.html#cw_region
Also, even if your routing, NAT, or networking is otherwise misconfigured, DNS resolution is immune to many misconfigurations, because of the way it is implemented in VPC... so the fact that it works does not tell you whether you have Internet connectivity, in general.


text:
Q: Laravel chat app : Unable to deliver messages to a specific user I have been trying to develop a chat app on Laravel with socket.io. Now, I am facing problem that is when a user is sending a message to a specific user, the message is being delivered to all the available users. May I know the section of code you need to help me out? Or there's some other area where I can specifically look into.
const express = require("express");

const app = express();

const server = require('http').createServer(app);

const io = require("socket.io")(server, {
    cors: { origin: "*" }
});

server.listen(3000, () => {
   console.log('Server is running');

   io.on("connection", function(socket) {
       console.log("User" + socket.id);

       socket.on("messageSent", function(message, senderId) {
           socket.broadcast.emit("messageSent", message, this.socket.id)
           console.log(this.socket.id);
       });

   //msg
       socket.on("msgSent", function(message) {
           socket.broadcast.emit("msgSent", message)
       });

       socket.on("clientMmsgSent", function(message) {
           socket.broadcast.emit("clientMmsgSent", message)
       });
   });
});

Other code:
<sc ript>
    var socket = io("{{config('app.server_url')}}");

   function sendMessage(event) {
       $.ajaxSetup({
           headers: {
               'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
           }
       });
       //console.log('test');
       event.preventDefault();
       if (event.keyCode === 13) {
           var msg = document.getElementById('msg').value;
           var client_id = document.getElementById('client_id').value;
           var operator_id = document.getElementById('operator_id').value;
           //console.log(smg);
           $.ajax({
               type: "POST",
               url: "{{route('send.msg')}}",
               data: {
                   msg: msg,
                   client_id: client_id,
                   operator_id: operator_id,
               },
               beforeSend: function() {

               },
               success: function(data) {
                   var msg = `
                   <div class="operator-msg">
                              ${data.operator_msg}
                           </div>
                   `;

                   console.log(data);
                   socket.emit("msgSent", {
                       'data': data,
                   });
                   $('#opt_msg').append(msg);
               },
               error: function(error) {
                   console.log(error);
               }
           });
           $('#msg').val(" ");
           return true;
       } else {
           return false;
       }
   }
</sc ript>


text:
Q: GAE blobstore get image size error I use GAE/J blobstore to upload images, I found in most cases it works just fine, but sometimes getting the image size give me wrong value:
...
BlobInfo info = blobInfoFactory.loadBlobInfo(blobKey);
long size = info.getSize();

Say, I have a jpg image, it's size is 141KB with dimension 236 x 1580, but after uploading to blobstore, the size is just about 60KB(the dimension is wrong too), other images which bigger than 141KB can get uploaded fine and can get correct size at server side.
I'm not sure it's GAE problem or not, Could someone shed some light on this? Thanks
BTW i use jquery-file-upload at client side, with a max uploaded image size set to 5Mb.


text:
Q: Javascript array sort numbers The below code is sorting numbers in an array, and the call back is making sure the numbers get sorted, but can someone explain what is the callback exactly doing?
var a = [2,4,7,21,34,52,88,5,2,6];
a.sort(function(a,b) {
return a-b
});

Also if someone can tell what are the uses of callback other than animation which is do other functionality only after the animation has finished.

A: The function is a comparator, it returns 0 if the two input equals, less then zero, if a is lower than b, and greater than zero if a is greater than b. The sort method uses this function to determine the ordering between two elements.
You could write this too:
return (a < b) ? -1 : (a > b) ? 1 : 0;

This is equivalent in effect, but the other solution is much shorter, and actually easier to read.
An other answer mentioned bubble sorting, but this has nothing to do with the actual sorting strategy, thats up to the sort function, this is just the comparator for the sorting, nothing more.

A: The callback is actually a comparator function which gives advantage how the developer wants to sort the array.
To arrange array elements in descending order,
a.sort(function(a,b) {
   return b-a
});


text:
Q: Phonegap (Cordova) - File not found Exception in reading file from FileSystem In order to send one file from my android device's File System to one server, I am using cordova 3.5 and the following code (as you can get reading this code the file is inside my Download directory):
receivedEvent: function(id) {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, fsSuccess, fail);

}
function fsSuccess(fs){
    fs.root.getDirectory("Download", {create: false, exclusive: false}, doDirectoryListing, FileError);
}

function doDirectoryListing(dirEntry) {
    var directoryReader = dirEntry.createReader();
    directoryReader.readEntries(gotFiles, FileError);
}

function gotFiles(entries)
{
    var wsUrl = "http://myServer/";
    var fileToSend =  "file:///storage/sdcard0/Download/"+entries[0].name, "file:///storage/sdcard0/Download/";
    multipart.uploadFiles(success, error,  wsUrl, fileToSend);
}

I can read all the files (names) that are in /Download parsing all the entries but I dont know how to get a specific file (for instance entries[0])  which needs to be passed to uploadFiles function.
Problem: I tried in different manner as for instance concatenating it with "file:///storage/sdcard0/Download/" but always getting a file not found exception.

A: I found the solution on my own,
mainly file:// is to be removed.
It could be gained this way: fileToSend.replace("file://", ""));


text:
Q: Assigning Values to KeyValuePair I want to assign some static values to my KeyValuePair object.
private IEnumerable<KeyValuePair<string, string>> getCountries()
{
    return new List<KeyValuePair<string, string>>()
    {
      { "code1", "value1" },
      { "code2", "value2" }
    };
}

But this is throwing nooverloaded method error.

A: return new List<KeyValuePair<string, string>>()
{
    new KeyValuePair<string, string>("code1", "value1"),
    new KeyValuePair<string, string>("code2", "value2"),
};

If you're using .NET Core 2.0+, you can use the slightly less verbose:
return new List<KeyValuePair<string, string>>()
{
    KeyValuePair.Create("code1", "value1"),
    KeyValuePair.Create("code2", "value2"),
};

In C# 9, you can use target-typed new to write this as:
return new List<KeyValuePair<string, string>>()
{
    new("code1", "value1"),
    new("code2", "value2"),
};

A: Or with Dictionary you can achieve desired initialization style
var pairs = new Dictionary<string, string>
{
    { "one", "first" },
    { "two", "second" },
}.ToList();

pairs.Should().BeOfType<List<KeyValuePair<string, string>>>(); // Pass

Notice, that if later in the code you are going to just enumerate list of key value pairs, then you can use dictionary without explicitly converting it to the list.
var pairs = new Dictionary<string, string>
{
    { "one", "first" },
    { "two", "second" },
}

// later somewhere in the code

foreach(var pair in pairs)
{
    Console.WriteLine($"{pair.Key}: {pair.Value}")
}

If you are using values internally (inside class), you can use tuples.
private IEnumerable<(string Code, string Name)> GetCountries()
{
    yield return ("code", "Earth");
    yield return ("code", "Vulkan");
}

Which later can be consumed in more readable way
foreach(var country in GetCountries())
{
    Console.WriteLine($"{country.Code}: {country.Name}")
}

If type used across application, then instead of using key-value pairs you can show intentions of your code to the readers of your code and create custom type.
public class Country
{
    public string Code { get; }
    public string Name { get; }

    public Country(string code, string name)
    {
        Code = code;
        Name = name;
    }
}

private IEnumerable<Country> GetCountries()
{
    yield return new Country("code", "Earth");
    yield return new Country("code", "Vulkan");
}

Which later can be consumed in more readable way
foreach(var country in GetCountries())
{
    Console.WriteLine($"{country.Code}: {country.Name}")
}

A: You need to consider that both Key and Value properties of the generic class are read-only, so you cannot set them directly. Instead you need to take advantage of the class's constructor in order to set the desired pairs.

 public IEnumerable<KeyValuePair<string, string>> getCountries()
  {
        var keyValue1 = new KeyValuePair<string,string>("code1","value1");
        var keyvalue2 = new KeyValuePair<string,string>("code2","value2");

        var keyValueList = new List<KeyValuePair<string, string>> {keyValue1, keyvalue2};
        return keyValueList;

   }


text:
Q: How can I test In-app updates in Android? Recently, Google introduced 'in-app updates' in Google I/O 2019.
So I am trying to use it.
val appUpdateManager = AppUpdateManagerFactory.create(this)
val appUpdateInfo = appUpdateManager.appUpdateInfo
appUpdateInfo.addOnCompleteListener {
    val result = it.result
    if (result.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
            && result.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {

        info("should show update")
        appUpdateManager.startUpdateFlowForResult(
                        result,
                        AppUpdateType.FLEXIBLE,
                        this,
                        1)
    } else {
        info("This is already latest version: ${result.updateAvailability()}")
    }
}

But the result.updateAvailability() is always UpdateAvailability.UPDATE_NOT_AVAILABLE.
To do this, I made a signed release apk with previous version code.
But it doesn't work.
According to the demo on the Developer Keynote (16:40 ~ )
He is doing it with the emulator.
It looks like debug mode.
How can I do this same thing?

A: Testing using Internal App Sharing
The right way to test in-app update is to use Internal App Sharing (not to be confused with Internal Testing Track).

*

*First setup your Internal App Sharing with the help of these instructions. Unlike Internal Testing Track, Internal App Sharing makes the app available immediately. So there is no waiting time.

*Opt-in to app signing by Google Play. This will allow google play to sign the apk generated for the device from the app bundle you provide. Details here.

*Build your app bundle. Through command line, it is simply ./gradlew bundleRelease or ./gradlew bundle<variant>.

*Go to https://play.google.com/apps/publish/internalappsharing/ and upload the generated aab file which is under app/build/outputs/bundle/<variant>/. Give a decent name that includes version code.

*This will provide a link to copy. Use it to install this bundle to your device.

*Bump the version code in your app build.gradle and build another bundle. Note: Version code is integer, that's what is to be incremented. Version name is different and it doesn't matter for this.

*Similarly upload this new bundle to Internal App Sharing.  Name it with the version code.

*This will provide another link. Open the link and this opens google play and you should see "Update" option. Don't click on Update!

*Open your app and now you should see in-app update prompt.

If you don't see the prompt and if you had followed these steps exactly, most likely, there is an issue with your code. Add some logging to see what is happening in your code.
In our testing, the following did NOT help to test in-app updates (which were suggested elsewhere):

*

*Re-uploading the same bundle/apk without bumping up the version code

*Decreasing version code to be lower than the published version

Testing using Alpha (closed track)
Once testing through internal app sharing is successful, I still found some trouble testing in-app update through published versions. After some trials, I was able to successfully test through Alpha track. I'm adding the steps here (I'm assuming you're familiar with Google Play console's Alpha closed track and adding yourself as alpha tester list):

*

*Install current version of the app through Google Play. This can be from production track or alpha or beta track. This version should already have in-app update feature implemented as this is the version that is expected to show in-app update prompt.

*Ensure that Automatic Update is disabled just for your app. You can do this through menu item of your app's store listing on Google Play app. We disable automatic update because, we really want to update the app through in-app update instead of Google Play updating the app when your device is charging.

*Publish a new version (with version code incremented, changing version name won't matter) to Alpha track.

*Nowadays, it takes a while before the published version shows up in Google Play. You may have to wait for several hours.

*Once it shows up in Google Play store, you may eagerly try opening your app. You'll be lucky if in-app update prompt shows up. Most likely it won't. In-app update may not show up even if you kept on waiting for several more hours and kept restarting your app. By following the remaining steps I didn't have to wait.

*Close your app completely.

*Close Google Play app completely.

*Clear Google Play app cache. I found that storage need not to be cleared, just the cache.

*Open Google Play and go to My Apps & Games from navigation pane.

*Now Google Play will search for the updates. Your app update should show up. Do NOT update here, of course.

*Open your app. In-app update prompt should appear. If not, test your in-app update with internal app sharing (steps in previous section) and ensure there is no problem with your implementation.

I guess similar process should work for Beta (open track) and production tracks as well.
Even after the update is available through Google Play, for the end-users to see in-app update, I think it may take quite some time (days!). Google Play has its own confusing ways. Good luck.

A: Alternatively you can use this class as a UNIT test for simulation of in-app updates

FakeAppUpdateManager

This has some pre-defined methods.

A: In my case, I have done the next steps:

*

*Uninstall original app from device.

*Install the app from Google Play Store (I already had my app in Store, but if you don´t have it, you can create an alpha or beta
version, without publish it in store).

*Unistall the app again.

*Generate signed apk with the new feature, with a lower versionCode than Google Play version

*Install this apk.

When it starts, it checks the new version in Google Play Store, and shows the assistant for update it.
If this solution works in a device but not in anothers, try to log in with the same Google account, and try the 5 steps again in this device. Then you can use your original account again. For some crazy reason, it appears that Google Play "activate" the version control and it returns that a version is available again in the rest of devices.
I don´t know exactly the behaviour...

A: Hmm...
I found the solution.
It is not the same as the demo on the Google I/O 2019 - Developer Keynotes.
I published the signed release apk into the internal developer version.
And it works fine.
Or you can publish it on the "Alpha/Beta close test publish".

A: I don't know if by this time you already got it down, but after some time testing I figured out that decreasing the versionName is what I needed to do to be able to test it properly, before I'd tested only decreasing the versionCode...
I think that the API should be able to handle whenever the versionName or versionCode are out of date, but apparently it doesn't.

A: *

*Generate a singed app bundle with lower version and upload it to internal app sharing from play console.

*Install the app on your device using the generated link.

*Again Generate an app bundle with higher version code and version number than pervious one

*Upload it to internal app sharing

*Open the newly generated link but do not update app from play store.

*Open the old app again.

*Now you will be app to see the update popup in your older installed app.

NOTE - App installed with internal app sharing can't be updated to live app even if the version is higher.
I am using this in-app-update library for simplicity.

A: Internal Test Tracks in the Google Play Console are an excellent tool to use when testing In-App Updates.

A: This is too late, but it might help other developers.
As of today, in-app-update testing can not be done for a debug build. You don't need to put your apk to PlayStore to test also. The best way to test in-app-update is by using internal-app-sharing.
If you follow the below steps one-by-one, you'll be able to test successfully.

*

*To test the app, a tester has to first enable Internal-App-Sharing in PlayStore, follow this link for the same, How to Enable Internal App Sharing for Android?

*If you're brave enough to understand the official documents, then simply follow this link to set-up in-app-update testing in your device, https://developer.android.com/guide/playcore/in-app-updates#internal-app-sharing
Here, I'll be writing the same in easy words.
Once you're done with setting up internal-app-sharing in Play-Store, make sure that you have to upload 2 apks to internal-app-sharing on Play-Console and hence generate 2 links. Both apks will be signed using the same signing-key (need not be the same as the one you use to sign for production, any dummy signing-key would work).

*First you upload an apk with in-app-update implementation with lower VersionCode (say, 100) to internal-app-sharing on play console.

To know, How to upload apk to internal-app-sharing on Play-Console, follow this lisk, https://support.google.com/googleplay/android-developer/answer/9844679?visit_id=637437125318137239-1277036129&rd=1
NOTE: make sure, you have uninstalled any preinstalled app with the same package-name in your device.

*Now you copy the link of the app you uploaded to internal-app-sharing on the play console and use this link to install the app on your device.

NOTE: Before installing, make sure the email-id you're using on play-store has been added in the mail-list on internal-app-sharing on play-console.

*Now, once you've installed the app using the link. Now, you need to again create a new signed apk with higher VersionCode (say, 101). And upload this apk to internal-app-sharing.

*Now, copy the link with higher VersionCode from internal-app-sharing. Click on this link on your device, it will take you to play-store but this time, update button will be enabled rather than install button as app is already installed in your device with lower VersionCode.

*You don't have to click the update button on PlayStore. You just have to click the link and hence open the screen on PlayStore. Now close PlayStore app.

*Now, you can launch the already installed app from your device.
If your implementation of in-app-update is fine, launching the app would appear the dialog from PlayStore for update.

Lastly, don't forget to upvote if it helps you in any way. Keep
Coding!

A: Take a look at documentation of FakeAppUpdateManager
or try below pre-defined method will help you to test app update available or not.
FakeAppUpdateManager fakeAppUpdateManager = new FakeAppUpdateManager(this);
        fakeAppUpdateManager.setUpdateAvailable(1); // add app version code greater than current version.
        fakeAppUpdateManager.getAppUpdateInfo().addOnSuccessListener(new OnSuccessListener<AppUpdateInfo>() {
            @Override
            public void onSuccess(AppUpdateInfo appUpdateInfo) {
                if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
                        && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {
                    System.out.println("checkForAppUpdateAvailability");
                }
            }
        });

A: For me, the last step of the Troubleshoot section in the docs made it work!
Basically, after you change the version of the app (version name and code), do this:

Make sure the account is eligible and the Google Play cache is up to
  date. To do so, while logged into the Google Play Store account on the
  test device, proceed as follows:
  Make sure you completely close the
  Google Play Store App.
  Open the Google Play Store app and go to the
  My Apps & Games tab.
  If the app you are testing doesn't appear with
  an available update, check that you've properly set up your testing
  tracks.

A: 1.Uninstall original app from device.
2.Install the app from Google Play Store (I already had my app in Store, but if you don´t have it, you can search any application and copy package name and add to your test application package name both are same ).
3.Unistall the app again.
4.Go to your gradle and set lower versioncode like 1.
5.sync
6.Install.
7.Now you will be app to see the update popup in your older installed app.

A: You can use FakeAppUpdateManager as follows:
val appUpdateManager : AppUpdateManager
    if (BuildConfig.DEBUG) {
      appUpdateManager = FakeAppUpdateManager(baseContext)
      appUpdateManager.setUpdateAvailable(2)
    } else {
      appUpdateManager = AppUpdateManagerFactory.create(baseContext)
    }

With this, you'll use the Play Store's AppUpdateManager when the app is launched and FakeAppUpdateManager when tested locally.
The number 2 on setUpdateAvailable corresponds to the app version code. It can be any number as long as it's higher than your version code defined on build.gradle.
Now, to simulate an immediate update:
val fakeAppUpdate = manager as FakeAppUpdateManager
  if (fakeAppUpdate.isImmediateFlowVisible) {
    fakeAppUpdate.userAcceptsUpdate()
    fakeAppUpdate.downloadStarts()
    fakeAppUpdate.downloadCompletes()
    launchRestartDialog(manager)
  }

A: *

*Uninstall the original app from your device

*Download the same app from play store

*Decrease Version code in Gradle file

*syn and install

*Now you will check whether the code is working or not


text:
Q: how does sortWithinPartitions sort? After applying sortWithinPartitions to a df and writing the output to a table I'm getting a result I'm not sure how to interpret.
df
.select($"type", $"id", $"time")
.sortWithinPartitions($"type", $"id", $"time")

result file looks somewhat like
1 a 5
2 b 1
1 a 6
2 b 2
1 a 7
2 b 3
1 a 8
2 b 4

It's not actually random, but neither is it sorted like I would expect it to be. Namely, first by type, then id, then time.
If I try to use a repartition before sorting, then I get the result I want. But for some reason the files weight 5 times more(100gb vs 20gb).
I'm writing to a hive orc table with compresssion set to snappy.
Does anyone know why it's sorted like this and why a repartition gets the right order, but a larger size?
Using spark 2.2.

A: The documentation of sortWithinPartition states

Returns a new Dataset with each partition sorted by the given expressions

The easiest way to think of this function is to imagine a fourth column (the partition id) that is used as primary sorting criterion. The function spark_partition_id() prints the partition.
For example if you have just one large partition (something that you as a Spark user would never do!), sortWithinPartition works as a normal sort:
df.repartition(1)
  .sortWithinPartitions("type","id","time")
  .withColumn("partition", spark_partition_id())
  .show();

prints
+----+---+----+---------+
|type| id|time|partition|
+----+---+----+---------+
|   1|  a|   5|        0|
|   1|  a|   6|        0|
|   1|  a|   7|        0|
|   1|  a|   8|        0|
|   2|  b|   1|        0|
|   2|  b|   2|        0|
|   2|  b|   3|        0|
|   2|  b|   4|        0|
+----+---+----+---------+

If there are more partitions, the results are only sorted within each partition:
df.repartition(4)
  .sortWithinPartitions("type","id","time")
  .withColumn("partition", spark_partition_id())
  .show();

prints
+----+---+----+---------+
|type| id|time|partition|
+----+---+----+---------+
|   2|  b|   1|        0|
|   2|  b|   3|        0|
|   1|  a|   5|        1|
|   1|  a|   6|        1|
|   1|  a|   8|        2|
|   2|  b|   2|        2|
|   1|  a|   7|        3|
|   2|  b|   4|        3|
+----+---+----+---------+

Why would one use sortWithPartition instead of sort? sortWithPartition does not trigger a shuffle, as the data is only moved within the executors. sort however will trigger a shuffle. Therefore sortWithPartition executes faster. If the data is partitioned by a meaningful column, sorting within each partition might be enough.


text:
Q: How to change Android board to be hub? I have a camera,Android board and a PC(windows).
When PC usb cable connects with Android, the camera will be used. If there is no connection, the Android board will use the camera.
Just like a hub,let camera signal can transfer to different device. Of course, not at the same time to transfer signal.
I want to code an app to comply with it.
Do I have to change the USB agreement?


text:
Q: How to sort by project name in Visual Studio 2008? I have one solution with 3 folders (Forms, Notices, Reports). In the Notice folder I have about 100 projects. The problem is, they are ordered by the creation date; while I would prefer that they were ordered by name.
I have seen that this does change, by sorting alphabetically, if I add a new project within the folder. But, once I close VS 2008 it resorts back to the creation date on reopening.

A: It's a known bug.
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=468874&wa=wsignin1.0
The only workaround I know is where you click a project name like you're going to rename it, but then just click off it onto another project node.  This re-sorts the list alphabetically, but it doesn't persist, you'll have to do it again when you reopen VS.


text:
Q: Sorting in Jekyll / liquid code based on two columns In my code  I am trying to read about 100 yml files and create an html table. The problem I am facing is I am unable to sort based on two columns. The column names are vendor and name.
I need to first sort on Vendor and then name.
It sorts on one columns only the vendor column and ignore the next column name.. All the column names are correct.
This is the code.
         {% assign devices = "" | split: " " %}
         {% for device in site.data.devices %}
         {% assign devices = devices | push: device[1] %}
         {% endfor %}

         {% assign sorted = devices | sort_natural: 'name' | sort_natural: 'vendor' %}
         {% assign lastVendor = "" %}
         {% assign nbDevices = 0 %}

         {%- for device in sorted %}
         {%- assign nbDevices = nbDevices | plus:'1' %}
         {%- assign lastVendor = device.vendor %}`
Here i start creating the table which gets filled with values from the yml files.

The table when created is sorted on only one column. Either vendor or name.
Tried group_by as suggested here but then no values show up in the table not sure why.
Tried sort and sort_natural both the effect is the same.
Any suggestions as to what I am doing wrong here.

A: Finally figured out why the code was not working.
We were building our jekyll site using docker. The docker image was outdated.
A build using just bundle exec jekyll serve resolved the issue !!
Now need to update the bundler and gems....still figuring out what all gets updated and will post here in case it helps anyone.


text:
Q: pandas - add 1 month to a pd.Timestamp I have multiple df, and they are indexed with timestamps for consecutive months. For example:
1996-01-01 01:00:00
1996-02-01 01:00:00
1996-03-01 01:00:00
1996-04-01 01:00:00
1996-05-01 01:00:00
1996-06-01 01:00:00

I'm trying to create a function where I can add an arbitrary number of rows onto the df, continuing on from whatever the last month happens to be.  I tried to solve this by using:
df.iloc[-1].name + pd.Timedelta(1, unit='M')

in a for loop, but this only seems to add 30 days, instead of changing the month value +1.  Is there a more reliable way to fetch a pd.Timestamp and add 1 month?
Thank you


text:
Q: how to get many2one filter value? i have following code that is calender.event inherited class . there i will create events by number sequence . and i have other field like other fields 'inspection_name' etc
    from openerp.osv import fields, osv
from openerp import api
import logging

class feedback_form(osv.Model):
    _name = 'feedback.form'
    _rec_name = 'inspec_type'
    _columns={
        'folionum' : fields.many2one('calendar.event','Maintainace ID',),
        'folio_number' : fields.many2one('asset.asset','Folio number',),
        'inspec_type' : fields.many2one('asset1.inspection','Inspection Type',domain="[('inspec_type' , '=' , folio_number)]"),

        'frequency' : fields.char('Frequency'),
        'shutdown' : fields.char('Shout Down'),
        'insp_msr1' : fields.many2one('results.measure','Result',domain="[('inspec_type', '=', inspec_type)]"),
    }

    def onchange_folio(self, cr, uid, ids, folionum, context=None):
        dids = []
        for record in self.pool.get('calendar.event').browse(cr, uid, folionum, context=context):
            dids = [x.id for x in record.folio_num]
        return {'domain':{'folio_number':[('id','in',dids)]}}

    '''def onchange_insp(self, cr, uid, ids, folio_number, context=None):
        dids = []
        for record in self.pool.get('calendar.event').browse(cr, uid, folio_number, context=context):
            dids = [x.id for x in record.inspection_name]
        return {'domain':{'inspec_type':[('id','in',dids)]}}'''

    def onchange_measure(self, cr, uid, ids, inspec_type, context=None):
        dids = []
        for record in self.pool.get('asset1.inspection').browse(cr, uid, inspec_type, context=context):
            dids = [x.id for x in record.msr_insp]
        return {'domain':{'insp_msr1':[('id','in',dids)]}}

calendar.event
from openerp.osv import fields, osv
from openerp import api
class calendar_event(osv.osv):
_inherit = "calendar.event"
_rec_name = 'number'

_columns = {
        'number' : fields.char('Meeting ID',readonly=1),
        #'place' : fields.many2one('stock.location','Substation Location',),

        'place' : fields.many2one('asset.parentlocation','Substation Location',),
        #'location' : fields.selection(STATUS_SELECTION,'Location',  default='Board A'),
        'asset_catg_id' : fields.many2one('asset.catg','Asset Catg Selection',),
            'area_id' : fields.many2one('asset.name','Asset Name Selection', domain="[('asset_catg_id', '=', asset_catg_id)]", select=True, required=True),
        'assetmodelid_add' : fields.many2many('agile.portfolio1','agile_portfolio1_rel','super_id','agile_portfolio1_id','Asset Model Code',),
        'folio_num' : fields.many2many('asset.asset','asset_asset_rel','super_id','asset_asset_id','Folio Num',),
        #'inspection_name' : fields.many2one('asset1.inspection','Inspection Type', ),
        'inspection_name' : fields.many2many('asset1.inspection','asset1_inspection_rel','super_id','asset1_inspection_id','Inspection Type'),
        #'folio_num' : fields.related('folio_num','folio_num',string='Folio Num',relation='asset.asset', type='many2one')
        }

_defaults = {
            'number' : lambda self,cr,uid,context={}:self.pool.get('ir.sequence').get(cr,uid,'calendar.event'),
            }

A: First
I guess it pretty simple typo mistake that you have done, the statement:

mesure_fil = self.pool.get('calender.event')

should be :

mesure_fil = self.pool.get('calendar.event')

You have typo on model name.
Second
You need to chnage the cod eof your on_chnage method here to make it work  correctly :
def onchange_folio(self, cr, uid, ids, folionum, context=None):
    dids = []
    for record in self.pool.get('calendar.event').browse(cr, uid, folionum, context=context):
            dids = [x.id for x in record.inspection_name]
    return {'domain':{'inspec_type':[('id','in',dids)]}}

and in your form view please make sure that your code is called like this
<field name="folionum" options="{'no_create': True, 'no_open': True}" on_change="onchange_folio(folionum)"/>

This will work correctly.
Bests


text:
Q: How to split separate formulas in the same cell? I want to show three separate values derived from three separate formulas within the same cell for the purposes of my formatting.
So instead of:
Cell 1: 50
Cell 2: 40
Cell 3: 60

I want all the numbers vertically in cell 1.
50
40
60

Is there a way to do this?

A: This might be semantics but if say your 'independent' formulae were:
A1: =5*10
A2: =6^2+4
A3: =FACT(5)/2
Then you might combine these in A1:
 =(5*10)&CHAR(10)&(6^2+4)&CHAR(10)&(FACT(5)/2)

and with wrap text enabled should achieve the result you seek.
Example with formulae from Comment (and created data):


text:
Q: extracting the local maxima (coordinates) from a 2d likelihood matrix (numpy array) efficiently I'm trying to extract the coordinates of the local maxima from a numpy 2D matrix. the values are numbers between 0 and 1 representing a likelihood that an object is in that location.
I've tried threshold-ing the matrix and extracting the argmax and saving the coordinates and changing it's value to 0 and looping until the threshold encountered.
 detections = []
 while True:
    maxloc = np.unravel_index(np.argmax(scmap),
                              scmap.shape)
    if scmap[maxloc] > 0.9:
        # other code ..
        detections.append(maxloc)
        scmap[maxloc] = 0
# after that, what i did is calculating the euclidean distance
# between each pair and excluded the ones that does not meet the
# threshold

I am not satisfied with this, and i think there is more efficient elegant ways to extract the local maxima. thoughts ?

A: Locating local maxima is a built-in feature of scikit-image which locates values that are maximal within some predefined distance.
from skimage.feature import peak_local_max
coordinates = peak_local_max(scmax, min_distance=5)

I'm not sure how this is actually implemented but one implementation method is perform non-maximal suppression (i.e. Iterate through each value in the matrix and compare with all values within a radius. If the value is not maximal in that window then set it to some predefined value like zero or -inf). Then take the coordinates of all non-suppressed values (possibly above some threshold) as the collection of local maxima.

A: If you are trying to extract coordinates of a Numby Matrix, of all of the values that meets a certain threshold, you can simply compare the threshold to the entire matrix.
import numpy as np
data = np.array([
    [0, 0.5, 0.95],
    [0, 0.95, 0.5],
    [0.95, 0.5, 0]
])
thresholded_coordinates = np.argwhere(data > 0.9)

# array([[0, 2], [1,1], [2, 0]])

The output of the thresholded_coordinates is a pairwise collection of coordinates. (0,2) indicates it is the third value in the first row (0-indexed). The output is indicated on the comment on the last line.


text:
Q: Overlaying PictureBoxes with transparency I am adding PictureBoxes to a panel programatically. The Panel has a background image, and the pictureboxes have png's in them which contain areas of transparency.
I had thought that to get the transparency to work, they should be added with the Parent being assigned to the last control added - So the first PB has the parent=panel, PB2's parent is PB1 etc.
These PB's are small and don't always overlap any other PB. Where they don't, I get the behaviour I want, I can see the panel background fine. Where they do overlap however, I get the following:
The first image to be placed is fine. The second image to be placed is truncated where the first image overlaps it.
I am setting the parent like this
if (LastIndex == 0)
        {
            thumbnail.Parent = this.BoardPanel;
        }
        else
        {
            thumbnail.Parent = this.BoardPanel.Controls[LastIndex-1];

        }
        LastIndex++;

The weird thing is that I can always see the background image, so the transparency is working somewhere?


text:
Q: Adding title + buttons to UINavigationController I'm getting crazy to solve this problem.
I've the following code in my AppDelegate.m
Basically a navigation controller + tab bar that link to 2 tableviewcontroller
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

    ElencoSpese *elenco=[[ElencoSpese alloc] init];
    elenco.tabBarItem.title=@"Prova 123";

    ElencoSpese *elenco2=[[ElencoSpese alloc] init];
    elenco2.tabBarItem.title=@"Prova 222";

    UITabBarController *tabMenu = [[UITabBarController alloc] init];
    tabMenu.viewControllers=[NSArray arrayWithObjects:elenco, elenco2, nil];

    UINavigationController *navig=[[UINavigationController alloc] initWithRootViewController:tabMenu];
    self.window.rootViewController=navig;

    [self.window makeKeyAndVisible];

    return YES;
}

ElencoSpese is a TableViewController and it works ok. I want to add "title" to this window and "+" and "Edit" button on top of the NavigationBar....
I've tried to uncomment the following in the loadview method of the tableviewcontroller: no result
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
self.navigationItem.rightBarButtonItem = self.editButtonItem;

I've alsto tried in the appdelegate to set title....nothing...

A: Do Like this..
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];

    ElencoSpese *elenco=[[ElencoSpese alloc] init];
    elenco.tabBarItem.title=@"Prova 123";

    ElencoSpese *elenco2=[[ElencoSpese alloc] init];
    elenco2.tabBarItem.title=@"Prova 222";
    UINavigationController *navig=[[UINavigationController alloc]     initWithRootViewController:elenco];
UINavigationController *navig1 =[[UINavigationController alloc] initWithRootViewController:elenco2];

    UITabBarController *tabMenu = [[UITabBarController alloc] init];
    tabMenu.viewControllers=[NSArray arrayWithObjects:navig, navig1, nil];

    self.window.rootViewController=tabMenu;

    [self.window makeKeyAndVisible];

    return YES;
}

Then each TableViewController  -viewDidLoad add like this
-(void)viewDidLoad
{
   [super viewDidLoad];
   self.title = @"Calculator";
    UIBarButtonItem *item = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(yourSelectorMethod)];

    UIBarButtonItem *item1 = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemEdit target:self action:@selector(yourSelectorMethod1)];

    self.navigationItem.leftBarButtonItem = item;
    self.navigationItem.rightBarButtonItem = item1;
}

A: The viewcontroller is embedded in a tabbar-controller, which is pushed in a navigationcontroller. So you should access the navigationitem like so:
self.tabBarController.navigationItem.rightBarButtonItem = self.editButtonItem;

A: the title for the window can be given as below
after the line in your code
self.window.rootViewController=navig;

just add
self.tabbarController.navigationItem.title = @"YOUR TITLE";

this will help you to give title


text:
Q: Duplicate name "app" passed to addEntry(): entries must be unique Hello I try to install sylius BootstrapTheme for my project and I have little problem when i try to install this. If need more code or code of other files for find the problem talk me
/themes/BootstrapTheme/webpack.config.js
const Encore = require('@symfony/webpack-encore');

Encore
  .setOutputPath('public/bootstrap-theme')
  .setPublicPath('/bootstrap-theme')
  .addEntry('app', './themes/BootstrapTheme/assets/app.js')
  .disableSingleRuntimeChunk()
  .cleanupOutputBeforeBuild()
  .enableSassLoader()
  .enableSourceMaps(!Encore.isProduction())
  .enableVersioning(Encore.isProduction());

const config = Encore.getWebpackConfig();
config.name = 'bootstrapTheme';

module.exports = config;

webpack.config.js
const Encore = require('@symfony/webpack-encore');
const bootstrapTheme = require('./themes/BootstrapTheme/webpack.config');
module.exports = [bootstrapTheme];
// Manually configure the runtime environment if not already configured yet by the "encore" command.
// It's useful when you use tools that rely on webpack.config.js file.
if (!Encore.isRuntimeEnvironmentConfigured()) {
    Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev');
}

Encore
    // directory where compiled assets will be stored
    .setOutputPath('public/build/')
    // public path used by the web server to access the output path
    .setPublicPath('/build')
    // only needed for CDN's or sub-directory deploy
    //.setManifestKeyPrefix('build/')

    /*
     * ENTRY CONFIG
     *
     * Add 1 entry for each "page" of your app
     * (including one that's included on every page - e.g. "app")
     *
     * Each entry will result in one JavaScript file (e.g. app.js)
     * and one CSS file (e.g. app.css) if your JavaScript imports CSS.
     */
    .addEntry('app', './assets/js/app.js')
    //.addEntry('page1', './assets/js/page1.js')
    //.addEntry('page2', './assets/js/page2.js')

    // When enabled, Webpack "splits" your files into smaller pieces for greater optimization.
    .splitEntryChunks()

    // will require an extra script tag for runtime.js
    // but, you probably want this, unless you're building a single-page app
    .enableSingleRuntimeChunk()

    /*
     * FEATURE CONFIG
     *
     * Enable & configure other features below. For a full
     * list of features, see:
     * https://symfony.com/doc/current/frontend.html#adding-more-features
     */
    .cleanupOutputBeforeBuild()
    .enableBuildNotifications()
    .enableSourceMaps(!Encore.isProduction())
    // enables hashed filenames (e.g. app.abc123.css)
    .enableVersioning(Encore.isProduction())

    // enables @babel/preset-env polyfills
    .configureBabel(() => {}, {
        useBuiltIns: 'usage',
        corejs: 3
    })

    // enables Sass/SCSS support
    //.enableSassLoader()

    // uncomment if you use TypeScript
    //.enableTypeScriptLoader()

    // uncomment to get integrity="..." attributes on your script & link tags
    // requires WebpackEncoreBundle 1.4 or higher
    //.enableIntegrityHashes(Encore.isProduction())

    // uncomment if you're having problems with a jQuery plugin
    //.autoProvidejQuery()

    // uncomment if you use API Platform Admin (composer req api-admin)
    //.enableReactPreset()
    //.addEntry('admin', './assets/js/admin.js')
;

module.exports = Encore.getWebpackConfig();

but when I when I run yarn encore production I have this error :
Duplicate name "app" passed to addEntry(): entries must be unique.
what I can do for leave this?

A: The error message is clear Duplicate name "app" passed to addEntry(): entries must be unique..
In your /themes/BootstrapTheme/webpack.config.js you have:
.addEntry('app', './themes/BootstrapTheme/assets/app.js')

And, in your webpack.config.js:
.addEntry('app', './assets/js/app.js')

I'm far from being an expert in Webpack but I believe you could delete the second one, as now you are using BootstrapTheme's one. If you need both the scripts, you could change the name of the entry in your webpack.config.js to something else, like:
.addEntry('someName', './assets/js/app.js')

Then you add your new tag to the twig file:
{% block javascripts %}
    {{ encore_entry_script_tags('app') }}
    {{ encore_entry_script_tags('someName') }}
//the rest of your js code, if you have
{% endblock %}


text:
Q: Make an endpoint check if user is authorized and perform one function if not do another Basically the title explains my question.
I need to make the same endpoint check if a user is authorized or not, and if the user is not authorized then do some other function.
I cannot do it with the [Authorize] attribute since then I cant even access the endpoint when unauthorized, cant do it with the [AllowAnnonymous] endpoint either since it bypasses any authentication.
Is there anyway I can achieve this, using the same endpoint ofc.


text:
Q: Custom sorting array by groups with Ruby Please your help. I have the input_array with 3 groups of values.
The group order I need is:
1st group: Pou
2nd group: Apl
3rd group: Gab

This order is already done in input_array, but I want to sort ascending each group.
The script I have so far produces the output given in central column of table below (current output).
input_arr = ["Pou-12","Pou-7","Pou-4","Pou-8","Pou-9","Pou-11","Pou-10","Pou-3","Pou-2","Pou-1","Pou-6","Pou-5","Apl","Gab-3","Gab-5","Gab-4","Gab-1","Gab-2"]

b=input_arr.sort_by do |s|
  if s =~ /^\d+$/
      [2, $&.to_i]
  else
      [1, s]
  end
end

puts b

and the desired sorted output array is shown below too.

 input array  | current output | desired output array

    Pou-12    |     Apl        |      Pou-1
    Pou-7     |     Gab-1      |      Pou-2
    Pou-4     |     Gab-2      |      Pou-3
    Pou-8     |     Gab-3      |      Pou-4
    Pou-9     |     Gab-4      |      Pou-5
    Pou-11    |     Gab-5      |      Pou-6
    Pou-10    |     Pou-1      |      Pou-7
    Pou-3     |     Pou-10     |      Pou-8
    Pou-2     |     Pou-11     |      Pou-9
    Pou-1     |     Pou-12     |      Pou-10
    Pou-6     |     Pou-2      |      Pou-11
    Pou-5     |     Pou-3      |      Pou-12
    Apl       |     Pou-4      |      Apl
    Gab-3     |     Pou-5      |      Gab-1
    Gab-5     |     Pou-6      |      Gab-2
    Gab-4     |     Pou-7      |      Gab-3
    Gab-1     |     Pou-8      |      Gab-4
    Gab-2     |     Pou-9      |      Gab-5

UPDATE
Cary's solution with array instead of hash.
a = ["Pou-7","Pou-4","Gab-4","Pou-8","Pou-9","Pou-11","Pou-10","Pou-3","Pou-2","Pou-1","Pou-6","Pou-5","Apl","Gab-3","Gab-5","Gab-1","Pou-12","Gab-2"]
order = [ "Pou", "Apl", "Gab" ]

a.map{ |s| head,tail = s.split("-"); [order.index(head), tail.to_i, s]}.sort.map(&:last)

=> ["Pou-1", "Pou-2", "Pou-3", "Pou-4", "Pou-5", "Pou-6", "Pou-7", "Pou-8", "Pou-9",
"Pou-10", "Pou-11", "Pou-12", "Apl", "Gab-1", "Gab-2", "Gab-3", "Gab-4", "Gab-5"]

A: input = ["Pou-12","Pou-7","Pou-4","Pou-8","Pou-9","Pou-11","Pou-10","Pou-3","Pou-2","Pou-1","Pou-6","Pou-5","Apl","Gab-3","Gab-5","Gab-4","Gab-1","Gab-2"]

grouped_by_prefix = input.group_by do |item|
  item.split('-')[0]
end

grouped_by_prefix.each do |_, values|
  values.sort_by! { |value| value.split('-')[1].to_i }
end

['Pou', 'Apl', 'Gab'].reduce([]) do |memo, key|
  memo + (grouped_by_prefix[key] || [])
end

algorithm is not super efficient (for example double split operation) but quite simple to understand

A: You can try this:
b = input_arr.group_by { |e| e.split("-")[0] }
b = b.flat_map { |k, v| v.sort_by!{ |vs| vs.split("-")[1].to_i }; v }

A: a = ["Pou-12","Pou-7","Pou-4","Pou-8","Pou-9","Pou-11","Pou-10","Pou-3","Pou-2",
     "Pou-1","Pou-6","Pou-5","Apl","Gab-3","Gab-5","Gab-4","Gab-1","Gab-2"]

order = { "Pou"=>0, "Apl"=>1, "Gab"=>2 }
a.map do |s|
  head, tail = s.split('-')
  [order[head], tail.to_i, s]
end.sort.map(&:last)
  #=> ["Pou-1", "Pou-2", "Pou-3", "Pou-4", "Pou-5", "Pou-6", "Pou-7", "Pou-8", "Pou-9",
  #    "Pou-10", "Pou-11", "Pou-12", "Apl, "Gab-1", "Gab-2", "Gab-3", "Gab-4", "Gab-5"]

Note that head, tail = "Apl".split('-') #=> ["Apl"], so head #=> "Apl" and tail #=> nil, but then tail.to_i #=> nil.to_i #=> 0.
See Array#<=> to understand how arrays are compared when sorting.

A: Your initial array looks like:
a = ["Pou-12","Pou-7","Pou-4","Pou-8","Pou-9","Pou-11","Pou-10","Pou-3","Pou-2","Pou-1","Pou-6","Pou-5","Apl","Gab-3","Gab-5","Gab-4","Gab-1","Gab-2"]

d = []

Group the array by it's first part:
c = a.group_by{|b| b.split("-").first}
#=> {"Pou"=>["Pou-12", "Pou-7", "Pou-4", "Pou-8", "Pou-9", "Pou-11",
#=>          "Pou-10", "Pou-3", "Pou-2", "Pou-1", "Pou-6", "Pou-5"],
#=>  "Apl"=>["Apl"],
#=>  "Gab"=>["Gab-3", "Gab-5", "Gab-4", "Gab-1", "Gab-2"]
#=> }

Now, sort the grouped array individually:
c.each do |k, v|
  d << v.sort{|b, c| ( b.split("-").last.to_i <=> c.split("-").last.to_i )}
end

Finally, since the output is Array of Array, you flatten it:
d.flatten!

#=> ["Pou-1", "Pou-2", "Pou-3", "Pou-4", "Pou-5", "Pou-6", "Pou-7", "Pou-8", "Pou-9", "Pou-10", "Pou-11", "Pou-12", "Apl", "Gab-1", "Gab-2", "Gab-3", "Gab-4", "Gab-5"]


text:
Q: PyCharm error when connecting to PostgreSQL database I'm getting this error when trying to connect to a PostgreSQL 9.4 database running on Heroku/AWS:
The specified database user/password combination is rejected:
[28000] FATAL: no pg_hba.conf entry for host "X.X.X.X", user "XXX", database "XXX"

How do I solve this issue?

A: Open the database connection settings, click on the "Advanced" tab and values to the following parameters:
ssl = false
sslfactory = org.postgresql.ssl.NonValidatingFactory
Click Apply and Test Connection.
Credits: https://intellij-support.jetbrains.com/hc/en-us/community/posts/205996299/comments/206373089

A: Go to the Advanced tab and look for the sslmode key. Set this to require from the dropdown and you should be good to go.
As a side note, if you got here by just googling postgres pycharm not connecting to db or something, it would probably be helpful to point out that I failed to make the connection by just pasting the connection string into the URL field. I had to manually break it down for each of the fields for it to finally connect.


text:
Q: Error while deploying app I am making a music app.My app runs sucessfully on stimulator but it shows following errors while deploying.I am using iOS 4.1 device.
Can any one help me getting out this errors while deploying.
Build ViewTable of project ViewTable with configuration Debug

Ld build/Debug-iphoneos/ViewTable.app/ViewTable normal armv7
cd /Users/uttambeldar/Desktop/ViewTable-1-1
setenv IPHONEOS_DEPLOYMENT_TARGET 4.1
setenv PATH "/xcode 3.2.4/Platforms/iPhoneOS.platform/Developer/usr/bin:/xcode 3.2.4/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
"/xcode 3.2.4/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2" -arch armv7 -isysroot "/xcode 3.2.4/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk" -L/Users/uttambeldar/Desktop/ViewTable-1-1/build/Debug-iphoneos -F/Users/uttambeldar/Desktop/ViewTable-1-1/build/Debug-iphoneos "-F/Users/uttambeldar/Desktop/ViewTable-1-1/../../Desktop/TravelApp backup 2/VisitIrvine_18 Sep 2010/iphonesimulator4.0/System/Library/Frameworks" "-F/xcode 3.2.4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks" "-F/xcode 3.2.4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks" "-F/xcode 3.2.4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/System/Library/Frameworks" -filelist /Users/uttambeldar/Desktop/ViewTable-1-1/build/ViewTable.build/Debug-iphoneos/ViewTable.build/Objects-normal/armv7/ViewTable.LinkFileList -dead_strip -miphoneos-version-min=4.1 -framework AudioToolbox -framework AVFoundation -framework CoreGraphics -framework Foundation -framework UIKit -o /Users/uttambeldar/Desktop/ViewTable-1-1/build/Debug-iphoneos/ViewTable.app/ViewTable

ld: warning: directory '/Users/uttambeldar/Desktop/ViewTable-1-1/../../Desktop/TravelApp backup 2/VisitIrvine_18 Sep 2010/iphonesimulator4.0/System/Library/Frameworks' following -F not found
ld: warning: in /xcode 3.2.4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/AudioToolbox.framework/AudioToolbox, file was built for i386 which is not the architecture being linked (armv7)
ld: warning: in /xcode 3.2.4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/AVFoundation.framework/AVFoundation, file was built for i386 which is not the architecture being linked (armv7)
ld: warning: in /xcode 3.2.4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics, file was built for i386 which is not the architecture being linked (armv7)
ld: warning: in /xcode 3.2.4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/Foundation.framework/Foundation, file was built for i386 which is not the architecture being linked (armv7)
ld: warning: in /xcode 3.2.4/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk/System/Library/Frameworks/UIKit.framework/UIKit, file was built for i386 which is not the architecture being linked (armv7)
Undefined symbols:
  "_OBJC_CLASS_$_NSFileManager", referenced from:
      objc-class-ref-to-NSFileManager in NetworkManager.o
  "_objc_setProperty", referenced from:
      -[ViewTableAppDelegate setSongListArray:] in ViewTableAppDelegate.o
      -[ViewTableAppDelegate setViewController:] in ViewTableAppDelegate.o
      -[ViewTableAppDelegate setWindow:] in ViewTableAppDelegate.o
      -[SongInfo setSongUrl:] in SongInfo.o
      -[SongInfo setImage:] in SongInfo.o
      -[SongInfo setName:] in SongInfo.o
  "_OBJC_CLASS_$_UINavigationController", referenced from:
      objc-class-ref-to-UINavigationController in ViewTableAppDelegate.o
  "___CFConstantStringClassReference", referenced from:
      cfstring=http://www.gaasgroup.co.in/Music/SongList.xml in ViewTableAppDelegate.o
      cfstring=Data: %@ in ViewTableAppDelegate.o
      cfstring=%@ in ViewTableAppDelegate.o
      cfstring=No Errors in ViewTableAppDelegate.o
      cfstring=Errors with xmlParser: %@ in ViewTableAppDelegate.o
      cfstring=Error Error Error!!! in ViewTableAppDelegate.o
      cfstring=Table View in ViewTableViewController.o
      cfstring=row Count %d in ViewTableViewController.o
      cfstring=MyIdentifier in ViewTableViewController.o
      cfstring=TableView in ViewTableViewController.o
      cfstring=MainView in ViewTableViewController.o
      cfstring=mp3filepath %@ in ViewTableViewController.o
      cfstring=row= %d in ViewTableViewController.o
      cfstring=P1=====  %@  in ViewTableViewController.o
      cfstring=%@/Annapoorna Stotram.mp3 in ViewTableViewController.o
      cfstring=f1=====  %@  in ViewTableViewController.o
      cfstring=P2=====  %@  in ViewTableViewController.o
      cfstring=%@/Devi Gayatri.mp3 in ViewTableViewController.o
      cfstring=f2=====  %@  in ViewTableViewController.o
      cfstring=HElloooooooo....... in ViewTableViewController.o
      cfstring=%c in ViewTableViewController.o
      cfstring=% in ViewTableViewController.o
      cfstring=%02x in ViewTableViewController.o
      cfstring=*******************Inside XmlDownloadedFromServer %@*******************
 in ViewTableViewController.o
      cfstring=Annapoorna%20Stotram.mp3 in ViewTableViewController.o
      cfstring=VISHNU---%@ in ViewTableViewController.o
      cfstring=Error  in ViewTableViewController.o
      cfstring=SongList in XmlParser.o
      cfstring=Info in XmlParser.o
      cfstring=Processing Element: %@ in XmlParser.o
      cfstring=Processing Value: %@ in XmlParser.o
      cfstring=FilePath is :-%@ in NetworkManager.o
      cfstring=Creating new file at path %@ in NetworkManager.o
      cfstring=Failed to create new file. in NetworkManager.o
      cfstring=error in NetworkManager.o
      cfstring= inside 200 status code for the request is  == %d  in NetworkManager.o
      cfstring=check returned string: %@ in NetworkManager.o
      cfstring=The cached version is already updated in NetworkManager.o
      cfstring=Local Version is updated no need to update xml ! in NetworkManager.o
      cfstring= Failure occurs... %d  in NetworkManager.o

      cfstring=Unable to delete file: %@ in NetworkManager.o
  "_objc_msgSendSuper2", referenced from:
      -[ViewTableAppDelegate dealloc] in ViewTableAppDelegate.o
      -[ViewTableViewController viewDidLoad] in ViewTableViewController.o
      -[ViewTableViewController didReceiveMemoryWarning] in ViewTableViewController.o
      -[ViewTableViewController dealloc] in ViewTableViewController.o
      -[MainView initWithStyle:reuseIdentifier:] in MainView.o
      -[MainView setSelected:animated:] in MainView.o
      -[MainView dealloc] in MainView.o
      -[DetailView didReceiveMemoryWarning] in DetailView.o
      -[DetailView dealloc] in DetailView.o
      -[XmlParser initXmlParser] in XmlParser.o
      -[XmlParser dealloc] in XmlParser.o
      -[SongInfo dealloc] in SongInfo.o
      -[NetworkManager dealloc] in NetworkManager.o
  "_OBJC_CLASS_$_NSData", referenced from:
      objc-class-ref-to-NSData in ViewTableAppDelegate.o
  "_OBJC_CLASS_$_UIActivityIndicatorView", referenced from:
      objc-class-ref-to-UIActivityIndicatorView in ViewTableViewController.o
  "_OBJC_CLASS_$_NSMutableArray", referenced from:
      objc-class-ref-to-NSMutableArray in XmlParser.o
  "_OBJC_CLASS_$_UIApplication", referenced from:
      objc-class-ref-to-UIApplication in ViewTableViewController.o
  "__objc_empty_vtable", referenced from:
      _OBJC_METACLASS_$_ViewTableAppDelegate in ViewTableAppDelegate.o
      _OBJC_CLASS_$_ViewTableAppDelegate in ViewTableAppDelegate.o
      _OBJC_METACLASS_$_ViewTableViewController in ViewTableViewController.o
      _OBJC_CLASS_$_ViewTableViewController in ViewTableViewController.o
      _OBJC_METACLASS_$_MainView in MainView.o
      _OBJC_CLASS_$_MainView in MainView.o
      _OBJC_METACLASS_$_DetailView in DetailView.o
      _OBJC_CLASS_$_DetailView in DetailView.o
      _OBJC_METACLASS_$_XmlParser in XmlParser.o
      _OBJC_CLASS_$_XmlParser in XmlParser.o
      _OBJC_METACLASS_$_SongInfo in SongInfo.o
      _OBJC_CLASS_$_SongInfo in SongInfo.o
      _OBJC_METACLASS_$_NetworkManager in NetworkManager.o
      _OBJC_CLASS_$_NetworkManager in NetworkManager.o
  "__objc_empty_cache", referenced from:
      _OBJC_METACLASS_$_ViewTableAppDelegate in ViewTableAppDelegate.o
      _OBJC_CLASS_$_ViewTableAppDelegate in ViewTableAppDelegate.o
      _OBJC_METACLASS_$_ViewTableViewController in ViewTableViewController.o
      _OBJC_CLASS_$_ViewTableViewController in ViewTableViewController.o
      _OBJC_METACLASS_$_MainView in MainView.o
      _OBJC_CLASS_$_MainView in MainView.o
      _OBJC_METACLASS_$_DetailView in DetailView.o
      _OBJC_CLASS_$_DetailView in DetailView.o
      _OBJC_METACLASS_$_XmlParser in XmlParser.o
      _OBJC_CLASS_$_XmlParser in XmlParser.o
      _OBJC_METACLASS_$_SongInfo in SongInfo.o
      _OBJC_CLASS_$_SongInfo in SongInfo.o
      _OBJC_METACLASS_$_NetworkManager in NetworkManager.o
      _OBJC_CLASS_$_NetworkManager in NetworkManager.o
  "_OBJC_CLASS_$_NSFileHandle", referenced from:
      objc-class-ref-to-NSFileHandle in NetworkManager.o
  "_UIApplicationMain", referenced from:
      _main in main.o
  "_OBJC_CLASS_$_NSBundle", referenced from:
      objc-class-ref-to-NSBundle in ViewTableViewController.o
  "_OBJC_CLASS_$_NSURL", referenced from:
      objc-class-ref-to-NSURL in ViewTableAppDelegate.o
  "_NSLog", referenced from:
      -[ViewTableAppDelegate ParseXML:] in ViewTableAppDelegate.o
      -[ViewTableAppDelegate ParseXML:] in ViewTableAppDelegate.o
      -[ViewTableAppDelegate ParseXML:] in ViewTableAppDelegate.o
      -[ViewTableAppDelegate ParseXML:] in ViewTableAppDelegate.o
      -[ViewTableAppDelegate ParseXML:] in ViewTableAppDelegate.o
      -[ViewTableViewController tableView:numberOfRowsInSection:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController XmlDownloadedFromServer:] in ViewTableViewController.o
      -[ViewTableViewController XmlDownloadedFromServer:] in ViewTableViewController.o
      -[ViewTableViewController XmlDownloadedFromServer:] in ViewTableViewController.o
      -[XmlParser parser:didStartElement:namespaceURI:qualifiedName:attributes:] in XmlParser.o
      -[XmlParser parser:foundCharacters:] in XmlParser.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager connection:didReceiveResponse:] in NetworkManager.o
      -
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
  "_NSURLAuthenticationMethodServerTrust", referenced from:
      _NSURLAuthenticationMethodServerTrust$non_lazy_ptr in NetworkManager.o
     (maybe you meant: _NSURLAuthenticationMethodServerTrust$non_lazy_ptr)
  "_OBJC_CLASS_$_NSString", referenced from:
      objc-class-ref-to-NSString in ViewTableAppDelegate.o
  "_OBJC_METACLASS_$_NSObject", referenced from:

  "_objc_msgSend_stret", referenced from:
      -[ViewTableViewController viewDidLoad] in ViewTableViewController.o
      -[ViewTableViewController viewDidLoad] in ViewTableViewController.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
  "_OBJC_CLASS_$_NSMutableData", referenced from:
      objc-class-ref-to-NSMutableData in NetworkManager.o
  "_OBJC_CLASS_$_NSURLConnection", referenced from:
      objc-class-ref-to-NSURLConnection in NetworkManager.o
  "_OBJC_CLASS_$_NSThread", referenced from:
      objc-class-ref-to-NSThread in ViewTableViewController.o
  "_OBJC_CLASS_$_NSURLRequest", referenced from:
      objc-class-ref-to-NSURLRequest in NetworkManager.o
  "_OBJC_CLASS_$_UITableViewCell", referenced from:
      _OBJC_CLASS_$_MainView in MainView.o
  "_AudioServicesAddSystemSoundCompletion", referenced from:
      -[ViewTableViewController XmlDownloadedFromServer:] in ViewTableViewController.o
  "_OBJC_CLASS_$_NSXMLParser", referenced from:
      objc-class-ref-to-NSXMLParser in ViewTableAppDelegate.o
  "_AudioServicesCreateSystemSoundID", referenced from:
      -[ViewTableViewController XmlDownloadedFromServer:] in ViewTableViewController.o
  "_OBJC_CLASS_$_NSRunLoop", referenced from:
      objc-class-ref-to-NSRunLoop in NetworkManager.o
  "_AudioServicesPlaySystemSound", referenced from:
      -[ViewTableViewController XmlDownloadedFromServer:] in ViewTableViewController.o
  "_OBJC_METACLASS_$_UIViewController", referenced from:
      _OBJC_METACLASS_$_ViewTableViewController in ViewTableViewController.o
      _OBJC_METACLASS_$_DetailView in DetailView.o
  "_objc_msgSend", referenced from:
      _main in main.o
      _main in main.o
      _main in main.o

      -[ViewTableAppDelegate dealloc] in ViewTableAppDelegate.o
      -[ViewTableViewController viewDidLoad] in ViewTableViewController.o
      -[ViewTableViewController viewDidLoad] in ViewTableViewController.o
      -[ViewTableViewController viewDidLoad] in ViewTableViewController.o
      -[ViewTableViewController viewDidLoad] in ViewTableViewController.o
      -[ViewTableViewController viewDidLoad] in ViewTableViewController.o
      -[ViewTableViewController viewDidLoad] in ViewTableViewController.o
      -[ViewTableViewController viewDidLoad] in ViewTableViewController.o
      -[ViewTableViewController tableView:numberOfRowsInSection:] in ViewTableViewController.o
      -[ViewTableViewController tableView:numberOfRowsInSection:] in ViewTableViewController.o
      -[ViewTableViewController tableView:numberOfRowsInSection:] in ViewTableViewController.o
      -[ViewTableViewController tableView:numberOfRowsInSection:] in ViewTableViewController.o
      -[ViewTableViewController tableView:cellForRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:cellForRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:cellForRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:cellForRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:cellForRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:cellForRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:cellForRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:cellForRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:cellForRowAtIndexPath:] in
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController urlEncode:] in ViewTableViewController.o
      -[ViewTableViewController urlEncode:] in ViewTableViewController.o
      -[ViewTableViewController urlEncode:] in ViewTableViewController.o
      -[ViewTableViewController urlEncode:] in ViewTableViewController.o
      -[ViewTableViewController urlEncode:] in ViewTableViewController.o
      -[ViewTableViewController urlEncode:] in ViewTableViewController.o
      -[ViewTableViewController urlEncode:] in ViewTableViewController.o
      -[ViewTableViewController DownloadXML:XmlName:] in ViewTableViewController.o
      -[ViewTableViewController DownloadXML:XmlName:] in ViewTableViewController.o
      -[ViewTableViewController DownloadXML:XmlName:] in ViewTableViewController.o
      -[ViewTableViewController DownloadXML:XmlName:] in ViewTableViewController.o
      -[ViewTableViewController DownloadXML:XmlName:] in ViewTableViewController.o
      -[ViewTableViewController DownloadXML:XmlName:] in ViewTableViewController.o
      -[ViewTableViewController XmlDownloadedFromServer:] in ViewTableViewController.o
      -[ViewTableViewController XmlDownloadedFromServer:] in ViewTableViewController.o
      -[ViewTableViewController XmlDownloadedFromServer:] in ViewTableViewController.o
      -[ViewTableViewController retainActivityIndicator] in ViewTableViewController.o
      -[ViewTableViewController retainActivityIndicator] in ViewTableViewController.o
      -[ViewTableViewController retainActivityIndicator] in ViewTableViewController.o
      -[ViewTableViewController retainActivityIndicator] in ViewTableViewController.o
      -[ViewTableViewController releaseActivityIndicator] in ViewTableViewController.o
      -[ViewTableViewController releaseActivityIndicator] in ViewTableViewController.o
      -[MainView LabelText:] in MainView.o
      -[MainView ProductImage:] in MainView.o
      -[MainView ProductImage:] in MainView.o
      -[DetailView changeText:] in DetailView.o
      -[DetailView changeImage:] in DetailView.o
      -[DetailView changeImage:] in DetailView.o
      -[XmlParser initXmlParser] in XmlParser.o
      -[XmlParser initXmlParser] in XmlParser.o
      -[XmlParser parser:didStartElement:namespaceURI:qualifiedName:attributes:] in XmlParser.o
      -[XmlParser parser:didStartElement:namespaceURI:qualifiedName:attributes:] in XmlParser.o
      -[XmlParser parser:didStartElement:namespaceURI:qualifiedName:attributes:] in XmlParser.o
      -[XmlParser parser:didStartElement:namespaceURI:qualifiedName:attributes:] in XmlParser.o
      -[XmlParser parser:didStartElement:namespaceURI:qualifiedName:attributes:] in XmlParser.o
      -[XmlParser parser:didStartElement:namespaceURI:qualifiedName:attributes:] in XmlParser.o
      -[XmlParser parser:didStartElement:namespaceURI:qualifiedName:attributes:] in XmlParser.o
      -[XmlParser parser:foundCharacters:] in XmlParser.o
      -[XmlParser parser:foundCharacters:] in XmlParser.o
      -[XmlParser parser:foundCharacters:] in XmlParser.o
      -
      -[XmlParser parser:didEndElement:namespaceURI:qualifiedName:] in XmlParser.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo RemoveControlChar] in SongInfo.o
      -[SongInfo dealloc] in SongInfo.o
      -[SongInfo dealloc] in SongInfo.o
      -[SongInfo dealloc] in SongInfo.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager myThreadMainMethod:] in NetworkManager.o
      -[NetworkManager myThreadMainMethod:] in NetworkManager.o
      -[NetworkManager myThreadMainMethod:] in NetworkManager.o
      -[NetworkManager myThreadMainMethod:] in NetworkManager.o
      -[NetworkManager startHTTPConnection] in NetworkManager.o
      -[NetworkManager startHTTPConnection] in NetworkManager.o
      -[NetworkManager startHTTPConnection] in NetworkManager.o
      -[NetworkManager startHTTPConnection] in NetworkManager.o
      -[NetworkManager startHTTPConnection] in NetworkManager.o
      -[NetworkManager startHTTPConnection] in NetworkManager.o
      -[NetworkManager startHTTPConnection] in NetworkManager.o
      -[NetworkManager startHTTPConnection] in NetworkManager.o
      -[NetworkManager startHTTPConnection] in NetworkManager.o
      -[NetworkManager connection:canAuthenticateAgainstProtectionSpace:] in NetworkManager.o
      -[NetworkManager connection:canAuthenticateAgainstProtectionSpace:] in NetworkManager.o
      -[NetworkManager connection:didReceiveAuthenticationChallenge:] in NetworkManager.o
      -[NetworkManager connection:didReceiveAuthenticationChallenge:] in NetworkManager.o
      -[NetworkManager urlEncode:] in NetworkManager.o
      -[NetworkManager urlEncode:] in NetworkManager.o
      -[NetworkManager urlEncode:] in NetworkManager.o
      -[NetworkManager urlEncode:] in NetworkManager.o
      -[NetworkManager urlEncode:] in NetworkManager.o
      -[NetworkManager urlEncode:] in NetworkManager.o
      -[NetworkManager urlEncode:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didReceiveData:] in NetworkManager.o
      -[NetworkManager connection:didFailWithError:] in NetworkManager.o
      -[NetworkManager connection:didFailWithError:] in NetworkManager.o
      -[NetworkManager connection:didFailWithError:] in NetworkManager.o
      -[NetworkManager connection:didFailWithError:] in NetworkManager.o
      -[NetworkManager connection:didFailWithError:] in NetworkManager.o
      -[NetworkManager connection:didFailWithError:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
  "_OBJC_CLASS_$_NSMutableString", referenced from:
      objc-class-ref-to-NSMutableString in ViewTableViewController.o
  "_NSSearchPathForDirectoriesInDomains", referenced from:
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[ViewTableViewController tableView:didSelectRowAtIndexPath:] in ViewTableViewController.o
      -[NetworkManager GetFile:] in NetworkManager.o
      -[NetworkManager connection:didFailWithError:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
      -[NetworkManager connectionDidFinishLoading:] in NetworkManager.o
  "_OBJC_CLASS_$_AVAudioPlayer", referenced from:
      objc-class-ref-to-AVAudioPlayer in ViewTableViewController.o
  "_OBJC_CLASS_$_UIImage", referenced from:
      objc-class-ref-to-UIImage in MainView.o
  "_OBJC_METACLASS_$_UITableViewCell", referenced from:
      _OBJC_METACLASS_$_MainView in MainView.o
  "_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
      objc-class-ref-to-NSAutoreleasePool in main.o
  "_OBJC_CLASS_$_NSCharacterSet", referenced from:
      objc-class-ref-to-NSCharacterSet in XmlParser.o
  "_OBJC_CLASS_$_NSObject", referenced from:
      _OBJC_CLASS_$_ViewTableAppDelegate in ViewTableAppDelegate.o
      _OBJC_CLASS_$_XmlParser in XmlParser.o
      _OBJC_CLASS_$_SongInfo in SongInfo.o
      _OBJC_CLASS_$_NetworkManager in NetworkManager.o
  "_AudioServicesDisposeSystemSoundID", referenced from:
      _simpleSoundDone in ViewTableViewController.o
  "_OBJC_CLASS_$_UIViewController", referenced from:
      _OBJC_CLASS_$_ViewTableViewController in ViewTableViewController.o
      _OBJC_CLASS_$_DetailView in DetailView.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

A: Run a CLEAN ALL - part of the Build menu and then Build again

A: Looks like you're trying to link against the simulator versions of the frameworks rather than the device versions.


text:
Q: Flex Layout Height Issue I am facing issue to increase and decrease the height of div where I apply fxFlex. I provided dynamic height to container. How can I fix this ?
Thanks in advance.
Demo here

 Some Text

 Some Text

 Some Text

Note: Height provided container dynamically (on window size / resize)
Screenshot:

A: Here's what you can do using fxFlexFill: StackBlitz HERE

<mat-card>Some Text</mat-card>

<mat-card>Some Text</mat-card>

<mat-card>Some Text</mat-card>

fxFlexFill allows you to set the height of the div according to what it can take.
So I added the following CSS for your HTML page to take a maximum height depending on your screen.
html, body {height: 100%; margin: 0;}

DEMO:


text:
Q: Importing TZStackView in an objective - c project I am trying to use TZStackView due to limitations of UIStackView but since it's written in swift, I can't add it to my project which is Objective-c project. I've added swift class to objective-c projects before but this doesn't seem to work. I've copied TZStackView files to my project directory and got like hundreds of error messages. How do I use it ( I don't wanna use pods)?

A: Use the TZStackView v1.2.0, TZStackView v1.3.0 supports swift 3 it will works only in xcode8. for xcode7 use TZStackView v1.2.0.


text:
Q: Does Zeitgeist slow performance considerably This was talked to me today and I actually did not have a proper answer, so I was wondering if Zeitgeist had any impact in performance. For example if comparing Ubuntu with and without Zeitgeist in terms of: Memory Usage, CPU Usage and Performance in general.
It is my believe that since Zeitgeist is mostly en Event Logger and not a File Sysyem indexer, the performance would be so low that it would not registered even on an old Pentium 3 when compared, like I said, with an Ubuntu that has Zeitgeist and one that doesn't. Am I right or wrong about this assumption?

A: Your assumption is right. Zeitgeist itself only takes in events and does now crawl around. Something had to send it events and it just stores it with max 2 SQLite calls ;)