Books about modal logic?
I've just approached modal logic reading "An Introduction to Non-Classical
Logic" of Graham Priest.
I am looking for some books that treat this argument in a more extensive
way than the book I am reading. I am especially interested in the
philosophical side of modal logic.
Can you suggest me some books?
Friday, 9 August 2013
C++ HelloWorld program compiled with MinGW crashes with "Illegal Argument"
C++ HelloWorld program compiled with MinGW crashes with "Illegal Argument"
I decided it was time that I learned C++, and after struggling for 3+
hours trying to get the compiler to work, I finally created a working
program. However, it seemingly spontaneously broke when I tried to
refactor the project in Eclipse by cutting and pasting it. The program
simply crashes, and Windows brings up the dreaded dialogue "HelloWorld.exe
has stopped working." A bit of debugging revealed that "cout" was
considered an illegal argument. I looked some more into the issue, and I'm
now suspicious that it has something to do with the compiler apparently
being 32-bit, as I have a 64-bit system. The executable is listed in
Eclipse as "HelloWorld.exe - [x86/le]." (Minus the period.) My program in
full is below:
#include <iostream>
using namespace std;
int main(){
cout << "Hello World!" << endl;
return 0;
}
I've also just discovered that creating a new "HelloWorld" C++ project in
Eclipse does absolutely nothing to fix the issue, even using the
unmodified code and settings. Anyone have any suggestions as to why this
would happen?
EDIT: Debugging information: Upon running the program:
Hello World!
Program received signal SIGNILL, Illegal instruction.
0x6fccc3c0 in libstdc++-6!_ZSt4cout ()
from C:\Windows\SysWOW64\libstdc++-6.dll
(gdb) bt
#0 0x6fccc3c0 in libstdc++-6~_ZSt4cout ()
from C:\Windows\SysWOW64\libstdc++-6.dll
#1 0x6fc8908c in libstdc++-6~_ZSt4cout ()
from C:\Windows\SysWOW64\libstdc++-6.dll
#2 0x004013be in libstdc++-6~_ZSt4cout () at HelloWorld.cpp:4
(gdb)
It should be noted that line 4 of the class now points to the cout call.
I decided it was time that I learned C++, and after struggling for 3+
hours trying to get the compiler to work, I finally created a working
program. However, it seemingly spontaneously broke when I tried to
refactor the project in Eclipse by cutting and pasting it. The program
simply crashes, and Windows brings up the dreaded dialogue "HelloWorld.exe
has stopped working." A bit of debugging revealed that "cout" was
considered an illegal argument. I looked some more into the issue, and I'm
now suspicious that it has something to do with the compiler apparently
being 32-bit, as I have a 64-bit system. The executable is listed in
Eclipse as "HelloWorld.exe - [x86/le]." (Minus the period.) My program in
full is below:
#include <iostream>
using namespace std;
int main(){
cout << "Hello World!" << endl;
return 0;
}
I've also just discovered that creating a new "HelloWorld" C++ project in
Eclipse does absolutely nothing to fix the issue, even using the
unmodified code and settings. Anyone have any suggestions as to why this
would happen?
EDIT: Debugging information: Upon running the program:
Hello World!
Program received signal SIGNILL, Illegal instruction.
0x6fccc3c0 in libstdc++-6!_ZSt4cout ()
from C:\Windows\SysWOW64\libstdc++-6.dll
(gdb) bt
#0 0x6fccc3c0 in libstdc++-6~_ZSt4cout ()
from C:\Windows\SysWOW64\libstdc++-6.dll
#1 0x6fc8908c in libstdc++-6~_ZSt4cout ()
from C:\Windows\SysWOW64\libstdc++-6.dll
#2 0x004013be in libstdc++-6~_ZSt4cout () at HelloWorld.cpp:4
(gdb)
It should be noted that line 4 of the class now points to the cout call.
i need to write data to a file in c# but somehow it shows success but the file is empty
i need to write data to a file in c# but somehow it shows success but the
file is empty
Hello This is the code i am trying : If the file existes , append to that
file else create a new one . I need to write data line by line
FileExists = File.Exists(NewFileName);
if (FileExists = false)
{
using (fs =new FileStream(NewFileName,
FileMode.Create))
{
sw = new StreamWriter(fs);
MessageBox.Show(Record);
sw.WriteLine(Record);
fs.Close();
}
}
else
{
using (fd = new FileStream(NewFileName,
FileMode.Append))
{
sw = new StreamWriter(fd);
MessageBox.Show(Record);
sw.WriteLine(Record,true);
}
}
}
file is empty
Hello This is the code i am trying : If the file existes , append to that
file else create a new one . I need to write data line by line
FileExists = File.Exists(NewFileName);
if (FileExists = false)
{
using (fs =new FileStream(NewFileName,
FileMode.Create))
{
sw = new StreamWriter(fs);
MessageBox.Show(Record);
sw.WriteLine(Record);
fs.Close();
}
}
else
{
using (fd = new FileStream(NewFileName,
FileMode.Append))
{
sw = new StreamWriter(fd);
MessageBox.Show(Record);
sw.WriteLine(Record,true);
}
}
}
Polymorphic data structures in C
Polymorphic data structures in C
I am a C beginner with quite a lot of OOP experience (C#) and I am having
trouble understanding how some notion of "polymorphism" can be achieved in
C.
Right now, I am thinking how to capture the logical structure of a file
system using structs. I have a folder that contains both folders and
files. Folders in this folder can contain another files and folders, etc.
My approach:
typedef enum { file, folder } node_type;
struct node;
typedef struct {
node_type type;
char *name;
struct node *next;
struct node *children;
} node;
Is this the best I can do? I have found a lot of posts on "polymorphism in
C", but I would like to see how a polymorphic data structure like this can
be built cleanly and efficiently (in terms of memory wasted on unused
members of those structures).
Thanks.
I am a C beginner with quite a lot of OOP experience (C#) and I am having
trouble understanding how some notion of "polymorphism" can be achieved in
C.
Right now, I am thinking how to capture the logical structure of a file
system using structs. I have a folder that contains both folders and
files. Folders in this folder can contain another files and folders, etc.
My approach:
typedef enum { file, folder } node_type;
struct node;
typedef struct {
node_type type;
char *name;
struct node *next;
struct node *children;
} node;
Is this the best I can do? I have found a lot of posts on "polymorphism in
C", but I would like to see how a polymorphic data structure like this can
be built cleanly and efficiently (in terms of memory wasted on unused
members of those structures).
Thanks.
Reset IIS after CPU usage Hit 100
Reset IIS after CPU usage Hit 100
Currently I have an issue in which w3wp.exe locks the CPU at 100%. I need
to solve this issue, but in the mean time, i would like to trigger an IIS
reset when the CPU remains above 95% for more than 2 minutes.
I have been playing with performance monitor, but i need something which
will allow for a time condition. (It may allow you to do this, but so far
i haven't worked it out)
Any ideas to get this to work would be appreciated.
Currently I have an issue in which w3wp.exe locks the CPU at 100%. I need
to solve this issue, but in the mean time, i would like to trigger an IIS
reset when the CPU remains above 95% for more than 2 minutes.
I have been playing with performance monitor, but i need something which
will allow for a time condition. (It may allow you to do this, but so far
i haven't worked it out)
Any ideas to get this to work would be appreciated.
getline() on a fstream which is passed as an argument in a class constructor
getline() on a fstream which is passed as an argument in a class constructor
Hi I have some trouble with using getline() in a my class. My class name
is myStringList, stringList is a list< string> member variable, and below
is the constructor.
input is an fstream object created in main(), open() a file and is passed
into the constructor as an argument.
myStringList::myStringList(std::fstream& input)
{
std::string temp;
while (std::getline(input,temp))//will temp be cleared?
{
myStringList::stringList.push_back(temp);
}
}
The getline() cannot work in this way. It seems because input is a
reference to fstream, i think? If I were to pass in argv[1] as the
argument and create a fstream object in this constructor itself, getline
will work.
What should be the correct syntax to use getline() on a fstream which is
passed as an argument in a class constructor?
Hi I have some trouble with using getline() in a my class. My class name
is myStringList, stringList is a list< string> member variable, and below
is the constructor.
input is an fstream object created in main(), open() a file and is passed
into the constructor as an argument.
myStringList::myStringList(std::fstream& input)
{
std::string temp;
while (std::getline(input,temp))//will temp be cleared?
{
myStringList::stringList.push_back(temp);
}
}
The getline() cannot work in this way. It seems because input is a
reference to fstream, i think? If I were to pass in argv[1] as the
argument and create a fstream object in this constructor itself, getline
will work.
What should be the correct syntax to use getline() on a fstream which is
passed as an argument in a class constructor?
Remove ability to select spicific rows in grid ExtJS 4
Remove ability to select spicific rows in grid ExtJS 4
I have to remove ability to select some rows in my grid.
I use CheckboxModel
selModel: Ext.create( 'Ext.selection.CheckboxModel', {
mode: 'SIMPLE'
} )
To disable selection I use beforeselect event
beforeselect: function ( row, model, index ) {
if ( model.data.id == '3' ) {
return false;
}
}
And to hide checkbox I use specific class for row and css rule
viewConfig: {
getRowClass: function( record, index ) {
var id = record.get('id');
return id == '3' ? 'general-rule' : '';
}
}
.general-rule .x-grid-row-checker {
left: -9999px !important;
position: relative;
}
Perhaps this is not the best way to achieve the desired result, but for my
task it works.
However, another problem appear: Select All / Unselect All checkbox in
grid header stops working. When you first click on this ckechbox all lines
except those that should not be selected will select, but if you click
again, nothing happens. Obviously, the system tries to re-select all rows,
as there are unselected.
Is there a better way to solve the problem? Or how to solve a problem with
this method.
The only thing that comes to mind - you need to rewrite the Select All /
Unselect All functions for checkbox, but I not sure how I can do it.
Thanks in advance for your answers and I apologize if I made my question
is not according to the rules - this is my first appeal to stackoverflow.
Sincerely, Sergei Novikov.
I have to remove ability to select some rows in my grid.
I use CheckboxModel
selModel: Ext.create( 'Ext.selection.CheckboxModel', {
mode: 'SIMPLE'
} )
To disable selection I use beforeselect event
beforeselect: function ( row, model, index ) {
if ( model.data.id == '3' ) {
return false;
}
}
And to hide checkbox I use specific class for row and css rule
viewConfig: {
getRowClass: function( record, index ) {
var id = record.get('id');
return id == '3' ? 'general-rule' : '';
}
}
.general-rule .x-grid-row-checker {
left: -9999px !important;
position: relative;
}
Perhaps this is not the best way to achieve the desired result, but for my
task it works.
However, another problem appear: Select All / Unselect All checkbox in
grid header stops working. When you first click on this ckechbox all lines
except those that should not be selected will select, but if you click
again, nothing happens. Obviously, the system tries to re-select all rows,
as there are unselected.
Is there a better way to solve the problem? Or how to solve a problem with
this method.
The only thing that comes to mind - you need to rewrite the Select All /
Unselect All functions for checkbox, but I not sure how I can do it.
Thanks in advance for your answers and I apologize if I made my question
is not according to the rules - this is my first appeal to stackoverflow.
Sincerely, Sergei Novikov.
Subscribe to:
Posts (Atom)