text:
Q: error al Compilar: System.Web.Compilation.CompilationLock Buenas tardes:  tengo un Ws, que hace rato no lo tocaba. hoy quise agregarle algo y al compilar, me devuelve el sig error:
Build (web): The type initializer for 'System.Web.Compilation.CompilationLock' threw an exception.
Estuve googleando pero no puedo encontrar el error.
En Vs estoy como admin.-
Muchas gracias


text:
Q: Regex for string matching with special escaping rule I'm trying to match special kind of string literals with some funky escaping rules.
The general form looks like this:
"some string"

Which are simple to match using a pattern such as "(.*?)"
However you can escape quotes by doubling them, such as:
"hello "" there" becomes hello " there
"hello """" there" becomes hello "" there
And this is where my regex skills fail me. How can I match strings like this?
Oh, and I'm using python 3.1.

A: regex = re.compile(r'"(?:[^"]|"")*"')

This just finds the literals, it doesn't decode them by replacing the doubled quotes.

A: Not using a regular expression, but you've specified Python, so here's a way to get your expected output:
>>> import csv
>>> strings = ['"some string"', '"hello "" there"', '"hello """" there"']
>>> for s in strings:
    print next(csv.reader([s]))

['some string']
['hello " there']
['hello "" there']

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to get IP of server that initiated redirect I hope you could help me with the following question:
A user clicks a hyperlink in a page. Server A handles the request and redirects the client to a URL on Server B (more specifically I am using the Response.Redirect method in .NET on server A).
I have been asked to restrict access to Server B to redirects originating from Server A only (by blocking  IP's other than Server A's). At first I thought this could be achieved by using the HTTP 'referer' header, however, it seems it is up to the browser to set this to a URL (rather than IP), and it is not guaranteed to do so.
I guess there is no way to set the HTTP 'referer' on server A in .NET (to server A's IP)? (my intuition is that would be a security hole). So my question is, how can I restrict access to Server B to redirects originating from Server A?
Any help much appreciated,
Martijn

A: you could send a signed message in the redirect process, so that server B can verify that it was signed by server A

A: No you cannot do it that way, browsers only set the referrer in certain conditions and a client can spoof this.
The referrer header is a request header - not a response header, so Server A cannot set this.
You would have to do something server side (a token perhaps) so long as you are in control of both servers, then pass the token as a parameter in the URL you redirect to.

A: Let me tell you how I understood your question:
You have a set of web pages(p1,p2,p3,p4) distributed on two servers A(p1,p2) and B(p3,p4).
clients can click links to pages p1,p2 that redirect the user to pages p3,p4 through server A to server B.
you want users be restricted so that they cannot access pages p3,p4. In other words get server B restrict access to pages p3,p4 except through redirects generated by server A.
If I got the point this way you can let server A appends a query string to the url while redirect and let server B check that query string and instead of using Response.Redirect from server A you can use Server.Transfer in order to hide the url from the user.


text:
Q: Are complex reflection groups never perfect? This is a follow-up to
Conceptual reason why Coxeter groups are never simple
A complex reflection group is a finite subgroup of $ U_n $ that is generated by pseudo reflections. A pseudo reflection is a matrix in $ U_n $ with $ n-1 $ dimensional $ \lambda=1 $ eigenspace. Real complex reflection groups are Coxeter groups.
I was looking at the complex reflection groups given here
https://en.wikipedia.org/wiki/Complex_reflection_group
and it seems that none of them are perfect (although the $ S_n $ and a number of the exceptional cases have index 2 perfect subgroups).
Is it true that complex reflection groups are never perfect? Is there a nice conceptual proof of this fact?

A: Complex reflections have the form
$$\begin{pmatrix}\zeta &0&\cdots& 0\\ 0&1&\cdots &0
\\ \vdots &&\ddots &
\\ 0&\cdots &0&1\end{pmatrix}$$
and so do not have determinant $1$. Therefore the subgroup is not a subgroup of $\mathrm{SL}_n(\mathbb{C})$, and the determinant map has a kernel that is not the whole group.


text:
Q: Using FLAG_KEEP_SCREEN_ON across the Android system The goal of my app is to keep the screen on across the whole Android system. Previously, I've used FULL_WAKE_LOCK for this and it allowed me to block dimming of the screen across  the system. However, since the API Level 17, it got deprecated:

This constant was deprecated in API level 17. Most applications should
  use FLAG_KEEP_SCREEN_ON instead of this type of wake lock, as it will
  be correctly managed by the platform as the user moves between
  applications and doesn't require a special permission.

Official documentation recommends using FLAG_KEEP_SCREEN_ON, however it is possible to use it only for particular Activity.
I would still FULL_WAKE_LOCK, however I've found that it doesn't work now on some of the devices, like MediaPad Huawei x2, Redmi Note 3, etc. The way I'm currently using the PowerManager can be found on GitHub. Is there any better way to do accomplish this task after API level 17?

A: Starting with API 23 and its new Doze mode Wake Locks are ignored and they do not prevent the system from entering sleep.
You should experiment with maintaining a foreground service in parallel with the wake lock, theoretically that should prevent the device from entering sleep.
NOTE: the foreground Service has to call startForeground and show a non dismissable Notification


text:
Q: Difference compilation VS 2015 and VS 2010 I have a free .Net 4.0 app that protect with Eazfuscator v3.3 (last free version). All the classes in my single project app are internal. I use symbol encryption to encrypt class names, methods and members. Up until now, everything was encrypted
Up until now, I was using VS 2010, and everything worked fine. I switched to VS 2015, still targeting .Net 4.0 framework. Once the code is compiled and obfuscated, using reflector I can clearly see class names in clear (but methods and members are still encrypted)
Is there anything different between VS 2010 compilation and VS 2015 compilation if both target .Net 4.0?
Thanks

A: VS 2015 uses Roslyn compiler. It produces different instructions and metadata and this affects the analysis engine in Eazfuscator.NET 3.3.
Eazfuscator.NET 3.3 cannot work with assemblies produced by VS 2015 or newer.
The support for Visual Studio 2015 was added in Eazfuscator.NET 4.9, so you need at least that version to successfully obfuscate the assemblies produced by Roslyn compilers.


text:
Q: Create an Impala text table where rows meet a condition I am trying to create a table in Impala (SQL) that takes rows from a parquet table. The data represents bike rides in a city. Rows will be imported into the new table if there starting code (a string, ex: '6100') shows up more than 100 times in the first table. Heres what I have so far:
#I am using Apache Impala via the Hue Editor

invalidate metadata;
set compression_codec=none;

invalidate metadata;
Set compression_codec=gzip;

create table bixirides_parquet (
start_date string, start_station_code string,
end_date string, end_station_code string,
duration_sec int, is_member int)
stored as parquet;

Insert overwrite table bixirides_parquet select * from bixirides_avro;

invalidate metadata;
set compression_codec=none;

create table impala_out stored as textfile as select start_date, start_station_code, end_date, end_station_code, duration_sec, is_member, count(start_station_code) as count
from bixirides_parquet
having count(start_station_code)>100;

For some reason the statement will run, but no rows are inserted in the new table. It should import a row into the new table if that rows starting code shows up more than 100 times in the original table. I think I'm wording my select statement improperly but I'm not sure how exactly.

A: I think the final query you want is:
select start_date, start_station_code, end_date,
       end_station_code, duration_sec, is_member, cnt
from (select bp.*,
             count(*) over (partition by start_station_code) as cnt
      from bixirides_parquet bp
     ) bp
where cnt > 100;


text:
Q: How to use JQuery Validation together with JQuery multiselect plugin I am trying to set some validation rules on a multiselect field. Problem is the validation only works when I deactivate the JQuery multiselect pluggin. See fiddle. Is there a way to make the two work together?

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!doctype html>
<html>
<head>

<link  href="http://wowislandcharter.com/roit/script/jquery/multiselect/multiselect.css"
    type="text/css"
    rel="stylesheet"/>

<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js"></script>

</head>
<body>
<form id="myform">

<select id="symptom" name="symptom" multiple="" size="15" >

    <option value="1">Watery diarrhea</option><option value="2">Abdominal cramps</option><option value="3">Nausea</option><option value="4">Vomiting</option><option value="5">Diarrhea</option><option value="6">Fever</option><option value="7">Bloody Diarrhea</option><option value="8">Cramps</option><option value="9">Facial pallor</option><option value="10">Tea-colored urine</option><option value="11">Abdominal pain</option><option value="12">Jaundice</option><option value="13">Headache</option><option value="14">Stiff neck</option><option value="15">Weakness</option><option value="16">Confusion</option>

</select>

<br/>
<input type="submit" value="Validate!">
</form>

<script src="http://wowislandcharter.com/roit/script/jquery/multiselect/multiselect.js"></script>

<script>
$("#symptom").multiselect({

    columns:2,
    texts:{placeholder:"SELECT SYMPTOM"}

   })

$( "#myform" ).validate({
  rules: {
    symptom: {
      required: true,

    }

  }
});
</script>
</body>
</html>


text:
Q: receive signal before process is being killed by OOM killer / cgroups In our cluster, we are restricting our processes resources, e.g. memory (memory.limit_in_bytes).
I think, in the end, this is also handled via the OOM killer in the Linux kernel (looks like it by reading the source code).
Is there any way to get a signal before my process is being killed? (Just like the -notify option for SGE's qsub, which will send SIGUSR1 before the process is killed.)
I read about /dev/mem_notify here but I don't have it - is there something else nowadays? I also read this which seems somewhat relevant.
I want to be able to at least dump a small stack trace and maybe some other useful debug info - but maybe I can even recover by freeing some memory.
One workaround I'm currently using is this small script which frequently checks if I'm close (95%) to the limit and if so, it sends the process a SIGUSR1. In Bash, I'm starting this script in background (cgroup-mem-limit-watcher.py &) so that it watches for other procs in the same cgroup and it quits automatically when the parent Bash process dies.

A: OOM killer does send a SIGKILL as it would otherwise be counter-productive to let the problematic program the choice of continuing.
This means that there is absolutely no way for a process to know when it is about to get killed by it.
Managing such issues usually imply making corrections to the programs or their configuration.  Sometimes, depending on the system's configuration, simply increasing swap space can give the OS more memory management flexibility to avoid such drastic measures.

A: It looks like you already use cgroups, this helps.
If your process is the only process in the cgroup (i.e. the only process that can be killed) and you own the program you execute, then you can modify your program to spawn a child, and adjust its oom score to some high value. This process, thus, will become a decoy: when you are reaching cgroup memory limit, OOM killer will kill this decoy process instead of the main process. The main process can wait on its child decoy to know the exact moment when OOM killer is triggered.
IMO, it's easier than monitoring script with some threshold. Here's example in Bash
#!/usr/bin/bash

self_pid=$$

(
    /usr/bin/sleep infinity &
    oom_decoy_pid=$!
    echo "1000" > "/proc/${oom_decoy_pid}/oom_score_adj"
    echo "Launched oom decoy ${oom_decoy_pid} for parent process ${self_pid}"

    wait $oom_decoy_pid

    echo "OOM decoy is killed. Likely OOM is coming!"
    echo "Signalling parent..."
    kill -SIGTERM $self_pid
)&

while true; do
    sleep 1
    echo "Doing something important and memory heavy"
done

A: It's possible to register for a notification for when a cgroup's memory usage goes above a threshold.  In principle, setting the threshold at a suitable point below the actual limit would let you send a signal or take other action.
See:
https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt


text:
Q: bind the same context to multiple functions I have a series of Promises that I've written inside of a class:
class Executor {

    someFunction(){
        return Promise.resolve(function(){
            console.log(this.name);
        });
    };

    someOtherFunction(){
        return Promise.resolve(function(){
            console.log(this.date);
        });
    };

    execute(){
        let {someFunction, someOtherFunction} = this;
        this.name = "John";
        this.date = "Saturday";
        someFunction=someFunction.bind(this)
        someFunction().then(someOtherFunction.bind(this));
    }

}

that I then invoke by instantiating the class and running the execute method:
var e = new Executor;
e.execute();

Is there a better way to bind the context of the class to multiple functions rather than writing multiple bind() statements?

A: You don't really need destructing here, it only complicates things, KISS:

'use strict';
class Executor {
  someFunction() {
    return new Promise((resolve, reject) =>  {
      setTimeout(() => {
        console.log(this.name);
        resolve();
      }, 250);
    });
  };

  someOtherFunction() {
    return new Promise((resolve, reject) =>  {
      setTimeout(() => {
        console.log(this.date);
        resolve();
      }, 250);
    });
  };

  execute() {
    this.name = "John";
    this.date = "Saturday";
    this.someFunction()
      .then(() => this.someOtherFunction())
      .then(() => { console.log('done!'); });
  }
}

let e = new Executor();
e.execute();

Note that your Promise usage was broken.

A:
Is there a better way to bind the context of the class to multiple functions rather than writing multiple bind() statements?

There are difference ways of referring to the value of this, or bind a function (see How to access the correct `this` / context inside a callback?), but a shorthand to bind multiple functions at once does not exist.

A: This approach may or may not thrill you. We define a context method on Promise to attach a context to the promise, and a thenWithContext method to do a then with automatic binding of the handlers passed in.
Object.defineProperties(Promise.prototype, {

  context: { value: function(context) { this.context = context; return this; } },

  thenWithContext: { value: function(resolve, reject) {
    return this.then(
      (...args) => typeof resolve === 'function' && resolve.call(this.context, ...args),
      (...args) => typeof reject  === 'function' && reject.call (this.context, ...args)
    ).context(this);
  } }

});

Usage:
execute() {
  this.someFunction() . context(this) . thenWithContext(this.someOtherFunction);
}


text:
Q: Use selenium to download multiple pdfs from a list of urls Hi I have the below code but it doesn't seem to download into my folder. I am able to pull out a list of url that contains the PDF but I am unable to make my code that downloads the PDF work.
driver = webdriver.Chrome(
executable_path=os.path.join(GenericMethods.get_full_path_to_folder('drivers'), "chromedriver.exe"),
chrome_options=chrome_options)
download_dir = "D:\VIX\FOMC_Minutes"
months = ['January', 'February', 'March', 'April', 'May', 'June',
      'July', 'August', 'September', 'October', 'November', 'December']

years = ['1983', '1982', '1981', '1980', '1979', '1978', '1977', '1976', '1975', '1974',
     '1973', '1972', '1971', '1970', '1969', '1968', '1967', '1966', '1965', '1964',
     '1963', '1962', '1961', '1960']

driver.get(f'https://fraser.stlouisfed.org/title/677')
driver.set_page_load_timeout(15)
pdf_links=[]
search = driver.find_element_by_class_name('list-search.form-control.input-sm')
for y in years:

for m in months:
    print (m + "-" + y)
    search.clear()
    search.send_keys(y)
    WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, "//span[contains(., '" + y + "')]/parent::a")))
    xpath = "//span[contains(., '" + m + "') and contains(., '" + y + "')]/parent::a"
    elinks = driver.find_elements_by_xpath(xpath)
    if len(elinks)>0:
        print(elinks[0].get_attribute('href'))
        pdf_links.append(elinks[0].get_attribute('href'))

