2018-10-22         Honey

Javascript not recognizing array from variable

I have an array coming from an outside source and Javascript won't recognize it unless I copy and paste it from the log on back.So, for example, the following code would output a string instead of an array for outside but if I copied the exact output from the log for outside and assign it manually to a new variable copyfromlog it will output as an array.var outside = Drupal.settings.map.loc_json;// Directly copied from output of previousvar copyfromlog = [ [ "<div class='test china'><h2>Fake School</h2><hr><p>Lorem Ipsum.</p></div&...

 javascript                     1 answers                     42 view
 2018-10-22         Honey

Cant run assets:precompile on heroku

I am developing a Rails app on Windows 10 under Rails 5.2.1 and Ruby 2.4.4p296I cannot run the command heroku run rake assets:precompileI get this error:C:\Users\Jaiel\Desktop\RubyOnRailsForum>heroku run rake assets:precompile --traceRunning rake assets:precompile --trace on ⬢ warm-mountain-15591... up, run.4644 (Free)** Invoke assets:precompile (first_time)** Invoke assets:environment (first_time)** Execute assets:environment** Invoke environment (first_time)** Execute environment** Invoke yarn:install (first_time)** Execute yarn:installYarn executable was not detected ...

 ruby-on-rails                     1 answers                     36 view
 2018-10-22         Honey

Way to edit WindowTitle for use later in bat script?

With the code below i get the window title i wanna use for later.But it also has "Window Title: " and i also wanna edit out some things.Is there a way to make it not include "Window Title: " before it becomes a SET variable?FOR /F "tokens=*" %%g IN ('tasklist /fi "imagename eq wmplayer.exe" /fo list /v ^|find /i "window title" ^|find /v "N/A"') do (SET _WindowMediaPlayerWindowTitle=%%g) To get the 'Window Title' as a variable using your provided method and information:@For /F "Tokens=1* Delims=:" %%A In ( 'TaskList /V /Fi "ImageName Eq WMPlayer.exe" /Fo List') Do @For...

 batch-file                     1 answers                     54 view
 2018-10-22         Honey

TSQL: How to convert local time to UTC? (SQL Server 2008)

We are dealing with an application that needs to handle global time data from different time zones and daylight savings time settings. The idea is to store everything in UTC format internally and only convert back and forth for the localized user interfaces. Does the SQL Server offer any mechanisms for dealing with the translations given a time, a country and a timezone?This must be a common problem, so I'm surprised google wouldn't turn up anything usable.Any pointers? 7 years passed and...actually there's this new SQL Server 2016 feature that does exactly what you need...

 sql-server                     10 answers                     2 view
 2018-10-22         Honey

Problem with loading modal forms using django-fm

Based on the example given here: https://github.com/django-fm/django-fm I can not upload successfully the modal window based on the form-view-model .py appropriate file provided.Here is my code in models.py:from django.db import models class Test(models.Model): test_one = models.CharField(max_length=200) test_two = models.CharField(max_length=200) def __str__(self): '''this function returns the name of the instance''' return self.test_one+self.test_twoHere is my code in forms.py:from django import formsfrom .models import Testcl...

 django                     1 answers                     74 view
 2018-10-22         Honey

HttpMethodBase vs HttpRequestBase

What is the difference in usage of org.apache.commons.httpclient.HttpMethodBaseand org.apache.http.client.methods.HttpRequestBase to execute a Http request?So for example to execute a GET request I can doclientX.executeMethod(new GetMethod(uri));orclientY.execute(new HttpGet(uri));So why both is provided by apache? Respectively when I should use which one? Basically since apache evolves its APIs also evolve. The HttpRequestBase is part of the new HttpClient implementation after version 4.0. So it is encouraged to use the newer implementation. HttpGet is the newer ...

 java                     1 answers                     26 view
 2018-10-22         Honey

Can I use alt = [Next] to gather reviews from each page?

Once again, trying to get help for a little bit of university research. I am trying to figure out a way to scrape all of the reviews for each movie without manually writing each url and iterating over it in a set. So, I'm trying to find the "Next" button and use that to guide how many pages of reviews to gather. In theory I would like it to stop on the last page of reviews since there would be no "Next" button on the last page. So if there are three pages of reviews, it would stop getting the reviews on the third page.To keep it simple, this is just some of the code I have ...

 python-3.x                     2 answers                     24 view
 2018-10-22         Honey

Codename One: show a (secret) Image from an URL without storing and without caching

I have the following code:EncodedImage placeholder = EncodedImage.createFromImage(FontImage.createImage(size, size, ColorUtil.GRAY), true);String url = "...";Date date = new Date();URLImage qrCode = URLImage.createToStorage(placeholder, date.getTime() + ".png", url, URLImage.RESIZE_SCALE);qrCode.fetch();qrCodeLabel.setIcon(qrCode);The qrCode image contains a secret that should not be saved on the Storage / FileSystem and that should not be cached in any way. It should be shown to the user only one time.Because these requirements, of course my code doesn't work as I need, be...

 codenameone                     1 answers                     91 view
 2018-10-22         Honey

