w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
converting .net refernce to c++ refernce
error C2664: 'innercppclass::getnum' : cannot convert parameter 1 from 'float' to 'float &' An object from the gc heap (a dereferenced gc pointer) cannot be converted to a native reference You forgot to document the error you're dealing with, this is what you saw. This is entirely by design and fundamental to the way managed code works. The float% argument of the managed function can be an interior pointer to a managed object, like the field of a ref class. The float& reference will be a raw unmanaged pointer at runtime, pointing to the float value. Which allows the callee to update the value. Both are just plain pointers at runtime, the only difference is that the garbage collector can see the interior pointer but not the unmanaged pointer. The jitter tells it where to loo

Categories : C#

C++ QTCreator 5.0 SQLite3_Open Undefined Refernce
If you want to link agains your system's sqlite version (which is probably best), you have to add the following line to your .pro-file: LIBS += -lsqlite3 and that should be it. You could also download the sqlite sources (the "amalgamation", as they call it) and add the .c file to your project. If you do that, you should use your downloaded Header file as well. But because you your system's header file in your code, I assume that you want to use the system's library version, which I recommend.

Categories : C++

Cakephp : save image in folder nd refernce to db
because i things third party plugins or components make app slower Why? If you get crappy written code this might be true but as a programmer you should be able to review, test and even measure the performance of code by profiling it if needed to find bottlenecks. And make a decision if the code is ok to use or not. What plugin slowed your app down? Your question can not be answered with the snipped you provide, it does not show how the file data is received by the app. Does it appear as a regular file upload in php? Is it maybe somehow encoded binary data in a field? Further the question can not really be answered within a reasonable amount of text and time IMHO. You already say that you don't want to use 3rd party code but prefer to reinvent the wheel and that you want to keep ref

Categories : PHP

Can't compile the project after splitting the source files to cpp and h, getting "undefined refernce to..."
undefined reference is a linker error, you are not passing the objects for the linking process. In the makefile, replace main.o: lines with main.o: main.cpp g++ $(FLAGS) -c main.cpp remove -lncurses from $(FLAGS) and add: link: <all the o files> g++ <all the o files> -lncurses -pthread -o dvoram64 then calling: make link will create the correctly linked executable. Edit: If you define the $(OBJECTS) variable, the link should be: link: $(OBJECTS) g++ $(OBJECTS) -lncurses -pthread -o dvoram64

Categories : C++

