text:
Q: CSS Float issue with IFrames I added an Iframe to a page and it pushed my sidebar down.  I tried different ways to float it, but I'm still stuck.  Any help would be appreciated.  Here's the HTML and CSS for the page:
http://lkwalker.com/writing.html
HTML:
<!DOCTYPE HTML>

  <title>LK Walker</title>
  <meta name="description" content="website description" />
  <meta name="keywords" content="website keywords, website keywords" />
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <link rel="stylesheet" type="text/css" href="css/style.css" />

Lauren K. Walker

 | Teacher |  Writer |  Yogi |

About

Schedule

Retreats

Privates

Energy Medicine Yoga

Military

Writing

Social Media

Theatre

Contact

Articles

Your browser does not support iframes.

 New York Times -
    Upward Facing Soldier

Mother Nature News -
    Do you need to be Skinny to do Yoga?

 Mother Nature News -
    What is Energy Medicine Yoga?

Check out our newest clothing partner, MahaDevi, use code EMYoga to get a 15% discount.

Like us on FaceBook - Follow us on Twitter

Copyright © Energy Medicine Yoga| Whitefish, MT | Contact Us |

CSS:
@font-face {
  font-family: Jacques Francois, times, serif;
    src: url('../fonts/Jacques Francois.otf');
    src: local("Jacques Francois"), url('../fonts/Jacques Francois.otf');
}

@font-face {
  font-family: lilly, arial, sans-serif;
    src: url('../fonts/lilly.ttf');
    src: local("lilly"), url('../fonts/lilly.ttf');
}

html {
  height: 100%;
}

* {
  margin: 0;
  padding: 0;
}

/* tell the browser to render HTML 5 elements as block */
article, aside, figure, footer, header, hgroup, nav, section {
  display:block;
}

body {
  font: normal .80em 'lilly', sans-serif;
  background: #cab0cb;
  color: #444;
  height: 100%;
  width: 1000px;
}

p {
  padding: 0 0 20px 0;
  line-height: 1.7em;
}

img {
  border: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Jacques Francois', serif;
  letter-spacing: 0em;
  padding: 0 0 5px 0;
  text-align: center;
}

h1, h2, h3 {
  margin: 0 0 15px 0;
  padding: 15px 0 5px 0;
}

h2 {
  font-size: 160%;
  padding: 9px 0 5px 0;
  color: #04662e;
}

h3 {
  font-size: 140%;
  padding: 5px 0 0 0;
}

h4, h6 {
  color: #615044;
  padding: 0 0 5px 0;
  font-family: normal 160% 'Jacques Francois', serif;
  font: bold 145% times, serif;
}

h5, h6 {
  color: #615044;
  font: italic 95% times, serif;
  letter-spacing: normal;
  padding: 0 0 15px 0;
}

a, a:hover {
  outline: none;
  text-decoration: underline;
  color: #B30303;
}

a:hover {
  text-decoration: none;
}

blockquote {
  margin: 20px 0;
  padding: 10px 20px 0 20px;
  border: 1px solid #E5E5DB;
  background: #FFF;
}

ul {
  margin: 2px 0 22px 17px;
  clear: both;
}

ul li {
  list-style-type: circle;
  margin: 0 0 6px 0;
  padding: 0 0 4px 5px;
  line-height: 1.5em;
}

ol {
  margin: 8px 0 22px 20px;
}

ol li {
  margin: 0 0 11px 0;
}

.left {
  float: left;
  width: auto;
  margin-right: 10px;
}

.right {
  float: right;
  width: auto;
  margin-left: 10px;
}

.center {
  display: block;
  text-align: center;
  margin: 20px auto;
}

#main, nav, #container, #logo, #site_content, footer
  {
  margin-left: auto;
  margin-right: auto;
  }

#main {
  margin: 5px auto;
  width: 940px;
  background: transparent;
  padding-bottom: 30px;
}

header {
  background: transparent;
  height: 130px;
}

#logo {
  width: 940px;
  height: 140px;
  background: transparent;
  color: #888;
  padding: 0;
  float: left;
  border-bottom: 1px solid #AFABAB;}

#logo h1, #logo h2 {
  font-family: normal 320% 'Jacques Francois', times, serif;
  border-bottom: 0;
  text-transform: none;
  margin: 0;
}

#logo_text h1, #logo_text h1 a, #logo_text h1 a:hover {
  padding: 0;
  color: #331d59;
  text-decoration: none;
  font-size: 48px;
}

#logo_text h1 a .logo_colour {
  color: #2c89b3;
}

#logo_text a:hover .logo_colour {
  color: #2c89b3;
}

#logo_text h2 {
  font-size: 140%;
  padding: 0 0 0 0;
  color: #04662e;
}

nav {
  height: 44px;
  float: right;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  width:90%;
  padding: 10px 10px;
  color: #222;
  border-top: 2px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
  width: 100%;
}

iframe
  {
  width: 60%;
  clear: both;

  }

#site_content {
  width: 940px;
  overflow: hidden;
  margin: 0 auto 0 auto;
  padding: 0 0 15px 0;
  border-bottom: 1px solid #AFABAB;
}

#top_border {
  border-top: 1px solid #fff;
  padding-top: 20px;}

#sidebar_container {
  float: right;
  vertical-align: top;
  display: inline;
  width: 30%;
  margin: 0 0 0 0;
}
.sidebar {
  float: right;
  vertical-align: top;
  width: 180px;
  margin: 0 0 17px 0;
  background: #EFF8FB;
  border-radius: 7px 7px 7px 7px;
  -moz-border-radius: 7px 7px 7px 7px;
  -webkit-border: 7px 7px 7px 7px;
  padding: 0 15px 5px 13px;
}

.sidebar h3, .content h1 {
  padding: 0 15px 20px 0;
  font: 230% 'Days', arial, sans-serif;
  font-style: bold;
  text-shadow:  #FFF 1px 1px;
  margin: 0 1px;
  color: #444;
}

.sidebar h3 {
  color: #444;
  font: 250% 'Lilly', arial, sans-serif;
  padding: 0 15px 5px 0;
}

.sidebar ul {
  margin: 0 0 15px 0;
}

.sidebar li a, .sidebar li a:hover {
  color: #555;
  text-decoration: none;
}

.sidebar li a:hover {
  text-decoration: underline;
}

.sidebar_item, .content_item {
  padding: 15px 0;
}

.paperclip {
  position: relative;
  z-index: 0;
  vertical-align: middle;
  margin: -15px 0 -60px -40px;
}

.content {
  text-align: left;
  width: 670px;
  margin: 25px 0 0 0;
  float: left;
  font-size: 120%;
}

.content ul {
  margin: 2px 0 22px 0px;
}

.content ul li, .sidebar ul li {
  list-style-type: none;
  background: url(../images/bullet.png) no-repeat;
  margin: 0 0 0 0;
  padding: 0 0 4px 28px;
  line-height: 1.5em;
}

footer {
  width: 940px;
  clear: both;
  font: 170% 'Lilly', arial, sans-serif;
  height: 30px;
  padding: 20px 0 20px 0;
  float: left;
  text-align: center;
  border-top: 10px solid #eeeeee;
}

footer p {
  line-height: 1.7em;
  padding: 0 0 10px 0;
  color: #000;
}

footer a {
  color: #000;
  text-decoration: 1px 1px #FFF;
}

footer a:hover {
  color: #000;
  text-shadow: none;
  text-decoration: underline;
}

.form_settings {
  margin: 15px 0 0 0;
}

.form_settings p {
  padding: 0 0 4px 0;
}

.form_settings span {
  float: left;
  width: 200px;
  text-align: left;
}

.form_settings input, .form_settings textarea {
  padding: 5px;
  width: 299px;
  font: 100% arial;
  border: 1px solid #D5D5D5;
  background: #FFF;
  color: #47433F;
  border-radius: 7px 7px 7px 7px;
  -moz-border-radius: 7px 7px 7px 7px;
  -webkit-border: 7px 7px 7px 7px;
}

.form_settings .submit {
  font: 140% 'Days', arial, sans-serif;
  border: 0;
  width: 99px;
  margin: 0 0 0 212px;
  height: 33px;
  padding: 2px 0 3px 0;
  cursor: pointer;
  background: #ddd; /* Show a solid color for older browsers */
  background: -moz-linear-gradient(#fff, #ddd);
  background: -o-linear-gradient(#fff, #ddd);
  background: -webkit-linear-gradient(#fff, #ddd);
  -webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 2px;
  -moz-box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 2px;
  box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 2px;
  border: 1px solid #ddd;
  border-radius: 7px 7px 7px 7px;
  -moz-border-radius: 7px 7px 7px 7px;
  -webkit-border: 7px 7px 7px 7px;
  color: #222;
  text-shadow: 1px 1px #FFF;
}

.form_settings textarea, .form_settings select {
  font: 100% arial;
  width: 299px;
}

.form_settings select {
  width: 310px;
}

.form_settings .checkbox {
  margin: 4px 0;
  padding: 0;
  width: 14px;
  border: 0;
  background: none;
}

.separator {
  width: 100%;
  height: 0;
  border-top: 1px solid #D9D5CF;
  border-bottom: 1px solid #FFF;
  margin: 0 0 20px 0;
}

table {
  margin: 10px 0 30px 0;
}

table tr th, table tr td {
  background: #BBB;
  color: #FFF;
  padding: 7px 4px;
  text-align: left;
}

table tr td {
  background: #DDD;
  color: #444;
  border-top: 1px solid #FFF;
}

/* Image Transitions */
ul#images {
  margin: 0 15px 10px 0;
  padding: 0;
  list-style: none;
  position: relative;
}

ul#images li {
  display: block;
  overflow: hidden;
  padding: 0;
  float: left;
  width: 155px;
  height: 300px;
}

/**
Stylesheet for SooperFish by www.SooperThemes.com
Author: Jurriaan Roelofs
**/

/* Configuration of menu width */
html body ul.sf-menu ul,html body ul.sf-menu ul li {
  width: 200px;
}

html body ul.sf-menu ul ul {
  margin: 0 0 0 200px;
}

/* Framework for proper showing/hiding/positioning */
ul.sf-menu,ul.sf-menu * {
  margin: 0;
  padding: 0;
}

ul.sf-menu {
  display: block;
  position: relative;
}

ul.sf-menu li {
  display: block;
  list-style: none;
  float: left;
  position: relative;
}

ul.sf-menu li:hover {
  visibility: inherit; /* fixes IE7 'sticky bug' */
}

ul.sf-menu a {
  display: block;
  position: relative;
}

ul.sf-menu ul {
  position: absolute;
  width:70%;
  top: auto;
}

ul.sf-menu ul a {
  zoom: 1; /* IE6/7 fix */
}

ul.sf-menu ul li {
  float: left; /* Must always be floated otherwise there will be a rogue 1px margin-bottom in IE6/7 */
  width: 150px;
}

ul.sf-menu ul ul {
  top: 0;
  margin: 0 0 0 150px;
}

ul.sf-menu li:hover ul,ul.sf-menu li:focus ul,ul.sf-menu li.sf-hover ul,
ul.sf-menu ul li:hover ul,ul.sf-menu ul li:focus ul,ul.sf-menu ul li.sf-hover ul,
ul.sf-menu ul ul li:hover ul,ul.sf-menu ul ul li:focus ul,ul.sf-menu ul ul li.sf-hover ul,
ul.sf-menu ul ul ul li:hover ul,ul.sf-menu ul ul ul li:focus ul,ul.sf-menu ul ul ul li.sf-hover ul {
  left: auto;
}

ul.sf-menu li:hover ul ul,ul.sf-menu li:focus ul ul,ul.sf-menu li.sf-hover ul ul,
ul.sf-menu ul li:hover ul ul,ul.sf-menu ul li:focus ul ul,ul.sf-menu ul li.sf-hover ul ul,
ul.sf-menu ul ul li:hover ul ul,ul.sf-menu ul ul li:focus ul ul,ul.sf-menu ul ul li.sf-hover ul ul,
ul.sf-menu ul ul ul li:hover ul ul,ul.sf-menu ul ul ul li:focus ul ul,ul.sf-menu ul ul ul li.sf-hover ul ul {
  left: -999999px;
}

/* autoArrows CSS */
span.sf-arrow {
  width: 7px;
  height: 7px;
  position: absolute;
  top: 20px;
  right: 5px;
  display: block;
  background: url(../images/arrows-black.png) no-repeat 0 0;
  overflow: hidden; /* making sure IE6 doesn't overflow and expand the box */
  font-size: 1px;
}

ul ul span.sf-arrow {
  right: 5px;
  top: 20px;
  background-position: 0 100%;
}

/* Theming the menu */
ul#nav {
  float: left;
}

