Links

Access UIApplication From Anywhere

Access UIApplication From Anywhere

No matter where you are in your code, from any file, you can access your program's UIApplication object.

Option 1: Gain Access to UIApplication object:

UIApplication *application; application = [UIApplication sharedApplication];  // Get idleTimeDisabled property BOOL result; result = application.idleTimerDisabled; 

Option 2: Gain Access to UIApplication Object and property in a single statement:

result = [UIApplication sharedApplication].idleTimerDisabled; 

Option 3: Older coding method:

result = [[UIApplication sharedApplication] isIdleTimerDisabled]; 

Idle Timer Status/Disable/Enable

When enabled, the idle timer puts your iPhone or iPod Touch into sleep mode after a given amount of non-use. Typically, this is want you want.

When disabled, the idle timer will not put your device to sleep. You sometimes want this, based on the type of iPhone application you are running.

Get current value:

BOOL result; result = [UIApplication sharedApplication].idleTimerDisabled; 

Timer Disabled:

[UIApplication sharedApplication].idleTimerDisabled = YES; 

Timer Enabled:

[UIApplication sharedApplication].idleTimerDisabled = NO; 

Status Bar Status/Hidden/Visible

The status bar takes up 20 pixels at the very top of the screen, showing cell phone signal strength, network activity, time, and other info.

Get status:

BOOL result; result = [UIApplication sharedApplication].statusBarHidden; 

Hide status bar:

[UIApplication sharedApplication].statusBarHidden = YES; 

Show status bar:

[UIApplication sharedApplication].statusBarHidden = NO; 

Network Activity Status/Hidden/Visible

The network activity icon is a small icon on the status bar. You can check the status, hide it, or make it visible.

Check status:

BOOL result result = [UIApplication sharedApplication].networkActivityIndicatorVisible; 

