text:
Q: What just happened to my PC? I was trying to open a .png picture today and clicked edit instead of open, which in my opinion wouldn't affect anything. However, most likely coincidentally, as soon as I clicked edit, a large number of cmd prompts opened and closed quickly.
I noticed that the file location was on the headers of the cmd prompts. This is what it said, from what I gathered before it stopped: C:\<user>\AppData\Google.
Does anyone have any idea what happened and what can I do to fix it or keep it from happening again?

A: It might be that some virus/application modified the registry key that executes which command when clicked on edit. Check yourself first in the registry.

Browsing the file extension key in HKEY_CLASSES_ROOT will say the key for the shell menus. Now find that shell key in the registry editor.

If there is another app that modified, like I have 'Edit with GIMP' here, new shell item appears. If there is something there, just check the command.

It might be that the program that is opening that file from the context menu might be faulty and it generates the errors. If that program is having errors, just delete that entire key, and the edit should ask you to select the program to launch.

A: It might be as stated by @SriHarsha, but there are also the following cases
Virus in PNG
Unlikely but even worse case:
the PNG file itself is prepared in a special way and contains a virus that opens a command prompt in order to perform a special operation (whatever the virus wants it to be).
Depending on the program which is used to open the PNG file, the virus may become active or not. E.g. it may not become active in Windows Image Viewer, because that program uses a newer graphics library which checks for buffer overflows.
But since you accidentally clicked "edit", it was opened in MS Paint, which might use a different library that does not perform buffer overflow checks, therefore crashes and the crash causes the virus to become active. The virus manages to run a command via the command line.
In such a case, the application is likely to crash or be unusable.
Fix: no fix. Run an antivirus program. If the virus is very new, it may not be detected. Don't use the PNG, but maybe keep it if you want to contact an anti-virus vendor.
Debugger
It is possible to set up a debugger to launch automatically when a program is started. This is done via the Registry Key ImageFileExecutionOptions. Depending on what type of debugger it is, it may open a console window. When the debugger decides to detach, the console window may close.
In that case, the application is likely to run normally.
Fix: remove the Registry Key for the affected program.

A: It could be a virus masked/binded to a PNG/JPG file.
With your accidental 'edit' of the image file, it may have caused the virus binded/masked to it to run.
Some viruses can be set to mask or bind into images. That way when you open the image file, it opens up the virus too. The way most of these things work is, the virus is stored into a .rar file and then placed inside the actual image. But most other binders work too.
You should run an anti-virus scan your entire system and the image file, as soon as possible. And delete the image file so you won't accidently edit it/run it again.


text:
Q: Service not being correctly autowired - annotation-based configuration I'm using annotation-based configuration - no XML at all.
I've configured everything, but can't figure out why OrderService is not being autowired and continues to be null.  The class below at the very bottom is the one that shows the actual problem.  The other classes are all my configuration.
I do have log4j on this application but am inexperienced with it.  Is there a way I can log what packages/classes are being scanned to help determine why this isn't working?
OrderService
@Service
public class OrderService extends GenericService<OrderDAO, Order> {
    @Autowired
    OrderDAO dao;
}

Services config
@Configuration
public class Config {
    @Bean
    public OrderService orderService() {
        return new OrderService();
    }
}

Main Config
@Configuration
@ComponentScan(basePackages = {
        "com.production.api",

        //todo: may not need the rest of these
        "com.production.api.dao",
        "com.production.api.models",
        "com.production.api.requests",
        "com.production.api.requests.job",
        "com.production.api.resources",
        "com.production.api.resources.job",
        "com.production.api.services"
})
@Import({
        com.production.api.services.Config.class,
        com.production.api.dao.Config.class
})
@PropertySource(value= "classpath:/META-INF/application.properties")
@EnableTransactionManagement
public class Config {

Main.java
public static void main(String[] args) throws IOException {
    //process annotation configuration
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(Config.class);

    HttpServer httpServer = startServer();
    System.out.println(String.format("Jersey app started with WADL available at " + "%sapplication.wadl\nTry out %shelloworld\nHit enter to stop it...", BASE_URI, BASE_URI));
    System.in.read();
    httpServer.stop();
}

Where the problem is...
@Component
public class NewJobRequestHandler {

    public static Logger logger = Logger.getLogger(Logger.class.getName());

    //@todo Why isn't this autowiring?
    @Autowired
    OrderService orderService;

    public void instantiateOrderService() {
        //@todo remove this manual wiring
        orderService = (OrderService) ApplicationContextProvider.getApplicationContext().getBean("orderService");
    }

    public AuthenticatedApiResponse getResponse(AuthenticatedRequest<NewJobRequest> request) {
        instantiateOrderService();

A: The problem here is that your Spring configuration and context is separated from your Jersey/Grizzly stack. You are expecting Jersey to be able to get beans from Spring, but it has no knowledge that Spring exists, its annotations don't mean anything to it.
You need to replace your Jersey Servlet with Spring's Jersey Servlet and add a ContextLoaderListener. Take a look at this example on how to wire Jersey and Spring. I'm not sure how Grizzly works, but if it's like any other servlet container, this should work.
For log4j, you can set your root logger level to INFO or DEBUG and you will get all sorts of log statements from Spring.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Problem When Compressing File using vb.net I have File Like "Sample.bak" and when I compress it to be "Sample.zip" I lose the file extension inside the zip file I meann when I open the compressed file I find "Sample" without any extension.
I use this code :
 Dim name As String = Path.GetFileName(filePath).Replace(".Bak", "")
 Dim source() As Byte = System.IO.File.ReadAllBytes(filePath)
 Dim compressed() As Byte = ConvertToByteArray(source)
 System.IO.File.WriteAllBytes(destination & name & ".Bak" & ".zip", compressed)

Or using this code :
Public Sub cmdCompressFile(ByVal FileName As String)

    'Stream object that reads file contents
    Dim streamObj As Stream = New StreamReader(FileName).BaseStream

    'Allocate space in buffer according to the length of the file read
    Dim buffer(streamObj.Length) As Byte

    'Fill buffer
    streamObj.Read(buffer, 0, buffer.Length)
    streamObj.Close()

    'File Stream object used to change the extension of a file
    Dim compFile As System.IO.FileStream = File.Create(Path.ChangeExtension(FileName, "zip"))

    'GZip object that compress the file
    Dim zipStreamObj As New GZipStream(compFile, CompressionMode.Compress)

    'Write to the Stream object from the buffer
    zipStreamObj.Write(buffer, 0, buffer.Length)
    zipStreamObj.Close()

End Sub

please I need to compress the file without loosing file extension inside compressed file.
thanks,

A: GZipStream compresses a stream of bytes, it does no more than that. It does not embed file info in the stream, so you need to embed it somewhere.
The easiest way to restore the file name is to name it with the original name e.g. Sample.bak.zip.
If that doesn't work for you can use SharpZipLib (samples here) which does the embedding of the file info for you.
If you don't want to go that either of thoes you can either create your own file format and embed the file info or you can try and implement the standard gzip format


text:
Q: How can i extract only 2014 from the text "Full Yr.2014 (Weekly)" I have been able to convert it into "Full Yr.2014" but unable to get 2014 at once. I am new to regular expression.
I'm using: gsub("([0-9]+).*$","\\1",PERIOD)

A: Try this: /([0-9])\w+/g
And also check out this website, here you can try out different regex expressions.

A: Try ([\d]{4}) as your regex. This regex will search for four digits.


text:
Q: Check if value exists in database c#/.net I am sending form data to a sql database and I display the outputs from my users in another form. I just added a checkbox field and I set the values at 'Y' and 'N' for yes and no. I am able to save them and retrieve it but I am trying to bind that value to a checkbox field in the form.
So my question is how can I display the value of the field for that specific item in the database in my checkbox field?
Here is what I have so far and it hasn't worked:
private void LoadData()
{
    Connection connection = new Connection();
    try
    {
        connection.connection1();
        SqlCommand com = new SqlCommand("Select Image,UserName,Description,Private,CompValue FROM FutureProjTbl Where id='" + projectId + "'", connection.con);
        SqlDataReader dataReader = com.ExecuteReader();

        while (dataReader.Read())
        {
            image1.Src = dataReader["Image"].ToString();
            Owner.Text = dataReader["UserName"].ToString();
            Description.Text = dataReader["Description"].ToString();
            //The following 2 are my attempts to retrieve the item and bind it to the checkbox on the project template all the values will load into.
            //privateItem.Checked = Convert.ToBoolean(dataReader["Private"].ToString());
            //privateItem = (CheckBox) dataReader["Private"];
            compValue.Text = dataReader["CompValue"].ToString();

            FillDataForEditProjectModal(dataReader);
        }
        dataReader.Close();
    }
    catch (Exception)
    {

        throw;
    }
}

A: You will need to compare and return a boolean to set the checked value
privateItem.Checked = (dataReader["Private"].ToString() == "Y");

A: try this:
privateItem.Checked = dataReader["Private"] == null ? false : dataReader["Private"].ToString() == "Y";

But instead of storing the value as Y and N why not change that field into a bool in the database and then you can just save it as the checked state of the checkbox (ie true for Y, false for N) and will map a lot easier when you bring it back:
privateItem.Checked = (bool)dataReader["Private"];


text:
Q: Complexity of backtracking algorithm with and without memorization The problem is as follow:
Our input is an array of 14 numbers and our output is whether this is a winning hand.
For a hand to be a winning hand it must be possible to divide its numbers into groups with the following rules:

*

*Each group of 3 must be of identical numbers or a straight (111 or 123)

*We are allowed to have only 1 pair of identical numbers (22 is OK but 45 is not)

For example:
[1,1,1,2,2,2,3,3,3,4,4,4,5,5]: True
[1,1,1,2,2,2,3,3,3,4,4,4,5,6]: False
[1,1,2,2,3,3,4,4,4,6,6,6,8,8]: True

I wrote the following solution for problem using a backtracking technique:
Note: Ignore all occurrence of seen it is part of the memorization for the second part of my question below.
def is_winning_hand(hand):
  hand.sort()
  seen = set()
  return is_winning_hand_step(hand, True, seen)

def is_winning_hand_step(hand, can_take_two, seen):
  if len(hand) == 0:
    return True

  if len(hand) == 1:
    return False

  if str(hand)+str(can_take_two) in seen:
    return False

  if can_take_two:
    valid, new_hand = take_two(hand)
    if valid:
      if is_winning_hand_step(new_hand, False, seen):
        return True

  if len(hand) >= 3:
    valid, new_hand = take_three(hand)
    if valid:
      if is_winning_hand_step(new_hand, can_take_two, seen):
        return True

    valid, new_hand = take_straight(hand)
    if valid:
      if is_winning_hand_step(new_hand, can_take_two, seen):
        return True

  seen.add(str(new_hand)+str(can_take_two))
  return False

def take_two(hand):
  if hand[0] == hand[1]:
    return True, hand[2:]
  else:
    return False, None

def take_three(hand):
  if hand[0] == hand[1] and hand[1] == hand[2]:
    return True, hand[3:]
  else:
    return False, None

def take_straight(hand):
  cnt = 1
  last_val = hand[0]
  indices = set([0])

  for i in xrange(1, len(hand)):
    if hand[i] == last_val:
      continue
    elif hand[i] == last_val + 1:
      cnt += 1
      indices.add(i)
      last_val = hand[i]
      if cnt == 3:
        return True, [x for j, x in enumerate(hand) if j not in indices]
    else:
      return False, None

  return False, None

Now I am trying to find out what is the time complexity of that problem.
Let's assume the input is already sorted for us so leave aside it's O(N log N) .
My guess is since in each step I have a potential split to 3 branches the complexity is O(3^N) where N should be the length of the input array. In our case it is always 14 length array but I am talking about the general case. Am I correct?
In the next step I added a memorization to my solution. What can we tell about the time complexity now? Thanks to the memorization I'm avoiding from solving the same sub-problems again and again, so is that making it an O(N) solution?


text:
Q: How select inbox msg by default display on spinner In the system when I select msg that msg by default display on spinner.I require this project those select item display only spinner.If I change item not show previous select item display on spinner.
    list.java
Spinner sp1;
TextView entry;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.list);
    sp1=(Spinner) findViewById(R.id.spinner1);
    entry = (TextView)findViewById(R.id.TextView123);
    getFilesnames();
}
private void getFilesnames() {
    // TODO Auto-generated method stub
    String[] filenames=getApplicationContext().fileList();
    List<String> list=new ArrayList<String>();
    for(int i=0;i<filenames.length;i++){
        list.add(filenames[i]);

    }
    ArrayAdapter<String> filenameAdapter=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,list);
    sp1.setAdapter(filenameAdapter);
}
public void onClick(View v) {
    // TODO Auto-generated method stub
    String selectFile = String.valueOf(sp1.getSelectedItem());
    openFile(selectFile);
}

