text:
Q: Spring Event for all Contexts being initialized A similar question has been answered...
Here: Listener for server starup and all spring bean loaded completely
Here: How to add a hook to the application context initialization event?
and several other places.
In my primary application, when the Root Spring context initializes it will trigger three child contexts to initialize.  When listening for an event to fire (based on the ContextRefreshedEvent), this results in four total events.  This does not give the consumer of these events accurate information regarding the overall state of the application's Spring context.
Unfortunately I don't have the ability to change the primary application.  The code that I'm wrestling with now is packaged as a jar and loaded into the primary application using a plugin architecture.  I am able to hook into the application's Spring context without issue, and I can successfully receive ContextRefreshEvent triggers.
What I'm looking for is a way to understand if all Spring application contexts in the primary application have completed.  One thing I tried was to manually keep track of the starting and completing of the application context (using a map) so that I could tell when all known application contexts were finished initializing.  This didn't work for me, as I found that the ContextStartedEvent didn't trigger during Spring's refresh operation.
Additional things that could work for me would be knowing how many application contexts exist or how many beans there are that need to be loaded.  That way I could keep track of them as they finished and ultimately know that all application contexts are complete.
Any ideas would be appreciated.
EDIT
In an attempt to ask as pointed a question as possible, I made this question too prescriptive in terms of the implementation.  Here is the actual problem that I was trying to solve (in the form of a question):
How might a plugin, packaged as a jar inside of a webapp, tell when the context of the webapp has been deployed successfully in Tomcat?
Through testing, I thought it was fairly safe to assert that the initialization of the Spring context was synonymous with the deploy phase of the application through Tomcat.  This may be false, but it lined up well enough.
Broadening the scope of the fix from exclusively using Spring, I was able to come up with a solution to the problem.  I will post that as a separate answer.

A: As of Spring 2.5.X < 4.X
One thing you could do is listen for ContextStartedEvent-s, add them to a map and then once ContextRefreshedEvent-s are triggered, wait while all contexts are refreshed.
This still might be not safe if the context is refreshed multiple times though...but at least a place to start.
As of Spring 4+
Reading ContextRefreshedEvent javadocs:
Event raised when an {@code ApplicationContext} gets initialized or refreshed.

What this means is that you can have your own logic to track whether that context was initialized or refreshed.
@EventListener( { ContextRefreshedEvent.class } )
void contextRefreshedEvent( ContextRefreshedEvent e ) {
    ApplicationContext context = ( ApplicationContext ) e.getSource();
    System.out.println( "a context refreshed event happened for context: " + context.getDisplayName() );
}

Meaning - the first time you'll get an event with that context - you will know that it was initialized. The following times - you will know that it was refreshed.
Being brutally simple ( no optimizations ) you can do the following:
private final Map<String, String> contextStatuses = new HashMap<>();

@EventListener( { ContextRefreshedEvent.class } )
public void contextRefreshedEvent( ContextRefreshedEvent e ) {
    ApplicationContext context = ( ApplicationContext ) e.getSource();

    if ( !contextStatuses.containsKey( context.getDisplayName() ) ) { // initialized
        contextStatuses.put( context.getDisplayName(), "initialized" );
    } else { // refreshed
        contextStatuses.put( context.getDisplayName(), "refreshed" );
    }

    checkAllContextsRefreshed();
}

private void checkAllContextsRefreshed() {
    for ( String status : contextStatuses.values() ) {
        if ( !"refreshed".equals( status ) ) {
            return;
        }
    }

    doWhenAllContextsRefreshed();
}

A: Per the edit on my question, here is the solution that I went with:
In the plugin that is packaged inside the primary application, I added a check using JMX against the stateName attribute of the WebModule type under Catalina.  This isn't the exact code I used, but for simplicity the logic looks like this:
ObjectName name = new ObjectName("Catalina:j2eeType=WebModule,name=//localhost/" + contextPath + ",J2EEApplication=none,J2EEServer=none");
MBeanServer mx = ManagementFactory.getPlatformMBeanServer();

String state = String.valueOf(mx.getAttribute(name, "stateName"));
if (state.equals("STARTED")) {
    LOGGER.warn("SUCCESS!");
}

As I mentioned in the edit, equating Tomcat deploy to Spring context initialization was close, but ultimately it wasn't a fair comparison.  Using this JMX endpoint gives me a very accurate representation of the state of the Tomcat deploy.


text:
Q: How to access gradle parameter in Java code I have some experience with java and I am new to gradle and I joined a project in which I have to modify the gradle file.
Here is my build.gradle file
apply plugin: 'java'
apply plugin: 'idea'

sourceCompatibility = 1.5
version = '1.0'
dependencies {
    testCompile 'org.testng:testng:6.9.10',
                'org.seleniumhq.selenium:selenium-java:2.53.0'
}

test {
    useTestNG()
    testLogging.showStandardStreams = true
}

I then run my test suite using the following command from the mac terminal
./build test
I want to pass a parameter named environment
Based on this value of this parameter, I need to configure my urls and run tests for that environment. Something like ./build test environment=dev or ./build test environment=qa
And in my java code I would do something like this
if(env == 'dev') {
    url = "my dev url";
    user = "my dev user name"
} else if(env == 'qa') {
    url = "my qa url";
    user = "my qa user name"
}

How can I pass this parameter in the terminal ?
A small snippet of how I can use this parameter in my code would be of great help (my java code does not have a main method).
Note: I have already used a property file and achieved this behaviour, but my team does not want to make changes in code to set the environment. So I had to discard those changes.

A: From command line to gradle you can use system properties or project properties. It will be either:
./gradlew test -Denv=dev

or
./gradle test -Penv=dev

The properties above can be now read in a build.gradle, you need to pass them to tests as well, it must be done with system properties so:
test {
    systemProperty 'env', System.properties['env'] ?: 'dev'
}

for system properties from command line or:
test {
    systemProperty 'env', project.hasProperty('env') ? project.env : 'dev'
}

In test classes use just:
System.getProperty("env")

