How to get Multiple Inputs

Question: I was thinking of implementing picture uploading to my web application.
Now there are few Uncertainties.It would be great if some one makes them clear.
How do you allow user to upload multiple data for
Example. I have a model for car and I want user to add as many pictures with comments. Usually on websites there is button that says "Add another picture". If user clicks that button or link a text field and a Browse button appears and user can add as many pictures as he wants.
Answer: You need to go through this wiki -
http://www.yiiframework.com/wiki/176/uploading-multiple-images-with-cmultifileupload/

How to get Multiple Inputs


Find out what version of Boost was used to compile an executable/DLL

Question: Is there any way to use "strings" or some otehr command to decide what version of Boost was used to compile a particular executable or .so? All I have is the executable/.so itself.
Answer: Boost is mostly a header-only library, with extensive use of templates (which all compiles down to probably some optimized binary). Given only the executable binary, you're most likely not be able to deduce the Boost version used.
Probably the only way you'll know what Boost version is used by looking at the executable's version number (if it has one) then look it up in the source control repository it came from (if you have access to it).
Comment: There is http://www.boost.org/doc/libs/1_42_0/boost/version.hpp, but the version is #define-d, so no I don't think you'll find a Boost version string in the binary unless the programmer explicitly put it there.


Applescript opening wrong version of OS X app

Question: My script is opening an old version of the app (which I wrote). I have searched the HD and cannot find the old app. The new version is in the applications folder. The script is in the scripts folder.
I made a new folder and put the script and the new app in it. Running the script still opens the wrong app. App2 is the problem child.
Where is the wrong path coming from?
How to:
Point the script at the correct app? I don't want a path in the script.
Find the old app and delete it?
property checkInterval : 5 -- Number of seconds between checks. Adjust to requirement.
global App1WasOpen, GUIScriptingWasEnabled, previousText

on run
 -- When the script starts up, note if App1 is running and GUI Scripting is enabled.
 tell application "App1" to activate
 tell application "System Events"
   set App1WasOpen to (application process "App1" exists)
   set GUIScriptingWasEnabled to (UI elements enabled)
 end tell

 -- Enable GUI Scripting if nec. and give the 'previousText' variable an initial value.
 switchGUIScripting(true)
 set previousText to ""
end run

on idle
-- Each time the script's polled by the system, check that App1's open.
tell application "System Events" to set App1IsOpen to (application process "App1" exists)

if (App1gIsOpen) then
  set App1WasOpen to true
  -- Get the latest value for 'beam'.
  tell application "App1"
       set hdg to getHeading
       set beam to hdg as string
   end tell
   if ((count beam) < 3) then set beam to text -3 thru -1 of ("000" & beam)

   -- If it's changed since the last check, enter it into App2 and keep it for later checks.
   if (beam is not previousText) then
       --display dialog "Opening App2" buttons {"OK"}
       tell application "App2" to launch
       --activate application "App2"
       tell application "System Events"

           set startTime to current date
           repeat until exists (text field 1 of window "App2" of application process "App2")
               if (current date) - startTime is greater than 5 then
                   error "Could not find text field 1 of window AppB of application process App2"
                   exit repeat
               end if
               delay 0.2
           end repeat
           tell application process "App2"
               try
                   set value of text field 1 of window "App2" to beam
               end try
           end tell
       end tell
       --tell application "App1" to activate
       set previousText to beam
   end if
   -- Request the next 'idle' event in 'checkInterval' seconds' time.
     return checkInterval
   else if (App1WasOpen) then
   -- App1 was open at the last check, but isn't now. Tell this script applet to quit.
   quit
   -- It'll actually quit on the next idle event, so request a short interval.
   return 1
 end if
end idle

-- Unless GUI Scripting was already on when the script started to run, turn it on or off as per the parameter.
on switchGUIScripting(onOff) -- 'onOff' is 'true' for on, 'false' for off.
if (not GUIScriptingWasEnabled) then
   tell application "System Events"
       activate
       set UI elements enabled to (onOff)
   end tell
end if
end switchGUIScripting

-- When this applet's told to quit, restore the previous GUI Scripting state before it does.
on quit
   switchGUIScripting(false)
   continue quit
end quit

Followup:
I used "Show in Finder" on the app's icon in the dock to point me to 17 Xcode archives, which I deleted. Now the script has a recurring message of "An error of type -10660 has occurred", and App2 never opens.
I opened the script editor, copied the code to a new script window and compiled it with a different name. Still doesn't open App2.
Comment: Have you tried `mdfind -name App2`?
Comment: Interesting - That finds a couple in the Xcode output .dsyms and one in sent email, but not in applications or documents. I'm going to edit the OP to tell what's been done and the results.
Answer: Try finding the Applications id with:
set appID to get id of application "/Applications/Safari.app"

Once you have found it, refer to the id rather than
tell application id "com.apple.Safari" to launch


How to identify timezone from longitude and latitude in iOS

Question: How can I find out which NSTimeZone a given longitude and latitude fall in?
Answer: I have tried APTimeZones library. In my case I needed Timezone as well as country name from the lat long of a particular city.
 I went through the library to know how it works. It actually has a file in JSON format which has all the timezones along with their corresponding lat longs. it takes the lat long as input and loops through this JSON file comparing the distances of all the timezone's lat long from the input lat long. It returns the time zone which has shortest distance from the input lat long.
But the problem was for a city in the border of a big country, it returned me the timezone of neighbouring country, as I also extracted the country code from it, I got the neighbouring country.
So Apple's native framework is far good in this case.
And the below code worked for me well.
CLLocation *location = [[CLLocation alloc] initWithLatitude:your_latitude longitude:your_longitude];
CLGeocoder *geoCoder = [[CLGeocoder alloc]init];
[geoCoder reverseGeocodeLocation: location completionHandler:^(NSArray *placemarks, NSError *error)
{
CLPlacemark *placemark = [placemarks objectAtIndex:0];
NSLog(@"Timezone -%@",placemark.timeZone);

//And to get country name simply.
NSLog(@"Country -%@",placemark.country);

}];

In Swift
let location = CLLocation(latitude: your_latitude, longitude: your_longitude)
let geoCoder = CLGeocoder()
geoCoder.reverseGeocodeLocation(location) { (placemarks, err) in
     if let placemark = placemarks?[0] {
          print(placemark.timeZone)
          print(placemark.country)
     }
}

Comment: This is the most elegant solution without a 3rd party library! I can't believe there's a timeZone property on a CLPlacemark :)
Comment: since ios11, macOS10.13 it is public framework, no need to look at other solutions
Answer: Here is the trick that worked for me. From which timezone identifier can be extracted and you can use this id for timezone.
CLLocation *location = [[CLLocation alloc] initWithLatitude:latitude longitude:longitude];

[geoCoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) {

    if (error == nil && [placemarks count] > 0) {

        placeMark = [placemarks lastObject];
         NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"identifier = \"[a-z]*\\/[a-z]*_*[a-z]*\"" options:NSRegularExpressionCaseInsensitive error:NULL];
        NSTextCheckingResult *newSearchString = [regex firstMatchInString:[placeMark description] options:0 range:NSMakeRange(0, [placeMark.description length])];
        NSString *substr = [placeMark.description substringWithRange:newSearchString.range];
        NSLog(@"timezone id %@",substr);

    }];

Comment: since ios11, macOS10.13 it is public
Comment: Yes this is apple's private framework, but if you get it from native framework then it is best rather than using third party library.
Comment: The chances of this breaking in an iOS update is very likely
Comment: This displays the user's time and timezone, not that of the location. iOS 13.4
Answer: I have ported the DarkSky's timezone code to Swift, it uses accurate timezone shapes to generate a simplified database of timezones allowing for fast lookup and small size. APTimeZones is lacking as it's only looking for timezone which has the closest centre.
https://github.com/bialylis/tz-lookup-oss
Answer: I created an another library to resolve coordinates to timezones and countries. https://github.com/patrick-zippenfenig/SwiftTimeZoneLookup
The timezone database is embedded as a bundle (~5 MB). I just updated it the latest release 2023b from timezone-boundary-builder
Usage:
import SwiftTimeZoneLookup

let database = try SwiftTimeZoneLookup()
guard let timezone = database.simple(latitude: 47.5, longitude: 8.6) else {
  fatalError("Timezone not found, coordinates invalid?")
}
print(timezone) // "Europe/Zurich"

guard let lookup = database.lookup(latitude: 47.5, longitude: 8.6) else {
  fatalError("Timezone not found, coordinates invalid?")
}
print(lookup) // SwiftTimeZoneLookupResult(timezone: "Europe/Zurich", countryName: Optional("Switzerland"), countryAlpha2: Optional("CH"))

Answer: You can use Core Location to do it in Swift, however, it requires the user to be online and runs asynchronously.
import CoreLocation

func timeZone(forLatitude latitude: CLLocationDegrees, longitude: CLLocationDegrees, completion: @escaping (TimeZone?) -> Void) {
    let location = CLLocation(latitude: latitude, longitude: longitude)
    let geocoder = CLGeocoder()

    geocoder.reverseGeocodeLocation(location) { placemarks, error in
        if let error = error {
            print("Error reverse geocoding location: \(error.localizedDescription)")
            completion(nil)
        } else if let placemark = placemarks?.first {
            completion(placemark.timeZone)
        } else {
            print("No placemark data found.")
            completion(nil)
        }
    }
}


Finite Order Automorphisms on Complex Simple Lie Algebras

Question: Let $L$ be a finite dimensional complex simple Lie algebra, and
let $F(L)$ be the set of all finite order automorphisms on $L$.
Suppose that we declare $f,h \in F(L)$ to be equivalent if there exists
an $L$-automorphism $\phi$ such that $f = \phi h \phi^{-1}$.
Then the resulting equivalence classes of $F(L)$ have been classified
by Kac.
Now let us impose a stronger equivalence relation, by requiring
the above $\phi$ to be inner (thus $L$ is of type $A$, $D$ or $E_6$).
How are such equivalence classes of $F(L)$
(with respect to this stronger equivalence relation) classified?
Comment: @Sunny: The question is well-formulated, but is there any motivation for it?  (Is there any connection with the tag rt?    It might also help to give a reference or two to the literature.)
Comment: @ Humphreys: Thank you very much for your comments.
Two references are: Kac, "Infinite Dimensional Lie Algebras" (Chap. X-5)
and Helgason, "Differential Geometry, Lie Groups and Symmetric Spaces"
(around page 500).
The motivation of Kac is the construction of a $Z_m$-grading on $L$
(also as adjoint $L$-representation) to further construct the
Kac-Moody Lie algebras. I don't know whether distinguishing finite order
automorphisms which are conjugate by $L$-automorphism but not
conjugate by inner $L$-automorphism will bring significance
to Kac's construction.