private void openFile(String selectFile) {
    // TODO Auto-generated method stub
    String value = "";
    FileInputStream fis;

    try {
        fis = openFileInput(selectFile);
        byte[] input = new byte[fis.available()];
        while(fis.read(input) != -1){
            value += new String(input);
        }
        fis.close();
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    entry.setText(value);

}

A: Check whether list has value after binding like following code:
private void getFilesnames() {
    // TODO Auto-generated method stub
    String[] filenames=getApplicationContext().fileList();
    List<String> list=new ArrayList<String>();
    for(int i=0;i<filenames.length;i++){
        list.add(filenames[i]);

    }
    /***
     check here list has value or not
     ***/

    if(list.size() <= 0) {
       list.add("You string.....");
    }

    ArrayAdapter<String> filenameAdapter=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,list);
    sp1.setAdapter(filenameAdapter);
}


text:
Q: How to Upload Multiple/many image in codeigniter I have problem in my source code, when input many images and different images/ upload file, the results obtained are the same image. how do i fix it, please help me
CONTROLLER
public function tambahprogress()
{
    $this->load->helper('url','form');
    $this->load->library('form_validation');
    $this->form_validation->set_rules('keterangan','keterangan','trim|required');

    $this->load->model('progress/progress_model');

    if ($this->form_validation->run()==FALSE) {
        $data['pekerjaan']=$this->progress_model->combopekerjaan();
        $data['pekerja']=$this->progress_model->combopekerja();
        $this->load->view('progress/tambahprogress', $data);
    }else{
        $config['upload_path']      = './assets/upload/';
        $config['allowed_types']    = 'gif|jpg|png';
        $config['max_size']         = 1000000000;
        $config['max_width']        = 10240;
        $config['max_height']       = 7680;

        $this->load->library('upload', $config);
        if (! $this->upload->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());
            $this->load->view('progress/tambahprogress',$error);
        }
        else
        {
            $image_data = $this->upload->data();
            $configer = array (
                'image_library'=>'gd2',
                'source_image'=>$image_data['full_path'],
                'width'=>800,
                'height'=>600,
                );
            $this->load->library('image_lib',$config);
            $this->image_lib->clear();
            $this->image_lib->initialize($configer);
            $this->image_lib->resize();
            $this->progress_model->insertProgress();
            $this->load->view('progress/tambahprogresssukses');
        }
    }
}

MODEL
public function insertProgress()
{
    $object = array
    (
        'id_progress' =>$this->input->post('id_progress'), 'no_spk' =>$this->input->post('no_spk'),'progress' =>$this->input->post('progress'), 'keterangan' =>$this->input->post('keterangan'), 'gambar'=>$this->upload->data('file_name'), 'gambar2'=>$this->upload->data('file_name'), 'gambar3'=>$this->upload->data('file_name'), 'id_pekerja' =>$this->input->post('id_pekerja')
    );
    $this->db->insert('progress',$object);
}

VIEW(INPUT PROCESS)

    Masukkan Gambar
    <<input type="file" name="userfile" size="20"/>

    <input type="file" name="userfile" size="20"/>

    <input type="file" name="userfile" size="20"/>

and the result is same images but when i input data, i input different image please help me

A:  $config['upload_path'] = PATH; //add path according to your requirements
 $config['allowed_types'] = 'jpg|jpeg|png';
 $config['overwrite'] = false; //OR true
 $config['max_size'] = '100000'; //You can change it
 //add more configuration according to your requirements
 $this->load->library('upload');
 $files = $_FILES;
 $number_of_files = count($_FILES['pic']['name']); //"pic" is name of FILE input
 //images name will be details0, details1, details2 and soo on.
 $errors = 0;
 for ($i = 0; $i < $number_of_files; $i++) {
 $_FILES['pic']['name'] = "details" . $i . ".jpg"; //If you want to change the name of images change "details" with your require name
 $_FILES['pic']['type'] = $files['pic']['type'][$i];
 $_FILES['pic']['tmp_name'] = $files['pic']['tmp_name'][$i];
 $_FILES['pic']['error'] = $files['pic']['error'][$i];
 $_FILES['pic']['size'] = $files['pic']['size'][$i];
 $this->upload->initialize($config);
 if (!$this->upload->do_upload("pic"))
 {
   $errors++;
 }
}
if ($errors > 0)
{
   echo $errors . "File(s) could not be uploaded";
}


text:
Q: how to remove or hide tree node in dev express navbar control containing treelist, using code
how to remove or hide tree node in dev ex press navbar control
  containing treelist, using codeemphasized text

 foreach (ToolStripMenuItem mi in mastersToolStripMenuItem.DropDownItems)
            {
                if (mi.Text == "Batch")
                {
                    mastersToolStripMenuItem.DropDownItems.Remove(mi);
                }
            }

and

foreach (ToolStripMenuItem mi in mastersToolStripMenuItem.DropDownItems)
            {
                if (mi.Text == "Batch")
                {
                    mi.visible=fase;
                }
            }

both not working

A:
some how got the answer

treeListMaster.Nodes[4].Nodes.RemoveAt(7);
    treeListMaster.Refresh();


text:
Q: Setting CSS display doesn't work I am working with a captcha. Upon success I want to set the display of the <div> that includes the captcha to "none". In that success part I have:
document.getElementById("mainForm").style.display="block";
document.getElementById("captcha").style.display="none";
alert("the captcha display is " + document.getElementById("captcha").style.display);

The resulting alert says that it is "block", even though I have just set it to "none".
Any idea why?

A: Well it looks like your javascript code is working, so I don't see a problem. Maybe you should attach some css and html and make code snippet with the problem.

document.getElementById("mainForm").style.display="block";
document.getElementById("captcha").style.display="none";
alert("the captcha display is " + document.getElementById("captcha").style.display);
#mainForm {
  width: 320px;
  height: 180px;
  background: #00A;
}

#captcha {
  width: 160px;
  height: 90px;
  background: #0A0;
}
<form id="mainForm">
  <div id="captcha">
  </div>
</form>

Regards, KJ


text:
Q: Calculating principal curvature directions on discrete mesh without quadratic fitting I am working with 2d surfaces embedded in 3d, with a discrete triangulation, and would like to calculate to principal curvature directions (eigenvectors of the curvature tensor). What I already know is summarised in the following post: How to get principal curvature of a given mesh?. Basically, they talk about fitting points to a quadratic polynomial, and then diagonalising the obtained quadratic form.
My question is, is there any faster way of finding the eigenvectors? I have to do this over and over again, hence the need for speed. It is easy to find out the eigenvalues of the curvature tensor, namely the Gaussian curvature (using angular deficits) and Mean curvature (using the Laplacian). Are there any existing simpler algorithms for the eigenvectors?
PS: I am working in Python, if that helps.

A: When you know an Eigenvalue e of a 3x3 matrix M, an Eigenvector is given by the cross product of two columns of M - e.I, which is low cost.
To avoid degenerate cases, it is better to choose the pair of columns that yields the longest vector, but this triples the cost.

A: To avoid quadratic surface fitting and estimate principal curvatures and directions in a point of triangular mesh, one can use vertex normals in addition to vertex coordinates as described in the article Estimating Curvatures and Their Derivatives on Triangle Meshes by Szymon Rusinkiewicz.
See this answer for more detail.


text:
Q: Aggregating points in dataframe based on distance I have a set of Lat/Long points with numerical values attached to each point. Essentially I want to perform basic calculations on the numerical values within 300,000m of each point, but initially just trying to sum the values as I should be able to work out how to make the calculations more complex from there. Additionally the dataset is large (~200,000 rows) which seems to be the current bottleneck.
I currently have the following:
library(sf)
library(dplyr)
library(units)

test <-data.frame(Longitude=rnorm(2e5),Latitude=rnorm(2e5),ncol=runif(2e5, min=0, max=100))
pt = st_as_sf(x = test,coords = c("Longitude","Latitude"),crs = 4326)
st_distance(pt,pt[1,])<set_units(300000,m)

My logic being for each row find the other rows which are within the radius, then use this information to filter (and sum) on these rows. However given the datasize I seem to be hitting a brickwall, also I am not certain this is the most efficient way.
Any help would be appreciated.

A: Maybe you can try using st_buffer(), that creates a circle with the given radius and then use st_intersect() to filter the points that are into it. I mean, try:
library(sf)
library(tidyverse)
library(units)

test <-data.frame(Longitude=rnorm(2e5),Latitude=rnorm(2e5),ncol=runif(2e5, min=0, max=100))
pt = st_as_sf(x = test,coords = c("Longitude","Latitude"),crs = 4326)

st_intersects(I(st_buffer(pt[1,], set_units(300000,m)))$geometry,pt %>% rowwise)
# Here, it took around 10s to run


text:
Q: Where can I get codes of material icons? I think there was a change in https://material.io/ - there are no codes for the icons, just 'name version' for example:
<i class="material-icons">
   camera_enhance
</i>

What's more - they suggest using that for IE9 or below - I remember that previously there were displayed codes instead for IE9 or below.

A: Yes, this appears to be a bug, there are numerous issues filed:
https://github.com/google/material-design-icons/issues/766
https://github.com/google/material-design-icons/issues/772
https://github.com/google/material-design-icons/issues/785
In the mean time, you can refer to this:
https://raw.githubusercontent.com/flutter/flutter/master/packages/flutter/lib/src/material/icons.dart

A: With the new version 4.0.0 of icons, codepoints are accessible in the font directory of the official GitHub repository (the files with .codepoints extension contain the codepoints).
The codepoints are also available on the Google Fonts website.
You can see the codepoint by clicking on the desired icon:

A: Google Fonts
Google recently added codepoints references to every icon directly in their webpage, see here:
https://fonts.google.com/icons?selected=Material+Icons:drag_indicator
Every icon has at least the following:

A: Follow the steps
Step 1: Make sure to add the material link index.html
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Step 2: Go to https://fonts.google.com/icons?selected=Material+Icons
Step 3: Find the icon from the list.

step 4: Click on the icon then you will see a code point on the right panel.
Copy the code point (In the screenshot it is e8b6).
Step 5: use code point with &#x
ie. 
<i class="material-icons"></i>


