Sometimes you want to mark a DB table record as deleted instead of deleting it permanently, right?
How do you do that?
So far I've been using a boolean "deleted" field.
var obj = {},ar = [],nothing=null,empty=undefined,word ='string',headorTail = true;
console.log(typeof obj) //object
console.log(typeof ar)//object
console.log(typeof nothing)//object
console.log(typeof empty)//undefined
console.log(typeof word)//string
console.log(typeof headorTail)//boolean
But how can i get the type of obj,ar,nothing as "object, array,null" - what is the best way to achieve this?
I am parsing table information from the html table.Now I want to check whether there is date in the records for one particular column.Means I want to check whether there is date in the string or not .And date can be in different format like the string can be
FUTIDX 26FEB2009 NIFTY 0 -- There is date in the string.
FUTIDX MINIFTY 30 Jul 2009 -- There is date in the string.
FUTSTK ONGC 27 Mar 2008 -- There is date in the string.
What should be the regular expression for that ?
I'm able to retrieve the URL of a publisher only if their URL is in the title or the description using regular expression in linkshare's coupon API but in doing so, that leaves me with a lot of publishers not having a reference to their website which I need for the type of site that I am building.
I was wondering if anyone else knows a way to reference the publishers URL preferably by their publisher ID or some other way?
I have a dictionary:
D = { "foo" : "bar", "baz" : "bip" }
and I want to create new dictionary that has a copy of one of it's elements k. So if k = "baz":
R = { "baz" : "bip" }
what I'v got now is:
R = { k : D[k] }
But in my case k is a complex expression and I've got a whole stack of these. Caching k in a temporary looks about as ugly as the original option.
What I'm looking for is a better (cleaner) way to do this.
Is there a specific way to check for a specific integer within a switch statment.
For example.
$user = $ads[$i]->from_user;
To check for the number 2 as $i in the above expression.
Hello,
I am trying to get the Treemap plugin (http://www.jquery.info/spip.php?article40) working with jQuery v1.3.x. The plugin works with jQuery v1.1 and v1.2 but for some reason it fails with the v1.3 base.
This is the browser error "Error: uncaught exception: Syntax error, unrecognized expression: "
Does anyone know changes occurred between JQuery v1.2 and v1.3 that could cause this?
Cheers,
D
Can you explain this?
I want to eval values and calculations from two different sources. One source gives me the following info(programmatically):
'a = 2'
The second source gives me this expression to evaluate:
'a + 3'
This works:
a = 2
eval 'a + 3'
This also works:
eval 'a = 2; a + 3'
But what I really need is this, and it doesn't work:
eval 'a = 2'
eval 'a + 3'
I would like to understand the difference, and how can I make the last option work.
Thanks for your help.
I'm writing a program which needs to traverse a set of directories. Tried to use the following code:
file.eachDirMatch(/.*[^.svn]/){
//some code here
}
But that ended up match none of my directories. I realize this boils down figuring out the right regex hang head in shame but even after revisiting some Java Regular Expression documentation I thought this should work.
My source:
public class MainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
@Override
public boolean dispatchTouchEvent(MotionEvent e) {
super.dispatchTouchEvent(e);
// Now what page ??
return true;
}
How to get the current web page?
putStrLn "Enter the Artist Name"
art <- getLine
putStrLn "Enter the Number of CD's"
num <- getLine
let test= buyItem currentStockBase art num
printListIO (showcurrentList test)
the values i have to pass for buyItem is
buyItem currentStockBase "Akon" 20
but i want to send "Akon" to art and for 20 i want to send num
it gives me this error
ERROR file:.\Project2.hs:126 - Type error in application
*** Expression : buyItem currentStockBase art num
*** Term : num
*** Type : [Char]
*** Does not match : Int
please help me
Hi,
I do the validation through configuration files.
But, RegexValidator does not work properly.
This Validator not disciplined even to unknown regular expression!!
Do you know about this problem?
Many thanks!!!
In the context of functional programming, a typical example of a side effect is "launch the missiles". I was just wondering where that expression comes from historically.
What could be the reason I am getting a SharpDX NotImplemented Exception?
SharpDX.SharpDXException: HRESULT: [0x80004001], Module: [General], ApiCode: [E_NOTIMPL/Not implemented], Message: Not implemented
at SharpDX.Result.CheckError()
at SharpDX.MediaFoundation.MediaFactory.Startup(Int32 version, Int32 dwFlags)
at SharpDX.MediaFoundation.MediaManager.Startup(Boolean useLightVersion)
this is on windows 8 desktop. the same code runs fine on windows 7.
I found the following code example for Java on RosettaCode:
public static boolean prime(int n) {
return !new String(new char[n]).matches(".?|(..+?)\\1+");
}
I don't know Java in particular but understand all aspects of this snippet except for the regex itself
I have basic to basic-advanced knowledge of Regex as you find it in the built-in PHP functions
How does .?|(..+?)\\1+ match prime numbers?
Hi all!
I can use getFunctionNameExpression() to get the function name as a expression. But i don't know how to get the name string from it. Any help ? thank you very much.
How can I write a recursive search that I avoid cycles.
My class is this:
class Component(var name: String, var number: Int, var subComponent: Set[Component])
Now I need a way to check whether a component is contained within its subcomponent or between subcomponent of its subcomponent and so on.Avoiding possible cycles caused by other Component.
My method of recursive search must have the following signature,
where subC is the Set [component] of comp.
def content (comp: Component, subC: Set[Component]) : Boolean = {
}
Thanks for the help.
@Override
public boolean equals( Object otherObject )
is not allowed in Java for an Enum, since the method equals(Object x) is defined as final in Enum. Why is this so?
I cannot thing of any use case which would require overriding equals(Object) for Enum. I'm just curious to know the reasoning behind this behavior.
Hi all, i'm using
putClientProperty("terminateEditOnFocusLost", Boolean);
to make jtable end editing and clear current selected rows when it lose focus or when simply click over an other GUI component.
This is very useful, but with "terminateEditOnFocusLost" there are some strange behaviours if it is used with editCellAt and changeSelection.
There are also some undesiderable TableModelEvents fired for some fake table updates.
So, im looking for an hack to simulate "terminateEditOnFocusLost without using it, is this possibile?
Thanks all.
I'm trying to use python to copy a tree of files/directories.
is it possible to use copytree to copy everything that ends in foo?
There is an ignore_patterns patterns function, can I give it a negated regular expression? Are they supported in python?
eg.
copytree(src, dest, False, ignore_pattern('!*.foo'))
Where ! means NOT anything that ends in foo.
thanks.
The page can be viewed at
http://cistrome.org/cps/seqconfig?did=2693
When load in Firebugs, it gives me this error:
TypeError: $(".open_gene").on is not a function
[Break On This Error]
$(".open_gene").on('change', function(event) {
However, if I type in this expression in Firebug's console, it can be evaluated as a function without any problems:
>>> $(".open_gene").on
function()
I was wondering what might be the reason to cause this issue.
Does anyone have ideas about this? Thanks!
Hello, is there a good regex expression that would be able to compare two dates
like 3/27/2010 to 3/8/2010 to tell if the first date is greater then the second date?
I'd like to compare using javascript
I am trying to check if a html document includes script tags that are not empty using regular expressions. The regular expression should match any script tag with a content other than whitespaces or linebreaks.
I have tried
<script\b[^>]*>[^.+$]</script>
but this regex only finds script tags with one space.
Given the following text:
This is!!xa simple string!xpattern
I would like to get a regexp that matches the !x that's between "string" and "pattern" but not !!xa that's between "is" and "a".
This regexp is to be used inside a string split().
I have tried several combinations but I cannot get a regexp that meets my needs. Perhaps my expression is not so regular after all =)
Thanks in advance!
I simply want to include a row number against the returned results of my query.
I found the following post that describes what I am trying to achieve but gives me an exception
http://vaultofthoughts.net/LINQRowNumberColumn.aspx
"An expression tree may not contain an assignment operator"
In MS SQL I would just use the ROWNUMBER() function, I'm simply looking for the equivalent in LINQ.