Tuesday, August 3, 2010

End of Amnesia (Avoiding Divide By Zero Errors)

People often ask how to avoid divide by zero problems in their Reporting Services reports. Let's say you have a textbox that calculates profit margin via the expression:
=Fields!Price.Value / Fields!Cost.Value
This works fine unless a value in the Cost field is zero (and is not an integer or double), in which case you will get '#error' displayed in your report. This is because a divide by zero with a decimal field will throw an exception. This exception is caught by the report processing engine and #error is displayed. If you would rather have a string like "N/A" instead of #error, you might think about creating a Reporting Services expression using the IIf function:
=IIf(Fields!Cost.Value = 0, "N/A", Fields!Price.Value / Fields!Cost.Value)
But when you preview the report, you still see #error in your report. What gives?
If you take a look at the IIf function description in the Visual Basic documentation, you will see the following:
As part of preparing the argument list for the call to IIf, the Visual Basic compiler calls every function in every expression. This means that you cannot rely on a particular function not being called if the other argument is selected by Expression.
This means that even through the value for cost is zero, the error will still be generated. So how do you work around this? You have to force the expression evaluation to avoid the division with a nested IIf:
=IIf(Fields!Cost.Value = 0, "N/A", Fields!Price.Value / IIf(Fields!Cost.Value = 0, 1, Fields!Cost.Value))
The nested IIf is evaluated first so that the divide by zero can be avoided but is not used by the outer expression if it is zero.
As an interesting side note, the Arithemtic Operators topic in the Visual Basic documentation seems to say that a DivideByZeroException is thrown for dividing by anything but the Double data type. I have not found this to be the case. Try this simple application in VB:
Dim a, b As Integer
a = 1
b = 0
MsgBox (a / b)
You will get "Infinity", despite what the documentation says. Anyway, the use of the expression above in your report will ensure that you will get the desired results, no matter what data type you are using.

JailbreakMe.com All iOS Device Jailbreak Released for iPhone 4/3GS/3G

Whoa. This brings back some amazing memories. For those who used the original iPhone and remember using the jailbreak website JailbreakMe.com–it’s back! I used JailbreakMe.com to jailbreak my iPhone on 1.1.1 in December of 2007 (holy that was a long time ago!).
The site has been updated by @comex to jailbreak your iPhone 4/3GS/3G on iOS 4.0/4.1 and will even work for your iPad on iOS 3.2/3.2.1. All you have to do is visit the following website within mobile Safari on your iPhone:
http://www.jailbreakme.com (seems to be slammed right now by traffic)
The following mirror seems to be working: http://www.jailbreakme.modmyi.com/
I haven’t tried this yet. Use at your own risk of course.

Update 1: You can now proceed normally if you’re jailbreaking with JailbreakMe.com for the first time. MMS/Facetime has been fixed. If you are suffering from broken MMS/FaceTime, launch Cydia and download the updates. It’ll fix it right away.
Update 2: Stuck at the purple screen? Go to Settings–General–Reset–Reset Network Settings…then try again. Go to http://www.jailbreakme.modmyi.com/ , DONE. Just worked great on my iPhone 4.
Keep up with all the updates in this thread in the iPhoneinCanada.ca Forums!

How To: Fix iPhone 4 FaceTime ‘Waiting For Activation

One of the major new features in the iPhone 4 was FaceTime. FaceTime, for those not in the know, is Apple’s video calling service between iPhone 4 devices.
On launch weekend, millions of Canadians picked up an iPhone 4 and when attempting to FaceTime, the call wouldn’t connect. Jumping into the settings menu for FaceTime revealed that FaceTime was “waiting for activation”. Activation, in this case, seemed to take hours. So, how do we fix this?

How To Fix FaceTime ‘Waiting For Activation’