text:
Q: Injecting jquery events/functions into angularjs I currently have this block of code:
$('.btn').click(function() {
   $(this).removeClass('big-red-button');
   $(this).addClass('btn-loading');

   $(this).find('.text').text('Working..');

   $(this).find('.state').addClass('loading');
   $(this).find('i').replaceWith(''+'');

});
What it does is when the specified button is clicked it changes the buttons CSS, disables it and sets the text to "Working.." this is to let the user know that an action is being executed, i know there are other ways of doing this but i prefer this way.  My issue now is i am using angularjs and i have ng-click on the button that executes a function, now before that function starts i wat to execute the above jquery code and when the function completes i want to execute a similar jquery code to change the buttons properties again.
This is my ng-click function():
$scope.addTicket = function(ticket, schedule_id) {
    // Set button into working state
    // Do stuff here
    // Set button into completed state
};

Now if i was using jquery alone i would be able to do this but now i do not know how to make my jquery code work with angular.

A: You directive will look like below, and then we will remove ng-click method.
Markup
<button my-directive add-ticket="addTicket()"></button>

Directive
app.directive('myDirective', function() {
    restrict: 'E',
    link: function(scope, element, attrs) {
        element.on('click', function() {
            element.removeClass('big-red-button');
            element.addClass('btn-loading');
            element.find('.text').text('Working..');
            element.find('.state').addClass('loading');
            element.find('i').replaceWith('' + '');
            scope.$apply(attrs.addTicket);
        });
    }
});


text:
Q: jQuery DataTables: Avoid linebreaks in cells I don't have a CSS problem, but a logical problem. I want to get rid of automatic linebreaks in my table cells. For some reason, long pieces of data are split in two lines, even in the HTML itself. This means that none of the classic CSS attributes are going to help here.
Example:
SAP-IT Projekt
 Welle 1

The value inside of the td element is cut in two.
What I've tried:
            {
                "data": "Project.Name",
                "editField": "ProjectEntry.IdProject",
                "render": function (project) {
                    // This code doesn't really work, the cells still contain linebreaks.
                    project = project.trim().replace(/(\r\n\t|\n|\r\t)/gm, "");
                    console.log(project);
                    return project;
                }
            }

Note: The logging in this render function outputs the string without linebreaks.
I think I'm missing a crucial piece of configuration that prevents these automatic linebreaks.
The table used to have the "responsive" piece of configuration, but I've removed that.

Update:
Here's the style of each cell:
#ProjectEntryDataContainer, #ProjectEntryDataContainer > div > table > tbody > tr > td {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    table-layout: fixed;
}

This style is being applied to each cell, according to Chrome's DevTools. The table element hast the class nowrap.
As I've mentioned, the CSS has little to nothing to do with my issue. The text is being displayed in one line, but the HTML element has a line break in it. I want to get rid of the line break in my HTML so I can search the cells properly, using jQuery code. I'm currently using the following code to search my cells:
var project = rowData.Project.Name.trim().replace(/(\r\n\t|\n|\r\t)/gm, "");

// Find our required cell that we want to edit. If we can't find one, create a new one.
    var colHeaderTarget = $("#ProjectEntryData").find('th:contains("Arbeitsstunden")')[0];
    var rowHeaderTarget = $("#ProjectEntryData").find('td:contains("' + project + '")')[0];

    var projectRows = $("#ProjectEntryData").find("tr:contains('" + project + "')");
    console.log(project);
    console.log(projectRows);

This code works wonderfully as long as the cell doesn't have linebreaks.

I just found out that my JSON data contains linebreaks. I'll update once I find out more.
{IdProject: 35, Name: "SAP-IT Projekt
↵ Welle 1", Description: null,

Update: The SQL data contained linebreaks... See answer.

A: Turns out that when your database contains line breaks you're going to get line breaks in the HTML. If anyone has a solution that causes DataTables to filter out line breaks in the cell data, I'll mark that one as the accepted answer. Otherwise, I'll just advise everyone to avoid linebreaks in your SQL data.

A: try   it worked for me very well.


text:
Q: Javascript filter method not working with if and else if I have a object that contains multiple (10) objects.
1 object looks like this:
bracket: null
bracket_id: null
game_site: null
game_site_id: null
id: 88462
next_game_for_loser: null
next_game_for_loser_id: null
next_game_for_winner: null
next_game_for_winner_id: null
next_team_for_loser: 1
next_team_for_winner: 1
number_of_sets: 5
pool: Object
pool_id: 18739
pool_round: Object
pool_round_id: 21984
season: Object
season_id: 20167
start_time: "2013-03-04T13:00:00+01:00"
swiss_round: null
swiss_round_id: null
team_1: Object
team_1_id: 21202
team_1_score: 3
team_2: Object
team_2_id: 21206
team_2_score: 1
time_created: "2012-12-09T12:46:33.626319+00:00"
time_last_updated: "2012-12-09T12:46:33.626361+00:00"
timezone: "Europe/Amsterdam"
tournament: Object
tournament_id: 18519
winner: Object
winner_id: 21202

I want to filter the objects on matchups (team id's)
I filter like so:
var game = games.objects.filter(function (gameInfo) {

            if (gameInfo.team_1_id == team1ID && gameInfo.team_2_id == team2ID) {
                return (gameInfo.team_1_id == team1ID && gameInfo.team_2_id == team2ID) && (inverted = 1);
            }

            else if (gameInfo.team_1_id == team2ID && gameInfo.team_2_id  == team1ID) {
                return (gameInfo.team_1_id == team2ID && gameInfo.team_2_id  == team1ID) && (inverted = 0);
            }
        });

I got 2 variables to set the team id:
var team1ID = 21206;
var team2ID = 21202;

I want the filter function to return the specific object where it matches the teamID1 and teamID2. This works good if gameInfo.team_1_id == team1ID && gameInfo.team_2_id == team2ID
But when i invert it like so: else if (gameInfo.team_1_id == team2ID && gameInfo.team_2_id  == team1ID) Then the object game is always empty...Why is that?

A: (inverted = 0)

Here you are assigning, not comparing. The resulting value (0) will always be falsy, and the filter function will return an empty game array.
Also, you should check for the inverted flag first, and not duplicate the other comparisons unnecessary:
var game = games.objects.filter(function (gameInfo) {
    return inverted == 1
      ? gameInfo.team_1_id == team1ID && gameInfo.team_2_id == team2ID
      : gameInfo.team_1_id == team2ID && gameInfo.team_2_id == team1ID;
});

If you want to set it, it should look like this:
var inverted;
var game = games.objects.filter(function (gameInfo) {
    if (gameInfo.team_1_id == team1ID && gameInfo.team_2_id == team2ID) {
        inverted = 0;
        return true;
    } else if (gameInfo.team_1_id == team2ID && gameInfo.team_2_id == team1ID) {
        inverted = 1;
        return true;
    } // else
        return false;
});

// Shorter, using the comma operator:

var game = games.objects.filter(function (gameInfo) {
    return (gameInfo.team_1_id == team1ID && gameInfo.team_2_id == team2ID && (inverted = 1, true)
        || (gameInfo.team_1_id == team2ID && gameInfo.team_2_id == team1ID && (inverted = 0, true);
});


text:
Q: How can I import the full location from the game into Blender? How can I import the full location from the game (made on Unity) into Blender? The screenshot shows a set of folders that were in the location file in the game itself.
Enter image description here
I can easily assemble a location from Mesh files, but at the texturing stage I don't know what to do. Manually is too much work. How do I import the entire location from these folders so that the textures are also applied?

A: You can import your unity file to blender only if you have unity file in FBX form , save unity or export unity file in FBX file and then go in blender , You will get an option to "IMPORT IN FBX FORMAT" , click and import the unity file in that.

A: Whether textures are auto-applied has to do with whether whoever made the models embedded the textures into the models when exporting them. For this, whoever made the model needs to export the model in FBX format and make sure in export settings that the textures are embedded inside the FBX file.
Also, why are you working with Unity at the texturing stage? Lookdev should be done in a 3d program (substance painter etc). Use neutral lighting for best results (white skydome light).


text:
Q: gmail style file upload in c# I need to implement Gmail style file upload in asp.net c#
where user will click on button and file dialog will open.
user selects a file,then process that file in code.
i dont want user to see file upload control he ll just click one button.
i have already used few solutions
    example

 function OpenFileUpload() {

        var myFrame = document.getElementById('frameUpload');
        $(myFrame).focus();
        $(myFrame).contents().find("#FileUpload1").click();

        var value = $(myFrame).contents().find("#FileUpload1").val();
        if (value != '') {
            $(myFrame).contents().find("#btnSubmit").click();

        }

    }

need better solutions.

A: I am not sure if you are talking about the server or client side....
File upload with large files is a interesting topic on it's own =)...especially large files...
find good articles here:
http://www.hanselman.com/blog/ABackToBasicsCaseStudyImplementingHTTPFileUploadWithASPNETMVCIncludingTestsAndMocks.aspx
http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx
http://msdn.microsoft.com/en-us/library/aa479405.aspx
But why not use a convenient tool...
Here is good component:...
http://www.plupload.com/
HTH

A: You could try something like swfupload http://swfupload.org/
Like in Gmail case, it supports opening a file dialog by clicking on a link/button, it supports MULTIPLE selection of files and also can display the progress bar uploading the file.
Most of SWFUpload documentation uses PHP on the server side. Here is one example for ASP.NET ( SWFUpload ASP.Net example site not working? ).
Please note that to support multiple selection of files to upload from a single window, this requires Flash, it cannot be done with standard input files.


text:
Q: Are dynamic routes possible in Ember.js? Can route's be dynamic? I am thinking this is an important feature because:

*

*Most routes would not be accessible for a user who is not authenticated

*Once the user authenticates new routes should be added

Seems like many web apps would share these requirements. How can Router.map be used to achieve these goals?

A: I'm not sure if creating new routes dynamically is a good idea as it can mess up many things. If you only need this for authentication then I recommend to check out ember-auth. Or you can write your own authentication mechanism like in the gist recommended in previous comment.
If you need to hide some links from the UI then you can just use some if-else constructs from your view like:
{{if isAuthenticated}}
  <!-- Show some links -->
{{else}}
  <!-- Show login link -->
{{/if}}

Note that this only hides the links. User can still enter the route URL directly, therefore the ember-auth or custom authentication mechanism is needed that will prevent the route from loading by checking the isAuthenticated flag also in beforeModel hook.


text:
Q: Error in installing packages in termux kali distribution I had installed Kali Debian in termux, where I got an error while installing python3.

E: dpkg was interrupted, you must manually run 'dpkg --configure -a'
to correct the problem.

Unfortunately got another error after execution.

Setting up udisks2 (2.8.1-4) ...
Failed to scan devices: No such file or directory dpkg: error processing package udisks2 (--configure):
installed udisks2 package post-installation script subprocess returned
error exit status 1
Setting up man-db (2.8.5-2) ...
debconf: unable to
initialize frontend: Dialog debconf: (No usable dialog-like program is
installed, so the dialog based frontend cannot be used. at
/usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76.)
debconf: falling
back to frontend: Readline Building database of manual pages ...
./tracee/event.c:517: int handle_tracee_event(Tracee *, int):
assertion "!IS_IN_SYSENTER(tracee)" failed proot warning: signal 6
received from process 26023

A: Thanks to everyone who had gave an eye to my question, although i find out my solution.
Firstly remove all the related files by
rm -rf
command.
Then run the installation command to reinstall kali in termux.
Hopefully i find out my apt-get working fine with all the commands.


text:
Q: Big project with many external libraries - source code organisation I was wondering what is the best way to organize my source code. I was researching on SO and found https://stackoverflow.com/a/1398594/137261 but this source code layout is library specific and doesn't cover my situation.
My situation:

*

*10 own modules (100k lines of code)

*15 external libraries (e.g. boost, sqlite, zlib, etc.)

*2 critical modules have to be available for selected developers only (maybe separate git repos ?)

*project is multiplatform (Linux and Windows)

*Git as version control system

*cmake used to build project

Question:

*

*does it make sense to incorporate all libraries into my project e.g. in _3rd_party_libs_ folder ?

*how to handle lib include paths in my modules (environmental variable, relative paths, git submodules, etc. ) ?

*should I always build external libs from source or just use their binaries ?

A:
does it make sense to incorporate all libraries into my project e.g. in _3rd_party_libs_ folder ?

Do whatever you want, but keep it consistent. I do note that you've listed examples such as boost/sqlite; these should be standard in your dev environments and not included in your project, unless you depend on say some funny version of boost.

how to handle lib include paths in my modules (environmental variable, relative paths, git submodules, etc. ) ?

This is what your build system - CMake - is for. Your source code just has #include <third_party_lib.h> without worrying about where they are located.

should I always build external libs from source or just used their binaries ?

Prefer binaries by default, unless you have a good reason to build from source every time.


text:
Q: How to center text in a div, which contains an Icon I got the following question, with a pic to illustrate:

I got a container, containing an icon and text. The Icon is always on the left, there can be more icons which are all fixed on the left. Now I want the text to be in the centre of the container. If the text gets too long, it should NOT overlap the icons, but it should expand to the right instead.
If the text is too long to fit in the container next to the icon, finally I just ellipse it.
But how do I do this? Is there a css solution?
Thanks in advance!

A: You can have the text taking the entire width of the container parent, but having left and right padding in a way that it will have enough space for the icon.
Then you can have the icon overlaying on top of the textbox.
The text box can align text in the center and clip text if overflow.
I made a simple pen to illustrate the idea. I hope this help
Codepen example
Here's the code.
HTML

This is a centered text and it is very long

CSS
.container {
  background-color: #FAFBFD;
  width: 15rem;
  height: auto;
  padding: 0.5rem;
  border-radius: 4px;
}
i {
  color: teal;
  position: absolute;
}
.textbox {
  padding: 0 1.3rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

}
body {
  padding: 2rem;
  background-color: #dedede;
}

(The style for body is just for your visual pleasure)

A: Here a code

#container {
  display: flex;
  flex-direction: row;
  padding: 20px;
  border: 2px solid skyblue;
}

#icon {
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background-color: skyblue;
}

#text {
  flex: 1;
  text-align: center
}

  Lorem Ipsum

To have text centered in the block

#container {
  position: relative;
  padding: 20px;
  border: 2px solid skyblue;
  text-align: center;
}