to get the value you need.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Routing on ASP.NET website (not WebForm application and not MVC) Can I use web.config or Global.asax to do routing in an asp.net website (folder structure)?
Basically I would like
http://www.something.com/agents/10/TheAgentsName
to go to
http://www.something.com/portfolio.aspx?caid=10
The agents name is just for "decoration" in the URL.
I have found several examples but they all apply to MVC or WebForms apps.
When trying to implement Global.asax, it keeps saying that System.Web.Routing does not exist in the namespace. This is what my Global.asax looks like now (it's unable to run)!
<%@ Application Language="C#" %>
<%@ Import Namespace="System.Web.Routing" %>

<script runat="server">

    void Application_Start(object sender, EventArgs e)
    {
        RegisterRoutes(System.Web.Routing.RouteTable.Routes);

    }

    void RegisterRoutes(System.Web.Routing.RouteCollection routes)
    {
        routes.MapPageRoute("AgentPortfolioByName", "agents/{id}/{name}", "portfolio.aspx");
    }

    void Application_End(object sender, EventArgs e)
    {
    }

    void Application_Error(object sender, EventArgs e)
    {
    }

    void Session_Start(object sender, EventArgs e)
    {
    }

    void Session_End(object sender, EventArgs e)
    {
    }

</script>

The Global.asax Application_Start is executed fine (I tried to put a break-point). But it just does not understand what System.Web.Routing is. In web.config I have these entries:
<compilation debug="true">
            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>
        </compilation>

......
<httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="RoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </httpModules>

........
<system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <remove name="ScriptModule"/>
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </modules>

A: You can use Global.asax for implement routing. I think you are somehow missing the System.Web.Routing.dll reference in your application. Please make sure you are referencing this one. Also please make sure in Global.asax you are importing  System.Web.Routing namespace. Please go through below link if it will be helpful in understanding the handling Global.asax file in web site application.
http://beyondrelational.com/blogs/niladribiswas/archive/2011/06/09/adding-the-global-asax-cs-file-in-asp-net-web-site.aspx
Please fell free to contact for further discussion.
Thanks,


text:
Q: My geojson-file doesn't get loaded via fetch I am trying to load a geojson-file into my map via fetch right here
https://olive-highfalutin-crown.glitch.me/
but I get nothing shown to be loaded in my network sources.
That is my code therefore:
    fetch("https://cdn.glitch.global/5778ed75-793f-41e9-810d-b244bbed9dbd/inkogym.geojson?v=1657180982175")
  .then(function (response) {
    return response.json();
  })
  .then(function (data) {
    L.geoJSON(data).addTo(map);
  });

Is my json not correct or what is the issue?


text:
Q: Why python goes in loop and takes up to 40% of my CPU? I was testing some code, and for some reason python can't get to the end of the code, taking up to 40% of my CPU.
import random

input_text = input('Testo > ')
key = ''
output_text = ''
cond_1 = ''

alfabeto = list("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM 1234567890èéòç@à°#ù§[]+*,;.:-_<>£$₽%&()=?ì^/|!ėëęēêĖËĘĒÉÈÊūûüúŪÛÜÚÙīïįíìîĪÏĮÍÌκōøõœöôóŌØÕŒÖÓÒãåāáâäæÃÅĀªÀÁÂÄÆßẞÇñÑ¥¢∆¶×÷π√•`~©®™✓йцукенгшщзхфывапролджэячсмитьбюЙЦУКЕНГШЩЗХФЫВАПРОЛДЖЭЯЧСМИТЬБЮ⌂☻‼‰╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤▬╥╙╘╒╓╫╪┘┌¤█▄▌▐▀αΣσ░▒▓│┤╡╢╖╕╣║╗╝¿þ¼½¾ⁿ⌠⌡≤≥±≡∩∞ΘΩð«»⌐¬¨↨↑↓→←↔₧☼♥♦♣♠♂♀♪◘○◙►◄▲▼Þ''"""")
numeri = ''

for _ in range(len(alfabeto)):
    while True:
        checked = str(random.randint(2,len(alfabeto)))
        if '0' in checked or '1' in checked or checked in cond_1:
            pass
        else:
            cond_1 += f'{checked} '
            break
    cont = list(checked)
    cont = '0'.join(cont)
    numeri += f'{cont}1'

print(numeri, len(numeri), len(alfabeto))

EDIT:
Looking at the answers i changed my code resolving the problem, here it is
import random

input_text = input('Testo > ')
key = ''
output_text = ''
cond_1 = ''

alfabeto = list("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM 1234567890èéòç@à°#ù§[]+*,;.:-_<>£$₽%&()=?ì^/|!ėëęēêĖËĘĒÉÈÊūûüúŪÛÜÚÙīïįíìîĪÏĮÍÌκōøõœöôóŌØÕŒÖÓÒãåāáâäæÃÅĀªÀÁÂÄÆßẞÇñÑ¥¢∆¶×÷π√•`~©®™✓йцукенгшщзхфывапролджэячсмитьбюЙЦУКЕНГШЩЗХФЫВАПРОЛДЖЭЯЧСМИТЬБЮ⌂☻‼‰╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤▬╥╙╘╒╓╫╪┘┌¤█▄▌▐▀αΣσ░▒▓│┤╡╢╖╕╣║╗╝¿þ¼½¾ⁿ⌠⌡≤≥±≡∩∞ΘΩð«»⌐¬¨↨↑↓→←↔₧☼♥♦♣♠♂♀♪◘○◙►◄▲▼Þ''"""")
numeri = ''

for _ in range(len(alfabeto)):
    while True:
        checked = str(random.randint(2,2000))
        if '0' in checked or '1' in checked or checked in cond_1:
            pass
        else:
            cond_1 += f'{checked} '
            break
    cont = list(checked)
    cont = '0'.join(cont)
    numeri += f'{cont}1'

print(numeri, len(numeri), len(alfabeto))

A: After adding some debug to your code
checked = str(random.randint(2,len(alfabeto)))
print('checked ' + checked)
if '0' in checked or '1' in checked or checked in cond_1:
    if '0' in checked:
        print('0 in checked')
    elif '1' in checked:
        print('1 in checked')
    else:
        print('checked in cond_1')
    pass

I ran it and saw this:
checked 249
checked 289
checked 70
0 in checked

From that point, it became pretty clear that we should have broke from the while (True) statement. I was perplexed until I took a step back.
for _ in range(len(alfabeto)+3):
    while True:

I missed that for loop! You're running that while loop and breaking when it fails to find something that would satisfy the condition. Then, you run it again. Eventually, on one of those loops, it has racked up enough values in cond_1 that it will stick in the while loop forever.

A: if we rearrange the code a bit we can see why this never finishes.  I start by pulling out part of the inner while loop into a function that generates all possible values:
def option_gen(n):
    for i in range(2, n):
        s = str(i)
        if '0' in s or '1' in s:
            continue
        yield s

options = list(option_gen(len(alfabeto)))

which has 160 values, and as as Tomerikoo observed this is much less than 351 values in your list.  hence your while loop will spin after a while, appending new values to an ever growing cond_1 string then just doing nothing useful.
we can use this function to write a more efficient version that instead fails much more quickly rather than diverging:
from random import shuffle

random.shuffle(options)

result = []
for _ in range(len(alfabeto)+3):
    cont = '0'.join(list(options.pop()))
    result.append(cont + '1')

numeri = ''.join(result)

this will throw a useful exception after a while describing why it can't make forward progress.  also note that making that for loop only run over something like range(5) will finish


text:
Q: How to get same size of slider thumb on android like IOS in react native <Slider
          style={{ width: '100%' }}
          step={15}
          onValueChange={change}
          value={travleSliderVal}
          maximumValue={120}
          thumbTintColor={colors.lightBlueRGB}
          minimumTrackTintColor={colors.lightBlueRGB}
        />

I do not think any prop available which can help me out.


text:
Q: bash process substitution + using same variable in main and sub-process If I do
x=42
IFS= read -r x < <(echo "$x")
echo "$x"

am I guaranteed to get back 42, or is there a race condition like for reading from / writing to the same file in a pipeline (cat /tmp/x | grep -v pat | cat >/tmp/x)?
OK, for read it's kind of obvious, what about mapfile -- might it clear the destination (= source for subprocess) array before forking off the substituted process?
arr=( 'forty' 'two' )
mapfile -t arr < <(printf '%s\n' "${arr[@]}")
declare -p arr

Edit: maybe a better comparison would be to
{ echo 42; echo 13; } >/tmp/x
cat >/tmp/x < <(grep -v 13 /tmp/x)
cat /tmp/x

A:
using same variable in main and sub-process

Each process has it's own space. They are separate variables.

am I guaranteed to get back 42

Yes.

might it clear the destination (= source for subprocess) array before forking off the substituted process?

No.
The subprocess <(...) has a copy of all the parent environment. It does not affect parent in any way.


text:
Q: Double buffering problem of a derived owner-drawn TabControl? I have derived a TabControl with the express purpose of enabling double buffering, except nothing is working as expected. Here is the TabControl code:
class DoubleBufferedTabControl : TabControl
{
    public DoubleBufferedTabControl() : base()
    {
        this.DoubleBuffered = true;
        this.SetStyle
            (
                ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.ResizeRedraw |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.SupportsTransparentBackColor,
                false
            );
    }
}

This Tabcontrol is then set with it's draw mode as 'OwnerDrawnFixed' so i can changed the colours. Here is the custom drawing method:
    private void Navigation_PageContent_DrawItem(object sender, DrawItemEventArgs e)
    {
        //Structure.
        Graphics g = e.Graphics;
        TabControl t = (TabControl)sender;
        TabPage CurrentPage = t.TabPages[e.Index];

        //Get the current tab
        Rectangle CurrentTabRect = t.GetTabRect(e.Index);

        //Get the last tab.
        Rectangle LastTab = t.GetTabRect(t.TabPages.Count - 1);

        //Main background rectangle.
        Rectangle BackgroundRect = new Rectangle(LastTab.Width, t.Bounds.Y - 4, t.Width - (LastTab.Width), t.Height);

        //Tab background rectangle.
        Rectangle TabBackgroundRect = new Rectangle(0, LastTab.Y + LastTab.Height, LastTab.Width, t.Bounds.Height - (LastTab.Y + LastTab.Height));

        //Set anitialiasing for the text.
        e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;

        //String format for the text.
        StringFormat StringFormat = new StringFormat();
        StringFormat.Alignment = StringAlignment.Center;
        StringFormat.LineAlignment = StringAlignment.Center;

        //Fill the background.
        g.FillRectangle(Brushes.LightGray, BackgroundRect);
        g.FillRectangle(Brushes.Bisque, TabBackgroundRect);

        //Draw the selected tab.
        if(e.State == DrawItemState.Selected)
        {
            g.FillRectangle(Brushes.White, e.Bounds);
            Rectangle SelectedTabOutline = new Rectangle(e.Bounds.X + 2, e.Bounds.Y + 2, e.Bounds.Width, e.Bounds.Height - 4);
            g.DrawRectangle(new Pen(Brushes.LightGray, 4f), SelectedTabOutline);
            g.DrawString(CurrentPage.Text, new Font("Arial", 12f, FontStyle.Bold, GraphicsUnit.Point), new SolidBrush(Color.FromArgb(70, 70, 70)), CurrentTabRect, StringFormat);
        }
        else
        {
            g.FillRectangle(new SolidBrush(Color.FromArgb(230, 230, 230)), e.Bounds);
            g.DrawString(CurrentPage.Text, new Font("Arial", 12f, FontStyle.Regular, GraphicsUnit.Point), Brushes.Gray, CurrentTabRect, StringFormat);
        }

    }

All to no avail however, as this control is not double buffered and still flickers when resized.
Any ideas?

A: If you read the documentation, it says, "This member is not meaningful for this control." If you want the control to be drawn utilizing double-buffering, you'll have to implement it yourself. Besides the fact that if you owner-draw the control, you would have to implement double-buffering yourself anyhow.

A: First of all, you can get rid of your TabControl code—you turn on buffering, and then immediately turn it off, so it's not actually doing anything useful.
Part of your problem is that you're trying to paint just part of the TabControl.
The easiest solution that gives about a 90% solution (it's still possible to get a flicker) is to add this to your form class:
protected override CreateParams CreateParams
{
    get
    {
        CreateParams cp = base.CreateParams;
        cp.ExStyle |= 0x02000000;
        return cp;
    }
}

If you want to be very sure of getting no flicker, you'll need to draw the entire TabControl yourself, and make sure to ignore background painting requests.
Edit: Note that this will only work in XP and later.

A: I've had problems with double buffering on controls in the past and the only way to stop the flicker was to ensure the inherited OnPaintBackground method was not being called. (See code below)  You will also need to ensure the entire backgound is painted during your paint call.
protected override void OnPaintBackground( PaintEventArgs pevent )
{
    //do not call base - I don't want the background re-painted!
}

A: Not sure, but you might try double-buffering the control that contains the tab control.

A: I looked around quite a bit, tried your code and whatever else I could think of, but I don't see a way to get rid of the flicker. Unfortunately, in my tests even a regular (non-owner-drawn) tab control flickers during resizing.
For what it's worth, turning off "Show window contents while dragging" will fix it, but I realize that may not be helpful.

A: I think it doesn't work because you are disabling double buffering!
All this.DoubleBuffered = true does is set ControlStyles.OptimizedDoubleBuffer to true.  Since you are disabling that flag in the next line of your program, you are really doing nothing.  Remove ControlStyles.OptimizedDoubleBuffer (and perhaps ControlStyles.AllPaintingInWmPaint) and it should work for you.


text:
Q: WSO2 ESB API does not send http request I'm trying to create an API on wso2esb 4.8.1 that is able to use HTTP GET and POST. When a POST request is received the request has to be dispatched to two endpoints. This works fine and I've not added this piece in the example below.
But the HTTP GET request should be handled in a straightforward manner and this does not work. The request is not being forwarded at all and I'm only seeing a time out message in the ESB logs.
I've used wirehark to see if I see an outgoing request on the wire but this is not the case.
To me the HTTP GET looks pretty straight forward, nothing special at all, but it does not get send out by the ESB. Help would be greatly appreciated!
I've added my API description below:
<api xmlns="http://ws.apache.org/ns/synapse" name="myapp" context="/myapp/myservice">
  <resource methods="GET">
    <inSequence>
      <log>
        <property name="Message Flow" value="MyApp MyService API - IN"></property>
        <property name="HTTP_METHOD IS###########" expression="$axis2:HTTP_METHOD"></property>
      </log>
      <property name="DISABLE_CHUNKING" value="true" scope="axis2" type="STRING"></property>
      <property name="ContentType" value="application/json" scope="axis2" type="STRING"></property>
      <property name="HTTP_METHOD" value="GET" scope="axis2"></property>
      <property name="NO_ENTITY_BODY" scope="axis2" action="remove"></property>
      <send>
         <endpoint>
           <address uri="http://myserver.com/myapp/myservice/myaction"></address>
         </endpoint>
      </send>
  </inSequence>
  <outSequence>
     <property name="messageType" value="application/json" scope="axis2"></property>
     <property name="ContentType" value="application/json" scope="axis2"></property>
     <send></send>
  </outSequence>
  <faultSequence>
     <log level="full">
        <property name="MESSAGE" value="Executing default sequence"></property>
        <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"></property>
        <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"></property>
     </log>
     <drop></drop>
    </faultSequence>
  </resource>
</api>


text:
Q: How to exchange two specific characters in linux? I am trying to exchange two characters in a complex textfile but it doesn't work.
It look like this:
cat 1
_**A** # 2 # 118 # -1 # ID=**B**;partial=10;start_type=GTG
GTGTCAAAAGGCAAGTTAACCTTCGCAATCAACTTCGCATTGGTAGGTGCGTATCTGGGCGCCATTAAGA

_**C** # 100 # 204 # -1 # ID=**D**;partial=01;start_type=Edge
GAGGAGATAAAGAAATTACAGGAAACCGATGAAGAAATAGGCAAAAACGAGCATATTGTTGCCTATCTTC
GTGCCGTTAGGGAAATGTGTCAAAAGGCAAGTTAA

I want to swap A and B, C and D  like this:
_**B** # 2 # 118 # -1 # ID=**A**;partial=10;start_type=GTG
GTGTCAAAAGGCAAGTTAACCTTCGCAATCAACTTCGCATTGGTAGGTGCGTATCTGGGCGCCATTAAGA

_**D** # 100 # 204 # -1 # ID=**C**;partial=01;start_type=Edge
GAGGAGATAAAGAAATTACAGGAAACCGATGAAGAAATAGGCAAAAACGAGCATATTGTTGCCTATCTTC
GTGCCGTTAGGGAAATGTGTCAAAAGGCAAGTTAA

I realize this is a tedious question... but  I can't see the solution :(

A: For the example above you can do something like this:
cat <file> | sed -e 's/\*\*B\*\*/\*\*A\*\*/' \
     -e 's/\*\*A\*\*/\*\*B\*\*/' \
     -e 's/\*\*D\*\*/\*\*C\*\*/' \
     -e 's/\*\*C\*\*/\*\*D\*\*/'

where the  contains the original code.
Note that the snippet above works only in case you **A** and **B** only once per line. For more complicated examples you need to check the manual of the sed command


text:
Q: WeChat oauth 2 doesn't work - how to fix? I'm trying to setup Wechat oauth login.
I have verified international account ("subscription" type), but an example from documentation doesn't work for my appid
https://open.weixin.qq.com/connect/qrconnect?appid=wx13243a5b6496168e&redirect_uri=http://foo.bar/baz&response_type=code&scope=snsapi_login

Scope 参数错误或没有 Scope 权限

I guess this may be because of "subscription" type, but there were no such options during a registration process.
What should I do to enable WeChat oauth for my site?

A: for anyone who tries to do the OAuth with wechat in swift, you can follow this link here to start with SDK integration, then this link to integrate OAuth. i post it here because the above link you provided has expired.
the error message above basically means you didn't specify the scope of your request. the second link has it.
// Build a SendAuthReq structure
    SendAuthReq* req =[[[SendAuthReq alloc]init]autorelease];
    req.scope = @"snsapi_userinfo";
    req.state = @"123";
    // The third party sends a SendAuthReq message structure to the Weixin platform.
    [WXApi sendReq:req];


text:
Q: "In the first instance" ... active in contemporary populations? On a site, I happened to use the phrase "In the first instance" ...

(Not that this is relevant, but notice the many upvotes suggesting that presumably, it reaches baseline understandability in a typical mixed-language, mixed-age, mixed-continent SE audience.)
I was utterly astounded that someone did not know the phrase,

Astonishingly, more people had not heard the phrase; my total astonishment/disgust with the Youth Of Today, etc. continued when an otherwise highly literate user figured it may be "regional" or such ...!

In particular: there was a (to me, completely bizarre) thought that it is more "descriptive than proscriptive" (or, something?)

My questions (here on the "Excellent English SE site") are

*

*Could it be this ordinary phrase is falling out of popularity/meaning?  If so since when? (Kids of the 60s? 90s? 10s?) Is there any real way to know this? Does it appear in Harry Potter?

*Is there anything to the "unfamiliar in action sentences" concept? (i.e., as I understand the commenter's comment, "ITFI X happened" versus "ITFI do X".)

A: Google books actually shows a constant decreasing usage of the expression in the first instance from which probably the fact that some users find it "unusual".
Moreover, M-W suggests it is a formal expression:
in the first instance - idiom (formal):

before other events happen : as the first thing in a series of actions
You will be seen in the first instance by your own doctor who may then send you to a specialist.

For what it is worth, I am quite familiar with this expression and I don't find it unusual.


text:
Q: Algorithm to find the coordinates of a point which is the reflection of a point about a line in 3D I am currently working on a project on Matlab and I need to find the coordinates of a point which is reflected about a line. I know how to do it in 2D but in 3D things are getting ugly.
So, we have a line which goes through two points A(x1,y1,z1) and B(x2,y2,z2). P1(x0,y0,z0) is reflected about that line and i need an algorithm to find the coordinates of reflection of P1.

A: At first, find projection L of point P to line AB.
L = A + AB * ScalarProduct(AB, AP) / ScalarProduct(AB, AB)

Then calculate reflection
P' = P + 2*(L-P) = 2*L-P


text:
Q: Is there a way to modify the path for ".." ( shortcut )? Whenever I download repositories from my team from other departments they have scripts ( .m files )in MATLAB which are runned from a path file which contain ".." ( like a shortcut ) in their path link and I do not know how to change that on my MATLAB workstation, the parent directory for it. For example an .m file (script) which contains:
MODEL_CONFIG='..\03_config\config.m';
run(MODEL_CONFIG)

On their workstation this code works but on my workstation it says that:
"there is no ..\03_config\config.m not found."
and I know that the ".." is the parent directory from the project. My question is:
"How can I change the default parent directory so that ".." can work on my workstation too?
Right now the only solution is to manually change in every script file the ".." with 'C:\Users%user%\Desktop\19_projectsMatlab\99_GSM_OEM' - and it this example 99_GSM_OEM would be the parent directory.

A: What a .. means in a path is basically: go back one folder from your current working directory in Matlab. You can easily change this folder by clicking on  in Matlab.
If you want to change this folder during script execution you can do this with
cd 'C:/Users/yourname/yourfolder/'

A: Actually I am stupid. ".." is like "cd.." in MS-DOS....
I was in the wrong folder all the time. I am not supposed to be in the parent directory of the project when I run the main script. I am supposed to be in the folder directory where the main script is running (main.m).
So when I am in the folder directory of the main.m file the following link:
MODEL_CONFIG='..\03_config\config.m';

says go back with one folder from where the main.m file is and there should be the folder 03_config which you access. Thank you guys.
And if you have more subfolders in the folder in which is the main.m script "." - means the current location....


text:
Q: I can't create admin in seed data what i tried so far
public class SeedIdentity
{
    public static async Task Seed(IApplicationBuilder app)
    {
        var identityContext = app.ApplicationServices.GetRequiredService<ApplicationIdentityDbContext>();
        identityContext.Database.Migrate();

        if (!identityContext.Roles.Any(i => i.Name == "Admin" && i.Name == "User"))
        {
            var roleStore = new RoleStore<IdentityRole>(identityContext);
            var roleManager = new RoleManager<IdentityRole>(roleStore, null, null, null, null);

            var adminRole = new IdentityRole { Name = "admin" };
            var userRole = new IdentityRole { Name = "user" };
            await roleManager.CreateAsync(adminRole);
            await roleManager.CreateAsync(userRole);
            identityContext.SaveChanges();

        }

        if (!identityContext.Users.Any(i => i.UserName == "akinaldemir"))
        {
                var userStore = new UserStore<ApplicationUser>(identityContext);
                var userManager = new UserManager<ApplicationUser>(userStore, null, null, null,null, null, null, null, null);
                var admin = new ApplicationUser()
                {
                    UserName = "akinaldemir",
                    Email = "akinaldemir@gmail.com"
                };

                await userManager.CreateAsync(admin, "Abc12!jtre");
                await userManager.AddToRoleAsync(admin, "admin");

                identityContext.SaveChanges();

        }
    }
}


text:
Q: Continuity of Complex Function of Two Functions Dependent of Re(z)
I believe this function is continuous at $0$ and hence is a continuous function.
It's continuous if $\lim_{z \rightarrow 0^-}\bar{z} = 0$, is that right?
If so, how do I prove that that's the limit? It seems really intuitive for me. It sounds as intuitive as, for example, $y=-x$ and hence $\lim{y}_{x \rightarrow 0^-} = 0$. Does it need proof?

A: No. To show continuity of $f$ at $0$ you need to show that $\lim_{|z|\to 0} f(z)=0$ instead of just showing that the left side limit converges to $0$. To show continuity see that $$ |f(z)-f(0)|=|f(z)|=|z|$$
Since $|z|=|\overline{z}|$. So for any $\epsilon > 0$, take $\delta =\epsilon$. Then $|z-0|=|z|<\delta$ implies that $|f(z)-f(0)|<\epsilon$. Hence $f$ is continuous at $z=0$.


text:
Q: Material Design Lite and jQuery, smooth scroll not working I am unable to use .animate method of jQuery with Google's Material Design Lite(MDL). I have used MDL to make navigation bar, but smooth scrolling was not working.
Simple jQuery code is this:
$(function(){
            $('a.smooth').click(function(){
                console.log("SMOOTH BEGIN");
                var speed = 1000;
                var href= $(this).attr("href");
                var target = $(href == "#" || href == "" ? 'html' : href);
                var position = target.offset().top;
                $("html, body").animate({scrollTop:position}, speed, "swing");
                console.log("SMOOTH END");
            });
        });

And simple html code is this:

    Home
    Product

<!—-Contents-—>

This code showed me the log, "SMOOTH BEGIN" and "SMOOTH END".
However, that link worked as ordinary link, not like smooth.
How can I get jQuery working with MDL? Maybe some conflicts are occurring, but console is not showing anything.

A: The reason you are not seeing anything happen is because you are scrolling on the body node. MDL handles the overflow within the mdl-layout__content, this is the element you should scroll on.
So this -
$("html, body").animate({scrollTop:position}, speed, "swing");

Now becomes-
$(".mdl-layout__content").animate({scrollTop:position}, speed, "swing");

Here's a codepen example -
http://codepen.io/mdlhut/pen/BNeoVa

A: Mitsuhiko Shimomura helped me in a different stack-overflow question. Instead of  var position = target.offset().top;  I used var position = target.get( 0 ).offsetTop - 130; if not the scroll would go to top and throw off the position, it did not look good. I had to add - 130 to the  .offsetTop because the smooth scroll was going past my target id's in the html. Thank you for the help! See my app where I used this smoothscroll feature.
And remember to add smooth class to anchors in html like this
Target

Target

$(function(){
  $('a.smooth').click(function(){
    console.log("SMOOTH BEGIN");
    var speed = 1000;
    var href= $(this).attr("href");
    var target = $(href == "#" || href == "" ? 'html' : href);
    var position = target.get( 0 ).offsetTop - 130;
    $(".mdl-layout__content").animate({scrollTop:position}, speed, "swing");
    console.log("SMOOTH END");
  });
});


text:
Q: Problem Glide showing picture from local Uri I'm trying to show a picture stored in my device using Glide but it doesn't work. My result Uri is:
file:///data/user/0/com.example.tfg_red_social_v0/files/croppedImage.jpg
The file exists I've checked with the explorer
private val cropImage = registerForActivityResult(uCropContract){uri->
     Glide.with(this).load(uri).circleCrop().into(binding.ivPerfil)
}

Please any help is welcome I'm adding extra code
My manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">
    <!-- PERMISOS PARA ACCEDER A INTERNET, CAMARA Y SD -->
    <uses-permission android:name="android.permission.INTERNET" />
   <!-- <uses-permission android:name="android.permission.CAMERA" /> -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:ignore="ScopedStorage"/>
    <uses-feature android:name="android.hardware.camera" android:required="true" />

this is my provider
<provider
            android:authorities="com.example.tfg_red_social_v0.fileprovider"
            android:name="androidx.core.content.FileProvider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>

and my file_paths.xml
<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-files-path
        name="my_debug_images"
        path="Pictures"/>
</paths>

And here how I use UCROP
    private val uCropContract = object: ActivityResultContract<List<Uri>, Uri>(){
        override fun createIntent(context: Context, input: List<Uri>): Intent {
            val inputUri =  input[0]
            val outPut =  input[1]

            val uCrop = UCrop.of(inputUri,outPut)
                .withAspectRatio(16f,9f)
            return uCrop.getIntent(context)

        }

        override fun parseResult(resultCode: Int, intent: Intent?): Uri {
            return UCrop.getOutput(intent!!)!!
        }
    }

    private val cropImage = registerForActivityResult(uCropContract){uri->
        imagenUri=uri
        Glide.with(this).load(uri).into(binding.ivImagen)
      }

    private val getContent = registerForActivityResult(ActivityResultContracts.GetContent()){uri->
        val inputUri = uri
        val outputUri = File(requireContext().filesDir, "croppedImage.jpg").toUri()
        val listUri = listOf<Uri>(inputUri!!,outputUri)
        cropImage.launch(listUri)
    }
}

And I start crop with
  binding.ivImagen.setOnClickListener{
        getContent.launch("image/*")
    }

A: Your Glide usage seems correct, do you have the second dependency added, please check your build.gradle(:app):
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'

Edit: In your manifest check if you have this permissions:
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        tools:ignore="ScopedStorage" />

And this in between your application tags in manifest:
        <provider
            android:name="androidx.core.content.FileProvider"

            android:authorities="com.example.tfg_red_social_v0.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/file_paths" />
        </provider>

And add file_paths.xml contains below code in your res/xml folder:
<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-path
        name="my_images"
        path="Android/data/com.example.tfg_red_social_v0/files/Pictures" />
</paths>

If it's not refreshing image then clear its cache by adding like:
Glide.get(this).clearMemory()
Glide.with(this)
     .load(uri)
     .circleCrop()
     .skipMemoryCache(true)
     .diskCacheStrategy(DiskCacheStrategy.NONE)
     .into(binding.ivPerfil)


text:
Q: C++ VS 2019 Expected '}' Error but the code runs fine I've written this code using Visual Studio 2019 community version just for practice and I keep getting "expected '}'" error at the very last line of the code. When I click run, it runs fine. Why is that?
Here is the full code.
#include <iostream>
#include <string>

using namespace std;

void funSayHi();

class People
{
public:
    void callPeople(string x, int y, double z)
    {
        ResName = x;
        ResAge = y;
        ResHight = z;

        cout << ResName << endl << ResAge << endl << ResHight << endl;
    }

private:
    string ResName = "No Name";
    int ResAge = 0;
    double ResHight = 0;
};

int main()
{
    string name;
    int age;
    double hight;

    funSayHi();

    cout << "Enter name\n";
    cin >> name;
    cout << "Enter age\n";
    cin >> age;
    cout << "Enter hight\n";
    cin >> hight;

    People peopleObj;
    peopleObj.callPeople(name, age, hight);
}

void funSayHi()
{
    cout << "Hi\n";
} //VS 19 underlines this bracket and says "expected '}'"


text:
Q: got error in SQL in my oracle when i call my trigger to update total in my STUDENT table I have to call a trigger which updates fields of total and percentage after query is inserted
heres the code
create table bhrugus1 (
  student_name varchar2(100),
  dbms number,
  dsa number,
  mco number,
  total number,
  percentage number,
  roll_no number primary key

);

CREATE OR REPLACE TRIGGER trial1
AFTER INSERT on bhrugus1
REFERENCING new AS new
FOR EACH ROW
BEGIN
      :new.total := :new.dbms + :new.dsa + :new.mco;
      :new.percentage := (:new.dbms + :new.dsa + :new.mco) / 3 ;
END;

insert into bhrugus1 values ('bhrugu',90,90,90,1,1,2);

SELECT * from bhrugus1;

the table and while running trigger i get error

the new error

A: Please modify your trigger:
CREATE OR REPLACE TRIGGER trial1
before INSERT on bhrugus1
REFERENCING new AS new
FOR EACH ROW
BEGIN
      :new.total := :new.dbms + :new.dsa + :new.mco;
      :new.percentage := (:new.dbms + :new.dsa + :new.mco) / 3 ;
END;

You shouldn't run an update statement in your trigger, use the :new... instead of update.
The other important thing is:
before insert

A: You are missing a component, what happens when someone UPDATEs any or all of dbms,dsa,mco. There is no update trigger to recalculate total or percentage. You could of course just include 'OR UPDATE' on the trigger. A better way however would be defining them a virtual columns.
create table bhrugus1 (
  student_name varchar2(100),
  dbms number,
  dsa number,
  mco number,
  total number generated always as (dbms+dsa+mco) virtual,
  percentage number generated always as ((dbms+dsa+mco)/3) virtual,
  roll_no number primary key
);

With that both total and percentage (bad name it is the average - but that is another issue) will always calculated properly.  And drop the trigger it is no longer needed.


text:
Q: Signature/Hash Choice for File Integrity Verification For a file repository, I need to select a hashing algorithm that will reasonably ensure the integrity of files.
I need an algorithm that anyone (with a bit of effort) would be able to easily use to verify the integrity given the hash. In short, the file may be transferred to the user, along with a hash, and they must be able to verify that the hash comes from the file.
My first choice would be MD5 because there seems to be widely available utilities to verify MD5 hashes, but I'm concerned with the MD5 algorithm being cryptographically broken (ref Wikipedia/US-CERT: http://en.wikipedia.org/wiki/MD5)
My second choice would be a SHA-2 algorithm, but I'm concerned about availability of utilities that could easily verify the hash. Most examples I've found show program code to evaluate a hash, but I've found few, if any, utilities that are pre-built (asking users to build their own utility is beyond the 'easily' scope)
What other options are available for generating and evaluating a file hash, or are these two the options that are best?

A: Provide both/multiple, and let the user decide which they verify against. Or if they are really cautious, they can verify against both/all.
Have seen download sites use this approach. One site recommended the most secure, but offered others like md5 as fallback. It also provided links to tools. Can't remember specific site I'm afraid.

A: Since you've been able to find a few file-checkers, why not link to them as a recommendation? That way your users have at least one tool they can use. They don't need several dozen different filechecking utilities, they need just one which works for the algo you chose to use.
Tools you could link to:
Windows: http://securityxploded.com/download-hash-verifier.php
Mac OS X: http://www.macupdate.com/app/mac/31781/checksum

A: sha256sum, a program a part of the coreutils package on linux will generate checksums for the listed files. The format of the checksum output is the same as that of the md5sum program (but using SHA-256 hashing instead of MD5 of course), which has been widely used for years. You didn't list any target platforms but a quick googling shows there are Windows ports of the command line program.
If you need to generate large numbers of checksums you can use md5deep, which includes support for other hashes as well, including SHA-256.
http://md5deep.sourceforge.net/
I haven't tried this but from the screenshots it looks pretty neat integrating into OSX and Windows Explorer: http://implbits.com/HashTab.aspx


text:
Q: how to allow only one radiobtton to be executed in a radiogroup inside a linear layout? I am trying to place a radio group with 3 radio buttons inside a linear layout. My aim is to choose only one RadioButton inside the RadioGroup but, it is giving me an error that there are multiple root tags. Can someone figure out how to solve this?
file.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="ok"

    android:id="@+id/textemail"/>

<RadioGroup
    android:layout_width="match_parent"
    android:layout_height="match_parent">
<RadioButton
    android:id="@+id/one"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="one" />

<RadioButton
    android:id="@+id/two"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="two"
    />

<RadioButton
    android:id="@+id/three"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="three" />

</RadioGroup>

<TextView
    android:id="@+id/textView1"
    android:layout_below="@+id/textemail"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="To:"
     />

<TextView
    android:id="@+id/TextTo"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="khushi"/>

<TextView
    android:id="@+id/textView2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Comment:"
     />

<TextView
    android:id="@+id/TextS3"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="your comment"

    />

<TextView
    android:id="@+id/textView4"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="email us "
    android:textAppearance="?android:attr/textAppearanceLarge" />

<EditText
    android:id="@+id/editText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="top"
    android:inputType="textMultiLine"
    android:lines="10" />

<Button
    android:id="@+id/button"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Send"
    android:textStyle="italic"/>

</LinearLayout>

A: You immediately close your radiogroup:
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"/>

This should be:
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"> // Note that there is no forward slash at the end

And you are not closing the RadioGroup:
</RadioButton> <-- This should be </RadioGroup>

A: Your RadioButton (views) should be children of the RadioGroup(view). By closing your RadioGroup using /> you declare the RadioButton(s) and the RadioGroup as children of the LinearLayout.
The Following should work.
   <?xml version="1.0" encoding="utf-8"?>
<Linearlayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="hello"
    android:id="@+id/textview"/>

<RadioGroup
    android:layout_width="match_parent"
    android:layout_height="match_parent">
<RadioButton
    android:id="@+id/one"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="one" />

<RadioButton
    android:id="@+id/two"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="two"
    />

<RadioButton
    android:id="@+id/three"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="three" />
</RadioButton>
</RadioGroup>

<TextView
    android:id="@+id/textViewllol"
    android:layout_below="@+id/textemail"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="hi:"
     />

<TextView
    android:id="@+id/Texme"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text=""
    />

<TextView
    android:id="@+id/textView3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="comment:"
    />

<TextView
    android:id="@+id/Text2"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="your comments"

    />

<TextView
    android:id="@+id/textView45"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="ok"
     />

<EditText
    android:id="@+id/editTextMessage"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="top"
    android:lines="10" />

<Button
    android:id="@+id/button4785"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="send"
    />

</LinearLayout>

A: Change below -
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"/>

to
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent">

<RadioButton
    android:id="@+id/one"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="one" />

<RadioButton
    android:id="@+id/two"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="two"
    />

<RadioButton
    android:id="@+id/three"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="three" />

</RadioGroup>

One of your Text is not in correct format change it as below -
<TextView
android:id="@+id/textView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ok:"
 />

to
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ok:"
 />

One more error -
change below -
<RadioGroup
    android:layout_width="match_parent"
    android:layout_height="match_parent">

to
<RadioGroup
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

A: You have one </Radiobutton> tag above </Radiogroup> that shouldn't be here. Just remove it to have :
<RadioGroup
    android:layout_width="match_parent"
    android:layout_height="match_parent">
<RadioButton
    android:id="@+id/one"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="one" />

<RadioButton
    android:id="@+id/two"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="two"
    />

<RadioButton
    android:id="@+id/three"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="three" />
</RadioGroup>


text:
Q: Error To Database when Leave uncheck this is the output
<?php

include_once('connection.php');

$StdID = $_REQUEST['txtID'];
$StdImage = $_REQUEST['txtImage'];
$FullName = $_REQUEST['txtFullname'];
$Address = $_REQUEST['txtAdd'];
$Bday = $_REQUEST['txtBday'];
$Grade = $_REQUEST['txtGrade'];
$Height = $_REQUEST['txtHeight'];
$Weight = $_REQUEST['txtWeight'];
$BloodPressure = $_REQUEST['txtBlood'];
$Gname = $_REQUEST['txtGname'];
$Contact = $_REQUEST['txtContact'];
$BCG = $_REQUEST['chkBCG'];
$Cardiac = $_REQUEST['chkCardiac'];
$Asthma1 = $_REQUEST['chkAsthma1'];
$Alcohol = $_REQUEST['chkAlcohol'];
$OPV1 = $_REQUEST['chkOpv1'];
$Thyroid = $_REQUEST['chkThyroid'];
$Chicken = $_REQUEST['chkChicken'];
$Tobacco = $_REQUEST['chkYosi'];
$OPV2 = $_REQUEST['chkOPV2'];
$Diabetes = $_REQUEST['chkDiabetes'];
$Measles = $_REQUEST['chkMeasles1'];
$Opv3 = $_REQUEST['chkOpv3'];
$Hypertension = $_REQUEST['chkHypertension'];
$Mumps = $_REQUEST['chkMumps1'];
$Food1 = $_REQUEST['txtFood1'];
$DPT1 = $_REQUEST['chkDpt1'];
$Tuberculosis = $_REQUEST['chkTuber'];
$Ulcer = $_REQUEST['chkUlcer'];
$Food2 = $_REQUEST['txtFood2'];
$DPT2 = $_REQUEST['chkdpt2'];
$Asthma2 = $_REQUEST['chkAsthma2'];
$Dengue = $_REQUEST['chkdengue'];
$Food3 = $_REQUEST['txtfood3'];
$Dpt3 = $_REQUEST['chkDpt3'];
$Kidney = $_REQUEST['chkKidney'];
$Head = $_REQUEST['chkHead'];
$Measles2 = $_REQUEST['chkMeasles2'];
$Cancer = $_REQUEST['chkCancer'];
$Std = $_REQUEST['chkstd'];
$Scar = $_REQUEST['chkScar'];
$Hepa = $_REQUEST['chkHepa'];
$Hypertension2 = $_REQUEST['chkHypertension2'];
$Mole = $_REQUEST['chkMole'];
$Std2 = $_REQUEST['chkStd2'];
$Kidney2 = $_REQUEST['chkKidney2'];
$Tattoo = $_REQUEST['chkTattoo'];
$OthersImmu = $_REQUEST['txtothersimmu'];
$Birthmark = $_REQUEST['txtBirthmark'];
$OthersImmu2 = $_REQUEST['txtothersimmu2'];
$OthersIll = $_REQUEST['txtothersill'];
$OthersImmu3 = $_REQUEST['txtothersimmu3'];
$OthersIll2 = $_REQUEST['txtothersill2'];
$Mens = $_REQUEST['txtmens'];

$sql = "INSERT INTO tbl_medics VALUES ('$StdID', '$StdImage', '$FullName', '$Address', '$Bday', '$Grade', '$Height', '$Weight', '$BloodPressure', '$Gname','$Contact', '$BCG', '$Cardiac', '$Asthma1', '$Alcohol', '$OPV1', '$Thyroid', '$Chicken','$Tobacco', '$OPV2', '$Diabetes', 'Measles', '$Opv3', '$Hypertension', '$Mumps', '$Food1', '$DPT1', '$Tuberculosis', '$Ulcer', '$Food2', '$DPT2', '$Asthma2', '$Dengue', '$Food3', '$Dpt3', '$Kidney', '$Head', '$Measles2', '$Cancer', '$Std', '$Scar', '$Hepa', '$Hypertension2', '$Mole', '$Std2', '$Kidney2', '$Tattoo', '$OthersImmu', '$Birthmark', '$OthersImmu2', '$OthersIll', '$OthersImmu3', '$OthersIll2', '$Mens')";

if ($conn->query($sql) === TRUE) {
    header("Location: MedicRecords.php?SuccessfullyAdded");
} else {
    echo "Error: " . $sql . "
" . $conn->error;
}

$conn->close();
?>

This is my Input
 <form action="AddMedicRecords.php" method="POST" enctype="multipart/form-data" style="border:1px solid #ccc">
 <?php $id = $_GET['id'];

  $sql = "SELECT * FROM tblstdpro where StdID = '$id'";

  $result = mysqli_query($conn,$sql);
  $count = 0;
  while($row = mysqli_fetch_array($result)){
    ?>

 Student Image Location
    <input type="text" class="form-control" value="<?php echo $row['StdImage'];?>" name="txtImage" type="readonly" readonly>

    LRN
    <input type="text" class="form-control" value="<?php echo $row['StdID'];?>" name="txtID" required>

   Full Name
    <input type="text" class="form-control" value="<?php echo $row['Lname'];?>, <?php echo $row['Fname'];?> <?php echo $row['Mname'];?>" name="txtfullname" required>

    Address

    <input type="text" class="form-control" value="<?php echo $row['Street']; ?> , <?php echo $row['Barangay']; ?> <?php echo $row['Munic']; ?>, <?php echo $row['Province']; ?>" name="txtadd" required>

      Birthday
    <input type="text" class="form-control" value="<?php echo $row['Bday'];?>" name="txtbday" required>

  Grade/ Course

    <input type="text" class="form-control" value="<?php echo $row['Track'];?> - <?php echo $row['YearLvl'];?>" name="txtgrade" required>

        Height
    <input type="" class="form-control" placeholder="Enter Height" name="txtheight" required>

    Weight
    <input type="" class="form-control" placeholder="Enter Weight" name="txtweight" required>

    Blood Pressure
    <input type="" class="form-control" placeholder="Enter BP" name="txtblood" required>

*Person to be Notified in Case of Emergency

          Name:
    <input type="text" class="form-control" value="<?php echo $row['Mother'];?>"  name="txtGname" required>

          Contact No.
    <input type="text" class="form-control" class="form-control" value="<?php echo $row['Contact'];?>" name="txtContact">

*Kindly Check the Box Provided on the Left Side

            IMMUNIZATION
            FAMILY HISTORY
            PREVIOUS ILLNESS
            PERSONAL HISTORY

            <input type="checkbox" name="chkBCG" value="BCG">   BCG
            <input type="checkbox" name="chkCardiac" value="Cardiac Disease">   Cardiac Disease
            <input type="checkbox" name="chkAsthma1" value="Asthma">   Asthma
    <input type="checkbox" name="" value="chkAlcohol">   Alcohol Use

            <input type="checkbox" name="chkOpv1" value="OPV 1">   OPV 1
            <input type="checkbox" name="chkThyroid" value="Thyroid Disease">   Thyroid Disease
            <input type="checkbox" name="chkChicken" value="Chicken Pox">   Chicken Pox
    <input type="checkbox" name="chkYosi" value="Tobacco Use">   Tobacco Use

            <input type="checkbox" name="chkOpv2" value="OPV 2">   OPV 2
            <input type="checkbox" name="chkDiabetes" value="Diabetes Mellitus">   Diabetes Mellitus
            <input type="checkbox" name="chkMeasles1" value="Measles">   Measles
            Allergy to Food, Drugs,Etc..

            <input type="checkbox" name="chkOpv3" value="OPV 3">   OPV 3
            <input type="checkbox" name="chkHypertension" value="Hypertension">   Hypertension
            <input type="checkbox" name="chkMumps" value="Mumps">   Mumps
    <input type="text" class="form-control" class="form-control" placeholder="Enter Allergy to Food, Drugs,Etc.." name="txtFood1">

          <input type="checkbox" name="ChkDpt1" value="DPT1">   DPT 1
            <input type="checkbox" name="chkTuber" value="Tuberculosis">   Tuberculosis
            <input type="checkbox" name="chkUlcer" value="Peptic Ulcer">   Peptic Ulcer
    <input type="text" class="form-control" class="form-control" placeholder="Enter Allergy to Food, Drugs,Etc.." name="txtFood2">

          <input type="checkbox" name="chkDpt2" value="DPT 2">   DPT 2
            <input type="checkbox" name="chkAstma2" value="Asthma">   Asthma
            <input type="checkbox" name="chkDengue" value="Dengue">   Dengue
    <input type="text" class="form-control" class="form-control" placeholder="Enter Allergy to Food, Drugs,Etc.." name="txtFood3">

            <input type="checkbox" name="chkDpt3" value="DPT 3">   DPT 3
            <input type="checkbox" name="chkKidney" value="Kidney Disease">   Kidney Disease
            <input type="checkbox" name="chkHead" value="Head Injury">   Head Injury
            Any Identification Mark:

            <input type="checkbox" name="chkMeasles2" value="Measles">   Measles
            <input type="checkbox" name="chkCancer" value="Cancer">   Cancer
            <input type="checkbox" name="chkStd" value="STD">   STD
            <input type="checkbox" name="chkScar" value="Scar">   1. Scar

            <input type="checkbox" name="chkHepa" value="HEPA-B">   HEPA-B
            <input type="checkbox" name="chkSkin" value="Skin Disease">   Skin Disease
            <input type="checkbox" name="chkHypertension2" value="Hypertension">   Hypertension
            <input type="checkbox" name="chkMole" value="Mole">   2. Mole

            Others:
            <input type="checkbox" name="chkStd2" value="STD">   STD
            <input type="checkbox" name="chkKidney2" value="Kidney Problem">   Kidney Problem
            <input type="checkbox" name="chkTattoo" value="Tattoo">   3. Tattoo

            <input type="text" class="form-control" class="form-control" placeholder="Enter Others" name="txtOthersImmu">

            Others:
            <input type="checkbox" name="txtBirthmark" value="Birthmark">   4. Birthmark

            <input type="text" class="form-control" class="form-control" placeholder="Enter Others" name="txtOthersImmu2">

            <input type="text" class="form-control" class="form-control" placeholder="Enter Others" name="txtOthersIll">

            <input type="text" class="form-control" class="form-control" placeholder="Enter Others" name="txtOthersImmu3">

            <input type="text" class="form-control" class="form-control" placeholder="Enter Others" name="txtOthersIll2">

      FOR FEMALE ONLY: Date of Last Menstrual Period:

                  <input type="date" placeholder="Enter Birthday" class="form-control" data-inputmask="'alias': 'mm/dd/yyyy'" data-mask name="txtMens" >

          <button type="submit" name="submit" class="btn btn-block btn-primary btn-lg">Add Student</button>
      <button type="button" class="btn btn-block btn-danger btn-lg">Cancel</button>

</form>

</form>

<?php
}
?>

Errors Says this
Notice: Undefined index: txtFullname in C:\wamp64\www\TestingThesis\AddMedicRecords.php on line 9

Error: INSERT INTO tbl_medics VALUES ('014-321', 'StdImage/014-321.jpg', '', '', '', '', '', '', '', 'Mommy','097576346', 'BCG', '', '', '', '', '', '','', '', '', 'Measles', '', '', '', '', '', '', '', '', '', '', '', '', '', 'Kidney Disease', '', '', '', '', '', '', '', 'Mole', '', '', '', '', '', '', '', '', '', '')
Data truncated for column 'StdID' at row 1

How can this be done when there are so many uncheck it errors bet when i check it all it goes in, how can i put a default value if it is uncheck?

A: The major issue is, when you are dealing with a checkbox, then you have to check whether it is checked or not like:
$value = '';    // Default value
if( isset($_REQUEST['checkbox_name']) )
{
    $value = $_REQUEST['checkbox_name'];
}

apart form that, your code is open to SQL Injections. And you are inserting data into table without providing column names. Any changes to the table will break the whole thing.

A: Input name is wrong, change it to txtFullname instead of txtfullname.
Full Name <input type="text" class="form-control" value="<?php echo $row['Lname'];?>, <?php echo $row['Fname'];?> <?php echo $row['Mname'];?>" name="txtFullname" required>

Also i fixed all you invalid html tags:
<?php
        $id = $_GET['id'];
        $sql = "SELECT * FROM tblstdpro where StdID = '$id'";
        $result = mysqli_query($conn,$sql);  $count = 0;
        while($row = mysqli_fetch_array($result)){ ?>
    <form action="AddMedicRecords.php" method="POST" enctype="multipart/form-data" style="border:1px solid #ccc">

 Student Image Location <input type="text" class="form-control" value="<?php echo $row['StdImage'];?>" name="txtImage" readonly>

                LRN <input type="text" class="form-control" value="<?php echo $row['StdID'];?>" name="txtID" required>

                Full Name <input type="text" class="form-control" value="<?php echo $row['Lname'];?>, <?php echo $row['Fname'];?> <?php echo $row['Mname'];?>" name="txtFullname" required>

                Address
 <input type="text" class="form-control" value="<?php echo $row['Street']; ?> , <?php echo $row['Barangay']; ?> <?php echo $row['Munic']; ?>, <?php echo $row['Province']; ?>" name="txtadd" required>

                Birthday <input type="text" class="form-control" value="<?php echo $row['Bday'];?>" name="txtbday" required>

                Grade/ Course
 <input type="text" class="form-control" value="<?php echo $row['Track'];?> - <?php echo $row['YearLvl'];?>" name="txtgrade" required>

                Height <input type="" class="form-control" placeholder="Enter Height" name="txtheight" required>

                Weight <input type="" class="form-control" placeholder="Enter Weight" name="txtweight" required>

                Blood Pressure <input type="" class="form-control" placeholder="Enter BP" name="txtblood" required>

*Person to be Notified in Case of Emergency

                Name: <input type="text" class="form-control" value="<?php echo $row['Mother'];?>" name="txtGname" required>

                Contact No. <input type="text" class="form-control" value="<?php echo $row['Contact'];?>" name="txtContact">

*Kindly Check the Box Provided on the Left Side

                            IMMUNIZATION
                            FAMILY HISTORY
                            PREVIOUS ILLNESS
                            PERSONAL HISTORY

                            <input type="checkbox" name="chkBCG" value="BCG">   BCG
                            <input type="checkbox" name="chkCardiac" value="Cardiac Disease">   Cardiac Disease
                            <input type="checkbox" name="chkAsthma1" value="Asthma">   Asthma
                            <input type="checkbox" name="" value="chkAlcohol">   Alcohol Use

                            <input type="checkbox" name="chkOpv1" value="OPV 1">   OPV 1
                            <input type="checkbox" name="chkThyroid" value="Thyroid Disease">   Thyroid Disease
                            <input type="checkbox" name="chkChicken" value="Chicken Pox">   Chicken Pox
                            <input type="checkbox" name="chkYosi" value="Tobacco Use">   Tobacco Use

                            <input type="checkbox" name="chkOpv2" value="OPV 2">   OPV 2
                            <input type="checkbox" name="chkDiabetes" value="Diabetes Mellitus">   Diabetes Mellitus
                            <input type="checkbox" name="chkMeasles1" value="Measles">   Measles
                            Allergy to Food, Drugs,Etc..

                            <input type="checkbox" name="chkOpv3" value="OPV 3">   OPV 3
                            <input type="checkbox" name="chkHypertension" value="Hypertension">   Hypertension
                            <input type="checkbox" name="chkMumps" value="Mumps">   Mumps
                            <input type="text" class="form-control" placeholder="Enter Allergy to Food, Drugs,Etc.." name="txtFood1">

                        <input type="checkbox" name="ChkDpt1" value="DPT1">   DPT 1
                        <input type="checkbox" name="chkTuber" value="Tuberculosis">   Tuberculosis
                        <input type="checkbox" name="chkUlcer" value="Peptic Ulcer">   Peptic Ulcer
                        <input type="text" class="form-control" placeholder="Enter Allergy to Food, Drugs,Etc.." name="txtFood2">

                        <input type="checkbox" name="chkDpt2" value="DPT 2">   DPT 2
                        <input type="checkbox" name="chkAstma2" value="Asthma">   Asthma
                        <input type="checkbox" name="chkDengue" value="Dengue">   Dengue
                        <input type="text" class="form-control" placeholder="Enter Allergy to Food, Drugs,Etc.." name="txtFood3">

                            <input type="checkbox" name="chkDpt3" value="DPT 3">   DPT 3
                            <input type="checkbox" name="chkKidney" value="Kidney Disease">   Kidney Disease
                            <input type="checkbox" name="chkHead" value="Head Injury">   Head Injury
                            Any Identification Mark:

                            <input type="checkbox" name="chkMeasles2" value="Measles">   Measles
                            <input type="checkbox" name="chkCancer" value="Cancer">   Cancer
                            <input type="checkbox" name="chkStd" value="STD">   STD
                            <input type="checkbox" name="chkScar" value="Scar">   1. Scar

                            <input type="checkbox" name="chkHepa" value="HEPA-B">   HEPA-B
                            <input type="checkbox" name="chkSkin" value="Skin Disease">   Skin Disease
                            <input type="checkbox" name="chkHypertension2" value="Hypertension">   Hypertension
                            <input type="checkbox" name="chkMole" value="Mole">   2. Mole

                            Others:
                            <input type="checkbox" name="chkStd2" value="STD">   STD
                            <input type="checkbox" name="chkKidney2" value="Kidney Problem">   Kidney Problem
                            <input type="checkbox" name="chkTattoo" value="Tattoo">   3. Tattoo

                            <input type="text" class="form-control" placeholder="Enter Others" name="txtOthersImmu">

                            Others:
                            <input type="checkbox" name="txtBirthmark" value="Birthmark">   4. Birthmark

                            <input type="text" class="form-control" placeholder="Enter Others" name="txtOthersImmu2">

                            <input type="text" class="form-control" placeholder="Enter Others" name="txtOthersIll">

                            <input type="text" class="form-control" placeholder="Enter Others" name="txtOthersImmu3">

                            <input type="text" class="form-control" placeholder="Enter Others" name="txtOthersIll2">

 FOR FEMALE ONLY: Date of Last Menstrual Period:

 <input type="date" placeholder="Enter Birthday" class="form-control" data-inputmask="'alias': 'mm/dd/yyyy'" data-mask name="txtMens">

 <button type="submit" name="submit" class="btn btn-block btn-primary btn-lg">Add Student</button> <button type="button" class="btn btn-block btn-danger btn-lg">Cancel</button>

    </form>
    <?php }?>


text:
Q: How to generate def file from singularity container, sif file or sandbox? So I have created a singularity sif file, by building it from a writable sandbox. I manually installed the packages and software and other changes in writable mode. But now I want a def file from it. Is there any way?
I have tried  cat /.singularity.d/Singularity but it only shows the build from the def files only not the manual installations.

A: Much like Docker, the singularity container does not keep a record of what you did while inside it. You could check out ~/.bash_history or /root/.bash_history to see if the commands are present there. Otherwise you'll have to rebuild from memory.


text:
Q: Agrupar resultado de un for Quiero agrupar los resultados que obtengo de un for por un campo que se repite tantas veces como resultados hay, la verdad es que no tengo muy claro como hacer un segundo for:
var records = document.getElementById('INFO');
records.innerHTML = '';
var html = '';
for (i=0; i<feature.length; i++){('')
    records.innerHTML += '
' + feature[i].get('codigo') + '
';
    if(feature[i].get('arte') !=null){
        records.innerHTML += '
' + feature[i].get('arte') + '
';
    }else{
        records.innerHTML += '';
    }
    if(feature[i].get('fecha_actividad') !=null){
        records.innerHTML += '
' + feature[i].get('fecha_actividad') + '
';
    }else{
        records.innerHTML += '';
    }
}

Supongamos que obtengo 3 resultados, de esos 3 resultados, por ejemplo, 2 tienen el mismo código, con este ciclo for se escriben secuencialmente uno tras otros hasta completar la salida de los 3. Lo que quiero es agrupar los que tienen el mismo código y muestre el resto de los registros y después ponga los siguientes códigos con el resto de registros. (el formato no sería ese claro)

cod: 64

especialidad: baile - fecha:29/10/2020

especialidad:canto - fecha:30/10/2020

cod:65

especialidad: baile - fecha:29/10/2020

gracias!


text:
Q: Facebook isn't recognizing development key hash I have tried all the other solutions i could find. I have tried deleting the debug.keystore, generating a new development keyhash, no matter what i get the alert saying unrecognized keyhash when clicking the facebook login button when running my app. The key hash that it tells me is unrecognized is definitely saved in my facebook app settings. Why isn't facebook recognizing this key hash, even though it is definitely in the FB app settings?
I have also tried printing the key hash both programmatically and in terminal, both of which were identical giving me this:

and the facebook app settings match perfectly:

A: Are you sending the correct ID to identify yourself along with the key hash though? And could there be any intermediary changes being made this data before it is sent?
Your best bet would be to attach a debugger exactly before the request is being sent to ensure all values are populated correctly.
EDIT:
Try this solution:
Android Facebook Key Hash Stopped Working


text:
Q: Unused output of a flyback transformer I have a flyback transformer.  It has 2 outputs. I'm going to use one of them on a flyback converter.
Should I leave the second output of the transformer unconnected or connect a load to it?

A:
should I left the second output of the transformer empty or connect a
load to it?

If it's no problem, leave it open circuit or, if it's the same voltage as the other secondary, you should be able to parallel them up to reduce \$I^2R\$ losses in the secondary.

A: Well, that depends on what the second output is for. There aren't two equal transformer in the world.
Often the second winding is for auxiliary bias but it could be a reset winding or a second output. Unless you know how it's wound you can't say for sure.
In doubt keep it open


text:
Q: How to explain eclipse that project from svn if I checkout it by tortoise svn? I checkout my project using tortoise svn.
I want to import it to eclipse and eclipse svn plugin must to work.
If I make java import - eclipse doesn't understand that it is project from svn.
svn plugin is installed.
UPDATE
I try Import-->Team-->Team Projcect Set

This thing ask me select FILE. What Do I need to select?

A: Which svn plusing are you using and eclipse version ?
I am using Eclipse Kepler and SVN Plugin as Subversive Team Provider. It is working fine for me. I have imported project as Java project.

A: Eclipse will understand your project if and only if it contains .classpath file and .project file in project.
If you are using Maven, then first run clean compile and eclipse:eclipse commands, then import in eclipse.

A: Use subversion. Sometimes, it may require to install newer connector. Refer to this question

A: If you have installed svn plugin in eclipse. You can also checkout project from eclipse.
Make .psf file pointing to your repository and then make import.
Import-->Team-->Team Projcect Set
Open notepad paste below content(correct with your path) and save as .psf
<?xml version="1.0" encoding="UTF-8"?>
<psf version="2.0">
<provider id="org.tigris.subversion.subclipse.core.svnnature">
<project reference="0.9.3,URL to folder you want to checkout,folder name"/>
<project reference="0.9.3,URL to another folder you want to checkout,folder name 2"/>
</provider>
</psf>


text:
Q: Finding twice the same random pattern How to find a character only if it is always followed by the same letter (random and unknown)?
For example:

kelmqaetrstaeiii

E.g with the letter a, it is twice followed by the same letter e, so i would like it to be found, but with the following:

kelmqaetrstafiii

We have ae and af, 2 differents letters after a, in this case nothing should be taken.
Is it possible?

A: You could iterate over the string and check if one of the pairs already appeared in the string:

function hasPair(str) {
    const dupe = {};
    for (let index = 0; index < str.length - 1; index++) {
        const pair = str.substr(index, 2);
        if (dupe[pair])
            return pair;
        dupe[pair] = true;
    }
    return false;
}

console.log(
    hasPair("kelmqaetrstaeii"),
    hasPair("kelmqaetrstaii")
);

A: Match the first letter, then use lookahead, match the second letter, and use backreferences:

const re = /(\w)(?=(\w).+\1\2)/;
console.log('kelmqaetrstaeiii'.match(re)[0]);
console.log('kelmqaetrstafiii'.match(re));


text:
Q: Spans jumping around on resize and/or zoom I'm at a loss - my Javascript is terrible and I'm trying to show some span based panels that hold some tables. The panels are simply left-side and right-side panels (you select something on the left - you see something on the right).
I need to be using spans as I've got Ajax repopulating them regularly. I also need to use the span with the id ResizableListTableDiv as it's necessary whilst using the great fxHeader javascript found at www.jaimon.co.uk (I've embedded the code to assist pulling the samples in) [note - the version I'm using doesn't seem to exactly match the version on jaimon.co.uk now]
My panels work to a point but I see problems :-
1) when the page zoom goes below 80%, or
2) when I resize the window, or
3) when I zoom in and out.
(the main problem being that the the right side panel flips over to under the other one on these events).
Note, I've only focused on IE so far - tips on how to make this any browser would be good too.
PS. Do I need to be doing this with Javascript or am I missing something and html should be doing it for me?

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Hello World

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5