To fix the FaceTime activation message, follow the steps below:
1.) Turn on WiFi by going to Settings > WiFi and connect to your local WiFi network.
2.) Go to Settings > General > About and wait here (about a minute) until you receive a carrier update prompt. After the update, the carrier field should say “xxxx 7.2″, where “xxxx” is your carrier name.
3.) Now go to Settings > Phone. Turn off FaceTime and turn off “Show My Caller ID”. Then, turn iPhone 4 off (slide to power off method).
4.) Now turn iPhone 4 back on. Go to Settings > Phone. Turn “Show My Caller ID” back on and turn FaceTime back on. Make a call to another iPhone 4.
Give the above steps a try and comment below on your success (or failures!).

How to Use FaceTime Over 3G on iPhone 4: My3G

Have you tried FaceTime yet on your iPhone 4? One of the coolest features of FaceTime is that it does not use your voice minutes, since the requirement is WiFi.
You can also FaceTime your contacts by tapping the FaceTime icon in their contact profile. This saves you the initial call cost if you’re going to FaceTime with people overseas or in a long distance area. Sweet!
How to Use FaceTime Over 3G on your iPhone 4: Download My3G
Now that the “all iOS device jailbreak” is out of the bag with JailbreakMe.com (currently being slammed by traffic as of August 2nd, 10AM PST), you can now download a tweak to use FaceTime on your iPhone 4 over the 3G network. Here’s how to do it:
1. Jailbreak your iPhone 4 by going to JailbreakMe.com. Follow the instructions on screen. You can always restore if the jailbreak messes up.
2. Install “My3G” via RockYourPhone.com for $3.99, or purchase from the ModMyi repo via Cydia for $2.79 (down at the moment).
3. Once installed, it’ll allow you to configure FaceTime to work over 3G. Done.
Let me know how this works (unfortunately JailbreakMe.com is down at the moment). I’m excited to test FaceTime over 3G works with our fast networks in Canada. Have you tried this yet? Let us know!





How To: Enable Emoji Keyboard On iOS 4.0/4.0.1

One of the earlier keyboard hacks that was released for the iPhone was the ability to use Emoji, or ‘emoticons’, when typing.
Emoji allowed iPhone owners to send each other little smiley faces and other unique characters in emails, SMS, notes, and more.
The stock iOS 4.0/4.0.1 firmware once again continues to disable Emoji. So, do the following steps to enable Emoji on your iOS 4.0/4.0.1 device:
1.) Install Emoji Free from the App Store [link].
2.) Run the app on your iOS 4.0/4.0.1 device. Tap on “Let’s do this” and exit the app when prompted.
3.) On your device, go to Settings > General > International > Keyboards > Add New Keyboard and search for “Emoji
4.) Tap on the “Emoji” selection and power cycle your device (turn the device off and then on again).

完美越狱JailbreakMe2.0降临

最新更新发布:iPad 3G已经实现完美越狱,距发布破解以来时隔不到一天时间iPad 3G的难关已被攻破,终于实现了除iOS 4.1 Beta外的全系列越狱,这一刻值得我们所有还在关注的朋友庆祝。感谢DEV团队的努力和无私奉献~! 详情请点击这里跳转查看
iPhone Dev Team成员、完美越狱工具Spirit的作者Comex,在Twitter上发布了一键越狱软件JailbreakMe 2.0此次越支持除iOS 4.1 Beta版以外的所有设备。
  JailbreakMe 2.0越狱方法:

1.  通过苹果自带Safari浏览器访问 http://jailbreakme.com 或分流站点:http://jailbreakme.modmyi.com/
2.  出现滑块后,滑动即可一键越狱

  ultraSn0w解锁:

1. 打开Cydia,添加源: repo666.ultrasn0w.com
2. 搜索ultraSn0w,安装即可




  常见问题回答:  
问: 滑动滑块后,屏幕停留在紫色界面,没有响应。

答: 出现这种情况通常是由于,服务器访问流量过大,导致无法连接。如果您的屏幕停留在上述图片中的任何一种情况,请耐心等待。如果您的屏幕出现其他情况,通常是由于某些错误造成的,您需要重新启动您的设备,然后再次越狱
越狱视频(iPhone3G和iPhone 4):
http://iphone.weiphone.com/news/2010-08-02/JailBreakMe2.0_jailbreak_iPhone_3G_iPhone_4_video_220880.shtml