[Solved] js: check if 2 elements has the same class and do something

If I understand correctly, when div.element1 is clicked on, you want find div.element1 on object2 and if it exists scroll to it. You can usee something like this: $(“.object1 > div”).click(function (){ var class = $(this).attr(“class”); if ($(“.object2 > div.” + class).length > 0){ var matchingDivOn2ndObject = $(“.object2 > div.” + class)[0]; $(‘html, body’).animate({ scrollTop: … Read more

[Solved] How to upload my webpage files into wordpress? [closed]

You could actually add it to wordpress theme: 1) Converte your index.php into a page template for the theme in wordpress (more information in: http://codex.wordpress.org/Page_Templates ) 2) Upload the files to your theme directory. 3) Create a page named “launch” in your wordpress administration. Select the template page your just created, save and its done … Read more

[Solved] Sorting the array using keys [closed]

Two things are important here. You need to preserve the key to value relationship. That implies that you use array sorting functions like uasort() instead of usort(). The next thing is, that you have to use a user-defined sorting function, which expresses your sorting algo. It describes how you want to sort your routes. It’s … Read more

[Solved] Matlab/Excel/R: Transforming an unbalanced dataset depending on value of column [closed]

A solution in Matlab: A = [1 5; 1 5; 1 6; 2 4; 2 2; 3 8; 3 4]; nMaxDays = max(A(:, 1)); nMaxSamples = max(accumarray(A(:, 1), 1)); mnSamplesMatrix = nan(nMaxSamples, nMaxDays); for (nDay = unique(A(:, 1))’) vnThisDay = A(A(:, 1) == nDay, 2); mnSamplesMatrix(1:numel(vnThisDay), nDay) = vnThisDay; end 0 solved Matlab/Excel/R: Transforming an … Read more

[Solved] show leave record in each month

Please use field value as a column name then you can easily solved this. Use below query: SELECT leaves.id, SUM( CASE WHEN (leaves.type=”Annual”) THEN leaves.noOfDays ELSE NULL END ) AS Annual, SUM( CASE WHEN (leaves.type=”Casual”) THEN leaves.noOfDays ELSE NULL END ) AS Casual, SUM( CASE WHEN (leaves.type=”Medical” ) THEN leaves.noOfDays ELSE NULL END ) AS … Read more

[Solved] How to put a hex value into a 24 bit struct

If you have control of your input format, i.e. you can guarantee it will always be something like 0xabc, then you can try: const char input[] = “0xabc”; uint32_t tmp; sscanf(input, “0x%x”, &tmp); struct cmd cmdid; cmdid.a = (tmp & 0xFF0000U) >> 16; cmdid.b = (tmp & 0xFF00U) >> 8; cmdid.c = (tmp & 0xFFU); … Read more

[Solved] How to filter data based on maximum datetime value in each day [closed]

With data like: public class Data { public String Name { get; set; } public DateTime TimeStamp { get; set; } public Data(String name, DateTime timeStamp) { this.Name = name; this.TimeStamp = timeStamp; } public override string ToString() { return String.Format(“{0} at {1}”, this.Name, this.TimeStamp); } } You can use: var source = new Data[] … Read more

[Solved] Html5 page structure issue

To start with, you need to contain your content with a width. Have an example! In this example I am giving the body a width the same as your logo image (939px). margin: 0 auto; will center the page. Your question is too broad to give you an exact solution. body{ margin: 0 auto; font-family: … Read more

[Solved] MySQL Select from three tables [closed]

something like this? QUERY: SELECT country, profession, MAX(money) AS money FROM ( SELECT u.country, g.profession, SUM(um.money) AS money FROM user_money um JOIN users u ON u.id = um.user_id JOIN groups g ON g.id = um.group_id GROUP BY g.profession, u.country ORDER BY um.money DESC ) t GROUP BY country ORDER BY money DESC SEE DEMO OUTPUT: … Read more

[Solved] stored procedures instead of forms

You’re describing Web Forms, which is another part of ASP.NET, but not part of ASP.NET MVC. The calling of stored procedures has nothing to do with any of these technologies. Some people choose to put such calls in their Controller or Code-Behind rather than having it in a separate data layer. 2 solved stored procedures … Read more