Can a cyclic quadrilateral be inscribed in a parabola?
It is quite obvious that a quadrilateral can be inscribed in a parabola.
However, can somebody provide a nice (meaning: intuitive) proof that a
cyclic quadrilateral can be inscribed in it?
Further, if you can prove that it is possible to have an inscribed
quadrilateral such that the diagonals are equal, then it'd be great!
Friday, 9 August 2013
memset clone producing weird results
memset clone producing weird results
I'm trying to copy the memset function. For a reason I don't understand,
the following code does not work and produces weird results:
#include <sys/types.h>
void *mem_set(void *dst, int c, size_t n)
{
char *d;
size_t i;
d = dst;
for (i = 0; i < n; i++)
d[i] = (unsigned char) c;
return dst;
}
Here's the test:
int *a;
a = malloc(4 * sizeof(int));
a[0] = 1;
a[1] = 2;
a[2] = 3;
a[3] = 4;
printf("%d %d %d %d\n", a[0], a[1], a[2], a[3]);
mem_set(a, 1, 4);
printf("%d %d %d %d\n", a[0], a[1], a[2], a[3]);
free(a);
And here the output:
1 2 3 4
16843009 2 3 4
I'm trying to copy the memset function. For a reason I don't understand,
the following code does not work and produces weird results:
#include <sys/types.h>
void *mem_set(void *dst, int c, size_t n)
{
char *d;
size_t i;
d = dst;
for (i = 0; i < n; i++)
d[i] = (unsigned char) c;
return dst;
}
Here's the test:
int *a;
a = malloc(4 * sizeof(int));
a[0] = 1;
a[1] = 2;
a[2] = 3;
a[3] = 4;
printf("%d %d %d %d\n", a[0], a[1], a[2], a[3]);
mem_set(a, 1, 4);
printf("%d %d %d %d\n", a[0], a[1], a[2], a[3]);
free(a);
And here the output:
1 2 3 4
16843009 2 3 4
How to search for a whole word with special char using oracle contains?
How to search for a whole word with special char using oracle contains?
I have a column short_desc in my table that is context indexed.
When i search like below
select * from table1 where CONTAINS (short_desc,'{product\_id}') > 0
I get results like
abc product_id
abc product id
The escaped character behaves like an OR and the query searches for
'product_id' or 'product id'
How can i search for the whole word 'product_id' only?
Thanks in advance
I have a column short_desc in my table that is context indexed.
When i search like below
select * from table1 where CONTAINS (short_desc,'{product\_id}') > 0
I get results like
abc product_id
abc product id
The escaped character behaves like an OR and the query searches for
'product_id' or 'product id'
How can i search for the whole word 'product_id' only?
Thanks in advance
how do I parse this text file using php into a usable html format
how do I parse this text file using php into a usable html format
Heres a rather big sample of the data to be be parsed:
POCSAG1200-: Address: 352986 Function: 0
POCSAG1200-: Numeric: 0U
9]060U65]070.6]4[8023]35.0.6629.1466257028237.0.16099 40533825.6014 2.4U84
2280673 -- 60295-2653 9 00 POCSAG1200-: Alpha: 09:00-98 MSG FOR MITALI:
PLS CALL MARTA LEREDE 07876 251582 POCSAG1200-: Address: 135502 Function:
2 POCSAG1200-: Numeric: 0U 9]060U69 270.U-U260305.7]3[.797]02478-]5601UU
4601-[-02.3.U 0267.--560989-[]1[.3 7]238 -56U795]0.0[89]5[03U9-97098U
967[9146]7U U-1663U3[02.787-567UU0445978- 6]4[8142[23-U]277799 02.[U146 0[
9]0267.--5]9382 4701 6]..9 502.2.U 2[2382-3709 3
967382-]601-1-560585]5]0388 1]63 3-]]3388
[]UUU14774789]02979U-1]4UU7]0.7U91447479143[6[UU]
62795]967[9-50.6]3U90.U7.9- 6098U 0.0U 5]167[9U
4601-[-0.6[U--96.[U5]02.3.U 0.69[00 POCSAG1200-: Alpha: 09:00-29 7/10
issues have led to the line blockage never actually being formally taken.
Traffic returned to Fast lines at 06.52. There is rain in the area damping
down what remains of the smouldering. MOM will be arranged to monitor the
-> POCSAG1200-: Address: 135502 Function: 255 POCSAG1200-: Alpha:
5Nüü$nNTnMM4LÜ,nT^Dß$Öt^lömLTe POCSAG1200-: Address: 135502 Function: 255
POCSAG1200-: Alpha:
ÄHlllMH0YyÄ(HPüÄ;:xhÄxh<ää:(Z:-KyähÄ:qäÜH1x(Öö>:;=;H,sÄyÄ;k<9hÄ4Ü;9h3xzÖh4:Üö(s3j=XYyÄHrÄ98X;(YHö;=Y4Ü;9h3xz(K
POCSAG1200-: Address: 135502 Function: 2 POCSAG1200-: Numeric: 0U 9]060U6-
460.81 ]5138186]4[03-3-[67386]4[0U9- 02478-]56098U 567382 3[5799
02.[U143]7UU- 9697U-502018488401 075U 1[9[0 POCSAG1200-: Alpha: 09:00-32
10/10 station staff have been asked to confirm. BH 0859öö POCSAG1200-:
Address: 1337798 Function: 3 POCSAG1200-: Alpha: ( POCSAG1200-: Address:
1337946 Function: 3 POCSAG1200-: Alpha: ! POCSAG1200-: Address: 1920326
Function: 3 POCSAG1200-: Alpha: ! POCSAG1200-: Address: 1920312 Function:
3 POCSAG1200-: Alpha: ! POCSAG1200-: Address: 1920245 Function: 3
POCSAG1200-: Alpha: ! POCSAG1200-: Address: 358509 Function: 2
POCSAG1200-: Numeric: 0U 9]060U65-660.023990.7]21000 POCSAG1200-: Alpha:
09:00-53 ALL OK POCSAG1200-: Address: 358509 Function: 255 POCSAG1200-:
Alpha: `bZfb@CSYsA(KgiAYKei POCSAG1200-: Address: 1780137 Function: 2
POCSAG1200-: Numeric: 1234 POCSAG1200-: Alpha: ! POCSAG1200-: Address:
1780100 Function: 2 POCSAG1200-: Numeric: 1234 POCSAG1200-: Alpha: !
POCSAG1200-: Address: 679182 Function: 2 POCSAG1200-: Numeric: 0U 9]061U69
86022683- ] 388.5]93-14146795]470 POCSAG1200-: Alpha: 09:01-24 Daily Test
Alert POCSAG1200-: Address: 1780140 Function: 2 POCSAG1200-: Numeric: 1234
POCSAG1200-: Alpha: ! POCSAG1200-: Address: 614926 Function: 2
Heres a rather big sample of the data to be be parsed:
POCSAG1200-: Address: 352986 Function: 0
POCSAG1200-: Numeric: 0U
9]060U65]070.6]4[8023]35.0.6629.1466257028237.0.16099 40533825.6014 2.4U84
2280673 -- 60295-2653 9 00 POCSAG1200-: Alpha: 09:00-98 MSG FOR MITALI:
PLS CALL MARTA LEREDE 07876 251582 POCSAG1200-: Address: 135502 Function:
2 POCSAG1200-: Numeric: 0U 9]060U69 270.U-U260305.7]3[.797]02478-]5601UU
4601-[-02.3.U 0267.--560989-[]1[.3 7]238 -56U795]0.0[89]5[03U9-97098U
967[9146]7U U-1663U3[02.787-567UU0445978- 6]4[8142[23-U]277799 02.[U146 0[
9]0267.--5]9382 4701 6]..9 502.2.U 2[2382-3709 3
967382-]601-1-560585]5]0388 1]63 3-]]3388
[]UUU14774789]02979U-1]4UU7]0.7U91447479143[6[UU]
62795]967[9-50.6]3U90.U7.9- 6098U 0.0U 5]167[9U
4601-[-0.6[U--96.[U5]02.3.U 0.69[00 POCSAG1200-: Alpha: 09:00-29 7/10
issues have led to the line blockage never actually being formally taken.
Traffic returned to Fast lines at 06.52. There is rain in the area damping
down what remains of the smouldering. MOM will be arranged to monitor the
-> POCSAG1200-: Address: 135502 Function: 255 POCSAG1200-: Alpha:
5Nüü$nNTnMM4LÜ,nT^Dß$Öt^lömLTe POCSAG1200-: Address: 135502 Function: 255
POCSAG1200-: Alpha:
ÄHlllMH0YyÄ(HPüÄ;:xhÄxh<ää:(Z:-KyähÄ:qäÜH1x(Öö>:;=;H,sÄyÄ;k<9hÄ4Ü;9h3xzÖh4:Üö(s3j=XYyÄHrÄ98X;(YHö;=Y4Ü;9h3xz(K
POCSAG1200-: Address: 135502 Function: 2 POCSAG1200-: Numeric: 0U 9]060U6-
460.81 ]5138186]4[03-3-[67386]4[0U9- 02478-]56098U 567382 3[5799
02.[U143]7UU- 9697U-502018488401 075U 1[9[0 POCSAG1200-: Alpha: 09:00-32
10/10 station staff have been asked to confirm. BH 0859öö POCSAG1200-:
Address: 1337798 Function: 3 POCSAG1200-: Alpha: ( POCSAG1200-: Address:
1337946 Function: 3 POCSAG1200-: Alpha: ! POCSAG1200-: Address: 1920326
Function: 3 POCSAG1200-: Alpha: ! POCSAG1200-: Address: 1920312 Function:
3 POCSAG1200-: Alpha: ! POCSAG1200-: Address: 1920245 Function: 3
POCSAG1200-: Alpha: ! POCSAG1200-: Address: 358509 Function: 2
POCSAG1200-: Numeric: 0U 9]060U65-660.023990.7]21000 POCSAG1200-: Alpha:
09:00-53 ALL OK POCSAG1200-: Address: 358509 Function: 255 POCSAG1200-:
Alpha: `bZfb@CSYsA(KgiAYKei POCSAG1200-: Address: 1780137 Function: 2
POCSAG1200-: Numeric: 1234 POCSAG1200-: Alpha: ! POCSAG1200-: Address:
1780100 Function: 2 POCSAG1200-: Numeric: 1234 POCSAG1200-: Alpha: !
POCSAG1200-: Address: 679182 Function: 2 POCSAG1200-: Numeric: 0U 9]061U69
86022683- ] 388.5]93-14146795]470 POCSAG1200-: Alpha: 09:01-24 Daily Test
Alert POCSAG1200-: Address: 1780140 Function: 2 POCSAG1200-: Numeric: 1234
POCSAG1200-: Alpha: ! POCSAG1200-: Address: 614926 Function: 2
Fibonacci Series for the given code snippet
Fibonacci Series for the given code snippet
What is the answer?
int count, n, t1=0, t2=1, display=0;
display=t1+t2; t1=t2; t2=display;
++count;
printf("%d+",display);
Given options were : 0,1,2,-1 `
What is the answer?
int count, n, t1=0, t2=1, display=0;
display=t1+t2; t1=t2; t2=display;
++count;
printf("%d+",display);
Given options were : 0,1,2,-1 `
Decimal byte array constructor in Binaryformatter Serialization
Decimal byte array constructor in Binaryformatter Serialization
I am facing a very nasty problem that I cannot identify.
I am running a very large business ASP.Net application containing many
thousands of objects; It uses serialization/deserialization in memory with
MemoryStream to clone the state of the application (insurance contracts)
and pass it on to other modules. It worked fine for years. Now sometimes,
NOT SISTEMATICALLY, in the serialization it throws the exception:
Decimal byte array constructor requires an array of length four containing
valid decimal bytes.
Running the same application with the same data, 3 times out of 5 it
works. I enabled all the CLR exceptions, Debug - Exceptions - CLR
Exception - Enabled, so I guess that if a wrong initialization/assignment
to decimal field occurs, the program should stop. It doesn't happen.
I tried to split serialization in more elementary objects but it's very
difficult, to try to identify the field causing problem. From the working
version in production and this one I passed from .Net 3.5 to .NET 4.0 and
consistent changes to the UI part, not the business part, have been made.
Patiently I'll go through all the changes.
It looks like old fashioned C problems when char *p is writing where it
shouldn't, and only in the serialization process when it examines all the
data the problem pops out.
Is something like this possible in the managed environment of .Net ? The
application is huge but I cannot see abnormal memory growths. What could
be a way to debug and track down the problem?
Below is part of the stacktrace:
[ArgumentException: Decimal byte array constructor requires an array of
length four containing valid decimal bytes.]
System.Decimal.OnSerializing(StreamingContext ctx) +260
[SerializationException: Value was either too large or too small for a
Decimal.]
System.Decimal.OnSerializing(StreamingContext ctx) +6108865
System.Runtime.Serialization.SerializationEvents.InvokeOnSerializing(Object
obj, StreamingContext context) +341
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object
obj, ISurrogateSelector surrogateSelector, StreamingContext context,
SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter,
ObjectWriter objectWriter, SerializationBinder binder) +448
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo
objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) +969
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object
graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
+1016
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream
serializationStream, Object graph, Header[] headers, Boolean fCheck)
+319
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream
serializationStream, Object graph) +17
Allianz.Framework.Helpers.BinaryUtilities.SerializeCompressObject(Object
obj) in
D:\SVN\SUV\branches\SUVKendo\DotNet\Framework\Allianz.Framework.Helpers\BinaryUtilities.cs:98
Allianz.Framework.Session.State.BusinessLayer.BLState.SaveNewState(State
state) in
Sorry for the long story and the undetermined question, I'll really
appreciate any help.
Marco
I am facing a very nasty problem that I cannot identify.
I am running a very large business ASP.Net application containing many
thousands of objects; It uses serialization/deserialization in memory with
MemoryStream to clone the state of the application (insurance contracts)
and pass it on to other modules. It worked fine for years. Now sometimes,
NOT SISTEMATICALLY, in the serialization it throws the exception:
Decimal byte array constructor requires an array of length four containing
valid decimal bytes.
Running the same application with the same data, 3 times out of 5 it
works. I enabled all the CLR exceptions, Debug - Exceptions - CLR
Exception - Enabled, so I guess that if a wrong initialization/assignment
to decimal field occurs, the program should stop. It doesn't happen.
I tried to split serialization in more elementary objects but it's very
difficult, to try to identify the field causing problem. From the working
version in production and this one I passed from .Net 3.5 to .NET 4.0 and
consistent changes to the UI part, not the business part, have been made.
Patiently I'll go through all the changes.
It looks like old fashioned C problems when char *p is writing where it
shouldn't, and only in the serialization process when it examines all the
data the problem pops out.
Is something like this possible in the managed environment of .Net ? The
application is huge but I cannot see abnormal memory growths. What could
be a way to debug and track down the problem?
Below is part of the stacktrace:
[ArgumentException: Decimal byte array constructor requires an array of
length four containing valid decimal bytes.]
System.Decimal.OnSerializing(StreamingContext ctx) +260
[SerializationException: Value was either too large or too small for a
Decimal.]
System.Decimal.OnSerializing(StreamingContext ctx) +6108865
System.Runtime.Serialization.SerializationEvents.InvokeOnSerializing(Object
obj, StreamingContext context) +341
System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object
obj, ISurrogateSelector surrogateSelector, StreamingContext context,
SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter,
ObjectWriter objectWriter, SerializationBinder binder) +448
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo
objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo) +969
System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object
graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
+1016
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream
serializationStream, Object graph, Header[] headers, Boolean fCheck)
+319
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream
serializationStream, Object graph) +17
Allianz.Framework.Helpers.BinaryUtilities.SerializeCompressObject(Object
obj) in
D:\SVN\SUV\branches\SUVKendo\DotNet\Framework\Allianz.Framework.Helpers\BinaryUtilities.cs:98
Allianz.Framework.Session.State.BusinessLayer.BLState.SaveNewState(State
state) in
Sorry for the long story and the undetermined question, I'll really
appreciate any help.
Marco
Thursday, 8 August 2013
vba excel checkboxes multiple cells
vba excel checkboxes multiple cells
My first question!
I have created a tool which allows the selection (via checkboxes) of
services to be offered at a hospital and which redistributes a nominated
bed total across the services selected. For example, 1000 beds are
distributed among 34 services according to a demand projection and
deselecting any services adjusts the distribution so that bed counts for
services are changing with every click of a checkbox. I have reached a
pretty good point with the tool and its macros so far - select all and
deselect all button for the services and collapsing the lists and hiding
the checkboxes when collapsed. Also there are two bed numbers for each
service, for medical and surgical.
Besides a complete deselection (unselection?) of services, I have a '% to
service' column where a user puts in a number between 0 and 100 depending
on how much of the demand the hospital should serve. I have both these
functions (checkboxes and %) working separately to affect the bed number
columns. If the % value > zero, then the two checkboxes must be true.
Conversely, only if both the checkboxes are false, the % value should be
zero.
So, % is 0 to 100 and affects both columns per service. And, each column
has a checkbox per service.
I'd like to know where I can put the if statements which would have to go
both ways. I can make it so that the state of one checkbox will zero the
percentage, but then this 0% will erase both medical and surgical bed
values. Or, if I put 0%, the checkbox state can't change if it contains an
if cells.value >0 command.
I have also gathered some code ideas to try checking 2 checkbox states and
change cell value (checkbox 1 is on row 31 and there are 34 rows and 2
columns so that the checkbox35 is next to checkbox1):
Private Sub Worksheet_Calculate()
For i = 1 To 34
If Me.Objects("CheckBox" & i).Value = False And Me.Controls("CheckBox" & i
+ 34).Value = False Then
Range("f&i+30").Value = 0
End If
Next i
End Sub
I hope there is enough detail. The easier option for me will be to have %
columns for medical and surgical and do away with the checkboxes. This
really is a presentation thing, since the function work properly
separately, but users need to click the boxes twice and 'select all'
doesn't work.
default view: http://i.imgur.com/NSXdYKn.gif zero% and checkbox is true:
http://i.imgur.com/Ek5Mp15.gif
Thanks so much for any help, guidance and question tips!
My first question!
I have created a tool which allows the selection (via checkboxes) of
services to be offered at a hospital and which redistributes a nominated
bed total across the services selected. For example, 1000 beds are
distributed among 34 services according to a demand projection and
deselecting any services adjusts the distribution so that bed counts for
services are changing with every click of a checkbox. I have reached a
pretty good point with the tool and its macros so far - select all and
deselect all button for the services and collapsing the lists and hiding
the checkboxes when collapsed. Also there are two bed numbers for each
service, for medical and surgical.
Besides a complete deselection (unselection?) of services, I have a '% to
service' column where a user puts in a number between 0 and 100 depending
on how much of the demand the hospital should serve. I have both these
functions (checkboxes and %) working separately to affect the bed number
columns. If the % value > zero, then the two checkboxes must be true.
Conversely, only if both the checkboxes are false, the % value should be
zero.
So, % is 0 to 100 and affects both columns per service. And, each column
has a checkbox per service.
I'd like to know where I can put the if statements which would have to go
both ways. I can make it so that the state of one checkbox will zero the
percentage, but then this 0% will erase both medical and surgical bed
values. Or, if I put 0%, the checkbox state can't change if it contains an
if cells.value >0 command.
I have also gathered some code ideas to try checking 2 checkbox states and
change cell value (checkbox 1 is on row 31 and there are 34 rows and 2
columns so that the checkbox35 is next to checkbox1):
Private Sub Worksheet_Calculate()
For i = 1 To 34
If Me.Objects("CheckBox" & i).Value = False And Me.Controls("CheckBox" & i
+ 34).Value = False Then
Range("f&i+30").Value = 0
End If
Next i
End Sub
I hope there is enough detail. The easier option for me will be to have %
columns for medical and surgical and do away with the checkboxes. This
really is a presentation thing, since the function work properly
separately, but users need to click the boxes twice and 'select all'
doesn't work.
default view: http://i.imgur.com/NSXdYKn.gif zero% and checkbox is true:
http://i.imgur.com/Ek5Mp15.gif
Thanks so much for any help, guidance and question tips!
Subscribe to:
Posts (Atom)