text:
Q: "goto" alternative in Java In Visual C++ code, I used to write some macros to check if a function's return value is not expected, goto the Exit label. Something like this:
HRESULT hr = S_OK;
IF_FALIED_EXIT(boo());
...
Exit:
  if(FAILED(hr)){ print error message }
  return hr;

This is to prevent the program from being crash and can always handle exceptions. My question is, in Java do we recommend code style like this, or should we use try/catch for most of the cases?
Thank you

A: This is specifically discouraged in Java. See Features Removed From C and C++.
In Java there are some things you can do that are similar, for example see the following basic example that uses a labelled break for an early escape:
// a Class is handed in to create a new instance of with basic reflection

construct_and_add: if (clazz != null) {

    try {
        Object obj = clazz.newInstance();

    } catch (Exception e) {
        System.err.println("Error <" + e.getClass().getName()
            + "> in reflective instantiation: " + e.getMessage());

        break construct_and_add;
    }

    somewhereElse.add(obj);
}


text:
Q: What to use instead of frames in HTML I need to build a site in HTML. I need the top of every page to look the same (I normally use ASP.NET master pages). Is there any way I can get around having the same header and navigation without having the same code at the top of every page?
The site need to be SEO friendly so I would rather not use frames.
Thanks.

A:
Is there anyway I can get around having to have the same header and navigation without having to have to have the same code at the top of every page.

Not without having the same, or similar, drawbacks as using frames.
If you want a template mechanism that doesn't depend on server side support, check out Template-Toolkit. It has a utility called ttree that will build a set of static files from your data and templates which you can then upload to hosting which doesn't have anything like SSI, PHP, Masterpages, etc.

A: You could kind of "compile" the website before deploying it. So, you could write the pages as PHP scripts that include the header and then "compile" them by running the scripts and deploying their outputs.

A: As a general approach, you'd usually store the header (and indeed footer, other common page sections, etc.) in a separate file and include these files on each page. Depending on the capabilities of the platform, you could even make these files intelligent, in the sense that they could alter themselves based on the "current" URL.
By using this approach, you have the benefit of only having to edit the "header", etc. in one file rather than having to search & replace across the entire site, or (worse still) manually carry out the changes on every page.
However, without know what platform you're using (ASP.NET/MVC, PHP, JSP, etc.) it's impossible to recommend anything specific.

A: I'm not a HTML guru, however, I'm sure that it is possible to create a floating layer (using <DIV> or <SPAN> sections) that could be docked at the top of the page

A: Most sites are built using a web framework of some description. These essentially allow you to define templates for your site pages - e.g you can define headers, footers, menus etc which the framework will insert into your page at render time (when the page is requested). However such pages are "dynamic" and thus require a scripting environment such as perl, python, ruby, php in order to generate the requested page. There are many frameworks available for these languages; or if you're building a super simple site you could set up your own templates and use those.
If however you're limited to pure HTML, i.e static pages, then yes you're going to have to manually add the common HTML to each page if you want to avoid frames.

A: You could use server-side includes and break the page up into Header pages, Side navigation pages and footer pages.
Then you can include these as server-side includes in each of your pages.

redpajama_set_name: RedPajamaStackExchange


text:
Q: What is the definition of a statement implying or being equivalent to another statement given a background theory? I understand what it means for a statement $P$ to imply, or be equivalent to, another statement $Q$. However, in mathematics, two statements are often not equivalent to each other by themselves, but only given a background theory $T$. For example, given the background of ZF set theory, the axiom of choice is equivalent to the statement that every set can be well-ordered. So, my question is, what is the rigorous definition of the statement "Given background assumptions $T$, $P$ implies/is equivalent to, $Q$"?

A: Given some theory $T$, we can say that statement $P$ is '$T$-equivalent' to $Q$ if and only if $P \leftrightarrow Q$ is a theorem of $T$ (or if you want: can be derived from its axioms). Or formally: $T \vDash P \leftrightarrow Q$

A: Bram28's answer is absolutely correct. However, I think it is worth pointing out a subtlety which arises if we look at weaker background logics than first-order logic. For simplicity I'll talk only about propositional logic(s) since already these present enough complexity for the situation to be interesting.
In classical propositional logic, it makes to say that (propositional) sentences $\alpha,\beta$ are equivalent modulo a (again, propositional) theory $T$ iff $$T\vdash \alpha\leftrightarrow\beta.$$ This is, however, dependent on having a particular connective ("$\leftrightarrow$") in our language. What if we don't have it?
Well, the following alternative definition leaps to mind: $\alpha$ is equivalent modulo $T$ to $\beta$ iff $$T\cup\{\alpha\}\vdash\beta\quad\mbox{and}\quad T\cup\{\beta\}\vdash\alpha.$$ In fact, this is really prior (in my opinion) to the $\leftrightarrow$-based definition, the two being connected by the deduction theorem. This gives us a notion of equivalence modulo a theory even in very limited situations - say, when we only have access to the connective "$\wedge$" (functional completeness is a privilege, not a right, and we may not have eaten sufficiently many lima beans recently :P).
However, this is really just the start of the story. Once we start questioning our underlying propositional apparatus, we will inevitably be led to the idea of algerbaic logic and in particular algebraization. It turns out that, broadly speaking, the following are equivalent for a logic (in the appropriate sense) $\mathcal{L}$:

*

*$\mathcal{L}$ has a "well-behaved" algebraic semantics (e.g. Boolean algebras for classical propositional logic).

*$\mathcal{L}$ has a "well-behaved" notion of logical equvialence (involving the so-called Leibniz operator $\Omega$).
See Blok/Pigozzi's Algebraizable logics or the introduction of Czelakowski's Protoalgebraic logics for more on this topic. Again, this type of subtlety does not arise when "working over $\mathsf{ZF}$" or similar, but for anyone interested in how logic works "under the hood" it's worth being aware of.


text:
Q: Convenient way of upgrading java version like npm In node.js, one can use npm to upgrade package version conveniently with a single command line. In java, is there a similar and convenient way to upgrade the jdk and jse to the latest version? Something like this;

$ jpm update

A: AFAIK there is no direct way for JDK like that.
In windows you can use the java update manager to update the java version. In linux environment you can use the method mentioned in https://askubuntu.com/questions/183867/how-do-i-update-oracle-java-7-jdk-and-jre


text:
Q: Ubuntu 14.04 Wireless not working: no network interface. Atheros [168c:003e] device I just installed Ubuntu 14.04.3 LTS after installing windows 10 in my new VN7-571G and the wireless is not working.
It never had: even during the installation it was not recognized.
I run a script to gather the data , which is here.
lspci -knn | grep Net -A2 output
03:00.0 Network controller [0280]: Qualcomm Atheros Device [168c:003e] (rev 20)
        Subsystem: Lite-On Communications Inc Device [11ad:0804]

The OS behaves like it has no wifi card. I do not see wifi settings in network settings
I'm not a linux power user, so I do not know what to do to solve the issue.
What should I do to make it work?

A: This device is supported in Ubuntu 15.10 with the latest updates.

*

*You can get it work in Ubuntu 14.04 by installing kernel 4.2 and the updated firmware. Run in terminal:
sudo apt-get install linux-generic-lts-wily
wget https://mirrors.kernel.org/ubuntu/pool/main/l/linux-firmware/linux-firmware_1.157_all.deb
sudo dpkg -i linux-firmware_1.157_all.deb

*In Ubuntu 15.10 and later you only need to install the firmware:
sudo apt-get install linux-firmware

In both cases, reboot afterwards.


text:
Q: Trying to access s3 bucket using scala application I want to access amazon s3 bucket using scala application. I have set up the scala IDE in my eclipse. But when i try to run the >application on my local (Run As --> Scala Application) , it gives the following >error on the console. Error: Could not find or load main class org.test.spark1.test I an trying to run  a simple wordcount application in which i am accessing a >file that is stored in my S3 bucket and storing the results in another file. Please make me understand what might the problem be.
Note: I am using eclipse maven project. My scala application code is :
package org.test.spark1
import com.amazonaws._
import com.amazonaws.auth._
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import com.amazonaws.services.s3._
import com.amazonaws.services.s3.model.GetObjectRequest
import java.io.File;
object test extends App {
def main(args: Array[String])  {
val myAccessKey = "here is my key"
val mySecretKey = "here is my secret key"
val bucket = "nlp.spark.apps"
val conf = new SparkConf().setAppName("sample")
val sc = new SparkContext(conf)
val yourAWSCredentials = new BasicAWSCredentials(myAccessKey, mySecretKey)
val amazonS3Client = new AmazonS3Client(yourAWSCredentials)
// This will create a bucket for storage
amazonS3Client.createBucket("nlp-spark-apps2")
val s3data = sc.textFile("here is my url of text file")
s3data.flatMap(line =>
  line.split(" "))
  .map(word =>
    (word, 1))
  .reduceByKey(_ * _)
  .saveAsTextFile("/home/hadoop/cluster-code2.txt")
}}

A: A possible solution I came across is that the Scala IDE does not automatically detect your main class:

*

*Go to Menu --> "Run" --> "Run configurations"

*Click on "Scala    application" and on the icon for "New launch configuration"

*For    project select your project and for the main class (that for some    reason is not auto-detected) manually enter (in your case)    org.test.spark1.test

*Apply and Run

OR
You could try to run your Spark job locally without eclipse using spark-submit.
spark-submit --class org.test.spark1.test --master local[8] {path to assembly jar}

Another thing, you should never hardcode your AWS credentials. I suggest you use InstanceProfileCredentialsProvider. This credentials exist in the instance metadata associated with the IAM role for the EC2 instance.


text:
Q: How can I retrieve existing data from an SQL Server database while updating many rows? We have a program that parses a few files every half hour and inserts or updates the data in a MS SQL Server database. The problem is that it seems as if the program commits many operations in one go. In the past, this wasn't a problem but recently the parsed files have significantly increased in size and now every half an hour the database becomes unresponsive for 5 or so minutes and we can't perform a simple select statement while the program finishes committing whatever changes it makes.
We can't change the program, so how can I make the database retrieve the old rows while the program finishes committing its changes instead of just timing out as it currently does?

A: You could change the isolation level of the database to use Read committed snapshot isolation.
https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/sql/snapshot-isolation-in-sql-server
Have a read of this article to get a good understanding of the implications of switching RCSI to on. It may cause a performance hit and may give you unwanted results, so test!: https://www.brentozar.com/archive/2013/01/implementing-snapshot-or-read-committed-snapshot-isolation-in-sql-server-a-guide/


text:
Q: Weak convergence and pointwise convergence of norm Assume that $f_n\rightharpoonup f$ weakly in some $L^p$ space, and $|f_n|\rightarrow|f|$ pointwise. Does this imply that $f_n\rightarrow f$ pointwise? (or a subsequence?)

A: Consider $f_n(x)=-\mathbf{1}_{\mathbb{Q} \cap [0,1]}$ and $f(x)=\mathbf{1}_{\mathbb{Q} \cap [0,1]}$.
Then $|f_n(x)|=|f(x)|$ and $f_n \rightharpoonup f$ since
$$\forall \phi \in L^q, \int (f_n-f)\phi=0,$$
as $f_n-f$ is non-zero over a set of $0$ measure.


text:
Q: How to make an Android app fetching live data(order books, market depths) from cryptocurrency exchanges? I decided to start with only one exchange(preferably Bitfinex) by displaying its real time order book.
I have taken some Android development courses but I am not sure on how to start. I know that we fetch data by using exchanges'APIs and websocket. Can someone give me some advice on how to build that into my app? Any other advice on how to start would be appreciated too.

