w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Video Chatting or Conferencing in Web Appllication
WebRTC is supported in Chrome and Firefox (Opera?) and perfect for video conferencing. It is not a .net technology but I do not see any problem in using it in a .net environment since the browsers have native support for it. Use getUserMedia to get the stream from camera. Set up an RTCPeerConnection and send the stream through that connection.

Categories : Dotnet

Dulplication of messages in group chatting project in J2ME
I have faced a similar issue. The best solution for such is to give your messages an id value before sending them. You could encode in JSON. Then check for the existence of the message id (if it doesnt exist) before storing/rendering the message.

Categories : Java

How to create Ruby on Rails App to send messages to/from a chatting mobile app
This task is going to be a lot of interfacing with the WeChat API in order to do GET requests and POST requests to their server. Interesting, they don't have any documentation for how to do this with web applications (only mobile), so it will take some trial and error (see documentation). From reading their documentation, it seems like you may have two basic options of how to go about this. One is to make a mobile-used application without a large database, but instead provides a small layer onto the WeChat api. This would mean that each time a user comes to your web application, they would have to give your app permission (client authorization), after your app could make api calls for them for at most 2 hours. In this case you would have to store their token and user information as

Categories : Ruby On Rails

Need some help on r-value concept
In this code: MyStruct a,b,c,d; b+c=d; As you have defined the operator+() function, it returns a MyStruct. Therefore b+c, which calls the function you defined, returns a MyStruct, and then the operator=() function is called on that MyStruct, and it is passed d as an argument. Although the temporary MyStruct is an rvalue because of its temporary nature, the code still compiles because of the reasons I explained above, and the fact that the C++ standard does not forbid calling the operator=() function on an rvalue when that rvalue is a user defined object and not an integral type. In this code: int a,b,c,d; b+c=d; b+c returns an r-value int. Having an r-value on the left side of an = operator is not C++ syntax. Either way, it wouldn't make any sense to assign a value to it, whereas

Categories : C++