driver.quit()
print(pdf_links)

for url in pdf_links:
page = driver.get(url)
elinks = page.find_elements_by_css_selector("a[href*='.pdf']")
for elink in elinks:
download = driver.find_element_by_link_text(elink)
download.click()

A: You have to make little tweak to your script and use wget rather standard download. By that way the download will be easy and faster.
make sure to add this import.
import wget

driver.set_page_load_timeout(15)
pdf_links=[]

for y in years:

    for m in months:
        driver.get(f'https://fraser.stlouisfed.org/title/677')
        search = WebDriverWait(driver, 30).until(
            EC.presence_of_element_located((By.CLASS_NAME, "list-search.form-control.input-sm")))
        search.clear()
        search.send_keys(y)
        WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, "//span[contains(., '" + y + "')]/parent::a")))
        xpath = "//span[contains(., '" + m + "') and contains(., '" + y + "')]/parent::a"
        elinks = driver.find_elements_by_xpath(xpath)
        if len(elinks)>0:
            driver.get(elinks[0].get_attribute('href'))
            # linkEle = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.XPATH, "//a[@class='btn btn-default btn-sm btn-block']")))
            linkEle = driver.find_elements_by_xpath("//a[@class='btn btn-default btn-sm btn-block']")
            if len(linkEle) >0:
                wget.download(linkEle[0].get_attribute('href'), m + "_" + y + ".pdf")
                # if you want to download to any specific directory then append the dir path as shown below.
                wget.download(linkEle[0].get_attribute('href'), dir_path + "/" + m + "_" + y + ".pdf")
driver.quit()


text:
Q: Find the difference between 2 numbers as the as a % increase of the lower number - excel Ive got 2 numbers in a spreadsheet like this
__A_|__B__
    |
700 | 900

What im trying to do is find the how much of an increase 900 is as a % of 700.
The current way i work it out is :

*

*900 - 700 = 200

*700/100 = 7

*200/7 = 28.57% increase

This is tedious as it requires a block of formulas that interact or i just end up doing by hand. Is there a simple 1 formula line approach to do the same ?

For reference ive created a google spreadsheet to test formulas in here : https://docs.google.com/spreadsheets/d/1O1Bj-kkjEntx_AYhV7zPD3bhFe-4vPbGXWBsAe3YuOY/edit#gid=0

A: In Cell C1 put the following formula:
=(B1-A1)/A1
Basically, % change should be calculated by first determining the difference between the amounts, then divide by the original amount.


text:
Q: synchronize two horizontal scroll view android i have two horizontal scroll views each containing a linear layout item under it. how is it possible to synchronize the scroll, when either of it is  scrolled, the other is also automatically scrolled. any help?

A: What you could do is on the onTouch of the first Horizontal Scroll view, record the X position that it started with for an action of Down.  Then when you have an action of Move, record the change in the X position.  Then you can call the second horizontal scroll view's scrollBy (deltaX, 0).  On an action of Up or Cancel, make sure to reset your state variables.
I've done this with a List View scrolling a vertical scroll, just using Y positions instead of X.  Here is my code to accomplish this.  The concurrentScroller is my vertical view.
if(concurrentScroller != null) {
            int deltaY = (int) (startTouchConcurrentY - ev.getY());
            startTouchConcurrentY = ev.getY();
            concurrentScroller.scrollBy(0, deltaY);
        }

A: I would implement onScrollListener for each of the views to call scrollTo on the other.


text:
Q: i am using flutter for chat app and getting an error in user distinguish for receiver and sender class Messages extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return FutureBuilder(
      future: FirebaseAuth.instance.currentUser,// here is the error " The argument type 'User' can't be assigned to the parameter type 'Future<dynamic>'.dart(argument_type_not_assignable)"

builder: (ctx, futureSnapshot) {
if (futureSnapshot.connectionState == ConnectionState.waiting) {
return Center(
child: CircularProgressIndicator(),
);
}
        return StreamBuilder(
            stream: FirebaseFirestore.instance
                .collection('chat')
                .orderBy('createdAt', descending: true)
                .snapshots(),
            builder: (ctx, chatSnapshot) {
              if (chatSnapshot.connectionState == ConnectionState.waiting) {
                return Center(
                  child: CircularProgressIndicator(),
                );
              }
              final chatDocs = chatSnapshot.data.docs;
              return ListView.builder(
                reverse: true,
                itemCount: chatSnapshot.data.docs.length,
                itemBuilder: (ctx, index) => MessageBubble(
                  chatDocs[index]['text'],
                  chatDocs[index]['userId'] == futureSnapshot.data.uid,
                  key: ValueKey(chatDocs[index].documentID),
                ),
              );
            });
      },
    );
  }
}

A: 'FirebaseAuth.instance.currentUser' is not a future to get the current user uid you can do this instead.
class Messages extends StatelessWidget {
final User user = FirebaseAuth.instance.currentUser;
@override
Widget build(BuildContext context) {

 final uid = user.uid; // set the function here
 return StreamBuilder(
    stream: FirebaseFirestore.instance
        .collection('chat')
        .orderBy('createdAt', descending: true)
        .snapshots(),
    builder: (ctx, chatSnapshot) {
      if (chatSnapshot.connectionState == ConnectionState.waiting) {
        return Center(
          child: CircularProgressIndicator(),
        );
      }
      final chatDocs = chatSnapshot.data.docs;
      return ListView.builder(
        reverse: true,
        itemCount: chatSnapshot.data.docs.length,
        itemBuilder: (ctx, index) => MessageBubble(
          chatDocs[index]['text'],
          chatDocs[index]['userId'] == uid, // Use it here
          key: ValueKey(chatDocs[index].documentID),
        ),
      );
    });
}
}

A: FirebaseAuth.instance.currentUser is not a Future like the error says. It returns an instance of User Class if the user is authenticated. You don't need to use FutureBuilder Widget for this situation. You can directly use it.


text:
Q: "Uninstall" buttons are gone from Add/Remove programs. How to get them back? After uninstalling a few applications in Windows XP, there are no buttons to remove applications or reinstall them.
The problem seems to be known in Windows XP, according to the number of discussion boards where lots of people are encountering the same issue. Unfortunately, the solutions (here another one) listed on those forums doesn't help.
Is there a Microsoft's KB article or some known workaround to solve this issue?

Edit: here some details:

*

*The issue appeared after uninstalling ZoneAlarm. This already happened.

*There is no HKEY_LOCAL_MACHINE\...\CurrentVersion\Uninstall\. At all.

*There is, on the other hand, HKEY_CURRENT_USER\...\CurrentVersion\Uninstall\. It contains one entry corresponding to one application.

*In the list of applications, this one application has an uninstall button. It is the only entity with a button in the list.

