text:
Q: Comparing chars in C++ - argument of type "char" is incompatible with parameter of type "const char * Im trying to compare 2 values in C++ (which im new to so please go easy)
struct styles{
int itemNo;
char desc[26];
char brand[21]; //between 3 - 20
char category;
double cost;
};

struct declared above, then im using this code in another function
char cat[2];
for (x=0;x<size;x++)
{

    if (strcmp(cat,styleAr[x].category)==0)

its giving me an error with the 'styleAr[x].category' in the if statement:
argument of type "char" is incompatible with parameter of type "const char *
any explanations on how I could solve this would be great

A: You have category as a single char and cat is an array of chars (i.e. a char *)... you probably didn't mean to compare a string with a single character

A: Assuming that cat is a string (that is, one character followed by a '\0'), then you should do this:
if (cat[0] == styleAr[x].category)

But of course, if you use std::string cat and std::string category, you can just write:
if (cat == styleAr[x].category)

A: strcmp compares character arrays, but category is just a single char, hence the error. You can compare two chars directly using ==
If category is supposed to be a single char, you need to change the comparison code
char cat='?';//or whatever you are looking for

for (x=0;x<size;x++)
{
    if (cat == styleAr[x].category)

A: You're comparing a two-char array (cat), that is NOT initalized to any value (at least not in the code that you showed us), to a single char.
The strcmp function accepts two arguments of type const char*, that is two null-terminated c-style strings (a char array whose last element is a '\0' character, the null character).
If you want to compare just one character, use the following code:
char cat = ; // Put the character you want to compare styleAr[x].category against there.

for (int x = 0 ; x < size; x++)
{
    if (cat == styleAr[x].category)
    {
       // The two characters are equal.
    }
}


text:
Q: How to Test Elasticsearch and Searchkick with RSpec Thanks for taking a look at my question guys. I've been failing miserably at making my test pass and so I'm turning to the fine people at StackOverflow. Any help would be stellar! I've followed this answer to help set up my tests:
Testing searchkick with RSpec
Here's my failing test
provider_controller_spec.rb
describe "#set_locations" do

  let(:provider) { create(:provider) }

  before(:each) { login(provider) }

  context "with search params" do

    let(:location) { create(:location) }
    let(:business) { create(:business, locations: [location]) }

    before(:each) do
      Business.searchkick_index.refresh
      get :set_locations, locale: "es", id: provider.url , query: business.commercial_name
    end

    it "should return search results" do
      expect(assigns(:businesses)).to eq([business])
    end
  end
end

I get the following error:
Failures:

  1) ProvidersController#set_locations with search params should return search results
     Failure/Error: expect(assigns(:businesses)).to eq([business])

Diff:
   @@ -1,2 +1,55 @@
   -[#<Business id: 99, email: nil, commercial_name: "Cazares Ledesma Hermanos", ruc: nil, phone: nil, razon_social: nil, website: nil, account_type: nil, created_at: "2014-04-02 16:42:26", updated_at: "2014-04-02 16:42:26", subcategory_id: nil, password_digest: nil, token: "0tw3uj7oy7q", slogan: nil, description: nil>]

   +#<Searchkick::Results:0x007f99420d7a18
   + @facets=nil,
   + @max_score=0.0,
   + @options=
   +  {:load=>true,
   +   :payload=>
   +    {:query=>
   +      {:dis_max=>
   +        {:queries=>
   +          [{:multi_match=>
   +             {:fields=>["_all"],
   +              :query=>"Cazares Ledesma Hermanos",
   +              :use_dis_max=>false,
   +              :operator=>"and",
   +              :boost=>10,
   +              :analyzer=>"searchkick_search"}},
   +           {:multi_match=>
   +             {:fields=>["_all"],
   +              :query=>"Cazares Ledesma Hermanos",
   +              :use_dis_max=>false,
   +              :operator=>"and",
   +              :boost=>10,
   +              :analyzer=>"searchkick_search2"}},
   +           {:multi_match=>
   +             {:fields=>["_all"],
   +              :query=>"Cazares Ledesma Hermanos",
   +              :use_dis_max=>false,
   +              :operator=>"and",
   +              :fuzziness=>1,
   +              :max_expansions=>3,
   +              :analyzer=>"searchkick_search"}},
   +           {:multi_match=>
   +             {:fields=>["_all"],
   +              :query=>"Cazares Ledesma Hermanos",
   +              :use_dis_max=>false,
   +              :operator=>"and",
   +              :fuzziness=>1,
   +              :max_expansions=>3,
   +              :analyzer=>"searchkick_search2"}}]}},
   +     :size=>100000,
   +     :from=>0,
   +     :fields=>[]},
   +   :size=>100000,
   +   :from=>0,
   +   :term=>"Cazares Ledesma Hermanos"},
   + @response=
   +  {"took"=>2,
   +   "timed_out"=>false,
   +   "_shards"=>{"total"=>1, "successful"=>1, "failed"=>0},
   +   "hits"=>{"total"=>0, "max_score"=>nil, "hits"=>[]}},
   + @results=[],
   + @time=2,
   + @total=0,
   + @wrapper=Tire::Results::Item>

Here's what I'm testing:
providers_controller.rb
def set_locations
  @businesses = Business.search(params[:query], page: params[:page]) if params[:query].present?
end

business.rb
class Business < ActiveRecord::Base
  include Tokenable
  searchkick language: "Spanish"
  searchkick autocomplete: ['commercial_name']
  searchkick word_start: [:name]
  searchkick settings: {number_of_shards: 1}

  validates_presence_of :commercial_name

  has_many :locations, :dependent => :destroy

  accepts_nested_attributes_for :locations,
    reject_if: lambda { |a| a[:street_address].blank? },
    :allow_destroy => true
end

I added this to spec_helper.rb
config.before :each do
  Business.reindex
end

A: Try:
expect(assigns(:businesses).results).to eq([business])

Also, in your Business model, combine your searchkick calls:
searchkick language: "Spanish",
           autocomplete: ['commercial_name'],
           word_start: [:name],
           settings: {number_of_shards: 1}

(Separate calls will produce undesirable results and this will throw an error in the next release of Searchkick)

redpajama_set_name: RedPajamaStackExchange


text:
Q: Using Embedded Mongoose Server in C++ for Typical Server Tasks I recently came across embedded mongoose web server library that I plan to use for a project. However, only after spending a lot of time on Google and Stack Overflow was I able to get the basic "hello world" example working in C language.
Now that I am not able to find any online tutorials or existing questions on Stack Overflow about my doubts, I would like to question them here. I have following questions about usage of Mongoose server-:

*

*How do I get to know what is requested?
Generally, in more popular servers like Apache when the user calls for "localhost/help.text" he gets "help.txt" displayed in the browser. However, in the embedded version of Mongoose how do I know what the user has requested to that I can pass on that particular file (or raw data in my case) depending upon what was requested by the user?

*

*How do I send files and its associations to the client's browser?
From examples, I was able to learn how raw data is sent to the client's browser, however what if I want to send a file.
Say for example I send an HTML file are all the assosiated files sent too?
Generally, when CSS and javascript files are encountered by the browser it sends another request to the server for those files and then server sends back those file. However, recently I came across this question and it confuses me a little (although I haven't tried what is says): Display html and pass the data from html to mongoose server

*

*How do I accept files from the client? As in allowing client to upload something?
I visited the file upload example of Mongoose given on the website, but I couldn't much unserstand what was going on.
These are some very basic features that a server has and perhaps because of scarcity of good tutorials I am not able to find out the solution to my problem while it may be pretty trivial.
On a slightly different note, I would like to learn more about features of Mongoose embedded server and how they can be used.
Pardon me if this question seems very basic, but from the reviews I have read and from what the Mongoose's website says, I think mongoose is a great embedded web server if only a little more documentation of the same could be found.
Thank you.

A: *

*How do I get to know what is requested?
The answer is in the example, https://github.com/cesanta/mongoose/blob/master/examples/hello.c All the information is in the struct mg_connection structure passed to the callback.

*

*How do I send files and its associations to the client's browser?
You should not do that directly. Just reply with the HTML page, and browser will request all required files itself by sending separate request per file.

*

*How do I accept files from the client? As in allowing client to upload something?
Yes you can upload files. There is an example https://github.com/cesanta/mongoose/blob/master/examples/upload.c on how to do that.


text:
Q: VMWare Server Console: Open Remote Host and firewall rules Consider the need to remotely manage an instance of VMWare Server 1.0.x. on a Windows network.

Client: Windows 7 with same VMWare Server version. In this case, it's 1.0.8.
Server: Windows 2008.

We've attempted to connect using the server's hostname, and its IP address. Both get the same results:

Questions:

*

*what firewall rules need to be in place on the server to allow authentication to occur?

*any other considerations to managing VMWare Server remotely?

A: There are some known issues with running the VMware client on Windows 7, but I assume you've already dealt with that - correct?
I'm not very familiar with that old of a version of VMWare, but are you attempting to connect directly to the ESX host or Virtual Center (did they even call it that back then?).
According to this document:
http://www.vmware.com/support/vc11/doc/c3firewall.html
You just need ports 902 and 905 open.


text:
Q: Install pylibmc on windows installing pylibmc for python in Windows. I am running pip install pylibmc, however, it's giving me this error:
error: command 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\B
IN\cl.exe' failed with exit status 2


text:
Q: Trying to follow the example for ToTraceString(), but it fails. Why? I've got to find a way to find out what the SQL SELECT that is being generated when interacting with EF, is. I found the MSDN online help describing it ObjectQuery.ToTraceString Method() and I am certain that I've followed the example exactly, but it is failing. I am getting the following error:
CS1503  Argument 2: cannot convert from 'string' to
'System.Linq.Expressions.Expression<System.Func<ResearchTableUpdates.Model.Template, bool>>'

I don't get why I'm getting this error. Here's the code that generates the error:
using (var db = new MyDbContext())
{
    int idNum = 1;
    ObjectQuery<Model.Template> oqTemplate = db.Templates.Where("it.ID = @idNum");
    oqTemplate.Parameters.Add(new ObjectParameter("idNum", idNum));
    Console.WriteLine(oqTemplate.ToTraceString());

The MyDbContext is a class I defined. Here is it's definition:
public class MyDbContext : Model.CoreFrameworkEntities
{
    public override int SaveChanges()
    {
        var modifiedEntities = ChangeTracker.Entries()
                .Where(p => p.State == EntityState.Modified)
                .Select(p => p.Entity);

        foreach (var modified in modifiedEntities)
        {
            Console.WriteLine();
            //modified.LastModifiedAt = now;
            Console.WriteLine(modified.ToString());
            Console.WriteLine();
        }
        return base.SaveChanges();
    }
}

And finally Model.CoreframeworkEntities is an EF model defined creating a .edmx file. It is one of the entities in the .edmx. (It is my understanding that any entity defined in a .edmx file is a DbContext data type. Now, if that's wrong, I'd love to know.)
I'm not sure why I'm getting the error that I am. It seems to me as though I've followed the MSDN article in code. Either the MSDN article is no longer valid or I've made a mistake, possibly in my understanding as to what the entities in a entity-relationship/.edmx file are all about.

A: That's because that article uses context inherited from ObjectContext. You use context inherited from DbContext. That old ObjectContext has ObjectSets which indeed has Where overload which accepts string and returns ObjectQuery. However DbContext (which you use) has DbSets and Where methods on them do not accept strings, but only Expressions hence your error. With DbContext you usually either use interceptors, or Database.Log property, like this:
db.Database.Log = Console.WriteLine; // or any other handler
var templates = db.Templates.Where(c => c.ID == idNum).ToArray(); // sql will be written to console.

As Gert Arnold mentions in comments, you can also call ToString() on query:
db.Templates.Where(c => c.ID == idNum).ToString()

However in some cases you cannot do that (for example you end your query with Count(), or First() and so on). But when you can do that, and you need only sql for a certain single query - of course ToString method is better.


text:
Q: Need suggestion to fix website load time issue I want some suggestion to fix site speed problem i am using Apache and nginx need some configuration to fix load time issue
My VPS specification
> 30GB Ram
> 2000 GB SSD-boosted
> 1 Gbit/s port UNLIMITED Traffic
> UP steam 120 Gbit/s
> Six cores Processor

I am using sentora(zadmin) web panel i am facing too much load time issue my server response is good but page take too much time to load i thing there is problem with my web panel configuration.
PING DATA
---   DIRECT SERVER IP DATA   ---
Pinging 173.212.213.220 with 32 bytes of data:
Reply from 173.212.213.220: bytes=32 time=279ms TTL=47
Reply from 173.212.213.220: bytes=32 time=277ms TTL=47
Reply from 173.212.213.220: bytes=32 time=278ms TTL=47
Reply from 173.212.213.220: bytes=32 time=278ms TTL=47

Ping statistics for 173.212.213.220:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 277ms, Maximum = 279ms, Average = 278ms

   --- IP BIND BY CLOUDFLARE ---
Reply from 104.18.60.166: bytes=32 time=147ms TTL=52
Reply from 104.18.60.166: bytes=32 time=147ms TTL=52
Reply from 104.18.60.166: bytes=32 time=147ms TTL=52
Reply from 104.18.60.166: bytes=32 time=146ms TTL=52

Ping statistics for 104.18.60.166:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 146ms, Maximum = 147ms, Average = 146ms

Server running on Cantos 6.9

Updated

error log
[Tue Jun 19 07:53:58 2018] [error] child process 4442 still did not exit, sending a SIGKILL
[Tue Jun 19 07:53:59 2018] [notice] caught SIGTERM, shutting down
[Tue Jun 19 07:54:00 2018] [notice] Digest: generating secret for digest authentication ...
[Tue Jun 19 07:54:00 2018] [notice] Digest: done

Apache httpd.conf
<IfModule prefork.c>
StartServers       16
MinSpareServers    10
MaxSpareServers   40
ServerLimit      1024
MaxClients       1024
MaxRequestsPerChild  4000
</IfModule>

<IfModule worker.c>
StartServers         4
MaxClients         300
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>


text:
Q: App icons don't match the 57 and 114 field icons in MonoTouch! I am having some issues assigning the iPhone app icons in MonoTouch -
Initially I only had an 114x114 icon and so assigned it to the iPhone4 field (in the Icon's tab) that expects the 114 image but it didn't come through - neither on the simulator nor the phone itself.  Then when I renamed the icon to icon.png and placed it in the root of the app it comes out ok for some reason...
Now I also created a 57x57 icon and once assigned to the iPhone field in the 'Icons' tab the result is unexpected....
It seems like MonoTouch reverses the icons!!  I have taken the icon.png out of the root folder and the 57x57 is shown on my iPhone4.  However, if I select the 114x114 icon into the 57x57 field and vice versa for my 57x57 icon (place it in the field that expects the 114x114 icon) - you guessed it - it all seems to work! Very strange!!
My crystal sharp icon is displayed on my iPhone4 (even though it is now specified in the 57px field)!  If I then reverse it back to the proper way 'it should be given to MonoTouch' I get a more fuzzy icon on my iPhone4 (ie the 57x57 version).
Has anyone else had difficulties with these icons?  What am I doing wrong?
Any help very much appreciated!!

A: The MonoTouch project property editors are there help manage the icons but you really can't skirt the conventions that iOS expects.  I am not sure exactly what you're doing in your project but it sounds like you aren't following the icon guidelines and conventions.
I'd recommend making sure you're following the guidelines established for icons set out in the iOS developers guide.  Here is a link to the guide which discusses the sizes, what each size is used for and, most importantly, what the icons should be named.  Do this and I think you'll find that your icon issues will be resolved.


text:
Q: I can't replace my user's image with a new image with Axios React Node I am creating a corporate social network and I would like to create a button change the user's image, except that I have a problem when I send my image to me send invalid format while I put a correct format. At your disposal you have the code for my image button etc and you have my back side on which I make my call to update the user's image, and two screens with what the console returns to me.
Code button :
  const [file, setFile] = useState()

  function handleChange(event) {
    setFile(event.target.files[0])
  }

  function handleSubmit(event) {
    event.preventDefault()
    const url = 'http://localhost:4200/api/user/upload';
    const formData = new FormData();
    formData.append('file', file);
    formData.append('fileName', file.name);
    const config = {
      headers: {
        'content-type': 'multipart/form-data',
      },
    };
    axios.post(url, formData, config).then((response) => {
      console.log(response.data);
    });

  }

return (
    <>
      <Topbar />

              {user && }

            <form onSubmit={handleSubmit}>

Modifier img

              <input type="file" onChange={handleChange} />
              <button type="submit">Upload</button>
            </form>

                {user &&
{user.nom} {user.prenom}
}
                {user && {user.bio}}
                <input type="text" onChange={(e) => { setUserBio(e.target.value) }}/>
                <button onClick={testbio} >modifier descirption</button>

            <Feed />

    </>
  );
}

Code Backend :
const UserModel = require("../models/user.model");
const fs = require("fs");
const { promisify } = require("util");
const pipeline = promisify(require("stream").pipeline);
const { uploadErrors } = require("../utils/errors.utils");

module.exports.uploadProfil = async (req, res) => {
  try {
    console.log({file :req.file, body : req.body});
    if (
      req.file.mimetype != "images/jpg" &&
      req.file.mimetype != "images/png" &&
      req.file.mimetype != "images/jpeg"
    )
      throw Error("invalid file");

    if (req.file.size > 500000) throw Error("max size");
  } catch (err) {
    const errors = uploadErrors(err);
    return res.status(201).json({ errors });
  }
  const fileName = req.body.name + ".jpg";

  await pipeline(
    req.file.stream,
    fs.createWriteStream(
      `${__dirname}/../images/profil/${fileName}`
    )
  );

  try {
    await UserModel.findByIdAndUpdate(
      req.body.userId,
      { $set : {picture: "./images/profil/" + fileName}},
      { new: true, upsert: true, setDefaultsOnInsert: true},
      (err, docs) => {
        if (!err) return res.send(docs);
        else return res.status(500).send({ message: err });
      }
    );
  } catch (err) {
    return res.status(500).send({ message: err });
  }
};


text:
Q: Simple Algebra Question on the system $x - 2y = 6,\;ax + y = 4$ I'm having difficulty understanding this problem from Brilliant's course on Linear Algebra. Here is the text:

Let's write down the general system: $$x - 2y = 6,\quad\quad ax + y = 4,$$ where $a$ is some real number. Try solving by taking $a$ times the first equation, minus the second. This gives: $$(-2a - 1)y = 6a - 4.$$

I don't understand how the left side of this equation is being constructed. Particularly, I'm lost as to how we end up with $-2a$, and even more lost as to where the $-1$ has come from.
It's been 25 years since I took Algebra I.

A: You have two equations $x - 2y=6$ and $ax + y = 4$. If you multiply the first equation by $a$ both sides you get $a(x - 2y)=6a$ which is $ax - 2ay=6a$. Now subtract the second equation from this one to get
\begin{align}
ax - 2ay&=6a \\
-ax - y &= -4
\\-----&-----\\
-2ay-y&=6a-4
\end{align}
Now factor $y$ from the left side  to get $(-2a-1)y=6a-4.$


text:
Q: How to update in DetailsView in asp.net web forms using entity framework 4.0 I have created a web form "Product.aspx" from where products are getting inserted in database.
I have used entity framework 4.0 and I am using DetailsView to insert data
    <asp:DetailsView ID="DV_Product" runat="server" Height="70px" Width="60%"
    AutoGenerateRows="False" DataKeyNames="ProductId" DataSourceID="EDS_Product"
    DefaultMode="Insert" OnItemInserting="DVProduct_ItemInserting">
    <Fields>
        <asp:BoundField DataField="Product1" HeaderText="Product" SortExpression="Product1" ControlStyle-Width="250"/>
        <asp:TemplateField HeaderText="Category">
            <InsertItemTemplate>
                <asp:EntityDataSource ID="EDS_Category" runat="server" ConnectionString="name=SpunkKraftEntities1"
                    DefaultContainerName="SpunkKraftEntities1" EnableDelete="True"
                    EnableFlattening="False"  EntitySetName="Categories" EntityTypeFilter="Category">
                </asp:EntityDataSource>
                <asp:DropDownList ID="DD_Category" runat="server" DataSourceID="EDS_Category" Width="250"
                    DataTextField="Category1" DataValueField="CategoryId" OnInit="DD_Category_Init">
                </asp:DropDownList>
            </InsertItemTemplate>
        </asp:TemplateField>

        <asp:TemplateField HeaderText="Description" >
            <InsertItemTemplate>
                <asp:TextBox ID="txt_Description" runat="server" TextMode="MultiLine" OnInit="txt_Description_Init" Width="250">
                </asp:TextBox>
            </InsertItemTemplate>
        </asp:TemplateField>

        <asp:BoundField DataField="Unit Price" HeaderText="Unit Price"  />
        <asp:TemplateField HeaderText="Upload Image">
            <InsertItemTemplate>
                <asp:FileUpload ID="fu_image" runat="server" OnInit="fu_image_Init"/>
            </InsertItemTemplate>
         </asp:TemplateField>
        <asp:CommandField ShowInsertButton="true" />

    </Fields>
</asp:DetailsView>

I have another page "ManageProduct.aspx" where I have used gridview to display list of products

I want to edit records in DetailsView. What I can imagine is when I click on "Select" or "Edit" then it should redirect to the "Product.aspx?ProductId=x" and fill the product details in DetailsView. What I want to ask is how can I redirect with the product Id and once redirected to "Product.aspx" how could I fill the details and update ?

A: Try in this way,and here am considering your Product Id as Product Name.
On RowEditing event, do like this
Response.Redirect("Products.aspx?Id="+GridView1.SelectedRow.Cells[2].Text);

On page_load of Products.aspx mention like this,
if(Request[Id]!=null)
{
    string demo = Request[Id].ToString();
    SqlConnection con = new SqlConnection("Your connection String");
    SqlCommand cmd = new SqlCommand("Select * from Your table where name = '"+demo+"'")
    SqlDataReader dr = cmd.ExecuteReader();
    while(dr.Read())
    {
       DetailsView1.Rows[0].Cells[2].Text = dr.GetString(0);//Your Product goes here
       // Proceed the same for your remaining entries
    }
}

Hope you might got some ideas to go further. In case of any confusion from my answer. Please let me know.


text:
Q: How do I auto adjust the numbering in citations? I am writing a report with a number of citations that are continuously being updated. I typically use \bibitem for my bibliography. But I am unable to auto adjust the numbering of these through the document, I would like them to appear as [1], [2],....[5] etc. Currently [5] appears in chapter 1 whereas [1] is in the next section. Is there a way to adjust this using bibitem? I use OVERLEAF.
I am new to .bib files but I tried the .bib file but i got no output from it for some reason. I use Zotero as my library and i extracted the bib file from there.  I can link the literature through the \cite command, for eg \cite{google} but it appears as [google] in the text with the bibliography not being printed at the end with the print biblio command.
Any help would be appreciated.
Edit 1
Here is what I have tried. In my document, before the \begin{document} line, I used
\usepackage[sorting=none]{biblatex}
  \bibliography{Phd.bib}
 \bibliographystyle{unsrt}

Just at the end where I need the bibliography to appear I used \printbibliography.
The Phd.bib file contains one item for now, just to test.
@article{pant, title={Influence of oxide films on primary water stress corrosion cracking initiation of alloy 600},
 volume={348}, ISSN={00223115},
 DOI={10.1016/j.jnucmat.2005.10.002},
 abstr number={1–2},
 journal={Journal of Nuclear Materials},
 author={Panter, J. and Viguier, B. and Cloué, J.-M. and Foucault, M. and Combrade, P. and Andrieu, E.},
 year={2006},
 month={Jan},
 pages={213–221}, }

I use \cite{pant} which ends up as [pant] on my pdf and no bibliography printed. I use overleaf so I am not sure how to individually run bibtex?


text:
Q: Native rotation for dx-input I'm using devExtreme to use some input with min & max. Here's my code :
<dx-slider [min]="0" [max]="100" [value]="data.value"></dx-slider>

My questions are those :
1) Is there a way to rotate vertically this input? Maybe with a rotation property?
2) Is there a way to stop the event when i "slide" up & down this element?
I've tried rotatating the component with css in this way :
  transform: rotate(-90deg);

but the result is that the input is correctly rotate by 90 deg, but instead of goind "up and down" with the scroll to change the value, I have to go from left to right (obviously), so I wanted, in case there is no way to native rotate this component, to stop the event and replace somehow with a my custom event.
Thank you in advice.
Jacopo.

A: Devexpress official answer
dxSlider is rendered as several nested elements and each of them uses its own style that is used for the slider functionality. So, the use of the CSS transform attribute is not enough to rotate dxSlider since this attribute does not influence the functionality. I am afraid dxSlider does not provide a way to rotate its content.


text:
Q: Ubuntu 14.04 GPU passthrough problem with IOMMU I have a problem with my GPU passthrough on Ubuntu 14.04, i checked my hard ware and my CPU is i7-2600 which supports VT-x in KVM and i try to passthrough my GTX 960. I did everything exactly as in the pudgetsystems guide. The error i get when i try to launch my VM:
# boris@boris-H61M-S2V-B3:~$ sudo /usr/vm1
[sudo] password for boris:

qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: vfio: error no iommu_group for device
qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: Device initialization failed.
qemu-system-x86_64: -device vfio-pci,host=0000:01:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on: Device 'vfio-pci' could not be initialized

A: You also have to own a compatible motherboard.
Did you enable VT-x and VT-d in your bios?
Did you blacklist your card's kernel driver in /etc/modprobe.d/blacklist.conf? If not, append blacklist nouveau to the end of the file.
Double-check your /etc/initramfs-tools/modules, /etc/default/grub, /etc/modules, and /etc/vfio-pci#.cfg files. (Making sure to run update-grub and update-initramfs -u)
Make sure your card id is claimed by stub with:
dmesg | grep pci-stub


text:
Q: Garbled graphics in text mode environments (pre-boot/BIOS) only, not in Windows
I'm getting garbled graphics on my computer in text mode environments, such as in the BIOS or before loading Windows. However, I don't have any graphical issues in Windows.
Graphics card is a GeForce 8800 GT, on a MSI P35 Neo motherboard model MS-7360.
Edit:
Seems the capacitors on the card are bulging. I managed to fix my TV on my own by replacing them (repairman wanted $100!), and I might try doing this on my graphics card. It's a long shot, but I might be able to do this and see if this is the problem.

A: Its your GPU. Its not the exact same issue but its a minor miracle your GPU still works.
Basically nearly everything in the 8xxx family was flawed and tended to fail due to issues with the BGA soldering on the video card.
These issues could manifest themselves in many different ways - dell put out a recall on laptop GPUs with the same chip family and I've personally had failures of a 8300 and a 8800. Text mode wierdness is more common - like the famous image, but I'm guessing that your pre-boot drive practitioner runs in that mode.
Bob pointed out its a G92
And... its also apparently buggy
You should consider planning to get a new video card.

A: Pretty sure your graphics card is bad. Bulging capacitors are never a good sign.
Back then, a lot of hardware components had faulty capacitors which would eventually fail. These capacitors had improper chemistry which caused them to pressurize during operation and ultimately leak caustic electrolyte. This problem was called capacitor plague and it forced a lot of computer manufacturers to recall and replace hardware.
Given the age of the machine (the Intel P35 chipset is seven years old), you should consider getting a new computer.


text:
Q: Javascript Validation (gen_validatorv4.js ) - based on checkbox results I created an order form as follows which contains multiple checkboxes to add items, Now I want to do the validation for disabled items when only user click on the related check box, Kindly help me to correct the following code.

<form action="order.php" method="POST" name="orderform" id="orderform" onSubmit="return validation();">

Order Item 1 :
 	 <select id="item1" name="item1">
      <option value="0" selected="selected">
 [Select]
</option>
      <option value="1">
 Product 1
</option>
      <option value="2">
 Product 2
 </option>
      <option value="3">
 Product 3
 </option>
</select>

Quantity :
	<input style="width:30px;" name="qty1" type="text">

<input type="checkbox" name="check2" onclick="check_box2(this.checked)" >Add Item 2 : 	 <select id="item2" name="item2">
      <option value="0" selected="selected">
 [Select]
</option>
      <option value="1">
 Product 1
</option>
      <option value="2">
 Product 2
 </option>
      <option value="3">
 Product 3
 </option>
</select>

Quantity :
	<input style="width:30px;" name="qty2" type="text">

 <input type="checkbox" name="check3" onclick="check_box3(this.checked)" >Add Item 3 :  	 <select id="item3">
      <option value="0" selected="selected">
 [Select]
</option>
      <option value="1">
 Product 1
</option>
      <option value="2">
 Product 2
 </option>
      <option value="3">
 Product 3
 </option>
</select>

Quantity :
	<input style="width:30px;" name="qty3" type="text">

 <input type="checkbox" name="check4" onclick="check_box4(this.checked)" >Add Item 4 :  	 <select id="item4">
      <option value="0" selected="selected">
 [Select]
</option>
      <option value="1">
 Product 1
</option>
      <option value="2">
 Product 2
 </option>
</select>

Quantity :
	<input style="width:30px;" name="qty4" type="text">

<input name="submit" type="submit" value="Send">

</form>

A: You just add some conditions:
if(document.getElementById('checkbox123').checked == true) {
  // validate code here
}

You can do it like this as well:
if(document.orderform.checkbox123.checked == true) {
  // validate code here
}

A: Able to do the validation by using VWZ_IsChecked() function which is included in gen_validatorv4.js script
frmvalidator.addValidation("item2","dontselect=0", "Please select an item2",
    "VWZ_IsChecked(document.forms['orderform'].elements['check2'],'check2')");

frmvalidator.addValidation("qty2","req","Please enter your quantity for item 2",
    "VWZ_IsChecked(document.forms['orderform'].elements['check2'],'check2')");


text:
Q: Microsoft SpeechSynthesizer (TTS) Voice Crackle When using Microsoft SpeechSynthesizer voices sometimes crackle, are fuzy...
// Initialize a new instance of the SpeechSynthesizer.
SpeechSynthesizer synth = new SpeechSynthesizer();

// Configure the audio output.
synth.SetOutputToDefaultAudioDevice();

// Speak a string.
synth.Speak("This example demonstrates a basic use of Speech Synthesizer");

I assume it is related to CPU usage. But it happend on powerfull computer too. Is there any best practices or workaroud ?

A: Adjust the rate downwards, until the crackling disappears.


text:
Q: Akka Streams (Scala): Filtering out exceptions One of the steps in my akka streams pipeline is a transformation that throws an exception when it receives an invalid input.  I would like to discard these problematic inputs.  So, I came up with the following solution:
...
.map( input => Try( transformation( input ) ).toOption )
.filter( _.nonEmpty )
.map( _.get )
...

Which takes 3 steps for what is, in fact, just a flatMap.
Is there a more straightforward akka way of doing this?

A: You can use Supervision Strategies. Taken from the doc:
val decider: Supervision.Decider = {
  case _: ArithmeticException => Supervision.Resume
  case _                      => Supervision.Stop
}

val flow = Flow[Int]
  .filter(100 / _ < 50)
  .map(elem => 100 / (5 - elem))
  .withAttributes(ActorAttributes.supervisionStrategy(decider))

You can configure the Decider for doing whatever you need. If you need to skip that element for all Exceptions use
 case _: Throwable => Supervision.Resume

Take a look to https://doc.akka.io/docs/akka/current/stream/stream-error.html

A: If you want to silently discard the exceptions as indicated in your sample code, here's a couple of ways to reduce the steps:
// A dummy transformation
def transformation(i: Int): Int = 100 / i

// #1: Use `collect`
Source(List(5, 2, 0, 1)).
  map(input => Try(transformation(input)).toOption).
  collect{ case x if x.nonEmpty => x.get }.
  runForeach(println)
  // Result: 20, 50, 100

// #2: Use `mapConcat`
Source(List(5, 2, 0, 1)).
  mapConcat(input => List(Try(transformation(input)).toOption).flatten).
  runForeach(println)
  // Result: 20, 50, 100

Note that there is no flatMap for Akka Source/Flow, although mapConcat (and flatMapConcat) does function in a somewhat similar fashion.


text:
Q: json vs jsonb postgresql ¿Cual es la diferencia entre json y jsonb?
El usuario @EmilioPlatzer me dio una respuesta a otra pregunta  donde usa estos 2, pero no veo la diferencia.
De hecho, el usuario comenta lo siguiente:

json vs jsonb
A los efectos de este problema da lo mismo, se puede usar array u object en ambas variantes. Recomiendo jsonb, pero ese es otro tema.

Acá un fiddler donde uso json y acá un fiddler donde uso jsonb
Personalmente no veo ninguna diferencia, ni en tiempo de respuesta del sql.

A: Resumen
La diferencia es interna. ¿qué se almacena y cuándo se hace la conversión?

*

*json: almacena el texto, la conversión se hace en cada SELECT, ventajas: el insert es más rápido, se almacena textualmente lo que se especifica (y no hay una única manera de escribir un objeto JSON).

*jsonb: almacena el objeto, la conversión se hace en cada INSERT, ventajas: los selects son más rápidos, lo que se almacena está estandarizado

Deberías preferir jsonb en todos los casos, salvo que el INSERT sea tu operación crítica.

A: jsonb almacena nos datos en un formato binario, además permite índices. Mientras que el formato json guarda el texto, incluyendo los espacios. Debido a la conversión el formato jsonb puede ser un poco más lento al guardarlo, pero gracias a su índice es mucho más rápido en las búsquedas.
La propia documentación de Postgres indica que a menos que haya una razón específica para usar el otro tipo, se debe preferir jsonb.


text:
Q: How do I navigate through 5 diffrent divs with a single button I have 5 divs with ids; #one, #two, #three, #four and #five. I have a navigation menu linked to each div like this;

ONE

TWO

THREE

FOUR

FIVE

where each div represents a single page on my website, the the ul works perfectly but is there a way  can have a single button like a "next" button that will go to page 2 when clicked and when clicked again will go to page 3 and so on... preferably using some sort of jquery or even javascript

A: I will respond based on the assumption that this is a purely theoretical exercise and given only the information you have provided.  Please note that there are better ways of doing what you ask, as alluded to in the first comment.
However, assuming that you have, as you say, got an identical navigation menu on each page, and that, as you say, each div is on a separate web page, I suggest that you could continue your existing methodology and place a "Previous" and "Next" button on each page, and hook it up manually to the correct page.
For example, on page with #one, you would have buttons that might look like this:
Previous
Next

On subsequent pages, you would hard-code the links to the other pages, and on the final page you would blank out the Next button in a similar way to the way the Previous button was blanked out above.
Having said that.  You could put all Divs in the same web page, and show/hide them using JavaScript and CSS.  For example:

Div 1

Div 2

Div 3

You could then call that JS function on the onClick event of the next/previous buttons.
<input type="button" text="Next" onclick="focusOnAParticularDiv('two');" />

Or something like that...
You could choose to use JQuery's shortcuts if you wish.
Alternatively, you could use an ASP.NET Wizard control :)
As mentioned in some other comments, you can also create the div the user is after at the server side, which would avoid sending ALL the divs to the client on the first request (this would speed up the user's first request).  This would mean you do not need any JavaScript, but would also mean that each time the user clicked a button the page would be destroyed and recreated on the server and sent back to the client (a full round-trip), which would have an impact on the number of hits your server gets.
It really depends what you're after and what your criteria are; hence why I have tried to cover several bases for you.

A: JQuery has a trigger event. You can trigger click event on your links when a user clicks next or previous button.

A: Something like
$(document).ready(function() {
  var links = [];
  var cnt=0;
  $("ul li a").each(function(i) {
    links[i] = this.href;
  });
    $("#next").click(function(e) {
      cnt++;
      if (cnt>=links.length) cnt=0;
      location.hash=links[cnt].split("#")[1];
      e.preventDefault();
    });
});


text:
Q: IIS First Start is too slow I have an application that takes about 20 or 30 minutes to run completely after the IIS restart. While that it happens the pages are very slow and many timeouts are displayed.
Can anyone help me to diagnose this?
Aplication Server: IIS 7,5
System: Window 2008 r2 sp1
CPUs: 8
RAM: 16gb
Application DLLs quantity: 2083
.NET version: 3,5

A: Try this:

*

*Read the timeout messages. See if that tells you where the slowdown is.

*Set some breakpoints in the code. You can use them to narrow down the slow place or places.

A: To solve my problem I've needed to eliminate about 1000 dlls.


text: Q: General Linear Group over F I understand that for the real numbers $GL_{n}(R)$ is the set of $n$ by $n$ matrices with real entries and nonzero determinant. If we consider a general linear group over an arbitrary field $F$ I know that the entries are from the field $F$, but does this also mean that the determinant is not equal to $0$ the real number or the determinant is not equal to the additive identity $0_{F}$?


text:
Q: LDAP Client change Unix and Samba password I have to work in a mixed Windows/Linux world as far as desktop clients are concerned.  I've got a central OpenLDAP server with Samba3 that serves a fake windows domain which keeps the Windows guys happy.
I've then set up the Ubuntu clients to authenticate via LDAP which keeps them happy.
Heres where I'm falling over, on Windows if a user changes their password the Unix and Samba passwords get updated. Great.
On Ubuntu, only the unix password gets updated so next time they use a Windows machine they can't log in/have to use their old password.
What is the preferred solution to updating both passwords? Should I just install likewise-open on Ubuntu and make it join the fake Windows domain?
It just seems odd to my mind to make an Ubuntu server pretend to be a Windows server so that an Ubuntu client can pretend to be a Windows client logging into an Ubuntu server pretending to be a Windows server.
Any info would be appreciated.


text:
Q: if else shows same result always in c++ hi here is my code and it always show result for first if statement. For instance, when i write 56, it shows 43 even i choose whether venus or mars. why ?

    #include <iostream>
#include <string>
using namespace std;
int main() {
  int weight2;
  int mass;
 string planet;

 double mars = 0.39;
  double venus = 0.78;

  std::cout << "Your weight on Earth:";
  std::cin >> mass;
  std::cout << "Which planet you wanna fight on:";
  std::cin >> planet;
  if (planet == "venus" || "Venus") {
    mass = mass*0.78;
    std::cout << mass;
  }
  else if (planet == "mars" || "Mars") {
    mass = mass*0.39;
    std::cout << mass;
  }

  else {
    std::cout << "Are you in a paralel universe?";
  }


text:
Q: Using celery, send async_apply to specific vhost? I have a use case where I'd like to be able to have many clients connect to RabbitMQ but they cannot see each other's messages. I believe using vhosts is the best way to keep privacy between the workers?
I thought I'd be able to pass a virtual_host argument to apply_async but that's not going to work, I believe I have to make a custom connection like so:
from kombu import Connection

my_connection = Connection(virtual_host='new_virtual_host')

task.apply_async(connection=my_connection)

However, I bet there's a built in way to do that inside Celery using the settings I already have configured and going through the proper channels in case I switch backends. What is that internal "get connection" function?
This is using Celery 3.1
EDIT:
Current attempt, not working in that it seems to just return a regular connection not using the specified virtual host...
from celery.app import app_or_default
app = app_or_default()
with app.broker_connection(virtual_host='other') as new_connection:
    task.apply_async((data,), connection=new_connection)

If I check new_connection the virtual_host kwarg has been ignored.. hmm...

A: A ha! So, it turns out Celery accepts the broker_url then ignores virtual_host since broker_url is set. It appears to work fine doing it this way, manually setting the property we want:
from celery.app import app_or_default

app = app_or_default()

with app.connection() as new_connection:

    # setting here instead of kwargs above
    new_connection.virtual_host = 'other'

    task.apply_async((data,), connection=new_connection)

Doing it this way when I change any regular CELERY or BROKER settings, it will apply to these new connections as well -- yay!


text:
Q: Unable to find the SharePoint 2010 Server SP1 Download link I tried every where and i am unable to find the SharePoint 2010 SP1 download link.
Will installing SharePoint 2010 Server Sp2 installs SP1 as well?

A: SharePoint 2010 SP1 is gone, now you will get only SharePoint 2010 SP2 (which include all the previous updates). You can install the March CU after that.
I checked from MSDN and they have only SharePoint 2010 SP2 only.


text:
Q: Azure blobs - cannot display image store in blob container in MVC 4 Question background:
I have a basic MVC 4 site and am trying to display a picture  that is stored in a blob storage container in my Azure cloud account. I store a list of image Uri's in a string List and pass these to a View where they should display
The Issue:
I can't seem to get the file name of the image stored in the container.
The following image shows the container in Azure. Note that there is an image stored in it with a size of 101.28KB:

This is the code I am trying to use to retrieve the blobs and then read the image Uri's:
AzureStorageController with a Pics Action Method:
 public ActionResult Pics()
    {
        var imageList = new List<string>();

        var imagesAzure = new myBlobStorageService();

        var container = imagesAzure.GetCloudBlobContainer();

        foreach (var blobItem in container.ListBlobs())
        {
            imageList.Add(blobItem.Uri.ToString());
        }
        return View(imageList);
    }

The GetCloudBlobContainer Method of the myBlobStorageService class:
 public CloudBlobContainer GetCloudBlobContainer()
    {
        string accountName = "fmfcpics";

        string accountKey = "xxxxxx/yyyyyyyyy/3333333333==";

        StorageCredentials credentials = new StorageCredentials(accountName, accountKey);

        CloudStorageAccount storageAccount = new CloudStorageAccount(credentials, true);

        CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

        CloudBlobContainer container = blobClient.GetContainerReference("images");

        if (container.CreateIfNotExists())
        {
            container.SetPermissions(new BlobContainerPermissions() { PublicAccess = BlobContainerPublicAccessType.Blob });
        }

        return container;
    }

The Pics View:
@{
ViewBag.Title = "Pics";
}

Pics

@foreach (var item in Model)
{

}

The Uri that is in the list that is being passed to the Pics View is: https://fmfcpics.blob.core.windows.net/images/myblob but it does not feature the image file name.
Any help with this would be appreciated.

A: As Guarav has stated already, a good thing to check would be to make sure your container is not "Private".


text:
Q: PHP spawn process How can I spawn a process in a PHP page in order to start a program that survives the execution time of the request?
In other words, I want the page to have a normal lifetime (few milliseconds) but launch a program that keeps running on the server. Thanks

A: Use this code:
<?php exec('nohup /usr/bin/my-command > /dev/null 2>&1 &'); ?>

This forks the sub-process into the background and writes all of the output into /dev/null. That way PHP continues executing the script as if there won't be any output it has to wait for.

A: I would suggest you to use CRON if you need to start a process on a time basis.


text:
Q: Python - program for searching for relevant cells in excel does not work correctly I've written a code to search for relevant cells in an excel file. However, it does not work as well as I had hoped.
In pseudocode, this is it what it should do:
Ask for input excel file
Ask for input textfile containing keywords to search for
Convert input textfile to list containing keywords
For each keyword in list, scan the excelfile
If the keyword is found within a cell, write it into a new excelfile
Repeat with next word

The code works, but some keywords are not found while they are present within the input excelfile. I think it might have something to do with the way I iterate over the list, since when I provide a single keyword to search for, it works correctly. This is my whole code: https://pastebin.com/euZzN3T3
This is the part I suspect is not working correctly. Splitting the textfile into a list works fine (I think).
#IF TEXTFILE
elif btext == True:
    #Split each line of textfile into a list
    file = open(txtfile, 'r')
    #Keywords in list
    for line in file:
        keywordlist = file.read().splitlines()
    nkeywords = len(keywordlist)
    print(keywordlist)
    print(nkeywords)

    #Iterate over each string in list, look for match in .xlsx file
    for i in range(1, nkeywords):
        nfound = 0
        ws_matches.cell(row = 1, column = i).value = str.lower(keywordlist[i-1])
        for j in range(1, worksheet.max_row + 1):
            cursor = worksheet.cell(row = j, column = c)
            cellcontent = str.lower(cursor.value)
            if match(keywordlist[i-1], cellcontent) == True:
                ws_matches.cell(row = 2 + nfound, column = i).value = cellcontent
                nfound = nfound + 1

and my match() function:
def match(keyword, content):
"""Check if the keyword is present within the cell content, return True if found, else False"""
if content.find(keyword) == -1:
    return False
else:
    return True

I'm new to Python so my apologies if the way I code looks like a warzone. Can someone help me see what I'm doing wrong (or could be doing better?)? Thank you for taking the time!

A:
Splitting the textfile into a list works fine (I think).

This is something you should actually test (hint: it does but is inelegant). The best way to make easily testable code is to isolate functional units into separate functions, i.e. you could make a function that takes the name of a text file and returns a list of keywords. Then you can easily check if that bit of code works on its own. A more pythonic way to read lines from a file (which is what you do, assuming one word per line) is as follows:
with open(filename) as f:
    keywords = f.readlines()

The rest of your code may actually work better than you expect. I'm not able to test it right now (and don't have your spreadsheet to try it on anyway), but if you're relying on nfound to give you an accurate count for all keywords, you've made a small but significant mistake: it's set to zero inside the loop, and thus you only get a count for the last keyword. Move nfound = 0 outside the loop.
In Python, the way to iterate over lists - or just about anything - is not to increment an integer and then use that integer to index the value in the list. Rather loop over the list (or other iterable) itself:
for keyword in keywordlist:
    ...

As a hint, you shouldn't need nkeywords at all.
I hope this gets you on the right track. When asking questions in future, it'd be a great help to provide more information about what goes wrong, and preferably enough to be able to reproduce the error.


text:
Q: Monitor connection to SQS and reconnect if it's lost I have a Spring-Boot microservice which listens to Amazon SQS queue. Listener's configured as such:
@SqsListener(value = "${sqs.queue.name}", deletionPolicy = ON_SUCCESS)
public void queueListener(Message message) throws Exception {
    // some logic here
}

Everything works fine, but from time to time for the reason I can't understand (there are no exceptions or anything) my microservice just stops receiving messages. According to Amazon SQS console messages just start piling up in the queue and no one reads them.
If I redeploy the microservice all piled up messages are being processed in no time. And everything works fine for the time being, until this problem appears again.
My idea was to implement some cron-job which will monitor the connection to SQS. And if connection is lost (if it's the case in the first place) I'd reestablish it.
So is there a way to connect to SQS and start listening the queue not during application startup, but in runtime?
I'm using Spring-Boot 2.4.0. I also have these dependencies:
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-aws-messaging</artifactId>
    <version>1.2.2.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-aws-autoconfigure</artifactId>
    <version>1.2.2.RELEASE</version>
</dependency>


text:
Q: Adding google oauth to laravel webservice i have an android app with laravel webservice for server side. i want to add register/login with google (oauth2) to android app. for now, users can register with sms and email-pass in android app using

laravel/passport

in server side. i now how to add google oauth to laravel but i don't know how to add it to laravel so users be able to register/login with google account from android app. when a request came  from user (android) first it goes to

public function redirectToProvider()

which redirects to google. from now what i must do? i must redirect to google or i must return a response with json to user that contains GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET ? and what i should do next?


text:
Q: How do I pause and resume audio in a different method than from the method it was made in? I am trying to make a game and attempting to make a "mute" and "unmute" button, but I cant figure out how to make it so when you push the button it stops the same clip that is being played at the beginning of the program. (using different methods of course).
I attempted to make the clip and audio public, but I keep getting an error and I'm not sure why.
public class TowerDefense
{
    String filepath = "MenuTheme.wav";
    private Clip clip;
void playMusic(String musicLocation)
{
    try{
        File musicPath = new File(musicLocation);

        if(musicPath.exists())
        {
        AudioInputStream audioInput = AudioSystem.getAudioInputStream(musicPath);
        clip = AudioSystem.getClip();
        clip.open(audioInput);
        clip.start();
        clip.loop(Clip.`LOOP_CONTINUOUSLY`);
        }
    }
    catch(Exception ex)
    {
        ex.printStackTrace();
    }
}
void pauseMusic(String musicLocation2)
{
long clipTimePosition = clip.getMicrosecondPosition();
clip.stop();
}
==============
//this is in a different private method called Options
panel.setButtonsActionListener2(**new** ActionListener(){
    @Override
    public void actionPerformed(ActionEvent e){
    frame.dispose();
        TowerDefense musicObject = new TowerDefense();
        musicObject.pauseMusic(filepath);
    Options();
        }
    });

I was expecting an output of the clip stopping and then you can either make it play again or keep it muted. In this case it just says error when I press the "mute" button.

A: So, in the code that runs when you click your mute button, you are making a new TowerDefense object that is supplied the music's filepath. Here is the issue with that. The clip that is already playing exists in the program. Creating a new TowerDefense object will not automatically give you access to the clip that is playing.
Ensure that you call the pauseMusic method on the same object where you called the playMusic method.
Thus, if you already have created a TowerDefense object in the program and called playMusic, then give your action listener access to that object and use the existing object to call pauseMusic.


text:
Q: HoloLens 2 stops receiving UDP multicast packets when plugged into Windows -- Why and how do I always enable UDP multicast? I'm developing apps for the HoloLens 2, and my current project involves a server on LAN that hosts a multiplayer experience. I developed this auto discovery mechanism using UDP multicast so that HoloLens 2 clients can find what ip the server is on just by listening for these UDP multicast packets.
During testing, the battery was running low, so I plugged it into Windows, and all my UDP multicast stuff just stopped working on the HoloLens. I don't know why.
I'm sure there's a setting somewhere for it, but I don't know where or if it can even be changed.
I've encountered this issue before on Windows where I had to go into the network adapter settings for IPv4 and change the interface metric to 1 under advanced TCP/IPv4 settings. With that setting on 1, Windows can receive UDP multicast packets, otherwise it does not.


text:
Q: How to display logo in center inline with menu? How can I place logo in center inline with menu? So the logo actually is inline but I want to center it with the items from the menu. Menu items starts from the bottom of the logo. How can I do this? Also tried to change the width of li but I couldn't do this, why?

.logo {
  display: inline;
  padding-top: 30px;
}

#siteNav {
  text-align: center;
  width: 100%;
  margin-left: 0px auto;
  text-decoration: none;
}

#siteNav ul {
  margin: 0;
  padding: 0;
  text-align: center;
  display: inline;
}

#siteNav li {
  border-right: 1px solid #797979;
  list-style: none;
  display: inline;
}

#siteNav li:last-child {
  border-right: none;
}

