title stringlengths 10 150 | body stringlengths 17 64.2k | label int64 0 3 |
|---|---|---|
How to get current module object from model in Yii2 | <p>I have module <code>ticket</code>.</p>
<p>Module class has propery <code>UserClassName</code> (string).</p>
<p>In this module I have model called <code>Dialog</code>.</p>
<p>Within this model, I want to get access to the module property <code>UserClassName</code>.</p>
<p>How I can get module object from my model... | 0 |
how to install php 5.4 with ubuntu 16?? | <p>I have install LAMP stack on ubuntu 16, I got php 7. </p>
<p>I want to downgrade it to php 5.4 . what command should I use to remove php 7 and install php 5.4 in my ubuntu 16?</p> | 0 |
Generating PDF files with JavaScript | <p>I’m trying to convert XML data into PDF files from a web page and I was hoping I could do this entirely within JavaScript. I need to be able to draw text, images and simple shapes. I would love to be able to do this entirely in the browser.</p> | 0 |
Remove Product Categories title from woocommerce pages | <p>Does anybody know how to remove (or hide) the Product Categories title on woocommerce pages? </p>
<p>It's using the h4 font settings in theme.php, these are also used for other element titles that I do not want to hide/remove. Any ideas? </p>
<p>Thanks so much!</p> | 0 |
Save and Load .bat game | <p>I'm making a text game written in bat, and the game has been done, (or more, a good part of it, such as the commands, and at the stage where you can play it); however, I want to add the power to save your game, and load it again.</p>
<p>I think one could do this by having the .bat file write the variables which nee... | 0 |
How to use Firebase Realtime Database for Android Google Map app? | <p>I'm trying to work on Firebase <code>Realtime Dataase</code> access to my map's Markers which includes <code>dob</code>, <code>dod</code>, <code>name</code>, <code>latitude</code> , <code>longitude</code>, etc. And I want to use Full name as the title of marker, as well as dob and dod for the snippet of marker. </p>... | 0 |
Change hotkey for autocomplete selection | <p>In Eclipse, I find it pretty annoying that Enter is the hotkey that selects an item from the Content Assist/Autocomplete list. Especially in PyDev where there is no end-of-line semicolon, pressing enter for a new line will instead give me whatever is selected in the Autocomplete list.</p>
<p>Tab is a much better s... | 0 |
How can I get the final redirect URL when using urllib2.urlopen? | <p>I'm using the <code>urllib2.urlopen</code> method to open a URL and fetch the markup of a webpage. Some of these sites redirect me using the 301/302 redirects. I would like to know the final URL that I've been redirected to. How can I get this?</p> | 0 |
Get "Missing expression after unary operator '-'" when I try to run a Powershell script | <p>When I try to run following command</p>
<pre><code>C:\Documents and Settings\BURE\My Documents\ibos\script>powershell.exe -NoProfile -WindowStyle Hidden & 'C:\Documents and Settings\BURE\My Documents\ibos\script\files_from_nomad.ps1' 1
</code></pre>
<p>I get following error</p>
<pre><code>Missing expressi... | 0 |
Iterating over arrays by reflection | <p>I am doing some reflection work and go to a little problem.</p>
<p>I am trying to print objects to some GUI tree and have problem detecting arrays in a generic way.</p>
<p>I suggested that :</p>
<blockquote>
<p>object instanceof Iterable</p>
</blockquote>
<p>Would make the job ,but it does not, (obviously appl... | 0 |
GET xmlHTTPrequest not working | <p>i am trying to make an ajax commenting system where if a new comment is posted, the document title changes to (1) website title (like twitter)</p>
<p>my code is here </p>
<p>The xmlHTTPrequest</p>
<pre><code> function loadXMLDoc7(url)
{
if (window.XMLHttpRequest)
{// code for IE7+, Fire... | 0 |
How can I generate a random number within a range in Rust? | <blockquote>
<p>Editor's note: This code example is from a version of Rust prior to 1.0 and is not syntactically valid Rust 1.0 code. Updated versions of this code produce different errors, but the answers still contain valuable information.</p>
</blockquote>
<p>I came across the following example of how to generate... | 0 |
JPA Updating Bidirectional Association | <p>Lets assume we have the following Entities: </p>
<pre><code> @Entity
public class Department {
@OneToMany(mappedBy="department")
private List<Employee> employees;
}
@Entity
public class Employee {
@ManyToOne
private Department department
}
</code></pre... | 0 |
Starting async method as Thread or as Task | <p>I'm new to <code>C#</code>s <code>await/async</code> and currently playing around a bit.</p>
<p>In my scenario I have a simple client-object which has a <code>WebRequest</code> property. The client should send periodically alive-messages over the <code>WebRequest</code>s <code>RequestStream</code>.
This is the cons... | 0 |
How to sum up an array of integers in C# | <p>Is there a <strike>better</strike> shorter way than iterating over the array?</p>
<pre><code>int[] arr = new int[] { 1, 2, 3 };
int sum = 0;
for (int i = 0; i < arr.Length; i++)
{
sum += arr[i];
}
</code></pre>
<hr>
<p>clarification:</p>
<p>Better primary means cleaner code but hints on performance improv... | 0 |
HTML/CSS show/hide multiple elements? | <p>I'm looking for an HTML/CSS solution to this challenge:
I have multiple elements with the same class or same id, and I want to show/hide them all at the same time, using a button or toggle switch. So I then have a click event, when I click that class or ID representing all those elements, they all hide. When I click... | 0 |
CMake Custom Command copy multiple files | <p>I am attempting to copy multiple files using the <code>${CMAKE_COMMAND} -E copy <from> <to></code> format, but I was wondering if there was a way to provide a number of files to copy to a specific directory. It seems the cmake copy only allows for one file to be copied at a time. I really don't want to... | 0 |
Error Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff] while saving timestamp into databse | <pre><code>SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss a z");
sdf.setTimeZone(TimeZone.getTimeZone("US/Eastern"));
String DateToStoreInDataBase= sdf.format(obj1.getSomeDate().toGregorianCalendar().getTime());
System.out.println(emprSubDte);
Timestamp ts = Timestamp.valueOf(emprSubDte);
preparedSt... | 0 |
Angular 6 iframe binding | <p>There is a variable that stores iframe code.
I want to bind this in a div, but nothing work.</p>
<p>html: </p>
<pre><code><div class="top-image" [innerHTML]="yt"></div>
</code></pre>
<p>ts:</p>
<pre><code>yt = '<iframe class="w-100" src="https://www.youtube.com/embed/KS76EghdCcY?rel=0&amp;cont... | 0 |
Getting "Caused by: java.lang.VerifyError:" | <p>I created an android application which is used as library in another android application. I used some third party jars in the android app which acts as a library. When I link this library in my android application and run it, I am getting the verify error when it tries to access the class present in the library. May... | 0 |
The requested operation cannot be completed due to security restrictions | <p>I have created new add-on as like as survey add-on. Module consist 3 level of groups,</p>
<ol>
<li>Head Manager(admin)</li>
<li>Manager</li>
<li>User</li>
</ol>
<p>If i am logged in as a manager and print the report, i am getting below warning,</p>
<pre><code>"AccessError: ('AccessError', u'The requested operatio... | 0 |
Move ImageView from its current position to fixed position using translate animation | <p>I want to move my image view from its current position to some fixed position on screen using translate animation.
Also I want to know how translate animation works and what parameters it accepts exactly?</p>
<p>My piece of code is...</p>
<pre><code> RelativeLayout.LayoutParams lParams = (LayoutParams) sprea... | 0 |
Convert .pem and .pub to .pfx file | <p>I have a .pem file and a .pub file, I used following commands to create them</p>
<pre><code>openssl genrsa -out temp.pem 1024
openssl rsa -in temp.pem -pubout -out temp.pub
</code></pre>
<p>Now I want to make them to a one .pfx file which is binary and contains both private and public key. Is it possible? how? (I ... | 0 |
How to use SQL Variables inside a query ( SQL Server )? | <p>I have written the following SQL Stored Procedure, and it keeps giving me the error at
<code>@pid = SELECT MAX(...</code> The whole procedure is:</p>
<pre><code>Alter PROCEDURE insert_partyco
@pname varchar(200)
AS
BEGIN
DECLARE @pid varchar(200);
@pid = SELECT MAX(party_id)+1 FROM PARTY;
INSERT INTO ... | 0 |
How can I install package of Latex use Texmarker | <p>I 'm new to use Latex. I have installed <strong><em>MiKTex</em></strong> and <strong><em>Texmarker</em></strong>. I opened my file <strong><em>"test.tex"</em></strong>. Program need to install one package, I choose "yes". But after this , i still got error , file <strong><em>"...sty"</em></strong> not found. Can an... | 0 |
Reason for java.sql.SQLException "database in auto-commit mode" | <p>I use <code>sqlite</code> database and <code>java.sql</code> classes in servlet application to batch-insert some data into database.
There are consecutive four inserts of different kinds of data.
Each one looks like this:</p>
<pre><code>PreparedStatement statement = conn
.prepareStatement("insert or ignore into... | 0 |
select records from postgres where timestamp is in certain range | <p>I have arrival column of type timestamp in table reservations ( I'm using postgres ).
How would I select all dates within this year for example?</p>
<p>I know I could do something like this:</p>
<pre><code>select * FROM reservations WHERE extract(year from arrival) = 2012;
</code></pre>
<p>But I've ran <strong>an... | 0 |
SqlBulkCopy Insert with Identity Column | <p>I am using the <code>SqlBulkCopy</code> object to insert a couple million generated rows into a database. The only problem is that the table I am inserting to has an identity column. I have tried setting the <code>SqlBulkCopyOptions</code> to <code>SqlBulkCopyOptions.KeepIdentity</code> and setting the identity colu... | 0 |
Synonym for a Sequence in Oracle | <p>I want to create a synonym for a sequence in oracle and fetch <code>currval</code> from it.</p>
<p>I created a synonym using this statement.</p>
<pre><code>CREATE SYNONYM NUMGEN FOR MY_SEQ;
</code></pre>
<p>when I fetch the <code>currval</code> or <code>extval</code> from <code>NUMGEN</code> it generate error, sy... | 0 |
Open rar files and read csv files using python | <p>I need to write a program which opens some rar files that contain csv files and read them. I know that there are external libraries for this purpose but what is the best way or library to achieve such a task ?</p> | 0 |
Node.js: How to attach to a running process and to debug the server with a console? | <p>I use 'forever' to run my application. I want to attach to the running environment to inspect my application. So what can I do? </p> | 0 |
How to populate a sub-document in mongoose after creating it? | <p>I am adding a comment to an item.comments list. I need to get the comment.created_by user data before I output it in the response. How should I do this?</p>
<pre><code> Item.findById(req.param('itemid'), function(err, item){
var comment = item.comments.create({
body: req.body.body
... | 0 |
How to rewrite urls of images in vendor CSS files using Grunt | <p>I am trying to move frontend dependencies out of the version control system. A combination of Bower.io and Grunt should be able to do this.</p>
<p>A problem however occurs that I am yet unable to solve with bundling multiple vendor libraries. For example assume I have the following directory structure where the <em... | 0 |
Printing Linked List in C++ | <p>My following code print just only first element. In <code>print_list()</code> function, it stops after printing first element. It says after first element, <code>head->next</code> is <code>0</code>. Shouldn't point towards second element? </p>
<p>I want to simply print whole list.</p>
<pre><code>#include<i... | 0 |
BigInteger Conversion from int to BigInteger | <p>I'm having trouble working with BigIntegers. I'm having trouble with the <code>add</code> method in the Rational class. In the <code>Rational(int x, int y)</code> constructor I'm trying to convert the parameters datatype <code>int</code> into the instance variable datatype of <code>BigInteger</code> though the use o... | 0 |
How to convert HTML page to PDF then download it? | <p>This is my web page designed with HTML and CSS:</p>
<p><a href="https://i.stack.imgur.com/aPT1a.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/aPT1a.jpg" alt=""></a></p>
<p>How can I download the same web page as PDF? I was trying many solutions but I am getting only content on PDF file but not with CSS... | 0 |
How to find the count of substring in java | <p>I am trying to find the count of the substring in a big string of length 10000 characters. Finally I need to remove all the substring in it.
example <code>s = abacacac, substr = ac</code>, <code>num of occurrence = 3</code> and final string is <code>s = ab</code>. My code is below, its not efficient for data of leng... | 0 |
AES Encryption -Key Generation with OpenSSL | <p>As a reference and as continuation to the post:
<a href="https://stackoverflow.com/questions/5136279/how-to-use-openssl-to-decrypt-java-aes-encrypted-data">how to use OpenSSL to decrypt Java AES-encrypted data?</a></p>
<p>I have the following questions.</p>
<p>I am using OpenSSL libs and programming in C for encry... | 0 |
MySQL load data: This command is not supported in the prepared statement protocol yet | <p>I'm trying to write a MySQL script to import data into a table for my Linux server. Here is the script named <code>update.sql</code>:<br></p>
<pre><code>SET @query = CONCAT("LOAD DATA LOCAL INFILE '", @spaceName, "' INTO TABLE tmp FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';");
PREPARE stmt FROM @query;
EXEC... | 0 |
How to do import/export a class in Vanilla JavaScript (JS) | <p>I'm using Vanilla JavaScript (JS) and trying to leverage the concept of <code>class</code> and <code>module</code> import/export which came as part of ECMA-2015(ECMA-6) release.</p>
<p>Please see the code snippet below:</p>
<p><code>rectangle.js</code> file -</p>
<pre><code>export default class Rectangle{
constru... | 0 |
Datetime strptime in Python pandas : what's wrong? | <pre><code>import datetime as datetime
datetime.strptime('2013-01-01 09:10:12', '%Y-%m-%d %H:%M:%S')
</code></pre>
<p>produces </p>
<blockquote>
<p>AttributeError Traceback (most recent call
last) in ()
1 import datetime as datetime
----> 2 datetime.strptime('2013-01-01 09:10... | 0 |
C# Checkedlistbox if checked | <p>Is it possible to apply .Checked== to checkedlistbox as in checkbox?</p>
<p>If to do it in a way as with checkbox it not works</p>
<pre><code>if(checkedListBox1.Items[2].Checked==true)
{
}
</code></pre> | 0 |
Valid characters for Excel sheet names | <p>In Java, we're using the following package to programmatically create excel documents:</p>
<pre><code>org.apache.poi.hssf
</code></pre>
<p>If you attempt to set a sheet's name (NOT file, but internal Excel sheet), you will get an error if:</p>
<ul>
<li>The name is over 31 characters</li>
<li>The name contains any... | 0 |
jQuery Menu and ASP.NET Sitemap | <p>Is it possible to use an <a href="http://en.wikipedia.org/wiki/ASP.NET" rel="noreferrer">ASP.NET</a> web.sitemap with a jQuery <a href="http://users.tpg.com.au/j_birch/plugins/superfish/" rel="noreferrer">Superfish</a> menu? </p>
<p>If not, are there any standards based browser agnostic plugins available that work... | 0 |
Devise routing error on Forgot password | <p>When I click on <code><%= link_to "Forgot your password?", new_password_path(resource_name) %></code></p>
<p>It takes me to</p>
<p><a href="http://0.0.0.0:3000/users/password/new">http://0.0.0.0:3000/users/password/new</a></p>
<p>with the routing error</p>
<pre><code>ActionController::RoutingError in Devis... | 0 |
Running a java applet from netbeans? | <p>I am trying to run a Java applet from NetBeans, and in trying to run it, I get a 'main class not found' error. I can avoid this by doing SHIFT+F6, but that'll only work if I am currently writing in the main class. I will be working on a somewhat large project, and it's going to have multiple files, and eventually it... | 0 |
CSS class and id with the same name | <p>Is there anything wrong with having a css class and id with the same name? Like .footer for the article/post's footer and #footer for the page footer.</p> | 0 |
Ruby File::directory? Issues | <p>I am quite new to ruby but enjoying it so far quite immensely. There are some things that have given me some trouble and the following is no exception.</p>
<p>What I am trying to do here is create a sort of 'super-directory' by sub-classing 'Dir'. I've added a method called 'subdirs' that is designed to list the ... | 0 |
Why doesn't my <script> tag work from php file? (jQuery involved here too) | <p>Here is what I am trying to accomplish. I have a form that uses jQuery to make an AJAX call to a PHP file. The PHP file interacts with a database, and then creates the page content to return as the AJAX response; i.e. this page content is written to a new window in the success function for the <code>$.ajax</code> ca... | 0 |
How to compare user input with my database in java | <p>As shown on the title, I have tried so hard to compare the user input with my database and it works with a true input. However, when the input is not exist on my database I don't know what is wrong in my below code, please help.</p>
<pre><code>private class da implements ActionListener{
public void actionPerformed... | 0 |
How to get Property Value from MemberExpression without .Compile()? | <p>I'm having issues trying to get the value of an object out of the Expression Tree without using .Compile()</p>
<p>The object is quite simple.</p>
<pre><code>var userModel = new UserModel { Email = "John@Doe.com"};
</code></pre>
<p>The method giving me issues looks like this.</p>
<pre><code>private void VisitMemb... | 0 |
What is session invalidation? | <p>Session invalidation means session destroying.So if session is destroyed,it indicates that server cant identify the client which has visited in previous.So now it creates a new session id for that client.</p>
<p>Is this right?If wrong tell me the correct procedure.</p> | 0 |
Mapping a SQL View with no Primary Key to JPA Entity | <p>In my Java App I want to get information that is stored in my Oracle Database, using JPA.
In my Database I have a View, with a set of columns that I got from some other tables. I want to map that View. However, my <strong>View doesn't have a Primary Key</strong>, so I can't create a JPA Entity. I thought about <stro... | 0 |
how to dynamically add swt widgets to a composite? | <p>I'm trying to add widgets like text boxes, buttons to a composite on click of a button.
I've tried , but i could only add these widgets dynamically only up to the size of the composite. My jface dialog is such that, it has a scrolled composite in which it holds a composite. In the main composite i have 3 other compo... | 0 |
preg_replace http with https | <p>Put simply, I need to check if the string in the variable $url is a simple http, if so, replace it with https - but I can't get it to work - any ideas:</p>
<pre><code>$url="http://www.google.com"; // example http url ##
$url_replaced = preg_replace( '#^http://#','https://', $url ); // replace http with https ##
</c... | 0 |
FancyBox 'Uncaught TypeError: Cannot call method 'hide' of undefined' | <p>I've been screwing around with fancybox. I work in the CakePHP Framework and I made an admin panel. This panel has a few options which I load via AJAX into an Div over the page itself.</p>
<p>Now when I put an image in this div and try to use Fancybox I get this error when I click on a image (to enlarge it):</p>
<... | 0 |
GCC: why constant variables not placed in .rodata | <p>I've always believed that GCC would place a <code>static const</code> variable to <code>.rodata</code> segments (or to <code>.text</code> segments for optimizations) of an ELF or such file. But it seems not that case.</p>
<p>I'm currently using <code>gcc (GCC) 4.7.0 20120505 (prerelease)</code> on a laptop with GNU... | 0 |
_M_ construct null not valid error when trying to implement multi threaded queue | <p>I am trying to implement a priority queue using using a simple linear approach as explained in <a href="https://rads.stackoverflow.com/amzn/click/com/B008CYT5TS" rel="nofollow noreferrer" rel="nofollow noreferrer">Art of Multiprocessor programming</a>. I'm new to c++ and have difficulty troubleshooting.</p>
<p>I've ... | 0 |
Yii2 REST query | <p>Hy.
I have a ProductController which extends the yii\rest\ActiveController.
Question is that how can i make querys via HTTP GET request.</p>
<p>Like: <a href="http://api.test.loc/v1/products/search?name=iphone" rel="noreferrer">http://api.test.loc/v1/products/search?name=iphone</a></p>
<p>And the return object wi... | 0 |
Downloading Xcode with wget or curl | <p>I am trying to download Xcode from the Apple Developer site using just wget or curl. I think I am successfully storing the cookie I need to download the .dmg file, but I am not completely sure.</p>
<p>When I run this command:</p>
<pre><code>wget \
--post-data="theAccountName=USERNAME&theAccountPW=PASSWOR... | 0 |
T-SQL round to decimal places | <p>How do I round the result of matchpercent to two decimal places (%)?
I'm using the following to return some results:</p>
<pre><code>DECLARE @topRank int
set @topRank=(SELECT MAX(RANK) FROM
FREETEXTTABLE(titles, notes, 'recipe cuisine', 1))
SELECT
ftt.RANK,
(CAST(ftt.RANK as DECIMAL)/@topRank) as matchperc... | 0 |
No log4j2 configuration file found. Using default configuration: logging only errors to the console | <pre><code>$ java -Dlog4j.configuration=file:///path/to/your/log4j2.xml -jar /path/to/your/jar_file.jar
</code></pre>
<p>Written to the console, you get</p>
<pre><code>ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
</code></pre>
<p>But, it also... | 0 |
How to sort alphabetically rows of a data frame? | <p>I am tring to sort <code>c</code> alphabetically <code>if x[i]== x[i+1]</code>. I used <code>order()</code> function but it changes the <code>x</code> column as well. I want to order the entire row:</p>
<pre><code> best <- function(state){
HospitalName<-vector()
StateName<-vector()
HeartAttack<-vecto... | 0 |
Bootstrap 3 full width div's in container-fluid | <p>I'm trying to create some "horizontal bands" in a Bootstrap 3 CSS layout, extending to the whole size of the browser's window, and thus outside of the content class margins. Here is a Plunker: <a href="http://plnkr.co/edit/6SlNU0ZgFehrBD64r9FG" rel="nofollow">http://plnkr.co/edit/6SlNU0ZgFehrBD64r9FG</a> . I found t... | 0 |
React Material UI Multiple Collapse | <p>Currently my list all have collapses but they are linked to one state for "open" so if I open one list, all the other lists open.
What is the best way to keep the collapses separate from each other without having a lot of states for each list.</p>
<p>EDIT: The app is going through an infinite loop</p>
<p><strong>A... | 0 |
'txtName' is not declared. It may be inaccessible due to its protection level | <p>After putting a textbox on my page when I compile it I get the above error:</p>
<p>'txtName' is not declared. It may be inaccessible due to its protection level.</p>
<p>This is happening when I try to read the value of the textbox in the codebehind page.</p>
<p>I'm not sure what's causing this...any ideas?</p>
<... | 0 |
Validate in merge function pandas | <p>Today I was trying to go a little deeper in the <code>merge()</code> function of pandas, and I found the option <code>validate</code>, which, as reported in the documentation, can be:</p>
<blockquote>
<p>validate : string, default None</p>
<p>If specified, checks if merge is of specified type.</p>
<p>“one_to_one” or... | 0 |
Tomcat starts without errors but not listening on 8080 | <p>I am running tomcat 6 on Centos 6.4 and have started it sucessfully. There were no errors on start. catalina.log reads:</p>
<pre><code>2012-08-11 14:23:42,941 | INFO | main | o.a.c.http11.Http11NioProtocol | Starting Coyote HTTP/1.1 on http-xx.xx.xx.xx-8080
2012-08-11 14:23:42,960 | INFO | main | o.a.catalina.sta... | 0 |
Preview layout with merge root tag in Intellij IDEA/Android Studio | <p>Let's imagine we are developing compound component based on LinearLayout. So, we create class like this:</p>
<pre><code>public class SomeView extends LinearLayout {
public SomeView(Context context, AttributeSet attrs) {
super(context, attrs);
setOrientation(LinearLayout.VERTICAL);
View.... | 0 |
Global variable on servlet. is global for all sessions, or only for the current session? | <p>I need to share information while the applicaiton is running; if I have:</p>
<pre><code>public class example extends HttpServlet
{
Object globalObject;
doGet...
doPost....
}
</code></pre>
<p>A user is using the aplication through server and the object globalObject; if another user use the application,... | 0 |
how do i animate a specific height to 100% in jquery | <p>i want to have a little "preview" of the content in the div, so i made it so small that only only the first line is shown. now i want to animate it that when you click the title, the div will have the height of 100%, but when i use animate(height:"100%") there is no nice sliding.</p>
<pre><code><a href="javascri... | 0 |
How can I install Perl on Windows 8? | <p>I want to use Perl for web development. I have tried to find out how to install it but when I tried to get ActivePerl it wouldn't install on Windows 8. Can anyone tell me how to install Perl on Windows 8? I can go for ActivePerl, Strawberry Perl, or any other Perl release as long as it will work on Windows 8.</p> | 0 |
Getting an object from a dictionary of objects | <p>I'm trying to pull an object from a dictionary of objects, and return said object however I'm having a bit of a problem with types. The class in question looks something like this, I'm wondering how I go about returning the actual object rather than the variable (which I assume is a string by default).</p>
<pre><co... | 0 |
Swift equivalent of Java toString() | <p>What is the Swift equivalent of Java <code>toString()</code> to print the state of a class instance?</p> | 0 |
Why doesn't this coffee-script print out? | <p>So when the index is 0, I want to print it out:</p>
<pre><code>a = [ 1, 2, 3 ]
for i of a
if i == 0
console.log a[i]
</code></pre>
<p>But there is no output.</p>
<p><code>i == 0</code> is never true...</p> | 0 |
VBS Creating CSV file then adding extra rows to it | <p>Below is my VBS code. I will admit, I am extremely new to this since I was give this as a job at work. I need to create a logon/logoff script that will capture certain information and store it in a csv file. I am able to get the information and store it in the csv file, but when I try to do it again, I want it to cr... | 0 |
session_start(): Session data file is not created by your uid | <p>I want to store the created sessions in a directory above the root, except when I use any of the following:</p>
<pre><code> session_save_path($_SERVER['DOCUMENT_ROOT'] . '/../storage/sessions');
session_save_path($_SERVER['DOCUMENT_ROOT'] . '/../storage/sessions/'); // With an extra slash at the end
ini_set(... | 0 |
C# "as" cast vs classic cast | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="https://stackoverflow.com/questions/496096/casting-vs-using-the-as-keyword-in-the-clr">Casting vs using the ‘as’ keyword in the CLR</a> </p>
</blockquote>
<p>I recently learned about a different way to cast. Rather than using</p>
<pre><code>Some... | 0 |
Visual C++ template syntax errors | <p>I have a header file...</p>
<pre><code>#include <SFML\Graphics.hpp>
#include <SFML\Graphics\Drawable.hpp>
#include <SFML\System.hpp>
#include <iostream>
#ifndef _SPRITE_H_
#define _SPRITE_H_
namespace Engine
{
template <class T>
class Sprite
{
sf::Vector2<T>... | 0 |
How to execute a stored procedure using OCI8 in PHP | <p>Can someone help me on how to call the stored procedure in oracle by php?
I have the sample of stored procedure</p>
<pre><code>CREATE OR REPLACE PROCEDURE view_institution(
c_dbuser OUT SYS_REFCURSOR)
IS
BEGIN
OPEN c_dbuser FOR
SELECT * FROM institution;
END;
</code></pre>
<p>the above stored procedure ... | 0 |
What are the best blogs for staying up to date on C#, ASP.NET, LINQ, SQL, C++, Ruby, Java, Python? | <p>Apologies if this repeats another - but I couldn't fine one like it.</p>
<p>My day to day programming spans a fair number of technologies: C#, ASP.NET, LINQ / SQL, C++, Ruby, Java, Python in approximately that order.</p>
<p>It's a struggle to keep up to date on any of best practices, new ideas, innovation and impr... | 0 |
How to set MySQL to use GMT in Windows and Linux | <p>I'm just trying to get MySQL to store time in GMT...</p>
<p>I've read the documentation here: <a href="http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html" rel="noreferrer">http://dev.mysql.com/doc/refman/5.1/en/time-zone-support.html</a></p>
<p>It says to set: default-time-zone='timezone' in an option ... | 0 |
Should I Always Fully Qualify Column Names In SQL? | <p>Out of interest when working with SQL statements should I always use the fully qualifed column name (tablename.columnname) even if only working with one table e.g.</p>
<pre><code>SELECT table.column1, table.column2 FROM table
</code></pre> | 0 |
How to connect a database in Atom Editor? | <p>I want to connect my database in atom and execute directly from the editor. How can I do that?</p> | 0 |
pause/resume a python script in middle | <p>Can I have a running python script(under Windows)being paused in the middle by user , and resume again when user decides ? </p>
<p>There is a main manager program which generates,loads and runs other python scripts (by calling python script.py from console).I don't have GUI and user can interact via console.I want ... | 0 |
Mocking service in a component - mock ignored | <p>This time I'm trying to mock a service (that does http calls) to test a component.</p>
<pre><code>@Component({
selector: 'ub-funding-plan',
templateUrl: './funding-plan.component.html',
styleUrls: ['./funding-plan.component.css'],
providers: [FundingPlanService]
})
export class FundingPlanComponent implemen... | 0 |
c# How to retrieve Json data into an array | <p>I have found different libraries that can parse Json data, but i did not find any documentation on how to get the data into an C# array or list.</p>
<p>I got this Json data:</p>
<p>{"001":{"Name":"John", "Phone":["Mob - 98837374","Mob - 98363627"]},
"002":{"Name":"Tom", "Phone":["Mob - 49858857"]}}</p>
<p>Anybo... | 0 |
jQuery Accordion - Need index of currently selected content part | <p>I have a simple menu on a web page, based on the jQuery Accordion. I have simplified the code somewhat, and it looks like this;</p>
<pre><code><div id="menu_div" class="nt-tab-outer nt-width-150px">
<h3 class="nt-tab-title"><a href="#">Menu A</a></h3>
<div id="menu_1_div">
<... | 0 |
How to disable open browser in CRA? | <p>I've created a React app using <code>create-react-app</code> but whenever I start the dev server (using <code>npm start</code>), it opens up my browser. I want to make it so that it doesn't open my browser whenever I start my dev server.</p>
<p>How can I accomplish this?</p> | 0 |
resample audio buffer from 44100 to 16000 | <p>I have audio data in format of data-uri, then I converted this data-uri into a buffer now I need this buffer data in new samplerate, currently audio data is in 44.1khz and I need data in 16khz, and If I recorded the audio using RecordRTC API and if I record audio in low sample rate then I got distorted audio voice, ... | 0 |
JSF h:selectOneMenu trouble: java.lang.IllegalArgumentException Cannot convert "string" of type class java.lang.String to interface java.util.List | <p>I have some JSF-trouble using h:selectOneMenu with a list from my backend bean:
My xhtml file looks like this:</p>
<pre><code> <f:view>
<h:form id="serverOptions">
<h:selectOneMenu id="preset" value="#{overview.pdfPresets}" >
<f:selectItems value="#{overview.pdfPresets}" />... | 0 |
Facebook Graph API get all likes from a post | <p>I am very new to facebook graph api, actually I just started today so I might use some help.</p>
<p>My code is working perfectly, I've written a simple algorithm to list people who like a certain post, but the problem is this. Here is the JSON reply I get from graph api:</p>
<pre><code><br/>
{<br/>
... | 0 |
Objective-C UILabel as HyperLink | <p>I am trying to make a <code>UILabel</code> a link for a <code>UIWebView</code>. How can I make a <code>UILabel</code> to work as hyperlink?</p> | 0 |
VBA Excel - Compile Error Object Required | <p><strong>Disclosure: I'm fairly inexperienced at coding of most sorts but have a reasonable understanding of the logic behind it and quite often just need a little push with getting syntax's right etc.</strong></p>
<p><strong>I posted the same code earlier but with a different problem and have no discovered this iss... | 0 |
Can any one explain Screenshot in Selenium? | <pre><code>WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com/");
File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
// Now you can do whatever you need to do with it, for example copy somewhere
FileUtils.copyFile(scrFile, new File("c:\\tmp\\screenshot.png"));
</code></... | 0 |
Reactive Spring does not support HttpServletRequest as parameter in REST endpoint? | <p>I created a RestController which look like this : </p>
<pre><code>@RestController
public class GreetingController {
@RequestMapping(value = "/greetings", method = RequestMethod.GET)
public Mono<Greeting> greeting(HttpServletRequest request) {
return Mono.just(new Greeting("Hello..." + reques... | 0 |
JavaScript access string chars as array | <p>Is it ok to do this:</p>
<pre><code>var myString="Hello!";
alert(myString[0]); // shows "H" in an alert window
</code></pre>
<p>Or should it be done with either charAt(0) or substr(0,1)?
By "is it ok" I mean will it work on most browsers, is there a best practice recommandation that says otherwise etc.</p>
<p>Tha... | 0 |
How would i use Sevenzipsharp with this code? | <p>iv tried numerous different ways to get this to work and i got it to basicly work but i cant get the WaitForExit(); 's to work like they do here... so how would i convert this to work with sevenzip? cause i cant get it to work, and also i the SFX's are passworded so that they cannot be accessed except by the use of ... | 0 |
How to change a button's size | <pre><code>int width, height;
width = this.Size.Width;
height = this.Size.Height;
width /= 3;
height /= 3;
btn_1.Size = new Size(width, height);
</code></pre>
<p>I am trying to make a button's size and location change when the user resizes a form.</p>
<p>How can I assigning a size to a button?</p>
<p>I tried to make... | 0 |
Java - JPA - @Version annotation | <p>How does <code>@Version</code> annotation work in JPA?</p>
<p>I found various answers whose extract is as follows:</p>
<blockquote>
<p>JPA uses a version field in your entities to detect concurrent modifications to the same datastore record. When the JPA runtime detects an attempt to concurrently modify the same... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.