Multithreading concept
Sample Timer timer = new Timer(); timer.schedule(new TimerTask() { @Override public void run() { runOnUiThread(new Runnable() { @Override public void run() { //your code } }); } }, 2000, 1000); // 2000 is delay and 1000 is call period There is also another schedule() methods that you can use to map your criteria.

Categories : Java

class concept in WPF
This is where WPF really shines - you can use an ItemTemplate or a DataTemplate to style the UI with the underlying data objects knowing absolutely nothing about how they are being presented. Check out Data Templating for an introduction. Effectively an ItemTemplate is a template (definition) of how each item should be rendered. A DataTemplate goes a step further and gives you the ability to select which template to use based on the data item being bound to, so you can have a list containing different types of objects yet still show them all in the same list/repeater control on the screen.

Categories : C#

What are Mixins (as a concept)
A mixin is a class dessigned to provide functionality for another class, normally through a specified class which provides the basic features that the functionality needs. For example, consider your example: The mixin in this case provides the functionality of undoing the set operation of a value class. This hability is based on the get/set functionality provided by a parametrized class (The Number class, in your example). Another example (Extracted from "Mixin-based programming in C++"): template <class Graph> class Counting: public Graph { int nodes_visited, edges_visited; public: Counting() : nodes_visited(0), edges_visited(0), Graph() { } node succ_node (node v) { nodes_visited++; return Graph::succ_node(v); } edge succ_edge (edge e) { edges_visited++;

Categories : C++

SOS Game: Concept of Tic-Tac-Toe
The bug is occurring in this section of your code: if((ar[0]+ar[1]+ar[2]).equals("SOS")) After the first player correctly enters SOS into these positions, this statement will always be true. Which means that your nested if/else is running on every turn: if(j%2 == 0) { player1++; } else if( j % 2 != 0) { player2++; } During the 4th turn, j will be equal to 3. (j%2 != 0) is true, which increments player2. If you continue running the program, you will see player1 and player2 continually incrementing on every turn because the initial if will always be true.

Categories : Java

What would this concept be called?
You can use a dictionary for this purpose: d = dict(vars) Then you can access var1 by doing d['var1'], which will give you value1.

Categories : Python

web app OO concept confusion
Of course getting everything you need at once from the database is the most efficient. You don't need to give that up just because you want to write your code as an OO model. Basically, you get all the results from the database first, then translate the tabular data into a hierarchical form to fill objects with. "getCompanies" could make a single database call joining addresses and contacts, and return "company" objects that contain populated lists of "addresses" and "contacts". See Object-relational mapping.

Categories : SQL

What is the concept behind namespacing?
To answer your question about when it is useful, one scenario where using namespaces in JavaScript can be essential is when you are using other JavaScript libraries. You want to avoid naming conflicts between your code and their code, and among them. To quote Addy Osmani in a detailed discussion of this issue: In JavaScript, namespacing at an enterprise level is critical as it's important to safeguard your code from breaking in the event of another script on the page using the same variable or method names as you are. With the number of third-party tags regularly injected into pages these days, this can be a common problem we all need to tackle at some point in our careers. As a well-behaved 'citizen' of the global namespace, it's also imperative that you do your best to similarly not

Categories : Javascript

Array.map concept?
map loops through your original array and calls the method for each value in the array. It collects the results of your function to create a new array with the results. You are "mapping" the array of values into a new array of mapped values. Your code is equivalent to: var mapCell = function (row) { var result = []; for (var i = 0; i < columns.length; ++i) { var mappedValue = { column: columns[i], value : getColumnCell(row, columns[i]) }; result.push(mappedValue); } return result; };

Categories : Javascript

Concept of handling SqlCommand in C#
The problem I'm facing is that since from main method I already have SqlDataReader being hold to read and so I cant update now. Any work around for me? That's only a problem because you're sharing the connection (myConnection). Don't do that. Create a new SqlConnection every time you want to perform a database operation, and let the connection pool infrastructure handle making it efficient. Also, use using statements for database-related resources: using (var connection = new SqlConnection(...)) { using (var command = new SqlCommand(...)) { using (var reader = command.ExecuteReader(...)) { ... } } }

Categories : C#

PHP ArrayObject / ArrayIterator : concept with example
If I reach the problem, you asking how to work with many objects? So, if you use the array of object, for example, from ORM. $users_list = new Users(); $arr_users = $users_list->all(); In $arr_users you will have an array with many users objects from your DB. Every object have some properties, for example - id, name, gender and age. foreach($arr_users as $single_user) { echo $single_user->id; echo $single_user->name; echo $single_user->gender; echo $single_user->age; } If you need just one user: echo $arr_users[1]->name; Also you can work with array of objects like this. Firstly, made new array from $arr_users; foreach($arr_users as $single_user){ $arr_user_by_id[$single_user->id] = $single_user; } Now you have new array, where keys are us

Categories : PHP

What concept is at work here and where can it be applied?
Because the function returns a reference, it's possible to modify the underlying static variable. On the first call, the static int variable is created, and then reference to it is returned. Then you set the value of the x to 10. The cout statement obtains the reference again and uses it to write x to stdout. It's worth noting that if x wasn't static, it would be destroyed at the end of function scope, and returned reference would be a reference to temporary, which is illegal. The most common practical application is operator[] class ArrayWrapper { int v [100]; public: int& operator[] (int index) { return v[index]; } }; // usage: ArrayWrapper aw; aw[3] = 3; cout << aw[10]; Of course this is an example implementation; for real world overloaded op[]

Categories : C++

PIVOT concept in sql server
Try this: SELECT QuoteID, PECCode, Desc, [IND] as IND_Site, [BVT] as BVT_Site, [CAX] as CAX_Site, [COX] as COX_Site, [CBA] as CBA_Site FROM ( SELECT cl.Quote_ID AS QuoteID ,cl.PECCode as PECCode ,lpu.Description as Desc ,cl.Site_ID as SiteID ,cl.Quantity as Quant FROM ConfigurationList cl LEFT OUTER JOIN LPU lpu ON cl.PECCode=lpu.PECCode WHERE Quote_ID = @QuoteID) T PIVOT ( SUM (Quant) FOR SiteID IN ([IND], [BVT], [CAX], [COX], [CBA]) ) as Pivoted_Table ORDER BY PECCode

Categories : SQL

mongodb - concept of batches
I am unsure if you can do this without two queries but you could try db.col.update({ guid:guid, samples: {$lt:300} }, { $inc: { samples: 1}, $push: { timings: { clientTime: clientTime } } }, { upsert: true }) That should insert a new document every 300 batches of the format: { "_id" : ObjectId("51e518ad8d065caa3b208661"), "guid" : 10, "samples" : 1, "timings" : [ { "clientTime" : 1 } ] }

Categories : Node Js

Confusion in String concept
In the first case compiler can not be sure what values str1 and str2 will have, so it is not a constant expression and thus it will be evaluated in runtime. There will be three objects (two from string literals and one created as its concatenation). In the second case compiler is able to compute result, so there will be just one object, as if you wrote "JAVAWORLD"

Categories : Java

Concept for OTP with Time limit
Calendar.getTime() returns the time with a resolution of one milli second. Therefore the milli second values will surely be different on both computers (or they are only the same by pure luck). To go with your solution you have to set the milli seconds to 0 before processing cal.set(Calendar.MILLISECOND, 0); then you should have at least one match.

Categories : Java

could not understand the concept of jsp_precompile
See this nice overview. One may conclude, that the it was a measure introduced later to be a standard (for the miscellaneous Java EE servers) to precompile JSPs. The JSP might not be run, only compiled! No other parameters should be given. That the JSP is actually run, is a server specific trait. Nowadays there are other means from maven plugins to whatever.

Categories : Jsp

Is there a concept like late binding in in jsf
I resolved the issue by adding a condition to the ui:include tag ie <ui:include src="#{bean.state=='somevalue'?'a.xhtml':'b.xhtl'/> so my page that has the binding attribute will be set only when the particular condition is satisfied other wise a dummy page is shown. This resolved my issue

Categories : JSF

Max column concept ... sql server
If you just want to return the row with the max System_Rev, then you need to alter the row_number() to partition by the System_id and the TeamProjectSK only. Remove the partition by System_State as well. select System_Id, TeamProjectSK, System_State, System_Rev from ( select w1.System_Id, w1.TeamProjectSK, w1.System_State, w1.System_Rev, row_number() over(partition by w1.System_Id, w1.TeamProjectSK order by w1.System_Rev desc) rn from dbo.DimWorkItem w1 where w1.System_Id = 1691 ) d where rn = 1; See SQL Fiddle with Demo

Categories : Sql Server

Want to understand the concept of ActionResult in MVC.
Encapsulates the result of an action method and is used to perform a framework-level operation on behalf of the action method. The Action Result in ASP.NET MVC provides a simple and versatile means of returning different types of response to the browser. It's an abstract class that returns following SubTypes ViewResult PartialViewResult EmptyResult RedirectResult RedirectToRouteResult JsonResult JavaScriptResult ContentResult FileContentResult FileStreamResult FilePathResult What do you want to return ? View ? partial View ? Some Json String ? File response the client ?

Categories : Asp Net Mvc

Android: Concept behind KeyHash of Facebook SDK?
Yes, that is indeed the case. The facebook knows your app signatures and verifies it to know if the app trying to authenticate is the right one. I guess something in my System.out.println was wrong, I used the following code from http://stackoverflow.com/a/9600642/243354 You can insert this code, export the apk as you will sign it for release, then load that apk to the emulator and check the logcat for hash key tag, once found, update to facebook settings.

Categories : Android

Need idea with ajax concept project
Maybe you can try ArcusNode or Cumulus. I suggest ArcusNode to proceed with. It's an OpenRTMFP protocol.

Categories : PHP

Concept behind these four lines of tricky C code
It is just building up a double array (16 bytes) which - if interpreted as a char array - build up the ASCII codes for the string "C++Sucks" However, the code is not working on each system, it relies on some of the following undefined facts: double has exactly 8 bytes endianness

Categories : C

ASP.Net membership store group concept
By default, Membership provider doesn't support that feature. However, you can override Membership Provider and Role Provider to extend that feature. Look at this SO answer - Custom Membership Provider and MembershipUser http://www.asp.net/general/videos/how-do-i-create-a-custom-membership-provider http://www.davidhayden.com/blog/dave/archive/2007/10/11/CreateCustomMembershipProviderASPNETWebsiteSecurity.aspx http://www.shiningstar.net/aspnet_articles/customprovider/CustomProvider.aspx http://www.devx.com/asp/Article/29256/0/page/3 http://www.15seconds.com/issue/050216.htm http://www.codeproject.com/KB/aspnet/CustomMembershipProviders.aspx http://www.codeproject.com/KB/aspnet/WSSecurityProvider.aspx

Categories : Misc

Need some concept of threading in java script?
Set i as global like, var i=null;// global i function A(){ B(); C(); } function B(){ //doing some task i=something; alert(i); } function C(){ i need value I here. alert(i) //getting undefined } Read this also Alternatively, you can use return in B() like, function A(){ i=B(); C(i);//passing i in C() } function B(){ //doing some task i=something; alert(i); return i;//return i } function C(i){ // value i has been passed in. alert(i); }

Categories : Javascript

Oracle 11g for a MySQLer, concept of database
This is the information I can give you coming from the perspective of a developer. I don't know huge amounts about Oracle, but I have done some fairly significant work with deploying to it for some applications that are now in production. Generally speaking, a database, in Oracle terms, is set up as part of installation. Most servers will only have one database, in my experience. A schema is the usual logical division within a database. Multiple schemas can easily exist on the same database instance. In Oracle, you will use schemas more like you would databases in MySQL. So when you might create 5 databases in MySQL, you would create 5 schemas in Oracle to accomplish the same thing. Note also that a schema is also a user. Oracle combines the two concepts into a single entity. Tablespace

Categories : Mysql

Sub area concept & view engine
I believe you cant have sub areas.... I have just tried it out, and I couldn't create a sub area if you do add Areas you need to remember that if in the original _Layout.cshtml if you put a link in it, you need to specify Area in the route values: @Html.ActionLink("My Link", "Index", "MyController", new { area = "" }) @Html.ActionLink("Create Link", "Create", "MyCreateController", new { area = "MyArea" })

Categories : Asp Net Mvc

How do I go about the concept of group video chat?
Google provides Audio/Video Library i.e. WebRTC. The library is in C++. You have to download the code compile it using Android NDK and include it on your project. You will have to write the JNI layer to call the C++ Library functions to play Audio/Video. Links : http://www.webrtc.org/reference/getting-started http://developer.android.com/tools/sdk/ndk/index.html

Categories : Android

Concept for transition between different views of the same data
The most durable way to do this would be to subclass UICollectionViewLayout for the second layout. However, you may be able to do this without subclassing, although it probably will seem more complicated. The idea is to copy out the contents of the green cell and animate them into place above the collection view - not a cell in the collection view. You'd get the frame of the starting point of the animation using [collectionView layoutAttributesForItemAtIndexPath:selectedIndexPath].frame and adjust for the content offset of the collection view. Of course, you'd then have to delete the green cell from the collection view using [collectionView deleteItemsAtIndexPaths:@[selectedIndexPath]]. In the meantime, create another instance of UICollectionViewFlowLayout. This instance would have scrol

Categories : Iphone

using the concept of loop in ajax or extjs4
In this case it would be much easier to just use a ComboBox and set the hideTrigger config. It looks exactly like a text field, but behaves with the drop down list like the Combo.

Categories : Ajax

How much should I enforce the concept of entity and value object in DDD?
There is a programming principle which I love, It's called KISS. The bottom line is to go as far as you need to, don't just do things and follow guidelines just because you have heard of, or came across them. Instead start with basic functionality and keep adding stuff as you need them. For example, you talked about factories. I usually don't use them unless object creation is complex or i want to enforce certain conditions, or when you talked about operator overloading for comparison, I don't do that unless i need to actually do comparison or need it in my code. One thing i do apply when I could is Immutability and not just because it is suitable for Value Objects but also because it is a great tool when it comes to multi-threading support because immutable objects can't be modified aft

Categories : C#

Best way get the data for paging concept in web applications in ASP.net
If amount of retrieved data is not big, then yes - getting everything at once is a way to go. On the other hand if its hundreds of thousands of records then your current approach - server-side paging is a much better alternative.

Categories : C#

JFreeChart - ChartFactory.createXYStepChart with to-concept
You can get close to what you are looking for by using the setStepPoint() method in the XYStepRenderer class. This attribute is a value in the range from 0.0 to 1.0, with the default being 1.0. When making the transition between two points (x0, y0) and (x1, y1), at some point a vertical move needs to be made from y0 to y1. The stepPoint determines where, in the range from x0 to x1, the vertical transition will be made. If stepPoint == 1.0 (the default), the vertical transition is made at x1. If stepPoint == 0.0, the vertical transition is made at x0. If stepPoint is some value in between (say 0.5) then the vertical transition is made at that fractional point along the range (x0, x1).

Categories : Java

Why is type erasure concept being used so widely?
Is carrying complete type everywhere up to runtime information too complicated? It was done for backward compatability, not to reduce complexity. Or maybe there are not so much use cases for it so it isn't just being needed that often? It isn't need that often but it is confusing when it is needed. Anyway, what are pros and cons of type erasure? Given this has been the state of things since 2004, I suspect it really doesn't matter as it won't change significantly not matter what the pros/cons are. There is a notional plan to fix this but it is not high priority and might not make it into Java 9.

Categories : Java

Concept of Digest authentication - does it really work?
Digest authentication doesn't work quite the way you've described. The server doesn't store the unhashed password. The server stores a hash of Username:realm:password. The client doesn't send the same hash for every authentication. Digest auth is a challenge-response protocol. To start the process the client requests a protected URL and the server responds with the realm and a nonce. The client uses the realm and nonce to calculate: md5(md5(username:realm:password):nonce:md5(httpMethod:uri)) The nonce causes each authentication to produce a different hash value, and in doing so prevents replay attacks. Further, it does provide some (weak) protection against attackers listening in on your communication because the plaintext password doesn't pass over the wire, although this does not

Categories : Security

Does DWR uses polling OR push based concept?
DWR can use both depending on the browser used. If the browser supports push DWR can use this. If the browser does not support push then DWR will use a polling mechanism. You can read all this in the documentation.

Categories : Java

Struts 2 validation concept understanding
To achieve this you need to use interceptor as said by Dave Newton. Interceptor code is : package com.interceptor; public class SessionInterceptor implements Interceptor,ServletRequestAware,SessionAware { HttpServletRequest request; //request object public Map<String, Object> sessionMap; @Override public void setSession(Map<String, Object> arg0) { this.sessionMap = arg0; } @Override public void setServletRequest(HttpServletRequest arg0) { this.request = arg0; } @Override public void destroy() { } @Override public void init() { } @Override public String intercept(ActionInvocation invocation) throws Exception { sessionMap=invocation.getInvocationContext().getSession(); ActionContext context=(ActionContext)invocation.getInvocationContext();

Categories : Java



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