text:
Q: I removed my-freeze.com NetAssistant, but now can't access two websites I used "Revo Uninstaller" to uninstall the spyware which left me with a problem using Internet Explorer so then downloaded the free version of "Hijack This" from the website and, not reading the Super User answer correctly, used fix for the general issues it found and saved the log file of the other queries.
NetAssistant is completely gone or appears to have - Malwarebytes Malware remover cannot find anything and most Google searches now seem to work correctly. However in removing it I seem to have made an error and now whenever I search for and try to open or try to directly access two sites which I had tried to access via NetAssistant whilst infected IE8 says they cannot be displayed. One of them is Wikipedia and I use both regularly.
I am not sure at what point this happened I think it may have been after using Revo Uninstaller and the second section where it looks for references to netassistant (in the registry?). Not sure if this is relevant but I can remember deleting some flags or something relating to Internet Explorer but not sure what.
Any suggestions?

A: I suspect a rootkit. Google "ComboFix download" and click only on the link from Bleepingcomputer.com. Any other source of CompboFix is bogus. You will have 10 minutes to download ComboFix before the link expires. CompoFix is free, if you are prompted for payment you have the wrong file. Do the following in the order listed:

*

*Run ComboFix

*Uninstall old MalwareBytes and reinstall a new copy and run it

*Visit Microsoft Download Center and search the term 'malicious'. Look through the returns
click on the Malicious Software Removal Tool that fits your system, 32 bit or 64 bit.

*Visit Ninite.com and download CCleaner registry tool. Beware all 'free' registry tuners
CCleaner is ok, CleanMyPc from www.registry-cleaner.net is the best $29 you'll
ever spend.

*Open your browser and look for something like 'Options'. Click on this and check
your search settings. Use only Bing or Google, Dogpile, etc. MyWebSearch is a virus.

*Also check your browsers proxy server settings. Unless you really need this disable
proxy server settings.

You should now be clean and free from malware/spyware:)


text:
Q: Closing all the opened chrome windows using selenium - python - osx I have to download some files from a website, I'm using Python - Selenium - Chrome - Osx.
I have his code so far:
lnk = "www.foobar.com"
CHROMEDRIVER=webdriver.Chrome()
options = webdriver.ChromeOptions()
profile = {"plugins.plugins_list": [{"enabled":False, "name":"Chrome PDF Viewer"}],
        "download.default_directory" : TEMP_DOWNLOAD}
options.add_experimental_option("prefs",profile)
driver = webdriver.Chrome(chrome_options = options)
driver.get(lnk)
while True:
    if filter(os.path.isfile, glob.glob(TEMP_DOWNLOAD+'/*.crdownload')):
        pass
    else:
        break
driver.quit()

This code starts the download of the file, waits the end of the download and then closes the webdriver.
Everything is working properly except that it opens 2 Chrome windows, one to open the link and the other to download the file, and the quit() method closes only the latter.
Is there a way to kill all the windows opened by Selenium (I'm trying to avoid firing a terminal command to kill the processes brute force)?
EDIT:
as Mukesh Takhtani said in comment in my code the problem is a pointless webdriver instance.

A: Use this. This I used for Firefox. You can use this for Chrome. Call kill_waste() in your python code and it would kill idle useless Chrome. Please note that this would work for OSX or FreeBSD. For Linux distros you would have to change the way you are going to use grep and cut
import commands

def kill_waste():

    (_,firefox_processes) = commands.getstatusoutput("ps -ax | grep '/usr/local/bin/firefox -foreground' | cut -c1-24")
    sleep(0.5)
    firefox_processes = firefox_processes.splitlines()

    for pid in firefox_processes:
        values = pid.split()
        time_value = values[3].split(':')

        if ((values[2] == 'I' or values[2] == 'I+') and time_value[0] == '1') or time_value[0] == '2':
            commands.getstatusoutput("kill -9 " + values[0])

redpajama_set_name: RedPajamaStackExchange


text:
Q: Get values from MVC3 model to pass Ajax and assign in array How do I get values from model using Ajax and assign these values in an array on the client?
Here is my controller
public ActionResult Oku()
{
    var query = from table in db.news where table.image_name select table;
    return Json(query,JsonRequestBehavior.AllowGet);
}

My Ajax script is:
$.ajax({
    type: "get",
    url: "Home/Oku",
    data: {},
    dataType: "json",
        // Some codes to assign array
    }
});

Thanks for your help

A: Just implement a success callback in your Ajax call.  Also you don't need to specify get, it is the default behavior.
$.ajax({
    url: "Home/Oku",
    dataType: "json",
    success: function(resp) {
         // do something with resp object which is an array
    }
});

A: I'd use JsonResult instead of an ActionResult.
Here's a Tutorial

A: The data returned from action is already in array format, since the query result is an IEnumerable.
You need to implement success callback in the ajax.
$(function () {
        $.ajax({
            type: "get", url: "Home/Oku", data: {}, dataType: "json",
            success: function (data) {
               alert(data[0])
            }
        });
    })


text:
Q: Java script extract all values from a map in an array Using spring boot,I get a list from the backend,so in HTML:
<script th:inline="javascript">
   var test = [[${productRecords}]];
</script>

By viewing the page source, I found it gives me:
<script th:inline="javascript">
       var test [{"productid":1,"productname":"nail","productcosttime":null,"img":null,"counts":8,"bookings":[]},{"productid":2,"productname":"hairWash","productcosttime":null,"img":null,"counts":40,"bookings":[]},{"productid":7,"productname":"jiemao","productcosttime":null,"img":null,"counts":1,"bookings":[]},{"productid":6,"productname":"makeUp","productcosttime":null,"img":null,"counts":1,"bookings":[]}];
</script>

Now I want to extract all the 'productid' and 'counts', and assign them to new variables conrespondingly, like
var productid = [1,2,7,6]
var counts = [8,4-,1,1]

How could I achieve this?
I have tried:
var temp = test[0].productid;

A: You can extract object properties using map function
let productids = test.map(obj => obj.productid) //[1,2,7,6]
let count_result = test.map(obj => obj.counts)  //[8,4-,1,1]

A: You can also accomplish this with Thymeleaf if you want (I think the JavaScript is fine as well, just another tool you can use).
let productid = [[${productRecords.![productid]}]];
let counts = [[${productRecords.![counts]}]];

See collection projection.


text:
Q: using sample in aggregate I have a list of lists. Every element of the main list is a list that correspond to a note,every note in the list, has an integrer called fold_ID.
I want to sample one note of each folder ID. I am currently doing this:
folder_ID<-function(lYSt){
  L<-lYSt
  f91<-cbind(sapply(L, `[[`, "fold_id"),
             seq(1,length(L)),
             seq(1,length(L)))
  colnames(f91)<-c("Folder ID","Note #",
                   "#Of notes in folder")
  f91<-as.data.frame(f91)
  f81<-table(sapply(L, `[[`, "fold_id"))
  for(i in 1:length(f91[,1])){
    fgd3<-as.numeric(f91[i,1])
    fgd3<-f81[as.numeric(names(f81))==fgd3]
    f91[i,3]<-fgd3
  }
    f92<-aggregate(f91$`Note #`,
                   by = list(f91$`Folder ID`,f91$`#Of notes in folder`),
                   function(x) sample(x,size = 1))
return(f92)
}

however, to test that each element sampled indeed belongs to the correspondent folder ID I did this:
eg<-folder_ID(LIST)

for(i in 1:length(eg[,2])){
  print(NT.2[[eg[i,3]]]$fold_id)
  print(eg[i,1])
  print("________________________________")
}

however, to my surprise, not every element sampled corresponded to the respective folder ID.
I want this part
    f92<-aggregate(f91$`Note #`,
                   by = list(f91$`Folder ID`,f91$`#Of notes in folder`),
                   function(x) sample(x,size = 1))

to sample exclusively from each folder ID. Now, strangely, it mostly samples from the respective folder ID, but not always.
I want the output to conserve the numnber of notes in folder part.
EDIT
this is an exmaple of the list:
[[1]]
[[1]]$fold_id
[1] 1
[[1]]$content
[1] "whats written in the note"
[[2]]
[[2]]$fold_id
[1] 2
[[2]]$content
[1] "whats written in the second note"

A: You could try this way.. lets assume your list-of-lists is called mylist, and it has the structure that you show above
push your folder ids and notes into a table
library(data.table)
dat =data.table(fold_id = sapply(mylist,\(x) x[["fold_id"]]),
                content = sapply(mylist,\(x) x[["content"]])
)

Now,sample one note from each folder
dat[, .SD[sample(1:.N,1)],  by=fold_id]

I made a fake list-of-lists like this:
# fake list of lists
mylist = lapply(1:500, \(x) list(fold_id = sample(1:10,1),content=paste0(sample(letters,25), collapse="-")))

It looks like this:
> mylist[1:3]
[[1]]
[[1]]$fold_id
[1] 4

[[1]]$content
[1] "y-e-m-a-n-r-s-q-g-i-o-d-w-p-h-l-f-b-c-j-t-v-z-x-u"

[[2]]
[[2]]$fold_id
[1] 7

[[2]]$content
[1] "m-q-f-k-g-z-u-x-i-b-t-e-j-y-n-d-s-w-c-v-h-o-a-l-p"

[[3]]
[[3]]$fold_id
[1] 7

[[3]]$content
[1] "t-w-q-n-x-b-p-j-e-s-a-h-r-u-v-f-z-i-k-c-g-y-l-d-o"

The result of the above manipulation, returns one note from each of the ten folder ids
    fold_id                                           content
 1:       4 k-x-h-n-g-e-p-f-z-w-a-j-r-i-o-c-m-d-q-b-v-l-y-u-s
 2:       7 q-v-n-l-d-k-a-u-h-x-w-e-f-r-c-y-p-b-z-j-m-g-s-o-i
 3:       5 k-q-m-v-p-g-b-f-t-l-r-i-u-c-x-a-y-n-o-s-e-w-d-j-z
 4:       1 w-r-t-f-a-j-b-n-q-v-u-d-i-e-s-c-l-k-m-z-h-p-g-x-o
 5:       6 p-a-v-f-d-z-c-n-x-j-m-b-s-l-w-o-h-e-y-t-i-u-r-g-q
 6:       9 b-y-v-o-j-i-g-m-q-f-t-e-u-d-a-z-c-k-p-x-h-r-n-w-l
 7:       3 h-u-s-a-o-t-b-p-r-k-j-x-q-z-e-m-y-v-d-n-i-f-l-w-c
 8:       8 v-f-m-u-c-d-o-t-h-x-l-p-r-j-g-a-s-y-w-e-n-i-z-q-k
 9:       2 j-o-r-x-g-p-t-v-z-a-n-l-y-e-f-w-s-h-k-q-m-i-u-b-c
10:      10 p-n-z-c-k-a-l-o-s-g-j-f-i-b-w-d-q-y-u-v-t-r-m-x-e

Here is another way, if you don't want to use this table, sample-by-group approach.

