FAQ Database Discussion Community


Fill form with Javascript code in browsers addressbar

javascript,com
I want to ease the users experience on a external partner website by giving him a copy/paste line to prefill the form with the data from our database. TASK: Fill form with javascript in Browsers ADRESS BAR (Firefox/chrome mandatory) There is a COM (MS) extension and i can't find any...

Having trouble retrieving JSON from res

json,node.js,express,mongoose
I'm using node, express, and mongoose. I have a function that performs a search in a database and sends the response in a JSON format with: res.jsonp(search_result); This displays the correctly returned result in the browser as a JSON object. My question is, how do I get that JSON object?...

Is there a way to check who or what is causing a redirect?

php,apache,redirect
My project (using a complex framework/cms) does redirects based on PHP, .htaccess, JS etc... and Iam struggling to find who is causing a specific redirect. While I see the redirect using common tools (RedirectChecker, Browser-Dev-Tools ...) I cannot see who/what is causing it. Is there a general way to find...

CodeIgniter db->insert throgh loop

mysql,codeigniter,loops
I'm new to CI. I want to add some records to the DB with a loop. What I have in my controller is : $client_name = $this->input->post('client_name'); $contact_person_details = array($this->input->post('contact_person_name_1'), $this->input->post('contact_person_phone_1'), $this->input->post('contact_person_email_1'), $this->input->post('contact_person_name_2'), $this->input->post('contact_person_phone_2'), $this->input->post('contact_person_email_2'),...

why scope.$watch is not working?

javascript,angularjs
I have angularjs directive with template which consists of two tags - input and the empty list. What I want is to watch input value of the first input tag. The $watch() method is called once when directive is initialised but that's it. Any change of input value is silent....

how to make Sprite follow bezier curve

sprite-kit,bezier,2d-games
Im fairly new to objective-c and sprite kit but i've done games development for a while. Im currently working on a 2d game and i have enemy ships moving from right to left on the screen. Ive been following tutorials for different parts of my game and then adding to...

Adding constraints to make images 1/4 the screen size

ios,xcode,swift,autolayout
Hi I am trying to get 4 rectangles to be each 1/4 of the screen size for each IPhone size from 4 to 6. I have tried adding constraints and setting the rectangles to equal height but still haven't succeeded. Is there an easy way to set to set this?...

Why does not work the use of an extension method in the same extension method?

