text:
Q: Named parameters in queries for SQL Server ALL,
I'm trying to find a proper syntax to do the following:
SELECT a, b, c FROM foo WHERE foo.id = :id;

(the query above is written as in SQLite).
The "normal" query would be written as:
SELECT a, b, c FROM foo WHERE foo.id = ?;

The first query is written with the named parameter, the second - with unnamed.
Google gives me the syntax for Stored Procedures and/or Functions, but what I am looking for is a SELECT query with the named parameter.
TIA!
EDIT:
The second syntax called a query with parameter and it using ?. So, when I write a C++ code I will be using BindParameter() ODBC syntax.
However with the first query n MS SQL Server, what syntax is correct?
I used the syntax that is used in SQLite for the query with the named parameter. And my question is for the proper syntax for SQL Server?
IIUC from the responses the proper SQL Server syntax is:
SELECT a, b, c FROM foo WHERE foo.id = @id;

Which means I will need to declare the variable named id, bind it to the prepared query and then execute it.
To answer Tibor question - no, the question is specifically for SQL Server. The DB Engine has t understand the syntax and I'm not sure how to properly write the query. My question is independent of client tool.
To answer Charlieface question - I am using plain SELECT... query, not a stored procedure or a function. As stated - that was what Google search gave me. What I am looking for is how to properly write such query (not sp or func) for SQL Server so that DB engine will understand it.
EDIT2:
So, my full code will look like this (for SQL Server):
std::string query = "SELECT a, b, c FROM foo WHERE foo.id = @id;";
SQLExecute( stmt, "DECLARE @id" ... );
SQLPrepare( stmt, query.c_str()... );
SQLBindParameter();
SQLExecute();

A: So as mentioned in the comments, when you're talking about a general query, not in the context of a function or procedure, the term parameter doesn't exist - but perhaps what you really mean is variable, just the same for your goal.
In that case, to declare a variable in SQL Server's (T-SQL) syntax, you'd want to do:
-- @ denotes it's a variable, followed by the name of the variable, and then the type after, optionally followed by = and a value if you want to set the variable during declaration (but not required)
DECLARE @id INT = 123;

If you choose not to set the variable during declaration then you can set it to a value later on using the SET keyword like so:
SET @id = 123;

Then you can utilize that variable within the same scope as your query like so:
SELECT a, b, c FROM foo WHERE foo.id = @id;

Full picture:
DECLARE @id INT;
SET @id = 123;

SELECT a, b, c FROM foo WHERE foo.id = @id;


text:
Q: Minimizing AX - B where both A and X are variable matrices. I'm trying to solve a problem of the form:
$$\text{minimize} \: \lVert AX - B \rVert^2_2$$
Subject to
$$A \geq 0 \\ X \geq 0.$$
Both $A$ and $X$ are variable and $B$ is a constant.
So essentially the problem is to factorize $B$ into $A$ and $X$ but unlike the typical recommender system problem, we know $B$ in its entirety.
Does this fall under any optimization domain? How would I go about solving this to find the best $A$ and $X$? The only approach I currently have is gradient descent but I doubt it's gonna find a good solution.
Edit: The dimensions of $A$ and $X$ are predetermined and not a free parameter.
Every element of $B$ is nonnegative.

redpajama_set_name: RedPajamaStackExchange


text:
Q: What word compares to empathy for someone who easily recognizes what others are thinking? empathy is (n.) modeled on German Einfühlung (from ein "in" + Fühlung "feeling"), which was coined 1858 by German philosopher Rudolf Lotze (1817-1881) as a translation of Greek empatheia "passion, state of emotion," from assimilated form of en "in" (see en- (2)) + pathos "feeling" (from PIE root *kwent(h)- "to suffer").
An empath has this ability more than average, and the more empathetic we are, the more we can relate to each other emotionally.
Emotions are conditionally triggered reactions that include biological, physiological, expressive, and cognitive elements too, not just the feelings most people recognize.  Empathy recognizes the emotional expressions of others and effectively "feels/suffers with them."
I'm looking for a word that's similar but recognizes "the thoughts of others and effectively thinks with them." This skill or genetic ability recognizes all of the elements of thinking and how someone expresses each one in speech and behavior, and with corresponding behavior, makes necessary adjustments until their thoughts match.
Thinking includes more than reasoning, which is more about logic than everything else thinking includes.  So the word I'm searching for is not limited to reasoning.
Intuition includes consciously recognizing the complex calculations of one's unconscious mind, not the thoughts of others, so the word I'm looking for is not intuitive.
For example:
Jane might be more empathetic because she feels what other people feel, but John is more ____ because he thinks what other people are thinking.
There are methods to becoming more empathetic or ____, but they are distinctively different and usually require different teachers, as well as being naturally easier to learn based on one's genetic temperament.

A:
Jane might be more empathetic because she feels what other people
feel, but John is more perspicacious because he thinks what other
people are thinking.

Perspicacious (adj.)

Someone who is perspicacious notices, realizes, and understands
things quickly. Collins

Quick in noticing, understanding, or judging things accurately.
Cambridge

Some perspective on perspicacious: the word combines the Latin
perspicac- (from perspicax meaning "clear-sighted," which in turn comes from perspicere, "to see through") with the common English
adjective suffix -ious. The result is a somewhat uncommon word used
to describe someone (such as a reader or observer) or something (such
as an essay or analysis) displaying the perception and understanding
of subtleties others tend to miss, such as the distinctions between
the words perspicacious, shrewd, sagacious, and astute—something our
synonym chooser can help with. M-W

How does the adjective perspicacious differ from other similar
words? Some common synonyms of perspicacious are astute, sagacious,
and shrewd. While all these words mean "acute in perception and sound
in judgment," perspicacious implies unusual power to see through and
understand what is puzzling or hidden. M-W

Although broader in meaning, perspicacious  often refers to, or includes, insight into what is usually hidden, especially what others are thinking. Mind-reading, on the other hand, can be a single instance or coincidence, as in "You must have read my mind!", a stage act, or the ability to truly read the thoughts of others in fine detail as another sense, like aliens in science fiction.

Coppola represents Vito first and foremost as a listener. ... Vito is
perspicacious and he is able to divine what others are thinking and revealing not only in what they say but in how they say it.
Stephen Brauer; Criminality and the Modern Contingency and Agency in
Twentiether-Century America (2022)

Often they were uncomfortably perspicacious and used to say outright
what others were thinking.  Bo Giertz; With My Own Eyes
(1960)

The examples of Ralph and Madame de Ramiere suggest, then, that high levels of affective empathy and generosity can coexist with well-developed mind-reading skills, though this coexistence is far from given, as the examples of Noun, Indian, Raymon and Laure indicate.
Mind-reading skills and affective sharing are sometimes shown to work
at cross-purposes in Indiana, and are sometimes presented as
compatible. One of the two stances can be prioritised over the other,
as the extreme examples of Noun and Laure suggest: Noun is utterly
seduced by, and trusting of, the stranger figure that is Raymon, while
Laure, as a perspicacious mind-reader, is not at all seduced by
him. Maria Scott; Empathy and Strangeness of Fiction (2020)

This unwieldy 'alternate consciousness' approach means that, to present a full picture, as the characters always strive to do, they must effectively take up mind reading. Thus Savage speaking of Victoria's father at one point: 'I could
read her father's mind as easily as I could read hers'; and, later,
of Victoria, 'I could almost hear her saying to herself, men are
extraordinary'... Besides showing how perspicacious the
Anglo-Indian hero is, these examples of Savage claiming to know the
thoughts of other characters and narrating them as fact is a sign of
the way having space to tell a story gives power. R. Srinivasan, et
al.; Our Indian Railway: Themes in India's Railway History (2006)

A: I suggest "in tune [with]"

1931   Times 21 May 9/5   Old buildings, he said, taught us that our new buildings should not be reproductions of the old, but should be equally in tune with the thought and methods of the day.

2009   Conf. & Incentive Trav. July 20   A fantastic website that keeps me on trend with fashion and in tune with the latest celeb gossip.

2016 Global Public Procurement Theories and Practices - Page 326 Khi V. Thai ... the complex intergovernmental and inter-organizational networks themselves that limit bureaucracy's ability to implement public policy in tune with public preferences,

A: People can be said to be on the same wavelength.

on the same wavelength [idiom]
(of two or more people) to think in a similar way and to understand
each other well

[Cambridge Dictionary]

*

*We could complete each other's sentences because we were on the same wavelength.

[Collins: Easy Learning Idioms Dictionary]

A: Mind reader, Freedictionary
Also found in: Thesaurus, Encyclopedia, Wikipedia.
mind reading
n.
The faculty of discerning another's thoughts through extrasensory means of communication; telepathy.
Thought-perceptive? Alive to other's thoughts? Thought reader? Thought intuiter?


text:
Q: Getting Post API Call argument as null I am trying to make a post call with very large argument size. But the call is not going through.
Issue: When size of parameter is large call is not going through.But in case of small parameter everything is fine that means API is working. I tried to research about POST call but couldn't make it work.
What i Did
I made a sample api project and tried it to test via postman and project too.
Postman call

This is working fine as expected.
In-Project

If someone is going to point out rquest.ContentLength = 0;. This is because param is getting appended to url only. I don't intend it to get appended but
i don't know how to do it and googled too. For small length this is working but say if string length goes to 3000 it fails.
API Call Initiator
UriBuilder uriBuilder = new UriBuilder(restURL);
var query = HttpUtility.ParseQueryString(uriBuilder.Query);
query["json"] = new JavaScriptSerializer().Serialize(reportParameterDictionary);
uriBuilder.Query = query.ToString();
restURL = uriBuilder.ToString();
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(restURL);
request.Method = "Post";
request.ContentType = "application/json";
rquest.ContentLength = 0;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
  StreamReader reader = new StreamReader(response.GetResponseStream());
  string responseData = reader.ReadToEnd();
  response.Close();
  dynamic obj = JsonConvert.DeserializeObject(responseData);
  if (obj != null)
  {
   printresult = obj.Success;
  }
}

Receiving End
[Route("PrintReport")]
public IHttpActionResult PrintReport(string json)