*

*get unique folders

folders = unique(sapply(mylist, \(x) x[["fold_id"]]))

*loop over each folder, selecting one of the notes at random

lapply(folders, \(f) {
  notes = unlist(lapply(mylist, \(x) if(x[["fold_id"]] == f) x[["content"]]))
  sample(notes, 1)
})

Output:
[[1]]
[1] "w-c-u-t-l-m-n-a-g-x-f-p-i-k-y-h-d-z-o-e-v-r-b-s-q"

[[2]]
[1] "v-p-a-t-c-u-e-h-q-i-o-g-j-l-s-y-k-r-x-w-b-d-z-n-f"

[[3]]
[1] "i-a-n-c-j-s-z-q-u-o-d-p-w-l-e-t-g-b-k-f-x-v-h-m-y"

[[4]]
[1] "f-n-w-l-b-t-m-e-a-v-i-d-x-o-k-y-h-g-u-r-c-q-s-j-z"

[[5]]
[1] "x-q-a-g-j-r-k-u-y-l-p-i-w-d-h-m-v-o-e-t-n-c-z-f-b"

[[6]]
[1] "b-y-v-o-j-i-g-m-q-f-t-e-u-d-a-z-c-k-p-x-h-r-n-w-l"

[[7]]
[1] "g-a-t-u-p-o-s-l-h-r-d-f-v-m-q-x-k-z-c-i-y-b-w-e-n"

[[8]]
[1] "b-f-r-o-x-q-l-m-a-j-n-t-w-p-g-c-e-u-z-v-k-y-d-s-i"

[[9]]
[1] "s-a-m-j-c-q-t-u-w-d-y-l-e-g-k-v-b-z-n-x-o-r-p-i-h"

[[10]]
[1] "x-y-u-e-q-h-f-d-a-r-o-n-k-w-t-p-b-g-v-l-m-i-j-z-s"


text:
Q: Ubuntu (20.04.2.0 LTS) boots into complete, unresponsive black screen after attempting to restart display-manager (gdm3) from command prompt Ubuntu 20.04.2.0 LTS desktop installation:
Following guidance from this post's accepted answer:
How to restart X Window Server from command line?
I ran:
sudo systemctl restart display-manager
(it may be useful to know that the tab autocomplete suggested adding .service to the end, but I did not do so)
My screen went black and unresponsive, perhaps I should have been more patient but after about a minute I decided it wasn't coming back on its own and hit the hardware reset button on my PC. Since then, when booting into my Ubuntu installation I am met with a completely black screen with no cursor. Attempting to log in to a TTY is completely ineffective, my only recourse so far is to restart into BIOS.
I have managed to get the installation media running with the drive holding my inaccessible OS mounted. A comment in the linked post's accepted answer had the same problem and indicated that the solution involved restarting the service from terminal. Naively attempting that approach from the installation media (the commenter did not provide a command), running the command again from the installation drive:
sudo systemctl restart display-manager
simply restarts the display manager in the installation environment (but does so in this case without bricking anything else and actually coming back). The OS still boots into a black screen.
I do not wish to re-install in any capacity if I can avoid it.
Additional information:
Output of cat etc/systemd/system/display-manager.service
[Unit]
Description=GNOME Display Manager

# replaces the getty
Conflicts=getty@tty1.service
After=getty@tty1.service

# replaces plymouth-quit since it quits plymouth on its own
Conflicts=plymouth-quit.service
After=plymouth-quit.service

# Needs all the dependencies of the services it's replacing
# pulled from getty@.service and plymouth-quit.service
# (except for plymouth-quit-wait.service since it waits until
# plymouth is quit, which we do)
After=rc-local.service plymouth-start.service systemd-user-sessions.service

# GDM takes responsibility for stopping plymouth, so if it fails
# for any reason, make sure plymouth still stops
OnFailure=plymouth-quit.service

[Service]
ExecStartPre=/usr/share/gdm/generate-config
ExecStart=/usr/sbin/gdm3
KillMode=mixed
Restart=always
RestartSec=1s
IgnoreSIGPIPE=no
BusName=org.gnome.DisplayManager
StandardOutput=syslog
StandardError=inherit
EnvironmentFile=-/etc/default/locale
ExecReload=/usr/share/gdm/generate-config
ExecReload=/bin/kill -SIGHUP $MAINPID
KeyringMode=shared
ExecStartPre=/usr/lib/gdm3/gdm-wait-for-drm

Edit:
After fiddling around in recovery mode, I am able to boot into the system's TTY if and only if GDM3 is not the active display manager and normal boot is performed through the recovery mode menu (the "resume" option). Despite reinstalling ubuntu-desktop and a new display manager the best I can do is get into TTY through recovery mode.

A: The issue was coming from an error parsing this file:
/usr/share/X11/xorg.conf.d/70-wacom.conf
I started a section and failed to include the EndSection suffix. Fixing this config file completely fixed my issue.


text:
Q: Specify exact path of program to be opened via .bat file
*

*I want to open Autodesk Civil3D Metric with a batch file.

*I can only get it to run the generic AutoCAD via a batch file.

Upon looking at the file path, it seems there may be an extra step in opening the Civil3D Metric tools build on the normal CAD platform (at least this is my line of thought).
From Explorer when opening the shortcut properties (see screenshot also )
Start in: "C:\Program Files\Autodesk\AutoCAD 2021\UserDataCache"
Target: "C:\Program Files\Autodesk\AutoCAD 2021\acad.exe" /ld "C:\Program Files\Autodesk\AutoCAD 2021\AecBase.dbx" /p "<<C3D_Metric>>"  /product "C3D" /language "en-US"
Is there a way to open the complete suite via batch?
Best regards,
J
explorer properties of program to be opened via .bat file


text:
Q: Display long list of data from Web Service I am planning to develop an app where user will be able to see list of products sold in a unit and select them. Output will take them to a next page where users can see Vendors who are selling their selected product.
Since I am calling list( It can be upto 1000)  through Web Service asp.net, I am afraid it may slow down the system. Users can select multiple products at a time.
Please recommend what is the best way to achieve this.Can I use spinner like UI for multiple selection ? or some thing better

A: For data paging and Gridview, you'll need to come up with a solution in code that tells your Gridview how many total rows you have so it will create the necessary paging controls in the header and/or footer.
I highly recommend using an AJAX solution like DataTables.Net with a web service. It has all you're looking for including unlimited virtual scrolling and paging. If you're using LINQ, then utilize the Skip and Take extensions to add the paging functionality in your code.


text:
Q: Name for a Particular (Parabolic) PDE Consider the following initial value problem:
$$
\begin{cases}
u(0,x) = u_0(x) & \text{in }\mathbb{R}^n\\
u_t = -[(\Delta)^{-1}u]\Delta  u + u^2 & \text{in }(0,\infty) \times \mathbb{R}^n
\end{cases}
$$
Here the operator $\Delta^{-1}$ is given by $\Delta^{-1} u = a(t,x)$ such that $\Delta_x a = u$. (for all times $t$)
Question: Is there a name for this particular equation, or a class of equations in which it falls? I know that it is a parabolic equation, but not much else. Apologies in advance if this seems like an elementary question. Also if someone could point me to an introductory resource( at the graduate level) for parabolic PDE, that would be nice: I have experience with elliptic equations (variational formulations, regularity theory like DeGiorgi Nash, Viscosity Solutions) but am rather inexperienced when it comes to Parabolic equations).
Edit: I have realized itis also necessary to consider the regularity of $u_0$. Let us assume that $u_0 \geq 0$ and $u_0 \in C^{\infty}_c(\mathbb{R}^n)$ (smooth and compactly supported).
According to my professor, it is also the case that the quantity:
$$
\int_{\mathbb{R}^n} u(t,x) \mathrm{d}x
$$
is conserved (i.e constant in time), and the quantity:
$$
S(t) = \int_{\mathbb{R}^{n}}u(t,x)\log (u(t,x))\mathrm{d}x
$$
is a decreasing function of time.

