Hi,
I have a string in PHP for example $string = "Blabla [word]";
I would like to filter the word between the '[' brackets.
The result should be like this $substring = "word";
thanks
do you got the solution for your problem ?
im working on the exact same thing and cant get it to work...
if u could post the solution, it would be much appreciated :o
greetingz
msn: [email protected]
steam : [email protected]
I have defined an object in 3D space with position, rotation and scale values (all defined as 3D vectors). It also has upwards and forwards direction vectors. When I rotate the object, I need these direction vectors to rotate with it.
Assuming my up vector is (0, 1, 0) and my forwards vector is (0, 0, 1) at zero rotation, how might I achieve this?
Hello SO;
I'm trying to convert xml elements whose content is a csv list of identifiers, the exact form doesn't matter. I want to exclude every item that contains the character "/". The best I've come up with is
translate(./someElement, ",*/*", "")
but this has at least two problems; I'm pretty sure that xsl doesn't accept wildcards, and "," is an illegal character in xpaths.
Is there a straightforward way to do this sort of thing?
I'm trying to add a button onclick event to a button tag when I load my Fancybox popup using the following code:
var processOrder = function(id) {
$('#processPopupLink').fancybox({
'hideOnContentClick': false,
'frameWidth': 850,
'frameHeight': 695
}).click();
$('#processComplete').click(function() {
alert('debug');
});
}
However, it's not showing the message box when I click the button, I have no idea why it is not working, any help would be appreciated.
Basically i have binary data, i dont mind if it's unreadable but im writing it to a file which is parsed and so it's importance newline characters are taken out.
I thought i had done the right thing when i converted to string....
byte[] b = (byte[])SubKey.GetValue(v[i]);
s = System.Text.ASCIIEncoding.ASCII.GetString(b);
and then removed the newlines
String t = s.replace("\n","")
but its not working ?
I've seen a few function definitions like this recently while playing with GNU Bison:
static VALUE
ripper_pos(self)
VALUE self;
{
//code here
}
Why is the type of self outside of the parenthesis? Is this valid C?
Switching aged 2003 SRV to 2008 caused my Asp.net 2 application fail: The application is no more loading the required library DLL from /bin/ folder anymore.
What should I change in my code or web.config to make this webapp load OK also in new 2008 server?
Now I receive this error when I access the application: This type is in IMPORTS ( Dll ).
Compiler Error Message: BC30002: Type
'Facebook.Entity.User' is not defined.
The IBM Toolkit for MPEG-4 comes with the following paragraph in its licence:
Rights In Data
You assign to IBM all right, title,
and interest (including ownership of
copyright) in any data, suggestions,
and written materials that 1) is
related to Your use of the Program and
2) You provide to IBM. If IBM requires
it, You will sign an appropriate
document to assign such rights.
Neither party will charge the other
for rights in data or any work
performed as a result of this
Agreement.
Correct me if I am wrong, but I'm understanding that I cannot use their toolkit without give them rights on my software?
Hi!
I'm a web developper/objective-c developper and I'd like to learn quickly to make some apps for windows.
I say quick because I'm used to learning many languages and I don't need any overview on concepts, patterns, etc.
Any answers will be very appreciated :)
Thanks!
I've just read this topic http://stackoverflow.com/questions/2930533/highlight-search-keywords-on-hover and actually I use pretty the same structure, but it looks awful. So can you give me an advice, how to write this loop prettier in one php file, I mean php and html at the same time?
<table class="result">
<?php while ($row= mysql_fetch_array($result, MYSQL_ASSOC)) {
$cQuote = highlightWords(htmlspecialchars($row['cQuotes']), $search_result);
?>
<tr>
<td style="text-align:right; font-size:15px;"><?php h($row['cArabic']); ?></td>
<td style="font-size:16px;"><?php echo $cQuote; ?></td>
<td style="font-size:12px;"><?php h($row['vAuthor']); ?></td>
<td style="font-size:12px; font-style:italic; text-align:right;"><?php h($row['vReference']); ?></td>
</tr>
<?php } ?>
Background:
I'm using Visual-SVN V. 1.7.5 with VS2008. I'm fairly new to SVN.
I have a Solution that uses source files that will be shared with other Solutions.
I've put these files in a folder called "Shared", and added them to my Solution using
"Add - Existing Item... - Add As Link"
which works fine as far as VS2008 is concerned.
But when I try to add the linked files to SVN using the "Add to Suversion" menu item on the file's context menu, I get a warning:
"...not added to Subversion because it is out of working copy. Please setup working copy root using Visual SVN - Set Working Copy Root menu".
I tried this, but this seems to change the root directory of the whole solution - not what I want to do.
Googling and searching SO indicates that I may want to set up some SVN Externals. I tried to follow the examples, using the command line for the first time with Visual-SVN. But I just got a bunch of error messages I didn't understand.
Questions:
Are Externals the way to go here?
If so, can someone provide some detailed, step-by-step help on how to do this with Visual-SVN?
Fist of all, when I say "run a desktop app in a applet" I mean do a Applet application that runs off-line, instead of a Desktop application that runs inside a JFrame.
The little I know about applets (and maybe something I say is wrong, please correct me) is that applets have all permitions not granted by default. Also, the applets run inside a Sandbox, that does not allow information in or out without explicity permition.
So, if I am focused on security in my application, its best to run it inside an applet (off-line, for a desktop application) then inside a JFrame. Is it right?
So I've started to layout unit tests for the following bit of code:
public interface MyInterface {
void MyInterfaceMethod1();
void MyInterfaceMethod2();
}
public class MyImplementation1 implements MyInterface {
void MyInterfaceMethod1() {
// do something
}
void MyInterfaceMethod2() {
// do something else
}
void SubRoutineP() {
// other functionality specific to this implementation
}
}
public class MyImplementation2 implements MyInterface {
void MyInterfaceMethod1() {
// do a 3rd thing
}
void MyInterfaceMethod2() {
// do something completely different
}
void SubRoutineQ() {
// other functionality specific to this implementation
}
}
with several implementations and the expectation of more to come.
My initial thought was to save myself time re-writing unit tests with something like this:
public abstract class MyInterfaceTester {
protected MyInterface m_object;
@Setup
public void setUp() {
m_object = getTestedImplementation();
}
public abstract MyInterface getTestedImplementation();
@Test
public void testMyInterfaceMethod1() {
// use m_object to run tests
}
@Test
public void testMyInterfaceMethod2() {
// use m_object to run tests
}
}
which I could then subclass easily to test the implementation specific additional methods like so:
public class MyImplementation1Tester extends MyInterfaceTester {
public MyInterface getTestedImplementation() {
return new MyImplementation1();
}
@Test
public void testSubRoutineP() {
// use m_object to run tests
}
}
and likewise for implmentation 2 onwards.
So my question really is: is there any reason not to do this? JUnit seems to like it just fine, and it serves my needs, but I haven't really seen anything like it in any of the unit testing books and examples I've been reading.
Is there some best practice I'm unwittingly violating? Am I setting myself up for heartache down the road? Is there simply a much better way out there I haven't considered?
Thanks for any help.
Ok so i change some code, re-build it and then, say for arguments sake i had a print statement outputting 'test2', well if i change it to 'test3' its still re-producing the old code 'test2'.
Ive deleted the debug folder and rebuilt but no good. Then randomly about 10 builds later it will catch up. Ive also closed VS2010 and then re-opened the project but that doesnt help.
What can i do as i need to see the changes asap?
ps it's definitely the correct file
I'm creating a new plugin for TinyMce. However I cannot find any examples to see some of the functionality I've seen in other plugins. I've read their source code but I cannot find where it is done:
When you click on an 'A' element, the link/unlink buttons in the taskbar become enabled.
When you right click on an 'A' element, then click on the "Insert/edit link" icon that is shown in the popup menu, the "Insert/edit link" window is setup (has all the attributes for that particular link) prefilled.
Could you suggest somewhere where I could learn how to do this? A file and line number is fine.
Thanks in advance.
Hi, I am using this code to refresh the data inside of the div:
<script>
$(function() {
$("#refresh").click(function() {
$("#new").load("/new.php")
})
})
</script>
Except it loads the who page inside of the div, instead of just the information that is inside of the div.
How do I make it refresh only the data that is inside of the div? Is there a way of doing it other than putting the information for that div in a seperate page?
Hi, does anyone know how to do this? I presume it uses some sort of event handler but i wondered if anyone could set me on my path?
Also, how does one show that yellow textbox which sometimes appears when you hover over processional software and it gives some information about what to fill in the textfield, thats perferably how i wish to show the coordinates? I dont know the name of what its called.
In IE 8, if you hover over the name of a tab, it comes up.
Thank you in advance
I'm working on a Rails application. I have a Module called Animals. Inside this Module is a Class with the same name as one of my Models (Dog).
show_animal action:
def show_animal
require 'Animals/Bear.rb' #Works
require 'Animals/Dog.rb' #Fails
end
So the first require definitely works, the seconds fails.
MissingSourceFile (no such file to load -- Animals/Dog.rb):
I noticed that Dog.rb is the same file name as one of my models, is that what's causing this? I'm using Webrick.
I always get re-set the panel width, but something make it ruge againg while I'm editing.
Looks like its worst editing layout in Netbeans then in code line...
So what would be nice is if you could do something like the following (not necessarily with this format, just the general idea):
data Minor = MinorA | MinorB
data Major = Minor | MajorB
isMinor :: Major -> Bool
isMinor Minor = True
isMinor _ = False
So isMinor MinorA would report True (instead of an error.)
At the moment you might do something like:
data Major = MinorA | MinorB | MajorB
isMinor :: Major -> Bool
isMinor MinorA = True
isMinor MinorB = True
isMinor _ = False
It's not terrible or anything, but it doesn't expand nicely (as in if Minor when up to MinorZ this would be terribly clunky). To avoid that problem you can wrap Minor:
data Minor = MinorA | MinorB
data Major = MajorA Minor | MajorB
isMinor :: Major -> Bool
isMinor (MajorA _) = True
isMinor _ = False
But now you have to make sure to wrap your Minors to use them as a Major... again not terrible; just doesn't really express the semantics I'd like very well (i.e. Major can be any Minor or MajorB). The first (legal) example is "Major can be MinorA..." but doesn't have any knowledge of Minor and the second is "Major can be MajorA that takes a Minor..."
p.s. No, this isn't really about anything concrete.
I want to be able to recognize the Eclipse window, which is always already open, so I won't ever need to open it with SilkTest. Is there a way that I can set the base state to be a window that's always going to be open? It seems the way to set the base state also designates the executable for it to open. The executable won't necessarily always be in the same location, and it would be a pain to configure that.
Is this possible?
I've already tried desktop.<Window>find("//Window[@caption='Java EE*']");, which doesn't work.
I have a list of 100,000 domains and I need to identify which ones are blocked by IE for phishing, malware, etc. Are there any applications that interact with IE or solutions that can help me solve this problem?
Hi,
I Want a php code to turn a youtube/dailymotion/vimeo/metacafe... URL into an EMBEDABLE code so i can show it using echo , it is really hard to read the API of every website, so i'm wondering if there is a class or code to do this.
Note: if there isn't anyone, then maybe a jQuery facebox alternative who supports more than youtube.
Thanks