Profile cover photo
Profile photo
Patrik Landin
29 followers
29 followers
About
Posts

Post has attachment
[Question] Hi I have made this Web service http://ddwap.mah.se/AB6959/ShoppingCart.svc which is uploaded on a Web server. I am now trying to connect to it from within an MVC project locally on my PC. I have added the service reference and it all looks fine but I don't get any response from the service. Any ideas of have to solve this? Thanks!

Post has attachment
Add a comment...

Post has attachment
Add a comment...

Hi, Does anybody know how to make query from table AspNetUsers that includes data ("Role") from the table AspNetUserRoles when I dont have these tables as entities in a model?? Using Code first, Identity EntityFramework.

Hi, I am developing a asp.net web application and have som problems with my connectionString after that I have erased my database as I must move it to a different dll. This is how it used to be when it worked....

<add name="CEConnection"
         providerName="System.Data.SqlServerCe.4.0"
   connectionString="DataSource=|DataDirectory|\EfloristCEDatabaseFile.sdf;Persist Security Info=False;" />

...but now the application throws an InvalidOperationException when trying to create it at the new location. 

Any suggestions of connectionString?  Thanks!

 Hi, I've got a ridiculous problem that is driving me crazy. I have this counter-variable that increments if the code inside the if-statements are true. The problem is that the wrong result is returned. Why is that?

int counter = 0;

if(orig_resistance > 0){
   r1 = getClosestValue(orig_resistance);
     res_array[0] = r1;
     if(r1 > 0){
      counter ++;
     }

   tmp = orig_resistance - r1;

  if(tmp != 0){
   r2 = getClosestValue(tmp);
     res_array[1] = r2;
    if(r2 > 0){
     counter ++;
    }
  }

   tmp = tmp - r2;

  if(tmp !=0){
   r3 = getClosestValue(tmp);
    res_array[2] = r3;
    if(r3 > 0){
     counter++;
    }
  }
 }
 printf("%d\n", counter);  //PRINTS THE RIGHT RESULT

 return counter; //RETURNS WRONG RESULT!!
}

Hi, my Pi wont start anymore. It worked fine a couple a weeks ago and suddenly without changing anything it didnt boot at all. The only thing that happens is that the red LED is on when I power it on. I have tried reflashing the SDCard (using RPi-Sd Card Builder for Mac) a couple of times but it doesnt help. I have tried changing micro-usb-cable as well. Any ideas of what to do?

I am trying to decrypt an encrypted String but get "illegalBlockSizeException: Data must not be longer than 128 bytes" all the time. What should I change to fix this? Code: 

public static String decryption(String msg, PrivateKey key)
throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, UnsupportedEncodingException,
IllegalBlockSizeException, BadPaddingException {
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.DECRYPT_MODE, key);

byte[] stringBytes = msg.getBytes("UTF-8");
byte[] encryptedBytes = cipher.doFinal(stringBytes);

BASE64Encoder encoder = new BASE64Encoder();
String base64 = encoder.encode(encryptedBytes);

return base64;

Trying to learn encryption/hashing etc...: I am looking at this tutorial http://docs.oracle.com/javase/tutorial/security/apisign/step3.html but I am not really sure if a signature is the same as a hash? If not, Which is the best way to create a hash of a message object (or a String)?

Please do not throw sausage pizza away
Add a comment...
Wait while more posts are being loaded