ul#nav ul {
  background: #ddd;
  margin-top: 5px;
  padding-bottom: 15px;
}

ul#nav li a {
  padding: 7px 18px 6px 18px;
  font: 150% 'Lilly', arial, sans-serif;
  text-decoration: none;
  color: #000;
  margin-right: 2px;
}

ul#nav li a:hover, ul#nav li a:focus, ul#nav li.selected a, ul#nav li.selected a:hover, ul#nav li.selected a:focus {
  color: #000;
  text-shadow: 1px 1px #fff;
}

ul#nav ul li a {
  color: #000;
}

ul#nav ul li a:hover {
  color: #B30303;
  margin-right: 2px;
}

/* Image Transitions */
ul#images {
  margin: 0 15px 10px 0;
  padding: 0;
  position: relative;
}

ul#images li {
  display: block;
  overflow: hidden;
  padding: 0;
  float: left;
  width: 155px;
  height: 300px;
  list-style: none;
}

A: #sidebar_container {
     float: right;
     vertical-align: top;
     display: inline;
     width: 200px;
     margin: 0 0 0 0;
     position: relative;
     bottom: 536px;
     left: 269px;
}

Add these lines to your sidebar_container id and try!!
Also you had added an iframe and this side_bar class in a single main div, and haven't specified their positions.

A: The issue is because of
 closing.
Cut and paste the entire sidebar container after closing of

Now

bla bla bla

   bla bla bla

Change it to

bla bla bla

   bla bla bla

A: Your issue not with iframe it is causing because of UL
Its taking its space you left content in div like

<!-left content-->

      &amp;lt;p&amp;gt;Your browser does not support iframes.&amp;lt;/p&amp;gt;

 New York Times -
    Upward Facing Soldier

Mother Nature News -
    Do you need to be Skinny to do Yoga?

 Mother Nature News -
    What is Energy Medicine Yoga?

CSS:
.left_container
{
width: 69%;
float: left;
}

remain css is same as yours thanks.

A: This is a messy fix but should resolve the issue for the moment. If you make these changes in your css it should all line up. I used Firebug on firefox to test it and it worked just fine.
.content {
    float: left;
    font-size: 120%;
    margin: 25px 0 0;
    text-align: left;
    width: 940px;
}

.content ul {
    float: left;
    margin: 2px 0 22px;
}

sidebar {
    background: none repeat scroll 0 0 #EFF8FB;
    border-radius: 7px;
    display: inline;
    float: right;
    margin: -450px 0 17px;
    padding: 0 15px 5px 13px;
    vertical-align: top;
    width: 180px;
}

I would not suggest this is a permanent solution but it should help in the meantime


text:
Q: too many crons - too many machines ! I have the following problem:

*

*too many machines.

*some groups of machines share the same cron configuration, some not.

*sometimes, I need to add a crontab entry manually in hundreds of machines.

*I'm always making mistakes, which my B.O.S.S  doesn't seem to like...

Is there some tool hopefully (with a web interface, and gnu) to manage this sort of thing?
Thanks wise people !!
CM

A: Configuration management systems such as Puppet, Capistrano and CFEngine are tools which will do this and a whole lot more.
If you're having to manage many machines for cron, you'll probably have a bunch of other things you have to configure on those machines too, so sooner or later you'll need to investigate more than just managing the cronjobs...
They have very good tutorials and documentation on the Puppet site (see here), and they're not too painful to get set up.
If it's hundreds of machines, get up and running with them as soon as you can and you'll wonder how you managed to cope without them (even for something simple like just pushing the cronjobs to lots of machines)!

A: With a configuration management tool like puppet (or cfengine, bcfg2, etc.), you can manage a lot more than crontabs from a centralized location.

A: The answer is automation (cfengine/puppet/bcfg2/chef/others). But those won't really help you unless you can keep them under strict control. You can easily obtain that in two steps:

*

*get a source code management repository running - i recommend subversion to start with

*integrate the scm with an automation tool of your choice

So move all your crons in /etc/cron.d/ and use a naming scheme that accomodates your systems. Second , put all /etc/cron.d/ directories in subversion and have local checkouts on each machine. You will be able to manage everything manually and have a history of your changes, be able to track any machines that do not have the latest crontabs and so forth. Then you can get an automation software to do all this for you.
If you really need something quick and dirty you should have a single file , let's say /etc/cron.d/all-jobs , deployed on on all machines and decide in that file if a cron is supposed to run or not based on the hostname.
Something like:
*/5 * * * * root [[ $HOSTNAME == 'myhostname' ]] && /usr/bin/job.sh
This is not very efficient but it should make your life easier until you get some automation going on.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to create a new variable in sas? I want to create a new variable which is equal to the column sum of an existing variable.the code i am using is-
data west;
input total;
set yash123;

total=sum monthly_sales;
proc print data=west;
var total;
run;

but its not working.

A: A simple proc summary is all you appear to need :

proc summary data=yash123 nway ;
  var monthly_sales ;
  output out=west (drop=_:) sum(monthly_sales)=total ;
run ;

A: if you're looking for a running total you can use:total+monthly_sales;retain total;

otherwise you can use sum(monthly_sales) as total in proc sql to have the total repeat for each observation.


text:
Q: select ignored slow case? I'm using such a select on multiple cases:
for {
    select {
    case data:= <- highFreqChan:
        // do something:
    case <- time.After(time.Second * 5):
        // send some heartbeat like data...
    }
}

I find that, if highFreqChan got huge data, the heartbeat case will not enter, and when stop sending data to highFreqChan, the heartbeat case alive again, how to make it always enter the heartbeat case while the highFreqChan still working?

A: You're running time.After as part of the select condition, which means it's evaluated at the time the select is reached... which means that it will expire 5 seconds after the select is reached. So you will only enter that case if highFreqChan doesn't have any data for 5 seconds straight.
If you want to do something every 5 seconds, use a time.Ticker instead, like so:
heartbeat := time.NewTicker(5 * time.Second)
defer heartbeat.Stop()
for {
    select {
    case data:= <- highFreqChan:
        // do something:
    case <- heartbeat.C:
        // send some heartbeat like data...
    }
}


text:
Q: After adding a new Post and trying to edit the same post, field remains empty <template>

      <Form method="post" @submit="submitData" :validation-schema="schema" ref="myForm" v-slot="{ errors, isSubmitting, handleReset }">

            <Field name="id" type="hidden" class="form-control"  v-model="id" />
            <Field name="title" type="text" class="form-control" :placeholder="'Title'" v-model="post.title"  :class="{ 'is-invalid': errors.title }"/>
            <ErrorMessage name="title" />

            <Field name="author" type="text" class="form-control" :placeholder="'Author'"  v-model="post.author" :class="{ 'is-invalid': errors.author }"/>
            <ErrorMessage name="author" />

           {{ buttonText }}

          Reset

      </Form>

        Title
        Author
        Action

        {{ post.title }}
        {{ post.author }}

          Edit

No Records Found

</template>

My vue/cli version is 4.5.13, vee-validate version is 4.4.11 and vue-axios version is 3.3.6
Whenever I add new data ad trying to edit immediately same data but v-model is not getting an update, so my input field remains empty, and when clicking on another available post and again clicking on added post it works fine.

A: You are probably losing reactivity because of list: undefined  data. I assume that you are receiving an array from your axios.get()
Saying that, I would try:
 data() {
   return {
      post: {
        title: null,
        author: null,
      },
      list: [], // Define default value as an array
      isEditMode: false,
      id: null,
      buttonText: "Add",
    };
  },

....

methods: {
  ....

    getUsers() {
      axios.get("http://localhost:3000/posts").then((result) => {
        this.list = [ ...result.data]
      })
    },
}

And for your table

        Title
        Author
        Action

        {{ post.title }}
        {{ post.author }}

          Edit

No Records Found


text:
Q: Finding the smallest element of a vector I'm 10th grade student, only 2 weeks of coding. I have a homework to fix this code if not working from the book with the title "Finding the smallest element of a vector". I've been stuck here over 5 days, and tomorrow is my due date.
    #include <iostream>
#include <iomanip>
using namespace std;

int main()
{
    int i, T[10], int min;
    for (i = 10; i < 10; i = i + 1)
        cin >> T[i];
    min = T[0];

    for (i = 1; i < 10; i++)
        if (T[i] < min)
            min = T[i];

    cout << "Min= " << min;
    return 0;
}

What should I change in order to work? Thank you.

A: There were two lines wrong: int i, T[10], int min; and for (i = 10; i < 10; i = i + 1). Here is a working link.
#include <iostream>
using namespace std;

int main()
{
    int i, T[10], min;
    for (i = 0; i < 10; i = i + 1)
        cin >> T[i];
    min = T[0];
    for (i = 1; i < 10; i++)
        if (T[i] < min)
            min = T[i];
    cout << "Min = " << min;
    return 0;
}

A: In the first for you should go from i = 0, not i = 10.


text:
Q: Running code from a custom AppDomain I have the following plugin:
IPlugin.cs:
namespace StandalonePlugin
{
    public interface IPlugin
    {
        string Execute(string data);
    }
}

StandalonePlugin.cs:
namespace StandalonePlugin
{
    [Export(typeof(IPlugin))]
    public class StandalonePlugin : IPlugin
    {
        public string Execute(string data)
        {
            StringBuilder result = new StringBuilder();
            result.AppendFormat("Plugintype: {0}\r\n", this.GetType().FullName);
            result.AppendFormat("Data: {0}\r\n", data);
            result.AppendFormat("AppDomain: {0}\r\n", AppDomain.CurrentDomain.FriendlyName);
            result.AppendFormat("Current Dir: {0}\r\n", Environment.CurrentDirectory);
            result.AppendFormat("Assembly location: {0}\r\n", Assembly.GetExecutingAssembly().Location);

            return result.ToString();
        }
    }
}

And finally the code loading the plugin and calling it's Execute method:
namespace CustomAppDomain
{
    class Program
    {
        static void Main(string[] args)
        {
            AppDomainSetup setup = new AppDomainSetup();
            setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
            setup.PrivateBinPath = @".";

            AppDomain pluginDomain = AppDomain.CreateDomain("PluginDomain", null, setup);

            string pathToDll = @"D:\Code\LearningPlugins\StandalonePlugin\bin\Debug";
            Type t = typeof(IPlugin);
            IPlugin plugin = (IPlugin)pluginDomain.CreateInstanceFromAndUnwrap(pathToDll, t.FullName);

            Console.WriteLine(plugin.Execute("Test"));

            Console.WriteLine("<ENTER> to continue");
            Console.ReadLine();
        }
    }
}

Here's the output:
> Plugintype: StandalonePlugin.StandalonePlugin
> Data: Test
> AppDomain:LearningPlugins.vshost.exe
> Current Dir: D:\Code\LearningPlugins\LearningPlugins\bin\Debug
> Assembly location: D:\Code\LearningPlugins\LearningPlugins\bin\Debug\StandalonePlugin.dll
>
> <ENTER> to continue

Now for the question: Why does the AppDomain list LearningPlugins.exe instead of PluginDomain, as specified in AppDomain pluginDomain = AppDomain.CreateDomain("PluginDomain", null, setup); ?
To clarify, I don't care about vshost being added. I'm wondering why the AppDomain PluginDomain isn't displayed. It seems like the parent AppDomain is used even though I want to create an extra appdomain for the plugin

A: When you launch the application in debug mode, vshost is added to the friendly name.
Workaround is use the regex
string myName = Regex.Replace(AppDomain.CurrentDomain.FriendlyName,
    @"(?<basename>.*).vshost(?<extension>\..*)", "${basename}${extension}");

Purpose of vshost
Also you can check AppDomain.FriendlyName issue

