text:
Q: WCF Metadata broken without change I am sorry if I sound agressiv but I am close to throwing my machine out of the window because this is the 3rd day in a row WCF burns my worktime.
I have created a simple WCF Service this morning. I could start it from Visual Studio so it got hosted in the WCF Service Host, I could include it as a Service Reference while running in 3 different projects. I could host in from a console application and clients can connect to it.
Now I need the Servicereference in yet another project but i cant host the wcf in the WCF Service host any more. It tells me:

Microsoft WCF-Diensthost
Der WCF-Diensthost kann keine Dienstmetadaten finden. Dies kann zu nicht ordnungsgemäßer > Ausführung der Clientanwendung führen. Überprüfen Sie, ob Metadaten aktiviert sind.
  Möchten Sie den Vorgang beenden?
Ja   Nein

Google Translation:

Microsoft WCF Service Host
The WCF Service Host can not find any service metadata. This can lead to incorrect
  execution of the client application. Check if metadata is enabled. Do you want to exit?
Yes No

There has been no change to the WCF implementation its interface or its config. I can still host it in the console app, but I cant not get a service reference any more.
Config is this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- Bei der Bereitstellung des Dienstbibliothekprojekts muss der Inhalt der Konfigurationsdatei der app.config-Datei
  des Hosts hinzugefügt werden. System.Configuration unterstützt keine Konfigurationsdateien für Bibliotheken. -->
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="WcfHost.Service1Behavior" name="WcfHost.Service1">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
          contract="WcfHost.IWcfInfoHost">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8732/InfoHost/Service1/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WcfHost.Service1Behavior">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>

How can this BEAK WITHOUT CHANGE?

A: Please check the serviceMetaData section in your web.config file:-
serviceMetadata httpGetEnabled="false"
     <serviceBehaviors>
        <behavior name="WcfHost.Service1Behavior">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>

Just set serviceMetadata httpGetEnabled = "true"
Please refer to https://social.technet.microsoft.com/wiki/contents/articles/1298.exposing-a-metadata-exchange-mex-endpoint-over-tcp-with-an-iis-hosted-wcf-service.aspx
This will fix your issue.

A: After recreating I figured it out. I was wrong the project was not unchanged. I changed the classname of the Interface implementation so
<service behaviorConfiguration="WcfHost.Service1Behavior" name="WcfHost.Service1">

was not correct any more.
But is is very disturbing the VS refactoring tool is unable to change the app.conf and it is most disturbing that the errormassage has nothing to do with the actual error. WCF makes me cry.


text:
Q: Lambda representability for boolean function I have the following $\lambda$-term
$$F=\lambda xy.(M(Nxy))$$
where
$$M=\lambda zxy.zyx \qquad N=\lambda xy.xxy$$
The term $F$ represents some boolean function of two arguments $f(x,y)$. So I need to describe this function. I think that I should act with this term on the terms $\mathsf{T} = \lambda xy.x$ and $\mathsf{F} = \lambda xy.y$ and do $\beta$-reduction after that. Is it true? Or I need to act differently? It is hard to understand for me, because I haven't dealt with $\lambda$-representability before.

A: Yes, your idea is correct. For $P = \lambda xy.M(Nxy)$ (I renamed the term $P$ to avoid confusion with $F = \lambda xy.y$), you have to consider all the possible applications to two booleans (which are $T$ and $F$), i.e. you have to consider the terms $PTT$, $PTF$, $PFT$ and $PFF$, and $\beta$-reduce them to their normal forms, which are still booleans. In this way, you can draw a truth table for $P$, which is the truth table of the boolean function represented by $P$.

