w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
API development, Bootstrap and jQuery. Good idea to inject them all in user's code?
If you have to have jquery and bootstrap, the only acceptable solution for an embeddable widget would be an iframe. You could write a loader script which places the iframe with your main content onto the page. I've written a quite extensive article about how to build embeddable widgets and their best practices on my blog here: http://codeutopia.net/blog/2012/05/26/best-practices-for-building-embeddable-widgets/ (based on a Stack Overflow answer I gave some time ago, but couldn't find the link to it)

Categories : Javascript

Python GUI toolkits that support text widget transparency or text widget with canvas background?
Take a look at WXpython here is an example of a transparent top-level window Transparent Frames WX is the only GUI library that i think could do this tkinter is good for more basic GUI's while WX is much more flexible here are a few more examples of using transparency with WX Transparent StaticText Transparent Panel I hope this helps you out!

Categories : Python

Good Dynamics: How can a third party create an IPA consumable by the Good Wrapping server?
The second flow is the correct one. Application wrapping is mostly intended for in-house developers. Just be aware that your particular scenario, where the customer provides you with their certificate, might not be Apple approved.

Categories : Misc

Do any standards and practices exist for applying acceptance test driven development to non-development tasks?
Take a look at this post in StackExchange: Agile methodologies such as Scrum in non-software development projects Also there is a nice article called "Scrum is not just for software" written by the Agile Alliance (note that this is a PDF download)

Categories : Misc

Good programming etiquette/ good programming practices
Val is a left over Legacy function. I would recommend switching to type specific converters. This also provides protection for values that are not convertible like letters. Remember to convert types. Turn Option Strict On and you will see. Integer.TryParse Dim result As integer = 0 Dim numberA, numberB as Integer If Integer.TryParse(TextBoxNumbA.Text, numberA) Then If Integer.TryParse(TextBoxNumbB.Text, numberB) Then result = numberA + numberB End If End If TextBoxResult.Text = result.ToString("n2")

Categories : Vb.Net

What does this typedef mean and what is it good for?
These statements typedef reference to array of size one, and size two respectively. This is an example: /* foo accepts arrays of size 10 only! */ void foo(int (&array)[10]) { ... } another example: /* foo accepts arrays of size len! The size is len, so you can know the size of the array unlike when using a pointer to int. (unless you pass the size in the next parameter, of course!) */ template <std::size_t len> void foo(int (&array)[len]) { ... }

Categories : C++

Why the answer will be "GOOD"?
Any class that implements an interface, and any class that extends a class that implements that interface, inherits all of that interfaces variables. No matter how you declare the variables in the interface, all interface variables are public static final, which is why you can access them with just the class name and not an instance of the class.

Categories : Java