Column 1	Column 2	Column 3	Column 4	Column 5


text:
Q: How to compare column name of a List type object with a string in C# I have List Type object in which I am passing data from the stored procedure. The result set has some columns which I need to compare with a string.
Ex. colName1 == "abc"
How to iterate through columns of the list and compare column names with a string? How to access text of the column?
modelSP.objAbsentDetail = dbOracle.STORED_PROC_DTL(ENGG, YY, MM, Location).ToList();

foreach(var item in model.objAbsentDetail)
        {
            //item.C1 (Column Name, not value) == "abc"
        }

Model Class:
public class abc
{
     public List<STORED_PROC_DTL_Result> objAbsentDetail { get; set; }
}

A: If you don't want to use reflection for this you can have your properties be backed by a dictionary rather than a named variable :
private Dictionary<string, object> _values = new ...

public string C1{
  get{
    if(!_values.ContainsKey("C1"))
      return null;
    return (string)_values["C1"];
  }
  set{
    _values["C1"] = value;
  }
}

Then you can rummage in the _values.Keys for your column name


text:
Q: convert date dd/mm/yyyy format from a form to timestamp? I have a form requiring date in dd/mm/yyyy format
and I've tried to convert it to a timestamp with strtotime() function
but I've seen it works only if you fill the form with date written like dd-mm-yyyy
how could i solve? I don't know abroad but here in Italy nobody writes dates like that dd-mm-yyyy