How to create a UIAppearance proxy for an inherited view in MonoTouch?

I created a subclass of UIButton which acts as a custom Back button inside UIBarButtonItem: - - - - - - - - - - - - - - - - - | UIBarButtonItem || ------------------------ | / || \ BackButton : UIButton | | ------------------------| _ _ _ _ _ _ _ _ _ _ _|As I was switching my code to using UIAppearance, I noticed that BackButton.Appearance is, unsuprisingly, inherited from UIButton.Appearance, and therefore changing it will change all UIButtons throughout the application and not just my custom buttons.I ...

 c#                     2 answers                     9 view
 2018-10-22         Honey

Setting values and display Text in Android Spinner

I need help in setting up value and display text in spinner.as per now I am populating my spinner by array adapter e.gmySpinner.setAdapter(myAdapter);and as far as I know after doing this the display text and the value of spinner at same position is same. The other attribute that I can get from spinner is the position on the item.now in my case I want to make spinner like the drop down box, which we have in .NET.which holds a text and value.where as text is displayed and value is at back end.so if I change drop down box , I can either use its selected text or value.but its ...

 java                     2 answers                     29 view
 2018-10-22         Honey

How to export Excel Data from different sheets to SQL-SERVER Database?

I am new in EXCEL-VBA and SQL. I have managed to create marco button and push excel cell data to SQL server tables. However, I am a bit puzzled:Q. How can I take excel cell data from different sheets and then push them to different tables in SQL Server database? (Currently, I have 3 sheets{Customers, Test, Information} in one excel file)Current Working code:Sub Button1_Click()Dim conn As New ADODB.ConnectionDim iRowNo As IntegerDim sCustomerId, sFirstName, sLastName As StringWith Sheets("Customers") 'Open a connection to SQL Server conn.Open "Provider=SQLOLEDB;Data So...

 sql                     2 answers                     88 view
 2018-10-22         Honey

Show sum of all for every record

Say you have table of some items with these two columns: ItemNamePrice....where ItemName is unique.How do you show sum of all prices for every ItemName (I'm using Oracle)? If I just try this:SELECT ItemName, SUM(Price) FROM ItemsI get this error: ORA-00937: not a single-group group function...which goes away only if I use GROUP BY. But then I can SUM only by groups, not all of them. You can't both group and not group in the same query. You can use a subquery to get the price:select ItemName, (select sum(Price) from Items) as AllPricesfrom ItemsAs the subquery d...

 sql                     9 answers                     101 view
 2018-10-22         Honey

How to CONCAT two table columns into one column in SQL Server

I am new to SQL Server. I have a script. Please check the script firstSELECT WOtask.PK, WOPK, TaskNo, TaskAction = CASE WHEN WOTask.AssetPK IS NOT NULL THEN '<b>' + Asset.AssetName + ' [' + Asset.AssetID + ']</b> ' + CASE WHEN Asset.Vicinity IS NOT NULL AND Asset.Vicinity <> '''' THEN RTRIM(Asset.Vicinity) + ': ' ELSE '''' END + WOta...

 sql-server                     1 answers                     72 view
 2018-10-22         Honey

Maven deploy plugin/shade plugin: don't deploy uber jar

I'm trying to both build an uber jar using the maven shade plugin (to build a docker image) and also deploy the project jars to a maven repository. I do not want to deploy the uber jar to the maven repo. Therefore, either I need to be able to exclude a particular file from the maven deploy plugin, or, make the maven shade plugin put the uber jar in a different location so it is not picked up by the deploy plugin.Is either of these two things possible? You can define two profiles: the default profile with shade plugin, and the other profile for deploy - without shade plug...

 java                     1 answers                     96 view
 2018-10-22         Honey

Batch INSERT on multiple queries is throwing foreign key violation

I am following this to do batch INSERTwith two queries. The first query inserts into <tableone> and the second query insert into <tabletwo>.The second table has a foreign key constraints that references <tableone>. The following code is how I am handling the batch insertsbatchQuery.push( insertTableOne, insertTableTwo);const query = pgp.helpers.concat(batchQuery);db.none(query)insertTableOne looks likeINSERT INTO tableone (id, att2, att3) VALUES (1, 'a', 'b'), (2, 'c', 'd'), (3, 'e', 'f'), ...insertTableTwo looks likeINSERT INTO tabletwo (id, tableone_id...

 postgresql                     1 answers                     84 view
 2018-10-22         Honey

List UIButtons in a Grid view without using CollectionView

I'm going to have a squared grid of UIButton objects. Each of these UIButtons is referenced to an unique option and id coming from an array API.Example of the option APIoptions = ( { name = Color; "option_id" = 16; "product_option_id" = 1324; "product_option_value" = ( { image = "example.com/image.jpg"; name = red; "option_value_id" = 104; price = 0; "price_prefix" = "+"; "product_option_value_id" = 4650;...

 ios                     1 answers                     69 view

Page 1 of 146  |  Show More Pages:  Top Prev Next Last