Posts

How to change your app's target API using flash CS6

Image
Clash Royale CLAN TAG #URR8PPP How to change your app's target API using flash CS6 I tried uploading APK to google play but get this error: Your app currently targets API level 21 and must target at least API level 26 to ensure it is built on the latest APIs optimized for security and performance. Change your app's target API level to at least 26 How would one change the API level in Flash CS6? So if you really insist on using CS6 you may need to manually download and place the SDK in the folder within the CS6's installation directory. – quantomworks Aug 6 at 5:39 2 Answers 2 To specify an Android target SDK for your Adobe AIR Android application you need to add the uses-sdk node to your manifest additions in your application descriptor. uses-sdk You can add any of the values below. Normally we specify a target and a minimum version in our applications (however you can also add a maxSdkVersion option if you need it). maxSdkVersion <android> <ma...

New column based on multiple conditions ignoring missing values

Image
Clash Royale CLAN TAG #URR8PPP New column based on multiple conditions ignoring missing values I have following dataframe with some missing values: A B 0 63.0 9.0 1 NaN 35.0 2 51.0 95.0 3 25.0 11.0 4 91.0 NaN 5 2.0 47.0 6 37.0 10.0 7 NaN 88.0 8 75.0 87.0 9 92.0 21.0 I want to create a new column based on conditions of both above columns: df['C'] = numpy.where((df['A']>55) | (df['B']>55), "Yes", "No") This works but does not take into account missing values: A B C 0 63.0 9.0 Yes 1 NaN 35.0 No 2 51.0 95.0 Yes 3 25.0 11.0 No 4 91.0 NaN Yes 5 2.0 47.0 No 6 37.0 10.0 No 7 NaN 88.0 Yes 8 75.0 87.0 Yes 9 92.0 21.0 Yes For correcting for missing values, I have to run following code: df['C'] = numpy.where((df['A'].isnull()) | (df['B'].isnull()), numpy.nan, df['C']) Then I get proper new column: A B C 0 63.0 9.0 Yes 1 NaN 35.0 NaN 2 51.0 95.0 Yes 3 25.0 11.0 No 4 91.0 NaN NaN 5 2.0 47.0 No 6 37.0 10.0 No 7...

All Schema Columns were Removed After Removing MySql Instance

Image
Clash Royale CLAN TAG #URR8PPP All Schema Columns were Removed After Removing MySql Instance My MySql service was running as MySql2 . Today, I liked to change the name to MySql . I started MySql Server Instance Config Wizard and selected the option Remove Instance . I then created a new instance with the name MySql from the same wizard. MySql2 MySql MySql Server Instance Config Wizard Remove Instance MySql I ran MySql Workbench and found that all my databases have no columns and when I try to select a table, an error message says: 09:16:34 SELECT * FROM ut_db.agency_info LIMIT 0, 1000 Error Code: 1146. Table 'ut_db.agency_info' doesn't exist 0.000 sec 09:16:34 SELECT * FROM ut_db.agency_info LIMIT 0, 1000 Error Code: 1146. Table 'ut_db.agency_info' doesn't exist 0.000 sec I have no idea why this has happened. Does removing the instance remove databases? And if so, why are all the names of the tables are listed in MySql Workbenches navigator? 1 Answer 1...

Error: “CUDNN STATUS NOT INITIALIZED” in keras-based convolutional network

Image
Clash Royale CLAN TAG #URR8PPP Error: “CUDNN STATUS NOT INITIALIZED” in keras-based convolutional network I'm trying to create a convolutional network using keras. However, I'm getting the following error: 2018-08-05 21:10:44.670676: E T:srcgithubtensorflowtensorflowstream_executorcudacuda_dnn.cc:332] could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED 2018-08-05 21:10:44.670843: E T:srcgithubtensorflowtensorflowstream_executorcudacuda_dnn.cc:336] error retrieving driver version: Unimplemented: kernel reported driver version not implemented on Windows I haven't installed cudnn seperately, only installed tensorflow-gpu through pip (not using the url). A seperate program that doesn't use a convolutional network works fine. My code: from __future__ import print_function import tensorflow as tf from tensorflow import keras from tensorflow.keras.datasets import mnist from tensorflow.keras.layers import Dense, Flatten from tensorflow.keras.layers impor...

MySQL Pivot Tables Without Numbers

Image
Clash Royale CLAN TAG #URR8PPP MySQL Pivot Tables Without Numbers I trying to do a pivot table from this table. I want a table like this: I want my headers in a column. How can I achieve this? Thanks a lot. show us your attempt. – Vamsi Prabhala Aug 6 at 1:25 1 Answer 1 You can use union all : union all select 'field1' as field, field1 from t union all select 'field2' as field, field2 from t union all select 'field3' as field, field3 from t union all select 'field4' as field, field4 from t; By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Node.js beginner struggling with arrays, promises and Async