Hide:

  [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; 

Show:

[UIApplication sharedApplication].networkActivityIndicatorVisible = YES; 

Icon Badge Number

The icon on the home screen can show a number, or badge, on the icon.

Set the icon badge number:

[UIApplication sharedApplication].applicationIconBadgeNumber = 10; 

Remove Icon Badge Number:

[UIApplication sharedApplication].applicationIconBadgeNumber = 0; 

Gain Access to UIApplicationDelegate

From anywhere in your program, you can access the UIApplicationDelegate object. This is often useful to access that object's properties and/or methods.

DemoAppDelegate *appDelegate; appDelegate = [UIApplication sharedApplication].delegate; 

Transfer Control To Another App

Sometimes you wish to transfer control from your application to another application.

Dial the phone (your app ends and the phone dialer begins):

// Dial the phone NSString *phoneToCall = @"tel: 123-456-7890"; NSString *phoneToCallEncoded = [phoneToCall stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]; NSURL *url = [[NSURL alloc] initWithString:phoneToCallEncoded]; [[UIApplication sharedApplication] openURL:url]; 

Transfer to a web page (your app ends and the web app begins):

// Access web page NSURL *url = [[NSURL alloc] initWithString:@"http://servin.com"]; [[UIApplication sharedApplication] openURL:url]; 

UIDevice currentDevice

NSLog(@"uniqueIdentifier: %@", [[UIDevice currentDevice] uniqueIdentifier]);
NSLog(@"name: %@", [[UIDevice currentDevice] name]);
NSLog(@"systemName: %@", [[UIDevice currentDevice] systemName]);
NSLog(@"systemVersion: %@", [[UIDevice currentDevice] systemVersion]);
NSLog(@"model: %@", [[UIDevice currentDevice] model]);
NSLog(@"localizedModel: %@", [[UIDevice currentDevice] localizedModel]);

Himmat Karne Walon Ki.. Haar Nahin Hoti

हिम्मत करने वालों की हार नहीं होती
लहरों से डर कर नैया पार नहीं होती ।

नन्ही चीटीं जब खाना लेकर चलती है
चढ़ती दीवारों पर सौ बार फिसलती है
मन का विश्वास रगों में साहस भरता है
चढ़कर गिरना ,गिरकर चढ़ना न अखरता है
आखिर उसकी मेहनत बेकार नहीं होती
कोशिश करने वालों की हार नहीं होती ।

डुबकियाँ सिंधु में गोताखोर लगाता है
जा जा कर खाली हाथ लौट आता है
मिलते न मोती सहज ही पानी में
चढ़ता दूना उत्साह इसी हैरानी में
मुट्ठी उसकी खाली हर बार नहीं होती
हिम्मत करने वालों की हार नहीं होती ।

असफलता एक चुनौती है,स्वीकार करो
क्या कमी रह गई देखो और सुधार करो
जब तक न सफल हो,नींद चैन सब त्यागो तुम
संघर्ष करो,मैदान छोड़ मत भागो तुम
कुछ किए बिना ही जय जयकार नहीं होती
हिम्मत करने वालों की हार नहीं होती ॥


Lahroon Se Darr Kar.. Naauka Paar Nahin Hoti
Himmat Karne Walon Ki.. Haar Nahin Hoti

Nanhiin Chiitin Jab Daana Lekhar Chalti Hai
Chadhti Deewaroon Par Sau Baar Phisalti Hai
Mann Ka Vishwaas Ragoon Mein Saahas Barta Hai
Chadh Kar Girna.. Girkar Chadhna.. Naa Aakarta Hai
Aakhir Uski Mehnat.. Bekaar Nahin Hoti
Koshish Karne Walon Ki.. Haar Nahin Hoti

Dubkiyaan Sindhu Mein Goota Khoor Lagaata Hai
Jaa Jaa Kar Khaali Haath.. Laut Aata Hai
Milte Na Shaheej Ke Moti Paani Mein
Behta Doona Utsaah Isi Hairaani Mein
Muthi Uski Khaali.. Haar Baar Nahin Hoti
Himmat Karne Walon Ki.. Haar Nahin Hoti


Asafalta.. Ek Chunauti Hai.. Sweekaar Karoo
Kya Kami Rehgayi.. Dekho.. Aur Suthaar Karoo
Jabtak Nasafaal Ho.. Neend Chaain Ki Tyaago Tum
Sungharshoon Ka Maidaan.. Choodh Mat Bhaago Tum
Kucch Kiye Bina Hi.. Jay Jay Kar Nahin Hoti
Himmat Karne Walon Ki.. Haar Nahin Hoti

codesign failed with exit code 1

The problem was that there where different names entered in the following configuration fields:


- Project -> Edit Active Target -> Properties Tab -> Field "Executable"

- Project -> Edit Active Target -> Build Tab -> Field "Product Name"
- in info.plist (or *.plist) the field "executable file"


So make sure that these fields contain the same value.

Diff nil & Nil Objective-c

Type

Definition

nil

A null object pointer, (id)0.

Nil

A null class pointer, (Class)0.

NO

A boolean false value, (BOOL)0.

YES

A boolean true value, (BOOL)1.

gcc-4.2 failed with exit code 1

Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1


Duplicate symbol _OBJC_IVAR_$_SongList.MyTableRecs in /Avneesh_iphone/MusicPlayer Final/US Top 100/build/iphonePlayer.build/Debug-iphonesimulator/USTop100.build/Objects-normal/i386/SongList.o and /Avneesh_iphone/MusicPlayer Final/US Top 100/build/iphonePlayer.build/Debug-iphonesimulator/USTop100.build/Objects-normal/i386/Junk.o



SOLUTION:


This error comes due to implementation of same name class in two files :)

Apple Statics

300 Grand Stores/10 Countries
A million people per day.
One on One class 18000 per day for mac.


iOS
120 million device since launch
230,000 new activation per day

6.5 billon apps on apps on store download
200 apps per second download

25000 ipad apps

Girlfriend 6.0 vs. Wife 1.0-Comparative Trial

Last year a friend of mine upgraded from GirlFriend 6.0 to Wife 1.0 and found that it's a memory hog leaving very little system resources available for other applications. He is now noticing that Wife 1.0 is also spawning Child Processes which are further consuming valuable resources. No mention of this particular phenomena was included in the product brochure or the documentation, though other users have informed him that this is to be expected due to the nature of the application.

