text:
Q: Customizing the numbering scheme I'm rather new to TeX and got it working, but letting it look nice is a different can of worms :-)
I'm using llncs and hyperref. My numbering scheme at the moment is the default, like

part: III Experimental...
  sec: 5 Results...
  subsec: 5.1 Features...
  subsub: method foo...

Is it possible to pimp hyperref so \autoref gives instead

part: 3 Experimental...
  sec: 3.5 Results...
  subsec: 3.5.1 Features...
  subsub: 3.5.1.1 method foo...

If it is necessary to move down part to section and define a \subsubsubsection, that wouldn't hurt. If I need a different package, neither.

A: Your question is about the numbering of sectioning headers and not really related to the hyperref package.
Since you're using the llncs document class, all you need to do is provide the following instructions in the preamble:
\renewcommand\thepart{\arabic{part}}
\renewcommand\thesection{\thepart.\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\setcounter{secnumdepth}{3} % to enable showing of subsubsection-level numbers

A full MWE (with optional use of the cross-referencing capabilities of the cleveref package):

\documentclass{llncs}

\renewcommand\thepart{\arabic{part}}
\renewcommand\thesection{\thepart.\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}
\setcounter{secnumdepth}{3}

\usepackage[colorlinks]{hyperref}
\usepackage[noabbrev,nameinlink]{cleveref} % optional

\begin{document}

\setcounter{part}{2}
\part{Experimental \dots}  \label{part:exp}

\setcounter{section}{4}
\section{Results \dots}  \label{sec:results}

\subsection{Features \dots}  \label{sec:features}

\subsubsection{Method foo \dots}  \label{sec:method}
Bla bla bla \dots

\bigskip\hrule\bigskip

\noindent
Crossreferences to \autoref{part:exp} and \autoref{sec:results},
\autoref{sec:features} and \autoref{sec:method}.

\noindent
Crossreferences to \cref{part:exp,sec:results,sec:features,sec:method}.
\end{document}


text:
Q: Why my project fails with ModuleNotFoundError when all directory has __init__.py? First thing is that I'm not a python expert.
I have a project which were run on Mac by PyChart and was working well. Since I moved back to Windows I'd like to run my python project in Windows Linux Subsystem a.k.a. Ubuntu Bash command line. The reason behind are the following:

*

*Ubuntu gives more flexibility to deal with different python versions

*I connect to kerberized Impala where thrift-ssl and other packages are required and they are compiled by install time, on Windows I faced difficulties to install these. Ubuntu works like a charm. Due to this PyCharm on Windows is not an option

*the service I connect to requires kerberos authentication. PyCharm running on Windows can manage spinning up Ubuntu and execute the developed script there, but kerberos (kinit) authentication gives extra complexity and requires me to put my domain password in a script or file. It's a no-go for me.

So, I moved my project to Ubuntu Bash. I created virtualenv, activated it and tried to run my script. It failed with the following error:
(venv) desktop@DESKTOP-ST034M2:/mnt/c/DEV/project$ ./etl/finance/exports/export.py
Traceback (most recent call last):
  File "./etl/finance/exports/export.py", line 5, in <module>
    from util import db_connection
ModuleNotFoundError: No module named 'util'

This is what project looks like:
project/
project/__init__.py

project/etl/
project/etl/__init__.py

project/etl/finance/
project/etl/finance/__init__.py

project/etl/finance/exports
project/etl/finance/exports/__init__.py
project/etl/finance/exports/export.py

project/util
project/util/__init__.py
project/util/db_connection.py

What export.py looks like:
#!/usr/bin/python3
import csv
import datetime

from util import db_connection

c = db_connection.Connect("finance_db")

Having __init__.py in every directory means that - at least for me -, python manages the directories as packages/modules, so I can include python files from different directories. So, my assumption is that if I execute the scripts from the project directory, which is the project root directory, then python should find the files in the directories.
What I'm doing wrong here? What other parameters should I setup and/or check to have the script running?

A: try
PYTHONPATH=. python youstartfile.py

redpajama_set_name: RedPajamaStackExchange


text:
Q: Migration of a Yii PHP Application I need to change my PHP application from one server to another (Goddady to inMotionHosting)
Godaddy:
PHP: 5.3.2
MYSQL: 5.1.63
InMotion:
PHP v5.4.30
MySQL v.5.6.17
I'm Using Yii Framework v1.1.8, and I see the actual is 1.1.15.
Is it a good time to update to actual version??? Is Yii have good backwards compatibility?
I'm using JQuery 1.6.2
Should I update to JQuery 1.11.1 ??? What about v2.1.1???
I understand that updating Yii and JQuery is not necesarry, but I will soon need to update my UI. I basically want to kwow if this how trivial is the operation...
Any help will be appreciated !

A: I know that jQuery 1.9 got rid of things, so for backwards compatability, there is jQuery Migrate https://github.com/jquery/jquery-migrate/
Yii 1.1.8 to 1.1.15 is just bugfixes and enhancements http://static.yiiframework.com/files/CHANGELOG-1.1.15.txt. An update here shouldn't do any harm, but like always.. test first.
Upgrading to Yii v2.x is a bad idea for you right now.  The minimum PHP version is 5.4 and with that, Yii made great use of the updated language features.  However v2 is currently still in Beta and I do not recommend that for any production application exposed to potential hackers.
IMO: don't make changes to the frameworks if you don't have to and eliminate the variable when you play the "what's wrong" game.
Regardless, I hope this info helps.


text:
Q: SSH and send commands in Tkinter? I'm trying to convert code from TCL into python using Tkinter.
I was wondering what would be the equivalent code in Tkinter for
"spawn ssh", "expect", and "send"?
For example, my simple tcl program would be something like:
spawn ssh root@138.120.###.###
expect "(yes/no)?" {send -- "yes\r"}
expect "password" {send -- "thepassword\r"}

A: You could try to use pexpect.
Expect is used to automate other command line tools.
Edit: Of curse you could just try to execute package require Expect through Tkinter, but what benefit would that have over a pure Tcl script? After all you write Tcl code then, wraped in python.
Another Edit: Tkinter is used to get access to Tk (the cool GUI Toolkit :P) from python, and it works by calling Tcl commands somewhere down the line. So, you can convert EVERY tcl programm to python (if you have the right tcl libs installed of course).

A: pxpect has a module called pxssh, that takes a lot of the the work out of manipulating simple ssh sessions. I found that this wasn't sufficient for heavy automation and wrote remote as an add-on to increase error handling.
using pxssh
from pxssh import pxssh
p = pxssh()
p.login('host', 'user', 'password')
p.send('command')

using remote
from remote import remote
r = remote('host', 'user', 'password')
if r.login():
  r.send('command')

I'm not sure about the Tkinter use case, my only assumption is that you are using it to craft a gui and there are many tutorials for it. I've used http://sebsauvage.net/python/gui/ before and it compares both Tkinter and wxPython.


text:
Q: Convert names as vector in R I have more than 100 name-items on my R Script without " " and "," between them. I want to make a vector from them.
AWE XYA Name3 WERFS XYAGD ...... DSFSF

The vector should be
vec <- c("AWE", "XYA" ,"Name3" ,"WERFS" ,"XYAGD" ...... ,"DSFSF")

Instead of manually entering " " and ,. Is there a way to automate this?

A: If you want to do that from Rstudio, you have some solutions here.
You also have a Rstudio addin to put quotation mark around words:
remotes::install_github("hrbrmstr/hrbraddins")

See there or there. After putting quotation marks, you can do a find and replace after selecting the area in the script to transform " into ",

A: Assuming the file in which this is stored is called temp.R, you can use scan to get a character vector. This will also work if you have text (.txt) file.
vec <- scan('temp.R', what = "character", quiet = TRUE)


text:
Q: VueJS not working properly in laravel I have this code in app.js:
require('./bootstrap');

window.Vue = require('vue');
import Buefy from 'buefy';
Vue.use(Buefy);

var app = new Vue({
    el: '#app',
    data: {}
});

in master page I used Yield before closing body tag:
@yield('scripts')

and in a view page I tried to use Vue like this:
@section('scripts')
  <script>
  var app = new Vue({
    el: '#app',
    data: {
      permission: true
    }
  });
  </script>
@endsection

But it gives this error:

ReferenceError: Vue is not defined

I can't figure out what's the problem.

A: Include the following before your script -
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.min.js"></script>


text:
Q: Excel: How to auto-update & append new entries from sub-sheets into a main sheet I have a spreadsheet with 5 tabs/sheets.
The first tab/sheet is a "Master" tab showing all our client entries. It is for viewing only - I never want to touch this tab.
The remaining four tabs/sheets are the same entries, but split by region (ei.. Neverland, Candyland, Wonderland, Park Place, Boardwalk). I want to be able to update the "region" sheets/tabs, so it will auto-update it's same entry in the main sheet - I know how to do this.
The issue is I ALSO want to be able to add new entries into these region tabs, and then have that auto-append the new entry to the main tab. As their are mutliple sheets linked to append, I don't want any sheets to over-write each other when appending either.
I am having trouble figuring out how to do both. I have very little coding experience. Is there a built in way to do this?


text:
Q: Boost::spirit passing semantic actions in inherited attributes I'm trying to pass semantic action in a grammar's inherited argument.
In the very basic example below the grammar parses two numbers and I pass semantic action (in a form of c++ lambda) into it and I'd like this action to be called on parsing of the first number. However it does not called but silently ignored and I'd like to know why is it so and what is the proper way to do such things.
#include <iostream>
#include <boost/spirit/include/qi.hpp>

using namespace std;
using namespace boost;

namespace qi = spirit::qi;
namespace phx = phoenix;

template <typename Iterator, typename Action>
struct two_numbers : qi::grammar<Iterator, void (Action const&)>
{
  two_numbers() : two_numbers::base_type(start)
  {
    using namespace qi;
    start = int_ [ _r1 ] >> ' ' >> int_;
  }
  qi::rule<Iterator, void (Action const&)> start;
};

int main ()
{
  string input { "42 21" };
  auto first=std::begin (input), last=std::end(input);

  static const auto my_action = [] (auto&& p) {
    cout << "the meaning of life is " << p << "\n";
  };

  static const two_numbers <decltype(first), decltype (my_action)> p;

  if (qi::parse (first, last, p(phx::ref(my_action))))
    cout << "parse ok\n";
}

The expected output is:
the meaning of life is 42
parse ok

And the real output is:
parse ok

A: First, immediate, response:

"I'm trying to pass semantic action in a grammar's inherited argument."

instant traumatic shock. You... you... what?!
C++ is not very good for higher order programming, certainly not with static polymorphism based on expression templates. In fact it is, but in my previous answer I already cautioned against UB when storing expression templates in named objects (≅ variables).
That time around it was UB that you spotted. That's lucky, in my opinion.
Recently, I've already encountered another question about similar goals:

*

*Constructing a qi::rule with a function attribute
Pay special attention to the comment thread. I don't think this is a sane path, at least not until Boost Mpl has been done with full C++11 goodness (Boost Hana, perhaps?) and Proto-0x is released.
By then, Spirit X3 is probably mature, and we're just left with the gap of Boost Phoenix. I'm not sure whether that's on anyones agenda.
In short: we'll be stuck in this "halfway" land where we can have nice things, but with some pretty constrained restrictions. We should probably avoid getting carried away and pretending we're suddenly capable of writing Haskell in C++.
Also relevant: There's a proposal (N4221, pdf) for Generalized Lifetime Extension of References in C++. It comes with some good examples of simple applications of say Boost Range adaptors that are silently UB in current C++. E.g. from  §2.3 Universal observation:
std::vector<int> vec;
for (int val : vec | boost::adaptors::reversed
                   | boost::adaptors::uniqued)
{
       // Error: result of (vec | boost::adaptors::reversed) died.
}

Solution
That said, since the inherited argument would be a functor (not a lazy actor), you need to bind it:
    start = int_ [ phx::bind(phx::cref(_r1), qi::_1) ] >> ' ' >> int_;

That does work: Live On Coliru
However, I don't recommend this


text:
Q: Trigger tomcat contentType detection I have an application that run inside tomcat.
In my app i have some static files that i want to serve with the correct content-type.
I've found that the conf/web.xml has lot's of already defined type in there.
But when i check the response of my server i have not content-type defined.
By checking the responses i mean that i look at response header on the dev tools of chrome
The issue is that i need these content-type to be detected and correctly applied in order to use the tomcat ExpiresFilter.
Does any one has a clue on what could be my error?
-edit
i just noticed that when the expires filter is not set, the content type is correctly defined
-edit 2
I just read that 304 response has not content ,so there is no content-type in theses response.
-edit 3
So my problem has nothing to do with ExpiresFilter.
The problem is that 304 response has no body, so no contentType could be defined.
But then the expiresFilter can't do nothing with response header.
And since my resources are in a restricted area , the expirations header are set the epoc.
Is there a way to bypass this ??

A: Use mime mappings to define the content types based on file extensions:
<mime-mapping>
    <extension>abs</extension>
    <mime-type>audio/x-mpeg</mime-type>
</mime-mapping>

References

*

*StandardContext (Apache Tomcat 7.0.78 API Documentation)


text:
Q: Making code run continuously I'm trying to make an app that does certain tasks according to a certain battery level (say a notification when battery level reaches 10%).
The problem is when i launch it the app just checks the event once instead of continuous monitoring.
e.g. (say i launched the app when battery was 11%. Since the notification is scheduled at 10% it wont give any notification. It just check the event a single time instead of continuously monitoring  i.e. when battery drains to 10% while running the app,nothing happens)
What is the possible solution to make the code run continuously ?

A: Try using the Alarm Manager Class: developer.android.com/training/scheduling/alarms.html.
If you pass in your battery check as the pending intent, the trigger time which is when you first want to check (In your case probably the interval time after the current time) and then an interval time (Too often can slow things down a lot, so try to find a time that suits your application, e.g. every few minutes.)
This should then fire on each interval which you could use to trigger your battery check and further functionality.


text:
Q: How to get the file from another folder in project by calling method from JUnit? @WebService(name = "ManageSearchDataPortType", targetNamespace = "https://abc/searchData", serviceName = "ManageSearchData", portName = "ManageSearchDataPort", wsdlLocation = "/WEB-INF/wsdl/ManageSearchData.wsdl")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
import com.xyz.SearchDataRequest;
import com.xyz.SearchDataResponse;

@XmlSeeAlso({ ObjectFactory.class, com.abc.ObjectFactory.class, com.abc..ObjectFactory.class, com.abc..ObjectFactory.class })
public class ManageSearchDataService {

    @WebResult(name = "searchDataResponse", partName = "searchDataResponse", targetNamespace = "https://abc/searchData")
    @WebMethod(action = "http://example.com/wsdl/ManageABC/2008/10/22#searchData")
    public SearchDataResponse searchData(@WebParam(name = "searchDataRequest", partName = "searchDataRequest", targetNamespace = "https://abc/searchData")
        SearchDataRequest searchDataRequest) {
        ClassLoader loader = ManagePriceLinePortTypeImpl.class.getClassLoader();
        java.io.InputStream stream = loader.getResourceAsStream("logHandling.properties"); // stream as null
        LoggingFramework.initialise(stream);
        SearchDataResponse response =new SearchDataResponse();
        response.setErrorCode("OK");
        return response;
    }

     public void test();
     {
     System.out.println("TEST  Method");
     }
    }

In above code snippet i was trying to read property file from outside the src location but i am getting file not found exception because of null stream.
HeaderClass is just normal call which contains getMPLNHeader static method.
Please anyone have any idea how to do this let me know.

package com.test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import com.xyz.SearchDataRequest;
import com.aaa.ManageSearchDataService;

@RunWith(MockitoJUnitRunner.class)
public class JunitTestClass {
    ManageSearchDataService mockObj ;

    @Test
    public void doSomething() {
        SearchDataRequest searchDataRequest= new SearchDataRequest();
        searchDataRequest.setStandardHeader(HeaderClass.getMPLNHeader("ASV"));
        SearchDataResponse respose =mockObj.searchData(searchDataRequest);
        System.out.println("=== "+respose.getErrorCode());

    }

    }


text:
Q: "TokenStream contract violation: close() call missing" when calling addDocument I'm using Lucene's features to build a simple way to match similar words within a text.
My idea is to have have an Analyzer running on my text to provide a TokenStream, and for each token I run a FuzzyQuery to see if I have a match in my index. If not I just index a new Document containing just the new unique word.
Here's what I'm getting tho:
Exception in thread "main" java.lang.IllegalStateException: TokenStream contract violation: close() call missing
    at org.apache.lucene.analysis.Tokenizer.setReader(Tokenizer.java:90)
    at org.apache.lucene.analysis.Analyzer$TokenStreamComponents.setReader(Analyzer.java:411)
    at org.apache.lucene.analysis.standard.StandardAnalyzer$1.setReader(StandardAnalyzer.java:111)
    at org.apache.lucene.analysis.Analyzer.tokenStream(Analyzer.java:165)
    at org.apache.lucene.document.Field.tokenStream(Field.java:568)
    at org.apache.lucene.index.DefaultIndexingChain$PerField.invert(DefaultIndexingChain.java:708)
    at org.apache.lucene.index.DefaultIndexingChain.processField(DefaultIndexingChain.java:417)
    at org.apache.lucene.index.DefaultIndexingChain.processDocument(DefaultIndexingChain.java:373)
    at org.apache.lucene.index.DocumentsWriterPerThread.updateDocument(DocumentsWriterPerThread.java:231)
    at org.apache.lucene.index.DocumentsWriter.updateDocument(DocumentsWriter.java:478)
    at org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1562)
    at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1307)
    at org.myPackage.MyClass.addToIndex(MyClass.java:58)

