Hi i have 2 div
<div style="width:50px;height:100px;overflow:auto" id="outer">
<div class="kind_div">hello</div>
</div>
i tried the draggable function of jquery ui:
$("div.kind_div").draggable({ cursor: 'crosshair', containment: 'document', appendTo: 'body' });
i can drag the kind_div but it remains into the outer div
I want drag it in all body of my page
how can i do?
thanks
Hi i have these classes:
class Core < ActiveRecord::Base
belongs_to :resource, :polymorphic => true
belongs_to :image, :class_name => 'Multimedia', :foreign_key => 'image_id'
end
class Place < ActiveRecord::Base
has_one :core, :as => :resource
end
If i try do launch this:
a = Place.find(5)
a.name ="a"
a.core.image_id = 24
a.save
name is saved. image_id no
i want save automatically all changes in records in relationship with place class at a.save command. is possible?
thanks
Hi i'm using this for getting data:
Topic.find(:all, :include => ...,
:conditions => @core ? ["cores_topics.id = ? AND visible = 1 AND (distance < ? OR cores.id IN (?))",@core.id, @user_location[3].to_i, @user_friends] :
["visible = 1 AND (distance < ? OR cores.id IN (?))", @user_location[3].to_i, @user_friends],
...
how can i rewrite the conditions shorter?
thanks
Hi i have to select the 2 lastest element for every topic
ex:
table: msg
id | topic_id
-----------
1 | 1
2 | 1
3 | 1
4 | 1
5 | 2
6 | 2
7 | 2
8 | 3
i want obtain these rows:
3 1
4 1
6 2
7 2
8 3
How can i do?
thanks
i've created a function for convert minutes (smallint) in time (varchar(5))
like 58 - 00:58
set QUOTED_IDENTIFIER ON
GO
Create FUNCTION [dbo].[IntToMinutes]
(
@m smallint
)
RETURNS nvarchar(5)
AS
BEGIN
DECLARE @c nvarchar(5)
SET @c = CAST((@m / 60) as varchar(2)) + ':' + CAST((@m % 60) as varchar(2))
RETURN @c
END
The problem is when there are minutes < 10 in time
like 9
the result of this function is 0:9
i want that the format is 00:09
how can i do that?
This query generates an error because table2 doesn't exist:
Select * FROM table WHERE table2.id IS NOT NULL
Is there anything like this for check the table2 before apply the check on the id?
Select * FROM table WHERE (EXIST(table2) AND table2.id IS NOT NULL) or not EXIST(table2)
Thanks
Hi i've wrote a query that works:
SELECT `comments`.* FROM `comments`
RIGHT JOIN (SELECT MAX( id ) AS id, core_id, topic_id
FROM comments GROUP BY core_id, topic_id order by id desc) comm
ON comm.id = comments.id LIMIT 10
I want know if is possible and how rewrite it for get better performance.
thanks
I have this linq query:
var segreterie = from s in db.USR_Utenti join h in db.USR_Accounts
on new {s.ID, settings.GruppoSegreteria}
equals new {h.USR_UtentiReference,h.ID_Gruppo} select s;
that has this problem:
The type of one of the expressions in the join clause is incorrect. Type inference failed in the call to 'Join'.
how can i do to solve it?
hi, i have 2 object: user, group that have a relationship many to many
i want create a user and associate some groups to it.
How can i do it?
thanks
I've tried with this. but it's wrong:
user = new User();
List<int> gruppi = new List<int>() {1,2};
utente.Group =db.Group.Where(p => gruppi.Contains(p.GruppoID)
Hi, i have a table like this:
Table(MissioneID, Type)
Type can be 1,2 or 3
i have to count missions by type value:
ex. if table's content is:
MissioneID Type
1,1
1,2
1,1
2,3
1,2
The result of query is
MissioneID,Count1,Count2,Count3
1, 2,2,0
2,0,0,1
How can i do?
thanks
I'm having a lot of problems configuring dovecot ony vps.
I'm already able to send email using port 110 and to receive email using port 25,
but I can't connect using port 993 and 995. I'm using self-signed ssl certificates.
When I try to connect to 993 this error is logged:
Jun 8 19:06:39 MY_HOSTNAME dovecot: imap-login: Disconnected (no auth attempts in 2 secs): user=<>, rip=MY_IP, lip=MY_VPS_IP, TLS, session=<MY_SESSION>
When I try to connect to 995 here is the error log:
Jun 8 19:08:17 MY_HOSTNAME dovecot: pop3-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=MY_IP, lip=MY_VPS_IP, TLS: SSL_read() failed: error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown: SSL alert number 46, session=<MY_SESSION>
EDIT: I was able to fix this part by refreshing my mail client ssl cert.
Anybody can help me please ? I'm stuck :/
Many thanks
I have a BIND 9.6 instance that acts as a caching NS for the whole building and is also authoritative for an internal zone ("example" below):
zone "example" {
type master;
file "example";
update-policy { grant dhcp-update subdomain example. A TXT; };
};
Due to a rogue switch we lost connectivity with the rest of the world, and the NS started answering SERVFAIL; what surprised me was that the server was also unable to respond to queries for the example domain.
What is the reason of this behavior? Shouldn't the NS be able to answer since it has authoritative data?
edit: The rest of the configuration is the standard one shipped with Debian: hints for the root servers and the zones for localhost and broadcast.
I have both local.domain.com and lmarket.local.domain.com pointing to my localhost from etc/hosts.
The problem is that I am using XAMPP on Windows 7, and have 2 SSL VirtualHosts in my apache config, but no matter which one I access, I am taken to local.domain.com. On non-HTTPS requests all works fine, and the vhosts are basically the same.
Here is the relevant part of my vhosts:
<VirtualHost local.domain.com:443>
DocumentRoot "C:/xampp/htdocs/local"
ServerName local.domain.com
ServerAdmin webmaster@localhost
ErrorLog "logs/error.log"
<IfModule log_config_module>
CustomLog "logs/access.log" combined
</IfModule>
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"
<FilesMatch "\.(cgi|shtml|pl|asp|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "C:/xampp/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
CustomLog "logs/ssl_request.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
<VirtualHost lmarket.local.domain.com:443>
DocumentRoot "C:/xampp/htdocs/lmarket.local"
ServerName lmarket.local.domain.com
ServerAdmin webmaster@localhost
ErrorLog "logs/error.log"
<IfModule log_config_module>
CustomLog "logs/access.log" combined
</IfModule>
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"
<FilesMatch "\.(cgi|shtml|pl|asp|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory "C:/xampp/cgi-bin">
SSLOptions +StdEnvVars
</Directory>
BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
CustomLog "logs/ssl_request.log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
If I invert these blocks, then the opposite happens: local.domain.com goes to lmarket.local.domain.com. Any help would be appreciated.
I just set up an internal http server for internal use (I set up Redmine), in a small network (30 or so PCs).
I set up the http server on a virtual box ubuntu, that runs also the DNS server (bind).
In the DNS lookup I added the Redmine server name (redmine.engserver <- 192.168.1.14) and as forwarders the outside ISP DNS IP adresses.
I am using a small wi-fi router (ASUS RT-N66U) as DHCP (and as gateway). In the DHCP config page I set up as DNS the ubuntu server IP (it is fixed 192.168.1.14).
Now when I connect a new PC to the network, the DHCP router issues its new IP and as DNS servers it issues: primary: 192.168.1.14 (ubuntu machine) and seconary 192.168.1.1 (the router itself).
ipconfig /all
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DHCPv6 IAID . . . . . . . . . . . : 248539109
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-17-15-AA-3F-D0-67-E5-49-A7-EF
DNS Servers . . . . . . . . . . . : 192.168.1.14
192.168.1.1
NetBIOS over Tcpip. . . . . . . . : Enabled
Before changing the DHCP setting on the router, I would always get only one DNS server: 192.168.1.1 (which uses probably DNS forwarding to external public DNS services).
The problem is this:
If in my browser I type www.google.com, it works all the time.
If in the browser I type http://redmine.engserver/ it works most of the time, but sometimes it ends up with a yahoo page search or something else. In the DNS cache it shows as (Server not found). ipconfig /displaydns
I looked with wireshark and it seems like sometimes the client PC interrogates the secondary DNS (192.168.1.1) instead of the first 192.168.1.14.
Obviously this one is a public domain and it does not have the redmine.engserver entry.
What is wrong in this configuration?
Is it even legitimate to have 2 DNS (one internal and one forwarded by the router) which are inconsistent?
Is there another way to have a local name service in a small office network?
Why is the router DHCP issuing itself as DNS?
I found myself in a setup on where I need to enable some authentication method using mysql.
I already have an user scheme. That user scheme is working like a charm with MD5 password and CRYPT, but when I turn to SHA1sum it says:
[Fri Oct 26 00:03:20 2012] [error] Unsupported encryption type:
Sha1sum
No useful debug informations on log files.
This is my setup and some info:
debian6
apache and ssl installed packages:
root@sistemichiocciola:/etc/apache2/mods-available# dpkg --list | grep apache
ii apache2 2.2.16-6+squeeze8 Apache HTTP Server metapackage
ii apache2-mpm-prefork 2.2.16-6+squeeze8 Apache HTTP Server - traditional non-threaded model
ii apache2-utils 2.2.16-6+squeeze8 utility programs for webservers
ii apache2.2-bin 2.2.16-6+squeeze8 Apache HTTP Server common binary files
ii apache2.2-common 2.2.16-6+squeeze8 Apache HTTP Server common files
ii libapache2-mod-auth-mysql 4.3.9-13+b1 Apache 2 module for MySQL authentication
ii libapache2-mod-php5 5.3.3-7+squeeze14 server-side, HTML-embedded scripting language (Apache 2 module)
root@sistemichiocciola:/etc/apache2/sites-enabled# dpkg --list | grep ssl
ii libssl-dev 0.9.8o-4squeeze13 SSL development libraries, header files and documentation
ii libssl0.9.8 0.9.8o-4squeeze13 SSL shared libraries
ii openssl 0.9.8o-4squeeze13 Secure Socket Layer (SSL) binary and related cryptographic tools
ii openssl-blacklist 0.5-2 list of blacklisted OpenSSL RSA keys
ii ssl-cert 1.0.28 simple debconf wrapper for OpenSSL
my vhost setup:
AuthMySQL On
Auth_MySQL_Host localhost
Auth_MySQL_User XXX
Auth_MySQL_Password YYY
Auth_MySQL_DB users
AuthName "Sistemi Chiocciola Sezione Informatica"
AuthType Basic
# require valid-user
require group informatica
Auth_MySQL_Encryption_Types Crypt Sha1sum
AuthBasicAuthoritative Off
AuthUserFile /dev/null
Auth_MySQL_Password_Table users
Auth_MYSQL_username_field email
Auth_MYSQL_password_field password
AuthMySQL_Empty_Passwords Off
AuthMySQL_Group_Table http_groups
Auth_MySQL_Group_Field user_group
Have I missed a package/configuration or something?
I want to use SendGrid as my email sending service, but want to also use Postfix's internal queue mechanism to manage the emails sent through Sendgrid.
So basically what I want to do is to configure Postfix to send emails through Sendgrid's SMTP, and I will configure my app to send the emails using the local Postfix.
My question is, how can I configure Postfix to use an external SMTP? Looked here but didn't see anything useful.
I have 3 Varnish 3.0.2 servers with Apache 2 as backends, which are being load balanced through a HAproxy separate server.
I need to find a very simple program (I'm not much of a sysadmin), which blocks requests from an IP, if that IP has made more than X requests in Y seconds.
Would something like this be achievable with a simple solution? Right now I have to block all requests manually with iptables.
I installed uwsgi and created a bash script, which allows me to start/stop uwsgi in the following manner: service uwsgi [start|stop]. This bash script is located in /etc/init.d/uwsgi.
Now, I want to (politely) ask Supervisor to use that script to manage the uwsgi process. All the tutorials indicate that this is not the way to do it, however I do want to be able to do both service uwsgi stop and supervisorctl stop uwsgi (not sure if I nailed the syntax of the latter) -- even though I am aware that the first one will not in fact stop my service because supervisor will restart it (that's exactly what I need).
Note that I'm using uwsgi in emperor mode if that matters in any way.
hello!
i have to create a videowall, from 3 to 9 monitor.
every monitor as a pc.
actually, i stream from a server 9 movies with different istances of VLC, but i could also play on every machine the relative video with a single player.
there's no problem.
the real problem is that i really dont know how to sync the videos on a LAN...unfortunately there is a NETSYNC module inside VLC wich is NOT working.
here are some info about my setup:
videowall from 3 to 9 monitor ||
from 3 to 9 pc, all with the same configuration ||
a gigabit router+switch for the "dedicated" LAN
im really stuck in this situation, if anyone has an idea or just a completely different solution, please, share it with me!
thanks a lot in advance! :)
Hi All!
My problem is that my FTP work great, exept when i upload files on a particular client server!
on this server happen that some files are uploaded fine and others not, they stop while uploading at half of it's size, then this error is displayed:
530 Sorry, the maximum number of
clients (4) from your host are already
connected. Unable to make a
connection. Please try again.
Obviously this is not true, i'm the only one that is uploading!
Anyone had the same experience with this!?
PS: i have tried many different FTP, all display the same error or just hung up!
Thank's