Not only that, Wife 1.0 installs itself such that it is always launched at system initialization, where it can monitor all other system activity. He's finding that some applications such as PokerNight 10.3, BeerBash 2.5, and PubNight 7.0 are no longer able to run in the system at all, crashing the system when selected (even though they always worked fine before). During installation, Wife 1.0 provides no option as to the installation of undesired Plug-Ins such as MotherInLaw 55.8 and BrotherInLaw Beta release. Also, system performance seems to diminish with each passing day.

Some features he'd like to see in the upcoming wife 2.0.

1. a "Don't remind me again" button
2. a Minimize button
3. An install shield feature that allows Wife 2.0 be installed with the option to uninstall at any time without the loss of cache and other system resources
4. An option to run the network driver in promiscuous mode which would allow the system's hardware probe feature to be much more useful.

I myself decided to avoid the headaches associated with Wife 1.0 by sticking with Girlfriend 7.0. Even here, however, I found many problems. Apparently you cannot install Girlfriend 7.0 on top of Girlfriend 6.0. You must uninstall Girlfriend 6.0 first. Other users say this is a long standing bug that I should have known about. Apparently the versions of Girlfriend have conficts over shared use of the I/O port. You think they would have fixed such a stupid bug by now. To make matters worse, The uninstall program for Girlfriend 6.0 doesn't work very well leaving undesirable traces of the application in the system. Another thing -- all versions of Girlfriend continually popup little annoying messages about the advantages of upgrading to Wife 1.0.

हमें गर्व है की हम भारतीय हैं

•भारत के इतिहास के अनुसार, विगत 10000 वर्षों में भारत नें किसी भी देश पर हमला नहीं किया है।

•जब कई संस्कृतियाँ 5000 साल पहले घुमंतू वनवासी थीं, भारतीय सिंधु घाटी (सिंधु घाटी सभ्यता) में हड़प्पा संस्कृति की स्थापना हुई।

•भारत का अंग्रेजी में नाम ‘इंडिया’ इं‍डस नदी से बना है, जिसके आस पास की घाटी में आरंभिक सभ्यंताएं निवास करती थीं। आर्य पूजकों में इस इंडस नदी को सिंधु कहा गया ।

•पर्शिया के आक्रमकारियों ने इसे हिन्दुक में बदल दिया। नाम ‘हिन्दुहस्ता न’ ने सिंधु और हीर का संयोजन है जो हिन्दुकओं की भूमि दर्शाता है।

•शतरंज की खोज भारत में की गई थी।

•बीज गणित, त्रिकोण मिति और कलन का अध्य्यन भारत में ही आरंभ हुआ था।

•‘स्था न मूल्यो प्रणाली’ और ‘दशमलव प्रणाली’ का विकास भारत में 100 वर्ष ईसा पूर्व में हुआ था।

•विश्व् का प्रथम ग्रेनाइट मंदिर तमिलनाडु के तंजौर में बृहदेश्वुर मंदिर है। इस मंदिर के शिखर ग्रेनाइट के 80 टन के टुकड़े से बनें हैं यह भव्य‘ मंदिर राजा राज चोल के राज्य के दौरान केवल 5 वर्ष की अवधि में (१००४ AD और 1009 AD के दौरान) निर्मित किया गया था।

•भारत विश्व का सबसे बड़ा लोकतंत्र और विश्व का छठवां सबसे बड़ा देश तथा प्राचीन सभ्यभताओं में से एक है।

•सांप सीढ़ी का खेल तेरहवीं शताब्दी में कवि संत ज्ञान देव द्वारा तैयार किया गया था इसे मूल रूप से मोक्षपट कहते थे। इस खेल में सीढियां वरदानों का प्रतिनिधित्व करती थीं जबकि सांप अवगुणों को दर्शाते थे। इस खेल को कौडियों तथा पासे के साथ खेला जाता था। आगे चल कर इस खेल में कई बदलाव किए गए, परन्तु इसका अर्थ वही रहा अर्थात अच्छे काम लोगों को स्वर्ग की ओर ले जाते हैं जबकि बुरे काम दोबारा जन्म के चक्कर में डाल देते हैं।

•दुनिया का सबसे ऊंचा क्रिकेट का मैदान हिमाचल प्रदेश के चायल नामक स्थान पर है। यह समुद्री सतह से 2444 मीटर की ऊंचाई पर भूमि को समतल बना कर 1893 में तैयार किया गया था।