What if DateTime.Now isn't good enough?
You can get an accurate number which you can use as a timestamp by calling the Windows API's QueryPerformanceCounter() which should give you a consistent value between threads with a very high resolution. Of course, this only gives you values that are relevant to one particular computer; it can't be used if you want to compare the timestamps created on two different computers. However, note this (from the Windows API documentation): On a multiprocessor computer, it should not matter which processor is called. However, you can get different results on different processors due to bugs in the basic input/output system (BIOS) or the hardware abstraction layer (HAL). (I've not encountered the above bug on any hardware myself.) You can get at the performance counter via C# as fo

Categories : C#

What is kAudioSessionProperty_InputSources actually good for?
I'm very new to audio programming on iPhones so I don't have an answer to the question of what that particular property is good for, but if you want the list of audio inputs, I think this will work: NSArray * ais = [[AVAudioSession sharedInstance] availableInputs]; This provides an array of AVAudioSessionPortDescription objects. for (id object in ais) { AVAudioSessionPortDescription * pd = (AVAudioSessionPortDescription*)object; NSLog(@"%@",pd.portName); }

Categories : Iphone

Why is it good to put script tag in the end of body tag?
Modern browsers will download the page content and display it as it is downloaded. If your script tags are before the body, the browser may download all of your scripts before anything begins to show up, which may be an undesirable amount of time to make often impatient users wait before they get to see anything. Putting your script tags at the end of the body tag, after all of the page's contents, means your entire page will begin displaying as soon as possible to give the user something to look at - and then your scripts will download and make everything work. In my understanding, browser can't start rendering page before DOM is ready (...) As a result, user can't see anything except white blank page until script is fully processed regardless of position of script tag. This isn't

Categories : Javascript

What would be a good way to write this SQL query in a better way?
You should include DeviceID, so it makes sense. Try this: SELECT DeviceID, MAX(timestamp) as end, MIN(timestamp) as start, (MAX(odometerKM) - MIN(odometerKM)) as distanceTravelled, SUM ( case speedKPH when 0 then 1 else 0 end) as stopsDuration, SUM ( case speedKPH when 0 then 0 else 1 end) as tripDuration, (MAX(odometerKM) - MIN(odometerKM)) / Device.fuelEconomy as fuelConsumption FROM EventData Join Device ON Device.deviceID = EventData.deviceID WHERE deviceID = ? AND timestamp >= ? AND timestamp <= ? GROUP BY DeviceID

Categories : Mysql

Is there a good reason we should not always use Google API SDK?
There are devices without Google services installed. In this case the Google API is not available. By not using the Google API SDK, your app can still run on these devices. E.g. consider the Kindle Fire, it doesn’t have the Play store installed, as well as various low-budget tablets and Chinese phones. Custom builds from the open-source code such as Cyanogenmod also don’t have the Google apps installed (although many users add them manually). Although Android itself is open-source, the Google apps require the vendor to get a license from Google. I know this because custom builds were asked by Google to not include their apps. Also having their own store instead of the Play Store is attractive for some manufacturers because then they get a share of the revenue instead of letting Googl

Categories : Android

Optimise ASP.NET CMS KooBoo for good SEO
You can create the meta tags and description for each pages in KooBoo. Please following the step which is mentioned in kooboo help. http://www.kooboo.com/docs/Kooboo-CMS/Page-settings Please also see below link for URL rewriting of different site. http://www.kooboo.com/docs/Kooboo-CMS/Kooboo-multi-sites-solution

Categories : Asp Net

Is there any good example for IOS to get a picture without clip?
Maybe something like that... -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage*temp =[info objectForKey: UIImagePickerControllerOriginalImage]; CGSize newSize = CGSizeMake("WIDTH", "HEIGHT"); <---- SET YOUR VALUES UIGraphicsBeginImageContext(newSize); [temp drawInRect:CGRectMake(0,0,newSize.width,newSize.height)]; UIImage* smaller = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); }

Categories : IOS

Buttons not show good
remove 'layout_weight="0"' below, and try again <LinearLayout android:id="@+id/linearLayout2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_weight="0">

Categories : Android

Are /me and redirects a good idea in API's?
1) If the client had to authenticate, then they should already know the current user. I'm not sure why you feel the need to track it and give it back to them, or provide a magic shortcut which looks it up. If you really want to do this, I'd suggest a separate resource for the currently authenticated user. 2) Looks like a 300 Multiple Choices is as close as you're going to get. Or possibly a 303 See Other. What you're describing sounds an awfully lot like having multiple canonical representations for a resource, which is considered non-RESTful.

Categories : PHP

determining how good a correlation is in R
Here are some of the packages that i know ,are powerfull:- EDIT:- explaning a bit better CART(Classification and regression tree)-rpart package(you can construct decision tree on binary as well as non binary data set depend on the result you require,in your case it is non binary.) BNeT(bayesian network):-deal package(It is based on bayes theorem which defined a causal relationship.) Naive Bayes classifier:-e1071 package,for some basic understanding about Navie Bayes Classifier! There are still many for correlation in R.

Categories : R

What is a good way to pause a thread?
You could make use of swing timers: ActionListener listener = new ActionListener(){ public void actionPerformed(ActionEvent event){ gsm.setState(3); } }; Timer timer = new Timer(2000, listener); timer.setRepeats(false); timer.start();

Categories : Java

Why does this not make a good looking square?
First of all, this is a (horribly deformed) cube, not a square. Unless you look at it face-on it is never going to look like a "good square" :) Your polygon face culling appears to be culling the wrong side of your cube faces. It still looks like a cube, just an inside out cube. This is likely because you have overridden OpenGL's default front face winding direction (GL_CCW).

Categories : Java