A: I recently developed an Android App which converts Bitcoin To Different Units like (USD/INR/.. 20 more) using coindesk free API.
Please refer this https://www.coindesk.com/api/


text:
Q: JQuery getJSON method not being called I'm trying to create a table with pagination using jQuery and json but can't get the getJSON method to work. The JavaScript function GetPageData is called on page load and is being called successfully. I've tested adding the two commented out lines in the code below and can see that no code inside of the getJSON method has any effect.
function GetPageData(pageNum, pageSize) {
    $("#tblData").empty();
    $("#paged").empty();
   // $("#tblData").append('
1	2
')
    $.getJSON("/Retailers/GetPagedData", { pageNumber: pageNum, pageSize: pageSize }, function (response) {
     //   $("#tblData").append('
1	2
')
        var rowData = "";
        for (var i = 0; i < response.Data.length; i++) {
            rowData = rowData + '
' + response.Data[i].Name + '	' + response.Data[i].RetailerCode + '
';
        }
        rowData = rowData + '
Name	RetailerCode
';
        $("#tblData").append(rowData);
        PagingTemplate(response.TotalPages, response.CurrentPage);
    });

Below is the Index.cshtml view, which is in the Retailers folder.
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/jquery")

@{
    ViewBag.Title = "Manage Retailers";
}

Manage Retailers

            Retailer Name
            Retailer Code

and below is the RetailersController...
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using CCM.Models;
using CCM.Helper;

namespace CCM.Controllers
{
    public class RetailersController : Controller
    {
        MCDevEntities context = new MCDevEntities();
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult GetPagedData(int pageNumber = 1, int pageSize = 20)
        {
            List<Retailer> listData = context.Retailers.ToList();
            var pagedData = Pagination.PagedResult(listData, pageNumber, pageSize);
            return Json(pagedData, JsonRequestBehavior.AllowGet);
        }
    }
}

Am I missing anything obvious that could be stopping this from working? I also have a Helper folder containing PagedData.cs and Pagination.cs. The page URL is localhost:.../Retailers/Index.
Edit.
In case it helps here is the rest of the javascript:
$(document).ready(function () {
    //Initially load pagenumber=1, pagesize=20
    GetPageData(1, 20);
});

function PagingTemplate(totalPage, currentPage) {
    var template = "";
    var TotalPages = totalPage;
    var CurrentPage = currentPage;
    var PageNumberArray = Array();

    var countIncr = 1;
    for (var i = currentPage; i <= totalPage; i++) {
        PageNumberArray[0] = currentPage;
        if (totalPage != currentPage && PageNumberArray[countIncr - 1] != totalPage) {
            PageNumberArray[countIncr] = i + 1;
        }
        countIncr++;
    };
    PageNumberArray = PageNumberArray.slice(0, 5);
    var FirstPage = 1;
    var LastPage = totalPage;
    if (totalPage != currentPage) {
        var ForwardOne = currentPage + 1;
    }
    var BackwardOne = 1;
    if (currentPage > 1) {
        BackwardOne = currentPage - 1;
    }

    template = "
" + CurrentPage + " of " + TotalPages + " pages
"
    template = template + '
' +
        '
 First
' +
        '
<select ng-model="pageSize" id="selectedId"><option value="20" selected>20</option><option value="50">50</option><option value="100">100</option><option value="150">150</option></select>
' +
        '
';

    var numberingLoop = "";
    for (var i = 0; i < PageNumberArray.length; i++) {
        numberingLoop = numberingLoop + '' + PageNumberArray[i] + '   '
    }
    template = template + numberingLoop + '
' +
        '
Last

';
    $("#paged").append(template);
    $('#selectedId').change(function () {
        GetPageData(1, $(this).val());
    });
}

A: Try using below code
$.ajax({
            url: '/Retailers/GetPagedData',
            data: {
                pageNumber: pageNum,
                pageSize: pageSize
            },
            success: function (response) {
                //code
            }
        });

A: Try this and check:
    $.ajax({
        url: '@Url.Action("GetPagedData", "Retailers")',
        data: {pageNumber : pageNum,
            pageSize: pageSize
        },
        success: function (response) {
             console.log(response);
            //   $("#tblData").append('
1	2
')
            var rowData = "";
            for (var i = 0; i < response.Data.length; i++) {
                rowData = rowData + '
' + response.Data[i].Name + '	' + response.Data[i].RetailerCode + '
';
            }
            rowData = rowData + '
Name	RetailerCode
';
            $("#tblData").append(rowData);
            PagingTemplate(response.TotalPages, response.CurrentPage);
        }
    });


text:
Q: couldn't import django:importError I am working on a Django project and at the beginning everything was going well . But for say 2 days i'm not more able to run my project using the Python run manage.py  it gives me this error
Traceback (most recent call last):
File "manage.py", line 17, in
"Couldn't import Django. Are you sure it's installed and "
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment ?
I use Anaconda as virtual environment . During my debugging process I checked the installed packages in the environment , and this is the output.

I also use python 3.8 as interpreter but outside the virtual environment.

A: Check that the interpreter is pointed to conda env directory.


text:
Q: How to retrieve the Microsoft Store ID key? I'm trying to learn how to retrieve the Microsoft Store ID key. For this, I followed the examples provided by Microsoft in Windows Universal Samples. I tried to use the Business to Business scenario (scenario 7). I already published a sample App and registered the app in Azure Active Directory. The problem is I don't know what value should I send as the publisherUserId parameter in the getCustomerCollectionsIdAsync/getCustomerPurchaseIdAsync functions. I tried to send the email of the current user (customer email) which only retrieves an empty result (Microsoft Store ID key).
 function getCustomerCollectionsId() {
    var token = getTokenFromAzureOAuthAsync().done(function (aadToken) {
        if (aadToken) {
            storeContext.getCustomerCollectionsIdAsync(aadToken, "***@hotmail.com")//"kim@example.com"
                .done(function (result) {
                    output.innerText = result;
                    if (!result) {
                        WinJS.log && WinJS.log("getCustomerCollectionsIdAsync failed.", "sample", "error");
                    }
                });
        }
    });
}

function getCustomerPurchaseId() {
    var token = getTokenFromAzureOAuthAsync().done(function (aadToken) {
        if (aadToken) {
            storeContext.getCustomerPurchaseIdAsync(aadToken, "***@hotmail.com")//"kim@example.com"
                .done(function (result) {
                    output.innerText = result;
                    if (!result) {
                        WinJS.log && WinJS.log("getCustomerPurchaseIdAsync failed.", "sample", "error");
                    }
                });
        }
    });
}

A: I have face the same problem, here is the solution works for me.
Go to https://portal.azure.com ,choose "Azure Active Directory" , choose "App registrations" , choose your application in the right panel. then Choose Manifest to edit it manifest. set following fields to the value:
"accessTokenAcceptedVersion": 1,
"identifierUris": [
    "https://onestore.microsoft.com",
    "https://onestore.microsoft.com/b2b/keys/create/collections",
    "https://onestore.microsoft.com/b2b/keys/create/purchase"
    ],
"signInAudience": "AzureADMyOrg",

And the resource field of your get token request (https://login.microsoftonline.com/xxx/oauth2/token) must  be the exact string "https://onestore.microsoft.com/b2b/keys/create/collections" (notice that the domain part is "onestore.microsoft.com")
ps:
My way to find out this solution:

*

*use charles ssl proxy to record request of my c# project with the storeContext.getCustomerCollectionsIdAsync api. find out that the url it send is "https://collections.mp.microsoft.com/v7.0/beneficiaries/me/keys" and the request body contain the token I send to it.

*use charles ssl proxy to record request of other app that works correctly like "Hotspot Shield", try to buy something from it, and cancel it. Find the request of the url and download the request body and base64 raw url to decode the second part of their token, find that the "aud" is  "https://onestore.microsoft.com/b2b/keys/create/collections" and "ver" is "1.0".

*Change the config of the "App registrations" and the token get code to make the result token is version 1.0 and "aud" to the correct one.

I think that "Azure Active Directory" is update to version 2, but the document of "Microsoft Store ID key" is not update to that version ...

A: using Windows.Security.Authentication.Web;
...
string SID = WebAuthenticationBroker.GetCurrentApplicationCallbackUri().ToString();

You can try this if you are in the development phase. This will be helpful if you are stuck worrying about submitting the app to store to do something like Facebook authentication. Given below is the reference I got it from. Hope this helped!
http://microsoft.github.io/winsdkfb/index.html


text:
Q: Triviality of the tangent space of an abelian variety The tangent bundle of an abelian variety $A/K$ is trivial. Mumford's proof of this fact goes something like this: given the (non-zero) value of a section in a fiber, one can determine the value in all of the fiber by the group law. This is the same as the proof for Lie groups.
But this seems somewhat incomplete to me, since in the algebraic geometry setting one specifies a section by stalks, rather than values in the residue field at each stalk. So my question is, how does one actually show that knowing all these values gives you a section with  those values?


text:
Q: Unable to simultaneously satisfy constraints. SwiftUI I am not sure as to why I am experiencing this error as I do not have any view modifiers on any of my linked views, and yet I have this error:

[LayoutConstraints] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want.
    Try this:
        (1) look at each constraint and try to figure out which you don't expect;
        (2) find the code that added the unwanted constraint or constraints and fix it.
(
    "<NSLayoutConstraint:0x6000003807d0 'accessoryView.bottom' _UIRemoteKeyboardPlaceholderView:0x7fc40b6609d0.bottom == _UIKBCompatInputView:0x7fc40b577c70.top   (active)>",
    "<NSLayoutConstraint:0x6000003be350 'assistantHeight' SystemInputAssistantView.height == 45   (active, names: SystemInputAssistantView:0x7fc40b5050a0 )>",
    "<NSLayoutConstraint:0x600000380aa0 'assistantView.bottom' SystemInputAssistantView.bottom == _UIKBCompatInputView:0x7fc40b577c70.top   (active, names: SystemInputAssistantView:0x7fc40b5050a0 )>",
    "<NSLayoutConstraint:0x600000380af0 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x7fc40b6609d0]-(0)-[SystemInputAssistantView]   (active, names: SystemInputAssistantView:0x7fc40b5050a0 )>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x600000380af0 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x7fc40b6609d0]-(0)-[SystemInputAssistantView]   (active, names: SystemInputAssistantView:0x7fc40b5050a0 )>

My SwiftUI Views are as follows:

struct RecordView: View {
    @EnvironmentObject var modelView : JournalRecordsModelView

    @State private var navigationPath: [JournalRecordsModel.Record] = []

    @State private var showAddRecord: Bool = false

    var body: some View {
        NavigationStack(path: $navigationPath) {
            List {
                ForEach(modelView.currentData) { record in
                    NavigationLink(value: record, label: { Text(record.timeDate) })
                }.onDelete(perform: { index in
                    index.forEach({ i in
                        modelView.deleteRecord(i)
                    })
                })
            }
            .navigationDestination(for: JournalRecordsModel.Record.self) { record in
                RecordDetailedView(record: record, navigationPath: $navigationPath).environmentObject(modelView)
            }
            .navigationTitle("Your Records")
            .navigationBarItems(trailing: Button(action: {
                showAddRecord.toggle()
            }, label: {
                Image(systemName: "plus")
            }))
            .sheet(isPresented: $showAddRecord) {
                AddRecordView(showAddRecord: self.$showAddRecord).environmentObject(modelView)
            }
        }
    }
}

struct AddRecordView: View {
    @EnvironmentObject var modelView : JournalRecordsModelView
    @Binding var showAddRecord: Bool
    @State private var showSubmitAddAlert: Bool = false
    @State private var dateTime = Date.now
    @State private var title: String = ""
    @State private var content: String = ""
    @State private var feeling: String = "Nil"
    var body: some View {
        HStack {
            Text("Add Record")
                .font(.title)
                .fontWeight(.bold)
                .frame(
                    width: UIScreen.main.bounds.width / 2.2,
                    height: 20,
                    alignment: .leading
                ).padding([.leading])
            Button(action : {
                showAddRecord.toggle()
            },
                   label: {
                Image(systemName: "xmark")
            }).frame(
                width: UIScreen.main.bounds.width / 2.2,
                height: 20,
                alignment: .trailing
             )
            .padding([.trailing])
        }.padding([.top, .bottom])

        DatePicker("Date and Time", selection: $dateTime)
            .padding(.horizontal)

        TextField("Entry Name", text: $title)
            .padding(.horizontal)

        TextField("What are your thoughts today?", text: $content)
            .padding(.horizontal)

        Text("How are you feeling?")
            .font(.body)
            .padding(.horizontal)

        Picker("How do you feel?", selection: $feeling) {
            ForEach(modelView.currentFeelings, id: \.self) { feeling in
                Text(feeling)
            }
        }
        .padding(.horizontal)
        .pickerStyle(MenuPickerStyle())

        Spacer()
        Button {
            modelView.addRecord(dateTime, title, content, feeling)
            showSubmitAddAlert.toggle()
        }
        label: {
                Image(systemName: "doc.fill.badge.plus")
        }
        .disabled(title.isEmpty || content.isEmpty || feeling == "Nil")
        .alert("Record added. Please confirm addition of record.", isPresented: $showSubmitAddAlert) {
            //the moment i click OK on the alert, have constraints error, button is causing the error
            **Button("Ok", role: .cancel) {
                showAddRecord.toggle()
            }**
        }
    }
}

The button in AddRecordView seems to be causing the problem but I am not sure as to why it is causing the problem. The UI and the app does not crash when running even though the error pops out. I would appreciate any advices in advance. Thank you.
I have checked on all variable names and checked any modifiers for my views that are related to sizing of the views, as I assume that the error is related to dimensions.

A: Message you are seeing is more a hint/warning as an error. There are constraints that do conflict and as the messeages tells you, it will solve this by breaking one constraint. This is not a huge deal, but could lead the UI to not look like you want it to look. You should check the layoutConstraint system anyways to know what is going on here. The listed constraints are system constraints, so it will be hard to figure out by checking them.
What you could try is:
**Button("Ok", role: .cancel) {
   showSubmitAddAlert = false
   showAddRecord = false
}**

this should close the alert before closing the presented AddRecordView
Also I would recommend setting the bools explicitly to true/false, because in every case there should be no scenario where it is toggled the other way around (makes it much easier to read, and also prevents unwanted behaviour if the value is not set as it should be).


text:
Q: Proving sum of even + odd = odd in the opposite direction. Every child knows this proof:
Assuming that:
$odd(x) = 2a + 1$, where $a \in \mathbb{N} $ and
$even(y) = 2b + 1$, where $b \in \mathbb{N} $ and also
$\lnot odd(x) = even (x)$
$\lnot even(x) = odd (x)$
then: $odd(x) \land even(y) \rightarrow odd (x + y)$ is simply proven by:
$$x = 2a + 1 $$
$$y = 2b $$
$$x + y = 2a + 1 + 2b$$
$$x + y = 2(a + b) + 1$$
$$x + y = 2k + 1, k \in \mathbb{N}$$
Therefore $x + y$ is odd, by definition of odd.
I am interested in proving it the other way around: $odd (x + y) \rightarrow odd(x) \land even(y)$
I'm not even really certain how to get started. I cannot assume anything about either $x$ or $y$; the only thing which I can assume is that their sum is odd. Would one have to prove this with a contrapositive? The problem I see with this (might be a case of overthinking) is that:
$$\lnot(odd(x) \land even(y)) \rightarrow \lnot odd(x + y) $$
$$\lnot odd(x) \lor \lnot even(y) \rightarrow \lnot odd(x + y) $$
$$ even(x) \lor odd(y) \rightarrow \lnot odd(x + y) $$
which just seems wrong...

A: Let me try:
Given  $c=x+y$ ; where $c$ is odd, i.e.
$c= 2k+1 =x +y .$
1)Assume $x,y$ are even, i.e. $2|x$ and $2|y$
then $2|c$, a contradiction,
since $c=2k+1$.
Hence it is not true that both $x$ and $y$ are even.
Hence $x$ is odd or $y$ is odd.
2) Assume both $x$ and $y$ are odd, then
$x= 2m+1$; $y=2n+1$ , and
$x+y = 2(m+n)+2$, a contradiction
since $c=x+y = 2k+1.$
3) Hence:
Either $x$ or $y$ is odd, not both.