Relevant code here:
// Setup tokenStream based on StandardAnalyzer
TokenStream tokenStream = analyzer.tokenStream(TEXT_FIELD_NAME, new StringReader(input));
tokenStream = new StopFilter(tokenStream, EnglishAnalyzer.getDefaultStopSet());
tokenStream = new ShingleFilter(tokenStream, 3);
tokenStream.addAttribute(CharTermAttribute.class);
tokenStream.reset();
...
// Iterate and process each token from the stream
while (tokenStream.incrementToken()) {
    CharTermAttribute charTerm = tokenStream.getAttribute(CharTermAttribute.class);
    processWord(charTerm.toString());
}
...
// Processing a word means looking for a similar one inside the index and, if not found, adding this one to the index
void processWord(String word) {
    ...
    if (DirectoryReader.indexExists(index)) {
        reader = DirectoryReader.open(index);
        IndexSearcher searcher = new IndexSearcher(reader);
        TopDocs searchResults = searcher.search(query, 1);
        if (searchResults.totalHits > 0) {
            Document foundDocument = searcher.doc(searchResults.scoreDocs[0].doc);
            super.processWord(foundDocument.get(TEXT_FIELD_NAME));
        } else {
            addToIndex(word);
        }
    } else {
        addToIndex(word);
    }
    ...
}
...
// Create a new Document to index the provided word
void addWordToIndex(String word) throws IOException {
    Document newDocument = new Document();
    newDocument.add(new TextField(TEXT_FIELD_NAME, new StringReader(word)));
    indexWriter.addDocument(newDocument);
    indexWriter.commit();
}

