text:
Q: Condicionales reemplazan comparador en tester android Necesito hacer dos comparaciones en el tester espresso de android con kotlin.
La primera trata en abrir el menú, mirar que el elemento no exista, validar eso con espresso, seleccionar el location y sublocation, abrir el menú y mirar que el elemento sí exista, validar también eso con espresso.
En la función HVISUALBRS() es donde debo poner la línea de código haciendo eso, pero como soy nuevo en esto de la automatización no entiendo muy bien cómo hacerlo, y lo que tengo comentado debajo de la función en mención es lo que estoy tratando de hacer.
class BRSInterfaceTestsStation {
val TIMEOUT_FOR_ENDING_SYNCH: Long = 120 // SECONDS

@Rule
@JvmField
var mActivityScenarioRule = ActivityScenarioRule (auto_login::class.java)
@get:Rule
public val permissioncamera: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.CAMERA)
@get:Rule
public val Permissionlocation: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.ACCESS_FINE_LOCATION)
@get:Rule
public val permissionaudio: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.RECORD_AUDIO)
@get:Rule
public val permissionStorage: GrantPermissionRule = GrantPermissionRule.grant(android.Manifest.permission.READ_EXTERNAL_STORAGE)

@Before
fun setup() {
    mActivityScenarioRule.scenario.onActivity {
        IdlingRegistry.getInstance().register(it._idle_resource_manager.resource())
    }
}

@Test
fun AsynchronizeAndChangeToStaging() {
    IdlingPolicies.setIdlingResourceTimeout(TIMEOUT_FOR_ENDING_SYNCH, TimeUnit.SECONDS)
    IdlingPolicies.setMasterPolicyTimeout(TIMEOUT_FOR_ENDING_SYNCH, TimeUnit.SECONDS)
    val progressBar = onView(
        allOf(
            withId(touchsuite.inkav.com.inkmobile.R.id.progress_bar),
            ViewMatchers.withParent(ViewMatchers.withParent(withId(R.id.content))),
            ViewMatchers.isDisplayed()
        )
    )
    progressBar.check(ViewAssertions.doesNotExist())

    val settingsButton = onView(withId(touchsuite.inkav.com.inkmobile.R.id.imageButton2))
    settingsButton.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
    settingsButton.perform(ViewActions.click())

    val textServer = onView(withId(touchsuite.inkav.com.inkmobile.R.id.txtserver))
    textServer.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
    textServer.perform(ViewActions.replaceText("staging.inkcloud.io"))
    textServer.perform(ViewActions.closeSoftKeyboard())

    val buttonOkSettings = onView(withId(touchsuite.inkav.com.inkmobile.R.id.button))
    buttonOkSettings.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
    buttonOkSettings.check(ViewAssertions.matches(ViewMatchers.isClickable()))
    buttonOkSettings.perform(ViewActions.click())

    val serverLabel = onView(withId(touchsuite.inkav.com.inkmobile.R.id.server_label))
    serverLabel.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
    serverLabel.check(ViewAssertions.matches(ViewMatchers.withText("STAGING")))
}

private val activityInstance: Activity?
    private get() {
        val currentActivity = arrayOf<Activity?>(null)
        InstrumentationRegistry.getInstrumentation().runOnMainSync {
            val resumedActivity = ActivityLifecycleMonitorRegistry.getInstance()
                .getActivitiesInStage(Stage.RESUMED)
            val it: Iterator<Activity> = resumedActivity.iterator()
            currentActivity[0] = it.next()
        }
        return currentActivity[0]
    }

@Test
fun GStarStationMachine (){

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.user_pass_layout)).perform(ViewActions.click())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.username_text_field)).perform(ViewActions.clearText())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.username_text_field)).perform(ViewActions.typeText("touchsuite.tester"))

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.password_text_field)).perform(ViewActions.replaceText("Abc1234."))
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.submit_button)).perform(ViewActions.click())

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.menu_button)).perform(ViewActions.click())
    onData(Is.`is`("STATIONS")).inAdapterView(withId(touchsuite.inkav.com.inkmobile.R.id.gridview)).perform(ViewActions.click())

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.station_button)).perform(ViewActions.click())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.search_bar)).
    perform(ViewActions.typeText("ink virtual"))
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.done_button)).perform(ViewActions.click())

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.machine_button)).perform(ViewActions.click())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.numberPicker1_popup)).perform(ViewActions.swipeUp())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.button_ok)).perform(ViewActions.click())
}

@Test
fun HVISUALBRS (){

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.user_pass_layout)).perform(ViewActions.click())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.username_text_field)).perform(ViewActions.clearText())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.username_text_field)).perform(ViewActions.typeText("touchsuite.tester"))

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.password_text_field)).perform(ViewActions.replaceText("Abc1234."))
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.submit_button)).perform(ViewActions.click())

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.menu_button)).perform(ViewActions.click())
    onData(withId(touchsuite.inkav.com.inkmobile.R.id.gridview)).check(matches(isNotChecked()))
    //onView(allOf(withText("BRS"))).check(matches(isNotFocusable()))

    onData(Is.`is`("STATIONS")).inAdapterView(withId(touchsuite.inkav.com.inkmobile.R.id.gridview)).perform(ViewActions.click())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.location_btn)).perform(ViewActions.click())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.numberPicker1_popup)).perform(ViewActions.swipeUp())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.button_ok)).perform(ViewActions.click())

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.sublocation_btn)).perform(ViewActions.click())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.numberPicker1_popup)).perform(ViewActions.swipeUp())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.button_ok)).perform(ViewActions.click())

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.menu_button)).perform(ViewActions.click())
    onView(allOf(withText("BRS"))).check(matches(isDisplayed()))

    //onData(Is.`is`("BRS")).inAdapterView(withId(touchsuite.inkav.com.inkmobile.R.id.gridview)).check(matches(isNotChecked()))
    //onView(allOf(withText("BRS"))).check(matches(isNotFocusable()))
    //onData(allOf(not(matches(withText("BRS")))))
    //onData(allOf(withId(touchsuite.inkav.com.inkmobile.R.id.gridview),not(matches(withText("BRS")))))
    //onData(withId(touchsuite.inkav.com.inkmobile.R.id.gridview)).check(matches(withText("BRS")))
    //onView(allOf(withId(touchsuite.inkav.com.inkmobile.R.id.gridview), withText("BRS"))).check(matches(isDisplayed()))
    //onData(Is.`is`("BRS")).inAdapterView(withId(touchsuite.inkav.com.inkmobile.R.id.gridview)).check(matches(withText("BRS")))

}

@Test
fun ISTARRamp (){

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.user_pass_layout)).perform(ViewActions.click())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.username_text_field)).perform(ViewActions.clearText())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.username_text_field)).perform(ViewActions.typeText("touchsuite.tester"))

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.password_text_field)).perform(ViewActions.replaceText("Abc1234."))
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.submit_button)).perform(ViewActions.click())

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.menu_button)).perform(ViewActions.click())
    onData(Is.`is`("STATIONS")).inAdapterView(withId(touchsuite.inkav.com.inkmobile.R.id.gridview)).perform(ViewActions.click())

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.location_btn)).perform(ViewActions.click())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.numberPicker1_popup)).perform(ViewActions.swipeUp())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.button_ok)).perform(ViewActions.click())

    onView(withId(touchsuite.inkav.com.inkmobile.R.id.sublocation_btn)).perform(ViewActions.click())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.numberPicker1_popup)).perform(ViewActions.swipeUp())
    onView(withId(touchsuite.inkav.com.inkmobile.R.id.button_ok)).perform(ViewActions.click())
    }

}


text:
Q: How To Set up RapidMiner library in Android Studio I am currently working on an object recognition app. I'm using Android Studio and I have created a Neural Network model on Rapid Miner Studio and saved it as PMML. I want to apply this model on a set of extracted features in Android Studio so that I can obtain a prediction (e.g: is the object a fruit/vegetable/nut?). However, I'm not able to integrate the Rapid Miner library in Android Studio. I've downloaded "rapidminer-extension-template" from https://github.com/rapidminer/rapidminer-extension-template. Is it the correct file that should be downloaded?
I have looked for a working solution for the past 4 days but I can't seem to find one.
Do I have to use the Rapid Miner library to apply the PMML model or is it possible to use something else?

A: the extension template is used to create new extensions for RapidMiner, which can provide new Operators.
So in your case you would need is an interpreter of the PMML model in Android. This project looks promising, but I haven't tested it myself.
Also please note, that the Write PMML Operator of RapidMiner currently does not support Neural Network models. The help text states the supported models are :

*

*Decision Tree Models

*Rule Models

*Naive Bayes models for nominal attributes

*Linear Regression Models

*Logistic Regression Models

*Centroid based Cluster models like models of k-means and k-medoids

Also feel free to ask further, or re-post, questions in the RapidMiner community forum, especially if you have questions about extension development you can find qualified help there.

A: I downloaded the pmml-evaluator library and added it to my project. The documentation on GitHub helped me achieve what I was looking for; it was able to read the PMML model and provide a prediction.
Also, even if on RapidMiner's website, they say that the PMML writer's list of compatible classifiers is restricted to the ones mentioned, I was able to save the Neural Net model and use it for prediction in Android Studio.

redpajama_set_name: RedPajamaStackExchange


text:
Q: ANR on Google's billing library Anyone have any idea why this ANR might be happening? I thought upgrading from the old IABHelper to the new billing library would solve it but it didn't. I submitted a bug on the billing library sample on github but haven't heard anything.
This is happening on Android 7 and 8. I have never had it happen to me, I only see it on the Play Store console.
"main" prio=5 tid=1 Native
  | group="main" sCount=1 dsCount=0 flags=1 obj=0x73ad8e30 self=0x7d456c7a00
  | sysTid=21462 nice=0 cgrp=default sched=0/0 handle=0x7d4a0fd9b0
  | state=S schedstat=( 0 0 0 ) utm=2078 stm=1145 core=2 HZ=100
  | stack=0x7ff79b5000-0x7ff79b7000 stackSize=8MB
  | held mutexes=
  #00  pc 000000000001de2c  /system/lib64/libc.so (syscall+28)
  #01  pc 00000000000e1a5c  /system/lib64/libart.so (_ZN3art17ConditionVariable16WaitHoldingLocksEPNS_6ThreadE+152)
  #02  pc 00000000004e12c4  /system/lib64/libart.so (_ZN3artL12GoToRunnableEPNS_6ThreadE+440)
  #03  pc 00000000004e10c4  /system/lib64/libart.so (_ZN3art12JniMethodEndEjPNS_6ThreadE+28)
  #04  pc 0000000000987c3c  /system/framework/arm64/boot-framework.oat (Java_android_os_BinderProxy_transactNative__ILandroid_os_Parcel_2Landroid_os_Parcel_2I+220)
  at android.os.BinderProxy.transactNative (Native method)
  at android.os.BinderProxy.transact (Binder.java:766)
  at com.android.vending.billing.IInAppBillingService$Stub$Proxy.isBillingSupported (IInAppBillingService.java:320)
  at com.android.billingclient.api.BillingClientImpl$BillingServiceConnection.onServiceConnected (BillingClientImpl.java:839)
  at android.app.LoadedApk$ServiceDispatcher.doConnected (LoadedApk.java:1713)
  at android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1742)
  at android.os.Handler.handleCallback (Handler.java:789)
  at android.os.Handler.dispatchMessage (Handler.java:98)
  at android.os.Looper.loop (Looper.java:164)
  at android.app.ActivityThread.main (ActivityThread.java:6703)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:769)