•भारत में, विश्व भर से सबसे, अधिक संख्या में डाक घर स्थित हैं।


•विश्व का सबसे बड़ा नियोक्ता भारतीय रेल है, जिसमें दस लाख से अधिक लोग काम करते हैं।

•विश्वम का प्रथम विश्वंविद्यालय 700 वर्ष ईसा पूर्व, तक्षशिला में स्था पित किया गया था। इसमें 60 से अधिक विषयों में 10,500 से अधिक छात्र दुनियाभर से आकर अध्यन करते थे। नालंदा विश्ववविद्यालय चौथी शताब्दी, में स्था पित किया गया था जो शिक्षा के क्षेत्र में प्राचीन भारत की महानतम उपलब्धियों में से एक है।


•आयुर्वेद मानव जाति के लिए ज्ञात सबसे आरंभिक चिकित्सा शाखा है। शाखा विज्ञान के जनक माने जाने वाले चरक ऋषि नें 2500 वर्ष पहले आयुर्वेद का समेकन किया था।

• भारत 17वीं शताब्दी के आरंभ तक ब्रिटिश राज्य आने से पहले सबसे सम्पन्न देश था। क्रिस्टोफर कोलम्बस ने भारत की सम्पन्नता से आकर्षित हो कर भारत आने का समुद्री मार्ग खोजा, उसने गलती से अमेरिका को खोज लिया।

• नौवहन की कला और नौवहन का जन्म 6000 वर्ष पहले सिंध नदी में हुआ था। दुनिया का सबसे पहला नौवहन संस्कृ‍त शब्द नवगति से उत्पन्न हुआ है। शब्द नौ सेना भी संस्कृत शब्द नोउ से हुआ।


•भास्काराचार्य ने खगोल शास्त्र के कई सौ साल पहले पृथ्वी द्वारा सूर्य के चारों ओर चक्कर लगाने में लगने वाले सही समय की गणना की थी। उनकी गणना के अनुसार सूर्य की परिक्रमा में पृथ्वी को 365.258756484 दिन का समय लगता है।


•भारतीय गणितज्ञ बुधायन द्वारा ‘पाई’ का मूल्य ज्ञात किया गया था और उन्होंने जिस संकल्परना को समझाया उसे पाइथागोरस की प्रमेय करते हैं। उन्हों ने इसकी खोज छठवीं शताब्दी में की, जो यूरोपीय गणितज्ञों से काफी पहले की गई थी।

•बीजगणित, त्रिकोणमिति और कलन का उद्भव भी भारत में हुआ था। चतुष्पीद समीकरण का उपयोग 11वीं शताब्दी में श्री धराचार्य द्वारा किया गया था। ग्रीक तथा रोमनों द्वारा उपयोग की गई की सबसे बड़ी संख्याद 106 थी जबकि हिन्दुयओं ने 10*53 जितने बड़े अंकों का उपयोग (अर्थात 10 की घात 53), के साथ विशिष्टे नाम 5000 बीसी के दौरान किया। आज भी उपयोग की जाने वाली सबसे बड़ी संख्या टेरा 10*12 (10 की घात12) है।

•वर्ष 1896 तक भारत विश्व में हीरे का एक मात्र स्रोत था
(स्रोत: जेमोलॉजिकल इंस्टील‍ट्यूट ऑफ अमेरिका)

• बेलीपुल विश्व‍ में सबसे ऊंचा पुल है। यह हिमाचल पवर्त में द्रास और सुरु नदियों के बीच लद्दाख घाटी में स्थित है। इसका निर्माण अगस्त 1982 में भारतीय सेना द्वारा किया गया था।

• सुश्रुत ऋषि को शल्य चिकित्सा् का जनक माना जाता है। लगभग 2600 वर्ष पहले सुश्रुत और उनके सहयोगियों ने मोतियाबिंद, कृत्रिम अंगों को लगाना , शल्य क्रिया द्वारा प्रसव, अस्थिभंग जोड़ना, मूत्राशय की पथरी, प्लास्टिक सर्जरी और मस्तिष्क की शल्य क्रियाएं आदि करीं ।