#siteNav a {
  text-align: center;
  height: 50px;
  padding: 50px;
  font-family: 'Mada', sans-serif;
  font-size: 14px;
  color: #000000;
  height: 55px;
}

MISSION

CLIENTS

PRODUCTS

CONTACT

A: CSS flexbox is a good choice here. The align-items property will help you center the these elements. Here is a fabulous resource for more detail on the flexbox approach: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
#siteNav {
  display: flex;
  flex-direction: row;
  align-items: center;
}

#siteNav img {
  flex: 0 0 auto;
}
#siteNav ul {
  flex: 1 0 auto;
}

A: I'm not 100% sure what you're asking for but this is my best guess.
Personally, I use CSS grid for everything. You can learn more here.
A quick explanation is that you need to define the grid layout in the parent container:
#siteNav {
    display: grid;
    grid: auto / repeat(6, 1fr);
    grid-row-gap: 20px;
}

You weren't using your logo class, but I did. I also linked a different logo since your logo URL is a local one we can't see.
.logo {
    display: grid;
    grid: auto / repeat(6, 1fr);
    grid-row-gap: 20px;
}

Then I needed to define where your menu items would fall into the grid:
#siteNav ul {
    margin: 0;
    padding: 0;
    text-align: center;
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: center;
}

Definitely check out the link up top about CSS grid. It's super useful.