text:
Q: Scheduling script on gitlab I know we can schedule script run in gitlab(I've not done it yet: https://docs.gitlab.com/ee/ci/pipelines/schedules.html)
Before starting this all I had doubt, suppose I want to run python script which uses pandas library then how script can run because gitlab doesn't have env which has pandas installed in it.

A: You can include installing panda in a job's script. The Gitlab runner with install panda and then carry out your other jobs defined in the .gitlab-ci.yml (including your script).
---
  run script:
    script:
      - pip install panda
      - python script.py


text:
Q: How to get UIButton name in swift5? I am currently making a pin-code. I want to incorporate all the functions into one function, in order to integrate the button event function into one So I want to get the name of UIButton, but I don't know how.
@IBOutlet weak var oneButton: UIButton!
@IBOutlet weak var twoButton: UIButton!
...
var pinCodeNum : String! = ""
...

  @IBAction func OneButton(_ sender: UIButton) {
        pincodeLogic(sender)
    }

    func pincodeLogic(_ sender: UIButton) {
         // I want get value is (example : 'oneButton' or 'twoButton' or 'threeButton' more )
    }

As you can see from my code, I'm getting a 'sender' as a parameter I want to know the name of oneButton or twoButton using this parameter. How do I know?

My number button consists of a button and a label.

EDit

  @IBAction func OneButton(_ sender: UIButton) {

        pincodeLogic(sender)
    }

    func pincodeLogic(_ sender: UIButton) {
         if let number = sender.currentTitle {
            print(number)
        }
    }

I can't see the print log.

A: You can compare the sender with your button instances.
func pincodeLogic(_ sender: UIButton) {
    switch sender {
    case oneButton:
        print("oneButton pressed")
    case twoButton:
        print("twoButton pressed")
    default:
        print("unknown button pressed")
    }
}

A: if you want to access the button action to perform some specific task.Just put a tag with your each button and add the same target to all.
@IBAction func btnAction(_ sender: UIButton) {
switch sender.tag {
case 1:
    print("oneButton pressed")
case 2:
    print("twoButton pressed")
default:
    print("unknown button pressed")
 }
}

If you need just to print the button title the do the following.
@IBAction func btnAction(_ sender: UIButton) {
   print(sender.titleLabel?.text! as! String)
}

A: To access the contents of the label present in the button using the sender, this is an example:
@IBAction func OneButton(_ sender: UIButton) {
   print(sender.titleLabel?.text)
}

so you could do this:
@IBAction func OneButton(_ sender: UIButton) {

        pincodeLogic(sender)
  }

  func pincodeLogic(_ sender: UIButton) {
         if let number = sender.titleLabel?.text {
            print(number)
        }
  }

I hope I've been there for you. Let me know.

A: @IBAction func btnClick(_ sender: UIButton{
    print(sender.titleLabel!.text!)
}


text:
Q: Arduino: How to pass a pointer in Program Space as parameters to a function I am developing in Arduino, some menus to get them on the screen.
I declare the menus as tables of text strings defined in Program space as in the example.
How can I pass the pointer Menu_Principal as a parameter to a function?
Thank you all very much in advance.
const char _str_opcion_0[] PROGMEM = "Opción Menú 1";
const char _str_opcion_1[] PROGMEM = "Opción Menú -2";
const char _str_opcion_2[] PROGMEM = "Opción Menú --3";
const char _str_opcion_3[] PROGMEM = "Opción Menú ---4";
const char _str_opcion_4[] PROGMEM = "Opción Menú ----5";
const char _str_opcion_5[] PROGMEM = "Opción Menú -----6";
const char _str_opcion_6[] PROGMEM = "Opción Menú ------7";
const char _str_opcion_7[] PROGMEM = "Opción Menú -------8";
const char _str_opcion_8[] PROGMEM = "Opción Menú --------9";
const char _str_opcion_9[] PROGMEM = "Opción Menú ---------A";
const char _str_opcion_A[] PROGMEM = "Opción Menú ----------B";
const char _str_opcion_B[] PROGMEM = "Opción Menú -----------C";

char* const Menu_Principal [] PROGMEM =
{
    _str_opcion_0, _str_opcion_1, _str_opcion_2, _str_opcion_3, _str_opcion_4, _str_opcion_5,
    _str_opcion_6, _str_opcion_7, _str_opcion_8, _str_opcion_9, _str_opcion_A, _str_opcion_B,
    NULL
};

A: You can pass a pointer to a function just like the usual way you do, but you can't just use it without copying the content from the flash to memory first.
const char _str_opcion_0[] PROGMEM = "Opción Menú 1";
const char _str_opcion_1[] PROGMEM = "Opción Menú -2";
const char _str_opcion_2[] PROGMEM = "Opción Menú --3";
const char _str_opcion_3[] PROGMEM = "Opción Menú ---4";
const char _str_opcion_4[] PROGMEM = "Opción Menú ----5";
const char _str_opcion_5[] PROGMEM = "Opción Menú -----6";
const char _str_opcion_6[] PROGMEM = "Opción Menú ------7";
const char _str_opcion_7[] PROGMEM = "Opción Menú -------8";
const char _str_opcion_8[] PROGMEM = "Opción Menú --------9";
const char _str_opcion_9[] PROGMEM = "Opción Menú ---------A";
const char _str_opcion_A[] PROGMEM = "Opción Menú ----------B";
const char _str_opcion_B[] PROGMEM = "Opción Menú -----------C";

PGM_P const Menu_Principal [] PROGMEM =
{
    _str_opcion_0, _str_opcion_1, _str_opcion_2, _str_opcion_3, _str_opcion_4, _str_opcion_5,
    _str_opcion_6, _str_opcion_7, _str_opcion_8, _str_opcion_9, _str_opcion_A, _str_opcion_B,
    NULL
};

void printMenu_P(PGM_P str) {
     char buf[strlen_P(str)+1];
     strcpy_P(buf, str);
     Serial.println(buf);
 }

void setup() {

    Serial.begin(115200);
    Serial.println();

    printMenu_P(Menu_Principal[0]);
}

BTW, PGM_P is just a macro defined by avrlib for const char*.


text:
Q: How to extract links from HTML using BeautifulSoup? I am trying to use regex function in python to filter out links from the html that I scraped on eBay website.
My question is how can I filter out those links with using following pattern: https://www.ebay.com/itm/ + all other characters.
I am getting successfully the https://www.ebay.com/itm/ part but I am not sure how to do the rest.
Python version that I am using: 3.8.8.
Here is the code:
from bs4 import BeautifulSoup
import requests
import re

url = 'https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2380057.m570.l1313&_nkw=Universal+Adjustable+Hand+Shower+Holder+Suction+Cup+Holder+Full+Plating+Shower+Rail+Head+Holder+Bathroom+Bracket+Stable+rotation&_sacat=0'
r = requests.get(url)
soup = BeautifulSoup(r.content, features="lxml")

listings = soup.find_all('li')
pattern = 'https://www.ebay.com/itm/'

results = re.findall('https://www.ebay.com/itm/', str(listings))
print(results)

A: To get links that starts with https://www.ebay.com/itm/ you can do:
import requests
from bs4 import BeautifulSoup

url = "https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2380057.m570.l1313&_nkw=Universal+Adjustable+Hand+Shower+Holder+Suction+Cup+Holder+Full+Plating+Shower+Rail+Head+Holder+Bathroom+Bracket+Stable+rotation&_sacat=0"
r = requests.get(url)
soup = BeautifulSoup(r.content, features="lxml")

listings = soup.select("li a")

for a in listings:
    link = a["href"]
    if link.startswith("https://www.ebay.com/itm/"):
        print(link)

Prints:
https://www.ebay.com/itm/01920391?epid=26039819083&_trkparms=ispr%3D1&hash=item3b542eae7a:g:FQkAAOSwK21gKvEZ&amdata=enc%3AAQAFAAACcBaobrjLl8XobRIiIML1V4Imu%252Fn%252BzU5L90Z278x5ickkrDx%252B2NLp21dg6hHbHAkGMYdiW1E6zjXxnQ0bf7c%252Fx%252Fvs5PW%252FYFw1ZdbGMi8wsGV6qXw8OFLl4Os1ACX3bnQxFkVpRib9hMb5gVyLha4q9L0xiporu5InbX0LrSgg7nCCCwtC7y3vOE3hc8PszsrXWLb5KFdj7%252BD98et12MdkEfMPFhJZuS%252BkFsp2esVTRCYctOhcwzPSdfzCOYprlr2miQc4czCv1Tcfs3LKUPJn8uQyRc%252BAnKY1oyTeYnJ7wYuGkBU%252FSVYjziLBaPhT%252FlVu0hR9ZX6OnAeRaJ1g0iCaDjrRXEXRwUO87riWeI8kExm1zzY7QicPeMnfWZdBvVhg05GOScPOlLTVPHakqGLX0y2GUXV6fkTLua3nSF5YBmLX%252FqdCxT6yS0dutVs5MPWvQYlN474hUzbubkZVAs7Y%252BBBEsHrGjVzCj0szZ6w1%252BHgkV5O9jrXGnyew5%252Bnxy7VCq5xEkUDIt1nSg996AeDksNmSNumhfsIOGltIXbqAbjqEUpPcVO%252BDPymxlh0iMxCZQalYnmljBRzKILYWkES0vfA14Gh5E7KWrztdC6WzEEFtgVuABakQ1eAOZnuEueqK6IakC%252BIfRbXv96Tv01IPDvwPeM8wMo6j8bMjY3D5KHS5EXPVdHKUnjCJiYCcVUqcKwhL6eN2MZ%252Bn9yxmWESUPN394NPrX%252FI2z7t0Bbo7iqmsWNQcyi0EHzDwJPMK%252FNSif8%252F2adRF7dT1JrbL9sryKSN2kv9OsdGQ0fMMC1LV3Ph43HivUJdqkgjGxqEqX5v1xQ%253D%253D%7Ccksum%3A25481541593068896952f4834d93a0bb998f5b5ba5fe%7Campid%3APL_CLK%7Cclp%3A2334524
https://www.ebay.com/itm/333909214974?_trkparms=ispr%3D1&hash=item4dbe8a46fe:g:wjYAAOSwXZtgQKMK&amdata=enc%3AAQAGAAADAPYe5NmHp%252B2JMhMi7yxGiTJkPrKr5t53CooMSQt2orsSprd4IgPv6LBzlteBBg9Pe7gpGas6KEYWvIQmgmNrIcf1ZIcLwSyYlVIojBTlJPAd4XoDj5k2AzULwOu2K1678su8RhEOIAhD%252FWN3J3erMgWugg2CT0y8zcUjbbWHtNfzYrnVuG%252FUvWmYzvxdGvHZvRdzha0juBNJzGKXnChJ6MECxb2uzy5G631xzrIxblEW3AM1ogDVv19il%252Fn7Vlzr0cERgdjLqGUj5KIynU8Xj9sHRx%252F%252FcSxPq8W4v1RHP%252FYZQhE4keU2U3pZGBCy9hyaYaf5pr78zEcjg2aoyh%252B6DUFkxtjTnmPhNqiwO5QNkl21UaDagoNQYRkZb4iW0QpXX628qHxIqBVL4GjtRczXt%252Bi0ZVn0B6GBqNzHtHarXqCSe7966rspJOMXwYB%252Fj3m%252Fpe3oJO8dKBNDmzxUNhnE4Bf76ZlFiW%252Fh9TXWEO3vdhLjRjjmjJKjgj7IXVorj%252BypBfHCbTXCA7nHsBSsOdNR%252B3LopnwoQutVCsk%252FQ8bESJCn0unvLARcM6wBRakZl3Uxhe1iSnMV%252F69vpTVm2XC1ZjU0IzF7xB5laYPRPcrOwXSJHwZJHkwyziteo%252FWBZNkklgTjY%252BdEanyHKlzppyJWLAufvIbWt4YWy3Xz%252FAKaKScpMGsHWNqEKwGJ%252BPeSFwq57qnm5xK0InzfsHtyVHd6lWoaKqyP8e7nVQBjqfNciDdLD5D3fuiIHQupPyX2m1Z%252B%252FeQOayocP6GV%252BAfSHCS44Y%252Fgh4njFjCVO5KAR%252BZXiNddo%252BfFGSpUZO1q38Cq3MDvyeRF3vYd2r3FNaimwBT2d3%252Fnl3seechJuFBWHONudGgMuSiXwoy66SbYwIj0CD427%252B1FVDHw%252F4LSkJhi78oWKX2I9sGnvHrj4boKie6mlPN6ZGOenVXOpLWNK8ZSN%252FzEqUzt6iC32EFb8rj%252FC4HK9AWddRejsdJHnsFKs7QAysEUN%252Fh6ltSA3FR64qww0Qvp3A%253D%253D%7Campid%3APL_CLK%7Cclp%3A2334524
https://www.ebay.com/itm/333909214974?_trkparms=ispr%3D1&hash=item4dbe8a46fe:g:wjYAAOSwXZtgQKMK&amdata=enc%3AAQAGAAADAPYe5NmHp%252B2JMhMi7yxGiTJkPrKr5t53CooMSQt2orsSprd4IgPv6LBzlteBBg9Pe7gpGas6KEYWvIQmgmNrIcf1ZIcLwSyYlVIojBTlJPAd4XoDj5k2AzULwOu2K1678su8RhEOIAhD%252FWN3J3erMgWugg2CT0y8zcUjbbWHtNfzYrnVuG%252FUvWmYzvxdGvHZvRdzha0juBNJzGKXnChJ6MECxb2uzy5G631xzrIxblEW3AM1ogDVv19il%252Fn7Vlzr0cERgdjLqGUj5KIynU8Xj9sHRx%252F%252FcSxPq8W4v1RHP%252FYZQhE4keU2U3pZGBCy9hyaYaf5pr78zEcjg2aoyh%252B6DUFkxtjTnmPhNqiwO5QNkl21UaDagoNQYRkZb4iW0QpXX628qHxIqBVL4GjtRczXt%252Bi0ZVn0B6GBqNzHtHarXqCSe7966rspJOMXwYB%252Fj3m%252Fpe3oJO8dKBNDmzxUNhnE4Bf76ZlFiW%252Fh9TXWEO3vdhLjRjjmjJKjgj7IXVorj%252BypBfHCbTXCA7nHsBSsOdNR%252B3LopnwoQutVCsk%252FQ8bESJCn0unvLARcM6wBRakZl3Uxhe1iSnMV%252F69vpTVm2XC1ZjU0IzF7xB5laYPRPcrOwXSJHwZJHkwyziteo%252FWBZNkklgTjY%252BdEanyHKlzppyJWLAufvIbWt4YWy3Xz%252FAKaKScpMGsHWNqEKwGJ%252BPeSFwq57qnm5xK0InzfsHtyVHd6lWoaKqyP8e7nVQBjqfNciDdLD5D3fuiIHQupPyX2m1Z%252B%252FeQOayocP6GV%252BAfSHCS44Y%252Fgh4njFjCVO5KAR%252BZXiNddo%252BfFGSpUZO1q38Cq3MDvyeRF3vYd2r3FNaimwBT2d3%252Fnl3seechJuFBWHONudGgMuSiXwoy66SbYwIj0CD427%252B1FVDHw%252F4LSkJhi78oWKX2I9sGnvHrj4boKie6mlPN6ZGOenVXOpLWNK8ZSN%252FzEqUzt6iC32EFb8rj%252FC4HK9AWddRejsdJHnsFKs7QAysEUN%252Fh6ltSA3FR64qww0Qvp3A%253D%253D%7Campid%3APL_CLK%7Cclp%3A2334524
https://www.ebay.com/itm/313269877281?hash=item48f056fa21:g:hd0AAOSwz6tfknZF
https://www.ebay.com/itm/313269877281?hash=item48f056fa21:g:hd0AAOSwz6tfknZF
https://www.ebay.com/itm/184741430233?_trkparms=ispr%3D1&hash=item2b037283d9:g:TyQAAOSwVYBgZxlp&amdata=enc%3AAQAGAAADAPYe5NmHp%252B2JMhMi7yxGiTJkPrKr5t53CooMSQt2orsS7UXID%252BRPOSNsnm8kYPghtOhpdocScHh%252BDgY2CTi3nJTgQcXQEKAs8Ix13gdusXFa3yngmHdTBh2vatEHVnazTxou3w%252FDC26a237oG00lpNN0M8zpUGIN9nYQpAgSrl8Z2cNTqgManH1%252Bz3LIm4YNAlHJk%252BHZA8%252FzFNts2J8C7tWjwB%252FA16vRrvHG7nYYLh0tdLtgbf0dpc2Qe9fAJlzaEBwz89Vmv30NMzTFBw4HT%252FzDvPHrTnvmygxCs75Law6GL0yq5FZiufYo%252Fj1bGviIrCjul2tV%252FqMzojlafc7De3fEH0%252Fx7e%252B3S%252BRPOUwrq%252BjDlOH8%252Bp7tZBwZd70GEYnMNBPUFcFmnDcsZgJhS4xnlt5ibp7JgMABsL7TnNK6pm0ran5wu7KVyRsCnTEkWCx0WZ9emEe1xzzVQrJt%252B7ICl%252FNqMq9gaz3%252F2O%252B4Zf83FlMWgd2K0kvtYiBYlFzRZTKrLIkJUl9pDo8nYDJROrSUnT3xZdDu38mqKft9ckuwd8LsRn8emIR%252BJJQi2I6M1gWYnuPrD09rQQMKD7FA2VxWfA4JfePSSoAwyFVyvOkYN47cJkG3ymeQJZUZOFXt8h2j%252F3b0KlMlImQcYcancrGMk7cx4AfUBca%252BSPEC8e3w2RIDzp62%252F9If%252FVLm6Vq6rvdjjspmxA9r2LErZAgEIu6%252BXWuF3eicCrtX9dQic3TmmPPeordO3nK2QKgdSc487ywrfOX9i5XmQqmFmOyN5W%252B%252FwDmeGHmb1l1KPnWa14048eIHqDITTFibsKyRk7H04VwWrkqhfOxsrek7VxmnK7Ciqgli22Se7VPqPhlVRddgYe%252FIvp5Yw8%252BGoewf4mpOiRQ%252Bmm5QpRVpA%252BusDd2id6Gz2crCd%252FnoYT9shk8tfXCfGwFson3CxpgjeSoLd1tsQ%252FeY0qgZelpVjKdZ%252BeaaJpiC1uKa4r5FZxxJ0b5VxYp8j6F9255HFQGZzAQ2MVJyu647sA%253D%253D%7Campid%3APL_CLK%7Cclp%3A2334524
https://www.ebay.com/itm/184741430233?_trkparms=ispr%3D1&hash=item2b037283d9:g:TyQAAOSwVYBgZxlp&amdata=enc%3AAQAGAAADAPYe5NmHp%252B2JMhMi7yxGiTJkPrKr5t53CooMSQt2orsS7UXID%252BRPOSNsnm8kYPghtOhpdocScHh%252BDgY2CTi3nJTgQcXQEKAs8Ix13gdusXFa3yngmHdTBh2vatEHVnazTxou3w%252FDC26a237oG00lpNN0M8zpUGIN9nYQpAgSrl8Z2cNTqgManH1%252Bz3LIm4YNAlHJk%252BHZA8%252FzFNts2J8C7tWjwB%252FA16vRrvHG7nYYLh0tdLtgbf0dpc2Qe9fAJlzaEBwz89Vmv30NMzTFBw4HT%252FzDvPHrTnvmygxCs75Law6GL0yq5FZiufYo%252Fj1bGviIrCjul2tV%252FqMzojlafc7De3fEH0%252Fx7e%252B3S%252BRPOUwrq%252BjDlOH8%252Bp7tZBwZd70GEYnMNBPUFcFmnDcsZgJhS4xnlt5ibp7JgMABsL7TnNK6pm0ran5wu7KVyRsCnTEkWCx0WZ9emEe1xzzVQrJt%252B7ICl%252FNqMq9gaz3%252F2O%252B4Zf83FlMWgd2K0kvtYiBYlFzRZTKrLIkJUl9pDo8nYDJROrSUnT3xZdDu38mqKft9ckuwd8LsRn8emIR%252BJJQi2I6M1gWYnuPrD09rQQMKD7FA2VxWfA4JfePSSoAwyFVyvOkYN47cJkG3ymeQJZUZOFXt8h2j%252F3b0KlMlImQcYcancrGMk7cx4AfUBca%252BSPEC8e3w2RIDzp62%252F9If%252FVLm6Vq6rvdjjspmxA9r2LErZAgEIu6%252BXWuF3eicCrtX9dQic3TmmPPeordO3nK2QKgdSc487ywrfOX9i5XmQqmFmOyN5W%252B%252FwDmeGHmb1l1KPnWa14048eIHqDITTFibsKyRk7H04VwWrkqhfOxsrek7VxmnK7Ciqgli22Se7VPqPhlVRddgYe%252FIvp5Yw8%252BGoewf4mpOiRQ%252Bmm5QpRVpA%252BusDd2id6Gz2crCd%252FnoYT9shk8tfXCfGwFson3CxpgjeSoLd1tsQ%252FeY0qgZelpVjKdZ%252BeaaJpiC1uKa4r5FZxxJ0b5VxYp8j6F9255HFQGZzAQ2MVJyu647sA%253D%253D%7Campid%3APL_CLK%7Cclp%3A2334524
https://www.ebay.com/itm/154108126132?_trkparms=ispr%3D1&hash=item23e18f63b4:g:5g0AAOSwkApfch0l&amdata=enc%3AAQAGAAADAPYe5NmHp%252B2JMhMi7yxGiTJkPrKr5t53CooMSQt2orsStEKTPzZMfQmny3knR97t0JsD6L97oauzovvk2KO0WEt%252Fy1DvPmlzbWssMnX7EK9TVYjaGDcIoX%252FGC%252FmDBJiZuzo4Q57rySuBn9egod2B14d0XvKYJrNvSErcJ2RIJIQABAo473RTmNDf6Ql8ivp1PqCbAFg3a3CFzJJNK1in5oOpyIPlur6D%252BrPTA0SbM8%252F6ryLrpO9VpOBncBnX3aQFMBkALPsmmbolhK1Z2wtACsanrnaWudSur0%252BWE2VNOx8K2DSdSW7FqtEDE0lE%252F%252FUhnHvrdqsLg%252F1GsgbpoyWNV1TSap52SOr0Ndsb6HhxIaOdngXwWmW%252BD4qbhHsUxFesHcMrPsOtlb7gIRYj5ubReQpvgK9GiBSCwiEBMUcODZoXhNEsXp9MiBZF9qeWKTApnNy3pbBWAI65p3v0TiawoyWN%252BGywOpl8laWKrZseCWQMn4o0ZmSC08wU%252Fj7Zn2biBdULHfRiJm%252FPvDzSeAVy92JchTe69dUO9%252BHL7%252B5zurnYfPEjLiOaKhHW60bbsO3ru3PZ1RMwF4iMxP%252FgGIKc8xk11Zsms1%252BGfiApbCy7rQraZPQBzQJpzQOIzd7xrkPyOBuNjj2HdPE7bZjLGOCjuIYDIuBxCP0ZMajblQrr5pzvUjdMT4zJ76GmJ28qGDm5TkxD8tDv0eaWnBfDssMpHtAW8GND7g3hE%252Fhqvoc2072E78fzVz0Ts51H%252BW77rrbpC9DmtLHopXEp5fCMcP3vuTv%252BaCqKuaMuy8blc6S6ldjbuqSkRe5qtI5edG5HeingADQenYM%252FbViMlpVwv1ul9GZquueAo89zMOUKKRhsfq6oP4LyLN6%252BNUcOoAxOSBMw7bWC7oYD5yilolDFw7RauJooyv3wMOuZLCABtjABogDu63sdJpcNptiYVj84nsGwDi4AJ4uTPjw1jItB87NskmHFAyY2sdHH%252Be3OqwybMZKg7OKXzx2WPSDPVdN2K5TjZA%253D%253D%7Campid%3APL_CLK%7Cclp%3A2334524

...and so on.

A: You could do a more efficient filtering within css using ^ starts with operator to identify the appropriate links starting with that string. Use a set comprehension to return only unique items.
from bs4 import BeautifulSoup
import requests
url = 'https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2380057.m570.l1313&_nkw=Universal+Adjustable+Hand+Shower+Holder+Suction+Cup+Holder+Full+Plating+Shower+Rail+Head+Holder+Bathroom+Bracket+Stable+rotation&_sacat=0'
r = requests.get(url)
soup = BeautifulSoup(r.content, features="lxml")
links = {i['href'] for i in soup.select('[href^="https://www.ebay.com/itm/"]')}
print(links)

If you wish to specify the href is a descendant of a li then add that into the selector with a descendant combinator and type selector:
links = {i['href'] for i in soup.select('li [href^="https://www.ebay.com/itm/"]')}


text:
Q: SSD Cache with FDE (TrueCrypt, BitLocker, etc) on Windows I wanted to bring back an old question, but with a twist. It has been answered, how an SSD could be used as a caching drive for a larger, mechanical drive. What I am looking for is to have the same, but for a drive which is encrypted with TrueCrypt or BitLocker
This question is about windows. I am aware of linux solutions, such as flashcacne and bcache. They all work on a block level, therefore could be used on top of encrypted volume, transparently. When SSD dies, the underlying file system on block device is intact, could be mounted by itself. Very elegant solution, and works very well, but the question is about Windows.
I am not certain about how Windows caching solutions (ExpressCache, DataPlex, etc) work. If SSD is used caching on top of already mounted drive, then encryption is as good as non-existent, because all the files you work with are cached unencrypted on SSD. Has there been any research on possible solutions, where it is verified, that Windows is not writing any plaintext data to SSD?
Maybe, a hardware solution?..

A: I don't know how to answer that directly as I have little experience with external SSD cache. OTOH, if you're looking for a faster drive with the price/GB of a mechanical drive I would suggest looking for a Hybrid drive like the Seagate SSHD's. These drives comes with an on-board SSD cache which can be used for write caching and possibly read caching too. Since it works on the disk directly, controlled by the disk firmware, it shows up as a normal drive and everything stored in the SSD cache is encrypted the same way as data making it to the spindles.
On another note, you have to consider that for as long as your computer is powered on (whenever it's on, standby, suspend to ram) the encryption key is kept in RAM and can be retrieved easily with specialized tools. The data is even kept during a full power cycle, and by cooling down the ram modules the data can be retained intact for several minutes without any power. This means even if you machine is protected by secure boot an attacker can move the DIMMs to another computer and boot up a tool to recover the encryption key.
With that in mind, even an unencrypted ssd cache could be considered OK if it's wiped clean during the computer shutdown, in which case the only place that wouldn't be covered would be leaving the computer off after a crash/power failure.


text:
Q: how can get this codeNumber in page.html?id=

                CTO-Tourism Org Office

                HOSPITAL

I am building a web index phone gap app in dreamweaver (2.3.0 phonegap) with web sql, well, if I want each listing in the web index has a page get data from db, of type page.html?id=5 eg if codeNumber of listing in db is 5...to eject data, how can get this codeNumber/id in page.html?

A: try this piece of code in php
        if(isset($_GET['id'])){
            echo($_GET['id']);
        }

A: I don't know about the difference between mobile devices and such, but I know of two ways of doing this (there are many more though).
PHP
if (isset($_GET['id'])) {
   $idFromUrl = $_GET['id'];
}
//now the id number is stored in variable $idFromUrl

JavaScript
var split = location.search.replace('?', '').split('=')

//split[0] is your var name
//split[1] is your var value


text:
Q: Exporting keychain: You failed to provide the necessary administrator authorization I'm trying to export private keys from Keychains application and getting error.
You failed to provide the necessary administrator authorization.
UPD:
Open keychains, in My Certificates - login found my keypair, right click on private one, Export as p12 on desktop, specify Fine password - error!

A: I had the same, but something was totally messed up and I'm still not sure what caused it.
For one thing, I had somewhere in the process clicked 'always allow' and entered the wrong password. It never asked me for a password afterwards, and kept insisting I failed. Miserably.
Anyway,  after I had clicked the lock to 'lock the login keychain' it suddenly started asking for the password again. Then it worked.

A: I exported  two private keys following the steps you reported, and I was able to achieve it both the times.
From the reported error, it seems you entered the wrong password when Keychain Access asked you the login keychain password. I entered the administrator password (the account I used in the test is an account that is allowed to administer my Mac), and I didn't get any error message. By a coincidence, I used the administrative password even when I was asked for a password the first time; I don't think that makes any difference.

A: I'm on Mac OS X 10.6 on a Mac Mini server.
While exporting a private key, the error I get is:

An error has occurred. Unable to export an item.
  You failed to provide the necessary administrator authorization.

Solution:
In order to export a private key out of the Keychain it is critical that you reboot the server and log in as root.

*

*ID: root

*Password: your administrator password

Proceed to Keychain Access and select your Keychain (like "System") and unlock it using root and your administrator password.
Now export as usual.

A: Whenever keychain is doing some problem, just click the lock to 'lock the login keychain', and afterward, click it again to unlock. Keychain will ask for the system password and then everything is working as normal.
The main issue is probably entering a wrong password once which freaks Keychain out.


text:
Q: Safe to assume Normal Distribution? I am reading a textbook called Bayesian Statistics: the Fun Way, and chapter 10 touches on integrating the pdf of a normal distribution for a sample of 6 observations with a mean of 20.6 and standard deviation of 1.62 from x=10 to x=18.
I understand how the mean and sd was calculated, but is it safe to assume that this sample of 6 follows a normal distribution and could infer its pdf to be a normal distribution pdf?


text:
Q: insertions into c++ map STL container is failing Please see the following code to understand my question better.
class compareByValue {
  public:
    bool operator()(const string* s1, const string* s2) const
    {
      if (s1 == s2)
        return true;
      if ((s1==NULL) || (s2==NULL))
        return false;
      return (0 == s1->compare(s2->c_str()));
    }
};

map<string*, string*, compareByValue> nodeIdToIpAddress;

for (int i = 0; i < nrec; ++i) {
  nodeIdToIpAddress[ptr1[i]] = ptr2[i];
  cout << "Added " << *(ptr1[i]) << " , " << *(ptr2[i]) << endl;
}

cout << "map has " << nodeIdToIpAddress.size() << " elements!" << endl;

I have a map that maintains key,value pairs which are pointers to string objects. I'm sure that neither keys nor values are NULL pointers. When I run the above program (well, I skipped surrounding code to make it easier to understand), "Added ... ..." gets printed 49 times. ptr1[i], ptr2[i] are pointers to string objects and are not NULL pointers because my program doesn't segfault.
The problem I have is, when I print size of map at the end, it says map has only 1 element in it.
I would appreciate if someone can give me directions to find the fix. Thanks in advance.
EDIT: @Mark solution worked like charm for me. thanks
EDIT2: After seeing valuable feedback from @Mark and @James, I think I don't need to store pointers to strings in my map. I'm going to change my code to store strings as key/values which means I don't need custom comparator functor. Thanks a lot.

A: Your comparator is wrong:  if (s1 == s2) must return false and the comparator must produce a strict weak ordering.
[For what it's worth, using a pointer type as the key for a std::map is unusual at best.]

A: Your comparison operator isn't right. As long as you can assume that no nulls are added, you can throw if you detect any:
bool operator()(const string* s1, const string* s2) const
{
  if (!s1 || !s2) throw std::runtime_error("Whatever");

  return *s1 < *s2;
}

EDIT: I should have elaborated on the reasoning here a bit more. The comparison operation that you pass into a std::map (or set or sort for example) must satisfy strict weak ordering. This basically means that x OP x is false, if x OP y is true then y OP x is false, and that x OP y, y OP z implies x OP z (as well as other rules regarding items that can't be compared).
Your function didn't satisfy this in several ways: if (s1 == s2) needs to return false. if ((s1==NULL) || (s2==NULL)) can't return false because it would imply that null < anything and anything < null. You'd have to split it up and return true for s1 null and false for s2 null. return (0 == s1->compare(s2->c_str())); is incorrect because it's a three-way result rather than a < relation.
Since you specified that nulls would never be inserted, the simplest resolution seemed to be to throw an exception in that case (if either was null) and thenuse the string built-in operator.
All that being said now, I would strongly consider NOT storing strings by pointer in containers unless you have actual evidence that it's a performance bottleneck. A simpler design is easier to maintain and keep correct, which tends to lead to better programs long-term.


text:
Q: Understanding the 10:1 events per variable rule I read online that 1:10 rule is based on the frequency of lower occurring class.
I have a dataset with 4712 records. There are 1558 records labeled yes, and 3554 records labeled no. In my case, the frequency of the less commonly occurring class is 1558. According to the 1:10 rule, am I right to understand that it is calculated like 1558/10 = 155.8 further equals 150 predictors? So In my logistic regression, I can use 150 variables/input features to the model without the risk of overfitting. Am I right?

*

*Do we also have to look at the frequency of the other (high occurring) class to determine the no of predictors that I can use? If yes, can you share me as to what has to be done to determine the predictor count?

(I am aware that we could also use 1:20 or 1:50 rule. But my question is mainly:)

*Are there any other considerations for determining the number of predictors in a logistic regression model?

*How do people calculate the minimum sample size required for analysis based on this? Is events per variable about that? (For example, I can't have 20 records and 60 predictors. It may not make sense.)
Similarly, can you people help me understand how to determine the number of predictors and sample size required for logistic regression? Is it called a 'data hungry model'?

A: This is a "rule of thumb" (English usage: a rough guide, in this case a guide to study design and initial modeling), not a strict "rule" that by itself ensures a lack of overfitting. Harrell's course notes and book provide (in their 4th Chapters) references to several studies that evaluated the sample sizes necessary to avoid overfitting in low signal-to-noise situations like observational studies in medicine or social sciences. Values on the order of 10 to 20 members of the minority class (or events in survival analysis) per candidate predictor (hence the generic "events-per-predictor" terminology) were found to do a reasonable job of avoiding overfitting. You can think about this as the minority class being the hardest to fit if there are too few cases, and the harder you try to fit (by adding in more predictors) the more likely that you will overfit.
For your questions:

*

*I can't rule out some influence of the majority-class size, but as this is a rough guide, not a strict "rule," I don't see much reason to worry about the majority-class size.

*As the Harrell references linked above make clear, much also depends on the nature of the study. Well-controlled experiments or experiments with small errors in the physical sciences might only need a lower ratio. If the values of the predictor variables are narrowly distributed or you have small numbers of cases with a particular value of a categorical predictor, you might need a higher ratio. If you need a precise estimate of the intercept in a logistic regression you may need more. As noted in comments on your question, there are alternatives to the simple events-per-predictor guideline that you could consider.

*Events-per-predictor is a starting point for study design and analysis in the fields for which this rule of thumb was determined. You still need to document that your model did not, in fact, overfit substantially. Building models from multiple bootstrapped samples, evaluated against the full data set, is one good way to do this. Harrell's rms package in R provides tools for such validation and calibration of many types of regression models, including logistic. If you are planning a prospective study and have some ideas about the spreads of your predictor values and their associations with outcome, you can do a formal power analysis to help determine the necessary study size.
Note that you can have "20 records and 60 predictors" or even more dramatic excesses of predictors to cases in some areas of interest, which can be called the "$p \gg n$" problem. For example, studies of gene expression in biology can have almost 20,000 potential predictors (the mRNA level for each of 20,000 genes) to associate with only a few dozen events (e.g., cancer deaths). Minimizing overfitting in such cases often involves a regularization approach like LASSO or ridge regression, which puts a penalty on the magnitudes of regression coefficients (many or most penalized down to 0 in LASSO). This trades off some systematic bias in the predictions against less variance when the model is applied to new data. These methods can be thought of as reducing the effective numbers of predictors as their coefficient magnitudes are reduced.
As you seem to be just starting serious modeling of this type, I strongly recommend that you consult references like those by Harrell linked above to understand the principles, and find a local statistics expert who can work with you and your colleagues to apply the principles to your study.


text:
Q: Finding flaw in bogus k-coloring proof I'm following along an MIT discrete maths course, one of the assignments states the problem of finding the flaw in a proof for $k$-coloring (the course only considers simple graphs without loops):

False Claim. Let $G$ be a (simple) graph with maximum degree at most $k$. If $G$ also has a vertex of degree less than $k$, then $G$ is $k$-colorable.
a) Give a counterexample to the False Claim when $k = 2$.

Maybe I think a bit too simple about the problem, but it says "… If $G$ also has a vertex of degree less than $k$ …", that means that $G$ only needs to have at least one node with degree less than the maximum degree $k$.
So to answer a) I thought of this graph:

The maximum degree here is 2 and it also has one node that has degree less than 2, but you still need $k+1$ colors to color it, so the claim can't be true in this case.
Next, they also provide a bogus proof for the claim:

Identify the exact sentence where the proof goes wrong.
Induction hypothesis: P(n) is defined to be: Let $G$ be a graph with $n$ vertices and maximum degree at most $k$. If $G$ also has a vertex of degree less than $k$, then $G$ is $k$-colorable.
Base case: ($n=1$) $G$ has only one vertex and so is 1-colorable. So P (1) holds.
Inductive step: We may assume $P(n)$. To prove $P(n + 1)$, let $G_{n+1}$ be a graph with n + 1 vertices and maximum degree at most k. Also, suppose $G_{n+1}$ has a vertex, $v$, of degree less than k. We need only prove that $G_{n+1}$ is $k$-colorable.
To do this, first remove the vertex v to produce a graph, $G_n$, with n vertices. Removing v reduces the degree of all vertices adjacent to v by 1. So in $G_n$, each of these vertices has degree less than k. Also the maximum degree of $G_n$ remains at most k. So $G_n$ satisfies the conditions of the induction hypothesis $P(n)$. We conclude that $G_n$ is k-colorable.
Now a k-coloring of Gn gives a coloring of all the vertices of $G_{n+1}$, except for v. Since v has degree less than k, there will be fewer than k colors assigned to the nodes adjacent to v. So among the k possible colors, there will be a color not used to color these adjacent nodes, and this color can be assigned to v to form a k-coloring of $G_{n+1}$.

We need to identify where the proof goes wrong. This one I find a bit harder, as the proof is relatively long.
For me, the base case seems off. It reads:

Base case: (n=1) G has only one vertex and so is 1-colorable. So P (1) holds.

It's true that you can color a one node graph with one color. But the claim talks about a graph that has degree at most k (which is 0 in a one node graph) that also has a vertex with a degree less than k (which would be -1 or less?), but the single node in that graph has degree k (which is 0 and equals the maximum degree of that graph which is also 0).
Am I on the right track or is the proof going wrong somewhere else?

A: Your counterexample is not correct, as it has maximum degree $3$. Hint: think about disconnected graphs.
The problem with the proof is not the base case, that is fine (you are doing induction on $n$, not $k$, so $k$ is fixed and could be much more than the maximum degree for small cases). The issue is that when they remove a vertex $v$, they say each of its neighbours will now have degree less than $k$. What if it didn't have any neighbours?

A: Especially Lime's answer covers basically everything, also TMM comment makes a lot of sense. Because I wanted to draw a graph again, here is my updated answer to the problem:

So in this graph we have max. degree $k = 2$, and also one node with degree less than $k$ but still need $k + 1 = 3 $ colors.
Indeed the basecase is ok, because the one-node graph can be colored in $k$ colors, that's just fact and we are inducting on the number of vertices, so that's fine. I was interpreting the basecase too literal.
Now where the proof goes wrong, I think there are two ways to see it:

*

*like TMM said, if we say "Also, suppose $G_{n+1}$ has a vertex, $v$, of degree less than $k$. […] To do this, first remove the vertex $v$ to produce a graph, $G_n$ […]" but if the graph only had one such vertex and we remove it, then we can't make use of P(n). So that would mean the proof goes wrong at "So $G_n$ satisfies the conditions of the induction hypothesis P(n)"

*like Especially Lime said, if we think of a graph like shown above with disconnected nodes, "Removing $v$ reduces the degree of all vertices adjacent to $v$ by 1." doesn't work because if $v$ is disconnected there are no nodes adjacent to $v$ and therefore the degree of all other nodes in the graph is not affected by removing $v$.


text:
Q: ks.test with left truncated weibull The Distribution I accept my values to follow is a left truncated weibull distribution.  I do know the parameters a, shape and scale of this distribution for using the ptrunc command:
require(truncdist);

ptrunc(x,"weibull",a=a,scale=b,shape=c)

so I want the ks.test command (see below) to use the described left truncated weibull distribution instead of the "normal weibull".
myvalues<-c(37.5, 35.4, 27.1, 32.9, 35.9, 35.1, 34.1, 32.5, 35.5, 31.5, 38.2, 36.1,,29.9, 30.1, 34.7, 38.7 ,32.3, 38.0, 34.9, 44.2, 35.8, 30.8, 39.3, 26.0, 34.2, 40.0, 36.1 ,41.5 ,32.8, 31.9, 41.3 ,30.5, 39.9, 35.0 ,31.2 ,35.0, 30.3, 29.0, 34.4, 35.7, 34.1, 35.4);
a<-7;
scale<-36.37516;
shape<-9.437013;

So I do know, that in this case it is not necessary to do the left-side truncation. But in others it will be.
ks.test(myvalues,"pweibull",scale=b,shape=c) #for normal weibull

but
ks.test(myvalues,ptrunc(x,"weibull",a=a,scale=b,shape=c)) # for leftruncated

gives a wrong result.

A: First of all, ptrunc should be replaced by rtrunc. ptrunc gives a vector of probability values. But by the documentation of ks.test we need a sample, and this is what rtrunc gives us. If the argument a of rtrunc is set to -Inf, there is no truncation and the result with a=-Inf is indeed the same as with a=7:
library(truncdist)

myvalues <- c(37.5, 35.4, 27.1, 32.9, 35.9, 35.1, 34.1, 32.5, 35.5, 31.5, 38.2, 36.1,29.9, 30.1, 34.7, 38.7 ,32.3, 38.0, 34.9, 44.2, 35.8, 30.8, 39.3, 26.0, 34.2, 40.0, 36.1 ,41.5 ,32.8, 31.9, 41.3 ,30.5, 39.9, 35.0 ,31.2 ,35.0, 30.3, 29.0, 34.4, 35.7, 34.1, 35.4)

a <- 7
scale<-36.37516
shape <- 9.437013

set.seed(1)
y1 <- rtrunc(myvalues,"weibull",a=-Inf,scale=scale,shape=shape)

set.seed(1)
y2 <- rtrunc(myvalues,"weibull",a=a,scale=scale,shape=shape)

set.seed(1)
ks0 <- ks.test( myvalues, "pweibull",scale=scale,shape=shape  )

set.seed(1)
ks1 <- ks.test( myvalues, y1 )

set.seed(1)
ks2 <- ks.test( myvalues, y2 )

.
> ks1

    Two-sample Kolmogorov-Smirnov test

data:  myvalues and y1
D = 0.21429, p-value = 0.2898
alternative hypothesis: two-sided

> ks2

    Two-sample Kolmogorov-Smirnov test

data:  myvalues and y2
D = 0.21429, p-value = 0.2898
alternative hypothesis: two-sided

But still the result of ks.test( myvalues, "pweibull",scale=scale,shape=shape  ) is different:
> ks0

    One-sample Kolmogorov-Smirnov test

data:  myvalues
D = 0.15612, p-value = 0.2576
alternative hypothesis: two-sided

The reason is that myvalues is too small. If we make it larger in the call of rtrunc (not ks.test), ks0, ks1, and ks2 are almost the same:
library(truncdist)

myvalues <- c(37.5, 35.4, 27.1, 32.9, 35.9, 35.1, 34.1, 32.5, 35.5, 31.5, 38.2, 36.1,29.9, 30.1, 34.7, 38.7 ,32.3, 38.0, 34.9, 44.2, 35.8, 30.8, 39.3, 26.0, 34.2, 40.0, 36.1 ,41.5 ,32.8, 31.9, 41.3 ,30.5, 39.9, 35.0 ,31.2 ,35.0, 30.3, 29.0, 34.4, 35.7, 34.1, 35.4)

myManyValues <- c(outer((0:9999)/100000,myvalues,"+"))

a <- 7
scale<-36.37516
shape <- 9.437013

set.seed(1)
y1 <- rtrunc(myManyValues,"weibull",a=-Inf,scale=scale,shape=shape)

set.seed(1)
y2 <- rtrunc(myManyValues,"weibull",a=a,scale=scale,shape=shape)

set.seed(1)
ks0 <- ks.test( myvalues, "pweibull",scale=scale,shape=shape  )

set.seed(1)
ks1 <- ks.test( myvalues, y1 )

set.seed(1)
ks2 <- ks.test( myvalues, y2 )

.
> ks0

    One-sample Kolmogorov-Smirnov test

data:  myvalues
D = 0.15612, p-value = 0.2576
alternative hypothesis: two-sided

> ks1

    Two-sample Kolmogorov-Smirnov test

data:  myvalues and y1
D = 0.15655, p-value = 0.2548
alternative hypothesis: two-sided

> ks2

    Two-sample Kolmogorov-Smirnov test

data:  myvalues and y2
D = 0.15655, p-value = 0.2548
alternative hypothesis: two-sided

Now let's see what happens when we do truncate the distribution:
library(truncdist)

myvalues <- c(37.5, 35.4, 27.1, 32.9, 35.9, 35.1, 34.1, 32.5, 35.5, 31.5, 38.2, 36.1,29.9, 30.1, 34.7, 38.7 ,32.3, 38.0, 34.9, 44.2, 35.8, 30.8, 39.3, 26.0, 34.2, 40.0, 36.1 ,41.5 ,32.8, 31.9, 41.3 ,30.5, 39.9, 35.0 ,31.2 ,35.0, 30.3, 29.0, 34.4, 35.7, 34.1, 35.4)

myManyValues <- c(outer((0:9999)/100000,myvalues,"+"))

a <- 29
scale<-36.37516
shape <- 9.437013

set.seed(1)
y1 <- rtrunc(myManyValues,"weibull",a=-Inf,scale=scale,shape=shape)

set.seed(1)
y2 <- rtrunc(myManyValues,"weibull",a=a,scale=scale,shape=shape)

set.seed(1)
ks0 <- ks.test( myvalues, "pweibull",scale=scale,shape=shape  )

set.seed(1)
ks1 <- ks.test( myvalues, y1 )

set.seed(1)
ks2 <- ks.test( myvalues, y2 )

.
> ks0

    One-sample Kolmogorov-Smirnov test

data:  myvalues
D = 0.15612, p-value = 0.2576
alternative hypothesis: two-sided

> ks1

    Two-sample Kolmogorov-Smirnov test

data:  myvalues and y1
D = 0.15655, p-value = 0.2548
alternative hypothesis: two-sided

> ks2

    Two-sample Kolmogorov-Smirnov test

data:  myvalues and y2
D = 0.2059, p-value = 0.05683
alternative hypothesis: two-sided

A: You are using the ptrunc function incorrectly (I assume), it needs to be fed a sequence of quantiles. Below I calculate the mean and standard deviation of the Weibull based on your scale and shape parameters, then sample from 5 standard deviations above and below to produce a comparison set.
require(truncdist);

myvalues <- c(37.5, 35.4, 27.1, 32.9, 35.9, 35.1, 34.1, 32.5, 35.5, 31.5, 38.2, 36.1,29.9, 30.1, 34.7, 38.7 ,32.3, 38.0, 34.9, 44.2, 35.8, 30.8, 39.3, 26.0, 34.2, 40.0, 36.1 ,41.5 ,32.8, 31.9, 41.3 ,30.5, 39.9, 35.0 ,31.2 ,35.0, 30.3, 29.0, 34.4, 35.7, 34.1, 35.4);
a <- 7;
scale <- 36.37516;
shape <- 9.437013;

# Calculate standard deviation of the weibull
weib_mean <- scale * gamma(1 + 1/shape)
weib_sd <- sqrt((scale^2) * (gamma(1 + 2/shape) - (gamma(1 + 1/shape))^2))

# Get a sample
quant <- seq(weib_mean - 5 * weib_sd, weib_mean + 5 * weib_sd, length.out = 1E5)
weibull_samp <- ptrunc(quant, "weibull", a = a, scale = scale, shape = shape)

# Take a look
plot(weibull_samp ~ quant)

# Use with test
> ks.test(sort(myvalues), weibull_samp)
       Two-sample Kolmogorov-Smirnov test

data:  sort(myvalues) and weibull_samp
D = 1, p-value < 2.2e-16
alternative hypothesis: two-sided


text:
Q: Why the action of $D_{2n}$ on $\{a_i\}$ should look like this? Here is the question I want to understand:
Assume $n$ is an even positive integer and show that $D_{2n}$ acts on the set consisting of pairs of opposite vertices of a regular $n$-gon. Find the kernel of this action (label vertices as usual).
Here is a part of the solution I found online:
" Let us assume that $n$ is even, and label the vertices of the $n$-gon clockwise as: $0,1,2, \dots, n-1.$ Now by using the set of ordered pairs defined by $\{a_i\},$ we can represent the $n/2$ pairs of opposite vertices as: $$\{a_i\} = \Big\{\left( i, \frac{n}{2} + i\right) : 0 \leq i \leq \frac{n}{2} \Big\}$$
Now on the elements $\{a_i\}$ define the action of $D_{2n},$ so that the elements of $D_{2n}$ permute the set as follows:
$r^k a_i = a_{{i-k}\mod n}$ and $s^k a_i = a_{{i-kn/2}\mod n}$ "
But I do not understand why the actions of $r^k$ and $s^k$ on $a_i$ looks like this. Could anyone clarify this to me please?


text:
Q: Non-linear trend reduction with missing data How can I reduce a non-linear trend of some data series if there are parts of "no data", represented by the value 99999? For example:
data={{124.55,368.632}, {124.6,281.976}, {124.65,200.952}, {124.7,91.384}, {124.75,-60.424},
{124.8,-282.504}, {124.85,-541.448}, {124.9,-378.76}, {124.95,99999}, {125,99999},
{125.05,99999}, {125.1,99999}, {125.15,99999}, {125.2,99999}, {125.25,99999}, {125.3,99999},
{125.35,265.46}, {125.4,376.75}, {125.45,462.54},...,{178.95,284.46}}

Normally, I am successful in reducing the non-linear trend of the data via
lm = LinearModelFit[data, {a, a^2, a^3, a^4, a^5},a];
Do[aha = Last[Take[data, {m, m}]]; y = Last[aha];
  x = First[aha]; new[m] = y - lm[x], {m, idim}];

but have no idea how to do the trend-reduction between those data gaps (i.e., outside of the regions with data = 99999). The position of those regions is not constant. After the reduction is performed, the position of the "no data"-values should be the same as before. Due to answer 1, unfortunately there is no periodically or cyclically behaviour in the data at all. Here, for example, is another, but complete data set:
 {{100.00,       0.303999        },
   {100.05,       0.303999        },
   {100.09,       0.176000        },
   {100.15,       0.303999        },
   {100.20,       0.176000        },
   {100.25,       0.303999        },
   {100.30,       0.431999        },
   {100.34,       0.431999        },
   {100.40,       0.559999        },
   {100.45,       0.687999        },
   {100.50,       0.687999        },
   {100.55,       0.943999        },
   {100.59,        1.07200        },
   {100.65,        1.20000        },
   {100.70,        1.32800        },
   {100.75,        1.32800        },
   {100.80,        1.20000        },
   {100.84,        1.20000        },
   {100.90,        1.20000        },
   {100.95,        1.07200        },
   {101.00,        1.07200        },
   {101.05,        1.07200        },
   {101.09,        1.07200        },
   {101.15,        1.07200        },
   {101.20,        1.07200        },
   {101.25,        1.07200        },
   {101.30,       0.943999        },
   {101.34,       0.943999        },
   {101.40,       0.943999        },
   {101.45,       0.687999        },
   {101.50,       0.431999        },
   {101.55,       0.303999        },
   {101.59,       4.800009E-002   },
   {101.65,      -8.000003E-002   },
   {101.70,      -0.207999        },
   {101.75,      -0.464000        },
   {101.80,      -0.719999        },
   {101.84,      -0.847999        },
   {101.90,      -0.847999        },
   {101.95,      -0.975999        },
   {102.00,       -1.10400        },
   {102.05,       -1.23200        },
   {102.09,       -1.36000        },
   {102.15,       -1.36000        },
   {102.20,       -1.36000        },
   {102.25,       -1.36000        },
   {102.30,       -1.36000        },
   {102.34,       -1.23200        },
   {102.40,       -1.10400        },
   {102.45,       -1.10400        },
   {102.50,      -0.975999        },
   {102.55,      -0.847999        },
   {102.59,      -0.719999        },
   {102.65,      -0.591999        },
   {102.70,      -0.464000        },
   {102.75,      -0.207999        },
   {102.80,       4.800009E-002   },
   {102.84,       4.800009E-002   },
   {102.90,       0.431999        },
   {102.95,       0.687999        },
   {103.00,       0.943999        },
   {103.05,        1.20000        },
   {103.09,        1.32800        },
   {103.15,        1.32800        },
   {103.20,        1.58400        },
   {103.25,        1.71200        },
   {103.30,        1.84000        },
   {103.34,        1.96800        },
   {103.40,        2.09600        },
   {103.45,        2.22400        },
   {103.50,        2.22400        },
   {103.55,        2.35199        },
   {103.59,        2.35199        },
   {103.65,        2.48000        },
   {103.70,        2.48000        },
   {103.75,        2.60800        },
   {103.80,        2.86399        },
   {103.84,        2.86399        },
   {103.90,        2.86399        },
   {103.95,        2.86399        },
   {104.00,        2.99200        },
   {104.05,        2.86399        },
   {104.09,        2.73600        },
   {104.15,        2.60800        },
   {104.20,        2.60800        },
   {104.25,        2.73600        },
   {104.30,        2.48000        },
   {104.34,        2.48000        },
   {104.40,        2.48000        },
   {104.45,        2.35199        },
   {104.50,        2.22400        },
   {104.55,        2.09600        },
   {104.59,        1.96800        },
   {104.65,        1.84000        },
   {104.70,        1.84000        },
   {104.75,        1.71200        },
   {104.80,        1.58400        },
   {104.84,        1.71200        },
   {104.90,        1.45600        },
   {104.95,        1.45600        },
   {105.00,        1.32800        },
   {105.05,        1.32800        },
   {105.09,        1.07200        },
   {105.15,        1.07200        },
   {105.20,       0.943999        },
   {105.25,       0.943999        },
   {105.30,       0.943999        },
   {105.34,       0.815999        },
   {105.40,       0.559999        },
   {105.45,       4.800009E-002   },
   {105.50,      -0.336000        },
   {105.55,      -0.975999        },
   {105.59,       -1.36000        },
   {105.65,       -2.00000        },
   {105.70,       -2.51200        },
   {105.75,       -2.89599        },
   {105.80,       -3.02400        },
   {105.84,       -3.02400        },
   {105.90,       -2.89599        },
   {105.95,       -2.12800        },
   {106.00,       -1.23200        },
   {106.05,      -0.464000        },
   {106.09,      -8.000003E-002   },
   {106.15,       0.303999        },
   {106.20,       0.559999        },
   {106.25,       0.687999        },
   {106.30,       0.943999        },
   {106.34,        1.07200        },
   {106.40,        1.32800        },
   {106.45,        1.45600        },
   {106.50,        1.58400        },
   {106.55,        1.58400        },
   {106.59,        1.58400        },
   {106.65,        1.58400        },
   {106.70,        1.58400        },
   {106.75,        1.45600        },
   {106.80,        1.32800        },
   {106.84,        1.45600        },
   {106.90,        1.32800        },
   {106.95,        1.32800        },
   {107.00,        1.32800        },
   {107.05,        1.20000        },
   {107.09,        1.07200        },
   {107.15,       0.943999        },
   {107.20,       0.943999        },
   {107.25,       0.815999        },
   {107.30,       0.815999        },
   {107.34,       0.687999        },
   {107.40,       0.559999        },
   {107.45,       0.559999        },
   {107.50,       0.559999        },
   {107.55,       0.431999        },
   {107.59,       0.431999        },
   {107.65,       0.559999        },
   {107.70,       0.431999        },
   {107.75,       0.687999        },
   {107.80,       0.815999        },
   {107.84,        1.07200        },
   {107.90,        1.07200        },
   {107.95,        1.32800        },
   {108.00,        1.45600        },
   {108.05,        99999.0        },
   {108.09,        99999.0        },
   {108.15,        99999.0        },
   {108.20,        99999.0        },
   {108.25,        99999.0        },
   {108.30,        99999.0        },
   {108.34,        99999.0        },
   {108.40,        99999.0        },
   {108.45,        99999.0        },
   {108.50,        99999.0        },
   {108.55,        99999.0        },
   {108.59,        99999.0        },
   {108.65,        99999.0        },
   {108.70,        99999.0        },
   {108.75,        99999.0        },
   {108.80,        99999.0        },
   {108.84,        99999.0        },
   {108.90,        99999.0        },
   {108.95,        99999.0        },
   {109.00,        99999.0        },
   {109.05,        99999.0        },
   {109.09,        99999.0        },
   {109.15,        99999.0        },
   {109.20,        99999.0        },
   {109.25,        99999.0        },
   {109.30,        99999.0        },
   {109.34,        99999.0        },
   {109.40,        99999.0        },
   {109.45,        99999.0        },
   {109.50,        99999.0        },
   {109.55,        99999.0        },
   {109.59,        99999.0        },
   {109.65,        99999.0        },
   {109.70,        99999.0        },
   {109.75,        99999.0        },
   {109.80,        99999.0        },
   {109.84,        99999.0        },
   {109.90,        99999.0        },
   {109.95,        99999.0        },
   {110.00,        99999.0        },
   {110.05,        99999.0        },
   {110.09,        99999.0        },
   {110.15,        99999.0        },
   {110.20,        99999.0        },
   {110.25,        99999.0        },
   {110.30,        99999.0        },
   {110.34,        99999.0        },
   {110.40,        99999.0        },
   {110.45,        99999.0        },
   {110.50,        99999.0        },
   {110.55,        99999.0        },
   {110.59,        99999.0        },
   {110.65,        99999.0        },
   {110.70,        99999.0        },
   {110.75,        99999.0        },
   {110.80,        99999.0        },
   {110.84,        99999.0        },
   {110.90,        99999.0        },
   {110.95,        99999.0        },
   {111.00,        99999.0        },
   {111.05,        99999.0        },
   {111.09,        99999.0        },
   {111.15,        99999.0        },
   {111.20,        99999.0        },
   {111.25,        99999.0        },
   {111.30,        99999.0        },
   {111.34,        99999.0        },
   {111.40,        99999.0        },
   {111.45,        99999.0        },
   {111.50,        99999.0        },
   {111.55,        99999.0        },
   {111.59,        99999.0        },
   {111.65,        99999.0        },
   {111.70,        99999.0        },
   {111.75,        99999.0        },
   {111.80,        99999.0        },
   {111.84,        99999.0        },
   {111.90,        99999.0        },
   {111.95,        99999.0        },
   {112.00,       4.800009E-002   },
   {112.05,      -8.000003E-002   },
   {112.09,      -8.000003E-002   },
   {112.15,      -8.000003E-002   },
   {112.20,      -8.000003E-002   },
   {112.25,      -8.000003E-002   },
   {112.30,      -0.336000        },
   {112.34,      -0.464000        },
   {112.40,      -0.336000        },
   {112.45,      -0.336000        },
   {112.50,      -0.336000        },
   {112.55,      -0.336000        },
   {112.59,      -0.336000        },
   {112.65,      -0.336000        },
   {112.70,      -8.000003E-002   },
   {112.75,       4.800009E-002   },
   {112.80,       0.176000        },
   {112.84,       0.303999        },
   {112.90,       0.559999        },
   {112.95,       0.687999        },
   {113.00,       0.943999        },
   {113.05,        1.07200        },
   {113.09,        1.20000        },
   {113.15,        1.45600        },
   {113.20,        1.71200        },
   {113.25,        1.96800        },
   {113.30,        2.35199        },
   {113.34,        2.86399        },
   {113.40,        3.12000        },
   {113.45,        3.37599        },
   {113.50,        3.63200        },
   {113.55,        3.88799        },
   {113.59,        3.88799        },
   {113.65,        3.88799        },
   {113.70,        4.01600        },
   {113.75,        3.88799        },
   {113.80,        4.01600        },
   {113.84,        3.88799        },
   {113.90,        3.75999        },
   {113.95,        3.50400        },
   {114.00,        2.99200        },
   {114.05,        2.48000        },
   {114.09,        1.96800        },
   {114.15,        1.58400        },
   {114.20,       0.943999        },
   {114.25,       0.431999        },
   {114.30,      -0.336000        },
   {114.34,      -0.847999        },
   {114.40,       -1.23200        },
   {114.45,       -1.61600        },
   {114.50,       -2.00000        },
   {114.55,       -2.25599        },
   {114.59,       -2.38399        },
   {114.65,       -2.51200        },
   {114.70,       -2.64000        },
   {114.75,       -2.89599        },
   {114.80,       -3.02400        },
   {114.84,       -2.89599        },
   {114.90,       -2.76799        },
   {114.95,       -2.64000        },
   {115.00,       -2.38399        },
   {115.05,       -2.25599        },
   {115.09,       -2.00000        },
   {115.15,       -1.74400        },
   {115.20,       -1.48800        },
   {115.25,       -1.23200        },
   {115.30,      -0.975999        },
   {115.34,      -0.719999        },
   {115.40,      -0.464000        },
   {115.45,      -0.207999        },
   {115.50,      -0.207999        },
   {115.55,       4.800009E-002   },
   {115.59,       4.800009E-002   },
   {115.65,       4.800009E-002   },
   {115.70,       4.800009E-002   },
   {115.75,      -8.000003E-002   },
   {115.80,       4.800009E-002   },
   {115.84,      -8.000003E-002   },
   {115.90,      -0.207999        },
   {115.95,      -0.464000        },
   {116.00,      -0.719999        },
   {116.05,      -0.847999        },
   {116.09,      -0.975999        },
   {116.15,       -1.10400        },
   {116.20,       -1.36000        },
   {116.25,       -1.23200        },
   {116.30,       -1.23200        },
   {116.34,       -1.23200        },
   {116.40,       -1.10400        },
   {116.45,       -1.10400        },
   {116.50,       -1.23200        },
   {116.55,       -1.10400        },
   {116.59,       -1.10400        },
   {116.65,       -1.23200        },
   {116.70,       -1.23200        },
   {116.75,       -1.36000        },
   {116.80,       -1.10400        },
   {116.84,      -0.847999        },
   {116.90,      -0.847999        },
   {116.95,       -1.10400        },
   {117.00,       -1.23200        },
   {117.05,       -1.36000        },
   {117.09,       -1.36000        },
   {117.15,       -1.23200        },
   {117.20,       -1.10400        },
   {117.25,       -1.10400        },
   {117.30,      -0.975999        },
   {117.34,      -0.847999        },
   {117.40,      -0.591999        },
   {117.45,      -0.719999        },
   {117.50,      -0.719999        },
   {117.55,      -0.591999        },
   {117.59,      -0.719999        },
   {117.65,      -0.719999        },
   {117.70,      -0.719999        },
   {117.75,      -0.719999        },
   {117.80,      -0.591999        },
   {117.84,      -0.591999        },
   {117.90,      -0.591999        },
   {117.95,      -0.464000        },
   {118.00,      -0.464000        },
   {118.05,      -0.207999        },
   {118.09,      -8.000003E-002   },
   {118.15,       4.800009E-002   },
   {118.20,      -8.000003E-002   },
   {118.25,      -8.000003E-002   },
   {118.30,      -8.000003E-002   },
   {118.34,      -8.000003E-002   },
   {118.40,      -8.000003E-002   },
   {118.45,      -8.000003E-002   },
   {118.50,      -8.000003E-002   },
   {118.55,       4.800009E-002   },
   {118.59,       4.800009E-002   },
   {118.65,       4.800009E-002   },
   {118.70,       4.800009E-002   },
   {118.75,       4.800009E-002   },
   {118.80,       4.800009E-002   },
   {118.84,       0.176000        },
   {118.90,       0.176000        },
   {118.95,       0.176000        },
   {119.00,       0.176000        },
   {119.05,      -8.000003E-002   },
   {119.09,      -0.207999        },
   {119.15,      -0.207999        },
   {119.20,      -0.207999        },
   {119.25,      -8.000003E-002   },
   {119.30,      -8.000003E-002   },
   {119.34,       4.800009E-002   },
   {119.40,       0.303999        },
   {119.45,       0.559999        },
   {119.50,       0.815999        },
   {119.55,        1.07200        },
   {119.59,        1.32800        },
   {119.65,        1.58400        },
   {119.70,        1.58400        },
   {119.75,        1.84000        },
   {119.80,        2.09600        },
   {119.84,        2.35199        },
   {119.90,        2.48000        },
   {119.95,        2.73600        },
   {120.00,        2.99200        },
   {120.05,        3.24800        },
   {120.09,        3.24800        },
   {120.15,        3.24800        },
   {120.20,        3.12000        },
   {120.25,        2.99200        },
   {120.30,        2.73600        },
   {120.34,        2.60800        },
   {120.40,        2.60800        },
   {120.45,        2.73600        },
   {120.50,        2.73600        },
   {120.55,        2.99200        },
   {120.59,        3.12000        },
   {120.65,        3.24800        },
   {120.70,        3.24800        },
   {120.75,        3.24800        },
   {120.80,        3.12000        },
   {120.84,        3.12000        },
   {120.90,        2.86399        },
   {120.95,        2.86399        },
   {121.00,        2.73600        },
   {121.05,        2.60800        },
   {121.09,        2.48000        },
   {121.15,        2.60800        },
   {121.20,        2.60800        },
   {121.25,        2.60800        },
   {121.30,        2.86399        },
   {121.34,        2.86399        },
   {121.40,        2.99200        },
   {121.45,        2.86399        },
   {121.50,        2.99200        },
   {121.55,        2.99200        },
   {121.59,        2.86399        },
   {121.65,        2.86399        },
   {121.70,        2.86399        },
   {121.75,        2.86399        },
   {121.80,        2.99200        },
   {121.84,        3.12000        },
   {121.90,        3.37599        },
   {121.95,        3.50400        },
   {122.00,        3.63200        },
   {122.05,        3.50400        },
   {122.09,        3.50400        },
   {122.15,        3.50400        },
   {122.20,        3.50400        },
   {122.25,        3.50400        },
   {122.30,        3.50400        },
   {122.34,        3.37599        },
   {122.40,        3.24800        },
   {122.45,        3.24800        },
   {122.50,        3.12000        },
   {122.55,        3.12000        },
   {122.59,        3.24800        },
   {122.65,        3.37599        },
   {122.70,        3.37599        },
   {122.75,        3.50400        },
   {122.80,        3.75999        },
   {122.84,        4.01600        },
   {122.90,        4.27200        },
   {122.95,        4.65599        },
   {123.00,        4.65599        },
   {123.05,        4.78399        },
   {123.09,        5.04000        },
   {123.15,        5.29600        },
   {123.20,        5.55199        },
   {123.25,        5.80799        },
   {123.30,        5.80799        },
   {123.34,        5.80799        },
   {123.40,        5.93599        },
   {123.45,        6.06400        },
   {123.50,        6.19200        },
   {123.55,        6.06400        },
   {123.59,        5.93599        },
   {123.65,        6.19200        },
   {123.70,        6.57599        },
   {123.75,        6.83199        },
   {123.80,        6.57599        },
   {123.84,        6.44800        },
   {123.90,        6.32000        },
   {123.95,        6.32000        },
   {124.00,        6.32000        },
   {124.05,        6.32000        },
   {124.09,        6.19200        },
   {124.15,        6.32000        },
   {124.20,        6.19200        },
   {124.25,        6.32000        },
   {124.30,        6.19200        },
   {124.34,        6.06400        },
   {124.40,        5.93599        },
   {124.45,        5.80799        },
   {124.50,        5.42400        },
   {124.55,        4.78399        },
   {124.59,        4.27200        },
   {124.65,        4.27200        },
   {124.70,        4.40000        },
   {124.75,        4.52799        },
   {124.80,        4.14400        },
   {124.84,        3.75999        },
   {124.90,        3.50400        },
   {124.95,        3.37599        },
   {125.00,        3.37599        },
   {125.05,        3.12000        },
   {125.09,        2.48000        },
   {125.15,        1.96800        },
   {125.20,        1.58400        },
   {125.25,        1.07200        },
   {125.30,       0.815999        },
   {125.34,       0.431999        },
   {125.40,       0.176000        },
   {125.45,      -8.000003E-002   },
   {125.50,      -0.207999        },
   {125.55,      -0.719999        },
   {125.59,       -1.61600        },
   {125.65,       -2.38399        },
   {125.70,       -3.15200        },
   {125.75,       -4.04800        },
   {125.80,       -4.94400        },
   {125.84,       -5.58399        },
   {125.90,       -5.96800        },
   {125.95,       -6.35200        },
   {126.00,       -6.60799        },
   {126.05,       -6.86399        },
   {126.09,       -7.88799        },
   {126.15,       -8.91200        },
   {126.20,       -9.67999        },
   {126.25,       -9.80800        },
   {126.30,       -10.1920        },
   {126.34,       -10.8320        },
   {126.40,       -11.6000        },
   {126.45,       -12.6240        },
   {126.50,       -13.6480        },
   {126.55,       -15.1839        },
   {126.59,       -17.7440        },
   {126.65,       -19.6640        },
   {126.70,       -21.3279        },
   {126.75,       -22.6080        },
   {126.80,       -23.8880        },
   {126.84,       -24.9119        },
   {126.90,       -25.8080        },
   {126.95,       -26.4480        },
   {127.00,       -26.9600        },
   {127.05,       -27.0880        },
   {127.09,       -27.6000        },
   {127.15,       -28.7519        },
   {127.20,       -29.6480        },
   {127.25,       -30.2880        },
   {127.30,       -31.3120        },
   {127.34,       -32.3359        },
   {127.40,       -32.8479        },
   {127.45,       -33.6160        },
   {127.50,       -34.6400        },
   {127.55,       -36.1760        },
   {127.59,       -37.8400        },
   {127.65,       -39.3759        },
   {127.70,       -40.6559        },
   {127.75,       -41.9360        },
   {127.80,       -42.0640        },
   {127.84,       -42.1920        },
   {127.90,       -42.0640        },
   {127.95,       -42.1920        },
   {128.00,       -42.4480        },
   {128.05,       -42.5760        },
   {128.09,       -42.7040        },
   {128.15,       -42.8320        },
   {128.19,       -43.0880        },
   {128.25,       -43.6000        },
   {128.30,       -44.3680        },
   {128.34,       -45.0080        },
   {128.40,       -45.6480        },
   {128.44,       -45.9040        },
   {128.50,       -46.0319        },
   {128.55,       -46.0319        },
   {128.59,       -46.2879        },
   {128.65,       -46.7999        },
   {128.69,       -47.1839        },
   {128.75,       -47.5679        },
   {128.80,       -47.6959        },
   {128.84,       -47.9519        },
   {128.90,       -47.8239        },
   {128.94,       -47.6959        },
   {129.00,       -47.4399        },
   {129.05,       -47.1839        },
   {129.09,       -46.9279        },
   {129.15,       -46.6719        },
   {129.19,       -46.6719        },
   {129.25,       -46.7999        },
   {129.30,       -46.5439        },
   {129.34,       -46.4159        },
   {129.40,       -46.2879        },
   {129.44,       -45.7760        },
   {129.50,       -45.3920        },
   {129.55,       -45.0080        },
   {129.59,       -44.2400        },
   {129.65,       -43.9840        },
   {129.69,       -43.4720        },
   {129.75,       -42.9600        },
   {129.80,       -42.7040        },
   {129.84,       -42.3200        },
   {129.90,       -42.0640        },
   {129.94,       -41.5520        },
   {130.00,       -40.7839        }}

A: You can try to fill the missing values if it is suitable for your data by:

*

*mean values

*mean values of same class

*the most probable value

*Spline smoothing

*You can filter the data through a linear filter

But if you are building a nonlinear model in general, you should not detrend data before estimating nonlinear models. In the case of nonlinear grey-box models, do not detrend the data to make sure that the models represent the actual physical levels.

A: If your data has some cyclical behaviour, the small amount of good samples you've posted seem to have a hint of an increasing/decreasing period, and the missing data appear in blocks, you might want to consider a linear interpolation between the lst element before the bad block and the first element after.
Then add to that a random variable which has a statistical distribution similar to the rest of the data minus it's cyclical behaviour.
If nothing else looks suitable you could use a zero mean gaussian with appropriate variance as your RV.


text:
Q: SQL - table having different values for different points in time - best practise? i'm currently designing a database for logging some values for a specific time horizon. For illustration let's just say that i have a table with the following columns as the primary key:
Name | someInteger | anotherInteger
I want to log values different values for the same primary key for example for 30 seconds. So for example there may be multiple records with the same "Name","SomeInteger", "AnotherInteger" where only the "Timestamp" is guaranteed to differ from the other records.
"ExampleName" | 1  | 3 | Timestamp1 | Value1
"ExampleName" | 1  | 3 | Timestamp2 | Value2
"ExampleName" | 1  | 3 | Timestamp3 | Value3
...
That means that i would include the Timestamp column as part of the primary key. I'm currently wondering whats the best database design (or best practise) to do so? Should i just include a Timestamp column as part of the primary key or is there a better solution?
Thank you very much in advance.
Ingo

A:
there may be multiple records for the same primary key like:

You seem quite confused.  A primary key is -- by definition -- unique.  Your table is fine, but the primary key (as described) is a compound primary key.
You seem to need two tables.  One would be your entity:
create table entity (
    EntityId int auto_increment primary key,
    Name varchar(255) not null,
    someInteger int not null,
    anotherInteger int not null,
    unique (name, someInteger, anotherInteger)
);

create table entityValues (
    entityValueId int auto_increment primary key,
    EntityId int,
    timestamp datetime,
    value ?,  -- I don't know what the type is
    foreign key (EntityId) references entities(EntityId)
);

This uses MySQL syntax.  You can do the same thing in SQLite.


text:
Q: Transaction Does not working in php,mysql I was just trying transaction with php. But does not working. here is the code
$conn = mysql_connect('localhost', 'root', '') or die (mysql_error());
mysql_select_db('users',$conn) or die (mysql_error());
$sql = 'INSERT INTO `login` (id ,username ,password ,isactive)VALUES (3,  "rtyer",  "edt6e4",  "y");';
$sql1 = 'INSERT INTO `user` (
            `f_name` ,
            `l_name` ,
            `age` ,
            `place` ,
            `loginid`
            )
            VALUES (
            3,  "dsgdhg",  "yuity",  45,  "fj",  3
            );';
mysql_query("SET autocommit = off");
mysql_query("BEGIN");
mysql_query("START TRANSACTION");
$result1 = mysql_query( $sql, $conn );
$result2 = mysql_query( $sql1, $conn );
if(!$result2)
{
mysql_query("ROLLBACK");
echo "transaction rolled back";
exit;
}
else
{
mysql_query("COMMIT");
echo "Database transaction was successful";
}
mysql_close($conn);

there is mistake in the sql1 so data is not inserting into user table but rollbacking from the login table. Its entering into the if block but rollback is not occuring. Whats the problem here?

A: Delete the extra semi-colon at this line and use double quotes and single quotes on values:
$sql = 'INSERT INTOlogin(id ,username ,password ,isactive)VALUES (3,  "rtyer",  "edt6e4",  "y");';  <--- this part
Into this and do the same to $sql1
$sql = "INSERT INTO login (id ,username ,password ,isactive)VALUES ('3',  'rtyer',  'edt6e4',  'y')"; <-- deleted semi-colon
$sql1 = "INSERT INTO `user` (
            `f_name` ,
            `l_name` ,
            `age` ,
            `place` ,
            `loginid`
            )
            VALUES (
            '3',  'dsgdhg',  'yuity',  '45',  'fj',  '3'
            )";

A: Transaction will work only in InnoDB. here it was MyISAM.


text:
Q: Does this proof resolve the Liar Paradox? The Liar Paradox of antiquity goes something like this:
A man says, "Everything I say is a lie."
(I find the modern variation -- "This statement is false" -- to be less interesting. It seems to me to be nothing more than a simple self-contradiction.)
Define $3$ logical predicates:
$S(x)$ means $x$ is a sentence
$T(x)$ means $x$ is true
$M(x)$ means the man says $x$
EDITED:

*

*$S(x)\land M(x)\land \forall y(S(y)\rightarrow (M(y)\rightarrow \neg T(y)))$  (Premise)

*$S(x)$  (Splitting premise, 1)

*$M(x)$

*$\forall y(S(y)\rightarrow (M(y)\rightarrow \neg T(y)))$

*$S(x)\rightarrow (M(x)\rightarrow\neg T(x))$  (Universal Specification, 4)

*$M(x)\rightarrow\neg T(x)$  (Detachment, 2, 5)

*$\neg T(x)$   (Detachment, 3, 6)

*$\forall a (S(a)\land M(a)\land \forall y(S(y)\rightarrow (M(y)\rightarrow \neg T(y)))\rightarrow \neg T(a))$  (Conclusion, 1)
My question is, does this proof resolve the Liar Paradox?
FOLLOW-UP:
By definition, everything a constant liar says is false. A contradiction arises only, it would seem, when he says something like, "Everything I say is a lie," that is, when he claims:
$$\forall x (S(x)\rightarrow (M(x) \rightarrow \neg T(x))$$
If, as required, this is false, then
$$\exists x (S(x) \land M(x) \land T(x))$$
This contradicts the requirement that everything he says is false. If the constant liar can refrain from making such an admission, no paradoxical situation should arise. No such contradiction would arise, for example, from his saying, "Everything I say is true."
EDITED:
To answer my own question then, the above theorem does not resolve the original Liar Paradox of antiquity. It doesn't "prove" much at all, I'm afraid, but I now feel I have indeed resolved the paradox: It arises from the liar himself claiming that everything he says is false, and my (not necessarily well-founded) assumption that everything he says is indeed false. In hindsight, I think the "prize" must go to Alex Becker for his insightful comment. See my formal proof (Corollary starting on line 19) at http://www.dcproof.com/LiarParadox.htm
FOLLOW-UP TWO YEARS LATER
In the time since I first posted this question, I have come to realize that "This sentence is false" is nothing more or less than meaningless nonsense. Somehow, it is easier to see that "This sentence is TRUE" is meaningless nonsense. Simply changing "true" to "false" should not somehow suddenly imbue this sentence with meaning. I don't really think you can formalize the notion of meaningless nonsense.

A: Jack has been a generally unreliable character. He has uttered lots of falsehoods. His regretful last words are "All my assertions (over my whole life) are false".
Is he right? We obviously have to look at what else he has said.
Scenario 1: he has up to his last moments in fact said lots of true things among all the false things. That's enough to make Jack's last words quite unproblematically plain false.
Scenario 2: Jack has, up to his last moments, indeed said nothing but falsehoods. Now trouble. If his final assertion is true it must be false, because it is true that all his assertions are false. [Which is as far as the stated argument in the question takes us: but of course the argument now continues ...] However, if Jack's final assertion is false, then indeed all his assertions are false, which is what his last words say, so his last words are true after all. So, in sum, his final words are true if and only if they are false. Contradiction.
Moral: a statement "Everything I say (including this) is false" is not intrinsically paradoxical. But asserted in a suitably unfavourable context it quite certainly can be (i.e. isn't plain false).
For a really good introductory discussion of serious approaches to the Liar paradox, can I recommend http://plato.stanford.edu/entries/liar-paradox/

A: It seems to me that your proof is of the Theorem "Any claim by a person M which implies that everything M says is false, is false." That is, at least that one statement is false. That is, M must sometimes speak the truth if they make such a claim. (The claim itself is a lie, but it implies the existence of true utterances.)
This is a straightforward resolution of the paradox, as the sentence involved in the Liar paradox is a universal quantification (as you point out), which implies its own negation, which is an existential quantification over statements.
In effect, as a problem involving speech acts, it represents a case where sarcasm can be decided with no further axioms about the universe of discourse-of-discourse.

A: (maybe this should be a comment, but it's too long)

(I find the modern variation -- "This statement is false" -- to be less interesting. It seems to me to be nothing more than a simple self-contradiction.)

The modern variation has come into being at least partly because it is a source of serious difficulty in defining formal semantics as well as inspiration for a various number of techniques.
The standard trick is as follows: we call a unary predicate "normal" if it doesn't satisfy itself. This condition is itself a predicate:
Normal(P) := "P(P) is false"

Then we define the statement
S := Normal(Normal)

By the definition of Normal, the literal meaning of S is "Normal(Normal) is false" -- i.e. "S is false". S becomes a liar's statement, and we can go through the usual argument to derive a contradiction:

*

*Assume S.

*

*Therefore not S

*Contradiction!

*Therefore not S.

*Therefore S

*Contradiction!

There were no hypotheses to this argument: it proves contradiction is tautology, and so this logic is useless.
The idea of this argument is useful elsewhere. For example, the usual proof the halting problem is uncomputable is essentially the same one as the one given above.

A: The Phrase "Everything I say is a lie" is not a paradox.  Consider it this way: 100% of the things I say is a lie.  A paradox means that when a statement is true it is false and when it is false it is true.  So 100% of the things I say is a lie is false, and thereby the answer to that does not have to be 0% of the things I say is a lie.  It can still be 50% of the things I say is a lie.

So in conclusion Everything I say is a lie can be false and still end up being: some of what I say is a lie.  You may have to think this through but I cannot make this very simple.

You had said: "I find the modern variation -- "This statement is false" -- to be less interesting. It seems to me to be nothing more than a simple self-contradiction."  Actually that is the new variation because that is a paradox versus "Everything I say is a lie"


text:
Q: Validating required fields and confirming fields in c# visual studio I am having trouble with creating a form that requires the user to enter information in the fields, Confirm an email and password entry, and go onto the next form when all those fields are matched/filled in. Individually, the code I have works, but I cannot seem to find a way to make it so that all the requirements are met before going onto the next form.  At the moment it just goes onto the next form if i click the continue button.
some excerpts of the code i have are:
if (string.IsNullOrEmpty(email))
{
    lblRequirementsError.Text = ("All required fields have not been filled.");
}

if (txtBoxEmail.Text != txtBoxConfirmEmail.Text)
{
    lblEmailError.Text = ("Email reentry does not match. Please reenter.");
}

if (txtBoxPassword.Text != txtBoxConfirmPassword.Text)
{
    lblPasswordError.Text = ("Password reentry does not match. Please reenter.");
}

this.Hide();
frmBilling secondForm = new frmBilling();
secondForm.Show();

A: if (! txtBoxEmail.Text.Equals( txtBoxConfirmEmail.Text))
{
    lblEmailError.Text = ("Email reentry does not match. Please reenter.");
}

if (! txtBoxPassword.Text.Equals( txtBoxConfirmPassword.Text))
{
    lblPasswordError.Text = ("Password reentry does not match. Please reenter.");
}

A: are you using web applications forms in visual studio 2012. You can use field validators inside the .ASPX file for any field that you want to validate before form submission. This is much easier that writing everything in C#.

A: You can use the DataAnnotation if you are binding or converting your controls to the data objects. Then it will be easy to validate. Please see the link for more details
http://msdn.microsoft.com/en-us/library/dd901590(VS.95).aspx

A: The problem is the form is created and opened regardless of the if results, because the code for it is outside the ifs. First, check that no fields are empty, and then, check that the validation has been met, THEN open the new window. Something like this should work:
//If both email and password are not empty
if (!string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(password))
{
    //if both email and password math the re entry
    if (txtBoxEmail.Text == txtBoxConfirmEmail.Text &&
        txtBoxPassword.Text == txtBoxConfirmPassword.Text)
    {
        //execute the code to open the new form
        this.Hide();
        frmBilling secondForm = new frmBilling();
        secondForm.Show();
    }
}

A: Try this:
bool validationStatus = default(bool);

if (string.IsNullOrEmpty(email))
{
    lblRequirementsError.Text = ("All required fields have not been filled.");
    validationStatus  = true;
}

if (txtBoxEmail.Text != txtBoxConfirmEmail.Text)
{
    lblEmailError.Text = ("Email reentry does not match. Please reenter.");
    validationStatus  = true;
}

if (txtBoxPassword.Text != txtBoxConfirmPassword.Text)
{
    lblPasswordError.Text = ("Password reentry does not match. Please reenter.");
    validationStatus  = true;
}

if(!validationStatus)
{
   Hide();
   frmBilling secondForm = new frmBilling();
   secondForm.Show();
}


text:
Q: $\exists c>0$ so that $f$ can be chosen to satisfy $||f|| \le c||g||$ Let $K$ be compact and $X$ be Banach subspace of $C(K)$. Let $E \subseteq _{closed} K$ so that $\forall g \in C(E), \exists f \in X$ with $f|_{E} =g$. To show: $\exists c>0$ such that $f$ can be chosen to satisfy $||f|| \le c||g||$.
I think we have to apply bounded inverse theorem somewhere but I'm not sure how to approach.

A: This is part of the proof of Open Mapping Theorem. Apply the theorem to the bounded linear operator $T: C(K) \to C(E)$ defined by $T(f)=f|_E$ (the restriction of $f$ to $E$).


text: Q: How to quit MAMP application in Mac terminal? I am sorry if the question sounds so stupid because I am really new to Mac. I don't know much about it at all, so any help would be greatly appreciated. Thank you.


text:
Q: Как работают синглтоны Java? Читая книгу "Программирование под Android" Брайна Харди, я столкнулся со следующим кодом. Существует класс синглтон:
public class CrimeLab {
    private static CrimeLab sCrimeLab;
    private Context mAppContext;

    public ArrayList<Crime> mCrimes;

    private CrimeLab (Context appContext){
        mAppContext = appContext;
        mCrimes = new ArrayList<Crime>();
    }

    public ArrayList<Crime> getCrimes() {
        return mCrimes;
    }

    public static CrimeLab get(Context c){
        if (sCrimeLab == null){

            sCrimeLab = new CrimeLab (c.getApplicationContext());
        }
        return sCrimeLab;
    }
}

Существует ещё один класс, в котором обращаются к методу get и getCrimes класса CrimeLab:
public class CrimeListFragment extends ListFragment {
    private ArrayList<Crime> mCrimes;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mCrimes = CrimeLab.get(getActivity()).getCrimes();
    }
}

Меня интересует эта строка кода mCrimes = CrimeLab.get(getActivity()).getCrimes();. Как мы обращаемся к CrimeLab, если мы не создали экземпляр класса CrimeLab, а статической является лишь переменная sCrimeLab в CrimeLab? Могу предположить, что приставка s не учитывается, или я сильно не понимаю принцип синглтонов.

A: s в данном случае является обозначением статической переменной, но название никак не влияет на её суть, оно может быть любым.
Метод get, также является статическим.
В коде написано, что если sCrimeLab является null, то необходимо создать экземпляр класса в ином случае вернётся существующий экземпляр.
По хорошему можно разделить строку mCrimes = CrimeLab.get(getActivity()).getCrimes(); на
CrimeLab crimeLab = CrimeLab.get(getActivity());
mCrimes = crimeLab.getCrimes();


text:
Q: Is it possible to get a data from an excel file from a particular table if I have two tables in one worksheet using EPPlus? I have a file that contains a few tables on one worksheet. How do I get data from a particular table using EPPlus? thanks a lot
I looked through samples and questions on stackoverflow

A: You can reference tables by index or by name using this:
var x = new OfficeOpenXml.ExcelPackage(new FileInfo(@"c:\FooFolder\Bin_Template.xlsx"));
var table = x.Workbook.Worksheets[1].Tables["Table1"];


text:
Q: Упорядочить список по типу содержимого? Есть список: [1, 3, 5, 'adf', 34, (1, 5, 8)]. Хочу упорядочить его по типу содержимого, чтобы сначала шли целые числа, строка и в конце кортеж.
То есть получить на выходе: [1, 3, 5, 34, 'adf', (1, 5, 8)].
Как добиться этого?

A: Вот вам "грязный хак" - по стечению обстоятельств он подходит к вашему случаю:
a = [1, 3, 5, 'adf', 34, (1, 5, 8)]
b = sorted(a, key=lambda x: str(type(x)))
print(b)

Результат:
[1, 3, 5, 34, 'adf', (1, 5, 8)]

A: Можно использовать сортировку со своим компаратором и для него задать возврат значений как приоритет по типу.
Пример:
TYPE_BY_PRIORITY = {
    int: 0,
    str: 1,
    tuple: 2,
}

items = [1, 3, 5, 'adf', 34, (1, 5, 8)]
items.sort(key=lambda x: TYPE_BY_PRIORITY.get(type(x)))
print(items)
# [1, 3, 5, 34, 'adf', (1, 5, 8)]

UPD.
Чтобы сортировка без ошибок обрабатывала типы, что нет в TYPE_BY_PRIORITY, то в .get нужно возвращать значение по умолчанию:
items.sort(key=lambda x: TYPE_BY_PRIORITY.get(type(x), 99))

UPD2.
Как подсказал MaxU, можно в компараторе возвращать кортеж вида (приоритет, значение), тогда сортировка будет и по типу, и по значению (будет порядок для элементов одного типа):
items.sort(key=lambda x: (TYPE_BY_PRIORITY.get(type(x), 99), x))

Это заметно с выборкой [3, 1, 5, 'adf', 34, (1, 5, 8)]. Компаратор только с приоритетом вернет [3, 1, 5, 34, 'adf', (1, 5, 8), 2.2], а компаратор с приоритетом и значением вернет: [1, 3, 5, 34, 'adf', (1, 5, 8)]

A: Решение "в лоб":
d = [1, 3, 5, 'adf', 34, (1, 5, 8)]

digits = []
strings = []
tuples = []

for i in d:
    if isinstance(i, str): # Строка?
        strings.append(i)
    elif isinstance(i, tuple): # Кортеж?
        tuples.append(i)
    elif isinstance(i, int):    # Число?
        digits.append(i)

print(digits + strings + tuples)

A: Вот решение в стиле code-golf. Переменная l это ваш список:
[x for x in l if isinstance(x,int)]+[i for i in l if isinstance(i,str)] + [j for j in l if isinstance(j,tuple)]

A:  Python3 — 15 bytes
l.sort(key=dir)

Вот уж настоящий code-golf.


text:
Q: How to setup params map in grails controller test I have an integration test.  The params that get past to the controller contain a list of multiple objects (phone #'s).  Each phone number has a type/number.  When I run the code I can capture what the gsp is sending to the controller in the params object as shown here:

How do I code that parameter map in an integration test?  Everything I've tried so far hasn't worked (below).  I'm trying to reproduce what the gsp form sends in controller.params before I call the action.
        def bindingMap = [alt1: 'Previous',
                'phones[0]': [type: 'H', number: '55555', deleted: 'false', id: '']]

        //controller.params
//        controller.params = map//[alt1 : 'Previous'
//                phones[0].type, 'H'
//                phones[0].number, '55555',
//                phones[0].deleted, 'false',
//                phones[0].id, ''
        //]
/*
        controller.params.phones[0]["type"] = 'H'
        controller.params.phones[0]["number"] = '12345'
        controller.params.phones[0]["deleted"] = 'false'

EDIT:
Figured it out:
    def bindingMap = [alt1: 'Previous',
            'phones[0].type': 'H',
            'phones[0].number': '55555',
            'phones[0].deleted': 'false',
            'phones[0].id': ''
    ]
    controller.params.putAll(bindingMap)

A: Have you tried?
controller.params.phones = [
    [type: 'H', number: '55555', deleted: 'false', id: ''],
    [type: 'A', number: '66666', deleted: 'false', id: '']
]