Posts

java - MainActivity is not public -

i getting weird error in androidmanifest.xml file saying "mainactivity not public. validate resource reference inside android xml files." not know how solve error. can me here? androidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pixalstudio.javaclasses" > <uses-permission android:name="android.permission.access_network_state" > </uses-permission> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent....

Java API for Google Analytics -

i've found great example here: https://developers.google.com/analytics/solutions/articles/data_over_time uses google.gdata, not google.api. credentials asking following: private static final string username = "username"; private static final string password = "password"; private static final string table_id = "table_id"; whereas in google.api, credentials needed following: private static final string key_file_location = "yourfile.p12"; private static final string service_account_email = "something@developer.gserviceaccount.com"; these 2 libraries (google.api , google.gdata) seem able similar things in fact different. meant username, password , table_id in first scenario? recommended java api google analytics? it recommended use google analytics java client libraries . example have pointed uses deprecated client login . you should use updated hello analytics api tutorial better example of using java api googl...

R: reading in .csv file removes leading zeros -

i realize reading .csv file removes leading zeros, of files, maintains leading zeros without having explicitly set colclasses in read.csv. on other hand, what's confusing me in other cases, remove leading zeros. question is: in cases read.csv remove leading zeros? the read.csv , read.table , , related functions read in character strings, depending on arguments function (specifically colclasses , others) , options function try "simplify" columns. if enough of column looks numeric , have not told function otherwise, convert numeric column, drop leading 0's (and trailing 0's after decimal). if there in column not number not convert numeric , either keep character or convert factor, keeps leading 0's. function not @ entire column make decision, may obvious not being numeric may still converted. the safest approach (and quickest) specify colclasses r not need guess (and not need guess r going guess).

javascript - MVC 4 display/hide a textbox based on a checkbox check -

Image
new mvc--was never of front-end web developer (mostly backend), i'm not privy design on front-end. now, i'm trying use mvc without original webform knowledge...that being said, please give me pointers/links/good ideas on how handle following: i have textbox field want show/hide based on checkbox. have these fields in view @using (html.beginform()... should change attribute on text box in javascript or controller action? if use javascript, i'm having hard time getting values in beginform, if use controller action, i'm not sure how/what pass to/from in controller action. i using jquery if want manipulate dom. here example - view @using (html.beginform()) { @html.checkboxfor(model => model.mybooleanvalue) <br /> @html.textboxfor(model => model.mytextvalue) <br /> <input type="submit" value="submit" /> } <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.j...

C# XML Serialization Not working -

i have following code supposed deserialize xml string class has of items in xml file, may not have them fine should assume null. when run following code using xml below leaves each value null. any pointers i'm going wrong thanks serviceresponse returnval = new serviceresponse(); try { xmlserializer serializer = new xmlserializer(typeof(serviceresponse)); stringreader sr = new stringreader(xmlresponse); namespaceignorantxmltextreader xmlwithoutnamespace = new namespaceignorantxmltextreader(sr); returnval = (serviceresponse)serializer.deserialize(xmlwithoutnamespace); } catch (exception ex) { throw ex; } [xmlroot("serviceresponse")] public class serviceresponse { public string requesttype { get; set; } public string applicationsender { get; set; } public string workstationid { get; set; } public string popid { get; set; } public string requestid { get; set; } public string referencenumber { get; set; } ...

windows 7 x64 - How to add 64 bit target platform in Delphi XE8? -

the files right click on target platform in project manager , select "add platform", when "add platform" item greyed out. is there way add 64 bit platform? this happen when migrating projects previous versions of delphi. try deleting dproj file , open dpr file. way handles upgrade process. if not, need create new project , add existing source files it. or can try editing dproj file enable win64 platform. <project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <propertygroup> ... <targetedplatforms>3</targetedplatforms> ... </propertygroup> ... <propertygroup condition="('$(platform)'=='win64' , '$(base)'=='true') or '$(base_win64)'!=''"> <base_win64>true</base_win64> <cfgparent>base</cfgparent> <base>true</base> </propert...

Loading instance variables form a file in Typescript -

here's code: import fs = require('fs'); export interface answer { order: number, text: string } export class config { responses:answer[]; timestamp_column: string; name_column: string fromjsonfile(filename: string) { var filestring = fs.readfilesync(filename); var parsedfile = json.parse(filestring.tostring()); this.responses = parsedfile.responses; this.timestamp_column = parsedfile.timestamp_column; this.name_column = parsedfile.name_column; } mapanswertonum(answer:string):number { (var of this.responses) { if (a.text == answer) { return a.order;} } throw new error(`invalid response string ${answer}`); } } it reads in file: { "responses": [ { "value": 0, "text": "at loss explain it..."}, { "value": 1, "text": "have vague sense..."}, { "value": 2, "text": "pretty handle on it..."}, { ...