« first day (1076 days earlier)      last day (4098 days later) » 

00:01
hello
Bob
Bob
01:00
It's really impressive how creating a fully fleshed out question without actually posting it helps clarify a problem
You have to fill in the details when you describe it to someone else
01:33
@Bob That's called rubberducking.
 
1 hour later…
02:40
@KendallFrey Hi
03:01
goodday
 
1 hour later…
04:28
0
Q: Entering DataString from Form into table rows

ElegiacI'm using SQL Server Compact Edition 4 and I have this set of tables and columns in my db: javascript_db.sdf (name of my database) Variables (name of my table inside javascript_db.sdf) ID, Name (columns in Variables table) and I want to add all my strings in my MainForm to the Name column, fi...

anyone? :D
@MAD4RA isthat can be in compact ?also
i'm not getting you @Elegiac
compact ?
compact edition
database
hmm i think so, i have no clue about compact database
05:09
can i ask
i have db that has null value ... value will be text for tooltip
but i want to dispose tooltip if value was null
 JsKeywordTipTexts[sqldrAllData1["Reserved_Word"].ToString()] = sqldrAllData1["Syntax"].ToString() + '\n' + sqldrAllData1["Description"].ToString();
if syntax and description was null i want ttiphint.dispose();
but this cant be"
  if (JsKeywordTipTexts[sqldrAllData1["Syntax"].ToString()] == null && JsKeywordTipTexts[sqldrAllData1["Description"].ToString()]== null)
                    {
                        ttipHint.Dispose();
                    }
how can i do that? :) anyone? sorry for noobQ
05:45
i already do this :
JsKeywordTipTexts[sqldrAllData1["Reserved_Word"].ToString()] = sqldrAllData1["Syntax"].ToString() + '\n' + sqldrAllData1["Description"].ToString();

                var a = JsKeywordTipTexts[sqldrAllData1["Reserved_Word"].ToString()] = sqldrAllData1["Syntax"].ToString() ?? sqldrAllData1["Description"].ToString();

                if (a == null)
                    {
                        ttipHint.Dispose();
                    }
it worked but the Description doesnt add lol
 
1 hour later…
07:09
Is this correct ?
 objSwatch = from n in allSwatches
                            where n.SwatchSequenceNumber == id
                            select n;
07:45
ya correct only @codebrain
@JasperManickaraj It had some issues, i wanted only one result so i use list.single(s=>s.id=="1"));
id is int?
yeah it works now mate
@Elegiac There ?
yo @codebrain?
@codebrain Note that if two items in the sequence have the specified id, Single will crash. That is because Single goes through all elements regardless of when it finds the requested item, and ensures just one is in the sequence. First stops immediately upon finding the requested item.
07:52
Hmm Good..
Codebrain yeah, its possible to send selected file to controller in MVC without using Html.Beginform and Ajax.Beginform methods..
i send it successfully
testing
fail
sarcastic comment
@RoelvanUden yeah, Id is the primary key in table. and I double check the insert so i wont have a second result on the same id mate.
@Elegiac I have a problem with sql compact. just started to learn that thingy
I started to work on contosso university with EF 4.1 which uses compact database.
im becoming to hate ce now .xD
07:59
lol
you know EF ?
nope sorry ...
oops
Okay.
@Elegiac i have this package version of CE id="SqlServerCompact" version="4.0.8854.1" />
in connection string i mentioned
<add name="SchoolContext" connectionString="Data Source=|DataDirectory|School.sdf" providerName="System.Data.SqlServerCe.4.0"/>
is that right ?
im using the same db but 4.0.8876.1
but i think its still same
okay Eoeg, thanks for the link roel
ASP.NET is still somewhat dumb inside.
08:28
Somewhat ahahaha understatement of the year
may be. to use sql server compact, i need sql compact and ef.sql compact. still it doesnt detect it. :\
09:11
Hey, @CodeBrain
how're you doing?
Hey @chukwu ,I am good man. how are you ?
I'm alright
hiii ,anybody knows about firebreacth plugins?
oh shit son
ncrunch license
what's happening today?
09:12
1
Q: Basic MVC Example using Twilio API

Farhan MukadamBACKGROUND First time using Twilio. Using ASP.NET MVC4 Using official twilio-csharp library: https://github.com/twilio/twilio-csharp PROBLEM I want to develop a MVC3 Web Application which will respond to calls to my Twilio numbber. The problem i'm facing is as to how to start with developing...