Why didnt wordpress include parameter in the save_post action refernce?
$post holds the post object that is being saved. $post_ID holds the ID of the post that is being saved. You can get these parameters in your callback function when making your add_action call. example add_action( 'save_post', 'my_save_function', 10, 2 ); The 10 represents priority - 10 is default, the lower the number, the higher the priority (i.e. run earlier). The '2' in the last parameter is the number of arguments to pass to your callback. The default is 1, but as you state there can be 2 parameters here so you can up the value to get them both, if they are both needed. function my_save_function( $post, $post_ID ) { // Do stuff here. } There are lots of actions/filters with variable numbers of parameters that aren't known implicitly, so doing this way allows the code to b

Categories : Wordpress

Perl, A hash of arrays: adding and removing keys, adding to an array, all in a while loop
You can use what perl calls autovivification to make this quite easy. Your code doesn't need that central if-statement. You can boil it down to: push @{ $hash{$q} }, $seq; If the particular key doesn't yet exist in the hash, perl will autoviv it, since it can infer that you wanted an array reference here. You can find further resources on autovivification by Googling it. It's a unique enough word that the vast majority of the hits seem relevant. :-)

Categories : Arrays

Adding a lookup entity without manually adding to related entities navigation properties
The navigation properties are just that, a link to the other entity. You wouldn't add to the navigation property, you would add to the entity itself and then access it via a navigation property.

Categories : C#

dynamically adding elements with jQuery with classes / Wijmo tree dynamic node adding
.append('<ul><li class="folder">NodeName</li></ul>'); supposed to be .append('<ul><li class="folder">' + NodeName + '</li></ul>');

Categories : Jquery

Render speed: adding one DOM item at a time or adding set of items at once
What I would do is use document.createDocumentFragment() and do all possible operations there, and touch the real DOM once. (Beside in a loop might be a good idea to cache the selector once): var frag = document.createDocumentFragment(); $.each(results, function(key, val){ var a = document.createElement("div"); a.innerHTML = val; frag.appendChild(a); }); $(".results").append(frag);

Categories : Javascript

Reading data from file and adding it to database without adding the same values
if (!isPatent(connection, preparedstatement, name)) addpatient(connection, preparedstatement, name, age, height, weight); public static boolean isPatient(Connection connection, PreparedStatement preparedstatement, String name) throws SQLException { boolean exists = false; preparedstatement = connection .prepareStatement("select * from allpatients where name = ?"); preparedstatement.setString(1, name); ResultSet rs = preparedstatement.executeQuery(); if (rs.next()) { exists = true; } rs.close(); return exists; }

Categories : Java

PHP: adding timestamp to filename vs adding it inside the file
Yes there's a third way - even a fourth - using a some DB handling and unlink(). For example: When you make your new cache file, put the filename in a table, and an expiration date. Then when you execute your script see if the expiration date is now, if so unlink the file. The fourth way is not efficient at all, but works. foreach(glob('files/*') as $file) { if(filemtime($file) < strtotime('-180 seconds')) { unlink($file); } } I would go with your first option, but with a better format... expirationDate_crc32hash.file. For example: 180_127264de.txt Then it'd be easier to explode at _, use strstr, or substr

Categories : PHP

Adding PHP code to Drupal Page for adding Javascript
This is more typically handled via a custom module or theme function. But assuming this is being put into a field on a node your code should work. The issue is likely a text format setting. Assuming this is Drupal 7, you can go to /admin/config/content/formats. I assume you are using PHP format. So you will want to inspect the settings for this format and make sure the PHP filter is enabled.

Categories : PHP

Adding jQuery slideDown 1000ms after adding product
I solved the above problem by adding the .delay method. All credit goes to @Kren470 http://stackoverflow.com/users/2148796/kren470 for solving this for me. Pasting below the modified code that works: $(this).find(".blockuserinfo-cart").toggle( $('#cart_block').stop(true, true).slideDown(400).delay(2000).slideUp(400),{ duration:4500, easing: 'linear' } );

Categories : Jquery

adding a new row to a table when adding another row in a different sheet
Personally I like the MSDN when I am looking for answers to VBA and vb.net. I have found it to be thorough and comprehensive. The more I learn, the more I understand what they are teaching on this site. This is a good tutorial to get started. Follow the links from this page. Getting Started with VBA in Excel 2010 http://msdn.microsoft.com/en-us/library/office/ee814737(v=office.14).aspx Also remember to search Stack Overflow as you progress, there are an amazing number of questions covering specifics you may require when you start, or ask more questions. If you require further assistance you can look at the links below. This link is helpful. But I would navigate through the links below to get a broader view and to find an explanation that works for you. Insert Row in Tables Multiple

Categories : Excel

What is the difference between adding to the argument and not adding it?
Collection<?> (pronounced "collection of unknown"), that is, a collection whose element type matches anything. I am not sure about your Box class definition so it is hard to describe it from that. But if you use any collection such as List, Map, Set. Then you can define the type of objects it may contain using generics. So if the type is not defined then it means you are allowing the raw types in your colection as mentioned here Collection c; But if you want this collection to store only a particular type then you can specify it using generfic. For examlple a collection of String: Collection<String> c; But if you want to allow any type of object to be stored then you use collection of unknown, as defined here: Collection<?> c; Using generics, allow you to

Categories : Java

Adding TabHost control into Linearlayout/Adding layout under the tabhost tabs
Are you not using an XML layout? It's much more efficient and tidy than what you have above... You haven't included any logcat so there isnt much to go on but it seems to me that the issue is your addTabItem tries to make something arbitrary and use it as the content when really you want to be using the frameLayout as the content so try passing that into the method and setting it as the content

Categories : Android

Matplotlib, adding text with more than one line. Adding text that can follow the curve
You can use line separators : pylab.text(1, 1.5, '$r_1 = 1.0$ AU ' + '$r_2 = 1.524$ AU ' + '$\Delta \nu = 75^{\circ}$', fontsize = 11, color = 'r') pylab.text() uses data coordinates by default, but you can use relative positions (0,0) to the lower-left and (1,1) to the upper-right, passing the parameter transform. See this example: pylab.text(0.6, 0.75, 'using axis coords', transform=ax.transAxes) The parameters: verticalalignment and horizontalalignment can also help you tremendously. Suppose you want to place a texts at the very corners: pylab.text(1.,1.,'top-right', transform=ax.transAxes, horizontalalignment='right', verticalalignment='top') pylab.text(0.,0.,'bottom-left', transform=ax.transAxes, horizontalalignme

Categories : Python

Adding column to table & adding data right away to column in PostgreSQL
I think you are looking for the update statement. For example: ALTER TABLE mn2012ct_geom2 ADD COLUMN obama_pct decimal(10,2); update mn2012ct_geom2 set obama_pct = CAST(obama AS DECIMAL) / CAST(uspres_total AS DECIMAL); You might also consider just creating a view to do the calculation: create view v_mn2012ct_geom2 as select g.*, CAST(obama AS DECIMAL) / CAST(uspres_total AS DECIMAL) as mn2012ct_geom2 from mn2012ct_geom2;

Categories : SQL

How can I check result of adding to a MemoryStream, before adding to the MemoryStream?
You mean something like this? var myUrl = "http://www.stackoverflow.com"; var encoding = Encoding.UTF8; XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.Encoding = encoding; var SOME_MAX_SIZE_IN_BYTES = 1024; MemoryStream ms = new MemoryStream(); for(var i=0; i<10; i++) { using (XmlWriter writer = XmlWriter.Create(ms, settings)) { // CREATE XML WITH STATEMENTS LIKE THIS writer.WriteStartElement("url", myUrl); writer.WriteEndElement(); // in order to get a semi-accurate byte count, // you need to force the flush to the underlying stream writer.Flush(); var lengthInBytes = ms.Length; if(lengthInBytes > SOME_MAX_SIZE_IN_BYTES) { Console.WriteLine("TOO

Categories : C#

Adding droidText to Android - Adding external jar to Android
Should I continue to raise the memory Yes, to the extent that you can. That JAR is immense, and so I am not surprised that it causes some problems. You might need to switch to command-line builds.

Categories : Android

Adding a "winmd" reference vs Adding a project reference
Tools + Options, Projects and Solutions, Build and Run. Change the "MSBuild project build output verbosity" setting to Normal. Pay attention to the build output, the messages you see after "XapPackager". Which show which files are getting added to the Xap package. Your DLL needs to be in that list. If it is not then your program will fail as described. In which case you'll need to find out why it is getting skipped. Start that by checking that the Copy Local property of the .winmd reference is True.

Categories : C#

adding inline rows without javascript not adding rows
I think you need to update formsets factory to have more forms something like: disease = get_object_or_404(Disease, pk=disease_id) if request.method == "POST": if 'add' in request.POST: cp = request.POST.copy() total = int(cp['form-TOTAL_FORMS']) #add max_num and extra params to formset factory IndicatorFormSet2 = inlineformset_factory(Disease, Indicator, max_num=total+1, extra=1) indicatorInlineFormSet = IndicatorFormSet2(request.POST, cp, prefix='form') return HttpResponseRedirect(reverse('drui', kwargs={'disease_id':disease_id}))

Categories : Django

Getting Error while adding Email composer plugin in phonegap "Error adding plugin com.example.abc"
The plugin needs updating for more recent versions of Cordova. You can download my Eclipse test project containing the updated plugin code and the resulting APK from here. Note that because of this this bug in Android 4.x I had to replace this line in EmailComposer.java: emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, body); with ArrayList<String> extra_text = new ArrayList<String>(); extra_text.add(body); emailIntent.putStringArrayListExtra(android.content.Intent.EXTRA_TEXT, extra_text); This works around the problem for plain text emails but won't work for HTML emails because Spanned (returned by Html.fromHtml) is not a subclass of Charsequence. When I tried casting the result of Html.fromHtml() to a string, the tags appeared as part of the text :-( Also when

Categories : Cordova

Adding New Tab in PHP
May be you are trying to add complete URL in your new tab. If you want to add a URL www.exaple.com/abc add like this URL [wwwroot]abc/ I also faced issue same as this, it resolved by using above method

Categories : PHP

What is adding #. to my URL?
As I commented the issue is not due to cakephp but addthis plugin, it basically append an unique Id if data_track_addressbar in its config is set to true. So to get rid of that just change it's value to false. var addthis_config = {"data_track_addressbar":false};

Categories : PHP

adding dll to C# project
Not sure if this is it, but I've ran into a somewhat similar problem with images from ProjectA, where I want them to be shown in ProjectB. This however is not possible in Store Projects, the image should be in the same project and cannot be referenced from ProjectB to ProjectA (without returning any error). A workaround (if possible) would be to put the two projects in the same solution and add the charm flyouts (if they are images) as linked items in ProjectB... Hope this gets you towards a solution.

Categories : Xaml

Adding Elemental to GWT
Seem there is something in elemental.Elemental which can not be compiled by the GWTJS compiler. Since Elemental is experimental things like this can happen...

Categories : Gwt

Asp.Net MVC Adding two viewmodels to a third
Contacts is of Type List<MV1>, thus you can't assign it to a Property of type VM1. You need to change the definition of VM3 to: public class VM3 { public List<VM1> VM1 { get; set; } public List<VM2> VM2 { get; set; } }

Categories : C#

Increment adding new row
Give a css class name (increment)to your *TD*s which shows the counter number and use last() method to get the last TD which shows the last counter number, and get the content of that and increment and then add it in the new row. $(function(){ $('.add-button').click( function(e) { e.preventDefault(); var $this = $("table#myTable tbody tr"); var $current_num = $this.find("td:first").attr("rowspan").length; var $incremented =parseInt($("#myTable").find('td.increment').last() .html())+1; $("#myTable tbody").append("<tr><td rowspan='2' class='increment'>" + $incremented + "</td><td>other data</td> <td>even more data</td><

Categories : Jquery

Adding conditions in web.xml
You cannot do it in web.xml level. This could be a cool feature if web.xml respect system properties but it does not. So you only way is to do this in code. Fortunately you have various possibilities. You can map your error URL to JSP where you implement logic based on system property or other parameter stored in property file, DB or where you want. You can do it in HTTP filter as well. You can also create several versions of your web.xml: one for production, other for tests. If you want to avoid duplications create these versions using automatic generation from template.

Categories : Java

adding xml value to table in sql
Try like this:- CREATE PROCEDURE AddEmp @empXml xml AS INSERT INTO Employee ( siteID, samplingPlanProjectSiteGUID, samplingPlanProjectGUID ) VALUES ( @empXml.value('(/SamplingPlanProject/CoordinateSystem/InputUnits/SiteID)[1]', 'varchar(max)'), @empXml.value('(/SamplingPlanProject/CoordinateSystem/InputUnits/SamplingPlanProjectSiteGUID)[1]', 'varchar(max)'), @empXml.value('(/SamplingPlanProject/CoordinateSystem/InputUnits/SamplingPlanProjectGUID)[1]', 'varchar(max)'), ) NOTE:- I have considered the name of the table as EMP and table column name as above. Do change the values as per your reqirement.

Categories : SQL

CSS margin adding on UL tag
Part of normalize.css in the 996grid framework has this style declaration: menu, ol, ul { padding: 0 0 0 40px; } If you don't want it, you have to explicitly remove it. Just add a padding:0 declaration to your styles for the particular element. You also seem to be using -webkit-padding-start: 40px;, which is of course going to affect padding as well...

Categories : HTML

Adding numbers in asp
To do this you would first add the two numbers and the use Cstr() to change it to a string for writing. Example: totalmovies=moviesA+moviesB response.write ("There are currently " + cstr(totalmovies) + " movies in our archives.") Note if moviesA and moviesB are Strings already then you need to change them to int before doing the addition then line 1 would be: totalmovies=cint(moviesA) + cint(moviesB) Hope it helps.

Categories : String

Adding Columns in PHP
I don't know what your DB schema is like, but you may want to modify your original query like this: SELECT SeasonStats.Sea, SeasonStats.Team, SeasonStats.GP, SeasonStats.Goals, SeasonStats.Assists, SeasonStats.Points, SeasonStats.PlusMinus, SeasonStats.Pim, SeasonStats.PP, SeasonStats.SH, SeasonStats.GW, SeasonStats.GT, SeasonStats.S, SUM(SeasonStats.Sea) as total FROM PlayerStats INNER JOIN SeasonStats ON PlayerStats.PlayerID = SeasonStats.PlayerID WHERE SeasonStats.PlayerID = $iPlayerID ORDER BY SeasonStats.Sea; You may also want to total some columns in SQL using the GROUP BY CLAUSE.

Categories : PHP

Adding a Class from a Div
Is it bad practice to add a class to a jQuery object that it may already have? How about removing a class that it may not have? with jQuery .addClass() you do not add existing class second time. Is it bad practice to add a class to a jQuery object that it may already have? How about removing a class that it may not have? No

Categories : Jquery

Adding sites to a DCA in R
The general way is to use the points() methods, as in points(vare.dca, display = "sites", col = "red") or use the text() method if you want the site/sample labels. orditorp() can also be used, just change the argument to display = "sites", which you could have ascertained by reading ?orditorp. There are a number of other options, most notably ordipointlabel() which will work harder to stop overlap of various labels. I've written a number of blog posts on these functions in vegan, which you can consult for more explanation and examples Decluttering ordination plots in vegan part 1: ordilabel() Decluttering ordination plots in vegan part 2: orditorp() Decluttering ordination plots part 3: ordipointlabel()

Categories : R

Adding a dropdownlist in MVC
You can make a property inside your main ViewModel which contains ViewModel for dropdownlist and use it with dropdown. Assume you have controller. public class HomeController { public ActionResult Index() { var viewModel = new MainViewModel { SomeProperty = "SomeValue", DropDownData = new DropDownDataViewModel() // Initialize it with appropriate data here. }; return this.View(viewModel); } } And MainViewModel public class MainViewModel { public string SomeProperty {get; set;} public DropDownDataViewModel DropDownData { get; set; } } So, inside your view you can call @Model.DropDownData to get access to this viewmmodel.

Categories : Asp Net Mvc

adding 5 to the $i after inserting the $i
This code should do the trick I think: <?php session_start(); mysql_connect("localhost", "root", ""); $db=mysql_select_db("test"); if(isset($_SESSION['counter'])) { $i=$_SESSION['counter']; } else { $i=1; } $r=(" INSERT INTO test1 (score) VALUES ('$i') " ) ; $t=mysql_query($r); if($t) { $i=$i+5; echo "done"; } else { echo "not done"; } $_SESSION['counter']=$i; ?> Basically, you can store data inside a session variable, which is maintained on the server and maintains, well a session, with the client/user. You can then refer to it in following pages.

Categories : PHP

Adding CSS via Javascript
The order in which CSS is applied is important. You should add your JavaScript code at the bottom of the page to make sure it gets applied in case some other styles are already applied before hand. Try !important property too in case your CSS is overriden.

Categories : Javascript

Adding Barewords to Lua
As soon as someone declares a local with the same name of your "keywords" it will shadow your "keyword/global var" and your mechanism will fail: print(foo) -- does what you think local foo = 2 print(foo) -- argh! and note that you cannot prevent the definition of local variables in a script. Edit: (answering to a comment). Are you using a customized Lua engine? You cannot prevent entering local scope, because you are always in local scope. It is exactly the other way around: technically there is no global scope in Lua (with the same meaning as in C, for example). There is a global namespace (implemented as a table), instead. The mechanisms for accessing globals differs between Lua 5.1 (function environments) and Lua 5.2 (implicit _ENV prefixing), but the concept is almost the same

Categories : String



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