A: It's because you're using AppDomain.CurrentDomain.FriendlyName.
As explained in msdn ( http://msdn.microsoft.com/en-us/library/system.appdomain.friendlyname )

The friendly name of the default application domain is the file name
  of the process executable

=> LearningPlugin.exe for you
So you should make something like that
in Main :
Console.WriteLine(plugin.Execute("Test", pluginDomain));

in Standalone Plugin :
public string Execute(string data, AppDomain childDomain)
        {
            StringBuilder result = new StringBuilder();
            result.AppendFormat("Plugintype: {0}\r\n", this.GetType().FullName);
            result.AppendFormat("Data: {0}\r\n", data);
            result.AppendFormat("AppDomain: {0}\r\n", childDomain.FriendlyName);//CHANGE HERE
            result.AppendFormat("Current Dir: {0}\r\n", Environment.CurrentDirectory);
            result.AppendFormat("Assembly location: {0}\r\n", Assembly.GetExecutingAssembly().Location);

            return result.ToString();
        }


text:
Q: Installing Big Integer libraries for C++? I try to install https://mattmccutchen.net/bigint/ and even when I include all the .hh files, using BigIntegers throws undefined reference errors.
[Linker error] undefined reference to `BigInteger::BigInteger(int)'
[Linker error] undefined reference to BigInteger::divideWithRemainder(BigInteger const&, BigInteger&)

I am using DevCPP and don't want to switch from this (it's been a headache getting anything other than DevCPP working). I also tried GMP but that was needlessly confusing and I couldn't get that working either.
When I tried compiling the .cc files that came with it, I get all the same linker errors.

A: I don't know how DevCPP works, but what you have to do is copy the .c files from Matt's library and put them in the same folder as your code (.cpp?) files.  Then you have to compile those files, in the same way that you compile all your code.  That should fix that problem.  The way to do this is compiler specific, but I found instructions for DevCPP here: http://www.uniqueness-template.com/devcpp/  Apperently you need to make a "project", and then add both your code and his code to it.  That's how you do programs with more than onen source file, which is absolutely essential knowledge for writing virtually any program.
You mentioned that your demo test code has the wrong answer, and that the code is
BigInteger num = 123456789*123456789*123456789;

This is because you have the integer 123456789, and multiply by the integer 123456789 (which overflows), and then multiply by the integer 123456789 (which overflows _again), and then convert that result to a BigInteger.  Obviously, that's not right.  Your code should probably look like this:
BigInteger first = 123456789; //yes, you can convert from int to BigInteger
BigInteger second = 123456789;
BigInteger third = 123456789;
BigInteger num = first *second *third;

Since you want to convert from int64_t to BigInteger, you have to jump through a small hoop, as BigInteger was not designed with int64_t in mind.  So here's a conversion function.
BigInteger int64_to_BigInt(int64_t v)
{ return BigInteger(int(v/INT_MAX))*INT_MAX+int(v%INT_MAX);}

int64_t BigInt_to_int64(BigInteger v)
{
    BigInteger bottom;
    v.divideWithRemainder(INT_MAX, bottom);
    return int64_t(v.toInt())*INT_MAX + bottom.toUnsignedInt();
}


text:
Q: Log4j2 Syslog Appender adds garbage field I'm using log4j2 to send the log messages to a remote syslog server.
The appender configuration is:
<Syslog name="CLSYSLOG" host="xxx.xxx.xxx.xxx" port="514" protocol="TCP"   facility="LOCAL4" format="RFC5424" appName="CEP" id="ES" includeMDC="false" enterpriseNumber="18060" newLine="true" messageId="Audit" mdcId="mdc" />

The message makes it to the remote server but a garbage string of "fe80: 0:0:0:801:24ff:fe62:8910%2" is added after the application name in all the messages.
Any idea how can I get rid of that string?

A: It turned out to be the IPV6 address of the source. Configuring syslog replaced it with the regular IP Address.


text:
Q: Need to produce one tex document in multiple volumes I have a very large document (1000+pages) that I need to produce as four separate volumes. I'm using Texmaker and TeXLive on a Win7 PC with the book class (too late to switch to memoir), and each chapter is a separate included file with the document structure in the main file. The first 3 volumes contain the main body of the document, and the 4th contains the appendices.
The volumes need to meet the following requirements:

*

*each volume has its own custom title page

*each volume continues numbering (page nums excluding front matter, section and fig/tab numbering, etc) from the previous

*the "management summary" needs to be in the frontmatter of each volume following the title page

*each volume needs its own 3-level toc and its lists, but also needs an abbreviated 1-level toc (preferably without pg numbers) for all of the other volumes

*the appendixes are their own volume

*bibliography for whole document needs to appear at the end of each volume
I'm new-ish to LaTeX, but this project has been a serious crash course. I'm looking at the volumes and shorttoc packages, but I'm not quite sure how to structure the main document for the repeating sections or custom title pages. To add some complexity, Volume 3 has two parts...
Any suggestion would be very much appreciated... deadline is coming up and I'm still scratching my head trying to figure this out. There doesn't seem to be much in any forums about doing multi-volume productions like this.
\documentclass[12pt,letterpaper,twoside,final,openright]{book}

\begin{document}

\begin{titlepage}
  % Title page for whole document
  \include{titleAll}
  % Title pages for volumes
  \include{titleV1}
  \include{titleV2}
  \include{titleV3}
  \include{titleV4}
\end{titlepage}

\frontmatter
  % Management summary chapter
  \include{management_summary}

  \tableofcontents
  \listoffigures
  \listoftables

\mainmatter
  % Volume I
  \part{VolumeI}
    \include{chap1}
    \include{chap2}
    \include{chap3}

  % Volume II
  \part{VolumeII}
    \include{chap4}
    \include{chap5}
    \include{chap6}

  % Volume III
  \part{VolumeIII.a}
    \include{chap7}
    \include{chap8}

  \part{VolumeIII.b}
    \include{chap9}
    \include{chap10}

\appendix
  % Volume IV
  \part{Appendices}
    \include{app1}
    \include{app2}
    \include{app3}

\backmatter
  \bibliographystyle{humannat}
  \bibliography{mybiblio.bib}

\end{document}

I'm currently using an \includeonly list to do it (not shown for brevity), but there seems that there should be a better way than what I have set up?

A: Here is my way:
Edit: Almost complete
We use \evolume and \evolume to reset page numbering
etoc package for table of contents
titletoc package for list of figures and tables
\documentclass[12pt,letterpaper,twoside,final,openright]{book}
\usepackage{titletoc}
\usepackage{etoc}

%---------------------------------------
\usepackage{lipsum,mwe}
\newcommand{\testt}{%
\lipsum[1]
\begin{table}
\begin{tabular}{|c|c|}
\hline
bla & foo \\
\hline
foo & bla \\
\hline
\end{tabular}
\caption{Just a table}
\end{table}}
\newcommand{\testf}{%
\lipsum[1]
\begin{figure}
\includegraphics{example-image-a}
\caption{Just a figure}
\end{figure}}
%----------------------------------------

\let\ppcleardoublepage\cleardoublepage
\renewcommand{\cleardoublepage}{%
\clearpage{\pagestyle{empty}\ppcleardoublepage}}
\newcounter{ppage}
\newcommand{\evolume}{\setcounter{ppage}{\value{page}}}
\newcommand{\setpage}{\stepcounter{ppage}%
\setcounter{page}{\value{ppage}}}

\newcommand{\vtableofcontents}[2][subsection]{%
\begingroup
\etocsettagdepth{VolumeI}{none}
\etocsettagdepth{VolumeII}{none}
\etocsettagdepth{VolumeIII}{none}
\etocsettagdepth{VolumeIV}{none}
\etocsettagdepth{#2}{#1}
\tableofcontents
\endgroup}

\newcommand{\vshorttoc}[3][chapter]{%
\begingroup
\etocsetstyle {part}
{}
{\medskip\noindent\relax}
{\bfseries\large\makebox[2cm]{\partname\ \etocnumber\ }%
\etocname\par\nobreak\medskip}
{}
\etocsetstyle {chapter}
{}
{}
{\bfseries\normalsize\makebox[3cm]{\chaptername\ \etocnumber\ }%
\etocname\par}
{}
\etocsettagdepth{VolumeI}{none}
\etocsettagdepth{VolumeII}{none}
\etocsettagdepth{VolumeIII}{none}
\etocsettagdepth{VolumeIV}{none}
\etocsettagdepth{#2}{#1}
\etocsettocstyle{\vspace{1cm}{%
\centering\LARGE\bfseries Contents of volume #3\par\nobreak\medskip}}{}
\tableofcontents
\endgroup}

\newcommand{\vlists}[1]{%
\startlist[#1]{lof}
\printlist[#1]{lof}{}{%
    \chapter*{\listfigurename}%
      \markboth{\MakeUppercase\listfigurename}%
              {\MakeUppercase\listfigurename}}
\startlist[#1]{lot}
\printlist[#1]{lot}{}{%
    \chapter*{\listtablename}%
      \markboth{%
          \MakeUppercase\listtablename}%
         {\MakeUppercase\listtablename}}}

\newcommand{\vstoplist}[1]{%
\stoplist[#1]{lof}
\stoplist[#1]{lot}}

\begin{document}
   % DOCUMENT
\begin{titlepage}
\huge\bfseries
\ \vfil
Document
\end{titlepage}

   % Volume I
\begin{titlepage}
\huge\bfseries
\ \vfil
Volume I
\end{titlepage}

\etocdepthtag.toc{VolumeI}

\frontmatter
  % Management summary chapter
  some test

  \vtableofcontents{VolumeI}
  %\newpage %  and may be a header
  \vshorttoc{VolumeII}{II}
  \vshorttoc{VolumeIII}{III}
  {\let\chaptername\appendixname\vshorttoc{VolumeIV}{IV}}

  \vlists{VolumeI}

\mainmatter
\setpage

  \part{VolumeI}
  \chapter{test}
  \section{One}
  \testf
  \subsection{Test On}
  \cite{big}
  \testt
  \chapter{test}
  \testt
  \chapter{test}
  \testf\testf

\backmatter

\bibliographystyle{plain}
\bibliography{mybiblio}{}
\evolume

  % Volume II

\begin{titlepage}
\huge\bfseries
\ \vfil
Volume II
\end{titlepage}

\etocdepthtag.toc{VolumeII}

\frontmatter
  % Management summary chapter
  some test

  \vtableofcontents{VolumeII}
  %\newpage
  \vshorttoc{VolumeII}{I}
  \vshorttoc{VolumeIII}{III}
  {\let\chaptername\appendixname\vshorttoc{VolumeIV}{IV}}

  \vstoplist{VolumeI}
  \vlists{VolumeII}

\mainmatter
\setpage

  \part{VolumeII}
  \chapter{test}
  \section{One}
  \testt
  \subsection{Test On}
  \testt
  \chapter{test}
  \cite{small}
  \testf
  \chapter{test}
  \testf\testt

\backmatter

\bibliographystyle{plain}
\bibliography{mybiblio}{}
\evolume

  % Volume III

\begin{titlepage}
\huge\bfseries
\ \vfil
Volume III
\end{titlepage}

\etocdepthtag.toc{VolumeIII}

\frontmatter
  % Management summary chapter
  some test

  \vtableofcontents{VolumeIII}
  %\newpage
  \vshorttoc{VolumeII}{I}
  \vshorttoc{VolumeIII}{II}
  \vshorttoc{VolumeIV}{IV}

  \vstoplist{VolumeII}
  \vlists{VolumeIII}

\mainmatter
\setpage

  \part{VolumIII.a}
  \chapter{test}
  \section{One}
  \testf
  \subsection{Test On}
  \testt
  \chapter{test}
  \testt
  \chapter{test}
  \cite{small}
  \testf

  \part{VolumeIII.b}
  \chapter{test}
  \chapter{test}
  \section{One}
  \testf
  \subsection{Test On}
  \testt
  \chapter{test}
  \cite{big}
  \testt\testt

\backmatter

\bibliographystyle{plain}
\bibliography{mybiblio}{}
\evolume

\appendix
  % Volume IV

\begin{titlepage}
\huge\bfseries
\ \vfil
Volume IV
\end{titlepage}

\etocdepthtag.toc{VolumeIV}

\frontmatter
  % Management summary chapter
  some test

  \vtableofcontents{VolumeIV}
  %\newpage
  \vshorttoc{VolumeII}{I}
  \vshorttoc{VolumeIII}{II}
  \vshorttoc{VolumeIV}{III}

  \vstoplist{VolumeIII}
  \vlists{VolumeIV}

\mainmatter
\setpage

  \part{Appendices}
  \chapter{test}
  \testt
  \chapter{test}
  \testt
  \chapter{test}
  \testf

\backmatter

\bibliographystyle{plain}
\bibliography{mybiblio}{}

\end{document}

One should be careful to the header in
    frontmatter of volume 2,3 and 4. the header of bibliography continue. So maybe one shoud reset it

A: Apologies for the long hiatus... deadlines and travel delayed my being able to close out this question & project...
I did try the MWE posted by @touhami, and it did work very well. Had I been starting from scratch building the volumes and chapters &c. and/or if this were likely to be a common sort of project that occurred regularly and needed to be semi-automated... @touhami's solution would be the way to do it, I think.
Unfortunately, the document was already largely built and under deadline pressure. What I ended up doing was pretty much the suggestion by @barbarabeeton, though I did "cheat" and use \shorttoc for the outside volume ToC's.
Thanks for all the suggestions and efforts.


text:
Q: VBA check if the values from one column are present in the other and if so, transfer associated data The code I have (below) does the job to an extent. My question is, how do I get the data in col B, C and D, to match the transfer to Tab1.
At the moment, the code looks at the values in the column A in Tab0, then checks whether any of them are present in col A in Tab 1 and if some are not there, it adds them on the bottom.

My current code:
Sub MovenMatch()

Dim varfirst1 As Range, varsecond2 As Range
Dim n&, m&
Dim first1 As Range, second2 As Range
Dim rowCount1&, rowCount2&
Dim mFlag As Boolean

rowCount1 = Sheets("Tab0").Cells(Sheets("Tab0").Rows.Count, "A").End(xlUp).Row
rowCount2 = Sheets("Tab1").Cells(Sheets("Tab1").Rows.Count, "A").End(xlUp).Row

Set varfirst1 = Sheets("Tab0").Range("A2:A" & rowCount1)
Set varsecond2 = Sheets("Tab1").Range("A2:A" & rowCount2)
m = rowCount2 + 1

For Each first1 In varfirst1
    mFlag = False
    For Each second2 In varsecond2
        If CStr(first1) = CStr(second2) Then
            mFlag = True
            Exit For
        End If
    Next second2

    If mFlag = False Then
        Sheets("Tab1").Range("A" & m).Value = first1

'My assumption is that the fix should come around here, replacing "xyz":
    Sheets("Tab1").Range("B" & m).Value = "xyz"

    m = m + 1
End If

Next first1
End Sub

A: Collections are ideal for matching unique identifiers.  My code stores cells references along with the unique IDs to simplify the tasks.
Sub MovenMatch2()
    Dim cell As Range, dict As Object
    Set dict = CreateObject("Scripting.Dictionary")

    With ThisWorkbook.Worksheets("Tab1")
        For Each cell In .Range("A2", .Range("A" & .Rows.count).End(xlUp))
            Set dict(cell.Value) = cell
        Next
    End With

    With ThisWorkbook.Worksheets("Tab0")
        For Each cell In .Range("A2", .Range("A" & .Rows.count).End(xlUp))
            If dict.Exists(cell.Value) Then
                dict(cell.Value).Resize(1, 4).Value = cell.Resize(1, 4).Value
            Else
                With ThisWorkbook.Worksheets("Tab1")
                    .Range("A" & .Rows.count).End(xlUp).Offset(1).Resize(1, 4).Value = cell.Resize(1, 4).Value
                End With
            End If
        Next
    End With

End Sub


text:
Q: CMake can not see SDL2_PATH environment variable (Windows) I would like to build a project, which uses SDL2. I downloaded the windows development package of SDL2, put it to D:\lib\SDL2-2.0.10, and set the SDL2_PATH environment variable to this path.
The project uses FindSDL2.cmake to find the library, where ${SDL2_PATH} is listed in SDL2_SEARCH_PATHS.
If I try to run CMake, it is not able to find SDL2. The environment variable is correctly set, I checked it with echo $env:SDL2_PATH in powershell.
But it I put this line at the beginning of CMakeLists.txt, then it works:
set(SDL2_PATH "D:\\lib\\SDL2-2.0.10")

Why is CMake not able to see the SDL2_PATH environment variable? What do I wrong?

A: The FindSDL2.cmake file looks for the CMake variable ${SDL2_PATH}, which you must define in the CMake file yourself. Without defining it, this variable will be empty. See the code here from this file:
SET(SDL2_SEARCH_PATHS
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local
    /usr
    /sw # Fink
    /opt/local # DarwinPorts
    /opt/csw # Blastwave
    /opt
    ${SDL2_PATH}
)

We can tell CMake to read an environment variable, with the ENV syntax, in order to import an environment variable's contents into CMake.
Therefore, try putting this at the beginning of your CMake instead:
set(SDL2_PATH $ENV{SDL2_PATH})

The FindSDL2.cmake file does read the SDL2DIR environment variable. So, rather than setting SDL2_PATH in your CMake file, you can simply set the SDL2DIR environment variable instead.


text:
Q: How to do a major version upgrade for Aurora Postgres in CloudFormation with custom Parameter Groups? Issue
I am trying to do a major version upgrade from Aurora Postgres 10.14 to 11.9 using Cloudformation. My template creates a DBCluster, a DBInstance, a DBClusterParameterGroup and a DBParameterGroup.
The problem is that when I try to update the stack and change the EngineVersion property for DBCluster from 10.14 to 11.9 and change the Family property for DBClusterParameterGroup and DBParameterGroup from aurora-postgresql10 to aurora-postgresql11, I get this error in CloudFormation:
Error

The following parameters are not defined for the specified group: enable_partitionwise_aggregate, enable_parallel_append, enable_partition_pruning, vacuum_cleanup_index_scale_factor, pg_bigm.last_update, apg_enable_semijoin_push_down, parallel_leader_participation, pg_bigm.enable_recheck, pg_bigm.gin_key_limit, max_parallel_maintenance_workers, pg_bigm.similarity_limit, enable_parallel_hash, enable_partitionwise_join (Service: AmazonRDS; Status Code: 400; Error Code: InvalidParameterValue)

I think this is because, according to the AWS Documentation for RDS Parameter Groups:

The DB cluster parameter group family can't be changed when updating a DB cluster parameter group

So even though I am trying to update the Family property for DBClusterParameterGroup and DBParameterGroup, CloudFormation simply ignores that, and so it is trying to apply the aurora-postgresql10 Parameter group Family aurora-postgresql10 to a database now trying to run Aurora Postgres 11.9
What I've tried

*

*Updating the Description property for
DBClusterParameterGroupandDBParameterGroupto include a reference to thepEngineVersion` parameter, as the AWS Documentation
says that will trigger a Replacement, but it does not actually do
this, and so I get the same error

*Manually adding the parameters listed in the error to DBParameterGroup before running update. Got error "Unmodifiable DB Parameter: pg_bigm.last_update"

The only workaround I have found is clunky:

*

*Manually update the database version in the console from 10.14 to 11.9, and change the DB cluster parameter group and Parameter group both to default.aurora-postgresql11 as well

*Comment out the code for DBClusterParameterGroup and  DBParameterGroup and update the stack with the updated EngineVersion 11.9 for DBCluster

*Uncomment out the code for DBClusterParameterGroup and DBParameterGroup and update the stack again with the correct Family property aurora-postgresql11 on DBClusterParameterGroup and DBParameterGroup. Now the database is updated, it is using the custom parameter groups, and the stack is not drifting

Code
Parameters:

  pEngineVersion:
    Type: String
    #currently '10.14'
    #trying to change to '11.9'
  pFamily:
    Type: String
    #currently 'aurora-postgresql10'
    #trying to change to 'aurora-postgresql11'

Resources:

  DBClusterParamGroup:
    Type: AWS::RDS::DBClusterParameterGroup
    Properties:
      Description: !Sub 'AuroraDBClusterParamGroup-${AWS::Region}'
      Family: !Ref pFamily
      Parameters:
        application_name: "App name"
        log_statement: all
        log_min_duration_statement: 0

  DBParamGroup:
    Type: AWS::RDS::DBParameterGroup
    Properties:
      Description: !Sub 'AuroraDBParamGroup-${AWS::Region}'
      Family: !Ref pFamily
      Parameters:
        max_connections: 1000

  AuroraDBCluster:
    Type: AWS::RDS::DBCluster
    Properties:
      EngineVersion: !Ref pEngineVersion
      Engine: aurora-postgresql
      DBClusterParameterGroupName: !Ref 'DBClusterParamGroup'
      #snipping unneccesary code#

  AuroraDBInstance:
    Type: AWS::RDS::DBInstance
    Properties:
      Engine: aurora-postgresql
      DBParameterGroupName: !Ref 'DBParamGroup'
      DBClusterIdentifier: !Ref 'AuroraDBCluster'
      #snipping unneccesary code#

Any help would be very appreciated

A: Solution
This method worked for me (I've modified some things slightly to post in a public forum) EDIT: I have updated this to use the Blue/Green solution now that I have had the chance to test it.
Parameters:
[...]
  DBEngineVersion:
    Type: String
    Description: "Choices are engine versions from Postgres 9/10/11, only newest and legacy deployed in Prod versions"
    Default: 11.7
    AllowedValues:
      - 9.6.18
      - 10.7
      - 10.14
      - 11.7
  MajorVersionUpgrade:
    Type: String
    Description: Swap this between 'Blue' or 'Green' if we are doing a Major version upgrade
    Default: Blue
    AllowedValues:
      - Blue
      - Green

Conditions:
  BlueDeployment: !Equals [!Ref MajorVersionUpgrade, "Blue"]
  GreenDeployment: !Equals [!Ref MajorVersionUpgrade, "Green"]

Mappings:
  EngineToPGFamily:
    "9.6.18":
      PGFamily: aurora-postgresql9.6
    "10.7":
      PGFamily: aurora-postgresql10
    "10.14":
      PGFamily: aurora-postgresql10
    "11.7":
      PGFamily: aurora-postgresql11

  ##### Keep parameters of both versions in sync ####
  DBClusterParameterGroupBlue: #Keep parameters of both versions in sync
    Type: "AWS::RDS::DBClusterParameterGroup"
    Condition: BlueDeployment
    Properties:
      Description: !Sub "Postgres Cluster Parameter Group for ${InfrastructureStackName}"
      Family: !FindInMap ['EngineToPGFamily', !Ref 'DBEngineVersion', 'PGFamily']
      Parameters:
        client_encoding: UTF8
        idle_in_transaction_session_timeout: 60000
  DBClusterParameterGroupGreen:
    Type: "AWS::RDS::DBClusterParameterGroup"
    Condition: GreenDeployment
    Properties:
      Description: !Sub "Postgres Cluster Parameter Group for ${InfrastructureStackName}"
      Family: !FindInMap ['EngineToPGFamily', !Ref 'DBEngineVersion', 'PGFamily']
      Parameters:
        client_encoding: UTF8
        idle_in_transaction_session_timeout: 60000

  DBCluster:
    Type: "AWS::RDS::DBCluster"
    Properties:
      DBClusterIdentifier: !Sub "${AWS::StackName}-cluster"
      DBClusterParameterGroupName: !If [GreenDeployment, !Ref DBClusterParameterGroupGreen, !Ref DBClusterParameterGroupBlue]
      Engine: aurora-postgresql
[...]
  DBInstance1:
    Type: "AWS::RDS::DBInstance"
    Properties:
      DBClusterIdentifier: !Ref DBCluster
      EngineVersion: !Ref DBEngineVersion
      Engine: aurora-postgresql
[...]

  DBInstance2:
    Type: "AWS::RDS::DBInstance"
    Properties:
      DBClusterIdentifier: !Ref DBCluster
      EngineVersion: !Ref DBEngineVersion
      Engine: aurora-postgresql
[...]

Usage and Methodology
This method will create a new ClusterParameterGroup that will be used during the upgrade (when doing a Major version upgrade), and clean up the original group when the upgrade is done.  The advantage to this solution is that there is no version hardcoding in the group and the same template can be used for continuous lifecycle updates without additional changes needed (aside from desired Parameters updates).
Initial Setup
Initially, leave MajorVersionUpgrade set to Blue and the conditions will ensure that only the Blue ParameterGroup is created using the proper DB family.
Performing a Major Version Upgrade
Update the stack and set the DBEngineVersion to the new major version and MajorVersionUpgrade to Green if it is currently Blue (or Blue if it is currently Green).  CloudFormation will:

*

*Start by creating the new resources (which is the new parameter group referencing the new version)

*Then it will update the Cluster and point to that new group

*Finally, it will delete the old ParameterGroup (referncing the old version) during the cleanup phase since the Blue/Green Condition for that group no longer evaluates to true.

Important notes

*

*The Parameters in both parameter groups must manually kept in sync

*Obviously, update the DBEngineVersion AllowedValues list with versions as needed, just be sure to update the EngineToPGFamily Mappings to have a valid Postgres family value for that Engine version

*Special care must be paid when implementing Parameters that are new to a DB Major version and don't exist in an older version, I have not tested this

A: You are correct that you cannot change the family on a DB Parameter Group that already has been created. That is why you get the error about the missing parameters, which isn't a great error response by AWS given the root cause.
Since DB Parameter Groups can be replaced without having to replace the DB Instance, you should change the Logical ID of the DB Parameter Group so it is detected as a new resource by CloudFormation, and removes the old v10 DB Parameter Group.
Example using your code:
Parameters:

  pEngineVersion:
    Type: String
    Default: '11.9'
    #currently '10.14'
    #trying to change to '11.9'
  pFamily:
    Type: String
    Default: 'aurora-postgresql11'
    #currently 'aurora-postgresql10'
    #trying to change to 'aurora-postgresql11'

Resources:

  DBClusterParamGroup11:
    Type: AWS::RDS::DBClusterParameterGroup
    Properties:
      Description: !Sub 'AuroraDBClusterParamGroup-${AWS::Region}'
      Family: !Ref pFamily
      Parameters:
        application_name: "App name"
        log_statement: all
        log_min_duration_statement: 0

  DBParamGroup11:
    Type: AWS::RDS::DBParameterGroup
    Properties:
      Description: !Sub 'AuroraDBParamGroup-${AWS::Region}'
      Family: !Ref pFamily
      Parameters:
        max_connections: 1000

  AuroraDBCluster:
    Type: AWS::RDS::DBCluster
    Properties:
      EngineVersion: !Ref pEngineVersion
      Engine: aurora-postgresql
      DBClusterParameterGroupName: !Ref 'DBClusterParamGroup'
      #snipping unneccesary code#

  AuroraDBInstance:
    Type: AWS::RDS::DBInstance
    Properties:
      Engine: aurora-postgresql
      DBParameterGroupName: !Ref 'DBParamGroup'
      DBClusterIdentifier: !Ref 'AuroraDBCluster'
      #snipping unneccesary code#

Notice how I renamed DBParamGroup to DBParamGroup11 and DBClusterParamGroup to DBClusterParamGroup11.


text:
Q: Ruby (without rails) using activerecord, insert into does not work I need to insert a new record into an existing table in a databse. I tried both approaches below:
  class UserDetail < ActiveRecord::Base

 def self.add_new_user
   new_user = UserDetail.new
   new_user.first_name = 'Joe'
   new_user.last_name = 'Smith'
   new_user.user_id = 'TEST'
   new_user.save
 end

 def self.add_new_user_2

UserDetail.create(user_id: 'TEST', first_name: 'Joe',
                  last_name: 'Smith')
 end

However, both approaches give me the error below:
    ActiveRecord::StatementInvalid: OCIError: ORA-00926:
    missing VALUES keyword: INSERT INTO "USER_DETAIL" DEFAULT VALUES

What am I missing? Please share your solutions.
(Using Ruby 1.9.3, ActiveRecord 4.2.4)

A: ActiveRecord makes assumptions about primary keys.  It is expecting to find a primary key on your UserDetail table called "ID". Should look something like.
class UserDetail < ActiveRecord::Base
    self.table_name = :user_detail
    self.primary_key = :user_id

    def self.add_new_user
       new_user = UserDetail.new
       new_user.first_name = 'Joe'
       new_user.last_name = 'Smith'
       new_user.user_id = 1
       new_user.save
    end
end


text:
Q: Edit for iframe contents Is there anyway I can edit the html content of an iframe inside a webpage?
I have the following code:
<iframe src="sample.html"></iframe>

I want to edit the contents of sample.html without literally touching the html code. And I want this editor to be embedded on the website. Thank you so much!

A: You can access the document of the <iframe> like so:
iframedoc = document.getElementById("my_iframe").contentDocument;
iframedoc.getElementById("element_in_iframe").do_something();

Note that this only works if the iframe is on the same domain as your parent page.


text:
Q: Double.parseDouble error java retrieve SOA I GET SOA STRING USE Double.parseDouble fd.setFdrRate(Double.parseDouble(coreFD.getInterestRate()));  message SOA return 3.7  but screen show 3.7000000000000005 save Database return 3.7 help me to check

A: double cannot represent the number 3.7 with full precision. You may consider using BigDecimal instead:
new BigDecimal(coreFD.getInterestRate()).toString() // 3.7

P.S. Always use BigDecimal (or similar-purpose class) for storing finance-related numbers.


text:
Q: Multiple SRAM on one MCU I want (have) to use  external SRAM on my STM32 and want to have in total 16Mbit.
Because big SRAM is quiet expensive, I want to use 2 smaller ones.
The question is, how do I achieve this (google is no big help in this case :/ )
My idea was that I use the 19 Adress lines for the first SRAM Chip and then for the second SRAM chip I use the lower 18 + 20th Adress line, so this memory scheme applies:
SRAM1: 0x00000 - 0x7FFFF
SRAM2: 0x80000 - 0xFFFFF

plus Offset of course ;)
The last thing is the Chip select line, but I can achieve this with a simple NOT-Gate
CS1 = ¬A[19] (indexed zero)
CS2 =  A[19]

Does this work? I'm concerned about rise and falltimes and delay from the gates. Does anyone have ever thought about this or even have experience?

A: This would work fine. The gate propagation delay for the cs line will be in the datasheet for the part you use but they are normally small enough to not be an issue. Worst case you can add an extra wait state to the memory controller in the CPU.
Alternatively you could put the two memory chips in parallel rather than series.
Instead of using 2x 512K x 16 SRAM you could use 2x 1M x 8 SRAM. The price is the same, which makes sense since it's the same amount of memory.
You then connect all of the address lines to each chip. D0-7 go to the first chip, D8-15 go to the second.
You still have to route all the address lines to both chips but each data line only goes to a single location so in theory layout is a little bit easier.
The down side is that if you later decide you only need half the memory you can't simply remove one of the chips to halve the RAM fitted.


text:
Q: Why does the Fairy Godmother use The Little Mermaid as an example fairy tale? In Shrek 2, Dama Fortuna (the Fairy Godmother) gets out fairy tales with happy endings without ogres. But one of them is The Little Mermaid. Is she aware that it has a sad ending of the Prince marrying another Princess and NOT the Mermaid? What gives?

A: The Shrek franchise is a big parody of general fairy tales but especially Disney movies. For example, when Donkey flies due to pixie dust, everybody in the crowd says "he can fly!", as the song in Peter Pan.
In the "real" story of The Little Mermaid, Ariel vanishes into the sea, but in Disney's version, Ariel and Eric defeat Ursula and live happily ever after. They even end up getting married:

A: The Fairy Godmother is Prince Charming's mother. She firmly believes her prince should marry Princess Fiona.
As you say, in the original Hans Christian Andersen version of "The Little Mermaid", the mermaid fails to marry the prince. If she'd gained the love of the prince, she'd also have gained a soul and avoided becoming foam on the waves. Instead, she's released from her broken heart as she dies, such is her happy ending. The prince, however, marries a princess.
In the Disney version, Ariel is clearly a princess, being one of the daughters of Triton. In the end, she marries a prince.
If anything, I think this particular example of a happy ending is left deliberately ambiguous, maybe for humour. Those who are thinking Disney look no further than mermaid princess marrying prince for their happy ending. Those who think Anderson can see that the Fairy Godmother is ruthless enough to dispose of Shrek (the non-human fairytale character) so that her prince can marry the princess, as is proper in fairytales(!).


text:
Q: NotSerializableException when sending an Object I want to create an instance , put it on a container and send it.
TransferContainer container = null;
    ...
  Class aClass = container.getByteCode();
    o = aClass.newInstance();
    ....// Some code
    ...
    container.setInstance(o);
    ObjectOutputStream out = new ObjectOutputStream(_s.getOutputStream());
    out.writeObject(container);

I get  this error

java.io.NotSerializableException
  If I don't add the the instance o in the container I can send it without any problem.

A: The reason for this exception is that aClass or some instance field of aClass doesn't implement Serializable.


text:
Q: Plone: Using the default skin for administration I'm developing a skin for Plone 3.x. The skin have a lot of differences from the default theme, and i would like to keep the default skin in administration mode. I read some solutions like this http://maurits.vanrees.org/weblog/archive/2008/01/switch-your-skin-based-on-the-url . But I cannot use subdomains in my web, so I cannot use these solutions.
I'm thinking that the solution would be something like that:
In my main_template.pt:
<tal condition:"true: Autenticated as admin">
         ''Put here the specifics css
</tal>
But I don't know the correct sintax in Plone
Thank you.

A: This doesn't answer your question directly, but you might want to take a look at "Editskin switcher".

A: Finally, I used this solution. The condition to detect if you are authenticated is tal:condition="not: here/portal_membership/isAnonymousUser". So, you can use a stylesheet only for visitors and other stylesheet for authenticated users. Something like that:
< style type="text/css" tal:content="string:@import url($portal_url/visitors.css);" media="all" tal:condition="here/portal_membership/isAnonymousUser" />
< style type="text/css" tal:content="string:@import url($portal_url/admin.css);" media="all" tal:condition="not: here/portal_membership/isAnonymousUser" />
Maybe this is not the optimal solution, but it works for me

A: Your solution will work - but there are better ways.  You don't describe how your stylesheets are installed, but here are two ways to do it.
Either, if you have a policy product, put the following in your product's profiles/default/cssregistry.xml:
<object name="portal_css" meta_type="Stylesheets Registry">
  <stylesheet title="" cacheable="True" compression="safe" cookable="True" enabled="1"
             expression="here/portal_membership/isAnonymousUser"
             id="visitors.css"
             media="all" rel="stylesheet" rendering="import"/>
  <stylesheet title=""
             cacheable="True" compression="safe" cookable="True" enabled="1"
             expression="not:here/portal_membership/isAnonymousUser"
             id="admin.css"
             media="all" rel="stylesheet" rendering="import"/>
</object>

or; visit "portal_css" in the ZMI (Zope management interface).  There you can do the same thing by "Add"ing the two stylesheets shown above, where "condition" is the value from "expression" above.
These are the same thing - one just sets it through the web, the other through GenericSetup - and now Plone will automatically incorporate one or the other css file into every page without you having to change main_template.pt.  Which is something you should never, ever, do.


text:
Q: A bunch of logged exceptions in Microsoft.VisualBasic.dll I have a large project where we have 2-3 dll projects that are converted from VB6 to VB.NET. We have fixed all the issues that caused compilation errors, and most of obvious issues in running, so now we have basically a program up and running. The exe is created from scratch in VB.NET, using a lot of functionality from the converted dll's (including GUI forms).
OK, so far so good. What I wonder is when I run the program in debug mode, I get a bunch of warnings in the "Immediate Window" saying:
A first chance exception of type 'System.Exception' occurred in Microsoft.VisualBasic.dll

...and some of other type (but most of them in Microsoft.VisualBasic.dll).
I was wondering if this is common in projects converted from VB6, or if it is caused by bad design in our code...

A: It's not limited to converted projects.
Some info here :
http://blogs.msdn.com/davidklinems/archive/2005/07/12/438061.aspx
http://www.helixoft.com/blog/archives/24

A: I am not sure of what exactly is causing your exceptions, but if it is in your code and surrounded by catch blocks (that probably do nothing, other than swallow the exception), you can set Visual Studio to break on all errors, which should help you track the problems down.
In VS, go Debug > Exceptions... and you can check what type of exceptions it will break on.
Hope that is of help


text:
Q: how to show pdf file in ext.window? It doesn't work, what is wrong?
var win = new Ext.Window({
    title: 'PDF Content',
    width: 400,
    height: 600,
    maximizable: true,
    layout: 'fit',
    plain: true,

    items: { // Let's put an empty grid in just to illustrate fit layout
        xtype: 'component',
        autoEl: {
            tag: "iframe",
            src: "../../../resources/august2013.pdf"
        }
    }
    //items : [ {
    //    html: '<object width="100%" height="100%" data="../../../resources/august2013.pdf"></object>'
    //} ]
})
win.show();

This view I am getting after inserting code below from Deamon!

A: Try this :
var win = Ext.create('Ext.window.Window' {
    title: 'PDF Content',
    width: 400,
    height: 600,
    modal: true,
    closeAction: 'hide',
    items: [{
        xtype: 'component',
        html: '<iframe src="../../../resources/august2013.pdf" width="100%" height="100%"></iframe>',
    }]
});
win.show();


text:
Q: Jackson Change JsonIgnore Dynamically I have a class and there are variables inside it as well. Sometimes I want to ignore some fields and sometimes not when deserializing (maybe at serializing too). How can I do it at Jackson?

A: You might want to use JsonViews  ( took it originally from http://wiki.fasterxml.com/JacksonJsonViews - broken now - web archive link: https://web.archive.org/web/20170831135842/http://wiki.fasterxml.com/JacksonJsonViews )
Quoting it:
First, defining views means declaring classes; you can reuse existing ones, or just create bogus classes -- they are just view identifiers with relationship information (child inherits view membership from parents):
 // View definitions:
  class Views {
            static class Public { }
            static class ExtendedPublic extends PublicView { }
            static class Internal extends ExtendedPublicView { }
  }

  public class Bean {
            // Name is public
            @JsonView(Views.Public.class) String name;
            // Address semi-public
            @JsonView(Views.ExtendPublic.class) Address address;
            // SSN only for internal usage
            @JsonView(Views.Internal.class) SocialSecNumber ssn;
  }

With such view definitions, serialization would be done like so:
 // short-cut:
  objectMapper.writeValueUsingView(out, beanInstance, ViewsPublic.class);

  // or fully exploded:
  objectMapper.getSerializationConfig().setSerializationView(Views.Public.class);
  // (note: can also pre-construct config object with 'mapper.copySerializationConfig'; reuse)
  objectMapper.writeValue(out, beanInstance); // will use active view set via Config

  // or, starting with 1.5, more convenient (ObjectWriter is reusable too)
  objectMapper.viewWriter(ViewsPublic.class).writeValue(out, beanInstance);
and result would only contain 'name', not 'address' or 'ssn'.

A: For serialization, "filtering properties" blog entry should help. Deserialization side has less support, since it is more common to want to filter out stuff that is written.
One possible approach is to sub-class JacksonAnnotationIntrospector, override method(s) that introspect ignorability of methods (and/or fields) to use whatever logic you want.
It might also help if you gave an example of practical application, i.e what and why you are trying to prevent from being deserialized.

A: You should probably look at the modules feature of recent Jackson versions.
One possible mechanism would be to use a BeanDeserializerModifier.
I've been looking for a useful online tutorial or example, but nothing immediately appears. It might be possible to work something up if more is known of your context. Are you managing your ObjectMappers manually, or using them in a JAX-RS setting, injected in Spring, or what?

A: I searched the entire web (yes I did) to find the answer. then I wrote something on my own.
I'm working with Jackson ion deserialisation. I wrote a custom reader that ignores the fields dynamically.
You can do the same thing for json deserialisation.
Lets assume an entity like this.
User {
    id
    name
    address {
       city
    }
}

Create a tree structure to represent field selection.
public class IonField {

    private final String name;
    private final IonField parent;
    private final Set<IonField> fields = new HashSet<>();

    // add constructs and stuff
}

Custom Ion Reader extending from amazon ion-java https://github.com/amzn/ion-java
public class IonReaderBinaryUserXSelective extends IonReaderBinaryUserX {

    private IonField _current;
    private int hierarchy = 0;

    public IonReaderBinaryUserXSelective(byte[] data, int offset, int length,
                                         IonSystem system, IonField _current) {
        super(system, system.getCatalog(), UnifiedInputStreamX.makeStream(data, offset, length));
        this._current = _current;
    }

    @Override
    public IonType next() {
        IonType type = super.next();

        if (type == null) {
            return null;
        }

        String file_name = getFieldName();

        if (file_name == null || SystemSymbols.SYMBOLS.equals(file_name)) {
            return type;
        }

        if (type == IonType.STRUCT || type == IonType.LIST) {
            IonField field = _current.getField(getFieldName());
            if (field != null) {
                this._current = field;
                return type;
            } else {
                super.stepIn();
                super.stepOut();
            }
            return next();
        } else {
            if (this._current.contains(file_name)) {
                return type;
            } else {
                return next();
            }
        }
    }

    @Override
    public void stepIn() {
        hierarchy = (hierarchy << 1);
        if (getFieldName() != null && !SystemSymbols.SYMBOLS.equals(getFieldName())) {
            hierarchy = hierarchy + 1;
        }
        super.stepIn();
    }

    @Override
    public void stepOut() {
        if ((hierarchy & 1) == 1) {
            this._current = this._current.getParent();
        }
        hierarchy = hierarchy >> 1;
        super.stepOut();
    }

Construct dynamic view. This Tree dynamically created and passed to the reader to deserialise.
Let's say we only need city inside the address.
IonField root = new IonField("user", null);

IonField address = new IonField("address", root);
IonField city = new IonField("city", address);
address.addChild(city);

root.addChild(id);

//now usual stuff.

IonFactory ionFactory = new IonFactory();
IonObjectMapper mapper = new IonObjectMapper(ionFactory);

File file = new File("file.bin"); // ion bytes

byte[] ionData =  Files.readAllBytes(file.toPath());

IonSystem ionSystem = IonSystemBuilder.standard().build();
IonReader ionReader = new IonReaderBinaryUserXSelective(ionData, 0, ionData.length, ionSystem, root);

User user = mapper.readValue(ionReader, User.class);


text:
Q: PHP - Inicio de sesión máximo de 3 veces pero con el mismo usuario Mi pregunta es la siguiente, como puedo hacer para que un usuario ingrese un maximo de 3 veces con el mismo usuario?
Y si quiere logearse por 4 vez le salga un aviso de que excedió el máximo de veces de inicio de sesión, con PHP.
Claro con conexión a una base de datos MySQL y PHP.
Aquí abajo les dejo el código.
<?php
    require('conexion.php');
    session_start();
    if(!empty($_POST))
    {
        $usuario = mysqli_real_escape_string($mysqli,$_POST['usuario']);
        $password = mysqli_real_escape_string($mysqli,$_POST['password']);
        $error = '';

        $sha1_pass = sha1($password);

        $sql = "SELECT  id FROM usuarios WHERE usuario = '$usuario' AND password = '$sha1_pass'";
        $result=$mysqli->query($sql);
        $rows=$result->num_rows;
        if ($rows > 0) {
            $row = $result->fetch_assoc();
            $_SESSION['id_usuario'] = $row['id'];

            header("location: ../paginas/pagina-entrada.html");
        }else{
            $error= "el nombre de usuario o contraseña es incorrecto, Por favor vuelva a intentarlo";
        }
    }
?>

    Login

    <form action="<?php $_SERVER['PHP_SELF']; ?>" method="POST">

Usuario<input id="usuario" name="usuario" type="text">

Password<input id="password" name="password" type="password">

<input name="login" type="submit" value="login">

    </form>

<?php echo isset($error) ? utf8_decode($error): '' ; ?>

A: Tabla Accesos
Campos
|----------------------------------------------------------------------|
|  id         |  primary key                                           |
|-------------|--------------------------------------------------------|
|  accesos    | int, almacena el numero de veces que ingreso           |
|-------------|--------------------------------------------------------|
| idusuario   |  int, almacena el id del usuario que ingresa           |
|-------------|--------------------------------------------------------|

<?php
    require('conexion.php');
    session_start();
    if(!empty($_POST))
    {
        $usuario = mysqli_real_escape_string($mysqli,$_POST['usuario']);
        $password = mysqli_real_escape_string($mysqli,$_POST['password']);
        $error = '';

        $sha1_pass = sha1($password);

        $sql = "SELECT  id FROM usuarios WHERE usuario = '$usuario' AND password = '$sha1_pass'";
        $result=$mysqli->query($sql);
        $rows=$result->num_rows;
        if ($rows > 0) {
        $row = $result->fetch_assoc();
        $idusuario=$row['id'];

       $sql2 = "SELECT accesos FROM Accesos WHERE idusuario = '$idusuario'";
       $result2=$mysqli->query($sql2);
       $rows2=$result2->num_rows;
       if($rows2==0)
       {
          $sql3 = "insert into Accesos (accesos,idusuario) values(1,'$idusuario')";
          $result3=$mysqli->query($sql3);
       }else{
         $row2 = $result2->fetch_assoc();
         $num_accesos=$row2['accesos'];
           if($num_accesos<3){
            $_SESSION['id_usuario'] = $row['id'];
            header("location: ../paginas/pagina-entrada.html");
               $sql4 = "update Accesos set accesos";
                ////////////////// EN ESTA PARTE INCREMENTAS EN UNO EL ACCESO
               $result4=$mysqli->query($sql4);
           }else{
                $error="Demasiadas sesiones abiertas";
              }
       }
        }else{
            $error= "el nombre de usuario o contraseña es incorrecto, Por favor vuelva a intentarlo";
        }
    }
?>


text:
Q: Regex to get a string between two strings Anyone please help in getting the regex to get the string between two strings.
Full string:
image001.jpg (1.69 KB)SpinTel - 372464.pdf (270.90 KB)SpinTel - 372464.xlsm (113.08 KB)

Output expected: SpinTel - 372464.pdf &
SpinTel - 372464.xlsm
I tried the expression:
((?i)Spintel)(.*)(.pdf)

and got the one output successfully,
but when I changed the expression to
((?i)Spintel)(.*)(.xlsm)

I am getting the output as SpinTel - 372464.pdf (270.90 KB)SpinTel - 372464.xlsm. My expected output in this is SpinTel - 372464.xlsm.
Please help.
Thanks in advance.

A: To get a match only:
\bSpinTel\b.*?\.(?:pdf|xlsm)\b

*

*\bSpinTel\b Match SpinTel between word boundaries to prevent a partial match

*.*? Match as least as possible chars

*\.(?:pdf|xlsm)\b match a dot and either pfd or xlsm followed by a word boundary

See a regex demo
If it should be followed by parenthesis, you can use a capture group for the SpinTel part, and match the parenthesis after it.
(\bSpinTel\b.*?\.(?:pdf|xlsm)\s+)\([^()]+\)

See another regex demo

A: To get matches and be prepared for other file extensions.
((?i)Spintel - \d*.\w*)

Output
Demo


text:
Q: Laravel 7 Ajax Datatables get data update I have a problem that make me stuck for a couple days.
I use laravel 7 and jax, and yajra datatables and i want to make page edit which show data by id from database.
before this i use popup modal to create and edit data, but for this i want to make another page for create and edit, so i would direct to another page like this
"/pegawai/edit/{{ $p->pegawai_id }}". so when i click button edit there are direct to page edit.
for page create and function delete is ok, but i stuck at edit.
this my controller to get list
public function getList(Request $request){
    $data = Cms::all();
    $canEdit = Auth::user()->can($this->permissions["edit"]);
    $canDelete = Auth::user()->can($this->permissions["delete"]);
    return Datatables::of($data)
            ->addIndexColumn()
            ->addColumn('action', function($row)use($canEdit,$canDelete){
                $btn = '';
                $canEdit ? $btn .= "
                <button
                type = 'button'
                class = 'btn btn-warning btn-sm'
                onclick = 'editData(this)'
                idData = '".$row->id."'
                title = '".$row->title."'
                slug = '".$row->slug."'
                meta_title = '".$row->meta_title."'
                meta_desc = '".$row->meta_desc."'
                description = '".$row->description."'
                >Edit</button>":'';

                $canDelete ? $btn .= '<button
                type = "button"
                class = "btn btn-danger btn-sm"
                onclick = "deleteData(this)"
                idData = "'.$row->id.'"
                >Delete</button>
                ':"";
                return $btn;
            })
            ->rawColumns(['action'])
            ->make(true);
}

this function at blade
function editData(attribute){
    resetError();
    resetForm();

    var id = $(attribute).attr('idData');
    var title = $(attribute).attr('title');
    var slug = $(attribute).attr('slug');
    var meta_title = $(attribute).attr('meta_title');
    var meta_desc = $(attribute).attr('meta_desc');
    var content = $(attribute).attr('description');
    tinymce.get("description").setContent(content);
    var cms_file = $(attribute).attr('cms_file');

    $("#id").val(id);
    $("#title").val(title);
    $("#slug").val(slug);
    $("#meta_title").val(meta_title);
    $("#meta_desc").val(meta_desc);
    $('#description').val(description);
    $('#cms_file').val(cms_file);
}

A: Use the code below:
$canEdit ? $btn .= "id)."' class='btn btn-warning btn-sm'>Edit";

A: if you are using the jquery, you need to add event delegation from the body because the element is coming from ajax. maybe use
$('body').on('click','.yourBtnClassname',function(e){

});

see this Image


text:
Q: How to stop a image from hovering by clicking on a  tag I want to stop image from hovering when clicking on the  tag, at first it had the undefined $ or jQuery error in Firebug but after adding:

the problem solved but it doesn't work either. This is my code:

          Kaf

and CSS:
 #holder {width:750px; height:350px; position:relative; font-family:arial, sans-serif; border-top:1px solid #da8; border-bottom:1px solid #da8; z-index:100;}
    #holder table {border-collapse:collapse; margin:-1px;}
    #holder ul {float:left; padding:0; margin:0; list-style:none;}
    #holder ul.sub {margin-bottom:-4px;}
    #menuOuter li a.lv1-a {background:blue; zoom:1;}
    #menuOuter li a.lv1-a:hover {direction:ltr;}

    #holder ul.sub {float:left;}
    #holder ul.sub ul {position:absolute; left:-9999px; top:180px;}
    #holder ul.sub li.sub-li a img {display:block; position:absolute; left:-9999px; border:0; height:200px; width:750px;}

    #holder ul.sub li.sub-li {display:block; float:left; width:150px; height:240px;}
    #holder ul.sub li.sub-li a {margin-top:200px; width:110px; display:block; padding:0 20px; height:40px; line-height:40px; color:#fff; text-decoration:none; font-family:arial, sans-serif; font-size:14px;}
    #holder ul.sub li.sub-li a.a1 {background:#e9a358;}
    #holder ul.sub li.sub-li a.a2 {background:#e9a358;}
    #holder ul.sub li.sub-li a.a3 {background:#9ea64b;}
    #holder ul.sub li.sub-li a.a4 {background:#dfb344;}
    #holder ul.sub li.sub-li a.a5 {background:#b8826e;}

    #menuOuter li:hover ul.sub li.current a {margin-top:200px; height:40px;}
    #menuOuter li:hover ul.sub li.current ul {left:-9999px;}
    #menuOuter li:hover ul.sub li.current a img {left:-9999px;}

    #menuOuter a:hover ul.sub li.current a {margin-top:200px; height:40px;}
    #menuOuter a:hover ul.sub li.current ul {left:-9999px;}
    #menuOuter a:hover ul.sub li.current a img {left:-9999px;}

    #holder ul.sub li.sub-li:hover > a {margin-top:0; height:350px;}
    #holder ul.sub li.sub-li a:hover {margin-top:0; height:350px;}

    #holder ul.sub li.current a {margin-top:0; height:350px;}
    #holder ul.sub li.current a.a1 img {left:0; top:0; z-index:-1;}
    #holder ul.sub li.current a.a2 img {left:-150px; top:0; z-index:-1;}
    #holder ul.sub li.current a.a3 img {left:-300px; top:0; z-index:-1;}
    #holder ul.sub li.current a.a4 img {left:-450px; top:0; z-index:-1;}
    #holder ul.sub li.current a.a5 img {left:-600px; top:0; z-index:-1;}

    #menuOuter li:hover ul.sub li.current:hover a {margin-top:0; height:350px;}
    #menuOuter li:hover ul.sub li.current:hover ul {left:0;}
    #menuOuter li:hover ul.sub li.current:hover ul li {float:left; height:15px; padding:0; margin:0;}
    #menuOuter li:hover ul.sub li.current:hover ul li a {height:15px; line-height:15px; margin:0; padding:0 20px;}
    #menuOuter li:hover ul.sub li.current:hover ul li a:hover {height:15px; line-height:15px; margin:0; padding:0 20px; text-decoration:underline;}

    #menuOuter a:hover ul.sub li.current a:hover {margin-top:0; height:350px;}
    #menuOuter a:hover ul.sub li.current a:hover ul {left:0;}
    #menuOuter a:hover ul.sub li.current a:hover ul li {float:left; height:15px; padding:0; margin:0;}
    #menuOuter a:hover ul.sub li.current a:hover ul li a {height:15px; line-height:15px; margin:0; padding:0 20px;}
    #menuOuter a:hover ul.sub li.current a:hover ul li a:hover {height:15px; line-height:15px; margin:0; padding:0 20px; text-decoration:underline;}

    #holder ul.sub li {position:relative;}

    #holder ul.sub li.sub-li:hover ul {left:0; width:130px;}
    #holder ul.sub li.sub-li:hover ul li {float:left; height:15px; padding:0; margin:0;}
    #holder ul.sub li.sub-li:hover ul li a {height:15px; line-height:15px; margin:0; padding:0 20px; font-size:11px;}
    #holder ul.sub li.sub-li:hover ul li a:hover {height:15px; line-height:15px; margin:0; padding:0 20px; text-decoration:underline;}
    #holder ul.sub li.sub-li:hover a.a1 img {left:0; top:0; z-index:-1;}
    #holder ul.sub li.sub-li:hover a.a2 img {left:-150px; top:0; z-index:-1;}
    #holder ul.sub li.sub-li:hover a.a3 img {left:-300px; top:0; z-index:-1;}
    #holder ul.sub li.sub-li:hover a.a4 img {left:-450px; top:0; z-index:-1;}
    #holder ul.sub li.sub-li:hover a.a5 img {left:-600px; top:0; z-index:-1;}

    #holder ul.sub li.sub-li a:hover ul {left:0; width:130px;}
    #holder ul.sub li.sub-li a:hover ul li {float:left; height:15px; padding:0; margin:0;}
    #holder ul.sub li.sub-li a:hover ul li a {height:15px; line-height:15px; margin:0; padding:0 20px; font-size:11px;}
    #holder ul.sub li.sub-li a:hover ul li a:hover {height:15px; line-height:15px; margin:0; padding:0 20px; text-decoration:underline;}
    #holder ul.sub li.sub-li a.a1:hover img {left:0; top:0; z-index:-1;}
    #holder ul.sub li.sub-li a.a2:hover img {left:-150px; top:0; z-index:-1;}
    #holder ul.sub li.sub-li a.a3:hover img {left:-300px; top:0; z-index:-1;}
    #holder ul.sub li.sub-li a.a4:hover img {left:-450px; top:0; z-index:-1;}
    #holder ul.sub li.sub-li a.a5:hover img {left:-600px; top:0; z-index:-1;}

    #holder ul.sub li.current ul {left:0; width:130px;}
    #holder ul.sub li.current ul li {float:left; height:15px; padding:0; margin:0;}
    #holder ul.sub li.current ul li a {height:15px; line-height:15px; margin:0; padding:0 20px; font-size:11px;}

    #holder ul.sub li span {display:block;position:absolute; top:240px; left:0; line-height:15px; width:130px; padding:10px; height:90px; z-index:-1; color:#000; text-decoration:none; font-size:11px;}
    #holder ul.sub li.p1 span {background:#ffe398;}
    #holder ul.sub li.p2 span {background:#ffe398;}
    #holder ul.sub li.p3 span {background:#dee68b;}
    #holder ul.sub li.p4 span {background:#fff384;}
    #holder ul.sub li.p5 span {background:#f8c2ae;}

A: You can add css attributes you want to work only with "hover-able" to class
HTML:

CSS:
.hoverable:hover {
    background-color: red;
}

jQuery:
$(document).ready(function () {
    $("#mm").click(function () {
        $('#m').removeClass('hoverable');
    });
});

EDIT: If you can't add class, you can get css attributes/values using .css( propertyName ) and storage to HTML5 data-* using .data( key, value ) and then in .hover event you set css from data to replace css :hover
I created simple jsFiddle example that can explain what i mean - http://jsfiddle.net/mDv2n/
It's not optimal solution but the best that has occurred within the limits.


text:
Q: shared memory father and child in c David Shwartz helped me alot and now it kinda works...
do you have any idea for more elgant way to parse the input, if the input consists more than 2 numbers to add which need to be processed by the child ? I want the child to get only two integers so that's why I created the shared memory so the father will send the child the result(shared memory) + another integer.
Thank you all.
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/shm.h>
 #include <string.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>

 volatile int *shared=0;
 int shmid;

 int  main()
 {

 char  line[256];
 int readByte;

 int fd[2]; //pipe to son, who processes addition
 int pid;

 shmid=shmget ( IPC_PRIVATE, sizeof(int) , 0600 );

 shared=shmat ( shmid, 0 , 0);

 if ( pipe(fd) )
 {
   perror("pipe");
   exit(-1);
 }

 pid=fork();

 if (pid!=0) // father
 {
     close (fd[0]);

     readByte=read(0, line, 256);
     line[readByte-1]='\0';
     printf("%d",readByte);

     int arr[2];
     int i=0;
     int j=0;
     int flag=0;
     char num[10];

     while (i<readByte)
     {
         if (line[i]=='+' )
         {
           i++;
           j=0;
           flag=1;
         }

          while (line[i]!='+' && line[i]!='\0')
          {
            num[j]=line[i];
            i++;
            j++;
           }
            num[j]='\0';

       if (flag==0)
           arr[0]=atoi(num);
       else
       {
           arr[1]=atoi(num);
           i++;
       }

     }
       printf("first %d\n",arr[0]);
       printf("sec %d\n",arr[1]);

        write(fd[1], &arr, sizeof(arr));
        wait(NULL);

       printf ( "%d\n" , *shared );

 }
 else
     // son
     {
       int arr[2];
       int sum;

       readByte = read(fd[0], &arr, sizeof(arr));

       printf("son printing: %d\n",arr[0]);
       printf("son printing: %d\n",arr[1]);

       sum =arr[0]+arr[1];
        *shared=sum;

       close (fd[0]);
       shmdt ( (const void *) shared );
     }

 shmdt ( (const void *) shared );
 shmctl ( shmid , IPC_RMID , 0 );

 close(fd[1]);

 return 0;

}

A: You throw away the return value of shmat. And you expect shared to be shared, but it's just a regular variable. Also, you need to prevent the compiler from optimizing away accesses to the shared memory. Here it is with all the fatal bugs fixed:
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <string.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>

volatile int *shared;
int shmid;

int main()
{
    int s,i;

    shmid=shmget ( IPC_PRIVATE, sizeof(int), 0600 );

    shared=shmat ( shmid, 0 , 0);
    *shared=100;

    printf ( "%d\n" , *shared);
    if ( fork()==0 ) // son
    {
        *shared=1000;
        shmdt ( (const void *) shared );
    }
    else // father
    {
            wait ( &s );
            printf ( "%d\n" , *shared);
            shmdt ( (const void *) shared );
            shmctl ( shmid , IPC_RMID , 0 );
    }
    return 0;
}


text:
Q: Validate application to access the database I need some help for my issue I will explain.
We have a delphi application named for instance App.exe. We use oracle database with our application.
I would like to allow just my App.exe (my valid application that was built by me) and not other App.exe that some other developer created.
At this moment we are signing our App.exe with a public CA.
So, is there any way to say to oracle to verify the App.exe and allow the connection since it is "official"? Maybe a trigger? Or validating the certificate signed?
Thanks!!
Diego

A: No matter what safeguards you put in place on the server side, it will always be possible for a client to fake a connection. This is an inherent limitation of the client-server model - the server can only gather information about the client by querying the client, and the client can always be configured to lie.
You cannot completely protect against this without the use of middleware. If you only allow the middleware to connect directly to the database e.g. by ip blocking, then you can have complete control of what commands can and can't be sent to the database.

A: Yes @JustinCave is right. Grant permission on user role based for application and restrict others from viewing. Even you can restrict it from particular ip also and only allowing user from particular ip to access this with proper credentials.
Moreover if database credentials are on server side there is nothing to worry unless your server is not secure. separating your presentation layer from business and data access layer.


text:
Q: What is the smallest filter in $\mathcal{B}$ containing $a \in B$?
$\mathcal{B}:=(B,\leq,\lor,\land,^c,0,1)$ is a Boolean algebra. Show that the smallest filter in $\mathcal{B}$ containing $a\in B$ is given by $$F(a) = \{x\in B:a\leq x\}$$

Here's my work:
First, I think it's important to verify that $F(a)$ is a filter. Clearly, $a \in F(a)$ so $F(a)\neq \phi$. $F(a)$ is also upwards closed, i.e. if $x \in F(a), x\leq y$ then $y \in F(a)$. This follows from the definition of $F(a)$ and transitivity of $\leq$, the partial order on $B$. Lastly, we must show that if $x,y\in F(a)$ then $x\land y \in F(a)$. $x\land y$ is the greatest lower bound of $x$ and $y$. Since $x,y\in F(a)$, we know that $a\leq x, a\leq y$. From here, we see that $a\land x =x$ and $a\land y=y$. So $a \land (x\land y) = (a\land x)\land y = a\land y = a$, implying $a \leq x\land y$, so $x\land y\in F(a)$. So F(a) is indeed a filter!
Why is $F(a)$ the smallest filter containing $a$?
P.S. For reference, $F \subseteq B$ is a filter if:

*

*$F \neq \phi$

*If $x,y \in F$ then $x\land y\in F$

*If $x\in F$ and $x\leq y$ then $y\in F$

A: Hint: any filter to which $a$ belongs is "upwards closed", so it has to include $F(a)$


text:
Q: Does the GitLab runner configuration file support comments? Does the GitLab Runner configuration file support comments? I also don't see comments mentioned in the Advanced Configuration doc.
I need comments to use Ansible's blockinfile.

A: GitLab uses TOML (Tom's Obvious, Minimal Language). The TOML format supports multiple forms for comments.
# This is a full-line comment
key = "value"  # This is a comment at the end of a line
another = "# This is not a comment"


text:
Q: How to run SQL *Loader on Mac? I installed the new Oracle client software package on my Mac by following instructions, but when i attempt to run the .bat file in the Terminal, I get the following error:
-bash: sqlloader: command not found
(I copy and pasted the contents of the .bat file into the terminal, was this incorrect?)

*

*How do I run .bat files properly?

*Is there a different, Mac-specific command for SQL *Loader?


text:
Q: diff comparison operation in moment.js This is Duplicate of this question. I don't know how to compare the diff. For example if the diff equal to greater than 14 days then the text box should be red. if 7 to 13 days it would be yellow and below 6 days it would be green.
code:

function compare() {
 var firstDate = moment($("#date1").val(), "MM-DD-YYYY");
  var secondDate = moment($("#date2").val(), "MM-DD-YYYY");

  console.log(firstDate.inspect(), secondDate.inspect());

  if (firstDate.isValid() && secondDate.isValid()) {
    // you need a validation before using diff function of momentjs
    var diff = Math.abs(firstDate.diff(secondDate, 'days'));
    console.log(diff);
    // you also need to remove all classes before adding new class
    $("#status").removeClass("redBg").removeClass("greenBg").removeClass("yellowBg");
    if (diff => 14) {
      $("#status").addClass('redBg');
    } else if (7 < diff =< 9) {
      $("#status").addClass('greenBg');
    } else if(diff >= 6) {
      $("#status").addClass('yellowBg');
    }
  } else {
    $("#status").addClass('yellowBg');
  }

    });
.greenBg {
    background: green;
}

.yellowBg {
    background: yellow;
}

.redBg {
    background: red;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.19.2/moment.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<html>
<body>
    <input type="text" id="date1" onchange=/>
<input type="text" id="date2" onchange='compare()'/>
<input  readonly type="text" id="status"/>
</body>
</html>

A: This is not a valid condition: else if(7 < diff =< 9), it shoud be else if(diff > 7 && diff <= 9)


text:
Q: R function returning data frame (extra column) I am a beginner to R programming( using it for data analysis)
I have following data. (trimmed version)
state   storeid sales
CA  1   40,000
CA  2   44,000
CA  3   38000
MN  1   26000
MN  2   25500

I need a function which return the top/low performing stores.
I wrote the following function.
storeinfo<-function(num="top") {

  df<-read.csv("store.csv")

  bestVal <- 1;
  if (!missing(num)) {
    if(is.numeric(num)){
      bestVal =  as.numeric(num);
    }
    if(num=="top"){
      bestVal <-1
    }
    if ( num=="poor"){
      bestVal<-0
    }
  }
  print(bestVal)
    data2<-subset(df[,c(1,2,3)])
    data2<-data2[order(as.numeric( data2$sales), data2$storeid,na.last=TRUE,decreasing=TRUE), ]
    idx<-tapply(1:NROW(data2),data2$state,"[",bestVal)
    idx1<-tapply(1:NROW(data2),data2$state,"[",1)

    return (data.frame(data2[idx1,1],data2[idx,2:3]))

}

when i am executing above function, i am seeing the following
> head(storeinfo(1))
[1] 1
  data2.idx1..1. storeid  sales
2             CA       2 44,000
4             MN       1  26000

a) How to suppress the first column 2,4 etc?(indexes)
b) How to find stores whose sales are low?
c) How to set different column names to returned data frame.

A: Do this
min_max_sales = c(which.min(df$sales), which.max(df$sales)) # return row numbers
df[min_max_sales,]

UPDATE.
If you need to sort the data frame and get a store with the nth best sales, here is a better approach using the plyr package
plyr::arrange(df, sales)[n,]


text:
Q: issue uploading image in laravel I was following a tutorial on how to do so;
I created a separate table for the user's profile model;
public function up()
    {
        Schema::create('profiles', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('user_id');
            $table->string('profile_image')->nullable();//profile image
            $table->string('address')->unique();
            $table->string('phoneno')->unique();
            $table->string('sex');
            $table->string('martial_status');
            $table->timestamps();
        });
    }