A: // Create a request using a URL that can receive a post.
WebRequest request = WebRequest.Create ("http://www.contoso.com/PostAccepter.aspx");
// Set the Method property of the request to POST.
request.Method = "POST";
// Create POST data and convert it to a byte array.
string postData = "This is a test that posts this string to a Web server.";
byte[] byteArray = Encoding.UTF8.GetBytes (postData);
// Set the ContentType property of the WebRequest.
request.ContentType = "application/x-www-form-urlencoded";
// Set the ContentLength property of the WebRequest.
request.ContentLength = byteArray.Length;
// Get the request stream.
Stream dataStream = request.GetRequestStream ();
// Write the data to the request stream.
dataStream.Write (byteArray, 0, byteArray.Length);
// Close the Stream object.
dataStream.Close ();
// Get the response.
WebResponse response = request.GetResponse ();
// Display the status.
Console.WriteLine (((HttpWebResponse)response).StatusDescription);
// Get the stream containing content returned by the server.
dataStream = response.GetResponseStream ();
// Open the stream using a StreamReader for easy access.
StreamReader reader = new StreamReader (dataStream);
// Read the content.
string responseFromServer = reader.ReadToEnd ();
// Display the content.
Console.WriteLine (responseFromServer);
// Clean up the streams.
reader.Close ();
dataStream.Close ();
response.Close ();

Follow this Link for complete explanation.

A: Have you tried to use HttpClient instead of HttpWebRequest?
var client = new HttpClient();
var content = new StringContent("YOUR LONG STRING",
                             System.Text.Encoding.Unicode,
                             "application/json");
var task = client.PostAsync(restURL, content);
var str = await task.Result.Content.ReadAsStringAsync();


text:
Q: Need help fixing code so that it can complie As part of an assignment, I have to write a code in C to give the end time when the start time and duration are added together.
For instance, "Start time is 1245. Duration is 345. End time is 1630"
This is my code:
#include <stdio.h>

void addTime(int start, int duration);
int main()

{
 addTime(1045, 345);
 addTime(800, 435);
 addTime(2300, 300);
}

void addTime(int start, int duration)

if(start + duration > 2400)
{
 printf("Start time is %d. Duration is %d. End time is %d\n", start, duration, (((((60*(start/100))+(((start/100)%)*100)) + ((60*(duration/100))+(((duration/100)%)*100)))/60) + (((((((60*(start/100))+(((start/100)%)*100)) + ((60*(duration/100))+(((duration/100)%)*100))/60)%)/3600)%))));
}

