how to find the attachment filename which is getting deleted
both ItemAttachmentDeleted, ItemAttachmentDeleting events afterproperties and beforeproperties are empty
Hi. Is there a way to convert '@my_variable' string into a value of @my_variable?
I have a table which stores names of variables. I need to get the value of this variable. Something like this:
DECLARE @second_variable AS NVARCHAR(20);
DECLARE @first_variable AS NVARCHAR(20);
SET @first_variable = '20';
SET @second_variable = SELECT '@first_variable'; --here I want that @second variable be assigned a value of "20".
As you all know, when you build a project with an app.config file it gets copied to the bin directory and renamed $(targetFileName).config.
Is it possible for it to be called something else?
For example if my executable is called myApplication.exe, can I have the config file called settings.config as opposed to myApplication.exe.config?
Cheers
Hi !
If you add a directory in your Visual Studio project and you add a class inside it, the namespace will respect the whole path the directory inclusive.
But sometimes, I prefer having the class in the main project namespace, although it lies in a directory structure, just because I don't want to have mess in my code.
So often happens that I rewrite the Myproject.MyDirectory namespace to be Myproject only.
Is it OK in your opinion? Or does any convention say that every class inside the directory must have it included in the namespace ?
Thanks
I have added an IP address in IIS7 in the IP address and domain restrictions. From what I have read this should block all traffic to the folder apart from the allowed IP address. For some reason this does not work. If I access the section from my work computer all ok, when I access it from my phone I can still see the page.
Does anyone have any idea why IIS is not blocking all the other IPs out?
Thanks
I am currently playing around with jqueries drag and drop, basically I currently have a div (.drag_check) that holds a checkbox, I have the drag and drop working but I want to alert out the checkbox's ID once the element is dropped, I assume I have to use child but all my attempts have returned 'undefined'. Below is my code,
$('.drag_check').draggable({
containment: 'document',
opacity:0.6,
revert: 'invalid',
helper: 'clone',
zIndex: 100
});
$("ul.searchPage").droppable({
drop:
function(e, ui) {
var param = $(ui.draggable).attr('class')
addlist(param)
alert(param)
}
})
Ok, I've looked all over for a solution for this but so far I'm unable to find anything related to what I need to accomplish.
What I need is very simple as far as logic goes.
I have a nav bar like this one:
<nav>
<ul>
<li><a href="download.shtml">Download</a></li>
<li><a href="documentation.shtml">Documentation</a></li>
<li><a href="contact.shtml">Contact</a></li>
<li><a href="about.shtml">About</a></li>
</ul>
</nav>
And the URLs of the site are straightforward:
http://domain.net/download.shtml
http://domain.net/documentation.shtml
http://domain.net/contact.shtml
http://domain.net/about.shtml
Question:
How can I detect which page/URL I'm on and add a class of .active to the corresponding nav item?
The end result would be, for example if I'm in the Download page:
<nav>
<ul>
<li><a href="download.shtml" class="active">Download</a></li>
<li><a href="documentation.shtml">Documentation</a></li>
<li><a href="contact.shtml">Contact</a></li>
<li><a href="about.shtml">About</a></li>
</ul>
</nav>
Thanks in advance for any help on this matter.
First question here!
So, I am having some problems with pointers in Visual C++ 2008. I'm writing a program which will control six cameras and do some processing on them so to clean things up I have created a Camera Manager class. This class handles all operations which will be carried out on all the cameras. Below this is a Camera class which interacts with each individual camera driver and does some basic image processing.
Now, the idea is that when the manager is initialised it creates two cameras and adds them to a vector so that I can access them later. The catch here is that when I create the second camera (camera2) the first camera's destructor is called for some reason, which then disconnects the camera.
Normally I'd assume that the problem is somewhere in the Camera class, but in this case everything works perfectly as long as I don't create the camera2 object.
What's gone wrong?
CameraManager.h:
#include "stdafx.h"
#include <vector>
#include "Camera.h"
class CameraManager{
std::vector<Camera> cameras;
public:
CameraManager();
~CameraManager();
void CaptureAll();
void ShowAll();
};
CameraManager.cpp:
#include "stdafx.h"
#include "CameraManager.h"
CameraManager::CameraManager()
{
printf("Camera Manager: Initializing\n");
[...]
Camera *camera1 = new Camera(NodeInfo,1, -44,0,0);
cameras.push_back(*camera1);
// Adding the following two lines causes camera1's destructor to be called. Why?
Camera *camera2 = new Camera(NodeInfo,0, 44,0,0);
cameras.push_back(*camera2);
printf("Camera Manager: Ready\n");
}
class Base
{
public:
type1 m_Pants;
};
class Derived : Base
{
public:
type2 m_Pants
};
This essentially didn't get flagged as an error, but was creating all kinds of clobbering and issues throughout a project.
Does anyone know of a technicality that wouldn't flag this?
here jj will be the value of FN, but the trouble is iam getting a error message
??? Error using == fopen
Invalid filename.
DirName = 'Samples\mattest\jj';
FileName = split('\\',DirName);
[a,b] = size(FileName);
FN = FileName(b);
file_1 = fopen(FN,'w');
split method was found at
http://www.mathworks.com/matlabcentral/fileexchange/4873
Doesnt the code seem correct ? Could someone please help me ?
Hello !
I am working right now with Zend Framework and I've created a Model_User_Row in app\models\User\Row.php.
When I try to create an instance of that class in IndexController I get an error:
Fatal error: Cannot redeclare class Model_User_Row in
F:\Projekty\www\inz\app\models\User\Row.php on line 14
14th line is a close brace.
<?php
class Model_User_Row extends Zend_Db_Table_Row
{
/**
* @return array
*/
public function toArray()
{
$res = parent::toArray();
unset($res['password']);
return $res;
}
} // #14
In my project I have no other class called Model_User_Row.
I am a bit confused - how to debug this case ?
Hi all,
I'd like to use a JS regex to take a string such as the following:
'http://www.somedomain.com/some_directory/some_other_directory/some_image.jpg'
And turn it into this:
'http://www.some_other_domain.com/another_directory/yet_another_directory/size1_some_image.jpg'
Any hints? Additionally, any pointers for books or other resources that give a gentle introduction to mastering regexes in JS and other languages?
I have the following class;
class myStringMethod():
def __init__(self):
self.func_list= [('func1','print_func1()'),('func2','print_func2()')]
def print_func1(self, name):
print name
def print_func2(self, name):
print name
def call_func_by_name(self):
for func in self.func_list:
getattr(self, func[1])('Func Name')
if __name__=='__main__':
strM = myStringMethod()
strM.call_func_by_name() #Nothing prints out!
No functions get called out, what am i missing?
gath
Would it be ok to get a CF app to check for a valid database before proceeding to process that request?
This is because there may be instances where the database server may be down or being upgraded, hence an error comes when a db dependant request is made.
If there is no connection to the db server, the user can be safely redirected to a safe page.
Or can cfcatch work?
How can this check be done?
Thank you.
Hi
I'm fighting to get the following mapping working in Grails 1.3.1 and MySQL:
class Login {
int id
String email
static mappings = {
table 'my_table'
id column: "Mgr_id"
version: false
}
}
No matter what I do the queries that are being issued refer to "schema.login" table instead of "schema.my_table". This is very frustrating... Can anyone answer why this might not be working?
Hi
I'm porting some crufty C++ Windows-code to Linux, which uses functions called "open" and "close" inside every class... Very bad style, or? Luckily that wasn't a problem in windows, since their systemcalls are named different.
When I try to call the systemcalls open() or close() I'm getting some compiler error about "no matching function for call for class:open()". I can't rename all our functions named "class::open" and "class::close" in the whole code, and I have to use open() and close() since I'm working with serial ports.
So my question is: How can I tell the compiler, which open I mean? How can I escape or hide the namespace of a class in C++?
I have a script that recursively scans a directory pulling out class names from php files, and storing those classes names in an array. This is working nicely even through the rather large Zend Framework library folders.
The issue is that classes that extend other classes are not being included in the array.
Here is my current preg_match:
if (preg_match("/class\s*(\w*)\s*\{/i",strip_comments(file_get_contents($file)),$matches)) $classes[] = $matches[1];
I know that the last \s* is not right; there should be something there that can catch "{" or " extends Some_Other_Class {" .
I'm currently registering my domains through GoDaddy. Does the registrar matter? Any recommendations for registrars you're especially happy with?
(See this very similar question, that requires API support. I need no such support, hence this question is more generic).
I would like to be able to extract the entity and property from the ConstraintViolationException message in a rdbms neutral way... Can this be done ? if so how ?
$extension = “SUBSTRING_INDEX(domain_name, ‘.’, -1)”;
$this->db->order_by($extension, “asc”);
It says:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘asc LIMIT 50’ at line 44
But its working when I didn’t used the $this-db-order_by Active Record Class
such as this one:
$this-db-query(“SELECT * FROM domain ORDER BY SUBSTRING_INDEX(domain_name, ‘.’, -1)”);
Anyone please help me. Thanks.
Hi
I have one sharepoint application, in this i have to show the current user, i used SPContext.Current.Web.CurrentUser.LoginName. then it returns XXXXXX\abida. But i want only the username like abida. How to achieve this requirement?
I have a email address like [email protected] and [email protected][email protected] ... etc
I want a Mysql select query so that it would trim user names and .com an returns output as
gmail,ymail,hotmail etc
I have the following code:
template <typename Provider>
inline void use()
{
typedef Provider::Data<int> D;
}
Where I'm basically trying to use a template class member 'Data' of some 'Provider' class, applied to 'int', but I get the following errors:
util.cpp:5: error: expected init-declarator before '<' token
util.cpp:5: error: expected `,' or `;' before '<' token
I'm using GCC 4.3.3 on a Solaris System.
I've been wondering if using long descriptive variable names in WinForms C# matters for performance? I'm asking this question since in AutoIt v3 (interpreted language) it was brought up that having variables with short names like aa instead of veryLongVariableName is much much faster (when program is bigger then 5 liner). I'm wondering if it's the same in C#?