then i copied this file UploadTrait.php in the Traits folder but the code didn't highlight in my vs code editor
namespace App\Traits;

use Illuminate\Support\Str;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;

trait UploadTrait
{
    public function uploadOne(UploadedFile $uploadedFile, $folder = null, $disk = 'public', $filename = null)
    {
        $name = !is_null($filename) ? $filename : Str::random(25);

        $file = $uploadedFile->storeAs($folder, $name.'.'.$uploadedFile->getClientOriginalExtension(), $disk);

        return $file;
    }
}

Here is my Profilescontroller
 public function updateProfile(Request $request)
    {
        // Form validation
        $request->validate([
            'profile_image'    => 'required|image|mimes:jpeg,png,jpg,gif|max:2040',
            'address'          => 'required',
            'phoneno'          => 'required',
            'sex'              => 'required',
            'martial_status'   => 'required'
        ]);

        // Get current user
        $user = User::findOrFail(auth()->user()->id);
        // Set user name
        $user->accno = $request->input('accno');

        //check if a profile image has been uploaded
        if ($request->has('profile_image')) {
            // Get image file
            $image = $request->file('profile_image');
            // Make a image name based on user name and current timestamp
            $name = Str::slug($request->input('accno')).'_'.time();
            // Define folder path
            $folder = '/uploads/images/';
            // Make a file path where image will be stored [ folder path + file name + file extension]
            $filePath = $folder.$name. '.' . $image->getClientOriginalExtension();
            // Upload image
            $this->uploadOne($image, $folder, 'public' , $name);
            // Set user profile image path in database to filePath
            $user->profile()->profile_image = $filePath;
        }
        // Persist user record to database
        $user->save();

        // Return user back and show a flash message
        return redirect()->back()->with(['status' => 'Profile updated successfully.']);
    }

