text:
Q: Getting Custom Properties value in Test Report from Project Level Tear Down Script I have used the below code for Test Report Generation at Project Level Tear Down Script in SOAP UI Open Source version. I want to modify the report by adding Project level "Custom Properties" value to be displayed in the Report. I have tried but not able to get the Custom Properties in the report.
It will be very helpful if somebody could resolve this.
/**
*
* Below is the TearDown script for SoapUI Project level
* Which create a custom report in a  given file
* Modify the variable "reportFileName" below
*
**/
 //Modify the file as needed for report file
//def reportFileName = '/tmp/abctestreport.txt'
//Adding the below as user wants specific directory
//Get the project path

def dataFolder =  new com.eviware.soapui.support.GroovyUtils(context).projectPath

//Create today's date for storing response
def today = new Date().format("yyyy-MM-dd")

def filePrefix = "${dataFolder}/TestReports/Automation${today}" as String

def fileNamePart = new Date().format("yyyy-MM-dd'T'HH.mm.ss")

//creating filename dynamically.
def reportFileName = "${filePrefix}/Automation_TestReport_${fileNamePart}.txt" as String

//NOTE: Not required to edit beyond this point

/**
* This class holds the test case details
**/
class TestCaseResultHolder {
def log
Map<String, String> properties = [:]
boolean status

def createProperties(testCase) {
    testCase.getPropertyNames().each { key ->
        properties[key] = testCase.getPropertyValue(key)
    }
}

def getCaseResult(caseRunner, caseName) {
    log.info "Checking test case status ${caseName}"
    if ( caseRunner.status.toString() == 'FAILED' ){
        log.error "Test case $caseName has failed"
        for ( stepResult in caseRunner?.results ){
            stepResult.messages.each() { msg -> log.info msg }
        }
        return false
    } else {
        log.info "${caseName} is passed"
    }
    true
}

    def buildCaseResult(caseRunner, caseName) {
        status = getCaseResult(caseRunner, caseName)
        if (!status) {
        createProperties(caseRunner.testCase)
        }
    }

}

/**
* This class holds the test suite details
**/
class SuiteResultsHolder {

def log
Map<String, TestCaseResultHolder> casaeResults = [:]
int testCaseCount = 0
int passedCasesCount = 0
int failedCasesCount = 0

def buildSuiteResults(suiteRunner, suiteName){
    log.info "Building results of test suite ${suiteName}"
    for ( caseRunner in suiteRunner?.results ) {
        def caseName = caseRunner.testCase.name
        testCaseCount++
        def tcHolder = new TestCaseResultHolder(log: log)
        tcHolder.buildCaseResult(caseRunner, caseName)
        casaeResults[caseName] = tcHolder
        if (tcHolder.status) {
            passedCasesCount++
        } else {
            failedCasesCount++
        }
    }
}

    def getStatus() {
       (0 < failedCasesCount) ? false : true
    }

}

/**
* This class holds the project details
**/
class ProjectResultsHolder {

def log
Map<String, SuiteResultsHolder> suiteResults = [:]
int suiteCount = 0
int passedSuitecount = 0
int failedSuiteCount = 0

def buildProjectResults(projectRunner, projectName) {
    log.info "Building results of test project ${projectName}"
    for(suiteRunner in projectRunner?.results) {
        def suiteName =  suiteRunner.testSuite.name
        suiteCount++
        def suiteResultsHolder = new SuiteResultsHolder(log: log)
        suiteResultsHolder.buildSuiteResults(suiteRunner, suiteName)
        suiteResults[suiteName] = suiteResultsHolder
        if (suiteResultsHolder.status) {
            passedSuitecount++
        } else {
            failedSuiteCount++
        }
    }
}

    def getStatus() {
        (0 < failedSuiteCount) ? false : true
    }

}

//Get the status string based on boolean
def getResult(status){ status == true ? 'SUCCEED' : 'FAILED'}

 //Draws a line
def drawLine(def letter = '=', def count = 70) { letter.multiply(count)}

//Gets the summary report
def getSummaryReport(project, projectResultHolder) {
    def report = new StringBuffer()
    report.append(drawLine()).append('\n')
    report.append("\t\t\tTest Execution Summary\n")
    report.append(drawLine('-', 60)).append('\n')
    report.append("Project : ${project.name}\n")
    report.append("Result : ${getResult(projectResultHolder.status)}\n")
    report.append("Total test suites executed: ${projectResultHolder.suiteCount}\n")
    report.append("Test suites passed: ${projectResultHolder.passedSuitecount}\n")
    report.append("Test suites failed: ${projectResultHolder.failedSuiteCount}\n")
    report.append(drawLine()).append('\n')
    report
}

//Gets the test case report
def getTestCaseReport(testCaseReport) {
    def report = new StringBuffer()
    report.append(drawLine('-', 60)).append('\n')
    report.append("\t\tTest Case Details:\n")
    report.append(drawLine('-', 60)).append('\n')
      testCaseReport.each { kase, tcReport ->
      report.append("Name : ${kase}\n")
      report.append("Status : ${getResult(tcReport.status)}\n")
        if (!tcReport.status) {
            report.append("Properties : ${tcReport.properties.toString()}\n")
        }
    }
    report
}

//Get the detailed report
def getDetailedReport(projectResultHolder) {
def report = new StringBuffer()
report.append(drawLine()).append('\n')
report.append("\t\t\tTest Execution Detailed Report\n")
report.append(drawLine()).append('\n')
projectResultHolder.suiteResults.each { suite, details ->
    report.append("Test Suite : ${suite}\n")
    report.append("Result : ${getResult(details.status)}\n")
    report.append("Total Cases : ${details.testCaseCount}\n")
    report.append("Cases Passed : ${details.passedCasesCount}\n")
    report.append("Cases Failed: ${details.failedCasesCount}\n")
    report.append(getTestCaseReport(details.casaeResults))
    report.append(drawLine()).append('\n')
    report.append(drawLine()).append('\n')
    }
    report
}

//Save the contents to a file
def saveToFile(file, content) {
    if (!file.parentFile.exists()) {
        file.parentFile.mkdirs()
        log.info "Directory did not exist, created"
    }
    file.write(content)
    assert file.exists(), "${file.name} not created"
}

def holder = new ProjectResultsHolder(log: log)
holder.buildProjectResults(runner, project.name)

def finalReport = new StringBuffer()
finalReport.append(getSummaryReport(project, holder))
finalReport.append(getDetailedReport(holder))

def reportFile = new File(reportFileName)
saveToFile(reportFile, finalReport.toString())

A: below is the code snippet you can use. Screenshot shows I have used this script in project teardown script.
Integrate the below code, add/append to StringBuffer "finalReport.append()" Content as per your requirement.
    List<String> plist = project.getPropertyNames()
    plist.each{it -> log.info "key = "+ it.toString()
//finalReport.append("key = "+ it.toString())
    log.info "Value ="+project.getPropertyValue(it.toString())}

accept the solution if it works for you , it will also help others

A: The post is very old, but if someone is searching a solution, after tryng different ways, the following code finally works for me:
    def createProperties(testCase) {
        // 'Properties' must match your step properties-box name you assigned,
        // by the way default value is just 'Properties'
        if (testCase.testSteps["Properties"]){
            testCase.testSteps["Properties"].getPropertyNames().each { key ->
                properties[key] = testCase.testSteps["Properties"].getPropertyValue(key)
                log.info "Created properties ${key} = " + properties[key]
            }
        }
    }


text:
Q: Evaluate $\lim_{(x,y) \to (0,0), x+y \neq 0}{\frac{\ln(1-x-y)}{x+y} } $ This was the question of a test. My question is if my attempt to solve it is correct, and if it is, why is it correct.
$$\lim_{(x,y) \to (0,0), x+y \neq 0}{\frac{\ln(1-x-y)}{x+y} } $$
My attempt:
Let $\xi = -x-y $. Then $\xi \to 0$ whenever $(x,y) \to (0,0)$ and $x+y \neq 0 \iff \xi \neq 0$. (Is it then correct to say that the previous limit exists and is equal to the following iff the following exists? And why?):
$$\lim_{\xi \to 0, \xi \neq 0}{\frac{\ln(1+\xi )}{-\xi}}$$
If it is correct, then the limit exists and is $-1$. If it is correct, why is it correct?

A: We want to show that $\forall \epsilon \gt 0 : \exists \delta \gt 0 : ||(x,y)||< \delta \implies |\frac{\ln(1-x-y)}{x+y}+1| \lt \epsilon$.
Fix $\epsilon \gt 0$. We know that $\lim_{\phi \to 0} \frac{ln(1+\phi)}{-\phi} = -1$. So there's $\delta_1 \gt 0$ such that $|\phi| \lt\delta_1 \implies |\frac{ln(1+\phi)}{-\phi}+1| \lt \epsilon$. Let $\delta = \delta_1$ and $\xi = -x-y$. Suppose $||(x,y)|| \lt \delta $. Since all norms in $R^n$ are equivalent we can use the norm of the sum. Then:
$||(x,y)|| = |x|+|y| \geq |x+y| = |\xi|$. Since $|\xi| < \delta_1 $, then $|\frac{ln(1+\xi)}{-\xi}+1| < \epsilon$ therefore $|\frac{ln(1-x-y)}{x+y}+1| < \epsilon  $. $\square$

redpajama_set_name: RedPajamaStackExchange


text:
Q: A placement code is saying that 'attempt to index nil with 'GetMouse'' and I have not got any variable codes after a code that needs it I have already tried the answer to one of my other questions but it didn't work. I'm quite new to Lua so maybe I'm missing something.
local player = game.Players.LocalPlayer
local Mouse = player.GetMouse()
local Block = game.ServerStorage.Experimental

Mouse.Button1Down(place)

function place()
    Mouse.Hit.X = PosX
    Mouse.Hit.Y = PosY
    Mouse.Hit.Z = PosZ

    PlacedBlock = Block:Clone()
    PlacedBlock.Parent = game.Workspace
    PlacedBlock.Position = Vector3.new(PosX,PosY,PosZ)
end

A: The simple error here is you used . instead of : while calling GetMouse(). Once you replace that your code should work just fine :D

A: local player = game.Players.LocalPlayer
local Mouse = player:GetMouse()
local Block = game.ServerStorage.Experimental

function place()
    PlacedBlock = Block:Clone()
    PlacedBlock.Parent = workspace
    PlacedBlock.Position = Mouse.Hit.p
end

Mouse.MouseButton1Click:Connect(place)

This should work!


text:
Q: Adding list-unsubscripe header to email through SendGrid Marketing API We are using SendGrid Marketing Email API for pushing newsletters to our subscribers, and wish to include a custom list-unsubscribe header in each of the emails. However I cannot see any API method supporting adding headers to the message. Am I completely blind or are there just no methods for adding custom headers to SendGrid emails?
Thank you
Brgds
Lukas

A: You can add custom header via their Web API with the header argument (must be in valid JSON format without integers), as described in their doc:

POST:     https://api.sendgrid.com/api/mail.send.json
POST Data:

api_user=your_sendgrid_username&api_key=your_sendgrid_password&to=destination@example.com&toname=Destination&subject=Example_Subject&text=testingtextbody&from=info@domain.com&header={"List-Unsubscribe": "unsubscribe_email@your_domain"}

A: If you're using the Marketing Email API there is no way to intercept the email and add headers to it at the moment.
You could do this if you were just using the Marketing Email API to manage lists and then sending the emails yourselves through SendGrid, because you could then build out the headers however you wanted.
For Marketing Emails, the list-unsubscribe header is automatically set by the Unusubscribe Application, as detailed in this Knowledge Base article.

A: When using the Marketing Email platform, you cannot add custom headers; you can do that with the main Web or SMTP API only. However, if you're using the main Web or SMTP API, you can specifically use Substitution Tags in the List-Unsubscribe field, for easy customization.


text:
Q: ImportError with bob.core: OSError: bob/core/libbob_core.so: undefined symbol: _ZN5boost9iostreams4zlib8deflatedE Python bob.core import error:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/project/local/lib/python2.7/site-packages/bob/core/__init__.py", line 3, in <module>
    bob.extension.load_bob_library('bob.core', __file__)
  File "/project/local/lib/python2.7/site-packages/bob/extension/__init__.py", line 244, in load_bob_library
    ctypes.cdll.LoadLibrary(full_libname)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 440, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 362, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /project/local/lib/python2.7/site-packages/bob/core/libbob_core.so: undefined symbol: _ZN5boost9iostreams4zlib8deflatedE

I have got no idea how  to resolve this. All efforts for help are appreciated.

A: You are probably having a C++ ABI compatibility issue introduced in gcc 5. Try exporting these variables either to 0 or 1. One of them might work depending on your system:
export CFLAGS="${CFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0"
export CXXFLAGS="${CXXFLAGS} -D_GLIBCXX_USE_CXX11_ABI=0"

You need to export theses before doing pip installation of any packages (bob.extension, bob.blitz).
Although as I said in the bob-devel mailing list. It is better to use our conda installation: https://www.idiap.ch/software/bob/install


text:
Q: One Dimension Wave Equation (Calculus of several variables) I can't find any way to get to that expression. Honestly I don't how to start this. Any recommendations?
Consider the One Dimension Wave Equation
$$
\frac{\partial^{2} u}{\partial t^{2}}=c^{2} \frac{\partial^{2} u}{\partial x^{2}}
$$
where $u:=u(x, t) .$ If now we make a change of variable $\xi=x+c t, \eta=x-c t,$ show that the wave equation can be written as $$\frac{\partial^{2} u}{\partial \eta \partial \xi}=0$$

A: The solution is quite simple: Try to substitude $\xi$ and $\eta$ in
$\frac{\partial^2 u}{\partial \eta \partial \xi}=0$,
with the given relations and try to recover your first equation. The rest is up to you. It is done in one second.
Regards

A: If you want to approach this from the other direction and take the brute force approach, note that by the chain rule,

*

*$\frac{\partial u}{\partial t} = \frac{\partial u}{\partial \eta}\frac{\partial \eta}{\partial t}+\frac{\partial u}{\partial \xi}\frac{\partial \xi}{\partial t}$,

*$\frac{\partial u}{\partial x} = \frac{\partial u}{\partial \eta}\frac{\partial \eta}{\partial x}+\frac{\partial u}{\partial \xi}\frac{\partial \xi}{\partial x}$.

Since $\xi=x+c t, \eta=x-c t$,
$
\frac{\partial \eta}{\partial t}=-c, \frac{\partial \eta}{\partial x}=1,\\
\frac{\partial \xi}{\partial t}=c, \frac{\partial \xi}{\partial x}=1.
$
Replacing these in the first two equations:

*

*$\frac{\partial u}{\partial t} = -c\frac{\partial u}{\partial \eta}+c\frac{\partial u}{\partial \xi}$,

*$\frac{\partial u}{\partial x} = \frac{\partial u}{\partial \eta}+\frac{\partial u}{\partial \xi}$.

Now, take the derivatives again,

*

*$\frac{\partial^2 u}{\partial t^2} = -c\frac{\partial^2 u}{\partial \eta \partial t}+c\frac{\partial^2 u}{\partial \xi \partial t}$,

*$\frac{\partial^2 u}{\partial x^2} = \frac{\partial^2 u}{\partial \eta \partial x}+\frac{\partial^2 u}{\partial \xi \partial x},$
and use the chain rule again:

*

*$\frac{\partial^2 u}{\partial t^2} = c^2\frac{\partial^2 u}{\partial^2 \eta}-c^2\frac{\partial^2 u}{\partial \eta \partial \xi}-c^2\frac{\partial^2 u}{\partial \xi \partial \eta}+c^2\frac{\partial^2 u}{\partial^2 \xi }$,

*$\frac{\partial^2 u}{\partial x^2} = \frac{\partial^2 u}{\partial^2 \eta} +\frac{\partial^2 u}{\partial \eta \partial \xi} +\frac{\partial^2 u}{\partial \xi \partial \eta} +\frac{\partial^2 u}{\partial^2 \xi}$.

Finally, replace these in
$$\frac{\partial^{2} u}{\partial t^{2}}=c^{2} \frac{\partial^{2} u}{\partial x^{2}}$$
to get
$$ c^2\frac{\partial^2 u}{\partial^2 \eta}-c^2\frac{\partial^2 u}{\partial \eta \partial \xi}-c^2\frac{\partial^2 u}{\partial \xi \partial \eta}+c^2\frac{\partial^2 u}{\partial^2 \xi } = \frac{\partial^2 u}{\partial x^2} = c^2\frac{\partial^2 u}{\partial^2 \eta} +c^2\frac{\partial^2 u}{\partial \eta \partial \xi} +c^2\frac{\partial^2 u}{\partial \xi \partial \eta} +c^2\frac{\partial^2 u}{\partial^2 \xi},$$ which simplifies to
$$\frac{\partial^2 u}{\partial \xi \partial \eta}=0$$
after cancellations.


text:
Q: How do we know if a table is managed table or external able? In hive when I run show tables; I get the list of all the tables, how do I know which of these are managed tables and which are external tables?

A: You can use the following command to get details of specified table:
describe formatted <your_table>;

The output will contain a row describing table type:

Table Type:           EXTERNAL_TABLE

or

Table Type:           MANAGED_TABLE

A: For a single table you can use desc formatted or desc extended
Demo
create table mytable (i int);
create external table myexttable (i int);

desc formatted
hive> desc formatted mytable;
...
Location:               hdfs://horton/user/dmarkovitz/mytable
Table Type:             MANAGED_TABLE
Table Parameters:
...

hive> desc formatted myexttable;

...
Location:               hdfs://horton/user/dmarkovitz/myexttable
Table Type:             EXTERNAL_TABLE
Table Parameters:
...

desc extended
hive> desc extended mytable;
...
Detailed Table Information      Table(tableName:mytable ... tableType:MANAGED_TABLE)

hive> desc extended myexttable;
...
Detailed Table Information      Table(tableName:myexttable ... tableType:EXTERNAL_TABLE)

For many/all tables, you can query the metastore (Hive metadata database).
metastore
(In this demo the metastore is in mysql)
select  d.name          as database_name
       ,t.tbl_name
       ,t.tbl_type

from            metastore.DBS   as d

        join    metastore.TBLS  as t

        on      t.DB_ID =
                d.DB_ID

where   d.name = 'dmarkovitz'
;

+---------------+------------+----------------+
| database_name |  tbl_name  |    tbl_type    |
+---------------+------------+----------------+
| dmarkovitz    | mytable    | MANAGED_TABLE  |
| dmarkovitz    | myexttable | EXTERNAL_TABLE |
+---------------+------------+----------------+

FYI, the EXTERNAL/MANAGED property is nothing but a flag (metadata level) and it can be changed using ALTER TABLE command
hive
alter table mytable set tblproperties ("EXTERNAL"="TRUE");
alter table myexttable set tblproperties ("EXTERNAL"="FALSE");

metastore
select  d.name          as database_name
       ,t.tbl_name
       ,t.tbl_type

from            metastore.DBS   as d

        join    metastore.TBLS  as t

        on      t.DB_ID =
                d.DB_ID

where   d.name = 'dmarkovitz'
;

+---------------+------------+----------------+
| database_name |  tbl_name  |    tbl_type    |
+---------------+------------+----------------+
| dmarkovitz    | mytable    | EXTERNAL_TABLE |
| dmarkovitz    | myexttable | MANAGED_TABLE  |
+---------------+------------+----------------+


text:
Q: How to fix small but relevant Python errors? I'm currently attempting to make a coding program, imitating the "Library of Babel" website. Basically what it does now, is it generates a pseudo random string of letters based on a kew, and allows the user to search the "library" for a string (right now, this only allows for a maximum of four characters). The searching is where I have the trouble. Basically how I run the function (see below) is by finding a "key" value which will output a certain string. However sometimes when search for strings higher up in the alphabet, the key returns an altered string
(i.e. "lurz--> lury","zzzz--> zzzy").
IMPORTANT EDIT: if you try to run the code, ignore the random letters: the error comes after you enter a search term (this only shows up after you enter the original key). If you re-input the key you get from the search term in the key input, the first four letters of the random letters you get back SHOULD be your search input.
This seems to me like a rounding error- my code is attached below. How can I fix this?
from __future__ import division
import math
__author__ = 'asaflebovic'
def getFactor(x, var):
    facs = []
    i = 0
    while i < x/2:
        if i % x ==0:
            facs.append(i)
            i = i+1
            print(i)
        print(i)
        i= i + 1
    var = max(facs)
def getRandStr(x,y):
    x = float(x)
    x = ((1664525*x + 1013904223)) % 4294967296
    #print(x)
    nums = [x]
    for i in range(1,2000):
        x = ((1664525*nums[i-1] + 1013904223)) % 4294967296
        nums.append(x)
    #print(nums)
    hold = ''.join(str(e) for e in nums)
    hold = (str(hold).replace('.', ''))
    hold = str(hold)
    hold2 = ""
    count = 0
    count2 = ""
    #print(hold)
    mssg = []
    for i in range(1,(int(math.ceil(len(hold)/2)))):
        count = hold[(2*i)-2]
        count2 = count
        #print("countval:" + count)
        count = hold[(2 * i) - 1]
        #print("countval:"+count)
        count2 = count2 + count
        #print("count2val:"+count2)
        hold2 = str(count2)
        hold2 = int(hold2) % len(abc)
        #print("each letter:"+abc[int(hold2)])
        mssg.append(abc[hold2])
    print(''.join(str(e) for e in mssg))
