Posts

Showing posts from August, 2012

c# - Multithreading with the WPF DataGrid? -

c# - Multithreading with the WPF DataGrid? - i have wpf datagrid binded dataset via datagrid's itemssource property in program. current setup, having load-time issues cause gui lock up. possible multithread loading of datagrid populate rows loaded instead of loading rows , populating datagrid currently? i'm new concept of multithreading, help appreciated! the problem access ui controls need be on ui thread, info binding it's hard work in separate thread otherwise relatively easy. in fact case requires bit of trickery. there's illustration here shows how accomplish using info virtualization: http://www.codeproject.com/kb/wpf/wpfdatavirtualization.aspx this solution makes utilize of fact when itemscontrol bound ilist implementation, rather ienumerable implementation, not enumerate entire list, , instead accesses items required display. uses count property determine size of collection, presumably set scroll extents. iterate through onscreen it...

segmentation fault - Core dumped?­­­­ -

segmentation fault - Core dumped?­­­­ - possible duplicate: why core dump file generated ? when programs segfault, message on stderr : segmentation fault sometimes, however, see instead: segmentation fault (core dumped) what 'core'? useful debugging? triggers dumped? these dumps located? a core dump snapshot of computer memory when programme crashed. http://en.wikipedia.org/wiki/core_dump it many things limit core dump, ulimit... http://www.akadia.com/services/ora_enable_core.html to c runtime settings. segmentation-fault

user interface - Scaling all UI elements with respect to aspect ratio to fit screen - Android -

user interface - Scaling all UI elements with respect to aspect ratio to fit screen - Android - i have made ui app looks this: all elements raster , size made fit phone's resolution, nicely. have ui scalable screen resolution while maintaining aspect ratio. have tried approaches no avail. how guys this? can point me right direction ? thanx you have : explicitly declare in manifest screen sizes application supports: "declaring back upwards different screen sizes can impact how scheme draws application on larger screens—specifically, whether application runs in screen compatibility mode." provide different bitmap drawables different screen densities "if application provides bitmap drawables baseline, medium screen density (mdpi), scheme scales them when on high-density screen, , scales them downwards when on low-density screen. scaling can cause artifacts in bitmaps. ensure bitmaps best, should include alternative versions @ different resoluti...

c# - How can I manipulate Winforms chart -

c# - How can I manipulate Winforms chart - i have problem fitting chart: how can adjust or manipulate y-axis numbers start want it? secondly, there way (properties) may help me display graph friendly? can see x-axis name aren't displayed , maybe space b/w gray , bluish bars? any help how display charts friendly welcome you can set interval of each axis: yourchart.chartareas[0].axisy.interval = 17; and can create start @ offset : yourchart.chartareas[0].axisy.intervaloffset = 11; as x-axis labels hard tell without knowing code.. ..but same options apply here too: yourchart.chartareas[0].axisx.interval = 1; to command widths of columns set custom property pixelpointwidth adding gap not possible. all solutions found hacks , best 1 add together dummy series between real info series: chart1.series[0]["pixelpointwidth"] = "33"; chart1.series["gap"]["pixelpointwidth"] = "33"; chart1....

how to use C++11 integral_constant::value_type() -