Image
Clash Royale CLAN TAG #URR8PPP Node.js beginner struggling with arrays, promises and Async A node.js (and coding in general) beginner here, struggling with the async nature of node. I'm trying to write some code that will look up the members of certain AD groups and add the member names to an array, as per the "getMembers" function below. I'm only interested in computer objects, which is why I only have ad.find returning "other" objects. Once that is complete, I want the "processAssets" function to do something with the array - for the purpose of testing, just ouptutting to the console.log. The problem is that "processAssets" is running before "getMembers" has populated the array. What am I doing wrong? I realise the answer may begin with "several things"...! const ActiveDirectory = require('activedirectory'); var ad = new ActiveDirectory(config); var query = 'memberOf=cn='; var cNames = [ 'grou...

Collecting keyword arguments in Ruby

Image
Clash Royale CLAN TAG #URR8PPP Collecting keyword arguments in Ruby Just trying to understand how to collect arguments in Ruby, I came up with the following snippet, that seems to fail to collect keyword arguments in **kargs in some case: keyword arguments **kargs def foo(i, j= 9, *args, k: 11, **kargs) puts "args: #args; kargs: #kargs" end foo(a: 7, b: 8) # output: args: ; kargs: foo(9, a: 7, b: 8) # output: args: ; kargs: :a=>7, :b=>8 foo(9, 10, 13, a: 7, b: 8) # output: args: [13]; kargs: :a=>7, :b=>8 I would like to know why it does not collect kargs in the first call to foo , while in the second call it does. kargs foo 1 Answer 1 It's because the first parameter i , is a required parameter (no default value), so, the first value passed to the method (in your first example, this is the hash a: 7, b: 8 ) is stored into it. i a: 7, b: 8 Then, since everything else is optional, the remaining values (if any, in this example, there are none) are fi...

Running Apply with Function of prime number on data Frame

Image
Clash Royale CLAN TAG #URR8PPP Running Apply with Function of prime number on data Frame I am looking up to index data frame by applying prime Number function on rows of data frame using apply . the given output should be holding out rows which have any or all numbers as prime. Example data frame name c4: c1 c2 c3 1 8 2 6 2 9 5 4 3 10 4 5 4 7 1 8 5 3 1 2 6 7 5 9 7 5 1 4 8 2 1 3 9 7 2 4 10 10 4 8 c1 c2 c3 1 8 2 6 2 9 5 4 3 10 4 5 4 7 1 8 5 3 1 2 6 7 5 9 7 5 1 4 8 2 1 3 9 7 2 4 10 10 4 8 the given output should be c1 c2 c3 1 8 2 6 2 9 5 4 3 10 4 5 4 7 1 8 5 3 1 2 6 7 5 9 7 5 1 4 8 2 1 3 9 7 2 4 c1 c2 c3 1 8 2 6 2 9 5 4 3 10 4 5 4 7 1 8 5 3 1 2 6 7 5 9 7 5 1 4 8 2 1 3 9 7 2 4 removing the tenth row. the code I am using for the prime number is prime.function<- function (x) if(x == 2) return(TURE) else if (any(x %% 2: (x - 1) == 0)) return(FALSE) else return(TRUE) prime.function<- function (x) if(x == 2) return(TURE) else if (any(x %% 2: (x - 1) == 0)) return(FALSE...

Scan files in a directory to get the number of methods and PHP classes in a directory

Image
Clash Royale CLAN TAG #URR8PPP Scan files in a directory to get the number of methods and PHP classes in a directory Im trying to get the number of class and methods in a specific directory which contain sub folder and scan through them. So far I can only count the number of files. $ite=new RecursiveDirectoryIterator("scanME"); //keyword search $classWords = array('class'); $functionWords = array('function'); //Global Counts $bytestotal=0; $nbfiles=0; $classCount = 0; $methodCount = 0; foreach (new RecursiveIteratorIterator($ite) as $filename=>$cur) $filesize=$cur->getSize(); $bytestotal+=$filesize; if(is_file($cur)) $nbfiles++; foreach ($classWords as $classWord) $fileContents = file_get_contents($cur); $place = strpos($fileContents, $classWord); if (!empty($place)) $classCount++; foreach($functionWords as $functionWord) $fileContents = file_get_contents($cur); $place = strpos($fileContents, $functionWord); if (!empty($place)) $method...

Swift - Singleton without global access

Image
Clash Royale CLAN TAG #URR8PPP Swift - Singleton without global access I want to create a Swift Singleton without global access. The pattern which I want to create is to assure that always just one instance of a class exists but this class should not be accessible over the usual global MyClass.shared syntax. The reason for this is that I want the class to be fully and correctly testable (which is not really possible with global Singletons). I will then use dependency injection to pass the single instance from viewcontroller to viewcontroller. So the "access" issue is solved without a global static instance. MyClass.shared What I could do is to do basically - nothing. Just create a normal class and trust on the discipline of all developers to not instantiate this class again and again but use it only injected as a dependency. But I would rather have some compiler enforced pattern which prohibits this. So the requirement is: My first attempt to solve this was something li...

Redirect a URL to new URL and original subdomain to path (htaccess)

