_id stringlengths 2 6 | text stringlengths 4 46k | title stringclasses 1
value |
|---|---|---|
d19801 | A simple way to do it is to put your GDI+ 1.1 code in #ifdefs and compile it to two different DLLs -- one with the code and one without. Then at runtime load the DLL that will work. Maybe you could even attempt to load the 1.1 DLL and if that fails fall back to the 1.0 DLL. | |
d19802 | I can see your website is still unsecured, for what it's worth, get yourself letsencrypt ssl.
Back to you question, go to your database, open the wp_options table, change the siteurl item to https://tourpoules.nl and also change the home item to https://tourpoules.nl.
A: If you have used search and replace DB master ... | |
d19803 | using the requests and lxml libraries (lxml for xpath) this becomes a fairly straightforward task:
1 import requests
2 from lxml import etree
3
4 s = requests.session()
5 r = s.get("https://fbref.com/fr/comps/13/calendrier/Scores-et-tableaux-Ligue-1")
6 tree = etree.HTML(r.content)
7 matchreporturls = tr... | |
d19804 | You can read from however many nodes you want in a Cloud Function. However, only one can trigger the function to run.
To read from your database use the following code:
admin.database().ref('/your/path/here').once('value').then(function(snapshot) {
var value = snapshot.val();
});
You will probably want to read from ... | |
d19805 | To get your grubby hands on exactly what Access is doing query-wise behind the scenes there's an undocumented feature called JETSHOWPLAN - when switched on in the registry it creates a showplan.out text file. The details are in
this TechRepublic article alternate, summarized here:
The ShowPlan option was added to Jet... | |
d19806 | You could provide an optional template argument which is a comparator (I think the standard lib does that frequently). Less ambitiously, you could use type{} to compare against which should work for anything with a default ctor: if(element != type{}). (Your problem is not that string doesn't have a comparison operator ... | |
d19807 | You need to correctly define the dependency with the Firebase Admin SDK for Node.js, and initialize it, as shown below.
You also need to change the way you declare the function: exports.wooCommerceWebhook = async (req, res) => {...} instead of exports.wooCommerceWebhook = functions.https.onRequest(async (req, res) => {... | |
d19808 | You generate a different query depending on which fields are entered.
Luckily this isn't too hard in SQL: all those fields are in the WHERE clause:
$where = [ 'foo' => 'bar', 'baz' => 0 ];
$sth = $db->prepare( "SELECT * FROM $table WHERE " .
implode( " AND ",
array_map( function($i) { return "$i=?"; }, arra... | |
d19809 | <script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
In the above script the tag sensor is not required in "src" instead of that please provide a googlemapapi key, it will work!!
eg:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=paste your key here"></script>
G... | |
d19810 | well as far i can get it, you need to make some kind of sequence for your IntegerField.
while it's not and id field, you can emmulate it by taking max value of that field among all objects:
max_val = YourModelClass.objects.all().aggregate(Max('that_field_in_question'))
# then just make new object, and assign max+1 to '... | |
d19811 | After doing some more digging I found what I was looking for. I found a rather well written example (in C#) of a technique called polygon clipping. This method finds the contact points in world coordinates. It goes through all the steps and code implementation for multiple different situations.
Here is the url: http://... | |
d19812 | Though Chepner is right that awk or sed are not exact tools for xml in case you are NOT having xmlstarlet in your system then try following.
echo $newdt
20181108
awk -v dat="$newdt" 'match($0,/>[0-9]+</){$0=substr($0,1,RSTART) dat substr($0,RSTART+RLENGTH-1)} 1' Input_file
A: If sed works for you -
sed -Ei 's/( name=... | |
d19813 | Looks like you need to create the /data/db folder
try doing this in the terminal
sudo mkdir /data/db
then start mongodb
A: Mongo by default writes data to /data folder and the user who is running mongo service does not have permission to create /data folder.
You can get this information from this log snippet
2017-05-0... | |
d19814 | Foo<int> and Foo<double> are 2 different classes despite they share the name Foo, so you can't just put them to vector as is. But you can use boost::variant and store a vector of variants.
A: A solution would be to have your Foo inheriting from an empty base class
struct CommonBase {};
template<typename T>
class Foo... | |
d19815 | Okay, the problem is solved. The code shown above is working. There seems to be a problem with the opened docx document (a customer form) - it may be corrupt.
After using another form the code works :/ | |
d19816 | Your conditions is not clear, but mybe this what you want:
DECLARE @T TABLE (Id INT, Name VARCHAR(25), Value INT);
DECLARE @YourId INT = 1;
DECLARE @YourName VARCHAR(25) ='a';
/**/
INSERT INTO @T VALUES
(1, 'a', 7),
(2, 'c', 7),
(1, 'g', 1),
(2, 'c', 2),
(4, 'g', 5),
(6, 't', 4);
/*First query*/
SELECT *
FROM @T
WHERE ... | |
d19817 | You should probably look at the CJK package that is in the contrib area of Lucene. There is an analyzer and a tokenizer specifically for dealing with Chinese, Japanese, and Korean.
A: I found lucene-gosen while doing a search for my own purposes:
Their example looks fairly decent, but I guess it's the kind of thing th... | |
d19818 | If your PDF file is in firebase storage you can create a url for your PDF with firebase storage. Then open this URL in a Web_view with webview_flutter plugin. | |
d19819 | You can use this regular expression to extract all rgb codes:
var regex = /rgb\(([^\)]+)\)/g;
A: You can use this:
string.replace(/^.*?linear-gradient *\((.+)/, function($1, $2) {
return $1.match(/rgb *\([^)]+\)/g); } );
//=> rgb(100, 106, 237),rgb(101, 222, 108)
Assuming there is no other r... | |
d19820 | The documentation for compareTo mentions this situation:
It is strongly recommended, but not strictly required that
(x.compareTo(y)==0) == (x.equals(y))
Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "No... | |
d19821 | The Session_End event fires when the server-side session times out, which is (default) 20 minutes after the last request has been served. The server does NOT know when the user "navigates away" or "closes the browser", so can't act on that.
A: You could use onUserExit jQuery plugin to call some server side code and ab... | |
d19822 | The payment wall iframe is configured by paypal with a whitelist of allowed domains (see Content Security Policy).
*
*The image URL must be https (specified in the docs)
*Your images must be on a server on the whitelist.
*This includes: The image URL can not have a custom port.
*PayPal automatically adds the domai... | |
d19823 | Using template_redirect hook, you can redirect user to a specific page when there is "no results found" on a product query search, like:
add_action( 'template_redirect', 'no_products_found_redirect' );
function no_products_found_redirect() {
global $wp_query;
if( isset($_GET['s']) && isset($_GET['post_type']) ... | |
d19824 | Your code contains some errors. See a solution in the snippet:
const csvData = `date,added,updated,deleted
2021-09-15,10,9,8
2021-09-16,20,11,7
2021-09-17,15,12,9
2021-09-18,20,9,8
2021-09-19,20,9,8
`;
const ActionsLineGraph = (props) => {
const svgRef = React.useRef();
// will be called initially and on every ... | |
d19825 | Try some thing like this.
array.map(snippet => (
<>
{snippet.question.map(que => {
if (que.type === "text") {
return <Typography>{que.value}</Typography>;
} else if (que.type === "number") {
return <Number>{que.value}</Number>;
}
return null;
})}
{snippet.answer.map... | |
d19826 | You can do everything with a single (anonymous) function, as demonstrated below:
$("body").on("click","button",function() {
with ($(this))
$('#text').val(hasClass('sel')? prev('input').val():'')
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- code 1 -->
... | |
d19827 | Your url looks to the controller action seems incorrect. You have var url = "/Admin/SaveLocationApiAsync/Post/"; when it should be var url = "/Admin/SaveLocationApiAsync";
Another approach to getting the correct url would be:
var url = '@Url.Action("SaveLocationApiAsync", "<ControllerName>")';
Also, in your ajax error... | |
d19828 | Try this instead to only select the visible elements under the tbody:
$('tbody :visible').highlight(myArray[i]);
A: If you want to get the visible tbody elements, you could do this:
$('tbody:visible').highlight(myArray[i]);
It looks similar to the answer that Agent_9191 gave, but this one removes the space from the ... | |
d19829 | You are referencing the same instance of the array in every object that you build.
userSelects[idx].excludedUsers = excludedUsers; does not copy the excludedUsers array into a new array for the object, it assigns a reference to the original array to userSelects[idx].excludedUsers.
If you want to clone the array you can... | |
d19830 | Since JS is single threaded, one function would run to its entirety and then only the control can go to any other function.
Perhaps you have an async call such as an AJAX call that indeed calls a function asynchronously but still whatever callback you give to it, that function would again run to its entirety before pa... | |
d19831 | You have not mentioned which the Azure IoT Hub scale tier is used. Basically there are two price groups such as Basic and Standard with a significant different cost and capabilities. The Basic tier offers only services for one-way communications between the devices and Azure IoT Hub.
Based on that, the following scenar... | |
d19832 | I ran through the same issue and after struggling for a couple of hours I went to my seller account and recreated my "Application Id" and "Application Secret". The only difference I made was I selected "self_access_application" instead of "third_party_application" this time and I was good to go.
Please refer: https://n... | |
d19833 | I think the simplest way would be to write a web service (WCF could be used, for example) which returns the said URL to the other web site. The "request for the URL" would just be a web service call from the other web site to your web service.
A: Sounds like your best bet would be to create a web service that would be... | |
d19834 | if I understood you right you could do:
def train_swicth(cars, s_x):
i=0
s=[]
out=[]
for c in s_x:
if c=="s":
s.append(cars[i])
i+=1
elif c=="x":
out.append(s.pop())
return out
as lists can be used as stacks with append as push-operation | |
d19835 | As long as you have a reference to the JPanel, you can add whatever GUI-element you want, by calling add(JComponent comp) on the JPanel.
So, you can do something like this:
class Panel extends JPanel{
...
}
class Main{
public Main(JPanel thePanel){
thePanel.add(new JButton("Hello"));
}
}
Wa... | |
d19836 | Try Process Monitor to see which path it tries to execute when it fails... | |
d19837 | You could try adding an animation listener to the animation. In the listener, there is onAnimationEnd() which gets called when the animation is done. Here, you may call succeeding animations such that they appear that they are chained.
Android Guide on Animation - Animation Listeners | |
d19838 | Yes it is possible to put an XPage in the sidebar without Composite Applications. What you need to do here is to go to File -> Preferences ->Widget Catalog and check the "Show widgets toolbar and My Widgets Panel". Now Open the XPage you want to create as a widget in XPiNC. In the toolbar, click on the "Configure a wid... | |
d19839 | From the Rack spec:
The Body must respond to each and must only yield String values. The Body itself should not be an instance of String, as this will break in Ruby 1.9.
In Ruby 1.8 Strings did respond to each, but that changed in 1.9.
The simplest solution would be to just return an array containing the string:
[sta... | |
d19840 | You can try this:
ListView1.Items.Add("Buah").SubItems.Add("Apel")
ListView1.Items.Add("Buah").SubItems.Add("Mangga")
ListView1.Items.Add("Buah").SubItems.Add("Jambu")
ListView1.Items.Add("Buah").SubItems.Add("Durian")
ListView1.Items.Add("Buah").SubItems.Add("Rambutan")
ListView1.Items.Add("Sayur").SubItems.Add("Apel... | |
d19841 | You can have it much more concise with list comprehension:
from fractions import gcd
print(" | 2 3 4 5 6 7 8 9 10 11 12 13 14 15")
print("-----------------------------------------------")
xlist = range(2,16)
ylist = range(2,51)
print("\n".join(" ".join(["%2d | " % b] + [("%2d" % gcd(a, b)) for a in xlist]) ... | |
d19842 | you can use try something like
@model.GetType().Name | |
d19843 | Here's a base R option using max.col :
#Select the columns to check
cols <- grep('CHECK', names(mydf), value = TRUE)
#Compare the value
mat <- mydf[cols] == 'A001'
#Find the column name where the value exist in each row
mydf$result <- cols[max.col(mat)]
#If the value does not exist in the row turn to `NA`.
mydf$result[... | |
d19844 | The typical way of controlling visibility is to use the visibility attribute with a conditional statement, and then set the associated binding variable, such as,
in xml:
<Label class="label" text="Label Text" visibility="{{ showLabel ? 'visible' : 'collapsed' }}" />
in js:
viewModel.set("showLabel", "true");
If ... | |
d19845 | int i = 'd' - 'a';
will have i set to 3 which is the difference | |
d19846 | You need to declare your variables with a keyword such as var, let, const otherwise the variable becomes global. All boils down to a scoping issue.
let timeIni = Number($.now());
Here is the fiddle working: https://jsfiddle.net/s8650s18/22/ | |
d19847 | I was wondering if any other app can see this request
The app that responds to your startActivityForResult() call can see the request. That could be:
*
*The real unmodified app that you wish to send the data to
*A hacked version of that app
*A completely independent app that happens to match your Intent, particul... | |
d19848 | To have an NSDictionary-type collection where your keys are pointers, you might be needing an NSMapTable class.
From this link:
NSMapTable (as the name implies) is more suited to mapping in a
general sense. Depending on how it is constructed, NSMapTable can
handle the "key-to-object" style mapping of an NSDictiona... | |
d19849 | Missed defer closeSession(session) in ReceiveData | |
d19850 | To create a folder inside your Internal Storage, try out this code snippet
val folder = filesDir
val f = File(folder, "folder_name")
f.mkdir()
Finally to check if the folder is created open Device Explorer in Android Studio, then follow the path
data->data->your app package name -> files-> here should be your folder t... | |
d19851 | @kittyminky you right
the solution is
Accounts.ui.config({ requestPermissions: { facebook: [the_permissons_you_want] } });
A: on my case using Accounts.ui.config yields an error since i only have Accounts defined, Accounts.ui isn't defined for me.
Perhaps because i didn't add that package, but must be a way without ... | |
d19852 | I found the solution.
I had the following code in my web.xml. I had to comment it out to get it working
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>NONE</param-value>
</context-param>
A: This script error is because one of the fiji related js file is missing in your jsf ... | |
d19853 | I'm surprised that the .on works at all. According to the documentation http://api.jquery.com/on/ it's second parameter should be a selector string and not a jquery object.
I would try something like this:
$(document).on("change", "#<%= cboxFirst.ClientID %>", function () {
if ($(this).is(":checked")) {
d... | |
d19854 | You can use the pipes module:
The pipes module defines a class to abstract the concept of a pipeline — a sequence of converters from one file to another.
Sure, the syntax won't be the same as a shell pipe, but why reinvent the wheel?
A: You may be thinking of coroutines. Check out this very interesting presentation... | |
d19855 | Moles is capable of detouring calls to managed code. This class is clearly not dealing with managed code. Try creating a stub for this class, manually. This means crating an INativeMethods interface, have NativeMethods implement INativeMethods, and then use the interface as the stub, as usual. Moles will then generat... | |
d19856 | There is also a "dumb" way of achieving the end goal, is to create a new table without the column(s) not wanted. Using Hive's regex matching will make this rather easy.
Here is what I would do:
-- make a copy of the old table
ALTER TABLE table RENAME TO table_to_dump;
-- make the new table without the columns to be de... | |
d19857 | You could use a separate object to define the validation messages:
export const validationMessages = {
required: 'Field is required'
}
// ...code
errors.firstName = validationMessages.required
Then, if you need to change the messages for required, just set the validationMessages.required, like this:
validationMe... | |
d19858 | SELECT emp_id, name, MIN(log) as log
FROM table_name
GROUP BY emp_id, name; | |
d19859 | Simply use
SELECT pg_get_triggerdef(oid)
FROM pg_trigger
WHERE tgname = trigger_name_in;
Besides, never use string concatenation when composing SQL code. The danger of SQL injection is too great. Use the format() function with the %I placeholder. | |
d19860 | If you want it to look like a single commit, you'll need to use git squash. Is there a reason why you can't use this? | |
d19861 | As a best practice, you should not scan and parse poms neither in remote nor local repository. On maven central they already scanned and parsed for you.
Just download nexus-maven-repository-index.gz from index dir (you need that big file 700M length, other files named nexus-maven-repository-index.XXX.gz are incremental... | |
d19862 | Acepted answer is data warehouse aproach with creation of separate tables and relations to time table. That's bit too long for me.
But if you can do it easily like this:
Calculate duration using DATEDIFF formula:
time_in_sec= DATEDIFF([time_end];[time_start];SECOND)
Than you can use that to calculate your 3 custom co... | |
d19863 | Found a work-around answer. You can set the dockerEntrypoint like so:
// build.sbt
dockerEntrypoint := Seq("bin/myapp", "-Dconfig.file=conf/application.prod.conf", "-Dlogger.resource=logback.prod.xml")
A: javaOptions can be supplied to sbt-native-packager with
javaOptions in Universal ++= Seq(
// -J params will be... | |
d19864 | If you set your database up properly you can just do this info.id; in your onContextItemSelected and that gives the database id | |
d19865 | try:
echo $articles[0]["dates"];
A: foreach($returned_content->find('div.box-inset') as $article) {
$item['dates'] = $article->find('div.important-dates', 0)->plaintext;
$articles[] = $item['dates'];
}
you cannot use echo to output array
foreach($articles as $strarticle)
{
echo $strarticle;
} | |
d19866 | Yes and no. Generally, this is a common pattern:
// create the object, retain count 1
MyObject *myObject = [[MyObject alloc] init];
// increment the retain count in the setter
self.myObjectProperty = myObject;
// let go of the object before the end of the current method
[myObject release];
You can avoid the release... | |
d19867 | You should use not "Keyboard shortcut" but rather "Mouse shortcut" from a popup menu (number 2 at the picture):
https://developer.android.com/studio/images/intro/keymap-options_2-2_2x.png
Also by default on most linux desktop environments alt+mouse click is already assigned to window dragging. OS shortcuts have more pr... | |
d19868 | You can do it with CSS3, is not necessary javascript for that:
https://jsfiddle.net/rzcdqh8k/
.animation {
width: 100px;
height: 100px;
background-color: red; //original color
-webkit-animation-name: example;
-webkit-animation-duration: 3s;
-webkit-animation-iteration-count: infinite;
animat... | |
d19869 | @Bsharp Sadly TagHelpers are only an ASP.NET Core feature and wont work in non-core versions of MVC. | |
d19870 | Months in cron expressions are 1-based. That's why 0 37 17 * 4 ? 2012 is never executed: today is 10th of May and you want it to run on every day of April. When you remove the year it prints next scheduled date in 2013, but in April! myJobKey will run at: Mon Apr 01 18:16:00 EDT 2013.
Obviously your expression should b... | |
d19871 | Wild guess: You added the column after running the app once.
If so (i have tried it before its working fine !), just unistall and reinstall your app.
OR you can simply increment your DATABASE_VERSION constant.
[EDIT]
But the second method won't work, since your current onUpgrade() method is buggy.
db.execSQL("DROP TABL... | |
d19872 | The Windows key is covered by VK_LWIN and VK_RWIN, respectively the left and the right key.
The "meta" key is presumably the one that brings up the context menu for the active window, same one you'd see if you right-click the mouse. It is VK_APPS. Beware that it is not a modifier key. | |
d19873 | if you know your table location in hdfs. This is the most quick way without even opening the hive shell.
You can check you table location in hdfs using command;
show create table <table_name>
then
hdfs dfs -ls <table_path>| sort -k6,7 | tail -1
It will show latest partition location in hdfs
A: You can use "show part... | |
d19874 | Read Write Execute Plain Dir Filename ./script: line 7: syntax error near unexpected token done' ./script: line 7: done'
Its because, you need a ; before do.
Bash scans from top to down, and executes every line. So in the top few lines, Bash does not know about FileExists and PrintFileName. So what you'd need to do is... | |
d19875 | You should code:
let persons = [...this.state.persons]
persons[0].name= "updated name"
this.setState({ persons })
A: using dot operator we can achieve this.
let persons = [...this.state.persons]
persons[0].name= "updated name"
this.setState({ persons })
A: Proble with that you mutate component state, below it's... | |
d19876 | make was treating the object files as intermediates and deleting them accordingly. Adding:
.SECONDARY: $(OBJS)
solved the problem. I do not know why it was doing this the first invocation but not the second invocation. Comments are welcome.
A: The reason that the .o files are not present is that they're considered in... | |
d19877 | SQL Server allows you to add datetime values, so that is a convenient data type for this purpose.
It is easy to convert the date to a datetime -- it is in a standard format.
The time column is tricker, but you can add in ':' for the conversion:
select v.*,
convert(datetime, v.date) + convert(datetime, stuff(stuf... | |
d19878 | If you are in Excel, right click on the row numbers on the left to show a context menu, then click on "Insert". This will add a new row. | |
d19879 | That would almost certainly be achieved using something like posix_memalign.
A: Since 4Kbytes is often the size of a page (see sysconf(3) with _SC_PAGESIZE or the old getpagesize(2) syscall) you could use mmap(2) syscall (which is used by malloc and posix_memalign) to get 4Kaligned memory.
A: you can not allocate ph... | |
d19880 | Firstly, assuming the newline is 100% spurious, I would figure out where it is coming from, and remove it there. But if for some reason that's not an option, the following gsub would work:
self.token = str.gsub(/\n$/, "")
That will only remove a newline if it's the last entry in the string. To remove all newlines, u... | |
d19881 | if(isset($_POST["add"])){
this will work for you
your form has POST method. So on PHP side you have to handle it with $_POST global variable. | |
d19882 | When these checkboxes are added you don't want to go the server but when user presses submit you are anyways going to server, so at that time you can persist this information about new checkboxes on server.
Another option is to call to server asynchronously using AJAX to update the server about the state change.
A: I... | |
d19883 | Wrap your entire layout in a <ScrollView>, it just gets truncated because the screen isn't 'high' enough. If you layout would be bigger in height, the first screen would be cut off too. | |
d19884 | If you need headless chrome in your container, choose a container with node14 and headless chrome installed. I found this one with Chrome 89 and released 10 months ago. You could find better source I guess
Else, you can use your node:14 container and, if it's possible, install headless Google Chrome on it (something li... | |
d19885 | If you're seeing different response it means that
*
*Either you're sending a different request. In this case inspect request details from JMeter and from the real browser using a 3rd-party sniffer tool like Fiddler or Burp, identify the inconsistencies and amend your JMeter configuration so it would send exactly the ... | |
d19886 | The jfxmobile plugin allows changing the path where the apk will be created.
Use installDirectory:
jfxmobile {
downConfig {
version = '3.0.0'
plugins 'display', 'lifecycle', 'statusbar', 'storage'
}
android {
installDirectory = file('/full/path/of/custom/folder')
manifest = '... | |
d19887 | To see if object is selected:
if($(".foo").is(':focus')){
// do something
}
To change values on keypress:
$(".foo").bind("keypress", function(e){
$(this).attr('value', 'bar');
})
Though not sure what you mean by changing the values of a drop down, or why you'd want to do that. | |
d19888 | FetchTask directly fetches data, whereas Mapreduce will invoke a map reduce job
<property>
<name>hive.fetch.task.conversion</name>
<value>minimal</value>
<description>
Some select queries can be converted to single FETCH task
minimizing latency.Currently the query should be single
sourced no... | |
d19889 | Containers run at the same performance level as the host OS. There is no process performance hit. I created a whitepaper with Docker and HPE on this.
You wouldn't use pm2 or nodemon, which are meant to start multiple processes of your node app and restart them if they fail. That's the job of Docker now.
If in Swarm, yo... | |
d19890 | Replace your .htaccess code with this:
RewriteEngine On
RewriteRule ^$ /articles/ [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/.]+)/?$ $1.php [L]
RewriteRule ^articles/([a-z0-9-]+)/([0-9]+)/?$ articles.php?id=$2&desc=$1 [L,... | |
d19891 | Seems the problem was coming from the following gem:
gem "rspec-legacy_formatters", :group => [:development, :test]
Not sure why I added it to the gem file. I removed it and did a
$ bundle install
which solved the problem | |
d19892 | A PHP driver (windows only) exists for NexusDB, currently it supports up to PHP v5.x. PHP v7.x support is being worked on.
Other drivers are either ODBC or Ado.NET. Perhaps say more about what you are trying to do? | |
d19893 | It now works, I am not sure what changed to fix this other than the fact i have placed the commands in a function this time, but it is all working as desired. | |
d19894 | What you did wrong is that you used gsub!. That takes a string and changes the string. It doesn't turn it into anything else, no matter what you do (even if you convert it to a float in the middle).
A simple way to achieve what you want is:
[["My", "2"], ["Cute"], ["Dog", "4"]].map{|s1, s2| [s1, *(s2.to_f if s2)]}
If ... | |
d19895 | Please try the following code. This code, will remove your div node from it's parent. div will be moved into body tag.
dojo.require("dijit.Dialog");
var myDialog=new dijit.Dialog(
{
title:"Dialog Title",
content:dojo.byId("divNodeID")
}
);
myDialog.show();
Hope this helps you. Thanks!
A: If ... | |
d19896 | def <<( rating ):
In your example, this is used to add a rating to a rateable model. (E.g. in acts_as_rateable.rb:41), similar to appending something to a string (str << "abc"). As it is within a module, it will only be included for the models that you declare as rateable.
class << ClassName:
All the methods inside of ... | |
d19897 | Maybe something like this:
<?xml version='1.0' encoding="UTF-8"?>
<document xmlns:xi="http://www.w3.org/2001/XInclude">
<p>Text of my document</p>
<xi:include href="copyright.xml"/>
</document>
https://en.wikipedia.org/wiki/XInclude
A: Below example should work to include external file:
<?xml version="1.0" enco... | |
d19898 | To find out how the query is executed, don't use EXPLAIN but EXPLAIN QUERY PLAN:
explain query plan select * from Shares where toId=3 and fromId=3 order by time desc;
0|0|0|SCAN TABLE Shares USING INDEX Shares_time_toId_fromId
In this query, the toId and fromId values are read from the index, but this does not matter ... | |
d19899 | From what I see in your question, you'll need to set_index():
df
date close
0 1980-12-12 28.75
1 1980-12-15 27.25
2 1980-12-16 25.25
3 1980-12-17 25.87
4 1980-12-18 26.63
5 1980-12-19 28.25
6 1980-12-22 29.63
7 1980-12-23 30.88
8 1980-12-24 32.50
9 1980-12-26 35.50
df['date'] = pd.to_dat... | |
d19900 | Add a cache property with the value false to the objects you pass to jQuery.ajax.
$.ajax({
url: "AJAXHandler.ashx",
cache: false,
data: { "lt": "loadcontrol" },
dataType: "html",
success: function(data) {
content.html(data);
}
});
You can set this globally by:
jQuery.ajaxSetup({
cache: false
});
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.