A: A good survey of recent work on this is given by Gualdani and Zamponi in
"A review for an isotropic Landau model,"  in PDE models for multi-agent phenomena, Springer INDAM. (arxiv link: https://arxiv.org/abs/1708.02097).
Other important papers in this area (discussed also in the above article) include the work of Krieger-Strain, Gressman-Krieger-Strain, and Gualdani-Guillen.

A: You should consider posting this in mathoverflow. I have never seen an
equation like this. It is nasty. Anyway, the first place to learn a bit of
parabolic equations is Evans "Partial differential equations".
A more advanced (and more difficult to read) book is Lieberman "Second Order
Parabolic Differential Equations". It is meant to be like Gilbarg and
Trudinger "Elliptic Partial Differential Equations of Second Order", which is
a classical book in elliptic equations.
Then there are a lot of very good books on abstract evolution equations (which
might help, given your equation). A classical book is Dautray and Lions
"Evolutions Problems" Volume 5 (so yes, there are five volumes, but they are
written in a beautiful way and you might learn a lot).
A book which might help for your equation is Hu "Blow-up theory for semilinear
parabolic equations".
Now coming to your equation%
$$
u_{t}=b\Delta u+u^{2},
$$
this is parabolic if $b(x,t)\geq\delta>0$ for all $x,t$. If $b\geq0$ then it
would be a degenerate parabolic equation. Degenerate parabolic equations are
difficult to treat. If $b<0$ then you have backward parabolic equations. These
are nasty because in general solutions do not exist. If $b$ changes sign then
all hell breaks loose. I have no idea what can happen.
In your case $b=-(\Delta^{-1}u)$ which makes this equation nonlocal. To
determine the sign of $b$ you have to use $-\Delta b=u$. This means that you should use the
maximum principle for elliptic equations. The problem is that it works well in
bounded domains but you are in $\mathbb{R}^{n}$, where it can fail. Your best
bet is to assume  good hypotheses on $u_{0}$ in such a way $-\Delta
b_{0}=u_{0}$ implies that $b_{0}(x)\geq\delta>0$. Then you might try to find a
solution to your problem for $[0,T]$ and $T$ very small. I don't know.
Now in the case in which $b(x,t)\geq\delta>0$, then the equation
$u_{t}=b\Delta u+u^{2}$ is a semilinear parabolic equation. When $b=1$ it has
been studied by Fujita. You will find a chapter in the book of Hu "Blow-up
theory for semilinear parabolic equations" (see Section 5.4). Depending on the value of $n$ and
$u_{0}$ you might have global existence or blow-up of solutions.
In conclusion, your equation is non-standard. I don't think it has a name.
Maybe "nonlocal semilinear equation of parabolic type". Where did it come
from?
Anyway, try math overflow. You might find experts in parabolic equations. I am
not one.


text:
Q: How can i pull a variable from an button Action function to another view controller class? I have a block of code
@IBAction func postbutton(_ sender: UIButton) {
   let ref: DatabaseReference = Database.database().reference()
   let postvalue =  ref.child("All Post").childByAutoId()
   let postkeyvalue = postvalue.key!
   postvalue.child("Post Content").setValue(postcontent.text)
   postvalue.child("Post Author").setValue(currentuser)
   var possstkeystring = postkeyvalue
}

I need to access the possstkeystring in my other view controller file.
I have already tried declaring the possstkeystring outside of the function. When I do that, my project always fail because it's empty.
I have tried using the prepare function that didn't work.
I tried declaring the variable outside of the class- that didn't work.
It always failed because the string was empty, and since its a firebase child string, it cant be empty.
Here is my other file block of code I'm trying to plug this into
self.ref.child("All Post").child(possstkeystring).child("Post Author").observe(DataEventType.value, with: { (snapshot) in
     if let item = snapshot.value as? NSDictionary
       {
          self.authornamereference = item["Post Author"] as! String
       }

please help! thanks :)
When I actually input the variable outside of scope or in a static variable, I get this error
Terminating app due to uncaught exception 'InvalidPathValidation', reason: '(child:) Must be a non-empty string and not contain '.' '#' '$' '[' or ']''

A: You can do it in multiple ways, One of the ways is to use NotificationCenter
Using NotificationCenter:
First you need to add extension to Notification.Name anywhere in your App. Like
extension Notification.Name { static let mynotification = Notification.Name("mynotification") }

In your Another View controller viewDidLoad method add
NotificationCenter.default.addObserver(self, selector: #selector(yourMethod), name: NSNotification.Name.mynotification, object: nil)

Then in your Another ViewController add a method which will be called when notification fired
 func yourMethod(){
    //// do something
 }

Now in your Click event method or even anywhere from app, you can call viewController's method by sending notification Like
 NotificationCenter.default.post(name: NSNotification.Name.mynotification, object: nil)

*Another Easy way to, if you started Another ViewController from this same viewController where the click event is present, then You must have the reference of the viewController. then you need to just call
vc.yourMethod(params);


text:
Q: Which SharePoint permission role? so I'll be working on this sharepoint site and someone already made a draft for the website and gave me access to edit the site. However, when I go to site settings, I only have these options.

I know that there are more options than just these. I'm trying to figure out what permission role I actually have and what permission role do I need to have for full editing and designing control?

A: You might only have "Design" permission level to this site.
If you want to get full editing and designing control, you need to assign with "Full Control" permission level.


text:
Q: MacOs - localhost file not found 404 Can someone please help.
I was running successfully my Symfony project via Docker containers. Suddenly when I access http://localhost/ I get the File not found. error?
I now that it means that system can not locate my files, but I am not sure what happened.
I see that my containers are built and running okay.
Also the same message I get when I try to test app endpoints through Postman.
I am on Mac Monterey 12.4.
Everything was working fine couple of hours ago. I just switched branches to change something, then switched back. The problem was on both branches..
Can someone help, I do not know what to do?
Docker config:
services:
    db:
        image: postgres:${POSTGRES_VERSION:-12}-alpine
        environment:
            POSTGRES_DB: ${POSTGRES_DB:-name}
            POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pass}
            POSTGRES_USER: ${POSTGRES_USER:-postgres}
        volumes:
            - $PWD/postgres-data:/var/lib/postgresql/data:rw
        profiles:
            - db-in-docker
        ports:
            - "5432:5432"
        networks:
            - symfony
    redis:
        image: "redis:alpine"
        command: redis-server /usr/local/etc/redis/redis.conf
        ports:
          - "6379:6379"
        volumes:
          - $PWD/redis-data:/var/lib/redis
          - $PWD/redis/redis.conf:/usr/local/etc/redis/redis.conf
        environment:
          - REDIS_REPLICATION_MODE=master
        networks:
          - symfony
    php:
        container_name: "backend_php"
        build:
            context: ..
            dockerfile: docker/php/Dockerfile
            target: dev
            args:
                TIMEZONE: ${TIMEZONE}
        volumes:
            - symfony_docker_app_sync:/var/www/symfony/
        depends_on:
            - redis
        networks:
            - symfony
    nginx:
        build:
            context: ./nginx
        volumes:
            - ../:/var/www/symfony/
        ports:
            - 80:80
        depends_on:
            - php
        networks:
            - symfony
        env_file:
            - .env.nginx.local

A: First of all: Why do you don´t use the built in symfony server for local development? However - how looks your docker container configuration for your webserver?


text:
Q: exit on ssh failure in my play i ssh to a host and execute a number of roles, however if I fail to ssh into the instance the next include carry on regardless, id like to exit/fail when - build fails to execute
here is the example,
FYI - app_ec2 creates an instance on AWS and sets the host, build.yml then applies configuration to this instance and launch then users this instance to create an AMI and then a ASGroup
---
- hosts: localhost
  connection: local
  serial: 1
  gather_facts: true
  any_errors_fatal: true
  max_fail_percentage: 0
  vars_files:
    - "vars/security.vars"
    - "vars/{{ env }}/common.vars"
    - "vars/server.vars"
  roles:
    - app_ec2

- include: build.yml
- include: launch-asg.yml

build.yml:
- hosts: "{{ role }}"
  serial: 1
  gather_facts: true
  sudo: yes
  any_errors_fatal: true
  max_fail_percentage: 0
  vars_files:
    - "vars/{{ env }}/common.vars"
    - "vars/server.vars"
  roles:
    - default
    - restart
    - awscli
    - cloudwatch-logs
    - ntp
    - java
    - tomcat
    - newrelic
    - newrelic_apm
    - "{{role}}"
    - app_liquibase
    - restart

A: I am suggesting to use Ansible Blocks:
 tasks:
  - block:
      - debug: msg='i execute normally'
      - command: /bin/false
      - debug: msg='i never execute, cause ERROR!'
    rescue:
      - debug: msg='I caught an error'
      - command: /bin/false
      - debug: msg='I also never execute :-('
    always:
      - debug: msg="this always executes"

And you can use this workaround:

*

*Run some playbook on current host (-c local == local connection)

*Call
inside some block run ansible that connects to remote host, and if
block fails retry.

PS:
Ansible playbooks should use Idempotency concept:

The concept that change commands should only be applied when they need
  to be applied, and that it is better to describe the desired state of
  a system than the process of how to get to that state. As an analogy,
  the path from North Carolina in the United States to California
  involves driving a very long way West but if I were instead in
  Anchorage, Alaska, driving a long way west is no longer the right way
  to get to California. Ansible's Resources like you to say "put me in
  California" and then decide how to get there. If you were already in
  California, nothing needs to happen, and it will let you know it
  didn't need to change anything.


text:
Q: PHP Version 5.6.30 for Windows acts like Version 7.0 I'm working on bringing some ten year old PHP code up to date and I wanted to work on this on my Windows PC.  This code is functioning on the server which has PHP Version 5.6.23 but on my PC with PHP Version 5.6.30 I'm getting, "Call to undefined function mysql_pconnect()" for example.  If I update that to mysqli_connect the error moves to mysql_query.  Basically everything that was only supposed to be deprecated is missing as though I were using version 7.0.
I know I need to update all of this anyway but I like to start with the code working.  Can anybody me tell what could be the problem?

A: The version of PHP you are using likely does not have the "mysql" extension enabled by default.
First, look in PHP's ext/ subdirectory and ensure that php_mysql.dll exists - if it does not, then you'll need to download a different package which includes it (assuming one exists).
Next, edit your php.ini file, find the "Dynamic Extensions" section, and ensure that the extension=php_mysql.dll line is not commented out. If it is already uncommented, then you may be missing other dependencies.


text:
Q: ¿Como puedo obtener el rango de las fechas? (SQL) Tengo siguiente tabla:
precio <pid PK FK, comercio: PK FK, fecha_registro: PK, precio>
Como puedo obtener el precio de un producto desde la fecha más antigua hasta la más reciente?

A: puedes obtener los precios de los productos ordenados desde la fecha mas Antigua hasta la fecha Reciente Utilizando la siguiente linea de codigo.
SELECT precio.fecha_registro, precio.pid,
precio.precio FROM precio
WHERE precio.pid LIKE 'XXXXXX'
ORDER BY precio.fecha_registro ASC

NOTA: Yo supuse que tu tabla se llama precio

*

*si quieres que te muestre un producto especifico?
debes colocar en vez de las XXXXXX,  el pid del producto que deseas buscar (NOTA: sin quitar las comillas)

*si quieres que te muestre todos los productos que tengas en tu tabla?
debes colocar en vez de las XXXXXX, el simbolo %  (NOTA: sin quitar las comillas)
esta Instrucción de SQL te mostrara la Lista de tus productos Ordenados por fecha desde la fecha mas antigua a la mas actual.


text:
Q: Django runserver & Firefox - caching conflict with multiple local sites running separately on same port? I'm working on several Django projects on my local machine, following a single page application architecture.  To initiate the server, I have a couple copies of a script in my /bin folder containing
#!/bin/bash

python /path/to/app/manage.py runserver 8080

and have each script with the app name.  This makes the application accessible via localhost:8080.  In addition, I usually have the majority of my site CSS inside main.css
My issue is that I seem to be coming across a caching issue with Firefox, regardless of which application server is running.  Sometimes a page will load with almost no CSS styling, but the jQuery UI elements will be initialized and I can interact somewhat with the application, although the functionality and styling is seriously broken.  Refreshing the page shows no improvement, and no errors are shown in the console.
Clearing the cache and changing the port in the scrip seem to solve the issue, but it requires me to have bookmarks for each project, whereas it is pretty convenient to have a single localhost:8080 URL for all projects.
Has anyone come across this issue, and is there a solution other than clearing cache and changing ports?

A: This thread discusses methods to prevent client side caching of content served by the development server in Django:
Fighting client-side caching in Django
I prefer to simply disable caching in my browser though, seeing that I spend so much time on developing that I don't want to bother with the hassle of trying to prevent it in my own code.
A simple web search for "how to disable caching in firefox" came up with this:
http://support.mozilla.org/en-US/questions/764993
I'm pretty sure that searching for the same thing for different browsers will also give you expected results.
EDIT:
These guys also seem to go pretty in depth about how to prevent the caching of static files when using the Django development server.
Turn off caching of static files in Django development server

A: Just add something like this to /etc/hosts:
127.0.0.1    site1.dev
127.0.0.1    site2.dev

Visit site1.dev:8080, now site1 has its own cache and cookies (session) in the browser.


text:
Q: fadeIn li one by one I have a list of some item, i want fadeIn element one by one, means if first element complete fadeIn then next element fadeIn and so on, in my given code what going wrong i dont know, please help me..
HTML

ABC

ABC

ABC

ABC

JS
var i=0;
$('#ulfade li:nth-child(' + i + ')').fadeIn(500, function () {
     $('#ulfade li:nth-child(' + (++i) + ')').fadeIn('slow');
});

jsFiddle: http://jsfiddle.net/subhash9/suUHD/2/

A: You can solve it like this:
$('#ulfade li').each(function(key, value) {
    $(value).delay(key * 500).fadeIn(500);
});

Demo
Try before buy
Edit
As you changed your fiddle, here's a solution that works when hovering some other element:
$('#divFade').mouseover(function() {
    $('#ulfade li').each(function(key, value) {
        $(value).delay(key * 500).fadeIn(500);
    });

    $(this).unbind();
});

Demo 2
Try before buy

A: You can also do it without using delay by doing the following:
$('#divFade').mouseover(function() {
    var i = 0;
    var list = $('#ulfade li');
    (function displayLI() {
         list.eq(i++).fadeIn(500, displayLI);
    })();

    $(this).unbind();
});

This uses the completion callback to iteratively fade in the next item in the list.
Demo


text:
Q: Implementing a buffered transform stream I am trying to implement a stream with the new Node.js streams API that will buffer a certain amount of data.  When this stream is piped to another stream, or if something consumes readable events, this stream should flush its buffer and then simply become pass-through.  The catch is, this stream will be piped to many other streams, and when each destination stream is attached, the buffer must be flushed even if it is already flushed to another stream.
For example:

*

*BufferStream implements stream.Transform, and keeps a 512KB internal ring buffer

*ReadableStreamA is piped to an instance of BufferStream

*BufferStream writes to its ring buffer, reading data from ReadableStreamA as it comes in.  (It doesn't matter if data is lost, as the buffer overwrites old data.)

*BufferStream is piped to WritableStreamB

*WritableStreamB receives the entire 512KB buffer, and continues to get data as it is written from ReadableStreamA through BufferStream.

*BufferStream is piped to WritableStreamC

*WritableStreamC also receives the entire 512KB buffer, but this buffer is now different than what WritableStreamB received, because more data has since been written to BufferStream.

Is this possible with the streams API?  The only method I can think of would be to create an object with a method that spins up a new PassThrough stream for each destination, meaning I couldn't simply pipe to and from it.
For what it's worth, I've done this with the old "flowing" API by simply listening for new handlers on data events.  When a new function was attached with .on('data'), I would call it directly with a copy of the ring buffer.

A: Here's my take on your issue.
The basic idea is to create a Transform stream, which will allow us to execute your custom buffering logic before sending the data on the output of the stream:
var util = require('util')
var stream = require('stream')

var BufferStream = function (streamOptions) {
  stream.Transform.call(this, streamOptions)
  this.buffer = new Buffer('')
}

util.inherits(BufferStream, stream.Transform)

BufferStream.prototype._transform = function (chunk, encoding, done) {
  // custom buffering logic
  // ie. add chunk to this.buffer, check buffer size, etc.
  this.buffer = new Buffer(chunk)

  this.push(chunk)
  done()
}

Then, we need to override the .pipe() method so that we are are notified when the BufferStream is piped into a stream, which allows us to automatically write data to it:
BufferStream.prototype.pipe = function (destination, options) {
  var res = BufferStream.super_.prototype.pipe.call(this, destination, options)
  res.write(this.buffer)
  return res
}

In this way, when we write buffer.pipe(someStream), we perform the pipe as intended and write the internal buffer to the output stream. After that, the Transform class takes care of everything, while keeping track of the backpressure and whatnot.
Here is a working gist. Please note that I didn't bother writing a correct buffering logic (ie. I don't care about the size of the internal buffer), but this should be easy to fix.

A: Paul's answer is good, but I don't think it meets the exact requirements. It sounds like what needs to happen is that everytime pipe() is called on this transform stream, it needs to first flush the buffer that represents all the accumulation of data between time the transform stream was created/(connected to the source stream) and the time it was connected to the current writable/destination stream.
Something like this might be more correct:
  var BufferStream = function () {
        stream.Transform.apply(this, arguments);
        this.buffer = []; //I guess an array will do
    };

    util.inherits(BufferStream, stream.Transform);

    BufferStream.prototype._transform = function (chunk, encoding, done) {

        this.push(chunk ? String(chunk) : null);
        this.buffer.push(chunk ? String(chunk) : null);

        done()
    };

    BufferStream.prototype.pipe = function (destination, options) {
        var res = BufferStream.super_.prototype.pipe.apply(this, arguments);
        this.buffer.forEach(function (b) {
            res.write(String(b));
        });
        return res;
    };

    return new BufferStream();

I suppose this:
BufferStream.super_.prototype.pipe.apply(this, arguments);

is equivalent to this:
stream.Transform.prototype.pipe.apply(this, arguments);

You could probably optimize this and use some flags when pipe/unpipe are called.


text:
Q: How to set up db in Meteor.js? I am new to Meteor.  I downloaded a git repo of a friends project.  I want to "initiate" the database, as the local folder is in the .gitignore.
In Rails, it would be something like rake db:setup which would grab all of the migrations and set up the database.  How do I do something similar in Meteor? I also see that there are no db, lib, or local folders in the project.
My goal here is to seed the database, for which I am using node-mongo-seeds
Thank you!

A: Meteor does not have an official or structured DB seeding or migrations API as Rails does.
Some apps include code that runs on startup and seed empty collections. Some community packages that perform migrations are no longer maintained.
Note that MongoDB is schemaless, so adding fields to the schema (defined in code, usually via SimpleSchema) is less "traumatic" than in SQL databases, with its pros and cons.
You can try to figure out if the application used one of the migration packages by looking at the package list (by running meteor list or looking at the .meteor/packages file).
There's also a video from a MeteorTLV meetup regarding migrations.


text:
Q: Entity Framework 6 Changes Stored Procedure Entity Return Type In Entity Framework 6, I've often experience when you configure a function import to return an entity as it's return type:
spSelectEntityByID
  Returns Type Entity

It will sometimes change the stored procedure to be like:
spSelectEntityByID
  Returns Integer

I have no idea why because I didn't change anything, EF has a mind of it's own on this one.  If I allow it to create a complex type:
spSelectEntityByID
  Returns spSelectEntityByIDResult (Complex Type)

It works fine, it never gets changed.  But only for the entity type it may change when updating the model, to update something else but not that stored procedure.  The query is as simple as:
select Field1,
       .
       .
from   dbo.Entities
inner join dbo.RelatedTable1
..
inner join dbo.RelatedTable2
..
where
(
   ISNULL(LTRIM(RTRIM(Field1)), '') = '' and
   ISNULL(LTRIM(RTRIM(Field2)), '') = ''
)

Any idea why?


text:
Q: How to change the number of rows in the textarea using jQuery I have a textarea with 5 lines. I want to show only one line and on focus it should show remaining 4 lines.

A: jQuery(function($){
  $('#foo').focus(function(){
    $(this).attr('rows',5);
  }).blur(function(){
    $(this).attr('rows',1);
  });
});

Or, using less jQuery, less typing, and getting a hair more performance:
jQuery(function($){
  $('#foo')
    .focus(function(){ this.rows=5 })
    .blur( function(){ this.rows=1 });
});

A: You can try something like this:
     $(document).ready(function(){

    $('#moo').focus(function(){
        $(this).attr('rows', '4');
    });
});

where moo is your textarea.

A: Try this
$('#textboxid').focus(function()
    {
       $(this).animate({'height': '185px'}, 'slow' );//Expand the textarea on clicking on it
       return false;
     });


text:
Q: Are download usage statistics available through the iPhone API? i'm referring to the cellular usage stats in settings->general->usage
(documented or undocumented API is ok).
I'm also looking for APIs to the wifi statistics as well.

A: None of this is available to app developers.


text:
Q: JQuery .find() can find by id, but not by class I've created the following DOM using Jquery:

    <input type="checkbox" id="cb0" class=".userCheckBox" value="Option 1" checked="checked">
    <input type="hidden" id="h0" class=".userCheckBoxHidden" value="true">
    Option 1

I've applied CSS tags to my elements in the DOM, through the CSS classes do not have any properties inside of them at this point.
There are about 17 of these in a div. After the page has been loaded, I'd like to reload the current checked value of each checkbox. As I iterate through each code, I try to use the .find() function on the DOM:
$('.choiceDiv').each(function(e){

When I try to find by Class,
$(this).find('.userCheckBox');

I get the following failure Object:
init [prevObject: init(1), context: div#d0.choiceDiv, selector: ".userCheckBox"]
context: div#d0.choiceDiv
length: 0
prevObject:init [div#d0.choiceDiv, context: div#d0.choiceDiv]
selector:".userCheckBox"
__proto__:Object(0)

When I try to find by ID,
$(this).find('#cb'+e)[0];

I get what I'm looking for:
<input type="checkbox" id="cb0" class=".userCheckBox" value="Option 1" checked="checked">

I was hoping to pull the object by class to ensure I always get the type of input I'm looking for. Can someone explain why I can use .find() with an ID and not by Class in this instance? I tried figuring it out with this post but couldn't get it to work.

A: Just remove the period from the class attribute. For example:
<input type="checkbox" id="cb0" class="userCheckBox" value="Option 1" checked="checked">
Could be found via .find('.userCheckBox') or .find('#cb0').


text:
Q: Not able to read javascript files through localhost I have Ubuntu 15.04 and i am working on a project using bootstrap i have kept the files in "/var/www/html", none of my files are able to access the javascript files when the page is rendered from Localhost. But I have tried to render same file from a desktop or home the Javascript files work fine.

A: You Should open the .html files using from a server like if you are using apache you can use localhost/yourfilepath.html. Otherwise External JS files will not open.


text:
Q: shell script (macOS): print escaped Unicode character from a plist string In a shell script I'm reading strings from the Info.plist in application bundles, in this example from the Copyright key, whereas $FILEPATH is the path to an application bundle, e.g. /Applications/TextEdit.app
#!/bin/bash
PLIST=$(/usr/bin/defaults read "$FILEPATH/Contents/Info.plist")
COPYRIGHT=$(echo "$PLIST" | /usr/bin/awk -F" = " '/NSHumanReadableCopyright/{print $2}' RS=';' | /usr/bin/sed 's/^"\(.*\)"$/\1/')
echo "Copyright: $COPYRIGHT"

Note: I'm not reading the key directly, which would be easier, of course; it's read into the variable PLIST, so the script can read other keys as well later on, and doesn't have to use the defaults command over and over.
Now the output is (for example) Copyright: Copyright \\U00a9 1995-2015, Apple Inc.\\nAll rights reserved.
Obviously the copyright sign \U00a9 was escaped, as was the line break, but how can I solve this problem so that the shell script actually prints out the string as it was meant to, i.e. with copyright sign and line break?
PS: at the end I would probably remove the line break, but as the first step I'd want to echo the whole thing as intended.

A: I would to use plutil instead of the defaults. The:
plist="/Applications/TextEdit.app/Contents/Info.plist"
plutil -p - < "$plist"

will print
... some lines deleted...
  "DTSDKName" => "macosx10.12internal"
  "DTXcode" => "0800"
  "NSHumanReadableCopyright" => "Copyright © 1995-2016, Apple Inc.
All rights reserved."
  "DTSDKBuild" => "16C7"
  "CFBundleDevelopmentRegion" => "English"
... other delted lines ...

the -p mean human readable format - so hard to process. Therefore, is better convert the plist to json, for example:
plutil -convert json -r -o - - < "$plist"

the -r mean convert to human-readable JSON , e.g.
{
  "CFBundleName" : "TextEdit",
  "DTSDKName" : "macosx10.12internal",
  "DTXcode" : "0800",
  "NSHumanReadableCopyright" : "Copyright © 1995-2016, Apple Inc.\nAll rights reserved.",
  "DTSDKBuild" : "16C7",
  "CFBundleDevelopmentRegion" : "English",
  "CFBundleVersion" : "329",

Now you can easily filter out the NSHumanReadableCopyright key, even using awk, but it is much better to use some real tool.
Mac by default has installed perl and also the JSON::PP module. So the:
plist="/Applications/TextEdit.app/Contents/Info.plist"
plutil -convert json -r -o - - < "$plist" |\
/usr/bin/perl -0777 -CSDA -MJSON::PP -MEncode -E '$p=decode_json(encode_utf8(<>));say $p->{NSHumanReadableCopyright}'

will output
Copyright © 1995-2016, Apple Inc.
All rights reserved.

Edit:
tested the whole as one long line from the comment:
plist="/Applications/TextEdit.app/Contents/Info.plist"; jplist=$(/usr/bin/plutil -convert json -r -o - "$plist"); copyright=$(echo "$jplist" | /usr/bin/perl -0777 -CSDA -MJSON::PP -MEncode -E '$p=decode_json(encode_utf8(<>));say $p->{NSHumanReadableCopyright}'); echo "$copyright"

and prints OK...


text:
Q: Calculating sum and count of detail records using Sequelize Using Sequelize 4.1.0, I want to produce equivalent results to this PostgreSQL 9.6.3 query:
SELECT
  "user"._id,
  "user"."lastName",
  "user"."firstName",
  "user".email,
  COALESCE(purchase.purchases, 0::bigint) - COALESCE(attendance.attendances, 0::bigint) AS balance
FROM "Users" "user"
  LEFT OUTER JOIN
    (SELECT "Purchases"."UserId", SUM("Purchases".quantity) AS purchases
    FROM "Purchases"
    GROUP BY "Purchases"."UserId") purchase ON "user"._id = purchase."UserId"
  LEFT OUTER JOIN
    (SELECT "Attendances"."UserId", COUNT("Attendances"._id) AS attendances
    FROM "Attendances"
    GROUP BY "Attendances"."UserId") attendance ON "user"._id = attendance."UserId"
    WHERE "user"."firstName" ILIKE 'Smith%' OR "user"."lastName" ILIKE 'Smith%' OR "user"."email" ILIKE 'Smith%';

My models (source: https://github.com/nstuyvesant/shy/blob/master/server/sqldb/index.js) are defined using Sequelize 4.0.0 like this...
import config from '../config/environment'; // source: https://github.com/nstuyvesant/shy/blob/master/server/config/environment/index.js
import Sequelize from 'sequelize';

let db = {
  Sequelize,
  sequelize: new Sequelize(config.sequelize.uri, config.sequelize.options)
};

// Imported model definitions
db.User = db.sequelize.import('../api/user/user.model'); // source: https://github.com/nstuyvesant/shy/blob/master/server/api/user/user.model.js
db.Purchase = db.sequelize.import('../api/user/purchase.model'); // source: https://github.com/nstuyvesant/shy/blob/master/server/api/user/purchase.model.js
db.Attendance = db.sequelize.import('../api/user/attendance.model'); // source: https://github.com/nstuyvesant/shy/blob/master/server/api/user/attendance.model.js

// Associations
db.Purchase.belongsTo(db.User);
db.Attendance.belongsTo(db.User);
db.User.hasMany(db.Purchase);
db.User.hasMany(db.Attendance);

module.exports = db;

In my user API controller (source: https://github.com/nstuyvesant/shy/blob/master/server/api/user/user.controller.js), I respond to GET /users with
import { User, Attendance, Purchase } from '../../sqldb';
import sequelize from 'sequelize';

export function index(req, res) {
  let startsWith = `${req.query.filter}%`;
  return User.findAll({
    where: {
      $or: [
        { firstName: { $iLike: startsWith } },
        { lastName: { $iLike: startsWith } },
        { email: { $iLike: startsWith } }
      ]
    },
    attributes: ['_id', 'lastName', 'firstName', 'email', [sequelize.literal('COALESCE(SUM(purchase.quantity), 0) - COALESCE(COUNT(attendance.id), 0)'), 'balance']],
    include: [{model: Purchase, attributes: ['quantity']}, {model: Attendance, attributes: ['_id']}],
    group: ['User._id', 'lastName', 'firstName', 'email', 'Purchases._id', 'Attendances._id']
  })
    .then(users => res.status(200).json(users))
    .catch(handleError(res));
}

This is the query it produces:
SELECT
  "User"."_id", "User"."lastName", "User"."firstName", "User"."email", COALESCE(SUM("Purchases"."quantity"), 0) - COALESCE(COUNT("Attendances"."_id"), 0) AS "balance", "Purchases"."_id" AS "Purchases._id", "Purchases"."quantity" AS "Purchases.quantity", "Attendances"."_id" AS "Attendances._id"
FROM "Users" AS "User"
  LEFT OUTER JOIN "Purchases" AS "Purchases" ON "User"."_id" = "Purchases"."UserId"
  LEFT OUTER JOIN "Attendances" AS "Attendances" ON "User"."_id" = "Attendances"."UserId"
WHERE ("User"."firstName" ILIKE 'Stuyvesant%' OR "User"."lastName" ILIKE 'Stuyvesant%' OR "User"."email" ILIKE 'Stuyvesant%')
GROUP BY "User"."_id", "lastName", "firstName", "email", "Purchases"."_id", "Attendances"."_id";

Any thoughts regarding what I might be doing wrong?

A: There is the way to generate a query with difference construction but with the same result. Supposing there were defined all models with their associations, the query will looks like following
User.findAll({
    attributes: ['id', 'lastName', 'firstName', 'email', [sequelize.literal('COALESCE(SUM(purchase.quantity), 0) - COALESCE(COUNT(attendance.id), 0)'), 'balance']],
    include: [{model: Purchase, attributes: 'quantity'}, {model: Attendance, attributes: 'id'}],
    group: ['id', 'lastName', 'firstName', 'email']
})


text:
Q: H.264 Pro Recorder Files not closed properly I have several files that were recorded using a BlackMagic Design H.264 Pro Recorder.  It would appear that somewhere in the process, the recorder did not close out the file properly when the recording was stopped at the end of the session.  As a result, I have several large files that might contain some form of recording. Unfortunately, I cannot open them in any software that I have tried.
Does anyone have any solution for software that may open these so that we can provide them to our client, or on something that may repair them so that they are usable?


text:
Q: How to show future months and dates using php? I need to add a leave list.It should add only 2 years so it should show only 2014 and 2015 that I did. My problem is I have to show Months When he select 2014 it should not show from Jan to May and If he select 2015 it should show Jan to Dec.How I can populate month based on year
In image its showing 2013 please ignore that because my system showing wrong year.
Here is my HTML code

            Add Leave

             Date
             :

             <select id="frm_day" name="frm_day">
             <?php
                for($i=1;$i<31;$i++)
                {
                  echo "<option value=".$i.">".$i."</option>";
                }
            ?>          </select>

               <select id="frm_year" name="frm_year">
                        <option value="<?php echo date("Y");?>"><?php echo date("Y");?></option>
                        <option value="<?php echo date("Y")+1;?>"><?php echo date("Y")+1;?></option>
               </select>

             <select id="frm_month" name="frm_month">
               <option value="<?php echo date("m");?>"><?php echo date("M");?></option>
             </select>

        <input type="submit" name="Submit" id="Submit" value="Submit" class="submit" />

A: The easiest one you can get from here
you can use it then:
$timestamp = strtotime("+1 month", yourstartdate);

and use it
date('Ymd', $timestamp);

you have to loop over the future ones:
for($i=0;$i < 12; $i++)
{
   $timestamp = strtotime("+".$i." months");
   if(isInFuture($timestamp) && date('m', $timestamp) <= 12) echo date('m', $timestamp);
}

function isInFuture($date, $timestamp = "")
{
   return ($date > date($timestamp));
}

A: Add this at the end of your

And change:
<select id="frm_year" name="frm_year">

to
<select id="frm_year" name="frm_year" onchange="changedYear(this)">

This will remove the months not in the current year if the user selects it. On any other year the full list is restored.

A: I strongly suggest just use a datepicker on this one. One popular datepicker is the jquery UI datepicker. Here is an example of what you are trying to achieve:
Sample Demo
This includes the 2 year cap.
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css" />
<form method="POST" action="">

            Date
            <input type="text" name="frm_day" id="frm_day" size="1" readonly>
            <input type="text" name="frm_year" id="frm_year" size="5" readonly>
            <input type="text" name="frm_month" id="frm_month" size="3" readonly>

</form>

For more info, visit the docs. All the settings can be found there.


text:
Q: Laravel : UTF-8 issue while exporting CSV While  trying to export data form database I saw some garbage value instead of showing the actual data which is UTF-8 character. I used Excel for opening the csv and I used Maatwebsite/Laravel-Excel package for exporting the csv.
Here is my controller :
public function downloadExcel($type)
    {
        $data = Item::get()->toArray();
        return Excel::create('solutionstuff_example', function($excel) use ($data) {

        header('Content-Encoding: UTF-8');
        header('Content-type: text/csv; charset=UTF-8');
        header('Content-Disposition: attachment; filename=solutionstuff_example.csv');
            $excel->sheet('mySheet', function($sheet) use ($data)
            {
                $sheet->fromArray($data);
            });
        })->download($type);
    }

Here is snap of it:

If anybody face the problem and know how to fix it.Hope you'll help me to solve it.
Thanks

A: I have solved the problem:
I changed the value:
'use_bom'=>false
to
'use_bom'=>true
in the 'csv' part of excel.php file in config folder.
I wish you success!
Image details:


text:
Q: Solve $p,q,r,s,t$ for this set of statements Obtained from the UKMT IMK Grey 2014 Q21:
Note that I DO NOT want answers; only hints.

An antique set of scales is not working properly. If something is lighter than 1000g, the scales
  show the correct weight, otherwise, the scales can show any value greater than 1000g.
  Jenny grows giant fruit and vegetables. She has a pumpkin, a quince, a radish, a swede and a
  turnip whose weights are all less than 1000g and, in grammes, are
  P, Q, R, S and
  T.
  When she weighs them in pairs, the scale shows the following:
  quince and swede: 1200g radish and turnip: 2100g quince and turnip: 800g
  quince and radish: 900g pumpkin and turnip: 700g. Which of the following lists gives the masses in descending order?

So, in this question, I have obtained:
1) $q+s>1000$
2) $r+t>1000$
3) $q+t = 800$
4) $p+t = 700$
5) $q+r = 900$
I added 4) and 5) to get $p+r+q+t=1600$, which gets taken away from 3) to get:
6) $p+r=800$
Also, 1) + 2) is
7) $q+r+s+t>2000$
I have retrieved these(not necessarily useful) equations/inequalities. I do not know how to get on from here.