else
{
 printf("Start time %d. Duration is %d. End time is %d\n", start, duration, (((((60*(start/100))+(((start/100)%)*100)) + ((60*(duration/100))+(((duration/100)%)*100)))/60) + (((((60*(start/100))+(((start/100)%)*100)) + ((60*(duration/100))+(((duration/100)%)*100)))/60)%));
}

This is the error message:
task3.c: In function 'addTime':
task3.c:14:1: error: expected declaration specifiers before 'if'
 if(start + duration > 2400)
task3.c:19:1: error: expected declaration specifiers before 'else'
 else
task3.c:22:1: error: expected '{' at end of input

A: You are missing the curly braces ({}) around addTime's implementation:
void addTime(int start, int duration)
{ /* here */
    if(start + duration > 2400)
    {
        printf("Start time is %d. Duration is %d. End time is %d\n", start, duration, (((((60*(start/100))+(((start/100)%)*100)) + ((60*(duration/100))+(((duration/100)%)*100)))/60) + (((((((60*(start/100))+(((start/100)%)*100)) + ((60*(duration/100))+(((duration/100)%)*100))/60)%)/3600)%))));
    }
    else
    {
        printf("Start time %d. Duration is %d. End time is %d\n", start, duration, (((((60*(start/100))+(((start/100)%)*100)) + ((60*(duration/100))+(((duration/100)%)*100)))/60) + (((((60*(start/100))+(((start/100)%)*100)) + ((60*(duration/100))+(((duration/100)%)*100)))/60)%));
    }
} /* and here */


text:
Q: Override method in a third party module I'm trying to override a method that is inside two modules from a third party library.
It looks like this :
module Omnigollum
  module Helpers
    def kick_back
      redirect !request.referrer.nil? && request.referrer !~ /#{Regexp.escape(settings.send(:omnigollum)[:route_prefix])}\/.*/ ?
        request.referrer:
        '/'
      halt
    end
  end
end

This method is used by other functions from this library. I need to completely override it.
I tried lot of solution given by other stackoverflow thread, but so far nothing works.
Here is what I have now :
module OmnigollumOverride
  module Helpers
    def kick_back
      puts '=-=-=-=-=-=-=-=-=-==-=-'
      puts '=-=-=-=-=-=-=-=-=-==-=-'
    end
  end
end

include Omnigollum
Omnigollum.module_eval { include OmnigollumOverride }

I just print some line to test if the method is correctly overridden.

A: Instead of:
include Omnigollum
Omnigollum.module_eval { include OmnigollumOverride }

call this once:
Omnigollum::Helpers.prepend OmnigollumOverride::Helpers

Prepending module places it on top of inheritance hierarchy. Whether you want to re-use the original behaviour, you might do:
def kick_back
  return super if SOME_CONDITION # call original method

  puts '=-=-=-=-=-=-=-=-=-==-=-'
  puts '=-=-=-=-=-=-=-=-=-==-=-'
end


text:
Q: Transport level protocol vs Application level Protocol What dictates if a protocol is transport level protocol or application level protocol by definition? Is wire protocol synonym for transport protocol?
Is it simply that, if it's implemented on the network card driver or operating system, or at the application level? For example:

*

*TCP/IP = Transport (Network driver)

*HTTP = Application (HTTP server)

Why is HTTP protocol called a transport protocol in the terms of SOAP? Is SOAP itself an transport or application level protocol?

A: Because you're mixing stuff.
Your list assumes the ISO/OSI layer model. Within this model each layer has distinct services/features it has to implement. For a closer look see the wiki or some other third party site. The higher up you are the more specific it usually gets in regards to actually handling specific data instead of general data. As an example for transport protocols:

The transport layer provides the functional and procedural means of transferring variable-length data sequences from a source to a destination host via one or more networks, while maintaining the quality of service functions.

SOAP on the other hand has a different definition of what transport means within its context. Again the wiki is a good reference.

Both SMTP and HTTP are valid application layer protocols used as transport for SOAP.

From the perspective of SOAP those are used to transport itself.

A: Application and Transport are two of the seven layers in the OSI reference model for computer networks.
Notably, the Internet does not use the full seven layer OSI model and it can be argued that it is really a 5 layer model rather than a 7 layer one (Session and Presentation are not really used as the Application can use protocols in the the transport layer (TCP/IP) directly).
The idea behind having different layers is that they can often be interchanged, and generally don't care about what happens below.  That way, if you're using a dialup modem connection, or WiFi, your application will continue to operate the same way (although at the low levels, you might be using an entirely different method of communication).
In modern operating systems, the application generally talks to the operating system's 'network stack' to get a session (e.g. a TCP connection).   The program running in user space is the 'Application Layer'.
Sometimes people build things on top of other protocols.  So in the case of HTTP (used by web browser) it can also be used as a transport protocol.  It is an application level protocol in its own right, but can be used as a transport protocol instead of TCP/IP.


text:
Q: Start a bat file on remote PC I am trying to execute a .bat or .cmd file on a remote pc with this:
PSEXEC \\192.0.0.230 "\Users\James\Desktop\BatchFiles\StopStart.cmd"

This will Disable a NIC and Enable another NIC, problem is, it ignores the timeout /t 10, because instead of opening the file on the remote computer, it runs the commands written in the batch file instead. So if it Disables the first NIC it will lose connection meaning it can't enable the other NIC. But if it can just run the file and let the lines run on the remote PC instead, this is not a problem, because then even if I lose connection due to the NIC being disabled, it should just keep running the .bat file on the remote PC instead of running the commands written in it from my own PC.
Is this possible? Thanks.

A: You might be able to use schtasks. I haven't tried this, but something like this might work:
schtasks /create /s SRV01 /tn MyApp /tr "cmd /c c:\path\to\my.bat"
schtasks /run /s SRV01 /tn MyApp

You can have a look at Microsoft reference for schtasks commands for more details.

A: Maybe you can use a second short script (that you launch with psexec instead) to have the remote machine copy that batch file locally, then in the last line use call to start that second local batch file copy (for example copied to %temp%)?
It'll lose connection to the network location, but as "call" was on the last line, that doesn't matter anymore.

A: If you have access to Powershell on both machines, you may be able to use Invoke-Command  or Invoke-CommandAs to run the command
This admittedly might be more powerful than a regular .bat execution, but based on past experience, would be how in automation environments we've had our Jenkins instances run commands remotely on nodes from the Jenkins host server machine.
In Powershell, there's an Invoke-Command option, which since I last looked at it, appears to have added additional parameters for running effectively as another user on that remote machine (I'm more familiar with the Invoke-CommandAs additional installation component, so I'm not 100% of this particular solution.). That said, based on the documentation there, the following is an example I'm copying here in case that link dies, and for quick reference.
Invoke-Command -FilePath <Path_To_Script*> -ComputerName <ComputerName**>

If, however, you're hoping to use the Invoke-CommandAs approach, this works from at least Powershell version 3.0, as I understand.
That would then look like this:
Invoke-CommandAs -ComputerName '<ComputerName**>' -Credential $Credential -ScriptBlock { Get-Process }
Or:
Invoke-CommandAs -ComputerName '<ComputerName**>' -AsUser $Credential -ScriptBlock { <Path_To_Script*> }
* i.e. "c:\scripts\test.ps1" in their example, or in your case, "\Users\Bridge\Desktop\BatchFiles\StopStart.cmd" - just be sure to remove the angled brackets in the code examples above.
** NETBIOS name, IP address, or fully qualified domain name of one or more computers in a comma-separated list. If using an IP Address, you must also provided a Credential parameter, along the lines of, for example -Credential Domain01\User01

A: Please open Remote Desktop Connection and log into the system from there.
You'll then be able to run whatever program you use.
I was nearly able to run GUI programs in WSL 2.0 on Windows 10 Pro via using the above.
If this doesn't work, please advise as such.


text:
Q: Enable/disable buffered rendering at runtime I have a grid that is using a buffered renderer.
For printing, I copy the grid DOM into a new window, and send it to printer. For this to work, the DOM has to be rendered completely, but with a buffered renderer, it isn't.
If I have to, I will disable buffered renderer completely, but since only a few users use the printing feature, I would prefer not to.
Is there a possibility to switch bufferedRenderer off temporarily before fetching the DOM, and to switch it back on afterwards?

A: I am not sure how it helps you , but I have done this similar sort by increasing the view size at runtime.
Lets suppose you have buffered renderer with this config:
ptype : 'bufferedrenderer',
trailingBufferZone : 20,
leadingBufferZone : 50

So dynamically , you can set the viewsize at runtime by getting the reference of plugin and using setViewSize(newSize) method.
eg:
var dd=Ext.ComponentQuery.query("#ExampleTreePanel")[0];
var bufferedRendererPlugin = dd.plugins[0];
bufferedRendererPlugin.setViewSize(100000);

This large size is just a big number we can assume so that the DOM will be completely loaded and you can give it to print.Its a workaround. Again you can resize the view by setting it to small number.
bufferedRendererPlugin.setViewSize(115);

A: I have adapted the good answer by Saloo to work around some things that are different between ExtJS 6 and ExtJS 4:
// Set view size to match store content:
this.bufferedRenderer.setViewSize(this.getStore().getCount());
// Refresh view, so that everything is rendered:
this.bufferedRenderer.refreshView(0);
// refreshView does not revert the node container's "translate" setting after the viewSize was changed to be equal or greater than the store count, so we have to enforce it manually:
this.getView().getEl().down(this.getView().getNodeContainerSelector()).translate(0,0,0);


text:
Q: How to rename XCode5 project that has an attached Pods? I'm trying to rename an XCode5 project that has an attached CocoaPods (Pods project).
(I've attached the CocoaPods using the following tutorial: http://www.raywenderlich.com/12139/introduction-to-cocoapods)
I've tried the standard renaming technique: https://stackoverflow.com/a/19442868/173623
But it breaks the build, since the rename only takes place for App project.
How can I accomplish this task?
Thank you.

A: After viewing your provided tutorial, I would like to suggest you the following:

*

*First follow the standard renaming technique that you got in another post

*Now if you have enough time and patience, then it'd be best to start over from the section Installing Your First Dependency
If you don't do that, then you may follow the next steps, but I can't guarantee for success.

*

*Replace all the occurrence of CocoaPodsExample.xcworkspace with <NEW_PROJ_NAME>.xcworkspace in the Pods folder and possible places

*Close the Xcode project (if you had it open) and open <NEW_PROJ_NAME>.xcworkspace to continue and test if it worked

*Now, switch to ViewController.m and replace CocoaPodsExample with <NEW_PROJ_NAME> if exists

Thats it! The project should now build successfully.

A: I found the easy way to do it:

*

*change inside podfile project name.

*pod install

*open generated file xcworkspace
reload red files

Done!

A: I have just written a blog post on how to go about this. The most sure-fire procedure looks like:

*

*remove CocoaPods

*rename project

*re-add CocoaPods to your project

Consult the post for details.

A: I removed all cocoapods from my project with this GEM
https://github.com/kylef/cocoapods-deintegrate
then renamed my app in standard way and after fixing this issue with tests:
https://stackoverflow.com/a/27558736/1237542
everything worked OK.

A: I had this issue and used Wassif's answer, however it didn't work until I also selected the new executable (.app) file in Products > Scheme > Edit Scheme > Info
Also I couldn't find "Installing Your First Dependency" on CocoaPods.


text:
Q: Creating new column in data frame in R by comparing 2 existing columns and then deleting the latter I have yet another question which I have been trying to solve for the past few hours unsuccessfully. It involves some dataset manipulation in R. Imagine that I have the following sample dataset:
a,b,v,r
1,3,1,0
2,5,1,1
3,6,0,1
1,5,1,0
2,4,1,1
3,6,0,1

I need to create a third column (say m) by comparing the values of the columns [v,r] by the following rules. If v = 1, r = 0 then m = 0. If v = 1, r = 1, then m = 1 and if v = 0, r = 1, then m = 2. [v,r] can never take the values (0,0).
I am wondering how I can create the third column and also delete the columns v,r in one line. Thank you !

A: Using data.table (1.8.8):
DT <- data.table(DF)
DT[, `:=`(m = (!v) * 1 + r, v = NULL, r=NULL)]
#    a b m
# 1: 1 3 0
# 2: 2 5 1
# 3: 3 6 2
# 4: 1 5 0
# 5: 2 4 1
# 6: 3 6 2

A: It's not one line (so not nearly as snappy as @Arun's data.table solution) but here is one approach with within and ifelse:
within(mydf, {
  m <- ifelse(v == 1 & r == 0, 0, ifelse(v == 1 & r == 1, 1, 2))
  rm(v, r)
})
#   a b m
# 1 1 3 0
# 2 2 5 1
# 3 3 6 2
# 4 1 5 0
# 5 2 4 1
# 6 3 6 2

A: using transform from base packages
DF <- read.csv(textConnection("a,b,v,r\n1,3,1,0\n2,5,1,1\n3,6,0,1\n1,5,1,0\n2,4,1,1\n3,6,0,1"), header = TRUE)

transform(DF, m = (!v) * 1 + r, v = NULL, r = NULL)
##   a b m
## 1 1 3 0
## 2 2 5 1
## 3 3 6 2
## 4 1 5 0
## 5 2 4 1
## 6 3 6 2


text:
Q: Derivative Confusion I am confused about something.
In derivation we learnt that;
a^x = a^x . lna
Now the question that comes to mind is what is the difference when we have:
a^3 =

A: First, a nitpick: the process of finding a derivative is called differentiation, not derivation.
What you learnt in class was that the derivative of $a^{x}$ with respect to $x$ is $a^{x}\ln(a)$.
So to suggest we apply the result 'when $x=3$' is wrong. We cannot differentiate with respect to $3$ because it is a constant, not a variable. If we differentiate $a^{3}$ with respect to $x$, then we simply get $0$ because $a^{3}$ is constant.
Another note: The usage of $a$ here may be confusing. It has been used as a placeholder for any constant, and should be treated as such. $x$, on the other hand, is understood to take any value for a given $a$ (it is a variable).

A: If $a$ is a constant, then so is $a^3$, so the derivative of $a^3$ is $0$.
If you are evaluating the derivative of $f(x) = a^x\cdot \ln(x)$ at $x = 3$, then given we know by the rule for such general functions, $f'(x) = a^x\ln(a)$, and to evaluate this at $x = 3$ gives us $$f'(3) = a^3 \ln a$$
which is a constant value, and as soon as we know what $a$ is, we know $f'(3)$.

A: $(a^x)'=a^x \ln a$, then it is clear that the differentiation is with respect to $x$. Let's denote this function with $f$, so $f(x)=a^x$. Now, when you take $a^3$, it can be interpreted either as just a number (also considered as a constant function $g(x)=a^3$) or as $f(3)$.


text:
Q: Non-complex Integral of this function $$ \displaystyle\int_a^{b} \left(\frac{1}{\frac{\sqrt{x^2 + 356 x + 322}}{10000}}\right)^{4×5} \left(\frac{\sqrt{x^2 + 356 x + 322}}{10000}\right)^{1000} \frac{\left(π^{(-1 - 4×5 + 10000)} \displaystyle\binom{10000}{1 + 4 k} \right)}{\left(\frac{\sqrt{x^2 + 356 x + 322}}{10000}\right)} dx$$
I'm having a hard time coming up with a non-complex integral for this function. I know I can use euler substitution to handle the sqrt function but apart from that I seem stuck.

A: If you get rid of all constant, you end with the problem of the antiderivative
$$I_n=\int \Big[x^2 + 356 x + 322\Big]^{n+\frac 12}\,dx$$ Your case corresponds to $I_{489}$.
Write  $x^2 + 356 x + 322=(x-\alpha)(x-\beta)$ and use Euler third substitution
$$\sqrt{(x-\alpha)(x-\beta)}=(x-\alpha)t$$ which implies
$$x=\frac{\alpha-\beta t^2}{1-t^2}\quad \implies \quad  dx=2(\beta-\alpha)\frac{ t }{\left(1-t^2\right)^2}\,dt$$
$$I_n=2(\beta -\alpha )^{2 (n+1)}\int t^{2 (n+1)}\,\left(1-t^2\right)^{-(2 n+3)}\,dt$$ This looks very much like an incomplete beta function.


text:
Q: C# errors because of same name or just wrong syntax? For an exercise, I have to create a library of sorts. The project specs indicate that there should be a class Book and Borrower with fields:
+---------------------------+            +--------------------------+
|Book                       |            |Borrower                  |
+---------------------------+            +--------------------------+
|private string title       |            |private string name       |
|private string author      |            |private Book b            |
|private int ISBN           |

and these methods:
|public Book(string,string,int)|         |public Borrower(String)  |
|public string GetAuthor()     |         |public string GetName()  |
|public string GetTitle()      |         |public Book GetBook()    |
|public int GetISBN()          |         |public void SetBook(Book)|
|// add methods, if needed     |         |                         |
+------------------------------+         +-------------------------+

So I code this into my compiler but in my Borrower class I have errors like:
class Borrower
{
    private string name;
    private Book b;

    public Borrower(string n)
    {
        name = n;
    }

    public string GetName()
    {
        return name;
    }

    public Book GetBook()
    {
        return b;
    }

    public void SetBook(Book) //I get an error here (Identifier expected)
    {
        Book = b; // error here says Book is type but is used as a variable
    }
}

This is my Book class there are no errors here
class Book
{
    private string title, author;
    private int ISBN;

    public Book(string a, string b, int c)
    {
        title = a;
        author = b;
        ISBN = c;
    }

    public string GetAuthor()
    {
        return author;
    }

    public string GetTitle()
    {
        return title;
    }

    public int GetISBN()
    {
        return ISBN;
    }
}

Do I get the errors because I have a method Book which is the same as the name of the class or can I actually use the class as a method?

A: This method
public void SetBook(Book)
{
    Book = b;
}

should be rewritten as follows:
public void SetBook(Book b)
{
    this.b = b;
}

Otherwise the object passed as parameter would have no name. I used the same name as your field Book b, so I added this.b for disambiguation.


text:
Q: trying to get value from another table - sql I have two tables:
Food and Aisle.
Food contains the fields foodID, Name, Cost, and Sale Price.

Aisle contains foodaisleID, Aisle Name, Aisle Location AND foodID

What I am doing is displaying all of the foodaisleID's on my page along with the Aisle Name and the Aisles location (doing this from the Aisle table).
What I am trying to do is along with displaying all the foodaisleIDs, Aisle Name and Aisle Location, I'm trying to display the foodID and the food name too, but as that's in a different table I have no idea how to display the corresponding one. (If I choose a specific Aisle, I want to display only the foods in that aisle).
My current SQL statement is:
"SELECT * FROM aisle WHERE foodaisleID = $foodaisleID"

and then I am echo'ing out the aisle name etc, any idea how I could incorporate the other table into the statement so I can echo the food name and cost too?
I have looked at "joins" but not sure how to actually implement them in

A: Might be worth making foodAisleID a foreign key inside the Food table (at this point I assume that it is a primary key inside the Aisle table, so correct me if I'm wrong) so that you display the foodID and food name that correspond to the correct foodAisleID. Then you could use a join to retrieve the correct data from both tables.

A:  SELECT * FROM aisle JOIN food ON Food.FoodId = Aisle.FoodId WHERE foodaisleID = $foodaisleID

Should do the trick


text:
Q: How to install older Django I am using Pycharm and want to install an older version of Django. However, PC only seems to install V2. How can I configure Pycharm to install an older version?
This is about installing an older version, NOT changing a version that has already been installed. I want to configure Pycharm to INSTALL a specific version.

A: Specifically for installing through PyCharms UI, you can specify which version of a package you want to install in the package manager. Navigate to
File -> Settings(or Preferences on MacOs) -> Project: [project name] -> Project interpreter
and click on the + sign under the cog icon. Then search for Django and specify the version you want to install from the drop down menu below the Description field.
However, if you want to install a different version through the terminal, you should write something along the lines of
pip install Django==[your_version]

A: As far as I know, there is no way to change the version on creating a new project unless you use your own interpreter when creating a new project.
So you can first create your virtual environment with the django version you want, and then select that venv when creating a new django project:
virtualenv venv
source venv/bin/activate
pip install django==2.1

When you want to create a new project, select Existing Environment instead of New environment using... and use your custom venv.

A: It's not possible at the moment. The only workaround, as mentioned by Pedram, is to use the existing interpreter with needed version of Django installed.
I filed a feature request about that, feel free to vote and leave comments.
You may also find useful the following feature request https://youtrack.jetbrains.com/issue/PY-33804


text:
Q: Jar file is not executed when used in shell script in a crontab? Below is my shell-script located in /app/Scripts.
Test.sh :
#!/bin/sh
usr/bin/java -jar /app/Scripts/emailJAR.jar >> /app/pvs/test.txt
echo $(date) >> /app/Scripts/test.txt

I have scheduled cron-tab as * * * * * /app/Scripts/Test.sh
I am getting the output of "echo $(date)" every minute, but, not usr/bin/java -jar /app/Scripts/emailJAR.jar.
Can anybody have any advice ?
Script location,Jar location, executable permission all are set. Still only the java -jar command executed thru crontab.
Mystery, I am able to run the script manually.
Please help me on this issue .

A: >> /app/pvs/test.txt

Looks like it may be taken as arguments into the .jar file, like so:
java -jar myJar.jar arg1 arg2 arg3 etc

You can do
System.out.println(Arrays.asList(args));

In your programs main method, to test whether or not my statement is true.
Or the output you are looking for is being redirected to the out-stream of the test.txt file you reference
I hope you tested the jar works prior to trying to place it in the crontab, as well as the command itself.

A: In the second line, try changing usr/bin/java to /usr/bin/java. As currently written, it only works when executed from the root directory, and crontab is probably executing from some other directory.


text:
Q: How to make conda virtual environments persistent and available for tools such as Jupyter Notebook? When a conda environment is activated in a shell window, the environment is only active in that window (i.e. not persistent). So when I navigate to the project location in another window, the "root" virtual environment is active.
Am I missing something or is this the intended behaviour?
How to give tools such as Jupyter Notebook access to the created environment?

A: Register a (python) notebook kernel:
Let's suppose you have created a conda environment named jupyter-env35 with conda create -n jupyter-env35 python=3.5 and now want to use it in jupyter.
Installing and registering a python kernel in the environment will make it available over the graphical notebook interface.
To do so, first install the ipython kernel:
conda install -n jupyter-env35 ipykernel

Then activate the environment and register the kernel:
source activate jupyter-env35
ipython kernel install --user --name jupyter-env35

When you now fire up juypter, it will show jupyter-env35 as a kernel in the list of available kernels. If you select it, all packages installed into juypter-env35 will be available.
Unregister a notebook kernel:
If you want delete the kernel from the notebook interface, jupyter --data-dir, will print out jupyter's data directory.
Navigate to the printed folder, find the subfolder kernels and delete the folder with the name of your kernel (here jupyter-env35). After that the kernel will not show up in jupyter anymore.


text:
Q: How to set cookies for other domain with AJAX request Let's assume I own 2 web apps hosted on foo.com and bar.com. bar.com allows cross origin requests from foo.com
Is it possible to set a cookie for bar.com by making an ajax request from foo.com to bar.com?


text:
Q: Adapter changing images upon fast scrolling hey guys I've this adapter that retrieves news list populated from a web service and it is working just fine but the problem is when I scroll fast the images (of the unseen rows) are being substituted, can you help?
Here's my adapter:
public class NewsAdapter extends RecyclerView.Adapter<NewsAdapter.RecyclerViewHolder> {

private List<New> news;
private Activity context;
private RecyclerViewOnItemClickListener itemClickListener;
private boolean tabletSize;

public NewsAdapter(Activity context, ArrayList<New> newss, RecyclerViewOnItemClickListener itemClickListener, boolean tabletSize) {
    this.news = newss;
    this.context = context;
    this.itemClickListener = itemClickListener;
    this.tabletSize = tabletSize;
}

@Override
public void onBindViewHolder(final RecyclerViewHolder holder, int position) {

    holder.title.setText(news.get(position).getTitle());
    //holder.date.setText(news.get(position).getPublishDate());

    String date = news.get(position).getPublishDate().substring(0,news.get(position).getPublishDate().indexOf("T"));
    /*Date date2= null;
    DateFormat formatter = new SimpleDateFormat("yyyy-MM-DD");
    try {
        date2 = (Date) formatter.parse(date);
    }catch (Exception e){

    }
    SimpleDateFormat newFormat = new SimpleDateFormat("dd-MM-yyyy");
    String finalString = newFormat.format(date2);*/
    if (MyApplication.lang.equals("en")) {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-d");
        Date date3 = null;
        try {
            date3 = sdf.parse(date);
        } catch (Exception e) {

        }
        sdf = new SimpleDateFormat("EEEE, MMMM yyyy");
        String format = sdf.format(date3);
        System.out.print("Result: " + format);
        holder.date.setText(format);
    }else{
        Locale locale = new Locale("ar");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-d");
        Date date3 = null;
        try {
            date3 = sdf.parse(date);
        } catch (Exception e) {

        }
        sdf = new SimpleDateFormat("EEEE, MMMM yyyy",locale);
        String format = sdf.format(date3);
        System.out.print("Result: " + format);
        Log.wtf("result",format);
        holder.date.setText(format);
        //holder.date.setText(date);
    }

    if(news.get(position).getPictures().size()!=0)

        Picasso.with(context)
                .load(news.get(position).getPictures().get(0).getFilePath()).placeholder(R.drawable.defaultbg)
                //.resize(250,200)
                //.rotate(90)
                .into(holder.img, new com.squareup.picasso.Callback() {
                    @Override
                    public void onSuccess() {
                        //do smth when picture is loaded successfully
                        holder.img.setAlpha((float)1);
                    }

                    @Override
                    public void onError() {
                        //progress.setVisibility(View.GONE);
                        //do smth when there is picture loading error
                    }
                });

}

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

public interface RecyclerViewOnItemClickListener {
    void onItemClicked(View v, int position);
}

public RecyclerViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View layoutView;

        layoutView = LayoutInflater.from(parent.getContext()).inflate(R.layout.news_list_item, parent,false);
        RecyclerViewHolder rcv = new RecyclerViewHolder(layoutView);
        return (rcv);
}

public class RecyclerViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {

    public TextView title,date;
    public ImageView img;
    protected  View itemView;
    LinearLayout rel;

    public RecyclerViewHolder(View itemView) {
        super(itemView);
        this.itemView = itemView;
        this.itemView.setOnClickListener(this);

        title=(TextView)itemView.findViewById(R.id.title);
        date=(TextView)itemView.findViewById(R.id.tvDate);
        img=(ImageView)itemView.findViewById(R.id.img);
        rel=(LinearLayout)itemView.findViewById(R.id.background);
        Log.wtf("received log",""+tabletSize);
        if(!tabletSize)
            Actions.setViewResizingListRow(itemView,context);
        else
            Actions.setTabletViewResizingListRow(itemView,context);
        if(MyApplication.lang.equals("en")) {
            title.setTypeface(MyApplication.opensanregular);
            date.setTypeface(MyApplication.opensanslight);

        }
        else
            date.setTypeface(MyApplication.gdenartwolight);
        if (MyApplication.lang.equals("ar")) {
            rel.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
        }
    }

    @Override
    public void onClick(View view) {
        itemClickListener.onItemClicked(view, getLayoutPosition());
    }
}
}

A: Put this line after you set your adapter in your activity
yourRecyclerView.setItemAnimator(null);


text:
Q: Getting sqlexception in servlet I have this code:
    public class cuemath extends HttpServlet{
   /**
    *
    */
   private static final long serialVersionUID = 1L;
   String Q;
   String DOWNLOAD="";

   ArrayList<String> _DOWNLOAD_ ;

   public void doGet (HttpServletRequest req,
                   HttpServletResponse res)
   throws ServletException, IOException
   {
     PrintWriter out = res.getWriter();

   try{Connection myCon;

   _DOWNLOAD_ =new ArrayList<String>();

   Statement myStmt;

   String userName = "xxxx";
   String password = "xxxxxxxx";
   String url= "jdbc:mysql://localhost:3306/maths?user="
   +userName
   +"&password="
   +password;

   Class.forName ("com.mysql.jdbc.Driver").newInstance ();

   myCon = DriverManager.getConnection (url);

   myStmt = myCon.createStatement();
   ResultSet rs;

   String pm=req.getParameter("LessonId").trim();
   int p=Integer.parseInt(pm);

   String query="select * from lessons where LESSONS_ID="+p;
   rs= myStmt.executeQuery(query);

   out.println("<CUEMATH>");
   out.println("<lessonid>");

           out.println(rs.getString("LESSONS_ID"));

   out.println("</lessonid>");

   out.println("<lessontext>");

           out.println(replaceTags(rs.getString("LESSONS_TEXT")));

   out.println("</lessontext>");
   out.println("</CUEMATH>");

   }
   catch (Exception e) {
        e.printStackTrace();
}
   }
    private  String replaceTags(String Input){

           if(!Input.equals(null)){

                   String one =">";
                   String two ="<";
                   String five ="\n";
                   String seven ="\\t";

                   String three =">";
                   String four ="<";
                   String six = "backslash";
                   String eight="tabspace";

                   Input = Input.replaceAll(one, three);
                   Input = Input.replaceAll(two, four);
                   Input = Input.replaceAll(five, six);
                   Input = Input.replaceAll(seven, eight);

                   Input=Input.replaceAll(five, six);
                   Input = Input.replaceAll(one, three);
                   Input = Input.replaceAll(two, four);

                   Input=Input.replaceAll(five, six);
                   return Input;

           }
           else
                   return "";

   }

}
I am getting this error log:
               java.sql.SQLException
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.ResultSetImpl.checkRowPos(ResultSetImpl.java:815)
at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5528)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5448)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5488)
at cue.math.cuemath.doGet(cuemath.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:189)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:91)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:92)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:325)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

