Friday, 15 February 2013

Can applications hosted in IIS Express utilize SQL Server aliases? -


I have a web-API project that is configured with a connection string that contains data for the alias defined in SQL Server The source set configures the manager. The server is running fine when it launches through Visual Studio 2013, but when it launches as a separate process by using% PROGRAMFILES% \ IIS Express \ iisexpress.exe, it fails to connect and Eventually with error:

System ComponentModel.Win32Exception (0x80004005): Network path not found

The procedure works as expected if the connection string was modified to specify the actual server go (Eg local host)

I searched the question asked on a redgate forum, which indicates that at least one other person has also met with this issue.

if statement - Possibilities to short if-conditions in Java -


If I want to reduce it

  if (x) {x = false; } And {x = true; }  

I use the following code:

  x =! X;  

But what if I want to reduce this code? Is there a way to do that? if so, how?

  if (x) {method_1 (); } Other {method_2 (); }  

Can you use? : Statement

  x? Method_1 (): method_2 ()  

And sometimes, it is more readable to divide it into multiple lines:

  isSomethingTrue? Method_1 (): method_2 ()  

* Edit

To be accurate, as others have commented, you specify a return value in some variables Will happen. So the bit of code will actually look like this:

  someVar = isSomethingTrue? Method_1 (): method_2 ()  

means that you can not do it in invalid ways


php - Creating MySQL backup from admin panel -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 5 जवाब

मुझे एक बटन बनाने की आवश्यकता है मेरे व्यवस्थापक पैनल में जब क्लिक किया जाता है, तो एक डीबी बैकअप उत्पन्न होता है।

मुझे बिना किसी कमांड लाइन या phpMyAdmin निर्यात के उपयोग करने का तरीका ढूंढने लगता है।

बटन php के साथ किया जाना है, या कोई अन्य विकल्प।

कोई भी मदद या सलाह या कम से कम एक विचार का स्वागत किया जाएगा।

android - Handling camera and user rotation -


I am going through a lot of answers, but there is a code that I do not know in which direction to choose. I hope someone can point me in the right direction.

I have a custom camera app where I show the preview ( SurfaceHolder ) from the front or back camera. I have a button where the user can rotate the preview image for 90/180/270 degrees. This value is saved and applied to the camera and the preview image.

Although the orientation of the images the users take, the picture is not the same. My question is how do I account for user and device orientation so that the output image can be rotated just like the preview image?

A possible direction (if you are on Android studio) by dragging the code, step by step and its The requirements will be to modify. It certainly does not 'do whatever your app' does, but it can get you off-the-ground (or you can get even more confused). And look, IT handles only rear CAM anyway, a small front of information.

1 / When your activity begins (on cret), record your rotation and lock it so that you do not see the view at any time while transferring your phone. Depending on your initial position, your orientation port or land may be. You can also 'force it' for LAND, for example, but when your activity begins, it will look jerky.

2 / onSurfaceChanged gives you the size of your surface. It can be PART (WLT; H) or Land (W> H) You can send the camera manager W, H to your camera manager to choose the ideal preview size. Since 'getSupportedPreviewSizes' most types (I would always like to say, but not 100% fixed) according to type of land (W> H), you swap your surface W and H.

3 / don does not forget about 'set display ormentation' in your initial orientation, so your preview is not sideways.

4 / Approximately, your surface W is not equal to one of the proposed preview sizes: h, resulting in crushed / enhanced preview (just look at any object with you Cam preview). So now you have to adjust the flat shape again, look at the 'set layout side' at the end of the 'size of the surface'. It is worth noting that you can either adjust the surface for a fit-in (letterbox), as a result the sides may have two background colored bandages, or fill (pan and scan) to fill your entire surface. Some of your screens (which cares)

This helps you correct the preview. I should also mention that there is another quote with preview orientation. Some tablets (Nexus 1 genes, ...) have natural orientation land, but some (such as Samsung 8 3.0) have a port in it. This problem is adjusted during the initial time and expresses itself in the 'isLandTab' boolean.

5 / Now, when you finally get your picture from camera.gate, then you move it back using the same amount. You revolve your preview rather expensive operation (memory-wise). You have to do it in the bitmap, rotate and ... whatever you want to do. Again, shrink, show, ....

Now, when you finally meet through this nonsensical rant, you can ask yourself. Is it not better that you launch activity in the land, lock it in this case?

  1. To swap it does not want W, H
  2. Display Orientation Set Do not
  3. Do not want to rotate the image after receiving the image.

You need to adjust the surface size of the shape to fit in proportion to the proposed / selected preview, as well as to dance.

Have fun, good luck


mysql - geographic database structure -


I have a geographical DB in mysql with more than 15m records so far every record has a field Parent_id : For example in Tuscany Italy has parent_id . It is a tree, but it is garbage

Unfortunately this

  • get all the leaves for all the nodes
  • Get all the descendents of the node
  • Receive immediate children of nodes
  • 1 and 2 can be obtained with nested set structure, 4 actual With the structure. I do not know how to deal with the third

    Unfortunately the nested set structure is not able to add and add nodes.

    So here's the question:

    1. How do you get it structured?
    2. Will you keep using mysql? Something better?
    3. Have you not given any advice about moving the actual DB into the new one?

    In addition, DB Infos must also be through this flexible checker, do you think it is better to build and structure DB directly? if so, how?


    More Confusion With OOP in Python -


    Why do I have to give the song to print as 4 for x but not for two strings? I finally understand the parameters and satisfy them, but I do not know how to print songs for X in addition to the BulldogOnPerd and MemoryContents other than memory address.

      class song (): def __init __ (self, song, x): self.lyrics = lyrics # self.x = x def sing_me_a_song (self): for the line in self: print Line def print_x (self): print x.lyrics happy_bday = song (["Happy birthday to you", "I do not want to sue", "I will stop there"], 'x-value') bulls_on_parade = song ["They will rally around the family", "packets full of shells"], 'x-value'] happy_bound. Sing_me_a_song () bulls_on_parade.sing_me_a_song () def song (args): pass x = song (song = 4, X = song) x come in this snippet of code    

    being a function. x lyrics for code> will pass this address to work (this is not entirely true, but for now, do it) to x as the value of the parameter.

    Bol = 4 is different because the Python function separates between call logic names and variable names.

      def song (args): pass x = song (song = 4, x = song)  

    In fact, if you do this in your code

     

      x = song (song = song) print x.lyrics  

    You will see something like this:

    < Pre> & lt; Function song 0x107b9d1b8 & gt;

    websocket - PrimeFaces Notify -


    I am trying to implement primfolks I applied the exact code shown in the linked example but every The times when I try to run it, I get the following error in the web console.

      Websocket failed. Downgrading the comet and resetting the push. Js.xhtml? Ln = Primefaces & amp; V = 5.1: 1 get http: // localhost: 8080 / notify / primepush / notify? X-Atmosphere-Tracking-ID = 0 & amp; ... NG and X-Atmosphere - TrackMessageSize = True and X-Atom Protocol = True & amp; I have satisfied all the dependencies for Primetime 5.1 and JSF 2.2.6. I'm really stuck on this one, I can not understand what I'm missing.   

    I think your problem is here.

    Include this among the UI in your .xhtml file: Define and script tags

       
      Public invalid execute group message () {RequestContext.getCurrentInstance () . Execute ("doGrowling ();"); }