text:
Q: Using only one loop to generate nested arrays I am trying to come up with an algorithm to generate a nested array of consecutive numbers using only one loop. I feel it should be solved somehow using remainder operator but can't quite come up with a general solution. Anyone has any suggestion or hints?
input: 4
output: 1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4

A: You would use the modulo operator (%), but note that you should loop from zero and up, and the result from modulo is also from zero and up, so you have to add one to it.

var input = 4;

for (var i = 0; i < input * input; i++) {
  var n = (i % input) + 1;

  document.write(n + '<br>');

}

A: Something like that should do the trick:
int input = ...
int i = 0;

while(i<=(input*input)){
    int output = (i % input) + 1;
    i++;
}


text:
Q: SwiftMailer: How To Send Result Report Of Student To His Guardian I'm trying to send result reports of student, and fees reminders to their parents. But the problem is that I don't understand how to get Daily Report one by one from DailyReport entity and email of their parents from Parent entity.
I spent hours to get it working but didn't get any success.
Because SwiftMailerBunlde only renders those twig templates which are in SchoolBundle/Resources/views/Default/email.html.twig and my twig templates are in
schoolFinal/app/Resources/views/dailyreport/index.html.twig.
I tried by creating object of Student entity but it throws error that student does not exists in SchoolBundle/Resources/views/Default/email.html.twig.
        $message= \Swift_Message::newInstance()
        ->setSubject('Testing Mail')
        ->setFrom('test@gmail.com')
        ->setTo($student->getGuardian()->getEmail())
        ->setCharset('utf-8')
        ->setContentType('text/html')
        ->setBody($this->renderView('SchoolSMSBundle:student:dailyreport.html.twig'));

    $this->get("mailer")->send($message);

This is my dailyreport.html.twig file

Daily Report

        Id
        {{ dailyReport.id }}

        Total Marks
        {{ dailyReport.total }}

        Obtained
        {{ dailyReport.obtained }}

        Back to the list

        Edit

        {{ form_start(delete_form) }}
        <input type="submit" value="Delete">
        {{ form_end(delete_form) }}

A: After passing the data in the renderView as below, it worked.
 ->setBody($this->renderView('SchoolSMSBundle:Default:dailyReport.html.twig', array('dailyReport'=>$dailyReport)));

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to filter specific words in Kibana (Elastic) For ease of access I use Kibana (web interface) for Elastic Search.
I have these 4 types of sentences in each line in random order which is repeating:

N'Some Name' was looking for P'Some Name'.
N'Some Name' was looking for N'Some Name'.
P'Some Name' was looking for N'Some Name'.
P'Some Name' was looking for P'Some Name'.

I'm trying to filter just first and last letter. For example I'd like to see records of letter which begins with P' and ends with N'. Then I'll try this query:
"^P*" AND "was looking for" AND "N$*"

But it gives me no results. I think there's something wrong because between P' and Some Name is not space and I can't figure out how to filter just P' and after N'.
Even when I try to NO filter exact position (^ = begins, $ = ends) like this it gives me no result:
"P*" AND "was looking for" AND "N*"

So result of this should look like:

P'Some Name' was looking for N'Some Name'.
or
N'Some Name' was looking for P'Some Name'.

(because there's not excactly said that "P*" is first and "N*" is last - this means 2 results.)
Could you help me please how to make exact query which filters N' or P' on exact position?
Thank you.

A: For your sentence :- P'Some Name' was looking for N'Some Name'.
Kindly use the following mentioned search query

/P*/ AND "was looking for" AND /N*/


text:
Q: Is there any way to play the 'Classic' system sounds in iOS? I found a list of sounds here but I cannot seem to find the system sounds under the 'Classic' section in the sound settings page. Is there anyway to access those sounds?
I tried using /System/Library/Audio/UISounds/alarm.caf and /System/Library/Audio/UISounds/sq_alarm.caf but they sound different from the one I need. Also  tried to look for paths under /System/Library/Audio/UISounds/ but could not find any.

A: You can use AudioToolbox, I think you are looking for 1304 or 1005, that is what I get for "Classic > Alarm" on an iPhone.
import AudioToolbox

func playAlert(){
    AudioServicesPlayAlertSound(1304)
}

https://github.com/TUNER88/iOSSystemSoundsLibrary
https://developer.apple.com/documentation/audiotoolbox/1405202-audioservicesplayalertsound


text:
Q: Cannot query correctly (MSSQL - PHP - JSON) I have a little problem on my project.  And it turns out that the query result returns nothing when the value of first name or last name has 'ñ' in it.
Here's my code
config.php:
<?php
   ini_set('mssql.charset', 'UTF-8');
   header('content-type: text/html; charset=utf-8');
   $serverName = "192.168.1.21"; /* IP add of db Server */
   $connection = array("Database" => "db", "UID" => "?", "PWD" => "***");
   $conn = sqlsrv_connect($serverName, $connection);

if(!$conn){
echo "Connection could not be established.";
die(print_r(sqlsrv_errors(), true));
}
?>

MyQuery:
$idnumber = $_POST["idnum"];
$response = array();
$query2 = "SELECT cLName, cFName, cMName, cQualifier FROM student WHERE cIDNO = '$idnumber'";

try{
    $stmt2 = sqlsrv_query($conn, $query2);
}
catch(PDOExeption $ex){
    $response["Success"] = 0;
    $response["message"] = "Database Error!";
    die(json_encode($response));
}
$row2 = sqlsrv_fetch_array($stmt2, SQLSRV_FETCH_ASSOC);

    if($row2){
        $response["Success"] = 1;
        $response["message"] = "Data available";
        $last_name = $row2["cLName"];
        $first_name = $row2["cFName"];
        $qualify = $row2["cQualifier"];

        $first_name = html_entity_decode(htmlentities($first_name));
        $last_name = html_entity_decode(htmlentities($last_name));

        $name = $first_name." ".$last_name." ".$qualify;

        $response["Name"] = $name;

        echo json_encode($response);
    }

    else{
        $response["Success"] = 0;
        $response["message"] = "Database Error!";
        die(json_encode($response));
    }

I looked on these pages:
1, 2, 3, etc.
But i don't have clue why is this happening to my program.
Example in the Databases: cLName = "Española", cFName = "Edgar", cQualifier = "Jr."
Output: "Name":"Edgar Jr."
While: cLName = "Agustin", cFName = "Florence", cQualifier = "Jr."
Output: "Name":"Florence Agustin Jr."
Ideas? Please?
Note: I am not authorized to alter or change anything on the database.

A: I think its encoding error mssql con doest not in UTF-8 mode,
What i did if following is ISO-8859-1 endoced, and utf8_encode is missing the output is what OP got, but with utf8_encode it is correct
<?php

$row = ['cLName' => "Española", 'cFName' => "Edgar", 'cQualifier' => "Jr."];

$last_name  = utf8_encode($row["cLName"]);
$first_name = $row["cFName"];
$qualify    = $row["cQualifier"];

$first_name = html_entity_decode(htmlentities($first_name));
$last_name = html_entity_decode(htmlentities($last_name));

$name = $first_name." ".$last_name." ".$qualify;

$response["Name"] = $name;
$enc = json_encode($response,JSON_UNESCAPED_UNICODE);

print_r($name);
print_r($response);
print_r($enc);


text:
Q: C# Fade-in and fade-out transparency when form is being moved I have the code to make the form partially transparent when is being moved, but I want to know if it's possible to add fade-in and fade-out effects when I start moving and stop moving the form.
EDIT
The code I am using to add transparency to the form is:
        bool canMove = false;

    private void Form1_Load(object sender, EventArgs e)
    {
        canMove = true;
    }

    private void Form1_Move(object sender, EventArgs e)
    {
        if (canMove)
        {
            this.Opacity = 0.7;
        }
    }

    private void Form1_ResizeEnd(object sender, EventArgs e)
    {
        this.Opacity = 1;
    }

A: You could take a Timer control, you could then start the timer when form starts moving and set the transparency of the form to some value, and on each tick of the Timer, make the transparency to decrease and on some value make it to increase. If you want to have the fadein fadeout effect when form stops moving, you can do the same when the form has moved.

A: You should use a Timer control, set the opacity in timer's tick event. until the form stops moving (define a variable like isMoving and set it to true/false based on form's status).
You can find an example of setting opacity in timer's tick event in my article about a fading label. Use Google translator to read it.
Hope this helps.


text:
Q: Cannot find libmysql.dll when building Qt statically A have compiled Qt with -static option and with -qt-sql-mysql. Everything goes well (compilation etc, it works on my computer). But when I put the program on the other computer I get the message "Cannot find libmysql.dll...". And nothing else happens.

A: Statically linked Qt doesn't mean that the sql plugins will use the static database libraries. You'd need to set the path to the mysql library such that a static library would be used. As it is, you're using a so-called export mysql library.
The immediate solution to get your program running is to include libmysql.dll in the installation path of your program.
The long-term solution is to reconfigure your Qt build with the correct, static mysql library, and rebuild the plug-in. You need to point configure to the right variant of the library. You can have a .lib file that is a static library, and another .lib file that is the import library. The former will be larger, and that's the one you want. The latter will make your executable dependent on mysql.dll.
The mysql C connector library is built as a dynamic library by default. You'd have to build it manually as a static library. It requires some tweaking of the cmakefile, IIRC. I haven't done it in a while. The general instructions are here but again, there's no ready-to-go static library option.


text:
Q: Find an example for $\text{Hom}_R(M, \bigoplus_{i \in I} M_i) \ncong \bigoplus_{i \in I}\text{Hom}_R(M, M_i)$. Let $\{M_i\}_{i \in I}$ be a family of $R$-modules and let $M$ be another $R$-module.

I am looking for an example which shows that in general
$\phi : \text{Hom}_R(M, \bigoplus_{i \in I} M_i) \rightarrow \bigoplus_{i \in I} \text{Hom}_R(M, M_i)$ is not an $R$-isomorphism.

I have proved that, if $M$ is finitely generated as an $R$-module, then
$\text{Hom}_R(M, \bigoplus_{i \in I} M_i) \cong \bigoplus_{i \in I} \text{Hom}_R(M, M_i)$.
Unfortunately, I still have not found any example showing that $\phi$ is not an $R$-isomorphism if $M$ is infinitely generated. Does anybody has an idea ?
Thanks for your help.

A: I think $\phi$ should go in the other direction, i.e. $$(\ddagger)\qquad\phi: \bigoplus_i \text{Hom}_R(M,M_i)\to \text{Hom}_R\left(M,\bigoplus_i M_i\right).$$
To see that it is not an isomorphism in general, consider $M = \bigoplus_i M_i$ and the identity on the R.H.S. of $(\ddagger)$.


text:
Q: Trouble plotting a function constructed using NIntegrate and FindRoot Here is my code:
f0[y_] := 1/(E^((1 + y)^2/2)*Sqrt[2*Pi])
f1[y_] := 1/(E^((-1 + y)^2/2)*Sqrt[2*Pi])
l[y_] := f1[y]/f0[y]
opts = {Method -> {Automatic, "SymbolicProcessing" -> None}, AccuracyGoal -> 8}
h0[ϵ0_?NumericQ, ϵ1_?NumericQ] :=
  -(ϵ1/(1 - ϵ0)) +
  NIntegrate[f0[y]*Boole[l[y] < (1 - ϵ0)/(1 - ϵ1)], {y, -∞, ∞},
    {Method -> {Automatic, "SymbolicProcessing" -> None},AccuracyGoal -> 8}] -
  ((1 - ϵ1) *
    NIntegrate[f1[y]*Boole[l[y] < (1 - ϵ0)/(1 - ϵ1)], {y, -∞,∞},
    {Method -> {Automatic, "SymbolicProcessing" -> None}, AccuracyGoal -> 8}])/(1 - ϵ0)