A: Stop using strotime(), date(), time() etc. functions, start using DateTime.
Perfect solution for all types of known input :
$dt = DateTime::createFromFormat('d/m/Y', $yourDMYinput);
echo $dt->getTimestamp(); # or $dt->format('U');

And why do you need timestamp for?
Why explode, replace or even cut string??? Just use createFromFormat.

Q1: Because its not supported below PHP 5.3.

There is v5.5 already out. I think answers should be for the latest code, not for code from the year 2006. Yes v5.2 was released in 2006 and v5.3 in 2009 (see release dates). If OP requests old code, find it on SO, and close this question with duplicate; don't answer it.

Q2: Because I don't know DateTime.

Learn it.

Q3: Because I can do more with strotime(), date(), time() etc.

Show me one thing that this functions can do, and DateTime cannot.
"Deprecated" code examples :
$input = '12/09/2013'; # dd/mm/yyyy

$new = substr($input,6,4)."-".substr($input,3,2)."-".substr($input,0,2);
$new = strtotime($new);
echo "$new\n";

$m = explode('/', $input);
$new = mktime(0,0,0,$m[1],$m[0],$m[2]);
echo "$new\n";

$new = str_replace("/", "-", $input);
$new = strtotime($new);
echo "$new\n";

preg_match('~^(\d+)/(\d+)/(\d+)$~', $input, $m);
$new = strtotime("$m[3]-$m[2]-$m[1]");
echo "$new\n";