A: There are only $4$ cases to consider

*

*if $x$ is odd and $y$ is odd, then $x+y$ is even.

*if $x$ is even  and $y$ is even, then $x+y$ is even.

*if $x$ is odd  and $y$ is even, then $x+y$ is odd.

*if $x$ is even  and $y$ is odd, then $x+y$ is odd.

Hence if $x+y$ is odd, and $x$ and $y$ are both integers, we know that $x$ and $y$ have different parity, one of them is odd and one of them is even.
If $x+y$ is odd, then ($x$ is odd and $y$ is even) or ($x$ is even and $y$ is odd).


text:
Q: Android 11 bypass the permissions of "allow only while using the app" I trying to develop an app that can take photos in the background. This app can prevent mobile phones from being stolen. If be stolen, the phone will send back photos and location.
I started an android service to receive the command from the user. The service can call android-camera2 to take pictures.
But the app I wrote doesn't work that It can only be allowed when it is used. Once the activity enters the background, it can't take photos. How can I solve this problem? I can modify the ROM of the android system. So are there any tips that can be provided?
thank you.


text:
Q: How to free allocated objects in java? As it can be seen in the following minimal code, I want when the JAVA object finished, the allocated object in test variable be unallocated. What can I do to unallocate this object?
I used null and system.gc, but they don't work to unallocate the object.
package chatclient;
/**
 *
 * @author root
 */
import java.io.IOException;

public class ChatClient {
    private void run() throws IOException {
        long test[]=new long[10000000];
        test[10000]=100;
        // Process all messages from server, according to the protocol.
        test=null;
        System.gc();
    }

    @Override
    protected void finalize() throws Throwable {
        super.finalize(); //To change body of generated methods, choose Tools | Templates.
    }

    /**
     * Runs the client as an application with a closeable frame.
     */
    public static void main(String[] args) throws Exception {
        while(true){
            ChatClient client = new ChatClient();
            client.run();
        }
    }
}

A: Java is a Garbage Collected language. It does not provide a means to explicitly free memory. Instead, if an object can't be reached, it is a candidate for Garbage Collection, and will be removed when the runtime's GC algorithm decides it needs the space.
The GC algorithm in modern versions of Java is incredibly sophisticated, and high performing. However it's quite normal for it to not remove objects from the heap, when memory usage is not approaching configured limits.
This is a great boon to the programmer - most of the time you simply don't need to worry about memory management. However if you're running in a very tight memory environment, Java might not be the right tool for you.


text:
Q: Delphi non-rtti inspector I have some virtual controls which is a part of a designer system i have made. They mimic delphi's own components, except that they are fully owner-drawn. The problem I am faced with is that, since my property system is somewhat different from ordinary Delphi - I cant use an RTTI inspector to edit the properties.
Does anyone know about a inspector that looks and acts like the normal delphi inspector, but that allows me to define the properties by code?
And if possible, one which allows me to define enums:
with edInspector.Items.add('align') do
Begin
  Options.add('alLeft',ftord(TMyAlign.azLeft));
  Options.add('alTop',ord(TMyAlign.azTop));
  Options.add('alRight',ord(TMyAlign.azRight));
  Options.add('alBottom',ord(TMyAlign.azBottom));
  Options.add('alClient',ord(TMyAlign.azClient));
end;

and complex types:
with edInspector.Items.add('font') do
Begin
  subitems.add('name',dtString).value:=def_FontName;
  subitems.add('size',dtInteger).value:=def_fontSize;
  subitems.add('color',dtColor).Value:=def_fontColor;
end;

A: Give Inspex a try. It's pretty cool.
http://www.raize.com/DevTools/Inspex/Default.asp
You can add properties dynamically, and you'll get property editors for most of the common types.
It can behave pretty much like the Delphi object inspector (it lets you edit sets, if you add multiple objects, it detects which properties are the same, and hides the others, and it does the same for property values).
It shows properties in a tree-like structure if there are multiple levels.
You can easily populate it by adding any TObject, via a string, or by adding the properties one by one.
Screenshot:

A: With Delphi Runtime Inspector, you will be able to see object information at run-time.


text:
Q: What does it mean the "starting address" of an executing thread? Would this mean what is the starting address of the first instruction to be executed or the address of the entry point of the thread that is currently executing or am I totally misunderstanding the answer ?

A: Threads share the same instructions so the "starting address" of the thread would be whatever the first instruction was that the thread executed and not, for example, any instructions that were used to start the thread in the parent.
Someone can correct me if I'm wrong but while threads can share the same data, they don't know who started them. As far as they are concerned they are their own process.


text:
Q: Changing colour of square issue I was wondering if anyone can help me. I'm trying to change the colour of my square at the bottom of my homepage it keeps on disappearing when I attempt to change the colour. I'm trying to change it to the colour white from solid red. Why does this keep happening?
Here is my codepen
Below is my CSS coding.
.next {
  position:absolute;
  bottom: 40px;
  left:50%;
  cursor:pointer;
    height: 50px;
    width: 50px;
  border: 4px solid red;
    border-top: none;
    border-left: none;
    transform: translateX(-50%) rotate(45deg);
}

Kind Regards,
Liam

A: Based on your css the arrow shape and color is set with the border property. In this case it's the right and bottom borders of your div that are given a red border, then the div is rotated to look like an arrow pointing downwards.
Update the border color to white instead of red:
border: 4px solid white;

If you were already doing the above, check in the developer console. Sometimes codepen doesn't fully update with your changes -- reload the page to try it again.

A: Have you tried using specifying the color as a hex value?
 border: 4px solid #ff0000; //red


text:
Q: Reading Values from Choice Field of Sharepoint List I am making AJAX call to a Sharepoint list which contains a Choice (checkbox) field. For this field the user can select multiple Countries for which a person is responsible.

AJAX call made to this list returns a href parameter containing a link for the related country values (TestContact(1)/Country) and not the actual values.

This means I need to make additional calls to get Country values for each of the records. So for 100 records I need to make 100 AJAX calls.
Is there any option (some parameter in Sharepoint Link) by which I can set to get Country values against each record in one single AJAX call?
Cannot convert this field to Single / Multiple lines of text as it will allow user to maintain any value (India or Indien / Germany or Deutschland / etc).
Sharepoint Link used in AJAX Call:
https://domain.com/sites/app/_vti_bin/listdata.svc/TestContact
Thanks,
Abhishek.

A: Modify your request from:
https://domain.com/sites/app/_vti_bin/listdata.svc/TestContact

to:
https://domain.com/sites/app/_vti_bin/listdata.svc/TestContact?$expand=Country

In that case the related entries (Country) will be retrieved along with entries identified by the resource path (TestContact) via a single HTTP request.
Reference
Expand System Query Option ($expand)


text:
Q: What are the thermal properties of a "perfectly rigid" container? can a "perfectly rigid" container be a diathermal boundary? I checked the wikipedia article for heat and read:

Kinetic theory explains transfers of energy as heat as macroscopic manifestations of the motions and interactions of microscopic constituents such as molecules and photons.

If the microscopic constituents of the container can't move (I assume this is what rigid means) is the only avenue for heat transfer across a rigid container the emission of photons?