The exception seems to tell that I should close the TokenStream before adding things to the index, but this doesn't really make sense to me because how are index and TokenStream related? I mean, index just receives a Document containing a String, having the String coming from a TokenStream should be irrelevant.
Any hint on how to solve this?

A: The problem is in your reuse of the same analyzer that the IndexWriter is trying to use.  You have a TokenStream open from that analyzer, and then you try to index a document.  That document needs to be analyzed, but the analyzer finds it's old TokenStream is still open, and throws an exception.
To fix it, you could create a new, separate analyzer for processing and testing the string, instead of using the one that IndexWriter is using.


text:
Q: how to draw a spiral using opengl I want to know how to draw a spiral.
I wrote this code:
void RenderScene(void)
{
    glClear(GL_COLOR_BUFFER_BIT);
    GLfloat x,y,z = -50,angle;
    glBegin(GL_POINTS);

    for(angle = 0; angle < 360; angle += 1)
    {
        x = 50 * cos(angle);
        y = 50 * sin(angle);
        glVertex3f(x,y,z);
        z+=1;
    }
    glEnd();
    glutSwapBuffers();
}

If I don't include the z terms I get a perfect circle but when I include z, then I get 3 dots that's it. What might have happened?
I set the viewport using glviewport(0,0,w,h)
To include z should i do anything to set viewport in z direction?

A: You see points because you are drawing points with glBegin(GL_POINTS).
Try replacing it by glBegin(GL_LINE_STRIP).
NOTE: when you saw the circle you also drew only points, but drawn close enough to appear as a connected circle.
Also, you may have not setup the depth buffer to accept values in the range z = [-50, 310] that you use. These arguments should be provided as zNear and zFar clipping planes in your gluPerspective, glOrtho() or glFrustum() call.
NOTE: this would explain why with z value you only see a few points: the other points are clipped because they are outside the z-buffer range.
UPDATE AFTER YOU HAVE SHOWN YOUR CODE:
glOrtho(-100*aspectratio,100*aspectratio,-100,100,1,-1); would only allow z-values in the [-1, 1] range, which is why only the three points with z = -1, z = 0 and z = 1 will be drawn (thus 3 points).
Finally, you're probably viewing the spiral from the top, looking directly in the direction of the rotation axis. If you are not using a perspective projection (but an isometric one), the spiral will still show up as a circle. You might want to change your view with gluLookAt().
EXAMPLE OF SETTING UP PERSPECTIVE
The following code is taken from the excellent OpenGL tutorials by NeHe:
glViewport(0, 0, width, height);
glMatrixMode(GL_PROJECTION);                        // Select The Projection Matrix
glLoadIdentity();                           // Reset The Projection Matrix

// Calculate The Aspect Ratio Of The Window
gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);

glMatrixMode(GL_MODELVIEW);                     // Select The Modelview Matrix
glLoadIdentity();                           // Reset The Modelview Matrix

Then, in your draw loop would look something like this:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);     // Clear The Screen And The Depth Buffer
glLoadIdentity();
glTranslatef(-1.5f,0.0f,-6.0f);                 // Move Left 1.5 Units And Into The Screen 6.0
glBegin(GL_TRIANGLES);                      // Drawing Using Triangles
    glVertex3f( 0.0f, 1.0f, 0.0f);              // Top
    glVertex3f(-1.0f,-1.0f, 0.0f);              // Bottom Left
    glVertex3f( 1.0f,-1.0f, 0.0f);              // Bottom Right
glEnd();

Of course, you should alter this example code your needs.

A: catchmeifyoutry provides a perfectly capable method, but will not draw a spatially accurate 3D spiral, as any render call using a GL_LINE primitive type will rasterize to fixed pixel width. This means that as you change your perspective / view, the lines will not change width. In order to accomplish this, use a geometry shader in combination with GL_LINE_STRIP_ADJACENCY to create 3D geometry that can be rasterized like any other 3D geometry. (This does require that you use the post fixed-function pipeline however)
I recommended you to try catchmeifyoutry's method first as it will be much simpler. If you are not satisfied, try the method I described. You can use the following post as guidance:
http://prideout.net/blog/?tag=opengl-tron

A: Here is my Spiral function in C. The points are saved into a list which can be easily drawn by OpenGL (e.g. connect adjacent points in list with GL_LINES).

*

*cx,cy ... spiral centre x and y coordinates

*r ... max spiral radius

*num_segments ... number of segments the spiral will have
SOME_LIST* UniformSpiralPoints(float cx, float cy, float r, int num_segments)
{
SOME_LIST *sl = newSomeList();
int i;

for(i = 0; i < num_segments; i++)
{
float theta = 2.0f * 3.1415926f * i / num_segments; //the current angle

float x = (r/num_segments)*i * cosf(theta); //the x component
float y = (r/num_segments)*i * sinf(theta); //the y component

//add (x + cx, y + cy) to list sl

}
return sl;
}

An example image with r = 1, num_segments = 1024:

P.S. There is difference in using cos(double) and cosf(float).
     You use a float variable for a double function cos.


text:
Q: Does anyone know how to access MRP Detail Inquiry results from a generic inquiry in Acumatica? I'm trying to find the MRP detail (or equivalent) table for a generic inquiry in Acumatica.  The element properties indicated on the Detail Inquiry page are Data Class: AMRPPlan and Business Logic: MRPDetail.  I can't find anything like these in the list of tables under Generic Inquiry.

A: In table name column add the namespace and class name: JAMS.MRP.AMRPPlan


text:
Q: When analyzing a binary compiled from Swift, is it possible to figure out the Swift method name for a function that has no symbol? I'm new to disassembling and reverse engineering binaries, so forgive me if this question is nonsensical or impossible.
In the past when I've tried reverse engineering macOS binaries, analyzing the ones written in Objective-C yielded a lot of useful information, because generally all of the Objective-C classes and their method names were easily retrievable, making it a lot easier to figure out what any particular method did.
I'm trying to analyze a binary written in Swift (technically a combination of Swift and Objective-C), and most of the functions now have no symbol. There are some Objective-C methods that I can retrieve as usual, and a few functions that have a Swift-style mangled name, but nearly all of the rest have no symbol. I know a lot of those have to be Swift methods.
Is there anyway to figure out what this binary's Swift classes are and their associated methods like I can with Objective-C?
Using a tool like Hopper Disassembler reveals the mangled names of some Swift classes (usually a symbol like _TtC4Something25SomethingElse) and I can get a list of its instance variable names and their offsets, but no method names.
Note: the binary in question is an x64 macOS binary, not an iOS binary.