A: Some additional things you can use:

*

*Subtracting (4) from (3) gives you $r - t = 100$, which you can combine with (2) to get some lower bounds on both $r$ and $t$.

*Subtracting (5) from (4) gives you $q - p = 100$.

*You are also given $0 < p, q, r, s, t < 1000$, which you can combine with other information to get tighter bounds (for example, since $q - p = 100$, you can state that $0 < p < 900$ and $100 < q < 1000$).

A: Equations 6) and 7) seems to be useless (contains less informations than previous equations)

*

*Solve the system of equations 3), 4) and 5) - you will obtain the solution depending on parameter $t=\tau$

 $\begin{cases}t=\tau\\ q=800-\tau \\ p=700-\tau\\ r=100+\tau \end{cases}$

*From 2) you obtain the lower boundary for $\tau$

 $\tau > 450$

*From 1) you obtain another parameter ($s=\sigma$) and it's relation with $\tau$:

 $\sigma > 200 +\tau$

*Now it is easy to see two groups of inequalities:

 $s>200+\tau > 100+\tau=r>\tau=t$ and $q=800-\tau>700-\tau = p$, so $\,\,s>r>t$ and $q>p$

*Result of second step compared with the result of step 4. gives us connection between these groups:

 $t=\tau>450 >350=800-450 >800-\tau =q$