C++ varargs - Is how I am using them okay or are they bad? Is there a good alternative?
EDIT: One more solution... if your compiler's IDE partially supports C++11, you may be able to initialize a std::vector at call time, i.e. template <typename T> void TestFunction(std::vector<T> vect) { .... } .... TestFunction(std::vector<int>{1,2,3}); Advantages to this approach are that STL automatically frees the allocated memory when the function goes out of scope. If that doesn't work you can resort to a two liner... template <typename T> void TestFunction(std::vector<T> vect) { .... } .... std::vector<int> tmp(1,2,3); TestFunction(tmp); The big downside is that here the memory sits on stack until you leave that scope (or explicitly resize the vector to zero length. Both approaches share some advantages... the count is built in and you ha

Categories : C++

what's a good/proper way to check whether a Web API is available?
A Web API is like any other web page, so this comes down to "How do I see if a webpage is responding?" As per the documentation, sure, just use try/catch. If there's a WebException, and you're sure the address is valid, then there was some issue in making your query. You can check the Response and Status properties of the WebException to learn more.

Categories : C#

What good are python classes?
The attributes you are declaring are class-level, and are shared by all instances of the class. You need to use a proper initializer/constructor function if you want those values to be specific to an instance: # Vertex class Vertex: def __init__(self): self.label = str() self.ID = int() self.outEdges = list() self.inEdges = list() You can also create methods on classes, not just attributes. class Vertex: # def __init__(self): ... def allEdges(self): return self.outEdges + self.inEdges

Categories : Python

Algorithm for 'good' number
Finding the number of "not good numbers" with n digits and top digit d is a straightforward dynamic programming problem. 10^n is the number of "good numbers" plus "not good numbers". I will give you no more help than that.

Categories : PHP

What would be a good key for some composite object?
If you aren't already using the tag property of btnButton, I would suggest generating a unique integer (use a counter and a generator method, for instance) and assign it to each button. Then simply index the NSDictionary on an [NSNumber numberWithInteger:] of the button's tag. You can look up the resultant catalog object like so: BGPairButtonCatalog *catalog = (BGPairButtonCatalog *)self.btnIndex[@(keyButton.tag)];

Categories : Objective C

What is a good benchmark for A* (AStar)?
A good stress test is a digital road network for 1) part of a big country (like spain, france, germany) , then 2) The whole country. (some million nodes) OpenStreetMap provides such data, but it is much work to import that to a graph.

Categories : Performance

cant come up with a good mongodb schema
I would do the following based on what knowledge I have of your application: There are two entities that should exist in two different collections: user and uploads. The uploads collection will be very large, so we want to make sure we can index and shard the collection to handle the scale and performance required by your queries. With that said, some key elements in uploads are: uploads= { _id:uploadId user:{id:userId, emailverified:true, banned:false} ts:uploadTime . . . } possible indexes: i. {ts:1,banned:1,"user.emailverified":1,"user.banned":1} (this index should be multi-purpose) ii. {"user.id":1,ts:1} Note that I store some redundant data to optimize your latest 1000 query. The cost is that in the rare case where emailverified and banned have to be updated, you need to run

Categories : Mongodb

is it good or bad to reuse the variables?
int x=0; //.. x = atoi(char_var); //.. int x = 0; You cannot redeclare x in the same scope. If you are not redeclaring it but using it for different purposes, you are free to do this. But it's a bad practice and should be avoided as it decreases code readability. Also you should find meaningful names for your variables for the same reasons.

Categories : C

Is this a good web application architecture?
I think you have more technology than needed in your architecture right now. Personally I would create a REST api on top of the DB (using either node or Rails - both are super easy to do this with and both can use pretty well any db) Then you can write any number of "apps" for the front end process, whether they are web apps, ios apps, android apps, etc... They will all get their data from your REST api on the backend. You might even consider writing the front end as a single page app using Angular, Knockout or Backbone, something like that. If you do that with node, your entire stack will essentially be written in javascript. It can get confusing for a newb, but it's super powerful.

Categories : Node Js

Asynchronous Programming - It's good But who did that?
Dear O/S can you read this file for me and when you have done it just call that callback! That's it, basically. Async IO uses OS kernel facilities to register a callback with an IO. While the IO is running there is no thread in use at all. Not even a background thread. The callback runs immediately inside of the node process, and queues a work item to the event loop.

Categories : Node Js

Is this a good grammar to xml schema?
Elements by default are compulsory, to make them optional use minOccurs="0". You are missing a xs:sequence and the double xs:simpleType used in the cheese element definition is not correct. The correct schema should be something like this: <xs:element name="pizza"> <xs:complexType> <xs:sequence> <xs:element name="doughLiteral" type="xs:string" fixed="dough"/> <xs:element name="sauce"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="marinara"/> <xs:enumeration value="bbq"/> <xs:enumeration value="pesto"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="cheese" minOccurs="0">

Categories : Xml