hh0[ϵ0_] :=
  FindRoot[h0[ϵ0, ϵ1] == 0, {ϵ1, 0.5},
    StepMonitor :>Print["Step to ϵ0 = ", ϵ0, Evaluate@opts]]
Plot[hh0[ϵ0], {ϵ0, 0, 1}]

I am able to get all the values that are necessery to plot, but the plot doesnt output any graphics. How can I fix this problem?Improved formatting

A: Here is an answer from my previous comment, as suggested by Öskå.
Since you are calling FindRoot, you don't get a value but a list. With /. you can retrieve the value:
Plot[ϵ1 /. hh0[ϵ0], {ϵ0, 0, 1}]


text:
Q: Editing a labels text value through JavaScript  I have a simple in VB/ASP.NET form containing two text boxes, I am attempting to apply some validation to the first text box using JavaScript. This is the first time I have attempted this and am having some trouble.
I have a label beside the text box stating an error, this labels visibility property is set to False. I wish the labels visibility to turn true if the text box is empty when the user loses focus.
For this I have used the onBlur option within the  tags of the text box. It then calls the JavaScript function and should set the label to Visible but it does not. I have tested to see if it is entering the function by using an alert instead and that works. The problem seems to be trying to alter the visibility property of the label.
Here is the portion of my code:
The JavaScript:
function myRegEx(frm) {

    if ( boxUsername.value == "" ) {

        invalidUser.visible = True;
        return false;

    }
}

The form:
<asp:TextBox onblur="return myRegEx(this)" id="boxUsername" runat="server" Width="200px"></asp:TextBox>

<asp:Label id="invalidUser" runat="server" visible="False" forecolor="Red" text="* Username must be alphanumeric with no special characters"></asp:Label>

Any help would be brilliant.

A: Here's another StackOverflow question that has the answer for you:
Change visibility of ASP.NET label with JavaScript

A: I suggest you use and ASP.Net Validation control, specifically the RequiredFieldValidator.
This will take care of the label for you, plus make certain the correct validation happens both client side (javascript) and server-side (vb).

A: You're using the deprecated IE-only feature that turns elements with IDs into global variables.
You should call document.getElemenntById instead.
Also, you need to use ASP.Net's generated client IDs.
Finally, to hide an element, you need to use CSS; HTML doesn't have a visible property.
For example:
document.getElementById("<%=invalidUser.ClientID %>").style.display = "none";

However, you should use ASP.Net's built-in validation feature instead.

A: Why not use an ASP.NET RequiredFieldValidator like so:
<asp:TextBox onblur="return myRegEx(this)" id="boxUsername" runat="server" Width="200px"></asp:TextBox>
<asp:RequiredFieldValidator ControlToValidate="boxUsername" Display="Dynamic" ErrorMessage="Please enter a value" />

If that is too simplistic then you can use a RegularExpressionValidator:
<asp:TextBox onblur="return myRegEx(this)" id="boxUsername" runat="server" Width="200px"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Please enter alpha numeric characters." ValidationExpression="[my reg ex]" ControlToValidate="boxUsername" Display="Dynamic" />


text:
Q: How to add custom text in custom option in magento 2.3.2 How to add custom text in particular custom option after in magento 2.3.2

A: How to Add a new Custom Option Text Field in Magento 2 follow this link
[1]: https://www.mageplaza.com/blog/how-to-add-a-new-custom-option-text-field-in-magento-2.html


text:
Q: Whenever I try to open Hexxit it always crashes This has always been a problem. Never have I ever had a time where I could get onto Hexxit; it always crashes! This is the report:
      Minecraft has crashed!
      ----------------------

Minecraft has stopped running because it encountered a problem; Failed to start game