text:
Q: how to have a QVector of QMap I wanna have a QVector of QMap. I used this syntax:
QVector<QMap<QString, QString>> x;
x[0].insert("name", "jim");
x[0].insert("lname", "helpert");
x[1].insert("name", "dwight");
x[1].insert("lname", "schrute");

but this is not working:

I'd appreciate it if someone guide me to the correct format.

A: You are getting "Index Out Of Range" because you are accessing an empty QVector. You need to first insert QMap elements to QVector. Then you can access x[0] -> for first QMap at 0th index, x[1] -> for second QMap at 1st index.......
Make QMap object. Insert Elments to it.
Make QVector object. Insert that QMap object to this QVector.
Read the documents and use appropriate functions for it https://doc.qt.io/archives/qt-4.8/

A: The "Index Out of Range" error comes up because you are trying to access an element of the vector which doesn't exist. Instead of accessing a particular index/element of the array it would be better to create a QMap outside of the QVector first and then x.push_back(map) so the map will be happily placed at the back of the QVector.
A similar thing applies to normal C++ with std::vector as you need to either push_back or emplace_back data onto the vector


text: Q: Apache tomcat server for yum repo I have a system that currently has apache tomcat on it (RHEL 6.5). I also want to make a yum update repo on this system for other systems on the network (also RHEL 6.5). I know I can use the apache http server to accomplish this and since I am new to servers, I am wondering if tomcat can also be used for this as well?