A: Usually reverse engineeing is the process of extracting meaningful constructs and descriptions from assembly. What you've done so far is usually only the first part of a "normal" reverse engineeing task.
This may sometimes be a tedious process, which involves mapping structures and understanding the meaning of functions directly from thier assembly code.
There are pleanty of reverse engineeing tutorials and other sources, and a good understanding of the relevant assembly language is required.
I really recommand this book (it's legally available online, original version is chm released by author) and this cannot easily be covered in a single SO question.
You might also want to get more specific help in the reverse engineeing SE beta.
I hope I pointed you in the right direction.


text:
Q: refer to either path I have a string, which refers to Team Foundation and is being used in a few functions. However, I would like it to check whether that file (TF.exe) is located on Enterprise (const TF: &'static str = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/TF.exe";) or Professional (.../2019/Professional/...). I've read about solution here, however, it is not the best one. Any ideas? Thanks in advance.

A: You can use std::path::Path::starts_with like so:
use std::path::Path;

const TF: &'static str = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/TeamFoundation/Team Explorer/TF.exe";

const ENTERPRISE: &'static str = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise";
const PROFESSIONAL: &'static str = "C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional";

fn main() {
    let path = Path::new(TF);
    if path.starts_with(ENTERPRISE) {
        println!("{}", "enterprise")
    } else if path.starts_with(PROFESSIONAL) {
        println!("{}", "professional")
    }
}

A: If the string is not user-writable, you could use
let professional = str.contains("es");

,or any other string or substring that would only be found in the human readable word Enterprise or Professional, and nowhere else in the location, which would save a lot of memory since a lot of big strings for the starts_with checks could be ignored, but @Ekrim Dinçel 's answer is probably best in most circumstances


text:
Q: Using Freddy to deserialize a list of strings I'm experimenting with Freddy in Swift:
https://github.com/bignerdranch/Freddy
And am trying to deserialize a list of strings.  My Json looks something like this:
{
    "types": ["A", "B", "C"],
}

Here's the swift code:
import Freddy

struct Config {
    let types: [JSON]
}
extension Config: JSONDecodable {
    public init(json: JSON) throws {
        types = try json.getArray(at: "types")
    }
}

This all seems to load correctly, but I'm not able to get the list of strings as an actual array of strings - they are an array of type JSON.  What do I do from here to map these into strings?

A: Indeed, Freddy objects are of type JSON - it works a bit like with SwiftyJSON.
Freddy has a getter named decodedArray() that will do what you need.
Example:
struct Config {
    let types: [String]
}

extension Config: JSONDecodable {
    public init(json: JSON) throws {
        types = try json.decodedArray(at: "types", type: String.self)
    }
}

// instances
let json = try! JSON(data: data)
let c = try! Config(json: json)

//tests
print(c.types)
print(type(of: c.types))

Prints:
["A", "B", "C"]
Array<String>

If you prefer keeping your "types" an array of JSON instead of an array of String, then use your original code and extract the strings with Freddy's getString() getter and flatMap:
// here .types is [JSON]
let strings = c.types.flatMap { try? $0.getString() }


text:
Q: What are the suggested practices for function polymorphism in R? Suppose I want to write a function in R which is a function of a couple of sufficient statistics on some data. For example, suppose the function, call it foo.func depends only on the sample mean of a sample of data. For convenience, I think users might like to pass to  foo.func the sample of random variables (in which case foo.func computes the sample mean),  or the sample mean itself, which is all that foo.func needs. For reasons of efficiency, the latter is preferred if there are multiple functions like foo.func being called which can take the sample mean. In that case the mean need only be computed once (in the real problem I have, the sample statistics in question might be computationally intensive).
In summary, I would like to write foo.func to be accessible to the beginner (pass in the data, let the function compute the sufficient statistics) as well as the expert (precompute the sufficient statistics for efficiency and pass them in). What are the recommended practices for this? Do I have a logical flag passed in? Multiple arguments? Some ways to do it might be:
#optional arguments
foo.func <- function(xdata, suff.stats=NULL) {
  if (is.null(suff.stats)) {
    suff.stats <- compute.suff.stats(x)
  }
  #now operate on suff.stats
}

or
#flag input
foo.func <- function(data.or.stat, gave.data=TRUE) {
  if (gave.data) {
    data.or.stat <- compute.suff.stats(data.or.stat)
  }
  #now operate on data.or.stat
}

I am leaning towards the former, I think

A: You can also embed functions into the arguments, as:
foo.func <- function(x, suff.stats = foo.func.suff.stat(x)){
  # your code here
}

As an example:
foo.func <- function(x, avg = mean(x)){
  return(avg)
}

foo.func(1:20)
foo.func(avg = 42)

Alternatively, you can either use a default setting of NULL for various arguments, and test for is.null(argument), or simply check the value of missing(argument) for each for each argument you might calculate.

Update 1: I erred in suggesting use of a default value of NA: it is far more appropriate to use NULL.  Using NA and is.na() will behave oddly for vector inputs, whereas NULL is just a single object - one cannot create a vector of NULL values, so is.null(argument) behaves as expected.  Apologies for the forgetfulness.

A: The R way of implementing polymorphism is through a CLOS (Common Lisp's OO) model where methods are associated with generic functions (verbs) rather than classes (nouns). For instance,
# suprising that there is not an equivalent function in R
# to propagate inheritance...
addclass <- function(x,classname) structure(x,class=append(class(x),classname))

# this should be your main function that does stuff
# here, the identity function is assigned for example
dostuff <- identity

# define generic function and methods
foo <- function(x,...) UseMethod("foo")
foo.raw <- function(x,...) dostuff(mean(x))
foo.stats <- function(x,...) dostuff(x)

# define two types of inputs
x <- 1:10
x <- addclass(x,"raw")

y <- 5
y <- addclass(y,"stats")

# apply
foo(x)
# [1] 5.5
foo(y)
# [1] 5
# attr(,"class")
# [1] "numeric" "stats"

The example was using R's S3 OOP model, which I think are quite sufficient; S4 is more modern and safe but adds a lot of boilerplate.


text:
Q: Getting a null pointer exception I was trying to fix a null pointer exception here
if(com.Employee__c != null && (mapEmployees.containskey(com.Employee__c) == null || (mapEmployees.containskey(com.Employee__c) != null && mapEmployees.get(com.Employee__c).Employee_End_Date__c > com.Revenue_Contract_Start_Date__c)))

as mapEmployees.get(com.Employee__c).Employee_End_Date__c
was null here so replaced this block with
if(com.Employee__c != null && (mapEmployees.containskey(com.Employee__c) == null ||
                            (mapEmployees.containskey(com.Employee__c) != null && ((mapEmployees.get(com.Employee__c).Employee_End_Date__c == null) || (
                                mapEmployees.get(com.Employee__c).Employee_End_Date__c!=null && mapEmployees.get(com.Employee__c).Employee_End_Date__c > com.Revenue_Contract_Start_Date__c)))))

But I am still getting the Null Pointer exception at this line (mapEmployees.get(com.Employee__c).Employee_End_Date__c == null)

A: Map.containsKey always returns a true or false value, but never a null value. As such:

mapEmployees.containskey(com.Employee__c) == null

(true or false) == null

((always false!))

And

mapEmployees.containskey(com.Employee__c) != null

(true or false) != null

((always true!))

And therefore will keep on going through the shortcut AND operator. True or false will never be null, so the first will never pass, and the latter will never fail.
This means that:

mapEmployees.get(com.Employee__c).Employee_End_Date__c

will throw a NullPointerException if mapEmployees.containskey(com.Employee__c) returned false (because the == null will change this to true, and the code keeps going when it shouldn't).
By the way, this really over-the-top logic checking, you usually only care of the value itself was null. The following should suffice:
User employee = mapEmployees.get(com.Employee__c);
if(employee != null && (
    employee.Employee_End_Date__c == null ||
    employee.Revenue_Contract_Start_Date__c == null ||
    employee.Employee_End_Date__c > employee.Revenue_Contract_Start_Date__c)) {

I'm not entirely sure your logic is correct, so this is my best attempt at trying to decipher what you're trying to do, but you can see that simply extracting the map value to a temporary variable has drastically reduced the complexity of your code and makes it easier to understand. This code is also 100% NullPointerException-proof as written.


text:
Q: Similar tool like pulse picker to decrease rep. freq. of pulsed laser? Now the laser I'm using is with 100MHz repetition frequency. For some measurement, I need to decrease to 20MHz (or 40MHz, 60MHz, between 10MHz to 60MHz is good). Apart from pulse picker, is there any other technique to realize?
Cheers,

A: Without knowing more about how much access you have to the actual laser, what type of laser you're using, or what type of measurement you're doing, it's difficult to suggest alternative solutions to pulse pickers, but there are several options to change the repetition rate of a pulsed laser (also depending on the technology used for pulsing, but based on your repetition rate of 100MHz I'm guessing you have either a solid-state mode-locked laser or a gain-switched semiconductor laser):

*

*The cavity length dictates the repetition rate of mode-locked lasers. So if you have access to the cavity you could adjust the repetition rate that way, although the reasonably achievable range of repetition rates will be far below the kind of range you're looking for.

*If you have a gain-switched semiconductor laser, it might be possible to change the repetition rate via your laser drive current, but this will depend on the model of your laser and your laser driver (current source). Maybe the user manual or the manufacturer will have further information on your options there.

*If you don't want to use a pulse picker, maybe you can change the rep rate of your measurement, e.g. via the acquisition rate of your detector?


text:
Q: Breaking the strict-aliasing rule in the simplest assignment After reading the Understanding Strict Aliasing article https://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html I see, how breaking the strict-aliasing rules can cause unexpected results in optimized build. For example:
void test(int* ptr1, float* ptr2);

Since ptr1 and ptr2 are incompatible, compiler assumes that they will never point to the same memory. This allows to optimize the code, which can give unexpected results, if pointers have the same value.
However, in legacy code strict-aliasing rule is mostly broken in simple assignments, like int n = 0; float f = *((float*)&n); Consider the following code:
#include <iostream>

static_assert (sizeof(float) == sizeof(int), "error");

int main(int argc, char *argv[])
{
    float f1, f2;
    int n = static_cast<int>(argv[1][0] - '0'); // Command argument is "0", so n = 0

    memcpy(&f1, &n, sizeof(f1));                // strict-aliasing rule is not broken
    f2 = *(reinterpret_cast<float*>(&n));       // strict-aliasing rule is broken

    std::cout << f1 << " " << f2 << std::endl;  // prints 0 0
    return 0;
}

I wonder, how it is even possible for C++ compiler to produce an optimized code, which can give different f1 and f2 values, this means, give unexpected result for the code that breaks strict-aliasing rule.
I investigated Assembly code produced by VC++ 2015 compuler in Debug and Release builds (for simplicity, in 32 bit code). In both cases, f2 assignment is converted to 2 movss instructions, like this:
movss       xmm0,dword ptr [n]
movss       dword ptr [esp+4],xmm0

So, I understand if modern C++ compiler will give an error or warning on the offending line. But if compilation is successful, what optimized Assembly code can give an unexpected result?
Notes:

*

*This code intentionally breaks the strict-aliasing rule.

*I know that this is UB.

*I don't ask what is the strict-aliasing rule, I want to know, how breaking the rule can cause UB in this specific case.

A: Once you have UB, anything can happen.
Compiler is allowed to do anything in your program.
Some compilers "remove" UB branch when UB is detected, so your program might display nothing for example. That's why reasoning on UB is useless.


text:
Q: Select TailNumber with MaxAirTime by UniqueCarrier I have a similar problem with my own dataset and decided to practice on an example dataset. I'm trying to select the TailNumbers associated with the Max Air Time by Carrier.
Here's my solution thus far:
library(hflights)

hflights %>%
  group_by(UniqueCarrier, TailNum) %>%
  summarise(maxAT = max(AirTime)) %>%
  arrange(desc(maxAT))

This provides three columns to which I can eyeball the max Air Time values and then filter them down using filter() statements. However, I feel like there's a more elegant way to do so.

A: You can use which.max to find out the row with the maximum AirTime and then slice the rows:
hflights %>%
    select(UniqueCarrier, TailNum, AirTime) %>%
    group_by(UniqueCarrier) %>%
    slice(which.max(AirTime))

# A tibble: 15 x 3
# Groups:   UniqueCarrier [15]
#   UniqueCarrier TailNum AirTime
#           <chr>   <chr>   <int>
# 1            AA  N3FNAA     161
# 2            AS  N626AS     315
# 3            B6  N283JB     258
# 4            CO  N77066     549
# 5            DL  N358NB     188
# 6            EV  N716EV     173
# 7            F9  N905FR     190
# 8            FL  N176AT     186
# 9            MQ  N526MQ     220
#10            OO  N744SK     225
#11            UA  N457UA     276
#12            US  N950UW     212
#13            WN  N256WN     288
#14            XE  N11199     204
#15            YV  N907FJ     150


text:
Q: Positioning of images/graphics in tables I need to create a table where cells in one columns are images, not text.
This is the code I'm using:
\begin{table}[hbtp]
\centering
\begin{tabu} to \textwidth {|c|c|c|c|}
    \hline
    \textbf{Motif}                                                                                & \textbf{\textit{P}-value} & \textbf{Rank} & \textbf{Match} \\ \hline
    \includegraphics[width=0.4\linewidth,height=\textheight,keepaspectratio]{../Img/05Core/Motif1} & 1E-27                     & 1             & TF1                    \\ \hline
    \includegraphics[width=0.4\linewidth,height=\textheight,keepaspectratio]{../Img/05Core/Motif2} & 1E-25                     & 2             & TF2                    \\ \hline
    \includegraphics[width=0.4\linewidth,height=\textheight,keepaspectratio]{../Img/05Core/Motif3} & 1E-23                     & 3             & TF3                    \\ \hline
\end{tabu}
\caption{Significantly enriched motifs retrieved.}
\label{tab:Motifs}
\end{table}

Now, the images I'm using are cropped PDF files so I would need to have some white margin around them inside each cell.
It turns out the code above automatically creates some padding left, right and below the picture, but the boundary at the top of it is overlapping with the upper limit of the cell, like so:

How do I center the picture in the cell so that it has the same margin from the top and the bottom of the cell?
Also, how do I align the text in the other cells to the middle of the cell?

A: Try something like this:
\documentclass{article}

\usepackage[demo]{graphicx} % the option demo is used for the example, remove it
\usepackage{tabu}

\begin{document}
\begin{table}[hbtp]
\centering
\tabulinesep=\tabcolsep
\begin{tabu} to \textwidth {|X[4,c,m]|X[1,c,m]|X[0.75,c,m]|X[1.25,c,m]|}
    \hline
    \textbf{Motif}                                                           & \textbf{\textit{P}-value} & \textbf{Rank} & \textbf{Match} \\ \hline
    \includegraphics[width=\linewidth,keepaspectratio]{../Img/05Core/Motif1} & 1E-27                     & 1             & TF1            \\ \hline
    \includegraphics[width=\linewidth,keepaspectratio]{../Img/05Core/Motif2} & 1E-25                     & 2             & TF2            \\ \hline
    \includegraphics[width=\linewidth,keepaspectratio]{../Img/05Core/Motif3} & 1E-23                     & 3             & TF3            \\ \hline
\end{tabu}
\caption{Significantly enriched motifs retrieved.}
\label{tab:Motifs}
\end{table}
\end{document}

Output:

The vertical space in cells is set through \tabulinesep (in this case to be the same as \tabcolsep, the space for columns separation).
If you need more room, you can add some issuing
\addtolength{\tabcolsep}{5pt}

just before
\tabulinesep=\tabcolsep

A: More advanced scenario with tabu (not taboo).
\documentclass[preview,border=12pt,varwidth]{standalone}% change it back to your own document class

\usepackage[demo]{graphicx} % the option demo is used for the example, remove it
\graphicspath{{../Img/05Core/}}
\usepackage{tabu,mathtools,tikz}

\begin{document}
\begin{table}[hbtp]
\centering
\tabulinesep=\tabcolsep
\begin{tabu} to \textwidth {|X[4,c,m]|X[1,c,m]|X[0.75,c,m]|X[1.25,c,m]|}
    \hline
    \textbf{Motif}                                                           & \textbf{\textit{P}-value} & \textbf{Rank} & \textbf{Match} \\ \hline
    \[\int_a^b f(x)\,\textrm{d}x=F(b)-F(a) \] & 1E-27                     & 1             & TF1            \\ \hline
    \includegraphics[height=4cm,keepaspectratio]{Motif2} & 1E-25                     & 2             & TF2            \\ \hline
    \[\begin{pmatrix} 1& 2& 3\\ 4 & 5 & 6\\ 7 &8 &9 \end{pmatrix}\] & 1E-23                     & 3             & TF3            \\ \hline
    \[\begin{aligned} a+b+c &= d+e+f\\ pV &= nRT\\ \gamma +\alpha-\beta &=0 \end{aligned}\] & 1E-23                     & 3             & TF3            \\ \hline
        \begin{tikzpicture} \draw[red] (0,0) circle (2) ;\end{tikzpicture}& 1E-23                     & 3             & TF3            \\ \hline
\end{tabu}
\caption{Significantly enriched motifs retrieved.}
\label{tab:Motifs}
\end{table}
\end{document}


text:
Q: React Native with mongdb realm, Realm.App(config) always returns empty object Below is the quick start code to initiate the app given in MongoDB realm docs.
import Realm from 'realm';

let app;

// Returns the shared instance of the Realm app.
export function getRealmApp() {
    if (app === undefined) {
        const appId = 'demo'; // Set Realm app ID here.

        const appConfig = {
            id: appId,
            timeout: 10000,
            app: {
                name: 'demo',
                version: '0',
            },
        };

        app = new Realm.App(appConfig);
    }

    return app;
}

when I call that function, I always get:

empty object {}

Version of realm : "^10.0.0-beta.12"

A: Here's my answer from another SO post. I believe the issue is on their side, not on your side; it's not possible to print objects directly. This isn't limited to the app object.
The developers have suggested using .toJSON() as a workaround. See this post from the MongoDB Developer forum.

I've had some troubles converting any Realm objects to printable
strings; I always get {} just like you do. I think it could be related
to this (unresolved) task on their GitHub.
On a similar note, there are some bugs in Realm's authentication
system. I'm trying to get email/password, Facebook, and Google
authentication going in my application but all of them currently seem
to be broken on Realm's side.
Here are some related issues on their GitHub that you can follow for a
solution.
Facebook
Google
Email/pass (fixed, but not released in the latest beta)

I don't have any information about JWT specifically but given these
other authentication issues there's a good chance the issue isn't on
your side. I recommend opening an Issue on their repository.


text:
Q: Insert newline character after every line using Python I'm trying to insert a newline character into a text file after every line.
So if this is my data:
Dose    atRA_minus_tet  tet
0.001   5.100033162 0
0.001967886 9.651369961 0
0.003926449 16.72520921 0

I want:
Dose    atRA_minus_tet  tet

0.001   5.100033162 0

0.001967886 9.651369961 0

0.003926449 16.72520921 0

My code:
def prepare_steady_state_data(self,data_file):
    with open(data_file) as f:
        lines= [line+'\n' for line in f.readlines()]

    with open(data_file[:-4]+'_for_SS_Fit.txt','w') as f:
        f.write(str(lines))

The problem is that this writes the string literally, like so:
['Dose,Cyp26(atRA_plus_tet),Tet\n\n', '0.001,26.67599946,1\n\n', '0.001006932,26.89620879,1\n\n', '0.001013911,27.117882,1\n\n', '0.001020939,27.34102614,1\n\n']

How do I change this code so that I get the desired format in the output text file?
With thanks,
Ciaran

A: with open(data_file) as source:
    with open(data_file[:-4]+'_for_SS_Fit.txt','w') as output:
        for line in source:
            f.write(line+'\n')

A: Replace this line
f.write(str(lines))

With
f.write(''.join(lines))


text:
Q: Android Mobile testing with Appium Selenium C# I have tried a lot of different stuff from the google and you-tube and this is where i land and i cannot get it to work, my connection to the Appium and emulator is fine also i have checked the adb devices everything is fine.
I am getting error for the Line driver = new AndroidDriver<IWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"), cap, TimeSpan.FromSeconds(180));
These are the two errors which i get:

"cannot convert from 'System.Uri' to 'OpenQA.Selenium.Appium.Service.AppiumServiceBuilder'"

and

"cannot convert from 'OpenQA.Selenium.Remote.DesiredCapabilities' to 'OpenQA.Selenium.DriverOptions".

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Appium.Enums;
using OpenQA.Selenium.Appium.Android;

namespace UnitTestProject4
{
    [TestClass]
    public class UnitTest1
    {
        AppiumDriver<IWebElement> driver;
 [TestMethod]
    public void TestMethod1()
    {
        DesiredCapabilities cap = new DesiredCapabilities();
        cap.SetCapability("deviceName", "Pixel 3a Pie 9.0 - API 28");
        cap.SetCapability("platformVersion", "9.0");
        cap.SetCapability("udid", "emulator-5554");
        cap.SetCapability("appPackage", "org.mozilla.firefox");
        cap.SetCapability("appActivity", "org.mozilla.gecko.BrowserApp");
        cap.SetCapability("platformName", "Android");
        driver = new AndroidDriver<IWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"), cap, TimeSpan.FromSeconds(180));
        driver.Navigate().GoToUrl("https://www.google.com");

      }
   }
 }

A: You are very close, but I would make a few small tweaks. Your error messages are complaining about two things -- the use of DesiredCapabilities instead of AppiumOptions, and the use of new Uri("http://127.0.0.1:4723/wd/hub") as a parameter for AndroidDriver<IWebElement>.
To solve these issues -- instead of DesiredCapabilities, I initialize my AndroidDriver with AppiumOptions. Additionally, you should try starting Appium through AppiumServiceBuilder() and use that service to start your driver session. You should also specify a parameter for automationName.
Here's what I always use to start a new mobile session on Android with C#:
// start appium service
var builder = new AppiumServiceBuilder();
var appiumLocalService = builder.UsingAnyFreePort().Build();
appiumLocalService.Start();

// create appium driver capabilities
var options = new AppiumOptions { PlatformName = "Android" };
options.AddAdditionalCapability("deviceName", "Pixel 3a Pie 9.0 - API 28");

// add app or appPackage / appActivity depending on preference
options.AddAdditionalCapability("appPackage", "org.mozilla.firefox");
options.AddAdditionalCapability("appActivity", "org.mozilla.gecko.BrowserApp");

options.AddAdditionalCapability("udid", "emulator-5554");
options.AddAdditionalCapability("automationName", "UiAutomator2"); // this one is important

// these are optional, but I find them to be helpful -- see DesiredCapabilities Appium docs to learn more
options.AddAdditionalCapability("autoGrantPermissions", true);
options.AddAdditionalCapability("allowSessionOverride", true);

// start the driver
var driver = new AndroidDriver<IWebElement>(appiumLocalService.ServiceUrl, options);


text:
Q: What does the percent mean with an equals and not a like? I'm learning mysql and I stumbled upon this syntax:
SELECT vaule FROM table WHERE field1='%s' AND field2 = 1

what is the meaning of %s?

A: This %s is a placeholder which can be filled e.g. with the sprintf (http://www.php.net/manual/en/function.sprintf.php) function.
Anyway, prepared statements (http://php.net/manual/en/pdo.prepared-statements.php) would be a better idea.

A: % is a placeholder, but it only works with like
SELECT vaule FROM table WHERE field1 LIKE '%s'

That query would return all records where field1 ends with s.


text:
Q: LDAP "relational" group membership filter I am trying to create a (single) LDAP filter that will find users with various attributes (status, create date, etc) who are also members of a particular group.  Normally the answer would be to filter on the "memberOf" attribute -- but unfortunately users in our directory do not have this attribute -- instead of members referring to their groups, only groups refer to their members (using uniqueMember).
I read in Mr. Tendys' comment in another question that there is an overlay that will add memberOf to users in such cases.  For whatever reason, this was not done in our case, and recreating the directory, as Mr. Tendys says is necessary to create the attribute for existing users, is a non-starter.
Currently we can search for the group separately from the other attributes like this:
Group:
BaseDN: ou=groups,dc=mycompany,dc=com
Query: (&(objectClass=groupofuniquenames)(description=My Funky Group))
(And then pull the uniqueMember attributes)

Other attributes:
BaseDN: dc=mycompany,dc=com
Query: (&(objectClass=person)(myCreateDate>=2010-10-27T10:49:42-04:00)(myUserType=E))

Relationally, my instinct is to join the uniqueMember attribute of the group to the DNs we get from the other attribute filter, but my investigation has not shown that this is possible in LDAP.
Admittedly, I am not an LDAP expert.  I am much more experienced in the relational database would, but I have been nipping around the edges of LDAP for some time now.  All of which is to say that I know some things, but there may be fundamentals I am missing.
How do I "join" these two filters, so I don't have to coalate the responses outside of my directory (a Java web service, for what its worth).

A: There are no joins in LDAP (unless there is something I haven't discovered yet!) You have to search the group members and check their attributes individually, or enumerate the users with matching attributes and check their group memberships, whichever makes more sense performance wise.


text:
Q: Override Contact Delete button with Custom Visualforce I'm in the process of finalizing a process which is meant to prevent non-sysAdmin users from deleting Contact records in Salesforce.  I have an addError on the trigger already to prevent users from doing it that way unless in a merge situation, but because of our sharing rules when they click the button it's not surfacing my custom error message in some situations so I'm trying to implement a custom override of the button as a catch-all.  The alert to non-admins works fine, but when trying to execute an allowed delete as an admin the page gets caught it some sort of processing loop and never does anything.
Here's the page:
<apex:page standardController = "Contact"
       action="{!IF($Profile.Name != 'System Administrator', null, URLFOR($Action.Contact.Delete, Contact.Id, [nooverride=1]))}">
<script>
  window.onload=function(){
    alert('You may not delete records.  Please use the deactivation button on the record instead.');
    window.history.back();
    };

I'm a bit stuck at the moment getting the admins to complete the action properly, so would appreciate any insight how to accomplish it.  Thanks.

A: Figured it out, I was missing one of the parameters for the URLFor portion:
<apex:page standardController="Contact"
       action="{!IF($Profile.Name != 'System Administrator', null, URLFOR($Action.Contact.Delete, Contact.Id, [nooverride=1], true))}">
<script>
  window.onload=function(){
    alert('You may not delete records.  Please use the deactivation button on the record instead.');
    window.history.back();
    };


text:
Q: accessing apache solr from php with solarium throws UnexpectedValueException I only just started with Apache Solr and I'm not a huge PHP crack either.
Apache Solr is running and pasting this query in the browser shows an XML document:
http://localhost:8983/solr/my_test/select?q=name:%22A%20Clash%20of%20Kings%22

However, the following code throws an UnexpectedValueException:
<?php
require __DIR__.'/vendor/autoload.php';
// check solarium version available
echo 'Solarium library version: ' . Solarium\Client::VERSION . ' - ';

$config = array(
    'endpoint' => array(
        'localhost' => array(
            'host' => '127.0.0.1', 'port' => '8983', 'path' => '/solr/#/my_test/select?q=name:"A Clash of Kings"'
        )
    )
);

// create a client instance
$client = new Solarium\Client($config);

// // get a select query instance
$query = $client->createQuery($client::QUERY_SELECT);

// // this executes the query and returns the result
$resultset = $client->execute($query);

// display the total number of documents found by solr
echo 'NumFound: '.$resultset->getNumFound(); // THROWS EXCEPTION

// create a ping query
$ping = $client->createPing();

// // execute the ping query
 try {
    $result = $client->ping($ping);
    echo 'Ping query successful';
     echo '

';
     var_dump($result->getResponse());
    echo '
';
} catch (Solarium\Exception $e) {
    echo 'Ping query failed';
}

?>

The output:
Solarium library version: 3.0.0 -
Fatal error: Uncaught exception 'Solarium\Exception\UnexpectedValueException'
with message 'Solr JSON response could not be decoded' in C:\Server\xampp\htdocs\HTML\php\vendor\solarium\solarium\library\Solarium\Core\Query\Result\Result.php:158 Stack trace: #0
C:\Server\xampp\htdocs\HTML\php\vendor\solarium\solarium\library\Solarium\QueryType\Select\ResponseParser\ResponseParser.php(61):
Solarium\Core\Query\Result\Result->getData() #1
C:\Server\xampp\htdocs\HTML\php\vendor\solarium\solarium\library\Solarium\Core\Query\Result\QueryType.php(73):
Solarium\QueryType\Select\ResponseParser\ResponseParser->parse(Object(Solarium\QueryType\Select\Result\Result)) #2
C:\Server\xampp\htdocs\HTML\php\vendor\solarium\solarium\library\Solarium\QueryType\Select\Result\Result.php(144): Solarium\Core\Query\Result\QueryType->parseResponse() #3 C:\Server\xampp\htdocs\HTML\php\lucene.php(25):
Solarium\QueryType\Select\Result\Result->getNumFound() #4 {main} thrown in C:\Server\xampp\htdocs\HTML\php\vendor\solarium\solarium\library\Solarium\Core\Query\Result\Result.php on line 158

After reading a post on Github I changed:
var_dump($result->getData());

in the ping query to
var_dump($result->getResponse());

because getData also threw this exception.
What surprises me a bit is that is says
Solr JSON response could not be decoded

but directly using the URL in the browser returns XML. Do I need to configure the format of the message somewhere? Do I need to change it from XML to JSON or vice versa or something? I am using Solr 5.3.1 on windows 7.
When I comment out the line that throws the exception, the reponse is:
Solarium library version: 3.0.0 - Ping query successful
object(Solarium\Core\Client\Response)#8 (4) {
  ["headers":protected]=>
  array(1) {
    [0]=>
    string(15) "HTTP/1.1 200 OK"
  }
  ["body":protected]=>
  string(6243) "

A: When you configure the path to your Solr index, it should not include any handler or query parameters. In your case, the Solr path should be /solr/my_test. And there are a couple of other code changes you should make. Try this...
$config = array(
    'endpoint' => array(
        'localhost' => array(
            'host' => '127.0.0.1',
            'port' => '8983',
            'path' => '/solr/my_test/'
        )
    )
);

$client = new Solarium\Client($config);
$query = $client->createSelect();
$helper = $query->getHelper();
$query->setQuery('name:' . $helper->escapePhrase('A Clash of Kings'));
$resultset = $client->select($query);
echo 'NumFound: ' . $resultset->getNumFound();

This is based on a phrase escaping example from the Solarium docs.


text:
Q: Quick Filter in WPF ListView We have a quick filter option in our project, when a user types a text say "Test" in a textbox, it filters out WPF ListView with matching text on 3 columns ( the view has 7 columns). The problem is, the ListView takes little more time to filter the items (say 3 sec). And User have to wait to type "est" unit the filter is completed for "T". This gives a poor experience to User.
The ListView is binded to an ObservableCollection<SomeItemViewModel>. I tried to keep the searchable columns in a separate Dictionary<string, string>, where the value will be the string concat of the 3 searchable columns. The idea was instead of searching each column and each row from ObservableCollection, I can filter out the matching records from Dictionary value and fill the Collection. This approach works little better, but still not satisfactory.
Any other approach?

A: One option would be to not start filtering as soon as the user starts to type. What you could do is, in the OnTextChanged event of a textbox, start a timer with very small Timespan which would not be noticeable to the user(in 100s of milliseconds). Expiration of the timer timespan would trigger an event which would start the filtering. If the text changes before the timer expires, reset the timer.
Filter the text only when the timer expires. This would ensure that the filtering would happen only after the user has completed typing the complete text they want to filter by.


text:
Q: What does red shield icon on lower right mean? In No Man's Sky, sometimes a red shield icon will appear in the lower right of the screen. What does it mean?
The most obvious answer is that it means my suit's shields are down, but all my gameplay seems to contradict this guess. I've played maybe 300 hours in 2 years, and I'm still not sure what it means. I have definitely had my shields damaged and not seen it, and I've been almost certain that my shields are full and seen it (as in the screen shot).

A: Based on this guide, when the backpack icon turns red it simply means that all the slots in your inventory have been filled. You can still pick up stackable items (assuming the stack limit hasn't been reached), just not pick up any new items

As you fill your suit's inventory, the bar on this icon will move up until the icon turns red, indicating you've run out of inventory slots.


text:
Q: To find the maximum number of order count that occur in any 1 hour of the day from the database? I have a food selling website in which there is order table which record the order of every user.It column for user id ,user name,orderid ,timestamp of order.I want to know the maximum number of order that has been made in any one hour span through out the day.Give me any formula for this,or any algorithm or any sql queries for these.

A: SQL server:
with CTE as
(
select cast(t1.timestamp  as date) as o_date, datepart(hh, t1.timestamp) as o_hour, count(*) as orders
from MyTable t1
group by cast(t1.timestamp  as date), datepart(hh, t1.timestamp)
)
select o_date, o_hour, orders
from CTE
where orders = (select max(orders) from CTE)

Oracle
with CTE as
(
select to_char(t1.timestamp, 'YYYYMMDD') as o_date, to_char(t1.timestamp, 'HH24') as o_hour, count(*)
from MyTable t1
group by to_char(t1.timestamp, 'YYYYMMDD'), to_char(t1.timestamp, 'HH24')
)
select o_date, o_hour, orders
from CTE
where orders = (select max(orders) from CTE)

A: You can get count by day and hour like this
For SQL
SELECT TOP 1
    COUNT(*)
FROM myTable
GROUP BY DATEPART(day, [column_date]), DATEPART(hour, [column_date])
ORDER BY COUNT(*) DESC;

For MySQL
SELECT
    COUNT(*)
FROM myTable
GROUP BY HOUR(column_date), DAY(column_date)
ORDER BY COUNT(*) DESC
LIMIT 1;


text:
Q: retrieve data from couchdb I am new couchdb user and I am using lightcouch API.
currently, I can get data from couchdb, but what I can get is not I need. You can see the following code: username value and password value are stored, and these two values are needed to store into jsonarray.
However, the problem is when I tried to print the data, it only showing me this:
{"id":"0a3f38cfc5ca45d6bcd76725faf5b917","key":"0a3f38cfc5ca45d6bcd76725faf5b917","value":{"rev":"1-32d4a8325e8995d0eddd5b2626b752df"}}.
The problem is that I can not get username and password. BTW, another question is, when the servlet send jsonarray for example named data, how does the jquery get the message and username from data.
CouchDbProperties properties = new CouchDbProperties(
        "db_test",
        true,
        "http",
        "127.0.0.1",
        5984, null, null);

CouchDbClient dbClient2 = new CouchDbClient(properties);
Map<String, Object> map = new HashMap<>();
map.put("username", "justin");
map.put("message", "hello world");
dbClient2.save(map);

List<JsonObject> jsonList = dbClient2.view("_all_docs").query(JsonObject.class);
for (int i=0; i< jsonList.size(); i++){
    System.out.println(jsonList.get(i));
}

A: You can have "views" specified in CouchDb, in that case instead of "_all_docs" you would give your view path "_design/something/_view/someview".
More about views https://wiki.apache.org/couchdb/Introduction_to_CouchDB_views
Or look into "_all_docs?include_docs=true", since "_all_docs" does not return data itself, just documents info like ids.


text:
Q: Error trying to start Oracle 12c on Solaris 11 After the installation of Oracle 12c under Solaris 11 .. Im running SQLPlus and after typing startup i get this error :
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/12.1.0.2/db_1/dbs/initDB12C.ora'

Any ideas guys ? i've tried everything i found on the net
.profile File
ORACLE_HOSTNAME=solaris; export ORACLE_HOSTNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.1.0.2/db_1; export ORACLE_HOME
ORACLE_SID=DB12C; export ORACLE_SID
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$CRS_HOME/lib
PATH=$ORACLE_HOME/bin:$PATH; export PATH

init.ora File :
# Change '<ORACLE_BASE>' to point to the oracle base (the one you specify at
# install time)
db_name='ORCL'
memory_target=1G
processes = 150
audit_file_dest='<ORACLE_BASE>/admin/orcl/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='<ORACLE_BASE>/fast_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='<ORACLE_BASE>'
dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
# You may want to ensure that control files are created on separate physical
# devices
control_files = (ora_control1, ora_control2)
compatible ='11.2.0'


text:
Q: How to debug node.js app running with TypeScript in WebStorm? How to debug node.js app running with TypeScript in WebStorm?

A: Update tsconfig.json to add sourceMap=true property in compilerOptions
{
  "compilerOptions": {
    "module": "commonjs",
    "moduleResolution": "node",
    "noImplicitReturns": true,
    "outDir": "lib",
    "target": "es6",
    "preserveConstEnums": true,
    "removeComments": false,
    "sourceMap": true,
    "inlineSources": true,
    "typeRoots": [
      "./node_modules/@types"
    ]
  },
  "exclude": [
    "node_modules",
    "lib"
  ]
}

In the Edit Run/Debug Configuration,

*

*Write following line in Node parameters field. Don't forget to mention your port number! In my case it is 3000
--inspect=3000 --require ts-node/register

*Mention your entry .ts file in Javascript file field. In my case it is bin/www.ts

*Debug your newly created configuration


text:
Q: Good container for insert-in-order? C++ Hi I was wondering what the best container for inserting elements in order in? A map I think is unnecessary since I am just going to be accessing the element at the front, popping it and then inserting more elements (I'm implementing a pathfinding algorithm (Dijkstra) with weights)
I could probably have used a list and inserted in order myself, but the inability to bisect (because you start accessing at the front or back) would be hindering to performance.

A: If you need only access the front and back, std::deque (double-ended queue) fits the bill perfectly.
However, for a Dijkstra algorithm, don't you need a priority queue instead?

A: If you are using C++ there is a std::priority_queue container adapter in the <queue> header file.


text:
Q: Проблема с SharedPreferences и AlertDialog Пытаюсь сделать настройки.
Собственно настройки сохраняю в sharedPreference.
Проблема в том, что оно странно сохраняет Boolean: зайду в настройки, всё checkbox false, перезахожу уже все true.
В чём моя ошибка?
/*НАСТРОЙКИ+СОХРАНЕНИЕ ИНФЫ*/
public static final String CHECK_SETTINGS = "check_settings"; //Имя файла
//Обучение
public static final String hasWathed="false"; // проверка на просмотр обучения

public static final String notifShops="true"; // уведомления магазинов
public static final String notifWebSite="true"; // уведомления сайта

Dialog:
    final CharSequence[] items = {" Получать уведомления об обновлениях сайта "," Получать уведомления об акциях магазинов "};

    sp = getSharedPreferences(CHECK_SETTINGS,
            Context.MODE_PRIVATE);

    boolean shops = sp.getBoolean(notifShops, true);
    boolean webSite = sp.getBoolean(notifWebSite, true);
    boolean[] mCheckedItems={webSite,shops};

    AlertDialog dialog = new AlertDialog.Builder(this)
            .setTitle("Настройки")
            .setMultiChoiceItems(items, mCheckedItems, new DialogInterface.OnMultiChoiceClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int indexSelected, boolean isChecked) {
                    if(indexSelected==0){
                        Log.d("Settings","notifWebSite"+isChecked);
                        SharedPreferences.Editor e = sp.edit();
                        e.putBoolean(notifWebSite, isChecked);
                        e.commit(); // не забудьте подтвердить изменения
                    }
                    if(indexSelected==1){
                        Log.d("Settings","notifShops"+isChecked);
                        SharedPreferences.Editor e = sp.edit();
                        e.putBoolean(notifShops, isChecked);
                        e.commit(); // не забудьте подтвердить изменения
                    }
                }
            }).setPositiveButton("OK", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int id) {
                    //  Your code when user clicked on OK
                    //  You can write the code  to save the selected item here
                }
            }).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int id) {
                    //  Your code when user clicked on Cancel
                    dialog.cancel();
                }
            }).create();
    dialog.show();


text:
Q: Netezza "not exists" within a CASE statement I have a multi-layered CASE statement, and one of the conditions needs to reference a table via a "not exists".  I keep getting the error about 'correlated subqueries not allowed".  How can I reference a table along with a condition inside a CASE statement? Below is a portion of my code:
WHEN ......  previous condition

WHEN ( CCOB_CLIENT_LOB_ID = 2  AND OI_CARRIER_LOB_ID IN (1,2,12,13) )
         and not exists ( select S.STATE
                          FROM CCOB_PACIFICSOURCE.V_SELFPAY_COB_STATES  S
                          WHERE S.STATE = SELFPAY_COB_STATE )  then 'NONE'

WHEN ....  subsequent condition

A: The short answer is: you cann't.
The longer answer is that you have to rewrite the query to outer join the table you give the alias S.
Then it's quite possible to test for NULL.
Watch out for dublicates on the S.state column though :)


text:
Q: negation of regular expression for first character alphabet, from second character onwards any character I want to form a regular expression for the "Name" text field that should allow
"first character alphabet, from second character on wards any character"
Please help me to create the negation of the regular expression for the above so that if the user is trying to key in first character other than alphabet cannot key in.
I am trying to invoke the code given below but not working.
<!DOCTYPE html>
 <html>
   <head>
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
     <script>
      $(document).ready(function(){
        $("#Name").keyup(function(){ $(this).val( $(this).val().replace(/[^a-zA-Z]*$/, "")); })
      });
      </script>
   </head>
   <body>
     Name:
     <input type="text" name="Name" id="Name"/>
    </body>
</html>

Please find the plunker link :
https://plnkr.co/edit/NTzyNpWqEUtgRgVAnHiy?p=preview

A: You forgot the '.' before the *
I believe this is what you are looking for:
$("#Name").keyup(function(){ $(this).val($(this).val().replace(/^[^a-zA-Z].*$/, '')); })

Edited plunker: https://plnkr.co/edit/CIXCLzRTVIVXIcjnjWd7


text:
Q: Finding vertical asymptotes So I am trying to find the behaviour of this function around an asymptote at $x=0$.
$a>0$
$$y=\frac{(x-a)(x^2+a)}{x^2}$$
I know that as $x \to 0^+$, $y \to -\infty $ and $x \to 0^-$, $y \to -\infty $.
I've tried dividing the top and bottom of $y$ by $x^2$ and ended with:
$$x-a+\frac{a}{x}-\frac{a^2}{x^2}$$
Which does not help me as I end with $\infty -\infty$. Any help would be greatly appreciated.

A: The fact that $x-a$ is negative when $x$ is near $0$ and $x^2 + a$ positive is positive when $x$ is near zero, and the denominator is positive, will mean that the function must approach $-\infty$ at the vertical asymptote, unless the numerator also approaches $0$, in which case you've got more work to do.  In this case the numerator approaches $-a^3$, which is not $0$, so that's it.
You're quite right about the fact that breaking it into $\infty-\infty$ won't help.  If you had that, I'd tell you to write it as a single fraction by using a common denominator.  That would take you to what you started with.

A: Expanding my comment above.

I know that as $x \to 0^+$, $y \to -\infty $ and $x \to 0^-$, $y \to
 -\infty $.

Only the first assertion is correct.
Since $\left( x-a\right) (x^{2}+a)=x^{3}-ax^{2}+ax-a^{2}$, we have
$$\begin{eqnarray*}
\lim_{x\rightarrow 0}\frac{\left( x-a\right) (x^{2}+a)}{x^{2}}
&=&\lim_{x\rightarrow 0}\left( x^{3}-ax^{2}+ax-a^{2}\right) \times
\lim_{x\rightarrow 0}\frac{1}{x^{2}} \\
&=&-a^{2}\times \lim_{x\rightarrow 0}\frac{1}{x^{2}}=-a^{2}\left( +\infty
\right) =-\infty, \qquad\text{    for }a\ne 0.
\end{eqnarray*}$$
So as $x$ approaches $0$, either from the left or from the right, $y\rightarrow -\infty $. The limit does not depend on the sign of $a$.
Plot of $y$ for $a=1$ (black) and $a=-1$ (green).


text:
Q: How to perform logistic regression on not binary variable? I was searching for this answer and I'm really suprised that haven't found it. I just want to peform three level logistic regression in R.
Let's define some artificial data:
set.seed(42)
y <- sample(0:2, 100, replace = T)
x <- rnorm(100)

My variable y is containing three numbers - 0, 1 and 2. So I thought that the simplest way would be just to use:
glm(y ~ x, family = binomial("logit"))

However I got information that y should be in interval [0,1]. Do you know how I can perform this regression ?
Please notice - I know that it's not so straightforward to perform multilevel logistic regression, there are several techniques how to do so e.g. One vs all. But as I was seeking for it, I wasn't able to find any.

A: set.seed(42)
y <- sample(0:2, 100, replace = TRUE)
x <- rnorm(100)

multinomial regression
If you don't want to treat your responses as ordered (i.e., nominal or categorical values):
library(nnet) ## 'recommended' package, i.e. installed by default
multinom(y~x)

Results
# weights:  9 (4 variable)
initial  value 109.861229
final  value 104.977336
converged
Call:
multinom(formula = y ~ x)

Coefficients:
   (Intercept)           x
1 -0.001529465  0.29386524
2 -0.649236723 -0.01933747

Residual Deviance: 209.9547
AIC: 217.9547

Or, if your responses are ordered:
ordinal regression
MASS::polr() does proportional-odds logistic regression. (You may also be interested in the ordinal package, which has more features; it can also do multinomial models.)
library(MASS) ## also 'recommended'
polr(ordered(y)~x)

Results
Call:
polr(formula = ordered(y) ~ x)

Coefficients:
         x
0.06411137

Intercepts:
       0|1        1|2
-0.4102819  1.3218487

Residual Deviance: 212.165
AIC: 218.165

A: Logistic regression as implemented by glm only works for 2 levels of output, not 3.
The message is a little vauge because you can specify the y-variable in logistic regression as 0s and 1s, or as a proportion (between 0 and 1) with a weights argument specifying the number of subjects the proportion is of.
With 3 or more ordered levels in the response you need to use a generalization, one common generalization is proportional odds logistic regression (also goes by other names).  The polr function in the MASS package and the lrm function in the rms package (and probably other functions in other packages) fit these types of models, but glm does not.

A: If you read the error message, it offers a hint that you might get success with:
y <- sample(seq(0,1,length=3), 100, replace = T)

And in fact, you do. Now you challenge might be to interpret that in the context of the actual situation in reality (which you have not offered.) You do get a warning, but R warnings are not errors.
You might also look up the topic of polychotomous logistic regression, which is implemented in several variants that might be useful in particular situations. Frank Harrell's book Regression Modeling Strategies has material on such techniques. You may also post further questions on CrossValidated.com if you need help choosing which route to go.