--sunny
Answer: The periodic inner automorphisms are, as you say, classified by Kac diagrams, that is, copies of the affine Dynkin diagram with non-negative weights attached to each vertex. More specifically, given a Kac diagram we construct an inner automorphism of $L$; and every inner automorphism of $L$ is conjugate to one of these automorphisms. (The outer automorphisms are classified via different diagrams, but the question you ask isn't an issue there except in type $D_4$.)
Let's look at the $E_6$ case, since this is easiest to explain what's happening. The affine Dynkin diagram has $S_3$-symmetry since there are three branches of length two emanating from the central vertex. Two Kac diagrams determine conjugate automorphisms in $Aut\; L$ if and only if each diagram can be obtained from the other via a symmetry of the affine Dynkin diagram. But conjugacy in the inner automorphism group holds if and only if each Kac diagram can be obtained from the other via a cyclic permutation of the three branches.
Something similar happens in types $A_n$ and $D_n$ where we also have outer automorphisms. The affine Dynkin diagram in type $A_n$ is a circle (or rather an $(n+1)$-gon), and so the group of symmetries of the diagram is a dihedral group, consisting of rotations and reflections; then two Kac diagrams give us conjugate automorphisms in the inner automorphism group if and only if they can be obtained from each other via rotations.
In type $D_n$ for $n\geq 5$ the affine Dynkin diagram has two forks at either end, and inner conjugacy corresponds - I think - to symmetries of the affine Dynkin diagram which induce even permutations of the four outer vertices. (In other words, we can reflect in the central line of symmetry, or we can flip the forks at both ends, but we can't flip just one fork.) In type $D_4$ the symmetry group of the affine Dynkin diagram is $S_4$, and the outer automorphism group (i.e. $Aut\; L/Int\; L$) is $S_3$, so you can guess which symmetries of the affine Dynkin diagram correspond to inner conjugacy: the permutations $(1\; 2)(3\; 4)$, $(1\; 3)(2\; 4)$ and $(1\; 4)(2\; 3)$.
Finally, the case usually denoted $^{2}D_4$ (i.e. outer automorphisms of $\mathfrak{so}_8$ whose square is inner) is quite complicated. There are no symmetries of the (twisted) affine Dynkin diagram here, but each conjugacy class of these automorphisms in $Aut\; L$ splits into three conjugacy classes for the inner automorphism group. And similarly, each conjugacy class of automorphisms of type $^3D_4$ splits into two conjugacy classes for the inner automorphism group.
Comment: (sorry the "add comment" button does not work
so I write my response here) @ Paul Levy: Thank you very much for your comments. I assume you use Cartan subalgebra and the resulting action on the roots $\Delta$. But I do not see one direction of the proof. Take $A_n$ for example, and consider the affine Dynkin diagram $D$ which is a $(n+1)$-gon. Choose a Cartan subalgebra and a simple system so that the vertices of $D$ represent the simple and lowest roots. Let $f, h \in F(L)$ be represented by non-negative integers on the vertices of the $(n+1)$-gon (i.e. Kac diagrams). If the two Kac diagrams
Comment: ... are related by a rotation on $D$, then as you say $f$ and $h$ are conjugate by inner automorphism,
because the rotation on $D$ is the restriction of an inner $L$-automorphism to the Cartan. But I do not see an easy proof for the converse (though I also think the converse is true): Suppose that the Kac diagrams of $f$ and $h$ are related by a reflection on $D$ and not a rotation on $D$. We look for $\phi$ so that $f = \phi h \phi^{-1}$. Indeed the obvious $\phi$ given by reflection on $D$ is an outer $L$-automorphism. But how do we know there is no other choice of $\phi$ whose restriction
Comment: ... to $\Delta$ lies inside the Weyl group (i.e. it is not reflection on $D$), and which brings the Kac diagram of $f$ to Kac diagram of $h$? Such $\phi$ will be inner.
Comment: In type $A_n$ we know that every outer automorphism is $\gamma\circ\sigma$ for some inner $\sigma$, where $\gamma$ is a graph involution. So it isn't possible for an outer automorphism of $L$ to restrict to an element of the Weyl group on $\Delta$. Another way of thinking of it is that an outer automorphism can only act as $-w$ on a Cartan subalgebra (and there's no way $-w$ can equal $w'$ for $w,w'\in W$).
Answer: A comment and a technical point (too long to post as a comment).
The classification of automorphisms up to inner automorphism, rather than outer, is in fact quite important in the study of real forms of complex groups. For one thing, an outer automorphism of the Lie algebra may fail to exponentiate to the group (if it is not simply connected or adjoint). Consequently the fixed points of two such automorphisms may not be isomorphic, and it is necessary to distinguish these groups. For example in $\mathfrak s\mathfrak o(12,\mathbb C)$ there are two subalgebras isomorphic to $\mathfrak g\mathfrak l(n,\mathbb C)$ which are conjugate by an outer (but not an inner) automorphism. If $G=Spin(12,\mathbb C)/\langle z\rangle$ where $z^2=1$ but $z$ is not fixed by the outer automorphism, then $G$ has two non-isomorphic subgroups locally isomorphic to $GL(6,\mathbb C)$: one is $GL(6,\mathbb C)$, and the other is disconnected.
Another point is that the correct formulation of Vogan duality requires this distinction, in the first place to make some counting come out right. For example if $G(\mathbb C)$ is adjoint of rank $n$, the total number of discrete series representations of all real forms of $G(\mathbb C)$ (with fixed infinitesimal character) is $2^n$. For $PSO(2n,\mathbb C)$ this requires counting $PSO^*(2n)$ twice (these two subroups are related by an outer, but not an inner, automorphism).
Here is a technical correction on the automorphisms of the extended diagram. The center $Z(G_{sc})$ of the simply connected group acts on the extended Dynkin diagram. Automorphisms of $\mathfrak g$, up to inner automorphism, are parametrized by labellings, modulo the action of $Z(G_{sc})$. This only matters in $D_n$: $Z(G_{sc})$ is $\mathbb Z/2\times\mathbb Z/2$ ($n$ even) or $\mathbb Z/4$ ($n$ odd). Consequently all $GL(n,\mathbb C)$ subgroups are conjugate if $n$ is odd, but not if $n$ is even. (For classification up to $Aut(\mathfrak g)$ also throw in automorphisms of the non-extended diagram).
Answer: It may be worth adding (belatedly) that the subgroup of affine diagram automorphisms mapping to Inn(L) has a natural description. Namely, the (co)weight lattice acts by translation on the affine root system. Since the affine Weyl group contains the (co)root lattice acting by translations, the quotient group acts on the affine diagram. As is well known, this quotient is isomorphic to the center Z of the simply connected group of L. In this way, the automorphism group of the affine diagram is an extension of Out(L), the automorphism group of the Dynkin diagram, by Z.


How can I set window type hints on a ClutterStage?

Question: Is there any way to make a standalone ClutterStage use TYPE_HINT_DOCK (and be borderless), with python? Perhaps by manipulating the window with Xlib?
Answer: I also strongly suggest to use clutter-gtk. It's python bindings have not been removed from Ubuntu.
However, clutter is now using gobject introspection for it's python bindings instead of generating them (simple example).
The new package name in Ubuntu is now gir1.2-clutter-gtk-0.10 instead of python-clutter-something. You can get an overview of other clutter based bindings with apt-cache search clutter gir.
This also means that nearly every gnome project now has python bindings, just do apt-cache search gir1.
Comment: clutter-gtk has been removed in 12.04, I believe. Also, I use ArchLinux, not Ubuntu, and I have found clutter **incredibly** unstable when used through GI, sadly.
Answer: yes, you need to retrieve the Stage XID and set the hints manually.
alternatively, you could use Clutter-Gtk, and the Gdk API, instead of using Xlib directly.
Comment: Could you explain how? I'm getting a bit lost in Xlib's documentation.
Comment: you'll need to change the _XA_MOTIF_WM_HINTS property on the stage window, following the ICCCM and the EWMH specifications. it's pretty boring Xlib stuff, so my suggestion is to use clutter-gtk if at all possible.
Comment: I am trying to get rid of the cluttergtk dependencies if at all possible, since Ubuntu no longer provides this in the default repos. (and that's where most of the linux users are these days...). Also, the problem I'm having right now is actually acquiring the Window object from Xlib.
Comment: @crazedpsyc: You should be able to retrieve XLib Window with `clutter_x11_get_stage_window ()` and then add hints to it using XLib calls.


Meaning of a seal

Question:
Could you tell me the meaning of this seal? I got it as a present from China but I don't know what it means...
Comment: The character 瓦 is a family name  and 尼亚 is a given one so its safe to assume its a name seal.  Typical name seals would also contain an additional character 印 signifying that it was a name seal.
Answer: This is probably a transliteration of a non-Chinese name. 瓦尼亚 rendered in Pinyin romanization is wǎ ní yà. Unless a set of characters was provided to the person who carved the seal, that is how the carver decided to transliterate your username (and personal name?), Anja.
Comment: Thanks @Anja. If you like my answer, please mark it as the accepted answer!

Meaning of a seal


Cannot load nib/xib file in Mavericks

Question: We have a Mac application we wrote about 3 years ago. We've been maintaining it through all versions of OS X since Leopard (10.5). It's a 32 bit universal binary and is part of a suite of packages, all compiled and built the same way.
All apps are working under Mavericks except one, and only one part of it is broken. In this "broken" app we have a menu option that allows the user to open up a simple logging window. All this thing is is an NSPanel with a text view in it. When we open it, the spinning beach ball comes up and observing the console, it identifies this program as "hung."
This thing has been working for years. It works on both PPC and Intel from Leopard up through Mountain Lion. I thought for sure there was deprecated code in it somewhere, but I went through it and couldn't find any. There's really not much to it anyway. All it does is open up and spit out text. I then traced through the code and found out the nib wasn't loading.
I have Xcode 3.2.5 installed on this system (it's been upgraded since Snow Leopard) without iPhone support and it seems to work. In any case, I thought I'd take a look at the actual contents and window layout to see if maybe I had some unsupported or dated support, and when I double click on the xib file from Xcode, when Interface Builder opens up, it locks up too. We have I think 5 xib files in this application, so I double clicked on all of them and they all open up properly in Interface Builder. The only one locking up is this one. As a test, I opened the xib up in Xcode 4 and it opened up properly.
We can't really move to Xcode 4 because we have a fair number of clients (about 30%) still using Leopard and Snow  Leopard. We typically build in either Lion or Snow Leopard. but haven't had any problems compiling and building under Mountain Lion. This app, and all the other we have will compile and build using Xcode 3.2.5 on the Mavericks system. Everything seems to work except this one xib file.
Has anyone ever encountered something like this? Are we overlooking something? Are there changes to the OS we've overlooked? Is this an OS bug?
Answer: If you use Retrospect backup, check whether the NIB files have been caught in a backup on the server.
I have recently found several applications which Retrospect cannot handle backing up the NIB files and does not let go of the NIB files until after the backup job has been stopped.

Cannot load nib/xib file in Mavericks


How to automatically broadcast local server name?

Question: When setting casual LAN Minecraft gaming, I'd find it would be easier and more user friendly if LAN clients just see the local Minecraft server automatically in the Multiplayer screen instead of typing in the IP. Can this be accomplished?
Answer: I found this Python script - "Advertising Linux Minecraft Servers to the LAN" that worked well for me:

My 5 year old son is really in to playing Minecraft at the moment and
  always wants me to play with him.  I set up a couple of Minecraft
  servers on a Linux machine on my local network so that any of us could
  hop in and out from any computer.  Annoyingly I found that the server
  for Linux does not broadcast its whereabouts to the LAN, so I had to
  manually enter the address and ports of the servers on every client.
Well that seemed unnecessary so I opened up Wireshark to see how the
  Windows and Mac clients announce their LAN games and came up with the
  following script.  I decided to use Python simply because it was
  pre-installed on my Linux box and I didn't want to install another
  language such as PHP just to handle this simple job.  That said, I
  don't know Python very well.
I run this script in a screen session on the Linux server.  It
  announces the Minecraft servers to the LAN every 1.5 seconds using a
  UDP broadcast to the subnet.  The clients always assume that the
  source IP of the broadcast is also the IP address of the Minecraft
  server, so this script must be run on the same box that is hosting the
  Minecraft servers.  In other words, you can't use this script to
  announce the whereabouts of a Minecraft server on a different machine.
  I believe that's a protocol change to previous versions where this was
  indeed possible.  At the time of writing, the current Minecraft
  version is 1.8.
You can add as many servers are you like to the servers array.  The
  array contains arrays consisting of the server description and the
  port number.

import socket
import time

servers = [
        ["Local Network - Survival Map", 25565],
        ["Local Network - Creative Playground", 25566]
]

BROADCAST_IP = "255.255.255.255"
BROADCAST_PORT = 4445

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)

print "Broadcasting Minecraft servers to LAN"

while 1:
        for server in servers:
                msg = "[MOTD]%s[/MOTD][AD]%d[/AD]" % (server[0], server[1])
                sock.sendto(msg, (BROADCAST_IP, BROADCAST_PORT))
        time.sleep(1.5)

Answer: If you're using Bukkit to run your server, I'd suggest getting the LANBroadcaster plugin.
If you're running a Vanilla server, there's no option to do so. (Try /broadcast maybe?)
If you're running a LAN game through the actual game (Pause menu > "Open to LAN", or /broadcast), it should appear on their multiplayer lists.*
*If it doesn't appear, something may be wrong with your network, or their (the people trying to connect to you)'s network discovery. In that case: They'll need to tweak their firewall settings.
Answer: Adding the script from @Buckshee's answer converted to Python 3 as it's already 2024:
import socket
import time

servers = [
        ["Local Network - Zima i Fajna jaskinia", 25565],
        ["Local Network - Creative Playground", 25566]
]

BROADCAST_IP = "255.255.255.255"
BROADCAST_PORT = 4445

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)

print("Broadcasting Minecraft servers to LAN")

while 1:
        for server in servers:
                msg = "[MOTD]%s[/MOTD][AD]%d[/AD]" % (server[0], server[1])
                sock.sendto(msg.encode('UTF-8'), (BROADCAST_IP, BROADCAST_PORT))
        time.sleep(1.5)


Please help me get rid of asmonitor.exe

Question: It might be silly and I trully apologize if the question is not apropriate here, but I have really tried and got to nowhere. I have a windows xp startup error which indicates something about asmonitor.exe program from the ActualSpy keylogger. I had installed but removed ActualSpy keylogger using Superantispyware or something close. I have searched the registries and found a asmonitor entry deleted. I looked at startup programs and can not find the asmonitor program. In addition, I searched the c: drive using regular explorer search and searched using ESET NOD32 antivirus. In each case I cannot find the application...
I have even looked at startup programs using msinfo32 command.
msconfig->startup
NOTHING! it drives me crazy! I can't get rid of it. it is still showing up at windows startup!
Where do I find this little program? where is it located? I don't want it to keep showing up. I don't want programs that can do it.. or maybe free ones. But I prefer manual solutions. aren't are any?
Answer: It's probably still in the Run section of your registry. Start regedit and look in:
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce and
\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

There's probably an entry for asmonitor.exe in there, which you can remove.
If that's not it, then there's probably another program running that is adding asmonitor.exe back in again.
NOTE: The usual warnings about changing your registry directly apply - the registry is at the core of Windows and inadvertently changing the wrong thing can leave your application or Windows setup unusable
Comment: It might be helpful, for the sake of newer users, to specify what the 'usual warnings' are anyway...:)
Answer: For a manual solution, you should check the registry for the offending file itself, or check the "run-on-startup" locations for suspicious files (in case it's not launching directly from asmonitor.exe).  These can include:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\RunOnce

There may be more as well, depending on your system configuration.  I usually do a search for "RunOnce" and check all the keys that show up around each occurrence that it finds.
Personally, for changing the startup options, I prefer to use the Startup Control Panel program.  It's free, stand-alone (no installer necessary) and it checks all the main areas that a program could start from and allows you to disable or delete them.
You mentioned having already looked at MSConfig, but you can also double check if it is running as a service by launching Services.msc from the run window.  If it is there, you can set it to disabled to prevent it from running.
Comment: +1 when i'll be able to vote because I have searched the entire registry for asmonitor.exe and didn't found it, but I haven't thought about it running as a service, man.. k, I'll give it a try when I get home. thank you.
Comment: WEll did try all your advices but still no solution to the problem.
Comment: Which version of Windows are you running?
Comment: windows xp os version
Comment: The only other thing that comes to mind is to see if you have a legacy `AUTOEXEC.BAT` file that may be running it.  Perhaps you could do a text search of your hard drive for the `asmonitor.exe` to see if it is being launched by any other batch or script files.

Please help me get rid of asmonitor.exe


Young avocado plant moves to soil for a week and leaves are drying and pointing down

Question:
Hi guys, am looking for advice for my young avocado plant which has stop growing and leaves curling and pointing downward as in the picture. Moves it from water to soil a week ago and it doesn't get better. Thanks.
Answer: It's probably quite normal for a late transplant and will rapidly recover. Since it was germinated on water it has been living entirely from resources inside the seed; these have been depleted and the leaves are showing some signs of stress with veins prominent against lighter leaf surface. It now has to learn to pull nutrients from the soil through the roots. Provided the root was not damaged too much in the move to soil all should be well if the new soil is kept evenly moist but not wet. If the root was broken during the move then re-establishment can take longer.
Comment: Thanks for the advice.  The roots are in good condition. Probably water too much that the soil become wet and the roots has difficulty growing.
Comment: Mine did that as well, it hasn't recovered for about 2 months now. It is still 'healthy' but sad-looking though. Growing has stopped but I think it is because of lack of sun (Winter here now)


Gimp: Permanently disable layer boundary lines

Question: Trying to get used to Gimp coming from Photoshop. Making progress, but one thing I can't deal with is having that yellow dotted line around selected layers. I know that I can  turn them off in the View menu - but I have to do that for every new image. Is there a way to either completely disable the lines, or set a keyboard shortcut to toggle them off/on?
Thanks
Comment: Hi. Welcome to GDSE. Maybe worthwhile noting that there is a reason GIMP has a layer boundary. If you disable it, then you won't be able to see where it is. This doesn't matter in Photoshop, as the layers are the same size as the canvas. This isn't always the case in GIMP where you can have layers that are smaller than the canvas. This can lead to all sorts of confusion/potential problems such as for example not being able to paint on pixels outside the layer boundary, and not knowing why.
Answer: To permanently disable layer boundaries from the File > Preferences menu chose Image Windows > Apearance to untick Show layer boundary. This then works on all newly created layers.

To toggle visibility of layer boundaries create a keyboard shortcut from Edit > Preferences > Interface. Select Configure Keyboard Shortcut and scroll down to the entry Show layer boundary. By default this entry is disabled. After selecting you can assign a not yet otherwise used keyboard shortcut by simply pressing it.
Comment: Looks like "Preferences" menu has been moved to under "Edit" top menu instead of "File".


Proof of Topologist Sine curve is not path connected .

Question: Topologist's sine curve is not path-connected Here I encounter Proof Of Topologist Sine curve is not path connected .But I had doubts in understanding that . $$ f(x) =\begin{cases}
\sin\left(\dfrac{1}{x}\right) & \mbox{if $0\lt x \lt 1$,}\\\
0 & \mbox{if $x=0$,}\end{cases}$$S is Range of f(x).I wanted to show that there exist no continous function  such that for any a,b$\in$S,$f(0)$=$a$,$f(1)$=$b$.It is apperenernt that a and b are 2 tupple elements .If $S=\{(0,0)\}\cup\{(x,\sin(1/x)):0<x<1\}$ and $g=(g_1,g_2):[0,1]\to S$ is a path with $g(0)=(0,0)$, then $g(t)=(0,0)$ for all $t$.  So we have to show that for any function there is no curve leaving (0,0) point .Any continuous function taking value $(0,0)$ must be single point constant function [Is this my interpretation is right ?].So On contrary Assume there exist continuous function which take value $(0,0)$ but also take other value .Here Jonas Meyer Sir claim that By continuity of $g_2$ function There exist $\delta$>0 such that $g_2(t)<1$ whenever $t<\delta $But How this is possible  Because $sin(\frac {1}{x}$) takes value [-1,1] for that condition .He also Obtained contradiction at the end using same argument .Where is I am Missing ? Any Help will be appreciated.
Comment: Thanks for Helping Me .Major confusion happen due to fact that I assumed $g_2(t)=sin(1/t)$ Now I understand that argument .
Comment: Actually you are using the same notation $f$ to denote $\sin (1/x)$ and the continuous function $[0,1]\to S$, which is quite confusing.
Comment: I had done changes accordingly .But Could you suggest something I had been with this problem For Yesterday?Still Not getting Sir
Answer: Recall an old fashion definition of continuity.
For all $\epsilon $ > 0, there is some $ \delta$ >0 with for all x,
in the domain of f,
$d(x,a)$ < $ \delta$ implies $ d(f(x),f(a)) $< $\epsilon $
Set $a $= 0, $\epsilon $ = 1 and get the claimed results.
In this case, the assumption of continuity leads to a
contradiction if the domain is a non-trivial interval.
Comment: Sir , I thought $f_2(x)$=$sin(1/x)$ and that function takes value 1 for many values in above setup.Where is I am missing?
Comment: @idon'tknow.  There is no f$_2$.
Answer: Actually, you want to show that there are two points in $S$ that cannot be connected by a continous function $f \colon [0,1] \to S$. Just observe that if $x=0$ and $y \in (0,1)$ the existence of a continous path from $(y,f(y))$ to $(x,f(x))$ should implie that $f$ has a limit on $x=0$, which from calculus you should know is not true. The essence of the statement is proving what I'm telling you.
Comment: Intuition is right But How to Prove that using $\epsilon -\delta$ definition that is my problem
Comment: If $t_0 \in [0,1]$ is such that $g_2(t_0)=0$ then, for continuity, $|g_2(t)|<1$ for $t$ sufficiently close to $t_0$. That only can happen if $g_2$ equals $0$ around $t_0$. Take the supremmum of the set of $t \in [0,1]$ such that $g_2(s)=0$ for all $s \in [0,t]$. The argument above shows that this supremmum equals $1$. So, as you say, the only continous path starting at $(0,0)$ must be constant.
Answer: In your question you stated that $S$ is the range of $f$. You meant to say let $S$ be the graph of the function $f$. It is best to simply think of $S$ as a well defined set and to think of the function $f$ as an artifact.
The following is not difficult to prove (c.f. Cantor's intersection theorem):
Proposition 1: Let $\gamma: [0,1] \to \mathbb R \times \mathbb R$ be any path and $\alpha_n$ a sequence of positive numbers that converge to $0$. For each $n$ set $A_n = \gamma(\,\left(0,\alpha_n\right]\,)$. Then the intersection (direct limit)  of the closures of the $A_n$ is a singleton,
$\tag 1 \bigcap \overline{A_n} = \{\,\gamma(0)\,\}$
To show that $S$ is not path connected, it suffices to show that there is no path connecting $(0,0) \in S$ to a different point in $S$.
In what follows we make use of $\pi_x$, the projection mapping onto the $x\text{-axis}$.
To get a contradiction, if such a path exists, we can construct another path connecting the same endpoints satisfying
$\tag 2 \gamma(0) = (0,0) \text{ and for } t \gt 0, \;(\pi_x \circ \gamma)\,(t) \gt 0$
(see Jonas Meyer's argument).
Exercise 1: Show that for any $0 \lt \delta \le 1$, the range of $\pi_x \circ \gamma$ applied to the interval $(0,\delta]$ contains the interval $(0, \delta^{'}]$ where $\delta^{'} = \pi_x \circ \gamma(\delta)$.
Hint: The range of any path is connected.
Exercise 2: Show that the positive numbers $\alpha_n = (\pi_x \circ \gamma)\,(\frac{1}{n})$ converge to zero.
Exercise 3: Show that the LHS of (1) contains the two points $(0,0)$ and $(0,1)$.
But upon completing exercise 3, you find that $\text{(1)}$ is false, a contradiction.

The above is essentially the same solution that Jonas Meyer provides, but with a more elaborate and step-by-step exposition.


Does a soul retain it's identity after Moksha?

Question: I know my question is counterintuitive since the entire idea of Moksha is merging with the Supreme.
Comment: There are five kinds of Moksha. In that Kaivalya Moksha is the Moksha where individuality is dissolved into Supreme. In other forms of Moksha identity do exist in world of Brahma.
Comment: Your question has two components.  Moksha and recollect of past lives. Header and body of content is not same. Please clarify your question
Comment: Jivatma can recollect past lives yes. But what is your question? You are asking if jiva retains identity in title and asking about past lives in body of content.
Comment: According to advaita, yes and no. there are 2 schools as to when. One school says immediately upon death final liberation is attained and your 'soul' (jiva is a better description) is merged and loses it's idenity, the other school says at the end of the present kalpa, so your 'identity' as an individual jiva would retain until then. In either case, your individual identity ceases upon final liberation.
Answer: A good question.
The answer is yes.
Fate of the Liberated soul

Except over-lordship (on the world), they become equal to Brahma in
affluence, glory, form (appearance) and objects.

Vayu Purana I.7.29
The liberated Jiva does not get the power to create, preserve and destroy the universe. Those powers are reserved for Brahma, Vishnu and Siva. They certainly get all other powers including omniscience.


How to enable hotspot button on Samsung S23?

Question: I recently switched to a Samsung S23, Android version 13.
It seems that in the quick setting buttons (when you swipe down), the button "Hotspot" is missing, which toggles whether the phone provides a wi-fi hotspot for other devices.
There are some online articles discussing that this setting might be disabled based on your provider. I have bought the phone independently from a provider.
I tried this workaround described by XDA Developers which uses adb to add MobileData and Hotspot to the sysui_qs_tiles list. However, that does not seem to have an effect, the desired button does not show up.
Any suggestions of what I might try?
Answer: To my knowledge, the provider controls this, I  assume via the Sim. if your plan does not offer hotspots, then you cant enable it.


Bower dependency watcher

Question: I've heard of David, which watches the Node.js dependencies of a project and gives you a badge that you can embed on any GitHub page. Does anyone know of a similar watcher for Bower? It should also provide a similar badge.
Comment: [libraries.io](https://libraries.io/) is another to check out but I don't believe that it provides badges
Answer: I would have a look at an application called Gemnasium. It supports quite a few languages including Bower and Node.js. It parses your project's dependencies and notifies you when new versions are released or they need to be updated. It also provides you with badges and has a guide on how to incorporate them into your GitHub page. It has free & paid plans that you can use as well.
Gemnasium (freemium)

Gemnasium monitors your Ruby / PHP / Node.js / Javascript / Bower / Python project dependencies and alerts you about updates and security vulnerabilities. Your project might be using a dangerous dependency, we will notify you as soon as advisories are public and affect your projects.
With Gemnasium, start reducing your technical debt today, and keep your project in shape!
Answer: There is also VersionEye. It too supports quite a few languages including Node.js and Bower. It also has dependency badges with a guide on how to incorporate them. Note that this does not have a free plan to use.
VersionEye (commercial)

VersionEye notifies you about outdated dependencies in your software projects. Nowadays software projects are based on many open source and self developed components. Checking manually for updates for these components is a very time consuming task and not fun at all! VersionEye notifies software developers about outdated dependencies in their projects. That way they can save a lot of time and focus on development.

Bower dependency watcher


Duplicate data for SVM

Question: Can we use duplicate data as an input to SVM? The duplicate data that I mean is, let say we have 50 of same data (maybe being duplicate) from total of 100 data. Will this kind of data effect the performance result that we obtained from SVM? Do we have to avoid any duplicate data for SVM?
Answer: You can, yes as long as the repeated data has the same label there will be no problem. It is not ideal though. The performance will be lower than if you trained with a more diverse dataset of the same size, and just as good as if you dropped the duplicates and trained.
Comment: ,thank you for your comment.
Yes, the replicate data will become a problem when it was labeled with wrong label.  I have search again the information about replicate data after read your comment.  Thanks again for your explanation. :)

Duplicate data for SVM


Changing motorcycle oil

Question: How do I change the oil on my motorcycle? I can see where to check the level, but how do I drain it? It's a Honda CB400 2011 model
Comment: you need to be a little more specific: what type of motorcycle are you asking about?
Answer: The bottom of the oil pan
All of the CB series of motorcycles use a wet sump lubrication system and have an oil pan.
On your model specifically it is in the center of the oil pain and just a bit obstructed by the exhaust pipes.  You will need an extension and a 17mm socket to get to the drain bolt.
The drain bolt has a magnet, so you can check to see if there is any metal on magnet when you change the oil.  A sign there may be issues if you do.
Torque Speck for Drain Bolt
45Nm, or 33ft-lbs.
Answer:
If you cannot find it anywhere, look at the bottom of the engine. Remember, drain plug is usually at the lowest point of the pan. Look for a hexagonal bolt, and it should be it. Ensure to not confuse it with you transmission though.

Changing motorcycle oil


Patterns to allow for versatile data-flow hooks in Javascript

Question: I have an application where I'd like to add ways for external modules/components to hook during the processes and data-flow and perform actions/modify data.
For the first requirement—performing actions—I assume the best pattern would be to emit events and have other modules/components subscribe to those events and perform their actions, correct?
The second requirement is where it gets very tricky for me, I will try to explain it with an example:
someObject = {
    ... // properties and stuff
    performComputation: function() {
       let data = this.data;

       return this.x * data.amount;
    }
}

Now, I want a way to perform dynamic modifications on some value of that function, and maybe the return value. What I want to achieve is very similar to what WordPress does with filter hooks. WordPress maintains an array of callbacks to call in a certain order to allow for data manipulation. If I implement something similar, my code would look like this:
someObject = {
    ... // properties and stuff
    performComputation: function() {
       let data = applyFilters('computationData', this.data);

       return applyFilters('computationResult', this.x * data.amount);
    }
}

and I could then hook into that using an API which would look like this:
addFilter('computationResult', (res) => { return res * 2; });

This obviously works, but by the fact that I have never seen this pattern used in any JS library and the fact that with hours of research I didn't find anyone implementing a simple node module about that, I have the impression this might be an anti-pattern that I should avoid (I understand it can become messy and hard to debug, for example).
So, here are my questions:

What's this pattern called? Maybe I just don't know how to search for it.
Has this anything to do with Aspect Oriented Programming?
Would there be a better pattern approach that I am not thinking about that would fulfill my requirements? Specifically: (1) hooking into parts of the applications to manipulate data (2) hooks need to be added and removed fairly often during the user interaction with the application.

Edit
It seems that my goal is being misunderstood, so I'll try to explain it better. The Observable pattern or Event dispatching allows me to run code within the execution of another code. However, the reason why it is not enough for me is specifically because Observers don't return values that can be manipulated.
As for AOP, as pointed out by Candied Orange's answer, the target doesn't know it's being hooked on. Which is also not my goal.
My goal is for a function to expose certain pieces of data for other functions to hook on and manipulate.
Again, with another example pseudo-code:
someObject = {
    name: "Jim",
    greet: function(str) {
        let greeting = applyFilters('greeting', str);

        return `${greeting} I am ${name}.`;
    }
}

addFilter('greeting', (str) => { return str.toUppercase(); });
addFilter('greeting', (str) => { return str + "!!"; });

someObject.greet("Hello"); // => HELLO!! I am Jim.

This is the kind of functionality I need, and it can be easily implemented with iterating over callbacks as I mentioned, but I am not sure if this is in any way a good pattern or if I have alternatives to achieve this goal.
Answer: I've written software before that uses the approach you describe from wordpress (interestingly, the software I was working on when I independently came up with the idea was also a PHP CMS system... I wonder if there's something about the requirements of that kind of system that pushes you towards the solution more there than in other environmnents?).  I've also worked in environments that use Aspect Oriented Programming heavily (e.g. the Spring framework for Java), and can see that the two are definitely very similar.  The wordpress plugin filter approach is essentially equivalent to a manually-implemented post execution pointcut in AOP.
Both are very flexible, easy-to-use ways of introducing customisation potential to your code.  But it's very easy to get confused by how the system works -- make sure you keep very careful track of how each feature builds on others  and what filters it uses, because you can get unexpected interactions between modules and tracking them down without documentation of what modifies which result can be tricky.
The only other advice would be that if you want to use an AOP approach, why do it manually?  There are javascript-based implementations of AOP (e.g. this one), and using one of them could allow you to reduce the replication that you'll inevitably end up with for building and managing your list of hooks and calling it everywhere you need.
Answer: Hooking, or creating hooks is causing a change the behavoir of software by modifing it's binary code.  The target program doesn't even need to be designed to allow this.   Where the program used to perform one operation at this location you change it to perform another.  That's a hook.
Where this gets confusing is when you start applying this term to source code that does the same thing.  A virtual table in c++ is meant to be modified so that calls to abstract functions/methods can be polymorphically dispatched to different concrete functions/methods.  Is that a hook?  Well yes, kinda, but it's the linker that's doing the hooking, not the source code that asked for the virtual table.
But the world of programming is wild and wooly so don't expect everyone to have as narrow a view of what hooks really are as I do.  When someone describes the methods in a strategy pattern as hooks I don't correct them.  I just move on.
So when you say you want an array of callbacks I'll grudgingly acknowledge that looping through this set of 'hooks' is equivalent to an object oriented pattern called observer.  This is what an event really is.  Using this pattern it doesn't mean matter if data is modified on a different thread then the observers (the 'hooks').
Of everything you've mentioned Aspect Oriented Programming (AOP) is the closest to true hooks.  The target of AOP doesn't need to have any idea that AOP is being used on it.  Unlike inheritance, composition, dependency injection, or even setters and getters, the target of AOP doesn't have to be designed to accept hooks.
However, you're working in javascript.  I should warn you that much of what your tossing around comes from the world of java and object oriented programming.
In the javascript world you have better access to functional programming.  With functional programming many design patterns simply aren't needed.  I'd recommend you look into functional reactive programming.  It solves many of the same problems with events but should be more natural in javascript then trying to map object oriented solutions into somewhere they aren't really needed.
Comment: Thanks for clarifying and forgive me if I used an incorrect terminology. As you said, however, the term _hook_ is used in a variety of ways _de facto_, and I decided to use this word just because the way WordPress (and other CMSes) use it, it's basically my goal. I think I might have incorrectly explained my goal. Instead of adding on a comment, I'd be grateful if you'd check out my Question Edit.
Answer: One of the best articles I've read on this subject is by Ebay, here:
http://www.ebaytechblog.com/2014/10/02/dont-build-pages-build-modules/
They describe how they'll use jQuery as an event dispatcher to communicate between discrete modules.  But they also suggest an alternative would be to use a dedicated event mediator to coordinate the events of all the different components.
Of course modern frameworks like Angular and React/ Redux have somewhat opinionated but tried and tested ways to have communication between between parts of your software.  I would spend a lot of time investigating all of the modern JavaScript frameworks, SO MUCH has changed recently.
Comment: Thanks for the answer, it was a nice read; however, this deals mostly with the first part of my question: event-systems as hooks. The thing with events is that the code that triggers them rightly doesn't care of who is subscribed; as such, events don't return values that can be passed around and manipulated. In my case, I need a way for other parts of the components to "filter" around specific data _exposed_ by a specific component. As far as I know, this is specifically not allowed inRedux for good reasons. That's why I was also asking for an alternative, since this may be an anti-pattern.


Can't download apps on my iPhone

Question: So I have an iPhone 4s and it has the new updates, but the apps stopped working. When I clicked on the app it flashed on the screen but then went back to home screen. I deleted the apps and tried to download them again but when I click the download button it goes to the square in a circle for one or two seconds then goes back to the download logo. I don't want to reset my phone but I don't know what to do. Other than that, my phone is perfect and it's not slow and never freezes.
Comment: Anyways I remember on my iPhone 4S (iOS 7.1) I was having similar problems, not exactly but similar. What you might want to try is syncing your phone over iTunes, download that app to iTunes and have it install to your phone there.
Comment: Are you on the latest iOS version?  There was a problem with these symptoms on 9.3.1.
Comment: I think this question requires a little clarification. What version of iOS are you running? When did you start noticing the problem? What app or apps specifically are having that problem? What are you referring to specifically by "it has the new updates"?
Answer: It's because iPhone 4 can't be updated to the latest iOS while most of apps require later iOS than the latest iOS iPhone 4 can be updated. You shouldn't have updated the apps before updating the iOS.
Comment: They are running an iPhone 4S, not an iPhone 4. It does support iOS 9, though it is slow and not a good phone to keep on using.

Can't download apps on my iPhone


Where can I learn cryptography/cryptanalysis the hard way, without going to school ? Any good book?

Question: I'm not so bad at mathematics:
I know what are p-list and p-combinations, I know matrix algebra, I know what a XOR is, I know how to tell if number is a prime, etc: I'm not the programmer who hates math because he is bad at it, but I don't have a PhD eitherway.
I'm not bad a computer sciences either, well at least in term of general computer science culture:
I know C, C++ (both learned at school), python, some haskell,  what text encoding are out there, how UNICODE works, I know how a file can be compressed or encrypted, what common algorithms are out there (diffie-hellman, the LZMA algorithm, DES, AES, Serpent, Blowfish, SHA, MD5...). I got a lot interested in cryptography on wikipedia or other websites, but I don't think wikipedia can teach me cryptography without detailing algorithms or without practice; for example I know what is synchronous cryptography and what is asynchronous (public/private key).
I'd like to learn how to properly and securely implement the most popular algorithms, and how to make them reliable: a book or good tutorials or courses. I've quickly searched on Khan Academy, but this subject is not trivial and requires both knowledge in math, computer sciences and/or electronics.
I don't want to read pages and pages of just theory about the basic things I might already know or might be not really relevant to today's cryptography, like a paper written by a researcher, just something practical, with problems, and cryptanalysis problems, for students.
I have currently much free time, I'm only 26, and I'm sure I can learn this stuff, not only for the pay increase it can bring me but also because I've always been fascinated by cryptography without actually understanding it, I just can't find any good material.
Comment: Are you talking about learning the *theory*, how algorithms are defined, etc, OR how to implement practical solutions? These are almost mutually exclusive, for most situations.
Comment: Do you learn best by reading or doing? That will make a difference.
Comment: more by reading, but also by doing, I mean cryptography is meaningless without cryptanalysis.
Comment: @jokoon, See https://www.schneier.com/crypto-gram-9910.html . There are also many recommended reading resources in  https://www.schneier.com/paper-self-study.html
Answer: (LZMA is a compression algorithm, not cryptographic.)
For the purpose of implementing cryptographic algorithms, the generic method is getting the relevant descriptive standard, grabbing your keyboard, and trying. Most standards include "test vectors", i.e. sample values which let you know whether your implementation returns the correct answers. At that point, things differ, depending on what kind of algorithm you are considering.
Symmetric cryptography:
Symmetric algorithms cover symmetric encryption, hash functions, and message authentication codes (MAC). You do not need to know much mathematics to handle these; most of it is about additions of 32-bit and 64-bit integers (that's modular arithmetic, with 232 or 264 as modulus) and bitwise operations (XOR, AND...).
Such code is usually done in C. Good performance is achieved by having some notions on how the C compiler will understand and translate the code into instructions for the CPU; knowledge of assembly is not strictly mandatory, but quite useful. An important parameter is cache memory: loop unrolling is usually a good tool, but if you overdo it, performance drops sharply.
I suggest beginning by implementing the classical hash functions (the SHA family, described in FIPS 180-3) and trying to make them fast. As a comparison point, get OpenSSL and use the command-line tool openssl speed to see what kind of performance can be obtained (this tool is already included in any decent Linux distribution, and it works on Windows and MacOS too). For instance, on my PC:
$ openssl speed sha256
Doing sha256 for 3s on 16 size blocks: 4842590 sha256's in 3.00s
Doing sha256 for 3s on 64 size blocks: 2820288 sha256's in 2.99s
Doing sha256 for 3s on 256 size blocks: 1262067 sha256's in 2.99s
Doing sha256 for 3s on 1024 size blocks: 395563 sha256's in 3.00s
Doing sha256 for 3s on 8192 size blocks: 53564 sha256's in 3.00s
OpenSSL 0.9.8o 01 Jun 2010
built on: Wed Feb 23 00:47:27 UTC 2011
options:bn(64,64) md2(int) rc4(ptr,char) des(idx,cisc,16,int) aes(partial) blowfish(ptr2)
compiler: cc -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN
-DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DMD32_REG_T=int
-DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM
available timing options: TIMES TIMEB HZ=100 [sysconf value]
timing function used: times
The 'numbers' are in 1000s of bytes per second processed.
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes
sha256           25827.15k    60367.37k   108056.57k   135018.84k   146265.43k

which means that OpenSSL includes a SHA-256 implementation hand-optimized in assembly, which achieves 146 MB/s when processing 8 kB messages. On the same machine, a pure C implementation ought to get to at least 130 MB/s.
For an example of how hash functions are implemented in C and Java, and how hashing speed can be measured in a meaningful way, see sphlib.
Afterwards, you can try symmetric encryption, in particular the AES (FIPS 197). It helps a bit to know what a finite field of characteristic 2 is, but the standard is clear enough to guide you through a perfunctory implementation. Then, try to optimize things. OpenSSL can serve as a comparison point, and get inspiration from the AES implementations of Brian Gladman. As for security, there has been some concern about what key-dependent information could be leaked through use of look-up tables in the implementation (try to search for "AES cache timing attack"); trying to reproduce that kind of attack is a very good exercise (mind you, it is not easy, but if you succeed in demonstrating it in lab conditions then you will have learned a good deal on how cryptographic implementations work).
Asymmetric cryptography:
Asymmetric cryptography is about the algorithms which involve more than one party. This includes asymmetric encryption (RSA, ElGamal), key exchange (Diffie-Hellman) and digital signatures (RSA again, DSA...). The maths contents are much bigger there, and optimization is a much broader subject than for symmetric cryptography, because there are several ways to implement each algorithm, instead of a single "obvious" implementation path.
A good reference is the Guide to Elliptic Curve Cryptography. Although it is mainly about elliptic curves, it includes a general treatment of the implementation of operations in finite fields, and it so happens that this is the sample chapter which can be downloaded for free at the URL linked to above. So get it and read it now. Another indispensable reference is the Handbook of Applied Cryptography, which can be freely downloaded; chapter 14, in particular, is about efficient implementation.
RSA is simple enough, and is adequately described in PKCS#1. There are possible timing attacks on RSA, which are countered by masking (yes, this is a paper "written by a researcher", but in the subject of cryptography, researchers are the people who understand what is going on). If you get the hang of modular arithmetic, you can try to implement DSA (FIPS 186-3). Diffie-Hellman is mathematically simple (it needs nothing more than is needed to implement DSA) but its describing standard (ANSI X9.42) is not downloadable for free.
Elliptic curves are a popular future replacement for modular arithmetic; EC variants of DSA and Diffie-Hellman are faster and believed more secure with shorter public keys. But that's more mathematics. There again, the Guide to Elliptic Curve Cryptography is the must-have reference.
There are other kinds of asymmetric cryptography algorithms, e.g. the McEliece cryptosystem (asymmetric encryption; there is a variant for signatures described by Niederreiter) and algorithms based on lattice reduction. But they do not (yet) benefit from published standards which take care of the implementation details, and there are not so many existing implementations to compare with. You'd better begin with RSA and DSA.
Cryptanalysis:
Cryptanalysis uses a much higher dose of mathematics than implementation.
For symmetric cryptography, the two main tools are differential and linear cryptanalysis; see this tutorial.
My own path to cryptography began by implementing DES, and then implementing Matsui's linear cryptanalysis on a reduced version of DES (8 rounds instead of 16). DES is described in FIPS 46-3, which is officially withdrawn, but still available. From DES can be defined Triple-DES (three DES instances, with three distinct keys, the middle one being use in "decryption" direction) and there are published test vectors for Triple-DES (also known as "TDES", "3DES", or sometimes "DES", which is arguably confusing).
For asymmetric algorithms, cryptanalysis mostly involves working on the mathematical structure of the keys, e.g. by trying to factor big non-prime integers in order to break RSA variants. Mathematics here range from the non-trivial to the totally unimaginable, so this might be too steep a learning curve to begin cryptography by trying to break RSA...
Comment: Wow. Great response. You offered a nice survey of cryptography in easy to understand language with valuable references. Thanks.
Comment: @Thomas, Your post doesn't talk about how to become a **cryptanalyst**.
Answer: Two things, really:

Get a good book. Bruce Schneier's "Applied Cryptography" is adequate.
Learn the 'openssl' tools, and learn to use them.

The most important thing about crypto to learn is humbleness. You don't want to ever create a new solution a problem -- you want to copy as best you can the solutions that have been well-tested by others. Most crypto failures are due to people having a bright idea, thinking they could make some optimization to improve upon an existing solution. It is only the extremely humble that eventually succeed in finding new ways of doing things.
The next lesson is that you have unlearn your prejudices that you've gotten from TV and movies, where a hacker sits down at a computer and breaks crypto. These are either unrelated to crypto, or a dramatization of what really goes on. For example, the movie "Sneaker" is a dramatization of what would happen if somebody developed a chip that could factor large integers.
The hardest thing in learning crypto is to distinguish between the technical concepts that are necessary to understand the field in general, and those which you'll need only when you specialize in a narrow area. Take, for example, the highly rated post above. You need to understand the difference between a "symmetric" algorithm vs. "asymmetric" algorithm vs. a "hash", but when the author of that post says "It helps a bit to know what a finite field of characteristic 2 is", I would disagree: it's only meaningful to PhDs researching crypto, not to the rest of us that simply want to figure out how to use it correctly.
A good way to wade through the technical details is to pick a target, and work backwards. For example, today, Apple updated the iPhone/iPad operating system to version 4.3.5 to fix a bug in the validation of X.509 certificate chains. Understanding the problem and why they had to fix it is exactly the sort of thing you are discussing in your original post. Figure out what an X.509 certificate is, what the chains are, and why they need to be validated, and why if you don't, a hacker using a tool like 'sslsniff' can defeat the encryption. Once you fully understand all that, you'll have achieved much of your goal that you describe in your original post.
Another example is a blog post on Verifying the Comodo Hacker's key
Again, find out what the Comodo hacker did (created signed certificates for Google and Yahoo), how certificate revocation works, and how to use the tools to validate that certificate. I suggest it as a good post because it's a good starting point for using the 'openssl' tools, which are standard in our industry.
Good luck!
Answer: Register for Stanford's online Cryptography class that begins next January. It's free, online, includes both theory (video lectures and quizzes) and practice (programming assignments), let's you work at your own pace and you will get a statement of accomplishment if you succeed. Given the various echoes I got on Stanford's previous online courses session, I'm definitely registering for this class (as well as the Computer Security one).

On the theory side:

Cryptography Engineering Design Principles and Practical Applications by Niels Ferguson and Bruce Schneier. Book is intended to be an update of the venerable Applied Cryptography, authors are well known in the field and reviews are good.

On the practice side:

You may give a look at various CTF (Capture The Flag) hacking/security competitions. They generally include Cryptography challenges. They're fun and take you out of your comfort zone to solve the problems within a limited time. Here's a good CTFs Calendar. Also, look at some write-ups of previous CTFs, I found many to be very educational and well explained.
Comment: seems very interesting and quite exciting, I subscribed, but I don't know, will it be free ?
Comment: @jokoon i enrolled myself...i think fee is for getting certificate.
Answer: For crypto algorithms:
Stinson's Cryptography:  Theory and Practice
goes through the math of many crypto algorithms in a way that would make them fairly easy to implement, if that's what you wanted to do.
Scheiner's Applied Cryptography is also a leading book on the topic.  Probably overlaps quite a bit but with some different algorithms.
As far as a book explicitly telling you how to implement them - I've got nothing.  Commercially, these aren't always implemented in software, and it's a fairly niche industry.  From a playing around perspective, I'd say get a book explaining the algorithm, implement it, and compare your outcome with a commonly used library for the same algorithm.
Similarly, I've got nothing on cryptanalysis, although I suspect if you pick an algorithm and google for things like "weakness in" and "weak keys" you'll find some interesting papers and other information.  Last time I had to write a paper on anything like this (10 years+ ago) that's essentially what I did...
Answer: I recommend Cryptography Engineering: Design Principles and Practical Applications.  It is the perfect book for you.  It describes how to design and implement cryptosystems, from the perspective of a systems designer and implementor.  It is a very pragmatic book, with a perspective derived from the authors' years of experience.  The word "engineering" in the title is truly apt.  I think you will find it an invaluable resource helping you prioritize what you should spend most of your energy worrying about, what can go wrong, and how to make sure those bad things don't happen to you.
Answer: If you want any understanding of the theory of cryptography, written in a way that is accessible for practitioners, try "Introduction to Modern Cryptography" by Katz and Lindell.
Answer: I would also add you have a look at Matasano crypto challenges as you already have some programming skills.
From their website :

HOW MUCH CRYPTO DO I NEED TO KNOW?
  None. That's the point.
SO WHAT DO I NEED TO KNOW? You'll want to be able to code proficiently
  in any language. We've received submissions in C, C++, Python, Ruby,
  Perl, Visual Basic, X86 Assembly, Haskell, and Lisp.

All their challenges are based on real-world crypto vulnerabilities, so you should learn nice stuff resolving these.
Answer: Learning cryptography from scratch can sometimes feel like a hard thing but if you have the right resources you will absolutely love it. The following are my favourite sites to get you started learning cryptography today.

Learn cryptography at Kifanga for complete beginners to more advanced levels.
Practical cryptography is really good for cryptanalysis articles
Learncryptography is great for hash functions


Does anyone have insight into the Hebrew idiom; "Prince of Peace?

Question: Yeshayahu (Isaiah) 9:6 is debated with regards to the subject being described i.e. Hizqiyah or Mashiach and that is not something I'm looking to get an answer/opinion on.  I have heard that the term; "Prince of peace" is an idiom which doesn't necessarily change the meaning conveyed but does have a more specific meaning than the translations provide.  Does anyone have insights they would like to share?
Comment: Messianic prophecies are often with dual meaning. Immediate context and Greater messianic context.
Comment: @Torah Observant servant. Are you talking about peace where conditions mentioned in Isaiah 2:4 and Isaiah 11:6-9 are present?
Comment: The prince of peace would be the son of the king of peace (Melchizedek)
Comment: @Torah Observant Servant. Are you referring to king Hezekiah. A ruler of peace instead of prince of peace?
Answer: I'm afraid the question is asking for information that doesn't exist, and so no answer is going to satisfy the questioner.
"Prince of peace" can only be called a "Hebrew idiom" in the sense that it's an idiom that happens in this case to be written in Hebrew. But the literary style was common throughout the ancient near east, and the specific idiom here is likely Egyptian in origin.
Exaltations
The idiom "Prince of Peace" is an exaltation given to a ruler. In this case, it means someone whose reign is characterized by peace/completeness, which is to say the reign is not going to be interrupted with war and will have good bounty.
Here is an exaltation of Harmhab found in a Cairo doorpost:
1 Privy councilor of the palace (pr-stny),
  great in love with his lord,
  chief prophet of Horus,
  lord of Sebi (Sby);
  for the ka of the general in chief, Harmhab.

2 Prince of the greatest of the companions,
  confidant of especial confidants (same conclusion as in l. 1);

3 king's-follower on his expeditions in the south and north country
  (same conclusion as in l. 1).

4 Greatest of the great,
  mightiest of the mighty;
  great lord of the people (conclusion as in l. 1).

5 King's-messenger at the head of his army,
  to the south and north country (conclusion as in l. 1). [1]

Notice that each line contains exaltations ending with the name of the person being exalted (the identical ending is only included in the first paragraph).
Understanding this literary type helps in exegesis. Here is another exaltation in the Bible, which contains 4 exaltations followed by "Be still and know that I am God" and then 4 more exaltations with the naming of God (YHWH appears) at the end.
  Psalm 46:8–11 (KJV 1900):

  8       Come, behold the works of the LORD,
  What desolations he hath made in the earth.
  9       He maketh wars to cease unto the end of the earth;
  He breaketh the bow, and cutteth the spear in sunder;
  He burneth the chariot in the fire.
  10       Be still, and know that I am God:
  11 I will be exalted among the heathen, I will be exalted in the earth.
     Yahweh of Hosts is with us; the God of Jacob is our high stronghold. Selah

Shalom includes completeness -- no lack. So it would include good harvests, friendly relations with neighbors, grandkids - whatever you see as lack.  Solomon would be the best type in Israel for this, but of course other nations had even better types (Augustus and Pax Romana) and no earthly king could bring true completeness.
Here is an exaltation from Egypt
 1 Year 5, third month of the first season (third month), day 2,
 the coronation (day)d under the majesty of
 Horus: Mighty Bull, Shining in Truth;
 Favorite of the Two Goddesses: Establisher of Laws,

 2 Quieter of the Two Lands;
 Golden Horus: Great in Strength, Smiter of the Asiatics,
 Good God, Ruler of Thebes, Lord of Strength, Mighty of Valor;[3]

Coronation Liturgy examples
Exaltations were a key component of a coronation liturgy, which the larger passage in Isaiah is an example of.
In the Code of Hammurabi we have a reference to the Hammurabi's coronation (or rather, being "named" by Anum and Enlil). There are five exaltations and a closing identification:

at that time Anum and Enlil named me [introduction]
to promote the welfare of the
people, me, Hammurabi, the devout, god-fearing prince [exaltation]
to cause
justice to prevail in the land,   [exaltation]
to destroy the wicked and the evil,
that the strong might not oppress the weak,   [exaltation]
to rise like the sun
over the black-headed (people),   [exaltation]
and to light up the land.  [exaltation]
Hammurabi, the shepherd, called by Enlil, am I; [Identification] [2]

Again, Hammurabi's name ends the sequence of exaltations.
From Hermeneia's commentary on Isaiah:

In the Egyptian coronation service, the divine birth of the new
pharaoh was also proclaimed. In Egypt the birth actually referred to
the physical birth of the king, which took place long before the
coronation, but it was announced at the king's coronation, as the
enthronement texts concerning Hatshepsut, Amenhotep III, and Haremhab
demonstrate.23 In a Memphis text, the god Amon says to Haremhab, just
prior to taking him into the divine assembly to be acclaimed king,
"You are my son and my heir, who has come out of my members." The
Egyptian coronation ritual, however, does not only have Amon making
the proclamation of the king's divine sonship directly to the new
pharaoh. Amon or Thoth speaking for him also addresses the divine
council, using third person pronouns to present the human king to them
as Amon's son, and the assembly of the gods responds to the
presentation, in turn, by referring to the king in the third person.[4]

The switch to third person is especially important as most of Isaiah is written in the first person. This may well have been inspired by an existing exaltation based on the Egyptian liturgy (e.g. Hezekiah's), but the omission of the name is crucial to understanding that this is not an actual coronation but is written to make the reader think of a coronation by adopting the same idiom.
The climax of the coronation liturgy is the naming of the King. That's what all the exaltations lead up to[5].

For unto us a child is born, unto us a son is given:

And the government shall be upon his shoulder:

And his name shall be called Wonderful, Counseller, The mighty God, The everlasting Father, The Prince of Peace.

Of the increase of his government and peace there shall be no end,

Upon the throne of David, and upon his kingdom, To order it, and to establish it with judgment and with justice From henceforth even for
ever.

The zeal of the LORD of hosts will perform this.

[KJV Is. 9.6-7]

Where the name of the king would appear, what we see instead is:
The zeal of the LORD of hosts will perform this.
So the idiom used is not Hebrew but Egyptian, which Judah adopted, but it's not exactly a coronation ritual, because the name is omitted and replaced with a promise for future provision.
Another difference is the generosity of the titles. That is, there is no "Smiter of Asiatics" or "Vanquisher of foes". The entire passage is one of incredible majesty and grace without a hint of terror. It's hard to read this passage without being deeply moved and put in awe of its beauty.
But reading the other old testament prophets, I would not call this a Hebrew idiom. Rather, it's a bright light shining in Isaiah, a promise of messiah, the climax of the first half of the book.

[1] James Henry Breasted, ed., Ancient Records of Egypt: The Nineteenth Dynasty, vol. 3 (Chicago: University of Chicago Press, 1906), 11–12.
[2] James Bennett Pritchard, ed., The Ancient Near Eastern Texts Relating to the Old Testament , 3rd ed. with Supplement. (Princeton: Princeton University Press, 1969), 164.
[3] James Henry Breasted, ed., Ancient Records of Egypt: The Eighteenth Dynasty, vol. 2 (Chicago: University of Chicago Press, 1906), 335.
[4] J. J. M. Roberts, First Isaiah: A Commentary, ed. Peter Machinist, Hermeneia (Minneapolis, MN: Fortress Press, 2015), 150–151.
[5] I was reminded of famous boxing announcements.
The professional record, a perfect one.
With seven world titles in five divisions
Former featherweight world chamption
Former lightweight world champion
Three time walter weight world champion
                  Floyd Merriiwhether!

Check out https://www.youtube.com/watch?v=JOzdm-lwLCg to get a sense of what these liturgies look like in the modern world.
Answer: The word "Prince" in Bible represent someone who had the authority on something. The Prince of a state usually mean the King. The word "Peace" in Bible is rarely meant the opposite of "War", in many occasions, it describes a state of mind.
In Old Testament, there are numerous verses tell "Peace" was delivered by God. For example;

Psalm 29:11 (NIV) - The Lord gives strength to his people;
the Lord blesses his people with peace.

In New Testament, the ending of many letters often quote the same blessing. For example;

Roman 15:33 (NIV) - The God of peace be with you all. Amen.

It is obvious "Peace", or in its elaborated form "Peace of mind", is a blessing from God, it is a grace to us when we believe. God send Jesus to the world, delivered His message, and therefore Jesus is the "Prince of Peace" (quoted in Isiah 9:6), who has the authority to bless the people with peace to those who believe in Him and His Father, giving them strength to endure all kinds of difficulties with a "Peace of mind". Just as Jesus said  "I have told you these things, so that in me you may have peace. In this world you will have trouble. But take heart! I have overcome the world." (John 16:33 NIV)
Comment: Thank you brother.  I appreciate your response.  However, I am looking for the meaning of the phrase; 'Prince of peace' used in the context of a Hebraic idiom.
Answer: Isa 9:6 should not be divorced from the next verse, which together, form a very well-known Messianic prophecy.  Let me set this out as follows:

For unto us a child is born, unto us a son is given, and the
government will be upon His shoulders. And He will be called:

Wonderful Counselor,
Mighty God,
Everlasting Father,
Prince of Peace.

Of the increase of His government and peace there will be no end. He
will reign on the throne of David and over his kingdom, to establish
and sustain it with justice and righteousness from that time and
forevermore.
The zeal of the LORD of Hosts will accomplish this.

I will resist the temptation to provide a detailed exposition and exegesis of this passage and its fulfillment, and concentrate only on the "Prince of Peace".  We observe several things about this Messianic prophecy:

It is a prophecy about the (then future) prince/king who would fulfill the promises in the Davidic covenant - see appendix below
The Davidic covenant was originally designed as covenant of peace, 2 Sam 7:9.  Thus, the prophesied "Prince of Peace" was to reign over the Kingdom of peace.
David's son Solomon (a name meaning "peace") was originally intended to partly fulfill this covenant of peace.  Indeed, Solomon, unlike his father David, did not fight wars. 1 Kings 4:24, 1 Chron 22:9, etc.
The NT regularly refers to Jesus as the fulfillment of this promise (see appendix below) and refers to the "God of peace" often, Heb 13:20, 1 Thess 5:23, 1 Cor 14:33,  2 Peter 1:2, Phil 4:7, 2 John 3, Rom 15:33, 2 Cor 13:11, etc.
By comparison with the references below (see also Isa 2:2-4) we note that peace is only possible with accompanying justice and righteousness.

Zech 9:9, 10 - Rejoice greatly, O Daughter of Zion! Shout in triumph, O Daughter of Jerusalem! See, your King comes to you, righteous and victorious, humble and riding on a donkey, on a colt, the foal of a donkey. And I will cut off the chariot from Ephraim and the horse from Jerusalem, and the bow of war will be broken. Then He will proclaim peace to the nations. His dominion will extend from sea to sea, and from the Euphrates to the ends of the earth.
Isa 32:17, 18 - The work of righteousness will be peace; the service of righteousness will be quiet confidence forever. Then my people will dwell in a peaceful place, in safe and secure places of rest.
Jer 23:5, 6 - Behold, the days are coming, declares the LORD, when I will raise up for David a righteous Branch, and He will reign wisely as King and will administer justice and righteousness in the land. In His days Judah will be saved, and Israel will dwell securely. And this is His name by which He will be called: The LORD Our Righteousness. [See also Jer 33:15, 16, Luke 1:31-33, John 1:49, 50, 12:13.]
Phil 4:7 - And the peace of God, which transcends all understanding, will guard your hearts and your minds in Christ Jesus.

This whole idea was anticipated by the reference to Melchizedek, the "King of Salem" (= King of Peace") in places like gen 14:18, Heb 7:1-3.
The Pulpit commentary observes this:

The Prince of Peace; literally, Prince of Peace. A "Prince of Peace" had been long shadowed forth, as in Melchizedek, "King of
Salem," i.e. "of Peace;" and again in Solomon, "the peaceful one;" and
Isaiah himself had already prophesied the peacefulness of the
Messiah's kingdom (Isaiah 2:4). Compare the song of the angels at our
Lord's birth (Luke 2:14). If the peacefulness has not vet very clearly
shown itself, the reason would seem to be that our Lord's kingdom has
yet to come into the hearts of most men. Isaiah 9:6

APPENDIX - Davidic (or Regal, or Royal) Covenant: 2 Sam 7, 23:5, 1 Kings 6:11, 12, 8:25, 1 Chron 17:11-14, 2 Chron 6:14-16, 7:17, 18, 13:5, Ps 89:4, 29, 34, 39, 132:11, 12, Jer 33:21, Eze 37:15-28.  This is an eternal covenant.
The provisions of the Davidic Covenant were as follows.

God promised to make David, a shepherd king over Israel. 2 Sam 7:9, 1 Kings 8:25, 2 Chron 21:7.
God promised to defeat all David's enemies and give him peace on all sides, 2 Sam 7:9
David's name would be great, 2 Sam 7:9-11
God promised there would always be a blood descendant of David on his throne, by an eternal "covenant of salt" (ie very solemn), 2 Chron 13:5, forever, 2 Sam 7:13, 15, 16, Eze 37:26, (2 Sam 23:5).
God promised that the descendant of David would have God as his Father and he would be His son, 2 Sam 7:14.
David's son, Solomon ["peace"], was the person to build the temple, 2 Sam 7:12, 13.
David and his descendants must remain faithful to God and keep all that is written in the Book of the Law (Deuteronomy), Deut 17:18, 31:26.

Note that the Davidic Covenant was distinct from the Israelite and Levitical Covenants – David became a type of the eternal reign of Messiah to come.
While David and his successors were earthly kings, they were to recognise that the real king of Israel was God.  1 Sam 8:7, 8, 24:6, 2 Sam 19:21, 1 Chron 28:5, 29:23, 2 Chron 9:8, 13:8, Ps 5:2, 44:4.  See also 1 Sam 12:14.
It is a simple matter of history that David's descendants were not always faithful and the earthly Davidic dynasty ended in 586 BC with the final capture of Jerusalem by Nebuchadnezzar.  However, the New Testament calls Jesus Christ, Messiah, "the Son of David" as a direct fulfilment of the (ultimately) eternal throne of David which Jesus inherited.  Matt 1:1, 20, 9:27, 12:23, 15:22, 20:30, 15, 21:9, 15, Mark 10:35, Luke 1:32, 33, 18:38, 39, John 1:49, Acts 13:32-37, Heb 1:8.  See also Rev 11:15, 19:16.  Such a Messiah was prophesied long ago: Ex 15:18, Ps 10:16, 61:7, 68:16, 92:8, 93:5, 146:10, Isa 9:7, 47:7, Lam 5:19, Micah 4:7, etc.  Compare Isa 55:3 with Acts 13:34 and John 1:49.
Note especially, what the angel said to Mary before Jesus' birth in Luke 1:32, 33 –

He will be great and will be called the Son of the Most High. The Lord
God will give Him the throne of His father David, and He will reign
over the house of Jacob forever. His kingdom will never end!"
Comment: Thank you for taking the time to give such a thorough answer.  I appreciate that yourself and @Vincent Wong made a point to assert that the prophecy is Messianic.  I didn't mean to be cryptic, I guess I should have disclosed that I do believe this to be a Messianic prophecy.  What I am trying to learn is how the phrase; "Prince of peace" was used as a Hebrew idiom such as the idioms "thief in the night", "cock crowed", "eye of a needle".  In my research I've understood it to mean keeper of peace i.e. ruling with a rod of iron.  Just looking to confirm or gain a deeper insight.
Comment: @TorahObservantServant - I am not sure what question you are asking as I have identified "God" of peace" as part of the Davidic royal covenant which is central to the OT idiom.
Comment: @TorahObservantServant - so what sort of answer do you want?  Isa 9:6, 7 has been recognized as a Messianic prophecy by the Rabbis for centuries.


Windows Event Log export to MySQL DB

Question: I have windows 2008 R2 server. Is there any way all events can be logged in my linux base mysql database ?
or is there any way i can log specific event in mysql tables?
Answer: The Windows Event Log system does not support logging to a SQL database by default - it always will log into locally-accessible files, only the destination directory and the file name are configurable via registry values1.
Server 2008 R2 and newer OS versions come with a Windows Event collector which can be configured to forward events to another Windows host, but cannot convert the data to be passed on into a database.
But of course, you are free to use any script - either rolled on your own or created by someone else - which might do exactly this: reading data from the event log and writing rows into a database. There are numerous examples on the net on how this might look like.
You also might consider using a complete log management solution designed to the very purpose of collecting, storing, analyzing and presenting the logs. The market is flooded with products - choose one that you think makes a good fit.

1 Each event log facility reads from the key HKLM\SYSTEM\CurrentControlSet\Services\EventLog\<logname> and the value of File (REG_EXPAND_SZ) represents the
Comment: Ok I made small workaround for my requirement. I made two batch files. one for account creation and one for account deletion. then via event viewer, i attached these batch file according to event, which execute batch file, which trim the output and log to mysql.
Answer: Ok I finally made an workaround to get my required information logged in local file as well as in remote linux mysql db too. I simply made two batch files that are triggered on specific event ID, and then do the task of logging into local file as well in mySQL DB too. It's not fancy, its not professional, but I am happy that its working for me and exactly in a way i needed. .I summarize it in post for future reference.
Windows Event-Viewer Logging to MYSQL

Windows Event Log export to MySQL DB


What's the criteria of deleting item?

Question: What's the recognized criteria in statistics world?
Answer: Your question is closely linked to the one found here relating to the magnitude of slopes in order to determine if an item contributes a meaningful amount of information (I assume you meant to say standardized factor loadings rather than Cronbach's alpha < .3). Basically, if an item correlation is too low with the latent trait being measured then it's likely of little use, and if an item has too high of a guessing parameter then the same occurs as well (too many low-ability individuals can answer an item correctly seemingly just by chance).
Comment: Because there is no single 'statistics world', there is just statistics applied in various disciplines/domains?  Because rules of thumb aren't particularly strong arguments for choosing courses of action?
Comment: +1. However note that we can't be sure the OP meant factor loadings. They were speaking about alpha anyway. The very question was quite unclear to me.
Comment: @WhiteGirl: last time I checked, there is none -- especially _statistically_ speaking. Closest to what you're looking for, from a test development point of view, is the TIMMS2007 technical report. Otherwise consult Handbook of test development (2nd Ed), chapter 20, Item Analysis for Selected-Response Test Items. But AFAIK both are not discussing benchmarks for guessing parameters.
Comment: @Tom,it's so strange, why not recognized standard in statistics world??
Comment: I just need a recognized criteria, maybe citation paper.

What's the criteria of deleting item?


Can we use FME translator for upgrading lower version GIS database into higher version GIS database

Question: I want to upgrdae our lower version GIS database into higher version GIS database.Is it possible to do so and suggest methods to do so.I am thinking of using FME.Is it possible to use FME or any other option will be suitable?Please suggest...
Comment: can you mention database format? personal/file geodatabase, oracle,sql??
Comment: I am using GE Smallworld 4.0 version and I want to upgrade it to 4.1 version.I am just thinking of using FME but if you have another better option then please let me know.
Answer: You can certainly use FME to read from a Smallworld 4.0 database, and write the data into a 4.1 database. But unless you were doing a large scale re-modelling of the data en-route I don't see the need.
I'm sure there must be some sort of upgrade mechanism in Smallworld. I'd contact your Smallworld reseller/support to find that out.
FME with Smallworld is best for moving data out of Smallworld to another system, or into Smallworld from another system. You'd only do Smallworld - Smallworld to transform the data in some way. I don't know of any user who is using it to upgrade in the way you describe.
Answer: Your question is very vague. Which database are you referring to?
Databases typically usually have their own procedures for upgrading and these should include data transfer as part of the process. The place to start with Oracle would be here: http://www.oracle.com/technetwork/products/upgrade/index.html
That said, if you have a specific reason for using FME, you'll need a database-writer level FME license to be able to do this.
The FME readers themselves don't specify which versions of the database they support but I believe they support all versions transparently - this page for Oracle implies it.
So you could probably pretty easily create a translation that has a reader piped straight into a writer to get the data from one to the other, but that won't upgrade the database software itself or any of the backend stuff.
Comment: without specifics my guess is. OP refers to the geodatabase version of sde. there are 9.3 specific objects and 10.x specific. You can right click on the admin connection in arccatalog and upgrade. but that only applies if that IS what is being referenced.
Comment: Please give more information regarding upgradation using FME..