I get this error when I finally load the page

BadMethodCallException Method App\Http\Controllers\ProfilesController::uploadOne does not exist.

even though i refer to uploadOne() in UploadTrait.php, I need help to understand where i went wrong.

A: In your ProfileController Class make sure that you are using the UploadTrait
<?php

namespace App\Http\Controllers;

use App\Traits\UploadTrait; /// Add the Path to your UploadTrait.
use Illuminate\Http\Request;

class ProfileController extends Controller {

    use UploadTrait;  /// After the class is declared add this statement to use the trait

    ...

     public function updateProfile(Request $request)
    {
        ...
    }

}


text:
Q: Найти параметр запроса в ссылке К примеру, для адреса:
url = 'https://example.com/path?key=value%20?:)#fragment?not-query'

Получить key:
key = 'value ?:)'

A: Параметр запроса можно получить, используя urllib.parse.parse_qs():
#!/usr/bin/env python3
from urllib.parse import urlparse, parse_qs

url = 'https://example.com/path?key=value%20?:)#fragment?not-query'
[key] = parse_qs(urlparse(url).query)['key']
print(key)  # -> value ?:)

Связанный вопрос: Retrieving parameters from a URL.


text:
Q: Image preloader problems when file not in root I am working with some existing code and there is a preloader which loads some images for the navigation rollover state.  It looks like this:

An example of one of the nav items using the above is below:

Now all of the above is in the root folder.
When I go one folder deep, the nav breaks:
My code looks exactly the same as that posted above except that I prefix each reference to an image with '../', e.g. '../Images/Home-over.png' to send it back to the root folder first.
Unfortunately this does not work.
As nothing else is broken it seems to me that the images are not getting pre-loaded and this will most likely be because the image path is wrong.
However I'm not sure how it can be or how I go about figuring out the correct path?
All help is appreciated.
Thanks

A: The problem behind this was that the entire page code was getting duplicated due to a duplicate 'includes' statement in my php and this then prevented the styling of the nav bar.


text:
Q: Бесконечное обновление страницы Хотел, чтобы страница один раз обновлялась через 1 секунду и все,
а у меня через 1 секунду начинает происходить бесконечное обновление.
Как устранить бесконечное обновление страницы?

function sayHi() {
 document.location.reload();
  return false;
}
setTimeout(sayHi, 1000);
<div class="timer">
БЕСКОНЕЧНОЕ ОБНОВЛЕНИЕ СТРАНИЦЫ
</div>

A: Внутри функции надо сделать следующее:

*

*Сделать if

*Условие должно проверять есть ли значение по определённому ключу в localstorage.

*Если нет - записать любое значение с любым ключом. И перезагружать страницу