I am generating a xml from database values.
I am newbie can anyone help me with this problem?

A: Before you start retrieving results from the ResultSet object, you should add a call to rs.next()
This call returns a boolean to indicate if a further row is available (in this instance, the first row), and moves the internal result set pointer to the next row of results (in this case the first row).
Often, you will see this in code:
if (rs.next())
{
  // retrieve results from rs object
}

or for multiple rows
while (rs.next())
{
  // each iteration through this loop
  // is a separate result row...
}

A: Better check the value of 'p' which you are appending to the end of the query once.
The problem is with the query creation itself. run the same query in the editor(with the value of p which you are getting). Double check it.

A: I think Ajj is right. The specific problem I can see after looking at your code is that LESSONS_ID field is a string and you are appending it to your query without quoting it.
String query="select * from lessons where LESSONS_ID="+p;

if LESSONS_ID had the value "basics" (say), then the query being sent to MySQL is:
select * from lessons where LESSONS_ID=basics

Which is not going to work. If you quote it in your string using either single or double quotes then it would work:
String query="select * from lessons where LESSONS_ID='"+p+"'";

query is now:
select * from lessons where LESSONS_ID='basics'

You could also consider using the PreparedStatement class in preference to Statement as that handles the parameter types reducing such issues.
You can look here for a PreparedStatement example.
Hope that helps.