def getAndCheck(x):
    holding = []
    mods = []
    cells = {}
    for i in range(0,len(x)):
        if x[i] in abc:
            holding.append(((((len(abc)))+((abc.index(x[i]))%len(abc)))))
            #print(len(abc))
            #print((len(abc))+(abc.index(x[i])))
            #print("in abc, it is "+str(holding))
        else:
            print("error: not found")
    #print("len: "+str(len(holding)))
    for i in range(0, len(holding)):
        cells[((i + 4) - (i % 4)) / 4] = ""
    for i in range(0, len(holding)):
        cells[((i+4)-(i%4))/4] = str(cells[((i+4)-(i%4))/4])+str(holding[i])
        #print("dict is: "+str(cells))
    holding = 0
    print(holding)
    newkey = (int(cells[1]) + 4294967296 - 1013904223) / 1664525
    print(newkey)
    newmul = {}
    for i in range(1,len(cells)):
        newmul[i]=[((1664525 * ((int(cells[i])+1013904223)) - 4294967296))]
    print(newmul)

    print("Your key is "+str(newkey)+". DON'T LOSE IT.")
    exacts = {}
    for i in range (1, int(math.ceil(len(newmul)/4))):
        exacts[(i+4)/4] = ""
abc = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
       "w", "x", "y", "z", " ", "?", "!", "-", ",", "."]
key = input("Key: ")
library = ""
#s = raw_input("Would you like a random, or exact location? (R or E)")
#if s.upper() == "E":
    #section = input("section: ")
    #shelf = input("shelf: ")
    #volume = input("volume: ")
    #page = input("page: ")
    #library = section + shelf + volume + page
getRandStr(key, library)
key = input("Search")
getAndCheck(key)


text:
Q: Difficulty loading a texture and passing it to a class in XNA 4.0 This is an assignment for a c#/XNA 4.0 class, and no, I'm not a HWgrade-zombie. I'd let you know the circumstances for my asking about this, the amount of "research" I've done, and that I wish to learn rather than get a grade, but it'd be considered fluff and deleted.
Anyhow, the problem I'm having is that my content (a sprite sheet) which I'm trying to load into "textureImage" in Game1.cs, which is then passed to "Sprite.cs" to be drawn, via "userControlledSprite.cs", isn't being drawn when I compile my program. Being new to c# and XNA both, I understand the issue (that the content loads, but isn't passed correctly), but I'm lost regarding a way to address it.
Here are the full three classes that my program consists of:
Game1.cs -- Calls the userControlledSprite.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Audio;
    using Microsoft.Xna.Framework.Content;
    using Microsoft.Xna.Framework.GamerServices;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    using Microsoft.Xna.Framework.Media;

    namespace Proj06
    {
        public class Game1 : Microsoft.Xna.Framework.Game
        {
           GraphicsDeviceManager graphics;
           SpriteBatch spriteBatch;

            static Texture2D textureImage;
            static Point frameSize = new Point(52,50);
            static Point currentFrame = new Point(0, 0);
            static Point sheetSize = new Point(4, 1);
            static Vector2 position = Vector2.Zero;
            static int collisionOffset = 1;
            static Vector2 speed;

           userControlledSprite UserControlledSprite1;

        public Game1()
        {
           graphics = new GraphicsDeviceManager(this);
           Content.RootDirectory = "Content";
        }

        protected override void Initialize()
        {
           base.Initialize();
        }

        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            textureImage = Content.Load<Texture2D>(@"images/Picture");
            UserControlledSprite1 = new userControlledSprite(textureImage, position, frameSize, collisionOffset, currentFrame, sheetSize, speed);
        }

        protected override void UnloadContent()
        {
          /// Ignore this void
        }

        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                this.Exit();

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.White);
            UserControlledSprite1.Draw(gameTime, spriteBatch);
            base.Draw(gameTime);
        }
    }
}

Sprite.cs -- Draws and animates the sprite, as well as checks for collisions.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Audio;
    using Microsoft.Xna.Framework.Content;
    using Microsoft.Xna.Framework.GamerServices;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    using Microsoft.Xna.Framework.Media;

    namespace Proj06
    {
       abstract class Sprite
        {
            Texture2D textureImage;
            protected Point frameSize;
            Point currentFrame;
            Point sheetSize;
            int collisionOffset;
            int timeSinceLastFrame = 0;
            int millisecondsPerFrame;
            const int defaultMillisecondsPerFrame = 16;
            protected Vector2 speed;
            protected Vector2 position;

            public Sprite(Texture2D textureImage, Vector2 position, Point frameSize,
                int collisionOffset, Point currentFrame, Point sheetSize, Vector2 speed)
                : this(textureImage, position, frameSize, collisionOffset, currentFrame,
                sheetSize, speed, defaultMillisecondsPerFrame)
            {
            }

            public Sprite(Texture2D textureImage, Vector2 position, Point frameSize,
                int collisionOffset, Point currentFrame, Point sheetSize, Vector2 speed,
                int millisecondsPerFrame)
            {
                this.textureImage = textureImage;
                this.position = position;
                this.frameSize = frameSize;
                this.collisionOffset = collisionOffset;
                this.currentFrame = currentFrame;
                this.sheetSize = sheetSize;
                this.speed = speed;
                this.millisecondsPerFrame = millisecondsPerFrame;
            }

            public virtual void Update(GameTime gameTime, Rectangle clientBounds)
            {
                timeSinceLastFrame += gameTime.ElapsedGameTime.Milliseconds;
                if (timeSinceLastFrame > millisecondsPerFrame)
                {
                    timeSinceLastFrame = 0;
                    ++currentFrame.X;
                    if (currentFrame.X >= sheetSize.X)
                    {
                        currentFrame.X = 0;
                        ++currentFrame.Y;
                        if (currentFrame.Y >= sheetSize.Y)
                        {
                            currentFrame.Y = 0;
                        }
                    }
                }
            }

            public virtual void Draw(GameTime gameTime, SpriteBatch spriteBatch)
            {
                spriteBatch.Begin();

                spriteBatch.Draw(textureImage,
                    position,
                    new Rectangle(currentFrame.X * frameSize.X,
                        currentFrame.Y * frameSize.Y,
                        frameSize.X, frameSize.Y),
                        Color.White, 0, Vector2.Zero,
                        1f, SpriteEffects.None, 0);

                spriteBatch.End();
            }

            public abstract Vector2 direction
            {
                get;
            }

            public Rectangle collisionRect
            {
                get
                {
                    return new Rectangle(
                        (int)position.X + collisionOffset,
                        (int)position.Y + collisionOffset,
                        frameSize.X - (collisionOffset * 2),
                        frameSize.Y - (collisionOffset * 2));
                }
            }
        }
    }

and userControlledSprite.cs -- deals with the sprite's movement and position
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;

    namespace Proj06
    {
        class userControlledSprite : Sprite
        {
            public userControlledSprite(Texture2D textureImage, Vector2 position,
                Point frameSize, int collisionOffset, Point currentFrame, Point sheetSize,
                Vector2 speed)
                : base(textureImage, position, frameSize, collisionOffset, currentFrame,
                sheetSize, speed)
            {
            }

            public userControlledSprite(Texture2D textureImage, Vector2 position,
                Point frameSize, int collisionOffset, Point currentFrame, Point sheetSize,
                Vector2 speed, int millisecondsPerFrame)
                : base(textureImage, position, frameSize, collisionOffset, currentFrame,
                sheetSize, speed, millisecondsPerFrame)
            {
            }

            public override Vector2 direction
            {
                get
                {
                    Vector2 inputDirection = Vector2.Zero;

                    if (Keyboard.GetState().IsKeyDown(Keys.Left))
                        inputDirection.X -= 1;
                    if (Keyboard.GetState().IsKeyDown(Keys.Right))
                        inputDirection.X += 1;
                    if (Keyboard.GetState().IsKeyDown(Keys.Up))
                        inputDirection.Y -= 1;
                    if (Keyboard.GetState().IsKeyDown(Keys.Down))
                        inputDirection.Y += 1;

                    return inputDirection * speed;
                }
            }

            public override void Update(GameTime gameTime, Rectangle clientBounds)
            {
                position += direction;

                if (position.X < 0)
                    position.X = 0;
                if (position.Y < 0)
                    position.Y = 0;
                if (position.X > clientBounds.Width - frameSize.X)
                    position.X = clientBounds.Width - frameSize.X;
                if (position.Y > clientBounds.Height - frameSize.Y)
                    position.X = clientBounds.Height - frameSize.Y;

                base.Update(gameTime, clientBounds);
            }
        }
    }

I will continue searching online for any helpful resources, and will post edits if I find anything. Thanks for your time.

A: Leave the field definition for UserControlledSprite1 where it is, but don't initialize it there:
public class Game1 : Microsoft.Xna.Framework.Game
{
    userControlledSprite UserControlledSprite1;
}

Then initialize it in the LoadContent() method right after loading the texture:
protected override void LoadContent()
{
    spriteBatch = new SpriteBatch(GraphicsDevice);

    textureImage = Content.Load<Texture2D>(@"images/Picture");
    UserControlledSprite1 = new userControlledSprite(textureImage, position, frameSize, collisionOffset, currentFrame, sheetSize, speed);
}

Also, make sure you're calling the UserControlledSprite1.Draw() method in Game1.Draw().

A: It's pretty simple here, your Draw and Update methods are never called.
If you want them to be called automatically by XNA, your Sprite class needs to extend DrawableGameComponent and be registered within Game1. For that, you'll need to pass Game as an argument. The Draw method you'll override will also need a SpriteBatch, so pass it in the constructor too. It's not really a clean way to do it, but it will work. Then call Components.Add on each DrawableGameComponent you have.
Once that's done, simply call spriteBatch.Begin() and spriteBatch.End() in Game1 (to do only one call on Begin and End), each Sprite will then draw itself.
I also took the liberty to remove useless usings and fix your class names to fit C# conventions (PascalCase).
The important parts that changed are :

*

*userControlledSprite now receives the spriteBatch and Game class

*userControlledSprite is registered as a component

*Sprite now extends DrawableGameComponent

*spriteBatch.Begin and End are now called

*Sprite now overrides the correct Draw method.

Please note I've left your Update method unchanged. It will not be called unless you change it for public override void Update(GameTime gameTime).
If you set a breakpoint in Draw, it should be called by XNA.
Game1.cs
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace Proj06
{
    public class Game1 : Game
    {
        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;

        private Texture2D textureImage;
        private Point frameSize = new Point(52, 50);
        private Point currentFrame = new Point(0, 0);
        private Point sheetSize = new Point(4, 1);
        private Vector2 position = Vector2.Zero;
        private int collisionOffset = 1;
        private Vector2 speed;

        private UserControlledSprite userControlledSprite1;

        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
        }

        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            textureImage = Content.Load<Texture2D>(@"images/Picture");
            userControlledSprite1 = new UserControlledSprite(this, spriteBatch, textureImage, position, frameSize, collisionOffset, currentFrame, sheetSize, speed);
            Components.Add(userControlledSprite1);
        }

        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                Exit();

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.White);

            spriteBatch.Begin();
            base.Draw(gameTime);
            spriteBatch.End();
        }
    }
}