#siteNav {
    text-align: center;
    width: 100%;
    height: auto;
    margin-left: 0px auto;
    text-decoration: none;
    background-color: #2780bc;
    display: grid;
    grid: auto / repeat(6, 1fr);
    grid-row-gap: 20px;
    padding: 10px;
}

.logo {
  height: 50px;
  grid-row: 1;
  grid-column: 1 / -1;
  justify-self: center;
}

#siteNav ul {
    margin: 0;
    padding: 0;
    text-align: center;
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: center;
}

#siteNav li {
    border-right: 1px solid #fff;
    list-style: none;
    display: inline;
}

#siteNav li:last-child {
    border-right: none;
}

#siteNav a {
    text-align: center;
    height: 50px;
    padding: 50px;
    font-family: 'Mada', sans-serif;
    font-size: 14px;
    color: #ffffff;
    height: 55px;
}

MISSION

CLIENTS

PRODUCTS

CONTACT


text:
Q: iOS merge several framework into one After watching the WWDC 2016 video optimizing App Startup time, Apple suggested developer can merge several frameworks (dynamic library not static) into one to improve the app cold start time.
https://developer.apple.com/videos/play/wwdc2016/406/
So I downloaded a dummy project here:
https://github.com/stepanhruda/dyld-image-loading-performance
And try to merge two frameworks into one using the following command:

libtool -static -o new.framework SwiftyJSON.framework Shimmer.framework
And the console returns
error:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't map file: SwiftyJSON.framework (Invalid argument)`

error:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't map file: Shimmer.framework (Invalid argument)

So my question is how to merge several framework into one? Can we use libtool to do it and how to do it? Many thanks.

A: For dynamic frameworks

lipo -create path/yourFramework1 path/yourFramework2 -output path/yourFramework

For .a libraries

*

*where sim/lib.a contains i386

*where dev/lib.a contains armv7

lipo -create '/sim/lib.a' '/dev/lib.a' -output 'lib.a'

output contains i386 and armv7

A: I can combine two frameworks (static library only) into one using
libtool -static -o new.framework SwiftJSON.framework/SwiftJSON Shimmer.framework/Shimmer

The script from this github maybe helpful
https://gist.github.com/evands/8ba4f227b00ae14a9303
P.S. Merging static library does not reduce the cold start time

A: If you're trying to merge frameworks created by cocoapods, you can use the pod-merge plugin: https://github.com/grab/cocoapods-pod-merge


text:
Q: Are the Hadoop {start|stop}-all.sh scripts typically used w/ cloudera 3 clusters, and if so, how? I've got a cluster I'm setting up Cloudera 3 on, and it is unclear on whether I should be using these start/stop scripts like I used to with the standard Apache Hadoop setup (where I had a specific user account that ran all the Hadoop stuff).  With CDH3, I got these services running as root.
What is the suggested secure and convenient way to issue global starts and stops with Cloudera 3?  Do users who want to use these scripts setup keys so root can login to the other boxes?  If so, how is this setup by a sudo'd user (just sudo su and setup keys?)?
Also, when I tried to run sudo /usr/lib/hadoop-0.20/bin/start-all.sh (with no keys setup for the root user to connect to the remove boxes), I get the following output:
starting namenode, logging to /usr/lib/hadoop-0.20/bin/../logs/hadoop-root-namenode-meez01.out
May not run daemons as root. Please specify HADOOP_NAMENODE_USER
<asks me for root@myserver's password>
....
<similar message for jobtracker>