Concretely, first consider that ($x,y,z$ stands for
a term whatsoever)
\begin{align}
NTz &= (\lambda xy.xxy)Tz &&& NFz &= (\lambda xy.xxy)Fz
\\
&\to_\beta (\lambda y.TTy)z &&& &\to_\beta (\lambda y.FFy)z
\\
&\to_\beta TTz &&& &\to_\beta FFz
\\
&= (\lambda x'y'.x')Tz &&& &= (\lambda x'y'.y')Fz
\\
&\to_\beta (\lambda y'.T)z &&& &\to_\beta (\lambda y'.y')z
\\
&\to_\beta T &&& &\to_\beta z
\end{align}
\begin{align}
Txy &= (\lambda x'y'.x')xy &&& Fxy &= (\lambda x'y'.y')xy
\\
&\to_\beta (\lambda y'.x)y &&& &\to_\beta (\lambda y'.y')y
\\
&\to_\beta x &&& &\to_\beta y
\end{align}
\begin{align}
MT &= (\lambda zxy.zyx)T &&& MF &= (\lambda zxy.zyx)F
\\
&\to_\beta \lambda xy.Tyx &&& &\to_\beta \lambda xy.Fyx
\\
&\to_\beta^* \lambda xy.y &&& &\to_\beta^* \lambda xy.x
\\
&= F &&& &= T
\end{align}
Hence,

!
\begin{align}
PTT &= (\lambda xy.M(Nxy))TT &&& PTF &= (\lambda xy.M(Nxy))TF
\\
&\to_\beta (\lambda y. M(NTy))T &&& &\to_\beta (\lambda y. M(NTy))F
\\
&\to_\beta M(NTT) &&& &\to_\beta M(NTF)
\\
&\to_\beta^* MT &&& &\to_\beta^* MF
\\
&\to_\beta^* F &&& &\to_\beta^* T
\end{align}

!
\begin{align}
 PFT &= (\lambda xy.M(Nxy))FT &&& PFF &= (\lambda xy.M(Nxy))FF
 \\
 &\to_\beta (\lambda y. M(NFy))T &&& &\to_\beta (\lambda y. M(NFy))F
 \\
 &\to_\beta M(NFT) &&& &\to_\beta M(NFF)
 \\
 &\to_\beta^* MT &&& &\to_\beta^* MF
 \\
 &\to_\beta^* F &&& &\to_\beta^* T
\end{align}

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to close mongodb groovy connection (soapUI) I have a groovy script that fetches data from mongodb (SoapUI)
@Grab(group='com.gmongo', module='gmongo', version='1.5')

import com.gmongo.GMongo
import com.mongodb.MongoCredential
import com.mongodb.*
import com.mongodb.ServerAddress
import com.gmongo.*
import com.mongodb.MongoURI
import com.mongodb.DBCursor;
import com.mongodb.BasicDBObject;
import com.mongodb.BasicDBList
import org.bson.types.ObjectId

//define variables from mongo document
def mongo_name
def mongo_description
def mongo_type

//define mongo_variables and initiate mongo connection
def mongoendpoint = context.expand( '${#Project#mongoendpoint}' )
def mongocollection=context.expand( '${#Project#mongocollection_products}' )
def mongo= new GMongo (new MongoURI(mongoendpoint))
def db = mongo.getDB(mongocollection)
def collection = db.getCollection("ProductItems")

//define elements from API response
def api_productId = context.expand('${#Project#package_parent}')

//get document from mongo
DBCursor cursor=collection.find(_id : api_productId)
//log.info cursor

if (cursor.hasNext() )
{ DBObject obj = cursor.next()
//mongo_name=obj.name.toString()
}

 //close cursor
cursor.close()

My problem is that connection stays open until I shut down ReadyAPI which leads to too many open (and not closed) connections.
Is it anyway to explicitly close connection? (googled, but couldn't find a solution which would work)

A: You need to use mongo client so that you will be able to close the connection. use mongo client instead of GMongo. So you can try something like this:
@Grab(group='com.gmongo', module='gmongo', version='1.5')

import com.gmongo.GMongo
import com.mongodb.MongoCredential
import com.mongodb.*
import com.mongodb.ServerAddress
import com.gmongo.*
import com.mongodb.MongoURI
import com.mongodb.DBCursor;
import com.mongodb.BasicDBObject;
import com.mongodb.BasicDBList
import org.bson.types.ObjectId

//define variables from mongo document
def mongo_name
def mongo_description
def mongo_type

//define mongo_variables and initiate mongo connection
def mongoendpoint = context.expand( '${#Project#mongoendpoint}' )
def mongocollection=context.expand( '${#Project#mongocollection_products}' )
mongoClient = new MongoClient( mongoendpoint )
def db = mongo.getDB(mongocollection)
def collection = db.getCollection("ProductItems")

//define elements from API response
def api_productId = context.expand('${#Project#package_parent}')

//get document from mongo
DBCursor cursor=collection.find(_id : api_productId)
//log.info cursor

if (cursor.hasNext() )
{ DBObject obj = cursor.next()
//mongo_name=obj.name.toString()
}

 //close cursor
cursor.close()

//close connection
mongoClient.close()


text:
Q: Updating an expired Contract entity to draft in Microsoft Dynamics Crm Hi I have been working on updating expired contracts in Microsoft Dynamics Crm 4.0. So that they change state to Draft and has an expired date in the future set. I have been doing this through the CrmWebservice.
My first try was to simply update through the Update method. But got this "The state is invalid, this contract cannot be updated".
So after that I have tried to update the status of the contract this way
SetStateContractRequest request = new SetStateContractRequest();
request.ContractState = ContractState.Draft;
request.ContractStatus = 1;
request.EntityId = contract.contractid.Value;
service.Execute(request);

Resulting in: "The target state is invalid.  The target state may not exist or the system does not allow changing to the target state from the current state."
I've tried other combinations with the same result.
So I'm fearing that it's not possible to change the status of a Contract once it has expired. Is that the case? And if not, then how do I solve the problem?

A: SetStateContractRequest should be the correct way, but according to a co-worker, this transition is not possible.
The whole contract/product/price list part of MSCRM is pretty rigid and restrictive; we usually forgo it altogether because it dictates a process that's different from what our customers need. Most of our projects that need contracts or products have custom entities for that part, around which we build a process that caters to the customer's needs.


text:
Q: Зависает UI во время выполнения AsyncTask Добрый день. Пишу Android приложение, нужно подключиться через интернет и получить данные с сервера. Загрузку данных сделал через AsyncTask, но во время выполнения AsyncTask главный поток блокируется.
private void doit () {
            //Загружаем данные через интернет
            String resp = ""; //То, что скачали с интернета
            pd = new ProgressDialog(this); //Инициализация прогресс диалога
            try {
                //Запускаем новый поток
                GetHTTPResponseTask task = new GetHTTPResponseTask();
                task.execute();
                resp = task.get();
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                resp = "Error";
            } catch (ExecutionException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                resp = "Error";
            }
            Toast.makeText(this, resp, Toast.LENGTH_LONG).show();
}

Класс AsyncTask
//Этот класс находится в том же классе, что и текущая Activity
private class GetHTTPResponseTask extends AsyncTask<Void, Void, String> {

        @Override
        protected void onPreExecute() {
            // TODO Auto-generated method stub
            super.onPreExecute();
            pd.setTitle("Авторизация");
            pd.setMessage("Заходим...");
            pd.show(); //Запускаем прогресс диалог
        }

        @Override
        protected String doInBackground(Void... p) {
            // TODO Auto-generated method stub
                    String _text = ""; //Для возврата результата
                    HttpURLConnection cn = null;
                    try {
                        //Что-нибудь подлиннее, чтобы показать, насколько всё плохо
                        URL url = new URL("http://dl.zaycev.net/127833/2206682/ruki_vverkh_-_ruki_vverkh_(zaycev.net).mp3");
                        cn = (HttpURLConnection)url.openConnection();
                        cn.setRequestMethod("GET");
                        cn.setRequestProperty("Accept-Charset", "UTF-8");
                        cn.setRequestProperty("Content-Type", "text/plain; charset=utf-8");
                        cn.setConnectTimeout(5000);
                        cn.setReadTimeout(7000);
                        cn.connect();

                        InputStream in = cn.getInputStream();
                        StringBuffer bf = new StringBuffer();
                        BufferedReader br = new BufferedReader(new InputStreamReader(in));
                        String line; //Построчное чтение
                        while ((line = br.readLine()) != null) {
                            bf.append(line);
                        }
                        _text = bf.toString();
                        cn.disconnect();
                    } catch (MalformedURLException e) {
                        _text = "Error";
                    } catch (UnknownHostException e) {
                        _text = "Error";
                    } catch (FileNotFoundException e) {
                        // TODO Auto-generated catch block
                        _text = "Error";
                    } catch (IOException e) {
                        e.printStackTrace();
                        _text = "Error";
                    }

            return _text;
        }

        @Override
        protected void onPostExecute(String result) {
            // TODO Auto-generated method stub
            super.onPostExecute(result);
            pd.dismiss(); //Закрываем прогресс диалог

        }
    }

Делал как описано в примерах на многих сайтах, итог один и тот же, 2 проблемы:

*

*Зависаем главный поток UI, хотя в отладке показывает, что делает в отдельном потоке;

*ProgressDialog во время загрузки большого файла не появляется. На виртуальном устройстве можно увидеть, что он появился после загрузки. Если закомментировать строку pd.Dismiss(), то тогда ProgressDialog запустится раньше, чем файл начнет скачиваться, но не остановится.
Кто-нибудь сталкивался с такими проблемами?
Список Thread.

A: У вас в основном потоке стоит метод get, который ждет пока завершит свою работу AsynTask и вернет результат. Для получения результата используйте listener или используйте Loader вместо AsynkTask. И не нужно показывать лишний код, который не относится к вопросу.


text:
Q: Will using GPT delete the encryption? New hdd, no data; using as storage hdd only - no os. I just encrypted my hdd and it has no partition. If I do the following, will the encryption be deleted? The size of the hdd is too large for "fdisk". Below is an example of someone else trying to do the same thing with their ouput afterwards.
I encrypted using the following format:
cryptsetup luksFormat /dev/sdX
cryptsetup luksOpen /dev/sdX external_disk
mkfs /dev/mapper/external_disk
cryptsetup luksCLose external_disk

I created a partition using the folling:
sudo parted /dev/sda
Output:
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
Creates a new GPT disklabel i.e. partition table:
mklabel gpt
Next, set the default unit to TB, enter:
unit TB
To create a 2TB partition size, enter:
mkpart primary 0.00TB 2.00TB
To print the current partitions, enter:
print
Sample outputs:
Model: ATA ST33000651AS (scsi)
Disk /dev/sda: 2.00TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number  Start   End     Size    File system  Name     Flags
 1      0.00TB  2.00TB  2.00TB  ext4         primary
Quit and save the changes, enter:
quit
Use the mkfs.ext4 command to format the file system, enter:
mkfs.ext4 /dev/sda1
update: I got a similar output except that my logical partition size was 512bytes and the physical was (like) 4068.
But now it seems my encryption is gone as I can mount and open the partition without a password.

A: With the schema written in the question, GPT partitioning was not needed and not used. The schema there created the needed partition.


text:
Q: elasticsearch : How can i tell _reindex api in to continue indexing docs while source index still receiving new docs? I have daily created indices, these indices are filled by an agent which collects a logs every second of the day, and i'am reindexing them (by field) to new indices using _reindex api.
How can i tell _reindex api to still reindixing while the source index still receiving new documents ?
Any help woould be really appriciated!
Thank you

A: you cannot force reindex API to be online to reindex new received documents.
but I have solution. you can add a date field (index_time) to your source index. write an hourly cron job to run reindex API with a query to get last hour indexed docs via index_time.
POST _reindex
{
  "source": {
    "index": "my-index-000001",
     "query": {
        "filter" :{
            "query": {
                "range": {
                   "index_time": {"gte" : "now-1h"}
                          }
                      }
                   }
               }
  },
  "dest": {
    "index": "my-new-index-000001"
  }
}


text:
Q: GIT - how to enforce file exclusion by server? I want to enforce file exclusion by the git server.
Users should not be able to push file that doesn't match to rules to the central repository.
I tried to setup rules in /info/exclude on the git server side, but it ignore it.
Is there a way to do that ? (excluding hooks solution).
Thanks for your help

A: You could ask users to add a system config:
git config --system core.excludesfile /share/path/to/system/wide/gitignore

That way, users are referencing a shared (gitignore) file.

A: You can create a pre-receive hook that analyzes the push and looks for file extensions.
I do that to avoid binaries being pushed, but files with certain extensions are allowed (jpg, mov, mp3, etc)

A:
excluding hooks solution

No. A Git server, that is a bare repository that sits somewhere and is just interacted with, does not care about what kind of object it gets pushed to. It just copies objects into its own object database and changes some ref pointers from time to time. There is nothing in it that would look at the tree objects and check if some path matches some path you would like to exclude.
The only way to do this would be using hooks, either the pre-receive or the update hook. You would get the new ref and see if the paths you want to exclude are touched within the new commits. If they are, you can abort the push.


text:
Q: Gradle/Maven configs for Artifactory Java Client I am trying to use the Artifactory Java Client in my code and Gradle build but cannot discern a few details about the JAR itself:

*

*What exact mavenRepo should I use to locate the JAR inside my build.gradle?

*What is the latest stable official version I should be using? According to Bintray, it's either 0.17, 0.7 or 0.10 depending on what link you go to. According to mvnrepo.org, it's 0.16.

*What are the Gradle coordinates for this latest/stable/official version (group:artifact:version.jar)? Again, because I can't tell what binary repo is hosting this JAR, nor what version is officially the latest/stable, determining the proper coordinates is almost impossible.

Update:
It looks like the answer to the first question (maven repo) is:
maven {
    url "http://dl.bintray.com/jfrog/artifactory-tools"
}

Looks like 0.17 is also the official stable/latest version.
So still needing help with the Gradle/Maven coordinates. Leaving these answers up here in case any future-comers wonder the same thing.

A: The Artifactory Java client is officially distributed from Bintray. You can use the Maven repo you mentioned or better use Bintray's jcenter:
repositories {
    jcenter()
}

0.17 is indeed the latest version. You can use this URL to get the latest version in Bintray - https://bintray.com/jfrog/artifactory-tools/artifactory-client-java/_latestVersion
The coordinates you need to use are:
compile(group: 'org.jfrog.artifactory.client', name: 'artifactory-java-client-services', version: '0.17', ext: 'jar')


text:
Q: Parsing DCS scripts into lists/dictionaries in python I am quite new to python and I am trying to use it (Python 2.7.14) to pull information out of a text file.
When I copy part of the text file as a string and run a search, as so:
import re

data = """ATTRIBUTE_INSTANCE NAME="R_MIX_HIHI_LIM"
    {
      VALUE { CV=0 }
    }
    ATTRIBUTE_INSTANCE NAME="R_MIX_LOLO_LIM"
    {
      VALUE { CV=0 }
    }
    ATTRIBUTE_INSTANCE NAME="R_MIX_SP"
    {
      VALUE { CV=0 }
    }
    ATTRIBUTE_INSTANCE NAME="R_VAC_HIHI_LIM"
    {
      VALUE { CV=0 }
    }
    ATTRIBUTE_INSTANCE NAME="R_VAC_LOLO_LIM"
    {
      VALUE { CV=0 }
    }
    ATTRIBUTE_INSTANCE NAME="R_VAC_SP"
    {
      VALUE { CV=0 }
    }
    ATTRIBUTE_INSTANCE NAME="L_RECIRC_TM"
    {
      VALUE { CV="" }
    }
    ATTRIBUTE_INSTANCE NAME="L_RECIRC_TM_SP"
    {
      VALUE { CV="" }
    }"""

regex = re.compile(r"ATTRIBUTE_INSTANCE NAME\=\"([A-Za-z][_A-Za-z]+)")
result = regex.search(data)

for result in regex.findall(data):
    print result

I get the output I am seeking. The problem arises when I try to directly search the text file using the following:
import re

f_open = open("file.txt", "r")
data = f_open.read()

regex = re.compile(r"ATTRIBUTE_INSTANCE NAME\=\"([A-Za-z][_A-Za-z]+)")
result = regex.search(data)

for result in regex.findall(data):
    print result

f_open.close()

My search command no longer outputs anything. This is due to the "open" command adding spaces between all the characters. So instead of:
ATTRIBUTE_INSTANCE NAME="R_PRS_CTRL_LM"
{
  VALUE { CV=0 }
}

I am getting:
     A T T R I B U T E _ I N S T A N C E   N A M E = " R _ P R S _ C T R L _ L M "
     {
         V A L U E   {   C V = 0   }
     }

Is there any to make sure my code reads the text file without adding spaces, thus breaking my search function?

A: I figured it out. The DCS output file is binary. Converting the file fixes the issue.


text:
Q: Import a list of users from flat file to AD group I have two questions really, both surrounding the same topic.
I need to be able to create a flat file and use this file to import the users listed in the file to a specific group in Active Directory.  They will already exist in AD, just not be in the group.
Secondarily to that, I also need to be able to use similar methodologies to remove users from the AD group using a different flat file.
Can this be done?  The list of users will be in the 100s so I really don't want to have to do it by hand....

A: Yes, this is possible with Powershell: Managing Active Directory with Windows PowerShell This is for Powershell 1.0, there are a lot of tutorials for the same task with Powershell 2, which is a lot easier.


text:
Q: Why jQuery doing unwanted multiple actions of single command? When i resize browser the it gives multiple alerts. I used "return false" not working.
If I used unbind()/unbind('resize') then it works but it creates an other problem- the resize() function stops working from second time browser/window resize.
My code-

A: Because the resize triggers everytime the browser changes.
If you are resizing 100 pixels it can trigger up to 100 times.
Something like this should work and trigger only once you stopped resizing the window:
var resizing = false, stopedResizing = true;
$(window).bind('resize',function() {
    if(!resizing){
        console.log("started resizing. Width = " + $(".myclass").parent().width());
        resizing = true;
    }
    stopedResizing = false;
    setTimeout(function(){
       if(!stopedResizing){
           stopedResizing = true;
           setTimeout(function(){
               if(stopedResizing && resizing){
                resizing = false;
                console.log('Stoped resizing. Width = ' + $(".myclass").parent().width());
               }
           }, 500);
       }
    }, 500);
});

A: This is not an issue with jQuery, but on the browser's implementation of resize.
Depending which browser you use it may trigger intermediate resizes, or a resize when your mouse is released only.

A: You could do something like:
$(document).ready(function(e) {

    alert($(".myclass").parent().width());
    var lastTime = 0;

    $(window).bind('resize',function() {
        var currentTime = new Date().time();
        if(currentTime > lastTime + 5000)
            alert($(".myclass").parent().width());
        lastTime = currentTime;
    });

});

...so that it will only fire on resizes at least 5 seconds apart. Normally though, you'd want to act when resizing stops, not when it starts.

A: This code fires ones on mouseover of the window after the a resize event as occurred.
$(document).ready(function() {

        var windowResized = false;

        function callFunction() {

            console.log("I am called once after window resize");
        }

        $(window).mouseover(function() {

            if (windowResized == true) {

                callFunction();
                windowResized = false;
            }

        })

        $(window).resize(function() {

            windowResized = true;

        });

    })


text:
Q: How to configure a WCF client using basicHttpBinding and Username authentication over https I'm trying to consume a web service provided by another group within our company.  The service is written in Java and their JAVA test client functions properly.  However, I cannot get a .NET4.0 or .NET 4.5 based WCF client to talk to it.  They require https transport and since its JAVA I'm using basicHttpBinding.  They also require Username/Password.  In JAVA, they are saying the username/password is at the binding level and when looking at a message that was captured from their test code, there is NO evidence of the username or password being sent.  I can connect to their service but cannot get authenticated because they are not seeing my username & password.  Username and password is being set in code.  I am currently testing against their dev server using their self signed cert.  Our endpoints are physically 1500 miles apart but connect via internal corporate (secure) network.
I just need to know the proper config settings for "binding", "behavior", and "endpoint" to use at the client.  I can post my settings but that would just be misleading as I've tried 100's of them and none give the desired result.
Any help you can give will be useful as long as it doesn't involve any changes on (or knowledge of) the service host side (its probably not even IIS).
Thanks for your thoughts.
Java client code looks like this:
ServiceImplServiceLocator locator = new ServiceImplServiceLocator();
locator.setServiceEndpointAddress( "https://<hostaddr>:8443/Service" );
locator.setServiceWSDDServiceName("Service");

ServiceImpl service = locator.getService();

ServiceSoapBindingStub binding = (ServiceSoapBindingStub) service;
binding.setUsername("Username");
binding.setPassword("Password");

// call web service
Return = binding.ServiceMethod( ... );


text:
Q: Matlab smooth a 3d mesh plot Hi I have a set of data A with each element corresponding to an x and y combination. When I plot this dat using mesh I get a graph with many spikes on it. This is not unnexpected but I would like a way to smooth these out to get a smooth surface.
I've tried to use the smooth3 command but cannot figure out how to make the suitable input.
Any help would be appreciated. Thanks
This is how my data is generated.
function v = f(x,y) % Not actual function
return x*rand()+y*rand()
end

x = 0.05:0.01:0.95;
y = 0.05:0.01:0.95;

o = zeros(length(x),length(y));
A = zeros(length(x), length(y));
for k = 1:5
    for i = 1:length(x)
        for j = 1:length(y)
            o(i,j) = f([x(i), y(j)]);
        end
    end
    A= A+o;
end
A = A/5;

This is what produces the plot.
[X,Y] = meshgrid(x);
mesh(A)

A: my be you can try a convolution of your variable A with a filter(the following is an example of a Gaussian filter).

C = conv2(A,fspecial('gaussian', hsize, sigma));
  check conv2 and fspecial in matlab help


text:
Q: Implementing back navigation in Jetpack Compose I've got a top bar with IconButton for handling back navigation when clicked.
Function passed as callback's implemented like this:
private fun navigateBack(navController: NavController) {
    val route = navController.previousBackStackEntry?.destination?.route ?: ""
    navController.navigate(route)
}

Unfortunately, it's not working the same as the default android bottom navigation shown in the picture

Is there a way to implement the same back navigation as bottom system navigation has?

A: You can pass your NavController to your TopAppBar and use navController.navigateUp() in the navigation icon.
If you want to show this icon only in some composables you can use a parameter, like canPop in the following example, and set it true in the composable where you want handle the back button.
if (canPop) {
    TopAppBar(
        title = { Text(text = title) },
        navigationIcon = {
            IconButton(onClick = {
                navController.navigateUp()
            }) {
                Icon(Icons.Rounded.ArrowBack, "")
            }
        },
        backgroundColor = MaterialTheme.colors.TopBarColor)
} else {
    TopAppBar(
        title = { Text(text = title) },
        backgroundColor = MaterialTheme.colors.TopBarColor
    )
}

Check also popBackStack documentation

Attempts to pop the controller's back stack. Analogous to when the user presses the system Back button when the associated navigation host has focus.


text:
Q: Convert CSV file to JSON file I am trying to convert my CSV file to a JSON file format. When I do it, there is an extra entry in the JSON file which only contains field names.
I have tried using pandas, dictionary but can't seem to get to the result. Something or other comes.
I want to remove the extra filed names only entry at the start of the JSON. Also how can I make ConnectionId as key and the same format for a different output.
import csv, json

csvfile = open('/home/Desktop/PD/GEOSubscriberLocations_LTE_sample.csv', 'r')
jsonfile = open('/home/Desktop/PD/script5.json', 'w')

fieldnames = ("Confidence", "ConnectionId", "Imei", "Imsi", "IsData", "IsSignalling", "IsVoice", "Latitude", "Longitude",
              "Mcc", "Mnc", "SegmentDuration", "SegmentStartTime", "ServingCellLabel", "Sv",
              "TrackingAreaCode", "Uncertainity")

reader = csv.DictReader(csvfile , fieldnames)

code = ''
for row in reader:
    for key in row:
        row[key] = row[key].decode('utf-8', 'ignore').encode('utf-8')
        json.dump(row, jsonfile, indent=4, sort_keys=False)
        jsonfile.write('\n')

The actual result is:
{
    "Confidence": "Confidence",
    "IsData": "IsData",
    "Latitude": "Latitude",
    "ConnectionId": "ConnectionId",
    "Mcc": "Mcc",
    "Sv": "Sv",
    "Longitude": "Longitude",
    "Uncertainity": "Uncertainty",
    "IsVoice": "IsVoice",
    "IsSignalling": "IsSignalling",
    "SegmentStartTime": "SegmentStartTime",
    "Imei": "Imei",
    "SegmentDuration": "SegmentDuration",
    "Mnc": "Mnc",
    "ServingCellLabel": "ServingCellLabel",
    "Imsi": "Imsi",
    "TrackingAreaCode": "TrackingAreaCode"
}
{
    "Confidence": "1.994667E-07",
    "IsData": "FALSE",
    "Latitude": "1.694202",
    "ConnectionId": "330708186825281",
    "Mcc": "999",
    "Sv": "01",
    "Longitude": "0.434623",
    "Uncertainity": "178",
    "IsVoice": "FALSE",
    "IsSignalling": "TRUE",
    "SegmentStartTime": "16/02/2017 09:56:59.912",
    "Imei": "99999006686069",
    "SegmentDuration": "00:00:00.0350000",
    "Mnc": "99",
    "ServingCellLabel": "Cell18",
    "Imsi": "999992223223602",
    "TrackingAreaCode": "1234"
}
{
    "Confidence": "1.504506E-12",
    "IsData": "FALSE",
    "Latitude": "1.633704",
    "ConnectionId": "260339442647675",
    "Mcc": "999",
    "Sv": "02",
    "Longitude": "0.668554",
    "Uncertainity": "314",
    "IsVoice": "FALSE",
    "IsSignalling": "TRUE",
    "SegmentStartTime": "16/02/2017 09:57:01.377",
    "Imei": "99999207564306",
    "SegmentDuration": "00:00:00.0280000",
    "Mnc": "99",
    "ServingCellLabel": "Cell19",
    "Imsi": "999993793410366",
    "TrackingAreaCode": "1235"
}
{
    "Confidence": "0.3303348",
    "IsData": "FALSE",
    "Latitude": "1.847635",
    "ConnectionId": "260339442647676",
    "Mcc": "999",
    "Sv": "14",
    "Longitude": "1.356349",
    "Uncertainity": "129",
    "IsVoice": "FALSE",
    "IsSignalling": "TRUE",
    "SegmentStartTime": "16/02/2017 09:57:01.555",
    "Imei": "99999605176135",
    "SegmentDuration": "00:00:00.0290000",
    "Mnc": "99",
    "ServingCellLabel": "Cell13",
    "Imsi": "999992216631694",
    "TrackingAreaCode": "1236"
}
{
    "Confidence": "0.01800376",
    "IsData": "FALSE",
    "Latitude": "1.914598",
    "ConnectionId": "330708186825331",
    "Mcc": "999",
    "Sv": "74",
    "Longitude": "1.222736",
    "Uncertainity": "463",
    "IsVoice": "FALSE",
    "IsSignalling": "TRUE",
    "SegmentStartTime": "16/02/2017 09:57:02.689",
    "Imei": "99999007880884",
    "SegmentDuration": "00:00:00.0260000",
    "Mnc": "99",
    "ServingCellLabel": "Cell7",
    "Imsi": "999992226681236",
    "TrackingAreaCode": "1237"
}
{
    "Confidence": "0.2068138",
    "IsData": "FALSE",
    "Latitude": "1.850279",
    "ConnectionId": "330708186825354",
    "Mcc": "999",
    "Sv": "13",
    "Longitude": "1.349263",
    "Uncertainity": "167",
    "IsVoice": "FALSE",
    "IsSignalling": "TRUE",
    "SegmentStartTime": "16/02/2017 09:57:04.351",
    "Imei": "99999002855874",
    "SegmentDuration": "00:00:00.0300000",
    "Mnc": "99",
    "ServingCellLabel": "Cell15",
    "Imsi": "999995430231562",
    "TrackingAreaCode": "1238"
}

If using ConnectionId as key, I want my output like:
{
    "ConnectionId": "189970698469977",
        {
            "Confidence": "0.01428183",
            "Imei": "99999507405260",
            "Imsi": "999992226504812",
            "IsData": "FALSE",
            "IsSignalling": "TRUE",
            "IsVoice": "FALSE",
            "Latitude": "1.848613",
            "Longitude": "1.354355",
            "Mcc": "999",
            "Mnc": "99",
            "SegmentDuration": "00:00:00.0860000",
            "SegmentStartTime": "16/02/2017 09:57:00.053",
            "ServingCellLabel": "Cell14",
            "Sv": "06",
            "TrackingAreaCode": "1256",
            "Uncertainty": 662
        }

A: Try replacing your for loop with the following code:
arr = []

with open (csvFile) as f:
    csvReader = csv.DictReader(f)
    #print(csvReader)
    for csvRow in csvReader:
        arr.append(csvRow)

print(arr)

# write the data to a json file
with open(jsonFile, "w") as jsonFile:
    jsonFile.write(json.dumps(arr, indent = 4))

Please refer to this link as well.

A: The extra field-names-only entry
If you provide fieldnames explicitly, csv will assume that the first row of the .csv file is data. If you leave out the fieldnames parameter, it will assume the first row of the .csv file is a header row with the field names:

The fieldnames parameter is a sequence. If fieldnames is omitted, the values in the first row of file f will be used as the fieldnames.

It looks like your .csv file has a header row but you have also provided fieldnames explicitly so csv has read in the header row as data. To just use the fieldnames in the header row change your call to DictReader to:
csv.DictReader(csvfile)  # notice no fieldnames parameter

Using a certain field as a key
First consider how best to represent this in JSON and what you are trying to gain from indexing by this field, the example you gave isn't quite valid JSON.
{
    "ConnectionId": "189970698469977",
        {
            "Confidence": "0.01428183",
            "Imei": "99999507405260",
            ...
        }

It's not valid because:

*

*We open a {, indicating this is an 'object'

*Objects have keys, and values associated with those keys and nothing else

*We provide a key 'ConnectionID' and a value for it. This is fine

*Then we provide another object but no key, this is invalid.

Assuming you want to be able to quickly look up objects based on the connectionId, how about we create an object in JSON that looks like this:
{
    "189970698469977": {
        "Confidence": "0.01428183",
        "Imei": "99999507405260",
        ...
    },
    "260339442647676": {
        "Confidence": ...
    },
    ...
}

This gives us the kind of satisfying property that the JSON will only be valid if the keys are unique.
To do this, we need to create a dictionary in Python that we will represent in the JSON dump:
We can create Python dictionaries from a sequence of (key, value) tuples. Example from the docs:
>>> dict([('sape', 4139), ('guido', 4127), ('jack', 4098)])
{'sape': 4139, 'guido': 4127, 'jack': 4098}

We will use this constructor to create our indexed dictionary:
dictionaryEntries = [(row['ConnectionId'], row) for row in csvReader]
dictionaryToDump = dict(dictionaryEntries)

Putting it together
Your code now might look like this:
import csv
import json

with open('mycsv.csv') as csvFile:
  csvReader = csv.DictReader(csvFile)
  dictionaryEntries = [(row['ConnectionId'], row) for row in csvReader]

dictionaryToDump = dict(dictionaryEntries)

with open('myjson.json', 'w') as jsonFile:
    jsonFile.write(json.dumps(dictionaryToDump))


text:
Q: Catching Flash URLLoader errors I'm trying to bullet proof a URLLoader and wondering where I need to capture things like 404s and more importantly, mid-session timeouts and connectivity failures.
The app will be run in places where the connectivity is spotty and it is very possible that a connection will initiate correctly, but will die somewhere in the middle.  I'm unable to recreate these scenarios in testing and am hoping someone can point me to a comprehensive list of error handling, so that I can anticipate most of the common network failures and handle them.
TIA.

A: You only need to handle the ioError and securityError events - that will catch all the errors. Timeouts will just eventually produce an ioError.
You might also want to listen to the httpStatus event to get the HTTP code.


text:
Q: Update dynamic number in class name using jquery Using jQuery, I'm trying to find a solution to my issue.
I have this html...

... and a number replaces "NN" dynamically.

*

*The number can be anywhere from 0 to 5 and including decimals, such as 1.2, 3.5, etc.

*Single digit numbers doesn't have ".0" at the end.

What needs to be done though after "NN" gets replaced by a number...

*

*Remove the decimal point if the number has one, for example 1.2 becomes 12.

*If a number is single digit, such as 1 or 4, add a zero at the end, for example 10 or 40.

Thanks in advance for the help!

A: You may use this simple plugin:
(function ($) {
    $.fn.replaceClass = function (pFromClass, pToClass) {
         pToClass = editDecimal(pToClass)  // DECIMAL MANIPULATION
        return this.removeClass(pFromClass).addClass(pToClass);
    };
}(jQuery));

function editDecimal(pToClass){
    var num = pToClass.split("prodReviews")[1]  // will get the NN part
    num = num* 10
    pToClass = "prodReviews"+num
    console.log(pToClass)
    return pToClass

}

Usage:
$('.prodReview').replaceClass('prodReviewsNN','prodReviews2');
$('.prodReview').replaceClass('prodReviewsNN','prodReviews3.2');

Before:

After:

A: Why do you need this? why not store the number in the DOM Element?
anyway...
var num = 2;
document.querySelector('.prodReview').className = 'prodReview prodReviews'+num;

and next time when you need to rewrite the class...
var newNum = 5;

document.querySelector('.prodReview .prodReviews'+oldNum).className = 'prodReview prodReviews'+newNum;

but a better solution would be to store the number in the DOM
var n = 2;
document.querySelector('.prodReview').n = n;

and then get it using :
var needle = 5;

var element = [].slice.call(document.querySelectorAll('.prodReview')).filter(function(e){return e.n == needle})[0]


text:
Q: how to fill AvFrame pixel by pixel i try to encode opengl output to a mp4 file using ffmpeg but when i want to simply fill AvFrame with pixel colors with this code snippet :
for (y = 0; y < c->height; y++) {
for (x = 0; x < c->width; x++) {
    int offset = 3 * (x + y * c->width);

    if (x > 2* c->width / 3 && x <c->width )
    {
        frame->data[0][offset + 0] = 0; // B
        frame->data[0][offset + 1] = 0; // G
        frame->data[0][offset + 2] = 255; // R
    }
    else if(x < 2 * c->width / 3 && x > c->width / 3) {
        frame->data[0][offset + 0] = 0; // B
        frame->data[0][offset + 1] = 255; // G
        frame->data[0][offset + 2] = 0; // R
    }
    else {
        frame->data[0][offset + 0] = 255; // B
        frame->data[0][offset + 1] = 0; // G
        frame->data[0][offset + 2] = 0; // R
    }
}

then i have this video output :

and i had this options for ffmpeg :
codec: libx264rgb
& pix_fmt : AV_PIX_FMT_BGR24
in fact i expect something like this video output :

i'm also new in ffmpeg and i realy dont know advanced stuffs about video encoding ,so anybody knows what is problem?

A: i changed :
ret = av_frame_get_buffer(frame, 32);

to
ret = av_frame_get_buffer(frame, 1);

and it fixed.


text:
Q: Keeping track of the latest releases How do people keep a track of the latest softwares being released? Let me say a distro group like slackware. A distro has ~25K+ packages and about a score of people involved. I hardly think these people keep checking the site of individual developers to see if they have released anything.
Is there a an automatic way? A script? A standardized RSS feed? or a mailing list (parsable mails)?

A: For Debian: Most Debian package sources include a debian/watch file. There is a service (currently not working) which scans these files regularly and informs the corresponding package maintainers if there are new upstream versions.

A: Most software pops up in my Software Center on my desktop. Most Linuxes have such a tool running by default. For HP-UX, Solaris and AIX I usually get en email from supplier or patch at given intervals.

*

*For third party software I subscribe to its RSS feed in an RSS aggregator.

*For third party software without RSS feed I use WebMonX, which is a little desktop program that pops up a notification when a webpage has changed.

*Don't forget to subscribe to third party security vulnerability feeds too. These feeds may flag software updates in an early stage.


text:
Q: How do you iterate row index and find the group with the maximum determinant from the dataset in python? I want to get the 7 index values from my dataset whose group will give me the maximum determinant of |Matrix.T*Matrix| which should be a 6 by 6 matrix.(as my no. of columns is 6).
Dataset:
Serial_no,A,B,C,D,E,F
1,0.379,-0.588,-1.69,-0.0135,0.083,-0.0297
2,-0.144,0.278,0.354,-0.000672,-0.0228,0.014
3,0.295,-0.157,-1.63,-0.00451,0.0778,-0.00969
4,0.371,-0.623,-4.98,-0.000253,0.0872,-0.0109
5,0.369,-3.11,-8.3,-0.0000105,0.0871,-0.0327
6,0.369,-0.899,-7.19,-0.0000177,0.0872,-0.0109
7,0.383,-1.04,-2.76,-0.00418,0.089,-0.033
8,0.369,-1.04,-8.3,-0.00000263,0.0871,-0.0109
9,-0.124,0.421,0.679,0.00246,-0.0216,0.0133
10,0.37,2.15,-17.1,0.000244,0.0871,0.0109
11,0.369,5.61,-14.9,0.0000352,0.0872,0.0327
12,0.369,1.45,-11.6,-0.000000963,0.0872,0.0109
13,0.369,3.53,-9.41,-0.00000186,0.0872,0.0327
14,0.369,6.44,-17.2,0.000513,0.0872,0.0327
15,-0.11,-2.57,4.11,-0.000127,-0.0209,-0.0131
16,-0.11,-2.76,4.43,-0.000606,-0.0211,-0.0132
17,0.37,0.761,-6.09,0.0000571,0.0871,0.0109
18,0.3678,1.45,-3.88,0.00209,0.0865,0.0325
19,0.381,-2.46,-19.4,-0.00274,0.0874,-0.0111
20,0.369,4.36,-11.6,-0.000003,0.0872,0.0327
21,-0.111,-1.74,2.79,0.000000903,-0.0209,-0.0131
22,-0.111,-1.91,3.05,-0.000000953,-0.0209,-0.0131
23,0.368,2.28,-6.09,0.000164,0.0871,0.0327
24,-0.11,-0.913,1.46,-0.0000412,-0.0209,-0.0131
25,-0.111,-1.08,1.73,-0.0000101,-0.0209,-0.0131
26,-0.144,-0.278,0.354,0.000672,-0.0228,-0.014
27,0.344,-0.344,-2.76,-0.00202,0.0877,-0.0107
28,0.369,3.11,-8.3,0.0000105,0.0871,0.0327
29,0.383,1.04,-2.76,0.00418,0.089,0.033
30,-0.124,-0.421,0.679,-0.00246,-0.0216,-0.0133

import pandas as pd
import numpy as np

#importing t dataset with pandas
df=pd.read_csv('Dataset.csv')
df = df.set_index('Serial_no')
X=df.iloc[:,:]

I tried this but not getting the row index values of the matrix
N = 7
def my_det(df,i):
    mat = df.iloc[i:i+N]
    return np.linalg.det(mat.T @ mat)

all_det = [my_det(df,i) for i in range(len(df)-N)]

print(np.argmax(all_det))
# 7

print(np.max(all_det))

dataset:

A: I couldn't resist. Here is a solution using Laplace and Cauchy-Binet formulas. And a brute force one for validation.
Sample run:
 [55.67740601  0.61391687]

This output indicates that on your 30x6 example the brute force and smart solutions gave the same answer and that the brute force took 55.7 seconds while the smart one took 0.6 seconds.
Code:
import numpy as np
import pandas as pd
import itertools as it
import io

def brute_force(A):
    return max(map(list,it.combinations(range(len(A)),7)),
               key=lambda s: np.linalg.det(A[s].T@A[s]))

def smart(A):
    N = len(A)
    # binomial coefficients
    bcs = np.zeros((7,N+1),int)
    # determinants for jxj minors j=1..6
    dets = [A[:,0]]
    bcs[0] = np.arange(N+1)
    # subsets of size j for j=1..7
    combs = [bcs[None,0]]
    for j in range(1,7):
        # extend bcs, combs
        bcs[j] = bcs[j-1].cumsum()
        combs.append(np.zeros((j+1,bcs[j,-j-1]),int))
        combs[-1][0,bcs[j,1:-j-1]] = 1
        combs[-1][0] = combs[-1][0].cumsum()
        for i in range(N-j):
            combs[-1][1:,bcs[j,i]:bcs[j,i+1]] = combs[-2][:,:bcs[j-1,i+1]]
        # use Laplace's formula to compute j+1xj+1 minors
        # the tricky bit is getting the indexing right...
        idxs = np.zeros((j+1,bcs[j,-j-1]),int)
        idxs[1:] = bcs[np.arange(j)[::-1,None],combs[-1][:-1]+1].cumsum(0)
        idxs[-2::-1] += bcs[np.arange(j)[:,None],combs[-1][-1:0:-1]].cumsum(0)
        if j<6:
            dets.append(np.einsum('ji,ji->i',(A[combs[-1]+np.arange(j,-1,-1)[:,None],j])*(-1)**np.arange(j+1)[:,None],dets[-1][idxs]))
        else:
            # use Cauchy-Binet to calculate the M^T M determinants
            d62 = np.square(dets[-1])
            d7 = d62[idxs].sum(0)
            # find index of max, translate back to subset
            return combs[-1][::-1,d7.argmax()]+np.arange(7)

a = """
Serial_no,A,B,C,D,E,F
1,0.379,-0.588,-1.69,-0.0135,0.083,-0.0297
2,-0.144,0.278,0.354,-0.000672,-0.0228,0.014
3,0.295,-0.157,-1.63,-0.00451,0.0778,-0.00969
4,0.371,-0.623,-4.98,-0.000253,0.0872,-0.0109
5,0.369,-3.11,-8.3,-0.0000105,0.0871,-0.0327
6,0.369,-0.899,-7.19,-0.0000177,0.0872,-0.0109
7,0.383,-1.04,-2.76,-0.00418,0.089,-0.033
8,0.369,-1.04,-8.3,-0.00000263,0.0871,-0.0109
9,-0.124,0.421,0.679,0.00246,-0.0216,0.0133
10,0.37,2.15,-17.1,0.000244,0.0871,0.0109
11,0.369,5.61,-14.9,0.0000352,0.0872,0.0327
12,0.369,1.45,-11.6,-0.000000963,0.0872,0.0109
13,0.369,3.53,-9.41,-0.00000186,0.0872,0.0327
14,0.369,6.44,-17.2,0.000513,0.0872,0.0327
15,-0.11,-2.57,4.11,-0.000127,-0.0209,-0.0131
16,-0.11,-2.76,4.43,-0.000606,-0.0211,-0.0132
17,0.37,0.761,-6.09,0.0000571,0.0871,0.0109
18,0.3678,1.45,-3.88,0.00209,0.0865,0.0325
19,0.381,-2.46,-19.4,-0.00274,0.0874,-0.0111
20,0.369,4.36,-11.6,-0.000003,0.0872,0.0327
21,-0.111,-1.74,2.79,0.000000903,-0.0209,-0.0131
22,-0.111,-1.91,3.05,-0.000000953,-0.0209,-0.0131
23,0.368,2.28,-6.09,0.000164,0.0871,0.0327
24,-0.11,-0.913,1.46,-0.0000412,-0.0209,-0.0131
25,-0.111,-1.08,1.73,-0.0000101,-0.0209,-0.0131
26,-0.144,-0.278,0.354,0.000672,-0.0228,-0.014
27,0.344,-0.344,-2.76,-0.00202,0.0877,-0.0107
28,0.369,3.11,-8.3,0.0000105,0.0871,0.0327
29,0.383,1.04,-2.76,0.00418,0.089,0.033
30,-0.124,-0.421,0.679,-0.00246,-0.0216,-0.0133
"""

df = pd.read_csv(io.StringIO(a),index_col=0)

from time import perf_counter as pc
T = []
T.append(pc())
xb = brute_force(df.to_numpy())
T.append(pc())
xs = smart(df.to_numpy())
T.append(pc())

assert (xs==xb).all()
print(np.diff(T))


text:
Q: Block Microservice Instance from registering with Eureka Service Discovery Is there a way via configuration to blacklist specific ip addresses from registering as microservices with Spring Eureka cloud discovery?  It seems that each time I restart my discovery service an unrecognized ip instance is registering as a microservice.  From the attached image I would expect that only a single instance be present rather than the two shown.
Currently the application.yml file is configured as follows:
---
# This default profile is used when running a single instance completely standalone:
#spring:
#  profiles: default
server:
  port: 8010
eureka:
  instance:
    hostname: eurekahost
  client:
    registerWithEureka: false
    fetchRegistry: false
    serviceUrl:
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

security:
  basic:
    enabled: false
  user:
    name: user # login username
    password: password

A: Although this is not my ideal solution since I prefer to do this via configuration, I found that I can de-register the service via Eureka's REST API.


text:
Q: How to limit content by patch in AzerothCore Originally asked by DarkAvernus on Discord
Is there a guide on how to limit content by patch? I'm looking to do progressive content for raids\arena seasons

A: Originally answered by Silker on Discord
Yes, there is a guide: The AzerothCore wiki, take and read:

*

*https://www.azerothcore.org/wiki/database-world - this one will have what you need.

You want to block raid/dungeon/maps/zones/that guy who eats pineapple pizza?

*

*Use: https://www.azerothcore.org/wiki/disables
You probably want to change items from vendors depending on patch like Wintergrasp or Dalaran rings:

*

*Use: https://www.azerothcore.org/wiki/npc_vendor
Want to disable emblem vendors in Dalaran? phase 'em..

*

*Use: https://www.azerothcore.org/wiki/creature#phasemask
Change emblems per boss through woltk content

*

*Use: https://www.azerothcore.org/wiki/creature_loot_template
Changing weekly quests (exp. 'x must die") and dungeon finder rewards?

*

*Here: https://www.azerothcore.org/wiki/quest_template
Arena seasons?

*

*Check the worldserver.conf
It's all about reading and understanding what to change, where and a lot of testing.
Furthermore, you can use editors like Keira3 that will help you generate the necessary SQL code


text:
Q: Linked List error in Insertion Function, Segmentation Fault (core dumped) Compiles fine but when executed I get segmentation fault (core dumped) error. I've tested each function individually and the add function is the only one giving me this error. Add function is supposed to add the value to the head of the linked list. When running the code, values get added to the list correctly and I can display the list, but the error follows shortly after.
 //Homework 11
 //Linked List

 #include <iostream>
 using namespace std;

 //Declaring class and Linked List.
 class NumberList
 {
 private:

   struct ListNode
   {
    double value;
    struct ListNode *next;
   };

   ListNode *head;

 public:

    NumberList()
     { head = NULL;}

    ~NumberList()
     {
      ListNode *nodePtr;
      ListNode *nextNode;
      nodePtr = head;

      while (nodePtr != NULL)
       {
       nextNode = nodePtr->next;
   delete nodePtr;
   nodePtr = nextNode;
     }
   }

 //Function inserting node at the head.
 void add(double x)
 {
 ListNode *newNode;
 ListNode *nodePtr;
 ListNode *previousNode = NULL;

  newNode = new ListNode;
  newNode->value = x;

 if (!head)
  {
  head = newNode;
  newNode -> next = NULL;
 }
 else
 {
  nodePtr = head;
  previousNode = NULL;
  }
  if (previousNode == NULL)
 {
 head = newNode;
 newNode->next = nodePtr;
 }

 }

 //Function to find matching values.
 bool isMember(double x)
 {
 int pos = 0;
 bool flag = false;

 if (head == NULL)
 {
 cout << "List is Empty" << endl;
 return flag;
 }

ListNode *nodePtr;

 nodePtr = head;

while (nodePtr != NULL)
{
pos++;
if (nodePtr->value == x)
{
  flag = true;
  cout << x << " was found at position " << pos << endl;
}
nodePtr = nodePtr->next;
}

 if (!flag)
  {
    cout << x << " not found in the list." << endl;
  }
 return flag;
 }

 //Function to display linked list values.
 void display() const
 {
   ListNode *nodePtr;

 if (head == NULL)
  {
 cout << "List is empty." << endl;
 return;
  }

  nodePtr = head;

   cout << "The list goes: " << endl;

  while (nodePtr != NULL)
  {
  cout << nodePtr->value << endl;
  nodePtr = nodePtr->next;
  }

   cout << "End" << endl;
  }

  //Function to delete a selected value in the list.
  void deletNodeAll(double x1)
  {
  ListNode *nodePtr;
  ListNode *previousNode;

  if (!head)
  return;

  if (head->value == x1)
  {
  nodePtr = head->next;
  delete head;
  head = nodePtr;
  }
  else
  {
  nodePtr = head;

  while ( nodePtr != NULL && nodePtr->value != x1)
  {
   previousNode = nodePtr;
   nodePtr = nodePtr->next;
  }

   if (nodePtr)
  {
    previousNode->next = nodePtr->next;
    delete nodePtr;
  }
  }
 }
 };

 int main()
 {
   NumberList Z;

   Z.add(3);
   Z.add(4);
   Z.add(2);
   Z.add(5);
   Z.add(7);
   Z.add(4);
   Z.add(7);
   Z.add(5);
   Z.add(2);
   Z.display();
   Z.isMember(2);
   Z.deletNodeAll(2);
   Z.display();

 return 0;
 }

A: your add() method causes segmentation fault because for first node you should update the head and head->next and return but you didn't.
if (!head) {
    head = newNode;
    newNode -> next = NULL;
    return ;/* do this else this again check previousNode == NULL also
                        which is not needed 1st time */
}

Also deletNodeAll() deletes only first occurrence of number you are passing, there is a bug in logic,check it yourself.


text:
Q: Turning off automatic outlining in Visual Studio Can any one tell me how to turn off automatic outlining in Visual Studio?  Outlining is the feature that collapses code into programmer defined regions.
In my opinion, there are precious few circumstances where outlining is useful.  Yes, it makes large files easier to navigate, but mostly it obscures complexity.  My preference would be to have this feature turned off by default when opening a source file.

A: In Visual Studio, go to Tools > Options > Text Editor > C# > Advanced
Clear the checkbox Enter outlining mode when files open

A: Tools -> Options -> Text Editor -> C# -> Advanced -> Outlining.

A: For VB it's Tools - Options - Text Editor - Basic - VB Specific - Enable outlining mode

A: For VS2008, it's under Tools – Options – Text Editor – C/C++ - Formatting - Enter outlining mode when files open.

A: For C/C++ in Visual 2017:
Go to Tools > Options > Text Editor > C/C++ > View
Then under > Outlining, set Enable Outlining to False.


text:
Q: Windows 10: will drivers installed using testmode still work then testmode is disabled? I have a general understanding problem with Windows Testmode and how to install unsigned drivers: I understand that if I have drivers (in my case for an USB to RS232 serial adapter) that are not digitally signed by the vendor, I can boot Windows into testmode using for example
bcdedit /set testsigning on

these drivers can be installed, and this actually works in my current case.
However, the thing I am not really sure about is what will happen if I disable testsigning afterwards using
bcdedit /set testsigning off

In theory, as far as I understand, the drivers should stop working. But practically, what I find on my Windows 10 x64 Pro testsystem is that the drivers are still fully functional. Windows also shows the drivers as not digitally signed in device manager, but still uses them, without any warning.
My question simply is: is that the way it is intended to work (i.e. install drivers in testmode, and the functionality will be persistent even if I reboot into normal mode), or am I having some strange side effect here?


text:
Q: Slow compilation for Project Euler 10 I am new to this. I was trying question number ten of the Project Euler Question Bank Archive. My code looks fine to me but it is not efficient. I am not sure, how I can make this quick. My code is as follows.
def isPrimeNum(num):
    for i in range(2, num):
        if num % i == 0:
            return False
    return True

def main():
    listOfPrimes = []
    sum = 0
    upperLim = 2000000

    for i in range(2, upperLim):
        if isPrimeNum(i) == True:
            sum += i
        else:
            continue
main()

A: When you check whether a number is a prime in isPrimeNum function use for i in range(2, int(num ** .5) + 1) instead of your current version of the for-loop. It works because all unique divisors of n are numbers less than or equal to sqrt(n). Check "Primality test" article on wikipedia.
With this modificaton you will get significant acceleration. Results on my machine:
# old version
%timeit main(20_000)
1.36 s ± 2.83 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

# new version
%timeit main(20_000)
26.5 ms ± 79.6 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)


text:
Q: D3 cross tabulation HTML table I'm trying to create a D3 cross tabulation HTML table (there will be more interactive features, this is just the first step) based on JSON data.  I can populate the horizontal table header, but am having trouble with the vertical headers and data fields.
The table should look something like the following:

My code so far (JSFiddle here) is:
var nested = d3.nest()
    .key(function(d) { return d._id.env; })
    .entries(data.result);

console.log(nested);

var table = d3.select("#table")
    .append("table")
    .style("border-collapse", "collapse")
    .style("border", "2px black solid");

var thead = table.append("thead");

thead.append("tr")
    .selectAll("th")
    .data(nested)
  .enter().append("th")
    .text(function(d) { return d.key; });

var tbody = table.append("tbody");

var tr = tbody.selectAll("tr")
    .data(nested.values)            // not sure how to get this
  .enter().append("tr");

tr.selectAll("td")
    .data(function(d) { console.log(d); return d; })
  .enter().append("td")
    .text(function(d, i) { console.log(d[i]); return d; });

The raw data is in the following format:
{
        "result" : [
                {
                        "_id" : {
                                "month" : 5,
                                "day" : 6,
                                "year" : 2014,
                                "env" : "A"
                        },
                        "ruleScore" : 83.25,
                        "jsPerPage" : 12,
                        "cssPerPage" : 4,
                        "imagesPerPage" : 7.75
                },
                {
                        "_id" : {
                                "month" : 5,
                                "day" : 6,
                                "year" : 2014,
                                "env" : "B"
                        },
                        "ruleScore" : 83,
                        "jsPerPage" : 12,
                        "cssPerPage" : 4,
                        "imagesPerPage" : 10
                },
                {
                        "_id" : {
                                "month" : 5,
                                "day" : 6,
                                "year" : 2014,
                                "env" : "C"
                        },
                        "ruleScore" : 83,
                        "jsPerPage" : 12,
                        "cssPerPage" : 5,
                        "imagesPerPage" : 10,
                },
                {
                        "_id" : {
                                "month" : 5,
                                "day" : 6,
                                "year" : 2014,
                                "env" : "D"
                        },
                        "ruleScore" : 83.08333333333333,
                        "jsPerPage" : 12,
                        "cssPerPage" : 6,
                        "imagesPerPage" : 9.25
                }
        ],
        "ok" : 1
}

I'm guessing this is pretty simple, just can't get my head around it - thanks!


text:
Q: str to bytes in Python3.3 How can I get b'\xe3\x81\x82' from '\xe3\x81\x82'?
Finally, I want     u'\u3042', which means Japanese letter 'あ',
b'\xe3\x81\x82'.decode('utf-8') makes  u'\u3042' but
'\xe3\x81\x82'.decode('utf-8') causes the following error
AttributeError: 'str' object has no attribute 'decode'

because b'\xe3\x81\x82' is bytes and '\xe3\x81\x82' is str.
I have DB with data like '\xe3\x81\x82'.

A: If you have bytes disguising as Unicode code points, encode to Latin-1:
'\xe3\x81\x82'.encode('latin1').decode('utf-8')

Latin-1 (ISO-8859-1) maps Unicode codepoints one-on-one to bytes:
>>> '\xe3\x81\x82'.encode('latin1').decode('utf-8')
'あ'


text:
Q: Why VTS fails with inaccurate adb error? I run VTS test suite and my tests fail 100% with this consistent error:
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:1489'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:1922'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:4950'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:1566'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:7793'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:4126'. ret: 1, stdout: , stderr: error: more than one device/emulator
AdbError: Error executing adb cmd 'adb -s 10.1.1.5:5555 reverse tcp:5010 tcp:3753'. ret: 1, stdout: , stderr: error: more than one device/emulator

The message is stderr: error: more than one device/emulator but if I list with adb devices I get only one device
List of devices attached
10.1.1.5:5555   device

same in VTS prompt:
vts-tf > l d
Serial                  State   Allocation  Product         Variant         Build            Battery
10.1.1.5:5555       ONLINE  Allocated   dev_prod    dev_prod    6/22/2018.025   100

My connection with the device under test is not over USB but over Ethernet.
Why adb sees more than one device/emulator since that is not the case ?
Does anyone knows at what serves port 5010 and why is being redirected (reverse) to random ports 1489, 1922, 4950, etc?

A: Seems that it doesn't work on an adb connection over Ethernet and you need an adb connection over USB.
Since the build was on a server I found this workaround to run the vts on the machine that is directly connected via USB to the DUT following these steps:
1) restart DUT
2) kill the old adb and check USB connected
sudo killall -9 adb
adb devices

3) then try to run the vts from the build on the server, by mounting via sshfs:
sudo apt-get install sshfs
mkdir android
sudo groupadd fuse
sudo modprobe fuse
sudo adduser $USER fuse
fusermount -uz ./android
sshfs user@server:/storage/user/android-build/ ./android
cd android
cd ./out/host/linux-x86/vts/android-vts/tools/
pushd `pwd` && cd ./out/host/linux-x86/bin && export PATH=$PATH:$(pwd) && popd
./vts-tradefed


text:
Q: Create a native javafx app with Inno Setup and maven I've a little JavaFX app and I use Maven for managing the dependencies thanks to the javafx-maven-plugin.
This plugin have an option who will build a native installer based on the settings (mvn jfx:build-native) using InnoSetup (on windows)
That's work pretty well but I can't find where I can specify all the Inno Setup options (like those visible here). Did I have to add something on my pom ? Did I have to create a .iss file ? If yes, how to specify the link to this file ?
Any idea ?

A:
Where to put "Inno Setup" file (*.iss)?

When using javafx-maven-plugin you can add inno setup file into:
src/main/deploy/package/windows/project-name.iss

Referencing files in iss
If you need to reference some files in setup file your root will be on:
target/jfx/native/bundles

So for example to pack whole project use:
...
[Files]
Source: "project-name\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
...

That will pack all files from:
target/jfx/native/bundles/project-name/*

Adding application icon
For simple icon you can just put it in:
src/main/deploy/package/windows/project-name.ico

And in iss put this:
...
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
...

And don`t forget to define: MyAppExeName and MyAppName.


text:
Q: How to direct CXF-based build, to auto-generate namespace for xmlbeans derived from XSD having no targetNamespace? I am maintaining a legacy CXF-based system that used to have all XSDs explicitly contain targetNamespace="http://projname.sourceforge.net/topproj/subproj/XSDversion".
That worked well for the maven-based build to auto-generate xmlbeans with properly nested directories based on package name derived from the namespace:

But when I updated the XSDs (dictated by an external source, not in my organization's control), they came without a targetNamespace (everything else is fine, including elementFormDefault="qualified") and so the build environment did not produce a package name and directory hierarchy:

What do I need to change in my project setup to work properly with those new XSDs?
Do I need to "hack" those XSDs to contain a dummy/desired targetNamespace?
Or is there a more correct way of handling this, not relying on a targetNamespace attribute to be present?


text:
Q: complexification of the vector space $\Bbb R^+$ Consider $\Bbb R$ and $\Bbb R^+$ as isomorphic vector spaces, with isomorphism $f(x)=\exp x.$

Is the complexification of $\Bbb R$ isomorphic to the complexification of $\Bbb R^+?$ What is the complexification of $\Bbb R^+?$

I understand that when going from $\Bbb R$ to $\Bbb R^+$ under $f$ we have $a+b:=ab$ and $kb:=b^k.$ Here is a relevant link: vector space.

A: Yes, isomorphic vector spaces have isomorphic complexifications.
If you're asking how to "implement $\mathbf{R}^{+} \otimes \mathbf{C}$" without unwrapping the isomorphism with the usual vector space structure on $\mathbf{R}$, I don't see a way to do this offhand. At first glance it's tempting to think of the complexification as $\mathbf{C}^{\times}$ with complex multiplication as "addition", and exponentiation as "scalar multiplication". The fatal problem is, the complex exponential mapping is not injective (unlike the real exponential mapping), so to make sense of the operations you end up "taking logarithms" (really, passing to the universal cover), i.e., to the usual vector space structure on $\mathbf{C}$.


text:
Q: RuntimeError: Lock objects should only be shared between processes through inheritance I'm getting a ValueError: Lock objects should only be shared between processes through inheritance when writing a xarray.DataArray to_netcdf().
Everything works until writing to disk. But I found a workaround which is to use dask.config.set(scheduler='single-threaded').

*

*Is everyone supposed to use dask.config.set(scheduler='single-threaded') before writing to disk?

*Am I missing something?
I tested two schedulers:
1) from dask.distributed import Client;  client = Client()
2) import dask.multiprocessing; dask.config.set(scheduler=dask.multiprocessing.get)
python=2.7, xarray=0.10.9, traceback:

  File "/home/py_user/miniconda2/envs/v0/lib/python2.7/site-packages/xarray/core/dataarray.py", line 1746, in to_netcdf
    return dataset.to_netcdf(*args, **kwargs)
  File "/home/py_user/miniconda2/envs/v0/lib/python2.7/site-packages/xarray/core/dataset.py", line 1254, in to_netcdf
    compute=compute)
  File "/home/py_user/miniconda2/envs/v0/lib/python2.7/site-packages/xarray/backends/api.py", line 724, in to_netcdf
    unlimited_dims=unlimited_dims, compute=compute)
  File "/home/py_user/miniconda2/envs/v0/lib/python2.7/site-packages/xarray/core/dataset.py", line 1181, in dump_to_store
    store.sync(compute=compute)
...
  File "/home/py_user/miniconda2/envs/v0/lib/python2.7/multiprocessing/synchronize.py", line 95, in __getstate__
    assert_spawning(self)
  File "/home/py_user/miniconda2/envs/v0/lib/python2.7/multiprocessing/forking.py", line 52, in assert_spawning
    ' through inheritance' % type(self).__name__

A: As @jhamman mentioned in the comments.  This may have been fixed in a newer version of Xarray.


text:
Q: Passing 'self' as an argument in a function call? In my gui application (PyQt 5) I have a couple of code pieces appearing repeatedly in different modules. This is an example:
save_file = QFileDialog.getSaveFileName(
                                    self,
                                    "Save",
                                    directory="path/to/filename"
                                )
save_path = save_file[0]

I thought about writing a function for that like this:
def save_file(obj, title, preset):
    save_file = QFileDialog.getSaveFileName(obj, title, preset)
    save_path = save_file[0]
    return save_path

And whenever I need it (in some class) I would call it in this way:
save_file(self, "Save testfile", os.path.join(file_path, file_name))

In this case I would have to pass self as an argument to my function. Is this ok?
I know I can pass an instance of a class as an argument.
But is it a good idea passing self directly when calling the function within a method?
I couldn't find much about that on the internet.

A: That is fine, though the convention is to use the following format:
self.save_file("Save testfile", "path/to/filename")

Though the save_file should probably be within a class and its method definition look like:
def save_file(self, title, preset):
    ...

A: self is typically used to refer to this object. The one in whose method you are currently. You have not given enough context for a complete answer, but you should read up on python classes, and the use of class methods. Here's a tutorial.


text:
Q: Comparing the results of four missing data imputation methods Below are the Bias, MSE and Coverage of four missing data imputation methods at different percentages of missing values. From these we can see that, m4 method gives less bias in all the cases but it gives larger MSE and smaller Coverage than other methods as the percentage of missing values increases.
#for 10% missing values
                 m1         m2         m3         m4
Bias           -0.040     -0.031     -0.034      0.006
MSE             0.028      0.030      0.029      0.035
Coverage        97.000     96.700     96.500     94.400

#for 30% missing values
                 m1         m2        m3           m4
Bias           -0.100    -0.080     -0.085       -0.056
MSE             0.043     0.044      0.043        0.051
Coverage        95.100    95.300     95.000       92.500

#for 50% missing values
                  m1        m2         m3        m4
Bias            -0.18     -0.155     -0.160    -0.144
MSE              0.07      0.070      0.068     0.075
Coverage         92.30     92.500     92.500    85.500

Now i have two questions regarding this

*

*What can we say about the m4 method compared to other methods?

*What inference can we draw from this?(which one is performing better and why?)

Any help will be highly appreciated.


text:
Q: phpMyAdmin unable to connect to MySQL Server I have been using xampp 1.7.4 on a local installation php version is 5.3.5 for several years without any problems.  I develop Joomla! websites offline and then upload to the server.
My phpMyAdmin stopped working, giving this error message:

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

I am a complete dummy with servers and NEVER fiddle with settings I do not fully understand.
Can anyone please advise?

A: Go inside your phpMyAdmin directory inside XAMPP installation folder. There will be a file called config.inc.php. Inside that file, find this line:
$cfg['Servers'][$i]['password'] = ''; you must make sure that this field has your mysql root password (the one that you set).


text:
Q: How to maintain same datatables in different environment (develop, test, production)? As a Developer if i make any changes in my development DB, I have to copy the script and execute it manually on the 2 DBs used for test and production.
Is there some way we can automate it ?
I am using java, mysql and spring mvc.
We are not allowed to make any changes on production DB

A: This is a feature commonly called "database migration"; it's baked into some development frameworks (e.g. Ruby on Rails), but afaik not into Spring MVC.
The easiest thing is to use a tool integrated into your build and deploy scripts - Flyway is popular.
The principle is this: you put your database changes into scripts, with a naming convention which indicates the order in which they are to be executed, and then run those scripts against the environment you're trying to update. Each database knows which was the last migration script to run, so you can pick up where you left off.
For instance:
filename: 201912130980-create-table-users.sql

create table users (
id int not null,
name string not null,
age int not null);

Once you run this, it will create a new table for your users.
filename: 201912130981-add-title-to-users.sql

alter table users add title varchar null;

This adds an extra column to the table.
If you run these two in sequence, they will create your database from scratch. If you have run the "create" script on test, but not yet the "alter" script, next time you run the migrations on test, it will know not to re-run the create script, and pick up with the alter script.
In a comment, you said you're not allowed to execute table changes on production - I assume you mean that it requires some human process (e.g. asking a DBA). In this case, you've got a bit of a problem, because the "migration" process requires maintaining which is the last change that happened to the database, and that's guaranteed by the tooling. Humans tend to make mistakes...Flyway does this via migration history tables.
The best option would be to work with your ops/dba team to see if you can deploy directly to production using Flyway. If that's too hard, you could create a "pre-prod" database and use that as the mirror of production; apply your migrations to that environment, and then send the migrations to the owners of production. You may be able to automate that via Jenkins or whatever you are using.

A: You can achieve this programatically using liquibase
You can refer here liquibase example


text:
Q: Prefixed words in English whose abbreviations skip the prefixes I was writing an article about certain abbreviations in German.  Two of the terms being abbreviated were Verschmelzungsfunktion and Vertauschungsfunktion.  Abbreviating both of them as V would have been ambiguous, and the author chose to abbreviate them as S  and T, respectively, apparently by disregarding the Ver- prefix and going instead to the root forms schmelzen and tauschen.
I started to write "We sometimes do this in English also."  Then I paused to think of an example, but none came to mind. I was surprised; I thought this was not unusual. That was several days ago and I still have not thought of an analogous English example.
To be clear, what I am looking for is:

*

*A set of two or more English words that begin with some common prefix like "un-", "re-", "down-" or similar

*The words should be abbreviated to the initial letters of their roots

*The abbreviations should be short, most preferably single letters

*Preferably, the example should be common and well-known, but even if not:

*It must come with a citation, and not be hypothetical or speculative

Is this something that does happen in English, or am I just mistaken?

A: I will stick my neck out and say:

No, this type of abbreviation does not occur in English, because it reflects a manner of formation of (especially) abstract nouns that is common in German but uncommon in or absent from English.

*

*In this specific example the prefix is the same in both cases, but most important it is — 'ver' — which in this context does not change the meaning of the root — tauschen, exchange and schmelzen, melt. It is an inherent linguistic feature of the formation of this kind of verb and often adds emphasis or extends the verbin some way (see Appendix, below). Regardless, it is therefore quite natural for  a German speaker to ignore this in forming an abbreviation. In English no prefix directly equivalent to this sense of 'ver' exists (again, see Appendix). Prefixes serve to alter or qualify the verb. So in a simple mathematical context we might have opposites, increase and decrease, which could be abbreviated by their first letters and certainly not by removing the prefix.

*Consider possible English nouns with different prefixes beginning with the same letter. Often removing the prefix gives a word of different meaning with an unintuitive initial letter — displacement function and devolution function, to snatch something out of the air. P and V? I think not. We'd go for something different entirely. Greek perhaps. Again the difference relates to the language.
My final remark is perhaps irrelevant to the question, but the only example I can think of using an internal letter for an abbreviation is K in the CYMK colour model: Cyan, Yellow, Magenta and BlacK. Here K rather than B is used for black as B stands for Blue in the alternative RBG — Red, Green, Blue — model.
Appendix: Linguistic Expansion
The prefix 'ver' can have other meanings in German. The Wiktionary entry list three types 1. As in vergeben (to forgive), which is not further explained but is clearly not of the type under discussion, 2. "denotes a transition of the object into a state, which is indicated by the stem". Examples include verlieben (to fall in love), which derives from the simple libeben (to love). This is similar to the instances in the question and is very common, and 3. "indicating a faulty action" as in verzahlen (to miscount) from the root zahlen (to count).
I do not think Germans would abbreviate examples of type 3 to the initial letter of the root, which is very different from the complete word.
The English words with a prefix related to the 'ver' have the prefix 'for' and are all of types 1 or 3, e.g. forgive, forget, forswear. We clearly would not abbreviate them in terms of the root.
The only English prefix that I can think of that serves a similar function to type 2 'ver' is the unrelated 'en-', although here the root can also be a noun or adjective, e.g. enact, encase, encircle,  encrypt. (The English 'en-' may have other meanings in certain words.) It is possible that if there were such things as 'enactment' functions and 'encircling' functions one might abbreviate them as A and C, maintaining a logical connection. I do not know of an examples in practice.


text:
Q: MS 2008 R2 Drops Remote Desktop Sessions in 10 seconds or less every time I'm adding a new 64-bit server to our domain.  Everything seems fine except when accessing the machine using remote desktop, after a few seconds the connection is lost.  The error message is "This computer can't connect to the remote computer."  "Try connecting again. If the problem continues, contact the owner of the remote computer or your network administrator."
A similar result with Telnet on port 3389.  I am able to connect but if I hit a key the connection to host lost.
The event log shows the successful login.  No errors.
Any ideas?

A: Bad NIC.  It provided network connectivity but no RDC.  NIC 2 works fine.


text:
Q: TinyMCE vs Xinha I have to choose an online WYSIWYG editor. I'm pending between TinyMCE and Xinha. My application is developed in Asp.Net 3.5. Could you help me with with some pros and cons?

A: Haven't tried Xihna myself, but I have experience with TinyMCE and FCKeditor. In my company we switched to TinyMce (from FCKeditor) due to the superior support for pasting from word documents and the (relatively easy to work with) plugin architecture which we used to add some custom modules (links browser, simple file browser). TinyMCE also converts the text to xhtml code which is usually better.

A: I'd recommend FCKEditor over TinyMCE. I've had much better luck with it (better markup, better managers, better extensibility, better speed, better compatibility, etc)

A: Try SPAW Editor. File Manager is included. Editor is generated from server side code, meaning it's lighter on client side processing.

A: Of course TinyMCE :)

A: I found Xinha to be much better and more functional than FCKEditor.  If you know PHP and a dab of javascript you can customize the file manager, and there is a lovely set of plugins on offer.  I am also impressed with what I have seen of TinyMCE and due to wider adoption you may find it to have more options.

A: I've never used Xinha, but I can vouch for TinyMCE. It's fast, scales well, and is infinitely customizable. I particularly like the dynamic loading of functionality, which means you only take the performance hit for the stuff you use.
It also includes language-specific compressors to further increase performance (C# is supported, along with PHP, Java and ColdFusion) by GZipping components.

A: Of course TinyMCE it has more plugins to choose from and its easy to make custom plugins.
It only gives issues with ipad(cause of iframes).


text:
Q: Create and view Flash Log I want to create log file for my flex application. That is the file should contain all the trace prints in it when I run my flex application. How can I configure flex to do this? thanks

A: With the debug Flash Player, you can write your trace statements to disk by editing/creating the mm.cfg file.

A: That partly depends on where / how you want the log file to be accessible. If it's only something you / the development team is concerned about - esp in remote debugging scenarios, then a secondary tool which does the above should be sufficient.
However, if this is something that you want to see running in the app as a user, then you need to get a little more creative and try using the Logger class. It differentiates each log event  by priority and has the ability to create an implementation - one of which is the trace logger. However the logger api still needs to be followed, and this means refactoring the actual trace statement itself to point to the logger instance.

A: I suggest that you take a look at: http://www.as3commons.org/as3-commons-logging/index.html
Thats a library very similar to Log4j, I personally implemented a appender for AMF logging.
If you read the user guide http://www.as3commons.org/as3-commons-logging/userguide.html you'll see that it's very easy to log everything (and if you have Flash player 10 you could even log uncatched errors). The only downside is that with the normal flash player (not the debugger version) you can't get the stack trace.
Hope it helps


text:
Q: How can I guess the name of the network interface recently started? I start my USB 3G Modem by:
# wvdial

And then I must do, in order to acquire internet access:
# route add default ppp0

Note that ppp0 is the new virtual interface name.
I would like to automate this:
#!/bin/bash
wvdial
route add default ppp0

But sometimes there is some previous ppp connection established (i.e: VPN), so the correct adapter must have another number (it is created as ppp1, ppp2... etc).
How could I guess/specify the name of the newly created ppp interface?
P.S: I am sure that there should be another more practical method to establish such PPP connection. So I opened this other question.

A: You can force the system to use a specific interface name with option unit.
Just add unit 1 to your pppd-options file (usually /etc/ppp/options).
That works if you always have only one ppp-device.


text:
Q: Filtering out multiple data.frame objects by given threshold simultaneously I have three data.frame objects that needs be to filter out by given threshold value simultaneously. I want to filter them out given threshold value for all data.frame objects. Can anyone give me some possible idea to accomplish this task?
simulated data:
df1 <- data.frame(
  start=seq(1, by=9, len=18), end=seq(6, by=9, len=18),
  ID=letters[seq(1:18)], score=sample(1:25, 18, replace = FALSE))

df2 <- data.frame(
  start=seq(2, by=11, len=20), end=seq(8, by=11, len=20),
  ID=letters[seq(1:20)], score=sample(1:25, 20, replace = FALSE))

df3 <- data.frame(
  start=seq(4, by=11, len=25), end=seq(9, by=11, len=25),
  ID=letters[seq(1:25)], score=sample(1:25, 25, replace = FALSE))

my attempt solution as follows:
filtering out given threshold:
df.li <- list(df1, df2, df3)
keep <- obj$score <= 12

test <- lapply(df.li, function(ele_) {
  keep <- ele_$score <= 12
  discard <- ele_[!keep]
  res <- data.frame(kee=keep,
                    dis=discard)
  return(res)
})

my desired output:
if this approach can happen, I am going to group of filtering output for each data.frame object as list.
I think there might be better way to do this. Regarding the question I raised, what's would be better approach to accomplish this task? Can anyone point me out possible way to solve this issue? Thanks in advance.

A: You could try:
lst <- list(df1, df2, df3)

library(dplyr)
lapply(lst, function(x) { filter(x, score <= 12) })

Or as per mentionned by @akrun, in base R:
lapply(lst, function(x) { subset(x, score <= 12) })


text:
Q: Increase size of poster in a0poster I am designing a poster for OHBM conference (my first poster). I am using a0poster, but it gives posters of fixed width and height.
I want to make a poster of 90 cm width, and 150 cm height. Is there a way to do this in a0poster?

A: Add \setlength{\paperwidth}{90cm} and \setlength{\paperheight}{150cm}. Here you can find the a0poster package.
Size:

MWE:
\documentclass[portrait,a0b,posterdraft]{a0poster}
\usepackage{german,epsf,pstricks}
\setlength{\paperwidth}{90cm}
\setlength{\paperheight}{150cm}
\usepackage{blindtext}
\begin{document}
\Blindtext
\end{document}


text:
Q: What's the meaning of the field strmap in the struct load_info? I'm studying the mechanism of module loading inside the linux kernel, and I'm stuck at the meaning of the field strmap inside the struct load_info.
The struct is defined in kernel/module.c and the field is filled in kernel/module.c. I know it is a bitmap, but I can't figure out the meaning of the individual bits.

A: (I couldn't find anything on LWN. This is a partial analysis of the code. Note that strmap existed as a separate variable before struct load_info was introduced.)
strtab contains a bunch of null-terminated strings concatenated together. E.g. it might contain this, where . stands for a null character:
foo.bar.quux.corge.
0123456789012345678

In layout_symtab, strmap is used to determine which chunks of strtab correspond to core symbols. The loop sets the jth bit of strtab whenever the jth character is part of the name of a core symbol. For example, given the table above, if bar and corge are core symbols then bits 4–7 and 13–18 are set to 1.
In add_kallsyms, the second loop computes the total length of the names of the core symbols, and the third loop copies the core symbols into a new table mod->symtab by copying only the bytes of strtab for which the corresponding bit in strmap is set. In the example above, the new table would contain bar.corge..


text:
Q: Another arraylist to another arraylist of different type public class Game {

    private ArrayList<Player> players;
    private ArrayList<Card> deck;
    private ArrayList<Card> pool;
    **private ArrayList<Capture> capture;**
    private int currentPlayer;
    private int playDirection;
    int index;
    int count = 0;
    int passNo = 0;

    Scanner input = new Scanner(System.in);
    Scanner input2 = new Scanner(System.in);
    Scanner input3 = new Scanner(System.in);

    public Game()
    {
        deck = new ArrayList<Card>();
        pool = new ArrayList<Card>();
        capture = new ArrayList<Capture>();

        for(int c=0; c<4; c++){
            for(int i=0; i<13; i++){
                deck.add(new Card(c,i));
            }
            Collections.shuffle(deck);
        }

    }

     public Player play() {
         Player player = getCurrentPlayer();
         int pass = -1;
         int option =0;
         int count =0;
         boolean play = false;
         boolean check = true;

         capture = new ArrayList<Capture>();

         System.out.println();
         System.out.println(player + ":" + player.getCards());

         do{
             System.out.println("Please select an option: ((1) Capture (2) Discard a card)");
             option = input2.nextInt();

             play=player.isPlayable();

             switch(option)
             {
             case 1:
                 if(play == true){

                     System.out.print("HandCard:" + player.getCards());
                     System.out.print("  Choose a Number from 0 to " + (player.getCards().size()-1)+ "  :   ");
                     int num = input.nextInt();
                     player.getCards().remove(num);
                  //after prompting user for entering the cards they wanted
                  //the following sentence has following error
                     **capture.add(player.getCards().get(num));**
                   //"The method add(Capture) in the type ArrayList<Capture> is
                    //not applicable for the arguments (Card)"
                    System.out.print("How many card you want capture from pool: (Choose 1 number from  1 to " + pool.size()+ ")" + "  :  ");
                    option = input.nextInt();
                    System.out.println("Please choose your card in the pool:");
                    System.out.println("Pool");
                    for(int j=0; j<pool.size(); j++)
                    {
                        System.out.print("(" + j + ")" + pool.get(j) + " ");
                    }

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

                            count = input.nextInt();
                            System.out.print(pool.get(count) + " ");
                            pool.remove(count);
                            //same problem as the above error
                            **capture.add(pool.get(count));**
                    }

                    System.out.print(player.getCards().get(num) + "  is selected");
                    System.out.println();
                    System.out.println("=================================================");
                    check=false;
                 }
                 else
                     System.out.println("Invalid Capture, Please choose either (1) Capture or (2) Discard a Card");
                 break;

             case 2:
                 if(play == true){
                     Card discard = player.cardDiscard();
                     System.out.println(discard + " has been added to pool");
                     pool.add(discard);
                     player.removeCard(discard);
                     check=false;
                 }
                 else
                     System.out.println("Invalid Capture Please choose either (1) Capture or (2) Discard a Card");
                 break;

                 default:
                     System.out.println("Invalid option choose");

             }
         }while(check);

         if(pass==currentPlayer)
         {
             passNo++;
         }
         else{
             passNo = 0;
         }

         if(player.getCards().size() == 0 ){
             int i = 1;
             int [] point = new int[players.size()+1];
             point[0] = 100;
             int lowest = 0;
             System.out.println();

             for(Player p : players){
                 System.out.println(p + ":" + p.getTotalScores() + " points");
                 point[i] = p.getTotalScores();

                 if(point[i] < point[i-1]){
                     lowest = point[i];
                 }
                 i++;
             }
             for(Player p:players){
                 if(p.getTotalScores()==lowest)
                 {
                     player = p;
                 }
             }
             return player;
             }

         goToNextPlayer();
         System.out.println();
         System.out.println("=========================================================================");
         System.out.println("Pool");
         for(int i=0; i<pool.size(); i++)
            System.out.print("(" + i + ")" + pool.get(i) + " ");
            return null;
         }

//Capture Class
         import java.util.ArrayList;
       public abstract class Capture {
              private static ArrayList<Capture> capture;
              private static ArrayList<Card> card;
              boolean result = false;

public Capture()
{
    // leave bank
}

// this part is the functions that hv to implement in pair , run , combo class
public abstract boolean formCapture(ArrayList<Capture> c);
public abstract double getScore();

public abstract void showMessage();}

Sorry for the long post but my problem lies on the parts commented, the errors appear making me unable to add the player hand cards and pool cards into the ArrayList<Capture> Capture list, but this list cannot be removed as it is being used in another class to detect other features used by other subclass. How do I solve the error and add the arraylist capture into a new type array list?
**Edited, Capture class has been added but not complete yet

A: capture.add(player.getCards().get(num));

In this line
player.getCards().get(num)

is returning a Card object reference.
But you decleared the Arraylist as
private ArrayList<Capture> capture;

So
capture.add();

this method can only take a Capture Object reference as parameter or any object reference that may have same parent as Capture. where as you are providing it a Card Object reference And I am assuming it Card does not have the same ancestor or implements from the same interface as Capture. That is why it is giving you that error.

A: Make an Interface let's say CardAndCapture and your Card and Capture class should implement this interface. Now in your code, change this line
capture = new ArrayList();
into
capture = new ArrayList();
Now your code should compile and run. You are making Card and Capture siblings here. So, make sure to properly integrate with CardCapture interface.

A: If Capture has Card as instance variable like this:
 public class Capture{
    private Card card;

    public Capture(Card card){
       this.card = card;
    }
   ...
 }

Usage
 capture.add(new Capture(player.getCards().get(num)));

A: Store object in a common list just if they have common usage. If they have common usage then partition this functionality into an interface and implement this interface by the classes intended to handle in the same manner. Create a generic list with this interface type and do method calls on the interfaces:
public interface ICommonUsage
{
  public void foo();
  public void bar();
}

public class Class1 implements ICommonUsage
{
  //...
  public void foo() {}
  public void bar() {}
  //...
}

public class Class2 implements ICommonUsage
{
  //...
  public void foo() {}
  public void bar() {}
  //...
}

public class Class3
{
  //...
  private List<ICommonUsage> commonUsedObjects;

  public void commonUsage()
  {
    for ( ICommonUsage item : commonUsedObjects )
    {
      item.foo();
      item.bar();
    }
  }
  //...
}

If you want to add an object/interface to a generic list that is not conform with its class (it hasn't the ability to call the methods on it) the compiler log an error message.