Posts by Rafael Alexandre • 2,110 points
76 posts
-
0
votes0
answers25
viewsQ: How to eliminate these excessive "callbacks" when using Names and subscribes in the TS?
I am working with Ionic 2 and I need to make a request in Storage to redeem a previously saved token, after making this request I need to send this token to the API to be validated. The problem is…
-
3
votes1
answer148
viewsQ: Convert Dynamic to query string
Is there any more "elegant" way to convert a dynamic for a query string? I’m currently doing with several Replace() but it’s not quite what I wanted. string data = new { email = email, password =…
-
0
votes1
answer49
viewsQ: Passing values between functions in PHP
In Laravel it is common to work with functions like url()->to(string) or redirect()->route(string) where this "second function" ->to(string) extends or returns a value to the first function…
phpasked Rafael Alexandre 2,110 -
1
votes1
answer174
viewsQ: Check coincident times within an array
I’m working with a grouping of indefinite size of arrays, where each array (child) has another grouping of indefinite times (with initial and final times) for the execution of a given task, in the…
-
1
votes0
answers103
viewsQ: Apply rotation only on X and Z axes
I’m trying to rotate an object only on the X and Z axes, keeping the original value on the Y axis, but this way the rotation just doesn’t work, or gets totally misaligned. RaycastHit hit; if…
-
6
votes1
answer220
viewsQ: How to determine the character’s level by gaining experience?
I created this calculation based on multiples below to determine how much experience the character will need to level up. float NeededExperience(int level, float experienceRatio = 100F) { float…
-
0
votes1
answer17
viewsQ: Create and remove aquifers in Visual Studio while you’re "debugging"
I can’t create or remove files while my project. NET is running, I tried to enable/disable several options of Visual Studio but I could not find what is blocking this edition. I don’t need the debug…
visual-studio-2015asked Rafael Alexandre 2,110 -
0
votes1
answer377
viewsQ: Zoom camera with touch on Unity
I am working with this code below controlling the distance from the camera to the character, this distance is the result of linear interpolation between a minimum and maximum offset, where the…
-
0
votes1
answer288
viewsQ: Map to Unity3d
I am developing an application in Unity3d that resembles the Waze application, but for this I will not be able to use a Google Maps API, for example, Static Maps, because I will need something that…
-
1
votes1
answer118
viewsQ: How to create a method that takes only one string and returns a generic type? . NET MVC
How could I create a method that doesn’t need to receive a type as a parameter, just a string, but would return a type? For example: public static T Guard(string guard_name) where T : class, IAuth {…
-
1
votes1
answer209
viewsQ: Passing as parameter a generic type in an attribute in . NET MVC
In another question I asked here I had to modify my authentication class to return the values of the model referring to the user and the authenticated user type, for example, admins, users, clients,…
-
3
votes1
answer98
viewsQ: Returning the values of a model dynamically in . NET MVC
I have an authentication class that stores the user ID in a session, which receives the model name corresponding to the current user, for example: users, admins, clients. Example:…
-
4
votes1
answer263
viewsQ: Passing model via dynamic form parameter in . NET MVC
I created this function to generate a handle (or slug, how to prefer) for the model users, the problem is that I would like to make it more "modular", so that I can easily implement in any other…
-
1
votes1
answer204
viewsQ: Separate items from a string using Regex
I need to separate the items of a string in an array using C# and Regex, could help me? The string is as follows: required|email|min:2|max:255 There are some rules I wanted to suit: Separate main…
-
2
votes3
answers783
viewsQ: How to return values from two different tables?
I’m working on a script for auto complete that you should search two tables of the same level (Courses and Packages) (without relation) and return the merged values in a single list. The problem is…
-
2
votes2
answers64
viewsQ: Can I only use HTML5 Form Validation for Client-side validations?
I’m a little worried about using HTML5 Form Validation because despite the simplicity of implementation for some browsers, mainly Ios and Safari support is partial as seen here. In my current…
html5asked Rafael Alexandre 2,110 -
0
votes2
answers496
viewsA: Problem with wordpress paging (returns 404)
I believe that through the Wordpress admin panel itself you can fix this problem. First go to Settings > Reading, and change the value of the "Blog pages show maximum" field to 2, then save the…
wordpressanswered Rafael Alexandre 2,110 -
11
votes1
answer756
viewsQ: How does terrain generation work in a game?
The game No Man’s Sky has not yet released but I’m curious about the technique they used to generate the terrain of the planet. I believe that processing a planet on real scales would be very…
-
2
votes3
answers410
viewsQ: Call a method automatically via a partial class on . NET
I created a partial class to the model users where I implemented some custom functions, such as a function that takes the assigned name and surname and generates a handle, see in the following…
-
4
votes3
answers113
viewsQ: How to implement custom features in a model on . NET?
I needed to implement some features in the model users but as you can see early on this class is automatically generated by Entity, so whenever I upgrade or recreate the model the custom…
-
4
votes1
answer389
viewsQ: Dodging an Obstacle without Navmeshagent
I need to create an obstacle clearance script but I can’t use Navmeshagent because this project depends on implementations where the Navmeshagent doesn’t work. See that in the image below there are…
-
2
votes2
answers439
viewsA: Laravel Ordination with Relationship
You can make a Join in your model Dealer Dealer::join('dealer', 'tabela_2.id', '=', 'dealer.relationship_id')->orderBy('table_2.id', 'DESC');
laravelanswered Rafael Alexandre 2,110 -
1
votes0
answers153
viewsQ: What is the best ASP.NET MVC 4 authentication method?
I’m having doubts about how to implement a better form of authentication, which is safe and allows "sessions" or "cookies" with different names, making it possible to create an authentication method…
-
3
votes3
answers3733
viewsA: Customize field name in validation error messages
This customization is quite simple, you will only need to implement one more array to introduce custom error messages, for example: protected function validator(array $data) { $validator =…
-
1
votes1
answer706
viewsQ: Form data validation in ASP.NET MVC
Is there a faster and simpler way to validate a form’s data in ASP.NET? so that I don’t have to be doing as many treatments as in the example below: [HttpPost] public ActionResult Attempt(string…
-
2
votes2
answers119
viewsQ: What is the name of these parameters in ASP.NET MVC?
What is the name of these parameters between brackets used to restrict some access or define the protocol used, as in the example: [Authorize] and [HttpPost]. Is it possible to create a custom…
-
0
votes1
answer349
viewsQ: Multi-user authentication with ASP.NET MVC and . NET 4.5
I am developing a system where there is a need for two types of users, the client, which will access only the frontend, and the administrator, associated with the backoffice. I need these users to…
-
1
votes1
answer887
viewsQ: How to generate a hash for the user password with ASP.NET MVC and . NET 4.5
I am implementing an authentication/user registration functionality with ASP.NET MVC 4.5, but I can’t find anywhere a more correct way to work with passwords in the database, I don’t want to simply…
-
1
votes1
answer515
viewsQ: Middleware with ASP.NET MVC and . NET 4.5
It is possible to add some middleware the routes that will, for example, allow or redirect a user to access the admin panel, which if not authenticated will be redirected to the login area? as in…
-
5
votes2
answers3095
viewsQ: How to pass variables from Controller to View in ASP.NET MVC 4.5?
I’m quite used to PHP MVC where I can pass the values to the view from the controller as follows: public function Index(Users user) { return View('index') ->with('user', $user); } Or to return…
-
2
votes1
answer417
viewsQ: Unity: How to navigate between two points on a sphere?
I need to create a navigation system between two points in a sphere, the problem is that as the Unity Navmesh does not work with spherical objects I have to calculate and manually position the…
-
6
votes2
answers784
viewsQ: What is the best way to create a mobile application that communicates with a Webserver?
I’m developing an app mobile which should contain the same content of the website, and it is necessary that the same database (Mysql) used by the site is also used by the mobile application. I…
-
3
votes1
answer218
viewsQ: Is AES in PHP safe?
I am intending to implement AES in an area of an intranet that is under development for the purpose that the user can store important data such as account passwords and server access passwords, in…
-
21
votes1
answer23926
viewsQ: Is there an API that lists states and cities?
I’ve been searching for some json API that lists the states of a particular country, or cities of a particular state, I’ve searched for this feature for several Google Maps Apis but I couldn’t find…
-
2
votes1
answer434
viewsA: Calling from the 2 post in the wordpress loop
Add the "post__not_in" key to your array and specify the ID of the first post. You can do as in this example: $query = array( 'post_type' => 'post', 'meta_query' => array( array( 'key' =>…
-
2
votes1
answer320
viewsA: Middleware for routing authentication to an existing vector in Laravel
You can simply implement a condition that will check whether the user is authenticated or not and return the controller or its related function. Example: Route::group(['prefix' => '/'],…
-
1
votes1
answer85
viewsQ: Images loaded in Listview are changing randomly
I implemented a Listview where an external image is populated in each position, but when I scroll the screen the images are changing randomly. This video shows exactly what happens:…
-
2
votes2
answers386
viewsQ: Listview catching plenty on scroll
My Listview is crashing enough on the scroll, I tried to implement Viewholder to the Adapter but did not solve, could help me? Adapter: public class Adapter extends SimpleAdapter { private Context…
-
1
votes0
answers42
viewsQ: Animate() only works in the first transition
I am creating an infinite Carousel that should be excited between transitions, however the event .animate() only works in the first transition, the rest is completely static, without animation.…
-
2
votes1
answer769
viewsQ: Average between multiple dates in an array
I am needing to calculate an average not only between an initial date and a final date, but on all dates present in a matrix to obtain an average result in days, hours, minutes and seconds of how…
phpasked Rafael Alexandre 2,110 -
0
votes1
answer367
viewsQ: REGEXP json search does not work properly when used string with parentheses
I created a regular expression that does a JSON search for the name and value of the field, but it does not work correctly when the searched value contains parentheses, such as a DDD for example, so…
-
1
votes1
answer1573
viewsQ: What is the best way to make an HTTP request on Android?
I’m using DefaultHttpClient to make json requests for a Webservice, but this function is obsolete, which is the best alternative for creating a Webservice client?
-
0
votes1
answer136
viewsQ: How to implement multiple authentication drivers
I am building a system where it is necessary to have two types of authentication, the first referring to ordinary users, who will access the front of the store, and the second for administrators,…
-
14
votes1
answer2902
viewsQ: How does google’s "Search for similar image" feature work?
I need to create a manager for a very large image bank, where in this manager besides the search for title and description, there should be a resource that searches for visually similar images. For…
-
2
votes1
answer1133
viewsQ: How to authenticate multiple user groups in Laravel 5?
I am trying to create an environment in Laravel 5 where there is the customer access area (Front of the Store) and the administration area of pages, products, etc. (CMS), but the problem is that I…
-
2
votes1
answer44
viewsQ: Return data from one table if it does not exist in another
I have an environment where there are two forms of login and tables "Users" and "Establishments", these tables are very similar and I need to return this query based on the email typed in the login…
-
0
votes4
answers1008
viewsQ: Error starting Rails Server
I’m trying to start the Rails Server but it is always returning me many errors, one of them was about the Sqlite that already corrected by downloading the Gem and modifying the require_paths no…
-
2
votes2
answers391
viewsQ: Use URL rescrita as array in . htaccess
It is possible to use rescrita with . htaccess and an undefined number of parameters in the URL? In mine. current htaccess I have defined three types of parameters that can be passed in the URL…
-
3
votes1
answer1222
viewsQ: How to get the result of an asynchronous task on Android?
I am trying to redeem the value of my API using .get() but it’s always falling in Exception, I believe I’m not doing it properly. private static String APIAddress =…
-
7
votes2
answers1160
viewsQ: How to develop a private Restfull API?
I need to develop a Restfull HTTP API in PHP to serve as authentication for users of an Android application, the problem is that as it is a public distribution application I can not define any key…