text:
Q: Composer Bug after Contao-Update to 4.13 I updated my Contao-Project from 4.9 with PHP 7.4 to 4.13 with PHP 8.1.
When I execute "composer update" I run into an infinite loop:
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package dma/dma_elementgenerator is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
63 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Loading composer repositories with package information                                                                                Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Package dma/dma_elementgenerator is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
63 packages you are using are looking for funding.
Use the `composer fund` command to find out more.
Loading composer repositories with package information   `

"composer update --no-scripts" produces the same result.
I had to update my installed packages to make the compatibility with PHP8.1 and Contao 4.13 possible. I also had to update my Metamodels-Package to version 2.3. After installing requiering the updated Metamodels-Models-Bundles the error took place. Is here anybody else with this problem?
additional note: The Metamodels 2.3 - Package comes from a private repository...
My composer.json requires:
"require": {
        "contao-community-alliance/contao-multicolumnwizard-frontend-bundle": "^2.3@dev",
        "contao-community-alliance/contao-textfield-multiple-bundle": "^2.3@dev",
        "contao-community-alliance/dc-general": "^2.3@dev",
        "contao-community-alliance/dc-general-contao-frontend": "^2.3@dev",
        "contao/calendar-bundle": "4.13.*",
        "contao/comments-bundle": "4.13.*",
        "contao/conflicts": "*@dev",
        "contao/faq-bundle": "4.13.*",
        "contao/listing-bundle": "4.13.*",
        "contao/manager-bundle": "4.13.*",
        "contao/news-bundle": "4.13.*",
        "contao/newsletter-bundle": "4.13.*",
        "delahaye/dlh_googlemaps": "^2.4",
        "dma/dma_elementgenerator": "dev-develop",
        "imi/composer-scripts-contao": "^1.0",
        "imi/database-helper": "^0.3.1",
        "imi/imi_mm_changelanguage": "dev-master",
        "kraken-io/kraken-php": "^1.6",
        "madeyourday/contao-rocksolid-columns": "^2.0",
        "menatwork/contao-multicolumnwizard-bundle": "^3.4",
        "metamodels/attribute_alias": "^2.3@dev",
        "metamodels/attribute_checkbox": "^2.3@dev",
        "metamodels/attribute_color": "^2.3@dev",
        "metamodels/attribute_combinedvalues": "^2.3@dev",
        "metamodels/attribute_contentarticle": "^2.3@dev",
        "metamodels/attribute_country": "^2.3@dev",
        "metamodels/attribute_decimal": "^2.3@dev",
        "metamodels/attribute_file": "^2.3@dev",
        "metamodels/attribute_geodistance": "^2.3@dev",
        "metamodels/attribute_langcode": "^2.3@dev",
        "metamodels/attribute_levenshtein": "^2.3@dev",
        "metamodels/attribute_longtext": "^2.3@dev",
        "metamodels/attribute_numeric": "^2.3@dev",
        "metamodels/attribute_rating": "^2.3@dev",
        "metamodels/attribute_select": "^2.3@dev",
        "metamodels/attribute_tablemulti": "^2.3@dev",
        "metamodels/attribute_tabletext": "^2.3@dev",
        "metamodels/attribute_tags": "^2.3@dev",
        "metamodels/attribute_text": "^2.3@dev",
        "metamodels/attribute_timestamp": "^2.3@dev",
        "metamodels/attribute_translatedalias": "^2.3@dev",
        "metamodels/attribute_translatedcheckbox": "^2.3@dev",
        "metamodels/attribute_translatedcombinedvalues": "^2.3@dev",
        "metamodels/attribute_translatedcontentarticle": "^2.3@dev",
        "metamodels/attribute_translatedfile": "^2.3@dev",
        "metamodels/attribute_translatedlongtext": "^2.3@dev",
        "metamodels/attribute_translatedtablemulti": "^2.3@dev",
        "metamodels/attribute_translatedtabletext": "^2.3@dev",
        "metamodels/attribute_translatedtext": "^2.3@dev",
        "metamodels/attribute_translatedurl": "^2.3@dev",
        "metamodels/attribute_url": "^2.3@dev",
        "metamodels/contao-frontend-editing": "^2.3@dev",
        "metamodels/core": "^2.3@dev",
        "metamodels/dropzone_file_upload": "^2.3@dev",
        "metamodels/filter_checkbox": "^2.3@dev",
        "metamodels/filter_fromto": "^2.3@dev",
        "metamodels/filter_perimetersearch": "^2.3@dev",
        "metamodels/filter_range": "^2.3@dev",
        "metamodels/filter_register": "^2.3@dev",
        "metamodels/filter_select": "^2.3@dev",
        "metamodels/filter_tags": "^2.3@dev",
        "metamodels/filter_text": "^2.3@dev",
        "omosde/contao-om-search": "^1.0",
        "php": "^8.1",
        "psi/news4ward_archive-menu": "*",
        "psi/news4ward_categories": "dev-master",
        "psi/news4ward_comments": "dev-master",
        "psi/news4ward_related": "dev-master",
        "psi/news4ward_tags": "dev-master",
        "rapid-data/captcha-bundle": "dev-master",
        "symfony/http-client": "*",
        "terminal42/contao-changelanguage": "^3.1",
        "terminal42/contao-countryselect": "^1.4",
        "terminal42/contao-leads": "^1.4",
        "terminal42/notification_center": "^1.5"
    },

"composer update --no-scripts" produces the same result.

A: Check your composer.json for any plugin configuration related to php-http/discovery. If the plugin for that package is enabled, and you are using v1.15.0 of that package, Composer might enter a loop on running the plugin. This is reported as a bug in their issue tracker
Steps to resolve this:

*

*disable the plugin (set php-http/discovery: false in the allow-plugin section)

*update the package to v1.15.1 where this bug is fixed


text:
Q: HD video editing system with Truecrypt I'm looking to do hi-def video editing and transcoding on an unencrypted standard partition, with Truecrypt on the system partition for sensitive data.  I'm aiming to keep certain data private but still have performance where needed.
Goals:

*

*Maximum, unimpacted, performance possible for hi-def video editing, encryption of video not required

*Encrypt system partition, using Truecrypt,  for web/email privacy, etc. in the event of loss

In other words I want to selectively encrypt the hard drive - i.e. make the system partition encrypted but not impact the original maximum performance that would be available to me for hi-def/HD video editing.
The thinking is to use an unencrypted partition for the video and set up video applications to point at that. Assuming that they would use that partition only for their workspace and not the encrypted system partition, then I should expect to not get any performance hit.  Would I be correct?
I guess it might depend on the application, if that app is hard-wired to use the system partition always for temporary storage during editing and transcoding, or if it has to be installed on the C: system partition always. So some real data on how various apps behave in the respect would be useful, e.g. Adobe, Cyberlink, Nero etc. etc.
I have a Intel i7 Quad-core (8 threads) 1.6Ghz (up to 2.8Ghz turbo-boost) 4Gb, 7200rpm SATA, nvidia HP laptop.
I've read the excellent posting about the general performance impact of truecrypt but the benchmarks weren't specific enough for my needs where I'm dealing with HD-video and using a non-encrypted partition to maintain max performance.

A: You may want to use this method. Basically you would hide your OS. If you would work on the unencrypted partition (or on an external drive, whatever), there wont be any drawback from using truecrypt. Basically the performance drawback is not much if you use a middle rated encryption. Don't know about your job where you would need such technology. (You can simply add a HDD password using your BIOS. Thats only possible to crack if the person who stole it replaces the whole electronics as far as I know.. but it may be impossible even like that.)

A: I think I'll just try out my own suggestion: to have 2 partitions: 1 for the encrypted OS and 2 for the uncrypted area to hold the video.
I have no requirement to encrypt the video so would like to think that the performance of retrieval would not be impacted during an edit section. Given that the video is for public broadcast or to be shared online anyway there is no need to encryption to hide this material. Unless of course it becomes very commercially lucrative - and for the original footage to be stolen that might harm that revenue. But in reality I'm a hobbyist film maker so that ultimate aim may not be realised :)
Regarding my job, it's not really necessary to encrypt the operating system drive, but preferable. The main reason why I would want to do this is to protect emails and any company or client sensitive work I may have in the event of loss or theft.
Having already used truecrypt I have found that to be suitable for the above aim.


text:
Q: Android geopoint from location/locality I have seen numerous examples of getting location name from Geocoder and then get addresses by getFromLocation() but how can I get geoPoint for a location by name. User enters a city name and I turn them into a geopoint and show on map. Is there a way in Android or google API's.
I dont mean current location but any location by giving its name. Basically I want it to allow user to get weather update for remote cities.I am able to do so for current location by getting current locality.

A: Try this, you'd better run it in a separately thread rather than UI-thread. You can both get Address and GeoPoint by this method.
public static Address searchLocationByName(Context context, String locationName){
    Geocoder geoCoder = new Geocoder(context, Locale.getDefault());
    GeoPoint gp = null;
    Address ad = null;
    try {
        List<Address> addresses = geoCoder.getFromLocationName(locationName, 1);
        for(Address address : addresses){
            gp = new GeoPoint((int)(address.getLatitude() * 1E6), (int)(address.getLongitude() * 1E6));
            address.getAddressLine(1);
            ad = address;
        }
    } catch (IOException e) {
        e.printStackTrace();
    }
    return ad;
}

A: use the below url to get lat and long from the address through reverse geo coding::
http://maps.googleapis.com/maps/api/geocode/json?address=hyderabad&sensor=false

or
http://maps.googleapis.com/maps/api/geocode/xml?address=hyderabad&sensor=true

A: to get Lat and Long co-ordinates from address is geocoding not reverse geocoding.
Simple get address convert it using geocode and, once you got the co-ordinates show location on map.


text:
Q: Отсутствует обязательный для компилятора член Столкнулся с такой проблемой: В части кода после процесса сборки появляется ошибка:

"Ошибка    CS0656  Отсутствует обязательный для компилятора член "Microsoft.CSharp.RuntimeBinder.Binder.Convert"

Указывал директиву Microsoft.CSharp в классе - безрезультатно.
В документации microsoft нашел описание ошибки:

Отсутствует обязательный для компилятора член "объект.член"
  Существует одна из следующих проблем:
  - Установка среды CLR повреждена.
  - Имеется ссылка на сборку, определяющая тип, который также находится в среде CLR. Однако тип сборки не определяет путь, который ожидает компилятор C#.
  Проверьте ссылки, чтобы убедиться, что используется правильная версия среды CLR.

Ссылку добавлял через Менеджер ссылок -> Com - > Windows Script Host Object Model
Причина скорее всего во втором варианте, но я же по сути ничего извне не добавлял

A: Как сказано вот в этом вопросе, все дело в том, что новая студия для COM-ссылок генерирует интерфейсы, которые используют dynamic. А dynamic не поддерживается в старых фреймворках (2.0-3.5).
Соответственно, вам поможет одно из следующих решений:

*

*перейти на .NET Framework 4.0;

*как подсказали вот в этом ответе, можно выключить настройку "Embed interop types" (в русской версии должно быть что-то про встраивание или внедрение) для ссылки на COM-библиотеку - это отключит новый механизм импорта;

*можно сгенерировать управляемую библиотеку при помощи утилиты tlbimp и сослаться на нее в проекте;

*наконец, можно самостоятельно написать интерфейсы и классы, которые обычно студия генерирует за вас.


text:
Q: Reactive Extensions... Examples in CRUD application I am just coming to grips with Reactive Extensions but still haven't had that "A-Ha" moment, the moment when it all seems to fit into place. As a result of this, I need some help and want to know what kind of a role reactive extensions might have in a simple CRUD program.
Does anyone have any examples how RX extensions has helped in their CRUD application. As you can imagine I am writing a CRUD application in C# ... any examples are accepted and this is posted so that I can think about how RX might fit into the type of programming that I am doing.
Perhaps you might list how a programming task has benefited from RX and how the task was being accomplished prior to the use of RX.

A: I have done this kind of thing that has worked well:
public interface IStorage : IDisposable
{
    IObservable<int> GetOperationsCount(IScheduler scheduler);

    IObservable<Node> FetchNodes(IObservable<NodeId> nodeIds, IScheduler scheduler);
    IObservable<Node> StoreNodes(IObservable<Node> nodes, IScheduler scheduler);
}

It allows me to perform a fetches and stores on a background thread and have values returned to me on the UI thread quite easily.
Each call to StoreNodes also sets up a transaction and I can get any errors from the return observable.
I also use the GetOperationsCount observable to display to the user the number of pending operations, etc.
My personal experience with Rx has made me want to use it for anything asynchronous at all - events, begin/end invoke, async, tasks, thread, etc. It makes everything fit under one model and can be a significant code saver.

A: if you do static CRUD (get a window/dialog with create, read, update, write, whatever) then I guess it might only help you on your UI. For example, maybe you want some kind of AutoCompletion of certain inputs. Or you have to query a service for additional info to show.
Then RX can help you do this. It will hide many async-realated difficulties and gives you readable, declerative expressions you can easily read and quickly do.
In this sense it's just the same as LINQ only for UI/async

A: A typical CRUD application have some UI (winform, WPF etc) and a data store to fetch data and show in the UI. The data flow between these two components (UI and data store) can be modeled using Rx.
Using Rx we can connect the 2 components (UI and data store) such as:
UI can exposes 3 observable for Create, Update and Delete (ex: which are passed in the constructor to data store). For ex: The Submit button event can be mapped to generate Create observable values and similarly for Update and delete. So basically the data store needs to subscribe to these 3 observable and doesn't need to bother how the data is generated (this will also help in UT as you can create fake observable easily).
Read would be a simple read method on data store as that is about pulling data on demand.
So basically Rx has worked as a abstraction to compose the 2 components.

A: Maybe I am wrong, consider the two answers. MS tends to divide their bussiness into to many layers, because they have an interest here.
CRUD is the physical implementation - Create - Read - ...
But UI seems to be logical - in the context - for the user ...
Sometimes you need to have a layer - bussiness layer - that controls the flow to and from RDMS.
Imo this is very complex.
In finance business the "update" or "delete" action is a replication of the current row with a new timestamp.
This makes it difficult to have a clean operation - physical at least ...
And on top of all this yout might consider that CRUD is just a part of a transaction - making "a logical unit of work" in flight until all is ok - then you should do a COMMIT.
Hope this will help ...

A: A CRUD app will have some sort of search functionality. You could implement a textbox search with "type and wait to search" just like in my demo that I recently wrote on my blog :
http://blog.andrei.rinea.ro/2013/06/01/bing-it-on-reactive-extensions-story-code-and-slides/
Essentially using Throttle and other Reactive Extensions you can create a quick search feature.

A: Rx is great for collections. Right now, I can't imagine working with a language that doesn't have LINQ like functionality.
Recently, it became the same for Rx, mostly because of a library that uses Rx for LINQ: DynamicData
ReadOnlyObservableCollection<TradeProxy> list;

var myTradeCache = new SourceCache<Trade, long>(trade => trade.Id);
var myOperation = myTradeCache.Connect()
        .Filter(trade=>trade.Status == TradeStatus.Live)
        .Transform(trade => new TradeProxy(trade))
        .Sort(SortExpressionComparer<TradeProxy>.Descending(t => t.Timestamp))
        .ObserveOnDispatcher()
        .Bind(out list)
        .DisposeMany()
        .Subscribe()

Basically, you can create LINQ like queries, that refresh themselves dynamically after any change - new item in the source list (just DTO is enough!), some property change, signal from elsewhere (passed as observable), etc.
You want to display number of entities with a flag? One liner.
You want to display easily display dynamic groups based on property chosen by user? One liner.
You want to do paging? 3 lines :P
Also, there is a MVVM framework called ReactiveUI - it provides you with a ReactiveCommand and few more tricks.
Among them is binding framework with converters based on lambdas, ability to react in a View to something very specific that happened in your VM, managing activation of view models (like initial command execution, but not in constructor).
You want the login button to be enabled only if user and password are not empty?
Login = ReactiveCommand.CreateFromTask(async () => { /* your async implementation, it can return a value! */},
             this.WhenAnyValue(x => x.Username, x => x.Password, (user, psw) => !string.IsNullOrEmpty(user) && !string.IsNullOrEmpty(psw)); // define when the command can execute by providing IObservable<bool>

    Login.Where(x => x == true) // only successful logins, ==true for clarity
        .InvokeCommand(DisplayMainScreen); // or something

In view you can do:
Login.Where(x => !x).Subscribe(_ =>{ // if login failed, set focus on password and select all text so user can just retype the password
          PasswordBox.SelectAllText(); // can't remember exact methods, but you get the idea
          PasswordBox.SetFocus();
       });

It just becomes very natural for you to make functionality like "When something, do this"


text:
Q: NX monorepo testing with jest: "SyntaxError: Unexpected token 'export'" for local lib We have recently moved a project with nestJS and React into a Nx Monorepo.
We have converted some parts into libs so we can reuse them easily. This all works nice except when testing. When I run npx nx run-many --all --target=test I get some errors:
           ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){export * from './lib/web-types';
                                                                                ^^^^^^

           SyntaxError: Unexpected token 'export'

I have seen and tried out all the variations I see of this problem and its solutions, but it seems they fix the issue when using 3rd party libs such as lodash etc. Here it is just a lib we write in our project.
It seems to me that it should be something very silly and simple, but I can not find a solution.


text:
Q: Filter rule to move emails related to one person in Outlook I have Outlook configured for mails and I want to create a rule such that matches where person "X" is either one of the following:

*

*Sender

*in the CC list

*in To list.

I need to move those emails into a specific folder.
How can I create this filter?

A: As Outlook handles the mentioned conditions as "AND" assignments I think you will need to define 3 rules to achieve this.

A: I use the "with text in the message header" rule, and add email addresses to it.


text:
Q: Why does Beautiful Soup Return filename instead of full link? Using below simple code, I'm facing the following problem: why does Beautiful Soup return only the file names rather than the full link addresses?
from bs4 import BeautifulSoup
import urllib2
url = 'http://www.gks.ru/bgd/free/B00_25/IssWWW.exe/Stg/d000/I000650R.HTM'
data = urllib2.urlopen(url).read()
page = BeautifulSoup(data,'lxml')
for link in page.findAll('a'):
       l = link.get('href')
       print l

All I'm getting as output:
I000660R.HTM
I000670R.HTM
I000680R.HTM
I000690R.HTM
I000700R.HTM
I000706R.HTM
I000707R.HTM
I000708R.HTM
I000709R.HTM
000710.HTM
000711.HTM
000712.HTM
000713.HTM
000714.HTM
000715.HTM

A: Problem solved, given the relativeness of the links I concatenated the output with the root of the url. Thanks.


text:
Q: Which probabilities to rely on? In a hypothetical situation, you are trying to determine whether your landlord is a fraud. You know that 1% of landlords are frauds. But then, you also find out that your landlord is a gambler and 20% of gamblers are frauds.
a) Which probability do you rely on to determine whether your landlord is a fraud?
b) Let's say I give a new information that 5% of landlords are gamblers, would your answer change? What would the probability that your landlord is a fraud be?
A random scenario that I think of. Hopefully someone can help me understand the statistics behind it.
For part (a), intuitively, you would want to say that the probability is 20% as it is a higher number and you want to be conservative in your estimation. But then, you can rethink the scenario as 99% of landlords are non-frauds and 80% of gamblers are non-frauds. If you go with the higher number, then you rely on the 99% non-fraud or 1% fraud.
For part (b), I wonder that if you introduce a new information such as 5% of landlords are gamblers, would there be some kind of Bayesian probability that would put the fraud probability somewhere between 1% and 20%.

A: Let's start with part (b)
For Part (b), you use Bayes Theorem. There's a 95% chance he is not a gambler, and if you know he is not a gambler, the chance he's frauding you is only 1%. if he is a gambler (a 5% chance), then the chances he's a fraud go up to 20%. Basically, you take a weighted average of the two probabilities with this equation:
.95*.01 + .05*.20
This comes out to .0195, or 1.95%.
Now, for Part (a), we use the same set up. Since we know he's a gambler, the probability he's a gambler is 100% and the probability that he's not a gambler is 0%. We can take our equation from before and modify it with these new probabilities:
0*.01 +1.0*.20
This gets us the intuitive 20%


text:
Q: regex javascript - match multiple search terms ignoring their order I would like to find all the matches of given strings (divided by spaces) in a string.
(The way for example, iTunes search box works).
That, for example, both "ab de" and "de ab" will return true on "abcde" (also "bc e a" or any order should return true)
If I replace the white space with a wild card, "ab*de" would return true on "abcde", but not "de*ab".
[I use * and not Regex syntax just for this explanation]
I could not find any pure Regex solution for that.
The only solution I could think of is spliting the search term and run multiple Regex.
Is it possible to find a pure Regex expression that will cover all these options ?

A: Returns true when all parts (divided by , or ' ') of a searchString occur in text. Otherwise false is returned.
filter(text, searchString) {
    const regexStr = '(?=.*' + searchString.split(/\,|\s/).join(')(?=.*') + ')';
    const searchRegEx = new RegExp(regexStr, 'gi');
    return text.match(searchRegEx) !== null;
}

A: I'm pretty sure you could come up with a regex to do what you want, but it may not be the most efficient approach.
For example, the regex pattern (?=.*bc)(?=.*e)(?=.*a) will match any string that contains bc, e, and a.
var isMatch = 'abcde'.match(/(?=.*bc)(?=.*e)(?=.*a)/) != null; // equals true

var isMatch = 'bcde'.match(/(?=.*bc)(?=.*e)(?=.*a)/) != null; // equals false

You could write a function to dynamically create an expression based on your search terms, but whether it's the best way to accomplish what you are doing is another question.

A: Alternations are order insensitive:
"abcde".match(/(ab|de)/g); // => ['ab', 'de']
"abcde".match(/(de|ab)/g); // => ['ab', 'de']

So if you have a list of words to match you can build a regex with an alternation on the fly like so:
function regexForWordList(words) {
  return new RegExp('(' + words.join('|') + ')', 'g');
}
'abcde'.match(['a', 'e']); // => ['a', 'e']

A: Try this:
var str = "your string";
str = str.split( " " );
for( var i = 0 ; i < str.length ; i++ ){
    // your regexp match
}

A: This is script which I use - it works also with single word searchStrings
var what="test string with search cool word";
var searchString="search word";
var search = new RegExp(searchString, "gi"); // one-word searching

// multiple search words
if(searchString.indexOf(' ') != -1) {

    search="";
    var words=searchString.split(" ");

    for(var i = 0; i < words.length; i++) {

        search+="(?=.*" + words[i] + ")";

    }

    search = new RegExp(search + ".+", "gi");

}

if(search.test(what)) {

    // found

} else {

    // notfound

}

A: I assume you are matching words, or parts of words. You want space-separated search terms to limit search results, and it seems you intend to return only those entries which have all the words that the user supplies. And you intend a wildcard character * to stand for 0 or more characters in a matching word.
For example, if the user searches for the words term1 term2, you intend to return only those items which have both words term1 and term2. If the user searches for the word term*, it would match any word beginning with term.
There are suitable regular expressions which are equivalent to this search language and can be generated from it.
A simple example, the word term, can be asserted in regex by converting to \bterm\b. But two or more words which must match in any order require lookahead assertions. Using extended syntax, the equivalent regex is:
(?= .* \b term1 \b )
(?= .* \b term2 \b )

The asterisk wildcard can be asserted in regex with a character class followed by asterisk. The character class identifies which letters you consider to be part of word. For example, you might find that [A-Za-z0-9]* fits the bill.
In short, you might be satisfied if you convert an expression such as:
foo ba* quux

to:
(?= .* \b foo            \b )
(?= .* \b ba[A-Za-z0-9]* \b )
(?= .* \b quux           \b )

That is a simple matter of search and replace. But do be careful to sanitize the input string to avoid injection attacks by removing punctuation, etc.

A: I think you may be barking up the wrong tree with RegEx. What you might want to look at is the Levenshtein distance of two input strings.
There's a Javascript implementation here and a usage example here.


text:
Q: Choosing an SSL certificate We are looking to get a wildcard SSL certificate for the company websites, and we are shocked to discover how messy the certificate market is.
Our sites will mainly be accessed in computer browsers. It isn't super important that the certificate is supported by mobile browsers, but it wouldn't hurt for it to be supported by at least newer smartphone browsers.
However, it is important that the certificate will work with mobile apps that we create (currently an Android app, but eventually iPhone and Windows Phone 7). These apps will access a REST web service using the wildcard certificate.
The cheapest wildcard certificate available on the Danish market is RapidSSL for about $100/yr. Will this fit our needs or do we need to go more expensive?
Thanks.

A: RapidSSL does not provide an extended validation certificate.
This is an example site (one of my test systems) with a RapidSSL certificate: https://leogarten.de/
If you open it with Chrome the URL has a green https tag. But with extended validation the URL gets a green box.
This is an example for such a site: https://www.paypal.com/de/cgi-bin/webscr?cmd=_login-run
Googles support pages explain the difference: https://www.google.com/support/chrome/bin/answer.py?answer=95617
Firefox 6 does not trust the RapidSSL certificate at all. IE 8 does not care much about security. I have no chance to test it with Safari.
Android does not trust the issuer. Tried it just with Android 2.1 (Motorola Defy). It could be different with other Android versions.


text:
Q: android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData I have a app with two MapActivity, each one have its MapView, with the same API key.
It work OK in Android 3.x and 4.x devices, but error in 2.3.x when switch activity.
Can anybody help?
Here is the error:
08-26 21:00:03.160: W/System.err(1858): IOException processing: 26
08-26 21:00:03.160: W/System.err(1858): java.io.IOException: Server returned: 3
08-26 21:00:03.160: W/System.err(1858): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
08-26 21:00:03.160: W/System.err(1858): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
08-26 21:00:03.160: W/System.err(1858): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
08-26 21:00:03.160: W/System.err(1858): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
08-26 21:00:03.160: W/System.err(1858): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)

A: Answer :
Use map in nested Framelayout when you are using map with fixed dimension.
      <FrameLayout
            android:id="@+id/mapview_bg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@color/silver"
            >

            <com.google.android.maps.MapView
                android:id="@+id/deal_mapview"
                android:layout_width="146dp"
                android:layout_height="106dp"
                android:apiKey="@string/google_map_api_key"
                android:clickable="true" />
       </FrameLayout>

Enjoy :)

A: Follow below link
this is issue of signing key of google map -
http://android-expert.blogspot.in/2013/03/android-and-strange-error-with-maps.html


text:
Q: Linking checkbox's checked state to a value of a textbox Would like to know how to link a checkbox's checked state to a value on a textfield returned from an sql query.  The textbox value is updated after a user selects a value from a select/menu on the form. The value of the select menu option is used as a filter in the query, which is working fine.
if ($('#textbox').val("TRUE")
    { $('#mycheckbox').prop('checked',true);}
else
    {
     $('#mycheckbox').prop('checked',false);
   }

The problem is that the if statement works for the previous value the user selected.  So its always one click behind even though the textbox value is current.  Although the value of the textbox is current on the form, when I make an alert box displaying the textbox's value, it too is behind.  So the if statement is ok, its just its using the textbox's previous value and not the current one.  Any way to make this current?

A: Your if statment is not testing the value of #textbox it is actually setting a value.
Try changing your if statement to read:
if ($('#textbox').val() == "TRUE")

Here's another SO post that might help.

A: First, you have syntax error in your code, assuming that is a typo.
What you are doing by$('#textbox').val("TRUE") is setting the value of textbox to TRUE.
So whenever your code block will execute you will end-up with checked check box, and textbox with TRUE value.
If your goal is to update the checkbox as per the value of text box. you can put the following one liner code instead of your four line, when you are actually setting/updating the value of text box.

$('#mycheckbox').prop('checked',$('#textbox').val() == "TRUE")

Update
As you mentioned you are setting the new value after a ajax call and didn't included your code sample, I'm guessing, your code is something like:
$.ajax({
  url: "your/url"
}).done(function(data) {
  $('#textbox').val(data)
});

If so, update your code to
$.ajax({
  url: "your/url"
}).done(function(data) {
  $('#textbox').val(data);
  $('#mycheckbox').prop('checked',$('#textbox').val() == "TRUE");
});

The response is based on guess.


text:
Q: Return the unique character elements that are mixed with numeric ones in a data.frame Suppose I have a data.frame that consists of mainly numeric values but also mixed with some character elements.
Is there a way to extract the unique character elements throughout the data.frame?
A toy example along with the desired output is shown below?
   DF <- data.frame(x = c(1:3, "*", "."), y = c("--", 4:6, "="), z = 1:5, w = rep("a", 5))

   desired_output <- c("*", ".", "--", "=")

A: You could extract all the values which has only punctuations in it from DF using grep :
unique(grep('^[[:punct:]]+$', as.character(unlist(DF)), value = TRUE))
#[1] "*"  "."  "--" "="


text:
Q: Google Map does not display the whole map I have a problem with google map..the case is, it will not load the whole map but only a part of the map and the rest it's blank already..what could be the problem?..
here's the code..

This will be replaced with the Google Map.

$(function()
{

   $('#map_addresses').gMap({
        controls: {
        panControl: true,
        zoomControl: true,
        mapTypeControl: true,
        scaleControl: true,
        streetViewControl: true,
    },
        scrollwheel: true,
        zoom: 5,
         maptype: 'ROADMAP',
        markers:[
            {
                latitude: 10.318577,
                longitude: 123.908062,
                html: "Jinisys Software Inc. Sales Office"
            },
            {
                latitude: 10.324213,
                longitude: 123.911546,
                html: "Jinisys Software Inc. Main Office"
            }

        ]
    });
}

A: Google map can only be loaded on to a visible div. Also, the width and height of the element have to be fixed. The map won't resize the div.
Try this:

This will be replaced with the Google Map.


text:
Q: ehcache hibernate second level caching, hibernate evicting automatically After my queries(lookups) get cached session closes, in a new session, hibernate is evicting everything after I change the DB through a random write Sql Query, how can I stop that from happening ? I'm looking into creating policies for things that rarely change.
INFO    Executing [namedSqlQuery=dao.web_login, objs=[user1]]
DEBUG   org.springframework.orm.hibernate3.SessionFactoryUtils user1- Opening Hibernate Session
DEBUG   org.hibernate.impl.SessionImpl user1 - opened session at timestamp: 5511432318976000
DEBUG   org.hibernate.impl.SessionFactoryImpl user1- evicting second-level cache: USERS_LOOKUP
DEBUG   org.hibernate.impl.SessionFactoryImpl user1- evicting second-level cache: COUNTRY_LOOKUP

ecache.xml
 <cache name="query.oneHourPolicy"
           maxElementsInMemory="10000"
           eternal="false"
           timeToLiveSeconds="3600"
           diskPersistent="true"
           overflowToDisk="true"/>

spring hibernate configuration
 <prop key="hibernate.cache.use_second_level_cache">true</prop>
                <prop key="hibernate.cache.use_query_cache">true</prop>
                <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</prop>
                <prop key="hibernate.cache.provider_configuration_file_resource_path">ehcache.xml</prop>

A: found the Hibernate Issue https://hibernate.onjira.com/browse/HHH-2224
I tested with the bellow :
in my random query
<sql-query name="random_write_query" callable="false">
        <synchronize table="USER"/>
        <synchronize table="USER_ADDRESS"/>
        {CALL PACKAGE.FUNCTION(?)}
</sql-query>

whenever I call the above and it's a DB change it will invalidate only the cache syncronized by table = USER or USER_ADDRESS
and only syncronized random read queries or entities will be evicted
<sql-query name="random_read_query">
         <synchronize table="USER"/>
         <synchronize table="USER_ADDRESS"/>
         <return-scalar column="USERNAME" type="string"/>
        <![CDATA[
            SELECT USERNAME FROM USER, USER_ADDRESS...
        ]]>
    </sql-query>


text:
Q: Tumblr photo post caption positioning I was hoping somebody would be able to help with the following query...
I've setup a Tumblr blog on which I'm going to regularly post photo sets.
I'd like to write a brief description with each set. I can do this
within the caption field that sits below the image. The problem with
this is that when including multiple images within a post the description
will be lost at the bottom, below all the images.
I'd like the caption to be positioned at the top of the post, before
the images so that viewers can read the description first.
Here's a link to the blog, though empty for now I've inserted a test
post to show how the information is displayed. The black block
represents an image set,'Coming Soon' was entered in the caption field.
http://rg-e.tumblr.com/
Any thoughts/or guidance would be greatly appreciated.
Thanks.

A: Would need to see your theme's code to provide you with specifics, but you just need to move where the {block:Caption} is being rendered.
An example:
{block:Photoset}
    {block:Caption}{Caption}{/block:Caption}

    {Photoset-500}
{/block:Photoset}

This will put the photoset's caption above the photoset.

A: Just to expand upon graygimore's answer - changing the position of the {block:Caption} - Here's the exact code I modified from my custom tumblr theme. Worked a treat.
Thanks again.
{block:Photo}

                                {block:Caption}

{Caption}

                                {/block:Caption}
                                {block:ContentSource}

                                            {lang:Source}:
                                            {block:SourceLogo}

                                            {/block:SourceLogo}
                                            {block:NoSourceLogo}
                                                {SourceTitle}
                                            {/block:NoSourceLogo}

                                {/block:ContentSource}

                             {LinkOpenTag} {LinkCloseTag}{Question}

                    {/block:Photo}


text:
Q: Button appearing differently in AVD/Graphical layout and on a actual phone I have modified my button to look like a spinner. On the AVD and Graphical layout it appears exactly like a spinner would but on my phone it appears quite different.
Button on the AVD:

Button on my phone:
Can someone tell me why this is happening??
Here is the Button layout in XML:
<Button
    android:id="@+id/datebutton"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="20dp"
    android:hint="@string/datebuttontxt"
    android:onClick="datepicker"
    android:gravity="center"
    style="@android:style/Widget.DeviceDefault.Light.Spinner" />

Changing the button background to invisible is not helping.
Also, If I use an actual spinner it would appear correctly, just like it shows on the AVD.

A: Widget.DeviceDefault.X styles change between different devices, use @android:style/Widget.Holo.X styles to get a consistant look and feel.
In your case:
@android:style/Widget.Holo.Light.Spinner


text:
Q: Webcam stopped working after installing V4L-DVB Device Drivers On Fedora 24 my built-in laptop webcam was working fine. But, for some reason, I've installed V4L-DVB driver. After rebooting my webcam stopped working, every webcam software tells me that no video device is found. Also there is no such thing as /dev/video0 in my filesystem. Can I fix this somehow? Maybe by uninstalling the driver, but I don't know how to remove it.
Booting into older kernel fixes the problem. Still I'd like to use the newest kernel version.

A: Boot with the old kernel version (4.6.4-301), then uninstall the package for kernel version 4.6.5-300 using your favorite package management tool.
Then ensure /lib/modules/4.6.5-300 directory is completely gone (delete it manually if it's still there) and reinstall the newest kernel package. Then reboot again with the latest kernel.


text:
Q: Serializer Error I have custom class with following properties:
Class Person
    readonly public string Name;
    readonly public string FamilyName;
    readonly public string UserName;
    private List<Person> Team = new List<Person>();
    public Person Leader { get; private set; }
    public bool HasTeam { get; private set; }

I am getting error on serializer because "Object has Leader property that has no public set." However I need to keep it private, as change of Leader will cause errors. Do you know any way around? Or I need to make it public and keep in mind that I cannot set it?
Thank you,
Michael

A: So, as mentioned, you could make it so, that it's it can be set only once, but i wouldn't see it as a good option (maybe you should rather rethink how you would like to store this information?)
public class Person
{
    private Person leader;
    public Person Leader
    {
        get
        {
            return leader;
        }
        set
        {
            if (Object.Equals(leader, value))
            {
                return;
            }
            if (leader != null)
            {
                throw new InvalidOperationException("Leader can be set only once!");
            }
            leader = value;
        }
    }
}

this would allow you to save/load the values, and it wouldn't allow it to be set afterwards. However, this is just working around the problem.
In case you don't have to save it specifically to XML, you could use a binary formatter, that saves the entire Person object (no matter if it contains private fields / properties)


text:
Q: Unable to load the servlet in jsp form tag My jsp page ExecutionIframe.jsp
<form target="results" id="form1" name="mxform" action="/SaveMxAdapter" method="post" accept-charset="UTF-8">

My Project structure
I am adding my jsp page to iframe an add to the string
form+="<iframe id=\"ExecutionIframe\" name=\"ExecutionIframe\" src=\"/polarion/mxadapter/ExecutionIframe.jsp\" border=\"0\" frameborder=\"0\" height=\"100%\" width=\"100%\" scrolling=\"yes\">";
                form+="</iframe>"

My web.xml is
<servlet>
<servlet-name>SaveMxAdapterServlet</servlet-name>
<servlet-class>
com.danlaw.polarion.mxadapter.servlet.SaveMxAdapterServlet</servlet-class>

</servlet>
<servlet-mapping>
<servlet-name>SaveMxAdapterServlet</servlet-name>
<url-pattern>/SaveMxAdapter</url-pattern>
</servlet-mapping>

But the jsp page unable to call the servlet
i got error like

Not Found
The requested URL /SaveMxAdapter was not found on this server.


text:
Q: Drag and drop ghost image mispositioned in Chrome In Firefox, the tip of the mouse cursor appears at the exact middle of the ghost image.
In Chrome, and other Chromium based browsers, the tip of the cursor appears at about one third of the ghost image in both directions.
I suspect it has something to do with using 125% DPI scale on my Win7 system, but I am not sure. Any ideas?

let dragImage = document.getElementById("drag-image");
let draggable = document.getElementById("draggable");

draggable.addEventListener("dragstart", function(e) {
  e.dataTransfer.effectAllowed = "move";
  e.dataTransfer.setData("text/plain", null);
  e.dataTransfer.setDragImage(dragImage, 50, 50);
});
#drag-image {
  width: 100px;
  height: 100px;
  background: black;
}
#draggable {
  width: 100px;
  height: 100px;
  background: blue;
}


text:
Q: Problema al capturar una excepcion en PHP estoy haciendo un ejercicio en clase de realizar una ecuación de segundo grado y que en el caso de que introduzca texto, me sale una excepcion, el problema es que no me entra en el bloque de catch, directamente me salta los mensajes de warning con la excepción que he creado. Introduzco números el programa me funciona perfectamente, el problema es cuando fuerzo el error introduciendo texto, no se si se me está escapando algún detalle. Os comparto el código y los resultados que me salen.
CODIGO:
    <!DOCTYPE html>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ejercicio 6</title>

Ejercicio 6

Escribe un script para resolver ecuaciones de segundo grado,
    ax2 + bx + c = 0. Si la ecuación no tiene soluciones reales,
    hay que mostrar un mensaje de error.

    <form method="post">
        Introduce el valor de ax2:
        <input type="text" name="ax2">

        Introduce el valor de bx:
        <input type="text" name="bx">

        Introduce el valor de c:
        <input type="text" name="c">

        <input type="submit" value="Calcular" name="calculate">
    </form>

<?php

    //Obtengo los datos del formulario

    //compruebo si se ha pulsado el boton para realizar el cálculo
    if(isset($_POST["calculate"])){

        //almaceno en las variables el valor de los inputs
        $a = $_POST["ax2"];
        $b = $_POST["bx"];
        $c = $_POST["c"];

        if(!is_numeric($a) &&!is_numeric($b) && !is_numeric($c)){ //compruebo que no se introduzca texto
            throw new Exception ("No se permiten números negativos");
        }

        try{ //bloque try para en caso de que se introduzca texto salte la excepcion

            $raiz = sqrt(pow($b,2) - 4 *($a * $c)); //valor de la raiz cuadrada
            $denominador = 2*$a;

            if($raiz > 0){ //en caso de que la raiz sea mayor que 0, tendrá dos solucione la ecuacion

                $numeradorPos = -$b + $raiz; //numerador positivo
                $numeradorNeg = -$b - $raiz; //numerador negativo

                $resultado1 = $numeradorPos / $denominador;
                $resultado2 = $numeradorNeg / $denominador;

                    //muestro los resultado
                    echo "La ecuación tiene dos soluciones:
";
                    echo "La primera solución es: $resultado1
";
                    echo "La segunda solución es: $resultado2
";

            }else if($raiz == 0){ //en caso de que la raiz sea igual a 0, la ecuación tendrá una solución

                $numeradorPos = -$b + $raiz; //numerador positivo
                $resultado1 = $numeradorPos / $denominador;

                    //muestro resultados
                    echo "La ecuación tiene una solucion:
";
                    echo "La solución es: $resultado1
";

            }else{ //en caso de que la raiz sea menor que 0
                echo "La ecuación no tiene solución";
            }

        }catch(Exception $e){ // en caso de que detecto una excepcion salta el bloque catch
            echo "Excepcion: " . $e->getMessage();
        }
    }
?>

RESULTADOS:

Esta es la solución que me sale cuando introduzco texto en los inputs