w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Multiple Grids to achieve Nested Grids functionality
Subscribe to select (http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.Panel-event-select) event of the TB1 and then filter store associated TB2 with whatever filter criteria you need - this way second grid will be automatically filtered to the records you need to show.

Categories : Extjs

How to send files and data from form with multiple divs and multiple dynamic elements as shown below?
Maybe this way will be better $(document).ready(function() { // submitting $('#upload-form').on('submit', function() { // get values var answer = $("#album_name").val(); // if empty if(answer == '') { alert('write album name'); } else { // ajax $.ajax({ url: $(this).attr('action'), // path for submit (upload.php) type: $(this).attr('method'), // here is post data: $(this).serialize(), // put all values into $_POST success: function(html) { // I get answer from upload.php alert(html); } }); } return false; // for not submitting the form }); });

Categories : PHP

Writing XMP Metadata in jpeg (with PHP) - Using Single or Multiple rdf:Description blocks
About RDF It appears that what Photoshop is doing is reading a valid, well formed, RDF/XML serialization of some data, and then displaying it back to the user in UI in another valid, well-formed, RDF/XML serialization that happens to follow some additional conventions. RDF is a graph-based data representation. The fundamental piece of knowledge in RDF is the triple, also called a statement. Each triple has a subject, a predicate, and an object. Subjects, predicates, and objects may all be IRI references; subjects and objects can also be blank nodes, and objects may also be literals (e.g., a string). RDF/XML is one particular serialization of RDF. The RDF/XML snippet: <rdf:Description rdf:about="" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"> <photoshop:Instruc

Categories : PHP

Multiple file upload & json object in a single POST Request on Play Framework
Found the way to do it..posting it in case someone else tries to do something similar in the future. So first of all the request from RestSharp client must be done in the following way: public async Task<string> DoPostRequestWithAttachmentsAsync(String ext, JSonWriter jsonObject, ObservableCollection<byte[]> attachments) { var client = new RestClient(DefaultUri); var request = new RestRequest(ext, Method.POST); request.RequestFormat = DataFormat.Json; request.AddParameter("json", jsonObject.ToString(), ParameterType.GetOrPost); // add files to upload foreach (var a in attachments) request.AddFile("attachment", a, "someFileName"); var content = await client.GetResponseAsync(request); if (content.StatusCode != HttpStatusCode.OK)

Categories : Json

How to send multiple sms messages as response to Twilio's single request
Twilio evangelist here. Are you asking how to send multiple messages back in response to an incoming message? If thats the case, you can just include multiple <Sms> verbs in your response: <Response> <Sms>Message One</Sms> <Sms>Message Two</Sms> </Response> This tells Twilio to send two messages back to the number that send the inbound message. Hope that helps.

Categories : Asp Net Web Api

Exporting Data From Multiple DataGridViews on a Form to Multiple Excel Sheets in a Single Excel File
Maybe you need to add more sheets before you can access Sheet at index 2 int count = workbook.Worksheets.Count; Excel.Worksheet addedSheet = workbook.Worksheets.Add(Type.Missing, workbook.Worksheets[count], Type.Missing, Type.Missing);

Categories : C#

Multiple text fields in single div with jQuery dynamic form
Your script only updates the first input, you need to loop through and update all inputs in the cloned div $('#btnAdd').click(function () { var num = $('.clonedInput').length; var newNum = num + 1; var newElem = $('#input' + num).clone().attr('id', 'input' + newNum); newElem.find(':input').each(function () { $(this).attr('id', $(this).attr('id').replace(/d+/, newNum)); $(this).attr('name', $(this).attr('name').replace(/d+/, newNum)); }); $('#input' + num).after(newElem); $('#btnDel').attr('disabled', ''); if (newNum == 5) $('#btnAdd').attr('disabled', 'disabled'); });

Categories : Javascript

Dynamic multiple/single activesheet referencering for scatterchart plotting
Sub ChartUSA() Dim MultiSel As Range Dim cht As Chart If TypeName(Selection) <> "Range" Then Exit Sub Set cht = Sheets("ChartUSASX").ChartObjects("Chart USA").Chart For Each MultiSel In Selection.Cells With cht.SeriesCollection.NewSeries .Name = "=" & RangeAddress(MultiSel) .XValues = "=" & RangeAddress(MultiSel.Offset(0, 1)) .Values = "=" & RangeAddress(MultiSel.Offset(0, 2)) .MarkerSize = 10 .ApplyDataLabels With .DataLabels .ShowSeriesName = True .ShowValue = False End With .MarkerSize = 10 End With Next End Sub Function RangeAddress(rng As Range) As String RangeAddress = "'" & rng.Parent.Na

Categories : Vba

Unable to send data multiple requests in a single connection — socket error
The connection was closed because you called conn.getresponse() and the server closed it. There isn't much that you can do about it from your side of the connection aside from passing a Connection: keep-alive header and hope that the server will comply. If you want to send another HTTP request, you have to start with conn.putrequest("POST", path) or something similar.

Categories : Python

PayPal jscript: Single form: send multiple items with dropdown quantities = 0?
The undefined_quantity variable is only available to Buy Now buttons - not cart buttons. It's used to determine whether or not an item has a changeable quantity. Where the buyer can pick the amount of items they want to purchase on the checkout page. The variable I believe you're looking for is quantity_x. The value would determine the number of items the buyer is purchasing.

Categories : HTML

Send multiple records via json to php mysql
You can write the list of data to String, then send it to php url. In php json_decode to read the list of data; public static class Entity{ private String name; private String price; private String description; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } } @Test public void send() throws Exce

Categories : Java

ExtJs - How to load json file using extjs with the Ext.Ajax.request method?
If data is not specified, and if autoLoad is true or an Object, this store's load method is automatically called after creation.Either set autoLoad to false or use proxy with type ajax and reader and then a callback function to handle your json data. Update : Try this Ext.define('app.store.Students', { extend: 'Ext.data.Store', model: 'app.model.Student', storeId: 'StudentData', autoLoad: true, proxy: { type: 'ajax', url: 'app/data/users.json', reader:{ type: 'json', root: 'student1'//If you are using student1 as root. } }

Categories : Ajax

Using one context menu strip with multiple grids
You can use the ContextMenuStrip.SourceControl to access to the control popping up the Context menu, of course when you right-click on your grid, SourceControl will be your grid: private void deleteToolStripMenuItem_Click(object sender, EventArgs e){ GridView view = contextMenuStrip1.SourceControl as GridView;//Not sure if it's GridView or GridControl, you may want to try it yourself (I'm not familiar with DevExpress) //.... //.... }

Categories : C#

Single JSON to Fetch Multiple Records
Since your json data starts with square brace means its a jsonarray and you need to parse it start with jsonarray. This code may help you.. JSONArray array = new JSONArray("Your_json_string"); for(int i=0;i<array.length();i++){ System.out.println("id:"+array.getJSONObject(i).getString("id")); System.out.println("name:"+array.getJSONObject(i).getString("name")); System.out.println("album:"+array.getJSONObject(i).getString("album")); JSONArray innerArray = getJSONObject(i)..getJSONArray("songs"); for(int k=0;k<innerArray.length();k++){ JsonObject innerObj = innerArray.getJSONObject(k); System.out.println("id:"+innerObj.getString("id")); System.out.println("Name:"+innerObj.getString("name")); System.out.println("duration:"

Categories : Android

keeping grids spaced in python when using multiple frames
The simplest solution is to give all three columns in the top frame an equal weight. That means that each will fill up an equal amount of extra space. As written in the question the first column is defined to take up all of the extra horizontal space. You'll also want to use tkinter Label widgets rather than ttk label widgets if you want this to work cross-platform. On the mac, for instance, the background is ignored for the ttk widgets. For me, when I have widgets laid out in a single row or single column I find that pack works best. However, make the changes I suggest and grid works fine, too. Grid is really great for laying things out in a grid, obviously, but it does mean that you have to take the extra steps of assigning weights to your rows and columns if you want everything to

Categories : Python

How to add multiple json values in a single cell of dataTable
Prior to DataTables 1.10.x, you could use the mRender parameter like this: "aoColumns":[ {"mData":"LastName", "sClass":"left", "mRender":function(data, type, full){ return full.FirstName + full.LastName + full.MiddleInitial; } }, {"mData":"ServiceDate","sClass":"left"}, {"mData":"ChargeAndDx","sClass":"left"}, {"mData":"BillingProvider","sClass":"left"}, {"mData":"null","sClass":"center","sDefaultContent":"<a href='' class='editor_menu'>menu</a>"} ] Starting from DataTables 1.10.x, you could use the columns.render property like this: "columns":[ {"data":"LastName", "className":"left", "render":function(data, type, full, meta){ return full.FirstName + full.LastName + full.MiddleInitial; } }, {"data":"Ser

Categories : Jquery

SQL query to create a single record view of multiple records - Dynamic Stored Procedure?
You would USE FOR XML_PATH in SQL Server. A workaround for GROUP_CONCAT SELECT U.UID, U.EMAIL, stuff( ( select cast(',' as varchar(max)) + name + '=' + Value from USER_META WHERE UID = U.UID for xml path('') ), 1, 1, '') AS M FROM USERS U SQL Fiddle

Categories : SQL

Two Grids on Same Page Extjs 4
You have your widget alias wrong. It should look like this: alias: 'widget.customerlist' Not xtype! You use xtype: 'customerlist' like you are in both Table N Columns which is a reference to the widget alias 'widget.customerlist'. The definition for the widget needs to change.

Categories : Extjs

Send multiple arrays and a string using json from ajax to php and receiving them on php
Your code syntax is wrong data: JSON.stringify(mycol:mycol,mycolval:mycolval,string:string), should be data: JSON.stringify({mycol:mycol,mycolval:mycolval,string:string}), You might want also want to specify the content type since you're sending JSON contentType: 'application/json', then you can access you data $postdata = json_decode(file_get_contents("php://input"), true); $mycol = $postdata['mycol']; though I am skeptical you actually want to send json but rather url encoded key value pairs so you can access them via $_POST['mycol'] etc, if so use data: {mycol:mycol,mycolval:mycolval,string:string}, instead. Also $("#"+inputs[i].id).val() could be simplified into inputs[i].value

Categories : PHP

How to access multiple json objects send in array django
While this is very old I found myself searching for this exact problem... I found a way that works although I feel it is a bit unreliable Javascript: var rows = []; $('.some_class').each(function(){ var id = $(this).attr('data-id'); var something = $(this).attr('data-something'); var item = {}; item["id"] = id; item["something"] = something; rows.push(JSON.stringify(item)); }); arr = rows.join("/"); ajax_req = $.ajax({ url: '../some_url/', type: "POST", data: {req_arr : arr}, }); views.py items = request.POST.get('req_arr', None) items = str(items).split("/") for i in range(0, len(items)): item = json.loads(items[i]) id = item['id'] something = item['something']

Categories : Javascript

Parsing single json entry to multiple objects with Gson
The way to make Gson understand it is to write a custom deserializer by creating a TypeAdapter for your Test class. You can find information in Gson's User Guide. It is not exactly a manual parsing, but it is not that different, since you have to tell Gson how to deal with each JSON value... It should be something like this: private class TestDeserializer implements JsonDeserializer<Test> { public Test deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject obj = json.getAsJsonObject(); int id = obj.get("id").getAsInt(); String name = obj.get("name").getAsString(); double distance = obj.get("param_distance").getAsDouble(); int sampling = obj.get("param_sampling").getAsInt(); //assumin

Categories : Java

populate multiple select boxes with single json string
var stuff = [{"servername":"svrA"},{"servername":"svrB"},{"servername":"svrC"},{"location":"locA"},{"location":"locB"},{"location":"locC"}]; var elems = { "servername": jQuery('#select-server'), "location": jQuery('#select-location') }; stuff.forEach(function(item){ for(var selectName in elems){ if(typeof item[selectName] != 'undefined'){ var val = item[selectName]; elems[selectName].append(jQuery('<option/>').val(val).html(val)); } } }); Not that forEach is not available on older browsers. The code above is just a sample for you to work with.

Categories : Javascript

How to plot multiple lines in a single graph using HighChart with JSON
It doesnt work, because highcharts ise timestamps (time in miliseconds), so dates like "2013-06-27 20:28:04" are incorrect. "valueint":40" have extra quate. In case when you have push object, you need to have y parameter with value, instead of custom name.

Categories : Json

Collect multiple forms data as JSON with Javascript and send via AJAX to PHP
JSON keys and values must be enclosed on double quotes: '{ "key": "value1", "key2": "value2", "object": { "prop": "value" } }' "{ "key": "value1", "key2": "value2", "object": { "prop": "value" } }" After a successful decode on PHP, you should use it as an object, not an array: $class = json_decode('{ "key": "value", "sclass": { "name": "abc", "surname": "xyz" } }'); echo $class->key; // = value echo $class->sclass; // Error: cannot convert std class to string echo $class->sclass->name; // = abc

Categories : PHP

How to send an array of strings in JSON to create multiple objects in Rails?
Base64 is a red-herring (something that can confuse an argument) so let's put that aside for a minute. JSON is capable of representing an array, so that's the place to start, because you want two of something. Pretending that we're doing what JavaScript and the browser would do is easy: require 'json' ary = ['content for box one', 'content for box two'] puts JSON[ary] # >> ["content for box one","content for box two"] At this point we have the same sort of base string that JavaScript would create for an array containing two ASCII strings. For this part of the test, it's inconsequential whether it's ASCII or binary. Note that JSON left the content of the strings in the array alone. We can use the BASE64 encoding inside those strings and know that JSON will leave it alone: puts

Categories : Ruby On Rails

ExtJS ComboBox dynamic JSON updates
I tried your code and it works with the below change and it is not required to call store.loadData var data = []; data.push({id: options[0].Id, displayField : options[0].Code + ' | ' + options[0].Description}); comboBox.store.add(data); What you have done is not the best way to map the returned JSON to your store, I have modified your code for the mappings which is the best way to do and it doesn't require you to call the load listener and manually add the records. Ext.define('ReusableComboBox', { extend: 'Ext.form.field.ComboBox', alias: 'widget.reusablecombobox', queryMode: 'local', forceSelection: true, valueField: 'id', displayField: 'displayField', autoLoad: false, initComponent: function () { if (!this.store) { var store = Ext.create('Ext.data.Store', { autoLo

Categories : Json

JSON returning multiple columns, but all values as single string. How do I get matching key-value from array?
For the JSON: {"COLUMNS":["ABC","DEF","GHI"],"DATA":[[11,27,4]]}" The property DATA is an array of arrays. Consider it like this: DATA = [a, b, c], where a, b and c are variables. The thing is that your a is another array, just as DATA is. This way DATA[0], the first element of the DATA array, is an array. How do I get DATA[0], which should be 11? The value you want is in: DATA[0][0]: Because: DATA[0] -> [11,27,4] Then: DATA[0][0] -> 11 DATA[0][1] -> 27 DATA[0][2] -> 4

Categories : Javascript

Batch file to create multiple variables from single lines in a text file
This should work: @echo off setlocal EnableDelayedExpansion set "Count=1" for /f "tokens=1,2,3,4,5,6,7 delims==: " %%A in (C:File.txt) do ( set "%%A[!Count!]=%%C" set "%%D[!Count!]=%%E" set "%%F[!Count!]=%%G" set /a "Count+=1" ) :: Call other batch script here. endlocal Example Output: COMPUTER[1]=PC COMPUTER[2]=PC2 ADDRESS[1]=154.100.1.1 ADDRESS[2]=100.100.1.1 MASK[1]=255.255.254.0 MASK[2]=255.255.254.0

Categories : Batch File

Spring batch Multithreaded processing for Single file to Multiple FIle
About multi-thread read How to set up multi-threading in Spring Batch? answer; it will point you to right direction. Also, in this sample there are some consideration about restart for CSV file Job should automatically fails if some error on thread: I have never tried, but this should be the default behaviour Spring Batch How to set time interval between each call in a Chunk tasklet can be a start. Also, official doc about Backoff Policies - When retrying after a transient failure it often helps to wait a bit before trying again, because usually the failure is caused by some problem that will only be resolved by waiting. If a RetryCallback fails, the RetryTemplate can pause execution according to the BackoffPolicy in place. Let me known if this help or how you solve problem because I'm

Categories : Multithreading

make several forms with single file inputs on change of a multiple file input using javascript
if I understood correctly, just encapsulate it in a div, then change the html content of this id, in other words: HTML: <div id='myForm' > <form action="upload.php" method="post" enctype="multipart/form-data"> <input id="selector" type="file" name="files[]" multiple> </form> </div> then you can do : $('#selector').change(function(){$('#myForm').html('<form action="upload.php" method="post" enctype="multipart/form-data"> <input id="selector" type="file" name="file </form>')});

Categories : File

read multiple json objects from a text file using json lib
If you can change the way the text file stores the data, I recommend putting all the stuff into a JSON array; that way, each file will have only a single JSON object, meaning you could parse it purely with a JSON parser.

Categories : Java

Combining multiple CSV file into a single one
Hundreds of megabytes aren't that much. Why not go for a simple approach using the csv module and collections.defaultdict: import csv from collections import defaultdict result = defaultdict(dict) fieldnames = {"ID"} for csvfile in ("file1.csv", "file2.csv", "file3.csv"): with open(csvfile, newline="") as infile: reader = csv.DictReader(infile) for row in reader: id = row.pop("ID") for key in row: fieldnames.add(key) # wasteful, but I don't care enough result[id][key] = row[key] The resulting defaultdict looks like this: >>> result defaultdict(<type 'dict'>, {'001': {'SALARY': '25', 'SCHOOLS_ATTENDED': 'my Nice School', 'NAME': 'Jhon'}, '002': {'SALARY': '40', 'SCHOOLS_ATTENDED': 'His lovely s

Categories : Python

Multiple interfaces in single file
Yes, you can fill a file with interfaces, but those interfaces cannot be public. Thus, they can only be accessible from the package they are defined in. If that's OK with you, you can collect your interfaces into a single file. Note that this might make your interface definitions harder to find.

Categories : Java

how to attach multiple files to email and send it to multiple emailid dynamically php
<?php $to = 'youraddress@example.com'; $subject = 'Test email with attachment'; //create a boundary string. It must be unique //so we use the MD5 algorithm to generate a random hash $random_hash = md5(date('r', time())); //define the headers we want passed. Note that they are separated with $headers = "From: webmaster@example.com Reply-To: webmaster@example.com"; //add boundary string and mime type specification $headers .= " Content-Type: multipart/mixed; boundary="PHP-mixed-".$random_hash."""; //read the atachment file contents into a string, //encode it with MIME base64, //and split it into smaller chunks $attachment = chunk_split(base64_encode(file_get_contents('attachment.zip'))); //define the body of the message. ob_start(); //Turn on output buffering ?

Categories : PHP

what happens when multiple processes send solr commits to single solr instance?
Check Link Locking is at a lower level than indexing and queries. Solr coordinates multi-threaded indexing and query operations in memory and a separate thread writes data to disk. There are no performance problems with multiple searches and indexes happening at the same time.

Categories : Solr

Send Multiple e-mails From File Using PHP Form
Not sure if you are reading the file correctly - I've never seen it done that way. This way should work: $i=1; $file = fopen($emails_file, "r") or exit("Unable to open file!"); while(!feof($file)) { $email=fgets($file); $email=trim($email); // remove "<" and ">" from each email $email=substr($email,1,strlen($email)-2); // Next line is the one sending the email: the key command of this script mail ($email, $subject, $message,"From: $from_email Reply-To: $replyto Content- Type: text/plain"); // Each time an email is send, output it print $i . ") sending message to: " . $email . " "; if( ($i % 10)==0 ) { sleep(1); } $i++; } fclose($file);

Categories : PHP

Best way to upload multiple files as part of a REST API? Single or multiple POST requests?
To do this, you'd need your client to upload in mime/multipart format. I don't know PHP, but I'm sure there's a library out there that will support receiving/parsing the multipart messages you get. As for whether it's a good idea .. If initiating the request is the creation of a single resource, it's not unreasonable to accept mime/multipart. If the parts being sent are themselves full-fledged resources, it would probably be better to make the client send them up separately, and reference them in the initiation request. Also note that mime/multipart is going to be a bit harder for your clients to deal with than simple requests. This post seems to be related to what you're trying to accomplish.

Categories : Api

Addressing multiple instances of SQLiteOpenHelper when there are multiple Content Providers for a single database
All you need is to make sure that you share one instance of SQLiteDatabase , SQLite automatically takes care of locking for same database. To make a database globally available, extend Application class: public class App extends Application { private static SQLiteDatabase db; public static SQLiteDatabase getDb() { return db; } @Override public void onCreate() { super.onCreate(); db = new MySQLiteOpenHelper(getApplicationContext()).getWritableDatabase(); } } and add it to manifest: <application android:name=".App" Now, you can access the database from any Activity/Fragment/Service by calling App.getDb()

Categories : Android

Qt. How to send multiple simultaneous requests from multiple proxy servers
QNetworkAccessManager supports multiple concurrent requests, there's no need for you to use multithreading directly unless that makes things easier on your end. To track multiple subsequent requests belonging to each other, I'd suggest to use the Command Pattern to group them: Each flow of communication to one of the proxies would be managed by a job object. See this other answer where I describe why I find the command pattern useful, in a very similar context.

Categories : Qt

Database Design: Multiple User Entities. Single or Multiple Tables
Option 1 looks better to me. It will simplify your code when you don't care to distinguish students from coaches, and will be pretty much the same as option 2 if you want to distinguish them. If you really need to validate the foreign keys you can use triggers to check if its a coach or not. I'm not sure what you mean by "Potential polymorphism issues and the need to normalise down the track.".

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.