• निश्चेतक का उपयोग भारतीय प्राचीन चिकित्सा विज्ञान में भली भांति ज्ञात था। शारीरिकी, भ्रूण विज्ञान, पाचन, चयापचय, शरीर क्रिया विज्ञान, इटियोलॉजी, आनुवांशिकी और प्रतिरक्षा विज्ञान आदि विषय भी प्राचीन भारतीय ग्रंथों में मिलतें हैं।

• भारत से 90 देशों को सॉफ्टवेयर का निर्यात किया जाता है।


• भारत में 4 धर्मों का जन्म हुआ – हिन्दु धर्म, बौद्ध धर्म, जैन धर्म और सिक्ख धर्म, जिनका पालन दुनिया की आबादी का एक बड़ा हिस्सा करता है।

• जैन धर्म और बौद्ध धर्म की स्थापना भारत में क्रमश: 600 वर्ष ईसा पूर्व और 500 वर्ष ईसा पूर्व में हुई थी।

• इस्लाम भारत का और दुनिया का दूसरा सबसे बड़ा धर्म है।

• भारत में 3,00,000 मस्जिदें हैं जो किसी अन्य देश से अधिक हैं, यहां तक कि मुस्लिम देशों से भी अधिक।

•भारत में सबसे पुराना यूरोपियन चर्च और सिनागोग कोचीन शहर में है। इनका निर्माण क्रमश: 1503 और 1568 में किया गया था।

• ज्यू: और ईसाई व्यक्ति भारत में क्रमश: २०० वर्ष ईसा पूर्व और 52 ईसा पश्चात से निवास करते हैं।


• विश्व में सबसे बड़ा धार्मिक भवन अंगकोरवाट, हिन्दु मंदिर है जो कम्बोडिया में 11वीं शताब्दी् के दौरान बनाया गया था।

• तिरुपति शहर में बना विष्णुक मंदिर 10वीं शताब्दी के दौरान बनाया गया था, यह विश्व का सबसे बड़ा धार्मिक गंतव्य है। रोम या मक्का धार्मिक स्थ‍लों से भी बड़े इस स्थान पर प्रतिदिन औसतन 30 हजार श्रद्धालु आते हैं और लगभग 6 मिलियन अमेरिकी डॉलर प्रति दिन चढ़ावा आता है।


• सिक्ख धर्म का उदगम पंजाब के पवित्र शहर अमृतसर में हुआ था। यहां प्रसिद्ध स्वर्ण मंदिर की स्थापना 1577 में गई थी।


• वाराणसी, जिसे बनारस के नाम से भी जाना जाता है, एक प्राचीन शहर है भगवान बुद्ध ने 500 वर्ष ईसा पूर्व में यहां आगमन किया और यह आज विश्व का सबसे पुराना और निरंतर आगे बढ़ने वाला शहर है।

• भारत द्वारा श्रीलंका, तिब्बत, भूटान, अफगानिस्तान और बंगलादेश के 3,00,000 से अधिक शरणार्थियों को सुरक्षा दी जाती है, जो धार्मिक और राजनैतिक अभियोजन के फलस्वरूप वहां से निकाल दिए गए हैं।

• माननीय दलाई लामा तिब्बती बौद्ध धर्म के निर्वासित धार्मिक नेता है, जो उत्तरी भारत के धर्मशाला से अपने निर्वासन में रह रहे हैं।

• युद्ध कलाओं का विकास सबसे पहले भारत में किया गया और ये बौद्ध धर्म प्रचारकों द्वारा पूरे एशिया में फैलाई गई।

• योग कला का उद्भव भारत में हुआ है और यहां 5,000 वर्ष से अधिक समय से मौजूद हैं।

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *MyIdentifier = @"MyIdentifier";
ImageCell *cell = (ImageCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier]; // changed this

if(cell==nil)
{
cell = [[[ImageCell alloc] initWithFrame:CGRectZero reuseIdentifier:MyIdentifier] autorelease]; // changed this

CGRect frame;
frame.size.width=270; frame.size.height=162; frame.origin.x=10; frame.origin.y=10;

NSDictionary *itemAtIndex = (NSDictionary *)[self.jsonArray objectAtIndex:indexPath.row];
NSString *myStringRaw = [NSString stringWithFormat:@"genratetemplates?id=%@",[itemAtIndex objectForKey:@"id"],nil];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:WWWROOT,myStringRaw,nil]];
NSLog(@"Template: %@",url);