update: I know someone out there has to be using Cloudera.. is this a conspiracy to get me to pay for their support?!  j/k. if anything, let mek now how you are using it

A: I was looking for similar info, and found it here:
http://www.migrate2cloud.com/blog/hadoop-cluster-with-hadoop-0-20-and-ubuntu-10-04
You can start/stop using the /etc/init.d/hadoop* scripts


text:
Q: What is the relationship between NVIDIA GPUs' CUDA cores and OpenCL computing units? My computer has a GeForce GTX 960M which is claimed by NVIDIA to have 640 CUDA cores. However, when I run clGetDeviceInfo to find out the number of computing units in my computer, it prints out 5 (see the figure below). It sounds like CUDA cores are somewhat different from what OpenCL considers as computing units? Or maybe a group of CUDA cores form an OpenCL computing unit? Can you explain this to me?

A:
What is the relationship between NVIDIA GPUs' CUDA cores and OpenCL computing units?

Your GTX 960M is a Maxwell device with 5 Streaming Multiprocessors, each with 128 CUDA cores, for a total of 640 CUDA cores.
The NVIDIA Streaming Multiprocessor is equivalent to an OpenCL Compute Unit.  The previously linked answer will also give you some useful information that may help with your kernel sizing question in the comments.

A:
The CUDA architecture is a close match to the OpenCL architecture.
A CUDA device is built around a scalable array of multithreaded Streaming Multiprocessors (SMs). A multiprocessor corresponds to an OpenCL compute unit.
A multiprocessor executes a CUDA thread for each OpenCL work-item and a thread block for each OpenCL work-group. A kernel is executed over an OpenCLNDRange by a grid of thread blocks. As illustrated in Figure 2-1, each of the thread blocks that execute a kernel is therefore uniquely identified by its work-group ID, and each thread by its global ID or by a combination of its local ID and work-group ID.

