Posts

php - WordPress plugin adds the number 1 to content if activated -

Image
If the plugin is active, then my wp plugin adds numeric 1 to the content. add_filters ('the_content', 'poc_shop_cart_button_filter'); Function poc_shop_cart_button_filter ($ the_content) {$ new_content = $ the_content; $ New_content = Include (WP_CONTENT_DIR. "/custom_php/shop-cart-button.php"); Return $ New_content; } This is the page in which I am including the plugin: if (isset ($ _ cookie ['_ abs_34287GjNW'])) {$ CookieID = htmlspecialchars ($ _COOKIE ['_ _ _ _ _ _ _ _]' ', ETAQUOTES,' UTF-8 '); } And {$ cookieID = ''; } $ SupplierID = get_bloginfo ('name'); Required (Abospace. 'Wp-content / custom_php / included / connect db.fp'); Try {$ Conn = new PDO ("mysql: host = $ host; dbname = $ dbname", $ user, $ pass}; $ Conn- & gt; exec ("SET CHARACTER SET utf8"); Calculate as $ Sql ​​= "SELECT COUNT (*) with` shopping cart` where supplierID =: supplierID and cookieID ...

javascript - Need InDesign script to run on file open -

I have this javascript which saves a copy of a file. I need that whenever a file is opened, it automatically runs and saves that copy in a specific folder. Here's what I've done so far: var myDoc = app.activeDocument; MyDoc.save (); var myFile = myDoc.fullName; Var myDate = new date; Var mySuffix = "_Backup_" + myDate.getDate () + "_" + myDate.getMonth () + "_" + myDate.getHours () + "-" + myDate.getMinutes () + "-" + myDate.getSeconds () + ".index" mybaseName = myDoc.fullName.fsName.match (/ (. *) \. [^ \.] + $ /) [1]; Var myNewFile = new file (myBaseName + mySuffix); myFile.copy (myNewFile); Therefore what you want is called an event listener. (See the "Working with Event Listener" section.) Save your .jsx file to the "Startup Script" folder. (On a Mac, this is the / application / Adobe InDesign CS6 / script / startup script /.) / P> #targetengine "session" app.addEve...

screen - Android WheelView Error -

I'm having a lot of problems when trying to add a review to my Android activity. I keep it on the screen and it's a There is an error that pops up. Note: This project contains Java compilation errors, which may cause rendering failures for custom views. Fix compile problems first. Exception took place during the rendering: Resource value could not be resolved: 0x7F020058 are logged in exception details window; View & gt; Error log android.content.res.Resources $ NotFoundException: Resource value could not be resolved: 0x7F020058 at android.content.res.BridgeResources.throwException (BridgeResources.java:693) android.content.res.bridgeResources.get click (BridgeResources.java1264) at kankan.wheel.widget.WheelView.initResourcesIf Required (WheelView.java:427)) at kankan.wheel.widget.WheelView.calculateLayoutWidth (WheelView.java:482) kankan.wheel.widget android.view.View.measure (see .JavaEND_BOLD6497) on Android.widget at .heelView.onMeasure (WheelView.java Tell18...

python - Create directories based on filenames -

I am making a complete start to programming, so I apologize if it is really original I have other questions Have seen that which are related, but this particular problem has not been solved - at least it is not what I can understand. I need to prepare a list of files; Create a separate directory for each file containing the directory name based on the name of each file; And put each file in its related directory. You should keep an eye on the libraries. I wrote an example for you that it will remove the file extension of each file in a given folder, create a new subdirectory, and move the file to the related folder, ie .: c: \ test \ - & gt; Test1.txt - & gt; Test2.txt will be c: \ test \ - & gt; Test1 \ - & gt; Test1.txt - & gt; Test2 \ - & gt; test2.txt code: import glob, os, shutil folder = 'c: test / file_path / In 'Glob.glob (os.path.join (folder,' *. * ')): New_dir = file_path.rsplit ('. ', 1) [0] os.mk...

php - mysql_fetch_assoc not fetching data -

I am currently trying to exceed the style of a movie but I am getting the following errors: Notice: Undefined index: ID_generation --- on Line 34 Notice: Undefined index: ID_generation --- at line 35 incorrect integer value : '' Id_genre '' in line 1 for $ style = ($ _POST ['style']); $ Genre_match = mysql_query ("Choose style from style, where style = '$ genre'") or die (mysql_error ()); $ Row_genre_match = mysql_fetch_assoc ($ genre_match); $ Genre_id = $ row_genre_match ['id_genre']; $ Insert_genre = mysql_query ("Include in movie_generator (` id_film`, `id_genre`) value ('$ fid', '$ genre_id')") or die (mysql_error ()); int (41) string (1) "6" Your SELECT not return id_genre $ genre_match = mysql_query ("SELECT id_genre FROM genre WHERE style = '$ genre'") or Die (mysql_error ());

java - Hadoop 2.2 - Combine Reducer Output -

मेरा नक्शा / कम करें फार्म का लाइनों को आउटपुट करता है Key1 5 Key2 8 Key3 4 Key1 7 Key3 3 और मैं इन परिणामों को चाबी द्वारा मूल्यों का योग प्राप्त करने के लिए एकत्र करना चाहता हूं I तो कुछ ऐसा है: कुंजी 1 12 (5 + 7) कुंजी 2 8 की 3 7 (4 + 3) भोले-भाले को केवल एक दूसरे से जुड़ना होगा पहले एक के पीछे काम को कम करें / कम करें, लेकिन यह अकुशल है क्योंकि आपके पास आवश्यक से दो बार अधिक I / O है, ओवरहेड आदि। इसलिए मैं इस समाधान से बचाना चाहता हूं। इसे करने का सबसे अच्छा तरीका संभवतः जैसे मानचित्र - & gt; कम 1 - & gt; कम 2 जहां कम से कम 1 का उत्पादन कम 2 का इनपुट है। दुर्भाग्य से, ऐसा करना असंभव प्रतीत होता है (उदाहरण के लिए देखें)। मैंने भी देखा है, लेकिन इससे कोई मदद नहीं करता है क्योंकि यह कई चरणों को कम करने की अनुमति नहीं देता है। तो आप इसके बारे में कैसे जा सकते हैं? Hadoop 2.X में कुछ नया है जिसे मैं इस्तेमाल कर सकता हूं? धन्यवाद। मैपर बिना कई रिड्यूसर का उपयोग करना संभव नहीं है मैं सुझाव देता हूं कि आपको दोनों नक्शे को संयोजित करने की कोशिश करनी चाहि...

Filtering a collection based on the existence of an object in each hasMany in Ember.js -

I try to filter an example of Ember.Enumerable based on the existence of an object I am here. Each item has Haimney association. App.Project = DS.Model.extend User: DS.hasMany 'user', async: true App.User = DS Model.extend () How can I filter the collection of projects based on the existence of an individual user object in each project user array ? users = @ store.find ('user', 1) @ store.find ('project'). Filter (Project) - & gt; Project.get ('user'). Then (user) - & gt; User property async: true on the project model on user , project.get ( 'User'), which in turn is returning from the filter () call instead, I have to return it to the user Whether or not the user is an object in the array. This is a simple question that I am still dirty with my javascript promises. I think you are having problems here: project. Get ('user'). Then (user) - & gt; The first parameter of then is the...