text:
Q: Custom formatting After some advice to get pointed in the right direction.
I am knocking together a site for a friend who isn't the most technical minded so want to make the process easy and of course Wordpress offers that. However I want to layout the pages a particular way such as http://www.apple.com/ipad/overview/ where content goes left right left right sort of thing with the image aligned alongside. I know this is probably possible using the editor however I want to make it easier and controlled in its format.
I was thinking possibly someway of having say a parent page with child pages under it essentially being pulled into the parent page instead of their own page themselves. Then with each page in the loop just alternating between left and right format. This doesnt offer lots of control to the person editing the site but keeps it simple. That was my best idea of handling it.
Is there another way that is better or is there an issue with the way I suggest like how sitemaps would be handled or dupicate content issues etc. Should I even be looking at custom post types? I just think that by using the children pages to handle it then they can attach a image via the featured post thumbnail image and alternate its positioning.
Thanks for any advice and pointers its greatly appreciated.

A: That is one way to do it, and I have done that for certain technically challenges clients. It is quick and simple. It does add a query to the parent page, but that isn't catastrophic. It would work fine if you have a few  of these pages and aren't adding or editing them a lot.
The second option is to created a custom post type and add 'content-left'/'content-right' classes as you loop through. Each iteration you'd have something like $myclass = ($myclass == 'content-left') ? 'content-right' : 'content-left'; and your stylesheet  takes over from there. It is slightly more complicated to set up but ultimately will probably be better, especially if you have a lot of posts. Managing Pages gets to be a pain, in my opinion, if you have a lot of them.


text:
Q: Get Empty Column Back In TSQL I can do
Select Column1, Column2, '' as Column3, 0 as Column4
From MyTable

I am trying my MDX as:
SELECT
{Measures.Measure1} ON COLUMNS
{
    Dimension1.DimensionColumn1.DimensionColumn1.Members,
    '',
    0
} ON ROWS
FROM  [CubeName]

This does not work - I get the following error message
Executing the query ...
Query (12, 1) Parser: The syntax for '{' is incorrect.

Question: How do I return empty or Zero ON ROWS in MDX?

A: You need to define the constant as an expression:
WITH
MEMBER MEASURES.CONSTANTVALUE AS 1
SELECT {MEASURES.CONSTANTVALUE} ON COLUMNS
FROM [cube]


text:
Q: "illegal start of simple expression" error in scalajs when use := if I use
loginError := if (loginItem.username.isEmpty) None else Some(loginItem.isUsernameValid)

compiler says:
 illegal start of simple expression

when changed to
val err = if (loginItem.username.isEmpty) None else Some(loginItem.isUsernameValid)
loginError := err

everything goes fine.
why I have to use a temporary variable?

A: You need parentheses around your if expression in the first case, because (in layman's terms) the if has a lower precedence than the :=:
loginError := (if (loginItem.username.isEmpty) None else Some(loginItem.isUsernameValid))

A: According to SLS, an if clause is an Expr but not a SimpleExpr or PrefixExpr.
Unfortunately, in the InfixExpr a := b, b must be a PrefixExpr.
That's why you have to use a temporary variable.


text:
Q: Labeling and Double Labeling Matrices in LaTex (Overleaf) - useful for Markov chain transition matrices This is actually not a question, but a solution. I looked everywhere and all of the solutions given are super complicated so I thought I would share my own for people who need help!!

*

*Treat the matrix/labels as one big array

*I used "tabular" command instead of array because the horizontal spacing doesn't work when you use the "array" command, however this doesn't matter too much because the syntax is relatively the same for both

I will post my code in the answer!!

A: In order to label a simple 3x3 matrix, you can either do it by columns/rows or give it a full title over the whole matrix.
This is the code for both the full titles and by each column/row:
\begin{document}

\begingroup
\setlength{\tabcolsep}{2pt} % sets spacing horizontally
\renewcommand{\arraystretch}{1} % sets spacing vertically
\begin{tabular}{ c c c }

%===============================================================
%Row 1
%===============================================================
%Column 1
Top Title &

%Column 2
&

%Column 3
\\

%===============================================================
%Row 2
%===============================================================
%Column 1
%this creates the horizontal array
\begingroup %make sure to use this to control spacing separately from the bigger array
\setlength{\tabcolsep}{6pt}
 \begin{tabular}{cccc}
     1  & 2  & 3
 \end{tabular}
\endgroup&

%Column 2
&

%Column 3
\\

%===============================================================
%Row 3
%===============================================================

% Column 1
$\begin{bmatrix}
    a & b & c \\
    d & e & f \\
    g & h & i
\end{bmatrix}$ &

%Column 2
% this creates the vertical array
\begin{tabular}{ccc}
     x \\ y \\ z
 \end{tabular} &

%Column 3
 Side Title

\end{tabular}
\endgroup

\end{document}

From this code you can adjust what titles you would like to keep/erase. Remember to adjust the matrix size accordingly. Matrices/tables/arrays have a syntax of:
Row1Column1 & Row1Column2     & ... & Row1Column(N) \\

Row2Column1 & Row2Column2     & ... & Row2Column(N) \\
.
.
.

Row(N)Column1 & Row(N)Column2 & ... & Row(N)Column(N)

So this is essentially a 3x3 matrix with the first column being:

*

*Big title (Top Title)

*column titles (1 2 3)

*matrix

Second Column:

*

*Empty space

*Empty space

*row titles (x y z)

Third Column:

*

*Empty space

*Empty space

*Big Title (Side title)

A: Welcome to TEX.SE! It's a nice approach. I use nicematrix package to do this.
\documentclass{article}
\usepackage{amsmath}
\usepackage{nicematrix}
\begin{document}
    \begin{align*}
        \begin{array}{cc}
            \text{Top Title} & \\
            \begin{bNiceMatrix}[first-row,last-col]
                1 & 2 & 3 &     \\
                a & b & c & x   \\
                d & e & f & y   \\
                g & h & i & z
            \end{bNiceMatrix} &  \text{Side Title}
        \end{array}
    \end{align*}
\end{document}

Here I handled the matrix with exterior with bNiceMatrix environment.

A: Here is another way to do that with nicematrix. In the latest version (5.10 of 2021-02-05), there is a built-in command \SubMatrix which I used to add the brackets in the array previously constructed.
\documentclass{article}
\usepackage{nicematrix}
\begin{document}
$A = \enskip
\begin{NiceMatrix}[baseline=4]
\Block{1-3}{\text{Top Title}} \\
1 & 2 & 3 &  \\
a & b & c & x & \Block{3-1}{\text{Side Title}} \\
d & e & f & y \\
g & h & i & z
\CodeAfter \SubMatrix[{3-1}{5-3}]
\end{NiceMatrix}$
\end{document}

You need several compilations (because nicematrix uses PGF/Tikz nodes).


text:
Q: How to mock a Wicket component I am trying to unittest a wicket panel with the help of WicketTester and Spock/Mockito.
In this panel, a ModalWindow (confirmation dialog) is show in a good case scenario.
I want to validate this dialog will be shown, so I tried to mock the component, inject it into the panel and test if the show method is called.
This won't work, as Wicket throws the following error:
java.lang.IllegalStateException: org.apache.wicket.Component has not been properly detached.
Something in the hierarchy of X has not called super.onDetach() in the override of onDetach() method

It's not suprising a mock can not call the onDetach method on it's super class.
I've tried stubbing the ModalWindow and using a spy to verify if the show method is called, but the implementation of that method has dependencies / external calls that are hard to mock.
Which way should I approach this problem? Or shouldn't I even try to make this kind of test work?

A: I'd create a custom version of ModalWindow that just overrides #show() method to call super.show() and to raise a flag that the method is called.
Then use this custom version in the test of the panel.


text:
Q: How do I sync Outlook Calendar with Automatic Replies? As the title says, I want to calendar book times away from my desk (out of office) in Outlook 365, and have them sync with my Automatic Replies, so external and internal people get those Automatic Reply notifications. I don't want to have to go to File --> Automatic Replies and set a date range and manually turn AR on, when I have sporadic dates over a week that I am in and out of the office.
Once the calendar item has passed, I want Automatic Replies to stop.
Is this possible and how, please?

A: As I know, there seems to be no option that could meet it directly in Outlook, and I found a similar idea in uservoice for Outlook, it's recommended to vote for it :
https://outlook.uservoice.com/forums/322590-outlook-for-windows-desktop-application/suggestions/18507883-provide-an-option-to-automatically-set-an-out-of-o
Hope the feature would be added soon.


text:
Q: How to unzip a .gz file in python and read all the files contained within it into different lists? I have a file chrom.txt.gz and within this file I have 30 different text files. I want to open this file with gzip and then create a function so that I can read each file and store it in separate lists. The function that I am trying is:
def txt_to_list(filename):
  f = open(filename,'r')
  for line in f.readlines():
    lst = line.strip()
    final_list.append(lst)
  return final_list

file1 = txt_to_list('file1.txt')
file2 = .....

So, is there anyway to automate this process? so that I don't have to manually call the function 30 times. And I do not understand how to get all the files out after gzip. How to do this?


text:
Q: Node.js: Disable UDP DNS lookup and use the given IP instead I have a simple CentOS node.js server that is supposed to consume high frequency UDP messages and then forward them to another service.
Trouble is that dgram.send does a DNS lookup on EVERY call.  This DNS lookup is both slowing down the processing of the messages and occasionally getting the DNS server to blacklist the node.js host server thinking it's getting DOS'd.
The question is:  how do I send a UDP packet in node.js WITHOUT incurring a DNS lookup?
Thanks for the time.

A: Glancing through the code for Node, it looks like you can pass an IP address to dgram.send and it won't do anything with DNS. Is it possible to look up or cache your IPs manually and then pass them to the send method?


text:
Q: expressing events in binary scenario: A machine produces pieces, either U: useable or N: unuseable So I need some help with my homework. Please tell if im in the wrong place I will delete the question by myself then.
The question:
A machine produces pieces. The pieces are either U: useable or N: unuseable.
Express the following events with U and N.

*

*A: All three pieces are usable.

*B: The first and the third piece is unusable.

*C: Only the first and the third are unusable.

*D: Two pieces are usable.

*E: The usable and the unusable alternate.
This seems way to easy to just write down A: (UUU), B: (NUN, NNN). Any help?


text:
Q: Export sklearn model to pmml with variable names I am exporting a random forest model built in scikit-learn to a pmml object, but when I do so the variable names get changed to x1, x2, etc. Is there a way to retain the original variable names in the pmml file?
Below is an example with the iris dataset. In the irismodel.pmml file, the variables are listed as x1, x2, x3, and x4, instead of sepal.length, sepal.width, petal.length, and petal.width.
#Load iris data and convert to pandas dataframe
from sklearn import datasets
iris = datasets.load_iris()
iris = pd.DataFrame(data= np.c_[iris['data'], iris['target']], columns= iris['feature_names'] + ['target'])
iris.columns = [['sepal.length', 'sepal.width', 'petal.length', 'petal.width', 'target']]

#Split target and predictors
irisdata = iris.ix[:,0:4]
iristarget = iris.target

#Write out to pmml object
from sklearn2pmml import PMMLPipeline
from sklearn2pmml import sklearn2pmml

iris_pipeline = PMMLPipeline([('classifier', RandomForestRegressor(n_estimators=10))])
iris_pipeline.fit(irisdata, iristarget)
sklearn2pmml(iris_pipeline, 'irismodel.pmml', with_repr=True)


text:
Q: Enable IPv6 on docker image for Bitwarden How do I enable IPv6 support when running Bitwarden from its Docker image? I changed /etc/docker/daemon.json as follows bit Bitwarden is still not reachable via IPv6:
{
  "log-level": "warn",
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "5"
  },
  "ipv6": true,
  "fixed-cidr-v6": "2001:db8:1::/64"
}

