Hi,
I have a string that is
$str = "testingSUB1";
How can I strip out SUB* from the string? I assume using preg_replace but I'm not good with matching what I want with regex.
Does anyone know how I can do this?
Thank you
Hi friends,
I am making a book application. To move to the next topic I am using a button. The Button works as it moves to the next topic, but at the end of the file my application gets the message obj_fatal and it crashes. If I knew how many objects there are in my NSArray then the problem will be solved. I am getting the details from a .plist file and storing it in to a array.
So if any one knows how, please let me know.
Thanks in advance.
Viral.
I am working on an enterprise application where I can have several links present in table or none depending on the data.
The links appear in the table and have following code behind them
<td class="Row"><span id='s_3_2_14_0' ><a href='JavaScript:SWETargetGotoURL("/eservice_enu/start.swe?SWECmd=GotoView&SWEView=Active+PO+Serial+View&SWEPostnApplet=Purchase+Order+List+Applet&SWEPostnRowId=1-KPBLOZ","_self")'>2001103009</a></span></td>
I need to find all the A tags present in the page inside SPAN tag
having following text
SWEView=Active+PO+Serial+View&SWEPostnApplet=Purchase+Order+List+Applet
I tried the following expression but it returns 0
$('a[href*="SWEView=Active+PO+Serial+View&SWEPostnApplet=Purchase+Order+List+Applet"').length;
I am trying to find a reference for approximately how many CPU cycles various operations require.
I don't need exact numbers (as this is going to vary between CPUs) but I'd like something relatively credible that gives ballpark figures that I could cite in discussion with friends.
As an example, we all know that floating point division takes more CPU cycles than say doing a bitshift.
I'd guess that the difference is that the division is around 100 cycles, where as a shift is 1 but I'm looking for something to cite to back that up.
Can anyone recommend such a resource?
I have the following Model:
Entities:
Product (Contains basic data for
products: price, etc)
Attribute (Contains data for all possible optional attributes)
ProductAttribute (Contains data for optional attributes of a product, eg.
Color, Model, Size). ProductAttribute
is essentially a many to many
relationship with payload (ProductId,
AttributeID, Value)
And this piece of code:
private static void ListAttributes(Product p)
{
p.ProductAttributes.Load();
foreach (var att in p.ProductAttributes)
{
att.Attribute.load();
Console.WriteLine("\tAttribute Name:{0} - Value {1}",
att.Attribute.Name,
att.AttributeValue);
}
}
This piece of code will fire a query for each time the att.Attribute.Load() method is called in the foreach loop, only so i can get display the name of the attribute.
I would like to fetch the Attribute.Name together with the query that fetches all attribute values, i.e. join ProductAttribute and Attribute.
Is there any way to achieve this within my method?
can any body help me out this problem,
I have jquery grid, i am trying to display 20k records or users on the grid?
what i am doing is first using stored procrdure i am getting all 20k records, initially each page 100 records i am shoiwng in the jquery grid...
on the top of the jquery grid i have GetAll button,,, if i click this button i need to see all 20k records on the grid in a single page..
is there any way we can handle this?
thanks
I'm trying to initialize an int array with everything set at -1.
I tried the following, but it doesn't work. It only sets the first value at -1.
int directory[100] = {-1};
Why doesn't it work right?
I'm using this code:
s = line.match( /ABCD(\d{4})/ ).values_at( 1 )[0]
To extract numbers from strings like:
ABCD1234
ABCD1235
ABCD1236
etc.
It works, but I wonder what other alternative I have to to this in Ruby?
I have a Biztalk project that imports an incoming CSV file and dumps it to a database table. The import works fine, but I only need to keep about 200-300 records from a file with upwards of a million rows. My orchestration discards these rows, but the problem is that the flat file I'm importing is still 250MB, and when converted to XML using a regular flat file pipeline, it takes hours to process and sometimes causes the server to run out memory.
Is there something I can do to have the Custom Pipeline itself discard rows I don't care about? The very first item in each CSV row is one of a few strings, and I only want to keep rows that start with a certain string.
Thanks for any help you're able to provide.
My question is a follow-up to the issue posted here
regarding the Intellisense performance issue when building a large solution in VS2008 that has many partial static classes.
Since Microsoft does not seem to be addressing the issue for VS2008, I would like to know if there are other ways around the problem? Waiting for VS2010 is not an option at this time. The proposed solution in the previous post is not practical as some of the partial classes may be regenerated and this would be a maintenance headache.
I am trying to solve a problem, a part of which requires me to calculate (2^n)%1000000007 , where n<=10^9. But my following code gives me output "0" even for input like n=99.
Is there anyway other than having a loop which multilplies the output by 2 every time and finding the modulo every time (this is not I am looking for as this will be very slow for large numbers).
#include<stdio.h>
#include<math.h>
#include<iostream>
using namespace std;
int main()
{
unsigned long long gaps,total;
while(1)
{
cin>>gaps;
total=(unsigned long long)powf(2,gaps)%1000000007;
cout<<total<<endl;
}
}
Hi all
I have a text file like below
2 1 2
5 10 13 11 12 14
2 0 1
2 99 2
200 2
1 5
5 1 2 3 4 5
1 0
0 0
I want to read file line by line, and read the umbers from each line. I know how to use the stream to read a fixed field line, but what about the non-fixed line?
Best Regards,
I am looking for how to style a label in a UITableView cell, so that it shows how many children/messages are in the next view controller.
This is used in Apple's Mail app, to show how many messages are in the inbox or account.
I am sure that this is a UILabel, but what font, color and how to make the oval around it?
I was wondering how I could plot more tick marks when plotting time on the x-axis.
Basically, a time equivalent to pretty. Pretty obviously doesn't work so well with times, as it uses factors of 1,2,5 and 10. For time one probably wants e.g. hours, half hours, ...
plot(as.POSIXct(x,origin="1960-01-01"),y,type="l",xlab="Time")
gives really too few and widely spaced tickmarks.
zoox<-zoo(y,as.POSIXct(stats$Time,origin="1960-01-01"))
plot(zoox)
gives the same.
Thanks
What is the upper limit of records for MySQL database table. I'm wondering about autoincrement field. What would happen if I add milions of records? How to handle this kind of situations?
Thx!
I have many events on a day, and it works as expected but now looking at the month view, my calendar grid is much taller that expected. I'd like to hide some of these events from the month view, like a summary with a visual que that there are more on this day than can be shown.
I can use eventRender and return false, but i would like to know how many events are on a given day, so i can limit the rendering to about 4, then perhaps i would add an event that says " more ... "
So the question may be : how to count the events on a given date ?
or is this more like a feature request to expose a max counter for month view ?
thanks
I would like to create a color generator based on random numbers, which might differ just slightly, but I need colors to be easily recognizable from each other. I was thinking about generation then in a rgb format which would be probably easiest. I'm afraid simply multiplying given arguments wouldn't do very well. What algorithm do you suggest using? Also, second generated color should not be the same as previous one, but I don't want to store them - nor multiplying with (micro)time would do well since the scripts' parts are usually faster.
Problem: We have x checkboxes and we want to check y of them evenly.
Example 1: select 50 checkboxes of 100 total.
[-]
[x]
[-]
[x]
...
Example 2: select 33 checkboxes of 100 total.
[-]
[-]
[x]
[-]
[-]
[x]
...
Example 3: select 66 checkboxes of 100 total:
[-]
[x]
[x]
[-]
[x]
[x]
...
But we're having trouble to come up with a formula to check them in code, especially once you go 11/111 or something similar. Anyone has an idea?
When using the beamer documentclass, it looks like the third level of nested input is ignored:
\documentclass{beamer}
\input{body}
body.tex:
\begin{document}
\input{file1}
\input{file2}
\end{document}
file2.tex:
\input{file21}
The content of file21.tex is ignored with documentclass beamer, but correctly inserted if I use a documentclass article, for example.
Has anyone seen something like this?
Ignore spaces, punctuation and anything else that is not a letter. Ignore the case of the incoming letters (so e.g. 'A' and 'a' should be counted together). The results of analysing this string should be added to any analysis performed by previous calls to this method.
In c++ 0x10 is the way to represent a hex value.
if I leave off the 0x then it's dec. Is there a way to define a binary?
Not that I can't derive 0x0003 is 11, but it would be cool if I could use
0b0011. It would just make the code a little more obvious.
Hi,
I have over 2000 HTML files that are now in Wordpress blog. I have the URL Map of Old_file.html and new wordpress URL.
I want 301 redirect but don't want to add 2000 lines to htaccess. Can you please suggest how to accomplish this using PHP so that when there is a request for old url, the php script should lookup into the database and redirect(301) to the new URL ?
Thanks.
This is my query
SELECT Fullname, rank, id_no, TIN, birthdate,
hair, eyes, Blood, height, weight, marks, name, address
FROM [******_DOMAIN\****_*****].*******view
Problem is, source table has too many duplicates, how do I my limit query to the latest row on the database?
I'm using SQL Server 2008.
Thanks In advance
My next problem is that the view shows me a birthdate string format of yyyymmdd, I need to change it to mm/dd/yyyy can please provide me a function? using the same string above?