text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
at a minimum, therefore minimizing the chances of me doing something stupid. **Of course, if you have something to add, to show us, to tell what is wrong in doing it or what can be improved, I'll be glad to hear from you.**
[ 0.7927436232566833, 0.3337950110435486, 0.23018229007720947, 0.04861501604318619, -0.1966158151626587, -0.06567469984292984, 0.4104747772216797, 0.24248524010181427, -0.14641472697257996, -0.4825406074523926, -0.35098546743392944, 0.1225547268986702, 0.3246516287326813, 0.04620287567377090...
I am using Maven 3 to build a java application with 3 tiers - server, ejb and ui. The EJB project is dependent on the Server project, and the UI project is only dependent on EJB, and provides an exclusion for the Server transitive dependency. When the UI project is built as a war, the Server dependency is being includ...
[ 0.04292164370417595, 0.29218968749046326, 0.4447745978832245, -0.3631124794483185, -0.18926993012428284, 0.0697132796049118, 0.22524568438529968, -0.5365191698074341, -0.036877892911434174, -0.8875068426132202, -0.10208521038293839, 0.31781286001205444, -0.38608598709106445, 0.312543928623...
+- commons lang:commons lang:jar:2.4:compile | | +- commons digester:commons digester:jar:1.8:compile | | \- commons beanutils:commons beanutils core:jar:1.8.0:compile | +- org_common:_security_lib:jar:16.0.006:compile | \- org.springframework:spring:jar:2.0:compile +- **project.name:EJB:ejb client:cli...
[ -0.43671342730522156, 0.5850785970687866, 0.4659695327281952, 0.06427555531263351, -0.3899194896221161, -0.013100748881697655, 0.07958593219518661, -0.39099371433258057, -0.5794481635093689, -0.6912825703620911, -0.32390284538269043, 0.31047317385673523, -0.34316375851631165, -0.0971975773...
+- commons digester:commons digester:jar:1.8:compile | | \- commons beanutils:commons beanutils core:jar:1.8.0:compile | +- org_common:_security_lib:jar:16.0.006:compile | \- org.springframework:spring:jar:2.0:compile +- **project.name:EJB:ejb client:client:1.0 SNAPSHOT:compile** | +- **project.name:Server...
[ -0.2824517786502838, 0.47458088397979736, 0.2561701238155365, 0.21841488778591156, -0.3309129774570465, -0.053843576461076736, 0.15997633337974548, -0.3201065957546234, -0.5609151124954224, -0.5208578705787659, 0.1028459221124649, 0.22614380717277527, -0.5594542026519775, 0.156415984034538...
to be included that does not show up in dependency:tree? The parent POM defines the modules as: ``` <modules> <module>Server</module> <module>EJB</module> <module>UI</module> </modules> ``` The dependency listed in the EJB POM is: ``` <dependencies> <dependency> <groupId>project.nam...
[ -0.1015949696302414, -0.11697136610746384, 0.7816681861877441, -0.1373758167028427, 0.18045049905776978, -0.1212078258395195, -0.4480951428413391, -0.3311760425567627, -0.20885026454925537, -0.635458767414093, -0.5481570959091187, 0.30524787306785583, -0.10685625672340393, -0.1462993621826...
<dependency> <groupId>project.name</groupId> <artifactId>EJB</artifactId> <version>${project.version}</version> <type>ejb-client</type> <exclusions> <exclusion> <groupId>project.name</groupId>
[ -0.221738800406456, 0.1352640837430954, -0.05988949537277222, -0.16389533877372742, -0.45808395743370056, 0.006430278532207012, -0.016506850719451904, -0.2915390431880951, -0.4116136431694031, -0.5200988054275513, -0.15349087119102478, -0.1020994782447815, -0.40546759963035583, 0.190498277...
<artifactId>Server</artifactId> </exclusion> </exclusions> </dependency> </dependencies> ``` I am aware that I can explicitly exclude the Server jar from being included in the WAR, but I would prefer to fix the actual issue. As we figured out in comments, the problem's source was b...
[ 0.09942290186882019, 0.5001625418663025, 0.3080673813819885, -0.10904831439256668, -0.3482990264892578, -0.09025859832763672, 0.3840548098087311, 0.0413852296769619, -0.06046632304787636, -0.525443434715271, 0.08653758466243744, 0.5501244068145752, -0.5727870464324951, 0.30055883526802063,...
there: > Which exact Maven version do you use? If not 3.0.4, try it and tell if it helps. I've found really, REALLY crappy issues while using previous Maven 3 releases, mostly with 3.0.2.
[ 0.1593526005744934, -0.01875988207757473, 0.13223424553871155, -0.07769718021154404, -0.2278163582086563, -0.04027813300490379, 0.23741872608661652, 0.13172033429145813, 0.11824274063110352, -0.6380955576896667, 0.00889504048973322, 0.7895769476890564, -0.012675842270255089, -0.31739985942...
I found another similar question: [Best way to download images from XML content](https://stackoverflow.com/questions/9002019/best-way-to-download-images-from-xml-content) in StackOverflow, but not exactly the same. I have multiple small images from XML content and I have control over both server and client side. Shall...
[ 0.1151120737195015, -0.049660053104162216, 0.6265285611152649, 0.14924906194210052, -0.32153457403182983, -0.08103005588054657, -0.16667360067367554, -0.20364858210086823, -0.29712289571762085, -0.5684545636177063, 0.030910475179553032, 0.5846260786056519, -0.274541974067688, -0.1978701055...
has solved the issue. My comment there: > Which exact Maven version do you use? If not 3.0.4, try it and tell if it helps. I've found really, REALLY crappy issues while using previous Maven 3 releases, mostly with 3.0.2.
[ 0.07766029238700867, 0.13040116429328918, 0.13285401463508606, -0.03164757788181305, -0.11503807455301285, -0.09069550037384033, 0.17547044157981873, 0.009941650554537773, 0.01987539231777191, -0.567892849445343, -0.08157457411289215, 0.6662594676017761, 0.022067975252866745, -0.1827054172...
Is anybody using Neo4j with the REST API in production? I've been looking at different implementations of the REST API out there and noticed this one has been downloaded quite a few times <http://hg.readify.net/neo4jclient/overview> Ryan, I'm one of the devs on the library. Our day-to-day project has a dedicated team...
[ 0.8522462248802185, 0.13286352157592773, -0.03957642987370491, 0.3088280260562897, -0.21578942239284515, -0.23414580523967743, 0.300559937953949, 0.11879123002290726, -0.46504175662994385, -0.625194251537323, -0.2564269006252289, 0.39909979701042175, 0.015339061617851257, 0.038234692066907...
I'm sure this is a simple thing to do but in php I need to make a 32 byte emptied out variable (i.e. it is all zeroes). I am trying to decode in php an AES encrypted message where the initialization vector is all zeroes. If I use null or 0 then I get an error that it needs to be 32 bytes and if I use "00000000000000000...
[ 0.013661500066518784, 0.4509495496749878, 0.1117004007101059, 0.011322188191115856, -0.3879455626010895, 0.17513692378997803, 0.3526838421821594, 0.07222346216440201, -0.21810895204544067, -0.37302571535110474, 0.371907502412796, 0.33636346459388733, -0.377436101436615, 0.10995206236839294...
I want to run `Nuint` in Visual, so I set ``` <StartAction>Program</StartAction> <StartProgram>$(NUNIT_PATH)\nunit.exe</StartProgram> <StartArguments>Test.dll</StartArguments> <StartWorkingDirectory>Test\bin\Debug</StartWorkingDirectory> ``` in my csproj file. But it stll does not work. If by "all zero" you mean *ze...
[ 0.11999443918466568, 0.012537551112473011, 0.10827559232711792, -0.17475053668022156, -0.13024476170539856, 0.2935526371002197, 0.40118661522865295, -0.3113708198070526, 0.021530115976929665, -0.7905474305152893, 0.18292813003063202, 0.45856407284736633, -0.23069411516189575, -0.0331178046...
I've been looking around here for any reference to a java library for visual representation of graphs but I only find libraries for histograms, pie charts, and others. I'm looking for a library for graphs, the ones with vertex, nodes and all that. Anyone could recomend any? I would go with [JUNG](http://jung.sourceforg...
[ 0.17287728190422058, 0.26669085025787354, 0.15131355822086334, 0.26993855834007263, -0.28139445185661316, -0.04937751963734627, 0.27885526418685913, 0.14502167701721191, -0.6624658107757568, -0.8190308213233948, 0.037181831896305084, -0.1280849277973175, -0.017940951511263847, 0.1957456618...
How to I can remove posts from a specific category from homepages in wordpress? I want to do it by category's name or id or ... I use the loop to get my posts like these: ``` if (!have_posts()) : while (have_posts()) : the_post(); ``` thanks a lot you can use this function, there's no need to know what your cat-id ...
[ 0.09424509853124619, -0.09646820276975632, 0.4663752317428589, -0.21538518369197845, -0.05939226970076561, -0.1844010353088379, 0.15930643677711487, -0.3001158535480499, -0.047641951590776443, -0.5516759157180786, -0.20334935188293457, 0.4676811695098877, -0.5817046761512756, 0.12704963982...
I'm wanting to be able to build a WCF service which achieves the following: * RESTfully exposes JSON * RESTfully exposes XML * Exposes SOAP * Other bindings if necessary The key here, is that I want to do this all **via configuration**, and only one function written in code for each required method, rather than havin...
[ 0.43779584765434265, 0.02222566492855549, 0.2952522039413452, -0.0964282900094986, -0.5133880376815796, -0.3149884343147278, 0.39150890707969666, -0.40823230147361755, 0.036012887954711914, -0.7796201109886169, -0.13189899921417236, 0.7552785277366638, -0.16642102599143982, -0.093880139291...
access them via URL, but the WSDL throws an error - i.e. if someone wanted to reference/consume the service via SOAP it would fail at the WSDL import step. The code for the service is below, as well as the configuration, and the service is hosted locally for testing under <http://localhost/WCF>. The following 2 RESTfu...
[ -0.03139054775238037, -0.004783138632774353, 0.6005570292472839, 0.15338563919067383, 0.12853850424289703, -0.12416841834783554, 0.2851094901561737, -0.05367472395300865, -0.029254071414470673, -0.7460187077522278, -0.41703787446022034, 0.5496275424957275, 0.13255637884140015, 0.1488663107...
have multiple webHttpBindings in the config (i.e. has to be done via separate methods and attributes such as `ResponseFormat=ResponseFormat.Json`) for WSDL generation to be valid? Or have I configured something incorrectly here? Any help appreciated, would be so much more straightforward to do it via config that extra...
[ 0.15466052293777466, -0.022669026628136635, 0.6577451825141907, 0.0010183413978666067, -0.04127052053809166, -0.15591762959957123, 0.5957722067832947, -0.5383058786392212, -0.30161604285240173, -0.6173226237297058, -0.23642516136169434, 0.3651365637779236, -0.18682226538658142, 0.160218894...
System.ServiceModel.Description.WsdlExporter.ExportEndpoint(ServiceEndpoint endpoint, XmlQualifiedName wsdlServiceQName) at System.ServiceModel.Description.WsdlExporter.ExportEndpoints(IEnumerable`1 endpoints, XmlQualifiedName wsdlServiceQName) at System.ServiceModel.Description.ServiceMetadataBehavior.Me...
[ -0.23425577580928802, -0.13421443104743958, 0.7028138041496277, 0.10574072599411011, 0.036694008857011795, 0.17816106975078583, 0.5483351945877075, -0.49033787846565247, -0.15668223798274994, -0.8272184729576111, -0.6012731790542603, 0.3573286831378937, -0.08707623183727264, 0.317314118146...
Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(Message...
[ -0.4532158374786377, 0.0035350644029676914, 0.5826688408851624, 0.03904192894697189, -0.14916737377643585, 0.3940744698047638, 0.3548280894756317, -0.7048149108886719, -0.38345417380332947, -0.4846375286579132, -0.3942233622074127, 0.5480332374572754, -0.25153836607933044, 0.19438275694847...
address="soap" binding="basicHttpBinding" name="soap" contract="WCF.IService1"></endpoint> <endpoint name="mex" address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> <host> <baseAddresses> <add baseAddress="http://localhost/WCF"/> </baseAddresses> ...
[ -0.23912832140922546, -0.0745907798409462, 0.2727231979370117, -0.1652487963438034, -0.4070625305175781, 0.37305665016174316, 0.36786720156669617, -0.5547894239425659, -0.10510429739952087, -0.6759679317474365, -0.09088893234729767, 0.44939619302749634, -0.07493367791175842, 0.252645611763...
<serviceMetadata httpGetEnabled="true"/> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name="jsonBehavior"> <webHttp defaultOutgoingResponseFormat="Json"/> </behavior> <behavior name="restBehaviour"> <webHttp/> </behavior> </e...
[ -0.2536969780921936, -0.2540469467639923, 0.34881091117858887, -0.3043164014816284, -0.0027119240257889032, 0.07601850479841232, 0.7804747819900513, -0.17724689841270447, -0.19549822807312012, -0.9528815746307373, -0.3246676027774811, 0.6063411831855774, 0.1272754967212677, 0.2739626467227...
<modules runAllManagedModulesForAllRequests="true"/> </system.webServer> </configuration> ``` **Code** ``` public class Service1 : IService1 { public IList<Student> GetStudents() { IList<Student> students = new List<Student>(); students.Add(new Student() { FirstNme = "Bob", LastNam...
[ 0.2881052494049072, -0.3542357385158539, 0.5584420561790466, -0.1546003818511963, 0.3876792788505554, 0.10654865950345993, 0.24166889488697052, -0.3440757095813751, -0.639731228351593, -0.7059922814369202, -0.8237805366516113, 0.40650057792663574, -0.2522054612636566, 0.15030212700366974, ...
interface IService1 { [WebGet(UriTemplate = "/students")] [OperationContract] IList<Student> GetStudents(); } [DataContract] public class Student { private int _studentId; private string _firstName; private string _lastName; private string _subject; [DataMember] public int ...
[ -0.2894173264503479, -0.6033696532249451, 0.48845455050468445, 0.21172043681144714, 0.06797507405281067, 0.23353007435798645, 0.14101997017860413, -0.05717061832547188, 0.05850186571478844, -1.0500279664993286, -0.28532105684280396, 0.3672519624233246, -0.4093206226825714, 0.05261633545160...
public string FirstNme { get { return _firstName; } set { _firstName = value; } } [DataMember] public string LastName { get { return _lastName; } set { _lastName = value; } } [DataMember] public string Subject {
[ 0.04894717037677765, -0.6125419735908508, 0.3725576400756836, 0.013823137618601322, -0.029405441135168076, -0.08233759552240372, 0.0759424939751625, 0.01986217498779297, -0.02745964378118515, -0.7692866921424866, -0.4569884240627289, 0.5701500177383423, 0.010924259200692177, 0.097557567059...
get { return _subject; } set { _subject = value; } } } ``` This is a known issue where having json, xml and soap endpoints for a single service throws an exception. I have raised it as an error on [MS Connect](http://connect.microsoft.com/wcf/feedback/details/711802/hosting-multiple-endpoints-soap-xml-an...
[ 0.29410240054130554, 0.04810268059372902, 0.4378173053264618, -0.07012128084897995, -0.21352651715278625, -0.17018413543701172, 0.3878031373023987, -0.2628370523452759, -0.270779013633728, -0.9262958765029907, -0.26672306656837463, 0.5792455673217773, -0.19879372417926788, 0.13228054344654...
the framework automatically determines this based on the content type if nothing is specified in your WebGet/WebInvoke attributes and returns the response accordingly. **NOTE**: At the moment when i try to open the link on MS Connect I get some system error on the MS Connect site. If you would like the workaround let...
[ 0.25990980863571167, -0.11112702637910843, 0.5165563821792603, 0.023204602301120758, -0.3912409842014313, -0.23384037613868713, 0.7538315057754517, 0.05123443156480789, -0.4868554472923279, -1.0251193046569824, -0.18760167062282562, 0.6657373905181885, -0.37884292006492615, 0.2628978788852...
I am writing a controller class for my plist, which gets called from another class. the controller class has a read and save method, the read method opens up the plist and saves it to the documents file for reading and writing too. In this read class I put all of the values that have been saved previously into their ow...
[ 0.008694004267454147, -0.07987352460622787, 0.5139324069023132, 0.17789438366889954, 0.15922752022743225, 0.026323113590478897, -0.19505570828914642, -0.14379815757274628, -0.03200274705886841, -0.6827802658081055, -0.04713401198387146, 0.3841460347175598, -0.249505877494812, -0.0118004782...
however I have a dictionary inside my plist and its only saving one value and the resetting the others to null.. I am wondering how do I make sure these variables keep their values? Here is my .h ``` #import <Foundation/Foundation.h> @interface EngineProperties : NSObject { NSString *signature; NSNumber *version; ...
[ 0.09458445012569427, -0.008323856629431248, 0.5515461564064026, 0.06975998729467392, -0.018250389024615288, 0.22648131847381592, 0.16494843363761902, -0.4407249093055725, -0.043447595089673996, -0.9319460391998291, -0.1815817505121231, 0.6734482645988464, -0.09322084486484528, 0.3522677719...
Here is my .m ``` #import "EngineProperties.h" @implementation EngineProperties @synthesize signature; @synthesize version; @synthesize request; @synthesize dataVersion; @synthesize cacheValue; @synthesize man; @synthesize mod; @synthesize sub; //This opens up and reads the current plist ready to be used -(void) r...
[ -0.06833718717098236, -0.01714893989264965, 0.6250578165054321, 0.05375353991985321, 0.14765618741512299, 0.13651685416698456, 0.31424662470817566, -0.5952779054641724, -0.20956632494926453, -0.912005603313446, -0.3110809624195099, 0.5865633487701416, -0.28008484840393066, 0.02865956164896...
if (![[NSFileManager defaultManager] fileExistsAtPath:plistPath]) { // if not in documents, get property list from main bundle plistPath = [[NSBundle mainBundle] pathForResource:@"EngineProperties" ofType:@"plist"]; } // read property list into memory as an NSData object NSData *plistXM...
[ -0.38027796149253845, -0.17728516459465027, 0.470035195350647, 0.138604536652565, 0.3488125205039978, 0.014762213453650475, 0.1536523997783661, -0.5762149095535278, -0.11267179995775223, -0.7481517791748047, -0.6750872731208801, 0.6427944898605347, -0.004954207688570023, 0.0463943406939506...
if (!tempRoot) { NSLog(@"Error reading plist: %@, format: %d", errorDesc, format); } // assign values self.signature = [tempRoot objectForKey:@"Signature"]; self.version = [tempRoot objectForKey:@"Version"]; self.request = [tempRoot objectForKey:@"Request"]; self.dataVersion = [tempR...
[ -0.11051670461893082, -0.07911166548728943, 0.2331434190273285, -0.17563588917255402, 0.03280322253704071, 0.12080156058073044, 0.4368499517440796, -0.6972231268882751, -0.04772550240159035, -0.593932032585144, -0.39644280076026917, 0.646597683429718, -0.17014631628990173, 0.00711360713467...
*)rNumber dataVersion:(NSNumber *)dvReturned cacheValue:(NSNumber *)cValue; { // get paths from root direcory NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES); // get documents path NSString *documentsPath = [paths objectAtIndex:0]; // get the path to...
[ 0.03722941875457764, -0.11550736427307129, 0.7003007531166077, 0.05152849853038788, 0.1832081824541092, 0.30403953790664673, 0.46953636407852173, -0.4765109121799469, -0.25112029910087585, -0.5186073184013367, -0.3879725933074951, 0.7510792016983032, -0.15510240197181702, -0.10880517959594...
some if statment stuff here to put the cache in the right place or what have you. if (methodName == @"manufacturers") { self.man = cValue; } else if (methodName == @"models") { self.mod = cValue; } else if (methodName == @"subMod") { self.sub = cValue; } ...
[ 0.26779666543006897, -0.23667345941066742, 0.1405373215675354, 0.11932730674743652, 0.1684676855802536, 0.005214144941419363, 0.4068758189678192, -0.2691448926925659, -0.07133030891418457, -0.6235253810882568, -0.08776222169399261, 0.6747768521308899, -0.01110548060387373, 0.19782274961471...
[NSDictionary dictionaryWithObjectsAndKeys: man, @"Manufacturers", mod, @"Models", sub, @"SubModels", nil]; NSDictionary *plistDict = [NSDictionary dictionaryWithObjectsAndKeys:
[ 0.09574806690216064, 0.05578466132283211, 0.14031542837619781, -0.028795460239052773, -0.010732157155871391, 0.6981682777404785, 0.3130657374858856, -0.20515066385269165, -0.2915467619895935, -0.6152359247207642, -0.20178335905075073, 0.5639937520027161, -0.05743451789021492, 0.11259400099...
signature, @"Signature", version, @"Version", request, @"Request",
[ 0.40901318192481995, -0.06484290957450867, 0.5257400870323181, 0.15373437106609344, 0.22990462183952332, -0.08719513565301895, 0.12790365517139435, -0.04193689301609993, -0.2674344778060913, -0.5100137591362, -0.27145916223526, 0.26630666851997375, 0.0435839481651783, 0.1798381805419922, ...
dataVersion, @"Data Version", cacheValue, @"Cache Value", nil]; NSString *error = nil; // create NSData from dictionary NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:plistDict format:NSPropertyListXMLFormat_v1_0 errorDescription:&error]; // check ...
[ 0.024793846532702446, -0.24634449183940887, 0.379384309053421, 0.19326642155647278, 0.04048827663064003, 0.21028605103492737, 0.2293042242527008, -0.1350974440574646, -0.19304035604000092, -0.44976773858070374, -0.13012103736400604, 0.28833505511283875, -0.19747574627399445, 0.009684501215...
file [plistData writeToFile:plistPath atomically:YES]; NSString *myString = [[NSString alloc] initWithData:plistData encoding:NSUTF8StringEncoding]; // NSLog(@"%@", myString); } else { NSLog(@"Error in saveData: %@", error); // [error release]; } } ...
[ -0.17693942785263062, 0.04017467424273491, 0.30420005321502686, -0.05267500504851341, 0.3943699598312378, 0.13255411386489868, 0.48825913667678833, -0.11383496969938278, -0.15269820392131805, -0.6259565353393555, -0.13065534830093384, 0.5799492001533508, -0.19319099187850952, -0.0397825576...
three vars, man, mod, sub so I can put them into my cache value dictionary.. The problem is when you are getting your data ready to create the dictionary, here: ``` if (methodName == @"manufacturers") { self.man = cValue; } else if (methodName == @"models") { self.mod = cValue; } else if (methodName == @"subM...
[ 0.03763950988650322, -0.08427302539348602, 0.47248414158821106, -0.21416424214839935, -0.2876390218734741, 0.3620350658893585, 0.3954310715198517, -0.7209658026695251, -0.07324317842721939, -0.6173082590103149, 0.2870626747608185, 0.8026650547981262, -0.04239945113658905, 0.345148384571075...
isEqualToString:@"models"]) { self.mod = cValue; } else if ([methodName isEqualToString:@"subMod"]) { self.sub = cValue; } ``` Another issue is that in readPlistData you are reading the keys "Man", "Mod", and "SubMod" but they should be the same as what you write into the dictionary: "Manufacturers", "Models"...
[ -0.04342220723628998, -0.05604119971394539, 0.1783369928598404, 0.13381239771842957, 0.12434655427932739, 0.1108323186635971, 0.309876412153244, -0.5075660347938538, -0.17189455032348633, -0.7106326818466187, -0.033460743725299835, 0.9336928725242615, -0.22627589106559753, 0.13591590523719...
will be reset to nil each time that you call it.
[ 0.2932784855365753, -0.22267520427703857, 0.4562811553478241, 0.16730545461177826, 0.15289202332496643, 0.06782163679599762, -0.20327652990818024, 0.12158021330833435, -0.14976806938648224, -0.5683268308639526, 0.1030876636505127, 0.21743962168693542, -0.12114186584949493, 0.41184571385383...
What is the equivalent below code in Javascript? Is this apple script convertable to java script? ``` tell application "Finder" activate set position of Finder window 1 to {607, 276} close Finder window 1 end tell ``` Thanks. Since the release of OS X Yosemite, [JavaScript is available to automation](htt...
[ 0.13500693440437317, 0.40408292412757874, 0.6860151886940002, -0.1630251407623291, 0.00986484531313181, -0.049145251512527466, 0.40443116426467896, -0.27203282713890076, -0.062108803540468216, -0.553078293800354, -0.26617884635925293, 0.650401771068573, -0.37912657856941223, -0.15496630966...
Is there a way to move the entire contents of an ArrayList to another instance of ArrayList in O(1)? I.e.: only the reference to the backing array is passed from one instance to the other (elements are not copied one by one). For example: ``` ArrayList<String> a = new ArrayList<>(Arrays.asList("A", "B", "C")); Array...
[ -0.05714995041489601, -0.03761715441942215, 0.3042488992214203, -0.2167876660823822, 0.2779711186885834, 0.004722274374216795, -0.0407065749168396, -0.3490988612174988, -0.292581170797348, -0.4430607557296753, -0.4645956754684448, 0.3593132793903351, -0.34906914830207825, 0.000322722160490...
am not looking for `tmp = a; a = b; b = tmp;` type of solutions. *Further explanation* 2: The operation must be ~O(1) in time. *The use-case*: This is useful when an object wants to encapsulate a list constructed outside: ``` public class A { private ArrayList<String> items = new ArrayList<>(); /** * T...
[ 0.13423986732959747, 0.2567266523838043, 0.43848106265068054, -0.33886608481407166, 0.24718506634235382, -0.21597667038440704, 0.5546088814735413, -0.5411385297775269, -0.14207760989665985, -0.4979247450828552, -0.4004868268966675, 0.3517051339149475, -0.2345518320798874, 0.223924785852432...
*/ public AnImmutableObject(ArrayList<String> items) { if (items != null) { items.moveContentsTo(this.items); } } /** * Other collections that do not provide the 'move' functionality * must be copied. If we just stored the reference to 'items' we * would break en...
[ 0.028046229854226112, -0.19797903299331665, 0.43937796354293823, -0.11775171011686325, 0.21552686393260956, 0.004522931296378374, 0.14153704047203064, -0.3340121805667877, -0.4422810971736908, -0.44134771823883057, -0.2802622616291046, 0.28085336089134216, -0.3599023222923279, 0.4508719742...
* still have write capabilities to the collection. */ public A(Collection<String> items) { if (items != null) { this.items.addAll(items); } } public List<String> getItems() { return Collections.unmodifiableList(items); } } ``` Notice that we want to avoid mak...
[ 0.18888477981090546, -0.07374827563762665, 0.2618391513824463, -0.1489672064781189, 0.2703682482242584, -0.2259581983089447, 0.39198875427246094, -0.3445967137813568, -0.2705433666706085, -0.4354900121688843, -0.4740036427974701, 0.6777615547180176, -0.34504273533821106, 0.3261616826057434...
lose the ability to modify the (now encapsulated) `ArrayList`. Since the release of OS X Yosemite, [JavaScript is available to automation](https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/). The equivalent of your code would be: ``` var finder = Application...
[ 0.21125587821006775, 0.24426236748695374, 0.4549921452999115, -0.36667531728744507, 0.12608832120895386, -0.025469472631812096, 0.3524087071418762, -0.27766937017440796, -0.2016616016626358, -0.44453665614128113, -0.29635944962501526, 0.4679947793483734, -0.44801121950149536, 0.05628738179...
How can I determine the initial guess of the equation `Ax+Bsin(x)=C` in terms of A,B and C ? I am trying to solve it using Newton Raphson. A,B and C will be given during runtime. Is there any other method more efficient than Newton Raphson for this purpose ? The optimal initial guess is the root itself, so finding an ...
[ -0.19410400092601776, 0.37301555275917053, 0.13561977446079254, -0.09977463632822037, -0.022517576813697815, 0.3449258506298065, 0.20238487422466278, -0.28736093640327454, -0.055004894733428955, -0.54347825050354, 0.013855144381523132, 0.32981353998184204, -0.14871172606945038, 0.233423471...
C * pi`, just to see if it works. Your biggest problem, however, would be the periodic nature of your function. Newton's method will be slow (if it even works) for your function as `sin(x)` will shift `x0` back and forth over and over. --- **Precaution:** ![](https://upload.wikimedia.org/wikipedia/en/math/a/f/2/af2...
[ -0.04239144176244736, 0.10750923305749893, 0.2568868100643158, -0.2384534329175949, -0.0657367929816246, 0.04133118689060211, -0.002158387331292033, -0.3423618674278259, -0.22424261271953583, -0.29144853353500366, -0.007887746207416058, 0.5261185765266418, -0.4947516620159149, 0.4250940382...
means that Newton's method might never even converge for an arbitrary `x0`.
[ 0.006757648196071386, 0.014169096015393734, 0.4009148180484772, 0.12687863409519196, 0.3948671519756317, 0.132579505443573, 0.2906951904296875, 0.16505588591098785, 0.046711571514606476, -0.17478318512439728, -0.16749732196331024, 0.20430219173431396, -0.2251269817352295, 0.484610497951507...
i was wondering how do you make a helper file's functions available to an action mailer? i have an action mailer called UserMailer and a helper called sessions\_helper.rb. how do i make the methods available to UserMailer? ive tried 'include' but it gives the following error the method im trying to get is "current\_us...
[ 0.1334366500377655, 0.03678329288959503, 0.2588047385215759, 0.03120122291147709, -0.20190061628818512, 0.13539622724056244, 0.3824498951435089, -0.278552383184433, -0.23847027122974396, -0.6532866358757019, 0.011040662415325642, 0.6274993419647217, -0.5240268707275391, 0.10974666476249695...
better design choice I'd keep my mailer independent of the current\_user. Mailers are not concerned with who the current\_user is ( similar to models ). For that matters, mailers are not even concerned with who the user is, they are concerned with "email, subject, and body". So when calling mailer methods, you can p...
[ 0.71802818775177, -0.025369221344590187, 0.3526938259601593, 0.29559242725372314, -0.03348733112215996, 0.2172093689441681, -0.028803864493966103, -0.021175149828195572, -0.08251500874757767, -1.0148346424102783, 0.11118051409721375, 0.49866265058517456, -0.3009067177772522, 0.024007998406...
I created a function for splitting an image into multiple images, but when I take take the CGImage of the UIImage, the CGImage returns NULL ``` NSArray* splitImage(UIImage* image,NSUInteger pieces) { NSLog(@"width: %f, %zu",image.size.width,CGImageGetWidth(image.CGImage)); NSLog(@"%@",image.CGImage); returns NULL NSM...
[ 0.18650422990322113, -0.6545226573944092, 0.495627760887146, -0.25585517287254333, -0.4340003728866577, 0.4208047688007355, 0.4388599693775177, -0.7345929741859436, -0.3142402470111847, -0.5364411473274231, -0.2067975401878357, 0.5042468309402466, -0.39328837394714355, 0.32228171825408936,...
release]; return finalArray; } ``` The CGImage property will return nil if the UIImage was created from another image such as an IOSurface or CIImage. To get around this in this particular case I can create a CGImage from an IOSurface using the c function then convert that to a UIImage. ``` UICreateCGImageFromIOSur...
[ 0.02970106340944767, 0.023796485736966133, 0.6715236902236938, -0.2590339481830597, -0.03741973266005516, -0.04978366196155548, 0.21005651354789734, -0.1869426667690277, -0.08832991123199463, -0.6713045835494995, -0.3663821518421173, 0.6617258191108704, -0.48925748467445374, 0.206855803728...
Is there a way to get the a users screen size/resolutions using javascript? I figured you probably can't use PHP to do this as it's server-side, but as javascript is client-side I thought it may be an option. Yes, you can use the following to print out the resolution for example: ``` <script type="text/javascript"> do...
[ 0.2813485562801361, -0.09776242822408676, 0.49649709463119507, -0.03045179694890976, -0.46414914727211, 0.019099880009889603, 0.044842470437288284, -0.24741987884044647, -0.2235860824584961, -1.0271962881088257, 0.2937697470188141, 0.720849871635437, 0.18631429970264435, -0.109994843602180...
I'm kind of new to WPF although I have some experience in Forms, and I decided to finally try to figure out how to use WPF. So When I got to draggable controls, this is the code I came up with (I attempted to change it to work with WPF but the control just twitches everywhere): ``` private void rectangle1_MouseMove(ob...
[ 0.07646964490413666, -0.4931913912296295, 0.7022182941436768, -0.2805269956588745, 0.06806422024965286, -0.08441722393035889, 0.26839330792427063, -0.40247657895088196, -0.17654874920845032, -0.5213464498519897, -0.0652235597372055, 0.5589030385017395, -0.44145870208740234, -0.008680511265...
rectangle1.Margin = new Thickness(x, y, rectangle1.Margin.Right, rectangle1.Margin.Bottom); } } ``` You want to use [adorners](http://msdn.microsoft.com/en-us/library/ms743737.aspx) to achieve dragging, resizing, rotating, etc.
[ -0.08990635722875595, -0.1739322990179062, 0.5371127128601074, -0.06507162749767303, 0.055828120559453964, 0.47921016812324524, -0.06480013579130173, -0.2714468240737915, -0.4814329147338867, -0.7241261601448059, -0.14195382595062256, 0.5567632913589478, 0.07821068912744522, 0.210930228233...
I am experiencing random occurrences of caching of Ajax requests created through Jquery's get. The Jquery gets are done in the most straight forward conventional way (route + params + callback) I am already using ``` $.ajaxSetup({cache:false}); ``` But it doesn't seem to always work. I get how ajaxSetup no cache ...
[ -0.0037201400846242905, -0.04059189185500145, 0.35806405544281006, 0.05121941119432449, -0.3788038492202759, -0.28198474645614624, 0.5821313261985779, 0.2817918360233307, -0.19420012831687927, -0.971331775188446, 0.0026809433475136757, 0.48694556951522827, -0.09674062579870224, 0.199251458...
place on the server (in response to the original ajax call). The solution ended up being the following attribute. ``` [OutputCache(Location = OutputCacheLocation.None)] ``` It can be either applied at the controller level or the action level.
[ -0.21529167890548706, -0.27348223328590393, 0.20127563178539276, -0.041511353105306625, 0.14813540875911713, -0.09634454548358917, -0.017569994553923607, 0.10661226511001587, 0.07976171374320984, -0.5887839198112488, -0.2508978247642517, 0.14959344267845154, -0.367274671792984, 0.154091253...
I'm using the following code to switch between activities: ``` Intent b = new Intent(nowActivity.this, About.class); startActivity(b); return true; ``` This code works perfectly but it seems to make it start a new activity on top of the existing activity. **Example**: I start the application on my Android phone and...
[ 0.5633805394172668, -0.05562727525830269, 0.9382737278938293, -0.3145092725753784, 0.2745579481124878, -0.1520642340183258, 0.4521278738975525, -0.09610790014266968, -0.08560152351856232, -0.9881026744842529, -0.0767177939414978, 0.800984263420105, 0.13004058599472046, -0.04090079665184021...
like I was opening the application once again. I don't want it to act like this and I asking you now, how can I fix this problem? Thanks in advance. I got it working! Here's the solution: **nowActivity.java** ``` @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection switch...
[ 0.14453303813934326, -0.11470638960599899, 0.5127018094062805, -0.3532295525074005, 0.14918026328086853, 0.10845404863357544, 0.3268541395664215, -0.25861915946006775, -0.16501064598560333, -0.7001594305038452, -0.3563794195652008, 0.6086238622665405, -0.20908744633197784, 0.03195622563362...
b.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(b); return true; case R.id.menuItem3: android.os.Process.killProcess(android.os.Process.myPid()); return true; default: return super.onOptionsItemSelected(item); } } ``` **About.java** ``` @Override public...
[ 0.10697845369577408, 0.04996221885085106, 0.5989675521850586, -0.6863008737564087, 0.2682742476463318, 0.4060169756412506, 0.32357659935951233, -0.4721849262714386, -0.16095836460590363, -0.5289941430091858, -0.4142872393131256, 0.6584069728851318, -0.44592171907424927, 0.00844095181673765...
startActivity(a); return true; case R.id.menuItem2: Toast.makeText(this, "Du är redan på \"Om\"-sidan", Toast.LENGTH_SHORT).show(); return false; case R.id.menuItem3: Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); start...
[ 0.042772017419338226, -0.10930697619915009, 0.6820521950721741, -0.6954383254051208, 0.1613353043794632, 0.23713041841983795, 0.705279529094696, -0.38068661093711853, -0.040887705981731415, -0.44838541746139526, -0.5064384341239929, 0.6790355443954468, -0.3207796812057495, 0.02229952812194...
return super.onOptionsItemSelected(item); } } ```
[ -0.14758025109767914, -0.08394664525985718, 0.1390092521905899, -0.3028227388858795, 0.21461310982704163, 0.04277196526527405, 0.10545779764652252, 0.16693729162216187, -0.250180721282959, -0.45546790957450867, -0.40308716893196106, 0.6830557584762573, -0.24755938351154327, 0.3053205907344...
I am new to mvc3 and i am using c# coding and razor my view engine. Is there any way to use date picker with out using jquery and something else. If you don't use javascript and jquery, well, you are left with HTML. And you know that in HTML you have standard input fields such as `<input type="text">`. Using pure HTML ...
[ 0.41261911392211914, -0.16556335985660553, 0.4110613465309143, 0.00684370705857873, -0.3026382029056549, -0.2570182979106903, 0.08604730665683746, 0.2339877188205719, -0.16493284702301025, -0.5625502467155457, 0.19530531764030457, 0.6897509694099426, -0.27033957839012146, 0.178802177309989...
I have two separate iOS apps, one is a client and one is a server. They need to be used together, either by itself is useless. Clients are free, server has a cost to use. I know I can submit this as a single app, and maybe have the server functionality be unlocked with an In App Purchase. But what if I want to submit...
[ 0.5865920782089233, 0.1767806112766266, 0.35233670473098755, 0.017098188400268555, 0.184945210814476, 0.2133173793554306, 0.1410079002380371, 0.06069662421941757, -0.20772360265254974, -0.5584067106246948, 0.1773785948753357, 0.5316656827926636, -0.34575268626213074, -0.024534324184060097,...
approved and the other is rejected and needs rehabilitation. That way I can coordinate a single launch date for both of them once both have been approved. Anyone with experience they would be willing to share? Here is an example of why I might want to do this: Let's say my server app is very large in size because it ...
[ 0.5461497902870178, -0.04335067793726921, 0.3551540970802307, 0.40771815180778503, 0.02226998470723629, -0.1113969162106514, -0.22355146706104279, -0.08686073869466782, -0.49821940064430237, -0.45308825373649597, 0.050894081592559814, 0.42014825344085693, 0.01102981436997652, -0.0936426073...
related client app to have a small footprint. To get around the client server uselessness without the other, first submit a paid app that does both, then submit the free client, then submit the paid server, then, if sales and revenue trends so indicate this to be a revenue optimization, remove the combo app from sale.
[ 0.35635343194007874, 0.012763642705976963, 0.41677215695381165, 0.3285957872867584, 0.0038969675078988075, -0.014739185571670532, 0.08651294559240341, -0.3307512104511261, -0.17139996588230133, -0.6749032735824585, -0.14893554151058197, 0.7106447219848633, -0.37584516406059265, -0.11039634...
I need to be able to handle a math equation such as "(45+9)/8" in my app. I wanted to just eval it using JavaScript, but realized that I can't use javax.script in Android. So, I found WebView, but I'm having a bit of trouble using it. Most of the examples refer to using an external page with the JS code, or using "java...
[ 0.2407534271478653, 0.338542640209198, 0.265017032623291, -0.11058338731527328, -0.06866768002510071, 0.32956069707870483, 0.43661415576934814, -0.277089387178421, -0.09243357926607132, -0.5194783806800842, 0.10419993847608566, 0.5727518200874329, -0.11344248056411743, -0.20641176402568817...
value to a hidden TextView? Check out [exp4j](http://projects.congrace.de/exp4j/). It's a simple expression evaluator for java. For the equation you posted in your question you could just do: ``` Calculable calc = new ExpressionBuilder("(45+9)/8").build() double result1=calc.calculate(); ```
[ 0.0651349127292633, 0.035368844866752625, 0.38478654623031616, -0.1383182406425476, 0.21217776834964752, 0.05881291255354881, 0.4976665675640106, -0.25973522663116455, 0.14292679727077484, -0.40642622113227844, -0.0026054505724459887, 0.7247284054756165, -0.22738659381866455, -0.2808004915...
Is there a tutorial how I can use mongodb database with Java play 2.0? On the official website (playframework.org) there seems to be only the NoSql example. check this demo on github. <https://github.com/czihong/playMongoDemo> I use morphia to connect play 2.o and mongodb.
[ 0.44956836104393005, -0.11766867339611053, 0.1306406855583191, -0.027094153687357903, 0.0346219427883625, -0.33604198694229126, -0.01950700581073761, 0.03762167692184448, -0.15223926305770874, -0.813295841217041, 0.3582342267036438, 0.8040525317192078, -0.28907132148742676, -0.144731983542...
I am trying to use some Facebook code in one of my pages. The code is: ``` <script type="text/javascript">(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=0000000...
[ 0.2637576460838318, 0.18818604946136475, 0.7983672618865967, -0.2294464409351349, 0.01699741557240486, 0.037833694368600845, 0.6165111660957336, -0.3090360164642334, -0.09198714047670364, -0.7549795508384705, 0.006056877318769693, 0.3242758512496948, -0.4383801519870758, -0.145339787006378...
and still validate? The [commit 52f425e1](https://github.com/git/git/commit/52f425e1a9ab8b0ae572d06fe2a1b428f741ef4a) (August, 30th 2013) mentions: > **Encourage new users to use '`log`' instead. These days, these commands are unified and just have different defaults**. > > > '`git log`' only allowed you to view the...
[ 0.32669562101364136, -0.019063420593738556, 0.8136036396026611, 0.21852320432662964, -0.023273959755897522, -0.37406986951828003, 0.47364282608032227, -0.3993050754070282, -0.19929492473602295, 0.007940399460494518, -0.040956344455480576, 0.5521399974822998, 0.08043248951435089, 0.21216748...
whatchanged`](https://github.com/git/git/blob/52f425e1a9ab8b0ae572d06fe2a1b428f741ef4a/Documentation/git-whatchanged.txt#L17-L25) will say now: > New users are encouraged to use [`git log`](http://git-scm.com/docs/git-log) instead. The > `whatchanged` command is essentially the same as [`git log`](http://git-scm.com/...
[ -0.07007730007171631, -0.1892993450164795, 0.364574670791626, 0.01869950443506241, -0.1882096529006958, 0.012383361347019672, 0.0035478214267641306, 0.021994881331920624, -0.31046032905578613, -0.2783122956752777, -0.12272623926401138, 0.5660833120346069, -0.23290954530239105, -0.012805521...
i'm trying to understand a concept and an error. what's wrong with this? ``` class A { public: A() { std::function<void(int)> testFunc(&A::func); } private: void func(int) {} } ``` my question, is it possible to create any sort of object that is able to call a member of a specific instance w...
[ 0.14385607838630676, 0.1423569768667221, -0.11323177069425583, 0.054212141782045364, -0.051673613488674164, -0.1639331877231598, 0.3843954801559448, -0.12007784098386765, -0.17220540344715118, -0.42364320158958435, -0.06306153535842896, 0.3852098286151886, -0.4994458854198456, 0.2837487757...
index[WM_CREATE] = &A::close; index[WM_DESTROY] = &A::destroy; } protected: map<UINT msg, void (A::*)(HWND, UINT , WPARAM, LPARAM)> index; void close(HWND,UINT, WPARAM, LPARAM); void destroy(HWND, UINT, WPARAM, LPARAM); }; class B : public A { public: B() { index[WM_CREATE] = ...
[ 0.07883450388908386, -0.01858854480087757, 0.2876969575881958, 0.03153457120060921, 0.42009732127189636, -0.07186800986528397, 0.4562912881374359, -0.24617499113082886, -0.1797034740447998, -0.5407647490501404, -0.13742941617965698, 0.8688928484916687, -0.26676636934280396, 0.1262591183185...
of using std::functions like so: ``` class A { public: // Gigantic stl error with these two A() // | { //
[ -0.07989873737096786, 0.2154236137866974, -0.3298046886920929, -0.0031987507827579975, -0.19170305132865906, -0.0024167101364582777, 0.4743161201477051, -0.26537835597991943, -0.25968438386917114, -0.5112781524658203, 0.03557267785072327, 0.6861633658409119, -0.41678622364997864, 0.0530586...
V index[WM_CREATE] = std::function<void(HWND, UINT, WPARAM, LPARAM>(&A::close); index[WM_DESTROY] = std::function<void(HWND, UINT, WPARAM, LPARAM>(&A::destroy); } protected: map<UINT msg, std::function<void(HWND, UINT, WPARAM, LPARAM)> > index; void close(HWND,UINT, WPARAM, LPARAM); v...
[ 0.10699548572301865, -0.14467379450798035, 0.6338157653808594, -0.31566768884658813, 0.16726896166801453, 0.08959493786096573, 0.3726561963558197, -0.591677188873291, -0.22398316860198975, -0.6270694732666016, -0.55415278673172, 0.7986749410629272, -0.5905969142913818, 0.4696612060070038, ...
// and this one B() // | { //
[ -0.0773644670844078, 0.0735502541065216, -0.23238690197467804, -0.4627799391746521, 0.039151012897491455, 0.12899786233901978, 0.014626633375883102, -0.1715463250875473, -0.008569140918552876, -0.17404040694236755, -0.23085597157478333, 0.3661483824253082, -0.5709092020988464, -0.090365350...
V index[WM_CREATE] = std::function<void(HWND, UINT, WPARAM, LPARAM)>(&B::create); } private: void create(HWND, UINT, WPARAM, LPARAM); }; ``` if someone could explain what these giant cryptic errors mean and how to fix them, i would greatly appreciate it. I think the problem you are having is that a m...
[ 0.39480605721473694, 0.08341003954410553, 0.2922718822956085, -0.0862855389714241, 0.03210671246051788, -0.06276803463697433, 0.594929039478302, -0.28659772872924805, -0.23940448462963104, -0.37576422095298767, -0.1379702389240265, 0.650532603263855, -0.6850967407226562, 0.4892741739749908...
function to a std::function, you need to use std::bind like this: ``` std::function<void(int)> testFunc(std::bind(&A::func, this, _1)); ``` This binds the this pointer of the current A instance to the function so it has the function pointer and the object instance, which is enough information to properly call the fu...
[ 0.014193945564329624, -0.007823040708899498, 0.32835033535957336, -0.3202081322669983, 0.02787238173186779, -0.15868940949440002, 0.23781909048557281, -0.18952007591724396, 0.28247782588005066, -0.5136217474937439, -0.43208473920822144, 0.5665832161903381, -0.507168710231781, 0.04777215793...
I am trying to parse an `XML response`, but I am failing miserably. I thought initially that the `xml` was just not being returned in the response, so I crafted up the code below with a direct link to my `xml` file online. I am able to print the `XML` to screen with no problems. However when I call my parse method I g...
[ 0.17904165387153625, 0.2168031632900238, 0.47394320368766785, -0.3453998863697052, 0.046821851283311844, -0.036958593875169754, 0.7130777835845947, -0.5442445278167725, 0.09723061323165894, -0.9271970987319946, -0.22148549556732178, 0.6823223233222961, -0.13632014393806458, 0.2853314578533...
URLConnection uc = url.openConnection(); HttpURLConnection connection = (HttpURLConnection )uc; connection.setDoInput(true); connection.setDoOutput(true); InputStream instream; InputSource source; //get XML from InputStream if(connection.getResponseCode()>= 200){ connection.conne...
[ -0.1938856989145279, -0.3352176547050476, 1.0474380254745483, 0.06904974579811096, -0.013556783087551594, 0.21762508153915405, 0.27879664301872253, -0.05005469173192978, -0.16336096823215485, -0.769592821598053, -0.70735102891922, 0.39710578322410583, -0.26472899317741394, 0.55044811964035...
instream = connection.getErrorStream(); } } catch (MalformedURLException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ParserConfigurationException e) { // TODO Auto-generated catch block ...
[ -0.01916898600757122, -0.1796562820672989, 0.3770320415496826, -0.10813571512699127, 0.21068593859672546, 0.32260361313819885, 0.5946244597434998, -0.41746601462364197, -0.013542840257287025, -0.3928607702255249, -0.1579779088497162, 0.7165848016738892, -0.5807406306266785, 0.1324492394924...
while((inputLine = buff_read.readLine())!= null){ System.out.println(inputLine); } DocumentBuilderFactory factory =DocumentBuilderFactory.newInstance(); factory.isIgnoringElementContentWhitespace(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc = builder.parse(instream); } `...
[ 0.19654162228107452, 0.43266746401786804, 0.4081018567085266, -0.23058177530765533, 0.280661940574646, 0.02926502749323845, 0.6052373647689819, -0.13406802713871002, -0.3752565383911133, -0.4153660237789154, -0.22932448983192444, 0.7475227117538452, -0.20026430487632751, 0.3632928729057312...
everything in instream, so instream is empty. Now when try to do this, ``` Document doc = builder.parse(instream); ``` The parsing will fail, because you have passed it an empty stream.
[ -0.03267828747630119, 0.07953600585460663, 0.3423915505409241, -0.2152073085308075, 0.22402600944042206, -0.4299529790878296, 0.49802887439727783, 0.16144487261772156, 0.09169464558362961, -0.7742162346839905, -0.3905036151409149, 0.6926313042640686, -0.31516602635383606, 0.187173917889595...
As the topic states: ``` list = ["a", "b"] element = "ac" ``` Can I use the: ``` if element in list: ``` If element is equal to the element in (list + "c") Pseudocode to what I want to achieve: ``` if element in (list+c) ``` What is the best way to get this behavior in python? **Edit:** I know there are ...
[ 0.04985518753528595, 0.2236013114452362, 0.35706067085266113, -0.22390851378440857, -0.14532749354839325, -0.32767078280448914, 0.3718812167644501, -0.4254244863986969, -0.43189164996147156, -0.5954840183258057, 0.05873659625649452, 0.8798531293869019, -0.3105967044830322, -0.1174974143505...
resulting list). It'll also "short-circuit" (that is, quickly move on) if it finds the element before going through the entire list. --- P.S. - it's best not to name variables `list`, since that's already the name for the actual list *type*.
[ 0.0033820595126599073, -0.09892617166042328, 0.26385387778282166, -0.07986252009868622, 0.0833195224404335, -0.20980384945869446, 0.35718896985054016, -0.32481613755226135, -0.1220313310623169, -0.2853536903858185, -0.4012288749217987, 0.5467084050178528, -0.38365885615348816, 0.2445147037...
I want to know the difference between the two flags ``` BatteryManager.BATTERY_STATUS_DISCHARGING ``` And ``` BatteryManager.BATTERY_STATUS_NOT_CHARGING ``` I developed an application that uses these two flags, and I expected to see "discharging" when I unplugged the phone from the charger, but instead it simply...
[ 0.4945637881755829, 0.12964527308940887, 0.5341822504997253, 0.022165386006236076, 0.1620582491159439, -0.4248504340648651, 0.055408451706171036, -0.21919642388820648, -0.2540208399295807, -0.3597223460674286, -0.024339471012353897, 0.9439951777458191, -0.38224244117736816, -0.063968405127...
is there a possible bit of code (php, java, css, html) that will force a page to display a print dialogue box, and by default only allow page 1 of X to be printed, or just simply set the print dialogue box to those settings? I have a page that is being printed out via a barcode printer that likes to print lots of blan...
[ 0.5843805074691772, 0.10232312232255936, 0.10316590964794159, 0.4864838123321533, -0.1440238356590271, -0.0816931203007698, -0.02215317077934742, 0.24194671213626862, 0.011959698982536793, -0.31956300139427185, 0.004045501351356506, 0.7629877924919128, -0.3070591688156128, -0.0086087575182...
some resources to direct me would be grand, google hasn't turned up much. You can get a print dialog by triggering the [window.print](http://www.javascriptkit.com/howto/newtech2.shtml) event. This will only open the browser's print dialog however, you have no control over the actual print process other than setting stu...
[ 0.4547349512577057, -0.11637679487466812, 0.5023878216743469, 0.15802313387393951, -0.27252697944641113, -0.2039792239665985, 0.3390958905220032, 0.023257577791810036, 0.12180539965629578, -0.7765161991119385, 0.05994219705462456, 0.7026869058609009, 0.13065078854560852, 0.0143280038610100...
I am wondering if it is possible to write `count(vanilla)` instead of `vanilla.count()` ? It is similar to `len(list)` but I want to do `len(myclass)`. Is it possible to implement like this on my user define class? Below just a dummy class I wrote to ask this question. Thank you. ``` class IceCream(): # Flavor...
[ 0.13269542157649994, 0.06826762109994888, 0.01970980502665043, 0.1617526262998581, -0.1872292459011078, 0.06912253797054291, 0.1351381093263626, 0.19769172370433807, -0.20856207609176636, -0.16907820105552673, 0.17488181591033936, 0.4062584936618805, -0.04268287122249603, 0.039142198860645...
toppings # Return the number of toppings def count(self): return len(self.toppings) def __str__(self): return "{0} flavor ice cream".format(self.name) vanillaToppings = ['chocolate chips', 'fudge', 'penuts'] vanilla = IceCream('Vanilla', vanillaToppings) print(vanilla, 'with', vanilla.count...
[ 0.050982505083084106, -0.13360664248466492, 0.3858589828014374, 0.2369510978460312, -0.09503437578678131, 0.24132442474365234, 0.34607934951782227, -0.039947886019945145, -0.38993120193481445, -0.0015212883008643985, -0.07766375690698624, 0.6309216022491455, 0.04226507991552353, -0.1786670...
# Flavor is a string # Toppings is a list of strings def __init__(self, flavor, toppings): self.name = flavor self.toppings = toppings # Return the number of toppings def __len__(self): return len(self.toppings) def __str__(self): return "{0} flavor ice cream".forma...
[ 0.02649945393204689, 0.1221775934100151, 0.2577878534793854, 0.2637503743171692, -0.0914381742477417, 0.45524364709854126, -0.054345253854990005, 0.059543803334236145, -0.14949949085712433, 0.02187070995569229, -0.2353430688381195, 0.5990347862243652, -0.07402072101831436, 0.04232208058238...
of *count* and *length* are somewhat interchangeable in this case, so why not use something familiar?
[ 0.5620198845863342, -0.08113615214824677, -0.03295595571398735, -0.08867216110229492, -0.40581855177879333, 0.061505790799856186, 0.0782703310251236, -0.0929788276553154, -0.34354889392852783, -0.5468403697013855, 0.052526649087667465, 0.32933488488197327, -0.11896134912967682, 0.270413696...
So I've been reading about it and every example I've come across, explain the concept with something like this: **Original**: ``` A ---> B ``` **IoC**: ``` A ---> :I: ---> B ---> C , etc ``` Where `A` originally consumes something from `B` directly. In **IoC** `A` consumes an interface for which `B` is one of ma...
[ 0.2683279812335968, 0.06493446230888367, -0.3405590057373047, 0.36313241720199585, -0.2239455282688141, -0.3345891535282135, -0.3620074391365051, 0.18634040653705597, -0.300481379032135, -0.36784762144088745, 0.2178126573562622, 0.4101957380771637, -0.33047136664390564, 0.293448269367218, ...
patterns (actually more than what wiki mentioned): > ``` > using a factory pattern > using a service locator pattern > using a constructor injection > using a setter injection > using an interface injection > using a contextualized lookup > > ``` Also [Dependency Injection](http://en.wikipedia.org/wiki/Dependency_In...
[ 0.514736533164978, -0.2865672707557678, -0.20687833428382874, 0.10838903486728668, -0.14825564622879028, -0.09647004306316376, 0.30023816227912903, -0.529938280582428, -0.35693100094795227, -0.5350224375724792, 0.11449917405843735, 0.4018672704696655, -0.6379975080490112, -0.11444669961929...
I have a 64-bit i7 machine. Suppose I allocate memory for n 32-bit integers. How many physical registers will actually be used in the allocation: n, or n/2? I tried to write the following simple programme to find out. ``` #include <iostream> #include <cstdlib> using namespace std; int main (int argc, char *argv[]) ...
[ -0.09837962687015533, 0.399558961391449, 0.4429188072681427, -0.2878453731536865, 0.15028494596481323, 0.39262551069259644, 0.1475980132818222, -0.27215662598609924, -0.22019343078136444, -0.5468946099281311, -0.10458327829837799, 0.30805301666259766, -0.36654043197631836, 0.20487041771411...
04 and 07? And does this mean that the system is actually allocating four (or more) integers, instead of packing the four 32-bit integers into two 64-bit registers? Thanks in advance for your help. > I have a 64-bit i7 machine. Suppose I allocate memory for n 32-bit integers. How many physical registers will actually ...
[ 0.04306566342711449, 0.24836409091949463, 0.23382994532585144, 0.0969836413860321, -0.011332213878631592, 0.3657027781009674, 0.03120092861354351, -0.24395255744457245, -0.4713435471057892, -0.6377367973327637, -0.10130412876605988, 0.6127439141273499, -0.17186880111694336, -0.188462957739...
machine word to be 64-bit on x86\_64, than yes it will use n/2 machine words. I wouldn't use the word physical registers, this can be confused with cpu registers, which is not where an array (unless very small and optimizer is aggressive) is allocated. > They seem further apart than they should be. Why aren't the add...
[ -0.1560383439064026, 0.1574428528547287, 0.2822194993495941, 0.1644139289855957, -0.022686276584863663, 0.25425422191619873, 0.09774737060070038, -0.12683725357055664, -0.2474416345357895, -0.8962773084640503, -0.009249996393918991, 0.41863104701042175, -0.10587816685438156, 0.150722891092...