extra

Passing value from extra to cursor

不问归期 提交于 2019-12-11 19:48:55
问题 I'm trying to iron out the last few bugs in my application. With my current setup I have the user go through a series of listview (Category -> source -> title). Based on the position from the listview I pass a int that is used by my cursor to filter the results and give the items that belong to the previously clicked item. After navigating a few times through the different activities it crashes since the application loses the value of said int (going back and forward through the activities).

new and malloc allocates extra 16 bytes

余生长醉 提交于 2019-12-11 04:01:01
问题 I'm writing on c++ in VS2010 Windows 7. I try to read file of size 64 bytes. Here's the code: BYTE* MyReadFile(FILE *f) { size_t result; BYTE *buffer; long lSize; if (f == NULL) { fputs ("File error", stderr); exit (1); } fseek (f, 0, SEEK_END); lSize = ftell (f); rewind (f); //buffer = (BYTE*) malloc (sizeof(char)*lSize); buffer = new BYTE[lSize]; if (buffer == NULL) { fputs ("Memory error", stderr); exit (2); } result = fread (buffer, 1, lSize, f); if (result != lSize) { fputs ("Reading

Gradle extra properties not visible in a custom task defined in a subproject

守給你的承諾、 提交于 2019-12-06 17:07:29
问题 I'm trying to reuse common logic among multiple Gradle tasks, similar to what was suggested in this answer, but I'm having trouble with extra project properties not being visible. Boiled down, here's the problem. Say I have a root Gradle build script, build.gradle that sets an extra project property, project.ext.myProp = 'myValue' I have a subproject defined in settings.gradle , include 'subproject' and the subproject defines and uses a custom task that references that extra project property,

SystemInfo - Get computer System Model via CMD - Extra spaces bug

梦想的初衷 提交于 2019-12-02 10:13:05
I'm trying to get a Computer System Model type via Batch file. for this i've created this script: systeminfo | find "System Model" > %temp%\TEMPSYSINFO.txt for /F "tokens=2 delims=:" %%a in (%temp%\TEMPSYSINFO.txt) do set SYSMODEL=%%a del %temp%\TEMPSYSINFO.txt set SYSMODEL=%SYSMODEL:~1% echo %SYSMODEL% >%temp%\SYSMODEL.txt del %temp%\SYSMODEL.txt set "Line1=*** System Model: %SYSMODEL%" echo %Line1% but when I run it i get extra spaces: *** System Model: OptiPlex 9010 Any idea how can I fix it? You're doing it the hard way. Use wmic . It's a lot faster and less complicated to scrape. for /f

Values lost in previous Activity when I hit back button, but not when this.finish() is called

和自甴很熟 提交于 2019-12-01 18:22:19
So I have a weird problem. I have 2 Activities I'm working on. One of the Activities displays a ListView whose data is grabbed via a long Extra I use to fetch the results via a WHERE clause in the database.query. The other Activity is called when a ListView item is clicked, allowing someone to add something to the database for the ListView. The activity names are DaysActivity.java (the activity with the listview) and DayAddActivity.java (the Activity that allows someone to add a day, which then shows up in the DaysActivity.java ListView). The problem I'm having is, when I finish()

Values lost in previous Activity when I hit back button, but not when this.finish() is called

亡梦爱人 提交于 2019-12-01 18:08:38
问题 So I have a weird problem. I have 2 Activities I'm working on. One of the Activities displays a ListView whose data is grabbed via a long Extra I use to fetch the results via a WHERE clause in the database.query. The other Activity is called when a ListView item is clicked, allowing someone to add something to the database for the ListView. The activity names are DaysActivity.java (the activity with the listview) and DayAddActivity.java (the Activity that allows someone to add a day, which

5px extra margin getting added to the bottom of each div

若如初见. 提交于 2019-11-30 11:47:35
I am trying to design a simple header to a page in css. I planned to stack two divs on top of each other. The top one has many tabs and the bottom one is a plain solid single image div. But when rendering i see that an extra 5px is getting added to the the heights of both these divs. So i am not able to place the bottom on exactly on top of the other one. There is a 5px bottom margin automatically. I tried negative margins, reset the global margins and paddings to zero. Still no use. Heres the code. <div class ="main_nav"> <div class="first_tab"> <img src ="images/startup/tab1_brown.png"

5px extra margin getting added to the bottom of each div

只谈情不闲聊 提交于 2019-11-29 18:08:35
问题 I am trying to design a simple header to a page in css. I planned to stack two divs on top of each other. The top one has many tabs and the bottom one is a plain solid single image div. But when rendering i see that an extra 5px is getting added to the the heights of both these divs. So i am not able to place the bottom on exactly on top of the other one. There is a 5px bottom margin automatically. I tried negative margins, reset the global margins and paddings to zero. Still no use. Heres

Specifying widget for model form extra field (Django)

末鹿安然 提交于 2019-11-28 08:10:22
I have to add extra field to my model form. My approach is: class MyForm(forms.ModelForm): extra_field = forms.CharField() class Meta: model = MyModel widgets = { #Does not work 'extra_field': forms.Textarea(attrs={'placeholder': u'Bla bla'}), } But it seems that widget definition for extra_field at class Meta is ignored, because i have a bare input tag instead of textarea on a template. So I apply next approach: class MyForm(forms.ModelForm): #It works fine extra_field = forms.CharField(widget=forms.Textarea()) class Meta: model = MyModel It works perfectly for me, but I used to specify

XML with PHP “echo” getting error “Extra content at the end of the document”

百般思念 提交于 2019-11-28 02:28:28
I'm getting an error that I believe to be very specific. This PHP is stored in my domain. It access a server with a mysql database and uses it's table information to generate an XML with markers, that will afterwards be used in Google Map. Actually it is working because it's retrieving the markers, but this error doesn't go away, and I don't know what's causing it. I'm very new to all the php and android programming. If someone could clarify this for me with easy explanation, I would be greatful. The error is: This page contains the following errors: error on line 3 at column 1: Extra content