w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Trouble Storing pdf in internal storage and viewing it from adobe
Get the path and create URI File internalFile = getFileStreamPath("pdf path"); Uri file = Uri.fromFile(internalFile); Intent i = new Intent(); i.setAction(Intent.ACTION_VIEW); i.setDataAndType(file, "application/pdf"); startActivity(i);

Categories : Android

How to bring Classic Text From Adobe Illustrator to Adobe Flash Professional?
I must be doing something wrong because the people at Adobe really cannot be that dumb to force developers to do this every time you move graphics from Illustrator to Flash Pro Haha. Good joke. This is the tip of the iceberg when it comes to stupid things that Adobe software does. In my role I do a lot of Flash banners, and the designers use Fireworks. I've done 500+ banners since starting work and almost every single one has needed the text fields to be readjusted once they're imported. The line and letter spacing is never the same, the size doesn't translate correctly, etc. If you don't actually need to the text to be editable, you could consider outlining it before you import it. This way, you'll have the same result when you copy and paste it. This may not be the best solution

Categories : Actionscript

std::regex to find word within brackets inside a string, then replace it (and the brackets)
You can use a Regex of something like: @"^[VARIABLEA]$"which will get you a match when you parse through your strings. You can also use the .split() or Regex.split() method to split your strings into arrays on a delimiter SEE: http://www.dotnetperls.com/split Then just replace where you find your match.

Categories : C++