text:
Q: Why do we require topologies are closed under arbitrary union? A topology is closed under arbitrary union of open sets, and therefore a fortiori also closed under countable union of open sets.
Why do we require arbitrary union rather than just countable union?
What might be an example that would illustrate why we require arbitrary union? Or are they just equivalent when talking about unions of sets?
The most similar question I've found to this one is regarding the validity of arbitrary union without assuming topology as prior.
Edit: This question was not addressed in answers given to a similar seeming post regarding finite intersection, rather than arbitrary or countable intersection.

A: The concepts are not equivalent: Let $X$ be an uncountable set and say that a subset $U\subseteq X$ is open if $U=X$ or $U$ is countable (which includes finite or empty). That would be a "topology" in your modified sense, but not in the "traditional" sense.


text:
Q: Shadow DOM - Unable to Click element (Selenium webdriver nodejs) I am attempting to click an element in a shadow dom. I am using Selenium Webdriver Nodejs. I currently get access the shadow root. I also can find an element. So I thought the last bit clicking it would be straight forward but cant find out how. There is not much support for Shadow Dom with nodejs.But cant work out how to click that element.
async function getshadowDOM(driver) {
// This gets the 1st Shadow Root
const shadowHost = await driver.findElement(By.css("#container > div.sf_common_comp-Page__header > div > xweb-shellbar"),3000);
const shadowRoot =  await driver.executeScript("return arguments[0].shadowRoot", shadowHost);

//This gets the 2nd Shadow Root
const shadowHost2nd = await shadowRoot.findElement(By.css("#shellbarContainer"));
const shadowRoot2 =  await driver.executeScript("return arguments[0].shadowRoot",shadowHost2nd);

//Clicks the element in 2nd Shadow DOM
const elem = await shadowRoot2.findElement(By.css("div > div.ui5-shellbar-overflow-container.ui5-shellbar-overflow-container-left > button"));
await elem.click();

}
module.exports = getshadowDOM;

A: I think i found a solution.
Used nodeJs + selenium.
It's work bad with return so i handle like this.
const shadowHost = await driver.findElement(By.css("body > div.project > sn-component-va-web-client"));

const shadowRoot =  await driver.executeScript("return arguments[0].shadowRoot", shadowHost);

const elem = await shadowRoot.findElement(By.css("div.menu-item.contact-support-clicker"));

elem.click();

in my case its works.


text:
Q: NOReverseMatch at /bid/2 I am Getting NoReverseMatch at /bid/2 error can you tell what am I doing wrong and what could be the solution. I am new to Django Thankyou.
Ignore:- sadfgnasgdsfhfgjhn fgdshsdgh fd dgsdfg dsf ds  asgdfhrtyn  sdfgh ehe ereg  sdfgsfghhsdje sdfghshsdherh
This is my URL pattern :-
urlpatterns = [
path("", views.index, name="index"),
path("login", views.login_view, name="login"),
path("logout", views.logout_view, name="logout"),
path("register", views.register, name="register"),
path("create/", views.create_listing,name="create_listing"),
path("submit/<str:username>",views.submit,name="submit"),
path("<int:list_id>",views.item,name="item"),
path("comments/<int:list_id>",views.comment,name="comment"),
path("category/<int:item_category>",views.category,name="category"),
path("bid/<int:list_id>",views.set_bid,name="set_bid"),

]
This is my View Function:-
def set_bid(request,list_id):
price = request.POST['bid']
username = request.user.username
item = Listing.objects.get(pk=list_id)
b=Bids.objects.filter(item=item)
if b:
    b.update(bid=price)
    b.save()
else:
    b = Bids(bid=price,user=username,item=item)
    b.save()
item.current_bidder = username
item.save()
return render(request,"auctions/item.html",{
    "listings":Listing.objects.get(pk=list_id),
    "comments":Comments.objects.all().filter(comment_id=list_id),
    "bid":Bids.objects.all().filter(item=item),
})

This is Item Template from where url pattern is called:-
 {% extends "auctions/layout.html" %}

{% block body %}
{% if message %}

{{ message }}

{% endif %}

Listing:  {{ item.name }}    <button class="btn btn-primary" type="button">Add to Watch list</button>

{{ item.description }}

{% if bid %}

${{ bid.bid }} by {{ item.current_bidder }}

{% else %}

${{ item.price }}

{% endif %}
<form class="" action="{% url 'set_bid' item.id %}" method="post">
  {% csrf_token %}
  <input type="number" name="bid" placeholder="Bid">

  <input id="bid" type="submit" value="Place Bid">
</form>

Details:-

Listed by: {{ item.user }}

Category: {{ item.category }}

Comments

{% for comment in comments %}

{{ comment.user }}

{{ comment.comment }}
    <button class="float-right"></button>

{% endfor %}
<form action="{% url 'comment' item.id %}" method="post">
  {% csrf_token %}
  Your comment

  <textarea name="comment" rows="5" cols="80"></textarea>
  <input type="submit" value="Post">
</form>
{% endblock %}

Error That I am getting :-

A: You haven't sent item in the context while rendering the html. Add the item in the context and will work.
return render(request,"auctions/item.html",{
    ...
    'item': item
})


text:
Q: Method to convert object from class to subclass in Python Consider the following minimal problem:
from math import sqrt

class Vector(object):

    def __init__(self, x, y, z):
        self.v = [x, y, z]

    def normalize(self):
        x, y, z = self.v
        norm = sqrt(x**2 + y**2 + z**2)
        self.v = [x/norm, y/norm, z/norm]

    # other methods follow

class NormalizedVector(Vector):

    def __init__(self, x, y, z):
        super(Vector, self).__init__(x, y, z)
        self.normalize()

So essentially NormalizedVector objects are the same as Vector objects but with the added normalization.
Would it be possible to add a method to Vector so that whenever the normalize method is called the object is automatically subclassed to NormalizedVector?
I know that I could be using the abstract factory pattern, but this would only work if objects are subclassed at creation: I would like to be able to subclass objects that have already been created previously.
I have found some solutions based on reassigning the __ class __ method, but these are discouraged. I am willing to modify the pattern above to a one that it is more "Pythonic".

A: I would recommend to use only the Vector() class and with a boolean normalized instance attribute.
Also, in normalize method you are using x, y and z but those variables are not defined and you are not even reading them with self.
The code I would recommend:
from math import sqrt

class Vector(object):

    def __init__(self, x, y, z, normalized=False):
        self.v = [x, y, z]
        if normalized in [True, False]:
            self.normalized = normalized
        else:
            raise Exception("Please set normalized to either True or False")

    def __repr__(self):
        return "Vector ({}, {}, {})".format(*self.v)

    def normalize(self):
        x,y,z = self.v
        norm = sqrt(x**2 + y**2 + z**2)
        self.v = [x/norm, y/norm, z/norm]
        self.normalized = True

    def isNormalized(self):
        return self.normalized

    # other methods follow

v1 = Vector(10, 20, 30)
print v1.isNormalized()
v1.normalize()
print v1.isNormalized()

v2 = Vector(40, 50, 60, normalized=True)
print v2.isNormalized()

Output:
False
True
True

The __repr__ function will just show a good representation of your object:
print v1

Output:
Vector (0.267261241912, 0.534522483825, 0.801783725737)

A: Why do you need to keep track of the normalization in the vector itself, just keep track of it in your main.py or wherever you're using the vectors?
Also, I would simply return a new copy of the object with the normalized values. This way you can create normalized vectors on the fly in your calculations without changing the original vector.
from math import sqrt

class Vector(object):

    def __init__(self, x, y, z):
        self.v = [x, y, z]

    def normalized(self):
        x, y, z = self.v
        norm = sqrt(x**2 + y**2 + z**2)
        return Vector(x/norm, y/norm, z/norm)

If you have really many vectors you need to normalize, you can normalize them into two lists or a list of tuples or whatever you want, here's a dict example:
vectors = {}
for x, y, z in zip(range(10), range(10), range(10)):
    v = Vector(x, y, z)
    vectors[v] = v.normalize()

If you just have a few vectors or randomly need to normalize a vector for a calculation every now and then, you can just keep track of them manually or create them on the fly in the calculations without changing the original vector: v_norm = v.normalized().

A: If you really want to keep the two classes you could overwrite the operations for the classes.
Let's say you want to add the vector and the normalized vector. You could do it like this
from math import sqrt
class Vector:

    def __init__(self,x,y):
        self.x = x
        self.y = y

    def __add__(self,v):
        if isinstance(v,Vector):
            return (self.x+v.x,self.y+v.y)
        elif isinstance(v,NormVector):
            n = NormVector(self.x,self.y)
            return (n.x+v.x,n.y+v.y)

class NormVector:

    def __init__(self,x,y):
        self.x = x / sqrt(x**2 + y**2)
        self.y = y / sqrt(x**2 + y**2)

    def __add__(self,v):
        if isinstance(v,Vector):
            n = NormVector(v);
            return (self.x + n.x,self.y + n.y)
        elif isinstance(v,NormVector):
            return (self.x+v.x,self.y+v.y)

a = Vector(5,0)
b = NormVector(0,3)
c = a + b
print c

Like this you can overwrite any function you need. A list of possible operations can you find in the documentation


text:
Q: I import the magpylib module but I have problem when I use the magpy.source import numpy as np
import matplotlib.pyplot as plt
import magpylib as magpy

fig = plt.figure(figsize=(8,4))
ax1 = fig.add_subplot(121, projection='3d')
ax2 = fig.add_subplot(122)

s1 = magpy.source.magnet.Box(mag=[0,0,600],dim=[3,3,3],pos=[-4,0,3])
s2 = magpy.source.magnet.Cylinder(mag=[0,0,500], dim=[3,5])

s1.rotate(45,[0,1,0],anchor=[0,0,0])
s2.move([5,0,-4])
c = magpy.Collection(s1,s2)
magpy.displaySystem(c,subplotAx=ax1,suppress=True)
xs = np.linspace(-10,10,29)
zs = np.linspace(-10,10,29)
Bs = np.array([[c.getB([x,0,z]) for x in xs] for z in zs])
X,Z = np.meshgrid(xs,zs)
U,V = Bs[:,:,0], Bs[:,:,2]
ax2.streamplot(X, Z, U, V, color=np.log(U**2+V**2),density=2)
plt.show()

AttributeError: module 'magpylib' has no attribute 'source'
I import the magpylib module but I have problem when I use the magpy.source.


text:
Q: Java 8: How to create java.util.stream.Stream based on java.io.Reader Reading the Java 8 docs it seems that it's intended java.util.stream.Stream could ultimately be backed by an I/O java.io.InputStream.
So, I wanted to read in a character stream and feed it into a map-reduce pipeline using the new features. I couldn't find any utility methods to do this, so I had to roll my own:
public static Stream<Character> charStream(Reader r) {
    Iterator<Character> iter = new Iterator<Character>() {
        Character nextChar = null;

        @Override
        public boolean hasNext() {
            if (nextChar != null) {
                return true;
            } else {
                try {
                    int readChar = r.read();
                    if(readChar == -1) {
                        return false;
                    }
                    nextChar = Character.valueOf((char) readChar);
                    return true;
                } catch (IOException e) {
                    throw new UncheckedIOException(e);
                }
            }
        }

        @Override
        public Character next() {
            if (nextChar != null || hasNext()) {
                Character theChar = nextChar;
                nextChar = null;
                return theChar;
            } else {
                throw new NoSuchElementException();
            }
        }
    };
    return StreamSupport.stream(Spliterators.spliteratorUnknownSize(
            iter, Spliterator.ORDERED | Spliterator.NONNULL), false);
}

Are there utility methods which could accomplish the same or similar?