#icon {
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background-color: skyblue;
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  margin: auto;
}

  Lorem Ipsum

A: In a container use, two span tag and First span will contain your image tab and another has text in it.
You can use align-text-center to center your text.


text:
Q: DataGridView scroll bars greyed out when called from a thread I have a windows form app written in C#. I took all the code that, (does a restapi call,builds a list,  puts the list into a datagridview) into a thread so I can check the thread and update the customer as it is running. When doing this everything works except the scroll bars are greyed out.

A: Is there a problem with scrollbars only?
If your code still in main thread, your form isn't able to do anything.(you need double check)
But it is true, you can use Application.DoEvents(); after finish bind data to gridView.
This method will stop all thread and update view, please make sure this is not a perfect solution, this method will bring irreversible error sometimes when cross thread condition.
Anyway, I hope to use System.Windows.Forms.Timer to make it simple.
Here is sample.
After starting form, timer will work 100 times and interval is 5 seconds.
private int loopCnt = 1;

// you don't need to this, just drag timer component from a "tool box"
// to your form any where at design time(mode).
// private System.Windows.Forms.Timer timer1 = new System.Windows.Forms.Timer();

private void Form1_Load(object sender, EventArgs e)
{
    //it is up to you start timer at form-load or triggering after some button click.
    //this.loopCnt = 1;

    this.timer1.Enabled = true;
    this.timer1.Interval = 1000 * 5;
    this.timer1.Start();
}

private void timer1_Tick(object sender, EventArgs e)
{
    CreateDataAndBind(loopCnt++);
    if(loopCnt > 100)
    {
        this.timer1.Stop();
    }
}

public void CreateDataAndBind(int loopCount)
{
    DataSet dsTemp = new DataSet();

    #region : Define data Table and columns

    DataTable dtTemp = new DataTable();
    DataColumn dColKey = new DataColumn("key", typeof(int));
    DataColumn dColName = new DataColumn("name", typeof(String));

    dtTemp.Columns.Add(dColKey);
    dtTemp.Columns.Add(dColName);

    dtTemp.Columns.Add(new DataColumn("role"));
    dtTemp.Columns.Add(new DataColumn("timeText", typeof(String)));
    dtTemp.Columns.Add(new DataColumn("timeValue", typeof(DateTime)));

    #endregion

    dsTemp.Tables.Add(dtTemp);

    for (int index = 0; index < 10; index++)
    {
        DataRow dRow = dtTemp.NewRow();
        dRow[0] = loopCount;
        dRow[1] = "jornathan";
        dRow[2] = "Developer";
        dRow[3] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        dRow[4] = DateTime.Now;
        dtTemp.Rows.Add(dRow);
    }

    this.BindDataSet(dsTemp);

}

public delegate void updateDataSetDelegate(DataSet ds);

private void BindDataSet(DataSet ds)
{
    if (this.dataGridView1.InvokeRequired)
    {
        this.Invoke(new updateDataSetDelegate(BindDataSet), new object[] { ds });
    }
    else
    {
        this.dataGridView1.DataSource = ds.Tables[0];
    }

}


text:
Q: How can I make my bundle display name appear different in Settings and under my icon? (Xcode) I have a long title for my app that looks nice in Settings, but doesn't fit under my app icon. Is there a way to have a different Bundle Display Name for under my icon?

A: Short answer: NO
The difference between CFBundleDisplayName and CFBundleName is that CFBundleDisplayName is localizable.
App title, notifications and settings all read from CFBundleDisplayName
See techninal details here:
https://developer.apple.com/library/content/qa/qa1892/_index.html


text:
Q: Why do Excel line breaks not transfer into Notepad? When copying a cell with line breaks in Excel and pasting it into Notepad, the text is pasted onto one line. Why is that?

A: This is true when you use Notepad, which is Microsoft's basic text editor that is already pre-installed in Windows.
However, you can use a more advanced text editor such as PSPad or Notepad++ (both excellent, and free), and you get your line breaks transferred.
Excel:

Cell marked, then copy-paste into Notepad++:

Same content pasted into Notepad (the Windows default editor):

Note that in both cases, quotation marks were added automatically!
The better editors give you also the option to display the control characters such as LineFeed (LF) and CarriageReturn (CR). In Notepad++ this looks like:

As a conclusion: choose your tool depending on your needs. If you need cell boundaries preserved in the editor, but cell contents may be altered a bit, use Notepad. If you need cell contents left untouched including line breaks, and 1:1-reproducibility of cell boundaries is not crucial, use another editor.
Mass processing of such data
If you need both cell borders and cell contents preserved 1:1 at the same time, you may run into problems.
There might be more intelligent solutions, but what I did in such cases was writing a little programme in any language (VBA, Python, or whatever you like most) that reads the contents and adds placeholder strings for the line breaks (something as simple as "###Linebreak###", which can later be re-replaced by CR and LF control characters. Of course, this is fiddly work then and makes sense only if you have to process large amounts of data.
You may run into problems also with the quotation marks that are added. These may at first glance be useful to preserve cell boundaries even when line breaks are included. However, your cell may have quotation marks a part of the original content, and then you get new problems. There are various solutions to this, then, but it needs your attention.

A: Keltari's answer gives the logical reasoning, while this answer focuses on the technical difference.
There are three different forms of line breaks in use in computing:

*

*Unix and macOS 10.0+ line endings use a line-feed character (LF)

*Macintosh (prior to macOS 10.0) line endings use a carriage-return character (CR)

*Windows line endings use a combination of carriage-return and line-feed characters (CRLF)

This is a hold over from the way that type writers work.
Excel uses a combination of these line breaks to represent cells with multiple lines:

*

*Cells are separated by the Tab character.

*Rows are separated by the CRLF characters.

*Multiline cells separate each line using just the LF character.

This becomes apparent when you save your workbook as a .txt file and open it with a text editor that supports showing these characters.

Notepad only processes CRLF as newlines and ignores LF or CR by themselves. They're still in the  document, but aren't visible in any way.
Note: You will not see this when pasting back and forth, because Notepad++ automatically adjusts line endings for you, while regular Notepad does not.

A: Its due to the nature of how spreadsheets work.  Imagine you have a spreadsheet full of data.  If you were to copy an entire row of data, then paste it into Notepad, all of that data needs to be on one line.  This is because if you were to copy another row of data and paste it, the next row of data needs to be on one line.  If there were line breaks in the first row you copied, the data would no longer be in two linear rows.  If you were to copy the data out of Notepad and back into the spreadsheet, it would not paste properly.

A: Excel uses LF to denote new lines within a cell. Notepad does not consider this to be a new-line as Windows in general uses CRLF for new-lines.
Notepad++ is more intelligent than the relatively simple Notepad and thus interprets LF as a new-line also.


text:
Q: How to place an image on top of another I would like to know how I can make my login page have a background image, and on top of that background image a rectangular image, and next to that second image, my login panel. This way:
image example
The orange color image would be my background image. The blue colored image would be my second image, which would be on top of the background image. And the third pink image would be my login component.
I'm using react js and typescript and I don't have much experience with programming and styling. I would really appreciate your help
EDIT
My code
style.ts
export const ContainerMain = styled(Grid).attrs({
  container: true,
})`
  height: 100vh;
`;

export const ContainerImagem = styled(Grid).attrs({
  item: true,
})`
  top: 0px;
  left: 0px;
  width: 2030px;
  height: 1142px;
  background-size: 'cover';
`;

export const ContainerLogin = styled(Grid).attrs({
  item: true,
})`
  top: 226px;
  left: 1242px;
  width: 520px;
  height: 528px;
  display: 'center';
  opacity: 1;
  border-radius: 4px;
  background-color: var(--white-100);
`;

login.ts
  return (
    <ContainerMain>
      <Hidden lgDown>
        <ContainerImagem xs={12}>

        </ContainerImagem>
      </Hidden>

      <ContainerLogin sm={12} md={12} xs={12} lg={6} xl={6}>
        <motion.div
          animate={{ x: [100, 0] }}
          transition={{ type: 'spring', stiffness: 5 }}
        >
          {children}
        </motion.div>
      </ContainerLogin>
    </ContainerMain>
  );
};

A: You can do a lot with a flex and aligning withing with components being position: absoulte;
Check out what I did here:

#wrap{
  display: flex;
  align-items: center;
}

#container{
  align-items: center;
  display: flex;
  position: relative;
}

#img2 {
  position: absolute;
  left: 25%;
}

#containerlogin {
  position: absolute;
  background: pink;
  z-index: 2;
  left: 50%;
  width: 150px;
  height: 100px;
}

This will be your login stuff