UserControlledSprite.cs
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace Proj06
{
    class UserControlledSprite : Sprite
    {
        public UserControlledSprite(Game game, SpriteBatch sb, Texture2D textureImage, Vector2 position,
            Point frameSize, int collisionOffset, Point currentFrame, Point sheetSize,
            Vector2 speed)
            : base(game, sb, textureImage, position, frameSize, collisionOffset, currentFrame,
            sheetSize, speed)
        {
        }

        public UserControlledSprite(Game game, SpriteBatch sb, Texture2D textureImage, Vector2 position,
            Point frameSize, int collisionOffset, Point currentFrame, Point sheetSize,
            Vector2 speed, int millisecondsPerFrame)
            : base(game, sb, textureImage, position, frameSize, collisionOffset, currentFrame,
            sheetSize, speed, millisecondsPerFrame)
        {
        }

        public override Vector2 direction
        {
            get
            {
                Vector2 inputDirection = Vector2.Zero;

                if (Keyboard.GetState().IsKeyDown(Keys.Left))
                    inputDirection.X -= 1;
                if (Keyboard.GetState().IsKeyDown(Keys.Right))
                    inputDirection.X += 1;
                if (Keyboard.GetState().IsKeyDown(Keys.Up))
                    inputDirection.Y -= 1;
                if (Keyboard.GetState().IsKeyDown(Keys.Down))
                    inputDirection.Y += 1;

                return inputDirection * speed;
            }
        }

        public override void Update(GameTime gameTime, Rectangle clientBounds)
        {
            position += direction;

            if (position.X < 0)
                position.X = 0;
            if (position.Y < 0)
                position.Y = 0;
            if (position.X > clientBounds.Width - frameSize.X)
                position.X = clientBounds.Width - frameSize.X;
            if (position.Y > clientBounds.Height - frameSize.Y)
                position.X = clientBounds.Height - frameSize.Y;

            base.Update(gameTime, clientBounds);
        }
    }
}

Sprite.cs
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Proj06
{
    abstract class Sprite : DrawableGameComponent
    {
        Texture2D textureImage;
        protected Point frameSize;
        Point currentFrame;
        Point sheetSize;
        int collisionOffset;
        int timeSinceLastFrame = 0;
        int millisecondsPerFrame;
        const int defaultMillisecondsPerFrame = 16;
        protected Vector2 speed;
        protected Vector2 position;
        private SpriteBatch spriteBatch;

        public Sprite(Game game, SpriteBatch sb, Texture2D textureImage, Vector2 position, Point frameSize,
            int collisionOffset, Point currentFrame, Point sheetSize, Vector2 speed)
            : this(game, sb, textureImage, position, frameSize, collisionOffset, currentFrame,
            sheetSize, speed, defaultMillisecondsPerFrame)
        {
        }

        public Sprite(Game game, SpriteBatch sb, Texture2D textureImage, Vector2 position, Point frameSize,
            int collisionOffset, Point currentFrame, Point sheetSize, Vector2 speed,
            int millisecondsPerFrame) : base(game)
        {
            this.textureImage = textureImage;
            this.position = position;
            this.frameSize = frameSize;
            this.collisionOffset = collisionOffset;
            this.currentFrame = currentFrame;
            this.sheetSize = sheetSize;
            this.speed = speed;
            this.millisecondsPerFrame = millisecondsPerFrame;
            spriteBatch = sb;
        }

        public virtual void Update(GameTime gameTime, Rectangle clientBounds)
        {
            timeSinceLastFrame += gameTime.ElapsedGameTime.Milliseconds;
            if (timeSinceLastFrame > millisecondsPerFrame)
            {
                timeSinceLastFrame = 0;
                ++currentFrame.X;
                if (currentFrame.X >= sheetSize.X)
                {
                    currentFrame.X = 0;
                    ++currentFrame.Y;
                    if (currentFrame.Y >= sheetSize.Y)
                    {
                        currentFrame.Y = 0;
                    }
                }
            }
        }

        public override void Draw(GameTime gameTime)
        {
            spriteBatch.Draw(textureImage,
                position,
                new Rectangle(currentFrame.X * frameSize.X,
                    currentFrame.Y * frameSize.Y,
                    frameSize.X, frameSize.Y),
                    Color.White, 0, Vector2.Zero,
                    1f, SpriteEffects.None, 0);

            base.Draw(gameTime);
        }

        public abstract Vector2 direction
        {
            get;
        }

        public Rectangle collisionRect
        {
            get
            {
                return new Rectangle(
                    (int)position.X + collisionOffset,
                    (int)position.Y + collisionOffset,
                    frameSize.X - (collisionOffset * 2),
                    frameSize.Y - (collisionOffset * 2));
            }
        }
    }
}

As an addendum, I'd strongly suggest you move to MonoGame. XNA is not supported anymore (It was killed off by Microsoft a long time ago) and MonoGame is the open source implementation. Not much have changed, but you'll still need to use XNA's content pipeline (the .XNB files).
If you want to stick to XNA, start projects with the Platformer Starter Kit. You will better see how XNA works, as your architecture is quite weird.


text:
Q: android notification comes up on start I m trying to create a app, where i schedule a notification
but whenever i try to open the app, the notification comes up.....
it comes up at the right time but also when the app is opened.
here's the code............
Main activity.java
public class MainActivity extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Calendar Calendar_Object = Calendar.getInstance();

    Calendar_Object.set(Calendar.HOUR_OF_DAY,16);
    Calendar_Object.set(Calendar.MINUTE,18);
    Calendar_Object.set(Calendar.SECOND,00);

    Intent myIntent = new Intent(MainActivity.this, AlarmReceiver.class);

PendingIntent pendingIntent = PendingIntent.getBroadcast(MainActivity.this,
        0, myIntent,0);

AlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);

alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, Calendar_Object.getTimeInMillis(),120000,pendingIntent);

}
}

AlarmReceiver.java
 public class AlarmReceiver extends BroadcastReceiver {

@Override

  public void onReceive(Context context, Intent intent) {

  Intent myIntent = new Intent(context, NotificationService.class);
  context.startService(myIntent);
}

}

NotificationService.java
public class NotificationService extends Service {

private NotificationManager mManager;

@Override
public IBinder onBind(Intent arg0) {

    return null;
}

@Override
public void onCreate() {
    super.onCreate();

}

@Override
public void onStart(Intent intent, int startId) {
    super.onStart(intent, startId);

    mManager = (NotificationManager) this.getApplicationContext()
            .getSystemService(
                    this.getApplicationContext().NOTIFICATION_SERVICE);

    Intent intent1 = new Intent(this.getApplicationContext(), MainActivity.class);

    @SuppressWarnings("deprecation")
    Notification notification = new Notification(R.drawable.images,
            "xys", System.currentTimeMillis());

    intent1.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP
            | Intent.FLAG_ACTIVITY_CLEAR_TOP);

    notification.defaults |= Notification.DEFAULT_SOUND;
    notification.defaults |= Notification.DEFAULT_VIBRATE;

    PendingIntent pendingNotificationIntent = PendingIntent.getActivity(
            this.getApplicationContext(), 0, intent1,
            PendingIntent.FLAG_ONE_SHOT);
    notification.flags |= Notification.FLAG_AUTO_CANCEL;

    notification.setLatestEventInfo(this.getApplicationContext(),
            "xyz", "abcd",
            pendingNotificationIntent);
    notification.flags|= Notification.FLAG_AUTO_CANCEL;

    mManager.notify(0, notification);

    stopSelf();

}

A: Alarm is triggering again because after notification you are calling the MainActivity in which you are setting Alarm again. Try to set alarm in different activity. else prevent alarm from setting if activity started after notification.


text:
Q: Should "whom" be capitalized in a title? As in the title of the book For whom the Bells Toll, should the word "whom" be capitalized?

Also, any advice on when to capitalize within a title would be appreciated.


text:
Q: Unwanted space between bootstrap columns I have designed my form controls using bootstrap and having issue with my design.
I have divided the screen into three columns with 4 md each. The General agreement control is defined as col-md 8 to span across. Not sure why there is space between General agreement field and sales office. Could somebody help. I have set the border for  .col-md-4 ,.col-md-8 for you to see.

css

