Saturday, 15 February 2014

android - zbar and reading 2D barcode doesn't work -


मैं निम्न पैरामीटर्स का उपयोग करके स्कैनर को समायोजित करता हूं

  scanner.setConfig (0, Config X_DENSITY, 400); Scanner.setConfig (0, Config.Y_DENSITY, 400); Scanner.setConfig (प्रतीक। CODABAR, Config.ENABLE, 1); Scanner.setConfig (Symbol.EAN8, Config.ENABLE, 1); Scanner.setConfig (प्रतीक.पार्टी, कॉन्फ़िग। एनएएनएबलईई, 1); Scanner.setConfig (Symbol.UPCE, Config.ENABLE, 1); Scanner.setConfig (प्रतीक। ISBN10, Config.ENABLE, 1); Scanner.setConfig (प्रतीक .UPCA, config.ENABLE, 1); Scanner.setConfig (प्रतीक। EAN13, कॉन्फ़िग। एनएएनएबलईई, 1); Scanner.setConfig (प्रतीक। ISBN13, Config.ENABLE, 1); स्कैनर। SetConfig (प्रतीक। I25, कॉन्फ़िग। सक्षम, 1); Scanner.setConfig (प्रतीक। DATABAR, Config.ENABLE, 1); Scanner.setConfig (Symbol.CODE39, Config.ENABLE, 1); Scanner.setConfig (प्रतीक। पीडीएफ 417, कॉन्फ़िग। एनएएनएबलईई, 1); Scanner.setConfig (प्रतीक। QRCODE, Config.ENABLE, 1); Scanner.setConfig (Symbol.CODE93, Config.ENABLE, 1); Scanner.setConfig (Symbol.CODE128, Config.ENABLE, 1);  

और

  पूर्वावलोकन का पूर्वावलोकन करें। पूर्वावलोकन करेंकेलैक पूर्वावलोकन सीबी = नया पूर्वावलोकनकॉलबैक () {पूर्वावलोकन पर सार्वजनिक void (बाइट [] डेटा, कैमरा कैमरा) {कैमरा। पैरामीटर पैरामीटर = Camera.getParameters (); आकार का आकार = parameters.getPreviewSize (); छवि बारकोड = नई छवि (आकार। चौड़ाई, आकार। हाइट, "Y800"); barcode.setData (डेटा); Int परिणाम = स्कैनर स्कैनरमाइज (बारकोड); स्ट्रिंग आउटपुट = ""; यदि (परिणाम! = 0) {previewing = false; mCamera.setPreviewCallback (शून्य); mCamera.stopPreview (); प्रतीकसैट सिम्स = स्कैनर.जेट्स रिजल्ट (); के लिए (प्रतीक sym: syms) {आउटपुट = आउटपुट + sym.getData (); बारकोडसंयोजित = सच; } अलर्टडिलाओग.बिल्डर बिल्डर = नया अलर्टडायलोग। बिल्डर (संदर्भ); Builder.setMessage (आउटपुट) .setCancelable (false) .setPositiveButton ("ठीक है", नया DialogInterface.OnClickListener () {सार्वजनिक शून्य पर क्लिक करें (DialogInterface संवाद, Int id) {ReumePreview ();}}); अलर्टडायलोग चेतावनी = बिल्डर.क्रेत (); alert.show (); }}};  

लेकिन मैं निम्नलिखित नमूनों का उपयोग करते हुए मैं परीक्षण 2 डी बार कोड नहीं पढ़ सकता

किसी भी विचार यह कैसे काम करता है

< / Div>

लूप के लिए ब्रेक इन करें

  पूर्वावलोकनकॉलबैक पूर्वावलोकन सीबी = नया पूर्वावलोकनकॉलबैक () {public void onPreviewFrame (बाइट [] डेटा, कैमरा कैमरा) {कैमरा। पैरामीटर पैरामीटर = camera.getParameters (); आकार का आकार = parameters.getPreviewSize (); छवि बारकोड = नई छवि (आकार। चौड़ाई, आकार। हाइट, "Y800"); barcode.setData (डेटा); Int परिणाम = स्कैनर स्कैनरमाइज (बारकोड); स्ट्रिंग आउटपुट = ""; यदि (परिणाम! = 0) {previewing = false; mCamera.setPreviewCallback (शून्य); mCamera.stopPreview (); प्रतीकसैट सिम्स = स्कैनर.जेट्स रिजल्ट (); के लिए (प्रतीक sym: syms) {आउटपुट = आउटपुट + sym.getData (); बारकोडसंयोजित = सच; टूटना; } अलर्टडिलाओग.बिल्डर बिल्डर = नया अलर्टडायलोग। बिल्डर (संदर्भ); Builder.setMessage (आउटपुट) .setCancelable (false) .setPositiveButton ("ठीक है", नया DialogInterface.OnClickListener () {सार्वजनिक शून्य पर क्लिक करें (DialogInterface संवाद, Int id) {ReumePreview ();}}); अलर्टडायलोग चेतावनी = बिल्डर.क्रेत (); alert.show (); }}  

};


c# - NHibernate always hydrates many-to-one -


I am experiencing something weird while using NHibernate. I have opened a codebase that I did not write, and who He's not here anymore. So I think that what I see is more tips on debugging than anything else.

I am using the NHINNET 3.4 Linux provider to query one unit, which has a lot of relation with another entity

Whatever I see is then Also, as long as I do not use the property which represents a number of relationships, it is always hydrated. By looking at questions through NHibernate profiler, I can see that the property is loading lazy. Setting Breakpoints with My Debugger I can see that the property has never been accessed.

When using the NHibernate profiler, I can see that when I load the Basic Entity List, but not in the same question

I do not know why this happens, But this results in N + 1 problem

Entities are defined in hbm.xml files.

So what I am asking is the input where I should start digging. I think that whatever I can think of already, I have tried to do all this.

"post-text" itemprop = "text">

The problem is not on NHibernate, it is on the use side (we both would agree I can say)

So, what we want (underlying or clear) is the initial point is the lazy setting:

  // class level // is sluggish by default & Lt; Class name = "entity" ... lazy = "true" ... & gt; ... // references multiple-to-one levels, by default also lazy & lt; Many-to-one names = "unit" lazy = "proxy" ... /> In order to avoid N + 1, we must ensure that we do not have the  batch-size  setting, 

  / / class / institution level // attention - it is not contained , We have to determine that & lt; Class name = "entity" ... lazy = "true" ... batch-size = "25" & gt; ... // collection level // attention - it is not rooted, we have to decide that & lt; Bag name = "Entities" ... batch-size = "25" & gt; ...  

On its place, NHibernate will not automatically load more than necessary. So what can be the case of general usage, when the context needs to be loaded?

When overlapping:

  public override baul par (object obj) {} public override Int GetHashCode () {}  

These methods should be overridden to provide a unique key to the business (for some time - for joint-id, even if necessary).

Last but not least

strong>, There may be a problem with your debugger. Debugger is actually affecting loading, because whenever we are looking at anything in the debug window ... we force NHBeNnet to load lazy stuff.

This is surprisingly the most frequent source of "forced" loading, then clear your supervisors ...

Finally, suggestions - just to load the original unit Unit Testing Finally, clear the session if you see some of the DB hits, see (with the profiler) you can also easily check what was the reason ...


javascript - Combining string with JSON object to return the data -


I have a JSON object that I need to get a price from.

This is the object reference that works ... I want to get the data.

dataJSON.companies [0] .fields.Internet.length

What do I need to do to somehow evaluate the object with a string variable . Something like this ...

  var mediaType = 'Internet'; DataJSON.companies [0] .fields + MediaType + .length;  

Is there any way to do this? I've been stumped.

When you do not know the name of the property till runtime.

var mediaType = 'Internet'; DataJSON.companies [0] .field [media type]. Length;

You can access the members of the object either with dot notation or square bracket notation.

For example

  var results = myobject.propertname;  

or

var results = myobject ["propertyname"];

python - check this list for a puzzle word game -


The issue is to make a word game, word melee and solve it. For guidance, I need to see if I have made changes, estimates (counting, if true, wrong), and if it repeats properly, then correct:

  def main ) Print ("Welcome to Welcome to My Game, Puzzle.") Print ("Gives Game") Wordlist = Open ("wordlist.txt", "r") Import Random Def Random Word (wordlist): wIndex = Random.randint (0, len (wordlist) Print for print in wrong word ("wrong guess:", end = ""): 1) return word list [wIndex] print (" (0, lane (secret) - for the category in the lane (secret) - (*) DEF display game (wrong, right): print (letter, end = "") print () spaces = '-' * * 1): If the secret [1] to the right: empty = empty [: i] + secret [i] [i + 1:] space for the letter in the blank: print (letter, end = "") print () Def Getgoe (approximate): while true: estimate = input () estimate = estimate. Estimate) = 1: Print ("Enter" ("Please try again, you are already using that letter.") Alif does not appear in "abcdefghijklmnopqrstuvwxyz": Print ("Please enter a letter Keep "=)" Yes "if: Keep = input () if you want to play again ((yes or not)", end = ""), while correct: keep = = "yes" : Moving is going to be the right elife == "no": return false and: print ("yes or no.")  

main

< V class = "post-text" itemprop = "text">

Many things are going wrong here, and I took the time to go through your code and have noticed that specific lines are wrong. You can find that list but it does not really answer your question, so I will not paste the whole analysis.

Why answer your question, when you run the code, nothing happens That you never call main You only define it.

  Def my_main (): Print ("There is a bunch of stuff here!") # Never called  

Nothing happens when you run this code You have to:

  def my_main (): print ("a bunch of stuff here!") Main ()  

to run it.

Now as I mentioned above: The code you wrote will not do what you are trying to do. However, this issue is different from the other nothing is doing. If you need some help applying the suggested changes to the links above, then you ask about a specific problem after trying the changes.


web services - Filepicker Connection Limit -


Then we have a large amount of images stored on filepicker, it uses S3 as its storage point and We were not accumulating the S3 file space within our DB, so we need to get it to the large scale to get the information. I have a question that we have once installed the script to capture every S3 file name. We are just concerned about hitting a connection limit or DDOS prevention software. We have planned to try to reduce it at 200ms intervals, but someone else is facing similar situation or know what the limit of connection is?

According to the email from the filecircurred support, 200ms is a secure interval between calls.


Programing a simple routine in microsoft excel 2007 on windowx xp -