*There are multiple users on the machine. The issue is the same for all those users, not only the one who uninstalled ZoneAlarm.

A: Here is a Microsoft Article on the issue but it pertains to Windows 95/98. Alternatively, you can also follow the solution outlined below:
Issue:

Solution:
Click Start >> Run >> type regedit. This starts the Registry Editor.
Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<Program Name>
 Lets take Adobe Acrobat 5.0 as an example
In the right-pane, do the following:
Double-click NoRemove (REG_DWORD) and set it to 0. Double-click NoModify   (REG_DWORD) and set it to 0
If NoRemove is set to 1, the Remove button will be unavailable.
If NoModify is set to 1, the Change button will be unavailable

Result:

Source.


text:
Q: Windows 10 unable to connect to Internet through proxy I am on Windows 10 Insider Build 10162. I use a proxy to connect to internet. Internet works fine on both Microsoft Edge and Google Chrome. But when I try to ping Google.com from cmd, it says "Request timed out".
I have tried to set proxy using:
netsh winhttp set proxy <proxy address>:<port>

It shows that the proxy was set properly, but ping still does not work so does Windows Update. Is this a bug in Windows or possible problem with my system?


text:
Q: Best Way to Segment Lung Nodules in Matlab I am working with images processing in Matlab.  I am trying to segment out only malignant (cancerous) lung nodules. Initially I managed to segment out Lung and all possible nodules.

I have used following Matlab code:
segM = % Segmented Lung
% Segment nodules
BW = im2bw(segM, 0.55);

Now, I want to apply some filter that will filter all benign (noncancerous) nodules. I am looking for solution from long time but I haven't found any way to continue it.
Here is the segmented Lung:

Update:
Consider the nodule size greater than 3mm is malignant (cancerous). How to calculate the size in mm from the image?

A: After you run this:
% Segment nodules
BW = im2bw(segM, 0.55);

You have the nodules in a BW image. Now, to filter out nodules based on the size, you could fit an ellipse to every node and check the major axis length. To do that you could use regionprops and ask for the MajorAxisLength.
Region props will detect all pixel groups (connected components) of your binary image and return information about each group in a struct array.
Try calling it like this:
nodules = regionprops(BW, 'MajorAxisLength');

It will return a struct array nodules where you can access each nodule like this:
>> nodules(1)

ans =

    MajorAxisLength: 4.6188

>> nodules(1).MajorAxisLength

ans =

    4.6188

It means the first nodule has a major length of 4.6188 pixels. You can convert that size to millimeters if you know the proportion of your image to the real data. For example, suppose you know that every pixel is equal to 0.4 mm in the real world. Then you just have to multiply that value to MajorAxisLength to get the value in mm (and filter the nodules you want).
It would also be useful to know where is the nodule you just filtered out. You can ask regionprops for more data, such as the Centroid, or BoundingBox. Perhaps it's also a good idea to take a look at MinorAxisLength to avoid detecting "lines" as nodules, or the Eccentricity value which tells you "how circle like" a group of pixels is. Take a look at the documentation for more information.
Also take a look at this other question, it might be useful:


text:
Q: Am i looking at HTML / Django the wrong way? So I'm comfortable programming in Python, I love the minimalist nature of the language. However, I haven't been exposed to any Django yet.
I do know html, css etc for web design but when making websites is it essentially doing either
1) The usual route: HTML, CSS,
or
2) Using Django
My understanding is that both the above can also be integrated with PHP, MySql, Javascript technologies.
Looking at www.reddit.com, I notice when I click view page source it doesn't seem to have the usual html (I know that reddit is made using Django)
Looking at another website eg www.cake.com, it seems to have the usual html.
Looking at both the above made me arrive at the conclusion that a website uses either Django or HTML/CSS only (not both at the same time).
This is my thought process.

A: Django is a framework for building web applications with Python.
As it sounds like you might not know what these concepts are and are thus confused, I'll try to give a quick overview over what this means:
A framework gives you additional tools (libraries) to work with a programming language. It basically makes working with the language in certain contexts easier from the start as you don't have to build every tool you want to use from scratch. For example, connecting a website with a database might be made easier by using shortcuts (provided by the framework) for interacting with the database.
A web application is a website that reacts to user interaction. It doesn't only serve static content (the HTML and CSS you see in your browser) but dynamically serves content. Based on user input, your web application might e.g. retrieve information from a database and display it, or it might provide a way for the user to authenticate with the website (by checking credentials).
Django is one such web application framework, and Python is the programming language it is built on. There are other frameworks out there that make creating web applications easier, which are based on other languages (e.g. Ruby on Rails, often shortened to just Rails, which is based on the Ruby programming language). There are also other Python-based web application frameworks, which you could use instead of Django, e.g. Flask. As different frameworks provide different functionality and some might be better-suited for some tasks than others, it would make sense to look for online comparisons before picking one.
I have never worked with pure Python combined with HTML + CSS (like you'd combine HTML/CSS and PHP code in one document) and don't know if that is even possible and how one would go about it.
If you want to give Django a try, I'd recommend checking out the Django Girls tutorial, which is a very beginner-friendly tutorial available in several languages.

A: Using Django does not mean rejecting HTML. You can use Django to create Angular.JS sites, REST API's, SOAP API as well as regular sites with 'normal' HTML.
Most of the time Django is ORM engine and URL routing. Additionally, it may be combined with the template engine and integrated "CMS".


text:
Q: Cost of ExecutionContext.Capture() and ExecutionContext.Run(context, work, state) Does anybody know if it is expensive to ExecutionContext.Capture() and to  ExecutionContext.Run(context, work, state)?
Does it decrease performance and so is recommended to use carefully?
I'm asking since I have an ContextItem where I save Context work and state in to execute later. Since I want to be able to react on an exception that might be thrown while executing work, I have a fallback that is executed if an exceptrion is thrown in work. And I also have final work, that is executed in any case regardlessly if an exception was thrown or not.
Since I can use an ExecutionContext only once I would have to ExecutionContext.Capture() three times for one of these ContextItems...
Or does this sound like a totally wrong approach?

A: As recommended by @Alois Kraus I ran a test with the following code comparing locking to capturing & lined up excecution:
class Program
{
    private static readonly object _lock = new object();
    private static readonly int numberOfItems = 1000000;
    private static readonly int _numberOfIterations = 1000000;

    private static void Main(string[] args)
    {
        MeasureTimeWithLocking();
        MeasureTimeWithCapuringContext();
        Console.WriteLine();
        MeasureTimeWithLocking();
        MeasureTimeWithCapuringContext();
        Console.WriteLine();
        MeasureTimeWithLocking();
        MeasureTimeWithCapuringContext();
        Console.ReadKey();
    }

    private static void MeasureTimeWithLocking()
    {
        List<ContextItem> items = new List<ContextItem>();
        Stopwatch stopwatch = Stopwatch.StartNew();
        for (int i = 0; i < numberOfItems; i++)
        {
            ContextItem item = new ContextItem();
            item.Work1 = DoSomeWorkWithLock;
            item.Work2 = DoSomeWorkWithLock;
            item.Work3 = DoSomeWorkWithLock;
        }

        Parallel.ForEach(items, (item) =>
        {
            item.Work1(null);
            item.Work2(null);
            item.Work3(null);
        });
        stopwatch.Stop();
        Console.WriteLine("Time elapsed with locking:           " + stopwatch.Elapsed);
    }

    private static void MeasureTimeWithCapuringContext()
    {
        List<ContextItem> items = new List<ContextItem>();
        Stopwatch stopwatch = Stopwatch.StartNew();
        for (int i = 0; i < numberOfItems; i++)
        {
            ContextItem item = new ContextItem();
            item.Context1 = ExecutionContext.Capture();
            item.Context2 = ExecutionContext.Capture();
            item.Context3 = ExecutionContext.Capture();
            item.Work1 = DoSomeWork;
            item.Work2 = DoSomeWork;
            item.Work3 = DoSomeWork;
        }

        foreach (ContextItem item in items)
        {
            ExecutionContext.Run(item.Context1, item.Work1, null);
            ExecutionContext.Run(item.Context2, item.Work2, null);
            ExecutionContext.Run(item.Context3, item.Work3, null);
        }
        stopwatch.Stop();
        Console.WriteLine("Time elapsed with capturing context: " + stopwatch.Elapsed);
    }

    private static void DoSomeWork(object ignored)
    {
        Work();
    }

    private static void DoSomeWorkWithLock(object ignored)
    {
        lock (_lock)
        {
            Work();
        }
    }

    private static void Work()
    {
        int count = 0;
        for (int i = 0; i < _numberOfIterations; i++)
        {
            count ++;
        }
    }

    private class ContextItem
    {
        public ExecutionContext Context1 { get; set; }
        public ExecutionContext Context2 { get; set; }
        public ExecutionContext Context3 { get; set; }

        public ContextCallback Work1 { get; set; }
        public ContextCallback Work2 { get; set; }
        public ContextCallback Work3 { get; set; }
    }
}

Results are:

So if I did this right, capturing & executing lined up is in average round about 5 times more expensive than locking.
To also answer the part of my question:

Or does this sound like a totally wrong approach?

I read in this article that

if you have to know they're there, either you're doing something super advanced, or something's gone wrong.

The article was recommended on SO as the best source if you want to know about ExecutionContext.
After going through it and running some tests with a colleague I realized that I was using ExecutionContext where it didn't make sense, plus it is less performant then than locks and so it probably also is less performant than other threading functionalities / constructs.


text:
Q: How can I get previous and next objects from a filtered, ordered queryset? I have a page based on a model object, and I want to have links to the previous and next pages. I don't like my current solution because it requires evaluating the entire queryset (to get the ids list), and then two more get queries. Surely there is some way this can be done in one pass?
def get_prev_and_next_page(current_page):
    ids = list(Page.objects.values_list("id", flat=True))
    current_idx = ids.index(current_page.id)
    prev_page = Page.objects.get(id=ids[current_idx-1])
    try:
        next_page = Page.objects.get(id=ids[current_idx+1])
    except IndexError:
        next_page = Page.objects.get(id=ids[0])
    return (prev_page, next_page)

Sort order is defined in the model, so doesn't have to be handled here, but note that you can't assume that ids are sequential.

A: Sounds like something the Paginator set to a threshold of 1 would do well at.
# Full query set...
pages = Page.objects.filter(column=somevalue)
p = Paginator(pages, 1)

# Where next page would be something like...
if p.has_next():
     p.page(p.number+1)

Documentation here and here.

A: I'm new to Python and Django, so maybe my code is not optimal, but check this out:
def get_prev_and_next_items(target, items):
    ''' To get previous and next objects from QuerySet '''
    found = False
    prev = None
    next = None
    for item in items:
        if found:
            next = item
            break
        if item.id == target.id:
            found = True
            continue
        prev = item
    return (prev, next)

And in view something like that:
def organisation(request, organisation_id):
    organisation = Organisation.objects.get(id=organisation_id)
    ...
    prev, next = get_prev_and_next_items(organisation, Organisation.objects.all().order_by('type'))
    ...
    return render_to_response('reference/organisation/organisation.html', {
        'organisation': organisation,
        'prev': prev,
        'next': next,
    })

Definitely not optimal for «heavy» querysets, but in most cases works like a charm. :)

