Sunday, 15 April 2012

php - DeleteUser method in FOSuserBundle symfony 2 Userinterface error -


I have a problem deleting user with $ UserManager-> deleteUser ($ user). I am getting an error: Error: Class AppBundle \ Controller \ UsermanagerController has 35 abstract methods and therefore they must apply abstract methods to summarize or declare them.

My Controller:

  Namespace AppBundle \ Controller; Use Symfony \ Component \ HttpFoundation \ Request; Use Symfony \ Bundle \ FrameworkBundle \ Controller \ Controller; Use AppBundle \ Entity \ UserManager; Use FOS \ UserBundle \ Model \ UserInterface; Use Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException; Class UsermanagerController Expands Controller User Interface {Public Function deleteAction ($ user) {$ UserManager = $ this- & gt; Container-> Obtain ('fos_user.user_manager'); If ($ user == faucet) {New Nottold HTTP Exception ('User not found for user'. $ User); } $ UserManager- & gt; Delete user ($ user); $ $ - this- & gt; Redirect ($ this - & amp; generUrl ('admin_index')); }  

My entity:

  Namespace AppBundle / Entity; Use the theory / ORM \ mapping as an ORM; Use FOS \ UserBundle \ Doctrine \ UserManager as BaseCustomer; Use FOS \ UserBundle \ Model \ UserInterface; / ** * @ ORM | Entryy * * / class UserManager BaseCustomer implements UserInterface {}  

My config.yml: orm:

  resolve_target_entities: FOS \ UserBundle \ Model \ UserInterface : AppBundle \ Entity \ UserManager  

and routing. Assam:

  fos_deleteuser_group: path: / app / usermanager / delete / {user} default: {_controller: AppBundle: Usermanager: delete}  

/ UserBundle / doctrine / UserManager, tried using any luck.

Thanks in advance for your help

In short:

Your first error was that implements the user interface in the admin you have removed it.

Then you have another problem inside your controller because you pass the string to the UserManager :: deleteUser method which is something UserInterface

I will provide some code for you, which should fix it.

  & lt ;? Php / ** * @ Ultimate $ username string * @ Return Response * / Public Function Deletion Action ($ user name) {$ userManager = $ this- & gt; Obtain ('fos_user.user_manager'); / * @ $$ User Manager User Manager * / $ user = $ userManager- & gt; FindUserByUsername ($ username); If (\ is_null ($ user)) {// user not found, $ notFoundResponse returns $ notFoundResponse; } \ Assert (! \ Is_null ($ user)); $ UserManager- & gt; DeleteUser ($ user); // OK, generate $ OK Response Returns $ OKHrsons; }  

c - Client not able to send message to server -


I am new to programming socket programming. I am trying to create a server that has the ability to connect to multiple clients. However,

  1. My message server is not printed at the end. This means that the code "Do you want to send?" Prompt does not stop at

  2. The second message switch on the wired client (like) does not respond to my server. Same looks like

Edit 1 I have edited the code that sends a message to the customer. However, the server side prevents "error on ACCEPT: bad file descriptor", which I am unable to resolve.

Edit 2 My client is also sending another message, but my server does not receive it and does not print it, even if the error on acceptance has ended Ho.

  ----- Listen (sockfd, 5); Clilen = sizeof (cli_add); Int pid; While (1) {nzockfood = acceptable (sockfid, (structure sokadar *) and cli_ed, and cleanen); If (newsfold <0) {error ("error in accepting"); Exit (1); } Pid = fork (); If (pid & lt; 0) {error ("Error creating new process"); Exit (1); } If (pid == 0) {close (sockfd); // Read buffer from socket bargeo (buffer, 256); N = reading (Newsoffor, buffer, 255); If (n & lt; 0) {error ("error in reading"); Exit (1); } Printf ("Message:% s", Buffer); ----- Barge (buffer, 256); N = write (newsockfd, tmparray, strlen (tmparray)); If (n & lt; 0) error ("oops! Can not write"); Exit (0); } And {closed (newsfoked); }}  

and client.c is

  Int likes; While (1) {printf ("What to do? \ N1. Send \ n2.Exit \ n"); Scanf ("% d", & amp; option); Switch (Preferred) {Case 1: {Berzero (buffer, 256); Printf ("What do you want to send?"); Fgets (buffer, 255, stdin); Getchar (); N = write (sockfd, buffer, 255); If (n & lt; 0) error ("oops! Can not write"); Bzero (buffer, 256); N = reading (scoff, buffer, 255); If (n & lt; 0) error ("Oops! Can not read"); Printf ("Received Message:% s \ n", Buffer); break; } Case 2: {Return 0; }}}  


sed - Increment all defines/enums in a source file -


मेरे पास बहुत से (100+) परिभाषित करता है / एन्यूमरेशन / वेरिएबल्स जैसे:

  FOO: 1 बार: 2 QUX: 3 // ... ZYX: 99 XYZ: 100  

मैं एक नई पंक्ति जोड़ना चाहता हूं: BAZ: 3 बार के बाद, और QUX के मान को '4' के साथ-साथ बाकी के मूल्यों को अपडेट करने के साथ-साथ अपडेट करें। BAZ के बाद के सभी मूल्यों को बढ़ाने के लिए सबसे आसान और आसान समाधान क्या है, अंतर्निहित / मूल यूनिक्स टेक्स्ट संपादन उपकरण (पाठ संपादक, सेड, आदि) का उपयोग करते हुए?

  $ cat file FOO: 1 बार: 2 QUX: 3 / / ... ZYX: 99 एक्सवाईजेड: 100  

यह बार्स के बाद बीएजी डालता है और उसके बाद हर नंबर को बढ़ाता है:

  $ awk 'NR == 1 , / ^ बार: / {प्रिंट; अगला}! एफ {प्रिंट "BAZ: 3"; f = 1} / ^ [[alnum:]] +: / {प्रिंट $ 1, ++ $ 2; अगला} 1 'फ़ाइल FOO: 1 बार: 2 BAZ: 3 QUX: 4 // ... ZYX: 100 एक्सवाईजेड: 101  

यह कैसे काम करता है

  • एनआर == 1, / ^ बार: / {प्रिंट; अगला}

    बार: से शुरू होने वाली पहली पंक्ति सहित सभी रेखाएं प्रिंट करें

  • ! F {प्रिंट "BAZ: 3"; f = 1}

    हम केवल इस कोड के बाद बार का सामना किया गया है। यहां, BAZ लाइन को जोड़ें और झंडा f को एक में सेट करें ताकि हम इसे फिर से जोड़ना न भूलें।

  • / ^ [[alnum:]] +: / {प्रिंट $ 1, ++ $ 2; अगला}

    बृहदान्त्र के बाद एक पहचानकर्ता के साथ शुरू होने वाली किसी लाइन लाइन के लिए, वृद्धि बृहदान्त्र के बाद की संख्या और अगली पंक्ति तक जायें।

  • 1

    अन्य सभी पंक्तियों के लिए, जैसे // ... , उन्हें प्रिंट करें जैसा है

( 1 के रूप में लाइन मुद्रित करने के लिए awk का गुप्त लबादा है)।

python - Receive a string with values and return a list -


Then, I get a str, with values ​​like:

  some = "8478579 " 

and get me

  some = [8,4,7,8,5,7,9]  
some.split () , but it gives me : something ["8478579"].

Using an understanding of the list

  Gt; & Gt; & Gt; [Iii] For some [ii] [8, 4, 7, 8, 5, 7, 9]  

or a map

< Previous> & gt; & Gt; & Gt; Something = "8478579"> gt; & Gt; & Gt; List (map (int, some)) [8, 4, 7, 8, 5, 7, 9]

c# - Process.Kill throwing Win32Exception (Access is denied) -


मेरे पास निम्न कोड है:

  foreach (var प्रक्रिया प्रक्रिया में.गेटप्रक्रियासबायनाम (नाम) )) {Try {process.Kill ()} यदि (! Process.WaitForExit (टाइमआउट)) {session.log ("कीलिंग प्रक्रिया {0} का समय समाप्त हो गया।", नाम); } और {session.log ("कीलिंग प्रक्रिया {0} सफलतापूर्वक समाप्त हो गई।", नाम); }} पकड़ (अपवाद अपवाद) {session.log ("प्रक्रिया को मारने की कोशिश करते समय अपवाद {0}: {1}", नाम, अपवाद। टॉस्ट्रिंग ()); }}  

निम्न अपवाद फेंक रहा है:

  प्रक्रिया को मारने का प्रयास करते समय अपवाद & lt; प्रक्रिया नाम & gt ;: System.ComponentModel.Win32Exception (0x80004005):  

कोड आम तौर पर काम करता है, लेकिन अजीब है। समय यह असफल हो जाता है मेरे द्वारा बनाए गए एक इंस्टॉलर पर कस्टम क्रिया का यह हिस्सा है, और जब यह चलाता है, तो यह स्थानीय सिस्टम खाते के अंतर्गत चलता है। मैंने देखा है कि यह अतीत में होता है। मैं इसे जानता हूं मैं इस प्रक्रिया में संहिता को संशोधित नहीं कर सकता, इसलिए मैं इसे समाप्त करने के लिए स्वयं हूं, हालांकि मैं फिट देखता हूं। किसी प्रक्रिया को निखारने का सबसे अच्छा तरीका क्या है जिससे मुझे कुछ मध्यवर्ती अवस्था में छोड़ने की परवाह नहीं है, क्योंकि मैं सिस्टम से उसकी फाइलों को अनइंस्टॉल कर रहा हूं? किसी भी आईओ को समाप्त करने या रद्द करने की अनुमति दी जानी चाहिए, अगर कोई भी सेटिंग ऐप के लिए वैश्विक स्तर पर सेट की जाने वाली प्रक्रिया में है और उपयोगकर्ता उन्नयन करता है क्या पी / इनकॉल्टिंग सबसे अच्छा समाधान हो सकता है?


Python error IOError: [Errno 2] No such file or directory: -


मेरी स्क्रिप्ट है

  bs4 आयात से BeautifulSoup आयात अनुरोधों आयात आयात करें ओएस givenURL = raw_input ("Entrer votre liens") हेडर = {'उपयोगकर्ता-एजेंट': 'मोज़िला / 5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebkit / 537.36 (KHTML, Gecko जैसे) क्रोम / 39.0.2171.95 सफ़ारी / 537.36'} # प्रारंभ सत्र सत्र = अनुरोध। सत्र () # प्लेलिस्ट प्रतिक्रिया = सत्र। प्राप्त हो रही है (दिए गए URL, शीर्षलेख = हेडर) सूप = खूबसूरत सूप (response.content) playlist = सूप.फ़ीन्ड ('a', {'data-playlist': true} ) ['डेटा-प्लेलिस्ट'] oname = soup.find ("title") oname.text प्रिंट oname.text # वीडियो की सूची यूआरएल = 'http://animedigitalnetwork.fr/index.php?option=com_vodvideo&view = प्लेलिस्ट & amp; प्रारूप = कच्चे 'प्रतिक्रिया = session.post (यूआरएल, डेटा = {' प्लेलिस्ट ': प्लेलिस्ट,' सीज़न ':' ',' ऑर्डर ':' डीईएससी '}, हेडर = हेडर) सूप = खूबसूरत सूप (प्रतिक्रिया। सामग्री) पथ = os.path.join ('प्लेलिस्ट', oname.text) के साथ खुले (मार्ग, 'w') के रूप में च: च या वीडियो सूप में। चयन ('div.adn-video'): s = 'http://www.animedigitalnetwork.fr' + video.a.get ('href') f.write (s + '\ n' ) # फ़ाइल पढ़ें, और पहली पंक्ति छपाई के बाद तोड़। च के रूप में खुले (पथ) के साथ: f: लाइन में लाइन के लिए: print line.rstrip () तोड़  

मुझे स्क्रिप्ट के साथ एक त्रुटि मिलती है

  ट्रेसबैक ( सबसे हालिया कॉल अंतिम): फ़ाइल "adnplay.py", पंक्ति 33, & lt; मॉड्यूल & gt; ओपन (पथ, 'डब्ल्यू') के रूप में एफ के रूप में: IOError: [त्रुटि 2] ऐसा कोई फ़ाइल या निर्देशिका नहीं है: यू 'प्लेलिस्ट / मारिया, सोरसी \ एक्सईयर डीआरजीआर \ एक्सई 9, प्यूकेले डे बल! - VOSTFR ' 

मैं साइट की प्लेलिस्ट को प्राप्त करने के लिए इस स्क्रिप्ट का उपयोग करता हूं और मुझे नहीं पता कि स्क्रिप्ट को कैसे ठीक करना है क्योंकि मेरे पास कोई समस्या नहीं है

और मैं

ty अग्रिम में


go - Daylight saving hours in Golang -


I am preparing a UI for a scheduling interface, where a user can set the timer several hours in the future . If possible, I want to be able to handle Daylight Savings, I thought it would be quite easy. While checking time, I went to the following inconsistency in the Golang package, if it is that which is.

  Package main import ("fmt" "time") func main () {Fairy timeformat = "January 2, 2006 3:04 pm (MST)" test, mistake : Time =. Purse (time format, "25th October, 1:59 am (bst)") fmt.println (test, test.itc), err) dur, _: = time.ParseDuration ("1m") test = test.Add ( Dur) fmt.println (test, test.UTC ()) fmt.Println ("--------- -----------") test, err = time.Parse (time format , "October 25, 2015 2:01 AM (BST)") fmt.println (test, test.UTC (), mistake) test = test.Add (dur) fmt.println (test, test.UTC ()) test = Test.Sub (dur) fmt.println (test, test.UTC ())}  

I know that on October 25, 2015, at 2 pm on BST at 1:00 GMT ( UTC) should go back. If I increase BST between 1 minute to 1:59 then actually the time is switched to GMT.

  2015-10-25 01:59:00 +0100 BST 2015-10-25 00:59: 00 0000 UTC & lt; Zero & gt; 2015-10-25 01:00:00 +0000 GMT 2015-10-25 01:00:00 +0000 UTC -------------------- 2015-10- 25 02:01:00 +0000 BST 2015-10-25 02:01:00 +0000 UTC & lt; Zero & gt; 2015-10-25 02:02:00 +0000 BST 2015-10-25 02:02:00 +0000 UTC  

However if I had a time of 2:00 in BST If I analyze, I hope it will be to switch to GMT, as the time of transition has to be increased. If the transitional code was called by Ad, then I add a minute again, but this time does not even return to GMT.

b) Always be GMT + 1

b) for BST