vb.net,reflection,extension-methods,dynamic-programming,generic-programming
I got an extension method that gives me the value of every property in an instance. For scalar values works it fine. But for Collections there is a problem. This is my code: <Extension()> Public Function ToXml(Of T)(ByVal source As T) As XmlDocument Dim oXmlDocument As New XmlDocument oXmlDocument.AppendChild(oXmlDocument.CreateXmlDeclaration("1.0", "utf-8",...

Building a HTTP request with varying number of arguments?

node.js
I'm trying to write a node function that will build a URL from the arguments passed to it, and then use request.js to make a HTTP GET. I can't figure out how best to deal with the fact that the URL will be valid as long as one argument is...

Listbox not removing values in c# GUI

c#,arrays,wpf,user-interface,listbox
The user basically enters a number of hex values into a textbox separated by commas eg. AA,1B,FF. These are then displayed in a listbox box. if the number of hex values in the textbox exceeds the size to transfer defined by the user, the listbox only displays the this number...

Jquery Same Origin Ajax Call Mistake

javascript,jquery,ajax,.htaccess,joomla
The site in question is test1.guru99.com I am making SAME ORIGIN like this var myemail = "[email protected]"; jQuery.ajax({ type: 'GET', //Define the method type url:'http://test1.guru99.com/Customization/popup/subscription-list.php', data: {email: myemail}, success: function(d) { console.log('success'); }, }); But I get error like ...

mutivalue date field search not working

xpages,xpages-ssjs
I have a multivalue field called freeDaysPool which has multiple dates as strings. With the following code, the search does not return anything. If I leave that field out, the search works just fine with the two other fields. I read that I should use CONTAINS with multivalue fields but...

If statement Matlab

matlab,if-statement,matrix
I have the following code for a = 1:38; for b = 1:41; if distance(a,b)== 0; distance(a,b) == 1; end end end Its for a 38x41 matrix. The matrix has numbers and zero values. How do I write an if statement that will convert any zero value to 1. I...

AngularJS - Display length of filtered data?

javascript,angularjs
I have a data array which contains objects (JSON format). var users = { 'New':{ {Name:'One'}, {Name:'Two'} }, 'Old':{ {Name:'Three'}, {Name:'Four'} } And i use this construction to display data: <div ng-repeat="(key, value) in users"> <p>{{key}}</p> <div ng-repeat="user in value | filter: query"> </div> </div> How do I get the...

Click after mouse over

java,selenium-webdriver
Dears I need some help in this code First: I need to make the test case go through the if statement when driver.findElement(By.id("login:popupPanel-tr")).isDisplayed()); id displayed to run the condition and if not to complete the test case without the if condition Second: I need to click the element driver.findElement(By.id("home:regNew")).click(); After...

Which ngen to use for x86 app on x64 system?

c#,.net,ngen
I decided to ask this question because did not find clear answer. My WPF program is x86 (.Net 4.5.2). I use Inno Setup to install and create ngen image. Should I use Microsoft.NET\Framework64\v4.0.30319\ngen.exe when installing on 64bit system and Microsoft.NET\Framework\v4.0.30319\ngen.exe when installing on 32bit system or because the program is...

Java - SimpleDateFormat - ParseException - Pattern seems to match

java
I wrote a class that tries to convert objects to dates. For string representations, it tries to determine the date format by searching for a match of a predefined date format pattern against that string. If a pattern matches, it uses that pattern in SimpleDateFormat to parse that string to...

JSON [{“non_field_errors”: [“Invalid data”]}]} Django Rest Framework

json,django,django-rest-framework,serializer
I have some serializer where I have some elements and want it to POST it when I create POST method for InvoiceDictionarySerializer. Dont have any idea how to make it works properly. Any suggestions? My code looks as follow: class InvoiceDictionaryElementSerializer(serializers.ModelSerializer): class Meta: model = InvoiceDictionaryElement fields = ( 'name',...

P4: how to make perforce (p4) work with symlinks?

perforce
I have a perforce workspace setup under /temp/myperforceworkspace and I have created a link in my home folder to point to /temp/myperforceworkspace but whenever I run p4 commands it can't recognise that I am in a valid workspace folder. how can I convince p4 that I really am in the...

reloading list after insert in AngularJS

javascript,angularjs
I am performing insert and update, and after words I would like to reload the list of items, but it is duplicating it in the view. Here is the load function // Listing contact resources $scope.load = function () { var g = $rdf.graph(); var f = $rdf.fetcher(g); f.nowOrWhenFetched($scope.path +...

Convert year in buddhist format

angularjs
I'm newbie AngularJS and have question. I use Date.now() for create current time. But I want display year in Buddhist format. I use code from this topic -> How to make a ticking clock (time) in AngularJS and HTML. How I can convert year to Buddhist format ? Thanks all.

When scrollviewer becomes visible other controls move to different position

wpf,xaml,listbox,scrollviewer
I’ve got a listbox which has vertical scrollviewer set to auto, so when user adds more items than can be visible on the screen, then the scrollbar appears. The problem is that when it appears, it moves other things, like the add button which is placed next to listbox. Is...

Activity+Fragment: add fragment in code vs. xml

android,android-fragments
Is there a difference in adding a fragment to an activity layout in code or adding it in xml? if (savedInstanceState == null) { getFragmentManager().beginTransaction() .add(R.id.container, CardViewFragment.newInstance()) .commit(); } vs. <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:name="com.example.CardViewFragment" android:layout_width="match_parent" android:layout_height="match_parent" android:tag="tag_cardview_fragment" /> ...

servlet get ? instead unicode character(persian)

java,jsp,servlets,unicode,utf-8
i have a very simple html with a submit button and a textbox that send a unicode (persian) text to servlet and run it on weblogic. I set charset=UTF-8 in jsp page and request.setCharacterEncoding("UTF-8"); in servlet but when I get parameter from request and print it or insert it into...

Toggle like button to create and remove input box

javascript,html
Am creating an HTML page with some buttons to create the input boxes. The buttons should behave like toggle one. ie, on first click input box should appear and if the same button in clicked again that particular input box need to disappear. Button toggle i have managed. But div...

CSS/HTML : float left not working when I zoom out the browser

html,css,css-float,border
I have a simple HTML like below : <div id="main_container"> <div class="floated_box">box 1</div> <div class="floated_box">box 2</div> <div class="floated_box">box 3</div> <div class="floated_box">box 4</div> <div class="floated_box">box 5</div> <div style="clear: both;"></div> </div> and the following css for my html elements : #main_container { width: 400px; margin: 20px auto; border: 2px solid #cccccc; padding:...

Can I combine RequireJs modules AND require.js itself into one js-bundle

javascript,requirejs,requirejs-optimizer
I'm using RequireJs Optimizer to combine all modules into one file - app.js On production I have two js files: app.js and require.js Production HTML has following script tag: <script data-main="app.js" src="require.js"></script> This will result in two requests for js files when running. The question: is it possible to combine...

save log into a file for different batchs

logging,slf4j,logback
I have 2 batch and i need to save hibernate and spring logs into separate files when i run them separately So i have a logback configuration like this <?xml version="1.0" encoding="UTF-8" ?> <configuration> <!-- Batch 1 --> <appender name="BatchALogToFile" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${logback.root.path}/batchA.log</file> <encoder> <charset>UTF-8</charset> <pattern>[%d{dd/MM/yyyy : HH:mm:ss}] %m%n</pattern> </encoder> <rollingPolicy...

Is there any open hardware microcontroller?

embedded,hardware,microcontroller
Is there any open hardware microcontroller?. I can't find something about this. I mean microcontroller which i can buy from vendors or somewhere and i can download and see full scheme of it. And this information enough to emulate it. something like it....

Sorting out JSON data into a smaller file using nodejs

javascript,node.js
I have a large JSON file, I am trying to pull out specific key blocks but i am unsure on how to do this. Current JSON file: { "blockID1": { "name": "name here", "locale": "en_GB" }, "blockID2": { "name": "name here", "locale": "en_GB" }, "blockID3": { "name": "name here", "locale":...

How to make a String out of a CryptoJS AES Object?

javascript,json,encryption,cryptojs
I have CryptoJS running and I need to do the following: I have a username and a password. U encrypt the username with the password: var encrypted = CryptoJS.AES.encrypt("user", "pass"); How can I create a String out of this object to store it in my LocalStorage? At the end I...

c++: pointer value different than address of the pointed variable

c++,variables,pointers,memory-address,value
I just made a tiny stupid program about passing a variable the value contained in another using a pointer, just as an introduction to pointers themselves. I printed, before and after the assignation, the value and position of all three variables involved. However, I get, as the value contained inside...

reset/change mysql root password

mysql,wamp,bitnami
How to reset/change mysql root password in bitnami wamp stack? I trying this solution but this not working for me. In the bitnami folder no have file \bin\mysqld-nt.exe...

MS SQL column encryption without certificate

sql,sql-server,encryption,aes,x509certificate
I am trying to encrypt one of my sensitive columns in a SQL Server table. I tried AES256 encryption with this script, and it works perfect. But I don't want to create Certificates, or Symmetric Keys on my SQL Server as it may be a security problem later. How can...

How to force the visual studio to use the wmain instead of main

c++,visual-studio,unicode,wmain
I'm in need of parsing unicode parameters, so I wanted to use the wmain instead. So instead of int main(int argc, char** argv) I would like to use int wmain(int argc, wchar_t** argv) The problem is that the visual studio is not recognizing the wmain, and it is trying to...

When is a generic function not generic?

haskell,polymorphism,scotty
I'm working on a Haskell server using scotty and persistent. Many handlers need access to the database connection pool, so I've taken to passing the pool around throughout the app, in this sort of fashion: main = do runNoLoggingT $ withSqlitePool ":memory:" 10 $ \pool -> liftIO $ scotty 7000...

AverageIf and Multiple data strings

excel-formula,excel-2010,conditional-statements
I'm involved with a youth football tournament on the referee side, with assessing/coaching the referees. I've just taken over doing the data entry for the referees assessment scores which we then use to determine who gets finals etc and am looking to extract more usable information from the data to...

How to change the Button content as CamelCasing in Windows phone 8.1 Message dialog

windows-phone,windows-phone-8.1,messagedialog
How to change the Button content as CamelCasing in Windows phone 8.1 Message dialog? private async void Button_Click(object sender, RoutedEventArgs e) { MessageDialog msg = new MessageDialog("Do you want to continue?"); msg.Commands.Add(new UICommand("Ok", (command) => { })); msg.Commands.Add(new UICommand("Cancel", (command) => { })); await msg.ShowAsync(); } I want to change...

Get json data separately in CLOB, pl/sql [duplicate]

json,oracle,plsql
This question already has an answer here: work with json in oracle 3 answers I have json object in CLOB data format in pl/sql, now I need to get each data-field separately from that json object to varchar variable. Without using pljson....

NanoHTTPD how to present variable from app

java,dynamic,webpage,nanohttpd
I play NanoHTTPD and WebServer based on it. To update any object in my code (application) I can use GET/POST method. But how can I create dynamic pages? For example I have html page on disc and it should present current temperature: <html> <head> <title>My page</title> </head> <body> <p style="text-align:...

How to retrieve the sub array elements in meteor

mongodb,meteor
I'm working with following document { "_id" : 123344223, "firstName" : "gopal", "gopal" : [ { "uuid" : "123", "name" : "sugun" }, { "uuid" : "456", "name" :"kiran" } ] } I want to retrieve name from the first document of array and print it in a table... here...

Assignment of base references aliasing non copyable derived objects

c++
I had a discussion with a colleague on the need to mark an abstract base class as non copyable. I did not see the need for this, since the base class is abstract therefore we cannot have instances of base, so copying through base references is not an issue. Derived...

Hash(#) tag redirect in htaccess

php,apache,.htaccess,mod-rewrite,redirect
I want to redirect my old website url to new website url. I wrote a redirect rule in .htaccess file. But the problem is, my old url contains a hash tag between the url params. Redirect /de/home/#/de/about/blog/ https://www.example.com/about/blog/ Everything I've tried ignores the hash tag and either doesn't redirect at...

getters() and setters() simplification for a class

java,encapsulation,setter,getter
Why do we exactly need to use the set and get methods in our class that use private attributes? When it is really used during our program process? Can we still make it work without it (without changing the private attributes to public)? This is an example of a...

parse a list into variable and sublist - pythonic way

python,list,parsing
I am parsing a list into a variable and another list with this script: b=[' 687.3774', ' 478.6', ' 47', ' 58', ' 96.90'] c,d=b[0],b[1:] It is always the first element that would be separated and this code works fine, however, it repeats the list b on the right hand...

Copying bytes in Python from Numpy array into string or bytearray

python,arrays,numpy,buffer
I am reading data from an UDP socket in a while loop. I need the most efficient way to 1) Read the data (*) (that's kind of solved, but comments are appreciated) 2) Dump the (manipulated) data periodically in a file (**) (The Question) I am anticipating a bottleneck in...

batch file for with if errorlevel errorlog

batch-file
what i want is if user already exist just put the name of this user in errorlog.txt i have this: set var_b=123 FOR /F %%v in (%arxiu%) do ( net user %%v >nul 2>nul if errorlevel 1 ( net user %%v %var_b% /add >nul 2>nul ) if errorlevel 0 (...

SELECT query from 2 tables

mysql,sql
I have a table matches that I want to get from it the users that has the best score: SELECT userId,SUM(score) AS score FROM `matches` GROUP BY userId ORDER BY score DESC This output 2 columns userId and score. Good. Now I have a users table, and I want to...

Batch file hangs at SQL Error

sql,windows,oracle,batch-file
I am using a batch file my.bat as given below: @echo off setlocal enabledelayedexpansion for /F "tokens=*" %%A in (user.txt) do ( sqlplus -s -l %%A @fetch.sql ) >> output.txt where user.txt (list of all user details for which I need expiry date. this list may have around 40-50 rows)...

orientation in ios ipad

ios,iphone,ipod
I have an Ipad application which support in "landscape" mode now i want this to support for both "landscape and portrait" this project is made with "xib" files i used some delegates but i did not get solution what i have to do i use this code - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator...

how to identified class if including package from another directory

java,class
from there, i using class loader to identified class from other directory File dir=new File ("D:\\dirclass") fulldir = new File (dir+"\\myclass"); filename = new StringTokenizer(fulldir.getName(), ".").nextToken(); URL[] checkclass = { dir.toURI().toURL() }; URLClassLoader urlcl = new URLClassLoader(checkclass); Class cls = urlcl.loadClass(filename); this is worked if class without package. but if...

JSF SelectManyCheckbox ajax render id [duplicate]

jsf
This question already has an answer here: Cannot find component with expression “foo” referenced from “bar” - <f:ajax> contains unknown id “foo” cannot locate it in context of component “bar” 4 answers I have <h:panelGroup> <ui:repeat value="#{requests.filters}" var="filter"> <custom:filter filter="#{filter}" update="j_requests"/> </ui:repeat> <h:panelGroup id="j_requests"> <h:outputText value="Запросы журналистов:"/> <custom:requestList id="allrequests"...

How to assign address of a int variable to unique_ptr

c++11
This is the code. int main() { unique_ptr <int> p {nullptr}; int val = 100; p = &val; // Not working - compilation error p = move(&val); // Not working - compilation error cout << *p; return 0; } What is the correct way?...

What does System.Reflection.TargetException: Non-static method requires a target. mean?

c#,system.reflection
In my application I receive the functionCode value from somewhere and need to reflect the appropriate class. I tried to reflect the appropriate type According to this solution. but it doesn't work for me. I can not use GetField() method because I'm working on a PCL project. Therefore I tried...

Remove by iterator from std::vector

c++,vector,std
For removing an iterator from std::vector I can do these two things: std::vector<int>& vec = myNumbers; // use shorter name vec.erase(std::remove(vec.begin(), vec.end(), number_in), vec.end()); Or I can do this: auto it = find(vec.begin(), vec.end(), number_in); vec.erase(it); The second is more intuitive, I guess, but which one is faster? EDIT: Elements...

Automatically set Controller properties based on route parameters in multi-tenant application

c#,asp.net-mvc
I'm currently working on a content managed multi-tenant application which will have an admin accessible set of pages and a public facing set of pages. I'm not worried too much about the admin accessible pages as I'm going to have a single admin URL all users use to log in...

Show different content based on option class, not value

javascript,jquery
in a web page i have various forms like this: <form action="" method="post"> <input type="text"> <select name="a"> <option class="hide-all">Choose</option> <option class="show-link">Show link</option> <option class="show-submit">1</option> <option class="show-submit">2</option> </select> <input class="hidden show-if-class-show-submit-selected" type="submit">Submit form</form> <a class="hidden show-if-class-show-link-selected"...

Jquery Mobile - Adding a responsive Leaflet map to page content

javascript,jquery,css,jquery-mobile,leaflet
I need to make a Leaflet map fit inside a JQM page that also includes a header. The problem is that the page is scrollable and I can't see the bottom of the map without scrolling. I need the whole page to fit the window size, without any scrolling. Here...

countdown.js giving incorrect time difference

javascript,jquery
I am using https://bitbucket.org/mckamey/countdown.js for setting up a countdown text between a fromDate and a toDate. Below is my code snippet var fromDate = new Date(2015, 01, 01); var toDate = new Date(2015, 01, 02); var countDown = countdown(fromDate, toDate).toString(); console.log(fromDate); console.log(toDate); console.log(countDown); and I am getting the following output...

Native Client Packaged App and MIME type

google-chrome-extension,google-chrome-app,google-nativeclient
Using a NaCl packaged app, is it possible to handle a MIME type for a dummy resource within a webpage (the type and location of resource does not matter e.g from the app pkg)? I need it to just launch the already installed packaged app without user's mouse click. Thank...

keep asking for a number until a even number is entered

javascript
in this assignment we are to prompt for a box and type in a number. If it is even an alert comes back and says it is even, if odd and alert comes back and says odd. I got that working, but the part that I am stuck on is...

Apache virtual proxy, do not redirect from root

apache,jenkins,continuous-integration,mod-proxy
I have the following in my vhosts.conf: NameVirtualHost *:80 <VirtualHost *:80> ServerName ci.myserver.com ProxyRequests Off ProxyPreserveHost On ProxyPass / ajp://127.0.0.1:8009/ ProxyPassReverse / ajp://127.0.0.1:8009/ ProxyPassReverseCookiePath / / </VirtualHost> Now, when I visit my root (myserver.com) I get my Jenkins, as well as when I visit ci.myserver.com How to I get not...

PostgreSQL timestamp/numeric precision ignored on function parameter?

database,postgresql,stored-procedures,postgresql-9.3
Given the following PostgreSQL functions: CREATE OR REPLACE FUNCTION fn_dtm ( dtm timestamptz(0)) RETURNS void AS $$ BEGIN RAISE NOTICE 'fn: %, %', dtm, dtm::timestamptz(0); END; $$ LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION fn_num ( num numeric(5, 2)) RETURNS void AS $$ BEGIN RAISE NOTICE 'num: %, %', num, num::numeric(5,...

asp listbox set different label for values

asp.net
here's how I populate my listbox ImageList.Items.Clear(); string[] files = Directory.GetFiles(FileImageFolder, "*" + SearchTerms.Text.Replace(" ", "*") + "*"); files = Array.FindAll(files, delegate(string f) { return IsImage(f); }); foreach (string file in files) { if (IsImage(file)) ImageList.Items.Add(file.Substring(file.LastIndexOf('/') + 1)); } it will display file name of images (together with its folder...

Wiping data on Android: Device Admin versus Profile Owner

android,mdm,device-admin,android-managed-profile,profile-owner
Android 5.0 introduces a new concept of Profile Owner. In my understanding Profile Owner is an advanced version of Device Admin (exists in Android since 2.2). Both Device Admin and Profile Owner can wipe data via DevicePolicyManager.wipeData(0). I would like to know if there is a difference in behaviour of...

No preview data - how to edit sql?

crystal-reports
I am editing a crystal report (using version 14.1.1) report that came with a system we are using. I cannot see any data in the preview but when I go to "Database -> show sql query" it is clear that it doesn't work because the query wants some values that...

add a soap header in C#

c#,web-services,xamarin,monodroid,xamarin.forms
I am building an Xamarin.forms App for android where we are consuming third party webservices. I have created the proxy and I can see the methods exposed by the service. But I cannot access the methods of the service as I have to add header to my SOAP request which...

Passing node name created runtime to xsl:value-of select

xml,xslt,xpath
My Input XML : <Book> <Chapter> <Pages value="20" /> <Note1Code value="1" /> <Note1Description value="This is just for reference" /> <Note1Level value="Avg" /> <Note2Code value="2" /> <Note2Description value="This is high important note" /> <Note2Level value="Imp" /> </Chapter> </Book> I want to transform into : <Book> <Chapter> <Pages value="20" /> <Note> <Code>1</Code>...

GridBagLayout alignment

java,swing,gridbaglayout
I am trying to place these buttons a bit upper, but i just dont know how. This is what i got so far : http://imgur.com/XBWFMzA . I really need some help with this GridBagConstraints, as i really don't get it, even with tutorials. One thing is the weightx/weighty.. no matter...

Hide imageview if it is blocked by gridview item?

android
I am attempting to hide an imageview only if an item in the gridview blocks it. The gridview is set to match_parent and the imageview sits in the bottom right so realistically it means that once we get to around 8 items it should be hidden. I know I could...

wxpython shell enable uparrow to retrieve commands

python,python-2.7,wxpython
I am using Shell from wx.py.shell, it is working good. But how do I enable the Python prompt like up arrow key feature. When I use arrow key inside shell, cursor goes up and down, while I want it to step through the last commands. I see from doc that...

How to use a capture group with String.split in old IE versions?

javascript,regex,split,internet-explorer-7
var textt = "L'architecture du système d'information devient"; var pattern = "/(ARCH)/gi"; var array = textt.split(pattern); console.log(array) This results in: [ L', itecture du système d'information devient ] And the expected result was: [ L', arch, itecture du système d'information devien ] Another example var textt = "ARCHIMAG"; var pattern...

Why is Backbone.Collection shown twice for the first viewer?

javascript,jquery,backbone.js
I try to show the same data in two different viewers in the same page by modifying the Todo demo. Any data change will be reflected in both viewers. The code works well with the only one viewer but shows the results that I don't want to want after reloading...

jQuery bind multiple classes with the same name to a click() function? [closed]

jquery,html
I'm currently helping a friend with his e-shop and he asked me if I could help him with a jQuery function that would fire every time a user clicks the buy button, however, all buy buttons got the same class name so how can I do this? Those are the...

MS CRM 2011 IFRAME “load” event not fired

jquery,iframe,dynamics-crm-2011,dynamics-crm,onload
I have MS CRM 2011 (5.0.9690.2243, on demand) HTML web resource which loads entity inside IFRAME: <HTML> <HEAD> <SCRIPT type=text/javascript src="http://code.jquery.com/jquery-latest.min.js"></SCRIPT> <SCRIPT> $(document).ready(function(){ if (window.console) console.log('doc ready'); var f=$("#m4_ifr_entity"); f.bind('load', function() { if (window.console) console.log('iframe loaded'); // do some stuff here }); }); </SCRIPT> <META charset=utf-8> </HEAD> <BODY contentEditable=true> <DIV...

FInd the object from x,y in iOS

ios,uiviewcontroller,coordinates
How to find which UIElement is present in the window when (x,y) coordinates is given in iOS ? I will be having a view controller with many UI elements and I will be given x,y with which I have to find the element present in the view .

Complete WordPress custom post type category tree

php,wordpress,loops,wordpress-theming
I have post type called 'sisallot', which has 5 subcategories. Lets call these subcats s1,s2,s3,s4,s5. Every subcategory has a couple of subcategories (these would then be ss1,ss2..etc.) and these ssubcategories has the final posts to get. I've added first level subcategories to my navbar. The question is: How can I...

How get back to previous activity by onBackPressed() and use new theme?

android,android-intent,themes,preferenceactivity,onbackpressed
i have an app with 3 activities:main,second,preferences. i can call preferences from main and second one.for preferences i used PreferenceActivity. i my preferences i want to change theme. but the problem is that the theme changed only when activity onCreate.. and when after changes in preferences i press BackBTN, it...

How to rebuild android test project when only having APK of the application to test (no source code)

android,apk,test-project
What I want to do: Update an android test-project What I have: 1. The APK of the application under test (aut) - no source code 2. The source code of test-project What I did: Modified (with a 3rd party app) the source code of the test-project (including the Manifest) What...

How to use websockets in Rails

ruby,ruby-on-rails-3,sockets
I'm trying to integrate web sockets into my Rails application as per this link: https://github.com/websocket-rails/websocket-rails/wiki/Installation-and-Setup I use Ruby 2.0 and Rails3. The contents of the relevant files: Gemfile: gem 'websocket-rails events.rb WebsocketRails::EventMap.describe do subscribe :awesomeness_approval, :to => ChatController, :with_method => :awesomeness_approval end development.rb ... config.middleware.delete Rack::Lock ... chat_controller.rb class ChatController...

Dynamic page. Trouble with getting data

php,html
I've got more than 20 links they look like: <div> <a href='writer.php?id=1'>1st Writer</a> <a href='writer.php?id=2'>2nd Writer</a> <a href='writer.php?id=3'>3d Writer</a> <a href='writer.php?id=4'>4th Writer</a> <a href='writer.php?id=5'>5th Writer</a> </div> How can i get "id" from each href='writer.php?id=' ' and pass it to $id writer.php? writer.php: <?$servername = "localhost"; $username = "root"; $password =...

Retrieve all latitude longitude points within x distance given an area

location,gis,latitude-longitude,postgis,geo
Given an area defined by x amount of points, I'd like to split that area in to 3 mile blocks and retrieve the center latitude longitude from each block. Here's what I mean: Area covering London: Area split in to 3 mile blocks (not perfect): And then print out the...

How can i ensure that my app support minimum Google Play Services 4.1 version?

android,google-play-services
I need to get ConnectionResult.SUCCESS when I'm checking Google Play Services availability if installed Google Play Services version is 4.1+: int code = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this); Currently I'm geting code == ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED, when Google Play Services version is 5.0.84. I know that all i need is to add some tag to manifest...

Find index of the element i am clicking on in Owl-carousal

jquery,owl-carousel
This is my html above, i am trying to get the index of which video i clicked on and i also need to get the href of the "owl-video" anchor tag. See the code below i tried. To find the a"href" i tried this, which doesn't seem to work....

How can I add data from a DataTable to a database table directly without specific prior structure in database table?

jquery,asp.net-mvc
I want to create table in database I got from excel I had tried sqlbulkcopy and many ways but they all require the fix structure in database before writing datatable is it possible to create table in database as per datatable without priror specification?

Javascript - avoiding asynchronous race condition when checking object property existence

javascript,object,asynchronous,properties,race-condition
Whilst JavaScript might not be multi-threaded, it does support asynchronous execution and whilst executions for 2 or more asynchronous bits of code might be on the same thread, the fact that an asynchronous order of events cannot be predicted, makes it possible for a race condition between asynchronous executions to...

JsonConverter to String Arrays

c#,json,json.net
From this Json file; "a": "a", "b": "b", "c": "c", "labels": "[Series A, Series B]" I use Newtonsoft.Json for desirialize: My class c#: public string a { get; set; } public string b { get; set; } public string c { get; set; } [JsonConverter(typeof(string []))] public string [] labels...

For loop iterating over growing vector

c++,loops,for-loop,dynamic,vector
My problem is, the for loop below always iterates only once. Before entering the loop, the search_list size is always 1. But the search_list vector may grow inside the loop, and should iterate respectively in case some element is added to the list. std::vector<int> search_list; search_list.clear(); search_list.push_back(first_elem); for(auto &discover :...

how to access hashtable values in powershell if hashtable is generated in a function?

powershell,powershell-v4.0
I have created a simple GUI to enter some values that are stored in a .txt file as soon as the User clicks OK. For verification I'm displaying the data of the just created file with its input in a popup window. As I want to use the data of...

logstash multiline codec with java stack trace

logging,elasticsearch,logstash,grok,logstash-grok
I am trying to parse a log file with grok. the configuration I use allows me to parse a single lined event but not if multilined (with java stack trace). #what i get on KIBANA for a single line: { "_index": "logstash-2015.02.05", "_type": "logs", "_id": "mluzA57TnCpH-XBRbeg", "_score": null, "_source": {...

Meteor: show something on button click

javascript,jquery,meteor
I got a problem in Meteor. I want to show and hide a part of a template when I click a button (Like revealing a answer to a question e.g). The problem is that this part of the template is created dynamically and I just want to reveal the answer...

Java: Sorting (Items in ArrayList by their Properties

java,android,class,sorting,arraylist
I have objects of type "Product" and an ArrayList of type 'Product' that contains multiple Product Objects. Product String ProductID; int ProductRating; I want to traverse the ArrayList and sort these Products by their ProductRating; Highest to Lowest, such that the first item in the ArrayList contains the Highest rating...

What is the preferable way to get the I/O of another console program in Perl?

perl
It seems there are 2 ways to get the I/O of another program in Perl, one is surround the program with arguments by `, the other is using open like below, any difference between these 2 and which one is preferred? # 2 options to get the I/O of another...

Drop tables without rows

sql-server-2008,tsql,stored-procedures
I wrote this code: SELECT o.name FROM sysobjects o,sysindexes i WHERE ( o.type = 'U' and o.id = i.id and i.indid in (0,1) and i.rows = 0 ) order by o.name GO Whould you please help me to drop those empty tables?...

FuelPHP: Cascading Delete Not Working

php,fuelphp
I have two tables. One is category and that category has MANY nominations. Table Category protected static $_has_many = array( 'nominations' => array( 'key_from' => 'id', 'key_to' => 'category_id', 'model_to' => 'Model_Nominations', 'cascade_save' => true, 'cascade_delete'=> true ) ); Table Nominations protected static $_belongs_to = array( 'categories' => array( 'key_from'...

RxJava + retrofit, get a List and add extra info for each item

android,polling,retrofit,observable,rx-java
I'm playing around with RXJava, retrofit in Android. I'm trying to accomplish the following: I need to poll periodically a call that give me a Observable> (From here I could did it) Once I get this list I want to iterate in each Delivery and call another methods that will...

issue in display Date in different format with one string value android

java,android,date,date-format,simpledateformat
Hello friends i have one string value for date like "2015-02-04" and below is my code Date todaysDate = new java.util.Date("2015-02-07"); SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat df2 = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss"); SimpleDateFormat df3 = new SimpleDateFormat("dd-MMM-yyyy"); SimpleDateFormat df4 = new SimpleDateFormat("MM dd, yyyy"); SimpleDateFormat df5 = new SimpleDateFormat("E, MMM...

Sum an Alias Column that already has a calcualtion in it

sql,sql-server
quite stuck here. I need to get the % Margin of an Alias column and its bugging me I'm not getting it right, and it is probably so simple. My query below is what I am using and I have created the column Profit by subtracting OH.TotalSellPrice from OH.TotalCostPrice columns....

onmouseover executes on inner elements

javascript,jquery
I have a div which is a wrapper for some text: <div class="timeSpanWrapper" data-occupied="false"> <span>@day.ToString("HH:mm", new System.Globalization.CultureInfo("da-DK"))</span> </div> When I put the mouse over the wrapper, I want to execute a function: $(".timeSpanWrapper").on("mouseover", function (evt) { if (evt.ctrlKey) { setTimeSlot($(this)); } }); The function gets executed, but it also gets...

PHP traverse category subcategory tree array into a custom 2D array

php,arrays,recursion,tree,tree-traversal
I have an parent child array similar to this: Array ( [0] => Array ( [category_id] => 1 [category_name] => Home & Garden [parent_id] => 0 [level] => 1 ) [1] => Array ( [category_id] => 2 [category_name] => Kitchen & Dining [parent_id] => 1 [level] => 2 ) [2]...