Image
Clash Royale CLAN TAG #URR8PPP Redirect a URL to new URL and original subdomain to path (htaccess) I have the following URL, https://subdomain.domain.com/app I want the htaccess to redirect it to, https://abc.domain.com/subdomain/ The "abc" can be a fixed string but I want the subdomain to be dynamic as I will be doing this for lots of environments. Have tried researching and use different htaccess rewrite rules but I'm not able to find something dynamic that I could use in all envs. Kindly advise. Anyone has ideas? – avn Aug 6 at 1:33 By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

(Unity) Rapidly click to speed up an object (otherwise decelerate)

Image
Clash Royale CLAN TAG #URR8PPP (Unity) Rapidly click to speed up an object (otherwise decelerate) I’m trying to have a button that when you click it, cause the speed to increase incrementally for each time you click. When you stop clicking, it begins to slow down. I’ve tried various methods from rigidbody.velocity (didn’t work because object was kinematic), to transform.Translate, to transform.MovePosition. Any help would be appreciated, as I need to figure this out fast. EDIT: The button being clicked is a sprite. void OnMouseDown() clicked = true; void ifClicked() if (clicked) speed += 0.5f; gameObject.transform.Translate(Vector3.right * speed * Time.deltaTime); StartCoroutine("Decelerate"); IEnumerator Decelerate() yield return new WaitForSeconds(1); speed -= 0.5f; Could you show us the code for it that you have now? – Ryolu 1 hour ago Unfortunately, my laptop’s battery just went out. I posted this from my phone. – K...

How to fix npm audit fix issues?

Image
Clash Royale CLAN TAG #URR8PPP How to fix npm audit fix issues? This shows up when I try to npm install , and all of them required manual review. I've tried to visit this to check for more info and apparently it's because my lodash is of version 4.17.4 . So I've then run npm install --save lodash@4.17.5 and checked my package.json to make sure it's reflecting correctly. npm install lodash 4.17.4 npm install --save lodash@4.17.5 package.json However, it seems the vulnerabilities is still there. Wondering if I fix it the wrong way? As per requested, the body of package.json "dependencies": "lodash": "^4.17.5", in your package.json what do you have for lodash in dependencies? Post the actual string in the question body please. – Akrion Aug 8 at 16:52 package.json lodash @Akrion: Yes it does have – Isaac Aug 9 at 2:10 Wait ... it talks about the react-native-cached-image that lib has that issue since it probably ha...

How to execute powershell/cmd commands using gnuwin32 Makefiles?

Image
Clash Royale CLAN TAG #URR8PPP How to execute powershell/cmd commands using gnuwin32 Makefiles? I try to use commands like curl, rm, start in makefiles in Windows using the following makefile processor: http://gnuwin32.sourceforge.net/packages/make.htm It does not seem to be possible, rather it seems like I am very limited with the commands. Which ways are there to extend my set of commands? I would appreciate any help. Thanks That's a very old version of GNU make. You can build the latest version from source very easily for yourself, or you can get a newer version pre-built from Eli Zaretskii's ezwinports project: sourceforge.net/projects/ezwinports/files/?source=navbar – MadScientist Aug 5 at 19:15 thanks for information - I appreciate it! – JFFIGK Aug 6 at 6:57 2 Answers 2 If you're content with a Windows-only solution , you can make do with invoking powershell.exe directly from your Makefile , as in your answer. powershell.exe Makefile...

Change files & photos folders to one storage folder in laravel filemanager

Image
Clash Royale CLAN TAG #URR8PPP Change files & photos folders to one storage folder in laravel filemanager Inside laravel file manager we have config.lfm file where we have default values: 'base_directory' => 'public', 'images_folder_name' => 'storage',//-was photos 'files_folder_name' => 'storage',//-was files 'shared_folder_name' => '',//-was shares 'thumb_folder_name' => 'thumbs', When I change this I still get photos and files folders, I can't find where is stored to be those two folder names I look up to all files in vendorunisharplaravel-filemanagersrc .... vendorunisharplaravel-filemanagersrc Any help? (Can't find any tags for laravel file manager) 1 Answer 1 I did it by changing this function $prefix and $base_directory . $prefix $base_directory public function getPathPrefix($type) $default_folder_name = 'storage'; if ($this->isProcessingImages()) ...

dealing with canvas copy trouble in tcl

Image
Clash Royale CLAN TAG #URR8PPP dealing with canvas copy trouble in tcl I created with Plotchart::createLogXYPlot in the canvas. I'm drawing several Graph in same canvas. (Using several plot in same canvas) I need this canvas to copy or convert file format type. But I'm searching about this topic, didn't help for me. Plotchart::createLogXYPlot Main trouble is saved file having a clipping img. Clipboard canvas is not working for me. (can't find tag about plotchart) I'm trying these ways. capturing canvas to img file format (clipping trouble) https://nikit.tcl-lang.org/page/Img#2155d00fdc05c6b6b85fa38ed5cd7dda67fd680886245dd51b6f9bcc0ba05a5c Snapshot canvas (clipping trouble and spend many time) https://groups.google.com/forum/#!topic/comp.lang.tcl/Dweb1ExDKhw Clipboard canvas (didn't work) https://www.tcl.tk/man/tcl/TkCmd/clipboard.htm Plotchart using Saveplot (need gs(gost scripts), I will not use it, Saved .ps file is success) How to save Plotchart...