A: Check out django-next-prev, I wrote it to solve this exact problem. In this case:
from next_prev import next_in_order, prev_in_order

def get_prev_and_next_page(current_page):
    page_qs = Page.objects.all()  # this could be filtered, or ordered
    prev_page = prev_in_order(current_page, page_qs)
    next_page = next_in_order(current_page, page_qs)
    return (prev_page, next_page)


text:
Q: Can I skip the normal syntax and work with geometry buffers in three.js for faster performance? I'm new to the area of geometry generation and manipulation and I'm planning on doing this on an intricate and large scale. I know the basic way of doing this is like it's shown in the answer to this question..
var geom = new THREE.Geometry();
var v1 = new THREE.Vector3(0,0,0);
var v2 = new THREE.Vector3(0,500,0);
var v3 = new THREE.Vector3(0,500,500);

geom.vertices.push(v1);
geom.vertices.push(v2);
geom.vertices.push(v3);

geom.faces.push( new THREE.Face3( 0, 1, 2 ) );
geom.computeFaceNormals();

var object = new THREE.Mesh( geom, new THREE.MeshNormalMaterial() );

object.position.z = -100;//move a bit back - size of 500 is a bit big
object.rotation.y = -Math.PI * .5;//triangle is pointing in depth, rotate it -90 degrees on Y

scene.add(object);

But I do have experience with doing image manipulation working directly with a typed array image buffer on the GPU which is essentially the same thing as manipulating 3D points, since colors are essentially 3D points on a 2D grid (in the case of a buffer, flattened out to a 1D typed array) and I know just how much faster that kind of large scale manipulation is when processed with shaders on the GPU.
So I'm wondering if I can access the geometry in three.js directly as a typed array buffer. If so, I can use gpu.js to manipulate it on the GPU rather than CPU and boost performance exponentially.
Basically I'm asking if there's something like canvas's getImageData method for three.js geometry.

A: As ThJim01 mentioned in the comment, THREE.BufferGeometry is the way to go, but if you insist on using THREE.Geometry to initialize your list of triangles, you can use the BufferGeometry.fromGeometry function to generate the BufferGeometry from the Geometry you originally made.
var geometry = new THREE.Geometry();
// ... initialize verts and faces ...

// Initialize the BufferGeometry
var buffGeom = new THREE.BufferGeometry();
buffGeom.fromGeometry(geometry);

// Print the typed array for the position of the vertices
console.log(buffGeom.getAttribute('position').array);

Note that the resultant geometry will not have an index array and just be a list of disjointed triangles (as it was represented as in the first place!)
Hope that helps!


text:
Q: MySQL claims that a built-in function "does not exist." Tell me what's wrong in these two queries?
SELECT * FROM `product_description` WHERE CHAR_LENGTH (description) > 250
SELECT * FROM `product_description` WHERE LENGTH (description) > 250

They return these error
Function table.name CHAR_LENGTH does not exist
Function table.name LENGTH does not exist

both functions seems not to work... what is going on ?

A: Maybe it is this which causes the issue
By default there must be no whitespace between a function name and the parenthesis following it. This helps the MySQL parser distinguish between function calls and references to tables or columns that happen to have the same name as a function. However, spaces around function arguments are permitted.


text:
Q: S3 returns 403 when trying to download file from Android Emulator I'm developing an Android app with React Native and I have ran into a problem with S3. I'm running the app on an emulator, and trying to download a file through a presigned URL from localstack. I've tried to do so with RNFS and RNFetchBlob, none of them worked. With both libs, S3 gives this message:

Presign signature calculation failed: <Response [403]>

I'm sending my request to 10.0.2.2:4566 instead of 127.0.0.1:4566, because the app can't connect to the latter (because it runs on an emulator).
I can access the URL through my browser, but I can't make it work on the emulator. What am I missing?

A: Check your emulator date and time. The signature is time dependent so your emulator time should be correct.

A: Finally figured it out. I had to configure on the backend that localstack should use my PC's IP, and access the files on the Emulator through that. This way the GET request is successful.
# AWS - localstack
aws.endpoint.url = http://192._._._:4566


text:
Q: Problems upgrading from 12.04 to 14.04 I'm a complete Linux newbie using Ubuntu 12.04 on my laptop and now wanting to upgrade to 14.04. I'm having some issues and have tried googling my way out. I would really appreciate some advice but please treat me as though I am a moron as I have very little experience with linux :-( I'm really sorry to do a "tl;dr" as my first post but I don't know what is relevant and what's not.
I tried to do the upgrade from update manager but got this message:
Third party sources disabled
Some third party entries in your sources.list were disabled. You can re-enable them after the upgrade with the 'software-properties' tool or your package manager.

Followed by this message:
The upgrade has aborted. The upgrade needs a total of 2,195 M free space on disk '/'. Please free at least an additional 891 M of disk space on '/'. Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.

The point at which the above happened was at "setting new software channels"
I emptied my rubbish bin and did
sudo apt-get clean

as instructed; Nothing happened in the terminal after that though. I'm not sure where '/' is and what I should delete on it? Nevertheless, I then tried to reinstall using update manager again but the results were the same.
I then googled a bit and did this in terminal:
sudo update-manager -d

and got this:
WARNING:root:nothing unsupported running 0 (0)

It then brought up update manager again anyway, so I clicked on upgrade again, as per my first step, but results were the same.
Thanks. The output of

df -h

is:
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       7.4G  5.8G  1.3G  83% /
udev            932M  4.0K  932M   1% /dev
tmpfs           188M  920K  187M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            939M   19M  921M   2% /run/shm
/dev/sda6       220G   31G  178G  15% /home
Really basic qu here but how do I remove things from /.?
I also did as below, and tried the upgrade again, but same results
sudo apt-get autoremove && sudo apt-get autoclean
[sudo] password for fibie:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
  gettext libtommath0 ttf-droid ttf-umefont ttf-unfonts-core wine-gecko1.8
  wine-gecko1.9
0 to upgrade, 0 to newly install, 7 to remove and 0 not to upgrade.
After this operation, 41.1 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 278209 files and directories currently installed.)
Removing gettext ...
Removing libtommath0 ...
Removing ttf-droid ...
Removing ttf-umefont ...
Removing ttf-unfonts-core ...
Removing wine-gecko1.8 ...
Removing wine-gecko1.9 ...
Processing triggers for install-info ...
Processing triggers for man-db ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Reading package lists... Done
Building dependency tree
Reading state information... Done
Thanks
This was originally a windows pc, but I thought I uninstalled windows. I don't get offered the option of booting into windows at start-up. I don't want or need windows.
Thanks :-) How do I resize the / partition?
I just tried

sudo do-release-upgrade

The output was HUGE but ultimately the result was the same and upgrade aborted.

A: / is your root partition. Your entire Ubuntu installation is in /. This includes all your applications, music, pictures, videos, etc. (Your personal files are usually stored in /home/(username)/). If you can clear/copy some of those to another location, you'll free up space in /.
You could also run sudo apt-get autoremove && sudo apt-get autoclean to free up a little more space
Your home directory is mounted on a 220G partition and your root directory(/) is mounted on a 7.4G partition. I'd recommend resizing the / partition (/dev/sda1) to 15G or so. You can use a tool like gparted to resize partitions.
If you don't want to resize the partition sudo do-release-upgrade *might* work.
Could you post your replies as comments on this post? Otherwise the original post gets cluttered.
In that case you should install gparted by running sudo apt-get install gparted. Then gparted & to run it.

A: You are in a bit of a bind: Your root partition is only ~8GB, so making space in it is hard. What I suggest is that you set up a temporary mount from a folder in your home directory to /var/cache/apt/archives/, so that the space in your home directory partition is available for apt:
mkdir ~/tmp
sudo mount -o bind ~/tmp /var/cache/apt/archives/

This should give apt plenty of room.


text:
Q: Processing photos uploaded by IOS gives different results I'm writing this post as my last bullet to solve the mistery of what is going on here.
Essentially, I'm developing an IOS app which will upload a set of photos to Azure, and they will be processed with AI and Image processing in a Batch service.
The app should upload the images to an azure Function, which will trigger the batch service in which all the processing is done, then the results are stored in an storage account.
All of the tests I have done so far have been succesful processing images from local, or even making my PC to download them from the cloud and process them as same encoding/decoding steps until the process begin.
The problem starts when I do the entire process, just including the front end part, with the only difference that the images are uploaded from IOS instead of my PC to the function, it gives entirely different (and wrong) results.
Things I have tested until now:

*

*The most relevant thing I can tell, I have downloaded a set of photos previously uploaded by IOS, I have reuploaded from my PC and the results were correct again, so the exact same images, the exact same process, gives really diferent results.

*The quality encoder of IOS app is set to 1/1.

*The RGB values from an image uploaded by IOS and the same image uploaded locally differ in no more than +-3-5... That couldnt lead to the results I am getting.
Code I use to begin the process.
generator = block_blob_service.list_blobs(container_name)
front = block_blob_service._get_blob(container_name, blob.name)
b64_bytes_front = np.frombuffer(front.content, dtype=np.uint8)
opencv_front = cv.imdecode(b64_bytes_front, cv.IMREAD_COLOR)
img = opencv_front

As I said, I use the same code to download to my PC (imwrite at the end)
I dont know what else to do, is there anyone here that had a similar experience?
Thank you so much.
EDIT. Im aware of all that opencv RGB-BGR standard. The channels are right, I think It has more to do with the decoding process of an image firstly recognized as jpeg (from azure), and the same image (not)recognized as Octet-application, as it shows when I upload it from IOS. Im starting to guess that this doesnt have solution since I'm talking about natural loss from encoding/decoding steps, but the differences in the processing are too big

