I'm wondering how to set the mouse cursor position under X11? Is it possible at all and if, where do I have to look for appropriate functions? X window system, KDE/Gnome/...?
I am using an Excel Add-in for an Erlangs:
http://abstractmicro.com/erlang/helppages/ref-erlbblockage.htm
I try to call the Erlang-B function within the Add-in from within VBA thus:
Function Erl(Erlangs As Double, Capacity As Double)
Erl = Application.WorksheetFunction.ErlbBlockage(Capacity, Erlangs)
End Function
...but it doesn't work. I get #VALUE! returned in the Excel cell.
I think it is because the function is not part of standard Excel (it is in the Add-in). So how do I call it?
In my C# code,DeviceIoControl is returning false,the handle is correct
DeviceIoControl(deviceHandle,
IOCTL_STORAGE_GET_DEVICE_NUMBER,
IntPtr.Zero,
0,
OutBuffPtr,//&psdn,
OutBuffSize,
ref dwBytesReturned,
IntPtr.Zero);
I found email composer sample code from iphone OS Ref Library. Here is a code-
Code:
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"];
NSArray *ccRecipients = [NSArray arrayWithObjects:@"[email protected]", @"[email protected]", nil];
NSArray *bccRecipients = [NSArray arrayWithObject:@"[email protected]"];
My question is how to take user's input? Here all email address are predefined in code. so what are the IDs of to, CC, Bcc, subject and body fields?
I'm having some trouble figuring out how to make a reference to a subroutine in an external .pm file.
Right now, I'm doing this :
External file
package settingsGeneral;
sub printScreen {
print $_[0];
}
Main
use settingsGeneral;
my $printScreen = settingsGeneral::printScreen;
&$printScreen("test");
but this result into an error:
Can't use string ("1") as a subroutine ref while "strict refs" in use
Hi all,
I am passing some weakrefs from Python into C++ class, but C++ destructors are actively trying to access the ref when the real object is already dead, obviously it crashes...
Is there any Python C/API approach to find out if Python reference is still alive or any other known workaround for this ?
Thanks
The DataContractJsonSerializer is not able to serialize Dictionaries properly.
Whereas JavaScriptSerializer serializes Dictionaries as {"abc":"xyz","def":42}
for example,
the DataContractJsonSerializer gives [{"Key":"abc","Value":"xyz"},{"Key":"def","Value":42}] instead.
This is really problematic and I want to know how can I serialize Dictionary objects correctly in my WCF service. I am looking for a solution that would require least amount of effort.
ref: http://msdn.microsoft.com/en-us/library/bb412170.aspx
hi,
in a ModelForm I replaced a field by excluding it and adding a new one
with the same name, as shown below in AddRestaurantForm. When saving
the form with the code shown below, I get an error in form.save_m2m()
("Truncated incorrect DOUBLE value"), which seems to be due to the
function to attempt to save the tag field, while it is excluded.
Is the save_m2m() function supposed to save excluded fields?
Is there anything wrong in my code?
Thanks
Jul
(...)
new_restaurant = form.save(commit=False)
new_restaurant.city = city
new_restaurant.save()
tags = form.cleaned_data['tag']
if(tags!=''): tags=tags.split(',')
for t in tags:
tag, created = Tag.objects.get_or_create(name = t.strip())
tag.save()
new_restaurant.tag.add(tag)
new_restaurant.save()
form.save_m2m()
models.py
class Tag(models.Model):
name = models.CharField(max_length=100, unique=True)
class Restaurant(models.Model):
name = models.CharField(max_length=50)
city=models.ForeignKey(City)
category=models.ManyToManyField(Category)
tag=models.ManyToManyField(Tag, blank=True, null=True)
forms.py
class AddRestaurantForm(ModelForm):
name = forms.CharField(widget=forms.TextInput(attrs=classtext))
city = forms.CharField(widget=forms.TextInput(attrs=classtext), max_length=100)
tag = forms.CharField(widget=forms.TextInput(attrs=classtext), required=False)
class Meta:
model = Restaurant
exclude = ('city','tag')
Traceback:
File "/var/lib/python-support/python2.5/django/core/handlers/base.py"
in get_response
92. response = callback(request, *callback_args,
**callback_kwargs)
File "/home/jul/atable/../atable/resto/views.py" in addRestaurant
498. form.save_m2m()
File "/var/lib/python-support/python2.5/django/forms/models.py" in
save_m2m
75. f.save_form_data(instance, cleaned_data[f.name])
File "/var/lib/python-support/python2.5/django/db/models/fields/
related.py" in save_form_data
967. setattr(instance, self.attname, data)
File "/var/lib/python-support/python2.5/django/db/models/fields/
related.py" in set
627. manager.add(*value)
File "/var/lib/python-support/python2.5/django/db/models/fields/
related.py" in add
430. self._add_items(self.source_col_name,
self.target_col_name, *objs)
File "/var/lib/python-support/python2.5/django/db/models/fields/
related.py" in _add_items
497. [self._pk_val] + list(new_ids))
File "/var/lib/python-support/python2.5/django/db/backends/util.py" in
execute
19. return self.cursor.execute(sql, params)
File "/var/lib/python-support/python2.5/django/db/backends/mysql/
base.py" in execute
84. return self.cursor.execute(query, args)
File "/var/lib/python-support/python2.5/MySQLdb/cursors.py" in execute
168. if not self._defer_warnings: self._warning_check()
File "/var/lib/python-support/python2.5/MySQLdb/cursors.py" in
_warning_check
82. warn(w[-1], self.Warning, 3)
File "/usr/lib/python2.5/warnings.py" in warn
62. globals)
File "/usr/lib/python2.5/warnings.py" in warn_explicit
102. raise message
Exception Type: Warning at /restaurant/add/
Exception Value: Truncated incorrect DOUBLE value: 'a'
I have just installed Visual Studio.NET. In the Design area I have added some graphical components (button, textbox) but I can't move these within the specified area, as their position remains unchanged. I would like to move these graphical components with the mouse cursor, I know it's possible, does anyone know how?
Is it possible to detect the computed font-size of a DOM element, taking into consideration generic settings made elsewhere (In the body tag for example), inherited values, and so on?
A framework-independent approach would be nice, as I'm working on a script that should work standalone, but that is not a requirement of course.
Background: I'm trying to tweak CKEditor's font selector plugin (source here) so that it always shows the font size of the current cursor position (as opposed to only when within a span that has an explicit font-size set, which is the current behaviour).
i want to grap data from this site using RegExp
http://www.islamqa.com/en/ref/20494
specially data in div with class="subject-container"
i tried this
/<div class="subject-container">(.*?)<\/div>\s*/is
but it gave me Invalid RegExp
why?
whenever i run the unit testing application to find whether appdelegate is there r not using the test suit
-(void)testAppDelegate
{
id app_delegate=[[UIApplication sharedApplication]delegate];
STAssertNotNil(app_delegate,@"delegate not found");
}
i got this error. Please help.
"_OBJC_CLASS_$_UIApplication", referenced from:
objc-class-ref-to-UIApplication in Tests.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Im trying to achieve current page highlights on wordpress similar to this site
Alex Soth.
I'm very nearly there with my css.
At present i have current page highlights on pages, ie. home,calendar, projects. However when it come to current page highlights on child pages i have a problem.
the indented child page list appears on hover when selecting a child page, but after page selection the menu reverts back to the standard pages menu with no visible child menus? unlike the link to the Alex Soth site where the extended menu stays and current page is highlighted
I know that the answer will be a simple piece of css involving current_page_item and possible position:relative to obtain the menu staying visible after selection. But i can for the life of me work it out.
Any ideas Ive attached my relivant pieces of css below??
thanks
/* =Link Styles
------------------------------------------------------------------*/
input#submit {
cursor: pointer;
}
input#searchsubmit {
background: url(images/search.png) no-repeat center;
}
input#searchsubmit:hover {
background: url(images/search.png) no-repeat center #3399FF !important;
cursor: pointer;
}
.navigation a:hover, input#submit {
background: #3399FF;
color: #3399FF !important;
}
a {
color: #666;
}
a:hover, a:hover span {
color: #c11501 !important;background-color: #fae100;
}
.entry sup a,
#main_nav .current_page_item a,
#main_nav .current_page_ancestor a
{
color: #666 !important;
}
#main_nav h1.masthead a {
color: #666;
}
#main_nav h1.masthead a:hover {
border-right: none;
}
h2 a, #main_nav a {
color: #3399FF;
}
img a, img a:hover {
text-decoration: none;
}
.post a, .navigation a {
font-weight: bold;
color: #000;
}
.navigation a {
background: #EEE;
color: #666;
font-weight: normal;
padding: 3px 0px;
border-radius: 0px;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
}
.post sup {
font-size: 11px;
color: #aaa;
}
.post sup a {
border: 0;
margin: 0;
font-weight: normal;
font-size: 10px;
}
#supplementary .post_nav ul.about_nav li a, #supplementary .post_nav ul.single_post_meta a, #supplementary ul.contact_key li a {
color: #888888;
border-bottom: 0;
}
/* =Main Menu
------------------------------------------------------------------*/
#main_nav ul.menu li {
position: relative;
}
#main_nav ul.menu li:hover ul.sub-menu,
#main_nav ul.menu li:hover ul.children {
display: block;
}
Sql server 2005 (even 2008) strips the insignificant whitespaces by default. To keep one can use the CONVERT funtction with the last argument as '1' (Ref. Article). How can we do the same thing in Entity Framework?
thanks
I'm a newbie android programmer and I recently followed a tutorial which shows how to create a local SQLite database by using SQLiteDatabase.rawQuery to return a Cursor. I would like to modify my app to use CursorLoader which is apparently a better way to access the database.
My problem is the CursorLoader constructor expects a URI to be given. Do I just input "file:///[path to db]"? Seems a bit messy.
Be gentle, as my macrofoo is weak.
What I'd like to do is something like this:
(defmacro foo [x] (dosync (alter x# conj x)))
(defmacro bar [] (let [x# (ref [])] (foo 3)))
Is this possible? I can't just (let [x ..] ..) because of symbol capturing.
NOTE: I'm aware this example is trivial and not macro-worthy, but it's the simplest example I could come up with.
I have a c script that I want to compile to a fastcgi script. Does anyone have a good ref or easy explanation on how to do this? I dont understand the docs...
I have a simple query over a table, which returns results like the following:
id id_type id_ref
2702 5 31
2702 16 14
2702 17 3
2702 40 1
2702 26 4
And I would like to merge the results into a single row, for instance:
id concatenation
2702 5,16,17,40,26:31,14,3,1,4
Is there any way to do this within a trigger?
NB: I know I can use a cursor, but I would really prefer not to unless there is no better way.
I just started on the .net compact framework. I want to draw a Sudoku field on the screen. So I put down a PictureBox and defined a method for the Paint event:
private void pictureBoxPlayfield_Paint(object sender, PaintEventArgs e)
{
// use e.Graphics to draw the grid, numbers and cursor
}
This works, but you can see as the grid is drawn. So my question is, what is the right/better way to create such a custom control? Is there maybe a way to enable double buffering?
I want to make my own GTK# Textbox, the textbox should draw the text and it's cursor on a special way.
However keyboard and mouse-handling is quite complex and is also influenced by for instance the operating system (for instance the use of dead keys)
Is there a way to build such a control without having to worry about keyboard input?
I assume I have to make a textbox control that inherits the original textbox control. How can I handle drawing requests and mouse movements?
Hello!
I have three questions about editbox control in WINAPI (i can't find information on msdn about this)
1. How to disable moving typeing cursor with mouse, arrows, backspace in editbox ? I want to make typing like in command line in dos, but with out backspace.
Can I write some piece of text with red color, and another with blue ?
How to write to editbox control from another thread ?
Is there any easy way to execute a chunk of code instead of moving cursor to the beginning of code chunk, and shift + down arrow to the end of code, then hit F5?
Is there any keyboard shortcut to duplicate line (duplicate several lines), delete line (delete several lines)?
Thanks.
I am trying to number some rows on a bridge table with a single UPDATE/SELECT statement using a counter variable @row. For example:
UPDATE teamrank JOIN (SELECT @row := @row + 1 AS position, name FROM members)
USING(teamID, memberID) SET rank = position
Is something like this possible or do I need to create a cursor? If it helps, I am using MySQL 5.
Hi,
I have obtained the crosshair cursor from NSCursor crosshairCursor. Then, how can i change
to it. I don't want to call enclosingScrollView to setDocumentCursor as
[[view enclosingScrollView] setDocumentCursor:crosshaircursor ];
I've been having trouble with the latest netbeans ruby ide.
Here is the weird behavior:
"|" = my cursor
some text |here
I try to add a single quote. Expected:
some text '|here
However I get
some text h'|ere
It's worse when there is a linebreak:
some text here |
some other text here
turns into
some text here
'| some other text here
Am I hitting some weird behavior of netbeans that can be turned off for this? I mean it is insanely annoying.