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?
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
Just a quick question, that I cannot fathom out, hope you guys and girls can help.
I have a div (with ID) that when clicked opens a new div - great works well, what I really want is to "populate" the new div with predefined text based on the clicked div's ID. example:
<div class="infobox" id="help_msg1">Click me</div>
I may have say 3 (actually more but...) of these div's
This opens:
<div id="helpbox">text in here</div>
In/on my .js page I have doc ready etc then:
var help_msg1 ='text that is a help message';
var help_msg2 ='text that is another help message';
var help_msg3 ='text that is yet another help message';
Then
$('.infobox').live('click',function() {
$('#helpbox').remove();
$('label').css({'font-weight': '400'});
$(this).next('label').css({'font-weight': '900'});
var offset = $(this).next().next().offset();
var offsetby = $(this).next().next().width();
var leftitby = offset.left+offsetby+10;
$('body').append('text in here');
$('#helpbox').css( { 'left': leftitby, 'top': offset.top } );
});
Note I remove each #helpbox before appending the new one and the .next().next() identifies the appropriate text input that lot all works.
What I need is how do I put var help_msg1 into the append when id="help_msg1" is clicked or var help_msg2 when id="help_msg2" is clicked etc. I have tried
How would I select only the first level .block and not any of the children?
$('.block:not("Children of this here")') <--
<div class="block">
<div class="block">
<div class="block">
</div>
</div>
</div>
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".
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 ?
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.
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 {" .
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?
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?
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 there,
Is there a way to change the name that displays on the AppStore, rather than the name associated with the credit card/apple ID associated with the developer programme?
For example, if my name on my credit card was foo, and the name on the apple ID was foo, but I actually want the name displayed on the AppStore (i.e. next to my App's name and details) to be bar.
BTW: The programme is individual.
Many thanks,
Jack
So we have a lot of routines that come out from exporting. We often need to get these out in CLI, make changes and bring them back in. Yes some of these are managed by different folks and a better change control is required but for now this is the situation.
If I do mysqldump --routines --no-create-info --no-data --no-create-db then great I have 200 functions I need to go through a file to find just the one or set I want.
Is there anyway to mysqldump routines that I want like there is for tables???
Our app uses migratordotnet to modify the backing SQL Server 2005 database. This works great 99% of the time but we are running into an issue. We have a client that is using and Active Directory group for sql server login and when new tables are added it creates them as Domain\login.table_name. What permissions are needed to be given to the AD group to add the tables as dbo.table_name? This does not happen in with all of our clients with similar configurations so I must be missing something.
Hello everybody,
Please help me with a function that validate an input string to allow:
1) UTF-8 characters (ex: staîâ) ; 2) space ; 3) minus symbol(-)
String cannot start or end with space or minus.
Thanks!
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).
$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.
I tried adding my own fields with names like _myappvar and _myotherappvar to documents to distinguish them from data fields. At first it worked but at certain points futon complains.
What is the right way to go?
I am using couchdb 0.9.0, this may be old, butI will not be able to upgrade in this iteration.
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.
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
My xml is like below
<rat>
<to>tt</to>
<from>ggg</from>
<heading>hhhhh</heading>
<body>jjj</body>
</rat>
My AS3 code is
var example:XML = new XML(event.target.data);
_label.text = example[0].rat[0][nodeName];
addChild(_label);
I want to display the data like
to = tt
from = ggg
how can i do that
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)
}
})
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 ?