A: I noticed this line: opencv_front = cv.imdecode(b64_bytes_front, cv.IMREAD_COLOR)
which I assume means you are using openCV and doing something with color? I had a problem with this a while ago, and discovered that openCV stores color values internally as BGR instead of RGB. It does, however, expect the input to be RGB unless you tell it otherwise, and will automatically revert the format back to RGB if you use any of openCV's file write functions.
Now, the reason I believe that it affects your IOS app: the BGR format is used by openCV because it is a format used by digital cameras! (The reason can be read here: https://www.learnopencv.com/why-does-opencv-use-bgr-color-format/) My guess is that IOS photos/images are stored as BGR and if you send them via the app, they are sent as BGR (as is) while when you export them to your PC, the IOS software converts it to RGB so your photos don't look weird when you try to view them on a PC - this would explain why downloading to your PC and then reuploading fixes the issue.
Hope this helped somehow!


text:
Q: A doubt on the notation of Frigola et al (2013) of Gaussian Processes(GP) for a State-Space model?
The picture above is from Frigola et al (2013) - Bayesian Inference and Learning in Gaussian Process State-Space Models with Particle MCMC.
In this paper, the authors later define $\mathbf{f}_t=f(\mathbf{x}_{t-1})$, and here lies my misunderstanding...
Let me explain better my doubt. When $f(\mathbf{x}_t)$ follows a unidimensional GP, we have for any $n\in \mathbb{N}$
$(f(\mathbf{x}_1),...,f(\mathbf{x}_n))\sim \mathcal{N}(\mu,k(X,X'))$,
where $f(\cdot) \in \mathbb{R}$, and $\mu = (m(\mathbf{x}_1),...,m(\mathbf{x}_1))'$.
However, when we write $\mathbf{f}_t=f(\mathbf{x}_{t-1})$, it seems we are using a univariate function to define vector $\mathbf{f}_t$. How can this be?
Any help would be appreciated.

A: Although I did not find this explicitly stated in the paper, it seems that $f$ is actually intended to be a multiple output Gaussian process (possibly with independent components) - so that a realization is a function from $\mathbb{R}^{n_x}$ to $\mathbb{R}^{n_x}$ and thus $\mathbb{f}_t = f(\mathbf{x}_t) \in \mathbb{R}^{n_x}$. Note that:

*

*In the first author's PhD thesis [1], Section 3.1, similar notation is used to define a Gaussian process state-space model, and on p. 27 the following remark appears:

Note that the covariance function $\kappa(\cdot, \cdot)$ returns a matrix
  of the same size as the state in an analogous manner to multi-output Gaussian
  processes (Rasmussen and Williams, 2006).

*In an earlier paper considering Gaussian process state-space models, Turner et al. [2] (reference [2] of the case paper), "independent GPs are used for each target dimension of $f$" (p. 869, last paragraph of the left-hand-side column). Which is a special case of a multiple-output GP.

References
[1] Roger Frigola-Alcalde (2015) Bayesian Time Series Learning
with Gaussian Processes. PhD thesis, University of Camridge. http://www.rogerfrigola.com/doc/thesis.pdf
[2] Ryan Turner, Marc Deisenroth, and Carl Rasmussen (2010). "State-space inference and learning with Gaussian processes." AISTATS 2010, http://proceedings.mlr.press/v9/turner10a/turner10a.pdf.

A: You need to understand the notation here. When the author say
\begin{align}
x_{t+1}| f_t \sim \mathcal{N}(x_{t+1}|f_t, Q),
\end{align}
this implies that $x_{t+1}$ is distributed with mean $f_t$ and covariance $Q$, where $f_t$ is obtained from the state evolution equation given in (1a), i.e.,
\begin{align}
x_{t+1} = f(x_t,u_t) + v_t.
\end{align}
As $f$ depends on $t$, they denote the mean of $x_{t+1}$ as $f_t$ which is nothing but $\mathbb{E}(x_{t+1}) = \mathbb{E}(f(x_t,u_t)) = f_t$ if $v_t \sim \mathcal{N}(0,Q)$. Therefore $x_{t+1}| f_t \sim \mathcal{N}(x_{t+1}|f_t, Q)$.
An easy way to understand this by assuming $f(x_t,u_t)$ takes the form
\begin{align}
f(x_t, u_t) = A x_t + B u_t
\end{align}


text:
Q: I keep getting short internet outages but my ISP says everything is fine. How should I proceed? I have a fibre internet connection as is typical in the UK - normal telephone cable to my house, then a combined home modem/router.
My connection is generally stable and consistent in terms of performance, but least once a day I loose service typically for 30s - 1min, sometimes a little longer but very rarely longer than 2 minutes. I work at home over RDP so I notice immediately, most people probably would not even be aware.
When I ping google.com from my Mac I will typically see a response time of 13ms. When the problem occurs I may see timeouts but more typically, the ping will jump to several seconds or several tens of seconds in a brief 'spike'.
I've confirmed that I can connect to my router (192.168.xxx.xx) interface and it reports the internet connection is down at these times. My devices connect to my router/modem fine, but it says the connection to the outside world is lost. e.g.

In my router logs all I see is this (last outage was 14:52):

Contacting my ISP their reply is:

I have looked into your account and there is stable connection with no
drops in last 50 days. Looks like issues you are experiencing are down
to wireless performance as line up to router is working fine

I am curious what/how their line check could entail so I can respond more usefully? Are they constantly pinging my modem otherwise how would they know if it is connected OK? If they say it's all fine on their side how can I investigate further and what should I be asking them to do?
It seems to me either their line has a problem, or my router is mistakenly reporting a lost connection. But how can I figure out which?

A: Simply speaking, your IPS (seems to) monitors the connection between your modem and the endpoint it connects to (it's a little more complicated then a "simple" ping).
Basically the ISP has a stable connection to your modem and assumes the problem is "behind" the modem on your end (your LAN). In my experience this is often the case due to IP conflicts, defective HW etc.
You can do systematic trouble shooting, to check for the problem's source (see comment):

*

*What happens if you ping the router's IP (the private IP your router has in your LAN not the public IP)?

*Some router interfaces give you the option to send out a ping as a trouble shooting tool, if this is available try to ping google directly from your router.

*Also make sure to ping different public IPs (use more then one and don't use just the DNS name, but ping the IP directly).

*If you router get's a public IP from your ISP (an doesn't block ICMP) you could try to ping your router through a different internet connection (e.g. your mobile phone when you are not connected to the internet)

Alternatively I would check if you can just connect one device via Ethernet through your router and disable the WLAN temp. Or better: disable your router and WLAN functionality and establishing a PPPoE connection directly with your "modem" over a LAN cable (as long as this is supported by your ISP and your modem not all devices support PPPoE). Make sure to use a software firewall if you connect your machine directly via PPPoE.
This can eliminate most things that can go wrong on your side. If the problem still persists it's most likely a problem with the modem/router and you need to replace the device. But some further testing will be necessary to be sure.
If for some reason you can not do any more troubleshooting, to find the cause, I would just tell tech support that the router itself says that there is no internet connection (not your device). If the ISP provided the router that usually does the trick and they will help you in the further steps.


text:
Q: AWK - does an if condition calculate an array input Question
so I have the following line of code:
if (sum[msg,h]/summsg[msg,h] != 0)
printf ("%9.2f\n",sum[msg,h]/summsg[msg,h])

msg is a message array holds 10 distinct values
hr holds all hours present in a log file.
the sum[] array is addind together values of a field  (sum[$5,$3] += $11)
and the summsg[] array is counting the number of lines (summsg[$5,$3]++)
This is retuning a fatal: division by zero attempted error, but I thorght that awk would evaluate the sum[msg,h]/summsg[msg,h] != 0 and then continue.
I have also tried checking for each of the values with the following code:
if (sum[msg,h] != 0 || summsg[msg,h] != 0)
printf ("%9.2f\n",sum[msg,h]/summsg[msg,h])

But this is stopping my hour calculation as I think it is picking up the leading 0 's on hours 00-09 and returning false.
I can provide the full code if needed.
Any ideas?
Comment Update
As per the comments, they were typos, corrected them and they didn't make a difference.
Sample input file
message1 01 10
message2 01 01
message2 01 05
message1 01 15
message1 01 05
message1 02 03
message1 02 06
message2 02 10
message2 02 20
message2 02 05

This is a made up input file

The code to reflect the input file would be as follows:
{
msg_type[$1]++
sum[$1,$2] += $3
summsg[$1,$2]++
}
END {
 for (msg in msg_type) {
    print msg
    for (h = 0; h <= 23; h++) {
        if (sum[msg,h] != 0 || summsg[msg,h] != 0)
        printf ("%9.2f\n",sum[msg,h]/summsg[msg,h])
       }
   }
}

A: For your MCVE code, the problem is that you indexed the arrays with 01 or 02 while loading them, but are trying to extract the data with 1 or 2 (no leading zero).  You have to fix that.  For example:
{
  msg_type[$1]++
  sum[$1,$2] += $3
  summsg[$1,$2]++
  #print "type:", $1, "hr:", $2, "value:", $3
}
END {
  for (msg in msg_type) {
    print msg
    for (i = 0; i <= 23; i++) {
      if (i < 10)
        h = "0" i
      else
        h = i
      #print "  ", msg, h, sum[msg,h], summsg[msg,h]
      if (sum[msg,h] != 0 || summsg[msg,h] != 0)
        printf("%9.2f\n", sum[msg,h]/summsg[msg,h])
    }
  }
}

For the sample input, the output becomes:
message1
    10.00
     4.50
message2
     3.00
    11.67

I think you should probably print the hour too, but that's your choice.


text:
Q: Validation Profiles still execute if previous profiles throw error I have a custom sign-up policy that has 3 validation profiles.
<ValidationTechnicalProfile ReferenceId="UsernameCheck" ContinueOnError = "false"/>
<ValidationTechnicalProfile ReferenceId="API-VerifyStep1"  ContinueOnError = "false"/>
<ValidationTechnicalProfile ReferenceId="AAD-UserWriteUsingLogonName" ContinueOnError="false" />

<TechnicalProfile Id="UsernameCheck">
  <Metadata>
    <Item Key="Operation">Read</Item>
    <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">false</Item>
  </Metadata>
  <IncludeInSso>false</IncludeInSso>
  <InputClaims>
    <InputClaim ClaimTypeReferenceId="signInName" PartnerClaimType="signInNames.emailAddress" Required="true" />
  </InputClaims>
  <OutputClaims>
    <!-- Required claims -->
    <OutputClaim ClaimTypeReferenceId="objectId" DefaultValue="NOTFOUND" />
    <OutputClaim ClaimTypeReferenceId="objectIdNotFound" DefaultValue="NOTFOUND" AlwaysUseDefaultValue="true" />
  </OutputClaims>
  <OutputClaimsTransformations>
    <OutputClaimsTransformation ReferenceId="AssertObjectIdObjectIdNotFoundAreEqual" />
  </OutputClaimsTransformations>
  <IncludeTechnicalProfile ReferenceId="AAD-Common" />
</TechnicalProfile>

<TechnicalProfile Id="API-VerifyStep1">
<DisplayName>Validate user's input data and return if valid to sign-up</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
    <Metadata>
        <Item Key="ServiceUrl">https://...</Item>
        <Item Key="SendClaimsIn">Body</Item>
        <!-- Set AuthenticationType to Basic or ClientCertificate in production environments -->
        <Item Key="AuthenticationType">None</Item>
        <!-- REMOVE the following line in production environments -->
        <Item Key="AllowInsecureAuthInProduction">true</Item>
      </Metadata>
<InputClaims>
    <InputClaim ClaimTypeReferenceId="extension_accessNumber"  />
    <InputClaim ClaimTypeReferenceId="email" />
    <InputClaim ClaimTypeReferenceId="signInName" />

</InputClaims>

<OutputClaims>
    <OutputClaim ClaimTypeReferenceId="extension_error" PartnerClaimType="extension_error" DefaultValue="true" />
    <OutputClaim ClaimTypeReferenceId="extension_message"  PartnerClaimType="extension_message" DefaultValue="Error"/>
    <OutputClaim ClaimTypeReferenceId="objectId" />
    <OutputClaim ClaimTypeReferenceId="newUser" PartnerClaimType="newClaimsPrincipalCreated" />
    <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="localAccountAuthentication" />
    <OutputClaim ClaimTypeReferenceId="userPrincipalName" />

</OutputClaims>
<OutputClaimsTransformations>
   <OutputClaimsTransformation ReferenceId="AssertErrorMessageFalseStep1" />
</OutputClaimsTransformations>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />

The problem is all validation profiles are executed regarldess of throwing an error. If either of the first two throw an error I receive a message on the sign-up page. However, the user still gets added to Azure AD. Why does it do this? What is the point of ContinueOnError? How do I ensure the write only happens after the other two are done validating?
Thank you in advance

A: ContinueOnError is by default false, so you shouldn't need to specify it as long as you want the default behavior.
Since you are using a restful provider, I suspect you are running into the issue mentioned by following thread -
Custom policy REST API ValidationTechnicalProfile ContinueOnError not working for HTTP codes like 404 NotFound and 401 unauthorized
Basically the validation technical profile needs to return 409.
https://learn.microsoft.com/en-us/azure/active-directory-b2c/validation-technical-profile
You can also use Preconditions as mentioned on the above page to avoid executing a technical profile.


text:
Q: How to create transitive properties usingh Jena schema? I basically want to do this using Jena:
i) Schema
class:LivingBeing type owl:Class
prop:PrimeFeatures

class:Animal type owl:Class
prop:Speed typeOf PrimeFeatures
prop:Nature typeOf PrimeFeatures

class:HumanBeing type owl:Class
prop:Intelligence typeOf PrimeFeatures

ii) Data
Individual:Cat typeOf Animal resource="someuri:Cat"
prop:Speed = 100
prop:Nature = violent
prop:Veg = No

Individual:John typeOf HumanBeing resource="someuri:John"
prop:Intelligence = Average

Resource resourcecat = model.getResource("someuri:Cat") ;

Using above schema and data, I want to answer following kinds of needs for resourcecat:
Get PrimeFeatures of resourcecat : I should get both the names of the Properties which are PrimeFeatures for Cat and their values.
So, I should get following:-
           PrimeFeatures(catresource):
           speed=100
           nature=violent

Also, I should be able to modify the prime features of the Animal class using the Animal class schema.
Basically I want to control the data which I fetch using the schema.
Mostly using OntClass, Resource and Properties. I know it must be possible using Jena.

A: One possible solution appears below. However, I would caution that you're not really using the characteristics of OWL and RDF in the way they were designed. If you really want to to make use of Jena's capabilities, you should read more about semantic web technology and use that to guide your design. Otherwise, you might as well design a custom solution just for your application using Java, rather than try to force-fit your design into a representation where it doesn't really fit.
package test;

import com.hp.hpl.jena.ontology.*;
import com.hp.hpl.jena.rdf.model.ModelFactory;
import com.hp.hpl.jena.util.iterator.ExtendedIterator;

public class User1374179_Test
{
    public static String ns = "http://example.org/test#";

    private OntClass livingBeing;
    private OntClass animal;
    private OntProperty primeFeatures;
    private OntProperty speed;
    private OntProperty nature;

    public static void main( String[] args ) {
        new User1374179_Test().run();
    }

    public void run() {
        OntModel m = createSchema();
        showClassProperties( livingBeing );
        showClassProperties( animal );

        Individual cat1 = createInstance( m, animal, "cat1" );
        cat1.addProperty( speed, m.createTypedLiteral( 100 ));
        cat1.addProperty( nature, "violent" );
        showInstanceProperties( cat1, animal );
    }

    private OntModel createSchema() {
        OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM_MICRO_RULE_INF );

        livingBeing = m.createClass( ns + "LivingBeing" );
        primeFeatures = m.createOntProperty( ns + "primeFeatures" );
        primeFeatures.addDomain( livingBeing );

        animal = m.createClass( ns + "Animal" );
        animal.addSuperClass( livingBeing );

        speed = m.createOntProperty( ns + "speed" );
        speed.addSuperProperty( primeFeatures );
        speed.addDomain( animal );

        nature = m.createOntProperty( ns + "nature" );
        nature.addSuperProperty( primeFeatures );
        nature.addDomain( animal );

        return m;
    }

    private Individual createInstance( OntModel m, OntClass cls, String name ) {
        return m.createIndividual( ns + name, cls );
    }

    private void showClassProperties( OntClass c ) {
        System.out.println( "Class " + c.getURI() );
        for (ExtendedIterator<OntProperty> i = c.listDeclaredProperties(); i.hasNext(); ) {
            System.out.println( " .. has property " + i.next() );
        }
    }

    private void showInstanceProperties( OntResource r, OntClass c ) {
        System.out.println( "Instance " + r.getURI() + " has properties: " );
        for (ExtendedIterator<OntProperty> i = c.listDeclaredProperties(true); i.hasNext(); ) {
            OntProperty p = i.next();
            System.out.println( p.getURI() + " ==> " + r.getPropertyValue( p ) );
        }
    }
}

Output:
Class http://example.org/test#LivingBeing
 .. has property http://example.org/test#primeFeatures
Class http://example.org/test#Animal
 .. has property http://example.org/test#speed
 .. has property http://example.org/test#primeFeatures
 .. has property http://example.org/test#nature
Instance http://example.org/test#cat1 has properties:
http://example.org/test#speed ==> 100^^http://www.w3.org/2001/XMLSchema#int
http://example.org/test#nature ==> violent


text:
Q: creating a dynamic height for a div I have a simple div that contains product information (image, title, description, price, etc...).  I'm using bootstrap (3.x)On the desktop, I use a specific height for the div so everything is equal, displaying in 2 columns.  On Mobile, I only have one column and I'd like to find a way to make the div height dynamic based on the size instead of setting a specific pixel height (descriptions vary and can change the height of the div quite a bit).  Is this possible?  The div's are created dynamically from a database...
Here's the current css - as you can see, I'm setting the height with pixels right now.
.prodBox2 {
height: 300px;
margin-bottom: 10px;
padding:5px;
border: 3px solid #666666;
border-radius:25px;
font-family: arial;
font-size: .8em;
color: rgb(50, 50, 50);
}
.prodImage2 {
float: left;
margin: 10px;
width: 125px;
height: auto;
}

Here's a codlin link if it helps:
http://codepen.io/shadowfax007/pen/xVqQNm

A: Any div's height is dynamic by default. So all you need to do is wrap the height condition in a media query (at screen widths above 768px):
@media(min-width: 768px) {
  .prodBox2 {
    height: 300px;
    overflow-y: auto;
  }
}
.prodBox2 {
  margin-bottom: 10px;
  padding: 5px;
  border: 3px solid #666666;
  border-radius: 25px;
  font-family: arial;
  font-size: .8em;
  color: rgb(50, 50, 50);
}
.prodImage2 {
  float: left;
  margin: 10px;
  width: 125px;
  height: auto;
}

As a side note, you probably want to do some reading on responsiveness, you are currently doing it wrong. In any good responsive design, you do not need to specify heights.


text:
Q: display images in selected category - magento 2 I have created store configuration with the help of system .xml

*

*list of categories with multi-select

*2 image upload

i want to display images in selected categories
<group id="test" translate="label" type="text" sortOrder="250" showInDefault="1" showInWebsite="1" showInStore="1"> Category <field id="category" translate="label" type="multiselect" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1"> Category <source_model>Test\Magento\Model\Config\Source\Categorylist</source_model> </field> <group id="view" translate="label" type="text" sortOrder="250" showInDefault="1" showInWebsite="1" showInStore="1"> View <field id="category" translate="label comment" type="image" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1"> Category Image <backend_model>Test\Magento\Model\Config\Backend\Image</backend_model> <base_url type="media" scope_info="1">image_upload</base_url> </field> <field id="product" translate="label comment" type="image" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1"> ProductImage  <backend_model>Test\Magento\Model\Config\Backend\Image</backend_model> <base_url type="media" scope_info="1">image_upload</base_url> </field> </group> </group>


text:
Q: HIVE_METASTORE_ERROR expected 'STRING' but 'STRING' is found I've been unable to get any query to work against my AWS Glue Partitioned table. The error I'm getting is

HIVE_METASTORE_ERROR: com.facebook.presto.spi.PrestoException: Error:
  type expected at the position 0 of 'STRING' but 'STRING' is found.
  (Service: null; Status Code: 0; Error Code: null; Request ID: null)

I've found one other thread that brings up the fact that the database name and table cannot have characters other than alphanumeric and underscores. So, I made sure the database name, table name and all column names adhere to this restriction. The only object that does not adhere to this restriction is my s3 bucket name which would be very difficult to change.
Here are the table definitions and parquet-tools dumps of the data.
AWS Glue Table Definition
{
    "Table": {
        "UpdateTime": 1545845064.0,
        "PartitionKeys": [
            {
                "Comment": "call_time year",
                "Type": "INT",
                "Name": "date_year"
            },
            {
                "Comment": "call_time month",
                "Type": "INT",
                "Name": "date_month"
            },
            {
                "Comment": "call_time day",
                "Type": "INT",
                "Name": "date_day"
            }
        ],
        "StorageDescriptor": {
            "OutputFormat": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat",
            "SortColumns": [],
            "InputFormat": "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat",
            "SerdeInfo": {
                "SerializationLibrary": "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
                "Name": "ser_de_info_system_admin_created",
                "Parameters": {
                    "serialization.format": "1"
                }
            },
            "BucketColumns": [],
            "Parameters": {},
            "Location": "s3://ph-data-lake-cududfs2z3xveg5t/curated/system/admin_created/",
            "NumberOfBuckets": 0,
            "StoredAsSubDirectories": false,
            "Columns": [
                {
                    "Comment": "Unique user ID",
                    "Type": "STRING",
                    "Name": "user_id"
                },
                {
                    "Comment": "Unique group ID",
                    "Type": "STRING",
                    "Name": "group_id"
                },
                {
                    "Comment": "Date and time the message was published",
                    "Type": "TIMESTAMP",
                    "Name": "call_time"
                },
                {
                    "Comment": "call_time year",
                    "Type": "INT",
                    "Name": "date_year"
                },
                {
                    "Comment": "call_time month",
                    "Type": "INT",
                    "Name": "date_month"
                },
                {
                    "Comment": "call_time day",
                    "Type": "INT",
                    "Name": "date_day"
                },
                {
                    "Comment": "Given name for user",
                    "Type": "STRING",
                    "Name": "given_name"
                },
                {
                    "Comment": "IANA time zone for user",
                    "Type": "STRING",
                    "Name": "time_zone"
                },
                {
                    "Comment": "Name that links to geneaology",
                    "Type": "STRING",
                    "Name": "family_name"
                },
                {
                    "Comment": "Email address for user",
                    "Type": "STRING",
                    "Name": "email"
                },
                {
                    "Comment": "RFC BCP 47 code set in this user's profile language and region",
                    "Type": "STRING",
                    "Name": "language"
                },
                {
                    "Comment": "Phone number including ITU-T ITU-T E.164 country codes",
                    "Type": "STRING",
                    "Name": "phone"
                },
                {
                    "Comment": "Date user was created",
                    "Type": "TIMESTAMP",
                    "Name": "date_created"
                },
                {
                    "Comment": "User role",
                    "Type": "STRING",
                    "Name": "role"
                },
                {
                    "Comment": "Provider dashboard preferences",
                    "Type": "STRUCT<portal_welcome_done:BOOLEAN,weekend_digests:BOOLEAN,patients_hidden:BOOLEAN,last_announcement:STRING>",
                    "Name": "preferences"
                },
                {
                    "Comment": "Provider notification settings",
                    "Type": "STRUCT<digest_email:BOOLEAN>",
                    "Name": "notifications"
                }
            ],
            "Compressed": true
        },
        "Parameters": {
            "classification": "parquet",
            "parquet.compress": "SNAPPY"
        },
        "Description": "System wide admin_created messages",
        "Name": "system_admin_created",
        "TableType": "EXTERNAL_TABLE",
        "Retention": 0
    }
}

AWS Athena schema
CREATE EXTERNAL TABLE `system_admin_created`(
  `user_id` STRING COMMENT 'Unique user ID',
  `group_id` STRING COMMENT 'Unique group ID',
  `call_time` TIMESTAMP COMMENT 'Date and time the message was published',
  `date_year` INT COMMENT 'call_time year',
  `date_month` INT COMMENT 'call_time month',
  `date_day` INT COMMENT 'call_time day',
  `given_name` STRING COMMENT 'Given name for user',
  `time_zone` STRING COMMENT 'IANA time zone for user',
  `family_name` STRING COMMENT 'Name that links to geneaology',
  `email` STRING COMMENT 'Email address for user',
  `language` STRING COMMENT 'RFC BCP 47 code set in this user\'s profile language and region',
  `phone` STRING COMMENT 'Phone number including ITU-T ITU-T E.164 country codes',
  `date_created` TIMESTAMP COMMENT 'Date user was created',
  `role` STRING COMMENT 'User role',
  `preferences` STRUCT<portal_welcome_done:BOOLEAN,weekend_digests:BOOLEAN,patients_hidden:BOOLEAN,last_announcement:STRING> COMMENT 'Provider dashboard preferences',
  `notifications` STRUCT<digest_email:BOOLEAN> COMMENT 'Provider notification settings')
PARTITIONED BY (
  `date_year` INT COMMENT 'call_time year',
  `date_month` INT COMMENT 'call_time month',
  `date_day` INT COMMENT 'call_time day')
ROW FORMAT SERDE
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'
OUTPUTFORMAT
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://ph-data-lake-cududfs2z3xveg5t/curated/system/admin_created/'
TBLPROPERTIES (
  'classification'='parquet',
  'parquet.compress'='SNAPPY')

parquet-tools cat
role = admin
date_created = 2018-01-11T14:40:23.142Z
preferences:
.patients_hidden = false
.weekend_digests = true
.portal_welcome_done = true
email = foo.barr+123@example.com
notifications:
.digest_email = true
group_id = 5a5399df23a804001aa25227
given_name = foo
call_time = 2018-01-11T14:40:23.000Z
time_zone = US/Pacific
family_name = bar
language = en-US
user_id = 5a5777572060a700170240c3

parquet-tools schema
message spark_schema {
  optional binary role (UTF8);
  optional binary date_created (UTF8);
  optional group preferences {
    optional boolean patients_hidden;
    optional boolean weekend_digests;
    optional boolean portal_welcome_done;
    optional binary last_announcement (UTF8);
  }
  optional binary email (UTF8);
  optional group notifications {
    optional boolean digest_email;
  }
  optional binary group_id (UTF8);
  optional binary given_name (UTF8);
  optional binary call_time (UTF8);
  optional binary time_zone (UTF8);
  optional binary family_name (UTF8);
  optional binary language (UTF8);
  optional binary user_id (UTF8);
  optional binary phone (UTF8);
}

A: I ran into a similar PrestoException and the cause was using uppercase letters for the column type.  Once I changed 'VARCHAR(10)' to 'varchar(10)' then it worked.

A: I was declaring the partition keys as fields in the table. I also ran into the Parquet vs Hive difference in TIMESTAMP and switched those to ISO8601 strings. From there, I pretty much gave up because Athena throws a schema error if all parquet files in the s3 buckets do not have the same schema as Athena. However, with optional fields and sparse columns this is guaranteed to happen

A: I also ran into this error and of course, the error message ended up telling me nothing about the actual problem. I had the exact same error as the original poster.
I am creating my glue tables via the python boto3 API and feeding it the column names, types, partition columns, and some other things. The problem:
here was my code that I was using to create the table:
import boto3

glu_clt = boto3.client("glue", region_name="us-east-1")

glue_clt.create_table(
    DatabaseName=database,
    TableInput={
        "Name": table,
        "StorageDescriptor": {
            "Columns": table_cols,
            "Location": table_location,
            "InputFormat": "org.apache.hadoop.hive.ql.io.SymlinkTextInputFormat",
            "OutputFormat": "org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat",
            "SerdeInfo": {
                "SerializationLibrary": "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe",
            }
        },
        "PartitionKeys": partition_cols,
        "TableType": "EXTERNAL_TABLE"
    }
)

So I ended defining all the column names and types for the input Columns to the API. Then I was also giving it the column name and type for the input PartitionKeys in the API. When I browsed to the AWS console, I realized because I defined the partition column both in the Columns and PartitionKeys, it was defined twice in the table.
Interestingly enough, if you try to do this via the console, it will throw a more descriptive error letting you know that the column already exists (if you try adding a partition column that already exists in the table).
TO SOLVE:
I removed the partition columns and their types from the input Columns and instead just fed them through the PartitionKeys input so they wouldn't be put on the table twice. Soooooo frustrating that this was ultimately causing the same error message as the OP's when querying through Athena.

A: This could also be related to how you created your database (whether through CloudFormation or UI or CLI) or if you have any forbidden characters like '-'. We have hyphens in our database and table names and it renders much functionality useless.


text:
Q: file system not supported error while adding a file to sql filegroup with filestream i am a beginner with sql server 2008, i was trying to add a file to a filegroup so that i an create a table which uses filestream, but i keep getting an errors.
here is the code that i am trying:
ALTER DATABASE dbtry1
ADD FILEGROUP dbtry1_fg_filestream CONTAINS FILESTREAM
GO
ALTER DATABASE dbtry1
ADD FILE
(
NAME= 'dbtry1_filestream',
FILENAME = 'E:\Projects\fs.ndf'
)
TO FILEGROUP dbtry1_fg_filestream
GO
the errors:
Msg 5134, Level 16, State 2, Line 1
The path that is specified by 'E:\Projects\fs.ndf' cannot be used for FILESTREAM files because it is not on a supported file system.
Msg 5009, Level 16, State 14, Line 1
One or more files listed in the statement could not be found or could not be initialized.
Please help!

A: FILESTREAMs require NTFS. Is your e: drive FAT?
See http://technet.microsoft.com/library/bb933993 and note the second paragraph (emphasis added):

FILESTREAM integrates the SQL Server Database Engine with an NTFS file system by storing varbinary(max) binary large object


text:
Q: Adding other language (like VC++ ,etc) quality profiles in sonarqube How can i set quality profile for languages like VC++ . When I am clicking on 'Create' in quality profiles it shows only java,C#,javascript in dropdown. Can I add quality profiles for languages other than these three ?

A: The profile creation dropdown is showing you a list of the languages recognized / loaded in your SonarQube instance. If you're not seeing C++, that means you don't have an analyzer on board that supports the language. Without an analyzer, there's no need for a profile because the analyzer:

*

*parses the language

*computes basic metrics

*provides the rules that would go into your profile
So your first step is to get set up with a code analyzer for the language (one is available as part of the Developer Edition($)). It will come with a default profile, and enable you to create additional profiles.


text:
Q: Regex for getting text between two texts using command prompt I am trying to extract the contents with in the body tag in my html file using command prompt and findstr command. My html is as below
<!doctype html>

  <meta charset="utf-8">
  <title>AdminWeb</title>
  <base href="/wwwroot/admin-web/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">

<app-root></app-root>

The out put I want is
<app-root></app-root>

I am trying to achieve using regular expression.
findstr /R (?<=)(.*)(?=)  test.html

But this is now working in command prompt. But this regex is working in js.
Thanks in advance.

A: First of all, findstr does not support all cool regex features that modern regex engines offer. Especially the latest JavaScript ECMAScript2018+ compliant engines like in Chrome, Node.js, etc. So, saying that "this regex is working in js" does not mean the same pattern will work anywhere else. It won't certainly work in findstr.
You may take the hard way and go on to study how to write a batch script for this. However, there is a much simpler way with other built-in Windows apps.
I strongly suggest Powershell as it offers you a lot of features .NET provides.
Here, open PowerShell console and use
$pathToFile = 'c:\...\...\you_file.txt'
$output_file = 'c:\...\...\you_file_out.txt'
$rx = '(?s)(?<=).*?(?=)'
Get-Content $pathToFile -Raw | Select-String $rx -AllMatches | % { $_.Matches } | % { $_.Value } > $output_file

NOTE: It is best to use an IE automation to handle HTML.
$output_file = 'c:\...\...\you_file_out.txt'
$url = 'http://your_site_here.tld/...'
$ie = New-Object -comobject "InternetExplorer.Application"
$ie.visible = $true
$ie.navigate($url)

while ($ie.Busy -eq $true -Or $ie.ReadyState -ne 4) {Start-Sleep 2}

$doc = $ie.Document
$tags = $doc.getElementsByTagName("body")
$tags[0].innerHTML > $output_file

A: Windows 10 64-bit. PowerShell 5.1
Parsing local \ remote html with PowerShell 5.1 match regex.
Output everything between the body tags. Do not include / include  tags in results. See working on a local / remote file below. See find anything between any <tag> and the very first instance of </tag> below.
Greedy and lazy quantifiers explained
regex101.com is your friend.
Never use (.?|\n), always use (?s).*?
Copy and paste into PowerShell 5.1. It will output everything between . The results outputs twice, once without the body tags and once with.
$testhtml = @'
<!doctype html>

<meta charset="utf-8">
<title>AdminWeb</title>
<base href="/wwwroot/admin-web/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">

<app-root></app-root>

'@

$testhtml -match '(?s)(?<=).*?(?=<\/body>)';$matches[0]
$testhtml -match '(?s)().*?(<\/body>)';$matches[0]

The command can be written:
[regex]::matches($testhtml,'(?s)(?<=).*?(?=<\/body>)').Value
[regex]::matches($testhtml,'(?s)().*?(<\/body>)').Value

Three different commands to work on a local file. Output does not include body tags:
(gc -Raw test.html) -match '(?s)(?<=).*?(?=<\/body>)';$matches[0]

[Regex]::Matches((gc -Raw test.html), '(?s)(?<=).*?(?=<\/body>)').Value

gc test.html -Raw | Select-String '(?s)(?<=).*?(?=<\/body>)' -AllMatches | % { $_.Matches } | % { $_.Value }

Output to results.html:
gc test.html -Raw | Select-String '(?s)(?<=).*?(?=<\/body>)' -AllMatches | % { $_.Matches } | % { $_.Value } | sc results.html

Remote url without and with body tag:
$testhtml = Invoke-WebRequest -Uri http://www.pgatour.com
$testhtml -match '(?s)(?<=).*?(?=<\/body>)'
$matches[0]
$testhtml -match '(?s)().*?(<\/body>)'
$matches[0]

Remote url without and with body tag. Output to results.html:
$testhtml = Invoke-WebRequest -Uri http://www.pgatour.com
$testhtml -match '(?s)(?<=).*?(?=<\/body>)'
$matches[0] | sc results.html
$testhtml -match '(?s)().*?(<\/body>)'
$matches[0] | sc results.html

Remote url between any tag and the first instance of /tag
$testhtml = Invoke-WebRequest -Uri http://www.pgatour.com
$testhtml -match '(
)(?s).*?(<\/div>)'
$matches[0]

