_id
stringlengths
2
6
text
stringlengths
4
46k
title
stringclasses
1 value
d701
You can just use a list for the sake of having a sorted - well - list. If you want to associate additional data, you could either use a tuple to store the data, or even create a custom object for it that stores the id in an additional field. You shouldn’t need to extend the list for that, you can just put any object in...
d702
I suggest you do use w+b mode, but move writing to zipfile after closing the invoice XML file. From what you wrote it looks as you are trying to compress a file that is not yet flushed to disk, therefore with w+b it is still empty at time of compression. So, try remove 1 level of indent for invoices_packa...
d703
First you should turn on error displaying in your iis, or read the error log for its description, google it if not sure how. Without error description, it's way too difficult to check what is wrong. A: Problem solved! After banging my head against the wall for a day i found out that i stupidly declared the array insid...
d704
You shouldn't add the templatetags directory to installed apps. You should put the templatetags directory inside an existing app, and add that to installed apps. A: Try to move templatetags folder to logicalhp A: Part of the problem was a typo in my settings.py (wrote the 'logicalhp.templatetags' when it was in 'itsl...
d705
The answer I needed is based upon Levon's reply at: How to delete a table in SQLAlchemy? Basically, this did the trick: from sqlalchemy import MetaData from sqlalchemy.ext.declarative import declarative_base from [code location] import db Base = declarative_base() metadata = MetaData(db.engine, reflect=True) table = m...
d706
Update: Please see the following tech note for iOS 8 support: http://www-01.ibm.com/support/docview.wss?uid=swg21684538 The link includes download links for patched versions of Worklight 5.0.6, 6.0, 6.1 and 6.2 as well as a list of fixed issues and other instructions. * *The relevant iFix is that from September 18th...
d707
First of all, the class AlexaViewSet is not a serializer but a ViewSet. You didn't specify the serializer class on that ViewSet so I you need to specify that. On the other side, if you want to pass a custom query param on the URL then you should override the list method of this ViewSet and parse the query string passed...
d708
you should check if your database has data that doesn't fit like an id value that is not present in the foreign table, delete any rows like that and the migration should work, it would help if you let us know what npm run deploy:fresh does, you might be doing something else wrong if the data is not clearing on a clean ...
d709
If you want the Dialog Border to appear in any colour you wish you have to use layout style and a theme. There is an excellent article about it here: http://blog.androgames.net/10/custom-android-dialog/
d710
.single('parameter') means the input field's name is 'parameter' In your case: app.use(multer({dest: './app/controller/store'}).single('photo')); You passed a 'photo' argument into single func. Then your form should look like this, change it: .. .. <input type="file" name="photo"> .. ..
d711
Though it may be more complicated, why not just have an onmousedown event on the <p> element, and thet event will then attach an onmousemove event and onmouseout event, so that if there is a mouse movement, while the button is down, then remove the class on the span elements, and once the user exits, the element then y...
d712
you should to do several things but I think you don't do that. I create a simple project only for you and added to my GitHub just click in this link: GitHub first Project templates if it is helpful please, take a vote. A: First of all, you wrote scr, not src and this should be corrected. <!--It doesn't work--> <im...
d713
I've had this problem before, and if I recall correctly it had something to do with iOS not knowing the actual size until after the view has been drawn the first time. We were able to get it to update by refreshing after viewDidAppear (like you mentioned it's the appropriate size after refreshing), but that's not exac...
d714
Reference for CardView. It is just a RelativeLayout with a rounded corners and a drop shadow. So yes, the image was probably an image of a layout designed with CardViews. At the same time, it could also just be a layout that was custom built and a shadow drawn behind it, if that developer wanted to do the work themselv...
d715
You can do this by enabling two-phase rendering: https://www.ibm.com/support/knowledgecenter/en/SSHRKX_8.5.0/mp/dev-portlet/jsr2phase_overview.html. Enable two-phase rendering in the portlet.xml like this: <portlet> ... <container-runtime-option> <name>javax.portlet.renderHeaders</name> <value>t...
d716
You sended string to model but you must send collection to model and then show in table A: Your view is expecting IEnumerable<Website.Models.OrderIndexViewModel> as the model but you are passing it a single instance of Website.Models.OrderIndexViewModel. This might be another bug in your code, as this will only ever ...
d717
When you use AND and OR together in any circumstances in any programming language ALWAYS use brackets. There is an implicit order which gets evaluated first (the AND or the OR condition) but you usually don't know the order and shouldn't be in need to look it up in the manual Also use Prepared statements for SQL querie...
d718
I recommend trying it out for yourself, but the comment in the code #TODO/XXX: Remove as_lookup_value() once we have a cleaner solution # for dot-notation queries suggests that it does. I've ever only really used lists. A: You can filter for a Post that has an author named "Ralph" using raw queries: Post.ob...
d719
I found a way. Just add httpServletRequest.getSession().setMaxInactiveInterval(intervalInSeconds) @RequestMapping(value = "/login", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public String login(HttpServletRequest request, HttpServletResponse servletresponse){ //Your logic ...
d720
The string is slightly incorrect, but I hope all other requirements are met: // Create a font XFont font = new XFont("Verdana", 12, XFontStyle.Bold | XFontStyle.Underline); // Draw the text gfx.DrawString("Hello, World!", font, new XSolidBrush(XColor.FromArgb(255, 0, 0)), 100, 100, XStringFormats.Center);
d721
In your yamls, there is a path "/?..." for handling the query parameters but this path will not receive traffic from "/" path as there is no prefix match. So you have to create a path "/" with type prefix to solve the issue. Then you can ignore current "/?..." path as it will match prefix with "/" path. Please try this...
d722
You aren't ever calling the function in your worker. This code in the worker: import { parentPort } from "worker_threads"; async function worker() { console.log("started"); parentPort.postMessage("fixed!"); } Just defines a function named worker. It never calls that function. If you want it called immediately, t...
d723
i think i found it after a lot of blood, sweat, and tears. i found that the ObjectMapper i had configured was actually not the one that was being used. Jersey1 clientConfig.getSingletons().add(new JacksonJsonProvider(objectMapper)); Client client = new Client(urlConnectionClientHandler, clientConfig); JAXRS2 (what did...
d724
You cannot protect your API keys for authorization when your API calls are initiated from the client (i.e., JavaScript). As you said, there will be no point of encrypting them as well. You'll need to have an authorization provider that can return the API key as part of the response. API Gateway allows you to have custo...
d725
If I got your question right, you can use union like this - select * from table_1 union select * from table_2 order by create_date desc EDIT Create a view like this - create view table_1And2 as select * from table_1 union select * from table_2 table_1And2 is not a good name, give a meaningful name. And modify your l...
d726
There might be a more elegant solution but you can loop through the response_date values in df2 and create a boolean series of values by checking against the all the response_date values in df1 and simply summing them all up. df1['group'] = 0 for rd in df2.response_date.values: df1['group'] += df1.response_date > r...
d727
Finally I have solved it. ReactiveMaps does not allow the location field in uppercase, so I had to change the indexed documents in elasticsearch taking in account this. "location": { "lat": 56.746423, "lon": 37.189268 }
d728
* *I think your pipe is fired before the 'filename' get any data. *You should not split with '/' Try this instead: var mime = require('mime-types'); // After npm install mime-types request .get(uri) .on('response', function (response) { var responseType = (response.headers['content-type'] || '').s...
d729
You can add it to some other app, or even create just a file called static in the root of project_name and refer to the class inside this file in your settings.INSTALLED_APPS directly, but the recommended way to provide AppConfigs is inside an apps.py file inside the application package. If you have no app where this A...
d730
Use Following code VolleyMultipartRequest multipartRequest = new VolleyMultipartRequest(Request.Method.POST, url, new Response.Listener<NetworkResponse>() { @Override public void onResponse(NetworkResponse response) { String resultResponse = new String(response.data); // parse success output ...
d731
argc and argv refer to command line inputs. When the program is run they are specified by the user. myprogram.exe --input1 fred See this: What does int argc, char *argv[] mean?
d732
Declare your DBLoader loader as global variable at the onCreateLoader loader = new DBLoader(this); return loader; put this at the onCreate method instead of onLoadFinished myAdapter = new MyCursorAdapter(this,null,0); bookList.setAdapter(myAdapter); put this at onLoadFinishied this.loader=(DBLoader)loader; adapter.c...
d733
It looks like the function you're trying to call is compiled as a C++ function and hence has it's name mangled. PInvoke does not support mangled name. You need to add an extern "C" block around the function definition to prevent name mangling extern "C" { void* aaeonAPIOpen(uint reserved); } A: Using the undname....
d734
The composer program is a ascii text file, and as such the setuid bit has no effect on it. Since you are kicking off the process as root, you can do something like su www-data -c "composer ...."
d735
It's feasible, at least, using PyQt + QWebKit (an example here and here).
d736
This is a bug of jekyll-sitemap and it has already been fixed. You can upgrade jekyll-sitemap to v0.6.2 and everything will be ok. https://github.com/jekyll/jekyll-sitemap/issues/54
d737
Web-handler should return a response object, not None. The fixed code is: async def index(request): async with aiohttp.ClientSession() as client: data=await(email_verification(client)) await client.post('http://127.0.0.1:8000/acc/signup',data=data) return web.Response(text="OK") async def email...
d738
The latest versions of Matlab have hashes. I'm using 2007b and they aren't available, so I use structs whenever I need a hash. Just convert the integers to valid field names with genvarname.
d739
use jQuery $(window).scrollTop()
d740
i have found the issue, posting if will help somebody else. the problem was that mysqld went into infinite loop trying to create indexing to a specific database, after found to which database was trying to create the indexes and never succeed and was trying again and again. solution was to remove the database and recre...
d741
You can create a text node and append it to the parent of img, and optionally remove img if needed. This code goes inside the error handler for img $('img').on('error', function(){ $(this).parent().append($('<div>Broken image</div>')); $(this).remove(); }) A: Ok, I think I have found a solution for you. I tri...
d742
You can just set the headers directly. $cookies = array( 'somekey' => 'somevalue' ); $endpoint = 'https://example.org'; $requestMethod = 'POST'; $timeout = 30; $headers = array( sprintf('Cookie: %s', http_build_query($cookies, null, '; ')) ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $endpoint); curl_...
d743
Your code has undefined behavior. You cannot validly access the memory pointed at by an uninitialized pointer, like you do. The memset() function writes to memory, it does not magically allocate new memory (it takes as input the pointer to the memory to be written), you cannot in anyway use it "instead of" malloc(). Y...
d744
I got the same error message in a new java installation when trying to use an SSL connection that enforces 256-bit encryption. To fix the problem I found I needed to install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files (e.g. http://www.oracle.com/technetwork/java/javase/downloads/j...
d745
Next to your question there are some other things to take into account: a. Always use Parameters when creating Sql: SqlCommand cmd = new SqlCommand("select * from personeel where wachtwoord = @Password", conn); cmd.Parameters.Add("@Password", password) b. Put your database methods in a separate class (Encapsulation, e...
d746
Yes, the Playstore supports this feature named In-app-updates There is no official implementation for this here, but take a look at this. A: You can use In-app updates: In-app updates is a Google Play Core libraries feature that prompts active users to update your app. There are mainly two update flows. * *Flexibl...
d747
You should consider using DS.ActiveModelAdapter instead of DS.RESTAdapter. See also https://stackoverflow.com/a/19209194/1345947
d748
You can do it with openssl pkeyutl which is a replacement for openssl rsautl that supports ECDSA. Suppose you want to hash and sign a 'data.txt' file with openssl. At first you need to hash the file: openssl dgst -sha256 -binary -out data.sha256 data.txt after you can sign it: openssl pkeyutl -sign -inkey private.pe...
d749
There were breaking changes in redux-forms from v5 to v6. Previously you could do something similar to what you have to access the touched field. If you want to do something similar to see if there are errors on a field, you need to create your own component to pass to redux-form's Field component. Your custom componen...
d750
Just click (ctr+h) on keyboard.
d751
External table feature is publicly available feature as per documentation https://docs.snowflake.com/en/user-guide/tables-external-intro.html
d752
You could: print the space before: movielist = ' ' + '\n '.join(movie) print the space for each item: movielist = '\n'.join([' ' +i for i in movie]) Exemple: >>> print '\n '.join(movie) something something something otherthing otherthing >>> print ' '+'\n '.join(movie) something something something otherthing...
d753
You need a range value for every one of your ordinal values: var x = d3.scale.ordinal() .domain(["A", "B", "C", "D", "E"]) .range([0, 1/4 * width, 2/4 * width, 3/4 * width, width]); https://jsfiddle.net/39xy8nwd/
d754
Let me just expand a little bit what you've already been told in comments. That's how by-name parameters are desugared by the compiler: @tailrec def factorialTailRec(n: Int, f: => Int): Int = { if (n == 0) { val fEvaluated = f fEvaluated } else { val fEvaluated = f // <-- here we are going deeper into s...
d755
property: value pairs must go inside a ruleset. font-family: 'Open Sans', Helvetica, Arial, sans-serif; … is not a valid stylesheet. foo { font-family: 'Open Sans', Helvetica, Arial, sans-serif; } … is. Re edit: The errors you are seeing are a side effect of the IE7 hacks at the beginning of the ruleset. Remov...
d756
You add(!) an extra callback function every time you call looper.output to the event 'output'. I don't know what you want to achieve, but to get this call only once use this.once('output', ...) or move the callback setting to the object or remove the old function first...
d757
You have installed SQLAlchemy, but you are trying to use the Flask extension, Flask-SQLAlchemy. While the two are related, they are separate libraries. In order to use from flask.ext.sqlalchemy import SQLAlchemy you need to install it first. pip install Flask-SQLAlchemy (You installed SQLAlchemy directly from source....
d758
Load testing; how many selenium clients are you running? One or two will not generate much load. First issue to think about; you need load generators and selenium is a poor way to go about this (unless you are running grid headless but still). So the target server is what, Windows Server 2012? Google Create a Data Coll...
d759
This is bit tricky to perform in crystal reports as record selection is compulsory applied. However you can overcome this by using sub report. Calculate the report footer using report. This will surely work
d760
You can test for cursor visibility directly with GetCursorInfo() bool IsCursorVisible() { CURSORINFO ci = { sizeof(CURSORINFO) }; if (GetCursorInfo(&ci)) return ci.flags & CURSOR_SHOWING; return false; } I'm not sure what it means for this call to fail so I just have it returning false if it fails.
d761
I am going to explain how it works. But the code you have written is correct. Even I ran the code. let express = require('express'); let app = express(); app.use(express.static('../html&css')); let server = app.listen(8080, function () { app.get(function (req, res) { res.sendFile(); }); }); let port ...
d762
If you want to remove border-bottom of last 'li' element, then use following CSS:- .classname:last-child{ border-bottom:0; } Where classname is the class added to the 'li' element. .hide() will hide the last 'li' element, not border.
d763
you can do something like this: parser = configparser.ConfigParser() parser.read_dict({'section1': {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}, 'section2': {'keyA': 'valueA', 'keyB': 'valueB', ...
d764
Are the "Rules" in database given permission to "Write" * *Go to the firebase console and open your project. *Go to the database and search for "Rules" tab. *Check the rules are set as below { /* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */ "rules": { "...
d765
In JavaScript, variables and functions can't have the same name. (More confusingly: functions are variables!) So that means that this line: let hour = hour(); Is not allowed, because you're trying to reassign the hour variable from being a function to being a value. (This is a side effect of using let. If you had used...
d766
$r = ""; $j = 0; foreach ($orgs as $k => $v) { echo "\n\r" . $v->id . "\n\r"; if (1) { //you don't really need this, because it's allways true $a_view_modl = ArticleView :: model($v->id, $v->id); $connection = $a_view_modl->getDbConnection(); if $orgs is an associative array, it becomes: $r = ...
d767
I have developed a sample application. I have used string as record item, you can do it using your own entity. Backspace also works properly. public class FilterViewModel { public IEnumerable<string> DataSource { get; set; } public FilterViewModel() { DataSource = new[] ...
d768
I have done several projects involving scraping websites to obtain thousands of stock prices each day. The problem, as dano suggested, is related to your error handling: except Exception as e: return None This does nothing to handle failed requests. You can append the failed urls to a list, and at the end of your...
d769
Your Program class is defined as implementing the Runnable interface. It therefore must override and implement the run() method: public void run () { } Since your two Thread objects are using anonymous inner Runnable classes, you do not need and your should remove the implements Runnable from your Program class defin...
d770
Using dynamically created progress bar or referencing it from an id, are both fine. Using a reference from XML allows you to have more control on the progress bars appearance, as you would have designed it sepcifically for your need (like appearance, where it has to appear, etc..). But if that is not the case, you can ...
d771
I think you want to group the first "word" with the hyphen ^(\w+\-)*\w+$ This assumes that you want to match things like XX-XX XXX-X XX-XX-XX-XX-XX-XX-XX-XX XXX But not XX- XX--XX If there has to be a hyphen then this would work ^(\w+\-)+\w+$
d772
Instead of using .Copy to directly paste the values into the destination, you can use .PasteSpecial Paste:=xlPasteValues. I.e. something like .Range("e6").Copy StartSht.Cells(i + 1, 4).PasteSpecial Paste:=xlPasteValues for your first line. Or you can just set the cell equal to the range you're copying, as suggested in...
d773
The problem is most likely that request is not a valid json request. If that is the case then content will be equal to None which means it is not subscriptable.
d774
You can try : app.__vue__.$router.push({'name' : 'home'})
d775
I take no credit for this since I got every bit of it from going through multiple StackOverflow threads, but I got this working with: @interface MyViewController () - (IBAction) toggleSettingsInPopover: (id) sender; @property (nonatomic, strong) UIStoryboardPopoverSegue *settingsPopoverSegue; @end @implementation MyVi...
d776
So I feel your pain in refactoring all of your code. We went through the same thing with one of our apps at work and it was a pain. On the backside of it though, well worth it! The way ionic suggests you to organize your files is not sustainable. I have a couple thoughts and ideas for you based on going through the sam...
d777
Simple way: You could call the CMD version of php from inside node and return the value via node. Hard way
d778
You can use the function getProfile() of the ICCProfile class. Usage: int profileId = ...; ICCProfile iccp = new ICCProfile(profileId, input); ICC_Profile icc_p = iccp.getProfile(); In accordance to the code at google result #1 for twelvemonkeys icc_profile. A: Found a solution. For this Twelvemonkeys package imag...
d779
When your working set (the amount of data read by all your processes) exceeds your available RAM, your throughput will tend towards the I/O capacity of your underlying disk. From your description of the workload, seek times will be more of a problem than data transfer rates. When your working set size stays below the a...
d780
Similar kind of question is answered here You can achieve it using yaml aliases fr: activerecord: attributes: blog: &title_content title: Titre content: Contenu event: *title_content Refer yaml aliases for more info.
d781
Not in a "standards-based" way, no. The X-Windows system is independent of specific window managers, as such, there is no standard way to "maximize" a window. It ultimately depends on the features of the window manager in use...
d782
Both DAO and ActiveRecord are patterns to access data in a Database. DAO stands for "Data Acess Object". Following are the links to the relevant Wikipedia pages to read more about the individual patterns. * *ActiveRecord: http://en.wikipedia.org/wiki/Active_record_pattern *DAO: http://en.wikipedia.org/wiki/Data_acc...
d783
You can copy above code snippet as a service configuration to your services.yaml, which probably roughly looks like this: # app/config/services.yaml services: app.memcached_client: class: Memcached factory: 'Symfony\Component\Cache\Adapter\MemcachedAdapter::createConnection' arguments: [['m...
d784
You can flatten the table before converting it to pandas: https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.flatten >>> table.flatten().to_pandas() a b.c b.d 0 [1, 2] True 1991-02-03 1 [3, 4, 5] False 2019-04-01 Then you can join on column b.d or b.c
d785
getDomain() needs to be added to the scope in the controller... $scope.getDomain = function(url) { // ... return domain; }; Then you can use it in your view... <td colspan="3" class="linkCol"> <a ng-href="{{ad.url}}" target="_blank" title="{{ad.url}}">{{ getDomain(ad.url) }}</a> </td>
d786
I have solved this problem. I have just modify the code and get sollution Here is my modified function function doPendingamt(val,cnt) { var req = Inint_AJAX(); req.onreadystatechange = function () { if (req.readyState==4) { if (req.status==200) { //document.getE...
d787
As they wrote here, htaccess works in all directories except cgi-bin. But, as you can see from here, there's a way around it. Basically, you edit the <Directory "C:/path/to/cgi-bin"> section of your httpd.conf file - and put there whatever would have been in the .htaccess file in cgi-bin. Remember to restart your apach...
d788
You can try something like this: obj= eval(uneval(objSource)); It only works in FF but the idea is to serialize an object and the eval the serialized string instantiating (prototyping) a new object with the same properties as the first one. You can use also the function JSON.stringify as the "uneval" function.
d789
At the beginning of your script, you can use movieclipName._visible=false; Then you modify the same property to reverse that. A: Have you tried: on(load){ this._visible = false; }
d790
Delimiters! new Vue({ el: '#app', delimiters: ['[[', ']]'], data: { title: 'yadda yadda' } Apparently I had previously set them and stopped for whatever reason. (hence the inconsistency)
d791
At the time of writing this is a limitation in Serilog.Expressions, which will hopefully be addressed soon. Update: version 3.4.0-dev-* now on NuGet supports ToString(@l, 'u3'). You can work around it with conditionals: {'level': if @l = 'Information' then 'INF' else if @l = 'Warning' then 'WRN' else 'ERR'} With a f...
d792
Just create a VIEW and SELECT from this VIEW to get what you're looking for.
d793
First, try not to use subqueries at all, they're very slow in MySQL. Second, a subquery wouldn't even help here. This is a regular join (no, Mr Singh, not an inner join): SELECT ud_id FROM user, mycatch WHERE catch_id>'$catch_id' AND user.user_id = mycatch.user_id A: Select m.longitude,m.latitude from user u left j...
d794
You can wrap each job into a coroutine that checks its timeout, e.g. using asyncio.wait_for. Limiting the number of parallel invocations could be done in the same coroutine using an asyncio.Semaphore. With those two combined, you only need one call to wait() or even just gather(). For example (untested): # Run the job,...
d795
viewDidLoad is a method invoked after view has been loaded from nib file. You are not supposed to call it manually. If you have written the code to refresh the controls in viewDidLoad move that into a different method and invoke that method from your button event handler. - (void)adjustControlsForLanguage { NSUse...
d796
To clarify, that's not a button, it's an anchor. You can add a server side event by adding runat=server and an event handler for the OnServerClick event. <a id="EnterToImagesLink" name="EnterToImagesLink" class="EnterLink" runat="server" OnServerClick="MyClickEvent"> </a> A: you can replace the anchor element "a" wi...
d797
I would recommend to design your API as a service loadable with ServiceLoader, similar to DOM API. Thus, your API will be loadable as: Entry entry = ServiceLoader.load(Entry.class).next(); And it will be easy to have many implementations of the same API.
d798
You wrote s in your regular expression instead of \s (meaning whitespace). If you want to enforce that there is exactly one space character (not multiple spaces and not tabs or other whitespace characters) then you can use this: /^[0-9A-Za-z]{1,10}(?: [0-9A-Za-z]{1,10})*$/ If you also want to allow underscores, you ca...
d799
This looks similar to the example shown here: https://wiki.eclipse.org/EclipseLink/Examples/JPA/nonJDBCArgsToStoredProcedures#Handling_IN_and_OUT_arguments The difference is you are using a DataModifyQuery which is designed around JDBC's executeUpdate to execute the query, and so returns an int instead of a resultset. ...
d800
Are you running in development or production mode? SHOW FIELDS FROM foo is done by your model, as you noted, so it knows which accessor methods to generate. In development mode, this is done every request so you don't need to reload your webserver so often, but in production mode this information should be cached, ev...