I am not sure if "fixed-cidr-v6": "2001:db8:1::/64" is correct, though.
Do I need to change anything else?

A:
I am not sure if "fixed-cidr-v6": "2001:db8:1::/64" is correct,
though.

"2001:db8:1::/64" is incorrect, that is in a documentation prefix. Substitute your own (globally scoped) /64.


text:
Q: Getting the RSS link from the  in Actionscript 2 I'm having problems getting to the rss link that tells the browser where the rss is for the site. The link is found in the <head> tag of the html here is an example of what the link looks like.
<link rel="alternate" type="application/rss+xml" title="CNN - Top Stories [RSS]" href="http://rss.cnn.com/rss/cnn_topstories.rss" />

My original approach was to treat the site like an XML file and look through the tags, but most sites have an arbitrary number of <meta> tags that forget to have a ending /> so the <link> tag I'm looking for becomes a child of a random <meta> tag.
Now I'm thinking of just treating the site like a string and looking for the <link> tag in it, but this causes problems since the <link> tag can have its attributes in any order possible. Of course I can work around this, but I would prefer something a bit neater than look for type="application/rss+xml" then look to the left and right of it for the first href it sees.

A: HTML parsing is hard! Even if you find a solution that works for one site, it will likely break in another. if you can find a library to help you your life will be a lot easier.
If you can not find a html parser for actionscript 2, maybe you could set up a server script to it for you? Like:
myXML.load("http://yourserver.com/cgi-bin/findrss?url=foo.com");
and then have it return the url as xml
If you try this approach, I recommend the python library Beautiful Soup. I've used it before and, in my opinion, it's amazing. It will work on any website you give it, no matter how horrible the markup is.
It would look something like this:
#!/usr/bin/python
import cgi
import cgitb; cgitb.enable() # Optional; for debugging only
import urllib2
from BeautifulSoup import BeautifulSoup

def getRssFromUrl(url):
    try:
        Response = urllib2.urlopen(url)
    except Exception:
        print "<error>error getting url</error>"
        return []
    html = Response.read()
    soup = BeautifulSoup(html)
    rssFeeds = soup.findAll('link', attrs={"type" : "application/rss+xml"})
    return rssFeeds

print "Content-type: text/xml\n\n"
form = cgi.FieldStorage()
if form.has_key("url") is True:
    url = form["url"].value
else:
    url = ""
print "<xml>"
rssFeeds = getRssFromUrl(url)
for feed in rssFeeds:
    print ("<url>%s</url>" % feed["href"])
print "</xml>"


text:
Q: Are MAE and RMSE possible ways of choosing between ols and types of glm? I have a longitudinal data set and have fit a number of different regression models [ols, poisson, binomial....and more]. I want to justify the final model selection and assumed one method might be to use MAE and RMSE to show which 'fits' the data best. Is this approach one that has academic precedent? Is there some reason you should not use such to assess model fit?

A: Many would opine that one should rather choose model form by knowledge of the phenomenon being studied, and the goal of the analysis.  Some posts mostly arguing this way is

*

*How to decide which glm family to use?

*Choosing the best family and link function for a GLM

*How do I decide which family of variance/link functions to use in a generalized linear model?

*How to choose the family in Generalized Linear Model in R

*Goodness of fit and which model to choose linear regression or Poisson


text:
Q: Typescript : create a type extending from primitive type? In my angular project, I want to create a custom type extending from string. my case is I want to create a "ID" type to separate string from idstring.
let str = String("tutu");
let id = ID("ec1s69azs");

this.service.getUserById(str) => doesn't compile;
this.service.getUserById(id) => compile;

In the future, I may want to add id validator in "ID" type
I was wondering if its possible because I've tried many "hacks" but none give me the result I want.
class ObjectID extends String {
}

export type ID = ObjectID;

or
interface StringConstructor {
  new(value?: any): String;
  (value?: any): string;
  readonly prototype: String;
  fromCharCode(...codes: number[]): string;
}

export type ID = StringConstructor;

A: Don't think you need to extends string, you can use branded types to achieve the desired result.
type ObjectID =  string & { __type: 'Id'}
function ID(n: string): ObjectID{
    return n as any;
}

// Usage
function getUserById(id: ObjectID) {

}

getUserById(ID("1")); //ok
getUserById("1");  // error

You need to define a helper function to create instances of the type or use casting, but the call site will give errors if you pass a simple string.
This article has a bit more of a discussion on the topic. Also the typescript compiler uses this approach for paths


text:
Q: Google Maps API Geocode & Place markers I am trying to merge the code of this geocoding api example:
https://developers.google.com/maps/documentation/javascript/examples/geocoding-simple
with some previously working code for dropping markers on a map.
here is my code:
<!DOCTYPE html>

    <title>Remove Markers</title>

      <input id="address" type="textbox" value="London, UK">
      <input id="submit" type="button" value="Geocode">
      <input onclick="deleteMarkers();" type=button value="Delete Markers">

Click on the map to add markers.

It was working before i tried to add geocoding, i have removed the API key for obvious reasons, any idea where i have gone wrong? I am relatively new to JavaScript so would love the feedback!

A: Your code will produce an error. You can solve it by moving these lines of code...
    var geocoder = new google.maps.Geocoder();

    document.getElementById('submit').addEventListener('click', function() {
      geocodeAddress(geocoder, map);
    });

...inside initMap() so that the function will look something like this:
  function initMap() {
    var haightAshbury = {lat: 51.5074, lng: 0.1278};

    map = new google.maps.Map(document.getElementById('map'), {
      zoom: 15,
      center: haightAshbury,
      mapTypeId: 'hybrid'
    });

    // This event listener will call addMarker() when the map is clicked.
    map.addListener('click', function(event) {
      addMarker(event.latLng);
    });

    // Adds a marker at the center of the map.
    //addMarker(haightAshbury);

    var geocoder = new google.maps.Geocoder();

    document.getElementById('submit').addEventListener('click', function() {
      geocodeAddress(geocoder, map);
    });
  }

Always remember to check for curly braces that doesn't have pairs.


text:
Q: Object doesn't support property or method 'addEventListener' Trying to fix this error for a customer;
They have a SharePoint 2013 intranet which has both internal and external facing urls.
When they open a form (using IE11) internally, it works fine. However, if they use the external url, it gives a critical error, with details of "Object doesn't support property or method 'addEventListener'"
I did a quick search before, and the only things i've found are;
a) using compatibility mode
b) adding the following script to the masterpage
<script language="javascript">
    /* IE11 Fix for SP2010 */
    if (typeof(UserAgentInfo) != 'undefined' && !window.addEventListener)
    {
        UserAgentInfo.strBrowser=1;
    }
</script>

or
<script language="javascript">
    /* IE11 Fix for SP2010 */
    if (typeof UserAgentInfo.strBrowser !== 'undefined' && !window.addEventListener)
    {
        UserAgentInfo.strBrowser=1;
    }
</script>