Invoke-WebRequest -Uri http://www.pgatour.com | sc results.html
(gc -raw results.html) -match '(
)(?s).*?(<\/div>)'
$matches[0]

Remote url by classname. These work but are not very productive. See Parsing HTML Webpages with Powershell
$response = Invoke-WebRequest -Uri http://www.pgatour.com
$response.ParsedHtml.body.getElementsByClassName('success-message')
$( $response.ParsedHtml.getElementsByTagName('div') | ?{$_.className -eq 'success-message'} ).outerHTML
$( $response.ParsedHtml.body.getElementsByTagName('div') | Where {$_.getAttributeNode('class').Value -eq 'success-message'} ).outerHTML


text:
Q: Handling About:Blank / No IP Address I'm running code to get the URL and IP of the current webpage.  This all works fine until About:Blank shows up and it halts my code cold.  The problem is that About:Blank returns no IP address and that is the problem.  How can I keep this running even if there is no IP address.  Yhis where it stops.
ppaddr2 = (int**)pHostEnt2->h_addr_list;
sockAddr2.sin_addr.s_addr = **ppaddr2;
addr2 = inet_ntoa(sockAddr2.sin_addr);

The relevant code...
BSTR bstr;
pBrowser->get_LocationURL(&bstr);
std::wstring wsURL;
wsURL = bstr;

