Magento database name convention is not trivial. How to get these fields below for last 7 days?
Last Name
First Name
Address
City
State
Zip
Phone
Email
Amount
Order #
Item #
We have a website that displays information in a location based manner, i.e. it detects the IP of the visiting user and redirects him/her to an appropriate landing page; for e.g. a user coming from 'Egypt' will be redirected to http://www.mysite.com/egypt/cairo and a user visting from dubai will be redirected to http://www.mysite.com/uae/dubai, so on and so forth and we cater to multiple locations in the middle-east.
Now, we have been advised by our SEO consultant that we should put a 301 (permanent redirect) on http://www.mysite.com to point to http://www.mysite.com/ksa/riyadh
I would like to know the negative implications that this would have on Google indexing or otherwise, as I fundamentally disagree with this suggestion and believe that in a siutation like this a 302 redirect would be more appropriate.
I need to put curly braces in a sentence according to the indexes. Suppose my input sentence is: "I am a girl and I live in Nepal." and I need to put curly braces according to
[12, 15], [2, 4], [23, 25]
These indexes are corresponding to the words "am", "and" and "in" respectively.
The required output should be:
"I {am} a girl {and} I live {in} Nepal."
I have tried using substring but after it replaces first word, it then shifts the characters by two indexes and that is the problem I am having.
Can anyone provide me solution to get the required output?
i have a form with a capacha, if the capacha was entered wrong, after submit the page is doing a "history.go(-1)" and all fields include the capacha input are back on the screen
right now i have a js that clear that - but now that i need it in several places, i want to know if it possible to clear a form field after back with something related to the html form or what ever
thanks
I have got a file with following format.
1234, 'US', 'IN',......
324, 'US', 'IN',......
...
...
53434, 'UK', 'XX', ....
...
...
253, 'IN', 'UP',....
253, 'IN', 'MH',....
Here I want to extract only those lines having 'IN' as 2nd keyword. i.e.
253, 'IN', 'UP',....
253, 'IN', 'MH',....
Can any one please tell me a command to grep it.
Hello! I try to use amazon API using PHP. If I use
print_r($parsed_xml->Items->Item->ItemAttributes)
it show me some result like
SimpleXMLElement Object ( [Binding] = Electronics [Brand] = Canon [DisplaySize] = 2.5 [EAN] = 0013803113662 [Feature] = Array ( [0] = High-powered 20x wide-angle optical zoom with Optical Image Stabilizer [1] = Capture 720p HD movies with stereo sound; HDMI output connector for easy playback on your HDTV [2] = 2.5-inch Vari-Angle System LCD; improved Smart AUTO intelligently selects from 22 predefined shooting situations [3] = DIGIC 4 Image Processor; 12.1-megapixel resolution for poster-size, photo-quality prints [4] = Powered by AA batteries (included); capture images to SD/SDHC memory cards (not included) ) [FloppyDiskDriveDescription] = None [FormFactor] = Rotating [HasRedEyeReduction] = 1 [IsAutographed] = 0 [IsMemorabilia] = 0 [ItemDimensions] = SimpleXMLElement Object ( [Height] = 340 [Length] = 490 [Weight] = 124 [Width] = 350 ) [Label] = Canon [LensType] = Zoom lens [ListPrice] = SimpleXMLElement Object ( [Amount] = 60103 [CurrencyCode] = USD [FormattedPrice] = $601.03 ) [Manufacturer] = Canon [MaximumFocalLength] = 100 [MaximumResolution] = 12.1 [MinimumFocalLength] = 5 [Model] = SX20IS [MPN] = SX20IS [OpticalSensorResolution] = 12.1 [OpticalZoom] = 20 [PackageDimensions] = SimpleXMLElement Object ( [Height] = 460 [Length] = 900 [Weight] = 242 [Width] = 630 ) [PackageQuantity] = 1 [ProductGroup] = Photography [ProductTypeName] = CAMERA_DIGITAL [ProductTypeSubcategory] = point-and-shoot [Publisher] = Canon [Studio] = Canon [Title] = Canon PowerShot SX20IS 12.1MP Digital Camera with 20x Wide Angle Optical Image Stabilized Zoom and 2.5-inch Articulating LCD [UPC] = 013803113662 )
my goal is to get only Feature infomation and I try to use
$feature = $parsed_xml->Items->Item->ItemAttributes->Feature
it does'not work for me because it just show me the first feature only. How do i get all feature information? please help
I cannot believe I am having trouble with this following string
String filter = "name=Default;pattern=%%;start=Last;end=Now";
This is a short and possibly duplicate question, but how would I split this string to get:
string Name = "Default";
string Pattern = "%%" ;
string start = "Last" ;
string end = "Now" ;
Reason why I ask is my deadline is very soon, and this is literally the last thing I must do. I'm Panicking, and I'm stuck on this basic command. I tried:
pattern = filter.Split(new string[] { "pattern=", ";" },
StringSplitOptions.RemoveEmptyEntries)[1]; //Gets the pattern
startDate = filter.Split(new string[] { "start=", ";" },
StringSplitOptions.RemoveEmptyEntries)[1]; //Gets the start date
I happen to get the pattern which I needed, but as soon as I try to split start, I get the value as "Pattern=%%"
What can I do?
Forgot to mention
The list in this string which needs splitting may not be in any particular order . this is a single sample of a string which will be read out of a stringCollection (reading these filters from Properties.Settings.Filters
I am using the below code to register a HotKey :
RegisterGlobalHotKey(Keys.F4, USE_ALT);
private void RegisterGlobalHotKey(Keys hotkey, int modifiers)
{
try
{
// increment the hot key value - we are just identifying
// them with a sequential number since we have multiples
mHotKeyId++;
if (mHotKeyId > 0)
{
// register the hot key combination
if (RegisterHotKey(this.Handle, mHotKeyId, modifiers, Convert.ToInt16(hotkey)) == 0)
{
// tell the user which combination failed to register -
// this is useful to you, not an end user; the end user
// should never see this application run
MessageBox.Show("Error: " + mHotKeyId.ToString() + " - " +
Marshal.GetLastWin32Error().ToString(),
"Hot Key Registration");
}
}
}
catch
{
// clean up if hotkey registration failed -
// nothing works if it fails
UnregisterGlobalHotKey();
}
}
private void UnregisterGlobalHotKey()
{
// loop through each hotkey id and
// disable it
for (int i = 0; i < mHotKeyId; i++)
{
UnregisterHotKey(this.Handle, i);
}
}
How can i unregister the Hot key and Make Alt+ F4 keep working again ?
I have these two lists (where the Value in a SelectListItem is a bookingid):
List<SelectListItem> selectedbookings;
List<Booking> availableBookings;
I need to find the ids from selectedBookings that are not in availableBookings. The LINQ join below will only get me the bookingids that are in availableBookings, and I'm not sure how to do it the other way around.
!= won't work since I'm comparing strings.
results = (
from s in selectedbookings
join a in availableBookings on s.bookingID.ToString() equals a.Value
select s);
Hi all
I have a URL such as http://www.domain.com/index.php?p=register. I want to redirect that to use HTTPS (SSL) with .htaccess, but only on this, and a couple of other pages (the login page, etc), but not the entire site. The URLs don't point to directories, but are used to dynamically include different files.
Can someone give me a pointer or an example of how to get a single page redirect to HTTPS please?
Thanks,
James
Hi,
i'm using loadmovie() to load a youtube video player inside my flash website but i want to specify the width and height so it can fit my box.
This is my code:
vloader.loadMovie("http://www.youtube.com/v/Alw5hs0chj0&hl=fr&fs=1hJ-mPcGtC");
I have an empty CLIP called "vloader" where i load the video player.
Note: it is recommended that i get a code in Action script 1.0
Thanks
I need to determine whether a string (sourceString) contains another string (queryString) and if it does, at what offset.
I'm guessing that NSScanner might do the trick but I don't fully understand the documentation.
Let's say sourceString = @"What's the weather in London today?"
If I set queryString to equal @"What's the weather", I'd like a method that would determine that, in this case, YES (sourceString does contain queryString) and the offset is 0 (i.e. at the start of sourceString).
Any suggestions?
I need to knowingly isolate each row of the vCard and get its value.
For instance, I want to get "5555" from X-CUSTOMFIELD.
So far, my thoughts are:
"X-CUSTOMFIELD;\d+"
I have been looking at some tutorials and I am a little confused with what function to use? What would my regex above return? Would it give me the whole line or just the numerical part (5555)?
I was thinking I i get the whole row, I can use substring to get the digits?
BEGIN:VCARD
VERSION:2.1
N:Last;First;
FN:First Last
TEL;HOME;VOICE:111111
TEL;MOBILE;VOICE:222222
X-CUSTOMFIELD;5555
END:VCARD
Background : I have some Application Data. i.e. the Database, come important config files.
This data is vital for the application to start else it is exited.
Problem : Where should I store this data. i.e in which folder and where.
Right Now (This is wrong) it is stored in a folder in Debug/App_Data. But is causing issues in git and when we publish the App the data is not found. So where can we store this folder ?
Present Structure is "WpfApplication2\WpfApplication2\bin\Debug"
These Files need to be present when the app is started. So they need to be a part of the app itself.
Hello Friends,
i once had the chance to look at a website, where design was showcased but sorted in a special manner. You were able to look at footers, headers, login menus, and all kinds of parts from different sites.
If anyone can remember the address i would be very happy about it.
Thanks for reading.
Is it possible to override the to_sentence method just for one model in my rails application?
More generally, how do I modify methods for an Array of my models?
I have several divs that share a common class. If one of these divs do not have a child div, I want to hide the div. I can find the right div but I'm unable to hide it.
This is my code,
$(function() {
if ($(".adRight.childen('div')").length == 0) {
$(this).hide();
}
});
What should I use instead of (this)? this refers to the document and not the div the if-statement found.
I could understand the following search algorithms:
Constraint Satisfaction with Arc Consistency,
Uninformed search
A* Search
MinMax
I would understand the definition and working principles of the above algorithm,but could you please give me some real world examples that the above algorithms will be suitable?My idea would be: For CSP with Arc Consistency,assign students to groups that each group must contain both technical and management students,and no 2 technical students in a same group.
Uniformed Search: search for a file under UNIX directoy.
A* Search: search a way (staring from home) to go to mulitple stores to buy things then get back home with minimum total travelling time.
MinMax:Go or other Chess.
Please correct me if I am wrong.
I'm trying to suggest a solution for a friend who owns an existing web shop. The current solution isn't cutting it.
The new solution needs to have a few things that look like they're enterprise-only if I go with Magento, and $12k a year for a store with maybe $20k in stock just doesn't work.
The site should have items, which have one or more categories. Each category may have a parent category. Items have MSRP, and a discount rate by supplier, brand, and sometimes additional discount by product.
When a user buys something, it should automatically setup a shipping label with UPS or USPS, depending on user's choice, and build two invoices; one to go in the box, one to go into records. This is crucial; it's low profit per item, so it needs to minimize labor here.
Need to be able to have sales (limited by time), discount codes/coupon codes. Ideally would have private sales and/or members-only rates as well.
It needs a payment gateway; Paypal/GCheckout-only isn't going to fly. Must be able to accept Visa/MC.
Suggestions? I'm debating just building this myself in Java or PHP, but wanted to point my friend to a reasonable-cost solution that already exists if I can. This all seems pretty straightforward to code, save working with the UPS/USPS/Visa/MC APIs, and doing CSS for it.
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.
The following code will list all the file in a directy
<?php
if ($handle = opendir('.')) {
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
$thelist .= '<LI><a href="'.$file.'">'.$file.'</a>';
}
}
closedir($handle);
}
?>
<P>List of files:</p>
<UL>
<P><?=$thelist?></p>
</UL>
While this is very simple code it does it job.
I'm now looking for a way to list ONLY file that have .xml (or .XML) at the end, how do I do that?
Code is appreciate, thanks!
jess
By default when system() and exec() functions are used in PHP the default user is SYSTEM so I can never see the result. Is there a way to change the user it runs on?