text:
Q: Send request to all dynos I run 4 dynos with nodejs app on it under same subdomain (Example: app.website.com).
I need to send to all my dynos request from other dyno app (other domain: admin.website.com), also nodejs app. All dynos should remove some cached data in memory on command from admin server.
If I send http request to app.website.com only one of the dynos get it (because of the load balancer).

A: In Herokus "common runtime" its neither possible to connect to individual dynos from the outside, nor can you send http requests from one dyno to another. (See https://devcenter.heroku.com/articles/dynos#common-runtime-networking). In Herokus private space on the other hand the later would be possible, because all dynos form a VPN. (See https://devcenter.heroku.com/articles/dynos#private-spaces-runtime-networking)
Instead of trying to send a cache purge event to all dynos using http, it would probably be a better idea to change the setup. You could use a central component, e.g. a message queue, to which both your admin dynos and your app dynos can connect. The admin app could then dispatch cache purge events, which your app consumes. If you don't want to expand your infrastructure unnecessarily, but you already have any other central storage (e.g. a database) connected, you could also use that.


text:
Q: python try and except inside function for value error nameList = []
scoreList = []
gradeList = []
run = 1
loop = 1

def inputFunction():
className = input("\nWhat is the class name: ")
topic = input("What is the topic: ")
while run == 1:

    studentName = input("What is the students name? Enter 'done' to exit: ")

    if studentName in ("done", "Done"):
        break

    try:
        studentScore = int(input("What is the student's score? "))
    except ValueError:
        print("nonono")

    if studentScore <50:
        grade = "NA"
    if studentScore >49 and studentScore <70:
        grade = "A"
    if studentScore > 69 and studentScore < 90:
        grade = "M"
    if studentScore > 89:
        grade = "E"
    nameList.append(studentName)
    scoreList.append(studentScore)
    gradeList.append(grade)
print("\nClass Name:",className)
print("Class Topic:",topic)

I am trying to use a try and except for the variable "studentScore" however it gives me the error "name 'studentScore' is not defined"
any help appreciated

A: You can use a while loop to keep asking the user for a valid integer until the user enters one:
while True:
    try:
        studentScore = int(input("What is the student's score? "))
        break
    except ValueError:
        print("Please enter a valid integer as the student's score.")

A: The problm is, when the statement in the try block throws, studentScore is undefined.
You should give it a default value in case the exception is raised:
try:
    studentScore = int(input("What is the student's score? "))
except ValueError:
    print("nonono")
    studentScore = 0


text:
Q: How to insert data to columns from PHP into MariaDB? I am familiar with MySql databases but there is this new database called MariaDB. I try to insert data there from PHP code and I can't, so can you help me insert the data?  My PHP on the server is 5.4.32 and my MySQL version is 10.0.20-MariaDB-cll-live.
This is the code that I am using to try to insert data into MariaDB.
$connection = mysql_connect("localhost", "root", ""); // Establishing Connection with Server
$db = mysql_select_db("database", $connection); // Selecting Database from Server

if(isset($_POST['submit'])){ // Fetching variables of the form which travels in URL
    $name = $_POST['name'];
    $email = $_POST['email'];
    if($name !=''||$email !=''){
       //Insert Query of SQL
       $query = mysql_query("insert into VIP Membership(Name, Email) values ('$name', '$email')");
       echo "

Data Inserted successfully...!!";
    }
    else{
       echo "
Insertion Failed
 Some Fields are Blank....!!
";
    }
}

mysql_close($connection); // Closing Connection with Server

EDIT: I used the mysqli code now but it throws me an error 500.
<?php
$servername = "localhost";
$username = "username";
$password = "";
$dbname = "db_table";

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
if(isset($_POST['submit'])){ // Fetching variables of the form which travels in URL
$name = $_POST['name'];
$email = $_POST['email'];
if($name !=''||$email !=''){

$sql = "INSERT INTO 'VIP Membership' (Name, Email)
VALUES ('$name', '$email')";

if(mysqli_query($conn, $sql)) {
    echo "New record created successfully";
} else {
    echo "Error: " . $sql . "
" . mysqli_error($conn);
}
}

mysqli_close($conn);

A: You need to use backticks (not single quotes) to surround your table name, since it has a space in it.
$sql = "INSERT INTO `VIP Membership` (Name, Email) VALUES ('$name', '$email')";

UPDATE: You should really be using prepared statements.  As it stands, this code is very unsafe.
$sql = mysqli_prepare($conn, "INSERT INTO `VIP Membership` (Name, Email) VALUES (?, ?)");
if($sql !== FALSE){
    mysqli_stmt_bind_param($sql, "ss", $name, $email);
    if(mysqli_stmt_execute($sql)){
        echo "New record created successfully";
    } else {
        echo mysqli_stmt_error($sql);
    }
} else{
    echo mysqli_error($conn);
}

A: MariaDB is a backward compatible, binary drop-in replacement of MySQL. That means  MariaDB version will work exactly like MySQL. You don't have to do anything specific to make your MySQL code to work on MariaDB. But in your code I would use the mysqli function (or PDO) instead of the old deprecated mysql one.
As you may encounter some incompatibilities you can check this official document for differences between the two. MariaDB vs MySQL

A: check your brackets {  insert code here } if this thing is not arranged properly it brings out an error


text:
Q: Using Infinite Scroll jQuery Plugin with ajax I'm doing a project similar to Google Reader.
I'm using Infinite Scroll jQuery Plugin which works exactly as  advertised when viewing the contents of the default selected category (in a scrollable div).
However when selecting another category (or folder in the case of Google Reader) and the contents of that category is loaded with ajax into the same div container as above (basically exactly like Google Reader) and scrolling down to page 2 the problems arise as it will move to whatever page was previously selected +1 instead of starting from the beginning when a new category is selected.
I think basically I need a way to reset the plugin when a new category is selected. Any help greatly appreciated.

A: I realize it was a very general question. I was hoping to find someone who had done something similar.
Anyway, this is probably not optimal but I solved it like this.
I added this function to the plugin that can be called from out side the plugin:
this.resetPlugin = function() {
  $(document).unbind('retrieve.infscr',kickOffAjax);
  props.currPage = 1;
};

I load the plugin like this
window.infinitescroll = $('#content').infinitescroll({usual settings});

Than I can reset it when another category is selected:
window.infinitescroll.resetPlugin();

A: Your answer did not work for me. Here's what I did:
You have to set two variables for the re-instantiaion of InfiniteScroll to work. You also have to Rebind it. Here is the code:
$('#myContainer').infinitescroll('destroy'); // Destroy

// Undestroy
$('#myContainer').infinitescroll({
    state: {
        isDestroyed: false,
        isDone: false
}
});

InitInfiniteScroll(); // This is a wrapper for the standard initialization you need

// Re-initialize
$('#myContainer').infinitescroll('bind');

A: Only this works for me, may be this solutions are outdated:
jquery infinite scroll "reset"

A: Just want to contribute with my answer if someone faces a similar problem.
var off = 0;
var infinite = {};

function loadMorePosts(cat, offset){
            //FUNKY AJAX LOAD
}

function initInfinite(){
    infinite = new Waypoint.Infinite({
      element: $('.infinite-container')[0],
      onBeforePageLoad: function() {
        console.log(off);
        var cat = $('.f-categories').val();
        loadMorePosts(cat, off);
        off += 5;
      },
      onAfterPageLoad: function(){
        //console.log($.noop);
      }
    });
}
initInfinite();

$(function() {
    $('.f-categories').change(function(){
        var cat = $(this).val();
        off = 0;
        infinite.destroy();
        $('.grid').html('');
        initInfinite();
        loadMorePosts(cat,off);
    });
});


text:
Q: Error: You can't pop an empty literal stack for entry and strange character in bibliography I'm drafting a paper and got a error:

In bibliography there is a strange character ".." after "Proceedings":
Files:
dados-seminario.tex:
\autor{Seu Nome Completo}
\codigoautor{SC XXXXX}

\titulo{Título Completo do Trabalho de Dissertação}

\dataapresentacao{31}{Fevereiro}{2016}

\area{Área de Concentração da Proposta de Dissertação}
\linha{Linha de Pesquisa da Proposta de Dissertação}

\orientador{Nome Completo do Orientador}{D}

\postoorientador{Ten Cel}

\coorientador{Nome Completo do Co-orientador}{P}
\coord{Nome Completo do Coordenador}{P}

\postocoord{Cel}

\chefe{Nome Completo do Chefe da SE/8}

\postochefe{Cel}

main.tex:
\documentclass{seminario}

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[authoryear]{natbib}
\usepackage{geometry}
\geometry{
    a4paper,
    left=25mm,
    right=25mm,
    top=25mm,
    bottom=30mm,
    headheight=0mm,
    headsep=0mm,
}

\DeclareRobustCommand{\NATand}{;}
\DeclareRobustCommand{\NATetal}{et~al.}
\makeatletter
\renewcommand{\NAT@nmfmt}[1]{%
  \ifNAT@swa\expandafter\MakeUppercase
  \else\DeclareRobustCommand{\NATand}{ e}\expandafter\@firstofone\fi{{\NAT@up #1}}%
}
\makeatother

\graphicspath{{./img/}}

\begin{document}

\include{dados-seminario}

\makecapa
\maketitle

\parindent 0.75cm

\include{secao-02}

\bibliographystyle{seminario}
\bibliography{refs}

\preparatitulos
\makeassinaturas
\label{theend}
\end{document}

secao-02.tex:
\chapter{Introdu\c{c}\~{a}o}

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, vestibulum ut, placerat ac, adipiscing vitae, felis \citep{zargar2013survey}.
. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam \citep{zargar2013survey}..

\section{Objetivo}
 nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam tincidunt urna\cite{rai2016survey}

\section{Problemas de Pesquisa}
, leo velit ultricies tellus, ac venenatis arcu wisi vel nisl \citep{zargar2013survey}.
\section{Contribuições Esperadas}

seminario.cls:
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{seminario}
\newif\if@titlepage
\@titlepagetrue
\newif\if@append
\@appendfalse
\newif\if@appendformat
\@appendformatfalse
\newif\if@annexformat
\@annexformatfalse
\newif\if@abrevia
\@abreviafalse
\newif\if@simbo
\@simbofalse

\DeclareOption{a4paper}        {\setlength\paperheight{297mm} \setlength\paperwidth{210mm}}
\DeclareOption{a5paper}        {\setlength\paperheight{210mm} \setlength\paperwidth{148mm}}
\DeclareOption{b5paper}        {\setlength\paperheight{250mm} \setlength\paperwidth{176mm}}
\DeclareOption{letterpaper}    {\setlength\paperheight{11in} \setlength\paperwidth{8.5in}}
\DeclareOption{legalpaper}     {\setlength\paperheight{14in} \setlength\paperwidth{8.5in}}
\DeclareOption{executivepaper} {\setlength\paperheight{10.5in} \setlength\paperwidth{7.25in}}
\DeclareOption{landscape}      {\setlength\@tempdima{\paperheight} \setlength\paperheight{\paperwidth} \setlength\paperwidth{\@tempdima}}
\DeclareOption{titlepage}      {\@titlepagetrue}
\newcommand\@ptsize{}
\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}}

\newif\if@restonecol
\DeclareOption{onecolumn}{\@twocolumnfalse}
\DeclareOption{twocolumn}{\@twocolumntrue}

\newif\if@openright
\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
\DeclareOption{twoside}{\@twosidetrue  \@mparswitchtrue}

\DeclareOption{leqno}{\input{leqno.clo}} % Posicionar a numeração das equações à esquerda
\DeclareOption{fleqn}{\input{fleqn.clo}} % Posicionar as equações a uma indentação fixa da margem esquerda

\DeclareOption{draft}{\setlength\overfullrule{5pt}}
\DeclareOption{final}{\setlength\overfullrule{0pt}}
\DeclareOption{openright}{\@openrighttrue}
\DeclareOption{openany}{\@openrightfalse}

\ExecuteOptions{a4paper,12pt,oneside,titlepage,onecolumn,final,openany}
\ProcessOptions
\input{size1\@ptsize.clo}
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand\baselinestretch{}
\setlength\parskip{0\p@ \@plus \p@}
\@lowpenalty   51
\@medpenalty  151
\@highpenalty 301

\setcounter{topnumber}{2}
\renewcommand\topfraction{.7}
\setcounter{bottomnumber}{1}
\renewcommand\bottomfraction{.3}
\setcounter{totalnumber}{3}
\renewcommand\textfraction{.2}
\renewcommand\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\renewcommand\dbltopfraction{.7}
\renewcommand\dblfloatpagefraction{.5}

\if@twoside
    \def\ps@headings{%
        \let\@oddfoot\@empty\let\@evenfoot\@empty
        \def\@evenhead{\thepage\hfil\slshape\leftmark}%
        \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
        \let\@mkboth\markboth
        \def\chaptermark##1{%
            \markboth {\MakeUppercase{%
            \ifnum \c@secnumdepth >\m@ne \@chapapp\ \thechapter. \ \fi
            ##1}}{}}%
        \def\sectionmark##1{%
            \markright {\MakeUppercase{%
            \ifnum \c@secnumdepth >\z@ \thesection. \ \fi
        ##1}}}}
\else
    \def\ps@headings{%
        \let\@oddfoot\@empty
        \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
        \let\@mkboth\markboth
        \def\chaptermark##1{%
            \markright {\MakeUppercase{%
            \ifnum \c@secnumdepth >\m@ne \@chapapp\ \thechapter. \ \fi
            ##1}}}}
\fi

\def\ps@myheadings{%
    \let\@oddfoot\@empty\let\@evenfoot\@empty
    \def\@evenhead{\thepage\hfil\slshape\leftmark}%
    \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
    \let\@mkboth\@gobbletwo
    \let\chaptermark\@gobble
    \let\sectionmark\@gobble}
\def\ssp{\def\baselinestretch{1.0}\large\normalsize}
\def\dsp{\def\baselinestretch{1.37}\large\normalsize}

\newcommand*\chaptermark[1]{}
\setcounter{secnumdepth}{3}

\newcounter {part}
\newcounter {chapter}
\newcounter {section}[chapter]
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]

\renewcommand\thepart {\@Roman\c@part}
\renewcommand\thechapter {\@arabic\c@chapter}
\renewcommand\thesection {\thechapter.\@arabic\c@section}
\renewcommand\thesubsection   {\thesection.\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection}
\renewcommand\theparagraph    {\thesubsubsection.\@arabic\c@paragraph}
\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}

\newcommand\nomecapitulo{CAP{\'I}TULO}
\newcommand\@chapapp{\nomecapitulo}

\newcommand\part{
    \if@openright \cleardoublepage \else \clearpage \fi
    \thispagestyle{plain}
    \if@twocolumn \onecolumn \@tempswatrue \else \@tempswafalse \fi
    \null\vfil
    \secdef\@part\@spart}

\def\@part[#1]#2{
    \ifnum \c@secnumdepth >-2\relax
        \refstepcounter{part}%
        \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
        \addcontentsline{toc}{part}{#1}%
    \fi
    \markboth{}{} {
        \centering
        \interlinepenalty \@M
        \normalfont
        \ifnum \c@secnumdepth >-2\relax
            \huge\bfseries \nomeparte~\thepart
            \par
            \vskip 20\p@
        \fi
        \Huge \bfseries #2\par}
    \@endpart}

\def\@spart#1{
    {  \centering
       \interlinepenalty \@M
       \normalfont
       \Huge \bfseries #1\par}
    \@endpart}

\def\@endpart{
    \vfil\newpage
    \if@twoside
        \null
        \thispagestyle{empty}%
        \newpage
    \fi
    \if@tempswa
        \twocolumn
    \fi}

\newcommand\chapter{
    \if@openright \cleardoublepage \else \clearpage \fi
    \thispagestyle{plain}%
    \global\@topnum\z@
    \@afterindenttrue
    \dsp
    \secdef\@chapter\@schapter}

\def\@chapter[#1]#2{
    \ifnum \c@secnumdepth >\m@ne
        \if@append \refstepcounter{section} \else \refstepcounter{chapter} \fi%
        \typeout{\@chapapp\space\thechapter.}%
        {
            \def\\{ }%
            \if@append
                \addcontentsline{toc}{section}{\protect\numberline{\thesection\ }\uppercase{\@chapapp \space \@arabic\c@section}:\space#1}
            \else
                \if@appendformat
                    \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter\ }\textbf\nomeindiceapendice}
                \else
                    \if@annexformat
                        \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter\ }\textbf\nomeindiceanexo}
                    \else
                        \addcontentsline{toc}{chapter}{\protect\numberline{\thechapter\ }\bf#1}
                    \fi
                \fi
            \fi
        }%
    \else
        {
            \def\\{ }  % allow \\ in title
            \addcontentsline{toc}{chapter}{#1}
        }%
    \fi
    \chaptermark{#1}%
    \addtocontents{lof}{\protect\addvspace{10\p@}}%
    \addtocontents{lot}{\protect\addvspace{10\p@}}%
    \if@twocolumn \@topnewpage[\@makechapterhead{#2}] \else \@makechapterhead{#2} \@afterheading \fi}

\def\@makechapterhead#1{%
    {
        \parindent \z@ \raggedright \normalfont
        \interlinepenalty\@M
        \if@append
%            \thesection \space \@chapapp \space \@arabic\c@section: \space \MakeUppercase{#1} \par \nobreak%
            \@chapapp \space \@arabic\c@section: \space \MakeUppercase{#1} \par \nobreak%
        \else
            \bfseries \thechapter \space \MakeUppercase{#1} \par \nobreak%
        \fi
            \vskip 3\baselineskip
        \dsp
    }}

\def\@schapter#1{
    \if@twocolumn
        \@topnewpage[\@makeschapterhead{#1}]%
    \else
        \@makeschapterhead{#1}%
        \@afterheading
    \fi}

\def\@makeschapterhead#1{
    \parindent \z@
    \normalfont
    \hbox to\textwidth{\bfseries \hfill
    \MakeUppercase{#1}\hfill}
    \nobreak
    \vskip 20\p@
    \dsp}

\newcommand\section{
    \@startsection {section}{1}{\z@}
        {-3.5ex \@plus -1ex \@minus -.2ex}
        {2.3ex \@plus.2ex}
        {\normalfont\MakeUppercase}}

\newcommand\subsection{
    \@startsection{subsection}{2}{\z@}
    {-3.25ex\@plus -1ex \@minus -.2ex}
    {1.5ex \@plus .2ex}
    {\normalfont\MakeUppercase}}

\newcommand\subsubsection{
    \@startsection{subsubsection}{3}{\z@}
    {-3.25ex\@plus -1ex \@minus -.2ex}
    {1.5ex \@plus .2ex}
    {\normalfont\normalsize\MakeUppercase}}

\newcommand\paragraph{
    \@startsection{paragraph}{4}{\z@}
    {3.25ex \@plus1ex \@minus.2ex}
    {-1em}
    {\normalfont\normalsize}}

\newcommand\subparagraph{
    \@startsection{subparagraph}{5}{\parindent}
    {3.25ex \@plus1ex \@minus .2ex}
    {-1em}%
    {\normalfont\normalsize}}

\if@twocolumn \setlength\leftmargini  {2em} \else \setlength\leftmargini  {2.5em} \fi

\leftmargin  \leftmargini
\setlength\leftmarginii  {2.2em}
\setlength\leftmarginiii {1.87em}
\setlength\leftmarginiv  {1.7em}

\if@twocolumn \setlength\leftmarginv  {.5em} \setlength\leftmarginvi {.5em} \else \setlength\leftmarginv  {1em} \setlength\leftmarginvi {1em} \fi

\setlength  \labelsep  {.5em}
\setlength  \labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}
\@beginparpenalty -\@lowpenalty
\@endparpenalty   -\@lowpenalty
\@itempenalty     -\@lowpenalty

\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\newcommand{\labelenumi}{\alph{enumi})}
\newcommand\labelenumii{\arabic{enumii})}
\newcommand\labelenumiii{\theenumiii.}
\newcommand\labelenumiv{\theenumiv.}
\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi(\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}

\newcommand\labelitemi{\textbullet}
\newcommand\labelitemii{\normalfont\bfseries \textendash}
\newcommand\labelitemiii{\textasteriskcentered}
\newcommand\labelitemiv{\textperiodcentered}

\newenvironment{description}
    {\list{}{
        \labelwidth\z@ \itemindent-\leftmargin
        \let\makelabel\descriptionlabel}}
    {\endlist}

\newcommand*\descriptionlabel[1]{\hspace\labelsep \normalfont\bfseries #1}

\newenvironment{verse}
    {\let\\\@centercr
     \list{}{
        \itemsep      \z@
        \itemindent   -1.5em%
        \listparindent\itemindent
        \rightmargin  \leftmargin
        \advance\leftmargin 1.5em}%
     \item\relax}
    {\endlist}

\newenvironment{quotation}
    {\list{}{
        \listparindent 1.5em%
        \itemindent    \listparindent
        \rightmargin   \leftmargin
        \parsep        \z@ \@plus\p@}%
     \item\relax}
    {\endlist}

\newenvironment{quote}
    {\list{}{\rightmargin\leftmargin} \item\relax}
    {\endlist}

\newcounter{teorema}[chapter]
\newenvironment{thm}[1][]{\refstepcounter{teorema}\par\medskip
   \textbf{Teorema~\theteorema. #1} \rmfamily\itshape}

\newcounter{problema}[chapter]
\newenvironment{probl}[1][]{\refstepcounter{problema}\par\medskip
   \textbf{Problema~\theproblema. #1} \rmfamily\itshape}

\newcounter{questao}[chapter]
\newenvironment{qpesq}[1][]{\refstepcounter{questao}\par\medskip
   \textbf{Quest\~{a}o de Pesquisa~\thequestao. #1} \rmfamily\itshape}

\newcounter{hipotese}[chapter]
\newenvironment{hipo}[1][]{\refstepcounter{hipotese}\par\medskip
   \textbf{Hip\'{o}tese~\thehipotese. #1} \rmfamily\itshape}

\newcounter{proposicao}[chapter]
\newenvironment{prop}[1][]{\refstepcounter{proposicao}\par\medskip
   \textbf{Proposi\c{c}\~{a}o~\theproposicao. #1} \rmfamily}

\newcounter{definicao}[chapter]
\newenvironment{defn}[1][]{\refstepcounter{definicao}\par\medskip
   \textbf{Defini\c{c}\~{a}o~\thedefinicao. #1} \rmfamily\itshape}

\newcounter{exemplo}[chapter]
\newenvironment{exmp}[1][]{\refstepcounter{exemplo}\par\medskip
   \textbf{Exemplo~\theexemplo. #1} \rmfamily}

\newcounter{nota}[chapter]
\newenvironment{nota}[1][]{\refstepcounter{nota}\par\medskip
   \textbf{Nota~\thenota. #1} \rmfamily}

\newcounter{tarefaok}[chapter]
\newenvironment{tarefac}[1][]{\refstepcounter{tarefaok}\par\medskip
   \textbf{Tarefa~\thetarefaok. #1} \rmfamily\itshape}

\newcounter{tarefanok}[chapter]
\newenvironment{tarefanc}[1][]{\refstepcounter{tarefanok}\par\medskip
   \textbf{Tarefa~\thetarefanok. #1} \rmfamily\itshape}

\@addtoreset {equation}{chapter}
\renewcommand\theequation
  {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@equation}

\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
\setlength\tabbingsep{\labelsep}
\skip\@mpfootins = \skip\footins
\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}

\newcommand\nomefigura{FIG.}
\newcommand\nometabela{TAB.}

\newcounter{figure}[chapter]
\renewcommand \thefigure {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{\nomefigura~\thefigure}
\newenvironment{figure}
    {\ssp\@float{figure}}
    {\end@float\dsp}
\newenvironment{figure*}
    {\ssp\@dblfloat{figure}}
    {\end@dblfloat\dsp}

\newcounter{table}[chapter]
\renewcommand \thetable {\ifnum \c@chapter>\z@ \thechapter.\fi \@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{\nometabela~\thetable}
\newenvironment{table}
    {\ssp\@float{table}}
    {\end@float\dsp}
\newenvironment{table*}
    {\ssp\@dblfloat{table}}
    {\end@dblfloat\dsp}

\newlength\abovecaptionskip
\newlength\belowcaptionskip
\setlength\abovecaptionskip{10\p@}
\setlength\belowcaptionskip{0\p@}

\long\def\@makecaption#1#2{
    \vskip\abovecaptionskip
    \sbox\@tempboxa{#1: #2}
    \ifdim \wd\@tempboxa >\hsize
        #1: #2\par
    \else
        \global \@minipagefalse
        \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
    \fi
    \vskip\belowcaptionskip}

\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}

\def\autor#1{\gdef\@autor{#1}}
\def\codigoautor#1{\gdef\@codigoautor{#1}}
\def\postoautor#1{\gdef\@postoautor{#1}}

\def\titulo#1{\gdef\@titulo{#1}}
\def\titantigo#1{\gdef\@titantigo{#1}}
\def\dataapresentacao#1#2#3{\gdef\@dia{#1} \gdef\@mes{#2} \gdef\@ano{#3}}

\def\area#1{\gdef\@area{#1}}
\def\linha#1{\gdef\@linha{#1}}

\def\orientador#1#2{\gdef\@orientador{#1} \gdef\@titorientador{#2}}
\def\postoorientador#1{\gdef\@postoorientador{#1}}
\gdef\@titA{}

\def\coorientador#1#2{\gdef\@coorientador{#1} \gdef\@titcoorientador{#2}}
\def\postocoorientador#1{\gdef\@postocoorientador{#1}}
\gdef\@titB{}

\def\coord#1#2{\gdef\@coord{#1} \gdef\@titcoord{#2}}
\def\postocoord#1{\gdef\@postocoord{#1}}
\gdef\@titC{}

\def\chefe#1{\gdef\@chefe{#1}}
\def\postochefe#1{\gdef\@postochefe{#1}}

\newcommand\preparatitulos{
    \ifnum\pdfstrcmp{\@titorientador}{P}=0\gdef\@titA{Ph.D.}
    \else\ifnum\pdfstrcmp{\@titorientador}{D}=0\gdef\@titA{D.Sc.}
    \else\ifnum\pdfstrcmp{\@titorientador}{DC}=0\gdef\@titA{D.Sc.}
    \else\ifnum\pdfstrcmp{\@titorientador}{D.C.}=0\gdef\@titA{D.Sc.}
    \else\ifnum\pdfstrcmp{\@titorientador}{D.C}=0\gdef\@titA{D.Sc.}
    \else\ifnum\pdfstrcmp{\@titorientador}{DC.}=0\gdef\@titA{D.Sc.}
    \else\ifnum\pdfstrcmp{\@titorientador}{}=0\else\gdef\@titA{\@titorientador}\fi\fi\fi\fi\fi\fi\fi

    \ifdefined \@coorientador
        \ifnum\pdfstrcmp{\@titcoorientador}{P}=0\edef\@titB{Ph.D.}
        \else\ifnum\pdfstrcmp{\@titcoorientador}{D}=0\edef\@titB{D.Sc.}
        \else\ifnum\pdfstrcmp{\@titcoorientador}{DC}=0\edef\@titB{D.Sc.}
        \else\ifnum\pdfstrcmp{\@titcoorientador}{D.C.}=0\edef\@titB{D.Sc.}
        \else\ifnum\pdfstrcmp{\@titcoorientador}{D.C}=0\edef\@titB{D.Sc.}
        \else\ifnum\pdfstrcmp{\@titcoorientador}{DC.}=0\edef\@titB{D.Sc.}
        \else\ifnum\pdfstrcmp{\@titcoorientador}{}=0\else\edef\@titB{\@titcoorientador}\fi\fi\fi\fi\fi\fi\fi
    \fi

    \ifnum\pdfstrcmp{\@titcoord}{P}=0\gdef\@titC{Ph.D.}
    \else\ifnum\pdfstrcmp{\@titcoord}{D}=0\gdef\@titC{D.Sc.}
    \else\ifnum\pdfstrcmp{\@titcoord}{DC}=0\gdef\@titC{D.Sc.}
    \else\ifnum\pdfstrcmp{\@titcoord}{D.C.}=0\gdef\@titC{D.Sc.}
    \else\ifnum\pdfstrcmp{\@titcoord}{D.C}=0\gdef\@titC{D.Sc.}
    \else\ifnum\pdfstrcmp{\@titcoord}{DC.}=0\gdef\@titC{D.Sc.}
    \else\ifnum\pdfstrcmp{\@titcoord}{}=0\else\gdef\@titC{\@titcoord}\fi\fi\fi\fi\fi\fi\fi
}

\newcommand\makecapa{
    \thispagestyle{empty}
    \noindent
    \begin{center}

        \begin{large}
            \textbf{MINIST\'{E}RIO DA DEFESA\\}
            \textbf{EX\'{E}RCITO BRASILEIRO\\}
            \textbf{DEPARTAMENTO DE CI\^{E}NCIA E TECNOLOGIA\\}
            \textbf{INSTITUTO MILITAR DE ENGENHARIA\\}
            \textbf{CURSO DE MESTRADO EM SISTEMAS E COMPUTA\c{C}\~{A}O}

            \vspace{2cm}
            \textbf{RELAT\'{O}RIO DE ACOMPANHAMENTO DE TRABALHO DE DISSERTA\c{C}\~{A}O DE MESTRADO}

            \vspace{4.5cm}
            \textbf{\MakeUppercase{\@autor}}

            \vspace{4.5cm}
            \textbf{\MakeUppercase{\@titulo}}

            \vspace{5cm}
            \textbf{Rio de Janeiro\\}
            \textbf{\@ano}
        \end{large}
    \end{center}
    \newpage
}

\newcommand\maketitle{
    \thispagestyle{plain}
    \chapter{T\'{i}tulo do Trabalho de Disserta\c{c}\~{a}o}
        \begin{flushleft}
            \textbf{T\'{i}tulo Atual do Trabalho de Disserta\c{c}\~{a}o:}\\
            \@titulo \\

            \ifdefined \@titantigo
                \vspace{0.7cm}
                \textbf{T\'{i}tulo Anterior do Trabalho de Disserta\c{c}\~{a}o:}\\
                \@titantigo \\
            \fi

            \vspace{0.7cm}
            \textbf{\'{A}rea de Concentra\c{c}\~{a}o:}\\
            \@area \\

            \vspace{0.7cm}
            \textbf{Linha de Pesquisa:}\\
            \@linha \\
        \end{flushleft}
    \newpage
}

\newcommand\nomebibliografia{REFER\^ENCIAS BIBLIOGR\'AFICAS}

\newdimen\bibindent
\setlength\bibindent{1.5em}

\newenvironment{thebibliography}[1] {}

\newenvironment{thethesisbibliography}[1] {
    \chapter{
        \nomebibliografia
        \@mkboth{\MakeUppercase\nomebibliografia}{\MakeUppercase\nomebibliografia}
    }
    \ssp \list{}{}
} {\def\@noitemerr {\@latex@warning{Empty `thethesisbibliography' environment}} \endlist}

\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\let\@openbib@code\@empty

\renewenvironment{thethesisbibliography}[1] {
    \chapter{
        \nomebibliografia
        \@mkboth{\MakeUppercase\nomebibliografia}{\MakeUppercase\nomebibliografia}
    }
    \list{\@biblabel{\@arabic\c@enumiv}} {
        \settowidth\labelwidth{\@biblabel{#1}}
        \leftmargin=20pt
        \itemindent=-20pt
        \@openbib@code
        \usecounter{enumiv}%
        \let\p@enumiv\@empty
        \renewcommand\theenumiv{\@arabic\c@enumiv}
    }
    \sloppy
    \clubpenalty4000
    \@clubpenalty \clubpenalty
    \widowpenalty4000%
    \sfcode`\.\@m
} {\def\@noitemerr {\@latex@warning{Empty `thethesisbibliography' environment}} \endlist}

\def\@approvalspace{2cm}
\newcommand\makeassinaturas{
    \newpage
    \begingroup
        \noindent
        \vspace{5mm}
        \begin{center}

            $\:\overline{\makebox[10cm][c]{\ifdefined \@postoautor {\@postoautor}\fi ~{\@autor} {(\@codigoautor)}}}\:$ \\
            Aluno\\
            \vspace{\@approvalspace}

            $\:\overline{\makebox[10cm][c]{\ifdefined \@postoorientador {\@postoorientador}\fi ~{\@orientador,}~{\@titA}}}\:$ \\
            Orientador\\
            \vspace{\@approvalspace}

            \ifdefined \@coorientador
                $\:\overline{\makebox[10cm][c]{\ifdefined \@postocoorientador {\@postocoorientador}\fi ~{\@coorientador,}~{\@titB}}}\:$ \\
                Co-orientador\\
                \vspace{\@approvalspace}
            \fi

            $\:\overline{\makebox[10cm][c]{\ifdefined \@postocoord {\@postocoord}\fi ~{\@coord,}~{\@titC}}}\:$ \\
            Coordenador de P\'{o}s-gradua\c{c}\~{a}o\\
        \end{center}

        \vspace{\@approvalspace}
        \noindent
        Declaro que o presente Relat\'{o}rio de Acompanhamento de Trabalho de Disserta\c{c}\~{a}o foi apresentado segundo as NICPG/IME em \@dia \:de\:\@mes \:de\:\@ano.

        \vspace{\@approvalspace}
        \begin{center}
            $\:\overline{\makebox[10cm][c]{\ifdefined \@postochefe {\@postochefe}\fi ~{\@chefe}}}\:$ \\
            CHEFE da SE/8\\
        \end{center}

    \endgroup
    \newpage
}

\setlength\columnsep{10\p@}
\setlength\columnseprule{0\p@}

\pagestyle{plain}
\pagenumbering{arabic}
\if@twoside \else \raggedbottom \fi
\if@twocolumn \twocolumn \sloppy \flushbottom \else \onecolumn \fi

\newenvironment{frontmatter} {
    \if@twocolumn \@restonecolfalse \else \@restonecoltrue \fi
    \columnseprule \z@
    \columnsep 35\p@
    \onecolumn
    \setcounter{page}{2}
    \renewcommand{\thepage}{\arabic{page}}
} {\newpage}
\endinput

refs.bib :
@article{zargar2013survey,
  title={A survey of defense mechanisms against distributed denial of service (DDoS) flooding attacks},
  author={Zargar, Saman Taghavi and Joshi, James and Tipper, David},
  journal={IEEE Communications Surveys \& Tutorials},
  volume={15},
  number={4},
  pages={2046--2069},
  year={2013},
  publisher={IEEE}
}

@inproceedings{rai2016survey,
  title={Survey on Recent DDoS Mitigation Techniques and Comparative Analysis},
  author={Rai, Ankur and Challa, Rama Krishna},
  booktitle={Computational Intelligence \& Communication Technology (CICT), 2016 Second International Conference on},
  edition = {1},
  pages={96-101},
  year={2016},
  type = {intl},
  organization={IEEE},
  publisher = {IEEE}

}

seminario.bst: https://ufile.io/p50am
Could someone help?

A: With the following test file for your bibliography
\documentclass{article}

\usepackage[brazilian]{babel}
%\usepackage[utf8]{inputenc}
%\usepackage[T1]{fontenc}

\usepackage[authoryear]{natbib}

\usepackage{geometry}
\geometry{
    a4paper,
    left=25mm,
    right=25mm,
    top=25mm,
    bottom=30mm,
    headheight=0mm,
    headsep=0mm,
}

\DeclareRobustCommand{\NATand}{;}
\DeclareRobustCommand{\NATetal}{et~al.}
\makeatletter
\renewcommand{\NAT@nmfmt}[1]{%
  \ifNAT@swa\expandafter\MakeUppercase
  \else\DeclareRobustCommand{\NATand}{ e}\expandafter\@firstofone\fi{{\NAT@up #1}}%
}
\makeatother

\begin{document}

\nocite{*}
\bibliographystyle{plainnat} % seminario plainnat
\bibliography{ref1} % refs ref1

\end{document}

I can compile without errors. Please see that I used style plainnat and the following bib file ref1.bib:
@article{boteanu2013comprehensive,
  title={A comprehensive study of queue management as a DoS countermeasure},
  author={Boteanu, Daniel and Fernandez, Jos{\'e} M},
  journal={International journal of information security},
  volume={12},
  number={5},
  pages={347--382},
  year={2013},
  publisher={Springer},
}

If I change the bibliography style to seminario.bst the error you have occours.  For me means that that your style seminario.bst is faulty.
Please contact the creator of that style/class to correct that style.
Sorry, I can not help you to find the errors inside that file ...


text:
Q: How to fetch all the coinbase pro transactions correctly in php I have a question of coinbase pro,
How can I get all the orders/transactions from coinbase pro using php without any limit , or with any limit parameter.
I am using the following library to fetch all the coinbase pro orders , but it only gives me 100 orders from the below method.
fetch_orders

Here is the method,
$CoinbaseProtrans = $CoinbasePro->fetch_orders('ETH/USD',"",150,array('limit'=>100,'after'=>1));
echo "<pre>";print_r($CoinbaseProtrans);echo "</pre>";

Here is the error I am getting,
Fatal error: Uncaught ccxt\ExchangeError: coinbasepro after cursor value is not valid in coinbasepro.php:813

Here is the link of the library:
https://github.com/ccxt/ccxt/blob/master/php/coinbasepro.php

A: This question was answered here: https://github.com/ccxt/ccxt/issues/6105#issuecomment-552405563
<?php

include_once ('ccxt.php');

date_default_timezone_set ('UTC');

$exchange = new \ccxt\coinbasepro(array(
    'apiKey' => 'YOUR_API_KEY',
    'secret' => 'YOUR_SECRET',
    // 'verbose' => true, // uncomment for debugging
    // https://github.com/ccxt/ccxt/wiki/Manual#rate-limit
    'enableRateLimit' => true, // rate-limiting is required by the Manual
));

$exchange->load_markets ();

// $exchange->verbose = true; // uncomment for debugging

$all_results = array();

$symbol = 'ETH/USD';
$since = null;
$limit = 100;
$params = array();

do {
    // any of the following methods should work:
    // $results = $exchange->fetch_orders($symbol, $since, $limit, $params);
    // $results = $exchange->fetch_my_trades($symbol, $since, $limit, $params);
    $results = $exchange->fetch_trades($symbol, $since, $limit, $params);
    echo $exchange->iso8601($exchange->milliseconds());
    echo ' fetched ' . count($results) . " results\n";
    $all_results = array_merge ($all_results, $results);
    if (count($results) > 0) {
        $last = count($results) - 1;
        echo '     last result ' . $results[$last]['id'] . ' ' . $results[$last]['datetime'] . "\n";
        echo '    first result ' . $results[0]['id'] . ' ' . $results[0]['datetime'] . "\n";
    } else {
        break;
    }
    @$params['after'] = $exchange->last_response_headers['cb-after'][0];

// uncomment one of the following:
// } while (true); // fetch all results forever
} while (count($all_results) < 1000); // fetch up to 1000 results

echo "fetched " . count($all_results) . " results in total\n";

?>


text:
Q: How Mac OS Associate System Folder with Special folder Icon I just ran into this question. I think there must be a plist file or something similar. Here is what I found:

*

*When customizing a plain folder with my own icon file, there is an invisible file created in the folder called "Icon^M", which I think is a kind of icon file?

*But system "special" folder like /Applications, /Users/Documents, and so on, do not have this kind of file in it, and are displayed as special icons instead of stock plain blue icon.
So, how does Apple associate special folders and their special icons? I think there is some system plist file to associate these two, like:
...
< key >/User/Documents< /key >
< value >pathToIcon or binaryRepOfFileAndPath< /value >
...
Where can I find the file? Thank you!

A: The special folder .icns files, e.g for Applications, Library, System and User, etc. are stored in /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources and the info.plist file to control these is /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist.


text:
Q: Find the Maxima of $g(x)= xe^{x^{2}} + e^{-x^{2}}$ in $[0,1]$ Find the Maxima of $g(x)= xe^{x^{2}} + e^{-x^{2}}$ in $[0,1]$
$g'(x) = 2x^{2} e^{x^{2}} +e^{x^{2}} -2xe^{-x^{2}}$.
I'm not able to determine the nature of $g'$.
How can I get to know about the monotonicity of $g$ from this$?$ I calculated $g''$ but that doesn't help.
Any idea$?$

A: For $x \in [0,1]$, $e^{2x^2} \geq 1$, so:
\begin{align*}
g'(x) &= e^{-x^2}((2x^2 + 1)e^{2x^2} - 2x) \\
&\geq e^{-x^2}(2x^2 + 1 - 2x) \\
&= e^{-x^2}(x^2 + (x - 1)^2)  \\
&\geq 0
\end{align*}


text:
Q: Jquery code doesn't work after paging? i have written below code in my content page which has listview and datapager
    <asp:Content ID="content2" runat="server" ContentPlaceHolderID="HeadContent">
    <link href="../js/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" />

</asp:Content>

This works fine.. but when i do paging then code written doesn't work.
I could see that in visual studio one file is created 'Jscript-window script block'. and code written
__doPostBack('ctl00$BodyContent$lvEnglishMovieList$dpgGallery$ctl01$ctl01','')

What does this mean??

A: Issue solved.

My listview was inside the update panel becuase of which i had to write these code. Got help from asp.net forum and the link is
HERE

A: If your paging is asynchronous, the newly fetched DOM elements won't be captured by $(".fancyYoutube") as this only runs once on DOMready. You can create a more generic event handler that works with dynamically added elements by using the .delegate() method instead.
EDIT
In fact, looking again, the .delegate() method probably wouldn't work, as the .fancybox() function is not an event. In that case, you should find the callback function that is executed when paging completes (this will be the function that takes the new AJAX response and injects it into the DOM), and just make another call to .fancybox(), passing in the AJAX response HTML.
Can you post your pagination code? I could probably help you more clearly!

A: ObjectDatasource code
<asp:ObjectDataSource ID="ObjHindiList" runat="server" SelectMethod="GetAllList"
                TypeName="Movie.Repositories.MovieDetailRepository"
                OldValuesParameterFormatString="original_{0}">
                <SelectParameters>
                    <asp:Parameter DefaultValue="Hindi" Name="movielanguage" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>

now listview code with datapager in it.
<asp:ListView ID="ListView1" DataKeyNames="MovieId" runat="server"
                DataSourceID="ObjHindiMovieList" onitemcreated="ListView1_ItemCreated"
                onitemdatabound="ListView1_ItemDataBound" EnableViewState="false">
                <LayoutTemplate>

                                        <asp:DataPager ID="dpgGallery" PagedControlID="ListView1" runat="server" PageSize="10">
                                            <Fields>
                                                <asp:NextPreviousPagerField ButtonCssClass="command" FirstPageText="« Previous" PreviousPageText="« Previous"
                                                    RenderDisabledButtonsAsLabels="false" ShowFirstPageButton="false" ShowPreviousPageButton="true"
                                                    ShowLastPageButton="false" ShowNextPageButton="false" RenderNonBreakingSpacesBetweenControls="False" />
                                                <asp:NumericPagerField CurrentPageLabelCssClass="current" NextPreviousButtonCssClass="next"
                                                    RenderNonBreakingSpacesBetweenControls="False" />
                                                <asp:NextPreviousPagerField ButtonCssClass="command" LastPageText="›" NextPageText="Next »"
                                                    RenderDisabledButtonsAsLabels="false" ShowFirstPageButton="false" ShowPreviousPageButton="false"
                                                    ShowLastPageButton="false" ShowNextPageButton="true" RenderNonBreakingSpacesBetweenControls="False" />
                                            </Fields>
                                        </asp:DataPager>

                </LayoutTemplate>
                <ItemTemplate>

                            <asp:Image ID="Image1" ImageUrl='<%#Eval("MovieThumbNailImageUrl")%>' runat="server" />

                                            <asp:Label ID="lblmovieName" runat="server" Text='<%#Eval("MovieName")%>'></asp:Label>

                                            <asp:Label ID="lbldate" runat="server" Text='<%#Eval("ReleaseDate","{0:dd-MMM-yy}")%>'></asp:Label>

                                        <asp:LinkButton CssClass="linkbutton" ID="lnkabout" runat="server" OnClick="lnkabout_Click" Text="About Movie"></asp:LinkButton>&nbsp|
                                        <asp:LinkButton CssClass="linkbutton" ID="lnkGallery" runat="server" Text="Photos"></asp:LinkButton>&nbsp|
                                        <a class="fancyYoutube" href='<%#Eval("TrailerUrl") %>'>View Trailer

                                        Director

                                        <asp:Label ID="lblDirector" runat="server" Text='<%#Eval("Director") %>'></asp:Label>

                                        Producer

                                        <asp:Label ID="Label1" runat="server" Text='<%#Eval("Producer") %>'></asp:Label>

                                        Staring

                                        <asp:Label ID="lblstarring" runat="server" Text='<%#Eval("Cast") %>'></asp:Label>

                </ItemTemplate>
                <ItemSeparatorTemplate>

                </ItemSeparatorTemplate>
            </asp:ListView>

and in code behind i have not written anything for paging.


text:
Q: Why does `TakesExam.grade NOT IN ("b", "f", "u")` exclude rows with `grade = 0` in mysql? Why does TakesExam.grade NOT IN ("b", "f", "u") exclude rows with grade = 0 in mysql?
How do I fix the above problem? Every row with a grade equal to 0 or NULL gets excluded from the result?