Copied from OpenCL Programming Guide for the CUDA Architecture http://www.nvidia.com/content/cudazone/download/OpenCL/NVIDIA_OpenCL_ProgrammingGuide.pdf


text:
Q: MiniKF users provisioning phase fails I'm trying to install MiniKF on my local Mac.
I followed the instructions listed here.
After browsing to http://10.10.10.10 and progressing with the wizard, I'm getting this error message:

An unexpected exception has occured
Line: build/bdist.linux-x86_64/egg/rok_common/cmdutils.py:942
Type: CommandExecutionError
Reason: Command <ExtCommand [TY2CSkwoO9o] rok-gw --url http://10.10.10.10:8080/rok/ --username user bucket-create snapshots', status=FINISHED (ret: 1), PID=29432, shell=False>' failed. Error log: Traceback (most recent call last):\n  File "/usr/local/bin/rok-gw", line 11, in \n    sys.exit [...truncated...]  line 81, in login\n  File "build/bdist.linux-x86_64/egg/rok_common/http.py", line 224, in raise_for_status\nrok_fort_client.client.FortClientError: 401 (Unauthorized) Error for 'POST http://10.10.10.10:8080/rok/auth/v1/user/sessions', API Error: unauthorized, code: 401, msg: Invalid user credentials, details: This server could not verify that you are authorized to access the document you requested\n
The logfile `/home/vagrant/provision.log' may contain more information on this error, including a backtrace.
*** MiniKF provisioning tool terminated. Press Enter to restart, Ctrl-C to exit... ***

This error can be seen in the picture below.
When I'm clicking "Connect to Kubeflow" and entering the username and password as seen in the picture below, I'm getting the error: "Invalid Email Address and password.".
Any ideas how to fix that?

A: Solved by deleting the vdi file (minikf-user-data.vdi) and running these commands again:
vagrant init arrikto/minikf
vargant up


text:
Q: Видимость приложения на панели, запущенное на втором рабочем столе Здравствуйте.
Стоит debi9.2, kde4.14.26. В системе 2 рабочих стола.
Запуска на первом firefox, на втором leafpad.
Но на панели задач, будь я на первом или втором рабочем столе, видны обе программы и firefox, и leafpad. Как сделать, чтобы находясь на первом рабочем столе на панели задач отображался только firefox, а переключившись на второй рабочий стол на панели задач отображался только leafpad?


text:
Q: keepass web interface I'm just getting started with Keepass http://keepass.info/ as a password database. It works great as an standalone application.
The problem I'm having is when I am with out MY computer or USB key and I need to get a password out of the database.
Currently I am keeping a copy of my password database on my Webserver (Secret URL). When I am at a friends house and I need a password. I download the database file and run keepass on their computer, Get the password, and delete the database file. This is a little clumsy as sometime people will not let me download Executable to their computers.
What I am looking for is a semi secure online version that uses keepass's database (without having to covert the database). Something I can self hosted.
I have tried http://ossfree.net/webkeepass/ but it requires you to convert the KeePass database to XML for import in to the online web-app. I'm looking for something that can read directly from the database.
I noticed that there are many different ports of KeyPass available I was hoping for a Java applet version that i could just embed in to a website with out too much installation but it does not seem to exist at the moment.
Requirements

*

*Uses KeePass database (no conversion)

*Self hosted.

A: Are you dead set on Keepass?  I recently switched from Keepass due to some of the same frustrations.  I even use dropbox to keep my keepass database in a handy place and sync between my computers.  But in the end that's just a bandaid.
I ended up switching to lastpass.  They have a web vault for accessing your passwords from any browser without plugins if you're away from your computer.  But they also integrate into every browser on any OS via plugins and they have smart phone apps.
Then for when you have a usb thumb drive with you then you can use the portable version of firefox on it with the lastpass plugin loaded.

A: This is an old thread but it comes up high on Google.
This seems to be exactly what you want:
WebKeePass
Description from the site:

Web AND Mobile (Apple iPhone) based, multi user, java port of the KeePass project. A free, easy to use password manager which helps you to manage your passwords in a secure way. Focused on deep encryption and ease of use.

One potential drawback is that this thing requires a java plugin in the browser.


text:
Q: How to get a Twitter user's handle from a phone number using Twitter API If I have a phone number, and the owner of the number

*

*Has a Twitter account

*Associated his account with the phone number

Can I use the Twitter API to find the account based on the phone number?
UPDATE: What I basically need is a reverse lookup function from a phone number to a Twitter account handle.

A: there is not a way to do this, twitter doesn't provide the phone numbers in any form in their api, they also do not let you search based on email address.
this is their user lookup api call
http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-users-lookup

A: My feeling is that Twitter would not allow this, since it would be too easy to do a brute-force enumeration of Twitter users who are dumb enough to use SMS to tweet (thereby giving their phone # to Twitter).


text:
Q: The button for deleting a record from the database does not work. rest ajax So, when you click on the "delete" button, the data from the table is not deleted, that is, nothing happens.
There are no errors in the console. It looks like the delete function is basically not being handled here.
console screenshoot
How can this be fixed?

My files:
index.html
<!DOCTYPE html>

<meta charset="UTF-8">
<title>Cars Selling</title>

Cars Selling List

Insert new position

            code
            manufacturer
            model
            color
            transmission
            body_type
            price
            action

listCarsSelling.js
$(document).ready(function() {
            $.getJSON('/ListCarsSelling', function(json) {
                var tr=[];
                for (var i = 0; i < json.length; i++) {
                    tr.push('
');
                    tr.push('' + json[i].code + '	');
                    tr.push('' + json[i].manufacturer + '	');
                    tr.push('' + json[i].model + '	');
                    tr.push('' + json[i].color + '	');
                    tr.push('' + json[i].transmission + '	');
                    tr.push('' + json[i].body_type + '	');
                    tr.push('' + json[i].price + '	');
                    tr.push('<button id="updatePosition">Update</button>  '
                    + '<button id="deletePosition">Delete</button>	');
                    tr.push('
');
                }
                $('table').append($(tr.join('')));
            });
});

delete.js
$(document).ready(function() {
        $('#deletePosition').click(function() {
            var code = $(this).attr('code');

            $.ajax({
                url: '/ListCarsSelling/'+code,
                method: 'DELETE',
                contentType: "application/json",
                dataType : 'json',
                success: function () {
                    window.location = '/'
                },
                error: function (error) {
                    alert(error);
                }
            });
        });
});

Rest Controller
package lab3.Controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import lab3.DAO.CarSellingDAO;
import lab3.Model.CarSelling;

@RestController
public class CarSellingController {

    @Autowired
    private CarSellingDAO csDAO;

    @DeleteMapping("/ListCarsSelling/{code}")
    public String delete(@PathVariable Integer code) {
        return csDAO.deletePosition(code) + " position delete from the database";
    }
/*...other*/
}

After my update, everything now works more or less. But, there is a problem with reloading the page after deleting.
Here's what I changed:
        $(document).on( "click" ,"#deletePosition", function() {
            var code = $(this).attr('value');
            console.log(code);
            $.ajax({
                url: '/ListCarsSelling/'+code,
                type: 'DELETE',
                contentType: "application/json",
                dataType : 'json',
                success: function () {
                    window.location = '/'
                },
                error: function (error) {
                    alert(error);
                }
            });
});

and this part in another .js file:
+ '<button id="deletePosition" value='+json[i].code+'>Delete</button>	');

After pressing the button, a window pops up. I click ok and I have to refresh the page manually to update the database itself.
How to make it all happen automatically?
page after clicking the delete button

A: After the last update, I was able to deal with the problem. It consisted of only one line.
Final solution / changes in two files:
        $(document).on( "click" ,"#deletePosition", function() {
            var code = $(this).attr('value');
            var rowToDelete = $(this).closest('tr');
            console.log(code);
            $.ajax({
                url: '/ListCarsSelling/'+code,
                type: 'DELETE',
                contentType: "application/json",
                //dataType : 'json', //<---success was not processed because of this
                success: function () {
                    rowToDelete.remove(); //<--- it's better than reloading the page. Just remove line from html
                },
                error: function (error) {
                    alert(error);
                }
            });
});

$(document).ready(function() {
            $.getJSON('/ListCarsSelling', function(json) {
                var tr=[];
                for (var i = 0; i < json.length; i++) {
                    tr.push('
');
                    tr.push('' + json[i].code + '	');
                    tr.push('' + json[i].manufacturer + '	');
                    tr.push('' + json[i].model + '	');
                    tr.push('' + json[i].color + '	');
                    tr.push('' + json[i].transmission + '	');
                    tr.push('' + json[i].body_type + '	');
                    tr.push('' + json[i].price + '	');
                    tr.push('<button id="updatePosition">Update</button>  ' // <--- the refresh button has yet to be updated, but that's a completely different story
                    + '<button id="deletePosition" value='+json[i].code+'>Delete</button>	');
                    tr.push('
');
                }
                $('table').append($(tr.join('')));
            });

});

now everything works. Hooray!:)


text:
Q: Normalizing a family of plane curves containing a cusp In Caporaso and Harris's paper (http://www.mat.uniroma3.it/users/caporaso/CaporasoHarrisInv.pdf page 368, right before section 3), it is mentioned that if $[X]$ is a point on the variety of plane curves with a given degree $d$ and genus $g$ such that $X$ has a cusp and $\delta-1=\binom{d-1}{2}-g-1$ nodes, then we cannot simultaneously normalize the fibers of the universal family $\mathscr{X}\subset V\times\mathbb{P}^2\rightarrow V$ in some neighborhood $V$ of $[X]$.
How do we see this? If it is easier to explain, how do we see this in just one example?


text:
Q: MFC CScrollView scrolls not working I am new in working with MFC scrollview, I am displaying the large image in a function  onPaint of my ScrollView class. here is the On initial update function following code
void CCenterImageView::OnInitialUpdate()
{
    CScrollView::OnInitialUpdate();

    // TODO: Add your specialized code here and/or call the base class

    CSize sizeTotal;
    // TODO: calculate the total size of this view
    sizeTotal.cx = m_matImage.cols;
    sizeTotal.cy = m_matImage.rows;
    SetScrollSizes(MM_TEXT, sizeTotal,sizeTotal);

}

void CCenterImageView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
    // TODO: Add your message handler code here and/or call default

    CScrollView::OnVScroll(nSBCode, nPos, pScrollBar);

    //Invalidate();
}

void CCenterImageView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
    // TODO: Add your message handler code here and/or call default

    CScrollView::OnHScroll(nSBCode, nPos, pScrollBar);
    UpdateData();
    //Invalidate();
}

void CCenterImageView::OnPaint()
{
    CPaintDC dc(this); // device context for painting
    // TODO: Add your message handler code here
    // Do not call CView::OnPaint() for painting messages

    if(m_CVvImageObj.GetImage())
    {
        //this function blit the bitmap on the screen height and width are more than 1000 pixels
        m_CVvImageObj.Show(dc.GetSafeHdc(),0,0,m_CVvImageObj.Width(),m_CVvImageObj.Height());
    }

}

by using this http://www.functionx.com/visualc/views/scrollview.htm i can see the vertical and horizontal scroll but pressing them dont change anything on the view. Kindly guide me how can i move the scroll on user clicks and change the view?

A: CScrollView acts as if you are painting on a large canvas, whose size you determine using SetScrollSizes. The size you set is normally the size of the entire image, most likely larger than the window in which it's displayed.
Then, when you handle OnDraw, you can either paint the entire image, as you have done, or you can paint only the part that is showing, which you can find out from GetClipBox. The latter is necessary for efficiency only, as CScrollView will clip the parts which aren't visible.
You don't need the OnXScroll handlers at all. You should remove them and let CScrollView handle the scrolling, if that's all you do in response to scroll.
There will be problems if your image dimensions are >=2^15, but that doesn't sound like your situation.

A: Your code look suspicious (the 3th argument). However if it is related to the issue of scrolling above 32K, see knowledge base article 'PRB: CScrollView Scroll Range Limited to 32K' (article ID: 166473).


text:
Q: Thymeleaf send property as a parameter I'm trying to pass a property value as a String parameter to a Thymeleaf fragment with no success:
My code is:

the fragment receiving the parameter is as follows:

in the property file:
checkout.paybutton.text=Purchase

How can evaluate the property before is sent as parameter?

A: Try this..


text:
Q: Graphing using 2D array I have been going around this problem for a while now and i can't seem to debug my program.
I have created a graph using 2d arrays and i am trying to put an 'X' over the x and y coordinate points. Then i am trying to plot a least square regression line on top of the points.
Here is my code snippet:
char[][] graph = new char[21][42];

for (int i = 0; i < count; ++i) {
 graph[21 - 1 - yCoords[i]][xCoords[i] + 1] = 'X';
}

// plot the regression line
for (int i = 0; i < graph.length; i++) {
 int yPred = Math.round(yMean + slope * (i - xMean)); // calculate regression value
 graph[21-1-yPred][i + 1] = graph[21-1-yPred][i + 1 ] == 'X' ? '*' : '-'; //problem somewhere here
}

//This is how i initialized my array
 public static void initializeArray(char[][] charArray) {
  for(int k =0; k< charArray.length; k++) {
      for(int d = 0; d < charArray[0].length;d++) {
        charArray[k][d] = ' ';
      }
    }
  for (int i = 0; i < charArray.length; ++i) {
    charArray[i][0] = '/';
  }
  charArray[20][0] = '+';

  for (int i = 1; i < charArray[0].length; ++i) {
    charArray[20][i] = '-';
  }
}

Please remember that this is not the complete code.If anyone has a hard time figuring out the problem then comment below and i will explain or provide more code to my problem.

Right now i am getting this output.

My expected output is this:

The problem seems to be with plotting the regression line. So i am using "X"s to represent the points, "-"s the regression line segments, and "*"s where a line segment and a point are located at the same spot.
I am willing to provide more details. Can anyone help me with bug please.

A: For anyone facing the same problem, here is what i did to get the correct output.
All i had to do was put -1 while looping to avoid index out of bounds exception.
ere is the code:
for (int i = 0; i < graph[0].length - 1; i++) {
 int yPred = (int) (yMean + (slope * (i - xMean)));
 if(yPred > 0 && yPred < 21) {
   graph[21 - 1- yPred][i+1] = graph[21 - 1- yPred][i+1] == 'X' ? '*' : '-';
  }


text:
Q: SASS SyntaxError when including web font When I try to use rake assets:precompile RAILS_ENV=production it throws this error:
Sass::SyntaxError: Invalid CSS after "...awesome-webfont": expected ")", was ".woff);"

This is my style.css file:
@font-face {
    font-family:FontAwesome;
    src:font-image-url(fontawesome-webfont.woff);
}

If I comment the line src:font-image-url(fontawesome-webfont.woff);  this error appears
Sass::SyntaxError: Invalid CSS after "...:image-url(ban2": expected ")", was ".jpg);"

I am using gem "font-awesome-rails" with rails 4.2.4 .

A: Firstly, you'll need to wrap your URL in quotation marks.
Secondly, SASS does not have a URL helper font-image-url. You're maybe looking for font-url, which does the following:

Generates a path to an asset found relative to the project's font directory.

Applying the above, you should have something like:
@font-face {
    font-family: "FontAwesome";
    src: font-url("fontawesome-webfont.woff");
}

The second error seems to come from not wrapping a URL value in quotation marks a well.


text:
Q: Bootstrap 3 - Half Columns Trouble I've recently encountered a problem in where I am trying to achieve:
0.5 col |                             11 col                             | 0.5 col
I've looked at similar questions and found two methods that are mentioned:
Nesting:

0.5 col

     test

0.5 col

As you may see, I'm unsure on how to achieve the 11 col of the page after the 0.5 col in nesting them.
Bootstrap sass files:
.col-xs-half {
   @extend .col-xs-1;
   width: percentage((0.5 / $grid-columns));
}

However, this does not work and when set thinks col-xs-11 is the starting position.
Any help would be much appreciated.

A: you can build a custom version of bootstrap here
https://getbootstrap.com/docs/3.3/customize/#grid-system
change 12 column to 24 column
and you can put the code below in your html


text:
Q: Error 405 not allowed on HttpPost in Asp.net core 3.1 web api When i try to post the raw text with postman the server answer 405 not allowed. I try to add
app.UseCors(options => options.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
services.AddCors();
without any solution.
Whis is the code of the application:
   [Route("api/[controller]")]
    [ApiController]
    public class VideoWallController : ControllerBase
    {
        // GET: api/<ValuesController>
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET api/<ValuesController>/5
        [HttpGet("{id}")]
        public string Get(int id)
        {
            return "value";
        }

        // POST api/<ValuesController>
        [HttpPost]
        public string prova([FromBody] VideoCallBack test)
        {
            return "true;";
        }

        [HttpPost]
        public void teststring(string test)
        {

        }

        // PUT api/<ValuesController>/5
        [HttpPut("{id}")]
        public void Put(int id, [FromBody] string value)
        {
        }

        // DELETE api/<ValuesController>/5
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }
    }

A: If you want to reach that endpoint using the /teststring suffix, you need to put that in the endpoint template:
[HttpPost("teststring")]
public void teststring(string test)
{
}

Or, as @maghazade said, you can just reach the endpoint using the controller URL, without a suffix: https://localhost:44336/api/videowall
Also, the CORS settings are not needed to access the API using Postman. CORS is used only to configure the API access through a web application running on a web browser.

A: Firstly,as maghazade said,there are two endpoints for the post method.You can try to use [HttpPost("teststring")] as ferhrosa said.You can also add [action] to  [Route("api/[controller]")],so that routes of actions will include their action names.If you add other actions with post method,the routes will not conflict anymore.
[Route("api/[controller]/[action]")]
    [ApiController]
    public class VideoWallController : ControllerBase
    {
        // GET: api/<ValuesController>/Get
        [HttpGet]
        public IEnumerable<string> Get()
        {
            return new string[] { "value1", "value2" };
        }

        // GET api/<ValuesController>/Get/5
        [HttpGet("{id}")]
        public string Get(int id)
        {
            return "value";
        }

        // POST api/<ValuesController>/prova
        [HttpPost]
        public string prova()
        {
            return "true;";
        }
        // POST api/<ValuesController>/teststring
        [HttpPost]
        public void teststring([FromBody]string test)
        {

        }

        // PUT api/<ValuesController>/Put/5
        [HttpPut("{id}")]
        public void Put(int id, [FromBody] string value)
        {
        }

        // DELETE api/<ValuesController>/Delete/5
        [HttpDelete("{id}")]
        public void Delete(int id)
        {
        }
    }

And if you want to pass string test from Body,you need to add [FromBody] and select JSON in postman.

result:


text:
Q: Print out of a data file in c is completely wrong I am trying to get a file from a directory and keep it in memory, the goal is to then copy information from the file structure by structure into a tmp file, do some editing, then save the new info in a new data file. All i'm trying to do right now is get the file and then print it.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

typedef struct hw5_struct {
    char f_name[12];
    char l_name[12];
    int age;
    float height;
}HW5_struct;

void printThisFile( FILE *data );

int main( int argc, char *argv[] ) {
    const char *fileLocation = argv[1];

    FILE *originalData = fopen( fileLocation, "r" );

    if( access( fileLocation, F_OK ) != -1 )
        printf("The file at %s exists\n", argv[1]);

    printThisFile( originalData );

    //int sizeOfOriginalData = sizeOf( &originalData );

}

void printThisFile( FILE *data ) {
    printf( "printThisFile called\n" );

    int c;
    if ( data ) {
        printf( "printing file contents now:\n" );
        while( ( c = getc( data ) ) != EOF )
            printf("%c", c);
        fclose( data );
    }
}

It prints the following:
FredHutcheson À@LarryStarchÍ̼@LucyLu-FredFlintstone 33£@BarnyRubbleÍÌl@AmandaHelix33³@RobertHenderson7ffÆ@BobbyNLMcÍ̼@BettyDurnanJPBFloodProfÀ@

I don't really know what it is supposed to look like exactly, but its definitely not that.

A: This would make sense if whatever wrote that file was writing binary versions of hw5_struct
If that's the case you need to load the file by doing the corresponding binary read
FILE *originalData = fopen( fileLocation, "rb" );
HW5_struct tempStruct;
fread ( &tempStruct, sizeof(hw5_struct),1, data);
You can then pick it apart by printing the bits.
printf("%s %s %d %f\n", tempStruct.f_name, tempStruct.l_name,tempStruct.age, tempStruct.height);
Your current read code will only work with a text file.


text:
Q: how to change this sql statement so it returns one row per widget I have the following sql query:
select O.name, O.asset_no, A.name as attr_name, AV.string_value, D.dict_value INTO OUTFILE '/tmp/networkchassis_1503_detailed.csv' FIELDS ENCLOSED BY '"' TERMINATED BY ',' ESCAPED BY '"' LINES TERMINATED BY '\r\n'
FROM Object as O
left join AttributeMap as AM on O.objtype_id = AM.objtype_id
left join Attribute as A on AM.attr_id = A.id
left join AttributeValue as AV on AV.attr_id = AM.attr_id and AV.object_id = O.id
left join Dictionary as D on D.dict_key = AV.uint_value and AM.chapter_id = D.chapter_id
left join Chapter as C on AM.chapter_id = C.id WHERE O.id IN ('5261', '5262', '5263', '5461', '5268', '5271', '22469', '5284', '14418', '5288', '5291', '5292', '5294', '5295', '20629', '20630', '5296', '5297', '5307', '5238', '22425', '22426', '5315', '5316', '22429', '22430', '5317', '22431', '22427', '22428', '5320', '5321', '5325', '5326', '13373', '5329', '14671', '14672', '22432', '22433', '8999', '648', '393', '394', '471', '395', '396', '1688', '1689', '268', '269', '5582', '5583', '5584', '5585', '5586', '5587') AND A.name in ("FQDN", "HW Type") ORDER BY O.name;

This returns two rows, per widet, one with FQDN, and the other for HW Type, like so:
+-----------+----------+-----------+---------------+----------------+
| name      | asset_no | attr_name | string_value  | dict_value                         |
+-----------+----------+-----------+--------------------------------+
| widget1   | 1026857  | HW Type   | NULL          | HP             |
| widget1   | 1026857  | FQDN      | widget1.dd.com| NULL

I'd like to change the query so that I get one row, with both attributes specified.  Something like this...
+-----------+----------+-------------------+----------------+
| name      | asset_no | fqdn              |  hw_type       |
+-----------+----------+-------------------+----------------+
| widget1   | 1026857  | widget1.dd.com    | HP             |

it's the dict_value field that contains hw type value, and the string_value field has the fqdn value.
I've been playing around with the query but so far, I haven't been able to  rewrite it to get the desired results.
Any help would be appreciated.
EDIT 1
select O.name, O.asset_no, MAX(CASE WHEN attr_name = 'FQDN' THEN AV.string_value) as fqdn, D.dict_value as hw_type
FROM Object as O
left join AttributeMap as AM on O.objtype_id = AM.objtype_id
left join Attribute as A on AM.attr_id = A.id
left join AttributeValue as AV on AV.attr_id = AM.attr_id and AV.object_id = O.id
left join Dictionary as D on D.dict_key = AV.uint_value and AM.chapter_id = D.chapter_id
left join Chapter as C on AM.chapter_id = C.id
WHERE O.id IN ('5261', '5262', '5263', '5461', '5268', '5271', '22469', '5284', '14418', '5288', '5291', '5292', '5294', '5295', '20629', '20630', '5296', '5297', '5307', '5238', '22425', '22426', '5315', '5316', '22429', '22430', '5317', '22431', '22427', '22428', '5320', '5321', '5325', '5326', '13373', '5329', '14671', '14672', '22432', '22433', '8999', '648', '393', '394', '471', '395', '396', '1688', '1689', '268', '269', '5582', '5583', '5584', '5585', '5586', '5587')
AND A.name in ("FQDN", "HW Type") GROUP BY O.name
ORDER BY O.name;

I've modified the query to look like the above... but I'm getting an error:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') as fqdn, D.dict_value as hw_type
FROM Object as O
left join AttributeMap as A' at line 1

If I remove the MAX() method, and just have the following query, it works:
select O.name, O.asset_no, AV.string_value as fqdn, D.dict_value as hw_type
FROM Object as O
left join AttributeMap as AM on O.objtype_id = AM.objtype_id
left join Attribute as A on AM.attr_id = A.id
left join AttributeValue as AV on AV.attr_id = AM.attr_id and AV.object_id = O.id
left join Dictionary as D on D.dict_key = AV.uint_value and AM.chapter_id = D.chapter_id
left join Chapter as C on AM.chapter_id = C.id
WHERE O.id IN ('5261', '5262', '5263', '5461', '5268', '5271', '22469', '5284', '14418', '5288', '5291', '5292', '5294', '5295', '20629', '20630', '5296', '5297', '5307', '5238', '22425', '22426', '5315', '5316', '22429', '22430', '5317', '22431', '22427', '22428', '5320', '5321', '5325', '5326', '13373', '5329', '14671', '14672', '22432', '22433', '8999', '648', '393', '394', '471', '395', '396', '1688', '1689', '268', '269', '5582', '5583', '5584', '5585', '5586', '5587')
AND A.name in ("FQDN", "HW Type") ORDER BY O.name;

+----------+----------+-------------------+-----------+
| name     | asset_no | fqdn              | hw_type
+----------+----------+-------------------+-----------+
| widget1  | 1026857  | NULL              | HP        |
| widget1  | 1026857  | widget1.dd.com    | NULL      |

As you can see, I'm getting closer to what I want as far as names of columns but I'm still getting back two rows vs. one.

A: I think this might work. I got rid of the output to the file as it's not really germane to the query result.  You may want/need to change the left joins to inner joins:
    select O.name, O.asset_no,
         AV.string_value as FQDN,
         D.dict_value as "HW Type"
    FROM Object as O
    left join AttributeMap as AM on O.objtype_id = AM.objtype_id
    left join Attribute as A on AM.attr_id = A.id
    left join AttributeValue as AV on AV.attr_id = AM.attr_id and AV.object_id = O.id

    left join Chapter as C on AM.chapter_id = C.id
    AND A.name ='FQDN'

    left join AttributeMap as AM2 on O.objtype_id = AM2.objtype_id
    left join Attribute as A2 on AM2.attr_id = A2.id
    left join AttributeValue as AV2 on AV2.attr_id = AM2.attr_id and AV2.object_id = O.id

    left join Dictionary as D on D.dict_key = AV2.uint_value and AM2.chapter_id = D.chapter_id
    AND A2.name = 'HW Type'
    WHERE O.id IN ('5261', '5262', '5263', '5461', '5268', '5271', '22469', '5284', '14418', '5288', '5291', '5292', '5294', '5295', '20629', '20630', '5296', '5297', '5307', '5238', '22425', '22426', '5315', '5316', '22429', '22430', '5317', '22431', '22427', '22428', '5320', '5321', '5325', '5326', '13373', '5329', '14671', '14672', '22432', '22433', '8999', '648', '393', '394', '471', '395', '396', '1688', '1689', '268', '269', '5582', '5583', '5584', '5585', '5586', '5587')
    ORDER BY O.name;

A: Slightly rearranging Kevin's answer to put the criteria in the right places and renaming tables to make things a little more clear. To avoid the sin of excessive left joins, this assumes that your desired Object rows are guaranteed to have an AttributeMap and that AttributeMap at least contains the two Attributes you want. If this isn't the case, swap the JOINs for LEFT JOINs. Also, I removed the Chapter join because it seems you're not actually doing anything with it.
SELECT O.name, O.asset_no,
    FQDN_AV.string_value as FQDN,
    HWType_D.dict_value as "HW Type"
FROM Object as O

-- This section will cascade joins to get the FQDN value
JOIN AttributeMap as FQDN_AM ON O.objtype_id = FQDN_AM.objtype_id
JOIN Attribute as FQDN_A ON FQDN_AM.attr_id = FQDN_A.id AND FQDN_A.name = 'FQDN'
JOIN AttributeValue as FQDN_AV ON FQDN_AV.attr_id = FQDN_AM.attr_id AND FQDN_AV.object_id = O.id

-- This section will cascade joins to get the HW Type value
JOIN AttributeMap as HWType_AM O.objtype_id = HWType_AM.objtype_id
JOIN Attribute HWType_A ON HWType_AM.attr_id = HWType_A.id AND HWType_A.name = 'HW Type'
JOIN AttributeValue HWType_AV ON HWType_AV.attr_id = HWType_AM.attr_id AND HWType_AV.object_id = O.id
JOIN Dictionary HWType_D ON HWType_D.dict_key = HWType_AV.uint_value AND HWType_AM.chapter_id = HWType_D.chapter_id

-- Apply the filter and order
WHERE O.id IN ('5261', '5262', '5263', '5461', '5268', '5271', '22469', '5284', '14418', '5288', '5291', '5292', '5294', '5295', '20629', '20630', '5296', '5297', '5307', '5238', '22425', '22426', '5315', '5316', '22429', '22430', '5317', '22431', '22427', '22428', '5320', '5321', '5325', '5326', '13373', '5329', '14671', '14672', '22432', '22433', '8999', '648', '393', '394', '471', '395', '396', '1688', '1689', '268', '269', '5582', '5583', '5584', '5585', '5586', '5587')
ORDER BY O.name;

Hope this works out better. Enjoy!