View

    @Html.AntiForgeryToken()
    @Html.HiddenFor(model => model.CompanyCode)

                @Html.LabelFor(model => model.Company, htmlAttributes: new { @class = "control-label col-md-4" })

                        @(Html.Kendo().ComboBoxFor(model => model.CountryCode)
                            .HtmlAttributes(new { style = "width:100%" })
                            .DataTextField("CompanyCodeCompany")
                            .DataValueField("CountryCode")
                            .Filter(FilterType.Contains)
                            .MinLength(3)
                            .Events(e => e.Change("onCompanyChange").DataBound("onCompanyComboChange"))
                            .Value("GB")
                            .DataSource(dataSource => dataSource
                            .Read(read => read.Action("RequestHeader_SalesOrganisation", "Request").Type(HttpVerbs.Post))
                            .ServerFiltering(true)
                            )
                        )

                    @Html.ValidationMessageFor(model => model.Company, "", new { @class = "text-danger" })

                @Html.LabelFor(model => model.Name1, htmlAttributes: new { @class = "control-label col-md-4" })

                        @(Html.Kendo().ComboBoxFor(model => model.CustomerMasterDataId)
                    //.Filter("contains")
                    .HtmlAttributes(new { style = "width:100%" })
                    .DataTextField("CustomerNumberName")
                    .Placeholder("Select...")
                    //.AutoBind(false)
                    //.Deferred(false)
                    .DataValueField("CustomerMasterDataId")
                    .Filter("contains")
                    .MinLength(3)
                    .DataSource(dataSource => dataSource
                          .Read(read =>
                          {
                              read.Action("RequestHeader_CustomerData", "Request")
                                  .Type(HttpVerbs.Post)
                                  .Data("GetCompanyCodeFilter");
                          }).ServerFiltering(true)
                                    ).CascadeFrom("CountryCode").Filter("contains")

                       .Events(e =>
                       {
                           e.Change("onCustomerComboChange");
                       })
                        )

                    @Html.ValidationMessageFor(model => model.CustomerMasterDataId, "Please enter a valid CustomerName", new { @class = "text-danger" })

                @Html.LabelFor(model => model.CustomerNumber, htmlAttributes: new { @class = "control-label col-md-4" })

                        @Html.EditorFor(model => model.CustomerNumber, new { htmlAttributes = new {  @class = "form-control", style = "width:100%", @readonly = "readonly" } })

                    @Html.ValidationMessageFor(model => model.CustomerNumber, "", new { @class = "text-danger" })

                @Html.LabelFor(model => model.CustomerGroup, htmlAttributes: new { @class = "control-label col-md-4" })

                        @Html.EditorFor(model => model.CustomerGroup, new { htmlAttributes = new { @class = "form-control", style = "width:100%", @readonly = "readonly" } })

                    @Html.ValidationMessageFor(model => model.CustomerGroup, "", new { @class = "text-danger" })

                @Html.LabelFor(model => model.SalesOffice, htmlAttributes: new { @class = "control-label col-md-4" })

                        @(Html.Kendo().ComboBoxFor(model => model.SalesOfficeID)
                            .Filter("contains")
                            .HtmlAttributes(new { style = "width:100%" })
                            .DataTextField("SalesOffice")
                            .Placeholder("Select...")
                            .DataValueField("SalesOfficeID")
                            .AutoBind(false)
                            //.Deferred(false)
                            .DataSource(dataSource => dataSource
                                .Read(read =>
                                {
                                    read.Action("RequestHeader_SalesOffice", "Request")
                                        .Type(HttpVerbs.Post)
                                        .Data("GetSalesOfficeFilter");
                                })
                                )

                        )

                    @Html.ValidationMessageFor(model => model.SalesOfficeID, "Please select a valid Sales Office", new { @class = "text-danger" })

                @Html.LabelFor(model => model.ProjectName, htmlAttributes: new { @class = "control-label col-md-4" })

                    @Html.EditorFor(model => model.ProjectName, new { htmlAttributes = new { @class = "form-control", style = "width:100%" } })
                    @Html.ValidationMessageFor(model => model.ProjectName, "Please enter a Project Name", new { @class = "text-danger" })

                @Html.LabelFor(model => model.ProjectContent, htmlAttributes: new { @class = "control-label col-md-4" })

                    @Html.TextAreaFor(model => model.ProjectContent, new { htmlAttributes = new { @class = "form-control", cols = "50" } })
                    @Html.ValidationMessageFor(model => model.ProjectContent, "", new { @class = "text-danger" })

                @Html.LabelFor(model => model.NameOfResponsiblePerson, htmlAttributes: new { @class = "control-label col-md-5" })

                    @(Html.Kendo().ComboBoxFor(model => model.PersonResponsibleMasterDataId)
                        .Filter("contains")
                        .HtmlAttributes(new { style = "width:100%" })
                        .DataTextField("NameOfResponsiblePerson")
                        .DataValueField("PersonResponsibleMasterDataId")
                        .Placeholder("Select...")
                        // .AutoBind(false)
                        //.Deferred(false)
                        .DataSource(dataSource => dataSource
                        .Read(read =>
                        {
                            read.Action("RequestHeader_PersonResponsibleMasterData", "Request")
                                .Type(HttpVerbs.Post)
                                .Data("GetFilterOption1");
                        }).ServerFiltering(true)
                                    ).CascadeFrom("CountryCode").Filter("contains")

                    )
                    @Html.ValidationMessageFor(model => model.PersonResponsibleMasterDataId, "Please select a valid Service Account Manager", new { @class = "text-danger" })

                @Html.LabelFor(model => model.Requestor, htmlAttributes: new { @class = "control-label col-md-4" })

                    @Html.EditorFor(model => model.Requestor, new { htmlAttributes = new { @class = "form-control", @readonly = "readonly" } })

                @Html.LabelFor(model => model.ContractStartDate, htmlAttributes: new { @class = "control-label col-md-4" })

                    @(Html.Kendo().DatePickerFor(model => model.ContractStartDate)

                          .Name("ContractStartDate")
                           .Min(DateTime.Today)
                           .HtmlAttributes(new { style = "width: 100%" })
                    )
                    @Html.ValidationMessageFor(model => model.ContractStartDate, "", new { @class = "text-danger" })

                @Html.LabelFor(model => model.ContractDurationInMonths, htmlAttributes: new { @class = "control-label col-md-4" })

                    @Html.EditorFor(model => model.ContractDurationInMonths, new { htmlAttributes = new { @class = "form-control", style = "width:100%" ,@Value = "2" } })
                    @Html.ValidationMessageFor(model => model.ContractDurationInMonths, "", new { @class = "text-danger" })

                @Html.LabelFor(model => model.Priority, htmlAttributes: new { @class = "control-label col-md-4" })

                    @(Html.Kendo().DatePickerFor(model => model.Priority)
                          .Name("Priority")
                          .Min(DateTime.Today)
                          .HtmlAttributes(new { style = "width: 100%" })
                    )
                    @Html.ValidationMessageFor(model => model.Priority, "", new { @class = "text-danger" })

                @Html.LabelFor(model => model.IsRequiredToSendToCostDesk, htmlAttributes: new { @class = "control-label col-md-4" })

                    @Html.CheckBoxFor(model => model.IsRequiredToSendToCostDesk, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.IsRequiredToSendToCostDesk, "", new { @class = "text-danger" })

                @Html.LabelFor(model => model.IsDayBusiness, htmlAttributes: new { @class = "control-label col-md-4" })

                    @Html.CheckBoxFor(model => model.IsDayBusiness, new { htmlAttributes = new { @class = "form-control" } })
                    @Html.ValidationMessageFor(model => model.IsDayBusiness, "", new { @class = "text-danger" })

                @Html.LabelFor(model => model.RequestID, htmlAttributes: new { @class = "control-label col-md-4" })

                        @Html.EditorFor(model => model.RequestID, new {  htmlAttributes = new { Value = Model.RequestID == 0 ? "" : Model.RequestID.ToString(), @class = "form-control", style = "width:100%", @readonly = "readonly" } })

                    @Html.ValidationMessageFor(model => model.RequestID, "", new { @class = "text-danger" })

                    @Html.LabelFor(model => model.GeneralAgreementName, htmlAttributes: new { @class = "control-label col-md-2" })

                            @*
*@
                            @Html.TextAreaFor(model => model.GeneralAgreementName, new { htmlAttributes = new { @class = "form-control", cols = "50" } })

                        @Html.ValidationMessageFor(model => model.GeneralAgreementName, "", new { @class = "text-danger" })

                @*

*@

                        @Html.LabelFor(model => model.CalculationSpecials, htmlAttributes: new { @class = "control-label col-md-5" })

                            @*
*@
                            @Html.TextAreaFor(model => model.CalculationSpecials, new { htmlAttributes = new { @class = "form-control", cols = "50" } })
                            @Html.ValidationMessageFor(model => model.CalculationSpecials, "", new { @class = "text-danger" })

A: I believe your "problem lies in this segment:
@Html.LabelFor(model => model.GeneralAgreementName, htmlAttributes: new { @class = "control-label col-md-2" })

You are becoming inconsistent with column widths.


text:
Q: Firebase AppCheck custom provider Currently I'm trying to use a custom provider for AppCheck and according to documentation, this implementation can be used to verify other platforms than currently allowed, more specific:

*

*You want to verify devices using platforms other than Apple, Android, and the web. For example, you could create App Check providers for desktop OSes or Internet-of-Things devices.

Now since current SDK that supports AppCheck is Node.js, my question is:

*

*How can I create a custom AppCheck provider for non allowed platforms to generate a token?

More specific, I'm trying to implement AppCheck for non Google Android phones, HarmonyOS.
But, Node.js SDK currently has one method to be used: createToken(appId: string, options?: AppCheckTokenOptions) from where I should supply an appId, where this value is generated by Firebase when registering a new app:

In this case the app platform is compatible with Firebase (Android, iOS, web, etc). I can register as example a Google Android phone, but I can't register an IoT device, HarmonyOS phone, Tizen TV, etc.
How can I generate a new appId or how should be used createToken(...) method in those cases?
Also REST API documentation for AppCheck require appId.
Edit:
I've tested using same appId from a Google phone registered in console for a non Google phone and token can be used with enforced Firebase protected services, it works.
Also adding a debug token generated from a non Google phone to a registered Google phone in console it works, Firebase pass requests and response is received. But I think is not ok since a non Google phone impersonate a registered Google phone.


text:
Q: s3 multipart upload using pre-signed URL I am trying to upload file using S3 multipart upload and pre-signed URLs using the Java SDK.  I can successfully upload the file without multipart using pre-signed URL.  I believe I can use multipart upload with pre-signed URL's provided I generate pre-signed URL's for every file part.  However, I am not certain how to initiate the multipart upload as all examples that I have come across seem to mention the s3 credentials for initiating the multipart (and I need to avoid using AWS credentials for this request & was the reason behind using pre-signed URL's).  Any insights on how to go about solving this would be quite welcome.
The intention is to avoid using any AWS credentials where the request is initiated from.  If this is not possible using pre-signed URL's and multipart uploads, suggest an alternative whereby one can use temporary credentials on the upload requesting side without this upload requesting side having to rely on AWS credentials.
I realize I can initiate a multipart upload request (which takes in the bucket name and object key but it does not work without credentials).  any thoughts?


text:
Q: Troubleshooting HTML/PHP Form I am using feedburner for my rss feeds and am currently trying to create a widget that displays the generic feedburner email subscribe form with a slight modification.  I am trying to include a text box in my form for a user to enter a keyword and then when they enter their email and hit subscribe they are brought to the feedburner confirmation page.
All is working well except for retreiving the variable I have set for the "keyword" text box..  technically after the form is filled out the confirmation url should look something like:
 feedburner.google.com/fb/a/mailverify?=MYFEED&s=USER-KEYWORD
but it currently just shows this:  feedburner.google.com/fb/a/mailverify?=MYFEED&s=
- and the last little bit is left blank so I am looking for someone to tell me where I went wrong on getting the keyword text field to populate the url in the search parameter..
here is my form (with the mod):
    public function widget( $args, $instance ) {
        extract( $args );
        $title = apply_filters( 'widget_title', $instance['title'] );

        $user_value = $_POST['keyword'];

        echo $before_widget;
        if ( ! empty( $title ) )
            echo $before_title . $title . $after_title; ?>

            <form style="border:1px solid #ccc;padding:3px;text-align:center;" action="http://feedburner.google.com/fb/a/mailverify?uri=MYFEED&s=<?php echo $user_value ?>" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=MYFEED&s=<?php echo $user_value ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">

Enter a keyword:

<input type="text" style="width:140px" name="keyword" value="<?php echo $user_value ?>" />

Enter your email address:

<input type="text" style="width:140px" name="email"/>

<input type="hidden" value="MYFEED" name="uri"/>

<input type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe" />

Delivered by FeedBurner
</form>

        <?php echo $after_widget;
    }

EDIT
Most Recent Version (with var_dump):
    public function widget( $args, $instance ) {
            var_dump($_POST);
            extract( $args );
            $title = apply_filters( 'widget_title', $instance['title'] );

              $user_value = $_POST['keyword'];

            echo $before_widget;
            if ( ! empty( $title ) )
                echo $before_title . $title . $after_title; ?>

                <form style="border:1px solid #ccc;padding:3px;text-align:center;" action="http://feedburner.google.com/fb/a/mailverify?uri=MYFEED&s=<?php echo $user_value ?>" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=MYFEED&s=<?php echo $user_value ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">

Enter a keyword:

<input type="text" style="width:140px" name="keyword" value="<?php echo $user_value ?>" />

Enter your email address:

<input type="text" style="width:140px" name="email"/>

<input type="hidden" value="MYFEED" name="uri"/>

<input type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe" />

Delivered by FeedBurner
</form>

            <?php echo $after_widget;
        }

A: Should be either
<?php echo $user_value ?>
      ^^^^---

or
<?= $user_value ?>
 ^^--


text:
Q: User Lastlog login datetime did not update I use lastlog to check latest login datetime. Here are steps I use to update my latest login datetime.
1) Try to Login to that user