how to use C++11 integral_constant::value_type() - i learning utilize c++ 11 type_traits, in integral_constant, there function value_type(); i tried got error: typedef std::integral_constant<int, 1> one_t; one_t one_o; one_o.value_type(); ../src/main.cc:13:9: error: cannot refer type fellow member 'value_type' in 'one_t' (aka 'integral_constant') '.' one_o.value_type(); well function value_type() not function name. indeed, definition of integral_constant looks this: template <class t, t v> struct integral_constant { // ... typedef t value_type; constexpr operator value_type() const noexcept { homecoming value; } }; notice value_type typedef template parameter t ( int , in op's example). in add-on there's conversion operator converts integral_constant<t, v> t . it's implicitly called this int = one_o; // same int = 1; to phone call explicitly need utilize operat...

javascript - AngularJS Post Request not catching JSON data return from PHP -

javascript - AngularJS Post Request not catching JSON data return from PHP - i've been sending , requesting info php files using angular's $http service on local server (xampp), ran multiple problems when began doing on web server, hosted publicly. first problem $http.post kept giving me error: could not find www.websitepath.com/object%20object obviously not url entered. fixed using $http service , specifying post type. know fact scripts connecting (as in angularjs script reaching php script) , php script working fine (i loaded myself , got string wanted). however, angularjs keeps giving me this: object {data: "", status: 200, headers: function, config: object, statustext: "ok"} the info seems empty despite fact php script printing out json string. code angularjs script , php script below: var promise = $http({ method: "post", url: fetchtable, data: { choice: 2 }, headers: {'content-type': ...

Elasticsearch: what date does the key in a date_histogram aggregation represent? -

Elasticsearch: what date does the key in a date_histogram aggregation represent? - i'm running date_histogram aggregation. each bucket has key, contains timestamp (milliseconds since unix epoch). my question is: timestamp represent? start of interval specified (day), or end, or middle? thanks in advance. elasticsearch date-histogram

ruby on rails - Why there is discrepanceis in number of instance methods? -

ruby on rails - Why there is discrepanceis in number of instance methods? - while going through ruby monk have seen count of float instance methods 201 when tried in irb showing 114. helpful if create me understand why there alter in number of count in instance methods , on factors instance methods depends on. puts float.instance_methods.count there no discrepancy in total number of instance methods of ruby float class (of same version). number may vary based on ruby version, no 2 same ruby versions have different instance methods. i have seen count of float instance methods 201 what seeing total number of instance methods of extended float class. extension done rails. for example, in rubymonk terminal, instance methods list of float class shows duplicable? in list, not instance method of float class. it's implemented in activesupport extending core object class , deprecated after rails 3.2.13. ruby-on-rails ruby ruby-1.9.3

python - Rolling back database transactions in SQLAlchemy tests with PostgreSQL -

python - Rolling back database transactions in SQLAlchemy tests with PostgreSQL - i building pyramid web application built on top of sqlalchemy , solely relies postgresql database backend. what way have unit tests construction that to speed tests, database transactions rolled @ teardown() , or other clean hook of test suite other tricks speed tests used, e.g. if sqlalchemy , postgresql has corresponding sqlite's :in:memory: database it possible take custom test runner á la py.test if specific features outside standard library unittest framework makes easier write test cases. since question bit similar other question, i'll re-create relevant part of reply here: all test case classes should subclassed base of operations class, defines mutual teardown method: class basetest(unittest.testcase): def setup(self): # makes things nicer if previous test fails # - without subsequent tests fail self.teardown() self.con...

html - uploading file - unable to find file field :input -

html - uploading file - unable to find file field :input - i have html looking this: <div id="promocodesupload"> <div class="qq-uploader"> <div class="qq-upload-drop-area" style="display: none;"> <span>drop </span> </div> <a class="qq-upload-button btn" style="position: relative; overflow: hidden; direction: ltr;">upload <input type="file" name="file" style="position: absolute; right: 0px; top: 0px; font-family: arial; font-size: 118px; margin: 0px; padding: 0px; cursor: pointer; opacity: 0;"> </a> <ul class="qq-upload-list"></ul> </div> </div> and need upload file using capybara automated tests: i have tried many ways unable find file field :input or element not found , on... $code_id = '//*contains(@id,"promocodesupload")]/div/a[contai...

java - Swagger Annotation - not to include parameter when there is no parameter? -

java - Swagger Annotation - not to include parameter when there is no parameter? - i have swagger-jersey2-jaxrs 1.5.1-m2 integrated drop-wizard. have generated next yaml swagger annotations have included on resource , models: --- swagger: "2.0" info: version: "1.0.0" title: "test application" tags: - name: "test" paths: /v1/test/version: get: tags: - "v1test" summary: "version number of test" description: "returns version number of test" operationid: "getversionandbuildinfo" produces: - "application/json" parameters: responses: 404: description: "build number not found." 200: description: "successful operation" schema: type: "array" items: $ref: "#/definitions/testinformation" definitions: testinf...

python - Populate User From Ldap Without Login in Django -

python - Populate User From Ldap Without Login in Django - i'm using django-auth-ldap auth backend in django project. have problem, can't give permissions user before user 1 time logged in. because user object created when user tring login system. i want write task populate user ldap periodically, how can that. can't login each unpopulated user since don't know passwords. i found out can populate user this: django_auth_ldap.backend import ldapbackend ldap_backend = ldapbackend() ldap_backend.populate_user('username') python django ldap django-auth-ldap

jquery - Reinitialise scripts after ajax-load -

jquery - Reinitialise scripts after ajax-load - i have 2 scripts trying initialise each time new posts loaded using ajax-load plugin wordpress. question initialise script , how? here's load more function comes plugin... /* * ajaxloadmore * main function responsible returning 1 true ajaxloadmore instance functions everywhere. * * @since 2.0.0 */ function ajaxloadmore(){ global $ajax_load_more; if( !isset($ajax_load_more) ) { $ajax_load_more = new ajaxloadmore(); } homecoming $ajax_load_more; } // initialize ajaxloadmore(); // think need initialise scripts endif; // class_exists check the 2 scripts trying initialise flexslider , custom funcitona post filter. the flexslider positioned @ footer of page.. <script src="<?php bloginfo('template_directory'); ?>/plugins/flexslider...

android - Getting NullPointerException in NFC-handling code -

android - Getting NullPointerException in NFC-handling code - i got code handling nfc tags stackoverflow i'm getting nullpointerexception while running it: public class mainactivity extends activity { nfcadapter adapter; pendingintent pendingintent; intentfilter writetagfilters[]; boolean writemode; tag mytag; context ctx; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); ctx = this; button btnwrite = (button) findviewbyid(r.id.button); final textview plateno = (textview)findviewbyid(r.id.plate_no); final textview model = (textview)findviewbyid(r.id.model); final textview chasis = (textview)findviewbyid(r.id.chasis_no); final textview engine = (textview)findviewbyid(r.id.engine_no); final textview duedate = (textview)findviewbyid(r.id.due_date); final textview rotexno = (textview)fi...

c - Printing Names using Circular Linked List -

c - Printing Names using Circular Linked List - i working on circular linked list problem , solved it.but got stuck in other problem. programme takes names of persons in circular linked list nodes , prints them. my question programme works fine if , if names 4 characters or less.if length of names exceeds 4,it shows weird behaviour. if length of name 5 characters,then programme stuck on sec iteration of loop of initiate function. if length of name 6 characters or more programme terminates showing names entered. the source code is: #include <stdio.h> #include <stdlib.h> #include <strings.h> #define size 10 #define num_per_line 3 typedef struct node { char name[size]; struct node * next; } clistnode; void get_name(char *a); void print_list(clistnode *end_ptr); clistnode *initiate(int n); clistnode *insert_at_end(clistnode *first,clistnode *end_ptr, char *a); int main(void) { clistnode *list_end_ptr; int n=6; list_end_ptr=initiate(n); print_li...

c# - String Comparison? -

c# - String Comparison? - possible duplicate: differences in string compare methods in c# is there difference between these methods? string.compare(s1, s2) == 0 s1.compareto(s2) == 0 s1.equals(s2) s1 == s2 which 1 should use? from reflector: public static int compare(string stra, string strb) { homecoming cultureinfo.currentculture.compareinfo.compare(stra, strb, compareoptions.none); } public int compareto(string strb) { if (strb == null) { homecoming 1; } homecoming cultureinfo.currentculture.compareinfo.compare(this, strb, compareoptions.none); } so compareto has additional reference check compare . public static bool operator ==(string a, string b) { homecoming equals(a, b); } so == same equals . difference between 2 compare , 2 equals is, can pass compareoptions argument compare , , returns 0/1/-1. while equals doesn't receive compareoptions argument, , can tell true/false only. c# string...

C# time bool always returning false -

C# time bool always returning false - i have bool tells me if current time in between 2 other times go dark @ 8 (20:00) in eve , lite @ 7 in morning.. not sure if should doing 7 or 07 have tried booth still getting false? can tell me why returning false? not much else it's returning false when in between 2 times currently.. gtm timezone london, thanks! public static bool nighttime { { timespan span = lastmoodlightupdate - datetime.now; timespan start = new timespan(20, 0, 0); //dark @ 20:00 timespan end = new timespan(07, 0, 0); //light @ 07:00 timespan = datetime.now.timeofday; homecoming ((now > start) && (now < end)); } } the problem here comparing 2 timespan values simple numeric comparison. as such, no time can both larger 20:00 , smaller 07:00 in terms of values. humans can deal such incongruities, computer can't. you need consider want here: |---------|............................

couchbase bucket goes down when defining a view -

couchbase bucket goes down when defining a view - i have couchbase server 3.0.3 installed on redhat linux . works fine until seek define new view. when seek define view web ui, bucket seek in goes downwards , goes continuous fail-and-restart mode. it never comes up. works fine when delete bucket , re-add stays fine until seek define view. views work fine on osx installation, on macbook. from log: shutting downwards bucket "audit" on 'ns_1@172.....' deletion ns_memcached000 ns_1@172..... 01:51:46 - sat apr 4, 2015 bucket "audit" loaded on node 'ns_1@172.....' in 0 seconds. ns_memcached000 ns_1@172..... 01:51:29 - sat apr 4, 2015 shutting downwards bucket "audit" on 'ns_1@172.....' server shutdown ns_memcached000 ns_1@172..... 01:51:29 - sat apr 4, 2015 shutting downwards bucket "audit" on 'ns_1@172.....' server shutdown (repeated 16 times) ns_memcached000 ns_1@172..... 01:51:27...

android - Changing reenter animation to another item of a list -

android - Changing reenter animation to another item of a list - i have recyclerview images , when press image app opens activity contains viewpager same images in position of 1 selected. i've done transition in lollipop share image between activities using supportpostponeentertransition , supportstartpostponedentertransition in called activity wait until viewpager loaded images start transition. when come in in called activity , when press transitions ok. the problem i'm facing if move image in viewpager of called activity, when press animates image selected @ beginning, not selected one. i've been able alter animated image 1 selected in called activity this: @override public void onbackpressed() { view view = ((imagedetailfragment) adapter.getfragment(viewpager, viewpager.getcurrentitem())).gettransitionview(); viewcompat.settransitionname(view, constants.transition_image); super.onbackpressed(); } but returning same position of original ...

flask - Py2neo searching error -

flask - Py2neo searching error - im still trying create social network py2neo+flask+neo4j. i've got problem while searching database py2neo.i wanna find users username includes special string.for illustration users username includes "dav".i wrote code below , dont know why error... from py2neo import graph graph=graph("http://neo4j:123@localhost:7474/ ") def search(name): users=graph.merge("person") n in users: print n['username'] and error: traceback (most recent phone call last): file "", line 1, in file "/home/ali/desktop/flask/search.py", line 10, in search users=graph.cypher.execute('match (p:person) homecoming p' file "/usr/local/lib/python2.7/dist-packages/py2neo/core.py", line 659, in cypher metadata = self.resource.metadata file "/usr/local/lib/python2.7/dist-packages/py2neo/core.py", line 213, in metadata self.get() file ...

How to set boot disk for SSD in google compute engine? -

How to set boot disk for SSD in google compute engine? - i seek create click deploy website site , select ssd pesistent disk after creation can see google created normal 10gb disk boot , not ssd one, how alter that? even though there 2 pesistent disk now which click-to-deploy machine have created ? example, using lamp stack, sill alternative create info disk ssd. not same disk boot disk, additional one. you may have create gce instance scratch using web gui. in compute engine > disks , have alternative of creating ssd disks can used boot when creating new machine. after done, can install web server. google-compute-engine

rust - Incorrect placement of let -

rust - Incorrect placement of let - i'm making file hold bunch of thing larn rust it's having problem set allow statement on allow a = (1, "hello"); here's little code dump: #[allow(dead_code)] fn main() { } //tuples// allow = (1, "hello"); allow b: (i32, &str) = (1, "hello"); //enums// enum character { digit(i32), other, } allow 10 = character::digit(10); allow 4 = character::digit(4); you can utilize let in functions. global variables can defined static keyword, , have lot of limitations compared local variables. please read the official book, covers questions this. rust

sql - vbScript - InputBox into .accdb , blank? -

sql - vbScript - InputBox into .accdb , blank? - after 9 hours of research , trial , error, i've come of current issue having script wrote input info database. i'll simplify focal point of problem in code view. have 3 fields, 1 timestampe @ end of sql such .... & now() & "')". inserts find, variable inputboxes insert blank data. option explicit dim ib dim sql1, constring, con constring="provider=microsoft.ace.oledb.12.0;data source=c:\users\user\documents\database1.accdb;" sql1="insert table1 (column1) values('" & ib & "')" set con = createobject("adobd.connection") con.open constring ib=inputbox("input data") if ib="quit" or ib="quit" con.close else con.execute sql1 end if loop while ib<>"quit" , ib<>"quit" it appending rows database, blank. ive designed table take short text of <255 chars. i ran test ...

c# - PDFSharp WPF 1.32 private fonts will not work with Azure Blob storage -

c# - PDFSharp WPF 1.32 private fonts will not work with Azure Blob storage - i have code adds text using private font pdf file using pdfsharp. works if font located on local file scheme not work when provide url font stored on azure blog storage. tried using google font on cdn, didn't work. there problem loading fonts web url? the sample code below. note have solved cors issue on azure blob storage isn't that. private readonly xpdffontoptions _fontoptions = new xpdffontoptions(pdffontencoding.unicode, pdffontembedding.always); private static readonly xprivatefontcollection privatefontcollection = xprivatefontcollection.global; [test] public async task test01rawpdfsharp() { //setup var business relationship = "labelapptest"; var fs = new filestore(account); var fonturl = "http://labelapptest.blob.core.windows.net/designernospamcom/justyna sokolowska - erazm-regular.otf"; var pdfurl = "https://lab...

IOS save image in document folder with set dimanation (width and height ) -

IOS save image in document folder with set dimanation (width and height ) - get image uimageview , save in app document folder done problem when image big resolution how set fixed width , height image here code please help me nsinteger n=100000000; nsuinteger r = arc4random_uniform(n) + 1; nsstring *myimagename=[nsstring stringwithformat:@"image%lu.png",(unsigned long)r]; nsdata *pngdata = uiimagepngrepresentation(self.myimage.image ) ; nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentspath = [paths objectatindex:0]; //get docs directory nsstring *filepath = [documentspath stringbyappendingpathcomponent:myimagename]; //add file name [pngdata writetofile:filepath atomically:yes]; + (uiimage*)imagewithimage:(uiimage*)image scaledtosize:(cgsize)newsize; { uigraphicsbeginimagecontext( newsize ); [image drawinrect:cgrectmake(0,0,newsize.width,n...

javascript - Emberjs application loads on all routes except Index -

javascript - Emberjs application loads on all routes except Index - i'm going seek best , break downwards problem im facing here, , basic summary have ember-cli project , no matter index route not load. other routes load fine. //broken route image http://i.stack.imgur.com/kb7mw.png //working route image http://i.stack.imgur.com/yzhed.png at first thought maybe handlebars template. updated latest version of ember-cli , used htmlbars, still not showing. traced promise see if there hope there: vm66628:70 ember inspector (promise trace): ember: process errors router @ new promise (http://localhost:4200/assets/vendor.js:59149:9) @ promise.then (http://localhost:4200/assets/vendor.js:59387:21) @ object.transition.then (http://localhost:4200/assets/vendor.js:56759:29) @ didbegintransition (http://localhost:4200/assets/vendor.js:34821:16) @ emberobject.default.extend._dourltransition (http://localhost:4200/assets/vendor.js:34104:7) @ emberobject.default.extend.handleurl (h...

ios - How to parse a string in SWIFT -

ios - How to parse a string in SWIFT - how parse info string? trying parse out "@usernames" , "rt" retweets twitter string. the info comes this "@username hey random tweet #whatsup @username2 blah blah" how go parsing info out? pull tweet info , set variable called currenttweet you utilize twitter-text , bridging header. ios cocoa-touch swift

winapi - What is the use of CListCtrl::GetItemData()? -

winapi - What is the use of CListCtrl::GetItemData()? - can please help me know, utilize of clistctrl::getitemdata() in mfc, vc++ ? i went through msdn description not clear enough. if can provide brief explanation , illustration great , help lot. the item info allows associate info want each item of list control. info of time pointer info structure. for illustration in email application have list command containing received emails. each item contains illustration sender, subject , date. item info contain pointer info construction contains whole mail service text amoung other information. winapi visual-c++ mfc clistctrl

java - Match the last occurrence of a word in a string -

java - Match the last occurrence of a word in a string - currently, implementing textbox in java swing, highlights keywords. referenced 2nd reply given in this question. however, want lastly occurrence of word highlighted. for example, when user typing "i have swimming @ school @ 7pm" , want textbox highlight sec "at" . have tried using negative lookahead in regex. not working. i used (at(?!.at)|from|by))) instead of (at|from|by) what have tried (referenced link provided): if (wordr == after || string.valueof(text.charat(wordr)).matches("\\w")) { if (text.substring(wordl, wordr).matches("(\\w)*(at(?!.at)|from|by)")) setcharacterattributes(wordl, wordr - wordl, attr, false); else setcharacterattributes(wordl, wordr - wordl, attrblack, false); wordl = wordr; } i think regex not working checking happening...

blogger - Blogspot obscures CSS based background -

blogger - Blogspot obscures CSS based background - ( blog url: http://chainlinkandconcrete.blogspot.com/ ) alright, have figured out how edit template have 300kb background image. real easy , basic way it. until accessed blog desktop much higher resolution monitor own, discovered wasn't resizing fit browser window. want fill browser window , kind of remain there statically. lots of blogs this. no problem, figure: googled issue, found bit of css help it. here's code started with: body{ background: url(<image url goes here>) no-repeat center center fixed; background-size: cover; margin:0; } tossed body { } section, few tutorials mention, css tool platform has. seems should it, right? well, appears to, except background there brief moment. background want loads, blog content loads, , default blog background sort of obscures image want. if i'm utilizing code, how create blog have no background image url toss in stays visible while blog p...

java - Why jTable change the order from an arraylist? -

java - Why jTable change the order from an arraylist? - example hava arraylist. = {2,1.5, 1.51, 1.4} when fill columns. jtable show me this: an={1.4, 1.51,1.5, 2} this code i've done. void verdatos(){ string [] titulos= {"n","an","bn","pn","f(pn)"}; tabla=new defaulttablemodel(null,titulos); object []object = new object[6]; arraylist iteraciones = new arraylist(); iteraciones = biseccion.getiteraciones(); arraylist = new arraylist(); = biseccion.getan(); arraylist bn = new arraylist(); bn = biseccion.getbn(); arraylist fpn = new arraylist(); fpn = biseccion.getfpn(); collections.reverse(fpn); (int = 1; < iteraciones.size(); i++) { object[0] = ; object[1]= an.get(i); object[2]= bn.get(i); object[3]= iteraciones.get(i); object[4] = fpn.get(i) ; tabla.addrow(object); } jtblnumerica.setmodel(tabla); } ...

DLR Scripting within Silverlight 4 Application -

DLR Scripting within Silverlight 4 Application - i add together scripting back upwards silverlight 4 application i'm working on. have latest stable releases of both ironruby , ironpython installed on machine visual studio 2010. looked @ samples of using scriptengine class both ironruby , ironpython. got work in little windows forms app create sure code works. however, can't seem add together reference required assemblies/dlls silverlight 4 application. here's scriptengine code: scriptengine engine = ruby.createengine(); engine.runtime.globals.setvariable("mainpage", this); string code = "mainpage.txttitle.text = \"hello ironruby!\""; engine.execute(code); and, here's using statements requires: using ironruby; using microsoft.scripting.hosting; when seek add together reference next assemblies/dlls ironruby 1.0 release, visual studio 2010 doesn't allow me add together them , provides no exception message why....

xmpp - Robot for AIM, Samtime, OCS, etc -

xmpp - Robot for AIM, Samtime, OCS, etc - we know google supplied robots of gtalk , such en2de@bot.talk.google.com translates messages send english language german. and want know there robot im accounts on-line aim, sametime, ocs, etc. i don't care robot can do, @ to the lowest degree echo send it. thanks. sametime not public im service, depend on company if have sametime bots running. xmpp robot ocs aim sametime

content-length when using http compression -

content-length when using http compression - the client making range request 0-1023 http server. prefers gzip compression accept-encoding: gzip;q=1.0, identity; q=0.5, *;q=0 in request. what content-length in response header? 1024 or size of compressed data. thanks, it's smaller of 1024 or compressed size. rfc2616 section 14 says: " [ rest of reply has no relevance actual question asked. i'm leaving in because people found useful. ] rfc 2616 has (amongst other things) content-length: applications should utilize field indicate transfer-length of message-body, unless prohibited rules in section 4.4. so have figure out transfer-length is; section 4.4 (message length) says these 2 things transfer-length: the transfer-length of message length of message-body appears in message; is, after transfer-codings have been applied. if content-length header field (section 14.13) present, decimal value in octets represents both entity-...

How to include one c# file into another c# file? -

How to include one c# file into another c# file? - how include 1 c# file c# file? i have 2 c# file 1 test.cs , 1 main.cs. want include test.cs main.cs. test.cs file code // can utilize console.writeline debugging using system; using system.collections.generic; using system.collections; using system.linq; using system.text; using system.threading.tasks; class solution { public bool solution(long number1, int[,] arr1,int dim_2,int dim_3) { //some code here } } main.cs code using system; include test.cs; class grouping { public static void main(string[] args) { long number1 = 5; int [,] arr1 = new int[,] {{0, 0},{1, 1},{2, 2},{3, 3},{4, 4}}; int dim_2 = 5; int dim_3 = 2; solution object_class = new solution(); bool result = object_class.solution ( number1, arr1, dim_2, dim_3 ); console.writeline("return :"); console.writeline( result ); } } what doing wrong ...

java - How to use HttpComponentsClientHttpRequestFactory with RestTemplate efficiently? -

java - How to use HttpComponentsClientHttpRequestFactory with RestTemplate efficiently? - i using resttemplate along mill httpcomponentsclienthttprequestfactory in 1 of projects. in project, need create http url phone call server running restful service returns response json string. below code - public class getuserclientdata { public string getdata(keyholder keys) { homecoming new httprequestaccess(keys).makehttprequest(); } } below class wraps httpclient part - public class httprequestaccess { // should static? private resttemplate resttemplate; private keyholder keys; private int timeout; public httprequestaccess(keyholder keys){ this(keys.gettimeoutvalue()); // setting timeout resttemplate this.keys = keys; } public httprequestaccess(int timeout) { this.timeout = timeout; resttemplate = new resttemplate(clienthttprequestfactory()); } private clienthttprequestfactory clientht...

reactjs flux - Should view call the store directly? -

reactjs flux - Should view call the store directly? - from flux's todomvc example, saw todoapp component asking store states. should view create action , allow dispatcher phone call store instead? the views listening stores' "change" event called controller-views, because have 1 controller-like aspect: whenever stores change, info stores , pass children through props. the controller-views views should calling stores' getters. getters should public api stores expose. stores have no setters. it's tempting phone call stores' getters within render() method of component deep in tree, anti-pattern. violates unidirectional info flow, making more hard understand flow of info through application, , , makes rendering more expensive. in todomvc flux example, todoapp component controller-view. reactjs-flux flux

data visualization - Vizualisation tool for Apache Cassandra -

data visualization - Vizualisation tool for Apache Cassandra - i new cassandra user. searching visualization tool (open-source or licensed) can utilize build visualization (graph, etc.) based on info stored in cassandra server ? i not sure whether such tool exists, nice if allow have olap style visualization. mean user able select info wants include or not in graph... currently have below gui tools interacting cassandra cluster. cassandra cluster admin – similar phpmyadmin mysql, graphical administration tool features simple interface can display cassandra info in columns, rows, , range slices. allows keyspace, column family, , row manipulation. opscenter – provided datastax, opscenter finish info infrastructure management tool allowing manage, monitor , command cassandra. provides wide range of visualization help see going on databases. cassandra gui 2.0 – designed create management easier, graphical tool cassandra features row view explorer , filtering...

Saving and Loading files from an Android mobile Device using Flash Actionscript 3.0 -

Saving and Loading files from an Android mobile Device using Flash Actionscript 3.0 - im making test maker app both desktop , android. able save , load in desktop failed on android. can save file, cannot load saved file. android device says "no files found". doesnt open file browser. type of saving , loading im doing type user can project , open it. im using filereference this. works on desktop not on android mobile. can help me this? i'm pretty sure can't utilize filereference on mobile (though sense free right me if wrong). on mobile, should utilize file & filestream classes loading/saving local files. here example, of using compile time constant create (to determine if desktop or air) , loading appropriately , out of textfield called textfield : config::air { var file:file = file.applicationstoragedirectory.resolvepath("myfile.txt"); if(file.exists){ var stream:filestream = new filestream(); stream.o...

android - Is it possible to increase or decrease time to appear system popup when try draw wrong pattern lock? -

android - Is it possible to increase or decrease time to appear system popup when try draw wrong pattern lock? - how can increasing or decreasing time wrong 5 effort pattern? please check code: devicepolicymanager mgr = (devicepolicymanager) context .getsystemservice(context.device_policy_service); int attempts = mgr.getcurrentfailedpasswordattempts(); seek { // if counter exceeds more 3 service fire. if (attempts > 3) { } count++; } grab (exception e) { e.printstacktrace(); } log.i("lock attmepts", string.valueof(attempts)); my main question 5 time effort wrong draw pattern lock ans comes scheme time 30 sec want increment or decrease time possible or not? , if possible how can done that? android

css background static? -

css background static? - if wanted background deosnt move(stays static) page moves when scrolling, if mean!! this background code: background: #fff url(back1.png) ; as you're using shorthand background property, add together fixed end of rule: background: #fff url(back1.png) fixed; this background-attachment property, if expand out it's this: background-color: #fff; background-image: url(back1.png); background-attachment: fixed; css

osx - How can I compile GCC on a mac so compiled executables will work on earlier versions of OS X? -

osx - How can I compile GCC on a mac so compiled executables will work on earlier versions of OS X? - i'm attempting build programme (dwarf fortress) uses c++0x features aren't supported in latest leopard version of xcode. there important speed boost using gcc 4.5, we've decided build our own. however, causes resulting executables not work on tiger, citing missing symbols in libc. presumably, gcc beingness built against leopard sdk, not installed tiger sdk, reasonable annoying. how create build against tiger's? you need pass -mmacosx-version-min=10.5 ld, tell link against appropriate symbols in libc. osx gcc c++11 tiger

how to have an excludes list in ant build script? -

how to have an excludes list in ant build script? - i'm trying add together excludes list ant build script. have property (lets phone call build.excludes) looks this: build.excludes=myapp,anotherapp in build script have if statement similar following: <for list="${appslist}" delimiter="" trim="true" param="currentapp" keepgoing="yes"> <sequential> <if> <!-- check if current build item in build.excludes list --> <then> <!-- build of project happens here --> </then> </if> </sequential> </for> the way can think of doing have loop iterate on build.excludes list , (but don't know set loop... perhaps in macro?). thanks! edit: ant 1.6.5 , can't upgrade. looks you're using ant-contrib for task. if supports same elements ant condition task, has been around long pl...

actionscript 3 - How listener will be executed for objects hidden by another objects in as3? -

actionscript 3 - How listener will be executed for objects hidden by another objects in as3? - i have 2 movie-clips, 1 small-box , big-box .both rectangular shape. small- box has index 0, , big-box has index 1. x,y same , big-box beingness big in size gets hide small-box. problem listener attached small-box not fire big-box on top of small-box. way listener fired when click on small-box area?? set mouseenabled = false on clip covering button create clicks go trough objects below. if boxes have children of own, may need set mousechildren = false . actionscript-3 sprite flash-cs3 movieclip

ios - Is there a way to download Xcode on its own? -

ios - Is there a way to download Xcode on its own? - is there way download xcode on own, without ios sdk? have slow net connection , take 3 or hours download, don't need ios sdk @ all. any help appreciated!! :) you can download xcode (seemingly on own) mac app store now: http://itunes.apple.com/us/app/xcode/id422352214 xcode ios

cocoa - Intercept keyboard input in OSX -

cocoa - Intercept keyboard input in OSX - i'm trying write application prevents key signals propagating beyond os in osx. clarify, want create seems user key pushing on keyboard broken. so, associated letter won't show in textarea, key won't activate function in application, etc. ideas? in advance. you want quartz event taps. note process need running "root" privileges intercept events @ scheme level. see http://stackoverflow.com/questions/1776567/osx-quartz-event-taps-event-types-and-how-to-edit-events cocoa osx

python - How to get diff time from kernel input keyboard events(from key pressed to release)? -

python - How to get diff time from kernel input keyboard events(from key pressed to release)? - i'm trying write python code capture events /dev/input/event* on linux. events want filter event type, event value, event code , time(tv_sec , tv_usec). problem: eventtype=ev_key , event_code = 0,1,2 (where 0=key_release,1=key_pressed,2=key_repeat), want difftime key_pressed(code 0) , key_released(code 1) (time_pressed - time_released) if key repeated (event code 2). any thought ? as starting point, based on a solution treviño, here quick , (mostly) dirty way capture keyboard events , study timings: import struct format = 'llhhi' event_size = struct.calcsize(format) ev_key = 0x01 key_down = 1 key_auto = 2 key_up = 0 devname = "/dev/input/event0" def dt(sec_a, usec_a, sec_b, usec_b): homecoming (sec_a+usec_a/1000000.) - (sec_b+usec_b/1000000) open(devname, "rb") infile: kdtime = {} while true: event = infile.read...

perl cpan strange behavior -

perl cpan strange behavior - after upgrading os x yosemite , installing cpan (ver 2.00), cannot see text type when in cpan session. give more detail, installing modules through cpan works, running commands in cpan works, cannot see type in given instance of cpan. in attached illustration screenshot, type 'help' in cpan session , expected output, word 'help' not visible @ command line. have no clue start troubleshooting. insight appreciated. many thanks! perl cpan interactive-session

about pointers in c++ -

about pointers in c++ - in next questions, p1,p2, abd p3 pointers intergers. in origin of each question *p1 , *p2 both have value 10. after executing next statements, value of *p1 , *p2 p3 = null p3 = p1 p1 = p2 p2 = p1 the way did ended getting 10 both same way started. p3 = null p3 = p1 ;now p3 set 10 p1 = p2 ;now p1 set 10 p2 = p1 ;now p2 set 10 but don't think i'm understanding correctly. the lastly line sets p2 p1, set p2; both p1 , p2 point original target of p2, contains value 10. c++ pointers

onclicklistener - android onclick for several custom Views issue -

onclicklistener - android onclick for several custom Views issue - good morning, i'm drawing 9 customviews in 1 ralativelayout. i want assign on click listener each view. the issue when click on 1 of these view, reference lastly drawed view, if clicked on first one. here code: public class mainactivity extends activity { mysurfaceview view; relativelayout layout; list<customcircles> circlesarr; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); layout = (relativelayout) findviewbyid(r.id.relativelayout); viewtreeobserver vto = layout.getviewtreeobserver(); vto.addongloballayoutlistener(new viewtreeobserver.ongloballayoutlistener() { @override public void ongloballayout() { layout.getviewtreeobserver().removeongloballayoutlistener(this); int width = layout.getmeasuredwidth(); int height = layout.ge...

angularjs - Ionic Show Google Map Result from Json file -

angularjs - Ionic Show Google Map Result from Json file - i doing assignment. there 1 scenario user search companies' name, etc. user click result --> shows company details include map. know how pass json file's location data(a long list,i paste hereinbelow short one) view. also, how create mark on showed map. used setcenter got wrong result. tks reply in advance. attach here js, html , css. class="snippet-code-js lang-js prettyprint-override"> angular.module('starter', ['ionic']) .run(function($ionicplatform) { $ionicplatform.ready(function() { if(window.cordova && window.cordova.plugins.keyboard) { cordova.plugins.keyboard.hidekeyboardaccessorybar(true); } if(window.statusbar) { statusbar.styledefault(); } }); }) .controller('mapcontroller', function($scope, $ionicloading) { google.maps.event.adddomlistener(window, 'load', function(pos) { ...

sql - get all dates between multiple date range from mysql table -

sql - get all dates between multiple date range from mysql table - this my mysql table: name leavetype -------------------------------------------------- ravi 2015-01-01 201-01-02 casual leave sudha 2015-01-02 201-01-02 sick leave expected output 2015-01-01 ----------- 1. ravi cl 2015-01-02 ------------- 1. ravi cl 2. sudha sl this mysql query: select leave_id, emp_id, employee_id, name, `from`, `to` emp_leave hod_id='42' , from` between '2015-4-01' , '2015-04-10' , `to` between '2015-4-01' , '2015-04-10' order `from` your to dates have wrong year. have 201-01-02 instead of 2015-01-02 . 1 time that's fixed, , query changed have right dates , prepare syntax error, it works fine. if it's still not working, it's possible whatever hod_id isn't 42 . be careful date formatting. many systems ...

Android Left sliding menu bar -

Android Left sliding menu bar - hi looking sliding menu similar below availble in ios, looking similar in android, there reference code available similar this. https://github.com/romaonthego/refrostedviewcontroller/raw/master/demo.gif i think drawerlayout in android. seek tutorial. more details, can read document. in case need root layout in drawerlayout instead of listview. illustration in case: <android.support.v4.widget.drawerlayout android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center_vertical"> <!-- main content view --> <framelayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#f4f4f4" /> <!-- navigation drawer --> <linearlayout ...

mysql - SymmetricDS messes up with tripple foreign key -

mysql - SymmetricDS messes up with tripple foreign key - i have database supposed synchronized using symmetricds. there next queries, building base: create table `defectstdreference` ( `std_doc_id` bigint(20) not null comment 'Идентификатор НТД', `improve_notice_doc_id` bigint(20) not null comment 'Идентификатор предписания', `defect_id` int(11) not null comment 'Идентификатор дефекта', `paragraph` varchar(4000) not null comment 'Пункт НТД', `reference_id` bigint(20) not null auto_increment comment 'Идентификатор ссылки на пункт НТД', `client_id` bigint(20) default null, primary key (`reference_id`), key `relationship70` (`std_doc_id`), key `relationship72` (`improve_notice_doc_id`,`defect_id`,`client_id`), constraint `relationship70` foreign key (`std_doc_id`) references `std` (`doc_id`) on delete no action on update no action, constraint `relationship72` foreign key (`improve_notice_doc_id`, `defect_id`, `client_i...