size_t DSlashLoc = wsURL.find(L"://");
if (DSlashLoc != wsURL.npos)
    {
    wsURL.erase(wsURL.begin(), wsURL.begin() + DSlashLoc + 3);
    }
DSlashLoc = wsURL.find(L"www.");
if (DSlashLoc == 0)
    {
    wsURL.erase(wsURL.begin(), wsURL.begin() + 4);
    }
DSlashLoc = wsURL.find(L"/");
if (DSlashLoc != wsURL.npos)
    {
    wsURL.erase(DSlashLoc);
    }
   wprintf(L"\n   Current Website URL: %s", wsURL.c_str());

int Newlength = WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK, wsURL.c_str(), -1, NULL, 0,  NULL, NULL);
std::string NewLogURL(Newlength+1, 0);
int Newresult = WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK, wsURL.c_str(), -1, &NewLogURL[0],Newlength+1,  NULL, NULL);

HOSTENT *pHostEnt2;
int  **ppaddr2;
SOCKADDR_IN sockAddr2;
pHostEnt2 = gethostbyname(NewLogURL.c_str());

ppaddr2 = (int**)pHostEnt2->h_addr_list;
sockAddr2.sin_addr.s_addr = **ppaddr2;
addr2 = inet_ntoa(sockAddr2.sin_addr);