UIWebView *webView = [[UIWebView alloc] initWithFrame:frame];
[webView setBackgroundColor:[UIColor blueColor]];
[webView loadRequest:[NSURLRequest requestWithURL:url]];
[cell.contentView addSubview:webView];
webView.delegate = self;
[webView autorelease];
[cell setData:itemAtIndex];
}

getting UIScreen width

[[UIScreen mainScreen] bounds].size.width

Get current URL of UIWebView

NSString *currentURL = [webView stringByEvaluatingJavaScriptFromString:@"window.location"];

setBackgroundColor example

[obj setBackgroundColor:[UIColor blueColor]];

touchesEnded example

- (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([touches count] == 1)
{
UITouch * touch = [touches anyObject];

if ([touch tapCount] == 1)
{

NSLog(@"Touch on");

CGPoint point = [touch locationInView:self.view];

UIImageView *view = nil;
NSArray *subviews = [scrollView1 subviews];

for (view in subviews)
{
if(CGRectContainsPoint(view.frame, point))
{

NSLog(@"gotchs");

}
}


}

}
}

india is a world in the world

india is a world in the world if want to explore india you needed to take lots of rebirth everything you find in the world you can get it in india ;)

Gautama Buddha Quotes

Happiness: We are shaped by our thoughts; we become what we think. When the mind is pure, joy follows like a shadow that never leaves


Anger: You will not be punished for your anger you will be punished by your anger


Buffering: He who loves fifty people has fifty woes; he who loves no one has no woes


Love: A family is a place where minds come in contact with one another. If these minds love one another the home will be as beautiful as a flower garden. But if these minds get out of harmony with one another it is like a storm that plays havoc with the garden


Peace: Peace comes from within. Do not seek it without

Data scraping with cURL and php 5


< ?php $db = mysql_pconnect('127.0.0.1', 'root', '');
mysql_select_db('crawl',$db) or die("Error In database : ".mysql_error()); set_time_limit(999999999); //error_reporting(0); if (!function_exists('array_combine')) { function array_combine($keys, $values) { if (count($keys) != count($values)) { return false; } foreach($keys as $key) { $array[$key] = array_shift($values); } return $array; } } function get_via($query,$url) { $ch=curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $query); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0"); curl_setopt($ch,CURLOPT_ENCODING , "UTF-8"); $content = curl_exec($ch); curl_close($ch); return $content; } function get_file1($file, $newfilename) { $err_msg = ''; $out = fopen($newfilename, 'wb'); if ($out == FALSE) { print "File not opened "; exit; } $ch = curl_init(); curl_setopt($ch, CURLOPT_FILE, $out); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_URL, $file); curl_exec($ch); curl_close($ch); } $dom=new domdocument; $alpha=$_REQUEST['searchInput'];
for($i=0;$i<100;$i=$i+10) page="($i=" query="$alpha&searchtype=" query="$alpha&searchtype=" pagestart="">loadhtml(get_via("",$page));
$nodes = $dom->getElementsByTagName('div');
foreach($nodes as $P)
{
if($P->getAttribute('class')=='searchResultsItemHolder searchResultsArtistItemHolder')
{
$insideDiv=$P->childNodes;
foreach($insideDiv as $divElement)
{
if($divElement->nodeName=="a")
{
if($divElement->getAttribute('class')=='artistLink')
{
$data["details"]=$divElement->getAttribute('href');
$data["name"]=$divElement->getAttribute('title');
$image=$divElement->childNodes;
foreach($image as $img)
{
$data["imagename"]="GsT".rand(0,time()).".jpg";
mysql_query("INSERT INTO `tN`.`tA` (`uid` ,`art_name` ,`art_pic` ,`Track`)
VALUES ('1', '".mysql_escape_string($data["name"])."', '".mysql_escape_string($data["imagename"])."', '".mysql_escape_string($data["details"])."')") print(mysql_error());
if(mysql_insert_id()>0)
{
get_file1($img->getAttribute('src'), "images/artist/".$data["imagename"]);
}
}
}
}
}
}
}
}
?>