A: I find that in cases like these, it's easier to implement Spliterator rather than Iterator:
public static IntStream charStream(Reader r) {
    Spliterator.OfInt split = new Spliterators.AbstractIntSpliterator(Long.MAX_VALUE, Spliterator.ORDERED) {
        @Override
        public boolean tryAdvance(IntConsumer action) {
            try {
                int c = r.read();
                if (c == -1) {
                    return false;
                } else {
                    action.accept(c);
                    return true;
                }
            } catch (IOException ex) {
                throw new UncheckedIOException(ex);
            }
        }
    };

    return StreamSupport.intStream(split, false);
}

It's better to implement an IntStream to avoid boxing.  You can always turn the IntStream into a Stream<Character> with .mapToObj(i->(char) i)

A: You can create an IntStream representing the characters using
new BufferedReader(r).lines().flatMapToInt(CharSequence::chars)

If it really has to be a (boxing) Stream<Character> you can use mapToObj(c -> (char)c) on the IntStream:
public static Stream<Character> chars(Reader r) {
    return new BufferedReader(r).lines().flatMapToInt(CharSequence::chars)
      .mapToObj(c -> (char)c);
}

but for most cases
public static IntStream chars(Reader r) {
    return new BufferedReader(r).lines().flatMapToInt(CharSequence::chars);
}

should be sufficient.


text:
Q: reading values from textboxes in Gridview I want to read the values of my entire gridview for my project in ASP.NET.
I've been experimenting and searching for quite some time now, and haven't found what I'm looking for.
This is my gridview in the aspx page:
<asp:GridView ID="GridViewNatuur" runat="server" AutoGenerateColumns="False">
                <Columns>
                    <asp:BoundField DataField="Naam" HeaderText="Mana" />
                    <asp:TemplateField HeaderText="Aantal">
                        <ItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" TextMode="Number" AutoPostBack="False" MaxLength="100" Text="0"></asp:TextBox>
                                                    </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>

It gets values for 6 rows when the page loads. For each of these rows, a textbox will be created. However, all of these textboxes will have the same Id, which is bad. How can I prevent this? Or alternatively, how can I read every row's textbox value?
BLNatuur blnatuur = new BLNatuur();
        List<Natuur> naturen = blnatuur.GetNaturen();
        BLManaCost blmanacost = new BLManaCost();
        int i = 0;
        int aantal;

        foreach (GridViewRow gridRow in GridViewNatuur.Rows)
        {
            ManaCost manaCost = new ManaCost();
            manaCost.KaartId = kaartInsertId;
            manaCost.TypeId = naturen[i].ID;
            string opgehaaldAantal = ((TextBox)GridViewNatuur.Rows[gridRow.RowIndex].Cells[1].FindControl("TextBox1")).Text;
            bool correct = Int32.TryParse(opgehaaldAantal, out aantal);
            if (!correct)
            {
                aantal = 0;
            }
            manaCost.Aantal = aantal;
            i++;
            blmanacost.InsertManaCost(manaCost);
        }

In the code I pasted here, the variable I want to get the part of string opgehaaldAantal right.
Please note that I'm not experienced in ASP.NET as of yet.

A: Just change from
 string opgehaaldAantal = ((TextBox)GridViewNatuur.Rows[gridRow.RowIndex].Cells[1].FindControl("TextBox1")).Text;

to
 string opgehaaldAantal = ((TextBox)gridRow .FindControl("TextBox1")).Text;

A: To get the values of all the textboxes, create an OnRowDataBound event that reads each TextBox as it is created and adds the Text value to a List or similar collection.

A: I solved the problem.
First of all, I ran into the problem where I couldn't read the value of the numeric text box while it was still numeric. So I converted it to a SingleLine textbox in the backend.
I also found that the TextBox control was located in the second spot of the control array of the cell. (The first being the cell itself). So I had to read that array spot to get the TextBox.
BLNatuur blnatuur = new BLNatuur();
        List<Natuur> naturen = blnatuur.GetNaturen();
        BLManaCost blmanacost = new BLManaCost();
        int i = 0;
        int aantal;

        foreach (GridViewRow gridRow in GridViewNatuur.Rows)
        {
            ManaCost manaCost = new ManaCost();
            manaCost.KaartId = kaartInsertId;
            manaCost.TypeId = naturen[i].ID;

            TextBox textbox = (TextBox)gridRow.Cells[1].Controls[1];
            textbox.TextMode = TextBoxMode.SingleLine;
            String opgehaaldAantal = textbox.Text;

            bool correct = Int32.TryParse(opgehaaldAantal, out aantal);
            if (!correct)
            {
                aantal = 0;
            }
            manaCost.Aantal = aantal;
            i++;
            blmanacost.InsertManaCost(manaCost);
        }

I'd like to thank the people who looked into it and helped me figure out the problem.


text:
Q: SyntaxError: invalid syntax Why does such an error happen? I want to plot 2 graphes at one time.
I wrote codes in Jupiter notebook like
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import plotly
import plotly.graph_objs as go

import plotly.offline as offline
plotly.offline.init_notebook_mode(connected=False)

x = "test.csv"
df = pd.read_csv(x)

a = df["A"].values.tolist()
b = df["B"].values.tolist()

a = pd.Series(a)
b = pd.Series(b)

data = [
        plotly.graph_objs.Scatter(y = a, mode = 'lines', name = 'A')
        plotly.graph_objs.Scatter(y = b, mode = 'lines', name = 'B', yaxis="y2")
]

layout = plotly.graph_objs.Layout(
    title="A&B",
    xaxis={"title":"Date"},
    yaxis={"title":"Data-a"},
    yaxis2={"title":"Data-b", "overlaying":"y", "side":"right"},
)

fig = plotly.graph_objs.Figure(data=data, layout=layout)
plotly.offline.iplot(fig)

When I run it, I get this error:
plotly.graph_objs.Scatter(y = b, mode = 'lines', name = 'B', yaxis="y2")
         ^
SyntaxError: invalid syntax

I think no syntax error in the codes, so I really cannot understand why such an error happens.
What is wrong in  my codes?How should I fix this?

A: You're missing commas at the end of these lines:
data = [
        plotly.graph_objs.Scatter(y = a, mode = 'lines', name = 'A'),
        plotly.graph_objs.Scatter(y = b, mode = 'lines', name = 'B', yaxis="y2"),
]


text:
Q: DllNotFoundException for libz3.dll when using Z3 via nuget I use Z3 via NuGet package in my .NET Core 2.1 project and recently tried to update from version 4.5.0.1 to 4.8.1. Then I reverted back to 4.5.0.1 and got this exception at context creation:
using(var ctx = new Microsoft.Z3.Context())
{

}

System.DllNotFoundException: Unable to load DLL 'libz3.dll' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

I checked the following:

*

*my app is compiled for x64 and I use z3x64win package,

*both libz3.dll and Microsoft.Z3.dll are stored in %userprofile%\.nuget\packages\z3x64win\4.5.0.1\lib,

*tried to add this path to the PATH environment variable as described here but it did not help,

*tried to manually save libz3.dll and Microsoft.Z3.dll to bin directory of the project but the problem persists.

Are there any other necessary steps to refer Z3?

A: Back in the days I remember having these problems with Z3 and often it worked by trying the following:

*

*Remove and reset your Microsoft.Z3.dll reference completely. Make sure the csproj file is clean from references before adding the reference again.

*Re-download or get Z3 dll's so that you are hundred procent sure they match and that VS or your environment don't use cache.

*Are you sure both libz3.dll and z3.exe is in your PATH?

A: There is now an official .NET Core Z3 NuGet package which should solve all your issues: https://www.nuget.org/packages/Microsoft.Z3.x64/