printf("\n   Current Website IP:%s", addr2);

A: gethostbyname returns NULL if it cannot find a DNS entry. Just check for that and output a suitable message

A: In addition to what rushman said, you could also validate that the URL starts with "http:" or "https:" before processing it.
Also, you should NOT be stripping out the "www." portion.  Everything between "://" and the next "/" is the hostname.  Resolve it as-is, DNS will handle it fine.  In fact, if you strip it off, you can get different results.  For example, "yahoo.com" resolves to "98.139.180.149" but "www.yahoo.com" resolves to "72.30.2.43".  The browser is not going to strip off the "www.", so you should not, either.
Try this:
BSTR bstr;
pBrowser->get_LocationURL(&bstr);
std::wstring wsURL(bstr, SysStringLen(bstr));
SysFreeString(bstr);

std::wstring wsHost;

size_t DSlashLoc = wsURL.find(L"://");
if (DSlashLoc != std::wstring::npos)
{
    DSlashLoc += 3;

    size_t DSlashLoc2 = wsURL.find(L"/", DSlashLoc);
    if (DSlashLoc2 != std::wstring::npos)
      wsHost = wsURL.substr(DSlashLoc, DSlashLoc2 - DSlashLoc);
    else
      wsHost = wsURL.substr(DSlashLoc);
}

if (wsHost.empty())
{
    printf("\n   Unknown Website Host");
}
else
{
    wprintf(L"\n   Website Host: %s", wsHost.c_str());

    std::string sHost;
    int Newlength = WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK, wsHost.c_str(), wsHost.length(), NULL, 0,  NULL, NULL);
    if (Newlength > 0)
    {
        sHost.resize(Newlength);
        WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK, wsHost.c_str(), wsHost.length(), &sHost[0], Newlength, NULL, NULL);
    }

    HOSTENT *pHostEnt2 = gethostbyname(sHost.c_str());
    if (!pHostEnt2)
    {
        printf("\n   Unknown Website IP");
    }
    else if (pHostEnt2->h_addrtype != AF_INET)
    {
        printf("\n   Website does not use IPv4 addresses");
    }
    else
    {
        for (char **addr = pHostEnt2->h_addr_list; *addr != NULL; ++addr)
        {
            printf("\n   Website IP: %s", inet_ntoa(* (struct in_addr *) *addr));
        }
    }
}


text:
Q: Submit button on page will not react to .click() command using Selenium ChromeDriver We have two different pages with submit button on each. On one page submit button register the click and test continue. On second page you can see that Selenium clicked on button, but button won't register the click and test will fail.
Working button:

    <button id="form2:btnContinue" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-right fr" type="submit" onclick="PrimeFaces.ab({s:"form2:btnContinue",u:"form1 form2 form3 form2:btnContinue"});return false;" name="form2:btnContinue" role="button" aria-disabled="false">

    Continue
    </button>

Nonworking button:

<button id="form:j_idt210" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only fr" type="submit" onclick="PrimeFaces.ab({s:"form:j_idt210",u:"form form2 confirmationPanel"});return false;" name="form:j_idt210" role="button" aria-disabled="false">
Submit Payment
</button>

I declare both Webelements similarly. Working button:
@FindBy(xpath = "//*[@id='form2:btnContinue']")
    private WebElement processPaymentButton;

Nonworking button:
@FindBy(xpath = "//*[@id='form:j_idt210']")
    private WebElement submitFormButton;

Also PageObjects looks completely same. Working button:
public void setProcessPayment() {
        WebDriverWait wait = new WebDriverWait(driver, 9);
        wait.until(ExpectedConditions.visibilityOf(processPaymentButton));
        wait.until(ExpectedConditions.elementToBeClickable(processPaymentButton));

        processPaymentButton.click();

        wait.until(ExpectedConditions.visibilityOf(verificationInputField));

        sendKeysElement(verificationInputField, "1111");
        sendPaymentButton.click();
    }

Nonworking button:
public void setProcessPayment() {
        WebDriverWait wait = new WebDriverWait(driver, 9);
        wait.until(ExpectedConditions.visibilityOf(submitFormButton));
        wait.until(ExpectedConditions.elementToBeClickable(submitFormButton));

        submitFormButton.click();

        wait.until(ExpectedConditions.visibilityOf(authorizationTokenField));

        sendKeysElement(authorizationTokenField, "1111");
        authorizePaymentButton.click();
    }

I tried change .click() with .sendKeys(Keys.ENTER), script or Action. Basically I tried everything I was able to found. I also change way button is accessed (CSS, ID, different Xpath approaches). Nothing is working, however when you watch running test, you can clearly see, that Selenium clicked the button. Button was working with Selenium while ago, but than it stopped.
We are using Selenium 2.47.1 and latest ChromeDriver. Button is working when you click on it manually.
Thank you for your help.
NOTE: Issue is more related to button itself than the Selenium. If you give us hint how to fix button to work, we will be thankful.

A: Solution to whole problem lays with "Bank Code" component above. This component contains auto-filler which will display table with possible results (different bank codes and canal used for transaction).

Whole issue was in code I was sending to this component, I was sending bank code with channel, which caused Java on component to break, preventing button to be functional. I found this trying my test with Selenium IDE. Now its working.

So lesson learned from this whole issue is that each component on page can interfere with each other and your button can work if you just adjust your test.


text:
Q: chef knife search node for nil or empty attributes I would like to use the "knife search node" command to identify nodes that have an empty or nil automatic['domain'] attribute.  Is this possible?
The domain is emtpy or nil because /etc/hosts was updated manually with the incorrect order of "ip  (hostname -s)  fqdn" vs "ip (fqdn) (hostname -s)".
I have attempted the following searches:
knife search node -i
"etc_passwd:MYID AND NOT domain:*"
"etc_passwd:MYID AND NOT domain:*?*"

"etc_passwd:MYID AND NOT domain:[a TO z]"
"etc_passwd:MYID AND NOT domain:[a TO z]*"
"etc_passwd:MYID AND NOT domain:[* TO *]"
"etc_passwd:MYID AND NOT domain:[* TO *]*"
"etc_passwd:MYID AND NOT domain:([0 TO 9] [a TO z] [A TO Z])"
"etc_passwd:MYID AND NOT domain:([0 TO 9] [a TO z] [A TO Z])*"

"etc_passwd:MYID AND NOT _exists_:domain"
"etc_passwd:MYID AND domain:is_empty?"
"etc_passwd:MYID AND domain:null"
"etc_passwd:MYID AND domain:nil"

This knife exec search works, however it takes a significant amount of time to run against the node list.
knife exec -E "search(:node,'etc_passwd:MYID').select{|n|n.automatic['domain'].nil?}.each{|n| puts n.name}"

Any advice or direction would be greatly appreciated.
Thanks in advance.
wcm