Bhagwat Geeta at a glance

Prof.Einstein says - When i read bhagvad gita and reflect about how God created this universe, everything else seems so superfluous.

गीता में कुल 700 श्लोक हैं , 556 श्लोक श्रीकृष्ण के हैं जिनमें से 101 श्लोक परमात्मा को ब्यक्त करते हैं और 23 श्लोक आत्मा से सम्बंधित हैं। अर्जुन अपनें 101 श्लोको के माध्यम से 16 प्रश्न करते हैं और अपनी सोच स्पष्ट करते हैं। संजय जिनके कारण गीता आज हमलोगों को उपलब्ध है, अपनें विचार 40 श्लोकों के माध्यम से ब्यक्त किया हैतथा धृत राष्ट्र जी का मात्र एक श्लोक है।
साधना की दृष्टि से श्री कृष्ण सांख्य-योगी हैं, अर्जुन हमलोगों की तरह एक भोगी ब्यक्ति की भूमिका निभा रहे हैं,धृत राष्ट्र जी एक परम श्रोता हैं और संजयजी परा भक्त हैं जिनको साकार कृष्ण में निराकार कृष्ण दिखते रहते हैं।
यदि आप गीता के आधार पर सांख्य योग की साधना में उतरना चाहते हैं तो आप को गीता के कृष्ण पर अपनी पूरी ऊर्जा केंद्रित करनी पड़ेगी, यदि आप भोग से समाधि तक की यात्रा पर चलना चाहते हैं तो आप को गीता के अर्जुन पर ध्यान करना पडेगा, यदि आप को श्रोतापन की हवा खानी हैं तो आप अपनें ध्यान का केन्द्र धृत राष्ट्र को बनाएं और यदि परा-भक्ति का आनंद उठाना चाहते हैं तो आप को संजय को अपनाना पडेगा।
बुद्ध एवं महाबीर के समय अबसे 2500 वर्ष पूर्व श्रोता अधिक थे लेकिन वर्तमान में न के बराबर हैं क्योंकि यह युग उन लोगों का है जिनकी बुद्धि संदेह से भरी है। आज का युग विज्ञानं का
युग है और संदेह विज्ञानं की बुनियाद है। जितना गहरा संदेह होगा उतना गहरा विज्ञान निकलेगा। संदेह से विज्ञान निकलता है और श्रद्घा से परमात्मा की खुशबू मिलती है।
गीता सांख्य योग की गणित है , परा-भक्ति का द्वार है और भोग से भगवान तक का मार्ग है अतः आप गीता के श्लोकों को याद करके अपनें अंहकार को और पैना न करें , गीता के श्लोकों को एकत्रित करके ध्यान बिधि बनाएं और उस मार्ग पर चलें तब गीता आपकी उंगली पकड़ कर उस पार तक की यात्रा करा सकता है।
गीता कहता है मैं घर नहीं हूँ जिमें तुम बसना चाहते हो , मैं तो नाव हूँ जो हर पल तुमको उस पार ले जानें को तैयार है , तुम आवो तो सही।
गीता का मूल मन्त्र है समत्व-योग अर्थात आसक्ति रहित कर्म का होना। आसक्ति रहित कर्म बैराग्य में पहुंचाता है तथा वह भाव पैदा करता है जिसमें कर्म अकर्म दिखता है और अकर्म कर्म दिखता है । गीता राग से वैराग ,बैराग में ज्ञान तथा ज्ञान के माध्यम से आत्मा-परमात्मा का बोध कराता है ।