text:
Q: WordPress Theme Only Broken In Chrome I seem to be having a really strange issue that only happens in chrome.
My custom theme that i'm using (Simplify. No Support for it anymore...) works great in All browsers except chrome.
The feature boxes and header are very messed up and i'm not sure why it is like that.
I went over to chrome support and they told me to come here....
My Theme in FireFox
My Theme in Chrome
My style.css

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td{border:0;font-family:inherit;font-size:100%;font-style:inherit;font-weight:inherit;margin:0;outline:0;padding:0;vertical-align:baseline;}
:focus{outline:0;}
body{line-height:1;}
ol,
ul{list-style:none;}
table{border-collapse:separate;border-spacing:0;}
caption, th, td{font-weight:normal;text-align:left;}
blockquote:before,
blockquote:after,
q:before,
q:after{content:"";}
blockquote,
q{quotes:"" "";}
a img{border:0;}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section{display:block;}
.alignnone{margin:5px 20px 20px 0;}
.aligncenter,
div.aligncenter{display:block;margin:5px auto 5px auto;}
.alignright{float:right;margin:5px 0 20px 20px;}
.alignleft{float:left;margin:5px 20px 20px 0;}
.aligncenter{display:block;margin:5px auto 5px auto;}
a img.alignright{float:right;margin:5px 0 20px 20px;}
a img.alignnone{margin:5px 20px 20px 0;}
a img.alignleft{float:left;margin:5px 20px 20px 0;}
a img.aligncenter{display:block;margin-left:auto;margin-right:auto}
.wp-caption{background:#fff;border:1px solid #f0f0f0;max-width:96%;padding:5px 3px 10px;text-align:center;}
.wp-caption.alignnone{margin:5px 20px 20px 0;}
.wp-caption.alignleft{margin:5px 20px 20px 0;}
.wp-caption.alignright{margin:5px 0 20px 20px;}
.wp-caption img{border:0 none;height:auto;margin:0;max-width:98.5%;padding:0;width:auto;}
.wp-caption p.wp-caption-text{font-size:11px;line-height:17px;margin:0;padding:0 4px 5px;}
body{color:#6a6969;font-family:'Anaheim', sans-serif;font-size:14px;line-height:1.15;min-width:950px;word-wrap:break-word;}
div, p, a, li, img{transition:all 2s;-moz-transition:all 2s;-o-transition:all 2s;-webkit-transition:all 2s;}
#slide div, #slide p, #slide a, #slide li, #slide img{transition:none;-moz-transition:none;-o-transition:none;-webkit-transition:none;}
img{max-width:100%;border:0 none;}
#container{width:930px;margin:40px auto;}
#header{height:90px;background:url("images/header.png") repeat-x scroll 0 0 #333333;}
#header-bottom{background:url("images/header-bottom.png") no-repeat scroll center top #3c4143;height:500px;margin:-7px 0 -610px;}
img.site-logo, .site-title {max-width:250px;max-height:70px;padding:5px 0;float:left;}
.site-title { padding: 20px 0; font-size: 35px; text-transform: uppercase; max-width: 300px; }
#header-content{width:930px;margin:auto;}
.site-title-hidden{display:none;}
#content{float:left;width:70%;}
#content-full{width:930px;}
.content-ver-sep{background:none repeat scroll 0 0 #CCCCCC;border-bottom:1px solid #FFFFFF;clear:both;height:1px;}
.lsep{background:url("images/lsep.png") no-repeat scroll top center #CCCCCC;clear:both;height:20px;margin:10px auto;}
#right-sidebar{float:right;width:25%;}
#footer{background:url("images/footer.png") repeat-x scroll 0 0 #26292B;border-bottom:50px solid #111111;clear:both;padding:0px;min-width:930px; border-top: 10px solid #000000;}
.versep{background:none repeat scroll 0 0 #111111;border-bottom:1px solid #222222;border-top:80px solid #222222;height:2px;}
#footer-content{width:930px;margin:0 auto;}
#social{display:table;height:50px;margin:-70px auto 30px;padding:0 10px 10px;}

.youtube-link,
.gplus-link,
.picassa-link,
.li-link,
.feed-link{float:left;height:50px;width:50px;}
.youtube-link{background:url("images/youtubeicon.png") no-repeat scroll center top transparent;margin:0 20px;}
.youtube-link:hover{background:url("images/youtubeicon.png") no-repeat scroll center bottom transparent;}
.gplus-link{background:url("images/gplusicon.png") no-repeat scroll center top transparent;margin:0 20px;}
.gplus-link:hover{background:url("images/gplusicon.png") no-repeat scroll center bottom transparent;}
.picassa-link{background:url("images/picassaicon.png") no-repeat scroll center top transparent;margin:0 20px;}
.picassa-link:hover{background:url("images/picassaicon.png") no-repeat scroll center bottom transparent;}
.li-link{background:url("images/liicon.png") no-repeat scroll center top transparent;margin:0 40px 0 20px;}
.li-link:hover{background:url("images/liicon.png") no-repeat scroll center bottom transparent;}
.feed-link{background:url("images/feedicon.png") no-repeat scroll center top transparent;}
.feed-link:hover{background:url("images/feedicon.png") no-repeat scroll center bottom transparent;}
#footer-sidebar{overflow:hidden;padding-top:20px;}
#creditline{color:#8A96A0;font-size:13px;margin-bottom:-40px;text-align:center;padding: 5px;}
#creditline a{font-weight:bold;}
#simplify-main-menu{color:#EEEEEE;float:right;line-height:1;max-width:650px;}
#simplify-main-menu ul{list-style:none outside none;}
#simplify-main-menu li{float:left;position:relative;margin:0 5px;}
#simplify-main-menu a{color:#AAAAAA;display:block;font-size:13px;min-width:40px;padding: 25px 10px 29px;position:relative;text-align:center;text-transform:uppercase;border-bottom:5px solid transparent;}
#simplify-main-menu a:hover,
#simplify-main-menu .current-menu-item > a,
#simplify-main-menu .current-menu-ancestor > a,
#simplify-main-menu .current_page_item > a,
#simplify-main-menu .current_page_ancestor > a{color:#45a9f6;border-bottom:5px solid #45a9f6;}
#simplify-main-menu li ul{float:left;position:relative;margin:0;}
#simplify-main-menu ul ul,
.sub-menu, .sub-menu ul ul{display:none;float:left;left:0;position:absolute;border-bottom:5px solid #000000;border-top:5px solid #000000;border-radius:5px;background:#F2F2F2;background:rgba(242, 242, 242, 0.95);padding:5px;box-shadow:0px 0px 5px 0px #000000;z-index:10000;}
#simplify-main-menu ul li ul li{margin:0;}
#simplify-main-menu ul ul ul{left:100%;top:0;z-index:999;}
#simplify-main-menu ul ul a{border-bottom:1px solid #BFBFBF;border-top:1px solid #FFFFFF;color:#242424;padding:9px 15px;width:140px;text-align:left;text-transform:none;}
#simplify-main-menu ul ul a:hover,
#simplify-main-menu ul ul .current-menu-item > a,
#simplify-main-menu ul ul .current-menu-ancestor > a,
#simplify-main-menu ul ul .current_page_item > a,
#simplify-main-menu ul ul .current_page_ancestor > a{background:#555555;color:#EEEEEE;border-bottom:1px solid #BFBFBF;}
#simplify-main-menu ul li:hover > ul{display:block;}
.widget{display:block;word-wrap:break-word;}
#right-sidebar .widget{background:none repeat scroll 0 0 #CCCCCC;margin-bottom:20px;padding:15px;}
#right-sidebar .widget h3{color:#555555;padding-bottom:5px;text-transform:uppercase;}
#right-sidebar .widget,
#right-sidebar .widget li,
#right-sidebar .widget a,
#right-sidebar .widget a:hover{color:#333333;text-decoration:none;}
#right-sidebar .widget ul{border-bottom:1px solid #EEEEEE;border-top:1px solid #999999;margin:0;}
#right-sidebar .widget li{background:url("images/listicon.gif") no-repeat scroll 0 8px transparent;border-bottom:1px solid #999999;border-top:1px solid #EEEEEE;list-style:none outside none;padding:5px 0 5px 17px;}
#footer-sidebar .widget{margin-bottom:30px;}
#footer-widget{float:left;}
#footer-sidebar .widgets{margin-left:6%;float:left;}
#footer-sidebar #footer-widget{width:20.5%;}
#footer-sidebar .widget h3{color:#EEEEEE;text-transform:uppercase;}
#footer-sidebar .widget,
#footer-sidebar .widget li,
#footer-sidebar .widget a,
#footer-sidebar .widget a:hover{color:#BAB4B4;text-decoration:none;}
#footer-sidebar .widget ul{margin:0;}
#footer-sidebar .widget li{background:url("images/listicon.gif") no-repeat scroll 0 8px transparent;list-style:none outside none;padding:5px 0 5px 17px;}
#right-sidebar input#s,
#footer-sidebar input#s{width:60%;min-width:100px;}
#right-sidebar form#searchform input[type="submit"],
#footer-sidebar form#searchform input[type="submit"]{padding:8px 7px;}
.textwedget{width:100%;}
h1, h2, h2 a, h2 a:visited, h3, h4, h5, h6{font-family:'Poiret One', cursive, sans-serif;font-weight:bold;line-height:1.25;margin:0 0 10px;}
h1,h2,h3,h4,h5,h6{clear:both;}
hr{background-color:#ccc;border:0;height:1px;margin-bottom:10px;}
ul, ol{margin:0 0 10px 25px;}
ul{list-style:square outside none;}
ol{list-style:decimal outside none;}
dl{margin:0 20px;}
dt{font-weight:bold;}
dd{margin-bottom:10px;}
strong{font-weight:bold;}
cite, em, i{font-style:italic;}
blockquote cite,
blockquote em,
blockquote i{font-style:normal;}
pre{background:#FFFFFF;border-radius:5px 5px 5px 5px;color:#222222;line-height:18px;margin-bottom:18px;overflow:auto;padding:1.5em;}
abbr,
acronym{border-bottom:1px dotted #666;cursor:help;}
sup,
sub{height:0;line-height:1;position:relative;vertical-align:baseline;font-size:70%;}
sup{bottom:1ex;}
sub{top:.5ex;}
address{background:#EEEEEE;border:2px solid #DDDDDD;border-radius:5px 5px 5px 5px;font-weight:bold;margin-bottom:15px;max-width:250px;padding:5px 10px;text-align:right;}
embed{max-width:100%;}
#container .gallery{margin:0 auto 1.625em;}
#container .gallery a img{border:none;}
#container .gallery .attachment-thumbnail{float:none;margin:5px auto;}
img#wpstats{display:block;margin:0 auto 1.625em;}
#container .gallery-columns-1 .gallery-item{width:80%;}
#container .gallery-columns-2 .gallery-item{width:40%;}
#container .gallery-columns-3 .gallery-item{width:27%;}
#container .gallery-columns-4 .gallery-item{width:19%;}
#container .gallery-columns-4 .gallery-item img{width:100%;height:auto;}
h1{font-size:30px;}
h2{font-size:23px;}
h3{font-size:20px;}
h4{font-size:17px;}
h5{font-size:15px;}
h6{font-size:13px;}
p{margin-bottom:15px;}
a{color:#0387BF;text-decoration:none;}
b, strong{font-weight:bold;}
displaynone{display:none;}
.clear{clear:both;}
table{background-color:#EEEEEE;border:1px solid #FFFFFF;border-radius:3px 3px 3px 3px;padding:5px;-moz-border-radius:3px;-webkit-border-radius:3px;min-width:200px;color:#333333;}
td{padding:5px 7px;vertical-align:top;}
#wp-calendar td{padding:0px 7px;}
th{font-weight:bold;line-height:1;padding:5px 7px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.7);background:#CCC;}
caption{color:#555555;}
table#wp-calendar{width:100%;}
input[type="text"],
textarea, input#s,
input[type="password"]{background:none repeat scroll 0 0 #EDEDED;border-radius:5px;font-size:14px;padding:10px 7px;width:98%;border-top:1px solid #999999;border-left:1px solid #999999;border-right:1px solid #FFFFFF;border-bottom:1px solid #FFFFFF;}
input[type="password"]{width:200px;}
input[type="text"]:focus,
textarea:focus,
input#s:focus,
input[type="password"]:focus{background:none repeat scroll 0 0 #F7F7F7;}
button,
input[type="reset"],
input[type="button"],
input[type="submit"]{-moz-box-shadow:inset 0px 1px 0px 0px #0eb3cc;-webkit-box-shadow:inset 0px 1px 0px 0px #0eb3cc;box-shadow:0px 0px 3px 0px #555555;background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #11a5db), color-stop(1, #085d96));background:-moz-linear-gradient(center top, #11a5db 5%, #085d96 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#11a5db', endColorstr='#085d96');background-color:#11a5db;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;border:1px solid #0785b3;display:inline-block;color:#f7f7f7;font-family:arial;font-size:13px;font-weight:bold;padding:5px 15px 6px;text-decoration:none;text-shadow:1px 1px 1px #555555;min-height:35px;text-transform:uppercase;cursor:pointer;margin:5px 0;}
button:hover,
input[type="reset"]:hover,
input[type="button"]:hover,
input[type="submit"]:hover{background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #085d96), color-stop(1, #11a5db));background:-moz-linear-gradient(center top, #085d96 5%, #11a5db 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#085d96', endColorstr='#11a5db');background-color:#085d96;}
button:active,
input[type="reset"]:active,
input[type="button"]:active,
input[type="submit"]:active{position:relative;top:1px;}
input#s{width:70%;min-width:235px;}
.post.sticky,
.sticky{background:url("images/sticky.png") no-repeat scroll right top #F2F2F2;margin-bottom:30px;padding:15px;}
.gallery-caption{clear:both;width:95%;}
.bypostauthor{}
#container,
#content,
#content-full{font-size:14px;text-align:justify;}
#content img,
#content-full img{height:auto;max-width:100%;vertical-align:middle;}
#content img.wp-smiley,
#content-full img.wp-smiley{border:none;box-shadow:none;}
#heading{color:#CCCCCC;font-size:35px;margin: 40px auto;text-align:center;width:700px;font-weight:100;}
.heading-desc{color:#AAAAAA;font-size:14px;margin:-40px auto 10px;text-align:center;width:700px;}
#slide-container{width:930px;height:383px;background:url("images/sliderbottom.png") no-repeat scroll center bottom transparent;margin:30px 0;}
#slide{width:930px;height:350px;overflow:hidden;}
#slide-container a, #slide{transition:none;-moz-transition:none;-o-transition:none;-webkit-transition:none;}
#slide img{width:930px;height:350px;overflow:hidden;}
#ft-buttons-slide{text-align:left;margin:-30px 30px 0;width:870px; font-size: 0px; position: absolute; position: absolute;}
.ft-button-slide { background: transparent; border-radius: 50%; margin: 0 5px; border: 2px solid #FFFFFF; border: 2px solid rgba(255,255,255,.5); width: 1px; height: 1px; display: inline-block;  }
.ft-button-slide-active { background: #FFFFFF; background: rgba(255,255,255,.7); }

#ft-title-slide{position:absolute;bottom:0pt;margin-left:400px;z-index:1000;opacity:1;width:500px;font-size:15px;}
#ft-title-slide blockquote{background:#EEEEEE;background:rgba(255, 255, 255, 0.70);color:#333333;font-size:17px;text-align:right;box-shadow:0 0 5px 0 #999999;border-left:10px solid #999999;border-right:10px solid #999999;}
#ft-title-slide blockquote h3{margin:0;}
#ft-title-slide blockquote:before{content:'';margin-right:0;}
#ft-title-slide blockquote:after{content:'';margin-left:0;}
#featured-boxs{padding:0;display:inline-block;text-align:left;}
.featured-box{width:210px;margin-left:30px;}
.featured-box h3{font-family:Verdana, Geneva, sans-serif;font-weight:100;font-size:15px;color:#555555;}
#featured-boxs h2{font-family:Verdana, Geneva, sans-serif;font-weight:100;font-size:19px;color:#555555;}
.featured-box-first{padding:20px 0;width:210px;margin:0;}
#featured-boxs img.box-image{border:3px solid #EEEEEE;width:202px;height:100px;}
#featured-boxs img.box-image:hover{box-shadow:0 0 11px 0px #555555;}
#featured-boxs img.box-icon{width:50px;height:50px;}
h3.featured-box2{width:140px;float:right;}
.featured-box,
.featured-box-first{display:inline;float:left;}
#customers-comment{font-size:17px;font-weight:bold;margin-top:20px;line-height:2;}
blockquote, q {background:#DDDDDD;background:none repeat scroll 0 0 rgba(255, 255, 255, 0.35);border-left:10px solid #ccc;margin:20px 10px;padding:10px;quotes:quotes:'<<' '>>';border-right:10px solid #ccc;}
blockquote:before, q:before {color:#ccc;content:'\201C';font-size:4em;line-height:.1em;margin-right:.20em;vertical-align:-.4em;}
blockquote:after, q:after {color:#ccc;content:'\201D';font-size:4em;line-height:.1em;margin-left:.20em;vertical-align:-.4em;}
blockquote p, q p {display:inline;}
#container .attachment-thumbnail{border:1px solid #AAAAAA;border-radius:3px 3px 3px 3px;margin:0px 15px 10px 0;padding:3px;float:left;}
#container .gallery .attachment-thumbnail{float:none;margin:5px auto;}
h1.page-title,
h1.arc-post-title{font-size:35px;text-shadow:-1px -1px 3px #FFFFFF;text-transform:uppercase;text-align:left;color:#45a9f6;}
h2.post-title,
h2.comments,
h3#reply-title,
h2.post-title-color{font-size:25px;margin-bottom:0;padding-bottom:10px;text-align:left;text-shadow:-1px -1px 3px #FFFFFF;text-transform:uppercase;}
.entrytext{padding:10px 0;}
h2.post-title a,
h2.post-title a:hover,
h2.comments a,
h2.post-title-color{color:#45a9f6;}
h3.arc-src{text-transform:uppercase;color:#F60;font-size:20px;}
h3 span{color:#777777;}
.post,
.hentry,
.no-results{margin-bottom:20px;}
.read-more{background:none repeat scroll 0 0 #EEEEEE;border:1px solid #C5C7C8;border-radius:10px 10px 10px 10px;box-shadow:0 0 3px 0 #C5C7C8;display:table;padding:5px 10px;margin-top:10px;}
.read-more a{color:#555555;}
.postmetadata{font-family:Arial, Helvetica, sans-serif;text-shadow:0 0 1px #FFFFFF;}
p.postmetadata{margin:0;}
.postmetadata a{color:#0387BF;}
.postmetadataw{letter-spacing:3px;font-weight:bold;}
.up-bottom-border{background:url("images/bottom.png") no-repeat scroll center bottom transparent;display:inline-block;margin-bottom:10px;padding:5px 0 25px 0;width:100%;border-top:1px solid #EEEEEE;}
.page-link{font-weight:bold;}
.page-link a{background:#AAAAAA;padding:0 5px;color:#FFFFFF;}
.floatleft{float:left;width:45%;text-align:left;}
.floatright{float:right;width:45%;text-align:right;}
#page-nav .alignright{text-align:right;}
#page-nav .alignleft{text-align:left;}
#page-nav a{border-width:1px;font-size:17px;font-weight:bold;padding:10px;}
#commentsbox .commentlist{margin:0;}
#commentsbox .watermark{color:rgba(150, 150, 150, 0.7);font-family:'Oswald',arial,serif;font-size:17px;text-align:center;text-shadow:none;text-transform:uppercase;}
#commentsbox .comment-author cite,
#commentsbox .comment-author cite a{color:#1072BC;letter-spacing:3px;font-style:normal;font-weight:bold;}
#commentsbox img.avatar{left:0;position:absolute;ttop:7px;}
#commentsbox ul.children{padding:0;}
.comment-body{padding:0 0 10px;}
#commentsbox .commentlist li.comment{border-top:1px solid #EEEEEE;line-height:19px;margin:0 0 24px;padding:5px 0 0 50px;position:relative;}
#comments .comment-body p:last-child{margin-bottom:6px;}
#commentsbox .comment-meta,
#commentsbox .comment-meta a:link,
#commentsbox .comment-meta a:visited{color:#AAAAAA;font-size:12px;padding-bottom:10px;text-shadow:none;}
#commentsbox .commentlist .children li{border-top:2px solid #FFFFFF;list-style:none outside none;margin:0 0 0 -25px;}
#commentsbox .commentlist li:last-child{border-bottom:medium none;ist-style:none outside none;}
#comment-form{max-width:550px;}
#respond .required{color:#ff4b33;font-weight:bold;position:absolute;}
#commentsbox ol.commentlist, #commentsbox li.commentlist{padding:0;list-style:none;}
#comments-list #respond{margin:0 0 18px 0;}
#comments-list ul #respond{margin:0;}
#cancel-comment-reply-link{font-weight:normal;line-height:18px;}
#respond input{margin:0 0 9px;}
#respond textarea{width:98%;}
#respond .form-allowed-tags{font-size:13px;line-height:18px;}
#respond .form-allowed-tags code{font-size:11px;}
#respond .form-submit{margin:12px 0;}
#respond .form-submit input{font-size:14px;width:auto;}
h2#client-text.post-title{color:#888A8A;opacity:0.7;padding:10px 0;text-align:center;}
#client{display:table;display:block\9;margin:20px auto;}
#client img{margin:0 13px;max-height:100px;vertical-align:middle;width:100px;}
#f-post-page { margin: 10px auto; width: 100%; font-size: 15px; cursor: pointer; text-align: center; font-weight: bold; }
#f-post-page-container { display: none; }
/* Text meant only for screen readers. */
.screen-reader-text { clip: rect(1px, 1px, 1px, 1px); position: absolute !important; height: 1px; width: 1px; overflow: hidden; }
.screen-reader-text:focus { background-color: #f1f1f1; border-radius: 3px; box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); clip: auto !important; color: #21759b;  display: block; font-size: 14px; font-size: 0.875rem; font-weight: bold; height: auto; left: 5px; line-height: normal; padding: 15px 23px 14px;  text-decoration: none; top: 5px; width: auto; z-index: 100000; /* Above WP toolbar. */ }

/* =Media Print
-------------------------------------------------------------- */
@media print {

h1 { page-break-before:always; }
h1,  h2,  h3,  h4,  h5,  h6 { page-break-after:avoid; }
ul,  ol,  dl { page-break-before:avoid; }
}

HTML for the slide show and heading text

get_header(); ?>
<div id="header-bottom"> </div>
<div id="container">
<h1 id="heading"><?php echo esc_textarea(simplify_get_option('heading-text', __('Welcome to the World of Creativity!','simplify'))); ?></h1>
<p class="heading-desc"><?php echo esc_textarea(simplify_get_option('heading-des', __('WordPress is web software you can use to create a beautiful website or blog. We like to say that WordPress is both free and priceless at the same time.','simplify'))); ?></p>

<div id="slide-container">
<div id="slide">
<img src="<?php echo esc_url(simplify_get_option('banner-image', get_template_directory_uri() . '/images/slide-image/slide-image1.jpg')); ?>" />
<?php if ( esc_url(simplify_get_option('slide-image', get_template_directory_uri() . '/images/slide-image/slide-image2.jpg')) != '' ) : ?>
<img src="<?php echo esc_url(simplify_get_option('slide-image', get_template_directory_uri() . '/images/slide-image/slide-image2.jpg')); ?>"  />
<?php endif; ?>
<?php if ( esc_url(simplify_get_option('extra-image', get_template_directory_uri() . '/images/slide-image/slide-image3.jpg')) != '' ) : ?>
<img src="<?php echo esc_url(simplify_get_option('extra-image', get_template_directory_uri() . '/images/slide-image/slide-image3.jpg')); ?>"  />
<?php endif; ?>
</div>
</div> <!-- slide-container -->

<?php get_template_part( 'featured-box' ); ?>

<br /><br /><div class="clear"></div><div class="content-ver-sep"></div><br />

<?php if (esc_html(simplify_get_option('fpost', '0')) != '1'):  get_template_part( 'front-page-blog' ); endif;?>

<?php if ( esc_textarea(simplify_get_option('bottom-quotation', __('All the developers of D5 Creation have come from the disadvantaged part or group of the society. All have established themselves after a long and hard struggle in their life ----- D5 Creation Team','simplify'))) != '' ) : ?>

<div id="customers-comment">
<blockquote><?php echo esc_textarea(simplify_get_option('bottom-quotation', __('All the developers of D5 Creation have come from the disadvantaged part or group of the society. All have established themselves after a long and hard struggle in their life ----- D5 Creation Team','simplify'))); ?></blockquote>
</div>
<?php endif; ?>

<?php get_footer(); ?>

HTML for the feature boxes (i.e Quality Hosting, Other Game servers):

<div id="featured-boxs">

<span class="featured-box-first"><h2><?php echo esc_textarea(simplify_get_option('featuredr-title', __('Recent Works','simplify'))); ?></h2><div class="content-ver-sep"></div><br /><p><?php echo esc_textarea(simplify_get_option('featuredr-description',  __('The Color changing options of Simplify will give the WordPress Driven Site an attractive look.','simplify'))); ?></p></span>
<?php
foreach (range(1, 3) as $fboxn) { ?>
<span class="featured-box">
<img class="box-image" src="<?php echo esc_url(simplify_get_option('featured-image' . $fboxn, get_template_directory_uri() . '/images/featured-image' . $fboxn . '.jpg')) ?>"/>
<h3><?php echo esc_textarea(simplify_get_option('featured-title' . $fboxn,  __('Simplify Theme for Small Business','simplify'))); ?></h3>
<div class="content-ver-sep"></div><br />
<p><?php echo esc_textarea(simplify_get_option('featured-description' . $fboxn ,  __('The Color changing options of Simplify will give the WordPress Driven Site an attractive look. Simplify is super elegant and Professional Responsive Theme which will create the business widely expressed.','simplify'))); ?></p>
</span>

<?php }

if ( esc_html(simplify_get_option('srfbox', '1')) == '1' ): echo '<div class="clear"></div><br /><div class="lsep"></div><br /><br />'; ?>
<br /><span class="featured-box-first"><h2><?php echo esc_textarea(simplify_get_option('featuredr2-title', __('Our Services','simplify'))); ?></h2><div class="content-ver-sep"></div><br /><p><?php echo esc_textarea(simplify_get_option('featuredr2-description', __('Simplify is super elegant and Professional Responsive Theme which will create the business widely expressed.','simplify'))); ?></p></span>
<?php  foreach (range(1, 3) as $fboxn2) { ?>
<span class="featured-box">
<img class="box-icon" src="<?php echo esc_url(simplify_get_option('featured-image2' . $fboxn2, get_template_directory_uri() . '/images/featured-image' . $fboxn2 . '.png')) ?>"/>
<h3 class="featured-box2"><?php echo esc_textarea(simplify_get_option('featured-title2' . $fboxn2, __('Simplify Theme for Business','simplify'))); ?></h3>

<div class="clear"> </div>
<p><?php echo esc_textarea(simplify_get_option('featured-description2' . $fboxn2 , __('Simplify is super elegant and Professional Responsive Theme which will create the business widely expressed. The Color changing options of Simplify will give the WordPress Driven Site an attractive look.','simplify'))); ?></p>

</span>

<?php }  ; endif; ?>

</div>

A: Finally figured out the issue.
It's a very "cheaty" way out but it works
@media screen and (-webkit-min-device-pixel-ratio:0) {
  #header-bottom{background:url("images/header-bottom.png") no-repeat scroll center top #3c4143;height:500px;margin:-7px 0 -540px;}
  #slide-container{width:930px;height:383px;background:url("images/sliderbottom.png") no-repeat scroll center bottom transparent;margin:40px 0;}
}


text:
Q: how can I add this object in an array? How can I add {[]} in an array?

A: @CertainPerformance is correct. You have to have an associated property if you want to have objects.
var a = [ { propertyName : [] } ]
then you can access that array like this :
a[0].propertyName or a[0]['propertyName']
And you can have multiple values inside the object too :
var a = [
          {
            propertyName_1 : [],
            propertyName_2 : "",
            propertyName_3 : 3,
          }
        ];

A: var a = [{}] // no problem, you are assigning an empty object `{}` as first element of array
var a = [[]] // no problem, you are assigning an empty array `[]` as first element of array
var a = [{[]}] // Not working because you're assigning empty array into object
               //object needs key to store value

var a = {[]} //Not ok <<======== have you ever see var a = { 1, 2, 3} ?

Please refer to documentation:

An object is a collection of properties, and a property is an association between a name (or key) and a value.


text:
Q: Issue with installing DeGruyter fonts I am trying to install fonts that are necessary to successfully compile a De Gruyter template using dgruyter.sty. I ran into issues when trying to compile the document. This is the error message:
! I can't find file `DGMetaSerifScience-Regular-tlf-t1'.
<*> ...de; input DGMetaSerifScience-Regular-tlf-t1

Please type another input file name
! Emergency stop.
<*> ...de; input DGMetaSerifScience-Regular-tlf-t1

Transcript written on mfput.log.
grep: DGMetaSerifScience-Regular-tlf-t1.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input DGMetaSerifScience-Regular-tlf-t1' failed to make DGMetaSerifScience-Regular-tlf-t1.tfm.
kpathsea: Appending font creation commands to missfont.log.

./book.tex:56: Font T1/DGMetaSerifScience-TLF/m/n/8.0=DGMetaSerifScience-Regula
r-tlf-t1 at 8.0299pt not loadable: Metric (TFM) file not found.
<to be read again>
                   relax
l.56 \maketitle

I am using TexShop on Mac.
Thank you for your help!


text:
Q: Regexp grabs only last digit I have a regexp like this
'#/somestring/[-a-z0-9]+([0-9]+)/#'

And string like this
http://www.localhost.dev/somestring/test-2014-test-153/

I need to grab "153" part of url, it's a post id, but now i grab only "3", last digit of id part.
I've tried to modify expression with "*", ".", "{1,}", but no success.
UPDATE:
Sorry, forgot to mention, 'somestring' part, must be checked too, it's a controller route.

A: What you need is this simple regex. It will work with or without trailing slash. 1st group will contain the number.
somestring\/.+?(\d+)\/?$

DEMO
(If the last segment of your test case isn't last, then you can use somestring\/.+?(\d+)\/ - DEMO)

A: Maybe this will fit your needs:
\-([0-9]+)\/

A: -(\d+)/

this will work, and also if you're in confusion try a site like
http://regexpal.com/

A: somestring\/.*?(\d+)[^\d]*$

try this.This will give the last integer irrespective of what's ahead.Just grab the capture.See demo.
http://regex101.com/r/nA6hN9/42


text:
Q: PhoneGap Android Barcode Scan UI modification Im currently using the Barcode Scanner from the open source library Zxing in my android project. The problem Im facing is concerning the scanning UI
When I launch the Scan window, it occupies the entire screen and Im not sure how to customize it - I would like to add a HTML back button in case the customer wants to scan or even better add the menu bar to be consistent with all other pages on my app ?
How do I add basic HTML elements in the scanning window ?

A: If you are just calling BarcodeScanner via an intent you have no control. However if you are embedding the Java code from the BarcodeScanner app in your app you have all the java code and xml resources available and can edit them how you like. It will all be Java and native Android resource stuff though.. not html.
If you are embedding the layout is
http://code.google.com/p/zxing/source/browse/trunk/android/res/layout/capture.xml
and the activity that does the scanning you want to edit is
http://code.google.com/p/zxing/source/browse/trunk/android/src/com/google/zxing/client/android/CaptureActivity.java
If you add a button in the layout and call finish in the OnClickListener you set up in the activity it would be a back as you desire..


text:
Q: D3 js orgchart plugin with mixed hierarchy Is there any js plugin available to render mixed hierarchy like the attached image.
I am looking for below features

*

*on demand loading

*mixed hierarchy

*node customization

*zooming and panning

*json data support

A:
GetOrgChart is exactly what you are looking for
on demand loading
node customization
json data support
mixed hierarchy - it supports different of orientation for example from left to right or from bottom to top
zooming and panning - scroll up/down with the mouse and use the keyboard kes to navigate


text:
Q: Does new 'dynamic' variable type in .NET 4.0 solve the single/multiple method dispatch issue in CLR? The problem of single dispatch is mostly familiar to people engaged in coding with statically typed languages like Java and C#. The basic idea is:
While the runtime polymorphism allows us to dispatch to the right method call according to the type (runtime type) of receiver, for example:
IAnimal mything = new Cat();
mything.chop();

The method call will be performed according to the runtime type of mything, namely Cat.
This is the single dispatch capability (which is present in Java/C#).
Now, if you need to dispatch not only on the runtime type of receiver, but on the types of (multiple) arguments either, you face a little problem:
public class MyAcceptor {
    public void accept (IVisitor vst) {...}
    public void accept (EnhancedConcreteVisitor vst) {...}
}

The second method never gets called, because in our 'consumer' code we just tend to treat different types of objects (visitors in my example) by their common supertype or interface.
That's why I ask - because dynamic typing allows the multiple dispatch polymorphism and C# 4.0 has that dynamic keyword ;)

A: Yes, dynamic typing allows multiple dispatch - and no, you don't have to create your own dynamic object to do it.
Suppose we wanted to implement Enumerable.Count() ourselves, and we didn't want a load of "if (source is IList)"  tests in our code. We could write it like this:
public static class Enumerable
{
    public static int Count<T>(this IEnumerable<T> source)
    {
        dynamic d = source;
        return CountImpl(d);
    }

    private static int CountImpl<T>(ICollection<T> collection)
    {
        return collection.Count;
    }

    private static int CountImpl(ICollection collection)
    {
        return collection.Count;
    }

    private static int CountImpl<T>(string text)
    {
        return text.Length;
    }

    private static int CountImpl<T>(IEnumerable<T> source)
    {
        // Fallback
        int count = 0;
        foreach (T t in source)
        {
            count++;
        }
        return count;
    }
}

I'm not saying it would be a good idea, but that's how it would work :)
Note that you need to be careful not to introduce situations where you could end up with an ambiguous call for some types. This wouldn't be an issue using classes for parameters, but consider that a single class can implement multiple interfaces.

A: Yes, you can create DLR types that do arbitrarily complex dispatch. Check out http://msdn.microsoft.com/en-us/library/system.dynamic.dynamicobject.aspx


text:
Q: LED with a transistor on each side I'm trying to make a circuit with a transistor on each side of an LED so it only lights up when both transistors are activated.
The transistors need to be on either side of the LED because the LED is part of a small LED grid display and one transistor controls the vertical line (which the anode is connected to) and the other transistor controls the horizontal line (which the cathode is connected to)
Here is the simple circuit I came up with:

Seems to me like it should work, but it doesn't. Applying a voltage to Va and Vb doesn't light up the LED. I'm pretty new to electronics, so I'm sure I'm missing something simple. Is there something obiously wrong with this circuit? (adding a resistor in series with the LED doesn't help)

A: Something like this may work for you (2 x 2 matrix shown). Part numbers and values are placeholders, but you'd normally want the drivers without series resistors to have lower base resistors because they're going to be handling much more current than the other transistors (but for much less time). The drive voltage for the high side drivers (PNP transistors) has to swing up to the +5V supply in this case to turn them off.

simulate this circuit – Schematic created using CircuitLab

A: Your Va is too low. It should be at least a volt higher than Vcc, and maybe 2 or 3, depending on your base resistor and LED current.
This is the classical problem with making a high side driver.

A: A simple transistor and gate. Both must be driven high to conduct, turning on the led.

simulate this circuit – Schematic created using CircuitLab

The transistors need to be on either side of the LED because the LED is part of a small LED grid display and one transistor controls the vertical line (which the anode is connected to) and the other transistor controls the horizontal line (which the cathode is connected to)

I don't get why you think this.


text:
Q: OpenCV on Android converting to grayscale not working I am trying to convert some OpenCV Mat to grayscale for Contours detection algorithms. For some reason the image after convertion is all black. Mine code (b is Android Bitmap):
Mat tmp = new Mat (b.getWidth(), b.getHeight(), CvType.CV_8UC1);
Utils.bitmapToMat(b, tmp);
Imgproc.cvtColor(tmp, tmp, Imgproc.COLOR_BGR2GRAY);
//there could be some processing
Imgproc.cvtColor(tmp, tmp, Imgproc.COLOR_GRAY2BGRA, 4);
Utils.matToBitmap(tmp, b);

And now I am drawing this bitmap and it is all black. When I applied contour detection to this bitmap (in place of comment) there were no match, so I assume problem is with convertion. After removing convertion (simply call bitmapToMat and matToBitmap) then bitmap is not all black so convertion to Mat are also working. Bitmap is in ARGB_8888 and there are no errors, just the output bitmap is all black.
Edit: Just to be sure I tried to save a bitmap with ocv imwrite - it's still all black so the problem is for 100% at cvtColor...

A: If the bitmap b is from the android device, then try using COLOR_RGB2GRAY instead of COLOR_BGR2GRAY because BGR is the default pixel format for OpenCV images, not all images.
Try this code:
Mat tmp = new Mat (b.getWidth(), b.getHeight(), CvType.CV_8UC1);
Utils.bitmapToMat(b, tmp);
Imgproc.cvtColor(tmp, tmp, Imgproc.COLOR_RGB2GRAY);
//there could be some processing
Imgproc.cvtColor(tmp, tmp, Imgproc.COLOR_GRAY2RGB, 4);
Utils.matToBitmap(tmp, b);

A: I tried this method and it works perfectly, first you must convert it into grey scale, then to Canny, and finally to Bitmap.
this function returns a black and white image.
public static Bitmap edgesim(Mat img1) {

Bitmap image1;

//mat gray img1 holder
Mat imageGray1 = new Mat();

//mat canny image
Mat imageCny1 = new Mat();

//mat canny image
Mat imageCny2 = new Mat();

/////////////////////////////////////////////////////////////////

//Convert img1 into gray image
Imgproc.cvtColor(img1, imageGray1, Imgproc.COLOR_BGR2GRAY);

//Canny Edge Detection
Imgproc.Canny(imageGray1, imageCny1, 10, 100, 3, true);

///////////////////////////////////////////////////////////////////

//////////////////Transform Canny to Bitmap/////////////////////////////////////////
image1= Bitmap.createBitmap(imageCny1.cols(), imageCny1.rows(), Bitmap.Config.ARGB_8888);
Utils.matToBitmap(imageCny1, image1);

return image1;

}