@Chukwuemeka Nothing much, learning some EF, with contosso univ sample application. it bugs me off. :\
@codebrain Why's that?
i want how to fire com event of c# in firebreath
@Chukwuemeka wait ll tell
@drch is there any advantage you're currently getting from NCrunch that's worth the pay? I'm just wondering..
09:14
@Chukwuemeka no - it is overpriced
but i didn't pay for it so yay
@drch My opinion exactly..
for my money, resharper's test runner is good enough.
how did you get the license then?
the place im working at
NCrunch: $159
Resharper: $149
i have my own license for resharper
We don't enforce testing here.
kind of a shame
I only do tests on my side projects because I want to
Has anyone had production-level experience with both Firebird and PostgreSQL?
09:22
hi @drch
I need some comparison.
i got problem with db (compact) can i ask?
just a simple problem .xD
@Chukwuemeka yo, On creating a controller with model and entity class I get a error.
of course you can ask
i just may not be able to answer
@drch Haha
09:24
@codebrain need a talk
call ?
string conStr1 = DBEngine.JS_CSDB_PATH;

            SqlCeDataReader sqldrAllData1;
            SqlCeConnection sqlCon1 = new SqlCeConnection(conStr1);

            SqlCeCommand sqlCmd1 = new SqlCeCommand("Select Reserved_Word, Syntax, Description From JS_TABLE", sqlCon1);


            sqlCon1.Open();
            sqldrAllData1 = sqlCmd1.ExecuteReader();


            while (sqldrAllData1.Read())
            {

                JsKeywordTipTexts[sqldrAllData1["Reserved_Word"].ToString()] = sqldrAllData1["Syntax"].ToString() + '\n' + sqldrAllData1["Description"].ToString();
its working now
problem was null tooltip always shows even no text on it
i think its the newline '\n' that makes that popup
but i got no problem with this before:
 CsKeywordTipTexts.Add(sqldrAllData["TypeName"].ToString(), sqldrAllData["Syntax"].ToString() + '\n' + sqldrAllData["Description"].ToString());
even null data in table row it wouldnt show
any advice @drch
is syntax ever empty?
I like that green color !
09:27
@codebrain I need to see your connectionString
what is it @codebrain
in the database, is syntax empty?
some have syntax some have not
same as description @drch
:12020843   <add name="SchoolContext" connectionString="Data Source=|DataDirectory|School.sdf" providerName="System.Data.SqlServerCe.4.0" />
@codebrain Daamn. Compact.. brb
09:29
SchoolContext is my context class name.
yeah compact.
@Elegiac well you have to remove the empty ones. i remember that you had duplicates. you are probably replacing existing values with the empty ones.
i cant do it @drch reason why i have other datas for other rows in the table, but some dont have
@codebrain I suggest you add a reference to 'System.Data.SqlServerCe'
i already try to make it var, then make a simple condition that if its null then ttipHint = Dispose(); but doesnt work
@codebrain , and set it's CopyLocal property to true
09:31
and its because of the newline lol
'\n'
while (sqldrAllData1.Read())
{
	var key = sqldrAllData1["Reserved_Word"].ToString();
	var val = sqldrAllData1["Syntax"].ToString() + '\n' + sqldrAllData1["Description"].ToString();

	// only replace if it's a new key or if the existing value is empty
	if (!JsKeywordTipTexts.ContainsKey(key) || string.IsNullOrWhitespace(JsKeywordTipTexts[key]))
	{
		JsKeywordTipTexts[key] = val;
	}
}
sqlCon1.Close();
@Chukwuemeka There is a reference, i have nuget package for sqlcompact.
@Chukwuemeka how to do that ?
@Elegiac string.IsNullOrWhitespace(str) returns true if null, string.empty or whitespace only
Just read a comment on an answer - went to upvote it and the up arrow wasn't there... ... then I realised it was because I wrote it 6 months ago... * facepalm *
'string' does not contain a definition for 'IsNullOrWhitespace' @drch
09:33
@codebrain , right-click on the reference to that assembly in your Solution Explorer's reference list, select Properties and set the CopyLocal property to true
@Elegiac what version of .net are you using?
c#
express
what version? 3.5? 4.0? 4.5?
string.isnullorwhitespace was added in 4.0
er its capital S sorry
string.IsNullOrWhiteSpace() msdn.microsoft.com/en-us/library/…
@Chukwuemeka yeah will do that and revert you :)
You can make an extension for IsNullOrWhiteSpace if you really need it in other versions.
09:35
alternatively, you could do str == null || str.Trim().Length == 0
still tooltip appears @drch
@Elegiac what is the behavior you expect?
im expecting if syntax and description is null in a row, tooltip should dispose
right but how is your code written
how does it determine whether or not to show a tooltip
i think its because of '\n'
when it detected whitespace it will automatically dispose
mousemove
it worked the time i remove '\n' haha
but the problem was
09:39
ok so if you have:
Reserved_Word: try
Syntax: null
Description:null