[reference:http://geetasecrets.blogspot.com/]

JSONP vs JSON

nothing much more, just proposed a cleaner way to get data objects (and other things) from the external domain (Like RSS, Atom).

URL Rewriting in zend framework

$front = Zend_Controller_Front::getInstance();


/* Check in you project $front may be differ for Zend_Controller_Front::getInstance();
now suppose we have to convert path mysite.com/user/profile/of/gauravstomar
to mysite.com/users/gauravstomar
then you need to define a route here it is $route */


$route = new Zend_Controller_Router_Route('users/:of',array('controller'=>'user','action'=>'profile'));

// here :of represents the of parameter of the url
// and put it in

$front->getRouter()->addRoute('users', $route);

Proudly launching iVotings.com

this is one of my projects @ xevoke which i made as better as i can, we have a limited time frame for this but in my opinion this is one of my best project i ever built. a very user friendly and too much fast as we have lots of calculations and each calculation have heavy data base interaction.

iVotings.com take my most of time to make it faster to download... lots of stuff i used in it to make it possible like JSON, DB Cache and lots more.

i wish that this site will go much higher.

Use of Zend Cache

Zend Cache will help you to prevent the time taken for heavy sql query.




Lines to be added in bootstrap file:

Zend_Loader::loadClass('Cache');
$backend= 'File';$frontend = 'Core';
$frontendOptions= array('lifetime' => 7200);
$backendOptions= array('cache_dir' => 'public/temp');
$cache = Zend_Cache::factory($frontend, $backend,$frontendOptions,$backendOptions);
Zend_Registry::Set('cache',$cache);




Lines to be added in init function of your controller file:


$this->cache = Zend_Registry::get('cache');


Lines to use the Zend Cache:

$data = $this->cache->load('TempVar');
if($data === FALSE)
{
$query=$this->db->query("SELECT * FROM table_name");
$data = $query->fetchAll();
$this->cache->save($data,'UserCompair');
}
$this->view->users = $data

Using JSON with PHP : an example

__________________________________________
index.php
______________________________________________

$array = array
(
["books"] => array(
["0"] => array
(
["book"] => array
(
["title"] => "JavaScript, the Definitive Guide"
["publisher"] => "O Reilly"
["author"] => "David Flanagan"
["cover"] => "/images/cover_defguide.jpg"
["blurb"] => "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
)

)

["1"] => array
(
["book"] => array
(
["title"] => "DOM Scripting"
["publisher"] => "Friends of Ed"
["author"] => "Jeremy Keith"
["cover"] => "/images/cover_domscripting.jpg"
["blurb"] => "Praesent et diam a ligula facilisis venenatis."
)

)

["2"] => array
(
["book"] => array
(
["title"] => "DHTML Utopia: Modern Web Design using JavaScript & DOM"
["publisher"] => "Sitepoint"
["author"] => "Stuart Langridge"
["cover"] => "/images/cover_utopia.jpg"
["blurb"] => "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."
)

)

)

)
die(json_encode($array));

______________________________________
index.js
______________________________________
window.onload = xmlHttp;

function xmlHttp()
{
if (window.XMLHttpRequest){xmlhttp = new XMLHttpRequest();}
else if (window.ActiveXObject){xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}
else alert("XMLHttpRequest & ActiveXObject not active");
xmlhttp.open('POST', "index.php", true);
xmlhttp.onreadystatechange = function(){if(xmlhttp.readyState == 4 && xmlhttp.status == 200)setDataJSON(eval('(' + xmlhttp.responseText + ')'));}
xmlhttp.send(r);
}

function setDataJSON(req)
{
var data = eval('(' + req.responseText + ')');
for (var i=0;i {
var x = document.createElement('div');
x.className = 'book';
var y = document.createElement('h3');
y.appendChild(document.createTextNode(data.books[i].book.title));
x.appendChild(y);
var z = document.createElement('p');
z.className = 'moreInfo';
z.appendChild(document.createTextNode('By ' + data.books[i].book.author + ', ' + data.books[i].book.publisher));
x.appendChild(z);
var a = document.createElement('img');
a.src = data.books[i].book.cover;
x.appendChild(a);
var b = document.createElement('p');
b.appendChild(document.createTextNode(data.books[i].book.blurb));
x.appendChild(b);
document.getElementById('DivIdWhereChangeWillShown').appendChild(x);
}
}



Javascript function for getting page elements by their attribute

function getElementsByAttribute(TagName,Attribute,Value)
{
var oElm = document.body;var oCurrent;var oAttribute;var arrReturnElements = new Array();
var arrElements = (TagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(TagName);
var oAttributeValue = (typeof Value != "undefined")? new RegExp("(^|\\s)" + Value + "(\\s|$)") : null;
for(var i=0; i 0)if(typeof Value == "undefined" || (oAttributeValue && oAttributeValue.test(oAttribute)))arrReturnElements.push(oCurrent);}
return arrReturnElements;
}