Java generic method parameter type inside brackets vs. outside brackets
The first one should be used if you just care that findMax accepts a list that meets certain criteria (in your case a List of type that extends Number). static Number findMax(LinkedList<? extends Number> list) { Number max = list.get(0); for (Number number : list) { if (number > max) { max = number; } } return max; } This method returns Number. For example, this might be a problem if you have a class of your own that extends Number and has some special methods that you would like to use later on the result of this method. The second one should be used when you plan to use exact type T in the method body, as a method parameter or as a return type of the method. static <T extends Number> T findMax(LinkedList<T> list, T c

Categories : Java

Regular expression to transform brackets and nested brackets when inside a markup
If it's really only about finding brackets surrounding "cent", you could use the following approach (with lookbehind, lookahead): Edited to leave some of the brackets as per expected output: this is now a combination of positive and negative lookbehinds and lookaheads. In other words, it's unlikely that regex is the solution, but does work with the literals provided and then some. // surrounding String test1 = "this is a [cent] and [cent] string"; // pseudo-nested String test2 = "this is a [cent[cent] and [cent]cent] string"; // nested String test3 = "this is a [cent[cent]] and [cent]cent]] string"; Pattern pattern = Pattern.compile("((?<!cent)\[+(?=cent))|((?<=cent)\]+(?!cent))"); Matcher matcher = pattern.matcher(test1); if (matcher.find()) { System.out.println(matcher.repl

Categories : Java

javascript Regex get string inside brackets,removing brackets
Try: /[a-zA-Z0-9s]+((d+))[a-zA-Z0-9s]+/ This will capture any digit of one or more inside the parentheses. Example: http://regexr.com?365uj EDIT: In the example you will see the replace field has only the numbers, and not the parentheses--this is because the capturing group $1 is only capturing the digits themselves. EDIT 2: Try something like this: var str1 = "this is (1) test"; var str2 = "this is (2) test"; var re = /[a-zA-Z0-9s]+((d+))[a-zA-Z0-9s]+/; str1 = str1.replace(re, "$1"); str2 = str2.replace(re, "$1"); console.log(str1, str2);

Categories : Javascript

A method to count the number of brackets without including what's inside the brackets
You can't use a regex for this (not in Java, at least), but you can do something like: int count = 0; int brackets = 0; for (char c : str.toCharArray()) { // str is the string you are searching if (c == '[') { if (brackets == 0) { count++; } brackets++; } else if (c == ']') { brackets--; } } At the end of this, count will be the number of top-level bracket pairs. In general, regexes are not appropriate for dealing with recursive structures such as arbitrarily nested brackets. Some regex engines such as that of Perl is able to accommodate recursion, but this isn't standard.

Categories : Java

Camera Preview Issue - Preview becomes pixellated and distorted
if anyone like me (learning the ropes) comes across this same issue, what my problem was I had added camera.setDisplayOrientation(90); in order to rotate the preview to portrait. My problem was, I had called this in the wrong place, I now call it in the onResume() method. A simple fix in the end...thanks everyone

Categories : Android

Commonsware camera preview demo: no preview after device on/off
It is not a solution, but a workaround: invoke setContentView() in onResume(). It can be either protected void onResume() { super.onResume(); setContentView(R.layout.xxx); // ... } or private View cachedContentView; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); cachedContentView = doCreateContentView(getLayoutInflater()); // ... } protected void onResume() { super.onResume(); setContentView(cachedContentView); // ... } Both of them work. I still have no idea what causes the problem and what is the difference between the original example and the library.

Categories : Android

Explode string with brackets and without brackets
All you need is : $str = "{X}{Y}{Z}{R}{R}" ; preg_match_all("/{([A-Z])}/", $str,$matches); print_r($matches); See Live DEMO Array ( [0] => Array ( [0] => {X} [1] => {Y} [2] => {Z} [3] => {R} [4] => {R} ) [1] => Array ( [0] => X [1] => Y [2] => Z [3] => R [4] => R ) ) Explanation This uses the regular expression {([A-Z])}. Bit-by-bit, it means: { Match a literal {. (...) Match the content within normally, but capture whatever text it matched. [A-Z] Match any character between A and Z. } Match a literal }. We use preg_match_all to find all instances of this pattern. Group 0 is the e

Categories : PHP

How to load html contents from stream and then how to create style sheet to display the html file in preview pane (like HTML preview handler)
You mean you want to make HTML Browser inside a window? please take a look at this link. http://www.codeproject.com/Articles/3365/Embed-an-HTML-control-in-your-own-window-using-pla if this isnt what you want, please explain what you mean by "preview handler for HTML"

Categories : C++

Microsoft.Internal.Assumes+InternalErrorException: Internal error occurred
I have seen similar issues resolved by installing the latest Updates to Visual Studio. Please install the latest Update 3 and see if that fixes your problem.

Categories : Visual Studio 2012

Implementing internal class with internal interface error
You have to change the method modifier to public internal class InsuranceClientFactory : IInsuranceClientFactory { public Iws2SoapClient InsuranceClient() { } } Making the method public doesn't mean it can be accessed publicly since the DeclaringType itself internal method will have internal access only.

Categories : C#

internal interface *less* accessible than an internal protected constructor?
This MSDN page defined 'protected internal' as (emphasis from original): The protected internal accessibility level means protected OR internal, not protected AND internal. In other words, a protected internal member can be accessed from any class in the same assembly, including derived classes. To limit accessibility to only derived classes in the same assembly, declare the class itself internal, and declare its members as protected. So in other words, types from outside the current assembly that derive from Base would have access to Base(IFoo foo) but they wouldn't have access to IFoo, since it is internal. Thus the error.

Categories : C#

regular expression to get text between brackets that have text between brackets
Yes you can use this pattern v v (([^)(]*)+([^)(]*))+ ------------ ------------- | | | |->match all (right)brackets to the right.. | |->match all (left)brackets to the left Demo Above pattern won't work if you have a recursive pattern like this (i want(to) (extract and also (this)) this text) ------ ------------------------- In this case you can use the recursive pattern as recommended by elclanrs You can also do it without without using regex by maintaining a count of number of ( and ) So, assume noOfLB is the count of ( and noOfRB is the count of ) keep on iterating each character in string and maintain the position of first ( increament noOfLB if you find

Categories : PHP

how do you enable php to enable to make http calls
The thing is that fsockopen is used for opening socks (i.e connect to the specified port on the specified host/IP). When you try to open sock to the host "http://google.com" it is like running "ping http://google.com" - you will get an error - as there is no such host "http://" What you shout do is use http_get or curl <?php $response = http_get("http://www.example.com/", array("timeout"=>1), $info); print_r($info); ?> or remove the "http://" <?php $fp = fsockopen("www.example.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br /> "; } else { $out = "GET / HTTP/1.1 "; $out .= "Host: www.example.com "; $out .= "Connection: Close "; fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($

Categories : PHP

Redirect Desktop Internal Pages to Correct Mobile Internal Pages with Htaccess
At the end, you have two RewriteRule lines which I believe should be changed to: RewriteRule ^/?$ http://m.domain.com [R=302] RewriteRule ^/?(.*)/?$ http://m.domain.com/$1.html [R=302,L] The ^/?(.*)/?$ means give me a string that starts at the beginning (^) and gives me all characters ((.*)) until the end ($) without the trailing/beginning (/) if there is one (?). The http://m.domain.com/$1.html means that if the address is http://www.domain.com/internal-page/ then it becomes http://m.domain.com/internal-page.html. The [R=302,L] should mean a 302 redirect (R=302) and the last rewrite (L), so no other rewrites can occur on our URL. EDIT: I believe that in the case of your RewriteRules the first one was redirecting to http://m.domain.com in the event that the URL was just the domain,

Categories : Htaccess

Enable/Disable Scrolling in iPhone/iPad’s BUT enable the website scrolling
Check if the device is mobile using a function like this window.mobilecheck = function() { var check = false; (function(a){if(/(android|bbd+|meego).+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl

Categories : Javascript

How Can One Javascript Enclosure Internal Function Call Another Internal Function
Define func1 before you return, then assign a reference to func1 as a property of your return object. var x = (function() { function func1() {} return { func1: func1, func2: function func2() { var y = func1(); } } }());

Categories : Javascript

C++ Adobe Air Overlay
In addition to the Adobe Flash Professional tool, you also require a special version of the Flash Player, namely a library you can embed into your own program/game to integrate it with the rest of the graphics system. You can get this only using an extra license. Also given the reoccuring performance issues of Flash it might not be the wisest decision, although for creating nice animated UIs its a productive environment.

Categories : C++

In-App Billing v3 with Adobe Air
It seems its almost impossible, shame on Adobe. The only solution I have found so far is to launch some temporary Activity every time I'm about to buy something and launch GooglePlay from it, so I can override its onActivityResult method. I have found such implementation here.

Categories : Android

Adobe Air: Error 307
The XML file you posted above is called the application descriptor. The namespace number of the file format is shown in the first node - <application xmlns="http://ns.adobe.com/air/application/2.5"> You need to change this number to match the version of the AIR compiler you are using. You're likely using version 3.0 or above, which is why you're seeing that message. Change the number to 3.0 instead of 2.5 and it should work fine.

Categories : Android

Anyone success which In App Purchase ANE for Adobe air?
http://distriqt.com Very easy to set up with clear instructions. Also supports Google Play Store. App currently in the Apple App Store using the ANE. https://itunes.apple.com/gb/app/prime-mover/id595928344?mt=8

Categories : IOS

Using keyboard with Adobe Air and Starling
Found the solution, I was using stageDisplayState.FULL_SCREEN instead of stageDisplayState.FULL_SCREEN_INTERACTIVE It seems that was preventing AIR from getting keyboard input

Categories : Actionscript

C++ & Qt : A slider like in Adobe After Effects
I'm no expert either, but this may help you. It sounds like you want to create your own widget. Then you should subclass QWidget, reimplement mouseEvents (to make it respond to vertical "drags") and paintEvents(to make it look the way you want it to look), give it the signals you need. If you don't want to start from scratch, maybe sublcassing QLineEdit you gain some steps. Look this trhead, and this tutorial. This last is a real "eye opener", if you take the time to understand it thoroughly. Good luck!

Categories : C++

Connecting Salesforce with Adobe AIR
The best way to do this is to use the OAuth code from the provided toolkit and then to use the Rest API with the various AIR HTTP classes to do the rest yourself, there's libraries available for parsing the JSON to local actionscript objects.

Categories : Actionscript

GCM Push Notification adobe air
I'm guessing you're following the tutorials on distriqt's site about using the distriqt cross platform push notifications extension? If so then the DEV_KEY is actually the developer key you get when you sign up to the distriqt extension package. It is necessary to call this function with a valid key if you are hoping to use the distriqt extensions. If you call it without the DEV_KEY param the extension will not work as documented. The second line you have there containing the application ID is used in your application descriptor file. You need to add the following to your manifest additions on android replacing all the YOUR_APPLICATION_ID references with your applications id. This is normally of the form : com.company.name. The air prefixes are shown as these are your applications full

Categories : Actionscript

Adobe Air, and getting data through JSONP
Here is how to get Data from Server in Adobe AIR based applications. <?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" applicationComplete="init()" width="620" height="740" frameRate="30"> <fx:Script> <![CDATA[ import com.adobe.serialization.json.JSON; // var ini // ------------------------------------------------------------------------ private var filePath:String = "http://www.mysite.com/test.php?callback=?";// URL or path to JSON Source // can be "assest/jsondata.txt";

Categories : Jquery

Adobe AIR cacheAsBitmap and GPU rendering
Yes, GPU rendering is helpful only on objects that cache a bitmap representation. But, it's not that simple, you cannot just turn on cacheAsBitmap and cacheAsBitmapMatrix on everything and get a performance boost. Bitmap cacheing incurs a memory penalty (a major consideration on mobile), and for objects that change frequently may result in degraded performance (because the cache gets trashed often). A bit more in-depth info here: Application performance optimization on Android Adobe AIR - Mobile Performance – Tips & Tricks

Categories : Caching

How to create NEW txt file using Adobe AIR
//create a reference to the file in the applicationStorage Directory //(for more directories, look at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html var fileToCreate:File = File.applicationStorageDirectory; fileToCreate = fileToCreate.resolvePath("myfile.txt"); //create a filestream to write to the file //the write and/or creating the file is done with the FileMode in the open() function //look at the table that describes what FileMode does what here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/FileMode.html var fileStream:FileStream = new FileStream(); fileStream.open(fileToCreate, FileMode.WRITE); //write some string to the file fileStream.writeUTF('this is a string to write to the file');

Categories : Actionscript

Adobe Air multi-download
It doesn't look like you're checking to see if you've finished downloading all the files before you call downloadNextFile(). So the error is probably just that it gets to the end of the array and then tries to generate a URLRequest with a null string.

Categories : Actionscript

Adobe Flash and JSON
You can send GET/POST request with the URLLoader class: import flash.net.URLLoader; import flash.events.Event; import flash.net.URLRequest; import flash.net.URLLoaderDataFormat; import flash.net.URLRequestMethod; var urlRequest:URLRequest = new URLRequest("LINK_HERE"); urlRequest.method = URLRequestMethod.POST; urlRequest.data = your_json_object; var urlLoader:URLLoader = new URLLoader(); urlLoader.addEventListener(Event.COMPLETE, onComplete); urlLoader.load(urlRequest); function onComplete(e:Event):void { trace(e.currentTarget.data); // the response from the server }

Categories : Json

Adobe CQ5 - Populating drop down from external DB
There are several ways to go about this. The first consideration is how often your data changes from within the db, and what the lag is between the db and the cq5 server. If the data does not change often, and it only needs to be updated either manually, or on a periodic basis, you can consider ingesting the information from the database, and then transforming it into a structure in the JCR. From there, you can use the out of the box json transformer in Sling, by hitting the node url, with the .json extension. I.e. the same way you see a content node as json localhost:4502/content/geometrixx/en.infinity.json Assuming this is an author instance, you should consider putting the dropdown structure in the /apps directory if you want to hide it from the public in case it gets activated. If y

Categories : Java

Adobe Edge sorting your Images
I just did a test and it's working for me. That is what I did: Created a new subfolder called "test" inside the images subfolder (not the one inside publish!!) Put there my test.png image. Added projectFolder/images/test/test.png to the assets. I can see the subfolder in the Library > Assets panel. Dragged and dropped the image in the stage. Saved the project Published the project The image test.png is always inside its subfolder.

Categories : Image

Adobe AIR TOUCH_END event not being dispatched
Could this be a classic? TOUCH_END (and MOUSE_UP) should be dispatched from the DisplayObject in(over) which it happened. If it's not being dispatched when you moved away from the Object with the listener added - this could be your issue. try stage.addEventListener(TouchEvent.TOUCH_END, onTouchEnd) rather than this.addEventListener instead. If you only need to track single TouchEvents you would be well advised to use MouseEvents by specifying MultitouchInputMode.NONE instead - MouseEvents are known to perform a lot better in terms of CPU usage. You could use this.addEventListener(MouseEvent.RELEASE_OUTSIDE, onTouchEnd); in this case. RELEASE_OUTSIDE triggers when a MOUSE_UP occurs outside of the object.

Categories : IOS

iOS created PDF won't open in Adobe Acrobat
Problem Solved. Was createing an NSMutableData object with NSMutableData dataWithLength: instead of NSMutableData dataWithCapacity: so I probably had some unused Data space at the beginning. Oops.

Categories : IOS

Adobe DPS Webview caching problems
you can use location.reload(true) in your javascript to trigger a hard refresh. the first argument specifies that the reload should be a "hard refresh" Obviously you can't call it on page load or you'll end up with an infinite loop of reloads, but you could add a development-only button in the page along the lines of: <button onclick="location.reload(true);">hard refresh</button>

Categories : IOS

PDFsharp : How can i get rid of Adobe Reader when printing?
The PdfFilePrinter class uses Process.Start to start Adobe Reader. You can play with the ProcessStartInfo options and maybe you can get the behavior you want (launch minimized or without a window at all etc.). PDFsharp is open source and the PdfFilePrinter class is included in the source package. IIRC this class was developed in the days of Adobe Reader 5 or 6. Maybe Adobe Reader 10 or XI can do better with a slightly modified way of invoking them. I don't have time to try this myself, but I would like to hear from you if you managed to improve your issue. Or is the issue to close Adobe Reader after printing? That would be more difficult as you have to find out when Reader finished printing.

Categories : Misc

Adobe edge - get scroll position value
this.onMove(e.pageX, e.pageY); // insert code to be run when the composition is fully loaded here this.onMove=function(posX, posY) { timelinecontrol = Number(posX)*2; console.log(timelinecontrol); sym.stop(timelinecontrol); sym.$("lblX").html("X:"+posX); sym.$("lblY").html("Y:"+posY); }

Categories : Jquery

java.lang.RuntimeException from Adobe AIR app
You are having problems dismissing a dialog. Maybe the problem comes when the dialog is started, the device orientation is changed and the activity is recreated without the dialog. In this case, if you try to dismiss the dialog, the app will crash. Try replicating it to see if this is the problem. You may prefer using DialogFragment to avoid this problem or simply catch the exception and move on, as you got what you were looking for (your dialog dismissed). UPDATE: Your error log states that it's trying to dismiss a missing dialog when the activity is being destroyed. It could be an issue in the com.amazon.android.framework source code, and maybe the users get prompted for something before the crash. You could try to replicate situations when your Activity is destroyed. Following ou

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.