A full error report has been saved to C:\Users\annabelle.cole\AppData\Roaming\.technic\modpacks\hexxit\crash-reports\crash-2014-11-22_11.34.49-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash :(

--- BEGIN ERROR REPORT fb414879 --------
Full report at:
C:\Users\annabelle.cole\AppData\Roaming\.technic\modpacks\hexxit\crash-reports\crash-2014-11-22_11.34.49-client.txt
Please show that file to Mojang, NOT just this screen!

Generated 22/11/14 11:34

-- System Details --
Details:
    Minecraft Version: 1.5.2
    Operating System: Windows 7 (x86) version 6.1
    Java Version: 1.7.0_45, Oracle Corporation
    Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
    Memory: 42110536 bytes (40 MB) / 135794688 bytes (129 MB) up to 1037959168 bytes (989 MB)
    JVM Flags: 3 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1024m -XX:MaxPermSize=128m
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    Suspicious classes: FML and Forge are installed
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML: MCP v7.51 FML v5.2.23.737 Minecraft Forge 7.8.1.737 68 mods loaded, 68 mods active
    mcp{7.51} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized
    FML{5.2.23.737} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized
    Forge{7.8.1.737} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized
    CodeChickenCore{0.8.7.3} [CodeChicken Core] (coremods) Unloaded->Constructed->Pre-initialized
    CoFHFramework{1.5.2.5} [CoFH Framework] (coremods) Unloaded->Constructed->Pre-initialized
    ImmibisMicroblocks{55.0.7} [Immibis's Microblocks] (coremods) Unloaded->Constructed->Pre-initialized
    NotEnoughItems{1.5.2.28} [Not Enough Items] (coremods) Unloaded->Constructed->Pre-initialized
    mod_bspkrsCore{v2.09(1.5.2)} [bspkrsCore] ([1.5.2]bspkrsCorev2.09.zip) Unloaded->Constructed->Pre-initialized
    TreeCapitator{Forge 1.5.2.r14} [TreeCapitator] ([1.5.2]TreeCapitator.Forge.1.5.2.r14.Uni.CoreMod.jar) Unloaded->Constructed->Pre-initialized
    CoFHCore{1.5.2.5} [CoFHCore] (CoFHCore-1.5.2.5.jar) Unloaded->Constructed->Pre-initialized
    CoFHWorld{1.5.2.5} [CoFHWorld] (CoFHCore-1.5.2.5.jar) Unloaded->Constructed->Pre-initialized
    CustomLAN{2.2} [Custom LAN Mod] (CustomPortForge.jar) Unloaded->Constructed->Pre-initialized
    ImmibisMicroblocksInstallCheck{55.0.7} [Immibis's Microblocks (Checks for incorrect installation, ignore this)] (immibis-microblocks-55.0.7.jar) Unloaded->Constructed->Pre-initialized
    DamageIndicatorsMod{2.7.0.1} [Damage Indicators] (1.5.2 DamageIndicators v2.7.0.1.zip) Unloaded->Constructed->Pre-initialized
    AsgardShield_Core{2.0.4} [AsgardShield] (1.5.2AsgardShield_Core_2.0.4Forge.zip) Unloaded->Constructed->Pre-initialized
    ASAddon_Hallowed{2.0.0} [AS Addon- Hallowed] (1.5.2ASAddonHallowed_v2.0.0Forge.zip) Unloaded->Constructed->Pre-initialized
    HarkenScythe_Core{2.1.6} [HarkenScythe] (1.5.2HarkenScythe_v2.1.6Forge.zip) Unloaded->Constructed->Pre-initialized
    ASAddon_HarkenScythe{2.0.0} [AS Addon- HarkenScythe] (1.5.2ASAddonHarkenScythe_v2.0.0Forge.zip) Unloaded->Constructed->Pre-initialized
    ASAddon_NetherEnder{2.0.0} [AS Addon- Nether-Ender] (1.5.2ASAddonNetherEnder_v2.0.0Forge.zip) Unloaded->Constructed->Pre-initialized
    ASAddon_ColorAPI{1.0.0} [ASAddon_ColorAPI] (1.5.2AsgardShield_Core_2.0.4Forge.zip) Unloaded->Constructed->Errored
    BetterStorage{0.6.2.23-hotfix2} [BetterStorage] ([1.5.2]BetterStorage_0.6.2.23-hotfix2.zip) Unloaded->Constructed->Pre-initialized
    mod_ArmorBarMod{0.7.1} [Armor Bar Mod] (ArmorBarv0.7.1.zip) Unloaded->Constructed->Pre-initialized
    Artifice{1.5.2R1.1.2} [Artifice] (Artifice-1.1.2-182.jar) Unloaded->Constructed->Pre-initialized
    ArtificeCompat|Chisel{1.5.2R1.1.2} [Artifice Compat: Chisel] (Artifice-1.1.2-182.jar) Unloaded->Constructed->Pre-initialized
    ArtificeCompat|EE3{1.5.2R1.1.2} [Artifice Compat: EE3] (Artifice-1.1.2-182.jar) Unloaded->Constructed->Pre-initialized
    ArtificeCompat|Forestry{1.5.2R1.1.2} [Artifice Compat: Forestry] (Artifice-1.1.2-182.jar) Unloaded->Constructed->Pre-initialized
    ArtificeCompat|MFR{1.5.2R1.1.2} [Artifice Compat: MFR] (Artifice-1.1.2-182.jar) Unloaded->Constructed->Pre-initialized
    ArtificeCompat|Railcraft{1.5.2R1.1.2} [Artifice Compat: Railcraft] (Artifice-1.1.2-182.jar) Unloaded->Constructed->Pre-initialized
    ArtificeCompat|Vanilla{1.5.2R1.1.2} [Artifice Compat: Vanilla] (Artifice-1.1.2-182.jar) Unloaded->Constructed->Pre-initialized
    Backpack{1.12.13} [Backpack] (backpack-1.12.13-1.5.2.zip) Unloaded->Constructed->Pre-initialized
    mod_BackTools{1.5.2v1} [mod_BackTools] (BackTools1.5.2v1.zip) Unloaded->Constructed->Pre-initialized
    BattleTowers{1.3.4} [Battle Towers] (BattleTowers_1.5.2.zip) Unloaded->Constructed->Pre-initialized
    BetterDungeons{1.8} [Better dungeons] (BetterDungeons.zip) Unloaded->Constructed->Pre-initialized
    BiblioCraft{1.3.3} [BiblioCraft] (BiblioCraft[v1.3.3].zip) Unloaded->Constructed->Pre-initialized
    mod_BuffBarMod{0.7.1} [Buff Bar Mod] (BuffBarv0.7.1.zip) Unloaded->Constructed->Errored
    ChestTransporter{1.1.6} [Chest Transporter] (chestTransporter_1.1.6_Universal.zip) Unloaded->Constructed->Errored
    DimDoors{1.5.2R1.4.1RC1} [Dimensional Doors] (DimensionalDoors-1.5.2R1.4.1RC1-194.zip) Unloaded->Constructed->Pre-initialized
    eplus{1.15.4} [Enchanting Plus] (EnchantingPlus-1.15.4.jar) Unloaded->Constructed->Pre-initialized
    ExtrabiomesXL{3.13.4} [ExtrabiomesXL] (ExtrabiomesXL-universal-1.5.2-3.13.4.jar) Unloaded->Constructed->Pre-initialized
    hexxitgear{1.5.2R1.0} [Hexxit Gear] (HexxitGear-1.0-23.jar) Unloaded->Constructed->Pre-initialized
    ImmibisCore{55.1.6} [Immibis Core] (immibis-core-55.1.6.jar) Unloaded->Constructed->Pre-initialized
    InfernalMobs{1.3.1} [Infernal Mobs] (InfernalMobs_1.5.2.zip) Unloaded->Constructed->Pre-initialized
    inventorytweaks{1.54b} [Inventory Tweaks] (InventoryTweaks-1.54b.jar) Unloaded->Constructed->Pre-initialized
    MapWriter{2.0} [MapWriter] (mapwriter-2.0.5.zip) Unloaded->Constructed->Pre-initialized
    Meteors{2.10.2} [Falling Meteors] (Meteors Mod V2.10.2.zip) Unloaded->Constructed->Pre-initialized
    More Bows{1.5_v1} [More Bows mod] (More bows 1.5.2_2 Forge.jar) Unloaded->Constructed->Errored
    Natura{2.1.5} [Natura] (Natura_1.5.2_2.1.5.1.jar) Unloaded->Constructed->Pre-initialized
    Natura|CompatMineFactoryReloaded{0.1} [Natura compat: MFR] (Natura_1.5.2_2.1.5.1.jar) Unloaded->Constructed->Pre-initialized
    NEIPlugins{1.0.9.3} [NEI Plugins] (NEIPlugins-1.0.9.3.jar) Unloaded->Constructed->Pre-initialized
    LegendGear{1.5.2} [LegendGear] (NMcCoy-LegendGear-1.5.2.zip) Unloaded->Constructed->Pre-initialized
    ObsidiPlates{1.5.0} [Obsidian Pressure Plates] (obsidiplates-1.5.2-universal-1.5.0.13.jar) Unloaded->Constructed->Pre-initialized
    OffLawn{1.0} [offLawn] (OffLawn-1.5.1.zip) Unloaded->Constructed->Pre-initialized
    ProjectZulu|Core{1.0.3.8} [Project Zulu Core] (ProjectZuluCompletev1.0.3.8.zip) Unloaded->Constructed->Pre-initialized
    ProjectZulu|Blocks{1.0.3.8} [Project Zulu Block and Items] (ProjectZuluCompletev1.0.3.8.zip) Unloaded->Constructed->Pre-initialized
    ProjectZulu|Dungeon{1.0.3.8} [Project Zulu Mobs] (ProjectZuluCompletev1.0.3.8.zip) Unloaded->Constructed->Pre-initialized
    ProjectZulu|Mobs{1.0.3.8} [Project Zulu Mobs] (ProjectZuluCompletev1.0.3.8.zip) Unloaded->Constructed->Pre-initialized
    ProjectZulu|World{1.0.3.8} [Project Zulu World] (ProjectZuluCompletev1.0.3.8.zip) Unloaded->Constructed->Pre-initialized
    QuantumCraft{1.01} [qCraft] (qCraft1.01.zip) Unloaded->Constructed->Pre-initialized
    xreliquary{1.5.2} [Xeno's Reliquary] (Reliquary1.0.6d.zip) Unloaded->Constructed->Pre-initialized
    rftl{1.0} [RottenFleshToLeather] (RottenFleshToLeather-1.5.1.zip) Unloaded->Constructed->Pre-initialized
    AS_Ruins{10.3} [Ruins Spawning System] (Ruins_1.5.2.zip) Unloaded->Constructed->Pre-initialized
    secretroomsmod{4.6.0} [SecretRoomsMod] (SecretRoomsMod-universal-4.6.0.283.zip) Unloaded->Constructed->Pre-initialized
    SoulShards{1.0.16} [Soul Shards] (SoulShards-1.0.36-universal-srg.jar) Unloaded->Constructed->Errored
    TConstruct{1.5.2_1.4.3d7} [Tinkers' Construct] (TConstruct_1.5.2_1.4.3.final.jar) Unloaded->Constructed->Pre-initialized
    TConstruct|CompatMineFactoryReloaded{0.1} [TConstruct Compat: MFR] (TConstruct_1.5.2_1.4.3.final.jar) Unloaded->Constructed->Pre-initialized
    TwilightForest{1.18.1} [The Twilight Forest] (twilightforest-1.18.1.zip) Unloaded->Constructed->Pre-initialized
    WildCaves3{0.4.2} [Wild Caves 3] (WildCaves3-0.4.2.zip) Unloaded->Constructed->Pre-initialized
    chococraft{2.8.8} [Torojima's ChocoCraft] (zzzChococraft_2.8.8.zip) Unloaded->Constructed->Pre-initialized
    LWJGL: 2.9.0
    OpenGL: Intel(R) HD Graphics 4000 GL version 4.0.0 - Build 9.17.10.2932, Intel
    Is Modded: Definitely; Client brand changed to 'fml,forge'
    Type: Client (map_client.txt)
    Texture Pack: Default
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

java.lang.RuntimeException: Unknown character '

A: Looks like someone overmodded to say the least. There might be way to fix this by adding ram. Those mods require at least 3-4 gb ram. So if you dont have that you might be screwed.
You can do this in the profile editor under Java settings (advanced). In JVM Arguments you will see that you can input how much ram you want Minecraft to be running on. In this box you fill in:
"-Xmx2048M -Xms2048M" for 2GB ram
"-Xmx4096M -Xms4096M" for 4GB ram
To add more, add 1024 to the numbers for an extra gigabyte.
eg, 4096 (4GB) + 1024 = 5120 (5GB)
You can also try to disable some mods and check where the errors lie.
It can be because you are using forge with a fairly old java version.Try to update to the latest runtime 7 java (forge still has trouble with runtime 8).

A: Try Re-installing it. Same thing happened to me, I re-installed it, IT WORKED!


text:
Q: calling getall in apache geode to getall data for the keys in the list is slow I am using region getall method to get values for all keys, but what i found is that for the key present in apache geode it gets data quickly but for one which is not present in apache geode. it calls the cache loader one by one. Is there any mechanism so that calling cacheloader can be made parallel.

A: I don't think there's a way of achieving this out of the box, at least not while using a single Region.getAll() operation. If I recall correctly, the servers just iterate through the keys and performs a get on every single one, which ends up triggering the CacheLoader execution.
You could, however, achieve some degree of parallelism by splitting the set of keys into multiple sets, and launching different threads to execute the Region.getAll() operation using these smaller sets. The actual size of each set and the number of threads will depend on the ratio of cache hits / misses you expect, and your SLA requirements, of course.


text:
Q: How to split contained words string to to function parameters in BASH? Example code
input="cp directory_a directory_b" # obtaining value from keyboard

eval_input $input

I hope $input can be splitted into $0, $1 and $2 in eval_input function. So far i use this method to archive it
eval_input $(echo $input)

But i think maybe there is more better way.
Note that $input here, in actually it suppose to be obtained its value from a user not assign by myself.

A: Splitting strings in shell leads to many difficult problems.  The best solution is not to create a string.  Use an array:
input=(cp directory_a directory_b)
eval_input "${input[@]}"

This provides cp, directory_a and  directory_b as the arguments to eval_input which eval_input can reference as $1,$2, and$3`.
This approach will work even if some of the command's arguments contain spaces or other difficult characters.  For example, the following will work well:
input=(cp "directory a" "directory b")

Trying to do that using a string instead of array will be very difficult.
Using a user-supplied string
You can use the read command to break user-supplied input into individual arguments:
$ input="cp directory_a directory_b"
$ read -a array <<<"$input"

You can verify that the above succeeded by examining the output of declare -p:
$ declare -p array
declare -a array='([0]="cp" [1]="directory_a" [2]="directory_b")'

You can access individual elements of array as follows:
$ echo "${array[0]}"
cp
$ echo "${array[1]}"
directory_a

A: You can use set -- to set positional parameters:
( input="cp directory_a directory_b"; set -- $input; echo "[$1] [$2] [$3]"; )

Output:
[cp] [directory_a] [directory_b]

PS: Use (...) to avoid messing up current shell and do this in a sub-shell.


text:
Q: Why after fresh Ubuntu 12.04 installation update aren't being installed? I've installed Ubuntu 12.04 on a computer. Everything is fine without update. Just after the installation, it was showing about 200 MB updates to download. Since then I'm trying to install all the updates. Now it's partially completed, some of the software (firefox,VLC) is updated. Still it's showing 39.3 MB updates to download and it's failing again and again. Every time I tried to install these 39.3 MB updates, it shows that, it can't connect to internet, but there is no problem with my connection (Network indicator shows it's connected and I can browse and download anything). It's giving me the following message:
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-image-3.2.0-43-generic-pae_3.2.0-43.68_i386.deb Size mismatch
Failed to fetch http://us.archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-3.2.0-43-generic-pae_3.2.0-43.68_i386.deb Size mismatch

I thought this is a problem with sources list. So I've given the following command
sudo rm -vf /var/lib/apt/lists/partial/*

Previously, I've faced similar type of problem with a different computer. At that time, this solution worked for me, but now I'm still facing this problem. Anyone please help me to solve this problem.
Update
Here is the output of sudo apt-get update
Hit http://dl.google.com stable Release.gpg
Hit http://archive.canonical.com precise Release.gpg
Get:1 http://extras.ubuntu.com precise Release.gpg [72 B]
Hit http://dl.google.com stable Release
Hit http://us.archive.ubuntu.com precise Release.gpg
Hit http://archive.canonical.com precise Release
Hit http://dl.google.com stable/main i386 Packages
Hit http://extras.ubuntu.com precise Release
Ign http://dl.google.com stable/main TranslationIndex
Get:2 http://us.archive.ubuntu.com precise-updates Release.gpg [198 B]
Hit http://archive.canonical.com precise/partner i386 Packages
Hit http://extras.ubuntu.com precise/main Sources
Hit http://us.archive.ubuntu.com precise-backports Release.gpg
Ign http://archive.canonical.com precise/partner TranslationIndex
Hit http://extras.ubuntu.com precise/main i386 Packages
Hit http://us.archive.ubuntu.com precise-security Release.gpg
Ign http://extras.ubuntu.com precise/main TranslationIndex
Hit http://us.archive.ubuntu.com precise Release
Ign http://dl.google.com stable/main Translation-en_US
Get:3 http://us.archive.ubuntu.com precise-updates Release [49.6 kB]
Ign http://dl.google.com stable/main Translation-en
Get:4 http://us.archive.ubuntu.com precise-updates Release [49.6 kB]
Ign http://archive.canonical.com precise/partner Translation-en_US
Ign http://archive.canonical.com precise/partner Translation-en
Hit http://us.archive.ubuntu.com precise-backports Release
Hit http://us.archive.ubuntu.com precise-security Release
Ign http://extras.ubuntu.com precise/main Translation-en_US
Hit http://us.archive.ubuntu.com precise/main Sources
Ign http://extras.ubuntu.com precise/main Translation-en
Hit http://us.archive.ubuntu.com precise/restricted Sources
Hit http://us.archive.ubuntu.com precise/universe Sources
Hit http://us.archive.ubuntu.com precise/multiverse Sources
Hit http://us.archive.ubuntu.com precise/main i386 Packages
Hit http://us.archive.ubuntu.com precise/restricted i386 Packages
Hit http://us.archive.ubuntu.com precise/universe i386 Packages
Hit http://us.archive.ubuntu.com precise/multiverse i386 Packages
Hit http://us.archive.ubuntu.com precise/main TranslationIndex
Hit http://us.archive.ubuntu.com precise/multiverse TranslationIndex
Hit http://us.archive.ubuntu.com precise/restricted TranslationIndex
Hit http://us.archive.ubuntu.com precise/universe TranslationIndex
Get:5 http://us.archive.ubuntu.com precise-updates/main Sources [383 kB]
Get:6 http://us.archive.ubuntu.com precise-updates/main Sources [383 kB]
Get:7 http://us.archive.ubuntu.com precise-updates/restricted Sources [5,467 B]
Get:8 http://us.archive.ubuntu.com precise-updates/universe Sources [87.1 kB]
Get:9 http://us.archive.ubuntu.com precise-updates/universe Sources [87.1 kB]
Get:10 http://us.archive.ubuntu.com precise-updates/universe Sources [87.1 kB]
Get:11 http://us.archive.ubuntu.com precise-updates/multiverse Sources [6,582 B]
Get:12 http://us.archive.ubuntu.com precise-updates/main i386 Packages [625 kB]
Get:13 http://us.archive.ubuntu.com precise-updates/restricted i386 Packages [10.0 kB]
Get:14 http://us.archive.ubuntu.com precise-updates/universe i386 Packages [203 kB]
Get:15 http://us.archive.ubuntu.com precise-updates/multiverse i386 Packages [13.8 kB]
Get:16 http://us.archive.ubuntu.com precise-updates/multiverse i386 Packages [13.8 kB]
100% [16 Packages bzip2 0 B] [Connecting to us.archive.ubuntu.com (91.189.91.14
bzip2: Compressed file ends unexpectedly;
    perhaps it is corrupted?  *Possible* reason follows.
bzip2: Inappropriate ioctl for device
    Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

Hit http://us.archive.ubuntu.com precise-updates/main TranslationIndex
Hit http://us.archive.ubuntu.com precise-updates/multiverse TranslationIndex
Hit http://us.archive.ubuntu.com precise-updates/restricted TranslationIndex
Hit http://us.archive.ubuntu.com precise-updates/universe TranslationIndex
Hit http://us.archive.ubuntu.com precise-backports/main Sources
Hit http://us.archive.ubuntu.com precise-backports/restricted Sources
Hit http://us.archive.ubuntu.com precise-backports/universe Sources
Hit http://us.archive.ubuntu.com precise-backports/multiverse Sources
Hit http://us.archive.ubuntu.com precise-backports/main i386 Packages
Hit http://us.archive.ubuntu.com precise-backports/restricted i386 Packages
Hit http://us.archive.ubuntu.com precise-backports/universe i386 Packages
Hit http://us.archive.ubuntu.com precise-backports/multiverse i386 Packages
Hit http://us.archive.ubuntu.com precise-backports/main TranslationIndex
Hit http://us.archive.ubuntu.com precise-backports/multiverse TranslationIndex
Hit http://us.archive.ubuntu.com precise-backports/restricted TranslationIndex
Hit http://us.archive.ubuntu.com precise-backports/universe TranslationIndex
Hit http://us.archive.ubuntu.com precise-security/main Sources
Hit http://us.archive.ubuntu.com precise-security/restricted Sources
Hit http://us.archive.ubuntu.com precise-security/universe Sources
Hit http://us.archive.ubuntu.com precise-security/multiverse Sources
Hit http://us.archive.ubuntu.com precise-security/main i386 Packages
Hit http://us.archive.ubuntu.com precise-security/restricted i386 Packages
Hit http://us.archive.ubuntu.com precise-security/universe i386 Packages
Hit http://us.archive.ubuntu.com precise-security/multiverse i386 Packages
Hit http://us.archive.ubuntu.com precise-security/main TranslationIndex
Hit http://us.archive.ubuntu.com precise-security/multiverse TranslationIndex
Hit http://us.archive.ubuntu.com precise-security/restricted TranslationIndex
Hit http://us.archive.ubuntu.com precise-security/universe TranslationIndex
Hit http://us.archive.ubuntu.com precise/main Translation-en
Hit http://us.archive.ubuntu.com precise/multiverse Translation-en
Hit http://us.archive.ubuntu.com precise/restricted Translation-en
Hit http://us.archive.ubuntu.com precise/universe Translation-en
Hit http://us.archive.ubuntu.com precise-updates/main Translation-en
Hit http://us.archive.ubuntu.com precise-updates/multiverse Translation-en
Hit http://us.archive.ubuntu.com precise-updates/restricted Translation-en
Hit http://us.archive.ubuntu.com precise-updates/universe Translation-en
Hit http://us.archive.ubuntu.com precise-backports/main Translation-en
Hit http://us.archive.ubuntu.com precise-backports/multiverse Translation-en
Hit http://us.archive.ubuntu.com precise-backports/restricted Translation-en
Hit http://us.archive.ubuntu.com precise-backports/universe Translation-en
Hit http://us.archive.ubuntu.com precise-security/main Translation-en
Hit http://us.archive.ubuntu.com precise-security/multiverse Translation-en
Hit http://us.archive.ubuntu.com precise-security/restricted Translation-en
Hit http://us.archive.ubuntu.com precise-security/universe Translation-en
Fetched 935 kB in 3min 39s (4,261 B/s)
W: Failed to fetch gzip:/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise-updates_multiverse_binary-i386_Packages  Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

A: Just had the US archive package list hash sum mismatch on some fresh 12.04.5 installs. Shorter solution that worked for me at least:
# rm /var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise_*
# rm /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise*
# aptitude update
... now worked ...

A: My problem is solved now. I'm posting here the solution step by step. From the output of sudo apt-get update, I was facing following problem:
W: Failed to fetch gzip:/var/lib/apt/lists/partial/us.archive.ubuntu.com_ubuntu_dists_precise-updates_multiverse_binary-i386_Packages  Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.

To solve this problem I entered the following commands one by one.
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update
sudo apt-get dist-upgrade

Then the output was
audity@auditypc:~$ sudo rm /var/lib/apt/lists/* -vf
[sudo] password for audity:
removed `/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_partner_binary-i386_Packages'
removed `/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_Release'
removed `/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_Release.gpg'
removed `/var/lib/apt/lists/dl.google.com_linux_talkplugin_deb_dists_stable_main_binary-i386_Packages'
removed `/var/lib/apt/lists/dl.google.com_linux_talkplugin_deb_dists_stable_Release'
removed `/var/lib/apt/lists/dl.google.com_linux_talkplugin_deb_dists_stable_Release.gpg'
removed `/var/lib/apt/lists/extras.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages'
removed `/var/lib/apt/lists/extras.ubuntu.com_ubuntu_dists_precise_main_source_Sources'
removed `/var/lib/apt/lists/extras.ubuntu.com_ubuntu_dists_precise_Release'
removed `/var/lib/apt/lists/extras.ubuntu.com_ubuntu_dists_precise_Release.gpg'
removed `/var/lib/apt/lists/lock'
rm: cannot remove `/var/lib/apt/lists/partial': Is a directory
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_main_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_main_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_main_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_main_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_multiverse_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_multiverse_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_multiverse_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_multiverse_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_Release'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_Release.gpg'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_restricted_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_restricted_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_restricted_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_restricted_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_universe_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_universe_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_universe_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-backports_universe_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_multiverse_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_multiverse_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_multiverse_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_multiverse_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_Release'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_Release.gpg'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_restricted_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_restricted_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_restricted_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_restricted_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_main_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_main_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_main_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_main_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_multiverse_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_multiverse_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_multiverse_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_multiverse_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_Release'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_Release.gpg'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_restricted_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_restricted_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_restricted_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_restricted_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_universe_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_universe_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_universe_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-security_universe_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_universe_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_universe_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_universe_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_universe_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_main_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_main_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_main_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_main_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_multiverse_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_multiverse_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_multiverse_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_multiverse_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_Release'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_Release.gpg'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_restricted_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_restricted_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_restricted_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_restricted_source_Sources'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_universe_binary-i386_Packages'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_universe_i18n_Index'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_universe_i18n_Translation-en'
removed `/var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise-updates_universe_source_Sources'
audity@auditypc:~$ sudo apt-get clean
[sudo] password for audity:
audity@auditypc:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
audity@auditypc:~$ sudo apt-get update
Get:1 http://dl.google.com stable Release.gpg [198 B]
Get:2 http://us.archive.ubuntu.com precise Release.gpg [198 B]
Get:3 http://dl.google.com stable Release [1,347 B]
Get:4 http://extras.ubuntu.com precise Release.gpg [72 B]
Get:5 http://archive.canonical.com precise Release.gpg [198 B]
Get:6 http://dl.google.com stable/main i386 Packages [763 B]
Get:7 http://us.archive.ubuntu.com precise-updates Release.gpg [198 B]
Get:8 http://extras.ubuntu.com precise Release [11.9 kB]
Ign http://dl.google.com stable/main TranslationIndex
Get:9 http://archive.canonical.com precise Release [7,078 B]
Get:10 http://extras.ubuntu.com precise/main Sources [8,130 B]
Get:11 http://us.archive.ubuntu.com precise-backports Release.gpg [198 B]
Get:12 http://archive.canonical.com precise/partner i386 Packages [8,261 B]
Get:13 http://extras.ubuntu.com precise/main i386 Packages [10.8 kB]
Ign http://archive.canonical.com precise/partner TranslationIndex
Get:14 http://us.archive.ubuntu.com precise-security Release.gpg [198 B]
Ign http://extras.ubuntu.com precise/main TranslationIndex
Get:15 http://us.archive.ubuntu.com precise Release [49.6 kB]
Ign http://dl.google.com stable/main Translation-en_US
Get:16 http://us.archive.ubuntu.com precise Release [49.6 kB]
Ign http://dl.google.com stable/main Translation-en
Get:17 http://us.archive.ubuntu.com precise-updates Release [49.6 kB]
Ign http://extras.ubuntu.com precise/main Translation-en_US
Ign http://archive.canonical.com precise/partner Translation-en_US
Get:18 http://us.archive.ubuntu.com precise-updates Release [49.6 kB]
Ign http://extras.ubuntu.com precise/main Translation-en
Ign http://archive.canonical.com precise/partner Translation-en
Get:19 http://us.archive.ubuntu.com precise-backports Release [49.6 kB]
Get:20 http://us.archive.ubuntu.com precise-backports Release [49.6 kB]
Get:21 http://us.archive.ubuntu.com precise-backports Release [49.6 kB]
Ign http://us.archive.ubuntu.com precise-backports Release
E: GPG error: http://us.archive.ubuntu.com precise-backports Release: The following signatures were invalid: NODATA 2
audity@auditypc:~$

Now I was facing a GPG error. To solve this I tried the following
$ sudo -i
# apt-get clean
# cd /var/lib/apt
# mv lists lists.old
# mkdir -p lists/partial
# apt-get clean
# apt-get update
# exit

After this command. I entered the final commands.
sudo apt-get dist-upgrade


text:
Q: A Lipschitz Implicit Function Theorem. I look for a reference (book or article) that contains the statement of a version of the implicit function theorem as stated below. This statement I found in notes (with due proof) on the implicit function written by KC Border.

In these notes the author states that the proof is based on the proof of the implicit function theorem for two-variable functions given by Apostol in his calculus book. I looked at the proof given by Apostol in his calculus book (Calculus vol.2) and in fact the proof method of the above theorem is, with due adaptations, the same.
I am writing notes on the implicit function theorem. However, I did not want to have to repeat the proof, but to indicate to the reader a formal reference containing the proof.

Update 1 13 November, 2018
I have already searched in the following textbooks

*

*Implicit Functions and Solution Mappings. A View from Variational Analysis

*The Implicit Function Theorem: History, Theory, and Applications

*Nonlinear Functional Analysis
But I did not succeed.

Update 2 January 27, 2021
I originally found this theorem in the Book Aplicações da Topologia à Análise (Applications Of Topology To Analysis) in Portuguese. But I'd like it to be a reference in English language.
I have already searched in Treatise on Analysis. Foundations of modern analysis. vol. I by J. Dieudonne but again I didn't find anything like that.


text:
Q: How can I stop this guy from killing me? After the first boss, you enter a new level (Firelink Shrine) and there is a knight sitting on a log nearby.  I attacked this knight a few times and that apparently made him mad, so he killed me.
Now this guy is ridiculous strong, so I figured I'll just respawn and leave him alone this time.  Apparently this guy REALLY hates my guts though because every time I respawn he immediately begins attacking me.  3 hits later, I'm dead and have to respawn.  Lather, Rinse, Repeat.  I realize Dark Souls is known for its difficulty, but infinite dying at a checkpoint is kinda lame.
I have tried reloading my save point, but that didn't seem to help.  I'd rather not start over, if at all possible.
Here is a screenshot of the guy if that helps.

NOTE
I found a cliff and got him to roll off the edge and die.  I'm not sure if this is the only option though.

A: Just roll off the hill and he should follow you to his and your death.

A: A quick method of dispatching the Crestfallen Warrior is derived from his pretty slow attacks. Try meeting his attacks with a parry and riposte, or dodging by rolling. You can also circle him with minor difficulty and then backstab him... these techniques come in VERY handy for most small enemies in the game so this battle is a good training ground for your Parry/Ripostes and your backstabs. Just remember you can always retrieve your souls before he kills you and you wont lose a thing providing that you are hollowed.
Oh and another little tip: at low levels try not to attack NPC's although they look helpless and pathetic (most of them), they are hard as nails to defeat!

A: You can pay Oswald of Carim in the Bell Tower to absolve your sins. It will cost 500 times your soul level to absolve your sins, but it will reset all angry NPCs to neutral.

A: Unfortunately, there's no way of resetting the Crestfallen Warrior (short of starting over) after he's become hostile. See below for a way to actually calm him down. (I forgot all about Oswald!)
However, you are not penalized in any way for killing him/causing him to die. According to the Wikidot:

Be wary about accidentally making him hostile the first time you meet him, as he'll attack you as soon as you respawn at the bonfire.

It goes on to say:

As he doesn't drop any item nor does he have any effect on other NPC's story, you don't need to worry about killing him by kicking him off cliff as his "full reward" is only his souls.

Which is to say, there are no penalties for killing him, and you can snag a quick 1000 souls in the process!

A: This guy's ringmail makes him a little annoying. I would say that if you're not even strong enough to defeat him (he is perhaps the weakest NPC in the game) then you're probably safe to restart your game.

A: There is an very easy way of killing him... he is too strong to fight with at this point... so to deal with him just lock onto him and let him follow you to a cliff... be sure to guard youself.. then just take a leap of faith.. he is so pissed off of you that he will follow you :D :D ... now you will respawn at the bonfire but he will be GONE for GOOD. :D


text:
Q: Prove that $H$ is a abelian subgroup of odd order Question is:

Let $G$ be a group of  order 2n. Suppose half of the element of G are of order 2 and the other half form  a subgroup $H$ of order n . Prove that $H$ is of odd order  and is an abelian subgroup of $G$

What could i see is..
if we prove that order of every element of $H$ is odd , then order of $H$ is odd . Also i am unable to use the fact that half of the element of $G$ are of order 2.
Please help me to clear this.
Thank You.

A: I assume no element of $H$ has order $2$. Then every nonidentity element of $H$ can be paired with its own inverse. Since $e\in H$ as well, you get that $H$ is a subgroup of odd order.
Moreover, $[G:H]=2$, so $H$ is normal in $G$. Pick $g\in G\setminus H$. This induces a conjugation automorphism of $H$,
$$
\varphi_g\colon H\to H:h\mapsto ghg^{-1}=ghg
$$
since $g$ has order $2$. In particular, for any $h\in H$,
$$
h\varphi_g(h)=hghg=(hg)^2=e
$$
since $hg\notin H$, lest $g\in H$. So you conclude $\varphi_g(h)=h^{-1}$. It follows that $H$ is abelian, for if $h,k\in H$,
$$
k^{-1}h^{-1}=(hk)^{-1}=\varphi_g(hk)=\varphi_g(h)\varphi_g(k)=h^{-1}k^{-1}.
$$


text:
Q: am trying to create class to encapsulate toolbar but the background turns black. c++ win32api I created a simple class to hide the details of creating a toolbar in win32 API but I don't like the toolbars it is producing. (See image for clarification. I don't have reputation points so I have just posted a link)
http://i35.tinypic.com/1zmfeip.jpg
I have no idea now the black background is coming into my application.
Here is the class declaration in file CToolBar.h
#ifndef _CTOOLBAR_H
#define _CTOOLBAR_H

#include<windows.h>
#include<commctrl.h>

class CToolBar
{
public:
       CToolBar();//constructor
       ~CToolBar();//destructor

       void AddButton(int iconID, int command);//add Both a button, its icon and its command ID
       void Show();//display the toolbar
       void Initialise(HINSTANCE hInst, HWND hParent);
protected:
          HINSTANCE m_hInst;
          HWND m_hParent;
          HWND m_hToolBar;
          HIMAGELIST m_hImageList;
          TBBUTTON m_Tbb[4];  //toolbar buttons
          int m_numberButtons;
};
#endif

here is the implementation in file CToolBar.cpp
//CToolBar.cpp
#include "CToolBar.h"
#include<windows.h>
#include<commctrl.h>

CToolBar::CToolBar()//the constructor
{
    m_hImageList=ImageList_Create(32, 32, ILC_COLOR32, 0, 15);//returns NULL if the function fails
   //finish other initialisations
   InitCommonControls();//initialise commctrl.dll whatever.. or else your toolbar wont appear
  }

void CToolBar::Initialise(HINSTANCE hInst, HWND hParent)
{
  m_hInst=hInst;
  m_hParent=hParent;

  m_hToolBar=CreateWindowEx(
                WS_EX_PALETTEWINDOW ,
                TOOLBARCLASSNAME,
                "",
                WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS |WS_VISIBLE|TBSTYLE_BUTTON | TBSTYLE_TOOLTIPS | CCS_ADJUSTABLE | CCS_TOP ,
                0, 0,
                0, 0,
                m_hParent,
       NULL,
                m_hInst,
                0);
}

CToolBar::~CToolBar()//destructor
{
 ImageList_Destroy(m_hImageList);
}

void CToolBar::AddButton(int iconID, int command)
{
     HICON hIcon = LoadIcon(m_hInst, MAKEINTRESOURCE(iconID));
     ImageList_AddIcon(m_hImageList, hIcon);
     DeleteObject(hIcon);

if(iconID!= -1)//-1 means the separator. The rest are mere buttons
{
     m_Tbb[m_numberButtons].iBitmap =m_numberButtons;
     m_Tbb[m_numberButtons].idCommand = command;
     m_Tbb[m_numberButtons].fsState = TBSTATE_ENABLED;
     m_Tbb[m_numberButtons].fsStyle = TBSTYLE_BUTTON;
     m_Tbb[m_numberButtons].dwData = 0;
     m_Tbb[m_numberButtons].iString = 0;
}
else//ie if (iconID== -1) ; then display the separator. the command value is ignored
{
     m_Tbb[m_numberButtons].iBitmap =-1;
     m_Tbb[m_numberButtons].idCommand = 0;
     m_Tbb[m_numberButtons].fsState = TBSTATE_ENABLED;
     m_Tbb[m_numberButtons].fsStyle = TBSTYLE_SEP;
     m_Tbb[m_numberButtons].dwData = 0;
     m_Tbb[m_numberButtons].iString = 0;

}

     m_numberButtons++;

}

void CToolBar::Show()
{
SendMessage(m_hToolBar, TB_SETIMAGELIST , (WPARAM)0, (LPARAM)m_hImageList);
SendMessage(m_hToolBar, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);//message for backward
//compatibility
SendMessage(m_hToolBar, TB_ADDBUTTONS, m_numberButtons, (LPARAM)m_Tbb);
SendMessage(m_hToolBar,WM_SIZE,0,0);

ShowWindow(m_hToolBar, SW_SHOW);
}

How i used the class
in main.cpp, i  created a global instance of the class.
CToolBar myToolBar;

in the callback procedure, under WM_CREATE, I used some member functions.
case WM_CREATE:
     myToolBar.Initialise(g_hInst,hwnd);
     myToolBar.AddButton(IDI_OPEN, ID_OPEN);
     myToolBar.AddButton(IDI_MAIN,ID_OPEN);//Separator button
     myToolBar.AddButton(IDI_CLOSE, ID_CLOSE);
     myToolBar.AddButton(IDI_CLOSEALL, ID_CLOSE);
     myToolBar.Show();
     break;

That's about it.

A: Looks like you are using bitmap with transparency channel. GDI does not support alpha channel. It uses special color which will be transparent. If you want to support 32-bit bitmaps you could use GDI+ for drawing such bitmaps. Another option is to use CAplhaToolbar which already supports bitmaps with alpha transparency.

A: Try modifying the flags parameter of ImageList_Create to include ILC_MASK as well


text:
Q: Formal definition of polynomial of several variables (or in several unknowns) I am trying to make a formal definition of polynomial of several variables with coefficients in R a commutative ring.
For $1$ variable We can define a polynomial as every function $p:\mathbb{N}\to R$ with finite support $S$. As $ S=\{n\in\mathbb{N} : p(n) \neq 0\} $ is finite, it has a maximum, let's call it $k$, the degree of $p$.
And now We can represent (as usual) $p\equiv \sum_{i=0}^{n}a_i x^i$ with $a_i=p(i)$ for all $i\in\{0,\ldots, n\}$.
For $2$ variables, $x_1$ and $x_2$ you can think about $p:\mathbb{N}^2\to R$ with finite support, and for example the polynomial $2+x_1-x_1x_2 + 4x_1^3$ would be $p(0,0)=2, p(1,0)=1, p(1,1)=-1, p(3,0)=4$, but We do not have the degree now so, ¿how can we write in sum form?¿It is correct my attempt?¿Can we generalize for $n$ variables?

A: One way to view a polynomial ring $R[x]$ or $R[x, y]$ and so on is as a monoid algebra. I won't explain exactly what that means, but to define a polynomial ring in $k$ variables, you would do it like this:

*

*Regard $M = (\mathbb{N}^k, +)$ as a commutative monoid under point-wise addition, for instance if $k = 3$ we could have $(0, 1, 2) + (3, 4, 0) = (3, 5, 2)$.

*Let $R[M]$ be the free $R$-module with basis given by $\{x^m \mid m \in M\}$. Here $x^m$ is just alterative notation for $m$, which proves notationally useful in what follows. At this point $R[M]$ is a free module with a basis, so we have linear combinations of basis elements, and can decide when things are linearly independent.

*Equip $R[M]$ with an $R$-bilinear multiplication by defining for each $n, m \in M$ that $x^n x^m = x^{n + m}$. Now $R$ is a ring, we can check that $x^{(0, \ldots, 0)}$ functions as a unit element, and multiplication is commutative because $M$ is commutative.

Now I claim that $R[M]$ is the usual polynomial algebra in $k$ variables. For example, when $k = 3$ just following the definitions gives equations like
$$ \begin{aligned}
(2x^{(0, 0, 0)} + 3 x^{(0, 1, 2)})8 x^{(3, 5, 2)}
  &= 16x^{(3, 5, 2)} + 24 x^{(3, 6, 4)},
\end{aligned} $$
So the element $x^{(a, b, c)} \in R[M]$ behaves just like $x_1^a x_2^b x_3^c \in R[x_1, x_2, x_3]$.
If you want to write down the free module $R[M]$ in a different form there are many ways to do it, but finitely-supported functions $f \colon M \to R$ is a good way to do it. You can then interpret what the product of two such functions $f, g \colon M \to R$ are, by following the definitions through, to get something like
$$ (f \cdot_{R[M]} g)(p) = \sum_{\substack{m, n \in M \\ m + n = p}} f(m) g(n), $$
For example in the sum written above, to find the coefficient of $x^{(3, 5, 2)}$ on the right-hand side, I want to look at all the ways of finding $x^m$ and $x^n$ on different sides of the product such that $m + n = (3, 5, 2)$.


text:
Q: How to run the same scripted pipeline multiple times in jenkins? I went over the internet to find out a way to run the same pipeline multiple times but have not found an answer.
Basically, the pipeline has 5 stages and I want this pipeline to run 5 times, each iteration of the pipeline will execute the stages in the same order in the code.
node{

def build_ok = true

    try{
    stage('#1 SoftSync 4.5.1 CPU Usage Test') {
          build job: 'SoftSync_4.5.1_CPU_Usage_Test', parameters: [string(name: 'LOG_LEVEL', value: 'debug'), string(name: 'FILE_PATH', value: 'TLV_SoftSync/Management_Bundle/SoftSync_CPU_Usage_Test.robot')]
    }
    } catch(e) {
        build_ok = false
        echo e.toString()
    }

    try{
    stage ('#2 SoftSync 4.5.1 Improvments to system time management Test '){
        build job: 'SoftSync_4.5.1_Improvments_To_System_TimeManagement_Test', parameters: [string(name: 'LOG_LEVEL', value: 'debug'), string(name: 'FILE_PATH', value: 'TLV_SoftSync/Management_Bundle/SoftSync_Improvments_to_system_time_management.robot')]
    }
    }catch(e) {
        build_ok = false
        echo e.toString()
    }

    try {
    stage ('#3 SoftSync 4.5.1 Telematics and statistics Test'){
       build job: 'SoftSync_4.5.1_Telematics_and_statistics_Test', parameters: [string(name: 'LOG_LEVEL', value: 'debug'), string(name: 'FILE_PATH', value: 'TLV_SoftSync/Management_Bundle/SoftSync_Telementry_and_Statistics.robot')]
    }
    }catch(e) {
        build_ok = false
        echo e.toString()
    }

    //try{
      //stage ('#4 SoftSync 4.5.1 PTP Profiles Slave Lock Test'){
        build job: 'SoftSync_4.5.1_PTP_Profiles_SlaveLock_Test', parameters: [string(name: 'LOG_LEVEL', value: 'debug'), string(name: 'FILE_PATH', value: 'TLV_SoftSync/PTP_Bundle/SoftSync_PTP_Lock_validation.robot')]
    //}
    //}catch(e) {
    //    build_ok = false
    //    echo e.toString()
    //}

    try{
      stage ('#5 SoftSync 4.5.1 Alarms Test'){
       build job: 'SoftSync_4.5.1_Alarms_Test', parameters: [string(name: 'LOG_LEVEL', value: 'debug'), string(name: 'FILE_PATH', value: 'TLV_SoftSync/Management_Bundle/SoftSync_Alarms_Test.robot')]
    }
    }catch(e) {
        build_ok = false
        echo e.toString()
    }

if(build_ok) {
    currentBuild.result = "SUCCESS"
} else {
    currentBuild.result = "FAILURE"
}

post{
    always{
        junit allowEmptyResults: true, testResults: '/var/lib/jenkins/output/*.xml'
    }
}
}

I have seen some usages with arrays and .each function but all for parallel usages witch is not help full in my case...
any ideas?

A: You can wrap your stages with a loop. Something like below.
node {
    def itrList = ["Run1", "Run2", "Run3"]
    itrList.each { val ->

        def build_ok = true
        try {
            stage("#1 SoftSync 4.5.1 CPU Usage Test with $val") {
                echo "111111"
            }
        } catch (e) {
            build_ok = false
            echo e.toString()
        }

        try {
            stage("#2 SoftSync 4.5.1 Improvments to system time management Test  with $val") {
                echo "22222222222"
            }
        } catch (e) {
            build_ok = false
            echo e.toString()
        }

        if (build_ok) {
            currentBuild.result = "SUCCESS"
        } else {
            currentBuild.result = "FAILURE"
        }
    }
}


text:
Q: Construction of a non-autonomous Hamiltonian diffeomorphism Let $(M,\omega)$ be a symplectic manifold. I have read that the autonomous Hamiltonian diffeomorphisms (i.e. a Hamiltonian diffeomorphism generated by a time-independant Hamiltonian) form a proper subset of the Hamiltonian diffeomorphisms of $M$, but I haven't been able to find a proof of that. Does anyone have a link in which a non-autonomous Hamiltonian diffeomorphism is constructed, and proven that it is indeed non-autonomous.

A: Here's a hint: use the fact that the exponential map for $\mathrm{Sp}(2n)$ is not surjective, and the fact that if $\phi$ is a Hamiltonian diffeomorphism coming from a time-independent Hamiltonian, then at a fixed point $p$ of $\phi$, the differential $D_p \phi \in \mathrm{Sp}(T_p M)$ is in the image of the exponential map.
If you'd like a reference where some counterexamples are stated in the form of exercises, take a look at McDuff-Salamon, Introduction to Symplectic Topology, Exercise 3.1.16 on p. 103 of 3rd Ed.


text:
Q: Make sure a class has a property ( and initialised via the constructor? ) I have the following interface and classes using C# 10:
public interface IStrategy {
  String Name { get; }
}

public abstract class Strategy : IStrategy {
  public abstract String Name { get; }
}

public class WeeklyStrategy : Strategy {

  public override String Name => "Weekly Strategy";

  public Options Options { get; }

  public WeeklyStrategy(Options options) {
    Options = options;
  }

}

How to force all Strategy derived classes (Ex: WeeklyStrategy) has a property Options?
And can I force that property to be initialised through the class constructor?


text:
Q: Importing model in utils.py causes ImproperlyConfigured I have created a file called utils.py in my Django app, where I keep random classes or functions that do something.
I have run into an issue, where I can't import any model in utils.py file.
I have models called User which inherit from AbstractUser and it's been said to Django by: AUTH_USER_MODEL = 'main.User'
I have also a model called Project.
Whenever I type from main.models import Project or User in utils.py I get django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'main.User' that has not been installed
Of course main is in installed apps in settings.
I have solved this before by using get_user_model() for User, but there is no such a function to get a Project.
How to solve this problem? Am I missing something?

A: Circular import. I've been importing mixin from utils in model and in utils I've been importing model from models that inherited mixin.


text:
Q: ASCII Characters Messed Up in simple C Program I have written this simple program for an assignment, but when I input my text, the output gives me symbols instead of chars.  any help would be appreciated.  I do not know why my output appears that way, but the program seems to compile fine.  Maybe it is working and I need to just do a base test with the math to see if it is functioning properly.  In any event if anyone sees errors in this, feedback is much appreciated.
#include <stdio.h>
#include <cs50.h>
#include <stdlib.h>
#include <ctype.h>

string Crypto(string, int); // rotation

int main(int argc, string argv[])
   {
    int k = 0;
    // error checing
    if (argc == 0 || argc == 1 || argc > 2)
   {
        // get mad
        printf("Enter 1 integer as an argument.  Stop messing around!\n Try Again: ");
        return 1;
   }
    else
   {
        //create command line arguments to be stored into k
        k = atoi(argv[1]);
        k = k * 1;
   }

    // Get text to be encrypted
    printf("Enter the text you want to encrypt: \n");
    string a = GetString();

    string b = Crypto(a, k);
    printf("%s\n", b);

    return 0;
 }

 //Now let's get cryptic
 string
 Crypto(string a, int k)
 {
    int c = 0;
    for (int i = 0, n = strlen(a); i < n; i++)
    {
        if(a[i] >= 65 && a[i] <= 90)
        {
            c = ((26 - (91 - a[i] + k) % 26));
            a[i] = c + 'A';
        }
        else
        {
            c = ((26 - (123 - a[i] + k % 26)));
            a[i] = c + 'a';
        }
     }
     return a;
  }

A: In function Crypto, you need to attach a \0 (null) character to signify the end of the string. Just before return a;, write a a[i+1] = '\0'; statement.


text:
Q: How to preserve format with yaml dump in python3 I want to change only the attribute anotherName from the following yaml file with python.
test.yaml:
---
kind: test
scope: not far
spec:
  test1:
    options:
      - name: test.com
        anotherName: example.com
        empty: []
    groupOne: []
    emptyList:
      firstList: []
      secondList: []

Code (based on this answer)
import yaml
with open("test.yaml", 'r') as stream:
    try:
        loaded=yaml.safe_load(stream)
    except yaml.YAMLError as exc:
        print(exc)
    temp= loaded['spec']['test1']['options']
    for elem in temp:
        elem['anotherName']='somethingChanged'
with open("modified.yaml", 'w') as stream:
    try:
        yaml.dump(loaded, stream)
        print(loaded)
    except yaml.YAMLError as exc:
        print(exc)

The value has been changed, but the code change the order and the structure of the modified.yaml :
#First it misses the thre dashes
kind: test
scope: not far
spec:
  test1:
    emptyList:
      firstList: []
      secondList: []
    groupOne: []
    options:
    - anotherName: somethingChanged #then the order is changed
      empty: []
      name: test.com

A: you can probably not force a specific output from pyyaml, but if you have such a specific requirement what you want to substitute, then why make the extra hassel of parsing the yml fromat at all. How about reading the file into a string and then making your replacement:
import re
# Here you would need to read the file content. I define it here
content="""
---
kind: test
scope: not far
spec:
  test1:
    options:
      - name: test.com
        anotherName: example.com
        empty: []
    groupOne: []
    emptyList:
      firstList: []
      secondList: []
"""
print(re.sub(r'anotherName: [^\n]*', 'anotherName: somethingChanged', content))

Output:
---
kind: test
scope: not far
spec:
  test1:
    options:
      - name: test.com
        anotherName: somethingChanged
        empty: []
    groupOne: []
    emptyList:
      firstList: []
      secondList: []

A: If your version of PyYAML is higher than 5.1 you can use sort_keys argument to preserve the order. The only line that needs change is this one:
yaml.dump(loaded, stream, sort_keys=False)


text:
Q: Polygamma sum problem ... Hello guys i have a problem evaluating the following sum
$$\sum_{n=1}^{+\infty}\frac{n(n+1)}{2}\frac{4x(3\pi ^{2}(n+1)^{2}+x^{2})}{(x^{2}-\pi ^{2}(n+1)^{2})^{3}}$$ It is obviously of the polygamma form but i cant find an idea to solve it. Writing it into partial fractions makes it diverge so i dont know where to go. Please give a hint or a solution, anything is helful. If we were to write it into part frac we would get $$\frac{(n^2+n)}{(x-\pi (n+1))^{3}}$$ which is similar to $\frac{1}{n}$ which diverges, therefore i need an idea that doesnt rely on it.


text:
Q: How to use reflection along with LINQ to Entities to get an entity property's value? I try to execute the following statement:
int count = this.objectReportsRepository.All()
            .Count(or => (int)or.GetPropertyValue("ReportingUserId") == reportModel.ReportingUserId
            && or.GetPropertyValue("Reported" + target + "Id") == reportModel.GetPropertyValue("Reported" + target + "Id")
            && DbFunctions.TruncateTime((DateTime)or.GetPropertyValue("ReportDate")) == serverTimeToday);

However, I get an error:
System.NotSupportedException: LINQ to Entities does not recognize the method 'System.Object GetPropertyValue[QuestionReport](InterpretumDAL.QuestionReport, System.String)' method, and this method cannot be translated into a store expression.
GetPropertyValue is actually an extension method that I wrote on my own to use reflection:
public static object GetPropertyValue<T>(this T sourceObject, string propertyName)
{
    return sourceObject.GetType().GetProperty(propertyName).GetValue(sourceObject, null);
}

I want to execute the LINQ to Entities statement written on the top of my question, because I have different Report entities. For example, I have QuestionReport, UserReport, TagReport, etc. entities. I do all the same with them, but they have a different meaning. The QuestionReport entity stores reports for Question entities. The UserReport - for User entities and so on. So, instead of writing the same code n times, I want to user Reflection.
The only thing I could think of is to add a ToList() method call after the All() method call, but by doing this I actually load all entities in memory and only after this I Count the thing I want to count, instead of counting it with a simple query.
Help? Anyone? :)

A: You need to build expression tree in order to use it against linq to entities, try this expression.
var or = Expression.Parameter(typeof(ObjectReport));
var cond1 = Expression.Equal(
    Expression.Property(or, "ReportingUserId"),
    Expression.Constant(reportModel.ReportingUserId));
var cond2 = Expression.Equal(
    Expression.Property(or, "Reported" + target + "Id"),
    Expression.Constant(reportModel.GetPropertyValue("Reported" + target + "Id")));
var cond3 = Expression.Equal(
    Expression.Call(
        typeof(DbFunctions),
        "TruncateTime",
        Type.EmptyTypes,
        Expression.Convert(Expression.Property(or, "ReportDate"), typeof(DateTime?))),
    Expression.Convert(Expression.Constant(serverTimeToday), typeof(DateTime?)));
var cond = Expression.AndAlso(Expression.AndAlso(cond1, cond2), cond3);
var predicate = Expression.Lambda<Func<ObjectReport, bool>>(cond, or);

int count = this.objectReportsRepository.All().Count(predicate);

A: No offense man, but why even use entity framework if you're going to misuse generics like this?
Your repository should be a Repository<T> so that when you perform .All() you can just directly select the property value that you need via Func. Then in your code, wherever you need a Repository<QuestionReport>, everything is automagically set up and your queries can simply perform
var questions = repository.All(questionReport => questionReport.Question == "How old are you");

You should never use reflection in any kind of loop. It's very inefficient.
Anyway, if you're still set on this, you'll have to do the .All().ToList() then loop through it again to do your logic, because (to retiterate): you're doing it very, very wrong.


text:
Q: Angular 6 scope of this keyword is different in child components I have a component, which we can call Profile-Main.
Profile-Main has the following data retrieval function:
getData(text: string): Observable<Response> {
    const baseUrl = environment.apiURL + "Profile/";
    const params = new HttpParams().set('userName', text);

    return this.httpClient
           .get(baseUrl + 'GetUser', {params: params})
           .map(response => <Response>response);
}

Now the Profile-Main Component makes use of angular input tags component(ngx-chips).
I am trying to implement the autocomplete feature which passes a ref to the getData function as follows:
<div class="col-sm-10">
    <tag-input class="tag-chips" [secondaryPlaceholder]="'Enter your User Name'"
                name="userName" [ngModel]="['Test User']" [maxItems]="1" [ripple]="false"
                [onlyFromAutocomplete]="true">

    <tag-input-dropdown [appendToBody]="false" [displayBy]="'Name'" [identifyBy]="'id'"
                  [autocompleteObservable]="getData">
    </tag-input-dropdown>
    </tag-input>
</div>

Now the issue is that when the getData method is hit, this.httpClient is undefined because at that point the scope of the this keyword refers to the TagInputDropdownComponent and not the ProfileMainComponent.
How do i get around this problem? I see that on the net there is alot of sources on input parameters but the problem with that is that I cant directly edit that npm package?
I'm new to angular 6 but there must be a simple way to resolve this issue?

A: If you are allowed to edit the component that has getData function, Try to use Arrow function syntax, it binds this automatically.
getData = (text) : Observable<Response> =>  {
    const baseUrl = environment.apiURL + "Profile/";
    const params = new HttpParams().set('userName', text);

    return this.httpClient
      .get(baseUrl + 'GetUser', {params: params})
      .map(response => <Response>response);
  }


text:
Q: Changed sub-site to its own domain trigger 302 redirects for all page links Below, I'm calling the development site mainsite.com (containing the WPMS install) and the domain that will point to a Norwegian sub-site of mainsite.com, I call launchsite.no.
A Norwegian sub-site is ready to be launched, and the client is ready to point launchsite.no to the Wordpress installation. I'm manually pointing launchsite.no to the correct IP address in HOSTS to make sure it's ready for the 'switch'.
So it's not a migration question. The host has internally made an alias for launchsite.no to be the same directory where the WPMS install is.

*

*The site works perfectly when Domain is set to mainsite.com and Path is set to /no/ (in wp-admin).

*Just pointing launchsite.no to the server IP gives me mainsite.com (main site, not Norwegian). (And launchsite.no/wp-admin doesn't work.)

*I changed the Domain to launchsite.no and the Path to / for the Norwegian site.

*This gives me launchsite.no (yay!) and if I hover on all links on the site, they are correct, like launchsite.com/om-oss (About Us page). But when I click them, all of them give 302 Moved Temporarily and I end up on mainsite.com!
I'm having trouble debugging this. I have read these documents and these from the codex
The Site URL and Home in the database are correct, and there are no relevant occurrences of mainsite.com/no/.
I've tested out some URLs that work and some that don't, hoping that it will give a clue.

*

*launchsite.no/wp-admin/ - OK (phew!)

*launchsite.no/ - OK, Norwegian start page.

*launchsite.no/om-oss (page) - 302 redirect to mainsite.com!

*launchsite.no/?pagename=om-oss (same page) - OK!

*launchsite.no/?page_id=18 (same page) - 302 redirect to mainsite.com.
I have disabled the Rewrite and Yoast SEO plugins (since they are capable of doing 301 redirects), no difference.
I have saved and flushed Wordpress' rewrite rules.
The host will not help me with Wordpress, but just says WP Multisite works on their servers. So I would be very grateful for suggestions what causes this, where I should look.
It seems that Wordpress' own permalink translation is broken after the "sub-site move".
UPDATE:
I think I've ruled out everything but an error in wp_rewrite. Is there a way to catch or log what Wordpress is rewriting the page Permalinks to? Is there a third value apart from siteroot and home that it uses, that I could check in the database?
Here is my .htaccess (standard, from the multisite article on wordpress.com):
Options All -Indexes
DirectoryIndex index.php index.html index.htm

#make sure in development site is not found by search engines.
Header set X-Robots-Tag "noindex, nofollow"

# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On

RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

# END WordPress

And here's my wp-config:
$table_prefix = 'wp_';

/**
* WordPress Localized Language, defaults to English.
*
* Change this to localize WordPress. A corresponding MO file for the chosen
* language must be installed to wp-content/languages. For example, install
* de_DE.mo to wp-content/languages and set WPLANG to 'de_DE' to enable German
* language support.
*/
define('WPLANG', '');

/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*/
define('WP_DEBUG', false);
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', 'mainsite.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define('WP_POST_REVISIONS', true);
define( 'WP_AUTO_UPDATE_CORE', false );

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

A: Your wp-config.php indicates that you've set up a subdirectory installation, but you want to be able to use different domain names for the sites. To do that, I believe you'll need a plugin of some sort.
A quick search indicates that WordPress MU Domain Mapping may do what you need. Be sure to read the installation instructions carefully -- it looks somewhat more involved than the usual "put the plugin in wp-content/plugins and activate".
Caveat: I have a fair amount of experience in WordPress Multisite subdirectory installations, but my WPMS subdomain knowledge is pretty thin. If I've made an error, please correct me.


text:
Q: Docker and libseccomp I'm running into a problem with docker. I've got here OpenSuse 13.2 with a self-built version of libseccomp library. it's fresh version 2.3.1 from couple of weeks ago. If i'm running any docker container, i get the following error:
hostname:/usr/lib/docker # docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
78445dd45222: Pull complete
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Status: Downloaded newer image for hello-world:latest
container_linux.go:247: starting container process caused "conditional filtering requires libseccomp version >= 2.2.1"
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "conditional filtering requires libseccomp version >= 2.2.1".
ERRO[0002] error getting events from daemon: net/http: request canceled

Of course i can use an option --security-opt seccomp:unconfined when starting a container, but this is not my purpose.
# rpm -qa libseccomp
libseccomp-2.3.1-1.x86_64

docker info:
Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 1
Server Version: 1.13.0
Storage Driver: devicemapper
 Pool Name: docker-254:2-655361-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: ext4
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 307.2 MB
 Data Space Total: 107.4 GB
 Data Space Available: 20.64 GB
 Metadata Space Used: 806.9 kB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.147 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.03.01 (2011-10-15)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: oci runc
Default Runtime: runc
Init Binary: docker-init
containerd version:  (expected: 03e5862ec0d8d3b3f750e19fca3ee367e13c090e)
runc version: N/A (expected: 2f7393a47307a16f8cee44a37b262e8b81021e3e)
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 3.16.7-53-desktop
Operating System: openSUSE 13.2 (Harlequin) (x86_64)
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 3.868 GiB
Name: hostname
ID: DCOH:JZMG:ZUTM:5MSB:DVAG:SQXS:Z36N:5OXU:GQII:YTMO:RWDA:HYBJ
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
WARNING: No kernel memory limit support
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

A: Seems the problem may be with runc. I'm currently running into the same identical error, on Leap 42.1 with docker & runc from OBS Virtualization:containers repo. My setup was running fine until recent set of package updates.
i | runc   | package    | 0.1.1+gitr2942_2f7393a-33.2 | x86_64 | Virtualization:containers (openSUSE_Leap_42.1)
i | docker | package    | 1.13.0-182.1                | x86_64 | Virtualization:containers (openSUSE_Leap_42.1)

strings on /usr/sbin/runc show:
strings /usr/sbin/runc | grep 2.2.1
[..]
conditional filtering requires libseccomp version >= 2.2.1
[..]

Going down further, changelog shows:
* Fri Feb 24 2017
- update to docker-1.13.0 requirement
* Mon Dec 19 2016
- update runc to the version used in docker 1.12.5 (bsc#1016307).

And the source for that package has Godeps/_workspace/src/github.com/seccomp/libseccomp-golang/seccomp_internal.go with this on line 299:
return fmt.Errorf("conditional filtering requires libseccomp version >= 2.2.1")

Looks like there is now an official bug report, and this issue impacts a few different SUSE releases that use that repo:
https://bugzilla.opensuse.org/show_bug.cgi?id=1028639


text:
Q: Pass StreamWriter to another thread and close the thread after N seconds I have code like this:
StreamWriter successWriter = File.AppendText(pathSuccess);
task = Task.Factory.StartNew(() =>
{
    IEnumerable<string> lines = File
          .ReadLines(actualPath)
          .Skip(GetInt(positionNumericUpDown.Value));
    try
    {
        var options = new ParallelOptions()
        {
            CancellationToken = cts.Token,
            MaxDegreeOfParallelism = GetInt(maxThreadNumericUpDown.Text)
        };

        Parallel.ForEach<string>(lines, options, (line, loopState, idx) =>
        {
            options.CancellationToken.ThrowIfCancellationRequested();
            Result result = getResult(line);
            lock(successWriter)
            {
               successWriter.WriteLine("{0}\t{1}", result.Url, result.Message);
               successWriter.Flush();
            }
        }
    }
    catch (OperationCanceledException ex)
    {
        Console.WriteLine(ex.Message);
    }
},
TaskCreationOptions.LongRunning);

Now I need every 60 seconds start another thread NewThread with method
 void checkForMoreResults(successWriter);

The NewThread can take more than 60 seconds so I need close the previosuly running thread before starting the new one (after every 60 seconds)
Any suggestion how can I do it will appreciated

A: why not just use BackgroundWorker and call CancelAsync()?  it might be a little bit easier perhaps than the .net TPN APIs.


text:
Q: change your location to the fake location I want to change my location in my device. my location is already shown the right one, but I just want to use fake location Instead of the right one. now my location is Tehran , how to change my location to the Turkey?
here is my code:
public class main extends Activity {
    Button btn;
    public LocationManager mLocationManager;
    public String mocLocationProvider = LocationManager.NETWORK_PROVIDER;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mLocationManager = (LocationManager)  getSystemService(Context.LOCATION_SERVICE);
        mLocationManager.addTestProvider(mocLocationProvider, false, false, false, false, true, true, true, 0, 5);
        mLocationManager.setTestProviderEnabled(mocLocationProvider, true);
        btn= (Button) findViewById(R.id.set);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Location location = new Location(mocLocationProvider);
                location.setLatitude(32.87972);
                location.setLongitude(39.967203);
                location.setAltitude(0);
                location.setTime(System.currentTimeMillis());
                mLocationManager.setTestProviderLocation(mocLocationProvider, location);
                Toast.makeText(getBaseContext(),"Latitude: "+location.getLatitude()+" Longitude: "+location.getLongitude(), Toast.LENGTH_SHORT)
               .show();
            }
        });
    }
}

A: You can do this by using apps like FakeGPS. You will need to enable "Allow Mock Locations" in developer settings.

A: Im not quite sure what you mean, you can use the "Allow Mock Locations" like notsopopularguy said. Make sure you have developer settings turned on.
If you what to change it in app just change the below code with new values.
location.setLatitude(32.87972);
location.setLongitude(39.967203);

Turkeys Latitude and longitude are as follows 38.963745 & 35.243322. Insert these into the required places above.


text:
Q: Scheduled method in Spring 4 container I'm developing a web application using Spring-MVC (4.2.5) and Spring-Security (4.0.3). My issue is that I need a method which runs at set time intervals, such as every 30 seconds, but before it's executed I have to make sure that the user is logged in.
When the user submit login form, an HTTP request is send to an external server and, if the credentials are correct, an HTTP response containing a session token is returned.
The session token is fundamental for all other request, including the ones I want to forward within the timed method.
In my controller I can obtain the session token from the Spring Security Context, in every moment:
String token = SecurityContextHolder.getContext().getAuthentication().getDetails().toString();

I tried to use a scheduled task but unfortunately that doesn't work, because this is started at application launch, when there is no session and runs in a thread separated from the servlet container. The following exception is thrown:
GRAVE: Unexpected error occurred in scheduled task.
java.lang.NullPointerException
    at service.RetrieveBettingOdds.retrieveMatchByNationality(RetrieveBettingOdds.java:54)
    at tasks.OddsTask.run(OddsTask.java:36)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

because SecurityContextHolder.getContext() is null.
OddsTask
@Component
public class OddsTask {
    @Autowired
    private BettingService bettingService;
    @Autowired
    private MatchDao matchDao;
    private List<Match> betfairMatches;
    private List<Match> databaseMatches;

    public void run() {
        betfairMatches = new ArrayList<>();
        databaseMatches = new ArrayList<>();
        databaseMatches = matchDao.retrieveAllMatches();

        for(Country country : Country.values()) {
            betfairMatches = bettingService.retrieveMatchByNationality(country.name(), getCompetitionId(country.name()));
        }
    //cut code
}

RetrieveBettingOdds
@Service
public class RetrieveBettingOdds implements BettingService {
    private static final String BETTING_END_POINT = "https://api.betfair.com/exchange/betting/json-rpc/v1";
    private static final String APP_KEY = "my_app_key";
    private String token;

    @Override
    public List<Match> retrieveMatchByNationality(String country, String competitionId) {
        token = SecurityContextHolder.getContext().getAuthentication().getDetails().toString();
    /**
    * Cut the following code, in which I create an HTTP request including the token
    **/
}

spring-mvc.xml
<bean id="oddsTask" class="tasks.OddsTask">
</bean>

<task:scheduler id="myScheduler" pool-size="10" />

<task:scheduled-tasks scheduler="myScheduler">
    <task:scheduled ref="oddsTask" method="run"
        fixed-delay="10000" initial-delay="60000" />
</task:scheduled-tasks>

What can I use instead? How can I fix it?

A: I have an idea that unfortunately I cannot test at this point, but I hope this somehow helps, or at least give you other ideas on how this could be done.
How about you define an Http event listener that updates a data structure with active session?.
public class ActiveUsers implements HttpSessionListener {

    private ActiveUsersDao active = new ActiveUsersDao<>();

    @Override
    public void sessionCreated(HttpSessionEvent event) {
        active.add(event.getSession().getId());

    }

    @Override
    public void sessionDestroyed(HttpSessionEvent event) {
        active.remove(event.getSession().getId());
    }
}

Then in your web.xml you register the listener
<listener>
   <listener-class>com.stackoverflow.ActiveUsers</listener-class>
</listener>

Finally, in your scheduled bean you can get data from your DAO.
@Service
public class TaskScheduler

   @Auotwired ActiveUsersDao activeUsers;

   @Scheduled
   public void run() {
      Set<String> snapshot = activeUsers.findAll();
      for(String user: snapshot) {
         //do what you've got to do
      }
   }


text:
Q: Smallest Convex Hulls ($n$-Simplex) of $n+2$ Points in $\mathbb{R}^n$ "Given $n$, find the minimal value of $k$ with the following property: Any $k$ (distinct) points in $\mathbb{R}^n$ can be partitioned into two disjoint subsets so that the intersection of the convex hulls of the two partitions is not empty."
A convex hull of a set is the "smallest" convex set which contains the set. A convex set $C$ is one in which $\forall x,y \in C$, $\lambda x + (1-\lambda)y \in C$ for $0 \leq \lambda \leq 1$.
For instance, in $\mathbb{R}$, suppose we have three points, $a,b,c$ with $a < b < c$. Then let $a$ and $c$ be in one partition and $b$ in the other. Clearly, the convex hull of $\{a,c\}$ is the line segment which indeed passes $b$.
In $\mathbb{R}^2$, I think $k=4$. We have four cases:
Case 1: All four points $a,b,c,d$ are collinear. Then the partitions can be $\{a,c\}$ and $\{b,d\}$ and their convex hulls clearly have non empty intersection.
Case 2: Three of the points are collinear, say $a,b,c,$ with $b$ between $a$ and $c$. Point $d$ is elsewhere. Then let the partitions again be $\{a,c\}$ and $\{b,d\}$.
Case 3: The four points form the vertices of a convex quadrilateral. Then let the convex hulls be the "diagonals".
Case 4: The four points form the vertices of a concave quadrilateral. Then three of the points form the vertices of a triangle and the fourth point would be inside that. The convex hull of $\{a,b,c\}$ is exactly that triangle.
I conjecture that $k=n+2$. I think that the convex hull of $n+1$ points in $\mathbb{R}^n$ is the $n$-simplex (I don't know if that's the right notation). We can always form a simplex with $n+1$ points and then have the last point be floating around. If that point is within the simplex (conjectured convex hull), then we are done. If it's outside it, we can sort of divide up the space based on the "faces" of our simplex.
For instance, in $\mathbb{R}^3$, we have five points. We can build a tetrahedron with four of the points. The tetrahedron will have four faces which can be extended to be four planes, dividing up the $\mathbb{R}^3$. Each plane cuts the space into two. So if our fifth point is on one side of the face, then there is an associated vertex of the tetrahedron on the other side. We can let that vertex and this fifth point be in a partition and the other three points in the other. Thus, we have a line segment passing through a triangle. If there's problems with the point being in the plane of one of the faces, I think we can still account for that case simply by forming a triangle and line segment.
But beyond $\mathbb{R}^n$, it isn't obvious to me how to prove or disprove the conjecture. I think the solution shouldn't require anything but rather elementary (not necessarily easy or simple, just techniques that a undergraduate or even high school student might recognize) methods. I don't actually know any algebraic geometry but I know that simplices and affine geometry has something to do with the problem; hence the tags.
Any ideas for solving this problem are welcome and appreciated.

A: Your conjecture is correct. First, it is possible to place $n+1$ affinely independent points in $\mathbb{R}^n$, and these cannot be partitioned as suggested.
Second, given $n+2$ points $x_k\in\mathbb{R}^n$, they must be affinely in
dependent, i.e., there are scalars $a_k$, not all zero, so that $$\sum_{k=1}^{n+2} a_kx_k=0,\quad\sum_{k=1}^{n+2}a_k=0.$$
Rewrite this as
$$\sum_{a_k\ge0}a_kx_k=-\sum_{a_k<0}a_kx_k,$$
and divide both sides by $\sum_{a_k\ge0}a_k$ to get convex combinations on both sides.