a) BST "invalid" at the right time GMT time (right) Invalid BST is between 2:00 on October 2 after the last Sunday in October and the last Sunday of the following Sunday in March)

c) An error if a date was created with those dates with BST (And possibly other daylight saving hours in other countries).

Otherwise, I would have to check whether a user enters a date in BST or not that the date is outside of BST and adjust or emphasize users at UTC time, which is built in the library. Deals the object with the daylight saving function.

During the research I saw it and I have decided that it is definitely not as easy as I previously believed ...

To handle daylight saving time There will be no insight or better way for

Edited Version: Version 1.3.3 was retried and this output was received

  2015- 10-25 01:59 : 00 + 10100 BST 2015-10-25 00:59:00 +0000 UTC < Zero & gt; 2015-10-25 01:00:00 +0000 GMT 2015-10-25 01:00:00 +0000 UTC -------------------- 2015-10- 25 01:00:00 +0000 GMT 2015-10-25 01:00:00 +0000 UTC & lt; Zero & gt; 2015-10-25 01:01:00 +0000 GMT 2015-10-25 01:01:00 +0000 UTC  

It looks as if I used to expect later versions. .. If this question has also been received then it will be fully read.

Thank you.

Go, like everyone else but Microsoft, regularly updates that are included in the current go release uses it.

You used .1.0.3 which was released in March 2012. British time zone data for 2015 added later

Always use a current version of Go for Time Zone Count


PHP-FPM on nginx will not connect to an external MySQL -


I have a sensor server that is running NGNX + PHP-FPM, which is an external database for the purpose of a WordPress installation. Will not be connected to.

I can SSH in websrew and fix mysql to connect to the external mysql database, but when it tries php to connect to the database it fails is.

Where do I look for this problem to solve?

This problem is possible to be related to selinux (as it was

  setsebool at httpd_can_network_connect_db  

or it does not work:

  setenforce 0  

javascript - How to onClick in Ajax Process -


I have added the html code in the ajax process, but I have encountered a problem while using the onclick function .


Expected results will show "12"
However, the problem has been received "undefined" value.

  function getValue () {var val = $ (this) .find ('ImageClass'). Val (); Warning (val); } Function getImage () {$ .ajax ({type: "GET", url: 'image.php? Id =' + id, async: false, before: function (x) {if (x & x; Override mime type) {x.overrideMimeType ("app / j-son; charset = UTF-8"}}}, datatype: "jason", success: function {var html = '';} html + = ' 
Input class = "Image class" type = "hidden" value = "12" /> '+' & lt; img src = "img / '+ ID + '.png "style =" width: 200px; "& gt; & lt; / div>' + '& lt; / div & gt; $ $ (' content ') .HTML (html) ;}}); }

You can also create a custom function with delegation:

$ (document) .on (".toClick", function getValue () {// to take action here}};

Your HTML

  html = = '
Input class = "imageClass" type = "hidden" value =' 12 '/>' + '& lt; img src = 'Img /' + id + '.png "style =" width: 200px; "& gt; & lt; / div & gt;' + '
or send it to the HTML function

  html + = '
& # 39; & # 39; & lt; img src =" img / '+ id +' .png "style =" width: 200px; "& gt; & lt; / div & gt; + '

and the function should be:

  function getValue (e) {var val = $ (e ) .find ('. ImageClass'). Val (); Warning (Val);}  

Note: Inline function has not been re-found, instead use Event Rep.


mamp - PHP changes not showing on local -


I am using OSX Yosemite and I have installed MAMP. I am able to upload my files to the HTOO and view on the local host: 8888, although when I make a change in a php file, the changes will not be visible, only the original contents of the PHP file are not left.

The original file says: And I look in the local host: 8888 Hello World However, while changing it in the following: - - Localhost still prints: Hello World! And everyone does not change in Hello !!! As the code specifies.

Can you please help, thank you!

The code has been cached. You have to disable OpenCash. If you are using MAMP PRO, you can do this in this setting. Otherwise, you have to edit php.ini yourself.

Edit /Applications/MAMP/bin/php/php5.xx/conf/php.ini By adding the first letter for all opepase related lines As to where 5.xx should be a folder with your used PHP version. phpinfo (); Which version you can use by adding to your index.php file.

Alternatively you < index.php in opcache_reset (); echo "Hello World!" Before

in your file

dns - What does binding a Rails Server to 0.0.0.0 buy you? -


I am using "www.xip.io" as a DNS wildcard for testing on different devices. I have set my primary domain to my IP address. I set fire to a railway server with the bundled excel rail server and I here www. Lt; Ip_address & gt; .xip.io: 3000 and note that my rail server does not have the answer.

However, if I bind my rail server to 0.0.0.0, such as bundle exec rails server -b 0.0.0.0 , it works! I do not understand that 0.0.0.0 is asking its server to work for it. Can anyone understand the meaning of this?

Service to bind all IP addresses . Rail server used to do this by default, but 4.2 has been changed to force only localhost . Basically if it is only bound to localhost , then it will only respond locally to localhost or 127.0.0.1 , which is a DNS service Can not work because it is not a public IP address.

When you use 0.0.0.0 it will bind the and local hosts to your local IP address.


Android ListView With Drawable Images OutOfMemoryError -


I'm new to Android development and I'm running into a problem with memory. In terms of mobile I try to make iOS apps. As shown in this image is a key activity in my list:

screenshot

do I have 9 session, when I have the same image, it's easy to scroll, but when I use 9 different images, so it is Strtrs and when I list go down then I get Autofmemri error error:

  java.lang.OutOfMemoryError at android.graphics.bitmapFactory.nativeDecodeAsset andro (at android.graphics.bitmapFactory.decodeStream) (Basic Law) On id.graphics android.content.res on BitmapFactory.decodeResourceStream (BitmapFactory.java:422)) and android.graphics.drawable.Drawable.createFromResourceStream (drawable.java:840) android.content.res.Resources.loadDrawable (resources.java:2110) .Resources.getDrawable (resource. Java: 700) on ly.mann.kevinmann.transformingwork.CellAdapter.getView (CellAdapter.java:57)  

I've read some answers about her e To do similar things, but I have lost as little as what to do.

I am using the adapter to display the images:

  ObjSession cellData = mSessions.get (status); If (cellData! = Null) {// Previous Back String uri = "@ Drawable /" + cellData.mPreview; Drawable Rays; Int imageResource = mContext.getResources (). GetIdentifier (uri, null, mContext.getPackageName ()); Try {res = mContext.getResources (). GetDrawable (imageResource); } Hold (resource. Notfound exception e) {imageResource = mContext.getResources (). GetIdentifier ("@ Drawable / Following", blank, mContext.getPackageName ()); Res = mContext.getResources (). GetDrawable (imageResource); } Holder.feature imageview.Setmeage drawer (ridge); Holder.titleLabel.setText (cellData.mTitle); Holder.introLabel.setText (cellData.mIntro); }  to 

Any help amazing will

Edit: I have tried since the listed possible Anulipan in the comments below - which The solution does not fix my issue, I have tried to take MDPI with HDPE and MDPI of MDL with MDPI.


android - How to minimize Time Requirement while updating 2000 rows in SQLite -


I have SQLite with more than 20,000 rows.

When I am adding new data (2000 rows) it takes 2 seconds.

But when I try to update the same 2000 rows it takes about 10 minutes.

I am using the following code to update

  Public Entit Update_temepricease details (straight_itemprisidad emstracts_itempcc_ command, string item id) {SQLiteDatabase db = this.getWritableDatabase (); Material values ​​= new material value (); //values.put(KEY_NAME, contact.getName ()); Values.put (key_item_ind, mStruct_ItemPrice_Details.get_Item_Id ()); // Stract_compiat namespace Input (key_prit_iid, mStruct_ItemPrice_Details.get_Price_Id ()); // Struct_Contact name . // update line int update = db.update (table, value, key_PRICE_Id + "=?", New string [] {mStruct_ItemPrice_Details.get_Price_Id ()}); // db.close (); Update update; } Database_ItemPrice_Details db = getInstance (reference); SQLiteDatabase db = db.getWritableDatabase (); Try {DB.beginTransaction (); } Grip (Exception E) {// TODO Auto generated blocking block e.printStackTrace (); }} {Update_ItemPriceDetails (List.get (i), ""}} {Database_ItemPrice_Details_Kolkata db = getInstance (context) for (int i = 0i> 2000; i ++); SQLiteDatabase db = db.getWritableDatabase (); DB.setTransactionSuccessful (); DB.endTransaction (); } Grip (Exception E) {// TODO Auto generated blocking block e.printStackTrace (); Step # 1: Do not Call Code  getWritableDatabase ()  

inside the loop

Step # 2: Use the transaction correctly:

  DB startTransaction (); Try {// your SQL db.markTransactionSuccessful (); } Grip (Exception E) {do whatever you want to do} etc. Finally {db.endTransaction (); }   

Maybe will not affect what performance you have, but it is important to check that since proper transactions are very important for execution. Especially for the duration you mentioned, it seems that the transaction is not working properly. Step # 3: According to Tobian's suggestion, make sure that you have Key_PRICE_Id in Java on your column. Step # 4: To avoid making excessive garbage, avoid making ContentValues ​​ inside the loop. Step # 5: Use traceview to determine when you are spending your time remaining.


subgraph from selected vertices using python-igraph -


I am trying to create a sorted subfraph which includes upper part from a graph with verticality center.

This is my view:

  & gt; & Gt; & Gt; Import igraph as Ig; gt; & Gt; & Gt; Np & gt; & Gt; & Gt; Ig.summary (graph) IGRAPH DNW- 9358 35488 - + Att: ID (V), Label (V), Name (V), Weight (E) & gt; & Gt; & Gt; Btwn = graph.betweenness (weight = 'weight') & gt; & Gt; & Gt; Ntile = np.percentile (btwn, 95)> gt; & Gt; & Gt; Pruned_vs = graph.vs.select ([v & gt; = ntile btwn for vt])> gt; & Gt; & Gt; Pruned_graph = graph.subgraph (pruned_vs)  

Everything is working fine though, the resulting subgraph is not well-formed.

  & gt; & Gt; & Gt; IGRAPH DNW- 0 + + attr: id (v), label (v), name (v), weight (e)  

I have tried implementation Changing attribute to subtraction but this did not help. What am I missing?

This row is incorrect:

  pruned_vs = Graph.vs. Select  

The list understands that you pass as the argument () to a ( gt; = ntile for v for btwn) Boolean vector return, which is unsupported by graph.vs.select () - you need to pass the vector in which there are indices for nodes for selection. It can be done as follows:

  pruned_vs = graph.vs.select (v for v, b to btwn, if b> = ntile])  

cmake - CMakeLists configuration to link two C++ projects -


I have the following condition: Project A relies on Project B, but both are built at the same time. To include Project A, which includes Project B and its libraries are also required. Now I have tried this like:

  ADD_SUBDIRECTORY ($ {CMAKE_SOURCE_DIR} / other_project other_project)  

and then:

  INCLUDE_DIRECTORIES (includes $ {CMAKE_SOURCE_DIR} / other_project /}} list (attached LINK_LIBS other_project)  

in Project A's CMakeLists.txt, but it does work It does not seem that the compiler gives me an error while adding Project B's headers, even if they do not exist.

What is the correct way to add dependency to A? How should CMakeLists.txt look like?

Edit:

As suggested in the comments, this question was resolved, although I want to see an example of how to use it, a CMakeList In the txt file The following is a simple example which creates zlib and then creates libxml2 which we rely on the construction zlib

One thing is worth mentioning, I pulled this example quickly from what I have already done. The Libxml2 example uses the make, so it will actually build on a system, in which it is, e.g. Linux, Mac ...

The proposed directory structure for this example is ...

  • src /
    - CMakeLists.txt
      < / Li> --------- External_ZLib.cmake

      External_libxml2.cmake
    • Davoud / (There is no need to create this directory, CMK will do it for you )
    • # Any version that supports ExternalProject, setting cmake_minimum_required (VERSION 3.1) project (test_ext_proj) Set Ahia (test_ext_proj_CMAKE_DIR "$ {CMAKE_CURRENT_SOURCE_DIR} / CMake") or (downloaded CMAKE_MODULE_PATH $ {test_ext_proj_CMAKE_DIR} $ {CMAKE_MODULE_PATH}) Set Test_ext_proj_BUILD_INSTALL_PREFIX $ {CMAKE_CURRENT_BINARY_DIR} / install) Set (test_ext_proj_DOWNLOAD_DIR $ {CMAKE_CURRENT_SOURCE_DIR} / download cache path " (External_jilib) included (external_libxcil2)

      External_ZLib.cm take shots:

      Set Set (ZLib_version 1.2.8) Set (ZLib_url "http://zlib.net/zlib-${ZLib_version}.tar.gz") Set (ZLib_md5 "44d667c142d7cda120332623eab69f40") Exter nalProject_Add (zlib URL $ {ZLib_url} URL_MD5 $ {ZLib_md5} PREFIX $ {vision tpl_BUILD_PREFIX} DOWNLOAD_DIR $ {test_ext_proj_DOWNLOAD_DIR} INSTALL_DIR $ {test_ext_proj_BUILD_INSTALL_PREFIX} CMAKE_GENERATOR $ {General} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX: PATH = $ {test_ext_proj_BUILD_INSTALL_PREFIX} -DCMAKE_BUILD_TYPE = $ { CMAKE_BUILD_TYPE} -DCMAKE_C_FLAGS = $ {CMAKE_C_FLAGS}) # This variable is required, so other packages can find it. Set (libxml2_release "2.9") set (ZLB_ROOT $ {test_ext_proj_BUILD_INSTALL_PREFIX} cache path "")

      External_libxml2.cmake:

        set (libxml2_patch_version 0) Set (libxml2_url "ftp://xmlsoft.org/libxml2/libxml2-sources-${libxml2_release}.${libxml2_patch_version}.tar.gz") Set (libxml2_md5 "7da7af8f62e111497d5a2b61d01bd811") # We need to tell that we depend The build order is set correctly on ZLib (_XML2_DEPENDS ZLib) # This build is required to build, make sure we have it, or error out. If (CMAKE_GENERATOR Matches ". * Makefiles") (MAKE_EXECUTABLE "$ (create)") and () find_program (MAKE_EXECUTABLE make) if (not MAKE_EXECUTABLE) message (FATAL_ERROR "did not get ', to create libxml2 need. ") endif () endif () ExternalProject_Add (libxml2 up $ {_ XML2_DEPENDS} URL $ {libxml2_url} URL_MD5 $ {libxml2_md5} pREFIX $ {test_ext_proj_BUILD_PREFIX} DOWNLOAD_DIR $ {test_ext_proj_DOWNLOAD_DIR} INSTALL_DIR $ {test_ext_proj_BUILD_INSTALL_PREFIX} BUILD_IN_SOURCE 1 CONFIGURE_COMMAND configured prefix = $ {Test_ext_proj_BUILD_INSTALL_PREFIX} - with -zlib = $ {ZLIB_ROOT} BUILD_COMMAND $ {MAKE_EXECUTABLE} INSTALL_COMMAND $ {MAKE_EXECUTABLE} Install)  

for loop - Accessing index # of an array of structures in Swift -


I do not understand that it is also possible in Swift, but I try to match using the index loop

Data: Index of my array with a property located within a structure within class MyClass {struct myStruct {var name: string}} MyArray: [myStruct] = [myStruct (name: "Gary", Age: 35), Mystread (name: "Carol", Age: 60), Maestroct (name: "Low Controller:

  For example MyClass = MyClass () for index (age, age) in calculation (instanceofMyClass.myArray) {Println ("My index is" index "and age is" age ")  

When I change my straight strokes with a simple array, I return a value, but when it has an array of strokes, it can not return it back

Even if the name of your loop variable is (index, age) , you still have myArray , and in it are examples of the structure you define, resulting in age are actually examples of that structure instead of the couple.

Need something like this in age to get the value:

Enumerate (index, myStruct) for (instanceofMyClass.myArray) {println ("My sequence Nika is \ (index) and age \ (myStruct.age) ")}

ios - Can I know if a user removes notification from notification center? -


As the name of the title, can I possibly know whether an iOS user notification in the notification center for my app Removes or cleans? I only want to know for tracking purposes.

I have full faith that this is not possible. A solution will be done to track the number of notifications sent by the user and compare it compared to the notification sent to the user (remember that the apple does not guarantee the arrival of a push). I know that this is not the same as tracking the number of notifications, which the user cancels / closes, but unfortunately it is not possible in another way.

Something similar has been discussed here:


c++ - Qt Console Application missing in New Project wizard in Qt Creator -


The QT console application entry for some reasons is missing from the new project wizard in my Qt Creator 3.3.0.

How does this look on my computer:

Enter the image details here

It should appear normally:

Why any ideas are unavailable and how to get it back?

It was found that this was because I had selected Android templates in the combo at the top-right . I did not see the combo at all and I do not know how it got it.

Enter image details here

convert it to all templates The problem has been solved.


oracle - PL/SQL Who am I function similar to T-SQL's OBJECT_NAME(@@PROCID) -


टी-एसक्यूएल में, निम्न कमांड वर्तमान चल रहे संग्रहीत कार्यविधि का नाम वापस कर देगा:

  OBJECT_NAME (@@ PROCID)  

पीएल / एसक्यूएल में, जब मैं एक पैकेज की एक संग्रहीत कार्यविधि पर निम्न कोड डालता हूं, तो यह पैसों के बजाय मूल पैकेज का नाम देता है संग्रहित प्रक्रिया निष्पादित करना।

  $$ PLSQL_UNIT  

क्या पीएल / एसक्यूएल में निष्पादन प्रक्रिया का नाम प्राप्त करने का कोई तरीका है?

< / Div>

हाँ, 12 से पहले के संस्करणों में यह असंभव है। लेकिन आप कुछ हैक्स कोशिश कर सकते हैं।

  1. V $ सत्र दृश्य में PLSQL_ENTRY_SUBPROGRAM_ID और PLSQL_SUBPROGRAM_ID फ़ील्ड हैं जो आपको वर्तमान में कार्यान्वित करने की कार्यवाही कर सकती हैं।

वर्तमान सत्र है:

  वीएस $ सत्र से PLSQL_ENTRY_OBJECT_ID, PLSQL_ENTRY_SUBPROGRAM_ID, PLSQL_OBJECT_ID, PLSQL_SUBPROGRAM_ID का चयन करें जहां AUD SID = sys_context ('userenv', 'sessionid')  

और फिर एक दृश्य ALL_PROCEDURES :

 < कोड> ALL_PROCEDURES से PROCEDURE_NAME का चयन करें जहां OBJECT_ID =: objectId और SUBPROGRAM_ID =: subprogramId  

इस दृश्य में संकुल में घोषित फ़ंक्शन और प्रक्रियाएं होती हैं लेकिन उन में शामिल नहीं हैं जो पैकेज निकायों में घोषित हैं। / P>

  1. dbms_utility.format_call_stack लाइन नंबर और स्रोत का नाम दिखाता है पार्सेड आउटपुट को owa_util.who_called_me द्वारा प्राप्त किया जा सकता है। कच्चे आउटपुट में ऑब्जेक्ट हैंडल है जो आपको अनाम ब्लॉक के स्रोत कोड तक पहुंच प्रदान कर सकता है।

dbms_utility.format_call_stack नमूना आउटपुट:

  ----- PL / SQL कॉल स्टैक ----- ऑब्जेक्ट लाइन ऑब्जेक्ट संभाल संख्या नाम B87FEF1C 1 अनाम ब्लॉक  

और फिर: < / P>

  V $ SQL से SQL_FULLTEXT चुनें जहां CHILD_ADDRESS = 'B87FEF1C'  

संग्रहित प्रक्रियाओं का स्रोत कोड ALL_SOURCE से प्राप्त किया जा सकता है। ।

  1. एक बार जब आप कॉलिंग विधि का एक स्रोत कोड और उस कोड में एक लाइन नंबर प्राप्त करते हैं, तो आप इसे प्रक्रिया नाम प्राप्त करने के लिए पार्स कर सकते हैं।

केवल एक बुरा उदाहरण एक-लाइनर्स है लेकिन यह एक दुर्लभ स्थिति है।

  प्रक्रिया बाहरी प्रक्रिया है जो भीमी शुरू होती है; समाप्त; शुरू करें जोमामी; समाप्त;  

आपके पास ऐसी जानकारी है जो कि whoami को इस लाइन पर बुलाया गया था लेकिन आपको नहीं पता कि यह पहली घटना है या दूसरा है। इसलिए, सोर्स कोड को पार्स करने से आपको सटीक समाधान नहीं मिल सकता है।

अन्य स्थितियों को स्रोत कोड पार्स करके संसाधित किया जा सकता है। मेरा प्रयास है नमूना उपयोग:

<पूर्व> पैकेज बनाना APCKG प्रक्रिया PROC है; समाप्त; / पैकेज निकाय बनाओ APCKG प्रक्रिया प्रोसी है प्रक्रिया "INNER / proc" शुरू होता है dbms_output.put_line (p_stack.whoAmI); समाप्त; शुरू "INNER / proc"; समाप्त; समाप्त; / APCKG.PROC प्रारंभ करें; समाप्त;

आउटपुट:

  5: आपका साइका। पैकेज बॉडी APCKG.PROCEDURE PROC.PROCEDURE "INNER / proc"  

आउटपुट प्रारूप:

  रेखा संख्या + ':' + स्वामी + ['।' + टाइप + '' + नाम] *  

इसलिए यह केवल अंतिम कॉलर और इसके पदानुक्रम को देता है। एक प्रक्रिया के भीतर एक प्रक्रिया जो एक पैकेज के शरीर में स्थित है।

यदि आप एक सटीक समाधान की जरूरत है और Oracle 12 की आवश्यकता है तो यह समाधान पूर्व के लिए है। संस्करण (10.2 पर परीक्षण) यह ऊपर एक-लाइनर उदाहरण के लिए पहली घटना वापस करेगा।

UPD:

मैंने इस समाधान को कॉल के लिए पूर्ण पैमाने पर पैकेज में उन्नत किया है स्टैक कंट्रोल लाभ:

  • ओरेकल 9 (), 10 और 11 पर परीक्षण किया गया।
  • यह वास्तव में पर्स स्रोत (अर्थात् लेक्सिकल विश्लेषण, टोकन इत्यादि। )।
  • शुद्ध पीएल / एसक्यूएल।
  • अज्ञात ब्लॉक स्रोत कोड (वे भीतरी प्रक्रियाओं को शामिल कर सकते हैं) को पार्स करता है।
  • utl_call_stack
  • विधि whoAmI और whoCalledMe
  • डबल उद्धृत नामों का समर्थन करता है।
  • स्ट्रिंग्स के लिए q -notation का समर्थन करता है।
  • बहु-लाइन और एक-लाइन टिप्पणियों को छोड़ देता है।
  • परिभाषाओं के बिना कार्यविधि और फ़ंक्शन declarations को छोड़ देता है।

UPD 2:

  • सशर्त संकलन के लिए समर्थन जोड़ा गया।

UPD 3:

  • संस्करणों के लिए ओरेकल 12 पैकेज utl_call_stack का बैकपोर्ट कार्यान्वित किया गया।

java - Specify time to live for a tomcat session? -


सत्र टाइमआउट सेटिंग है:

  & lt; session-config & gt; & LT; सत्र-समय समाप्ति & gt; 30 & lt; / सत्र-समय समाप्ति & gt; & Lt; / सत्र-config & gt;  

जो कि एक निष्क्रिय सत्र कितने समय तक वैध रहता है पर नियंत्रण करता है।

क्या यह निर्दिष्ट करने के अलावा संभव है कि सत्र कितने समय तक जी सकता है? "रहने के लिए समय" या "अधिकतम उम्र" निर्दिष्ट करने के बाद उपयोगकर्ता को फिर से प्रवेश करने के लिए मजबूर किया जाने के बाद?

ऐसा टॉमकेट कॉन्फिगरेशन के साथ करना संभव है?

इसे (session-config के अंदर) जोड़ें:

  & lt; cookie-config & gt; & LT; अधिकतम उम्र & gt; मूल्य & lt; / अधिकतम उम्र & gt; & Lt; / कुकी-config & gt;  

ruby on rails - Retrieving the reports from my Google Analytics account -


What is the easiest way to get reports data from Google Analytics related to ecommerce specifically ? I found some gems such as Google-api-client, gabba, gattica and levato But that is a real and easy to use, it is not clear.

Or if I do not use gem, I want the end point of which API? This is not clear from Google Docs.

Any help is appreciated.

You want to use that report to obtain data, and you make requests (requests) Especially want to use time.

To get an understanding of what type of data you can get and what parameters you need to use to obtain that data, I suggest that I I want to play with them. Once you understand what you are doing, then the request should not be disturbed very much.

I do not know about a gem which it handles, but honestly, you do not need one. A gem arm might handle OAuth2 for you, but then the request is very straight forward.


cmd - findstr exclude some subdirectories -


I'm using the searcher / s to find what I'm looking for. How do I remove some sub directories? For example, the main directive -> sub folder 1, sub folder 2, sub folder 3, sub folder 4

  searchst / s / i / c: "SWG_DD_STANDARD_DATE" *. * & Gt; E: \ Personal \ ORA_APPS_DEV \ WO_WIP \ ONE_OFF \ NARAIN_ALL \ search \ search.txt  

How can I remove sub folder 2 from my search?

You can iterate the list of folders and exclude one without the need of the

(/ d %% a in * *) C: "SWG_DD_STANDARD_DATE" "%% a \ *")); E: \ Personal \ ORA_APPS_DEV \ WO_WIP \ ONE_OFF \ NARAIN_ALL \ Search \ search.txt

Or, if Only the output folder is to be excluded, you can filter it

  searchst / s / i / C: "SWG_DD_STANDARD_DATE" * | searchst / V / b / I / C: "subfolder 2"> E: \ personal \ ORA_APPS_DEV \ WO_WIP \ ONE_OFF \ NARAIN_ALL \ Search \ search.txt  

cordova - visual studio 2013 iOS code signing -


I try to apply an application to use my iPad vs-MDA-Remote from Visual Studio 2013

Project output is returning ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 left ======= === ====== ==== Deploy: 0 succeeded, 1 failed, 0 left ==========

I know that the provisioning profile is for me OK on Mac because I can create any kind of exode issue .

But I want to work and work from Visual Studio for a project and I can not get the most fundamental project to make projects.

MDAVCLI: Code Sign Warning: Specified Code Signature Resource Rule File ('/ Applications / Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk /ResourceRules.plist "') can not be traced

Any help is greatly appreciated - I retrieve all my apple certificates and profiles

Thanks John


delphi - What is the proper way to execute a batchfile with multiple params? -


I have a batch file that I use to manage the translation of various programs. Now I want a Delphi application to call this batch file and pass the required parameters for further processing. Unfortunately, there are spaces in the parameter, which is due to a partition. Is there any way to keep the intention of all the parameters? This is where my batchfile looks:

  ECHO scans new ressources% MLDIR% \ Ml7Build.exe% 1% ECHO import new translation% MLDIR% \ MlBuild.exe I% 2 Create the ECHO translation application for the dictionary for%% MLDIR% \ Ml7Build.exe b% to 3%  

Because I found many similar questions on ShellExecute from ShellApi-Command Tried to use, but none of them can help me solve my problem My Delphi code looks like this:

  param1: = ExtractFileName (hMLProj); Param2: = '-f:' + MLWorkDir + 'Previous _' + ExtractFileName (hMLProj) '-settings: Auftrag_Test.importsettings- Method: 2 -overwri: 3-Error: 2' + ExtractFileName (hMLProj) + '; Param3: = ExtractFileName (hMLProj); ShellExecute (0, 'open', PCHAR (MLWorkDir + '__automatedTranslationFUBAR.bat'), PChar (param1 + param2 + param3), zero, SW_SHOWDEFAULT);  
  ECHO scans for new resources% MLDIR% \ Ml7Build.exe s Import terminology for% ~ 1 ECHO new translation%% MLDIR% \ MLBUld.exeI% ~ 2REM7 ^ is omitted? Please note that % n   not  % N%  (n = 1..9) Removes the specified parameter for the batch  n  tilde "any enclosed quote." 

The parameters need to be "enclosed in quotation" (and they should be double quotes) if they include spaces like separator.


javascript - Converting a html table into a json object and sending it to a php page ,the table has a input field -


I have went created by the PHP code takes DP data from HTML tables that dynamically. The last field in the table is an input field to enter a number. The data from the table must be sent to the second php page to insert the SQL. I am new to XML and Ajax PLS helps me with above javascript code.

  & lt; Script & gt; $ (Document) Click .ready ( "enter") or (function (event) {event.preventDefault (); to var elementTable = document.getElementById ( "form_table"); var jObject = []; (var i = 0 ; I & lt; elementTable.rows.length; i ++) {jObject [i] = []; Jobakt [i] [0] = Elimenttibl. ROS [i]. Seals [1] Kjlr HTML; Jeobakt [I. ] [1] = elementTable.rows [i] .cells [2] .innerHTML; //} console.log (jObject) data input field, bridesmaid JSONObject = encodeURIComponent (JSON.stringify (jObject)) to obtain //; the error here var url = "submit.php"; var requestData = "& amp; dtable =" + JSONObject; var XMLHttpRequestObj = FileResort.Utils.createRequest (); XMLHttpRequestObj.open ( "POST", url, true); XMLHttpRequestObj .setRequest Header ("Content Type", "Application / X-www-Form-URL Exodited"); XMLHttpRequestObj.send (requestData);}); & Lt; / Script & gt;  

As long as you're using JQuery, optimization

 

Which is mostly what you want for the table ordering ajax from zero ordering (which i Post think it should be, but that is my personal opinion)


erd - Making ER Diagram from DBLP XML -


I am doing some research on data from I is googled if there are tools or web Services that can help me create ER diagrams of this huge XML data file, but unfortunately I have not got any.

Is there any device that can do this stuff? Otherwise how can I read and separate the institutions of such huge XML files?

PS: I'm good at Java programming.

Hope this image will help you:

Here DBLP Dblp.xml :

  & lt ;? XML version = "1.0" encoding = "IS0-8859-1"? & Gt; & Lt ;! DOCTYPE dblp system "dblp.dtd" & gt; & Lt; Dblp & gt; & Lt; Www mdate = "2005-10-06" key = "person / Ley93" & gt; & Lt; Author & gt; Michael Lay & lt; / Author & gt; & Lt; Title & gt; DBLP.uni-trier.de: Computer Science Bibliography & lt; / Title & gt; & Lt; URL & gt; Http: //dblp.uni-trier.de/< / URL & gt; & Lt; Year> 1993 & lt; / Year & gt; & Lt; / Www & gt; & Lt; Inproceedings mdate = "2012-09-18" key = "person / codd74" & gt; & Lt; Author & gt; E. F. Code & lt; / Author & gt; & Lt; Title & gt; Seven Steps Matching With Casual User & Lt; / Title & gt; & Lt; Month & gt; January & lt; / Month & gt; & Lt; Years & gt; 1974 & lt; / Year & gt; & Lt; Pages & gt; 179-200 & lt; / Pages & gt; & Lt; Booktitle & gt; IFIP Working Conference Data Base Management & lt; / Booktitle & gt; & Lt; URL & gt; Db / conf / ds / dbm74.html # Codd74 & lt; / URL & gt; & Lt; Note & gt; IBM Research Report RJ1333, San Jose, California & lt; / Note & gt; & Lt; CDROM & gt; DS / DS1974 / P179.pdf & lt; / CDROM & gt; & Lt; / Inproceedings & gt; & Lt; Article mdate = "2002-01-03" key = "person / CoddD74" & gt; & Lt; Author & gt; E. F. Code & lt; / Author & gt; & Lt; Author & gt; C. J. Date & lt; / Author & gt; & Lt; Title & gt; Interactive support for non-programmers: Relational and network approaches & Lt; / Title & gt; & Lt; Magazine & gt; IBM Research Report, San Jose, California & lt; / Magazine & gt; & Lt; Quantity & gt; RJ1400 & lt; / Quantity & gt; & Lt; Month & gt; June & lt; / Month & gt; & Lt; Years & gt; 1974 & lt; / Year & gt; & Lt; / Article & gt; & Lt; Incollection mdate = "2011-11-25" key = "reference / algo / chondo 8b" publisher = "encyclopedia entry" & gt;  

jni - Is it possible somehow to handle swipe away exit of Android app? -


Is it possible in Java or in the original code? I have tried to catch the signal with C ++ with the sigaction and java threads.with the default order sequence handler (new TryMe ()); No one does the work.

There is currently no guaranteed / guaranteed method of detecting an Android app without closing the end of the operating system Android operating The system reserves the right to terminate its app without any notice. The recommended solution for this type of notification is only to ensure that as long as the active activity has reached the On-Throwest Lifestyle method, Save it. If you are trying to restart some situation that is being killed, so that it continues in the background, then you may have to check the service if for some reason you need a special case , When it stops, I think that some kind of hack can be done, but this is unlikely and it is a hack that will stop working on the OS development in the future.

Here is a link to the same question.


C# + MySql + SSL = "The handshake failed due to an unexpected packet format" -


मैं एक साधारण .net 4.0 C # कंसोल अनुप्रयोग से MySQL डेटाबेस से कनेक्ट करने का प्रयास कर रहा हूं:

  MySql.Data.MySqlClient का उपयोग कर; नेमस्पेस MySqlTest {class प्रोग्राम {static void Main (string [] args) {उपयोग (var कनेक्शन = नया MySqlConnection ("सर्वर = xxx.xxx.xxx.xxx; डेटाबेस = my_database; Uid = my_login; Pwd = my_password;" + " सर्टिफ़िकेटफ़ाइल = सी: \\ उपयोगकर्ता \\ myuser \\ दस्तावेज़ \\ विजुअल स्टूडियो 2013 \\ परियोजनाएं \\ सैंडबॉक्स \\ MySqlTest \\ certificate.pfx; "+" प्रमाणपत्र पासवर्ड = प्रमाणपत्र_पासवर्ड; एसएसएल मोड = आवश्यक; ")) {कनेक्शन ।खुला(); }}}}  

जब मैं ऐप चलाता हूं, मुझे एक सिस्टम मिलता है। आईओ। आईओई एक्सप्शनः "अप्रत्याशित पैकेट प्रारूप के कारण हाथ मिलाना विफल रहा।"

I मैंने अपनी फाइल को 3 अन्य फाइलों से बना दिया है, पहले यह कमांड चला कर:

 । \ Openssl.exe pkcs12 -exportoutout certificate.pfx-किंका user.key -in उपयोगकर्ता CRT -certfile ca.crt  

दूसरे प्रयास पर, मैं सभी तीन फाइलों को .pem में कनवर्ट कर दिया और फिर उसी आदेश को चलाता हूं (- "एक प्रमाण पत्र फ़ाइल बनाना। ग्राहक "अनुभाग):

 । Openssl.exe pkcs12 -exportoutout certificate.pfx-कीनी उपयोगकर्ता.pem -in user.pem -certfile ca.pem  

मैं उसी तीन फाइलों का उपयोग करके MySQL Workbench से डेटाबेस से कनेक्ट हुआ और यह काम किया। मुझे नहीं पता कि मेरे ऐप पर मुझे यह अपवाद क्यों मिलता है क्या किसी के पास कोई विचार है?

मैं न्यूजेट से डाउनलोड किए MySql.Data 6.9.6 ड्राइवर का उपयोग कर रहा हूं।

धन्यवाद!


windows phone - How to get response body from httpclient c# when doing multipart -


I am trying to post multipart data using System.Net.Http.HttpClient, received feedback 200 is fine.

Here is the method I used:

  Public async job postmultiPart () {var client = new HTTP client (); Client.DefaultRequestHeaders.TryAddWithoutValidation ("content-type", "multicast / form-data"); // This PostData MultipartFormDataContent Content = New MultipartFormDataContent (); Content.Add (new string content ("12", encoding. UTF8), "UserID"); Content.Add (new string content ("78", encoding. UTF8), "noofetende"); Content.Add (new string content ("Chennai", encoding. UTF8), "location name"); Content.Add (new string content ("32.56", encoding. UTF8), "longitude"); Content.Add (new string content ("32.56", encoding. UTF8), "latitude"); Console.Write (content); // upload the file information and upload to ensure a result. // This will throw an exception if the service does not return valid valid status code to the customer. PostAsync (fileUploadUrl, content). With full ((PostTask) => {postTask.Result.EnsureSuccessStatusCode ();}); }  
  • How to obtain a response body from this method?
  • To resonate John (who does not disagree with John only), formerly - async / await ( continue ) The world of async / wait was not found with the world.

    To get the body of the reaction as a string, you have to wait another:

      var response = wait client.PostAsync (fileUploadUrl, content); Response.EnsureSuccessStatusCode (); Var body = Waiting for the result. Content RedAssressingSync ();  

Unable to start Apache and MySQL servers in Windows -


I'm having some problem with installing xampp in windows. In fact, I have Skype and Team Viewer installed in my laptop. I uninstalled the team viewer and in Skype I have checked "Use of Port 80 and 443" for additional incoming connections. However, I am getting this problem which is

  5:07:24 pm [Apache] attempt to start Apache service ... 5:07:32 PM [mysql] Problem address walked! 5:07:32 PM [mysql] C: \ Program Files \ MySQL \ MySQL Server 5.5 \ bin \ mysqld "--defults-file =" C: \ Program Files MySQL \ MySQL Server 5.5 "Port 3306 \ My 5:07:32 PM [MySQL] MySQL will not start without configured ports! 5:07:32 PM [mysql] You need to uninstall / disable / reconfigure the blocking application 5 : 07: 32 PM [mysql] or reconfigure mysql and control panel to listen to a different port 5:07:32 PM [mysql] MySQL attempt to start service ...  

both MySQL and Apache Pls help me with this.

Thanks in advance :)

As an error, you are running with C: \ Program Files \ MySQL \ MySQL Server 5.5 \ bin \ mysqld

You can use the Windows logo> Type < Code> services.msc MySQL can search for the service and stop it. (Left panele "stop")

Note : If you use XAMPP If you are going, Apache, php and / or mysql


javascript - is it possible to embed a google web app in a third party website? -


For my work, we are creating a Google Apps Script-based web app, however, our customer can make their own personal- Want a web app on branded website The problem is from the "Web App and Google Site Gadgets" page, I only see an option to embed web applications specifically in Google Sites, and otherwise can not find any other information. Does this mean there is no way to embed in personal websites or is there a solution that I am not getting anywhere?

I use ContentService to use Apps Script as backend I use

on my webpage, I use the call like this:

  var url = "https://script.google.com/macros/s/ AKfycb ... vZ8SvFBRWo / Offset Offset = "+ offset +" & baseDate = "+ baseDate +" & amp; callback = "; $ .getJSON (url, function) {...  

In my script:

  function doGet (e) {var callback = e JSONP Parameter.backback; // Return ContentService.createTextOutput (callback + '(' + JSON.stringify (return object) + ')'). SetMimeType (ContentService.MimeType.JAVASCRIPT);}  

javascript - How to add an event to jQuery's on() callback? -


I tried to:

  $ ('body'). On ('click', '.headerCheckbox', function) {// Add event here and should be magic? Event.stopPropagation (); // Event output in firebug: Event: [object object] Header check box ($ (this ));});  

This is a table, where one of my columns has a checkbox in the header. I want to stop blurring the event so that the table does not get the event, so this column Not like.

I thought it was the right path, but after adding the line, the table is still stable. I can not find a good example to work with it.

Workaround Dataset disabling the sorting on the specified column. DataTable ({"Order": [[1, "desc"]], "column def": [{"targets": 0, "column" orderable ": false}]});

A. Wolff thought the answer to the question was because it was because I wrote (3) with 3 parameter version instead of 2, which I am using, so I did not even think about it.

If your data headers are stable, then you should be able to force the event directly on the checkbox:

  $ ('.headerCheckbox') ('Click', function) {event.stopPropagation (); HeaderCackboxClatch ($ (this));});  

How the delegation works by using event bubbing , (Filtering by using this event goal), so in fact you were blocking the promotion at the body level. The header click event was already removed, and so the sorting method has already been called .


c++ - How many min-cut is in Tree without weights? -


I have read an example from a book that takes the algorithm from the 2013-local competition.

Who can say how we can calculate this question?

How much is there in the tree without deduction, in which n peak and n-1 edges?

Any thoughts or hints?

The minimum cut size is one and is exactly n - 1 like this The cut (we can cut any edge of the tree and get two non-empty components)

Why is this a matter?
The size of the minimum cut is one and it can not be small because the graph is connected. Now we can remove one edge, by removing one edge, specifically sets the corner of two sets and we have the n - 1 the edges, thus we have the n - 1 < / Code> is the minimum cut.


javascript - the first jquery code is not working.....is it because of jQuery conflict -


Among the two jQuery which I have written, the second is not working.

I think this is a matter of JQuery conflict.

Please help ....

  & lt; Script & gt; // This is the first jQuery code jQuery (document) .ready (function ($) {$ (function () ($ (document) .ready (function () {$ ('.rm option'). Each (function () (If ($ (this ($) () ($) ($) ($ div # disp). Text ()) $ (this) .attr ('selected', 'selected');});}); / / Partially "eyes", "blind", duration: 800}, hide: {effect: "blind" $ (function () {$}); $ ("#opener"). {$ ("#dialog") .dialog ("open");});}) ('#dialog'). Dialog ({keyboard: true})};   Try it: 

Try this:

  



        

यह मेरा नियंत्रक है:

  $ scope.datas = [{आइटम: [ नाम: "owl1.jpg", आईडी: 1} {नाम: "owl6.jpg", आईडी: 6}]}]; $ Scope.demo = function () {$ scope.datas.push ({आइटम: [{नाम: "owl1.jpg", आईडी: 1}, {नाम: "owl2.jpg", आईडी: 2}]}) ; };  

निर्देशक:

  sampleApp.directive ("imagedata", फ़ंक्शन ($ संकलन) {वापसी {प्रतिबंधित: "ई", लिंक: फ़ंक्शन (दायरा) , तत्व, एटर्स) {दायरा। $ घड़ी (attrs.value, फ़ंक्शन (न्यूवैल्यू) {element.html ("& lt; img src =। / Img /" + newValue.name + "& gt;"); $ संकलन (तत्व सामग्री ()) (स्कोप);});}};});  

सूचकांक पृष्ठ:

  & lt; div class = "col-md-9" ng-controller = "addorr नियंत्रक" & gt; & Lt; बटन एनजी-क्लिक = "डेमो ()" & gt; अपडेट & lt; / बटन & gt; & Lt; div वर्ग = "उल्लू-डेमो" वर्ग = "उल्लू-कैरोझेल" एनजी-दोहराने = "एक में डेटा" & gt; & Lt; div वर्ग = "आइटम" एनजी-दोहराने = "डी में a.item ट्रैक $ इंडेक्स द्वारा" & gt; & Lt; imagedata मान = "d" & gt; & lt; / imagedata & gt; & Lt; / div & gt; & Lt; / div & gt; & Lt; / div & gt;  

इसका काम ठीक है लेकिन डेमो फ़ंक्शन पर क्लिक करें, मैं आइटम को सरणी में दबाता हूं। लेकिन गुंजाइश घड़ी नहीं है wokrking।


android - Get a set of TableRow in TableLayout by findViewById -


Linearlayout, where some conditions may disappear from some situations. E.g.

& lt; LinearLayout & gt; & Lt; LinearLayout Android: id = "@ + id / layout1" & gt; & Lt ;! - Baby set - & gt; & Lt; / LinearLayout & gt; & Lt; LinearLayout Android: id = "@ + id / layout2" & gt; & Lt ;! - Baby set - & gt; & Lt; / LinearLayout & gt; & Lt; / LinearLayout & gt;

In LinearLayout, I can find FindViewById from any section of the child (with their layout) from the main layout and it can change visibility (at least in the programmatically). Layout with ID uses rapper for child's set.

Can I do something like this in TableLayout? I know, get FindViewById from a set layout of TableView and change its visibility?

From table to linear layout is. All this can do is make a linear layout, so you can specify an ID and change its visibility.

View


javascript - setInterval skipping count -


I am writing a script to solve a 10 digit code and there is a script in it:

  var currNum = 9999999999; SetInterval (function () {var tmp = currNum; $ ('# code box-10') Val (Math.floor (tmp 10%)); tmp = tmp / 10; $ ('# code box-9') .val (Math.floor (tmp 10%); tmp = tmp / 10; $ ('# code box-8') Val (Math.floor (tmp 10%.)); Tmp = tmp / 10; $ ( '# Code box-7') Val (Math.floor (tmp 10%)); tmp = tmp / 10 ;. $ ('# code box-6') Val (Math.floor (tmp 10%)); Tmp = tmp / 10; $ ('# code box-5') Val (Math.floor (tmp 10%)); tmp = tmp / 10; $ ('# code box-4') .val (Math. Floor (tmp 10%); tmp = tmp / 10; $ ('# code box -3') Val (Math.floor (tmp 10%.)); Tmp = tmp / 10; $ ('# code-box 2 '). Val (Math.floor (TMP% 10)); TMP = TMP / 10; $ (' # code-box-1 ') Val (Math.floor (TMP)% 10 )); $ ("# Btn-submit") Trigger ("click"); CurrNum--;}, 1000);  

The script just refreshes every page, but updates the numbers in the multiples of 5 and does it once every 5 seconds. For example:

Call 1: 9999999999 Call 2: 9999999999 Call 3: 9999999999 Call 4: 9999999999 Call 5: + 999999999 5 Call 6: + 999999999 5 Call 7: + 999999999 5 Call 8: + 999999999 5 Call 9: + 999999999 5 Call 10: + 999999999 0 Call 11: 99 99 99 99 99 99 and so on

I know that this is not one of the most skilled people, but any thoughts on such behavior?


Executing/Running python script on ubuntu server -



Executing/Running python script on ubuntu server -

i've uploaded .html chat file on ubuntu vps, remains execute/run python script pywebsock.py run python server. i've uploaded pywebsock.py /bin/www , want run have no thought start.

when run pywebsock.py on desktop opens terminal saying "waiting connection". i've done far seek , run it:

downloaded putty downloaded winscp installed version of python according .py (2.7)

any ideas?

running script on server same running locally.

python script.py

you may check if have python installed first using which python (should homecoming python location)

if not, using sudo apt-get install python

after that, go www directory , run it.

python ubuntu vps

Manipulate Wordpress generated content before it is displayed -



Manipulate Wordpress generated content before it is displayed -

i'm wordpress virgin, thrown don't know much about, trying help. know few things php.

i know if somehow in wordpress (not via update vulnerable hack) possible see , manipulate total page content, before displayed ?

i check few things in page meta-data tags, cross reference info in body on various places, create few changes here , there if needed , hand on wordpress again.

some sort of callback, @ lastly moment, total page's content in php variable.

maybe not possible ? hope larn something. cheers.

wordpress-plugin wordpress

python - How to install PyMongo -



python - How to install PyMongo -

i trying install mongodb driver python on mac os x (mavericks).

but when run

[ dsl ~/documents/python ] sudo easy_install pymongo

i next output

searching pymongo best match: pymongo 2.7 processing pymongo-2.7-py2.7-macosx-10.9-intel.egg removing pymongo 2.7rc1 easy-install.pth file adding pymongo 2.7 easy-install.pth file using /library/python/2.7/site-packages/pymongo-2.7-py2.7-macosx-10.9-intel.egg processing dependencies pymongo finished processing dependencies pymongo

i seek lot of different commands, nil work. how install pymongo ?

thanks help

edit: when seek utilize in python script

#!/usr/bin/env python3 import pymongo client = mongoclient()

i have error

traceback (most recent phone call last): file "./mongo.py", line 2, in <module> import pymongo importerror: no module named 'pymongo'

try these commands. source

$ easy_install -u setuptools $ python -m easy_install pymongo

python pymongo

java - Reducing WebLogic Memory Usage -



java - Reducing WebLogic Memory Usage -

i'm trying run weblogic in vm relatively little ram. there way turn off features or otherwise cut down memory footprint of weblogic? know can cap memory usage, i'm trying have less memory utilized on average.

which version of wls installing ? can custom install of wls , seek select components need. cut down number of connections in connection pool, cut down number of threads, have alternative not have wls console itself.

there used wls express edition, don't think there in more recent versions.

java memory weblogic

Redirect http server request in Dart, but uri.host is blank -



Redirect http server request in Dart, but uri.host is blank -

i've got:

server.listen((httprequest request) { print(request.uri.tostring()); if (request.uri.host == "woven.app") { request.response.redirect(new uri(scheme: 'http', host: 'woven.co', path: request.uri.path, fragment: request.uri.fragment)); } ...

but line 2 returns blank. according notes request.uri:

* returns host part of authorization component. * * returns empty string if there no authorization component , * hence no host.

update: case locally , on server, tested chrome.

this returns hostname:

request.headers.host

why work whereas request.uri.host not?

dart

sql - Simple Joins not working in H2 Database when giving multiple tables -



sql - Simple Joins not working in H2 Database when giving multiple tables -

i have many tables , want retrieve info joins in h2 database simple bring together not working when given multiple tables.

select a.*, b.name "make", c.name "model" basicinfo a, make_models b, make_models c a.make=b.id , a.model = c.id;

while if bring together 2 tables e.g.: works when multiple tables given shows query executed result 0 rows.

this query similar mysql syntax. there wrong query or h2 doesn't back upwards it?

try below query

select a.*, b.name "make", c.name "model" basicinfo bring together make_models b on a.make = b.id bring together make_models c on a.model = c.id;

sql join h2

mnesia - Erlang check empty string -



mnesia - Erlang check empty string -

i'm new in erlang development. i'm trying read value of accesstoken mnesia table (stored in 'users' table).

in code i've done:

buser = boss_db:find(users, [{email, 'equals', myemail}]), [{_,_,bemail,bname,bpassword,_,baccesstoken}] = buser, io:format("user details ~n~p~n", [buser]), io:format("access token ~n~p~n", [baccesstoken]), . .

i get:

user details [{users,"users-1","mymail@someemail.org","some name","somepassword",'',''}]

the lastly field accesstoken , printed as:

access token ''

if accesstoken value non empty i'll operation.

how check if accesstoken empty or not?

i tried:

accesstokenlength = length(baccesstoken) if accesstokenlength > 0 -> . .

but next error:

error in controller error badarg [{erlang,length,[''],[]}

i tried:

case binary_to_list(baccesstoken) =/= [] of true-> false->

but next error:

error in controller error badarg [{erlang,binary_to_list,[''],[]}

how check empty status properly?

you pattern match on value

case baccesstoken of '' -> %% empty _ -> %% not empty end

and 1 more thing. single quotes in erlang signifies atom. can write starting lover case letter, atom or false or not_empty. utilize more "complex" atom utilize single quote 'this atom'. , '' "empty atom.

and empty binary <<>>.

erlang mnesia

LS Retail NAV Error -



LS Retail NAV Error -

this stack trace when seek test connection web, can please help?

lsdemow1 user: type: microsoft.dynamics.nav.service.webmetadata.servicebrokerexception httpstatuscode: unauthorized message: server has rejected client credentials. stacktrace: @ microsoft.dynamics.nav.service.webservices.navwebservice.processmessage(message message) @ syncinvokeprocessmessage(object , object[] , object[] ) @ system.servicemodel.dispatcher.syncmethodinvoker.invoke(object instance, object[] inputs, object[]& outputs) @ system.servicemodel.dispatcher.dispatchoperationruntime.invokebegin(messagerpc& rpc) @ system.servicemodel.dispatcher.immutabledispatchruntime.processmessage5(messagerpc& rpc) @ system.servicemodel.dispatcher.immutabledispatchruntime.processmessage31(messagerpc& rpc) @ system.servicemodel.dispatcher.messagerpc.process(boolean isoperationcontextset) source: microsoft.dynamics.nav.service.webservices hresult: -2146233088

we experience same erros in event viewer, every 5 minutes. looks initiated job queue, when job queue disabled, error messages remain. have solution error? thanks.

nav ls

ios - Non-public API usage -



ios - Non-public API usage -

i can't upload app itunes connect.

xcode uploader says i'm using allocbatch:withentity:count:, allocwithentity:, indexforkey:, fastindexforknownkey:

i'm not using methods , dunno be. week ago same code uploading successfully. can cause of such behavior?

update

submitting older xcode not working anymore, error reveals on binary processing.

i had exact issue using yosemite xcode 6.1 , using objective c. got warning on validation saying can't upload app created beta version of xcode, 6.1 @ time of writing this.

i trashed xcode 6.1 dragging trash form finder downloaded xcode 6.0.1 gm app store. tried twice install 6.0.1 on top of 6.1 didn't work, hence trashing of 6.1

having cleaned , recompiled app xcode 6.0.1 validated , submitted app store no problem. hope helps.

ios swift app-store itunesconnect

Entity Framework Code First truncating my decimals -



Entity Framework Code First truncating my decimals -

i using entity framework 6.x using code first approach on mvc 5 application. in particular situation model (among other things) contains 2 properties named latitude , longitude:

[required, range(-90, +90)] public decimal latitude { get; set; } [required, range(-180, +180)] public decimal longitude { get; set; }

and when performed migration got this

createtable("resproperty"), c => new { : latitude = c.decimal(nullable: false, precision: 10, scale: 8), longitude = c.decimal(nullable: false, precision: 11, scale: 8), : }) ... other stuff

so both latitude , longitude have 8 decimal digits. former 2 whole numbers (max 90) , latter 3 whole numbers (max 180).

after performing update-database command table's columns shown as:

latitude decimal(10,8) longitude decimal(11,8)

that seems me. in view have map , javascript code allows user reposition marker. works fine too. when marker repositioned latitude , longitude fields populated updated value (javascript) has more 12 decimal digits. not matter afaik because scale 8 decimals.

after submit button pressed , either create or edit post method invoked examine model instance , confirmed actual values passed in model controller correct, have more plenty decimal digits (those javascript code place). value correct.

now... problem beingness after db.savechanges() performed database gets updated -and have confirmed actual write/update has taken place- somehow internally ef disregards actual values , writes truncated latitude/longitude rounded 2 decimal digits, latitude shows in db 09.500000000 other decimal digits zeroed because rounding seems have taken place.

// prior savechanges() latitude = 9.08521879 longitude = -79.51658792 // after savechanges() latitude = 9.08000000 longitude = -79.51000000

why rounding if have given right scale , precision , column has right scale , precision well? why savechanges altering values?

i found post (http://weiding331.blogspot.com/2014/01/entity-framework-decimal-value.html) same issue don't know how can prepare (if does) because have performed several migrations , info additions after table in question "migrated".

summarizing

the model info type right (decimal) the database migration code has right precion/scale (lat 10/8 lon 11/8) the sql database columns have right precision/scale (lat 10/8, long 11/8) the values passed in model have @ to the lowest degree 8 decimal digits both latitude , longitude the actual writing/updating of value takes place in database without error, but... the values recorded on database these 2 columns truncated 2 decimal digits , show other to the lowest degree important decimal digits 0 (0)

ef-code-first decimal entity-framework-6 geospatial rounding-error

javascript - how can we find that an iPad has pdf viewer installed? -



javascript - how can we find that an iPad has pdf viewer installed? -

i want find ipad has built in pdf viewer or adobe acrobat installed or not?

is possible in javascript code? using dojo, jquery etc...

please help

thanks mathi s

to able see whether or not has app installed (for illustration pdf viewer), privacy issue , i'm pretty sure it's impossible check whether or not has pdf viewer installed.

javascript dojo

visual studio - How to make sure nuget assemblies are added by package rather than only reference to DLL file? -



visual studio - How to make sure nuget assemblies are added by package rather than only reference to DLL file? -

i have noticed many times developers tend reference assemblies straight browsing .dll file under .\packages folder (installed project) , adding project references instead of installing nuget bundle on project. in case, though compiles, nuget bundle manager not know referenced assembly package, , updating bundle solution-wide not update references in project. if doing service oriented architecture each piece of feature in application separate project in solution, have hundred of projects, , managing references become nightmare. there way prevent developers referencing assemblies straight if belong nuget package? illustration there msbuild task verify references bundle assemblies require bundle installed on project?

if team uses resharper, have plugin help this:

http://blog.jetbrains.com/dotnet/2012/11/20/add-packages-not-references-a-nuget-plugin-for-resharper/

i'm guessing issue caused people using resharper without it, since default vs won't know include dll resharper find , reference (and not update bundle config without plugin)

also used having people using nuget @ solution level, not project level. forcefulness people update nuget packages across solution, , not leave v 1.1.1.0 on project , v 1.1.2.0 on project b.

visual-studio msbuild nuget nuget-package

bash - Why cant I have a space between option and optional argument using getopt? -



bash - Why cant I have a space between option and optional argument using getopt? -

when using getopt parse commandline parameters can set space in between alternative flag , argument required arguments not optional arguments. optional arguments parsed if right after option.

temp=`getopt -o p:q:: -n 'mkqueue.sh' -- "$@"` if [ $? != 0 ] ; echo "terminating..." >&2 ; exit 1 ; fi # note quotes around `$temp': essential! eval set -- "$temp" # go through options while true ; case "$1" in -p) echo "option p, argument \`$2'" ; shift 2 ;; -q) case "$2" in "") echo "option q, no argument"; shift 2 ;; *) echo "option q, argument \`$2'" ; shift 2 ;; esac ;; --) shift ; break ;; *) echo "internal error!" ; exit 1 ;; esac done

(based on this: http://software.frodo.looijaard.name/getopt/docs/getopt-parse.bash)

when run script without optional argument works:

./mkqueue.sh -p adfsa -q alternative p, argument `adfsa' alternative q, no argument

if seek add together optional argument -q space in between doesnt work:

./mkqueue.sh -p adfsa -q sdfasdfa alternative p, argument `adfsa' alternative q, no argument

it works if don't have space in between alternative , argument, though required arguments work space:

./mkqueue.sh -p adfsa -qsdfasdfa alternative p, argument `adfsa' alternative q, argument `sdfasdfa'

is there prepare this?

that limitation documented in manpage getopt:

a simple short alternative `-' followed short alternative character. if alternative has required argument, may written straight after alternative character or next parameter (ie. separated whitespace on command line). if alternative has optional argument, must written straight after alternative character if present.

although getopt allows "optional alternative arguments", considered bad idea. posix utility syntax guidelines, example, include:

guideline 7: option-arguments should not optional.

the basic reason guideline convention argument command-line alternative may string whatsoever. might option, example. might literal string --, indicates end of alternative list. might empty string. anything.

the problem "optional alternative arguments" way know optional alternative argument not provided recognize next argument either alternative or --. means value of optional argument cannot start -.

alternatively, can take solution taken getopt command-line utility, require optional argument follow option, without intervening space (that is, beingness in same word). in case, optional argument cannot empty string.

rather creating complicated rules resolving these ambiguities, simple solution -- recommended posix (and, lot less authority, me) -- not allow alternative arguments optional. if there mutual value command-line alternative , want simplify life of user not requiring typed, implement 2 different command-line options, 1 of takes argument , other of doesn't. mutual techniques include using lower-case character version without argument, , corresponding upper-case character version argument, or using long alternative (--option) version.

for prefer dense , packed explanation, posix rationale explains that:

guideline 7 allows string option-argument; option-argument can begin character, can - or --, , can empty string. example, commands pr -h -, pr -h --, pr -h -d, pr -h +2, , pr -h '' contain option-arguments -, --, -d, +2, , empty string, respectively. conversely, command pr -h -- -d treats -d option, not argument, because -- option-argument here, not delimiter.

bash getopt

sql - Improving a DB design where a prefix designates a relation -



sql - Improving a DB design where a prefix designates a relation -

i’m rewriting old accounting system, , i’ve found database design suspect quite poor. don’t have particularly much experience database design, can’t sure.

in old scheme there transactions table, , every row in table has foreign key table determined prefix. example:

| id | voucher | | 1 | l-100801 | | 2 | u-120407 | | 3 | z-622909 |

there more 2 columns in table (about 15 actually). if row’s voucher begins l, it’s connected client invoices table. if begins u, it’s connected payments table, etc.

am right in thinking poor design? how can improve on it? should each type separated own column? should there table voucher types utilize connecting records through?

am right in thinking poor design?

yes, poor database design. have had seen similar design @ company have worked before. makes hard query database based on table.

should each type separated own column?

it depends on entries in tables, if every id connected client invoice, payments , other tables , less complex approach. based on sample info not right approach.

should there table voucher types utilize connecting records through?

this improve way go ahead similar tackling many many association creating association table represent association. way company worked @ redesigned database.

sql database-design

osx mavericks - How do I get screen to both source bash and start in the working directory? -



osx mavericks - How do I get screen to both source bash and start in the working directory? -

i'm on osx mavericks , having problem gnuscreen both sourcing bash , starting in working directory @ same time. solutions i've seen former clash latter.

put in .bash_profile:

export profile_run=1

and set in .bashrc:

if [ -z "$profile_run" ]; . ~/.bash_profile fi

bash osx-mavericks gnu-screen

linux - Launching multiple processes on different boxes with BASH -



linux - Launching multiple processes on different boxes with BASH -

my script looks like:

#!/bin/bash myprogram1& pidmyprogram1=$! ssh myusername@pluto myprogram2& pidmyprogram2=$! function cleanup { kill -9 $pidmyprogram1 $pidmyprogram2 exit 0 } trap cleanup sigint sigterm while : sleep 1 done

it not work need to. trying launch 2 processes, 1 on box called pluto. want these 2 processes run indefinitely until nail control+c, want both processes stop. when run end ssh'ed pluto, processes aren't running. ideas how can handle requirement of starting process on seperate box? pretty new bash...

ssh myusername@pluto starts shell on remote machine , does not exit until shell exits. not cause remainder of script executed on remote machine. need pass myprogram2 argument ssh; programme must exist on remote machine, not on local box.

myprogram1 & pidmyprogram1=$! ssh myusername@pluto myprogram2 & pidmyprogram2=$! function cleanup { kill $pidmyprogram1 $pidmyprogram2 exit 0 } trap cleanup sigint sigterm while : sleep 1 done

assuming myprogram1 run forever until interrupted, can replace busy while loop with

wait $pidmyprogram1

linux bash ssh process

NodeBB with Nginx - "This web page has a redirect loop" -



NodeBB with Nginx - "This web page has a redirect loop" -

i'm trying set nodebb @ xxx.xxx.xxx.xxx/nodebb. have next settings nginx , nodebb:

/etc/nginx/conf.d/nodebb.conf

server { hear 80; server_name localhost; location /nodebb/ { proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_set_header x-nginx-proxy true; proxy_pass http://127.0.0.1:4567/; proxy_redirect off; # socket.io back upwards proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection "upgrade"; } }

/usr/share/nginx/nodebb/config.json

{ "base_url": "http://`xxx.xxx.xxx.xxx", "port": "4567", "secret": "xxxxxx-xxxxxxxxxxx-xxxxxx-xxxxx", "bind_address": "0.0.0.0", "database": "mongo", "mongo": { "host": "127.0.0.1", "port": "27017", "username": "xxxxxxxx", "password": "xxxxxxxxxxx", "database": "xxxxxxx" }, "bcrypt_rounds": 12, "upload_path": "/public/uploads", "use_port": false, "relative_path": "/nodebb" }

when navigate xxx.xxx.xxx.xxx/nodebb redirected xxx.xxx.xxx.xxx/nodebb/404 browser error message this web page has redirect loop. ideas i'm doing wrong?

edit: if navigate http://xxx.xxx.xxx.xxx:4567/nodebb/ - works fine

set server name same base_url, not localhost.

nginx nodebb

c# - How do you search for a string in a rich text box and highlight all found or highlight each line? -



c# - How do you search for a string in a rich text box and highlight all found or highlight each line? -

i found next code http://www.dotnetcurry.com/showarticle.aspx?id=146 , implemented app, finds string 1 time , go on looking other instances of string have maintain pressing search button (bit tedious 100's of matches).

i'd find instances of search string , if possible highlight each line, failing highlight string item code instances not one.

on link above there perchance solution downwards farther on page it's in vb don't know how convert c#.

private void btnlistsearch_click(object sender, eventargs e) { int startindex = 0; if (txtsearch.text.length > 0) startindex = findmytext(txtsearch.text.trim(), start, rtb.text.length); // if string found in richtextbox, highlight if (startindex >= 0) { // set highlight color reddish rtb.selectioncolor = color.red; // find end index. end index = number of characters in textbox int endindex = txtsearch.text.length; // highlight search string rtb.focus(); rtb.select(startindex, endindex); // mark start position after position of // lastly search string start = startindex + endindex; } } public int findmytext(string txttosearch, int searchstart, int searchend) { // unselect searched string if (searchstart > 0 && searchend > 0 && indexofsearchtext >= 0) { rtb.undo(); } // set homecoming value -1 default. int retval = -1; // valid starting index should specified. // if indexofsearchtext = -1, end of search if (searchstart >= 0 && indexofsearchtext >=0) { // valid ending index if (searchend > searchstart || searchend == -1) { // find position of search string in richtextbox indexofsearchtext = rtb.find(txttosearch, searchstart, searchend, richtextboxfinds.none); // determine whether text found in richtextbox1. if (indexofsearchtext != -1) { // homecoming index specified search text. retval = indexofsearchtext; } } } homecoming retval; } private void txtsearch_textchanged(object sender, eventargs e) { // reset richtextbox when user changes search string start = 0; indexofsearchtext = 0; }

i tried search listbox find strings @ start of line not along line.

string searchstring = textbox2.text; listboxresults.selectionmode = selectionmode.multiextended; // set our intial index variable -1. int x = -1; // if search string empty exit. if (searchstring.length != 0) { // loop through , find each item matches search string. { // retrieve item based on previous index found. starts -1 searches start. x = listboxresults.findstring(searchstring, x); // if no item found matches exit. if (x != -1) { // since findstring loops infinitely, determine if found first item 1 time again , exit. if (listboxresults.selectedindices.count > 0) { if (x == listboxresults.selectedindices[0]) return; } // select item in listbox 1 time found. listboxresults.setselected(x, true); } } while (x != -1); }

your code has few problems.

you phone call search , selection routines 1 time per button click, 1 occurrence can found each time. if want highlight occurrences need create loop

you undo each alter in findmytext method. makes no sense. may want clear selections before search new, not while searching

you set selection color before setting selection. nothing, @ best..

here version stores positions in list , supports 2 buttons go forwards , backward through list..:

list<int> found = null; private void cb_findall_click(object sender, eventargs e) { int cursorpos = rtb.selectionstart; clearhighlights(rtb); found = findall(rtb, txtsearch.text, 0); highlightall(rtb, color.red, found, txtsearch.text.length); rtb.select(cursorpos, 0); } private void cb_findnext_click(object sender, eventargs e) { int pos = -1; (int f = 0; f < found.count; f++) if (found[f] > rtb.selectionstart) { pos = found[f]; break; } if (pos >= 0) rtb.select(pos, txtsearch.text.length); rtb.scrolltocaret(); } private void cb_findprev_click(object sender, eventargs e) { int pos = -1; (int f = 0; f < found.count; f++) if (found[f] >= rtb.selectionstart) { if (f >= 1) pos = found[f - 1]; break; } if (pos >= 0) rtb.select(pos, txtsearch.text.length); rtb.scrolltocaret(); } public list<int> findall(richtextbox rtb, string txttosearch, int searchstart) { list<int> found = new list<int>(); if (txttosearch.length <= 0) homecoming found; int pos= rtb.find( txttosearch, searchstart, richtextboxfinds.none); while (pos >= 0) { found.add(pos); pos = rtb.find(txttosearch, pos + txttosearch.length, richtextboxfinds.none); } homecoming found; } public void highlightall(richtextbox rtb, color color, list<int> found, int length) { foreach (int p in found) { rtb.select(p, length); rtb.selectioncolor = color; } } void clearhighlights(richtextbox rtb) { int cursorpos = rtb.selectionstart; // store cursor rtb.select(0, rtb.textlength); // select rtb.selectioncolor = rtb.forecolor; // default text color rtb.select(cursorpos, 0); // reset cursor } private void txtsearch_textchanged(object sender, eventargs e) { found = new list<int>(); // clear list clearhighlights(rtb); // clear highlights } private void rtb_textchanged(object sender, eventargs e) { found = new list<int>(); clearhighlights(rtb); }

note how little each piece of code is!

c# listbox richtextbox

android - Shell Script to remove lines of text in a text file -



android - Shell Script to remove lines of text in a text file -

how can remove line of text in file if exists?

so far guessing

#!/sbin/sh mount -o remount,rw /system; # create backup first cp /system/build.prop /system/build.prop.bak; # append if [ grep -o 'wifi.supplicant_scan_interval' <<</system.build.prop > 1 ]; echo "yo"; fi; mount -o remount,ro /system;

however, shows me yo no matter of > 1 or < 1 (it exist in file), part seems wrong, also, don't know how remove line?

can help?

code update #!/sbin/sh mount -o remount,rw /system; function check_prop(){ busybox grep $1 /system/build.prop; homecoming $?; } # create backup first cp /system/build.prop /system/build.prop.bak; echo $(check_prop 'wifi.supplicant_scan_interval'); # append if [ $(check_prop 'wifi.supplicant_scan_interval') > 1 ]; # stuff here? echo 'yo'; fi; mount -o remount,ro /system;

is returning me blank line, , yo. if alter < 1 same thing

sed '/wifi.supplicant_scan_interval/d' inputfile

would remove lines matching wifi.supplicant_scan_interval

eg

$cat input hello world hai $sed '/world/d' input hello hai

if want delete line file utilize -i alternative action inplace

sed -i '/wifi.supplicant_scan_interval/d' inputfile

edit

using grep print lines except lines match patter.

grep -v 'wifi.supplicant_scan_interval' inputfile

eg

$ grep -v 'world' input hello hai

the -v alternative negation.

android bash shell sh

java - Why is the ListView empty? -



java - Why is the ListView empty? -

i trying create listview contains only images without texts gives white screen , not getting error or anything.

here codes:

xml:

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:weightsum="3"> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <relativelayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="2"> <listview android:id="@+id/setonelistview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" /> </relativelayout> ......... </linearlayout> </linearlayout>

activity:

public class set1_activity extends activity { listview list; int[] images = { r.drawable.iv1, r.drawable.iv2, r.drawable.iv3, r.drawable.iv4, r.drawable.iv5, r.drawable.iv6, r.drawable.iv11, r.drawable.iv12, r.drawable.iv13, r.drawable.iv14, r.drawable.iv15, r.drawable.iv16, r.drawable.iv111, r.drawable.iv112, r.drawable.iv113, r.drawable.iv114, r.drawable.iv115, r.drawable.iv116, r.drawable.iv7, r.drawable.iv8, r.drawable.iv9, r.drawable.iv19, r.drawable.iv49, r.drawable.iv50, r.drawable.iv52, r.drawable.iv54 }; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); setcontentview(r.layout.activity_main2); list = (listview) findviewbyid(r.id.setonelistview); heartlessadapter adapter = new heartlessadapter(this, images); list.setadapter(adapter); list.setonitemclicklistener(new onitemclicklistener() { public void onitemclick(adapterview<?> parent, view v, int position, long id) { switch(position){ case 0: display.setimageresource(r.drawable.iv1); tophone = r.drawable.iv1; break; ......... class heartlessadapter extends arrayadapter<string> { context context; int[] images; heartlessadapter(context c, int imgs[]) { super(c, r.layout.imageview); this.context=c; this.images=imgs; } class myviewholder { imageview myimage; myviewholder(view v) { myimage = (imageview) v.findviewbyid(r.id.imageview); } } @override public view getview(int position, view convertview, viewgroup parent) { // todo auto-generated method stub view row = convertview; myviewholder holder = null; if(row==null) { layoutinflater inflater = (layoutinflater) context.getsystemservice(context.layout_inflater_service); row = inflater.inflate(r.layout.imageview, parent, false); holder = new myviewholder(row); row.settag(holder); } else { holder = (myviewholder) row.gettag(); } holder.myimage.setimageresource(images[position]); homecoming row; } }

all works fine, no error , emulator show empty white screen nil inside. missing?

thanks!

1) allow heartlessadapter extend arrayadapter<integer> instead of arrayadapter<string>.

2) on constructor, phone call super(c, r.layout.imageview, imgs); should work that.

3) if wanna optimize lot, remove references context , array of images adapter. can item need calling getitem(position) , context calling getcontext().

edit:

in order work, phone call this:

super(c, r.layout.imageview, heartlessadapter.tointegerarray(imgs));

and add together method heartlessadapter:

private static integer[] tointegerarray(int[] array){ integer[] finalarray = new integer[array.length]; (int i=0; i<array.length; i++){ finalarray[i] = array[i]; } homecoming finalarray; }

java android xml listview android-listview

osx - Mac Matlab/ Simulinks Real time audio input -



osx - Mac Matlab/ Simulinks Real time audio input -

i building simple real time delay scheme on mac (2010-11 model; os x mavericks; serial sound input) using simulinks (matlab 2014a) consisting of 'audio input' block, 'audio output' block 'delay' block , adder (to add together delayed signal original signal), receive error: 'error in 'untitled/from sound device': given sound device may opened once.' twice sound input block.

when seek same using sound file input desired results. same diagram works fine on windows machine.

please help. give thanks you.

i think issue trying output sound sound device, while @ same time trying read sound device. won't work, can't that. see keep playing sound on , on 1 time again in matlab? similar issue in matlab. need somehow wait reading part finish before outputting sound sound device, or utilize 2 different devices, 1 reading , 1 writing.

i suspect same model worked on windows machine because had 2 sound devices (maybe built-in , external), , model automatically detected this, reading 1 device, , outputting other. documentation both blocks says:

use device parameter specify device acquire audio. parameter automatically populated based on sound devices installed on system.

which again, reinforces theory. if still have access windows machine, can double-check case.

osx matlab audio real-time simulink