When would I use ant for Java web development?
Ant is used as a build system. You do not have to use it--in fact there are quite a few better systems but since ant was one of the first it's still likely to be very common. It generally is used to compile your java files, create wars and often even put the .war files onto the tomcats. Maven is bigger and tries to do a lot more, but it's also rather strict in it's format and quite heavy--but it's quite common these days as well. Maven can gather all your dependencies automatically which is nice, with ant you still have to download everything yourself. There are others, but you get the idea. Response to comment: I don't use visual studio, but I think it is more limited. For instance, Eclipse can build all your java files into a jar or execute them directly (in fact, it uses ant int

Categories : Java

Parallel development in Git
This article is a good place to start for git workflow. Also, Number8 is right. You should be regularly fetching updates when working on the same branch with other developers.

Categories : GIT

bias when not using a development set
Yes. By the very definition of bias, using a small set means you will have a higher bias, towards whatever section you decide to train on. If you randomly choose small samples from a larger data set though, this bias will be greatly minimized. If you're just using a small set of data, 10-fold cross-validation doesn't make much sense. The idea of cross validation is to chunk up a large data set into multiple parts, training with alternating parts of them serving as train and test sets, iterating until the best solution across all cross-validation sets is found. If you don't have much time or computational power my first suggest would be to step down your 10-fold CV checking. This will mean you can include a much larger portion of your data set for the same computation time and quickly eva

Categories : Machine Learning

NSStatusItem app development
As you dont have much work with NSWindows and NSViews, you surely dont need NSWindowController or NSViewController. And I think for this kind of app even your AppDelegate class is enough and best place to put all your logic. If you have some models then you can break your code upto that, and use it in the AppDelegate itself. Transition from iOS to OSX. If you are good in Objective-C then you dont have to worry about few more Cocoa-Controls especially GUI levels, you have full support of Documentation. Switching between iOS to OSX, vice-versa is not to difficult, but yes if you end up with system level then you need to interact with OSX too.

Categories : Objective C

How to apply TDD to web API development
From what you are describing you could easily find yourself writing integration tests. If your aim is to test the logic for processing what is returned from the scraped data (e.g. you know that you are going to get a timetable in a specific format coming in and you now have logic to process that data) you will need to create a SEAM between your web services logic and your processing logic. Once you have done this you should be able to mock the data that is returned from the web service call to always return the same table data and then you can write consistent unit tests against it. public class ScrapingService : IScrapingService { public string Scrape(string url) {// scraping logic} } public interface IScrapingService { string Scrape(string url

Categories : Api

Where to start for WSN development
I have uploaded a series of tutorials on YouTube and also my Website that might be helpful for you to get started.

Categories : Misc

manuals for os development?
Here is a basic tutorial on how to make an OS (assuming you mean operating system): http://www.youtube.com/watch?v=6MJUGVFAXKg. It's pretty good, but you need to learn the assembly language first (http://en.wikipedia.org/wiki/Assembly_language). Hope I helped!

Categories : Assembly

IVR Development in java
There is far too little information here to provide a direct answer, but I'll try to give you some basics. The standards for IVR application development is VoiceXML for dialog (caller interaction) and CCXML for call control. The latter is not as commonly available. There are also numerous proprietary solutions. Your choice of an open standard versus a proprietary solution should be more about vendor/solution lock in. Even with the open standards, you'll likely use custom enhancements and have some amount of lock in, but portability will be easier. You can code directly to the telephony boards (challenging and usually poorly documented if you are someone new to telephony) or work with solutions that provide end to end capability. I find very few people porting IVR applications so I w

Categories : Java

What is a good way to inform the user about the progress?
I would prefer a sticky notification with a Progress Bar, so the user can use your app in the *'loading time' and when he wants to look up the Progress, he pulls down the notification bar, and voila. if you want, you can make a Toast when the task finished.

Categories : Android

Would an ASP:DataGrid control be a good choice for this?
You would be better off using simple asp:Repeaters for this. That way you can fully control the CSS and HTML you use to shape the user interface. It is possible to do it with an asp:DataGrid but the asp:DataGrid is too rigid. What you would do is have nested repeaters: <table> <asp:Repeater id="rpt1" runat="server> <tr><td> <table> <asp:Repeater ID="rpt2" runat="server"> <tr><td></td></tr> </asp:Repeater> </table> </td></tr> </asp:Repeater> </table> Then in your code behind you would bind the parent rpt1 and then in the rpt1.ItemDataBound: Protected Sub rpt1_ItemDataBound(sender As Object, e As System.Web.

Categories : HTML



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