Posts by Jhonathan • 1,399 points
41 posts
-
3
votes1
answer776
viewsA: Total number of elements in a stack
Generic method for returning stack elements: //Count the number of items in the stack int countitem() { ListElem *i; int t=0; i=pfirst; //point to the first item then move it to the next…
-
2
votes2
answers1557
viewsA: Does Node.js compile the Javascript that runs on the server?
It is interpreted and then compiled "on the fly" JIT with V8. Unlike Java, which compiles code in bytes and then compiles code for something the machine can understand, Nodejs remains Javascript and…
-
3
votes1
answer1395
viewsA: How to convert a date to timestamp in python?
>>> import time >>> import datetime >>> s = "01/12/2011" >>> time.mktime(datetime.datetime.strptime(s, "%d/%m/%Y").timetuple()) 1322697600.0 Would convert this…
-
8
votes1
answer1016
viewsA: What is Python Egg?
The archive .egg is a distribution format for Python packages. It is only an alternative to a Windows source or exe distribution. But note that for pure Python, the file . Egg is completely…
-
3
votes3
answers524
viewsQ: Regex in javascript for partial match in URL
I need to write a javascript regex that contains a specific piece of URL, but I’m not able to, mainly because it’s a url with "/". Example: Any "like" or partial match to "www.url.com/foo"…
-
1
votes1
answer308
viewsQ: Update array in Mongodb subdocument
I’m trying to do an update here on mongoshell and I’m having a hard time. I have the following json: { "_id" : ObjectId("56cc03c16f4e85f538ef79ae"), "contact_id" : NumberLong(1000295524418),…
-
6
votes2
answers323
viewsQ: Show command executed when SQL error occurs
Considering the following command executed BEGIN TRY -- Generate a divide-by-zero error. SELECT 1/0; END TRY BEGIN CATCH SELECT ERROR_NUMBER() AS ErrorNumber ,ERROR_SEVERITY() AS ErrorSeverity…
-
1
votes1
answer249
viewsQ: Enable Iframe in Asp.net application
I have an Asp.net application and I need to put it inside an Iframe. Turns out it gives Chrome console error: Refused to display 'domain' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.…
-
4
votes1
answer1111
viewsA: Difference between Partial Render and Render Action
Html.Renderaction This method result will be written directly to the HTTP stream Response response stream used. It means that the same object used as Textwriter will also be used for the page and/or…
-
3
votes1
answer237
viewsA: Convert Double to String Mongodb
//inteiro para string db.temp.find({name: {$exists:true}}).forEach( function(x) { db.temp.update({_id: x._id}, {$set: {name: x.name.toString()}}); }); //string para data db.temp.find({name:…
-
2
votes2
answers551
viewsA: What is the THIS parameter for?
This article of the Code explains very well the use of terminology. Every Javascript function, when executed, generates an association of the object created by the interpreter through this reserved…
-
2
votes3
answers2411
viewsA: How to record content in a classic Asp Session and move to a mvc page?
In this link you can have all session usage documentation with Asp. Follow a brief example: <% Session("usuario")="João" Session("idade")=50 %> I hope I’ve helped.…
-
1
votes2
answers794
viewsA: Get information from the customer
I found what I was looking for. I will use a technique based on Fingerprint with a plugin already made for such. From N variables contained in the browser it is possible to generate a hash as a…
-
2
votes2
answers794
viewsQ: Get information from the customer
This may sound like a silly question, but I’m kind of in trouble here. I need to collect through the browser some information that helps me identify the client that is browsing. I already know the…
-
2
votes2
answers1431
viewsQ: Remove duplicate Mongodb records
I have a collection with the field called "contact_id". In my collection I have duplicate records with this key. How can I remove duplicates resulting in just one record? I’ve tried to: db.Person…
-
2
votes1
answer59
viewsA: Connectionstring according to scenario
First you should look inside your application on the web.Config In the web.config section put the following code: <connectionStrings configSource="WebConnStrDevelopment.config"> <!--…
-
0
votes2
answers2296
viewsQ: Read multiple lines from a file in parallel with c#
I have a file with almost 700mb that has numerous lines with Json within it. I need to treat every json line-by-line and insert them into my database. The point is, today I’m using the following…
-
10
votes1
answer2836
viewsA: Differences about WCF, Webservice and Webapi with Asp.net?
Web Service It is based on SOAP and returns the data by default in XML. It only supports HTTP protocol. It is not open source, but can be consumed by any client that understands xml. Can only be…
-
4
votes1
answer469
viewsA: What are the differences between Stored Procedures and Functions within Sql Server?
Stored Procedure are objects that are previously compiled by SQL and whenever called will be executed from their "pre-compiled" code. But the Function function is compiled and executed every time it…
-
2
votes1
answer69
viewsA: Create Linq - EF List with n sublists
You can use the following code: var resultados = lista.Select((x, i) => new { Index = i, Value = x }) .GroupBy(x => x.Index / 3) .Select(x => x.Select(v => v.Value).ToList()) .ToList();…
-
1
votes2
answers1043
viewsA: How can I use Javascript to limit the number of checkboxes that can be selected?
See these two examples: $(document).on('change', '.shared', function() { var countShared = $('.shared:checked').length; if (countShared > 3 && $(this).is(':checked')) { alert("You have…
-
0
votes1
answer25
viewsA: How to Execute a Method in Completing the Section?
You can try some things using Javascript and/or Jquery: First way: You can use Jquery Unload: http://api.jquery.com/unload/ Second way: Using a bind with javascript: $(window).bind('beforeunload',…
-
1
votes2
answers4575
viewsA: error "Undefined object reference to an instance of an object." when displaying a null value in the view
Have you tried adding a constructor to the user class? public Usuarios() { this.FuncoesID = 0; this.Funcoes = new Funcoes(); }
-
1
votes1
answer156
viewsA: Picturebox+Image
The effect itself is a little complicated, but in this link you already have access to the very detailed source code of how to implement. In this link also has another example. You can also consider…
-
13
votes1
answer16393
viewsA: What does Assets mean?
The term Asset is just a word used with a slightly different "context" than normal in English. Asset means: active. But it is an asset reference related to goods. Behold: Liquid Assets can be sold…
terminologyanswered Jhonathan 1,399 -
0
votes1
answer279
viewsA: How do I check the browser type, version and if support Javascript?
I don’t know if you have all the information, but this link here can help you a lot. How to read browser properties and information Ex: System.Web.HttpBrowserCapabilitiesBase browser =…
-
0
votes2
answers381
viewsA: ASP.NET MVC with Formsauthentication
You can release the following controller by placing this code on your Web.config <location path="ControllerName"> <system.web> <authorization> <allow users="*"/>…
-
-2
votes2
answers1037
views -
4
votes1
answer1209
viewsA: Is there any way to access a cookie from a different domain?
You cannot read cookies from another domain this is fact. The only way I can think of is to add some code to the second domain that receives cookies for you and then put this on a page on the 1st…
-
3
votes1
answer167
viewsQ: MVC# - Mongodb 2.0 dependency injection
I’m starting a project using MVC 4 with Driver 2.0 of MongoDB. I’m used to using Ninject with EF6 and would like to know if there is such a thing as MongoDBor some example architecture standard for…
-
0
votes1
answer39
viewsA: Use ID in URL for Wordpress SEO
Looking only at SEO, I believe that you leave your URL without numbers, leaving as "friendly" as possible, so it is better read to the user and the robots of Search Engines. But considering that you…
-
0
votes1
answer140
viewsA: Circular Oriented Graphs with Mongodb
I suggest trying Neo4j, because it is suitable for this and uses json structures as well as mongodb. You can even use some plugin for example as Mongo Connector for Neo4j that already transfers the…
-
6
votes1
answer474
viewsQ: How to make a query that returns data from the last 7 days without considering Sunday
I need some condition in SQL SERVER return the result of the list of elements taking into account the last 7 days of creation of the same. But he cannot consider Sunday as a valid day in the…
-
2
votes1
answer273
viewsQ: Exchange Entity Framework EDMX for Code First
I have an EF5 application using EDMX modeling and I have much more experience and affinity with Code First. Does anyone have any idea/tutorial on how to migrate from EDMX to Code First without…
-
0
votes3
answers4590
viewsA: How to create dropdownlist Razor in . net mvc via ajax?
Just make an ajax request and return by Json for example. Look at this question: https://stackoverflow.com/questions/22928756/how-to-bind-json-data-to-dropdownlist-in-asp-net-mvc-using-jquery…
-
-4
votes4
answers957
viewsA: Multiple Contexts Migrations Entity Framework
Since each context is a completely different instance I believe that this is not possible. Unless you create a context that manages all contexts and encompasses in one.
-
1
votes1
answer805
viewsA: Model layer with DAO classes
I think DAO’s okay. Try implementing more BL business layers ( Business Layers ) Layers of domain entities. Some helpers if you need duplicate codes and methods. Avoid using many third-party…
-
7
votes3
answers2562
viewsQ: Sort SQL by 1,2,3 instead of 1,10,2,3
I have a name field in a table that has the following data: 1-Course 2-Course 10-Course When ordering by name it returns 1,10,2. How to make order to bring: 1,2,10 ? Ps: The field is NVARCHAR.…
-
2
votes3
answers3813
viewsA: Reports in C# MVC
Man, I wouldn’t recommend using any components. Uses a well-made model that returns your fields correctly. The components to export to pdf, Excel most have native. So you gain performance and don’t…
-
2
votes2
answers545
viewsA: With which files should you use the <link> tag with Bootstrap?
Only these should serve : <link href="bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="bootstrap-theme.css" rel="stylesheet" type="text/css" /> <script…
-
3
votes2
answers538
viewsA: How to update ASP.NET Repeater in real time?
You can use an update panel and place a Trigger or event to refresh the page with each request you want. Try something like that: GridView1.DataBind(); UpdatePanel1.Update(); I hope it helps.…