c) Turning off enable protected mode, ensuring the site is in the trusted sites. Checking the Disable script debugging (ie) and disable script debugging (other), and unchecking the 'display a notification about every script error' options.
I've tried both iterations of the script, and neither fixed the issue - UserAgentInfo is undefined, and !window.addEventListener evaluates to false.
I also tried setting all options in c) as well - this did not work either.
Is compatibility mode really my only option here?
What could be the differences between the internal and external sites, where this occurs with one, but not the other?
Thanks in advance for any help - i'm really quite stumped on this one.

A: UserAgentInfo is a function, and needs to be defined (by SharePoint) before you use it. If you check the page's source code, you should see some code like this:
function UserAgentInfo() {} UserAgentInfo.strBrowser = 3;UserAgentInfo.strBrowserType = 3;UserAgentInfo.intBrowserRmj = 11;

Your code snippet must be placed after this. Try placing your code as the very last thing before the </body> tag.


text:
Q: Convert string to Tuple in Scala I have to read data from file and convert it to a Tuple. Sample data is
(List(-28.92706839930671, 70.0055196968918, 97.18634024152067, -0.8977639173269137, -20.95631222378548),List(-2.1642508141664965, -49.26719368168469, -77.6449011447281, -92.11164347698504, 39.31785782242422),8.387308243500957E10,0.95,0.1)

I am using following code to read data from file.
val dataSource = Source.fromFile("/path/3.txt")
val lines = dataSource.getLines()
for (line <- lines) {
  line
}

How can I convert string line to Tuple of  ( List[Double] , List[Double] , Double , Double , Double ) ?

A: If the structure of your input is exactly like the sample in the question with no possibility of invalid input, one solution is to use the following in the for loop:
val ls = line.replaceAll("\\(", "")
  .replaceAll("\\)","")
  .replaceAll("List", "")
  .split(",")
(ls.slice(0,5).map(_.toDouble).toList, ls.slice(5,10).map(_.toDouble).toList,
  ls(10).toDouble, ls(11).toDouble, ls(12).toDouble)

Result:
(List[Double], List[Double], Double, Double, Double) = (List(-28.92706839930671, 70.0055196968918, 97.18634024152067, -0.8977639173269137, -20.95631222378548),List(-2.1642508141664965, -49.26719368168469, -77.6449011447281, -92.11164347698504, 39.31785782242422),8.387308243500957E10,0.95,0.1)


text:
Q: Problem with proof of theorem of continuous function Hi guys i have a problem with a proof of theorem.
Theorem 2:Be  $D\in\mathbb{R}$  y $f:\;D\rightarrow\mathbb{R}$ Continuous  inyective, then the function inverse of $f$, $f^{-1}:\;f(D)\rightarrow D$ defined how $f^{-1}(f(x))=x$ is Continuous.
That's the proof
Proof: We know $f:\;D\rightarrow F(D)$ is biyective, then for prove $f^{-1}$ is continuous only we need prove $f(V)$ is open set, where $V$ is an subset open of $D$. (for other theorem). Be $V\subset D$ then $V^{c}$ is closed. $D$ is compact, then $V^{c}$ is compact. then $f(V^{c})$ is compact(for theorem) as $f$ is inyective, we have $f(V^{c})=f(V)^{c}$ is closed, then $f(V)$ is open.
Now, the proof is fine?


text:
Q: same position shows differently for same x,y,z or lat,long,height when time-dynamic So, I am using the same position in a CZML file, sometimes as part of a time-dynamic position property, and other times a stationary, constant property.  When I use the stationary constant property, the entity renders in the expected location (near the AZ/NM border), but when the same position, and nearby positions, are used, the entity appears in a radically different position, which seems to be different depending on the time of day.  This happens whether I use cartographic or cartesian coordinates.  Why does this happen?  Is there some way that I can account for this?

A: I figured out what I was doing wrong - I was using the wrong referenceframe (inertial) for the time-dynamic positions, and the right one for the stationary position.


text:
Q: WebView in react-native-webview: camera not working import React from "react";
import { WebView } from "react-native-webview";
import { StyleSheet } from "react-native";

export default function HealthCheck({ route }) {
    return (
        <WebView
            style={styles.webViewContainer}
            source={{ uri: route.params.url }}
            originWhitelist={["*"]}
            allowsInlineMediaPlayback
            javaScriptEnabled
            scalesPageToFit
            mediaPlaybackRequiresUserAction={false}
            startInLoadingState
            javaScriptEnabledAndroid
        />
    );
}

This is my code on the webview.
The link I am trying to access needs permission to access the camera, but the problem is that the allow button on the web is not appearing on the webview.
How can I enable the camera on the webview on android? I'm using expo BTW.


text:
Q: Eclipse: Exported library fail to instantiate oracle driver ojdbc.jar I have a library that contains functionality to connect to on oracle database. When I export this library (as a JAR) and use it in the main project, it gives an exception when loading the driver with class.forname. It obviously cannot find the ojdbc driver. I included this driver in the build path and as exported library.
I tested and used the driver directly from the main project, and it work, it connects to oracle db.
Thanks.

A: The problem is that your driver is a jar file, and when you export the app as a jar file, that driver will be a jar file in a jar file. For that scenario you either need a special classloader or put the driver jar file in the classpath of your main program.

A: Explore your exportedjar by using WinRar and check if it contains a jar under jar.


text:
Q: Picking a certain ID with Retrofit I'm trying to filter a particular title by querying the URL's code. But I do not know how to work with it. I tried with these 2 examples and it did not work. Can someone help me?

public interface PokemonService {
    @GET("app.php?acao=perfil&id={id}")
    public Call<Perfil> busca(@Path("id") int id);

}

or

public interface PokemonService {
    @GET("app.php?acao=perfil&id={id}")
    public Call<Perfil> busca(@Query("id") int id);

}

A:  public interface PokemonService {
   @GET("app.php?acao=perfil")
   public Call<Perfil> busca(@Query("id") int id)
 }

And also check your model. it will be work fine this code

A: public interface PokemonService {
@GET("app.php?acao=perfil")
public Call<Perfil> busca(@Query("id") int id);

}

use this

A: Try it for the error that you have
public interface PokemonService {
@GET("app.php?acao=perfil")
public Call<List<Perfil>> busca(@Query("id") int id);

}


text:
Q: Break XOR type encryption with whole Known text from virus I was hit by a ransomware infection that encrypts the first 512 bytes at the top of the file and puts them at the bottom. Upon looking at the encrypted text it seems to be some type of XOR cipher. I know the whole plain text  of one of the files that was encrypted, so i figured in theory i should be able to xor it to get the key to decrypt the rest of my files. Well i am having a very hard time with this because i don't understand how the creator xor'ed it really. Im thinking he would use a binaryreader to read the first 512 bytes into an array, XOR it, and replace it. But does that mean he XOR'ed it in HEX? or Decimal? Im quite confused at this point, but i believe i am simply missing something.
I have tried Xor Tool with python, and everything it attempts to crack looks like non sense. I also tried a python script called Unxor that you give the known plain text to, but the dump file it outputs is always blank.
Good Header file dump:
Good-Header.bin
Encrypted Header file dump:
Enc-Header.bin
This may not be the best file example to see the XOR pattern, but its the only file i have that also has the original header 100% before encryption. In other headers where there is more changes the encrypted header changes with it.
Any advice on a method i should try, or application i should use to try and take this further? Thanks so much for your help!
P.S Stackoverflow yelled at me when i tried to post 4 links because im so new, so if you would rather see the hex dumps on pastebin than download the header files, please let me no. The files are in no way malicious, and are only the extracted 512 bytes and not a whole file.

A: To recover the keystream XOR the plaintext bytes with the cyphertext bytes.  Do this with two different files so you can see if the ransomware is using the same keystream or a different keystream for each file.
If it is using the same keystream (unlikely) then your problem is solved.  If the keystreams are different, then your easiest solution is to restore the affected files from backups.  You did keep backups, didn't you?  Alternatively research the particular infection you have got and see if anyone else has broken that particular variant, so you can derive the key(s) they used and hence regenerate the required keystreams.
If you have a lot of money then a data recovery firm might be able to help you, but they will certainly charge.

A: A rule of thumb to tell a decent cipher from a toy cipher is to encrypt a highly compressible file and try to compress it in its encrypted form: a dumb cipher will produce a file with a level of entropy similar to that of the original one, so the encrypted file will compress as well as the original one; on the other side, a good cipher (even without an initialization vector) will produce a file that will look like a random garbage and thus will not compress at all.
When I compressed your Enc-Header.bin of 512 bytes with PKZIP, the output was also 512 bytes, so the cipher is not as dumb as you expected — bad luck. (But it does not mean that the malware has no weak spots at all.)


text:
Q: How to evaluate the line integral $\int_{C}\frac{\partial f(x,y)}{\partial x}\,dx$? Let $A$ and $B$ be the endpoints of the line $C$. Is it possible to express the line integral
$$
\int_{C}\frac{\partial f(x,y)}{\partial x}\,dx
$$
using only $f$, $A$ and $B$ (like in the Fundamental Theorem of Line Integrals)?

A: To be well-defined the above integral it must be that case that $C$ is a line with constant $y$, that is, an horizontal line at height $y$. Then for $g(x):=f(x,y)$ you have that $dg=\frac{\partial}{\partial x}g(x)\,d x$, therefore
$$
\int_{C}\frac{\partial}{\partial x}g(x)\,d x=\int_{C}dg=\int_{\partial C}g=g(B)-g(A)
$$
if the endpoints of $C$ are $A$ and $B$ and we understand the integral in $C$ with the orientation from $A$ to $B$.


text:
Q: Dividing a file and removing columns having all 0's in columns I have a file like this, ( The file is basically a list )
"0000"
"ab" "0a"
"000000"
"0000"
"aba" "baa" "aab"
"cb" "cc" "bc" "00"
...............

Now, I want to remove all those rows which contains all 0's as well as those columns which contains all 0's in a specific row. For example, the output will be,
"ab" "0a"
"aba" "baa" "aab"
"cb" "cc" "bc"

Then I want to write this list to a file on disk. How can I do it in R?
This list is a result of execution of a function in R.
Result of:
dput(head(data))
list("0000", c("ab", "0a"), "000000", "0000", c("aba", "baa",
"aab"), c("cb", "cc", "bc"))

A: You input dataset was list.  So, I am guessing the output would also be list
  library(stringr)
  data[[1]] <- c("0a0000", "000000", "a00000")
  lst1 <- lapply(data, function(x) {x1 <- str_count(x, "0"); x[x1!=nchar(x)]})
  indx <- sapply(lst1, length)
  lst2 <- lst1[!!indx]
  datN <- as.data.frame(do.call(rbind,lapply(lst2, function(x)
                  if(length(x)<max(indx)) c(x, rep(NA, max(indx)-length(x)))
                    else x)),
                         stringsAsFactors=FALSE)

  datN
  #     V1     V2   V3
  #1 0a0000 a00000 <NA>
  #2     ab     0a <NA>
  #3    aba    baa  aab
  #4     cb     cc   bc