Id
int64
34.6M
60.5M
Title
stringlengths
15
150
Body
stringlengths
33
36.7k
Tags
stringlengths
3
112
CreationDate
stringdate
2016-01-01 00:21:59
2020-02-29 17:55:56
Y
stringclasses
3 values
56,176,749
Cant get a informations that's inside an array
Im trying to get a information that's inside an array but can't, everytime returns and undefined statemen. That's the array, it's inside the variable 'RESULTADO' debug {"recordType":"customrecord5","id":"1","values":{"CUSTRECORD4.custrecord6":[{"value":"11","text":"11 CP BUSINESS : Empresa Teste"}],"CUSTRECORD4.custrecord5":[{"value":"7","text":"LASER"}]}} for (var i = 0; i < resultado.length; i++){ var valores = resultado[i]; log.debug(valores); var dados = valores['value']; // NAO ESTOU CONSEGUINDO PERCORRER A VARIAVEL DADOS log.debug(dados); for (var u = 0; u < dados.length; u++){ valor = dados[u]; log.debug(valor); } } I need to get the information that's inside the index "values" and "CUSTRECORD4.custrecord5", but cant get in...
<javascript><arrays><object>
2019-05-16 21:18:19
LQ_EDIT
56,176,955
scala sum of an array elements through 'while loop'
scala throws me the error whenever i try to add/sum the elements of an array through 'while loop' i am able to get the sum by using 'for loop' def sum(input:Array[Int]):Int= { var i=0; while(i<input.length){ sum=i+input(i); i=i+1; } sum } <console>:17: error: reassignment to val sum= (i+input(i)) ^ <console>:21: error: missing argument list for method sum Unapplied methods are only converted to functions when a function type is expected. You can make this conversion explicit by writing `sum _` or `sum(_)` instead of `sum`. i also tried with return "sum()" but i got a diff error <console>:17: error: reassignment to val sum=i+input(i); ^ <console>:20: error: not enough arguments for method sum: (input: Array[Int])Int. Unspecified value parameter input.sum()
<scala><while-loop><sum>
2019-05-16 21:41:23
LQ_EDIT
56,178,677
Notice: Undefined variable: data in C:\xampp\htdocs\public\ruangweb2\apps\views\index.view.php on line 67
I need help on some codes. This isn't made by me, i just copy a source code to make a website from another developer. I still don't know what is the problem although I have searched all the solutions online, because I am still learning. <?php $limit = 5; $pagination = isset($_GET['pagination']) ? $_GET['pagination'] : ""; if (empty($pagination)) { $position = 0; $pagination = 1; } else { $position = ($pagination - 1) * $limit; } $query = $connect->execute("SELECT pinjam.id_peminjaman, pinjam.id_user, user.nama_user, pinjam.id_ruang, ruang.nama_ruang, pinjam.id_hari, hari.nama_hari, pinjam.tgl_pinjam, pinjam.jam_awal, pinjam.jam_akhir, pinjam.keterangan, pinjam.status FROM tbl_peminjaman AS pinjam LEFT JOIN tbl_user AS user ON pinjam.id_user = user.id_user LEFT JOIN tbl_ruang AS ruang ON pinjam.id_ruang = ruang.id_ruang LEFT JOIN tbl_hari AS hari ON pinjam.id_hari = hari.id_hari ORDER BY pinjam.updated_at DESC LIMIT $position, $limit"); $no = 1 + $position; $check_search = $query->num_rows; while ($query->fetch_object()) { if ($data->status == 'DITERIMA') { $color = "green-text"; } elseif ($data->status == 'DITOLAK') { $color = "red-text"; } elseif ($data->status == 'MENUNGGU') { $color = "yellow-text"; } else { $color = "grey-text"; } ?> Sorry, i haven't know yet how to modify the undetected variable. So please, help me. Thanks :)
<php><sql>
2019-05-17 02:10:19
LQ_EDIT
56,178,750
Why does all() return True for an empty iterable?
<p>My understanding of <code>all()</code> is that it returns <code>True</code> if every value if an iterable is <code>True</code> when evaluated as a boolean.</p> <p><code>bool([]) == False</code>, so why does <code>all([])</code> return <code>True</code>?</p>
<python><iterable>
2019-05-17 02:24:33
LQ_CLOSE
56,179,355
How can I avoid <br> tags inside of other tags using php
<p>For some reasons, I do not want to have <code>&lt;br&gt;</code> tags inside of my others tags. For example, if I have </p> <pre><code>&lt;b&gt;This is a line&lt;br&gt;another line?&lt;/b&gt; &lt;i&gt;testing 1&lt;br&gt;testing 2&lt;/i&gt; </code></pre> <p>I want it to be converted to</p> <pre><code>&lt;b&gt;This is a line&lt;/b&gt;&lt;br&gt;&lt;b&gt;another line?&lt;/b&gt; &lt;i&gt;testing 1&lt;/i&gt;&lt;br&gt;&lt;i&gt;testing 2&lt;/i&gt; </code></pre> <p>I know that they display the same in browsers. But I need to have the codes in this format for some other reasons. I am using php. Thanks for your help. </p>
<php><regex><dom><preg-replace><dom-manipulation>
2019-05-17 03:53:25
LQ_CLOSE
56,180,188
How do i assign foreign key value to my post
# This my part of CreateView def post(self, request, *args, **kwargs): form = BussinessDetailForm(request.POST,request.FILES or None) form2 = MultipleImageForm(request.POST or None, request.FILES or None) files = request.FILES.getlist('images') if all([form.is_valid(),form2.is_valid()]): forms = form.save(commit=False) geolocator = Nominatim() location = geolocator.geocode(self.request.POST.get("pin_code",False)) forms.latitude = location.latitude forms.longitude = location.longitude forms.created_by = self.request.user forms.themes = self # forms.object_id = int(self.request.POST.get("id",False)) forms.save() # part of models.py class BussinessDetail(models.Model): # content_type = models.ForeignKey(ContentType,on_delete = models.CASCADE) # object_id = models.PositiveIntegerField() # content_object = GenericForeignKey('content_type','object_id') themes = models.ForeignKey(Themes,on_delete=models.CASCADE,primary_key=False) # object_id = models.PositiveIntegerField() created_by =models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE,primary_key=False) listin_catagory =models.CharField(max_length=200,choices=listin_Catagory,blank=True) bussiness_name =models.CharField(max_length=200,blank=True) #themes table class Themes(models.Model): theme_created_by =models.ForeignKey(settings.AUTH_USER_MODEL,on_delete=models.CASCADE,primary_key=False) default_theme = models.BooleanField(blank=True,default=False) technology_theme = models.BooleanField(blank=True,default=False)
<django>
2019-05-17 05:32:43
LQ_EDIT
56,180,693
My app keeps crashing when i go to other activity
I am trying to make an app named 'moviesinfo', in which i have a login page, with sign up and forgot password option. When i try to login,the app crashes. I also don't know if the data entered on the sign up page is being stored in the database or not. This is my mainactivity.java ``` package com.example.moviesinfo; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity { SQLiteDatabase db; SQLiteOpenHelper openHelper; private EditText user; private EditText password; private Button btn; private Button btn2; private Button forgot; Cursor cursor; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); forgot=findViewById(R.id.forgot); btn2=(Button) findViewById(R.id.signup); user= (EditText) findViewById(R.id.username); password = (EditText) findViewById(R.id.password); btn = (Button) findViewById(R.id.login); openHelper= new DatabaseHelper(this); db=openHelper.getReadableDatabase(); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { String username1= user.getText().toString(); String password1= password.getText().toString(); cursor = db.rawQuery("SELECT * FROM " +DatabaseHelper.TABLENAME + " WHERE " + DatabaseHelper.COL2 + "=? AND " + DatabaseHelper.COL3+"=?", new String[]{username1,password1}); if (cursor!=null){ if (cursor.getCount()>0){ cursor.moveToNext(); Intent intent = new Intent(MainActivity.this,listmenu.class); startActivity(intent); //Toast.makeText(getApplicationContext(),"Login Successful", Toast.LENGTH_SHORT).show();// }else{ Toast.makeText(getApplicationContext(),"Error" , Toast.LENGTH_SHORT).show(); } } } }); btn2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sign_up(); } }); forgot.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { forgot(); } }); } private void sign_up() { Intent intent= new Intent(MainActivity.this, signup.class); startActivity(intent); } private void forgot() { Intent intent= new Intent(MainActivity.this, forgot.class); startActivity(intent); } } ``` This is the signup.java class ``` package com.example.moviesinfo; import android.content.ContentValues; import android.content.Intent; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import java.lang.String; import java.util.ArrayList; public class signup extends AppCompatActivity { SQLiteOpenHelper openHelper; DatabaseHelper db; SQLiteDatabase db1; public String uname = ""; public String pwd = ""; public ArrayList<String> cpwd = new ArrayList<String>(); EditText e1, e2, e3; Button b1,b2; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_signup); openHelper= new DatabaseHelper(this); e1 = (EditText) findViewById(R.id.username); e2 = (EditText) findViewById(R.id.password); e3 = (EditText) findViewById(R.id.cpwd); b1 = (Button) findViewById(R.id.save); b2 = (Button) findViewById(R.id.login2); b1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { db1=openHelper.getWritableDatabase(); String username =e1.getText().toString(); String password =e2.getText().toString(); String confirm_password =e3.getText().toString(); insert_data(username,password,confirm_password); } }); b2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(signup.this,MainActivity.class); startActivity(intent); } }); } public void insert_data(String username, String password, String confirm_password) { ContentValues contentValues = new ContentValues(); contentValues.put(DatabaseHelper.COL2, username); contentValues.put(DatabaseHelper.COL3, password); contentValues.put(DatabaseHelper.COL4, confirm_password); long id=db1.insert(DatabaseHelper.TABLENAME, null, contentValues); } } ``` This is the DatabseHelper.java class ``` package com.example.moviesinfo; import com.example.moviesinfo.signup; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; public class DatabaseHelper extends SQLiteOpenHelper { public static final String DATABASE_NAME="userdetails.db"; public static final String TABLENAME="user details"; public static final String COL1="id"; public static final String COL2="username"; public static final String COL3="password"; public static final String COL4="confirmpassword"; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null,1); } @Override public void onCreate(SQLiteDatabase db) { db.execSQL("CREATE TABLE " + "TABLENAME(ID INTEGER PRIMARY KEY AUTOINCREMENT,USERNAME TEXT,PASSWORD TEXT,CONFIRMPASSWORD TEXT)"); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS " +TABLENAME); onCreate(db); } } ``` I expect that when i click the login button it should jump to next activity with checking the login details from the database.
<java><android><android-sqlite>
2019-05-17 06:23:14
LQ_EDIT
56,181,440
How to add country flag in the html input tag?
<p>I want to add country flag in html input tag and yeah bootstrap helper can do it. But i do not know how to add the links and scripts exactly that would solve my issue. So any help ?</p>
<php>
2019-05-17 07:17:39
LQ_CLOSE
56,182,800
Programming language to write logic for microsoft sql server
I've been using microsoft sql server to write queries. I was browsing online and i found that python and c# can be used to write query logic as well. I was wondering is it more efficient to use another programming language instead of SQL for microsoft sql server?
<sql-server>
2019-05-17 08:46:38
LQ_EDIT
56,184,230
My python magic 8ball program isn't using my if statements?
<p>I am currently creating this magic 8ball program that should tell whether the question the user input starts with ("Should, is, am ,what, can, why..etc"). It then randomly chooses through a list and prints a str suitable to the question. </p> <p>However.. It doesn't use the if statements I've written and only prints "I dont quite know..".</p> <p>I've tried remaking the program differently - no success I've tried using different methods to get the first word of a str - no success.</p> <p>Here is my code:</p> <pre><code> import random, time, os what = ("Your answer is mine!", "I don't quite know..", "Who knows...") should = ("Yes, yes you should..", "Don't, please don't", "Okay...") isvar = ("I believe so.", "No, not at all.....") amvar = ("Yes, definetly", "No, not at all.....") whyvar = ("Your answer is mine...", "I dont quite know..") can = ("Yes, indeed", "No.... Idiot!", "Im not sure..") question = input("The answer resides within your question, which is..?\n:") first, *middle, last = question.split() rwhat = random.choice(what) rshoud = random.choice(should) ris = random.choice(isvar) ram = random.choice(amvar) rwhy = random.choice(whyvar) rcan = random.choice(can) first = str(first) if (first) == "what" or "What": print (rwhat) time.sleep(1) os.system('pause') elif (first) == "should" or "Should": print (rshoud) time.sleep(1) os.system('pause') elif (first) == "is" or "Is": print (ris) time.sleep(1) os.system('pause') elif (first) == "am" or "Am": print (ram) time.sleep(1) os.system('pause') elif (first) == "why" or "Why": print (rwhy) time.sleep(1) os.system('pause') elif (first) == "can" or "Can": print (rcan) time.sleep(1) os.system('pause') </code></pre> <p>it should run correctly.</p>
<python>
2019-05-17 10:09:40
LQ_CLOSE
56,184,558
combining select statements with dates
Please help me, I want my sql Select statement combine in one query <?php Total Assigned = SELECT date(DATE_DISTRIBUTE) , COUNT(DATE_DISTRIBUTE) AS TotalAssigned FROM ata_report_extracted WHERE STATUS ='DISTRIBUTED' GROUP BY date(DATE_DISTRIBUTE) "; Total Handled = "SELECT date(DATE_HANDLED) , COUNT(DATE_HANDLED) AS TotalHandled FROM ata_report_extracted WHERE PROS_DESCRIPTION NOT IN ('Open', 'Acknowledged', 'Fallout', 'Cleared') AND STATUS ='DISTRIBUTED' GROUP BY date(DATE_HANDLED) "; Total Resolved ="SELECT date(DATE_HANDLED) , COUNT(DATE_HANDLED) AS TotalResolved FROM ata_report_extracted WHERE PROS_DESCRIPTION = 'Closed' AND STATUS ='DISTRIBUTED' GROUP BY date(DATE_HANDLED) "; TotalDispatch ="SELECT date(DATE_HANDLED) , COUNT(DATE_HANDLED) AS TotalDispatch FROM ata_report_extracted WHERE PROS_DESCRIPTION ='Dispatch' AND STATUS ='DISTRIBUTED' GROUP BY date(DATE_HANDLED) "; TotalPending ="SELECT date(DATE_HANDLED) , COUNT(DATE_HANDLED) AS TotalPending FROM ata_report_extracted WHERE PROS_DESCRIPTION IN ('TOKUNDEROB', 'CALLNOANSWER') AND STATUS ='DISTRIBUTED' GROUP BY date(DATE_HANDLED) "; ?> <?php Total Assigned = SELECT date(DATE_DISTRIBUTE) , COUNT(DATE_DISTRIBUTE) AS TotalAssigned FROM ata_report_extracted WHERE STATUS ='DISTRIBUTED' GROUP BY date(DATE_DISTRIBUTE) "; Total Handled = "SELECT date(DATE_HANDLED) , COUNT(DATE_HANDLED) AS TotalHandled FROM ata_report_extracted WHERE PROS_DESCRIPTION NOT IN ('Open', 'Acknowledged', 'Fallout', 'Cleared') AND STATUS ='DISTRIBUTED' GROUP BY date(DATE_HANDLED) "; Total Resolved ="SELECT date(DATE_HANDLED) , COUNT(DATE_HANDLED) AS TotalResolved FROM ata_report_extracted WHERE PROS_DESCRIPTION = 'Closed' AND STATUS ='DISTRIBUTED' GROUP BY date(DATE_HANDLED) "; TotalDispatch ="SELECT date(DATE_HANDLED) , COUNT(DATE_HANDLED) AS TotalDispatch FROM ata_report_extracted WHERE PROS_DESCRIPTION ='Dispatch' AND STATUS ='DISTRIBUTED' GROUP BY date(DATE_HANDLED) "; TotalPending ="SELECT date(DATE_HANDLED) , COUNT(DATE_HANDLED) AS TotalPending FROM ata_report_extracted WHERE PROS_DESCRIPTION IN ('TOKUNDEROB', 'CALLNOANSWER') AND STATUS ='DISTRIBUTED' GROUP BY date(DATE_HANDLED) "; ?> Display total reports daily in one query
<php><sql><database>
2019-05-17 10:28:31
LQ_EDIT
56,185,370
Not able to run the application
Not able to run the application. Get Error: The remote Debugger was unable to locate a resource dll (vsdebugeng.impl.resources.dll). please ensure that the complete remote debugger folder was copied or installed on the target computer.
<asp.net><remote-debugging>
2019-05-17 11:20:03
LQ_EDIT
56,185,653
When to use 'config' level in logging
<pre><code>public static void main(String[] arg) { LOGGER.config(""); } </code></pre> <p>I visited many websites but i couldn't find an exact answer</p>
<java><logging>
2019-05-17 11:37:53
LQ_CLOSE
56,190,075
Flask python Send and Receive Images in Bytes
i try to send and receive image using python and flask Below is my current solution that does not work flask app = Flask(__name__) @app.route('/add_face', methods=['GET', 'POST']) def add_face(): if request.method == 'POST': # read encoded image imageString = base64.b64decode(request.form['img']) # convert binary data to numpy array nparr = np.fromstring(imageString, np.uint8) # let opencv decode image to correct format img = cv2.imdecode(nparr, cv2.IMREAD_ANYCOLOR); cv2.imshow("frame", img) cv2.waitKey(0) return "list of names & faces" if __name__ == '__main__': app.run(debug=True, port=5000) client URL = "http://localhost:5000/add_face" #first, encode our image with base64 with open("block.png", "rb") as imageFile: img = base64.b64encode(imageFile.read()) response = requests.post(URL, data={"name":"obama", "img":str(img)}) print(response.content) this the error is very bigger which that contain html script that i can not understand it return binascii.a2b_base64(s)\nbinascii.Error: Incorrect padding\n\n-->\n'
<python><opencv><flask>
2019-05-17 16:10:38
LQ_EDIT
56,191,415
Why is `git push --force-with-lease` failing with "rejected ... stale info" even when my local repo is up to date with remote?
<p>I'm trying to force push a rebase of a feature branch to a remote repository. To be a bit safer, I'm trying to use <code>--force-with-lease</code> to make sure no other changes have happened in the branch since I last fetched it.</p> <p>This is failing for reasons I don't understand:</p> <pre><code>$ git branch * my-branch master $ git push --force-with-lease origin my-branch -u To gitlab.com:example/my-project.git ! [rejected] my-branch -&gt; my-branch (stale info) error: failed to push some refs to 'git@gitlab.com:example/my-project.git' </code></pre> <p>I tried a fetch to see if my local cache had somehow gotten out of sync:</p> <pre><code>$ git fetch $ git push --force-with-lease origin my-branch -u To gitlab.com:example/my-project.git ! [rejected] my-branch -&gt; my-branch (stale info) error: failed to push some refs to 'git@gitlab.com:example/my-project.git' </code></pre> <p>I tried simplifying the push command a bit:</p> <pre><code>$ git push --force-with-lease To gitlab.com:example/my-project.git ! [rejected] my-branch -&gt; my-branch (stale info) error: failed to push some refs to 'git@gitlab.com:example/my-project.git' </code></pre> <p>I tried limiting the check to my branch:</p> <pre><code>$ git push --force-with-lease=my-branch:origin/my-branch To gitlab.com:example/my-project.git ! [rejected] my-branch -&gt; my-branch (stale info) error: failed to push some refs to 'git@gitlab.com:example/my-project.git' </code></pre> <p>As you can see, it fails the same way every time.</p> <p>Why is my push failing, and how do I fix it?</p>
<git><git-push>
2019-05-17 17:57:36
HQ
56,192,942
Uninitialized C structure field
<p>Is trying to access an uninitialized struct field in C considered undefined behavior?</p> <pre><code>struct s { int i; }; struct s a; printf("%d", a.i); </code></pre>
<c><struct><field><undefined-behavior>
2019-05-17 20:09:49
LQ_CLOSE
56,192,983
Android Studio is using this JDK location ... which is different to what Gradle uses by default
<p>After Android Studio sync my gradle project, I see the following message in the event log:</p> <blockquote> <p>Android Studio is using this JDK location: <code>/path/to/my/project/specific/jdk</code> which is different to what Gradle uses by default: <code>/path/to/android/studio/embedded/jdk</code> Using different locations may spawn multiple Gradle daemons if Gradle tasks are run from command line while using Android Studio. Set Android Studio to use the same JDK as Gradle and sync project</p> </blockquote> <p>I have <code>/path/to/my/project/specific/jdk</code> set in <code>Project Structure</code>-><code>SDK Location</code> -> <code>JDK Location</code> -> <code>Other</code> <a href="https://i.stack.imgur.com/8v3YH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8v3YH.png" alt="Project Structure -&gt; SDK Location -&gt; JDK Location -&gt; Other"></a></p> <p>I have the following in my <code>.bash_profile</code>:</p> <pre><code>export JAVA_HOME=/path/to/my/project/specific/jdk </code></pre> <p>and the <a href="https://developer.android.com/studio/command-line/variables#studio_jdk" rel="noreferrer"><code>STUDIO_JDK</code> documentation</a> says:</p> <blockquote> <p>Sets the location of the JDK with which to run Studio. When you launch Android Studio, it checks the <code>STUDIO_JDK</code>, <code>JDK_HOME</code>, and <code>JAVA_HOME</code> environment variables in that order.</p> </blockquote> <p>So I would expect that Android Studio would find <code>/path/to/my/project/specific/jdk</code>, but it doesn't. Is there a special JDK setting specifically for gradle?</p>
<android-studio><gradle><jvm>
2019-05-17 20:13:11
HQ
56,193,286
Python program to move mouse cursor doesn't work as expected
I'm creating a program that utilizes the win32api mouse_event to move the mouse cursor to a certain position. However, the program is not working as expected. Any help would be most appreciated. NOTE: I must use win32api and no other library. Take this program for example: import win32api x = 1000 y = 1000 win32api.mouse_event(0x0001, int(x), int(y)) It should move the mouse cursor to the 1000th x and y pixels on the screen but it doesn't.
<python><winapi><mouseevent>
2019-05-17 20:40:29
LQ_EDIT
56,194,168
How to change the text color of the button theme in Flutter
<p>If I add a theme to my app like this:</p> <pre><code>class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData( primaryColor: Color(0xff393e46), primaryColorDark: Color(0xff222831), accentColor: Color(0xff00adb5), backgroundColor: Color(0xffeeeeee), buttonTheme: ButtonThemeData( buttonColor: Color(0xff00adb5), ) ), home: Scaffold( body: MyHomePage(), ), ); } } </code></pre> <p>How do I change the text color for the button theme?</p>
<button><text><colors><flutter><themes>
2019-05-17 22:12:34
HQ
56,194,841
Looking for an explanation on the results of identity testing on integer variables in Python
<p>I have a simple code I stumbled upon on HyperSkill and was testing it on the Python console, both Python2 and Python3. The results confused me. </p> <pre><code>&gt;&gt;&gt; a = 5 &gt;&gt;&gt; b = 5 &gt;&gt;&gt; a == b True &gt;&gt;&gt; a is b True &gt;&gt;&gt; x = 1000 &gt;&gt;&gt; y = 1000 &gt;&gt;&gt; x == y True &gt;&gt;&gt; x is y False &gt;&gt;&gt; </code></pre> <p>I don't understand why the result of <code>a is b</code> is <code>True</code> and yet the result of <code>x is y</code> is (as expected) <code>False</code></p>
<python><boolean><logic><operators><identity>
2019-05-17 23:52:26
LQ_CLOSE
56,195,016
I have an insecure API (HTTP) that I'm trying to access and Chrome blocks the data. Any way to work around this?
<p>I'm working with an api that is formatted in XML and it hasn't been secured/received an SSL certificate (HTTPS). Is there a way to bypass this and display the data?</p> <p>I've tested to make sure it wasn't my code that was the problem. I'm using a simple fetch to output the code in my console. It works properly with other secure api's like the star wars api. </p> <pre><code> fetch(Url) .then(data =&gt; { return data.xml() }) .then(res =&gt; { console.log(res) }) I'm just trying to output basic data in either JSON or XML format </code></pre>
<javascript><json><xml><api>
2019-05-18 00:27:55
LQ_CLOSE
56,196,399
Is access to the heap serialized?
<p>One rule every programmer quickly learns about multithreading is: </p> <p><em>If more than one thread has access to a data structure, and at least one of threads might modify that data structure, then you'd better serialize all accesses to that data structure, or you're in for a world of debugging pain</em>. </p> <p>Typically this serialization is done via a mutex -- i.e. a thread that wants to read or write the data structure locks the mutex, does whatever it needs to do, and then unlocks the mutex to make it available again to other threads.</p> <p>Which brings me to the point: the memory-heap of a process is a data structure which is accessible by multiple threads. Does this mean that every call to default/non-overloaded <code>new</code> and <code>delete</code> is serialized by a process-global mutex, and is therefore a potential serialization-bottleneck that can slow down multithreaded programs? Or do modern heap implementations avoid or mitigate that problem somehow, and if so, how do they do it?</p> <p>(Note: I'm tagging this question <code>linux</code>, to avoid the correct-but-uninformative "it's implementation-dependent" response, but I'd also be interested in hearing about how Windows and MacOS/X do it as well, if there are significant differences across implementations)</p>
<c++><linux><multithreading><heap>
2019-05-18 06:00:38
HQ
56,196,973
Invalid value 'armeabi' in $(AndroidSupportedAbis). This ABI is no longer supported. Xamarin.Forms - VS2019
<p>I have a Mobile App built with Xamarin.Forms<br> when I am trying to upgrade my project from VS2017 to VS2019</p> <p>I get this error in <strong>Android Project</strong></p> <blockquote> <p>Invalid value 'armeabi' in $(AndroidSupportedAbis). This ABI is no longer supported. Please update your project properties </p> </blockquote> <p>I tried to delete <strong>bin</strong> and <strong>obj</strong> folders to force the project to rebuild everything, but the error still appears</p> <p><strong>Can I get an explanation about the error above and how to solve it?</strong></p> <p>Note: <strong>the error doesn't appear in VS2017</strong></p>
<xamarin><xamarin.forms><xamarin.android><build-error><visual-studio-2019>
2019-05-18 07:43:44
HQ
56,199,022
Convert Razor View to string ASP.NET core
<p>I want to send a view as email body, i'm using sendgrid. How do i convert view to string ?</p> <p>I got a code here <a href="https://long2know.com/2017/08/rendering-and-emailing-embedded-razor-views-with-net-core/" rel="nofollow noreferrer">https://long2know.com/2017/08/rendering-and-emailing-embedded-razor-views-with-net-core/</a></p> <pre><code> public string RenderToString&lt;TModel&gt;(string viewPath, TModel model) { try { var viewEngineResult = _viewEngine.GetView("Views/", viewPath, false); if (!viewEngineResult.Success) { throw new InvalidOperationException($"Couldn't find view {viewPath}"); } var view = viewEngineResult.View; using (var sw = new StringWriter()) { var viewContext = new ViewContext() { HttpContext = _httpContextAccessor.HttpContext ?? new DefaultHttpContext { RequestServices = _serviceProvider }, ViewData = new ViewDataDictionary&lt;TModel&gt;(new EmptyModelMetadataProvider(), new ModelStateDictionary()) { Model = model }, Writer = sw }; view.RenderAsync(viewContext).GetAwaiter().GetResult(); return sw.ToString(); } } catch (Exception ex) { throw new Exception("Error ending email.", ex); } } </code></pre> <p>This line say nullreference error</p> <pre><code>view.RenderAsync(viewContext).GetAwaiter().GetResult(); </code></pre>
<c#><asp.net-core><sendgrid-templates>
2019-05-18 12:38:44
LQ_CLOSE
56,199,111
Visual studio code cmd error: Cannot be loaded because running scripts is disabled on this system
<p>Inside of visual studio code, I'm trying to execute a script.bat from the command line, but I'm getting the following error:</p> <blockquote> <p>File C:\Theses_Repo\train-cnn\environment\Scripts\activate.ps1 cannot be loaded because running scripts is disabled on this system.</p> </blockquote> <p>After reading <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-6" rel="noreferrer">this</a> I tried to run the visual studio code in administrator mode, thinking that the problem was a matter of privileges. But the error is throwing anyway.</p>
<powershell><command-line><visual-studio-code><vscode-settings>
2019-05-18 12:51:27
HQ
56,199,176
Compilation Error for DEC Alpha CC compiler
I'm trying to compile source code, that from 2001, in Ubuntu 18.04.2 LTS. But, I got the errors below and actually don't know how I have to change the compiling code. Can you help me for compiling this code? Suggested compilation part from the program SUGGESTED COMPILATION COMMAND LINE (FOR A DEC-ALPHA CC-COMPILER): cc -lm -fast -tune host -arch host -assume whole_program \ -o mol_volume mol_volume.c When I tried this code, errors; cc: error: host: No such file or directory cc: error: host: No such file or directory cc: error: whole_program: No such file or directory cc: error: unrecognized command line option ‘-fast’; did you mean ‘-Ofast’? cc: error: unrecognized command line option ‘-tune’; did you mean ‘-mtune=’? cc: error: unrecognized command line option ‘-arch’; did you mean ‘-march=’? cc: error: unrecognized command line option ‘-assume’; did you mean ‘-msse’? Then, I changed `-fast`, `-tune`, `-arch`, `-assume` flags with `-Ofast`, `-mtune=native`, `-march=native`, `-msse` then add the path the for the directory part of the errors. cc -lm -Ofast -mtune=native -march=native -msse /mypath/ -o mol_volume mol_volume.c Then, I got that error; mol_volume.c: In function ‘main’: mol_volume.c:235:10: warning: implicit declaration of function ‘gets’; did you mean ‘fgets’? [-Wimplicit-function-declaration] while( gets(s) ) { ^~~~ fgets mol_volume.c:311:26: warning: format ‘%i’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] printf("WARNING: the %i-th atom of the pdb file %s has an unknown chemical type %s.\n", ~^ %li i+1, pdb_name, atom_type); ~~~ /usr/bin/ld: cannot find .: File format not recognized collect2: error: ld returned 1 exit status You can access the source code via this link; [Source Code][1] Thank you. ***My PC info:*** **Operation System**: Ubuntu 18.04.2 LTS **Kernel ver.:** 4.15.0-50-generic **GCC ver.:** 7.4.0 [1]: http://www.ks.uiuc.edu/Development/MDTools/molvolume/
<c><compiler-errors><compilation>
2019-05-18 13:00:10
LQ_EDIT
56,200,053
Java Runnable Interface Solution
<p>Can some one please explain the below Code</p> <pre><code>public class TestThread implements Runnable { public static void main(String[] args) { Thread thread = new Thread(new TestThread()); thread.start(); System.out.println("1"); thread.run(); System.out.println("2"); } @Override public void run() { System.out.println("3"); } } </code></pre> <p>The output results in 1 3 3 2.Can some one please explain.</p> <p>Thanks in Advance</p>
<java><multithreading>
2019-05-18 14:51:24
LQ_CLOSE
56,200,268
Compare Two String With Optional Characters
consider we have a function (in Django || python) which compares two strings, one is the correct answer and another is student answered string. correct = '(an) apple (device)' student_answerd = 'apple device' I want to check student_answered with the correct string but parentheses are optional it means all the below student_answered is correct: case 1: an apple device case 2: an apple case 3: apple device notice: we don't have the same correct format for all questions it means the location of parentheses is different for example maybe we just have one parentheses or more.
<python><regex><django><string-comparison><regex-greedy>
2019-05-18 15:17:11
LQ_EDIT
56,200,419
CS50 Credit Bug
I am working on the credit problem of CS50. However, I am only printing INVALID no matter what card number I put in. May I ask what is the problem with my code? It seems that there is something wrong with the part to calculate the total sum. #include <cs50.h> #include <stdio.h> #include <math.h> int main(void) { // Get the card number long num; do { num = get_long("What is the card number?\n"); } while (num < 0); long sum = 0, sum2 = 0, count = 0; //Get the sum for (long i = num; i > 0; i = i / 10) { sum += i % 10; count++; } for (long i = num / 10; i > 0; i = i / 100) { sum2 += i % 10; } if ((sum + sum2) % 10 != 0) { printf("INVALID"); } else { long digits = num / (10 * (count - 2)); if (count == 15 && (digits == 34 || digits == 37)) { printf("AMERICAN EXPRESS"); } else if (count == 16 && 51 <= digits <=55) { printf("MASTERCARD"); } else if ((count == 16 || count == 13) && (digits / 10) == 4) { printf("VISA"); } else { printf("INVALID"); } } }
<c><validation><credit-card><cs50><luhn>
2019-05-18 15:34:56
LQ_EDIT
56,200,878
Why does modulus return these values?
<p>5%5 is 0</p> <p>5%4 is 1</p> <p>5%3 is 2</p> <p>5%2 is 1</p> <p>5%1 is 0</p> <p>Why is that? From my understanding modulus just prints out whether or not it has a remainder but I'm apparently wrong here.</p> <p>also 5%10 prints out 5, and "%10" seems to consistently print out the last number of any value. 123%10 is 3 for some reason.</p> <p>What's the deal here?</p> <pre><code>x = 5%2; y = 123%10; </code></pre>
<c>
2019-05-18 16:32:06
LQ_CLOSE
56,201,054
How to toggle class when input lenght is not 0
how to add class when input [type="email"] has lenght > 0 and remove class if input lenght = 0? Im not so good in javascript. The solution can be in vue.js or pure javascript. I tried a few examples from the Internet, but without success. ``` <div class="form-group"> <input type="email" name="email" required> <label for="email">Email</label> </div> ``` - add class if input lenght > 0 - remove class if input lenght = 0
<javascript><vue.js><input>
2019-05-18 16:55:25
LQ_EDIT
56,204,573
Why JVM doesn't throw any compile time error for not initializing local variable if a local variable is declared like this int a=10,b=3,m;?
I am trying to execute the below code: public class HelloWorld{ public static void main(String []args){ int a=10,b=3,m; System.out.println("Hello World "+a+" " + b); } } I was expecting a compilation error for not initializing local variable 'm' but the program ran successfully and gave me the output. Why is it so ? I was thinking in all the cases if the local variable is not initialized JVM will throw an error. When I try to execute the code given below public class HelloWorld{ public static void main(String []args){ int a=10,b=3,m; System.out.println("Hello World "+a+" " + b + " " +m); } } Here I am calling the value of 'm' and I am getting error for not initializing local variable. But why doesn't java throw error in the first case?
<java><initialization><local-variables>
2019-05-19 03:39:55
LQ_EDIT
56,204,749
How i free/deallocate the memory for a std::map properly
I need to free (to avoid memory leaks) the all allocated memory for following C code(std::map , both key & value created by using 'new'). int main() { std::map<char*, char*> *mp = new std::map<char*, char*>; char *a = new char; a = (char*)"abc"; char *b = new char; b = (char*)"pqr"; mp->insert(std::pair<char*, char*>(a, b)); a = NULL , b = NULL; // no extra pointers to keys now // printf("element : %s", (*mp)["abc"]); // working /* need to free the allocated memory by the map in here properly, clear() & erase() are ok ? , bcoz i think, need some 'delete's */ }
<c++><memory-management><memory-leaks>
2019-05-19 04:27:27
LQ_EDIT
56,204,975
Advice on how to design a component
<p>I'm new to react (in the sense that I haven't ever completed a project I've started), and trying to get a more solid idea of the workflow of building components.</p> <p>I've cloned this project: <a href="https://github.com/bjones256/facebook-clone" rel="nofollow noreferrer">https://github.com/bjones256/facebook-clone</a></p> <p>The component I'm trying to make is a "score" component that will be listed on a user's profile. The score will be calculated by a combination of the amount of views and likes on the users posts.</p> <p>I don't expect it to be done for me, but moreso I would like advice on the thought process behind how this component could be designed.</p> <p>Currently I'm not seeing which functions count the amount of likes/comments on a post so that set them in the constructor for the score component. Any advice? I would use codementor, but I'm broke right now :P</p>
<javascript><reactjs><react-redux>
2019-05-19 05:18:46
LQ_CLOSE
56,205,004
.sqlite file no more available in documents folder - Swift 5
<p>The sqlite file related to coredata is no more available in the documents directory.</p> <p>Found it is present inside <code>/Library/Application Support</code></p> <p>How to search for that url in proper way?</p>
<ios><swift><core-data>
2019-05-19 05:25:58
LQ_CLOSE
56,205,640
unable to add firebase authentication to my app
I've successfully connected to firebase but when i click on "Add Firebase Authentication to your app " and click on accept changes nothing is happening Iam not getting any errors as well as Iam not getting the message "dependecies added succesfully". I've checked the gradle section of my app and the dependencies are added correctly but iam not getting the green star saying "dependencies added succesfully". These are the dependencies that have been added to my project dependencies { classpath 'com.android.tools.build:gradle:3.4.1' classpath 'com.google.gms:google-services:4.2.0' }[enter image description here][1] [1]: https://i.stack.imgur.com/AMEMt.png
<android><firebase><firebase-authentication>
2019-05-19 07:27:12
LQ_EDIT
56,206,847
I need help in creating a struct based on the following json code to parse it successfully
I am new to swift and am encountering problems in parsing a local json file. Every time I try to decode the file, the following error pops up. keyNotFound(CodingKeys(stringValue: "users", intValue: nil), Swift.DecodingError.Context(codingPath: [], debugDescription: "No value associated with key CodingKeys(stringValue: \"users\", intValue: nil) (\"users\").", underlyingError: nil)). Can someone please tell me how to structure my struct in order to parse the data? { "Users": [{ "name": "John", "username": "john1", "id": 1 }, { "name": "Smith", "username": "Sm2", "id": 2 }, { "name": "Nishanta", "username": "nisacharya", "id": 3 } ] }
<swift>
2019-05-19 10:20:23
LQ_EDIT
56,208,710
A problematic if statement in Javascript
I have an if statement with two conditions and an or operator between them, it evaluates to be true after only one condition. because I used the || operator it checks the first condition and if it is true it will go into the if statement without checking the second one. if (checkPassword() == true || checkUserName() == true) evenet.preventDefault(); I expect it to go into the checkUserName function because there are crucial things in it that needs to be done, I can do it the long way but it will be cool if there is a way to make the if statement check the second condition even though it has the || operator and that's how programming works ( as far as I know)
<javascript><if-statement>
2019-05-19 14:22:59
LQ_EDIT
56,210,044
passing slice as a reference to reflect changes in caller
<p>main declares a slice with name <code>allOutputs</code> (i believe its a slice of strings, not an array of strings) with zero length and 100 capacity. Then it appends a string with value "abcd" and calls myTest function which updates the array[0] with "1234" and then does an append with value "5678".</p> <p>When i printed <code>allOutputs</code> after <code>myTest</code> call, i correctly see the element at the first index has an updated value of "1234". This tells me that myTest got slice as reference. But the later <code>append</code> of <code>"5678"</code> is not seen by the caller (main here) at all why its so? Remember the original slice is backed by an array with a capacity of 100. Why can't i see 5678 in main when the slice is passed by a reference?</p> <p>In other words, how exactly the append works?</p> <pre><code>import "fmt" func myTest(array []string) { array[0] = "1234" array = append(array, "5678") } func main() { allOutputs := make([]string, 0, 100) allOutputs = append(allOutput, "abcd") fmt.Println(allOutputs) // Println1 myTest(allOutputs) fmt.Println(allOutputs) // Println2 } </code></pre> <p>ACTUAL OUTPUT: [1234]</p> <p>I EXPECTED: [1234, 5678]</p>
<arrays><go><append><slice>
2019-05-19 16:53:18
LQ_CLOSE
56,210,479
count only if field is filled
I have a question about an sql query i want to make. Supose i have an column with the follow values in table: school with column: grades. SUI grades | Score 2 9 2 2 9 5 4 1 5 4 1 5 4 6 1 1 6 1 Now i wan't an output where it groups the SUI that counts grades only if Score is filled. So my output will be: SUI Count 2 1 4 2 6 1
<mysql><sql>
2019-05-19 17:50:15
LQ_EDIT
56,211,215
Why does my keras LSTM model get stuck in an infinite loop?
<p>I am trying to build a small LSTM that can learn to write code (even if it's garbage code) by training it on existing Python code. I have concatenated a few thousand lines of code together in one file across several hundred files, with each file ending in <code>&lt;eos&gt;</code> to signify "end of sequence".</p> <p>As an example, my training file looks like:</p> <pre><code> setup(name='Keras', ... ], packages=find_packages()) &lt;eos&gt; import pyux ... with open('api.json', 'w') as f: json.dump(sign, f) &lt;eos&gt; </code></pre> <p>I am creating tokens from the words with:</p> <pre><code>file = open(self.textfile, 'r') filecontents = file.read() file.close() filecontents = filecontents.replace("\n\n", "\n") filecontents = filecontents.replace('\n', ' \n ') filecontents = filecontents.replace(' ', ' \t ') text_in_words = [w for w in filecontents.split(' ') if w != ''] self._words = set(text_in_words) STEP = 1 self._codelines = [] self._next_words = [] for i in range(0, len(text_in_words) - self.seq_length, STEP): self._codelines.append(text_in_words[i: i + self.seq_length]) self._next_words.append(text_in_words[i + self.seq_length]) </code></pre> <p>My <code>keras</code> model is:</p> <pre><code>model = Sequential() model.add(Embedding(input_dim=len(self._words), output_dim=1024)) model.add(Bidirectional( LSTM(128), input_shape=(self.seq_length, len(self._words)))) model.add(Dropout(rate=0.5)) model.add(Dense(len(self._words))) model.add(Activation('softmax')) model.compile(loss='sparse_categorical_crossentropy', optimizer="adam", metrics=['accuracy']) </code></pre> <p>But no matter how much I train it, the model never seems to generate <code>&lt;eos&gt;</code> or even <code>\n</code>. I think it might be because my LSTM size is <code>128</code> and my <code>seq_length</code> is 200, but that doesn't quite make sense? Is there something I'm missing?</p>
<python><tensorflow><keras><neural-network><lstm>
2019-05-19 19:17:58
HQ
56,211,783
Translate c# to VB.NET
I am trying to use code from [here][1] but my project is VB.NET I tried few online converters but without much success. C# version works great but not VB.NET one. What might be the problem ? [1]: https://stackoverflow.com/questions/32961051/convert-nested-json-to-csv My VB.NET version Dim arr As JArray = Nothing Dim obj As JObject = Nothing Try arr = JArray.Parse(json) Catch End Try If arr Is Nothing Then obj = JObject.Parse(arr.ToString()) Else json = "{ Response: [" & json & "]}" obj = JObject.Parse(json) End If Dim values = obj.DescendantsAndSelf().OfType(Of JProperty)().Where(Function(p) TypeOf p.Value Is JValue).GroupBy(Function(p) p.Name).ToList() Dim columns = values.[Select](Function(g) g.Key).ToArray() Dim parentsWithChildren = values.SelectMany(Function(g) g).SelectMany(Function(v) v.AncestorsAndSelf().OfType(Of JObject)().Skip(1)).ToHashSet() Dim rows = obj.DescendantsAndSelf().OfType(Of JObject)().Where(Function(o) o.PropertyValues().OfType(Of JValue)().Any()).Where(Function(o) o = obj OrElse Not parentsWithChildren.Contains(o)).[Select](Function(o) columns.[Select](Function(c) o.AncestorsAndSelf().OfType(Of JObject)().[Select](Function(parent) parent(c)).Where(Function(v) TypeOf v Is JValue).[Select](Function(v) CStr(v)).FirstOrDefault()).Reverse().SkipWhile(Function(s) s Is Nothing).Reverse()) Dim csvRows = {columns}.Concat(rows).[Select](Function(r) String.Join(",", r)) Dim csv = String.Join(vbLf, csvRows)
<c#><json><vb.net><linq>
2019-05-19 20:34:10
LQ_EDIT
56,211,844
Flutter-Web: Mouse hover -> Change cursor to pointer
<p>How can the cursor appearance be changed within Flutter? I know that with the <a href="https://api.flutter.dev/flutter/widgets/Listener-class.html" rel="noreferrer">Listener()</a> Widget we can listen for Mouse-Events, but I haven't found any information regarding hovering events for flutter web.</p> <p>Has someone found a soulution yet?</p>
<flutter><flutter-web>
2019-05-19 20:44:18
HQ
56,212,407
Angular material textarea
How to scale height of textarea (mat-form-field) to 100% of the content? I tried height: 100% in every element inside directive, and it does not work.
<css><angular><angular-material><textarea>
2019-05-19 22:10:55
LQ_EDIT
56,212,866
Is it possible to delete all registry keys that can be deleted without being stopped by one undeletable key using C#?
When you use the Registry Editor GUI to delete keys and you delete a subkey tree with undeletable keys inside it (e.g. key in use, insufficient permission), it will try to delete what it can without the undeletable keys stopping the operation. This does not seem to be the case with the Microsoft.Win32 library in C#. Using an external program like reg.exe works, but I'm trying to look for a solution that does not require an external application. private void DelHKLM() { try { using (RegistryKey desiredKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", true)) { desiredKey.DeleteSubKeyTree("Policies"); } } } The anticipated result is for the program to not give any exceptions and delete the subkey tree "Policies", but instead, it throws an "UnauthorizedAccessException" because the keys are in use. Note: I am running my program as Administrator and I do have permissions to the key as demonstrated through the registry editor. So, my question is: **Is there any way to achieve what the Registry Editor does in C#, preferably using native libraries?**
<c#><.net><winforms><registry>
2019-05-19 23:36:17
LQ_EDIT
56,212,963
How to nake a Discussion forum or Q&A forum?
<p>"Iam creating website for youngsters, but i want to add a discussion and Q&amp;A forum at site. how can attach those facilities in my website?"</p>
<javascript><php><html>
2019-05-20 00:02:03
LQ_CLOSE
56,213,308
How to transform a data frame in structured streaming?
I am testing structured streaming using localhost from which it reads streams of data. Input streaming data from localhost: ID Subject Marks 1 Maths 85 1 Physics 80 2 Maths 70 2 Physics 80 I would like to get the average marks for each unique ID's. I tried this but not able to transform the DF which is a single value. Below is my partial code: from pyspark.sql import SparkSession from pyspark.sql.functions import * from pyspark.sql.types import * spark = SparkSession.builder.appName("SrteamingMarks").getOrCreate() marks = spark.readStream.format("socket").option("host", "localhost").option("port", 9999).load() marks.printSchema() root |-- value: string (nullable = true) My expected output is just 2 columns (ID and Average Marks) ID Average Marks 1 82.5 2 75
<python><apache-spark><apache-spark-sql><spark-structured-streaming>
2019-05-20 01:13:56
LQ_EDIT
56,213,573
Cpp/C++ - Is this an alternative to tolower?
I was solving a very easy problem to convert a character in a string to lowercase, I obviously used tolower(). However, I saw someone use this and it was an accepted solution. **Is this an alternative to tolower() function in cpp? If so, why?** Reference to the problem: https://atcoder.jp/contests/abc126/tasks/abc126_a #include <iostream> using namespace std; int main(int argc, char const *argv[]) { // We want to convert "ABC" to "aBC" string S = "ABC"; S[0] += 0x20; // Returns "aBC" cout << S << endl; return 0; }
<c++><hex>
2019-05-20 02:06:19
LQ_EDIT
56,213,937
Do i always need to use a container/container fluid in bootstrap?
<p>I was watching this video and the instructor said that bootstrap requires us to use a container/container fluid when using the grid system. However, she failed to always use a container even when she used the grid system. If you have 1 row and a bunch of columns that you make responsive, does that mean you are still using the grid system or does there need to be more than 1 row, since thats the case she didnt use a container and i was confused as to why she did not when bootstrap states we should use a container? I am a bit confused as when i should use a container in general and more importantly lets say i do not use a container and just use the grid system, what will end up happening?</p>
<html><css><bootstrap-4>
2019-05-20 03:23:35
LQ_CLOSE
56,215,837
What is the point of using SubSink instead of a Subscriptions array
<p>I just watched a ngConf video of John Papa talking about SubSink as a best practice in order to unsubscribe from obversables.</p> <p>I was actually using Subscriptions[] then push subscriptions into it then forEach unsubscribe at cmp destroy.</p> <p>Is their something I missed or is it just a readability improvment to use SubSink ?</p>
<typescript><rxjs><observable><rxjs6>
2019-05-20 07:06:36
HQ
56,217,066
How to make insert and update from different table in one Mysql query with php
Ive tried the code below but it didnt work if (isset($_POST['ubah'])) { $queryUpdate = mysqli_multi_query("INSERT INTO perbaikan SET id_perbaikan = '',idrusakbaik = '" . $id . "',komenrusak = '" . $_POST['komenrusak'] . "',tglbaik = '" . $tgl_sekarang . "'; UPDATE kerusakan SET status = '" . $_POST['status'] . "'WHERE id_kerusakan = '" . $id . "'"); if ($queryUpdate) { echo "<script> alert('Data Berhasil Disimpan'); location.href='index.php?hal=master/perbaikan-mekanik/list' </script>"; exit; } }
<php><mysql><mysqli>
2019-05-20 08:33:10
LQ_EDIT
56,217,572
The SQL Server Network Interface library could not deregister the Service Principal Name (SPN)
<p>I've set up a SQL Server service account with permissions to read and write service principal names. When SQL Server starts up I get the expected message in the logs showing that the service account has successfully registered the SPN:</p> <blockquote> <p>The SQL Server Network Interface library successfully registered the Service Principal Name (SPN) [MySPN] for the SQL Server service.</p> </blockquote> <p>Connections to the database server use Kerberos authentication as expected and all seems well.</p> <p>However, when I shut down SQL Server a message is entered in the logs showing that the SPN could not be deregistered:</p> <blockquote> <p>The SQL Server Network Interface library could not deregister the Service Principal Name (SPN) [MySPN] for the SQL Server service. Error: 0x6d3, state: 4. Administrator should deregister this SPN manually to avoid client authentication errors.</p> </blockquote> <p>I've checked that there are no duplicate SPNs and checked that the SPN is registered to the correct service account, and only to that account. The server has been rebooted several times. Microsoft's Kerberos Config Manager doesn't offer any insight.</p> <p>I don't understand why the service account would be permitted to create the SPN but not permitted to delete it.</p>
<sql-server><sql-server-2014><kerberos><spn>
2019-05-20 09:03:42
HQ
56,219,277
VBA coding dobut
can anyone help me im now doing useform and some calculations through excel vba i want to input a value into textbox and want to convert corresponding unit in another text box instantly without any button eg flow rate in LPM(Liter per minute ) i want to convert it into gallon per minute 1LPM=0.2641 IF I TYPE 10LPM I WANT THE RESULT IN SECOND TEXT BOX AS (10*0.2641) as result
<excel><vba>
2019-05-20 10:44:03
LQ_EDIT
56,220,691
How do I open an external url in flutter web in new tab or in same tab
<p>I have a simple web app I have created with flutter web. I would like to know how I can open new an <code>external url</code> either in a <code>new tab</code> or in <code>the same tab</code> in my flutter web app. say I want to open the url <a href="https://stackoverflow.com/questions/ask">https://stackoverflow.com/questions/ask</a></p>
<dart><flutter><flutter-web>
2019-05-20 12:05:46
HQ
56,221,406
How to write into a cvs?
I want to write all the file names into a comma separated csv file. I have tried this, but it separate all the characters, not only the whole file names. for filename in filenames: with open('C:\Users\igyulavics\Desktop\estfile.csv', 'w') as csvFile: a = (os.path.join(dirname, filename)) print a writer = csv.writer(csvFile) writer.writerows(a) csvFile.close() So it gives back: c,Users,1, etc but I want this: c:\Users\1,c:\Users\2
<python><csv>
2019-05-20 12:51:09
LQ_EDIT
56,221,429
How to create array from string in javascript
<p>I have a string like below</p> <pre><code> Ontario;Northwest Territories;Nunavut;Prince Edward Island </code></pre> <p>from this string I need to create an array of string like</p> <pre><code> territoty:Array&lt;string&gt; = [Ontario,Northwest Territories,Nunavut,Prince Edward Island] </code></pre> <p>in javascript.</p> <p>How can I create the array from the string?</p>
<javascript>
2019-05-20 12:52:45
LQ_CLOSE
56,221,470
Signal/Method for every executed sql statement
<p>According to this 12 years old issue, django does not support a signal for every executed sql statement: <a href="https://code.djangoproject.com/ticket/5415" rel="noreferrer">https://code.djangoproject.com/ticket/5415</a></p> <p>I need this in a production environment where debug=False.</p> <p>This means overwriting connection.queries does not work.</p> <p>Is there a way to run some custom code after each sql statement (even if debug=False)?</p>
<django>
2019-05-20 12:55:37
HQ
56,222,259
ValueError: Unknown projection '3d' (once again)
<p><strong>Context:</strong> using Spyder version 3.3.4</p> <p>When executing this line of code:</p> <pre><code>import matplotlib.pyplot as plt #your code fig = plt.figure() ax = fig.gca(projection='3d') </code></pre> <p>I have an output error:</p> <pre><code>raise ValueError("Unknown projection %r" % projection) ValueError: Unknown projection '3d' &lt;Figure size 432x288 with 0 Axes&gt; </code></pre> <p>The same program is running on an old laptop where </p> <pre><code>print('matplotlib: {}'.format(matplotlib.__version__)) </code></pre> <p>While on a new machine:</p> <pre><code>print('matplotlib: {}'.format(matplotlib.__version__)) matplotlib: 1.5.0rc3 </code></pre> <p>A similar error was reported in <a href="https://stackoverflow.com/questions/3810865/matplotlib-unknown-projection-3d-error">this question (Stackoverflow)</a> but the answers do not help. Some suggestion on how to modify the instruction? matplotlib: 3.0.2</p>
<python><matplotlib><3d><conda><spyder>
2019-05-20 13:45:14
HQ
56,223,486
How can I create an button effect with javascript and jquery?
<p>I am trying to create a button effect in which will change its color on click and returns to its original colour after the click.</p> <p>I made a conditional within the button effect to returns to its original code but it doesn't work. Here is the code below:</p> <pre><code>let blueBtnAudio = new Audio('https://s3.amazonaws.com/freecodecamp/simonSound1.mp3'); let redBtnAudio = new Audio('https://s3.amazonaws.com/freecodecamp/simonSound2.mp3'); let yellowBtnAudio = new Audio('https://s3.amazonaws.com/freecodecamp/simonSound3.mp3'); let greenBtnAudio = new Audio('https://s3.amazonaws.com/freecodecamp/simonSound4.mp3'); // VARIABLES - DOM QUERIES const btnBlue = document.querySelectorAll("#btnBlue"); const btnGreen = document.querySelectorAll("#btnGreen"); const btnRed = document.querySelectorAll("#btnRed"); const btnYellow = document.querySelectorAll("#btnYellow"); $(btnBlue).click(function() { $(this).css('background-color', '#00FFFF'); blueBtnAudio.play(); if(btnBlue == '#00FFFF' ){ $(btnBlue).stop(); } }); </code></pre>
<javascript><jquery>
2019-05-20 14:55:08
LQ_CLOSE
56,224,091
what are inheritAttrs:false and $attrs used for in vue?
<p>As the question suggests, I can't figure out their meaning and why I should use it. It's said that it can be used so that when we have many components and we want to pass data from parent to the child's child's child's component, we don't have to use props. Is this true?</p> <p>It'd be nice If you could provide an easier example. Vue.js docs don't mention much.</p>
<vue.js><vuejs2><vue-component>
2019-05-20 15:34:00
HQ
56,224,987
Why is this not working? Can you help please?
import turtle as t t.setup(500,500) t.setworldcoordinates(0,0,500,500) t.pu() t.goto(0,0) t.pd() t.seth(0) def N(): t.pu() t.pd() def B(c,d): t.right(90) c t.forward(5) t.left(90) d t.forward(5) d t.left(90) t.forward(5) c t.right(90) def A(a,b): t.left(90) b t.forward(5) t.right(90) a t.forward(5) a t.right(90) t.forward(5) b t.left(90) t.seth(0) A(A(None,None),B(None,None)) > I'm Trying to make the Hilbert curve > But it is not working > I am using the l system > rsrgwerbwv > viewbviqe > nvenlvnqebfv > ndjvnlenbnwr > dnvonwvqe > ijdbvqepv p;e > nnweone[qro[nv > jdbdijvqejv > jsvjn[afb > njnvonadzb > ksnjvnasv
<python><python-2.7><turtle-graphics><fractals>
2019-05-20 16:37:31
LQ_EDIT
56,225,155
up to how much memory limit can be set POST method in PHP? Maximum how much?
<p>Normally 8mb is default memory limit of POST method..how much we can set? up to GB is possible or less than that? can we send large video of 4 gig through POST method? </p>
<php>
2019-05-20 16:50:01
LQ_CLOSE
56,227,634
C: Can anyone recommend a way to write a function that counts the number of fields in a struct? i.e. - sudocode- 'for field in struct'
I want a C function that I can pass a structure to and it will return the number of fields/members within the structure. At the moment I've found the easiest way is to just make a table and add to the table anytime I add a struct to any of the programs.
<c><for-loop><struct><introspection>
2019-05-20 20:18:47
LQ_EDIT
56,227,919
How to delete duplicate records in SQL?
<p>This my original table:</p> <p><a href="https://i.stack.imgur.com/zpd4S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zpd4S.png" alt="enter image description here"></a></p> <p>Intended table:</p> <p><a href="https://i.stack.imgur.com/0m2Lt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0m2Lt.png" alt="enter image description here"></a></p> <p>I can't add a new column to table. </p>
<sql><sql-server>
2019-05-20 20:42:08
LQ_CLOSE
56,228,222
How can I speed up my 3D Euclidean distance matrix code
<p>I have created code to calculate the distance of all objects (tagID) from one another based on x, y, z coordinates (TX, TY, TZ) at each time step (Frame). While this code does work, it is too slow for what I need. My current test data, has about 538,792 rows of data, my actual data will be about 6,880,000 lines of data. Currently it takes a few minutes (maybe 10-15) to make these distance matrices, and since I will have 40 sets of data, I woud like to speed thigs up.</p> <p>The current code is as follows:</p> <pre><code># Sample data frame with correct columns: data2 = ({'Frame' :[1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7], 'tagID' : ['nb1','nb2','nb3','nb1','nb2','nb3','nb1','nb2','nb3','nb1','nb2','nb3','nb1','nb2','nb3','nb1','nb2','nb3','nb1','nb2','nb3'], 'TX':[5,2,3,4,5,6,7,5,np.nan,5,2,3,4,5,6,7,5,4,8,3,2], 'TY':[4,2,3,4,5,9,3,2,np.nan,5,2,3,4,5,6,7,5,4,8,3,2], 'TZ':[2,3,4,6,7,8,4,3,np.nan,5,2,3,4,5,6,7,5,4,8,3,2]}) df = pd.DataFrame(data2) Frame tagID TX TY TZ 0 1 nb1 5.0 4.0 2.0 1 1 nb2 2.0 2.0 3.0 2 1 nb3 3.0 3.0 4.0 3 2 nb1 4.0 4.0 6.0 4 2 nb2 5.0 5.0 7.0 5 2 nb3 6.0 9.0 8.0 6 3 nb1 7.0 3.0 4.0 7 3 nb2 5.0 2.0 3.0 8 3 nb3 NaN NaN NaN 9 4 nb1 5.0 5.0 5.0 10 4 nb2 2.0 2.0 2.0 11 4 nb3 3.0 3.0 3.0 12 5 nb1 4.0 4.0 4.0 13 5 nb2 5.0 5.0 5.0 14 5 nb3 6.0 6.0 6.0 15 6 nb1 7.0 7.0 7.0 16 6 nb2 5.0 5.0 5.0 17 6 nb3 4.0 4.0 4.0 18 7 nb1 8.0 8.0 8.0 19 7 nb2 3.0 3.0 3.0 20 7 nb3 2.0 2.0 2.0 # Calculate the squared distance between all x points: TXdf = [] for i in range(1,df['Frame'].max()+1): boox = df['Frame'] == i tempx = df[boox] tx=tempx['TX'].apply(lambda x : (tempx['TX']-x)**2) tx.columns=tempx.tagID tx['ID']=tempx.tagID tx['Frame'] = tempx.Frame TXdf.append(tx) TXdfFinal = pd.concat(TXdf) # once all df for every print(TXdfFinal) TXdfFinal.info() # Calculate the squared distance between all y points: print('y-diff sum') TYdf = [] for i in range(1,df['Frame'].max()+1): booy = df['Frame'] == i tempy = df[booy] ty=tempy['TY'].apply(lambda x : (tempy['TY']-x)**2) ty.columns=tempy.tagID ty['ID']=tempy.tagID ty['Frame'] = tempy.Frame TYdf.append(ty) TYdfFinal = pd.concat(TYdf) print(TYdfFinal) TYdfFinal.info() # Calculate the squared distance between all z points: print('z-diff sum') TZdf = [] for i in range(1,df['Frame'].max()+1): booz = df['Frame'] == i tempz = df[booz] tz=tempz['TZ'].apply(lambda x : (tempz['TZ']-x)**2) tz.columns=tempz.tagID tz['ID']=tempz.tagID tz['Frame'] = tempz.Frame TZdf.append(tz) TZdfFinal = pd.concat(TZdf) # Add all squared differences together: euSum = TXdfFinal + TYdfFinal + TZdfFinal # Square root the sum of the differences of each coordinate for Euclidean distance and add Frame and ID columns back on: euDist = euSum.loc[:, euSum.columns !='ID'].apply(lambda x: x**0.5) euDist['tagID'] = list(TXdfFinal['ID']) euDist['Frame'] = list(TXdfFinal['Frame']) # Add the distance matrix to the original dataframe based on Frame and ID columns: new_df = pd.merge(df, euDist, how='left', left_on=['Frame','tagID'], right_on = ['Frame','tagID']) Frame tagID TX TY TZ nb1 nb2 nb3 0 1 nb1 5.0 4.0 2.0 0.0000 3.7417 3.0000 1 1 nb2 2.0 2.0 3.0 3.7417 0.0000 1.7321 2 1 nb3 3.0 3.0 4.0 3.0000 1.7321 0.0000 3 2 nb1 4.0 4.0 6.0 0.0000 1.7321 5.7446 4 2 nb2 5.0 5.0 7.0 1.7321 0.0000 4.2426 5 2 nb3 6.0 9.0 8.0 5.7446 4.2426 0.0000 6 3 nb1 7.0 3.0 4.0 0.0000 2.4495 NaN 7 3 nb2 5.0 2.0 3.0 2.4495 0.0000 NaN 8 3 nb3 NaN NaN NaN NaN NaN NaN 9 4 nb1 5.0 5.0 5.0 0.0000 5.1962 3.4641 10 4 nb2 2.0 2.0 2.0 5.1962 0.0000 1.7321 11 4 nb3 3.0 3.0 3.0 3.4641 1.7321 0.0000 12 5 nb1 4.0 4.0 4.0 0.0000 1.7321 3.4641 13 5 nb2 5.0 5.0 5.0 1.7321 0.0000 1.7321 14 5 nb3 6.0 6.0 6.0 3.4641 1.7321 0.0000 15 6 nb1 7.0 7.0 7.0 0.0000 3.4641 5.1962 16 6 nb2 5.0 5.0 5.0 3.4641 0.0000 1.7321 17 6 nb3 4.0 4.0 4.0 5.1962 1.7321 0.0000 18 7 nb1 8.0 8.0 8.0 0.0000 8.6603 10.3923 19 7 nb2 3.0 3.0 3.0 8.6603 0.0000 1.7321 20 7 nb3 2.0 2.0 2.0 10.3923 1.7321 0.0000 </code></pre> <p>I have tried using both: euclidean() and pdist() with metric=’euclidean’ but can’t get the iteration correct.</p> <p>Any advice on how to get the same result but a lot faster would be greatly apprecieated.</p>
<python><pandas><performance><euclidean-distance><distance-matrix>
2019-05-20 21:10:01
LQ_CLOSE
56,228,352
Probability of happening function
<p>Basically I have a race, in every lap of the race each pilot have 5% probability of crashing.</p> <p>How can I make a function that test the probability of crashing?</p> <pre><code> //the professor gave us this code but wasn't able to use it/ or understand it //Returns the value 1 with probability prob. Otherwise, return 0 int probEvent(float prob){ return prob &gt; ((float)rand()/RAND_MAX); } </code></pre>
<c><random><probability>
2019-05-20 21:22:21
LQ_CLOSE
56,228,814
C# Beginner - "Use of Unassigned Local Variable" Issue
<p>New to C# (only coding for a week so far) trying to create a practice program. Can't seem to get the data I want stored in 'price1' and 'price2'. Error is CS0165 Use of unassigned local variable 'price1' and 'price2'.</p> <p>I've tried moving lines of code around and adding in a return command, but I can't quite seem to figure it out.</p> <pre><code> Console.Write("What grocery are you buying: "); string product1 = Console.ReadLine(); Console.Write("How many are you buying: "); int quantity1 = Convert.ToInt32(Console.ReadLine()); double price1; if (product1 == "Steak") { price1 = Convert.ToDouble(steak.price * quantity1); } if (product1 == "Cheerios") { price1 = Convert.ToDouble(cheerios.price * quantity1); } if (product1 == "Pepsi") { price1 = Convert.ToDouble(pepsi.price * quantity1); } if (product1 == "Celeste Pizza") { price1 = Convert.ToDouble(celeste.price * quantity1); } Console.Write("What second grocery are you buying: "); string product2 = Console.ReadLine(); Console.Write("How many are you buying: "); int quantity2 = Convert.ToInt32(Console.ReadLine()); double price2; if (product2 == "Steak") { price2 = Convert.ToDouble(steak.price * quantity2); } if (product1 == "Cheerios") { price2 = Convert.ToDouble(cheerios.price * quantity2); } if (product1 == "Pepsi") { price2 = Convert.ToDouble(pepsi.price * quantity2); } if (product1 == "Celeste Pizza") { price2 = Convert.ToDouble(celeste.price * quantity2); } Console.WriteLine(price1 + price2); </code></pre> <p>Trying to get data stored in 'price1' and 'price2' so I can add them together at the end. Sorry if I'm getting any terminology wrong here.</p>
<c#><unassigned-variable>
2019-05-20 22:13:01
LQ_CLOSE
56,231,627
C# - Split an existing indexed array
Im Attempting to read a .txt file that is seperated by commas and two lines, currently i have it setup so that it reads the txt file but having trouble with it .split the existing array into two alternative ones based of the taxArray string[] taxArray = new string[2]; int count = 0; try { if(File.Exists(filePath)) { //read the lines from text file add each line to its own array index. foreach (string line in File.ReadLines(filePath, Encoding.UTF8)) { taxArray[count] = line; txtDisplay.Text += taxArray[count] + "\r\n"; count++; } } else { MessageBox.Show("This file cannot be found"); } } catch(Exception ex) { MessageBox.Show(ex.Message); } This currently outputs exactly as i need.
<c#><arrays><split>
2019-05-21 05:31:06
LQ_EDIT
56,233,220
How to make a Notification with different phone?
<p>i want to make an application about how to receive Notification from other phone but i don't know how to do it,i'm already search the keyword still didn't have a match with my problem, please can u give me an advice or tell me how i'm gonna do it?thank you</p>
<android>
2019-05-21 07:27:29
LQ_CLOSE
56,233,622
'setConfigSettings(FirebaseRemoteConfigSettings!): Unit' is deprecated
<p>After upgrading Firebase libraries to </p> <pre><code>implementation "com.google.firebase:firebase-messaging:18.0.0" implementation 'com.google.firebase:firebase-config:17.0.0' implementation 'com.google.firebase:firebase-core:16.0.9' </code></pre> <p>and syncing Gradle, I got warning:</p> <pre><code>'setConfigSettings(FirebaseRemoteConfigSettings!): Unit' is deprecated. Deprecated in Java 'setDeveloperModeEnabled(Boolean): FirebaseRemoteConfigSettings.Builder!' is deprecated. Deprecated in Java </code></pre> <p>in these lines:</p> <pre><code>//Setting Developer Mode enabled to fast retrieve the values firebaseRemoteConfig.setConfigSettings( FirebaseRemoteConfigSettings.Builder().setDeveloperModeEnabled(BuildConfig.DEBUG) .build()) </code></pre>
<android><firebase-remote-config>
2019-05-21 07:52:09
HQ
56,233,933
how to redirect banner logo image to home.php in codeignitor
i want my website banner logo redirect to home.phppresently using this code in codeignitor header file <div class="fleft"> <h1 class="logo"> <a href="#"><img src="<?php echo base_url('assets/img/Green-Surfer-Png.png')?>" id ="Green Surfer Logo" alt="Green Surfer"></a> </h1> </div>
<php><codeigniter>
2019-05-21 08:12:49
LQ_EDIT
56,234,166
Check two button click same time in Android
Is a any way to check two buttons click only same time ? I wrote switch in button click listeners,but I can't check when these buttons clicked same time Here is a my source @Override public void onClick(View v) { switch (v.getId()) { case R.id.button1: Log.d("MR.bool", "Button1 was clicked "); break; case R.id.button2: Log.d("MR.bool", "Button2 was clicked "); break; default: break; } }
<android><android-button>
2019-05-21 08:28:02
LQ_EDIT
56,234,276
whats wrong with the function set_title() in my code
<p>I have created a function called set_title(), which is used to set the title and description in the database I don't know where I was wrong </p> <pre><code> function set_title($file,$title = "",$description = ""){ $pathinfo = pathinfo($file); $file = $pathinfo['basename']; if ($title == "") { $title = ucfirst($pathinfo['filename']); } if ($description !== "") { $description = mb_substr($description, 0, 150); } $sql = "SELECT file, title ,description FROM title WHERE file = '$file'"; $con = new mysqli('localhost','root','','jbstore'); $result = $con-&gt;query($sql); if($result-&gt;num_rows &gt; 0){ $data = $result-&gt;fetch_assoc(); if($data['description'] == ""){ $sql = "INSERT INTO title (description) VALUES('$description')"; $con-&gt;query($sql); } }elseif ($result-&gt;num_rows == 0) { $sql = "INSERT INTO title (file,title,description) VALUES ('$file','$title',$description)"; $result = $con-&gt;query($sql); } } </code></pre> <p>I expected it insert data into database but nothing happens</p>
<php><mysql><sql><mysqli>
2019-05-21 08:34:35
LQ_CLOSE
56,235,738
how to share captured bitmap image(via camera) pass between one fragment two another fragment in android
I tried lot to capture image via camera pass one fragment to another fragment I tried several ways but I cannot do that please help me do that. used intent and sharedpreference app closing
<android><sharedpreferences><android-bitmap>
2019-05-21 09:56:21
LQ_EDIT
56,235,878
builtins.TypeError: cannot convert 'method' object to bytes
<p>I am getting "builtins.TypeError: cannot convert 'method' object to bytes" while trying to decode bson data which I have encoded just before. I would like to get the decoded data into a dict for each loop (to insert it in a mongoDb Collection). </p> <p>I have tried to decode it like that : </p> <p>1 - decode_datas = bson.BSON(bs).decode() who returns the TypeError</p> <p>2 - transform = bytes(bs)</p> <p>decode_data = bson.BSON(transform).decode() : it returns the same error.</p> <pre><code> for row in metaData: bs = bson.BSON.encode ( { 'dt': datetime.now(), 'cid': str(row['clt_id']), 'pid': str(row['clt_pro_id']), 'sid': str(row['sit_id']), 'mtr mid': mid, 'mtr ez': int(row['met_eziview']), 'mtr gwt': int(row['met_is_greenwatch_trading']), 'mtr gs': int(row['met_is_greenstart']), 'mtr net': int(row['met_without_gprs_network']), 'mtr act': int(row['sim_is_deactivated']) if row['sim_is_deactivated'] is not None else 1, 'mtr dt': row['met_first_production_date'] if row['met_first_production_date'] is not None else datetime.min, 'mtr hea': int(row['inv_pan_heading']), 'mtr slo': int(row['inv_pan_slope']), 'mtr wp': wp, 'mtr _t': sMtdPhases, 'adr lat': float(row['ad_latitude']), 'adr lon': float(row['ad_longitude']), 'adr zip': str(row['ad_cp']), } ) decode_datas = bson.BSON(bs).decode </code></pre>
<python><decode><encode><bson>
2019-05-21 10:04:27
LQ_CLOSE
56,236,015
JSP Form action and onsubmit
After I submit the form, the form will ignore the onsubmit whether the return is true or false, the form will directly go to form action. What I want is to validate the input, if it is null it will remain at the same page and pop up an alert. This is my JSP javascript <script> function validLogin() { if (document.login.username.value == "") { alert("Please enter Login Name."); document.loginform.userName.focus(); return false; } if (document.login.password.value == "") { alert("Please enter password."); document.userform.password.focus(); return false; } alert("Welcome User"); return false; } </script> This is my JSP Form <form action="Login" method="post" name="login" onsubmit="return validLogin();">
<javascript><forms><onsubmit>
2019-05-21 10:11:47
LQ_EDIT
56,236,600
header function filename is not working in php
header function filename is not working in php. i try to export a csv file but it always download the page name only like export.php i try so many code and force download. but i can't. plz anyone hlp me enter code here if(isset($_POST["export"])) { include 'database/config.php'; include "database/database.php"; $db = new database(); $fn = "csv_".uniqid().".csv"; $file = fopen($fn, "w"); $query = "SELECT * from wp_terms"; $read = $db -> select($query); fputcsv($file, array('ID', 'Name', 'slug', 'term group')); if($read) { while ($row = $read->fetch_assoc()) { fputcsv($file, $row); } } header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename="'.$fn); fclose($file); }
<javascript><php><mysql>
2019-05-21 10:45:28
LQ_EDIT
56,237,097
Salesforce JOIN query issues, How to work JOIN in Salesforce
Salesforce below my JOIN query not work,, so please help me $query = "SELECT s__c.Id,s__c.mobile_number__c,s__c.student_id__c,s__c.user_id__c,s__c.student_name__c FROM student__c AS s__c INNER JOIN uraan_db__c AS u__c ON u__c.Id=s__c.user_id__c "; Error:= Fatal error: Uncaught SoapFault exception: [sf:MALFORMED_QUERY] MALFORMED_QUERY: s__c.student_name__c FROM student__c AS s__c INNER JOIN uraan_db__c AS u__c ON ^ ERROR at Row:1:Column:118 unexpected token: 'INNER' in /opt/lampp/htdocs/ashvin/portal/soapclient/SforceBaseClient.php:799 Stack trace: #0 /opt/lampp/htdocs/ashvin/portal/soapclient/SforceBaseClient.php(799): SoapClient->__call('query', Array) #1 /opt/lampp/htdocs/ashvin/portal/soapclient/SforceBaseClient.php(799): SforceSoapClient->query(Array) #2 /opt/lampp/htdocs/ashvin/portal/student_list.php(24): SforceBaseClient->query('SELECT s__c.Id,...') #3 {main} thrown in /opt/lampp/htdocs/ashvin/portal/soapclient/SforceBaseClient.php on line 799
<salesforce><inner-join>
2019-05-21 11:16:07
LQ_EDIT
56,237,725
g.Draw blinking alot
I'm using this function in a Timer: ```python IntPtr Handle = FindWindow(null, "Notepad"); if (radioButton1.Checked) { using (Graphics g = Graphics.FromHwnd(Handle)) { Pen PN = new Pen(pictureBox2.BackColor, (Convert.ToInt32(numericUpDown2.Value))); g.DrawLine(PN, 961, 520, 961, 560); g.DrawLine(PN, 985, 540, 935, 540); g.Dispose(); } } ``` But the draw is blinking alot even if i set the timer interval to 1
<c#><winforms>
2019-05-21 11:53:29
LQ_EDIT
56,237,877
Is there a way to convert javascript Date object to string but retain the format as displayed when console.log is used on the Date object?
<p>I want to convert the date object to string but I want it in the same format as it is displayed when I do <code>console.log(new Date())</code> which is something like '2019-05-21T11:55:39.496Z' and not the usual extended format we get when we do <code>console.log(new Date().toString())</code> which is something like this 'Tue May 21 2019 17:28:51 GMT+0530 (India Standard Time)'.</p>
<javascript>
2019-05-21 12:02:02
LQ_CLOSE
56,239,310
Could not find a version that satisfies the requirement torch>=1.0.0?
<p>Could not find a version that satisfies the requirement torch>=1.0.0 No matching distribution found for torch>=1.0.0 (from stanfordnlp)</p>
<python><torch>
2019-05-21 13:23:53
HQ
56,239,918
what does this instructions mean?
Iam learn assemble and have some problems with understanding with instructions, what means "sub $0x10,%rsp" and why gcc copied this "mov $0x0,%eax" two times 0x0000000000001135 <+0>: push %rbp 0x0000000000001136 <+1>: mov %rsp,%rbp 0x0000000000001139 <+4>: sub $0x10,%rsp 0x000000000000113d <+8>: movl $0xa,-0x4(%rbp) 0x0000000000001144 <+15>: mov -0x4(%rbp),%eax 0x0000000000001147 <+18>: mov %eax,%esi 0x0000000000001149 <+20>: lea 0xeb4(%rip),%rdi # 0x2004 0x0000000000001150 <+27>: mov $0x0,%eax 0x0000000000001155 <+32>: callq 0x1030 <printf@plt> 0x000000000000115a <+37>: mov $0x0,%eax 0x000000000000115f <+42>: leaveq 0x0000000000001160 <+43>: retq
<assembly><x86-64><att>
2019-05-21 13:55:04
LQ_EDIT
56,240,322
How do i read a command line?
<p>In the program i need to have a way of reading a command line thats given to the program with the running of the program. so for example: </p> <p>"flying-postman.exe mail.txt boeing-spec.txt 23:00 –o itinerary.txt"</p> <p>so this line should firstly run the program(which is flying-postman.exe) and then it also needs to feed those 4 following variables to the program. </p> <p>So i know that ReadLine() exists, but it wont be helpful in the case because i need it to take those variables at the same time the program is called not after the program is called. i.e i dont want it to run the program then wait for the user to enter in the values.</p>
<c#>
2019-05-21 14:18:37
LQ_CLOSE
56,240,417
Linux command to verify what is the switch connected to the machine
Good Morning, On three different server, I want to verify if it's possible to check the name of the switch is connected to these servers. I would perform this with a Linux command if it's possible. Or maybe with some kind information found in the configuration files if they're present. My final goal is to check if 3 our machine of our server farm are connected to a single switch or two ( having in this case High Aivalability). Is it possible using a Specific Linux Command or to list info in a specific configuration Networking file? Or it's not possible in every case? Many thanks in advance Stefano I found on the Internet this command: cat /proc/net/bonding/bond0 but is has not been usefull cat /proc/net/bonding/bond0 of Linux Centos commands With the command cat /proc/net/bonding/bond0 I have no Output, I would have some typical Linux output lines to analyze if a switch code or switch name is present
<linux><networking>
2019-05-21 14:23:45
LQ_EDIT
56,242,664
How to require custom JS files in Rails 6
<p>I'm currently trying Rails 6.0.0.rc1 which seems to have moved the default <code>javascript</code> folder from <code>app/assets/javascript</code> to <code>app/javascript</code>. The <code>application.js</code> file is now located in <code>app/javascript/packs</code>. Now, I want to add a couple of js files, but for some reason they don't get imported and I can't find any documentation on how this can be done in Rails 6. I tried a couple of things:</p> <ol> <li><p>Create a new folder <code>custom_js</code> under <code>app/javascript/packs</code>, putting all my js files there and then add a <code>require "custom_js"</code> to <code>application.js</code>.</p></li> <li><p>Copy all my js files under <code>app/javascript/channels</code> (which should be included by default, since <code>application.js</code> has <code>require("channels")</code>).</p></li> <li><p>Adding <code>require_tree .</code> to <code>application.js</code>, which was the previous approach.</p></li> </ol> <p>How can I load my own js files inside a Rails 6 application?</p>
<ruby-on-rails><ruby-on-rails-6>
2019-05-21 16:26:34
HQ
56,243,121
Can I set custom ports for a Kubernetes ingress to listen on besides 80 / 443?
<p>I don't mean being able to route to a specific port, I mean to actually change the port the ingress listens on.</p> <p>Is this possible? How? Where is this documented?</p>
<kubernetes><kubernetes-ingress>
2019-05-21 16:57:26
HQ
56,243,340
New to Python and programming in general: trying to plot data through matplotlib, keep getting "builtins.IndexError: list index out of range."
I am pretty new to programming. My main goal is to plot csv data taken from sensors thousands of rows long. I decided to figure out how to plot simple data first. I am currently trying to use pandas and matplotlib.pyplot. On the matplotlib page, they have the direct code to graphing numerical data. [Matplotlib tutorial][1] [The direct code from Pyplot on graphing data in array][2] I entered the code exactly as is and I get this error: "builtins.IndexError: list index out of range." [The code I entered into the Wing shell][3] [The python shell error I received][4] [The reference script python said was in conflict][5] I'm pretty lost and really don't know what I'm missing. Any help would be much appreciated. Thank you very much in advance! [1]: https://matplotlib.org/users/pyplot_tutorial.html [2]: https://i.stack.imgur.com/Zlvkx.jpg [3]: https://i.stack.imgur.com/6a1CX.jpg [4]: https://i.stack.imgur.com/AURqJ.jpg [5]: https://i.stack.imgur.com/GHv2l.jpg
<python><pandas><matplotlib>
2019-05-21 17:14:14
LQ_EDIT
56,243,412
Console application does not automatically open properly from regedit
Basically I have a console application that opens another .exe. That console application works properly when I normally double click on it. I added the application in regedit: Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run so that it automatically opens with Windows and that .exe is ran automatically. I don't have an idea on how to fix this. ```cpp #include <windows.h> #include <shellapi.h> #include <iostream> using namespace std; int main() { cout << "Test...\n"; Sleep(500); cout << "Test..\n"; ShellExecuteA(NULL, "open", "Manager.exe", NULL, NULL, SW_SHOWNORMAL); cout << "Test....\n"; Sleep(500); return 0; } ``` The thing is that the console opens when Windows starts up, but does not open the .exe file, just basically opens and closes. It's like bypasses the "ShellExecuteA"... line, displaying text on console and Sleep(...) works. NOTE: Keep in mind that, as said above, it WORKS PROPERLY when I manually open this application, the "Manager.exe" opens. BUT I it doesn't work when this code is automatically opened with Windows. Any help?
<winapi>
2019-05-21 17:19:01
LQ_EDIT
56,247,165
How to write a program that prints a string a successive number of times (defined by user), in the same number of lines?
I am EXTREMELY new to programming. I am trying to write a function that prints the string '$' a number of times defined by the user, successively reaching that number in the same amount of lines. For instance, if the number is 5, then the output should be $ $$ $$$ $$$$ $$$$$ I have already tried a for loop. I honestly don't even know what sort of function would accomplish the desired result. I know this isn't right, but am I at least on the right track? def func(): number = int(input('Enter a positive integer: ')) for i in range(number): print('$'*number) number = number + int(input('Enter a positive integer: ')) print() func() All I can get it to do is print the string the specified number of times, in the same loop. And if the user inputs another integer, then it will print one line with the old value and the new added together.
<python><string><function><for-loop>
2019-05-21 22:38:16
LQ_EDIT
56,247,780
Create a number with several digit in C++
<p>I have 3 digits (1,4,6) and I want to create a number with 2 digits from my digits like 11,14,16,41,44,46,61,64,66.</p> <p>What command should I use in c++ ?</p>
<c++><numbers><digits>
2019-05-22 00:15:11
LQ_CLOSE
56,249,851
Go channels only sending values
I am learning channels in GO and following this [tutorial][1] When I only send value to a channel it gives error. Here is the example code. package main import "fmt" func main() { ch := make(chan int) ch <- 1 fmt.Println("Does not work") } Here I am just sending value to the channel but not receiving anything. It give an error fatal error: all goroutines are asleep - deadlock! But when I run following code it doesn't give any error package main import "fmt" func sum(s []int, c chan int) { sum := 0 for _, v := range s { sum += v } c <- sum // send sum to c } func main() { s := []int{7, 2, 8, -9, 4, 0} c := make(chan int) go sum(s[:len(s)/2], c) go sum(s[len(s)/2:], c) fmt.Println("did not receive but still works") } and prints did not receive but still works I couldn't understand why it works in second case while it does not work in first case. Even though I have not received any value for the channel in both cases. Also what is causing the deadlock in first case and how it gets avoided in second case? [1]: https://tour.golang.org/concurrency
<go><channel>
2019-05-22 05:27:46
LQ_EDIT
56,250,661
Issue when opening zip file in python
Error when reading a zip file in python I have a problem where I have to read over the zip folder and read the zip files within. I am getting an error while reading one of the text files from the zipped folder. [![enter image description here][1]][1] ```with zipfile.ZipFile(file_name) as zipped: for filenames in zipped.namelist(): if not os.path.isdir(filenames): print(filenames) with open(filenames,"r",encoding="utf8") as file1: print(file1) ``` When I try to run this code I a getting an error that xxxx-005.txt file not found I have the zip file in the same folder as the code. [1]: https://i.stack.imgur.com/BOzeb.png
<python><python-3.x>
2019-05-22 06:35:04
LQ_EDIT
56,250,690
understanding properties in C#
<p>I'm new to C#, just a question on properties </p> <pre><code>public int Age { get { return empAge; } set { empAge = value; } } </code></pre> <p>I actually know how properties works, but just need to find an easy way to understand why this sugar syntax work in this way.</p> <p>So I used to think the <code>int</code> keyword between <code>public</code> and <code>age</code> is the return type of the getter, but what about the setter? obviously the setter return void which doesn't match the return type of int?</p>
<c#><.net><oop>
2019-05-22 06:37:46
LQ_CLOSE
56,252,856
How to Pick files and Images for upload with flutter web
<p>I would like to know how to pick an Image from the users computer into my flutter web app for upload</p>
<dart><flutter><flutter-web>
2019-05-22 08:51:41
HQ
56,254,000
How to convert class objects to named tuples? I am learning named tuples any one help me in this
I really want to use namedtuples instead of class objects class objects class ZoneFileObject(object): def __init__( self, descriptor='', name='', filehandle='', ): self.descriptor = descriptor self.name = name self.filehandle = filehandle optimized namedtuple in single line
<python><python-3.x><object><namespaces><namedtuple>
2019-05-22 09:49:05
LQ_EDIT
56,255,597
phpMyAdmin AUTO_INCREMENT Uncontrolled Increase
I'm adding a new record using php to the table in the database, but the AUTO_INCREMENT value is getting ridiculously higher. This is for a new Linux server, running MySQL 5, PHP 7.6 and Apache 2. @$add_user = mysqli_query($conn, "INSERT INTO users(username, email, custom_title, avatar, message_count, is_moderator, is_admin, is_banned, is_onli`enter code here`ne, security_key) VALUES('$n_username','$n_email','$n_custom_title','$n_avatar','$n_message_count','$n_is_moderator','$n_is_admin','$n_is_banned','0','$security_key')"); https://i.hizliresim.com/vadEDR.png
<mysql>
2019-05-22 11:15:02
LQ_EDIT
56,255,628
How to set array of array in single array in php
<p>Following is my array</p> <pre><code>Array ( [0] =&gt; Array ( [1] =&gt; Beanie ) [1] =&gt; Array ( [2] =&gt; Cap ) [2] =&gt; Array ( [1] =&gt; Beanie with Logo ) ) </code></pre> <p>I want this into a single array like set key and value of array.</p> <pre><code>array( [1]=&gt;Beanie, [2]=&gt;Cap, [1]=&gt;Beanie with Logo, ) </code></pre>
<php><arrays>
2019-05-22 11:16:56
LQ_CLOSE
56,256,802
Is Anyone have a Listview Renderer for chat
<p>I need a ListView Renderer for Chat like whatsapp.</p> <p>when if the new Message comes its automatically scroll down.</p> <p>Please let me know if have a sample for this.</p> <p>thanks</p>
<c#><xamarin><xamarin.forms><xamarin.ios><syncfusion>
2019-05-22 12:27:01
LQ_CLOSE
56,259,032
In Django, how can I prevent a "Save with update_fields did not affect any rows." error?
<p>I'm using Django and Python 3.7. I have this code</p> <pre><code>article = get_article(id) ... article.label = label article.save(update_fields=["label"]) </code></pre> <p>Sometimes I get the following error on my "save" line ...</p> <pre><code> raise DatabaseError("Save with update_fields did not affect any rows.") django.db.utils.DatabaseError: Save with update_fields did not affect any rows. </code></pre> <p>Evidently, in the "..." another thread may be deleting my article. Is there another way to rewrite my "article.save(...)" statement such that if the object no longer exists I can ignore any error being thrown?</p>
<django><python-3.x><django-models><sql-update>
2019-05-22 14:22:03
HQ
56,262,137
Slow sass-loader Build Times with Webpack
<h1>Summary</h1> <p>When we switched to using Webpack for handling our SASS files, we noticed that our build times in some cases became really slow. After measuring the performance of different parts of the build using the <a href="https://www.npmjs.com/package/speed-measure-webpack-plugin" rel="noreferrer">SpeedMeasurePlugin</a>, it seems that <a href="https://github.com/webpack-contrib/sass-loader" rel="noreferrer">sass-loader</a> is the culprit…it can easily take 10s to build (it used to take 20s before we made some fixes), which is longer than we’d like.</p> <p>I’m curious if people have additional strategies for optimizing building Sass assets that I didn’t cover. I’ve gone through a fair number of them at this point (multiple times for some of them), and still can’t seem to get the build times low enough. In terms of goals, currently a large rebuild (such as making a change for a component used in many files), can easily take 10-12 seconds, I’m hoping to get it down closer to 5s if possible.</p> <h2>Solutions Tried</h2> <p>We tried a number of different solutions, some worked, others did not help much. </p> <ul> <li><a href="https://github.com/mzgoddard/hard-source-webpack-plugin" rel="noreferrer">HardSourcePlugin</a> - This one worked reasonably well. Depending on the caching for that build, it was able to reduce build times by several seconds.</li> <li>Removing duplicated imports (like importing the same ‘variables.sass’ file into multiple places) - This also reduced build time by a few seconds</li> <li>Changing our mix of SASS and SCSS to just SCSS - I’m not sure why this helped, but it did seem to shave a bit off our build times. Maybe because everything was the same file type, it was easier to compile? (It’s possible that something else was happening here to confound the results, but it did seem to consistently help).</li> <li>Replace sass-loader with <a href="https://github.com/yibn2008/fast-sass-loader" rel="noreferrer">fast-sass-loader</a> - Many people recommended this, but when I got it to work, it didn’t seem to change the build time at all. I’m not sure why…maybe there was a configuration issue.</li> <li>Utilizing <a href="https://github.com/webpack-contrib/cache-loader" rel="noreferrer">cache-loader</a> - This also didn’t seem to have any improvement.</li> <li>Disabled source maps for Sass - This seems to have had a big effect, reducing the build times in half (from when the change was applied)</li> <li>Tried using <code>includePaths</code> for SASS loaded from node_modules - This was suggested on a <a href="https://github.com/webpack-contrib/sass-loader/issues/296" rel="noreferrer">git issue</a> I found, where sass-loader had issues with something they called ’custom importers’. My understanding was that by using includePaths, SASS was able to rely on those provided absolute paths, instead of using an inefficient algorithm for resolving paths to places like node_modules</li> </ul> <p>From some brief stats, we appear to have about 16k lines of SASS code spread across 150 SASS files. Some have a fair amount of code, while others have less, with a simple average of the LOC across these files of about 107 LOC / file.</p> <p>Below is the configuration that is being used. The application is a Rails application, and so much of the Webpack configuration is handled through the Webpacker gem.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>{ "mode": "production", "output": { "filename": "js/[name].js", "chunkFilename": "js/[name].js", "hotUpdateChunkFilename": "js/[id]-[hash].hot-update.js", "path": "myApp/public/packs", "publicPath": "/packs/" }, "resolve": { "extensions": [".mjs", ".js", ".sass", ".scss", ".css", ".module.sass", ".module.scss", ".module.css", ".png", ".svg", ".gif", ".jpeg", ".jpg"], "plugins": [{ "topLevelLoader": {} }], "modules": ["myApp/app/assets/javascript", "myApp/app/assets/css", "node_modules"] }, "resolveLoader": { "modules": ["node_modules"], "plugins": [{}] }, "node": { "dgram": "empty", "fs": "empty", "net": "empty", "tls": "empty", "child_process": "empty" }, "devtool": "source-map", "stats": "normal", "bail": true, "optimization": { "minimizer": [{ "options": { "test": {}, "extractComments": false, "sourceMap": true, "cache": true, "parallel": true, "terserOptions": { "output": { "ecma": 5, "comments": false, "ascii_only": true }, "parse": { "ecma": 8 }, "compress": { "ecma": 5, "warnings": false, "comparisons": false }, "mangle": { "safari10": true } } } }], "splitChunks": { "chunks": "all", "name": false }, "runtimeChunk": true }, "externals": { "moment": "moment" }, "entry": { "entry1": "myApp/app/assets/javascript/packs/entry1.js", "entry2": "myApp/app/assets/javascript/packs/entry2.js", "entry3": "myApp/app/assets/javascript/packs/entry3.js", "entry4": "myApp/app/assets/javascript/packs/entry4.js", "entry5": "myApp/app/assets/javascript/packs/entry5.js", "entry6": "myApp/app/assets/javascript/packs/entry6.js", "entry7": "myApp/app/assets/javascript/packs/entry7.js", "entry8": "myApp/app/assets/javascript/packs/entry8.js", "landing": "myApp/app/assets/javascript/packs/landing.js", "entry9": "myApp/app/assets/javascript/packs/entry9.js", "entry10": "myApp/app/assets/javascript/packs/entry10.js", "entry11": "myApp/app/assets/javascript/packs/entry11.js", "entry12": "myApp/app/assets/javascript/packs/entry12.js", "entry13": "myApp/app/assets/javascript/packs/entry13.js", "entry14": "myApp/app/assets/javascript/packs/entry14.js", "entry15": "myApp/app/assets/javascript/packs/entry15.js" }, "module": { "strictExportPresence": true, "rules": [{ "parser": { "requireEnsure": false } }, { "test": {}, "use": [{ "loader": "file-loader", "options": { "context": "app/assets/javascript" } }] }, { "test": {}, "use": ["myApp/node_modules/mini-css-extract-plugin/dist/loader.js", { "loader": "css-loader", "options": { "sourceMap": true, "importLoaders": 2, "localIdentName": "[name]__[local]___[hash:base64:5]", "modules": false } }, { "loader": "postcss-loader", "options": { "config": { "path": "myApp" }, "sourceMap": true } }], "sideEffects": true, "exclude": {} }, { "test": {}, "use": ["myApp/node_modules/mini-css-extract-plugin/dist/loader.js", { "loader": "css-loader", "options": { "sourceMap": true, "importLoaders": 2, "localIdentName": "[name]__[local]___[hash:base64:5]", "modules": false } }, { "loader": "postcss-loader", "options": { "config": { "path": "myApp" }, "sourceMap": false, "plugins": [null, null] } }, { "loader": "sass-loader", "options": { "sourceMap": false, "sourceComments": true } }], "sideEffects": true, "exclude": {} }, { "test": {}, "use": ["myApp/node_modules/mini-css-extract-plugin/dist/loader.js", { "loader": "css-loader", "options": { "sourceMap": true, "importLoaders": 2, "localIdentName": "[name]__[local]___[hash:base64:5]", "modules": true } }, { "loader": "postcss-loader", "options": { "config": { "path": "myApp" }, "sourceMap": true } }], "sideEffects": false, "include": {} }, { "test": {}, "use": ["myApp/node_modules/mini-css-extract-plugin/dist/loader.js", { "loader": "css-loader", "options": { "sourceMap": true, "importLoaders": 2, "localIdentName": "[name]__[local]___[hash:base64:5]", "modules": true } }, { "loader": "postcss-loader", "options": { "config": { "path": "myApp" }, "sourceMap": true } }, { "loader": "sass-loader", "options": { "sourceMap": true } }], "sideEffects": false, "include": {} }, { "test": {}, "include": {}, "exclude": {}, "use": [{ "loader": "babel-loader", "options": { "babelrc": false, "presets": [ ["@babel/preset-env", { "modules": false }] ], "cacheDirectory": "tmp/cache/webpacker/babel-loader-node-modules", "cacheCompression": true, "compact": false, "sourceMaps": false } }] }, { "test": {}, "include": ["myApp/app/assets/javascript", "myApp/app/assets/css"], "exclude": {}, "use": [{ "loader": "babel-loader", "options": { "cacheDirectory": "tmp/cache/webpacker/babel-loader-node-modules", "cacheCompression": true, "compact": true } }] }, { "test": "myApp/node_modules/jquery/dist/jquery.js", "use": [{ "loader": "expose-loader", "options": "jQuery" }, { "loader": "expose-loader", "options": "$" }] }, { "test": "myApp/node_modules/popper.js/dist/umd/popper.js", "use": [{ "loader": "expose-loader", "options": "Popper" }] }, { "test": "myApp/node_modules/scroll-depth/jquery.scrolldepth.js", "use": [{ "loader": "expose-loader", "options": "scrollDepth" }] }] }, "plugins": [{ "environment_variables_plugin": "values don't really matter in this case I think" }, { "options": {}, "pathCache": {}, "fsOperations": 0, "primed": false }, { "options": { "filename": "css/[name]-[contenthash:8].css", "chunkFilename": "css/[name]-[contenthash:8].chunk.css" } }, {}, { "options": { "test": {}, "cache": true, "compressionOptions": { "level": 9 }, "filename": "[path].gz[query]", "threshold": 0, "minRatio": 0.8, "deleteOriginalAssets": false } }, { "pluginDescriptor": { "name": "OptimizeCssAssetsWebpackPlugin" }, "options": { "assetProcessors": [{ "phase": "compilation.optimize-chunk-assets", "regExp": {} }], "assetNameRegExp": {}, "cssProcessorOptions": {}, "cssProcessorPluginOptions": {} }, "phaseAssetProcessors": { "compilation.optimize-chunk-assets": [{ "phase": "compilation.optimize-chunk-assets", "regExp": {} }], "compilation.optimize-assets": [], "emit": [] }, "deleteAssetsMap": {} }, { "definitions": { "$": "jquery", "jQuery": "jquery", "jquery": "jquery", "window.$": "jquery", "window.jQuery": "jquery", "window.jquery": "jquery", "Popper": ["popper.js", "default"] } }, { "definitions": { "process.env": { "MY_DEFINED_ENV_VARS": "my defined env var values" } } }, { "options": {} }] }</code></pre> </div> </div> </p>
<webpack><build><sass><webpacker><sass-loader>
2019-05-22 17:32:17
HQ