$m = sscanf($input, '%d/%d/%d');
$new = strtotime("$m[2]-$m[1]-$m[0]");
echo "$new\n";

If you have another example of deprecated code, edit this answer and add it ;)

A: Why not use str_replace?
$timestamp = strtotime(str_replace("/", "-", $dateString));

Or better yet, convert the string into YYYY-MM-DD before you insert.

A: Your question is not very clear.
If you receive from a form the date in format "dd/mm/yyyy" and you need to convert it in "yyyy-mm-dd" you can simply use substr:
$date_eng=substr($data_ita,6,4)."-".substr($data_ita,3,2)."-".substr($data_ita,0,2);

and
$data_ita=substr($date_eng,8,2)."/".substr($date_eng,5,2)."/".substr($date_eng,0,4);

A: Quite lengthy.
$get_array = explode('/', 'dd/mm/yyyy');

$day = $get_array[0];
$month = $get_array[1];
$year = $get_array[2];
$time_Stamp = mktime(0,0,0,$month,$day,$year);


text:
Q: validating if username already exists in database by using prepared statements... how to? I am trying to validate username to assure that same username does not already exist in my database. I am trying to do so using prepared statements.
What I am trying to do right now is to see if post exist by checking what STMT has returned. I'm not really sure if I'm going into right direction with this.
What am I doing wrong?
EDIT: Although I tried what someone suggested and I am still adding duplicate username into database.
    if (empty($username))
    {
        $usernameError = "Required!";
    }
    else if (preg_match('/^[A-Z \'.-]{2,20}$/i', $username))
    {
        if ($stmt1 = $dbc->prepare("SELECT username FROM users WHERE username = ?"))
        {
            $stmt1->bind_param('s', $username);

            $stmt1->execute();

            if($stmt1->num_rows>0)
            {
                $usernameError = "Username already exists!";
            }
            else
            {
                $usernameError = "";
            }

            $stmt1->close();
        }
    }
    else
    {
        $usernameError = "Incorrect Username!";
    }