I have minimal experience with coding tasks within software platforms (such as SPSS syntax, matpup scripts, psycho code). Because of this, I think that I congratulate myself that I can codify the normal routine loop for general programs. I hope this is a way of doing this for Excel. Specifically, there is a way I can excel the code: Open a file, delete the two columns respectively, and save that file from a new file name in a new location and repeat it for all the files in a folder ? I believe the answer to this question would be very useful for individuals with minimal coding experience, which would benefit from the code which automatically works in Excel automatically without pointing and clicking in the GUI

  • Turn on the Macro Recorder
  • Open
  • Open your first file
    1. Open
    2. / Li>
    3. Delete your two columns
    4. File
    5. Prevent the macro recorder

    This will give you the necessary VBA code, then you can wrap a simple loop around it to repeat all the files in your directory.

    Give it a shot, then come back with the code, if you have a problem, then you have to ask a specific question and ask.


    Neo4j Import Tool Hanging -


    I am trying to import 22,148,908 nodes and 173,574,311 edges from CSV files. I left the neo4j-import tool to run overnight, but there has been no change in the production since 5 minutes of the start; the import is hanging and the output is as follows:

     < Code> [& gt; 34.39 MB / s ---- | Properties (2) ====== | * NODE ------------------------------------- v: 66.0 9 MB / s-] 16 MB  

    At the top it looks like the thread is still doing something. The CPU usage is more than 50% on that process, however, the disk usage is not growing and there is no line in messages.log .

    What are the debug options, I am able to understand what is happening?

    In fact, I remember a recent issue where this can happen if the last character of the input file is an exclamation (). "). If so, just add a new line and I think this should work.


    ios - Swift Sprite Kit passing Bool -


    I found an image with 2 faces, up and down (imagery of a card). This image changes when you tap the image.

    I used bool to get the expression, however, once again the scene is presented, I want to show the image which was above / below in the previous scene. Note that this is only 1 scene, and it presents itself again.

    How can I pass a Bool value between the scenes?

    // Update:

    My code:

      .... var FaceUp = true .... override funk komovatview (see: sqview ) {Titikesr = Skeccr (image named "Tiseediar png") TTexture.filteringMode = .Nearest T2Texture = SKTexture (imageNamed: "T2Card.png") T2Texture.filteringMode = .Nearest card = SKSpriteNode (texture: TTexture) Card.position = CGPoint (X: Rate.position.x - (TransparentLayer.size.width / 3), y: rate.position.y) Card.size = CGSize (width: 50, height: 50) card.name = "card" card .zPosition = 100 self.addChild (card) Flip (FaceUp)} Flipp (State: Boole) {Fasup = State if (! State) {Card.texture = TTexture // Ruti Pleyrktekstek = T1 Pleyrkrn action (Rnanimeshn 1) Face-Up = true} and {Kardktekst = T2Texture // error Pleyrkteksteks = T2 Pleyrkrn action (Rnanimeshn 2) Faceup = false}} override function touchesBegan (touches: NSSet, withEvent event: UIEvent) {to touch: UITouch = go UITouch as touches.anyObject () touchLocation = touch.locationInNode (self) to the node: SKNode = self.nodeAtPoint (touchLocation) If node .name == "card" {scale 1 = sakayction. ScaleTo (0.7, duration: 0.1) Repeat = SKAction.scaleTo (1, duration: 0.1) scaling = SKAction.sequence Switch to ([Scale 1, Scale 2]) Card.runAction (scaling) self.flip (faceup)}} restart () {self.saveHighScore () LastScore = function score self.addLeaderboardScore (self.Score) to transition = SKTransition .fadeWithDuration (1.8) to view = GameScene (size: self.frame.size) Scene.LastScore = score Scene.FaceUp = faceup scene .scaleMode = SKSceneScaleMode.AspectFill self.scene .view .presentScene (visual, transition ?? Transition)}  

    You can define GameScene A function is like the following.

      func setCardState (State: Bool) {FaceUp = State if (! State) {Card.texture = Texture2 Player} Texture = T2} Other {Card.actactation = Texture 1 Player.ctactation = T1}}  

    and call it in the new code with didMoveToView .

      override function didMoveToView (See: SKView) {TTexture = SKTexture (imageNamed: "TCard.png") TTexture.filteringMode = .Nearest T2Texture = SKTexture (imageNamed: "T2Card.png") T2Texture .filteringMode =. Closest Card = SKSpriteNode (Texture: TteExctions) Card.position = CGPoint (x: rate.position.x - (transparent. Size.width / 3), y: rate correction. I) Card.size = CGSize (width: 50, height: 50) Card.name = "card" card.geosition = 100 auto.addChild (card) setcardstate (faceup) // Added line. }  

    Set the old face-up value with restart the function restart .

      Start the function () {self.saveHighScore () LastScore = Score go to self.addLeaderboardScore (self.Score) Transitions = SKTransition.fadeWithDuration (1.8) Go Scenes = GameScene (Size: self. Frame.size) Scene.LastScore = Score view? .scaleMode = SKSceneScaleMode.AccpectFill Scene.FaceUp = FaceUp // Changed Line Self.scene ?. View? .Prustussin (scene, transit: transition)}  

    ios - Submitting a new XCode project app as an existing app -


    I have a published iOS app and no source code for that app.

    Can I remake it from scratch as a new XCode project and publish it as an update to the original app?

    Since the question was updated to my update, it is not okay, leave it anyway will be given.

    The original question was:

    My friend created and submitted an app but lost some of his source code I wanted to buy it from him and was wondering if I could make a new project, I could upload the app from scratch and upload binary as an update.

    This was my answer:

    You should do the following:

    1. with distribution rights Create your own developer account
    2. Allow the app to transfer it to your developer Account in iTunesConnect
    3. Create an app code so that you can update it
    4. Update the app
    5. Whatever you want to do

    Hope that helps :)


    date - Display todays day of the week, month, day, year in THIS format in PHP? -


    I would like to present this format of current date using PHP I have googled and found that there is some variation of what I want to do, but for the company which I want to work specifically wants to match it in this format to match.

      Monday, March 16, 2015  

    Thank you.

    If you have seen that 'D is able to understand it very easily:

      Date of Retention ('L, FJ, Y'); 


    c# - Threadsafe read from a stream -


    How to read from a stream - without using heavy buffestream Locks ? I am reading audio data from the file using the NAudio because the NAudio stream read is locked on the methods, I have the BufferedStream < / Code> is used as a cover I need to read the data However, I lost thread - security Unfortunately, I can not read data in large blocks, because the interface I use is Float GetSample (long) at only 1 sample at a time The Dhti.

    I have not used that library anytime, but if I understand you correctly, then your disk file is locked. Because you have to read it, so no other application can read it, is this correct?

    In this case, this is not your app that is multi-threaded, and you should not need the locks within your app. You have to make sure that the file has been opened for reading only, which allows read-only access to other applications.

    If a file opens the full set of NAudio parameters when you open it, you will be able to open the file with permission to share, otherwise if a stream can be passed to read the NAudio, You will be able to open the file, and then pass the stream to NAudio.


    PHP Pass By Reference Increases Memory Usage -


    When the function calls and passes in a large string, I usually pass by reference. Its intention prevents PHP from undergoing a copy of the string, thus reducing memory usage. However, I have seen the contrast in certain circumstances.

    In the example below, the usage of mat memory is doubly, when passing the string by reference in the function, on the is_string () call.

    Code:

      $ buf = ''; Report_memory (___LINE__); $ Buf = file_get_contents ('./20MB.pdf'); Report_memory (___LINE__); Example ($ buf); Report_memory (___LINE__); Example of function (& amp; $ str) {report_memory (___ LINE__); Is_string ($ str); Report_memory (___LINE__); } Function report_memory ($ line = 0) {echo 'line:'. Str_pad ($ line, 3) "'; Echo 'Mem:' Str_pad (intval (memory_get_usage () / 1024) 'K', 8). ''; Echo 'peak:' str_pad (intval (memory_get_peak_usage () / 1024). 'K', 8). ''; Echo "\ n"; }  

    Output:

      line: 2m: 625k peak: 631kg line: 5m: 21058 peak: 21076 line: 11m : 21058K line: 138m: Peak of 21058: 41494K Line: 8m: 21058 peak: 41494K  

    Function to replace context () Change ():

      Example of function ($ str) {report_memory (__ LINE__); Is_string ($ str); Report_memory (___LINE__); }  

    Output:

      line: 2m: 625k peak: 631kg line: 5m: 21058 peak: 21076 line: 11m : 21058 that crop: 21076 line: 13mm: 21058 peak: 21076 km Line: 8m: 21058 peak: 21076's  

    That's what I hope. Then why is the memory is doubling with is_string () when the variable is a reference?

    Environment CentOS 6.6 is running a stock PHP 5.3.3.

    The zend engine uses a lazy-copy mechanism unless the variable is modified, it Does not copy the variable. PHP creates a set of structures that is used to maintain the context, that is why in order to pass a variable in terms "really slow".


    Toad INCLUDE function -


    I am trying to create a .sql file that calls other .sql files with toad. I came to the ceremony included for Todd, it looks like what I see, but for the reason I get an error:

    'A place should be mentioned within the index and the length string . ' For some reason.

    Any thoughts?

    - Todd: 'Add' \ RCHF3025.na.test.testtest.com \ testtesttest \ recovery \ RECOVERY_ANALYSIS_part1.sql ';

    Is this Todd for Oracle? If you want to use @notation.

    @C: \ Scripts \ MyScript.sql


    java - URI.parse and imagebutton error -


    code when the user clicks on a button, but I have to open the error Web view:

      java.lang.NullPointerException: calling virtual method on a null object reference info.teammumu.cougarcardapp.SocialMediaFragment to zero android.widget.ImageButton.setOnClickListener to (android.view.View $ OnClickListener) ' Effort. onCreateView (SocialMediaFragment.java:28)  

    Java code:

      public class SocialMediaFragment extends Piece {public ImageButton fbbutton; Public Image Button Twitton; Public Image Button Ignaton; @Override public view onCreateView (LayoutInflater inflater, ViewGroup container, bundle savedInstanceState) {See rootView = inflater.inflate (R.layout.fragment_socialmedia, container, false); Fbbutton = (ImageButton) getActivity (). FindViewById (RIDFebbutton); Twbutton = (image button) getActivity () FindViewById (R.id.twbutton); Igbutton = (ImageButton) getActivity (). FindViewById (R.id.igbutton); Fbbutton.setOnClickListener (New View.OnClickListener) {@Override Public Zero onClick (see v) {intro browserIntent = new intent (Intent.ACTION_VIEW, URI.parse ("https://www.facebook.com/universityofhouston")) ; StartActivity;}}); Twbutton.setOnClickListener (see the new OnClickListener (click on {@Override Public Zero (see V)} {intent BrowserEntent = new intent (Intent.ACTION_VIEW, Uri.parse ("website"); startActivity (BrowserImentant);}} ); Igbutton.setOnClickListener (see the new OnClickListener () {@Override click on Public Zero (see V) {Intent BrowserIntent = New Intent (Intent.ACTION_VIEW, Uri.parse ("website"); startActivity (BrowserImentant);}} ); Return root view; }}  

    I had asked a question like this before, but it was never answered or maybe I could not understand it ... thanks for anyone who helped with this Could! I was trying to solve it for a few days but did not get success. It crashes and I can not open anything to tabs

    use rootView

      fbbutton = (ImageButton) rootView.findViewById (instead of  getActivity ()  which is given from  onCreateView  R.id.fbbutton to use ideas from slice layout;); Twbutton = (ImageButton) rootView.findViewById (R.id.twbutton); .....   

    Because the return reference of the activity of getActivity in which the current piece is added, hence the getActivity () calling. FindViewById (& lt; id & gt;) means that the use of view from the activity layout rather than fragmentation.


    Writing HTML to XML file -


    I am in the middle of a project, in which I have grabbed HTML from one page, stores data in XML, and then From there the data is captured between specific tags and it is exported in an email file.

    I am researching the internet and stacks exchanges to understand the basics of trying to accomplish this task. However, I feel that it can not be as simple as some lines of code to write HTML for HTML. I am not looking for code directly, but in normal direction there is more to come inside the head.

    They are a little different, there is a markup language used to display HTML websites, traditional As a combination of XML and a style sheet if you want to convert to XML, you should explore the relevant data from the HTML page using scanner and XML should export its structured data. There are many scrapping tools in many languages, including many guai tools.


    cocoa touch - IOS swift implement Android fragment transaction -


    I am transferring only a new developer from Android to the iOS swift. Right now I am developing an application and I am implementing the Android version but the same solution could not be found in iOS.

    Let me assume that I have 100 options at the top of the screen, and there is a viewer for each selection. I want to display different layouts. For example, I select option 1, then the Videocicker Below 3 labels and textfiles are displayed, if I select option 2, then three visuals and three buttons are displayed.

    In Android, I can use piece transactions to implement it, but I do not see any such solution in iOS yet. To solve any solution?

    There is no direct parallel to the pieces of Android in Coco-Touch. You can manipulate with UIView objects UIViewControllers . To achieve such a master-extension behavior, see later.


    processing - OpenGL error 1280 at bot beginDraw() invalid enumerant -


    मैं Processing 2.1.2 में किसी प्रोग्राम को लिखने के लिए STL

    मेरा प्रोग्राम ठीक काम कर रहा है, लेकिन इसके साथ मैं नीचे टर्मिनल पर एक त्रुटि का सामना कर रहा हूं:

      OpenGL त्रुटि 1280 बॉट शुरूआकाश (): अमान्य अभिप्राय  

    क्या आप कृपया मुझे मार्गदर्शन कर सकते हैं कि मैं इस त्रुटि से कैसे छुटकारा पा रहा हूं? कार्यक्रम का कोडन नीचे दिया गया है

      आयात toxi.geom। *; आयात toxi.geom.mesh। *; आयात toxi.processing। *; त्रिभुज मेष जाल; ToxiclibsSupport gfx; शून्य सेटअप () {आकार (1000, 800, पी 3 डी); जाल = (त्रिभुज मेष) नया एसटीएल रीडर ()। लोडबायरी (स्केचपाथ ("चेक.स्टल"), एसटीएलआरडर। आरआईएनजीएलएसएच); जीएफएफ़एक्स = नया टोक्सिकब्लब्ससपोर्ट (यह); } शून्य आकर्षित () {पृष्ठभूमि (51); का अनुवाद (चौड़ाई / 2, ऊंचाई / 2,0); rotateX (रेडियंस (-4.35)); // पिच रोटेट Y (रेडियन (180)); // रोटेट करेंजेट (रेडियन (180)); // यॉ दिशात्मक लाइट (1 9 2, 168, 128,0, -1000, -0.5); दिशात्मक लाइट (255, 64, 0, 0.5 एफ, -0.5 एफ, -0.1 एफ); noStroke (); पैमाने (4); gfx.mesh (जाल, झूठी); }  


    awk to parse input with multiple conditions -


    In this post

    :

    awk in a continuation of

    If I wanted to add a thread to pars and apologize, would I add it to that post? I have tried to modify the awk script below, but with no luck

      awk 'NR == 2 {partition ($ 2, a, "[ _. & Gt;] "); B = substr (a [4], the length of 1 (a [4] -1); A [2] + 0, B, B, substrate (a [4], length (one [4]), one [5]} '\ OFS = "\ t" $ {id} _position.txt> $ {Id} _parse.txt  

    I have more than one possible situation that one user can produce a result as input, one of those situations is in the data sample, in bold Field is required to be parsed:

      Parsing the rules: 1. NC_ (not always the case) and before the number 4 before zero. 2. G ### (Underscore First) _ ### (# after _) 3. t CG (alphabet) after Dell - (hyphen used in this place) ` 

    data sample

      input version errors coding chromosome version (S) NM_004004.5: c.575_576delCA ** NC_000013.10: g.20763145_20763146delTG ** NM_004004.5: c.575_576delCA XM_005266354.1: c. 575_576delCA XM_005266355.1: c.575_576delCA XM_005266356.1: c.575_576delCA < / Code> 

    desired output

      13 20,763,145 20,763,146 TG -  

    Thank you :).

    TCR language:

      input version @ (skip) @ ( Skip) NC _ @ {@ nc-raw} @ @ (skip) g @ {G-left} _ @ {g-right} del @ {letters2} @ (skip) @ (@ {G-left 12} @ {g-right 12} @ {letter 6} - @ (end) < / B> Run NC-number @ (Int-StrNR-RC) / Code>  

    :

      $ txr nc.txr data 13 20763145 20763146 TG -  

    In all command line:

      $ txr -c 'Input @ @ (G-left) _ @ {g-right} del @ {letters 2} @ (Skip) @ (Bind NC) @ @ (skip) @ @ (nc-raw) @ @ -num @ (integer-str NC-Raw) @ @ (output) @ {NC-number 6} @ Given 12} @ {g right 12} @ {letter 6} - @ (end) 'data 13 20763145 20763146 Tg -  

    Is there a function to send keystrokes in R / RStudio? -


    I am thinking that there is a function in R (or any method of making one) that can be used to send caststrokes My predicted use for this in RStudio is to check the update of RSTUOO on automatically exiting a transmission keystroke (ALT + h ALT + u) component. The last function created in the Rprofile.site file.

    Or, if anyone else knows that to check out the updates of RSTUDO on automatic exit (or open), I have all the ears I already have. In the last function it has been defined that this update automatically checks for updates on the exit of the RR () function, but at the same time I would like to check the RStudio update.

    Any ideas will be highly appreciated.

    Thank you!


    jquery - Getting reference to object that run function in JavaScript -


    I am trying to use the Java extension so that it can check if the server is alive or not. Expansion on here:

    My code is up to date:

      // tool scanner class function device scanner (list) {this.list = list; This.totalDevices = list.length; This.scan = function {for (var i = 0; i & lt; this.totaldevices; i ++) {$ .Ping (list [i], 1000) .done (function (success, url, time, On) (found (url);}) .file (function (success, url, time, on) {notFound (url);}); }} This.found = function (address) {warning (address); } This.notFound = function (address) {warning (address); }} Var Scanner = New Device Scanner ([KVMRxDefaultIP, KVMTx1DefaultIP, KVMTx2DefaultIP]); Click $ ("# BT1") (function () {scanner.scan ();});  

    How can I ping scanned or unsuccessful store results from device?

      // device scanner class function device scanners (list) {var me = this; // here (1) this.list = list; This.totalDevices = list.length; This.scan = function {for (var i = 0; i & lt; this.totaldevices; i ++) {$ .Ping (list [i], 1000) .done (function (success, url, time, () ({My.property_done = true; // here (2) found (url);}) .file (function (url, timing, on) {me.property_failed = true; // here (3) nofound ( Url);}); }} This.found = function (address) {warning (address); } This.notFound = function (address) {warning (address); }} Var Scanner = New Device Scanner ([KVMRxDefaultIP, KVMTx1DefaultIP, KVMTx2DefaultIP]); Click $ ("# BT1") (function () {scanner.scan ();});  


    c - how can I find display libraries on embedded linux -


    I could use what display library behind the scenes in embedded Linux I ... Also if a GPU for embedded platforms I can see how the library is built in ... ??? ... I have a complete source code for the kernel, if it helps ... Here Elsmodi output

      used by Masood size musb_dsps is 7764 0 Musb_hdrc 46434 1 musb_dsps bufferclass_ti 5990 0 omaplfb 12469 0 pvrsrvkm 179419 2 Bfrclas_ti, omaplfb bnep 10368 2 musb_am335x 1307 0  

    so I think omaplfb a ... how Find the libraries to use this ??

    What are you talking about userspace libraries or kernel modules? The omaplfb kernel module appears

    Use the first case ldd:

      # ldd / lib / x86_64-linux-gnu / libtinfo. Kernel modules should do the trick for modinfo:  
      # modinfo / lib / modules / `uname -r` / kernel / drivers /  

    Scsi / sg .ko |

    Find .ko file


    List as variable/argument in Prolog -


    I have created a function in the prologue to "turn on" a list, e.g. Add tail to the list of favorites so much:

      - turn ([a, b, c, d, e], tlist). In terms of my program, I want to be able to use the predefined list for the rule, such as  
      alist ([a, b, c, d, e, f])  

    But I get many different errors. I have tried the following arguments:

      turn (bye (L), R). Listv (X): - Bye (L), Member (X, L) turn (listv (X), R).  

    And I think that each of these lists has different representations of the list according to prologue, but I'm not sure which list representation is appropriate for completing the operation on a predefined list. is.

    Thank you!

    This code can be defined by easily turn / 2 Is:

      turn ([A | as], BS): - Annex (e.g., [A], BS). To specify some sample lists, we define a subsidiary predicate  name_list / 2 : 

      named list (one_to_nine, [1, 2,3, 4,5,6,7,8,9]). Name_list (a_to_f, [a, b, c, d, e, f]) Name_list (single_degit_primes, [2,3,5,7])  

    Let's query!

    ? - Named list (a_to_f,  xs ), turn (xs, ys). Xs = [ one , b, c, d, e, f], ys = [b, c, d, e, f,  a ]. Is successful in determining? - Named list (a_to_f,  ys ), turn (xs, ys). "Other" direction Ys = [a, b, c, d, e,  f ], x = [ f , a, b, c, d, e]% The option succeeds in leaving behind; false. 

    So far, we have used a specific sample list in the query a_to_f ; Let's use all of these!

    ? - Named list ( name , x), turn (xs, ys) Name = one_to_nine, Xs = [ 1 , 2,3,4,5,6,7,8,9], YS = [2,3,4,5,6,7,8, 9,  1 ]; Name = a_to_f, Xs = [ a , b, c, d, e, f], ys = [b, c, d, e, f,  a ]; Name = single_digit_primes, x = [ 2 , 3,5,7], ys = [3,5,7,  2 ]. 

    java - Unrecognized field "User" (Class com.test.webservice.bean.User), not marked as ignorable -


    Hello, I'm trying to change the Jason object below by jersey service,

     < "Test", "address": "test", "address": "new name", "password": "new password", "email": "test.test@test.com", "address" I get the following example: "test", "last name": "test", "city": "test"}}  

    I get the following error:

      Unrecognized area "user" (class com.test.webservice.bean.User), [source: io.undertow.servlet.spec.ServletInputStre AmImpl @ 1d89c0 is not marked as arrogant; Line: 11, column: 2] (Through the reference series: com.test.webservice.bean.User ["user"])  

    In addition, if I @ JSONIgnoreProperties to TRUE , The full user object is ignored and I get zero values ​​for all the fields.

    I am also aware of Object Mapper which I have set below:

      Private static ObjectMapper createCustomObjectMapper () {New Object Mapper (.) .configure (SerializationFeature. WRAP_ROOT_VALUE, true). Configure (DeserializationFeature.UNWRAP_ROOT_VALUE, true). Configure (DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, incorrect) .setAnnotationIntrospector (createJaxbJacksonAnnotationIntrospector ()); }  

    I am using Jackson 2.0, the sample code for User Bean is as follows

      ** Package Com Test.webserver Bean; Import javax.preistence *; Import org.codehaus.jackson.annotate.JsonCreator; Import org.codehaus.jackson.annotate.JsonProperty; @ Entity @Table (name = "user") public class user {@JsonCreator public user (@Jesonsproperty ("username") string user name, @Jesonproperty ("password") string password, jasonproperty ("email") string email , @Jasonproporty ("first name") string firstname, @JespronProperty ("last name") string lastname, @JespronProperty ("address") string address, @Jesproforty ("city" str Yang City) {this.username = Username; This.password = Password; This.email = email; This.FirstName = FirstName; This.LastName = LastName; This address = address; this city = city;} **  

    And if I set the json object below it works fine

      {"username": "newusername", "password": " New test word "test", "test.test@adrosonic.com", "address": "test", "firstname": "test", "lastname": "test", "city": "test"} < / Code> 

    I want to know how this should work like this, or if there is any alternative solution in this situation, leaving the json string.

    Thank you for your time


    jquery - How do i add bootsrap-rating to a number coming from an public API? -


    This only supports input in the bootstrap documentation, but can I add it to an object attribute through JQuery Ajax Can i

    Update:

    Tried it, but to no avail, tried to parse it as a number, it works in HTML when I value I give a number

      $ ('# album display') .andend (''  gt; '); & Lt; Input id = "input -6c" class = "rating" data-minute = "0" data-max = "1" data-step = "0.1" value = "56" data-size = "xs" & gt;  

    Ah it seems that I had to start $ ('rating'). (); Out of the success of the Ajax method ....


    Implementing an Bluetooth functionality in IOS -


    Based on this question

    I use the same option really my case.

    I have a tool for a barcode "Socket Mobile" sensor. It does not appear in the tool list when I have implemented Core Bluetooth option. How do I know when a device is BLE or a normal Bluetooth? Later I got Bluetooth Manager. Framework is implemented and it works correctly, but when I try to compile, xcode (or connect itunnes) shows the problem because it is a private library. Please I need another solution .. Thanks -

    Generally: Devices with BTLE are usually Bluetooth is branded with LE or Bluetooth Smart (and sometimes Bluetooth 4.0).

    Specifically, since you've included the classic Bluetooth framework and found your device, it's a pretty obvious sign that it is a classic Bluetooth and you will need to be a part to reach external accessories. For Apple's MFI program generally, device makers have an API that does not formally use their code to join the Apple program. Sector is one way, but it is a case by case basis and what is the approach that must contact the vendor to see if there is any.


    ios - Store array with parse and use it to filter result -


    Hi I am preparing an app where users can choose between sets of 20 tags when creating their account. The selected tags are stored in an array in the user category. I also have a section of group chat and I want to load group-chat according to the tag that the user chooses to sign in. I understand that I need to use .wherekey to filter out the result. I think existing users have to use "tag-array" and filter results as a result. Parse.com is using backend

    To fulfill your needs, Follow -

    1) When user is in the process of creating profiles - 1.1) Add user selected tag to NSMutableArray. 1.2) Save the tags list for user data (server / cloud).

    2) After the user's signals 2.1) Load group chats in the list according to the above tags.

    Example Source -

      - (NSArray *) filter object: (NSArray *) Objektstags: (NSArray *) Use tags {return [Gaanupryog objects filtered: [NSPredicate predicateWithFormat: @ "tag IN% @", tag]]; } // has been given the 'object' array that you get from the server NSArray * objects = @ [@ {@ "id": @ "1a", @ "tag": @ "1"}, @ {@ "Id" @ "tag": @ "3"}, @ {@ "ID": @ "@" 2a "@" tag ": @" 2 "}, @ {@" ID ": @" 3A "@" @ "@" tag "@" 4 "} @ {@" id ": @" 2B ", @" tag "@" 5 "} @ {@" ID ": } @ "3B", @ "tag": @ "6"]; NSArray * filtered objects = [self filter objects: Objektstags: @ [@ "1", @ "3", @ "4"]] ; Anselog (@ "filtered object:% @", filtered objects) made; // Generating print them as dictionaries Is  

    uiimageview - iOS image view: how can I implement this? -


    As a photo here, there is a placeholder in the image view as the image is being downloaded in the background, how do I Can I apply it?

    You can use it for iOS This is the best networking library for iOS. That is the use of great apps such as Facebook iOS Horizontal Apps, AAA Networking.

      #import "UIImageview + afnetworking.h"  

    After importing, just use this kind of

      [ImageView setImageWithURLRequest: [NSURLRequest requestWithURL: [NSURL URLWithString: @ "http://someurl.com"] Placeholder image: [UIImage imageNamed: @ "loading.png"] Success: ^ (NSURLRequest * request, NSHPRRSRons * response, UIMJ * Image) {imageView.image = image; } Failure: zero];  

    javascript - Apply filter to JSON.parse() dynamically -


    मेरे पास निम्न जेएस हैं:

      var text = '{"firstName": " Abc "," lastname ":" def "," age ": 25} '; Obj = JSON.parse (पाठ) .firstName; console.log (obj);  

    यह अपेक्षित के रूप में प्रथम कुंजी के समान मान प्रिंट करता है हालांकि, मैं क्या करने की कोशिश कर रहा हूं, मैं एक चर में लाने की कुंजी को संचित करना चाहता हूं और इसे JSON.parse () कथन के साथ प्रयोग करना चाहता हूं। ऐसा कुछ:

      var text = '{"firstName": "abc", "lastname": "def", "age": 25}'; Var फिल्टर = 'प्रथमनाम'; Obj = JSON.parse (टेक्स्ट) .filter; Console.log (फिल्टर) console.log (obj);  

    यह कोड कंसोल पर 'अपरिभाषित' प्रिंट करता है क्या मैं गलत कर रहा हूं?

    बदलें:

      obj = JSON .parse (पाठ) .filter;  

    से

      obj = JSON.parse (टेक्स्ट) [फ़िल्टर];  

    गुणों को एक्सेस करने के दो तरीके हैं: डॉट नोटेशन और ब्रैकेट नोटेशन।

      var test = object.property; // (डॉट नोटेशन) var test = object [property_name]; // (ब्रैकेट नोटेशन)  

    आप जो समस्या का सामना कर रहे हैं वह यह है कि आप अपने ऑब्जेक्ट पर 'फिल्टर' नामक एक संपत्ति का उपयोग करने का प्रयास कर रहे हैं जो मौजूद नहीं है और इसलिए अपरिभाषित है।


    asp.net mvc - Do not render table row checkboxes when collection count is zero with razor -


    I have to display a list of items using MVC razor.

    Each list item has a checkbox

    when it is list.count> This checkbox should be added only in html / html / html 0

    Would you render / add each item checkbox to each item if not using any clause?

    If you are trying to cut the markup, then you can use conditional operators:

    @ (list.Any ()? @ Html.CheckBox ("name", correct): zero)


    node.js - What is the proper way to query the couchdb's _users database from node? -


    I am using a crad package on the node for the couchdb query. Examples of my nodes are the administrator privileges I

    I'm looking for the proper way to query the _users table from the node.

    Right now, I am doing something like this:

      var db = conn.database ('_ users'); Db.exists (function (err, exist) {if (err) {console.log ('error', err);} else if (exists) {db.get ('org.couchdb.user: some_user', function (Err, doc) {console.log (doc);});} else {console.log ('database does not exist.');}});  

    Is there a cleaner way to do this? Any author library similar to Pouchdb-certification?

    That's what I have done At that time, I did not know that I can easily use the pouchback on the node. I am using Plus PoWeb-authentication to simplify the requests to use it.

    You can actually use PouchDB at the top of the _users database :

      var db = new PouchDB ('http: // localhost: 5984 / _users'); Db.alldocs ({include_docs: true}). Then (/ * ... * /) // & lt; - All users receive  

    _users is just a database :)


    java - @SOAPBinding(style = Style.RPC) for web methods returning ArrayList -


    यह मेरा वेब सेवा कोड था

      import java.util.ArrayList; आयात javax.jws.WebService; आयात javax.jws.soap.SOAPBinding; आयात javax.jws.soap.SOAPBinding.Style; @WebService @SOAPBinding (शैली = शैली। आरपीसी) सार्वजनिक श्रेणी ProductCatalog {सार्वजनिक ऐरे लिस्ट & lt; स्ट्रिंग & gt; GetProductCategories () {ArrayList & lt; स्ट्रिंग & gt; श्रेणियां = नए अर्रेलिस्ट & lt; स्ट्रिंग & gt; (); categories.add ( "किताबें"); categories.add ( "फिल्मों"); categories.add ( "संगीत"); वापसी श्रेणियां; }} मैंने `@SOAPBinding (शैली = शैली। आरपीसी)` एनोटेशन दिया है, लेकिन यह उत्पन्न wsdl में कोई प्रभाव नहीं दिखा रहा है।  

    उत्पन्न wsdl बाहरी से एक स्कीमा केवल स्थान

      & lt; प्रकार & gt; & LT; XSD: स्कीमा & gt; & Lt; xsd: आयात नेमस्पेस = "http://symp.com/" स्कीमा स्थान = "http: // rajasekhar_pc: 9090 / न्यूटेस्टमार्ट / उत्पादकेलिए सेवा? Xsd = 1" / & gt; & Lt; / XSD: स्कीमा & gt; & Lt; / प्रकार & gt;  

    लेकिन जब मैं वेब विधि वापसी प्रकार को स्ट्रिंग में बदलता हूं तो इसके कार्य ठीक तरह से

      @WebService @SOAPBinding (style = Style.RPC) सार्वजनिक वर्ग ProductCatalog {सार्वजनिक स्ट्रिंग getProductCategories () {वापसी "हैलो वर्ल्ड"; }}  

    और wsdl में परिवर्तन होता है और यह किसी भी बाह्य दस्तावेज़ को संदर्भित नहीं करता है

      & lt; types / & gt; & Lt; संदेश का नाम = "getProductCategories" / & gt; & Lt; संदेश का नाम = "getProductCategoriesResponse" & gt; & Lt; part name = "return" type = "xsd: स्ट्रिंग" / & gt; & Lt; / संदेश & gt;  

    रिटर्न प्रकार सरणी सूची के लिए आरपीसी शैली प्राप्त करने का कोई तरीका है ... और यहां तक ​​कि स्टिलेज साबुन इंडेड wsdl को भी आरे-लिस्ट ऑब्जेक्ट वापस आ रहा है ... मैं डेटा चाहता हूं

    < P> /////////// नवीनीकृत कोड ///////////

      आयात करें java.util.ArrayList; आयात javax.jws.WebMethod; आयात javax.jws.WebService; आयात javax.jws.soap.SOAPBinding; आयात javax.jws.soap.SOAPBinding.Style; @WebService @SOAPBinding (शैली = शैली। आरपीसी) सार्वजनिक वर्ग रोगियों की सूची {@WebMethod सार्वजनिक BeanList getpatientList () {बीनिलिस्ट बीन = नया बीनलिस्ट (); ArrayList & LT; स्ट्रिंग & gt; PatientList = नया अर्रेलिस्ट & lt; स्ट्रिंग & gt; (); patientList.add ( "अजय"); patientList.add ( "विजय"); patientList.add ( "कुमारी"); bean.setPatientList (patientList); // वापसी बीन; वापसी बीन; }} Import java.util.ArrayList; सार्वजनिक वर्ग बीनिलिस्ट {निजी ऐरे लिस्ट & lt; स्ट्रिंग & gt; patientList; सार्वजनिक अर्रेलिस्ट & lt; स्ट्रिंग & gt; GetPatientList () {रिटर्न रोगी सूची; } सार्वजनिक शून्य सेट प्रातिनिधिक सूची (अर्रेलिस्ट & lt; स्ट्रिंग & gt; रोगी सूची) {this.patientList = patientList; }}  

    यहां भी यह देता है

      & lt; प्रकार & gt; & LT; XSD: स्कीमा & gt; & Lt; xsd: आयात नामस्थान = "http://symp.com/" स्कीमा स्थान = "http: // rajasekhar_pc: 9090 / न्यूटेस्टमार्ट / पतियां लिस्ट सेवा" एक्सएसडी = 1 "/ & gt; & Lt; / XSD: स्कीमा & gt; & Lt; / प्रकार & gt; लेकिन मैं चाहता हूं कि wsdl को RPC शैली में होना चाहिए  

    एक सरणी के बजाय एक ArrayList जैसा कि JAXB संग्रह को शीर्ष-स्तरीय ऑब्जेक्ट के रूप में नहीं संभाल सकता, केवल सेम के गुणों के रूप में।

    कृपया ध्यान दें कि जेएडएस-आरएसपी / एन्कोडेड में मैसेजिंग मोड के रूप में समर्थित नहीं है। यदि आप SOAP एन्कोडेड संदेश भेजना चाहते हैं या RPC / एन्कोडेड शैली WSDL बनाते हैं तो आप JAX-RPC या Apache axis v1 का उपयोग कर सकते हैं।


    grails war to include all grails-app groovy sources -


    I cloned and ran grails war .

    Squares, jars and many .groovy / .gsp files in the war file like:

    5161 Mon March 16:02:12 IST 2015 Web-INF / Template / Scaffolding / SpiceJerovirov 2374 Mon March 16 14: 02: 12 AS 2015 Web-INF / Templates / Scaffolding / _form.gsp

    and

    1885 Sun Nov 23 21:04:40 IST 2014 Web-INF / Class / ORG / Gile / Samples / View-SourceFilter Gras OOV

    I have all the other gill-app .groovy files (controllers, domains, services, etc.).

    Thank you.


    ruby - What is max_prune_time in MemoryStore? -


    In the initial method of

    , max_prune_time can be passed as an option.

    What is its purpose?

    In addition, @max_prune_time = options [max_prune_time] || 2

    What is the default unit? Seconds?

    max_prune_time Maximum time in seconds is memory, by removing old entries Store goes out of memory View the implementation of sorting method for details:

      DRP cut (target_size, max_time = zero) # ... start_time = time. No cleaning tools (: sorting, target_size ,: from = & gt; @cache_size) = synchronize {@ key_access.keys.sort {| A, b @key_access [a] .to_f & lt; = & Gt; @key_access [b] .to_f}} key.Each | Key | Delete_entry (key, option) if @cache_size & lt; = Target_size || (Maximum_time & time.Now - start_time & gt; maximum_time) end-end # ... end  

    c# - Read text file from resource -



    c# - Read text file from resource -

    i trying next code split words in text file.

    the file written this:

    apple"juice"martini lemon"juice"party banana"smoothie"aligns

    and code following:

    string resource_data = properties.resources.textfile; string[] result = resource_data.split('"'); foreach (string lines in result) { if(combobox1.text == result[0]) { richtextbox2.text = result[2]; } }

    taken & edited c++ programme working on worked same txt file.

    string^ resource_data = "textfile.txt"; seek { streamreader^ datain = file::opentext(resource_data); string^ datastr; int count = 0; array<string^>^ result; array<char>^ separ = gcnew array<char>{'"'}; while((datastr = datain->readline()) != nullptr) { count++; result = datastr->split(separ); if(combobox1->text == result[0]) // result[0] = name {

    what code does.. read each line own. gives first word in each line result[0] sec word on each line result[1] etc. when select word in combobox check if same in text file , line used in result[x]. in c# gives words own result[x] , lines not matter.

    how can create next code in c++ work in c# having text file in resources.resx?

    i think see problem is. first need split string resource_data separate lines. splitting resource_data on new line character(s):

    string[] lines = resource_data.split(new string[1] { environment.newline }, stringsplitoptions.none); foreach (var line in lines) { string[] parts = line.split('"'); if (combobox1.text == result[0]) { richtextbox2.text = result[2]; } }

    you using stringreader:

    using (stringreader reader = new stringreader(resource_data)) { while (reader.peek() >= 0) { string[] parts = reader.readline().split('"'); if (combobox1.text == result[0]) { richtextbox2.text = result[2]; } } }

    additionally if storing path file in resources, open file , read it:

    using (streamreader reader = file.opentext(resource_path)) // path file { while (reader.peek() >= 0) { string[] parts = reader.readline().split('"'); if (combobox1.text == result[0]) { richtextbox2.text = result[2]; } } }

    c# combobox resources

    java - How to deal with GlazedLists's PluggableList requirement for shared publisher and lock -



    java - How to deal with GlazedLists's PluggableList requirement for shared publisher and lock -

    i have started using glazedlists in java project uses beansbinding extensively (mvvm pattern).

    pluggablelist allowing me bind source list table, , alter source list @ runtime. in order create happen every source list must share same listeventpublisher , readwritelock, since pluggablelist must share lock , plublisher it's source. accomplish creating static publisher , lock in class owns potential source lists, utilize static values create list in every instantiation of class pluggablelist, shown in pseudo code below:

    public class modelclass { final static eventlist list = new basiceventlist(); final static listeventpublisher listeventpublisher = list.getpublisher(); final static readwritelock readwritelock = list.getreadwritelock(); final eventlist sourcelist = new basiceventlist(listeventpublisher, readwritelock); } public class uicontrollerclass { final pluggablelist pluggablelist = new pluggablelist(modelclass.listeventpublisher, modelclass.readwritelock); // ... phone call pluggablelist.setsource(somesourcelist) }

    i have 2 concerns this:

    (1) have create decision in model because of specific requirement of component in uicontroller. seems violate mvvm pattern.

    (2) shared lock potentially impacts performance of lists if there many , accessed frequently, since share same lock. each of these lists should otherwise able operate independently without caring each other.

    am going incorrectly? there improve way create pluggablelists work without modelclass having know special uicontrollerclass requirement , without potential performance hit?

    i came elegant solution preserves mvvm pattern eliminates need shared lock , publisher.

    i created custom list transformation extends pluggablelist , overrides it's setsource method. new source list synchronized new list created pluggablelist (it have same publisher , lock pluggablelist).

    public class hotswappablepluggablelist<t> extends pluggablelist<t> { private eventlist<t> syncsourcelist = new basiceventlist<>(); private listeventlistener<t> listeventlistener = null; public hotswappablepluggablelist() { super(new basiceventlist<t>()); } @override public void setsource(final eventlist<t> sourcelist) { getreadwritelock().writelock().lock(); seek { if (listeventlistener != null) { syncsourcelist.removelisteventlistener(listeventlistener); } syncsourcelist = sourcelist; final eventlist<t> synctargetlist = createsourcelist(); listeventlistener = glazedlists.synceventlisttolist(syncsourcelist, synctargetlist); super.setsource(synctargetlist); } { getreadwritelock().writelock().unlock(); } } }

    java mvvm glazedlists beansbinding pluggable

    amazon web services - How to use Firebase's email & password authentication method to connect with AWS to make Fine Uploader S3 work? -



    amazon web services - How to use Firebase's email & password authentication method to connect with AWS to make Fine Uploader S3 work? -

    i decided utilize fine uploader current angularjs project (which connected hosted on firebase) because has many core features need in uploader built in but, having problem understanding how utilize firebase's email & password authentication method communicate aws (amazon web services) allow users utilize fine uploader s3 upload content. based on fine uploader blog post uploads without server code, workflow goes like:

    authenticate users help of identity provider, such google use temporary token id provider grab temporary access keys aws pass keys on fine uploader s3 your users can upload s3 bucket

    the problem won't using oauth 2.0 (which used google, facebook or amazon provide user identities) allow user's sign app , upload content. instead using firebase's email & password authentication.

    so how can create firebase's email & password authentication method create temporary token grab temporary access keys aws , pass keys on fine uploader s3 allow users upload content s3?

    to connect aws outside application, cognito going solution. allow generate openid token using aws node sdk , secret keys in backend, can utilize aws javascript sdk , webidentitycredentials in client.

    note i'm unfamiliar specific plugin/tool, much @ to the lowest degree openid , in work allow me connect using webidentitycredentials, imagine using.

    configure cognito on aws

    setup on cognito easy - more or less walkthrough. involve configuring iam rules on aws, though. how set pretty project specific, think need point official resources. they made nice updates, admittedly not speed on changes.

    through configuration, want setup 'developer authenticated identity', take note of 'identity pool id', , iam role arn setup cognito.

    setup node server can handle incoming routes

    there lot of materials out there on how accomplish this, want sure include , configure aws sdk. recommend using body-parser create reading in post requests easier.

    var app = express(); var bodyparser = require('body-parser'); var aws = require('aws-sdk'); app.use(bodyparser.urlencoded({ extended: true })); app.use(bodyparser.json()); create post function talk cognito

    once have server setup, reach out cognito using getopenidtokenfordeveloperidentity. in setup, utilize authenticated users because expect them come , want able go on associations, why send in userid in req.body.useridfromangularapp.

    this function using express.router().

    .post(function(req, res) { if(req.body.useridfromangularapp) { var cognitoidentity = new aws.cognitoidentity(); var params = { identitypoolid: 'your_cognito_identity_pool_id', logins: { 'your_developer_authenticated_identity_name': req.body.useridfromangularapp } }; cognitoidentity.getopenidtokenfordeveloperidentity(params, function(err, data) { if (err) { console.log(err, err.stack); res.json({failure: 'connection failure'}); } else { console.log(data); // can see result server side res.json(data); // send } }); } else { res.json({failure: 'connection failure'}); } });

    if goes well, homecoming openid token you. can homecoming angular application.

    post angular, collect promise

    at to the lowest degree need post new node server , collect openid token out of promise. using pattern, found in data.token.

    it sounds there may need pass token on plugin/tool.

    in case need handle authentication further, have included code handle webidentitycredentials.

    angular.module('yourapp').factory('awsmaker', ['$http', function($http) { homecoming { reachcognito: function(authdata) { $http.post('http://localhost:8888/simpleapi/aws', { 'useridfromangularapp': authdata.uid, }) .success(function(data, status, headers, config) { if(!data.failure) { var params = { rolearn: your_role_arn_setup_by_cognito, webidentitytoken: data.token }; aws.config.credentials = new aws.webidentitycredentials(params, function(err) { console.log(err, err.stack); }); } }); } }]);

    this should on way. allow me know if can help further.

    authentication amazon-web-services amazon-s3 fine-uploader amazon-cognito

    javadb - Java DB Stored Procedures -



    javadb - Java DB Stored Procedures -

    i need step step assistance on technical aspects of above.

    assuming have written java stored procedure , compiled it, place class file???

    i utilize either ij or java programme create stored procedure in database question is: class file be?

    i looking @ this:

    create procedure procedure-name(procedureparameters)procedureelements

    assuming executing above ij command line tool, class file stored procedures be?

    please provide me step step technical assistance on creating stored procedures in java db. give thanks you.

    i found looking for: http://docs.oracle.com/javase/tutorial/jdbc/basics/storedprocedures.html

    apparently have bundle class in jar file , tell db find it.

    it's long process, considering other options mysql

    javadb

    jquery - Suitable audio player for website which works on android as well as iPad -



    jquery - Suitable audio player for website which works on android as well as iPad -

    i have website embedding flash player not work android , ipad.

    then have tried jw player works on of platforms except samsung note 10 inch sound player suitable sound works on platforms?

    platforms: andriod mobiles , ipad, tablet, iphone, note-pad, desktop browsers.

    jquery jwplayer audio-player

    php - How to merge these two arrays in this specific order -



    php - How to merge these two arrays in this specific order -

    i have 2 array following

    array ( [0] => 641 [1] => 622 [2] => 100 [3] => 6431 ) array ( [0] => 64.1 [1] => 62.2 [2] => 10 [3] => 643.1 )

    how can create following

    array ( [0] => 641 [1] => 64.1 [2] => 622 [3] => 62.2 [4] => 100 [5] => 10 [6] => 6431 [7] => 643.1 )

    it's simple as

    $result=array_merge($array1,$array2);

    note: values wont in order presented though. if of import need loop through arrays build new array accordingly.

    ummm ok here version well

    if(count($array1)==count($array2)) { for($i=0;$i<count($array1);$i++) { $result[]=$array1[$i]; $result[]=$array2[$i]; } } print_r($result);

    fiddle

    manual

    php arrays

    d3.js - drag circle copies from different svgs to another svg in d3 -



    d3.js - drag circle copies from different svgs to another svg in d3 -

    i have different svgs (svg1-svg4) several circles drawn on them. can select these circles individually appearance changes (fill color). they're added class .selected.

    now drag semi-transparent copies of them new svg. original circles should remain are. provide interactive ability create new object on svg (svg5) dragging number of circles onto svg5. when they're dropped, copies of circles should deleted , prompt should open user can give more info new object in svg5.

    therefore created new svg (called svgcircles). on svgcircles, added grouping g append circle re-create when circle selected. added drag behavior grouping calls function alter position of g element/the circle copies.

    my question now: should position svg drag-event noticed , function called? thought putting on same position of circle clicked (but transparent) drag work if started dragging on lastly selected circle (which not want). should work selected circles.

    all functions work when set svg "below" others on body , drag it. svg should "fly" above others when drag it. don't want set in on other svgs(1-4) because hidden when dragged on other svgs.

    i'm sorry can't provide cody here because rather theoretical question. hope have made myself clear enough, though.

    i love know ideas/solutions! thanks!

    svg d3.js drag

    css - Float a div over google maps while maintaining bootstrap responsiveness -



    css - Float a div over google maps while maintaining bootstrap responsiveness -

    i'm trying on lay bootstrap container on google maps.

    referring : how float div on google maps

    i've managed overlay div on google maps using above method. however, doing using absolute positioning within relative-positioned wrapper accomplish that. means overlay not responsive. there way can overlay responsive bootstrap classes on google map? thanks.

    the map can positioned absolutely , container can positioned relatively on map.

    <div id="content"> <div id="gmap"></div> <div class="container overlap"></div> </div> #gmap {position:absolute;top:0;left:0;} .overlap {position:relative}

    see here in pen: http://codepen.io/anon/pen/sojbd

    css twitter-bootstrap google-maps

    mysql - Custom php script PDO is throwing exeption 23000,1062 duplicate entry -



    mysql - Custom php script PDO is throwing exeption 23000,1062 duplicate entry -

    i working on php script using pdo insert info in mysql. getting error "23000",1062,"duplicate entry 'email@email.com-username' key 'email' inserting info in database.

    so here php codes

    if(isset($_post['email'])){ $this->db = new connect(); $this->db = $this->db->dbconnect(); $this->encryption = new encryption(); isset($_post['timezone']) , $_post['timezone'] != 'null' ? date_default_timezone_set($_post['timezone']): date_default_timezone_set('america/chicago'); $this->email = $_post['email']; $this->username = $_post['username']; $this->password = $this->encryption->encode($_post['password']); $this->dtime = date("y-m-d h:i:s");; $this->sessionkey = $_post['key']; $this->country = $_post['country']; $this->region = $_post['uregion']; $this->browser = $_post['browser']; $this->ip = $_post['accessfrom']; $regmessage = array('error'=>false); try{ $query = "insert `users` ( id, email, uname, password, regtime, sessionkey, country, region, browser, ip ) values ( (select max(id) + 1 `users` `maxid`), :email, :uname, :password, :regtime, :sessionkey, :country, :region, :browser, :ip )"; $register = $this->db->prepare($query, array(pdo::attr_cursor => pdo::cursor_fwdonly)); if($this->sessionkey === $_session['token']){ $register->bindparam(':uname', $this->username); $register->bindparam(':email', $this->email); $register->bindparam(':password', $this->password); $register->bindparam(':regtime', $this->dtime); $register->bindparam(':sessionkey', $this->sessionkey); $register->bindparam(':country', $this->country); $register->bindparam(':region', $this->region); $register->bindparam(':browser', $this->browser); $register->bindparam(':ip', $this->ip); $register->execute(); if($register->rowcount() > 0){ $regmessage = array('error'=>false); }else{ $regmessage = array('error'=>true); } }else{ throw new pdoexception ('error'); } } catch(pdoexception $e){ //this getting error echoing pdo exception error $regmessage = array('error'=>$e); } header('content-type: application/json'); echo json_encode($regmessage); }else{ header('location: /'); }

    at error, showing me duplicate entry of emailid + username key email looks email@email.com-username

    but in info base, getting email id in email column , username in username column. can 1 tell me whats wrong in codes?

    my users table construction

    create table if not exists `users` ( `id` int(11) not null auto_increment, `email` varchar(250) character set utf8 not null, `uname` varchar(20) character set utf8 not null, `password` varchar(100) character set utf8 not null, `regtime` datetime not null, `sessionkey` varchar(10) character set utf8 not null, `country` varchar(25) character set utf8 not null, `region` varchar(25) character set utf8 not null, `browser` varchar(25) character set utf8 not null, `ip` varchar(16) character set utf8 not null, primary key (`id`), unique key `email` (`email`,`uname`) ) engine=innodb default charset=latin1 auto_increment=1 ;

    so can tell me , wrong?

    thank helping me.

    the phrasing in error message: 'email@email.com-username' key 'email' straight corresponds unique key unique key 'email' ('email','uname'). line, creating compound key, can think of invisible column in index comprised of email-uname. there not column added table format, , seeing expected behavior email , uname treated separately in table , key.

    if want test on , on 1 time again same email , username combo, you'll need delete row every time. without doing this, error seeing expect see if post-ing same info on , on again.

    i want mention have (appropriately) specified id column auto_increment, calculating value manually. discourage doing this, , instead utilize null insert value. mysql utilize right key value in column, , avoid potential key collision if ever had 2 of these things executing @ same exact moment.

    php mysql pdo

    php - Database query for timeline of a social networking site -



    php - Database query for timeline of a social networking site -

    i building social networking site , notice board scheme college.

    i want show 10 15 recent posts friends of loggedinuser in home page.

    if select rows of timeline table in database, consume more memory , fetch posts not of friends of loggedinuser.

    so should best possible way so?

    help me.

    the table "friends" stores userid, friendid , status. table "timeline" stores posts of users postid , userid

    i'm using apache, php , mysql.

    thanks...

    you'll want sql joins pretty before go build social network. i'm not gonna lie. basic question should able reply on own (without stack overflow) if you're planning on building social network of kind.

    that said, here 2 queries work. , might seek experimenting both , reading on difference between two, performance implications of using 1 vs other. should mention, these give postids need, you'll need bring together posts table (presumably) actual post content. leave step you.

    also, in terms of getting 10-15 recent posts, need inquire question... can reply question tables you've listed?

    hint: can't. question: why not?

    query alternative 1 (gets post ids belonging friends of friends.userid = ???):

    select b.postid, b.userid friends inner bring together timeline b on a.friendid = b.userid a.userid = ???

    query alternative 2 (gets post ids belonging friends of friends.userid = ???):

    select b.postid, b.userid timeline b exists (select * friends friends.userid = ??? , b.userid = friends.friendid)

    now, question you: both queries above homecoming same result? 1 preferable other? if so, preferable or depend on circumstance? can give me example?

    php mysql

    .net - C# NUnit not running tests asynchronously -



    .net - C# NUnit not running tests asynchronously -

    i have written next test trying create utilize of new async/await keywords available in .net 4.5:

    [test] public async void defaultfilesvalid() { logtest(log); var librarytasks = new list<task<string>>(); foreach (var def in librariesmodel.librarydefinitions) { iviewmodel viewmodel = (iviewmodel)reflectionutility.createnew(def.modeltype); var libraries = def.libraryfiles.where(f => def.isdefaultfile(f)).toarray(); foreach(var library in libraries) { var librarytask = loadembeddedlibraryasync(viewmodel, library); librarytasks.add(librarytask); } } // wait results var libraryerrors = await task.whenall(librarytasks); var errors = libraryerrors.selectmany(m => m); assert.true(!errors.any(), string.join(environment.newline, errors)); } private async task<string> loadembeddedlibraryasync(iviewmodel viewmodel, string library) { homecoming await task.factory.startnew<string>(() => { var librarydef = viewmodel.library; var librarymessage = string.format("the default library '{0}' of type '{1}' ", library, librarydef.libraryname); seek { // open library viewmodel.open(library, library: true); // check hash expected var filehash = librarydef.getdefaultfilehash(library); var hash = viewmodel.source.getstatewisehashcode().tostring(); if (filehash != hash) homecoming librarymessage + string.format("has been modified, model hash '{0}' '{1}' expected.", hash, filehash); } grab (exception ex) { homecoming string.format("failed open: {0}", exceptionutility.joinexceptionmessages(ex)); } homecoming null; }); }

    however code executing synchronously, can please explain doing wrong?

    thanks, alex.

    change unit test async void async task. nunit supports async void unit tests v2.6.2 onward v2, , supported them in v2.9.6 v3 (support in v3 has been removed in v2.9.7). async void tests require nunit provide special context, changes behavior of await (and perchance startnew, though haven't tested that).

    as side note:

    use task.run instead of task.factory.startnew. have blog post describing why. use task.run call methods, not implement (fake-)asynchronous methods. have blog post describing why.

    c# .net nunit .net-4.5

    How to simply this nginx rewrite rules -



    How to simply this nginx rewrite rules -

    how simplify nginx rewrite rule ? have tried many rules not working.

    rewrite ^/past-look-no-(.*)\.htm$ /index.php?do=past&values=$1&submit=search&looka=1&cont=y last; rewrite ^/past-snipe-no-(.*)\.htm$ /index.php?do=past&values=$1&submit=search&sniper=1&cont=y last; rewrite ^/past-kiss-no-(.*)\.htm$ /index.php?do=past&values=$1&submit=search&kisses=1&cont=y last; rewrite ^/past-kill-no-(.*)\.htm$ /index.php?do=past&values=$1&submit=search&killed=1&cont=y last; rewrite ^/past-jump-no-(.*)\.htm$ /index.php?do=past&values=$1&submit=search&jumper=1&cont=y last; rewrite ^/past-cash-no-(.*)\.htm$ /index.php?do=past&values=$1&submit=search&casher=1&cont=y last; rewrite ^/past-rob-no-(.*)\.htm$ /index.php?do=past&values=$1&submit=search&robs=1&cont=y last;

    regards

    nginx

    c# - void as an argument -



    c# - void as an argument -

    i'm programming in c#. need function creates button, specifies name , of events. need pass name , events arguments. have done this:

    private void createbutton(string name, eventhandler hover, eventhandler click) { button button = new button(); button.name = name; button.image = properties.resources.print_trans; button.mousehover += new system.eventhandler(hover); button.click += new system.eventhandler(click); button.visible = false; this.controls.add(button); }

    in part of code create these calls:

    createbutton("cmdprint", this.hover, this.print); createbutton("cmdmark", this.hover, this.mark);

    the calls generate error: "the best overloaded method match createbutton(string, system.eventhandler, system.eventhandler)' has invalid arguments".

    what type of arguments should hover , click be?

    edit:

    jon: hover , print events:

    private void hover(object sender, eventargs e) { proofs.showinformation((control)sender); } private void print(object sender, eventargs e) { proofs.print((control).sender); }

    the 2 phone call lines generate same error.

    steve: events print , hover have typical event syntax, don't know type should have hover , click in createbutton function.

    edit2:

    my problem solved. add together delegate:

    private delegate void del(object sender, eventargs e);

    change calls:

    del print = this.imprimir; del hover = this.hover; createbutton("cmdprint", this.hover, this.print); createbutton("cmdmark", this.hover, this.mark);

    and alter arguments (in createbutton):

    private void createbutton(string name, del hover, del click)

    thanks lot.

    the 2 eventhandler parameters should functions have signature:

    void myfunction(object sender, eventargs e)

    if eventhandler on msdn website, can see syntax of delegate described as:

    [serializableattribute] [comvisibleattribute(true)] public delegate void eventhandler( object sender, eventargs e )

    this tells homecoming type , type of parameters signature.

    c# delegates argument-passing

    asp.net - How do I send an object to my Web API? -



    asp.net - How do I send an object to my Web API? -

    i've built first asp.net web api. i'm trying send object api not sure how it.

    here's code far:

    employee employee = new employee(); employee.id = 1234; employee.firstname = "john"; employee.lastname = "smith"; using (var client = new httpclient()) { client.baseaddress = new uri("http://myapi.mydomain.com"); client.defaultrequestheaders.accept.clear(); client.defaultrequestheaders.accept.add(new mediatypewithqualityheadervalue("application/json")); client.defaultrequestheaders.authorization = new system.net.http.headers.authenticationheadervalue("bearer", token.accesstoken); **// how send employee object api?** httpresponsemessage response = await client.getasync("api/mycontroller/myaction"); if (response.issuccessstatuscode) { var someobject = await response.content.readasasync<myobjecttype>(); } }

    what need perform post api endpoint , serialize employee object json object, so:

    var gizmo = new product() { name = "gizmo", cost = 100, category = "widget" }; response = await client.postasjsonasync("api/products", gizmo); if (response.issuccessstatuscode) { // uri of created resource. uri gizmourl = response.headers.location; }

    at moment existing code performing request.

    httpresponsemessage response = await client.getasync("api/mycontroller/myaction");

    i highly recommend take @ article highlights how phone call web api endpoint via c#.

    i hope helps.

    asp.net asp.net-mvc asp.net-mvc-4 asp.net-web-api asp.net-web-api2

    ruby - Chef - Read a file from git repo at runtime and use parse value in recipe -



    ruby - Chef - Read a file from git repo at runtime and use parse value in recipe -

    i read file checkout git repository parse config file , utilize info perform few resources commands.

    git "/var/repository" action :sync end config = json.parse(file.read("/var/repository/config.json" )) config.each |job, flags| #do resources stuff here end

    this not work because file doesn't exist @ compile time:

    ================================================================================ recipe compile error in /var/chef/cache/cookbooks/... ================================================================================

    errno::enoent

    no such file or directory - /var/repository/config.json

    i trying load file in ruby_block , perform chef resource actions there, didn't worked. setting parsed config variable , utilize outside of ruby_block didn't work.

    ruby_block "load config" block config = json.parse(file.read("/var/repository/config.json")) #node["config"] = config doesn't work - node["config"] not set config.each |job, flags| #do stuff - not work because chef context missing end end end

    any thought how read file @ runtime , used parsed values in recipe?

    you may find helpful utilize lazy evaluation in scenarios this.

    in cases, value attribute cannot known until execution phase of chef-client run. in situation, using lazy evaluation of attribute values can helpful. instead of attribute beingness assigned value, may instead assigned code block.

    ruby chef

    javascript - Show only a limited number of rows in a table -



    javascript - Show only a limited number of rows in a table -

    i trying limit number of rows displayed in <table>. need show 2 rows out of whatever number of records fetched. there's little button @ end of table, on click of rest of records revealed.

    here's sample screenshot of how table like.

    i have tried searching on , other websites, unable through. can't utilize jquery plugin table either.

    how can accomplish using jquery/javascript?

    select tr elements tbody , utilize slice method select range of them:

    $("table > tbody > tr").hide().slice(0, 2).show();

    demo:

    class="snippet-code-js lang-js prettyprint-override">$("table > tbody > tr").hide().slice(0, 2).show(); $(".show-all").on("click", function() { $("tbody > tr", $(this).prev()).show(); }); class="snippet-code-html lang-html prettyprint-override"><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <table> <tbody> <tr> <td>1</td> <td>alice</td> </tr> <tr> <td>2</td> <td>bob</td> </tr> <tr> <td>3</td> <td>carol</td> </tr> </tbody> </table> <button class="show-all">show all</button>

    .slice( start [, end ] )

    reduce set of matched elements subset specified range of indices.

    start

    type: integer

    an integer indicating 0-based position @ elements begin selected. if negative, indicates offset end of set.

    end

    type: integer

    an integer indicating 0-based position @ elements stop beingness selected. if negative, indicates offset end of set. if omitted, range continues until end of set.

    javascript jquery

    wpf - OnApplyTemplate never called in Custom Control -



    wpf - OnApplyTemplate never called in Custom Control -

    i tested codes custom command onapplytemplate never called. i'm sure have right static methods , assemblyinfo.cs setup; whole version inclued. https://www.dropbox.com/sh/n4uusow5z6ncd9c/aadmri9jlr-qss7o2qyag-5aa?dl=0

    public override void onapplytemplate() { base.onapplytemplate(); console.writeline("begin"); //get part controls part_mastergrid = gettemplatechild("part_mastergrid") grid; part_rightcntl = gettemplatechild("part_rightcntl") stackpanel; part_leftcntl = gettemplatechild("part_leftcntl") stackpanel; part_bottomcntl = gettemplatechild("part_bottomcntl") stackpanel; part_parentpanel = gettemplatechild("part_parentpanel") dockpanel; //verify master grid exist if (part_mastergrid == null) return; //setup parent grid var parentgrid = new grid(); setupparentgrid(parentgrid); //set layers var layer0 = layers.firstordefault(x => x.level == 0); if (layer0 == null) return; var columnlayers = layers.select(x => x).where(x => x.level > 0 && x.orientation == layer.layerorientation.column).orderby( x => x.level); var rowlayers = layers.select(x => x).where(x => x.level > 0 && x.orientation == layer.layerorientation.row).orderby(x => x.level); var item = setuplayer0(layer0, columnlayers, rowlayers.count()); parentgrid.children.add(item); grid.setrow(item, 0); //setup column grid layers if (columnlayers.any()) { foreach (var layer in columnlayers) { setupcolumnlayers(parentgrid, layer, columnlayers.count()); } } //setup row grid layers if (rowlayers.any()) { foreach (var layer in rowlayers) { setuprowlayers(item, layer, rowlayers.count()); } } //add parent grid master grid part_mastergrid.children.add(parentgrid); grid.setrow(parentgrid, 0); }

    update: had next layeredgrid.xaml , had generic.xaml include layeredgrid.xaml

    <style targettype="{x:type common:layeredgrid}"> <setter property="template"> <setter.value> <controltemplate> <dockpanel verticalalignment="stretch" horizontalalignment="stretch" lastchildfill="true" name="part_parentpanel"> <stackpanel name="part_bottomcnt1" orientation="horizontal" dockpanel.dock="bottom" background="aliceblue"></stackpanel> <stackpanel name="part_leftcnt1" orientation="horizontal" dockpanel.dock="left" background="aliceblue"> <stackpanel.layouttransform> <rotatetransform angle="90"/> </stackpanel.layouttransform> </stackpanel> <stackpanel name="part_rightcnt1" orientation="horizontal" dockpanel.dock="right" background="aliceblue"> <stackpanel.layouttransform> <rotatetransform angle="90"/> </stackpanel.layouttransform> </stackpanel> <grid name="part_mastergrid" issharedsizescope="true" background="aliceblue"></grid> </dockpanel> </controltemplate> </setter.value> </setter> </style>

    update2: [update2 has nil above code version has themes root folder] in mainwindow.xaml gives compiled error cannot locate resource 'layeredgrid.xaml'.

    <dockpanel> <stackpanel name="downstatusbar" dockpanel.dock="bottom" background="aliceblue"> <label></label> </stackpanel> <testnest3:layeredgrid> <testnest3:layeredgrid.layers> <testnest3:layer level="0"> <testnest3:layer.content> <grid> ... </grid> </testnest3:layer.content> </testnest3:layer> </testnest3:layeredgrid.layers> </testnest3:layeredgrid> </dockpanel>

    there few things need check create sure default style gets applied:

    make sure have assembly-level themeinfo attribute , pass in resourcedictionarylocation.sourceassembly sec argument (genericdictionarylocation):

    class="lang-cs prettyprint-override">[assembly: themeinfo( resourcedictionarylocation.none, resourcedictionarylocation.sourceassembly)]

    make sure have themes\generic.xaml resource dictionary in same assembly custom control, build action of "page". note themes must top-level folder in project.

    make sure override default style key custom command in static constructor:

    static layergrid() { defaultstylekeyproperty.overridemetadata( typeof(layergrid), new frameworkpropertymetadata(typeof(layergrid))); }

    make sure generic.xaml includes (either straight or through dictionary merging) style targettype matching custom control. should not have explicit x:key, , should set template property. if pull style in through mergeddictionaries, create sure utilize assembly-qualified uris when merging in other dictionaries, e.g.:

    <resourcedictionary source="/test_nest3;component\themes/layeredgrid.xaml" />

    if you've verified above , still having problems, check output window create sure there isn't sort of error happening might prevent style beingness applied. also, check obvious: command getting loaded visual tree somewhere?

    edit: able open project on phone, , seems themes folder in wrong location: must straight under project, have nested under common folder. location supposed relative assembly root, not folder containing file command defined.

    wpf custom-controls

    Add C++ support to Eclipse for Java -



    Add C++ support to Eclipse for Java -

    so, in first year of programming classes , have been struggling of different programs have utilize code. java professor has asked utilize eclipse , lot. c professor had download visual studio @ origin of year have on desktop. however, bought mac , i'm stuck using xcode (which admittedly love). hoping consolidate of programming eclipse on machines. have java version of installed.

    could give me quick how-to on adding c++ back upwards programme , list of desirable settings. when seek myself, programs fail upon build displaying errors "binaries not exist." give thanks in advance!

    c++ eclipse

    emacs - How to avoid logging intermediate process states in Org-mode? -



    emacs - How to avoid logging intermediate process states in Org-mode? -

    in org-mode task can have 1 of several process states (e.g. todo, done...). process state list configurable , user may either set task state directly, or may cycle on states using s-left , s-right key combinations.

    what find counter-intuitive, however, interaction between state alter tracking , utilize of s-left , s-right keys. more specifically, when using keys 1 may go on several states before settling on 1 need, if type fast , skip desired state. unfortunately, org-mode happily log every single one of state changes, despite fact happened within few seconds , cannot correspond happened actual real-life task.

    is there way have org-mode filter generated log entries, intermediate state changes not inadvertently logged? e.g. setting merge state changes when happen in less x seconds?

    to select todo state , bypass logging associated that, use:

    (setq org-treat-s-cursor-todo-selection-as-state-change nil)

    in emacs configuration file.

    emacs elisp org-mode

    windows - How can I access to an attribute of PEPROCESS structure? -



    windows - How can I access to an attribute of PEPROCESS structure? -

    i have not experience @ in driver development. want access attribute of construction peprocess. have pointer pointing process object, obtained via psgetcurrentprocess routine. have seeing web describing construction internals (attributes) declaration, utilize offset of these attributes them, like:

    hprocess = psgetcurrentprocess(); list = (list_entry*)((ulong)hproces + 0x88); //active process link offset

    however way leave me in middle of problem. create build of code able run in other kind of platforms (ex: x86, x86_64) , others version of windows (xp, 7, ...); , suppose not possible way because offset not same.

    question: there not lame solution this? ex:

    list = process->activeprocesslink

    or something.

    try utilize macro: pchar containing_record( [in] pchar address, [in] type type, [in] pchar field);

    windows device-driver windows-kernel

    image size that would fit width in android -



    image size that would fit width in android -

    i new android dev , keeps tripping dealing sizes , width. wondering image sizes need have image fit 1 below

    wondering sizes image should in. hdpi mdpi xhdpi xxhdpi

    looking pixel value

    the improve reply on page :

    http://developer.android.com/guide/practices/screens_support.html

    you larn how back upwards multiple screen size on android.

    to summarize, main rules next :

    the baseline mdpi : it's resolution on should base of operations calculation baseline 160dpi hdpi = 1.5 * baseline xhdpi = 2 * baseline xxhdpi = 3 * baseline

    so if image should have size of 150px @ 160dpi resolution, should create 225px image hdpi screens , 300px image xhdpi screens.

    last advice : should seek create image when understand how multiple screens back upwards works. density more of import notion understand correctly. described here : terms , concepts

    android

    function - vim keep cursor position when counting matches -



    function - vim keep cursor position when counting matches -

    i have function count , homecoming number of matches of text:

    function! count_matches() redir => matches_cnt silent! %s/\[\d*\]//gn redir end homecoming split(matches_cnt)[0] endfunction

    i created map insert homecoming value of count_matches() @ current position:

    noremap <c-a> go[foo<c-r>=count_matches()<cr>]

    however cursor jumps origin of line after executing silent %s/[\d*]//gn command. when press control+a vim inserts "[foo", function beingness executed, search command resets cursor position , homecoming value inserted @ origin of line resulting in "1][foo" instead of "[foo1]".

    can somehow prevent count changing cursor position, or reset cursor position after counting matches?

    the script leads error, if pattern not found. how can function homecoming 1 without error 0 matches?

    even improve save cursor position, save finish viewport. (but works, if not alter window layout)

    see :help winsaveview()

    let wsv = winsaveview() movethecursoraround phone call winrestview(wsv)

    in particular case, take approach:

    inoremap <expr> <f3> len(split(join(getline(1,'$'),"\n"), '\[\d\+\]',1))

    which takes whole text, , splits on pattern \[\d\+\] , counts how many elements there are. or if add together text:

    inoremap <expr> <f3> '['.len(split(join(getline(1,'$'),"\n"), '\[\d\+\]',1)).']'

    this add together [ in front end , ] after number. adjust mapping key , text personal taste. (note, not need winsaveview() function, cause cursor won't move).

    it perhaps not such thought utilize function on multi mb text size. ;)

    function vim

    php - Insert Multiple combobox into one Field in database -



    php - Insert Multiple combobox into one Field in database -

    i has multiple combobox in page, here's code:

    <select name="usulan[]" size="3" multiple> <option name="satu" value="satu"> satu </option> <option name="dua" value="dua"> dua </option> <option name="tiga" value="tiga"> tiga </option> <option name="empat" value="empat"> empat </option> </select>

    then check more 1 alternative this:

    i want every alternative check inserted 1 field (field_usulan) in database.

    so if has table this:

    id | alat | field_usulan ----------------------------- 1 | |

    after inserted, want become this:

    id | alat | field_usulan ----------------------------- 1 | rj45 | satu, dua

    if utilize code:

    <?php if(isset($_request['submit'])) { include "../conf/koneksi.php"; $count = count($_post['alat']); for($i = 0; $i < $count; $i++){ if(!empty($_post['alat'][$i])) { $alat = mysql_real_escape_string($_post['alat'][$i]); $usulan = mysql_real_escape_string($_post['usulan'][$i]); $sql= "alter table tb_inventaris auto_increment = 1"; mysql_query($sql); $sql2=mysql_query("insert tb_inventaris (alat,usulan) values ('$alat', '$usulan')") or die(mysql_error()); echo "<meta http-equiv=\"refresh\" content=\"0; url='../koordinator.php?url=index'\">"; }else{ echo "<meta http-equiv=\"refresh\" content=\"0; url='../koordinator.php?url=index'\">"; } } } ?>

    it insert first option, this:

    id | alat | field_usulan ----------------------------- 1 | rj45 | satu

    sorry bad language.

    while inserting, utilize php's implode() function.

    $usulan = isset($_post['usulan']) ? implode(',', $_post['usulan']) : ''; $sql2=mysql_query("insert tb_inventaris (alat,usulan) values ('$alat', '$usulan')") or die(mysql_error());

    hope works you.

    php mysql