Xmonad configuration file issue - configuration

I am using Xmonad since long time now and it works well, execept I can not modify the configuration file xmonad.hs because there are some strange errors even with the basic configuration;
my actual file is :
import XMonad
main = xmonad $ defaultConfig
{borderWidth =1
, terminal = "urxvt"
, normalBorderColor = "#cccccc"
, focusedBorderColor = "#cd8b00" }
when I check the file I get this:
HsUnix.c:(.text+0x0): multiple definition of `__hsunix_wifexited'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix-2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x0): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_wexitstatus':
HsUnix.c:(.text+0x10): multiple definition of `__hsunix_wexitstatus'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix-2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x10): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_wifsignaled':
HsUnix.c:(.text+0x20): multiple definition of `__hsunix_wifsignaled'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix-2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x20): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_wtermsig':
HsUnix.c:(.text+0x40): multiple definition of `__hsunix_wtermsig'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x40): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_wifstopped':
HsUnix.c:(.text+0x50): multiple definition of `__hsunix_wifstopped'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x50): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_wstopsig':
HsUnix.c:(.text+0x60): multiple definition of `__hsunix_wstopsig'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix-2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x60): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_SIGWINCH':
HsUnix.c:(.text+0x70): multiple definition of `__hsunix_SIGWINCH'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix-2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x70): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_push_module':
HsUnix.c:(.text+0x80): multiple definition of `__hsunix_push_module'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x80): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_long_path_size':
HsUnix.c:(.text+0x90): multiple definition of `__hsunix_long_path_size'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix-2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x90): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_unsetenv':
HsUnix.c:(.text+0xa0): multiple definition of `__hsunix_unsetenv'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0xa0): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hscore_setrlimit':
HsUnix.c:(.text+0xb0): multiple definition of `__hscore_setrlimit'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0xb0): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hscore_getrlimit':
HsUnix.c:(.text+0xc0): multiple definition of `__hscore_getrlimit'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0xc0): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hscore_mkstemp':
HsUnix.c:(.text+0xd0): multiple definition of `__hscore_mkstemp'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0xd0): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_unlockpt':
HsUnix.c:(.text+0xe0): multiple definition of `__hsunix_unlockpt'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0xe0): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_grantpt':
HsUnix.c:(.text+0xf0): multiple definition of `__hsunix_grantpt'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0xf0): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_ptsname':
HsUnix.c:(.text+0x100): multiple definition of `__hsunix_ptsname'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x100): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_mknod':
HsUnix.c:(.text+0x180): multiple definition of `__hsunix_mknod'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix- 2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x110): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(HsUnix.o): In function `__hsunix_lstat':
HsUnix.c:(.text+0x1c0): multiple definition of `__hsunix_lstat'
/usr/local/lib/ghc-6.10.3/unix-2.3.2.0/libHSunix-2.3.2.0.a(HsUnix.o):HsUnix.c:(.text+0x150): first defined here
/usr/local/lib/ghc-6.10.3/base-4.1.0.0/libHSbase-4.1.0.0.a(PrelIOUtils.o): In function `__hscore_d_name':
PrelIOUtils.c:(.text+0x1c0): multiple definition of `__hscore_d_name'
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix- 2.4.0.0.a(dirUtils.o):dirUtils.c:(.text+0x0): first defined here
/usr/local/lib/ghc-6.10.3/base-4.1.0.0/libHSbase-4.1.0.0.a(PrelIOUtils.o): In function `__hscore_free_dirent':
PrelIOUtils.c:(.text+0x580): multiple definition of `__hscore_free_dirent'
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix- 2.4.0.0.a(dirUtils.o):dirUtils.c:(.text+0x10): first defined here
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(IO.o): In function `slqz_info':
(.text+0x227f): undefined reference to `fcntl_read'
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(IO.o): In function `slqz_info':
(.text+0x22ab): undefined reference to `fcntl_read'
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(IO.o): In function `skA0_info':
(.text+0x2358): undefined reference to `fcntl_write'
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(IO.o): In function `skAq_info':
(.text+0x240f): undefined reference to `fcntl_write'
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(IO.o): In function `slwb_info':
(.text+0x2703): undefined reference to `fcntl_read'
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(IO.o): In function `slwb_info':
(.text+0x272f): undefined reference to `fcntl_read'
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(IO.o): In function `slzG_info':
(.text+0x29a3): undefined reference to `fcntl_lock'
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(IO.o): In function `slCa_info':
(.text+0x2b73): undefined reference to `fcntl_lock'
/home/giuseppe/.cabal/lib/unix-2.4.0.0/ghc-6.10.3/libHSunix-2.4.0.0.a(IO.o): In function `slFq_info':
(.text+0x2dff): undefined reference to `fcntl_lock'
collect2: ld returned 1 exit status
Please check the file for errors.
can somebody help me? I would like configure xmonad to use xmobar, but If not even the simplest configuration works, iI do not know how to do it, I know that xmonad is using the last working configuration, maybe I can find it and modify, I do not know I am confused, thanks in advance

You have 2 versions of "unix" haskell library: system one and for your local user giuseppe. You can try hiding the last one just for recompiling the xmonad config, unhide it later.
ghc-pkg hide --user unix-2.4.0.0

Related

Understanding the difference between object.function(argument) and object:function(argument) in Lua

obj ={x=30}
function obj:printpos()
print(self.x)
end
other = {x=15}
obj.printpos(other)
The obj.printpos(other) gives expected output viz. 15. However the call obj:printpos(other) doesn't give expected output.It still prints 30. Why the call obj:printpos(other) is not taking other as its argument? Basically what is the difference between object.function(argument) and object:function(argument)? Is object:function(argument) same as object:function() i.e. whether argument is ignored?
obj:printpos(other) is equivalent to obj.printpos(obj, other).
function obj:printpos() end is equivalent to function obj.printpos(self) end.
From Lua 5.4 Reference Manual - §3.4.11 – Function Definitions (formatting mine):
The colon syntax is used to emulate methods, adding an implicit extra parameter self to the function. Thus, the statement
function t.a.b.c:f (params) body end
is syntactic sugar for
t.a.b.c.f = function (self, params) body end
From this, we can see the colon syntax implicitly adds the self parameter to the function scope.
Inversely, calling a function defined with the colon syntax using the dot syntax will cause the first argument passed to it to be assigned to the self parameter.
Thus, with
local thing = {}
function thing:func()
print(self)
end
the calls
thing:func()
-- and
thing.func(thing)
have the same result of assigning thing to self, and
thing.func(other_thing)
will assign other_thing to self.
The problem with
thing:func(other_thing)
is that, as previously seen, thing is assigned to self. other_thing is assigned to no parameter, as no other parameters were defined.

Julia - Change method definition within a function

So here's what I want, I have a function: f(x,t)=... where x is the "true" variable and t is a parameter. However, I need to use this function as a parameter in the Calculus package's derivative. This function requires a function with only one parameter. For this what I thought off was to redefine a method f(x)=f(x,t) where I fix the t parameter before passing it to the derivative function. This has to be done within another function.
However, doing this literally returns this error :
syntax: cannot add method to function argument f
I believe due to variable scope issues you should simply select a different name for your new function. You can also use anonymous functions instead of named definitions.
function foo(t_val)
newf(x) = f(x, t_val)
derivative(newf, otherparams...)
end
With anonymous functions,
function foo(t_val)
derivative(x -> f(x, t_val), otherparams...)
end
You can also assign anonymous functions to variables and use the variables as a function.
function foo(t_val)
newf = x -> f(x, t_val)
derivative(newf, otherparams...)
end

How to use Transactions in cakephp

I write this code, but its not working, it gives this error
Call to a member function commit() on a non-object
Hear is my code
$datasource = $this->Arrear->getDataSource();
$datasource->begin();
if($this->Customar->saveField("total_bake",$amount) && $this->Arrear->save()){
$dataSource->commit();
return $this->redirect(array('action'=>'index'));
}else{
$dataSource->rollback();
$this->Session->setFlash('Data insert Failed','failure');
}
Variables in php(and hence in cakephp as well) are case-sensitive
http://php.net/manual/en/language.variables.basics.php
you have in your first line
$datasource = $this->Arrear->getDataSource();
but you are committing like
$dataSource->commit();
you have the data source assigned to $datasource, but not to $dataSource. The last variable even is not defined, that is why it is showing that error. So, you have to be sure you are using exactly the same variable (with same capitalization) in all places.

Codeigniter:Using defined constants for table names in a join call

I have a defined constant for each of my database tables.
define('QTABLE','questions');
define('ATABLE','answers');
I would like to join these tables using a commonly referenced column "xid".
Here's how I'd do it if I referenced the actual name of the tables.
$this->db->from('questions');
$this->db->select('qcount,answers.xid,answers.aval');
$this->db->join('answers','questions.xid=answers.xid');
$gquery=$this->db->get();
But I do not want to reference the table names directly in the code in case we need to rename them later. How would I use the defined constants correctly to do this with Codeigniter's Active Records? I suspect it's all about escaping with the correct kind of single/double quotes.
I tried the following and it definitely does not work!
$this->db->from(Q-TABLE);
$this->db->select('qcount,ATABLE.xid,ATABLE.aval'); <----PROBLEM
$this->db->join(ATABLE,'QTABLE.xid=ATABLE.xid');<------PROBLEM
$gquery=$this->db->get();
Could you show me the way to the light?
mmiz
In your model
function __construct()
{
// Initialization of class
parent::__construct();
define('QTABLE','questions'); // define constant here in constructor
define('ATABLE','answers'); // define constant here in constructor
}
try query like this
$this->db->select('qcount,'.ATABLE.'.xid,'.ATABLE.'.aval');
$this->db->from(QTABLE);
$this->db->join(ATABLE,QTABLE.'.xid='.ATABLE.'.xid');
$query=$this->db->get();
echo $this->db->last_query(); exit;

VFP function to check if a method is defined

I would like to trigger a method of an object by using BINDEVENT(), but the method may not exist. Thus, I want to check if the method is defined before issuing BINDEVENT().
For example, in the following code snippet, if oHandler.myresize() does not exist, the error will be triggered at the line of BINDEVENT().
PUBLIC oHandler
oHandler=NEWOBJECT("myhandler")
DO (_browser)
BINDEVENT(_SCREEN,"Resize",oHandler,"myresize")
DEFINE CLASS myhandler AS Session
PROCEDURE myresize
IF ISNULL(_obrowser) THEN
UNBINDEVENTS(THIS)
ELSE
_obrowser.left = _SCREEN.Width - _obrowser.width
ENDIF
RETURN
ENDDEFINE
Thus, I want to check the method myresize() exists or not.
Is there any language function for this purpose? It is very similar to a php function function_exits() or method_exists().
PEMSTATUS( VariableNameRepresentingTheObject, "MethodOrPropertyLookingFor", 5 )
returns true or false if exists on the given object.