*Если есть что-то по заданному ключау - сразу выход из функции

localstorage - как куки, хранилище в браузере, в котором можно хранить данные, записывать туда и считывать
https://developer.mozilla.org/ru/docs/Web/API/Window/localStorage

A:

function sayHi() {
    document.location.reload();
    return false;
}
if(localStorage.getItem("permission_to_update") == ""){
    localStorage.setItem("permission_to_update", "no");
    setTimeout(sayHi, 1000);
}else{localStorage.setItem("permission_to_update", "")};


text:
Q: How do I get the menu items based on name or ID? I have this code that gets menu items, currently it works using slug-id (main-menu)
$menu_name = 'main-menu';

if (($locations = get_nav_menu_locations()) && isset($locations[$menu_name])) {
    $menu = wp_get_nav_menu_object($locations[$menu_name]);
    $menu_items = wp_get_nav_menu_items($menu->term_id);
}

foreach ($menu_items as $menu_item) {
    $id = $menu_item->ID;
    $title = $menu_item->title;
    $url = $menu_item->url;

}

Is there a possibility to get menu items using their digit ID (ex: 45) or name   (ex: menu name)


text:
Q: camel - how to have multiple contexts with java config I'm trying to group several camel routes in different camel contexts to avoid component name clashing. I know how to configure several RouteBuilder classes in the same Context extending From CamelConfiguration this way
   @Configuration
   public class CamelConfig extends CamelConfiguration {

   @Override
   public List<RouteBuilder> routes() {
       // here I create the RouteBuilder List and the return it
   }

But how I can have some routes in one camel context and other routes in other camel context using Java Configuration?

A: You can add many Camel Routes defined in external XML files in just one Camel Context
as the example bellow:
You can create your routes in a new xml file (ie. routes1-config.xml):
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="
   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
   http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
">

  <!-- this is an included XML file where we only the the routeContext -->
  <routeContext id="routes1" xmlns="http://camel.apache.org/schema/spring">
    <!-- we can have a route -->
    <route id="cool">
        <from uri="direct:start"/>
        <to uri="mock:result"/>
    </route>
    <!-- and another route, you can have as many your like -->
    <route id="bar">
        <from uri="direct:bar"/>
        <to uri="mock:bar"/>
    </route>
  </routeContext>

</beans>

and then import and reference it on the context inside the main camel xml file, like this:
<!-- import the routes from another XML file -->
<import resource="routes1-config.xml"/>

<camelContext xmlns="http://camel.apache.org/schema/spring">

  <!-- refer to a given route to be used -->
  <routeContextRef ref="routes1"/>

  <!-- we can of course still use routes inside camelContext -->
  <route id="inside">
    <from uri="direct:inside"/>
    <to uri="mock:inside"/>
  </route>
</camelContext>

For more details please check the official reference documentation from Apache Camel http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html

A: one CamelConfiguration class creates one CamelContext. The solution is to have multiple such sub classes (or similar).

A: You can use NMR (Normalized Message Router), http://camel.apache.org/nmr.html and expose the routes in each of those projects camel configuration as NMR routes and then consume it through your unified Java method using nmr:routename.