what would you expect to be the value of JsKeywordTipTexts["try"]
none
null? or would the key not exist
or string.empty?
whatever it is, you should be able to add that logic...
eg: if syntax or desc is null, don't add a newline between them
i see
but can we add it in while (sqldrAllData1.Read())
{
?
sure
so this:
var key = sqldrAllData1["Reserved_Word"].ToString();
                var val = sqldrAllData1["Syntax"].ToString() + '\n' +  sqldrAllData1["Description"].ToString();
should be insidecondition?
09:44
sounds good to me
ok ill give a try ... thanks @drch
does any knows about ldap?
how to connect to ldap?
anybody??
09:59
still doesnt work @drch lol
  var key = sqldrAllData1["Reserved_Word"].ToString();
                var val = sqldrAllData1["Syntax"].ToString() +  sqldrAllData1["Description"].ToString();
                var val_ = sqldrAllData1["Syntax"].ToString() + '\n' + sqldrAllData1["Description"].ToString();

                //only replace if it's a new key or if the existing value is empty
                if (!JsKeywordTipTexts.ContainsKey(key) || string.IsNullOrWhiteSpace(JsKeywordTipTexts[key]))
                {
                    JsKeywordTipTexts[key] = val_;
it worked now
//only replace if it's a new key or if the existing value is empty
                if (!JsKeywordTipTexts.ContainsKey(key) || string.IsNullOrWhiteSpace(JsKeywordTipTexts[key]))
                {
                        JsKeywordTipTexts[key] = val_;

                    if (!JsKeywordTipTexts.ContainsKey(key) || string.IsNullOrWhiteSpace(val))
                    {
                        JsKeywordTipTexts[key] = val;
                    }
                }
thats fine...
but you could make the logic a bit more simple
how? .xD
actually... you could just trim the val
.Trim() removes all whitespace
^ At the beginning and ending of the string, not in between.
10:14
var val = (sqldrAllData1["Syntax"].ToString() + '\n' + sqldrAllData1["Description"].ToString()).Trim();
ill try it
does whitespace include null newline?
yes.
nice
@Elegiac when you get stuck, you need to take a step back from the problem and figure what you want the output of the function to be and solve that
rather than saying "what lines do i have to add to make this work"
noted thanks @drch
yeah it worked also thanks
10:25
great
10:51
hi, an information, i've a data contract object with some info, included one password. i've to serialize it, but i need to encrypt my password. but i still have to use the object with the not encrypted password, to authenticate in the process. question is, i know if i do tempDataContract = myDataContract, if i update tempDataContract.Password even myDataContract.Password will be updated. any suggestions for this inconvenient? thank you
11:06
@codebrain there?
@neha Tell?
@ani07 ? what
Any queries?
@ani07 ohh.. yes in sql
in mysql?
mssql?
11:09
mssql
ask
I have my data in rows I wish to pivot the rows to columns inquery.. I cant use pivot keyword. so how to do this?
oh..sorry i am afraid i can answer that :(
@Neha tell me ..was busy with some work
be there.. @codebrain fastr....
11:15
done
0
Q: Is correct to place a switch-block inside another one?

Gelo VolroI shall provide a piece of code from one method, where I'm trying to handle commands/values from the web-service. switch (cmdName) { case "getShapefile": switch (cmdValue) { case "buildings": HandleShapeFile(ref shapfile); ...

any news about assigning / copying an object to a new one?
11:32
@GeloVolro in general, its ok, but if it gets really long you may want to refactor
switches like that can be hard to understand later on
I would totally resort to some reflection to avoid all those massive switches.
11:46
reflection?
pfft
//switch(i) {
//   case 1: Foo(); break;
//   case 2: Bar(); break;
//   default: throw new Exception("unexpected");
//}

var lookup = new Dictionary<int, Action>() { {1, Foo}, {2,Bar} };

if (!lookup.ContainsKey(i)) {
   throw new Exception("unexpected");
}
lookup[i]();
Sam
Sam
@All anyone having WCF Webservice Writing experience ?
@drch @RoelvanUden @axel
Sam
Sam
@RoelvanUden i need some help
12:04
@Sam Don't randomly ping people. It's considered rude.
2
Sam
Sam
@KendallFrey i need help from RoelvanUden that's why i ping to he.
She...
Yes, I have a female avatar. No, I am not female.
@Sam Roel van Uden is a man.
@Sam That's not as bad as just pinging the last 3 people to talk.
Sam
Sam
Sorry for that.
This is one of the best first posts I've seen. stackoverflow.com/q/19027352/785745
12:08
0
Q: Reinterpret cast in C# , how?

Gelo VolroI have defined such a function: public static void WriteResponse(ref HttpContext ctx, object sender, Type typeName) { var model = sender as typeName; // it's an error-line, becase of `as typeName` var jsonObject = new JavaScriptSerializer().Serialize(model); ctx.Response.AddHeader("A...

@GeloVolro Protip: You're not doing boxing there anywhere.
Protip 2: var doesn't mean "anything", but rather "something specific, but explicitly specified"
@KendallFrey isn't a boxing, just a convertation to System.Object?
the some exact type, for e.g. List<System.String>
It's the same object reference, but interpreted as an object.
@KendallFrey implicitly
so, the boxing is

int a = 2;
object b = a;

and NOT the:

int a = 2;
object b = (object)a;

?
12:18
@RoelvanUden oops
@GeloVolro There is no difference.
Boxing is from value type to object
ref type to object isn't
Protip 3: ref isn't used there, you can remove it.
@KendallFrey ref type works differently for object types, it does work as double-pointer
Yes.
The ref keyword anyway
if you cast a reftype to object, the reference doesn't change
@KendallFrey so that's why there isn't a sense to use ref for object in function argument
@GeloVolro ref is only ever useful if you want to reassign the variable.
which in C# tends to be smelly in many cases
12:48
Starting to read ISAPI. Any good links or resources ?
hey people, I hope someone with some VSTO experience is with us: For some reason a Outlook add-in I developed is getting deactivated on some computers. There is no error in my logfiles and I can re-activate the add-in from the deactivated COM-addins without a problem.

Is there a log where Outlook protocols when/why it deactivated add-ins?
13:13
Dear Experts, how do I change the language of a resource file to another language? E.g. I have a nl-BE resource file and I wish to change it to fr-BE. I cannot find any reference or the like in any .xml file
omfg this task was estimated as 8h and it took literally < 5 mins
i wish we had those
yeah i dunno who came up with thse
i can't milk it too much or ill get called out
We do scrum
yeah so do we
13:22
But you weren't involved in estimating?
oh sorry, i meant we do standups :P
no idea who estimated these but i like whoever it was
then again, we have an unrealistic deadline anyways
for our last release i had fuck all to do in the third week and ended up fixing typos and IE8 issues to fill the time
hi how to change the selected file name using fileupload and save with the changed name?
when a file is uploaded, its just a stream. you can save it as whatever you want
HttpPostedFile somefile = Request.Files[0];
somefile.SaveAs(@"c:\temp\jasperrules.txt");
@KendallFrey am i rude
@Steve Yes, so?
Sam
Sam
13:35
!!Is drch rude?
@Sam No
Sam
Sam
Hmmm....
If Steve is heterosexual, this sentence is false.
Yo! I think I have asked this before... but what is the best way to convert a stream to objects (that is, data comes in on a socket to my program, and I want to interpret that as objects (the structure is known))
@Markus That depends on the structure. What is it?
13:39
grab the bytes, deserialize it back into the object...
ermagerd
how do I deserialize it?
160h task in jira
how did you serialize it to send it over a socket?
@Markus if both ends are .NET, you can get away with binary serialization
13:40
it's data from different devices, android and iOS
@drch That should be about an hour for you.
@KendallFrey looks like about a week tops tbh
@Markus But what's the structure?
how do you mean structure?
it's different types of messages with a header and some payload
the header specifies what payload to expect (lenght and type)
> the structure is known
So surely you know how to deserialize it.
13:42
i ran into this the other day --- if the object you serialize isn't the SAME type of object that you sent over it'll get pissy, so if you have two programs: program x and program y, and in both of those programs you create identical classes... it won't work, it literally has to be the SAME one
I just use JSON.
@Steve with binary serialization yeah
Hey guys, I'm trying to "write" data to my standard in, so I can run a number of (timed) tests after one another, on an application that gets its input from stdin.
yup
currently, I use:
13:44
yar. just gzip up some json and fire it across
Stream stream = new MemoryStream();
stream.SetLength(500);
Console.SetIn(new StreamReader(stream));
StreamWriter writer = new StreamWriter(stream);
let's say we have a base message: |startbyte(byte)|type(byte)|size(short)| and then follows the payload
@Jasper You should probably just redirect or pipe stdin from a file or process.
However, this requires me to reset the stream position and means that the application will read the remaining space as extra whitespace
@Markus do you really require that complex of a protocol?
13:45
@drch so if i used non-binary serialization(is there such a thing?) i could just create two classes who's structure matched and it would work?
Is there a proper way to write to my own stdin?
@Steve yes.
neat
@Steve Of course there's such a thing. xml, json, etc
{ "To" : "Steve", "Answer" : "Yes"}
13:45
could it be simpler?
well, i'm talking about poco
@KendallFrey I looked, but I couldn't find a way to redirect it from within the process itself...
not json or xml or anything thats also a standard outside of .net
In fact, it's possible to make a different binary serialization that would work
json and xml are pretty standard and inside .net
13:46
@Jasper But why do you want to?
in C i would kind of create a struct and map the data strait to it. I can't find any good way to do the same in C#
no JSON
proto buffers
@Markus Marshal copy onto a struct
define struct as sequential
tada, same format
I have read some about that (Marshalling), would more of you agree that this is a decent way?
sounds gross
i just json all the things
13:48
It seems like you should just parse your data.
Honestly I would just use a binary reader and use reads for full control.
marshaling is a bit icky, but since you like C...
@KendallFrey For a school assignment, I wrote an application that reads it input from its standard in. Now, I've got to analyze the speed differences of different inputs (the input includes the number of tasks used and the type of (busy wait) lock used). Now I thought it would be easy to automate the whole thing if I could just write to the standard input and run the (renamed) main function a number of times.
right - and it needs to be done in obj-c and java as well
like and like.... we are a company where I'm not the boss...
because its ios and android callers
sounds like not fun
This is a comparison of data serialization formats, various ways to convert complex objects to sequences of bits. It does not include markup languages used exclusively as document file formats. Overview {| class="wikitable sortable" |- ! Name ! Creator/Maintainer ! Based on ! Standardized? ! Specification ! Binary? ! Human-readable? ! Supports references? ! Schema/IDL? ! Standard APIs |- | ASN.1 | ISO, IEC, ITU-T | | | ISO/IEC 8824; X.680 series of ITU-T Recommendations | (BER, DER, PER, or custom via ECN) | (XER, GSER, or custom via ECN) | | (built-in) | |- | Bencode | Bram Cohen (...
pick your pony
13:50
I suppose I could do it from a new application instead, but that would but that would also include things like changing the output format... perhaps I should just do that. I do feel the way I want it should just be possible and don't understand why it isn't just working...
we have looked at json as well but only very very brief, and since none of us was familiar with it we thought that it would be simpler just to send it as binary, but that might have been a mistake?
Binary is faster and smaller. It is not simpler as you will need reader/writer functions.
Protobuf can give some love to do it for you, but full control is gone then
Hmm protobuf seemed ok
@RoelvanUden once you have enough data for the size to truly matter, if you add proper compression, the difference size is probably minimal. Of course, compression will mean a lot slower
but does it work with c#
13:57
@Markus are you writing the ios and android apps as well?
speed is relative.
not me. but it's my colleagues so they are acutable (sorry, google translation, don't know what it means :) )
everything is
speed is probably not that big issue

« first day (1076 days earlier)      last day (4098 days later) »