A: Instead of using if($stmt != FALSE) use if($stmt->num_rows>0)
 if($stmt->num_rows>0){

   $usernameError = "Username already exists!";
}else{

    $usernameError = "";
}

A: Using fetch() method works.
(posting because can't delete question with an answer)
if($stmt->fetch())
{
    $usernameError = "Username already exists!";
}
else
{
    $usernameError = "";
}


text:
Q: How to work with multilingual sites using the full site editor and block themes? I'm developing a block theme and I need the user to edit the site content with the full site editor in two different languages.
In this situation, what would be the approach to allow the same page to have two versions, each one in a different language?

A: you either duplicate your website,
or pay multi-money  € ¥ ₪ ¥ $.
The old alternative is to implement multiple languages yourself,
e.g. either a complete duplicate of the website (terrible maintenance)
or a lot of tweaking and customizations (duplicate pages, post types, custom templates per page, where needed, and so forth).
Wordpress developers made it clear by now (20 years) that they don't care about multiple languages, (and some langauges are not even really supported, which is about 1/5 of the world population writing from right to left).
you either pay with money or with (a lot of) time.


text:
Q: How to get the Parent Class name irrespective of the Hierarchy I have a classes in my project with the following structure
Class A
Class B
Class C
Under Class C.... I have the function mention below
public static String getCallingClassname() {
    StackTraceElement[] stacktrace = Thread.currentThread().getStackTrace();
    StackTraceElement e = stacktrace[4];
    String classname = e.getClassName();
    return classname;   }

Class A is my main file from where I execute the script. Now, from Class A, I calls the function of Class B which in turn calls the getCallingClassname() method of Class C. In order to get the classname of Class A, I have used the index no as 4.
Problem is, there are many times when Class A directly calls the getCallingClassname() method of Class C, so in that case index 4 gives a wrong value.
Is there any method, through which I can always get the Parent Classname i.e. Class A in my example above ?
Thanks


text:
Q: How to make a slideshow banner in html? I want to make my banner changed automatically just like a slideshow. The banner I took from a folder and it can read all banner in that folder and display it on a website automatically changes. I already make it to read all banner and display it on the website, but it kind of random image, not changed except if I reload the page. This the code:
<?php
     $imglist='';
     //$img_folder is the variable that holds the path to the banner images.
     // see that you dont forget about the "/" at the end
     $img_folder = "images/";
     mt_srand( (double)microtime()*1000 );
     //use the directory class
     $imgs = dir($img_folder);
     //read all files from the directory, checks if are images and ads them to a list (see below how to display flash banners)
     while ( $file = $imgs->read() )
     {
         if (eregi("gif", $file) || eregi("jpg", $file) || eregi("png", $file))
          $imglist .= "$file ";
     }
     closedir($imgs->handle);
     //put all images into an array
     $imglist = explode(" ", $imglist); $no = sizeof($imglist)-2;
    //generate a random number between 0 and the number of images
     $random = mt_rand(0, $no); $image = $imglist[$random];
    //display image
    echo '';
?>

And how to make that PHP into HTML? if I change the extention into html, the banner div show the code not the images. Thanks.

A: The psuedocode for what you're doing would go something like:
load images from a directory into an array
on page load select a random image from image array
display first image
every X seconds display another image from image array
to display properly, your php file needs to be loaded/served from a web server. To do this, deploy your php file to your web server and then test it out.
an example of a banner I created a few years agao, that is similar to what you are after, is here

A: First, make your PHP echo out a hidden <input> element, with value containing the JSON string of image paths.  Using your code, something like:
<?php

    $out = " /*  Beginning of your page code */  "

    $imgJSON = json_encode($imglist);
    $out .= '<input id="bans" type="hidden" value="' .$imgJSON. '" />';

    $out .= " /*  Rest of your page code */  "

    echo $out;
    die();

Then, you can use the example below to swap the images in the banner div.  I demonstrate a very simple animation, just to show how it is done.
jsFiddle Demo
HTML:

javascript/jQuery:
var i = $('#bans').val();

var j = JSON.parse(i);
var max = j.length - 1;
var cnt = 0;

var timerId = null;
function swapBannersTimer() {
    doSwap();
    timerId = setTimeout(swapBannersTimer, 3000);
}
function doSwap(){
    var str = 'http://placekitten.com/' + j[cnt];
    $('#banner')
        .html('')
        .promise()
        .done(function(){
            $('img').animate({
                marginLeft: '0px'
            },500);
        });
    cnt = (cnt < max) ? cnt+1 : 0;
}
swapBannersTimer();

**CSS:*
#banner{width:300px;height:52px;overflow:hidden;}
.far_right{margin-left:300px;}

NOTE: Because this example uses the jQuery library, you must include it on your page -- usually between the DIV tags, like this:

If you use a CDN to load jQuery, as in the above example, it is probably already be pre-loaded from other websites.

If you want some fast lessons on jQuery, find free video tuts here:
https://www.thenewboston.com/videos.php?cat=32
or at
https://phpacademy.org/videos/jquery-basics


text:
Q: Is it possible in QML to add elements from a function? I'd like to create some elements from a JavaScript function.
For example: I have a column with some rows, on a button click I'd like to add another row, with some data.

A: Use Qml list view to create this column. Then to add new element, use the append method on Qml list model associated with this list view.


text:
Q: Confusion with notions of reducibility of representations I'm taking a first course on linear groups. I've never read anything about group representations before.
Consider the following three conditions on an object of a pointed category.

*

*Simple - has only the identity and the terminal arrow as quotients.

*Indecomposable - is not a product.

*Semi-simple - is a product of simple objects.

If the category in question is abelian, the bijection between subobjects and quotients, along with the existence of biproducts, give simpler characterizations of these conditions.
I learned from the nlab that these conditions are studied in representation theory. However, the lecturer gave seemingly different definitions in class. I don't feel as comfortable with these.

Definition 1a. Let $V$ be an $\mathbb F$-vector space and $G\leq \mathrm{GL}(V)$ a linear group.

*

*A linear subspace $W\leq V$ is a $G$-invariant subspace if $gW=W$ for every $g\in G$. A minimal $G$-invariant subspace is one which does not contain a non-trivial $G$-invariant subspace.

*$G$ is called reducible if $V$ admits a non-trivial proper $G$-invariant subspace $W$. $G$ is called irreducible if it isn't reducible.

*$G$ is completely reducible if there exist minimal $G$-invariant subspaces $W_1,\dots,W_k$ such that $V=W_1\oplus\cdots\oplus W_k$.

Definition 1b. Let $\rho:G\to \mathrm{GL}(V)$ be a representation of $G$. A linear subspace $W\leq V$ is called a $G$-invariant subspace if it's an $\mathrm{Im}\rho$-invariant subspace. Analogously for reducibility, irreducibility, and complete reducibility.

Definition 1a feels "wrong" to me. It feels $V$ shouldn't be mentioned at all, and that we should look at the category of all vector spaces equipped with $G$-actions (respecting the linear structure). Then I'm somehow hoping that "minimal" can be replaced with "simple" in a corresponding category. Then, definition 1b will be much more reminiscent of simplicity and semisimplicity.
Moreover, definition 1b simply looks different to me from the definition at the nlab (as a simple object in the category of representations). Why are these definitions equivalent? In particular, why is "complete reducibility" equivalent to being a semisimple object in the category of representations?
The minimal $G$-invariant subspaces are minimal elements of the subposet $\mathrm{Fix}(G\curvearrowright \mathrm{Sub}(V))$ of $G$-fixed points of the action of $G$ on the lattice of subspaces of $V$. I don't understand how this coincides with simple objects in some category not mentioning $V$ explicitly..

A: As you alluded to, in an abelian category, "simple" is equivalent to "the only subobjects (up to isomorphism) are the identity and the initial arrow".  In the case of these definitions, the relevant category is (as you guessed) the category of vector spaces equipped with $G$-actions, which is an abelian category.  A monomorphism $f:W\to V$ in this category is just an injective linear map preserving the action of $G$.  The image of such a monomorphism $f$ is a $G$-invariant subspace of $V$ which is isomorphic to $W$ (and conversely if $W$ is $G$-invariant subspace then the inclusion $W\to V$ is a monomorphism), and so up to isomorphism a monomorphism $W\to V$ is the same thing as a $G$-invariant subspace of $V$.  So a simple object in this category is just a vector space $V$ with an action of $G$ such that the only $G$-invariant subspaces are $V$ and $0$.
That is, simple objects are the same as irreducible representations.  Moreover, a $G$-invariant subspace $W$ of $V$ is minimal iff the action of $G$ on $W$ is irreducible.  That is, minimal subspaces of $V$ are the same thing as subobjects of $V$ which happen to be simple objects as well.  So "completely reducible" just says that $V$ is an (internal) finite direct sum of simple subobjects, which is equivalent to being an (external/categorical) finite product of simple objects.
(You mentioned indecomposability as well, but that does not correspond to any of your lecturer's definitions.  Both "minimal" and "irreducible" correspond to "simple", not "indecomposable".)

A: You can, of course, avoid to mention anything concrete and say that $Rep(G)$ is a category $Fun(G, Vect_{\mathbb k})$ where $G$ is one-object category. More generally, $Fun(G, R$-mod$)$ is always equivalent to category of left modules over the group algebra $A[G]$-mod even for noncommutative basic ring. Simplicity, semisimplicity and irresucibility work in it tautologically. But it's often very convenient to have definitions wich work "on objects and elements" and not "on arrows" because if you try, for example, to prove 5-lemma abstractly without referring to elements of any kind you'll have hard time.
Functors between one object groupoids are obviously homomorphisms, and given $\phi: G \to G'$ you have pullback $\phi*$ and its left and right adjoints which play a role in studiyng group cohomology. If you want to go further, there's a functor $\mathcal R: Grp^{op} \to Cat$ sending a group to it's representation category from which you can construct the "category of all representations over $\mathbb k$" via Grothendieck constuction.


text:
Q: add JMenuBar to a JPanel? I've got a JMenuBar and a JPanel. I'd like to add the JMenuBar to the JPanel. How would I do so?

A: JMenuBars are set to the JFrame using the setJMenuBar method.
See the following tutorial on how to use them.
http://download.oracle.com/javase/tutorial/uiswing/components/menu.html

A: You can use a BorderLayout for your JPanel and put the JMenuBar into the NORTH area of the panel with
JPanel p = new JPanel();
p.setLayout(new BorderLayout());
p.add(menubar, BorderLayout.NORTH);

JMenuBar is a JComponent and can be added to a Container like any other JComponent.

A: I have another solution, although you have to add the JMenuBar in the "Other Components" in NetBeans (good enough).  Create a JPanel and then add another JPanel inside (call it child) that fills the entire outter JPanel.   Place your controls in the child panel.  Then add the JMenuBar but NetBeans will place it in the "Other Components".  Edit your source and in the ctor after it calls "initComponents" place a call to this function:
public static void setJPanelMenuBar(JPanel parent, JPanel child, JMenuBar menuBar) {
    parent.removeAll();
    parent.setLayout(new BorderLayout());
    JRootPane root = new JRootPane();
    parent.add(root, BorderLayout.CENTER);
    root.setJMenuBar(menuBar);
    root.getContentPane().add(child);
    parent.putClientProperty("root", root);  //if you need later
  }

For example, your ctor might look like this:
  public MyPanel() {
    initComponents();
    setJPanelMenuBar(this, child, myMenuBar);
  }

Works for me.  Got the idea by looking at JInternalFrame source code.  All it does is replace the child JPanel with a JRootPane() and then put the child into the root pane's content pane.

A: I tried too but JMenuItem with Jmenu and JmenuBar was not added to JPanel.
But you can get that feel if you declare JFrame's layout as null then use setBounds(x, y, width, height) on JMenuBar instance then add the menu bar to JFrame.

A: Try putting a jDesktopPane on your panel and then add a menubar to that.  I'm using a tabbed pane in my example below, but it should work the same for a panel.
    JDesktopPane desktopPane = new JDesktopPane();
    tabbedPane.addTab("New tab", null, desktopPane, null);

    JMenuBar menuBar_1 = new JMenuBar();
    menuBar_1.setBounds(0, 0, 441, 21);
    desktopPane.add(menuBar_1);