sudo su userA

2) Exit that user and login to root then check latest login datetime

lastlog -u userA

3) But the result is not updated and will be

"Never logged in"

Can I know the root cause here or the solution how to update it? I usually try this way and can update other users.


text:
Q: how to scrape data from www.immoweb.be (belgian real estate platform) with python? I write to you because I would like to get help in web scraping. I am a beginner in python and web scraping. I would like to be able to extract information from a real estate site and contain it in an Excel file. My problem (due to my lack of knowledge in scraping) is that I don't know how to reach the desired information. I would like to obtain the price and address of each house presented on the web page.
I started to write something but I'm lost in the for loop. What must be added to obtain the address and the price? Thanks for your help. Cheers.
  url = "https://www.immoweb.be/fr/recherche/maison/a-vendre/ixelles/1050?countries=BE&orderBy=newest"
  response = requests.get(url)
  print(response.status_code)
  parser = html.fromstring(response.text)
  search_results = parser.xpath("//main/iw-search")
  properties_list = []

  for properties in search_results:
      raw_address = properties.xpath("<add something>")
      raw_price = properties.xpath("<add something>")
      ...

A: This is a dynamic website. Thus, you need you use a WebDriver.
import requests
from bs4 import BeautifulSoup
import pandas as pd
# pip install selenium
from selenium import webdriver
from selenium.webdriver import Chrome

drive = Chrome(executable_path =r"/Users/faridmammadaliyev/Desktop/chromedriver")
drive.get('https://www.immoweb.be/en/classified/apartment/for-sale/antwerpen/2000/9614247')
soup = BeautifulSoup(drive.page_source, "lxml")
jobs_elements = soup.find_all("tr", class_= "classified-table__row")

Then, you are ready to scrape:
data = []

for jobs_element in jobs_elements:
    try:
        table_data = jobs_element.find("td", class_="classified-table__data").text.strip()

    # if you dont add except .text method will produce an error
    except AttributeError:
        table_data = 'no data'

    try:
        table_header = jobs_element.find("th", class_="classified-table__header").text.strip()

    # if you dont add except .text method will produce an error
    except AttributeError:
        table_header = 'no data'

    item = {'table_data':table_data,
            'table_header': table_header}

    data.append(item)

print(data)

df = pd.DataFrame(data)

df

The check the following article for more details.
I hope this helps.


text:
Q: Search and replace with finding if L or R is a prefix or suffix or nothing Please excuse me for posting this again, but I think I really screwed up my previous thread. Because of comment blocks only allow so many characters, I could not explain myself better, and I did not see a choice for replying so that I would have more room. So if nobody minds, let me try explaining everything that I need. Basically I need to flip the names of 3D objects that have a prefix or a suffix of "L" or "R" from:
1: "L" with "R",
2: "R" with "L", or
3: don't change.
This is for a script in Maya in order to duplicate selected objects and flip there names. I got the duplicating part down packed and now it is about trying to flip the names of the duplicated objects based on 5 possibilities. Starting with the first 2 prefixes, the duplicated objects need to start with either
"L_" or "R_", match case doesn't matter.

The next 2, the suffixes, need to be either:
"_L" or "_R" with a possible extra character "_", such as "Finger_L_001".

Now in a search on this forum, I think found something almost to what I am looking for. I copied the syntax and replaced the user's search characters with mine being "L_" and "L", just to see if it would work, but with only some expectation. Since I only know the basics of regular expressions, such as "L.*" will find L_Finger_001, I really do not understand this line of syntax below and why the second choice is not leaving it as L_Finger.
So maybe this is not what I need or is it? And can someone explain this? I tried searching for keywords such as (?P) and (?P\S+), but I did not find anything. So without further due, here is the syntax....
>>> x = re.sub(r'(?P<prefix>_L)(?P<key>\S+)(?(prefix)|L_)','\g<key>',"L_Finger")
>>> x
'L_Finger'
>>> x = re.sub(r'(?P<prefix>L_)?(?P<key>\S+)(?(prefix)|_L)','\g<key>',"L_anything")
>>> x
'Finger'

#

Updated 11\10\13 3:52 PM ET
    Ok, so I have tweaked the code a bit, but I like where this is going. Actually, my original idea was to use dictionaries, but I could figure out how to search. By kobejohn steering me in the right direction with defining all possibilities, this is starting to make sense. Here is a WIP

samples = ('L_Arm',
           'R_Arm',
           'Arm_L',
           'Arm_R',
           'IndexFinger_L_001',
           'IndexFinger_R_001',
           '_LArm')

prefix_l, prefix_r = 'L_', 'R_'
suffix_l, suffix_lIndex, suffix_r, suffix_rIndex = '_L', '_L_', '_R', '_R_'

prefix_replace = {prefix_l: prefix_r, prefix_r: prefix_l}
suffix_replace = {suffix_l: suffix_r, suffix_r: suffix_l}
suffixIndex_replace = {suffix_lIndex: suffix_rIndex, suffix_rIndex: suffix_lIndex}

results = dict()
for sample in samples:
    # Default value is no modification - may be replaced below
    results[sample] = sample

    # Handle prefixes
    prefix = prefix_replace.get(sample[:2].upper())
    if prefix :
        result = prefix+sample[:2]

    else :
        #handle the suffixes
        suffix_partition = sample.rpartition("_")
        result = suffix_partition[0] if suffix_partition[2].isdigit() else sample
        suffix = suffix_replace.get(result[-2:])
        print("Before: %s --> After: %s"%(sample, suffix))

A: Ok, I guess multiple regular expressions is valid too. Here is a way using re's similar to the ones you found. It assumes real prefixes (nothing before the prefix) and pseudo-suffixes (anywhere except the first characters). Below that is a parsing solution with the same assumptions.
import re

samples = ('L_Arm',
           'R_Arm',
           'Arm_L',
           'Arm_R',
           'IndexFinger_L_001',
           'IndexFinger_R_001',
           '_LArm')
re_with_subs = ((r'(?P<prefix>L_)(?P<poststring>\S+)',
                 r'R_\g<poststring>'),
                (r'(?P<prefix>R_)(?P<poststring>\S+)',
                 r'L_\g<poststring>'),
                (r'(?P<prestring>\S+)(?P<suffix>_L)(?P<poststring>\S*)',
                 r'\g<prestring>_R\g<poststring>'),
                (r'(?P<prestring>\S+)(?P<suffix>_R)(?P<poststring>\S*)',
                 r'\g<prestring>_L\g<poststring>'))
results_re = dict()
for sample in samples:
    # Default value is no modification - may be replaced below
    results_re[sample] = sample
    for pattern, substitution in re_with_subs:
        result = re.sub(pattern, substitution, sample)
        if result != sample:
            results_re[sample] = result
            break  # only allow one substitution per string

for original, result in results_re.items():
    print('{0} --> {1}'.format(original, result))

Here is the parsing solution.
samples = ('L_Arm',
           'R_Arm',
           'Arm_L',
           'Arm_R',
           'IndexFinger_L_001',
           'IndexFinger_R_001',
           '_LArm')

prefix_l, prefix_r = 'L_', 'R_'
suffix_l, suffix_r = '_L', '_R'
prefix_replacement = {prefix_l: prefix_r,
                      prefix_r: prefix_l}
suffix_replacement = {suffix_l: suffix_r,
                      suffix_r: suffix_l}
results = dict()
for sample in samples:
    # Default value is no modification - may be replaced below
    results[sample] = sample
    # Handle prefixes
    prefix = sample[:2].upper()
    try:
        results[sample] = prefix_replacement[prefix] + sample[2:]
        continue  # assume no suffixes if a prefix found
    except KeyError:
        pass  # no valid prefix
    # Handle pseudo-suffixes
    start = None
    for valid_suffix in (suffix_l, suffix_r):
        try:
            start = sample.upper().rindex(valid_suffix, 1)
            break  # stop if valid suffix found
        except ValueError:
            pass
    if not start is None:
        suffix = sample[start: start + 2].upper()
        new_suffix = suffix_replacement[suffix]
        results[sample] = sample[:start] + new_suffix + sample[start + 2:]

for original, result in results.items():
    print('{0} --> {1}'.format(original, result))

gives the result:

*

*L_Arm --> R_Arm

*R_Arm --> L_Arm

*IndexFinger_L_001 --> IndexFinger_R_001

*Arm_L --> Arm_R

*_LArm --> _LArm

*IndexFinger_R_001 --> IndexFinger_L_001

*Arm_R --> Arm_L

A: You can do it by this tricky regex pattern >>
if re.search('(^[LR]_|_[LR](_|$))', str):
    str = re.sub(r'(^[LR](?=_)|(?<=_)[LR](?=(?:_|...$)))(.*)(?=.*\1(.))...$',
                 r'\3\2', str+"LRL")

See this demo.

Alternatively, you can do it by one line code >>
str = re.sub(r'(^[LR](?=_)|(?<=_)[LR](?=(?:_|...$)))(.*)(?=.*\1(.))...$', r'\3\2', str+"LRL")[:len(str)]

See this demo.


text:
Q: ProtoBuf-net invalid behaviour when serializing object containing list I have hard time trying to explain behavior in following example:
[ProtoContract]
public class Class1Proto
{
    [ProtoMember(1)]
    public int data1 = 1;
    [ProtoMember(2)]
    public string data2 = "MYRANDOMSTRING";
}

[ProtoContract]
public class ProtoChunk
{
    [ProtoMember(1)]
    public List<Class1Proto> arr = new List<Class1Proto>();

    public const int PageSize = 4096;
}

Usage:
    byte[] page = new byte[ProtoChunk.PageSize];

    ProtoChunk originalData = new ProtoChunk();
    for (int i = 0; i < 100; i++)
    {
        Class1Proto p = new Class1Proto();
        p.data1 = i * 2;
        p.data2 = (i * 2).ToString();
        originalData.arr.Add(p);
    }

    using (var memStream = new MemoryStream(page, writable:true))
    {
        Serializer.SerializeWithLengthPrefix(memStream, originalData, PrefixStyle.Fixed32);
    }

    using (var memStream = new MemoryStream(page, writable:false))
    {
        ProtoChunk deserializedData = Serializer.DeserializeWithLengthPrefix<ProtoChunk>(memStream, PrefixStyle.Fixed32);
    }

My expectation would be that originalData and deserializedData should be identical. And they mostly are except that deserializedData.arr[0].data1 == 1 while originalData.arr[0].data1 == 0. All the other objects are identical, even including originalData.arr[0].data2 and deserializedData.arr[0].data2 (string field).

A: protobuf-net assumes "implicit zero defaults" - i.e. unless specific otherwise, members have a default value of zero, meaning: zero is not transmitted. This isn't purely arbitrary - this is actually the "proto3" specification (well... more or less; in "proto3", zero is the only permitted default).
Your code - particularly the property initializer - acts as though it has a default value of 1, so: when the zero isn't transmitted, the 1 still gets applied by your constructor, and that becomes the value (deserialization in protobuf is a "merge" operation - pre-existing values are retained, again accordance with the specification).
Options:

*

*tell protobuf-net about your default - add [DefaultValue(1)] to the property

*tell protobuf-net not to run the constructor (and property initializer) - add SkipConstructor = true to the [ProtoContract]

*tell protobuf-net not to assume this behaviour: RuntimeTypeModel.Default.ImplicitZeroDefault = false;

*add your own conditional serialization callbacks (I can give an example if you really want)

I'd use the first option, personally.


text:
Q: Unexpectful output format of str() function I`m running such a sequence of commands:
read_csv = read.csv('D:/winequality-white.csv', stringsAsFactors=FALSE)
str(read_csv)

In the result I get:
'data.frame':   4898 obs. of  1 variable:
 $ fixed.acidity.volatile.acidity.citric.acid.residual.sugar.chlorides.free.sulfur.dioxide.total.sulfur.dioxide.density.pH.sulphates.alcohol.quality: chr  "7;0.27;0.36;20.7;0.045;45;170;1.001;3;0.45;8.8;6" "6.3;0.3;0.34;1.6;0.049;14;132;0.994;3.3;0.49;9.5;6" "8.1;0.28;0.4;6.9;0.05;30;97;0.9951;3.26;0.44;10.1;6" "7.2;0.23;0.32;8.5;0.058;47;186;0.9956;3.19;0.4;9.9;6" ...

But I expected an output`s format like this one:
'data.frame':   4 obs. of  4 variables:
 $ id    : int  10 11 12 13
 $ name  : chr  "sai" "ram" NA "sahithi"
 $ dob   : chr  "1990-10-02" "1981-03-24" "1987-06-14" "1985-08-16"
 $ gender: chr  "M" "" "F" "F"

What is the problem and how to fix it?
The link on the dataset: http://archive.ics.uci.edu/ml/machine-learning-databases/wine-quality/winequality-white.csv

A: read.csv uses commas as separators.
Your data set has semi-colons. Try read.table(<filename>, header = TRUE, sep = ";").


text:
Q: Getting C: drive capcity from multiple servers $computers = Get-Content -Path c:\server\computers.txt
$computers | foreach {
    $os = Get-WmiObject win32_OperatingSystem -computername $_
    Get-WMIObject Win32_Logicaldisk -filter "deviceid='$($os.systemdrive)'" -ComputerName $_
} | Select PSComputername,DeviceID,
@{Name="SizeGB";Expression={$_.Size/1GB -as [int]}},
@{Name="FreeGB";Expression={[math]::Round($_.Freespace/1GB,2)}} |
Sort FreeGB | Format-Table -Autosize >> C:\server\diskreport.txt

A: Since there really was no question posted or errors given for what you have, here's what I use to get the disk space on a server. You can always get a list and throw it into a foreach loop sending them to this function and throw the output to a file however you would like.
Function Get-DiskInventory
{
    [CmdletBinding()]
    Param (
    [Parameter(ValueFromPipeline,ValueFromPipelineByPropertyName)]
    [alias("Name")]
    [string[]]$ComputerName="localhost",
    [validateset(2,3)]
    [int]$DriveType=3,
    [Parameter()]
    [string]$DriveLetter

)

Begin{
    Write-Verbose "Getting disk inventory on $ComputerName"
}

Process {
    foreach ($Computer in $ComputerName) {
        Write-Verbose "Connecting to $Computer"
        Write-Verbose "Looking for drive type $DriveType"
        $Result = Get-WmiObject -Class win32_logicaldisk -ComputerName $Computer -Filter "drivetype=$DriveType" |
        Select-Object -Property @{label='Computer';expression={$Computer}},
        DeviceID,
        @{label='Size(GB)';expression={$_.Size / 1GB -as [int]}},
        @{label='UsedSpace(GB)';expression={($_.Size - $_.FreeSpace) / 1GB -as [int]}},
        @{label='FreeSpace(GB)';expression={$_.FreeSpace / 1GB -as [int]}},
        @{label='%Free';expression={$_.FreeSpace / $_.Size * 100 -as [int]}}

        if ($DriveLetter) {
            Write-Verbose "Filtering drives"
            $Result = $Result | where deviceid -EQ "$DriveLetter`:"
        }

        $Result | Select-Object -Property * -Unique
    }
}

End{
    Write-Verbose "Finished running command"
}
}


text:
Q: move menu navigation icon to top of page I am unable to move the menu navigation icon to the top of the page so it's just below the title at the moment. How would I move it to the top of the page so it's inline with the title? I would like the vertical menu to overlay the other contents when it's opened.
UPDATE: I've attached all of the code below so you can run it and see what's happening.

function myFunction() {
    var x = document.getElementById("myLinks");
    if (x.style.display === "block") {
      x.style.display = "none";
    } else {
      x.style.display = "block";
    }
  }
 body {
      font-family: 'Roboto', sans-serif;
    }
    .offers, .the-offer, .offer-date {
      text-align: center;
    }
    .name {
      font-family: 'Roboto', sans-serif;
      text-align: center;
      color: #2f416d;
      font-size: 29px;
      margin-top: 20px;
    }
    .site-name {
      color: #2f416d;
      margin-top: -40px;
      margin-right: 15px;
      text-align: right;
    }

    /* NAV BAR */

    /* Add a black background color to the top navigation */
    .topnav {
        background-color: white;
        overflow: hidden;
        margin-top: -10px;
        /* border-top: #2f416d solid 2px; */
        display: inline-block;
      position: relative;
    }

    /* Hide the links inside the navigation menu (except for logo) */
    .topnav #myLinks {
      overflow: hidden;
      display: none;
      margin-left: 36px;
    }
    .topnav a {
      color:#2f416d;
      padding: 14px 16px;
      text-decoration: none;
      font-size: 17px;
      display: block;
    }
    .topnav a.icon {
       background: #94ceca;
      display: inline-block;
      position: relative;
      padding: 13.5px;
      /* right: 0;
      top: 0; */
    }
    .topnav a:hover {
      background-color: #2f416d;
      color: black;
    }

    /* Style the active link (or home/logo) */
    .active {
      background-color: #94ceca;
      color: #2f416d;
    }
      .topnav a {
        display: flex;
        text-align: center;
        padding: 12px;
        text-decoration: none;
        font-size: 15px;
        font-family: 'Roboto', sans-serif;
      }
      .topnav a:hover {
        color: #94ceca;
      }
      .topnav a.active {
        color: #9ba0ac;
      }
      .about-head {
        font-family: 'Roboto', sans-serif;
        font-size: 18px;
      }

        <link href="https://fonts.googleapis.com/css?family=Montserrat:300|Roboto&display=swap" rel="stylesheet">

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
        <link rel="stylesheet" href="styles.css">

cdbicdnsiu

biaksncdjk - ENGLAND

          HOME
          ABOUT
          TESTIMONIALS
          PRICES
          OFFERS
          CONTACT

A: You need to put the .topnav div on top of the site and site-name divs, then change these classes:
.name {
  font-family: 'Roboto', sans-serif;
  text-align: center;
  color: #2f416d;
  font-size: 29px;
  position:absolute;
  top:0;
  width: 99%;
}
.site-name {
  color: #2f416d;
  margin-right: 15px;
  display: inline-block;
  position: absolute;
  right: 0;
}
.topnav {
    background-color: white;
    overflow: hidden;
    /* border-top: #2f416d solid 2px; */
    display: inline-block;
    position: absolute;
    z-index: 5;
}

The problem mainly was that you gave display: block at the .site div, so this div had full width and moved to the next line.
Codepen here.


text:
Q: VHDL: Std_Logic input stored in integer issue I have the following problem:
I have a PC which gives inputs to my SPARTAN 3AN FPGA and I wish to fetch those inputs, put them in a std_logic_vector, then convert them into integer. The instructions are divided in "n" instructions with 32 bits each. I need the first three bits be put in one integer, the next 28 in another, and the last is a "Last instruction flag". So, I have two arrays of 100 integers in which I would be putting the instructions (100 is the limit). If the "Last instruction flag" is one, than the entire operation should stop.
The program didn't synthesize properly, so I made a simulation of it. And I found the problem, but I don't know how to solve it, so I need your help. Here is the code and the simulation output:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
USE IEEE.NUMERIC_STD.all;

entity BinaryDecimalConv is
end BinaryDecimalConv;

architecture Behavioral of BinaryDecimalConv is

    type int_array is array (100 downto 0) of integer;

    signal clkcnt: integer :=0;
    signal fbaud: integer;
    signal lastnumflag: std_logic:='0';
    signal clk: std_logic;
    signal PLCinput: std_logic;
    signal init: std_logic;
    signal BusyIN: std_logic;
    signal BusyOutSignal: std_logic;
    signal InnerBusyOut: std_logic;
    signal cnt: integer :=0;
    signal fbaut: integer :=0;
    signal pre_int: std_logic_vector (31 downto 0) := (others => '0');
    signal pre_spec_num: int_array := (others =>0);
    signal cylinder: int_array := (others => 0);
    signal InnerNumLength: integer:=0;
    signal num_length: integer:=0;

begin

CLOCKK: Process is
begin
    clk<='0';
    wait for 10 ns;
    clk<='1';
    wait for 10 ns;
end process CLOCKK;

fbaud <=5208;
BusyIN <='0';
init <='0';

PLC: Process is
    variable PrePLC: std_logic_vector(159 downto 0):="1010101010101010101010101001010010101010101010101010101010010100101010101010101010101010100101001010101010101010101010101001010010101010101010101010101010010101"; -- 1 with 100, 5 with 200, 5 2ith 200, 3 with 300, 4 with 750
begin
    PLCinput<=PrePLC(159);
    PrePLC:= PrePLC(158 downto 1) & '0';
    wait for 104166 ns;
end process;

LastNum: process (LastNumFlag) is
    begin
    if LastNumFlag = '1' then
        BusyOutSignal <='1';
        InnerBusyOut <='1';
    else
        BusyOutSignal <='0';
        InnerBusyOut <='0';
    end if;
    end process LastNum;

DecoderAndAcquirer: process (PLCinput, BusyIN, InnerBusyOut,clk) is
begin

    if (clk'event and clk='1') then                                                         -- If rising edge on clock
        if ((BusyIN='0') and (InnerBusyOut='0') and (init='0')) then                        -- Check if FPGA and PLC are ready to exchange information and if init is done
            if (clkcnt = fbaud/2)                    then                                   --  If clkcnt is equal to half of the duration of the input bit then
                pre_int(31) <= PLCinput;                                                    -- Initialize the last digit of pre_int
                cnt <= cnt+1;                                                               -- Incrementing cnt => going towards bit 2
                clkcnt <=clkcnt+1;                                                          -- Incrementing clkcnt so you can exit this block
                if (cnt<32) then                                                            -- Checking if not last bit
                    pre_int <= '0' & pre_int(31 downto 1);                                  -- If not last bit, shift number to right
                else                                                                        -- else
                    cnt <=0;                                                                -- reset cnt to start with next instruction
                    if (pre_int(0)='1') then                                                -- Check if last digit is one
                        LastNumFlag <= '1';                                                 -- If last digit is one, stop acquiring instructions
                    else
                        LastNumFlag <='0';
                    end if;
                    pre_spec_num(InnerNumLength) <= to_integer(unsigned(pre_int(28 downto 1))); -- Conversion from binary to decimal for instruction
                    cylinder(InnerNumLength) <= to_integer(unsigned(pre_int(31 downto 29)));    -- Conversion from binary to decimal for the number of cylinder
                    InnerNumLength <= InnerNumLength +1;                                            -- Incrementing the number of instructions
                    num_length <= InnerNumLength;
                end if;
            elsif (clkcnt = fbaud) then                                                     -- If clkcnt has reached the entire length of the input bit
                clkcnt <= 0;                                                                -- set clkcnt to zero so the process can start from beginning.
            else                                                                            -- If clkcnt is less than or more than half of the entire duration, but surely
                clkcnt <= clkcnt +1;                                                        -- less than the entire duration, then increment the value of the clkcnt.
            end if;
        end if;
    end if;
end process DecoderAndAcquirer;

end Behavioral;

The thing is that, as shown on the picture, when cnt changes, nothing happens to the 31st bit of the instruction. Any ideas why?
Thanks,
Bojan

A: First PrePLC := PrePLC(158 downto 1) & '0'; mismatches length, so I assume
this is to be PrePLC := PrePLC(158 downto 0) & '0'; instead, thus working as
shift register.
In process DecoderAndAcquirer of the code there is:
...
pre_int(31) <= PLCinput;
...
if (cnt<32) then
  pre_int <= '0' & pre_int(31 downto 1);
...

So even through pre_int(31) is assigned, it is later overwritten in the
pre_int <= '0' & pre_int(31 downto 1); since (cnt<32), whereby the
pre_int(31) cant go high yet.
When simulating longer time, cnt goes to 32, and then the an '1' value is shown at pre_int(31); se figure below.

Edited: Below is version with temporary variable for pre_int, just to show the principles; operation is not verified.
DecoderAndAcquirer: process (PLCinput, BusyIN, InnerBusyOut,clk) is
  variable pre_int_v : std_logic_vector(pre_int'range);
begin

    if (clk'event and clk='1') then                                                         -- If rising edge on clock
        pre_int_v := pre_int;  -- Variable update from signal
        if ((BusyIN='0') and (InnerBusyOut='0') and (init='0')) then                        -- Check if FPGA and PLC are ready to exchange information and if init is done
            if (clkcnt = fbaud/2)                    then                                   --  If clkcnt is equal to half of the duration of the input bit then
                pre_int_v(31) := PLCinput;                                                    -- Initialize the last digit of pre_int
                cnt <= cnt+1;                                                               -- Incrementing cnt => going towards bit 2
                clkcnt <=clkcnt+1;                                                          -- Incrementing clkcnt so you can exit this block
                if (cnt<32) then                                                            -- Checking if not last bit
                    pre_int_v := '0' & pre_int_v(31 downto 1);                                  -- If not last bit, shift number to right
                else                                                                        -- else
                    cnt <=0;                                                                -- reset cnt to start with next instruction
                    if (pre_int_v(0)='1') then                                                -- Check if last digit is one
                        LastNumFlag <= '1';                                                 -- If last digit is one, stop acquiring instructions
                    else
                        LastNumFlag <='0';
                    end if;
                    pre_spec_num(InnerNumLength) <= to_integer(unsigned(pre_int_v(28 downto 1))); -- Conversion from binary to decimal for instruction
                    cylinder(InnerNumLength) <= to_integer(unsigned(pre_int_v(31 downto 29)));    -- Conversion from binary to decimal for the number of cylinder
                    InnerNumLength <= InnerNumLength +1;                                            -- Incrementing the number of instructions
                    num_length <= InnerNumLength;
                end if;
            elsif (clkcnt = fbaud) then                                                     -- If clkcnt has reached the entire length of the input bit
                clkcnt <= 0;                                                                -- set clkcnt to zero so the process can start from beginning.
            else                                                                            -- If clkcnt is less than or more than half of the entire duration, but surely
                clkcnt <= clkcnt +1;                                                        -- less than the entire duration, then increment the value of the clkcnt.
            end if;
        end if;
        pre_int <= pre_int_v;  -- Signals update from variable
    end if;
end process DecoderAndAcquirer;

Figure with waveform is shown below.


text:
Q: Is there any way to edit just the track data of an AVI file, like mkvpropedit does with MKV files? I am trying to swap the order of 2 audio tracks of an AVI file using ffmpeg.
ffmpeg -i "infile.avi" -map 0:0 -map 0:2 -map 0:1 -c copy "outfile.avi"

This works but the file is being re-encoded, not copied. It takes much longer than a straight copy to finish and the resulting file is larger than the original.
Is there any way to edit just the track data of an AVI file, like mkvpropedit does with MKV files? Command line tool preferred.
General
Complete name                            : infile.avi
Format                                   : AVI
Format/Info                              : Audio Video Interleave
File size                                : 451 MiB
Duration                                 : 43mn 11s
Overall bit rate                         : 1 460 Kbps
Writing application                      : VirtualDubMod 1.5.10.2 (build 2540/release)
Writing library                          : VirtualDubMod build 2540/release

Video
ID                                       : 0
Format                                   : MPEG-4 Visual
Format profile                           : Advanced Simple@L5
Format settings, BVOP                    : 3
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Default (MPEG)
Muxing mode                              : Packed bitstream
Codec ID                                 : XVID
Codec ID/Hint                            : XviD
Duration                                 : 43mn 11s
Bit rate                                 : 1 190 Kbps
Width                                    : 656 pixels
Height                                   : 368 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.206
Stream size                              : 367 MiB (82%)
Writing library                          : XviD 1.2.1 (UTC 2008-12-04)

Audio #1
ID                                       : 1
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Codec ID                                 : 55
Codec ID/Hint                            : MP3
Duration                                 : 43mn 11s
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel count                            : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 39.5 MiB (9%)
Alignment                                : Aligned on interleaves
Interleave, duration                     : 42 ms (1.00 video frame)
Interleave, preload duration             : 504 ms
Writing library                          : LAME3.98r
Encoding settings                        : -m s -V 4 -q 2 -lowpass 17 -b 128

Audio #2
ID                                       : 2
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Codec ID                                 : 55
Codec ID/Hint                            : MP3
Duration                                 : 43mn 11s
Bit rate mode                            : Constant
Bit rate                                 : 128 Kbps
Channel count                            : 2 channels
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 39.5 MiB (9%)
Alignment                                : Aligned on interleaves
Interleave, duration                     : 42 ms (1.00 video frame)
Interleave, preload duration             : 504 ms
Writing library                          : LAME3.98r
Encoding settings                        : -m s -V 4 -q 2 -lowpass 17 -b 128

$ ffmpeg -i "infile.avi" -map 0:0 -map 0:2 -map 0:1 -c copy "outfile.avi"
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.1 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libsnappy --enable-libfontconfig --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-libass --enable-ffplay --enable-libssh --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-openssl --enable-libopus --enable-frei0r --enable-libcaca --enable-libsoxr --enable-libvidstab --enable-libx265 --enable-libwebp --enable-libbs2b --enable-librubberband --enable-libopenh264 --disable-lzma --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, avi, from 'infile.avi':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.2 (build 2540/release)
  Duration: 00:44:03.10, start: 0.000000, bitrate: 1434 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 656x368 [SAR 1:1 DAR 41:23], 1164 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 128 kb/s
    Stream #0:2: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 128 kb/s
[avi @ 0x7f826b03d200] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 2 times
Output #0, avi, to 'outfile.avi':
  Metadata:
    ISFT            : Lavf57.41.100
    Stream #0:0: Video: mpeg4 (XVID / 0x44495658), yuv420p, 656x368 [SAR 1:1 DAR 41:23], q=2-31, 1164 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, 128 kb/s
    Stream #0:2: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
  Stream #0:1 -> #0:2 (copy)
Press [q] to stop, [?] for help
[avi @ 0x7f826b03d200] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frame=63371 fps=1830 q=-1.0 Lsize=  465060kB time=00:44:03.10 bitrate=1441.4kbits/s speed=76.3x
video:375760kB audio:82597kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.462486%

infile.avi 474 MB
outfile.avi 476.2 MB


text:
Q: Java how to convert a multidimensional array to single array easily? [[4, 17, 28, 38, 43, 58, 69, 77, 83], [4, 12, 24, 35, 48, 55, 62, 73, 87], [11,
15, 22, 36, 46, 60, 67, 80, 84]]

how to convert that to this:
[4, 17, 28, 38, 43, 58, 69, 77, 83, 4, 12, 24, 35, 48, 55, 62, 73, 87, 11,
15, 22, 36, 46, 60, 67, 80, 84]

is there an easy way?

A: ArrayUtils.addAll(array1,array2)

A: You can create a new array and fill it manually using a for loop as follows:
int[][] numbers = {{4, 5, 6},{3, 1, 10}, {4, 2, 9}};

ArrayList<Integer> numbers1Dim = new ArrayList<Integer>();

for (int i = 0; i < numbers.length; i++)
{
    for (int x = 0; x < numbers[i].length; x++)
    {
        numbers1Dim.add(numbers[i][x]);
    }
}

A: Do like this
Integer td[][]= {{4, 17, 28, 38, 43, 58, 69, 77, 83}, {4, 12, 24, 35, 48, 55, 62, 73, 87}, {11,15, 22, 36, 46, 60, 67, 80, 84}};
List<Integer> singleDArray = new ArrayList<Integer>();
for (Integer[] array :td) {
      singleDArray.addAll(Arrays.asList(array));
}
Integer[] sd = singleDArray.toArray(new Integer[singleDArray.size()]);

A: I would use a nested for loop:
Integer[][] array = <your array>;
List resultList = new ArrayList();
for (int i = 0; i < array.length; i++) {
    for (int j = 0; j < array[i].length; j++) {
        resultList.add(array[i][j]);
    }
}
Integer[] resultArrayList = resultList.toArray(new Integer[resultList.size()]);
System.out.println(resultArrayList);

}


text:
Q: Yandex AJAX crawling For AJAX crawling of Googlebot I use "_escaped_fragment_" argument in my website.
Now I checked Yandex's search results for my site.
I saw that AJAX reponses don't exist in search results.
Is there an option for Yandex like "_escaped_fragment_" ?
Else, should I check user agent and if user agent includes "YandexBot" then serve non-AJAX page?
Thank you

A: I found out that Yandex also supports Google's proposition for AJAX crawling.
No need to change any code if you optimized your site for Googlebot crawling.


text:
Q: network analysis in eclipse ide of java Client Server Program I have client and Server program written in java. I want to calculate packet delivery ration, throughput, RTT and other network related parameter for network analysis of client and server. I am using Eclipse neon IDE.
I also want to verify how many packets are transmitted from client to server, how many of them are get response and how many packet are dropped by server.
Client and Server are based on application layer protocol protocol(CoAP).